diff --git a/angular.json b/angular.json index d456ab4..a5689c7 100644 --- a/angular.json +++ b/angular.json @@ -35,6 +35,7 @@ "scripts": [ "node_modules/echarts/dist/echarts.js", "src/assets/mTokenK1/mToken_K1.js", + "src/assets/kmap/kmap-service-main-kd.js", "./node_modules/swiper/js/swiper.min.js", "src/assets/chartstheme/westeros.js", "src/assets/chartstheme/walden.js", @@ -62,8 +63,8 @@ "budgets": [ { "type": "initial", - "maximumWarning": "8mb", - "maximumError": "8mb" + "maximumWarning": "18mb", + "maximumError": "18mb" }, { "type": "anyComponentStyle", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index e0c2b10..e82830c 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -30,7 +30,6 @@ const routes: Routes = [ {path:'keyUnit',loadChildren:() => import('./key-unit/key-unit.module').then(m => m.KeyUnitModule)}, {path:'planManagement',loadChildren:() => import('./plan-management/plan-management.module').then(m => m.PlanManagementModule)}, {path:'planAudit',loadChildren:() => import('./plan-audit/plan-audit.module').then(m => m.PlanAuditModule)}, - {path:'home',loadChildren:() => import('./pages/pages.module').then(m => m.PagesModule)}, {path:'visualization',component: HomeComponent}, {path:'gis',loadChildren:() => import('./gis-management/gis-management.module').then(m => m.GISManagementModule)}, {path:'statisticanalysis',loadChildren:() => import('./statistic-analysis/statistic-analysis.module').then(m => m.StatisticAnalysisModule)}, diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 3a08e63..7e1f764 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,58 +1,60 @@ -import { Component } from '@angular/core'; +import { Component, Inject, Injector } from '@angular/core'; import { HttpClient } from '@angular/common/http' import { Data } from './interface' -import { Router,ActivatedRoute } from '@angular/router' -import {CacheTokenService} from './http-interceptors/cache-token.service'//引入服务 +import { Router, ActivatedRoute } from '@angular/router' +import { CacheTokenService } from './http-interceptors/cache-token.service'//引入服务 import { MaskLayerService } from './mask-layer.service'; - +import * as global from 'globals'; @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.scss'] + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.scss'] }) export class AppComponent { - constructor(private maskLayerService:MaskLayerService,private http:HttpClient,private router:Router,public token:CacheTokenService) { } - - isMaskLayerShow:boolean = false - - ngOnInit(): void { - - //监听遮罩层 - this.maskLayerService.getMessage().subscribe((message: any)=>{ - this.isMaskLayerShow = message - }); - var token = sessionStorage.getItem("token"); - var refreshToken = sessionStorage.getItem("refreshToken"); - if(token && refreshToken) { - this.http.post('/api/Account/RefreshToken', { - token: token, - refreshToken: refreshToken - }).subscribe((data: Data) => { - sessionStorage.setItem("level",data.level); - sessionStorage.setItem("token",data.token); - sessionStorage.setItem("refreshToken",data.refreshToken); - this.token.startUp() - }) - } - // console.log(1234,document.documentElement.clientWidth) - function addMeta(name,content){//手动添加mate标签 - - let meta = document.createElement('meta'); - -     meta.content=content; - -     meta.name=name; - -     document.getElementsByTagName('head')[0].appendChild(meta); - + constructor(private maskLayerService: MaskLayerService, private http: HttpClient, private router: Router, public token: CacheTokenService, private injector: Injector) { + global.injector = injector; } - if(document.documentElement.clientWidth < 800){ - addMeta('viewport','initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no,uc-fitscreen=yes,viewport-fit=cover') + + isMaskLayerShow: boolean = false + + ngOnInit(): void { + + //监听遮罩层 + this.maskLayerService.getMessage().subscribe((message: any) => { + this.isMaskLayerShow = message + }); + var token = sessionStorage.getItem("token"); + var refreshToken = sessionStorage.getItem("refreshToken"); + if (token && refreshToken) { + this.http.post('/api/Account/RefreshToken', { + token: token, + refreshToken: refreshToken + }).subscribe((data: Data) => { + sessionStorage.setItem("level", data.level); + sessionStorage.setItem("token", data.token); + sessionStorage.setItem("refreshToken", data.refreshToken); + this.token.startUp() + }) + } + // console.log(1234,document.documentElement.clientWidth) + function addMeta(name, content) {//手动添加mate标签 + + let meta = document.createElement('meta'); + + meta.content = content; + + meta.name = name; + + document.getElementsByTagName('head')[0].appendChild(meta); + + } + if (document.documentElement.clientWidth < 800) { + addMeta('viewport', 'initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no,uc-fitscreen=yes,viewport-fit=cover') + } } - } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 673c961..ddd0fc8 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -2,7 +2,7 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { MatButtonModule } from '@angular/material/button'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatIconModule } from '@angular/material/icon'; @@ -15,8 +15,8 @@ import { FormsModule } from '@angular/forms'; import { UiModule } from './ui/ui.module'; import { HttpClientModule } from '@angular/common/http'; import { httpInterceptorProviders } from './http-interceptors/index' -import {CacheTokenService} from './http-interceptors/cache-token.service' -import { TreeService } from'./http-interceptors/tree.service'; +import { CacheTokenService } from './http-interceptors/cache-token.service' +import { TreeService } from './http-interceptors/tree.service'; import { MTokenK1Component } from './m-token-k1/m-token-k1.component' //K1秘钥 import { CountdownModule } from 'ngx-countdown'; //倒计时插件 import { GISManagementModule } from './gis-management/gis-management.module'; @@ -24,34 +24,36 @@ import { DataCollectionModule } from './data-collection/data-collection.module'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { TestComponent } from './test/test.component'; import { ExternalLinksPlanComponent } from './external-links-plan/external-links-plan.component'; +import { SearchDownList } from '../modules/map/declare/component/SearchDownListPlugins/SearchDownList'; @NgModule({ - declarations: [ - AppComponent, - HomeComponent, - MTokenK1Component, - TestComponent, - ExternalLinksPlanComponent - ], - imports: [ - BrowserModule, - AppRoutingModule, - BrowserAnimationsModule, - MatButtonModule, - MatCheckboxModule, - MatSidenavModule, - NavigationModule, - MatIconModule, - PagesModule, - FormsModule, - HttpClientModule, - CountdownModule, - GISManagementModule, - DataCollectionModule, - MatProgressSpinnerModule, - UiModule - ], - providers: [httpInterceptorProviders, CacheTokenService,TreeService], - bootstrap: [AppComponent] + declarations: [ + AppComponent, + HomeComponent, + MTokenK1Component, + TestComponent, + ExternalLinksPlanComponent, + SearchDownList + ], + imports: [ + BrowserModule, + AppRoutingModule, + BrowserAnimationsModule, + MatButtonModule, + MatCheckboxModule, + MatSidenavModule, + NavigationModule, + MatIconModule, + PagesModule, + FormsModule, + HttpClientModule, + CountdownModule, + GISManagementModule, + DataCollectionModule, + MatProgressSpinnerModule, + UiModule + ], + providers: [httpInterceptorProviders, CacheTokenService, TreeService], + bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/data-collection/data-collection.module.ts b/src/app/data-collection/data-collection.module.ts index 50060c8..a689ae4 100644 --- a/src/app/data-collection/data-collection.module.ts +++ b/src/app/data-collection/data-collection.module.ts @@ -1,46 +1,46 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import {A11yModule} from '@angular/cdk/a11y'; -import {DragDropModule} from '@angular/cdk/drag-drop'; -import {PortalModule} from '@angular/cdk/portal'; -import {ScrollingModule} from '@angular/cdk/scrolling'; -import {CdkStepperModule} from '@angular/cdk/stepper'; -import {CdkTableModule} from '@angular/cdk/table'; -import {CdkTreeModule} from '@angular/cdk/tree'; -import {MatAutocompleteModule} from '@angular/material/autocomplete'; -import {MatBadgeModule} from '@angular/material/badge'; -import {MatBottomSheetModule} from '@angular/material/bottom-sheet'; -import {MatButtonModule} from '@angular/material/button'; -import {MatButtonToggleModule} from '@angular/material/button-toggle'; -import {MatCardModule} from '@angular/material/card'; -import {MatCheckboxModule} from '@angular/material/checkbox'; -import {MatChipsModule} from '@angular/material/chips'; -import {MatStepperModule} from '@angular/material/stepper'; -import {MatDatepickerModule} from '@angular/material/datepicker'; -import {MatDialogModule} from '@angular/material/dialog'; -import {MatDividerModule} from '@angular/material/divider'; -import {MatExpansionModule} from '@angular/material/expansion'; -import {MatGridListModule} from '@angular/material/grid-list'; -import {MatIconModule} from '@angular/material/icon'; -import {MatInputModule} from '@angular/material/input'; -import {MatListModule} from '@angular/material/list'; -import {MatMenuModule} from '@angular/material/menu'; -import {MatNativeDateModule, MatRippleModule, MatOption} from '@angular/material/core'; -import {MatPaginatorModule} from '@angular/material/paginator'; -import {MatProgressBarModule} from '@angular/material/progress-bar'; -import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; -import {MatRadioModule} from '@angular/material/radio'; -import {MatSelectModule} from '@angular/material/select'; -import {MatSidenavModule} from '@angular/material/sidenav'; -import {MatSliderModule} from '@angular/material/slider'; -import {MatSlideToggleModule} from '@angular/material/slide-toggle'; -import {MatSnackBarModule} from '@angular/material/snack-bar'; -import {MatSortModule} from '@angular/material/sort'; -import {MatTableModule} from '@angular/material/table'; -import {MatTabsModule} from '@angular/material/tabs'; -import {MatToolbarModule} from '@angular/material/toolbar'; -import {MatTooltipModule} from '@angular/material/tooltip'; -import {MatTreeModule} from '@angular/material/tree'; +import { A11yModule } from '@angular/cdk/a11y'; +import { DragDropModule } from '@angular/cdk/drag-drop'; +import { PortalModule } from '@angular/cdk/portal'; +import { ScrollingModule } from '@angular/cdk/scrolling'; +import { CdkStepperModule } from '@angular/cdk/stepper'; +import { CdkTableModule } from '@angular/cdk/table'; +import { CdkTreeModule } from '@angular/cdk/tree'; +import { MatAutocompleteModule } from '@angular/material/autocomplete'; +import { MatBadgeModule } from '@angular/material/badge'; +import { MatBottomSheetModule } from '@angular/material/bottom-sheet'; +import { MatButtonModule } from '@angular/material/button'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatCardModule } from '@angular/material/card'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatChipsModule } from '@angular/material/chips'; +import { MatStepperModule } from '@angular/material/stepper'; +import { MatDatepickerModule } from '@angular/material/datepicker'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { MatGridListModule } from '@angular/material/grid-list'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatListModule } from '@angular/material/list'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatNativeDateModule, MatRippleModule, MatOption } from '@angular/material/core'; +import { MatPaginatorModule } from '@angular/material/paginator'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatRadioModule } from '@angular/material/radio'; +import { MatSelectModule } from '@angular/material/select'; +import { MatSidenavModule } from '@angular/material/sidenav'; +import { MatSliderModule } from '@angular/material/slider'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatSortModule } from '@angular/material/sort'; +import { MatTableModule } from '@angular/material/table'; +import { MatTabsModule } from '@angular/material/tabs'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatTreeModule } from '@angular/material/tree'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { DataCollectionRoutingModule } from './data-collection.routing'; import { AddWater, WaterCollectionComponent } from './water-collection/water-collection.component'; @@ -49,55 +49,55 @@ import { AddLinkageForce, LinkageForcesComponent, ViewDetails2 } from './linkage import { NzTreeModule } from 'ng-zorro-antd/tree'; @NgModule({ - declarations: [WaterCollectionComponent, FireForceComponent, LinkageForcesComponent,AddWater,AddFireForce,ViewDetails,AddLinkageForce,ViewDetails2], - imports: [ - CommonModule, - A11yModule, - CdkStepperModule, - CdkTableModule, - CdkTreeModule, - DragDropModule, - MatAutocompleteModule, - MatBadgeModule, - MatBottomSheetModule, - MatButtonModule, - MatButtonToggleModule, - MatCardModule, - MatCheckboxModule, - MatChipsModule, - MatStepperModule, - MatDatepickerModule, - MatDialogModule, - MatDividerModule, - MatExpansionModule, - MatGridListModule, - MatIconModule, - MatInputModule, - MatListModule, - MatMenuModule, - MatNativeDateModule, - MatPaginatorModule, - MatProgressBarModule, - MatProgressSpinnerModule, - MatRadioModule, - MatRippleModule, - MatSelectModule, - MatSidenavModule, - MatSliderModule, - MatSlideToggleModule, - MatSnackBarModule, - MatSortModule, - MatTableModule, - MatTabsModule, - MatToolbarModule, - MatTooltipModule, - MatTreeModule, - PortalModule, - ScrollingModule, - FormsModule, - ReactiveFormsModule, - DataCollectionRoutingModule, - NzTreeModule - ] + declarations: [WaterCollectionComponent, FireForceComponent, LinkageForcesComponent, AddWater, AddFireForce, ViewDetails, AddLinkageForce, ViewDetails2], + imports: [ + CommonModule, + A11yModule, + CdkStepperModule, + CdkTableModule, + CdkTreeModule, + DragDropModule, + MatAutocompleteModule, + MatBadgeModule, + MatBottomSheetModule, + MatButtonModule, + MatButtonToggleModule, + MatCardModule, + MatCheckboxModule, + MatChipsModule, + MatStepperModule, + MatDatepickerModule, + MatDialogModule, + MatDividerModule, + MatExpansionModule, + MatGridListModule, + MatIconModule, + MatInputModule, + MatListModule, + MatMenuModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressBarModule, + MatProgressSpinnerModule, + MatRadioModule, + MatRippleModule, + MatSelectModule, + MatSidenavModule, + MatSliderModule, + MatSlideToggleModule, + MatSnackBarModule, + MatSortModule, + MatTableModule, + MatTabsModule, + MatToolbarModule, + MatTooltipModule, + MatTreeModule, + PortalModule, + ScrollingModule, + FormsModule, + ReactiveFormsModule, + DataCollectionRoutingModule, + NzTreeModule + ] }) export class DataCollectionModule { } diff --git a/src/app/data-collection/fire-force/fire-force.component.ts b/src/app/data-collection/fire-force/fire-force.component.ts index ca221a7..07eff1d 100644 --- a/src/app/data-collection/fire-force/fire-force.component.ts +++ b/src/app/data-collection/fire-force/fire-force.component.ts @@ -6,11 +6,12 @@ import { Component, OnInit } from '@angular/core'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'; +import { MapFactory } from '@src/modules/map/declare/factory'; +import { IMap, IMarker, IMarkerCluster, IPlaceSearch } from '@src/modules/map/declare/map'; import { Console } from 'console'; import { TreeService } from 'src/app/http-interceptors/tree.service'; import Viewer from 'viewerjs' declare var CryptoJS -declare var AMap: any; @Component({ selector: 'app-fire-force', @@ -66,7 +67,7 @@ export class FireForceComponent implements OnInit { } } //循环渲染出所有力量markers - cluster:any //力量聚合实例 + cluster:IMarkerCluster //力量聚合实例 createMarker(list){ let markerArrcluster = [] this.cluster ? this.cluster.setData([]) : null @@ -91,11 +92,13 @@ export class FireForceComponent implements OnInit { data : item }) : null }) - this.map.plugin(["AMap.MarkerClusterer"],() => { - var gridSize = 60 - var count = markerArrcluster.length; - var _renderClusterMarker = function (context) { - var factor = Math.pow(context.count / count, 1 / 18); + + var gridSize = 60 + var count = markerArrcluster.length; + + let render = MapFactory.RenderClusterMarkerInstance(); + render.contentRender = (contextCount) => { + var factor = Math.pow(contextCount / count, 1 / 18); var div = document.createElement('div'); var Hue = 180 - factor * 180; var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; @@ -103,91 +106,94 @@ export class FireForceComponent implements OnInit { var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; div.style.backgroundColor = bgColor; - var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20); + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); div.style.width = div.style.height = size + 'px'; div.style.border = 'solid 1px ' + borderColor; div.style.borderRadius = size / 2 + 'px'; div.style.boxShadow = '0 0 5px ' + shadowColor; - div.innerHTML = context.count; + div.innerHTML = contextCount; div.style.lineHeight = size + 'px'; div.style.color = fontColor; div.style.fontSize = '14px'; div.style.textAlign = 'center'; - context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2)); - context.marker.setContent(div) - }; - var _renderMarker = (context)=>{ - var content = ``; - var offset = new AMap.Pixel(-15, -15); - context.marker.setContent(content) - context.marker.setOffset(offset) - } - this.cluster = new AMap.MarkerCluster(this.map, markerArrcluster, { - gridSize: gridSize, // 设置网格像素大小 - renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 - renderMarker: _renderMarker, // 自定义非聚合点样式 - }); - this.cluster.on('click',(e)=>{ - if(e.clusterData.length == 1){ - let node = e.clusterData[0].data - // console.log(node) - this.clearData() - this.selectedFireForce = node.fireForceDetailInfo - this.selectedFireForceId = node.fireForceDetailId - if(node.forceType != 0){//如果是其他消防力量 - this.selectedFireForceLevel = 4 + return div; + }; + render.pixelRender = (contextCount) => { + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + return MapFactory.PixelInstance(-size / 2, -size / 2); + }; + + render.contentNonRender = (src) => { + return ``; + }; + render.pixelNonRender = () => { + return MapFactory.PixelInstance(-15, -15); + } + this.cluster = MapFactory.MarkerClusterInstance(this.map, markerArrcluster, { + gridSize: gridSize, // 设置网格像素大小 + render: render //自定义聚合点样式, 自定义非聚合点样式 + }); + this.cluster.on('click',(e)=>{ + if(e.clusterData.length == 1){ + let node = e.clusterData[0].data + // console.log(node) + this.clearData() + this.selectedFireForce = node.fireForceDetailInfo + this.selectedFireForceId = node.fireForceDetailId + if(node.forceType != 0){//如果是其他消防力量 + this.selectedFireForceLevel = 4 + }else{ + this.selectedFireForceLevel = node.level + } + this.FireForceDetailInfo.stationName = node.fireForceDetailInfo.name + + if(node.fireForceDetailId){ + let type + if(node.forceType == 0){ + type = 0 }else{ - this.selectedFireForceLevel = node.level + type = 1 } - this.FireForceDetailInfo.stationName = node.fireForceDetailInfo.name - - if(node.fireForceDetailId){ - let type - if(node.forceType == 0){ - type = 0 - }else{ - type = 1 + this.isMasklayer = true + this.http.get(`/api/FireForceDetail/${type}/${node.id}`).subscribe((data:any) => { + this.isMasklayer = false + this.FireForceDetailInfo = data + if(data.location && data.location.x){//如果已经标注单位坐标 + this.positionLngLat = data.location } - this.isMasklayer = true - this.http.get(`/api/FireForceDetail/${type}/${node.id}`).subscribe((data:any) => { - this.isMasklayer = false - this.FireForceDetailInfo = data - if(data.location && data.location.x){//如果已经标注单位坐标 - this.positionLngLat = data.location - } - //相关资料 - data.relevantInfomationData ? this.AttachmentArr = JSON.parse(data.relevantInfomationData) : null + //相关资料 + data.relevantInfomationData ? this.AttachmentArr = JSON.parse(data.relevantInfomationData) : null - if(node.forceType == 0 && node.level == 0){ - this.ZongpersonCountData = JSON.parse(data.personCountData) || this.ZongpersonCountData - this.ZongcontactData = JSON.parse(data.contactData) || this.ZongcontactData - } - if(node.forceType == 0 && node.level == 1){ - this.ZongpersonCountData = JSON.parse(data.personCountData) || this.ZongpersonCountData - this.ZhicontactData = JSON.parse(data.contactData) || this.ZhicontactData - } - if(node.forceType == 0 && (node.level == 2 || node.level == 3)){ - this.DaZhongpersonCountData = JSON.parse(data.personCountData) || this.DaZhongpersonCountData - this.DaZhongcontactData = JSON.parse(data.contactData) || this.DaZhongcontactData - } - if(node.forceType != 0){ - this.otherpersonCountData = JSON.parse(data.personCountData) || this.otherpersonCountData - this.othercontactData = JSON.parse(data.contactData) || this.otherpersonCountData - } - }) - - } - //寻找管辖单位 - this.allFireForceList.forEach(item => { - if(item.id == node.parentId){ - this.superior.name = item.name - this.superior.code = item.code + if(node.forceType == 0 && node.level == 0){ + this.ZongpersonCountData = JSON.parse(data.personCountData) || this.ZongpersonCountData + this.ZongcontactData = JSON.parse(data.contactData) || this.ZongcontactData + } + if(node.forceType == 0 && node.level == 1){ + this.ZongpersonCountData = JSON.parse(data.personCountData) || this.ZongpersonCountData + this.ZhicontactData = JSON.parse(data.contactData) || this.ZhicontactData + } + if(node.forceType == 0 && (node.level == 2 || node.level == 3)){ + this.DaZhongpersonCountData = JSON.parse(data.personCountData) || this.DaZhongpersonCountData + this.DaZhongcontactData = JSON.parse(data.contactData) || this.DaZhongcontactData + } + if(node.forceType != 0){ + this.otherpersonCountData = JSON.parse(data.personCountData) || this.otherpersonCountData + this.othercontactData = JSON.parse(data.contactData) || this.otherpersonCountData } }) + } - }) - }); - + //寻找管辖单位 + this.allFireForceList.forEach(item => { + if(item.id == node.parentId){ + this.superior.name = item.name + this.superior.code = item.code + } + }) + } + },this) + + } ngOnInit(): void { this.getAllFireForce() @@ -317,10 +323,10 @@ export class FireForceComponent implements OnInit { if(data.location && data.location.x){//如果已经标注单位坐标 this.positionLngLat = data.location this.map.setCenter([data.location.x,data.location.y]); - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [data.location.x,data.location.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }) // 将 markers 添加到地图 this.map.add(this.newPositionMarker); @@ -793,8 +799,8 @@ export class FireForceComponent implements OnInit { this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.isGisTopBox = false } - map:any - placeSearch:any//构造地点查询类 + map:IMap + placeSearch: IPlaceSearch//构造地点查询类 isMapLabel:boolean = false //是否已经标记坐标 newPositionMarkerContent:any = '
' + @@ -806,9 +812,9 @@ export class FireForceComponent implements OnInit { '
|
' + '
' //创建地图 - newPositionMarker:any//坐标实例 + newPositionMarker:IMarker//坐标实例 createMap(){ - this.map = new AMap.Map('container', { + this.map = MapFactory.MapInstance('container', { zoom:12 }) this.map.setCity('上海市'); @@ -816,16 +822,14 @@ export class FireForceComponent implements OnInit { var autoOptions = { input: "tipinput" }; - AMap.plugin(['AMap.PlaceSearch','AMap.AutoComplete'], ()=>{ - let auto = new AMap.AutoComplete(autoOptions); - this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类 - auto.on("select", (e)=>{ - this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) - this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat} - this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点 - });//注册监听,当选中某条记录时会触发 + let auto = MapFactory.AutocompleteInstance(autoOptions,this); + this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类 + auto.on("select", (e)=>{ + this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) + this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat} + this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点 + });//注册监听,当选中某条记录时会触发 - }); } //点击位置 isGisTopBox:boolean = false // @@ -845,26 +849,26 @@ export class FireForceComponent implements OnInit { }else{ center = this.map.getCenter(); //获取当前地图中心位置 } - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ draggable: true, position: center, content: this.newPositionMarkerContentBtn, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.positionLngLat = {x: center.lng || center[0], y: center.lat || center[1]} this.map.add(this.newPositionMarker); this.isMapLabel = true this.newPositionMarker.on('dragend', (e)=>{ this.positionLngLat = {x: e.lnglat.lng, y: e.lnglat.lat} - }) + },this) //点击确定 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{ this.isGisTopBox = false this.map.remove(this.newPositionMarker) - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.positionLngLat.x,this.positionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat)) this.map.add(this.newPositionMarker); @@ -878,10 +882,10 @@ export class FireForceComponent implements OnInit { this.positionLngLat = {} this.atLastPositionLngLat = {} }else{ - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点 this.map.add(this.newPositionMarker); @@ -891,10 +895,10 @@ export class FireForceComponent implements OnInit { this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'touchstart',(event)=>{ this.isGisTopBox = false this.map.remove(this.newPositionMarker) - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.positionLngLat.x,this.positionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat)) this.map.add(this.newPositionMarker); @@ -908,10 +912,10 @@ export class FireForceComponent implements OnInit { this.positionLngLat = {} this.atLastPositionLngLat = {} }else{ - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点 this.map.add(this.newPositionMarker); @@ -1143,25 +1147,13 @@ export class FireForceComponent implements OnInit { } if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){ let fetchUrl = item.objectName - let json={ - doc: { - docId: new Date(), - title: item.fileName, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl - }, - user: { - uid: "test", - nickName: "test", - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + }else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) } if(suffix == 'mp4'){ const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去 diff --git a/src/app/data-collection/linkage-forces/linkage-forces.component.ts b/src/app/data-collection/linkage-forces/linkage-forces.component.ts index dab0e22..92c2a83 100644 --- a/src/app/data-collection/linkage-forces/linkage-forces.component.ts +++ b/src/app/data-collection/linkage-forces/linkage-forces.component.ts @@ -10,8 +10,10 @@ import { NzTreeNode } from 'ng-zorro-antd/tree'; import { TreeService } from 'src/app/http-interceptors/tree.service'; import Viewer from 'viewerjs' import Swiper from 'swiper'; +import { MapFactory } from '@src/modules/map/declare/factory'; +import { IMap, IMarker } from '@src/modules/map/declare/map'; declare var CryptoJS -declare var AMap: any; + @Component({ selector: 'app-linkage-forces', templateUrl: './linkage-forces.component.html', @@ -124,11 +126,13 @@ export class LinkageForcesComponent implements OnInit { }) } }) - this.map.plugin(["AMap.MarkerClusterer"],() => { - var gridSize = 60 - var count = markerArrcluster.length; - var _renderClusterMarker = function (context) { - var factor = Math.pow(context.count / count, 1 / 18); + + var gridSize = 60 + var count = markerArrcluster.length; + + let render = MapFactory.RenderClusterMarkerInstance(); + render.contentRender = (contextCount) => { + var factor = Math.pow(contextCount / count, 1 / 18); var div = document.createElement('div'); var Hue = 180 - factor * 180; var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; @@ -136,40 +140,44 @@ export class LinkageForcesComponent implements OnInit { var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; div.style.backgroundColor = bgColor; - var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20); + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); div.style.width = div.style.height = size + 'px'; div.style.border = 'solid 1px ' + borderColor; div.style.borderRadius = size / 2 + 'px'; div.style.boxShadow = '0 0 5px ' + shadowColor; - div.innerHTML = context.count; + div.innerHTML = contextCount; div.style.lineHeight = size + 'px'; div.style.color = fontColor; div.style.fontSize = '14px'; div.style.textAlign = 'center'; - context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2)); - context.marker.setContent(div) - }; - var _renderMarker = (context)=> { - var content = ``; - var offset = new AMap.Pixel(-15, -15); - context.marker.setContent(content) - context.marker.setOffset(offset) - } - this.cluster = new AMap.MarkerCluster(this.map, markerArrcluster, { - gridSize: gridSize, // 设置网格像素大小 - renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 - renderMarker: _renderMarker, // 自定义非聚合点样式 - }); - this.cluster.on('click',(e)=>{ - if(e.clusterData.length == 1){ - let item = e.clusterData[0].data - this.clearData() - this.LinkageForceDetailInfo = item - item.location?this.positionLngLat = item.location:null - this.AttachmentArr = JSON.parse(item.relevantInfomationData) - } - }) + return div; + }; + render.pixelRender = (contextCount) => { + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + return MapFactory.PixelInstance(-size / 2, -size / 2); + }; + + render.contentNonRender = (src) => { + return ``; + }; + render.pixelNonRender = () => { + return MapFactory.PixelInstance(-15, -15); + } + + this.cluster = MapFactory.MarkerClusterInstance(this.map, markerArrcluster, { + gridSize: gridSize, // 设置网格像素大小 + render: render //自定义聚合点样式, 自定义非聚合点样式 }); + this.cluster.on('click',(e)=>{ + if(e.clusterData.length == 1){ + let item = e.clusterData[0].data + this.clearData() + this.LinkageForceDetailInfo = item + item.location?this.positionLngLat = item.location:null + this.AttachmentArr = JSON.parse(item.relevantInfomationData) + } + },this) + } ngOnInit(): void { @@ -251,10 +259,10 @@ export class LinkageForcesComponent implements OnInit { } if(item.location && item.location.x){//如果已经标注单位坐标 this.map.setCenter([item.location.x,item.location.y]); - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [item.location.x,item.location.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }) // 将 markers 添加到地图 this.map.add(this.newPositionMarker); @@ -512,7 +520,7 @@ export class LinkageForcesComponent implements OnInit { this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.isGisTopBox = false } - map:any + map:IMap placeSearch:any//构造地点查询类 isMapLabel:boolean = false //是否已经标记坐标 newPositionMarkerContent:any = @@ -525,9 +533,9 @@ export class LinkageForcesComponent implements OnInit { '
|
' + '' //创建地图 - newPositionMarker:any//坐标实例 + newPositionMarker:IMarker//坐标实例 createMap(){ - this.map = new AMap.Map('container', { + this.map = MapFactory.MapInstance('container', { zoom:12 }) this.map.setCity('上海市'); @@ -535,16 +543,14 @@ export class LinkageForcesComponent implements OnInit { var autoOptions = { input: "tipinput" }; - AMap.plugin(['AMap.PlaceSearch','AMap.AutoComplete'], ()=>{ - let auto = new AMap.AutoComplete(autoOptions); - this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类 - auto.on("select", (e)=>{ - this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) - this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat} - this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点 - });//注册监听,当选中某条记录时会触发 + let auto = MapFactory.AutocompleteInstance(autoOptions,this); + this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类 + auto.on("select", (e)=>{ + this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) + this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat} + this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点 + });//注册监听,当选中某条记录时会触发 - }); } //点击位置 isGisTopBox:boolean = false // @@ -564,26 +570,26 @@ export class LinkageForcesComponent implements OnInit { }else{ center = this.map.getCenter(); //获取当前地图中心位置 } - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ draggable: true, position: center, content: this.newPositionMarkerContentBtn, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.positionLngLat = {x: center.lng || center[0], y: center.lat || center[1]} this.map.add(this.newPositionMarker); this.isMapLabel = true this.newPositionMarker.on('dragend', (e)=>{ this.positionLngLat = {x: e.lnglat.lng, y: e.lnglat.lat} - }) + },this) //点击确定 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{ this.isGisTopBox = false this.map.remove(this.newPositionMarker) - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.positionLngLat.x,this.positionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat)) this.map.add(this.newPositionMarker); @@ -597,10 +603,10 @@ export class LinkageForcesComponent implements OnInit { this.positionLngLat = {} this.atLastPositionLngLat = {} }else{ - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点 this.map.add(this.newPositionMarker); @@ -611,10 +617,10 @@ export class LinkageForcesComponent implements OnInit { this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'touchstart',(event)=>{ this.isGisTopBox = false this.map.remove(this.newPositionMarker) - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.positionLngLat.x,this.positionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat)) this.map.add(this.newPositionMarker); @@ -628,10 +634,10 @@ export class LinkageForcesComponent implements OnInit { this.positionLngLat = {} this.atLastPositionLngLat = {} }else{ - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点 this.map.add(this.newPositionMarker); @@ -867,25 +873,13 @@ export class LinkageForcesComponent implements OnInit { } if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){ let fetchUrl = item.objectName - let json={ - doc: { - docId: new Date(), - title: item.fileName, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl - }, - user: { - uid: "test", - nickName: "test", - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + }else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) } if(suffix == 'mp4'){ const dialogRef = this.dialog.open(ViewDetails2, {//调用open方法打开对话框并且携带参数过去 diff --git a/src/app/data-collection/water-collection/water-collection.component.ts b/src/app/data-collection/water-collection/water-collection.component.ts index 56e12e2..9c0e730 100644 --- a/src/app/data-collection/water-collection/water-collection.component.ts +++ b/src/app/data-collection/water-collection/water-collection.component.ts @@ -4,7 +4,8 @@ import { ElementRef } from '@angular/core'; import { Component, OnInit } from '@angular/core'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; -declare var AMap: any; +import { MapFactory } from '@src/modules/map/declare/factory'; +import { IMap, IMarker } from '@src/modules/map/declare/map'; @Component({ selector: 'app-water-collection', @@ -80,11 +81,13 @@ export class WaterCollectionComponent implements OnInit { }) } }) - this.map.plugin(["AMap.MarkerClusterer"],() => { - var gridSize = 60 - var count = markerArrcluster.length; - var _renderClusterMarker = function (context) { - var factor = Math.pow(context.count / count, 1 / 18); + + var gridSize = 60 + var count = markerArrcluster.length; + + let render = MapFactory.RenderClusterMarkerInstance(); + render.contentRender = (contextCount) => { + var factor = Math.pow(contextCount / count, 1 / 18); var div = document.createElement('div'); var Hue = 180 - factor * 180; var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; @@ -92,46 +95,49 @@ export class WaterCollectionComponent implements OnInit { var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; div.style.backgroundColor = bgColor; - var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20); + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); div.style.width = div.style.height = size + 'px'; div.style.border = 'solid 1px ' + borderColor; div.style.borderRadius = size / 2 + 'px'; div.style.boxShadow = '0 0 5px ' + shadowColor; - div.innerHTML = context.count; + div.innerHTML = contextCount; div.style.lineHeight = size + 'px'; div.style.color = fontColor; div.style.fontSize = '14px'; div.style.textAlign = 'center'; - context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2)); - context.marker.setContent(div) - }; - var _renderMarker = (context)=> { - var content = ``; - context.marker.setContent(content) - var offset = new AMap.Pixel(-15, -15); - context.marker.setOffset(offset) - } - this.cluster = new AMap.MarkerCluster(this.map, markerArrcluster, { - gridSize: gridSize, // 设置网格像素大小 - renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 - renderMarker: _renderMarker, // 自定义非聚合点样式 - }); - this.cluster.on('click',(e)=>{ - if(e.clusterData.length == 1){ - let item = e.clusterData[0].data - // console.log(item) - this.selectedLiIndex = null - this.clearData() - this.selectedWaterTypeIndex = item.waterSourceType//点击的水源类型 - this.waterData = item - item.waterSourceType == 0 && item.detailData ? this.fireCockData = JSON.parse(item.detailData) : null - item.waterSourceType == 1 && item.detailData ? this.poolData = JSON.parse(item.detailData) : null - item.waterSourceType == 2 && item.detailData ? this.naturalWaterData = JSON.parse(item.detailData) : null - this.positionLngLat = item.location - } - }) + return div; + }; + render.pixelRender = (contextCount) => { + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + return MapFactory.PixelInstance(-size / 2, -size / 2); + }; + + render.contentNonRender = (src) => { + return ``; + }; + render.pixelNonRender = () => { + return MapFactory.PixelInstance(-15, -15); + } + this.cluster = MapFactory.MarkerClusterInstance(this.map, markerArrcluster, { + gridSize: gridSize, // 设置网格像素大小 + render: render //自定义聚合点样式, 自定义非聚合点样式 }); - + this.cluster.on('click',(e)=>{ + if(e.clusterData.length == 1){ + let item = e.clusterData[0].data + // console.log(item) + this.selectedLiIndex = null + this.clearData() + this.selectedWaterTypeIndex = item.waterSourceType//点击的水源类型 + this.waterData = item + item.waterSourceType == 0 && item.detailData ? this.fireCockData = JSON.parse(item.detailData) : null + item.waterSourceType == 1 && item.detailData ? this.poolData = JSON.parse(item.detailData) : null + item.waterSourceType == 2 && item.detailData ? this.naturalWaterData = JSON.parse(item.detailData) : null + this.positionLngLat = item.location + } + },this) + + } ngOnInit(): void { // console.log(88888,navigator.userAgent) @@ -226,10 +232,10 @@ export class WaterCollectionComponent implements OnInit { if(item.location.x){//如果已经标注单位坐标 // console.log(item) this.map.setCenter([item.location.x,item.location.y]); - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [item.location.x,item.location.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }) // 将 markers 添加到地图 this.map.add(this.newPositionMarker); @@ -518,7 +524,7 @@ export class WaterCollectionComponent implements OnInit { this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.isGisTopBox = false } - map:any + map:IMap placeSearch:any//构造地点查询类 isMapLabel:boolean = false //是否已经标记坐标 newPositionMarkerContent:any = @@ -531,9 +537,9 @@ export class WaterCollectionComponent implements OnInit { '
|
' + '' //创建地图 - newPositionMarker:any//坐标实例 + newPositionMarker:IMarker//坐标实例 createMap(){ - this.map = new AMap.Map('container', { + this.map = MapFactory.MapInstance('container', { zoom:12 }) this.map.setCity('上海市'); @@ -541,16 +547,14 @@ export class WaterCollectionComponent implements OnInit { var autoOptions = { input: "tipinput" }; - AMap.plugin(['AMap.PlaceSearch','AMap.AutoComplete'], ()=>{ - let auto = new AMap.AutoComplete(autoOptions); - this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类 - auto.on("select", (e)=>{ - this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) - this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat} - this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点 - });//注册监听,当选中某条记录时会触发 + let auto = MapFactory.AutocompleteInstance(autoOptions,this); + this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类 + auto.on("select", (e)=>{ + this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) + this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat} + this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点 + });//注册监听,当选中某条记录时会触发 - }); } //点击位置 isGisTopBox:boolean = false // @@ -573,26 +577,26 @@ export class WaterCollectionComponent implements OnInit { // console.log(3) center = this.map.getCenter(); //获取当前地图中心位置 } - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ draggable: true, position: center, content: this.newPositionMarkerContentBtn, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.positionLngLat = {x: center.lng || center[0], y: center.lat || center[1]} this.map.add(this.newPositionMarker); this.isMapLabel = true this.newPositionMarker.on('dragend', (e)=>{ this.positionLngLat = {x: e.lnglat.lng, y: e.lnglat.lat} - }) + },this) //点击确定 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{ this.isGisTopBox = false this.map.remove(this.newPositionMarker) - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.positionLngLat.x,this.positionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat)) this.map.add(this.newPositionMarker); @@ -606,10 +610,10 @@ export class WaterCollectionComponent implements OnInit { this.positionLngLat = {} this.atLastPositionLngLat = {} }else{ - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点 this.map.add(this.newPositionMarker); @@ -620,10 +624,10 @@ export class WaterCollectionComponent implements OnInit { this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'touchstart',(event)=>{ this.isGisTopBox = false this.map.remove(this.newPositionMarker) - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.positionLngLat.x,this.positionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.atLastPositionLngLat = JSON.parse(JSON.stringify(this.positionLngLat)) this.map.add(this.newPositionMarker); @@ -637,10 +641,10 @@ export class WaterCollectionComponent implements OnInit { this.positionLngLat = {} this.atLastPositionLngLat = {} }else{ - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.atLastPositionLngLat.x,this.atLastPositionLngLat.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-15, -18) + offset: MapFactory.PixelInstance(-15, -18) }); this.map.setCenter([this.atLastPositionLngLat.x,this.atLastPositionLngLat.y]); //设置地图中心点 this.map.add(this.newPositionMarker); diff --git a/src/app/external-links-plan/external-links-plan.component.ts b/src/app/external-links-plan/external-links-plan.component.ts index b604c41..c3f65b8 100644 --- a/src/app/external-links-plan/external-links-plan.component.ts +++ b/src/app/external-links-plan/external-links-plan.component.ts @@ -73,38 +73,17 @@ export class ExternalLinksPlanComponent implements OnInit { iframeSrc//毕生服务器链接 src//文件存储地址 lookWord() { - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + this.fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse = JSON.parse(identityJson) - let filename: string - this.http.get(`/api/ObjectMetadata/PlanPlatform/${this.fetchUrl}`).subscribe((data: any) => { - filename = data.fileName - let json = { - doc: { - docId: docId, - title: filename, - //title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/` + this.fetchUrl - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ', 'FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - var stringjson = JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - this.src = `http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}` - this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src); - this.showType = 0 - }) + this.showType = 0 + let src + let suffix = this.fetchUrl.split('.')[this.fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = this.fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + src = `/api/Objects/PlanPlatform/` + arr.join('.') + }else if (suffix == 'pdf') { + src = `/api/Objects/PlanPlatform/` + this.fetchUrl + } + this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(src); } companyData//当前公司信息 diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.ts b/src/app/gis-management/gis-labeling/gis-labeling.component.ts index 4b428b6..52da73d 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.ts @@ -1,1154 +1,1194 @@ import { HttpClient } from '@angular/common/http'; -import { Component, OnInit ,Renderer2,ElementRef, Inject, NgZone, ViewChild } from '@angular/core'; -import { FormBuilder,FormGroup, FormControl } from '@angular/forms'; +import { Component, OnInit, Renderer2, ElementRef, Inject, NgZone, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup, FormControl } from '@angular/forms'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import { ICircle, IDriving, IMap, IMouseTool } from '@src/modules/map/declare/map'; +import { MapFactory } from '../../../modules/map/declare/factory' declare var AMap: any; declare var QRCode: any; + @Component({ - selector: 'app-gis-labeling', - templateUrl: './gis-labeling.component.html', - styleUrls: ['./gis-labeling.component.scss'] + selector: 'app-gis-labeling', + templateUrl: './gis-labeling.component.html', + styleUrls: ['./gis-labeling.component.scss'] }) export class GisLabelingComponent implements OnInit { - constructor(private elementRef: ElementRef,public renderer2: Renderer2,private http:HttpClient,public snackBar: MatSnackBar,public dialog: MatDialog,public _ngZone:NgZone,private fb: FormBuilder) { } - - //右上角div - selectedTitle:number - titleList = [ {name:'重点单位',iconImg:'/assets/images/uniticon.png'}, - {name:'水源',iconImg:'/assets/images/watericon.png'}, - {name:'消防力量',iconImg:'/assets/images/xfll.png'}, - {name:'联动力量',iconImg:'/assets/images/ldll.png'}, - {name:'测量工具',iconImg:'/assets/images/distanceicon.png'}, - {name:'图层选择',iconImg:'/assets/images/coverageicon.png'} - ] - keyUnitList:any = [] - waterList = [ - {id:'0',name:'消火栓',selected:false}, - {id:'1',name:'消防水池',selected:false}, - {id:'2',name:'天然水源',selected:false}, - ] - fireForceList = [ - {id:'0',name:'总队',selected:false}, - {id:'1',name:'支队',selected:false}, - {id:'2',name:'大队',selected:false}, - {id:'3',name:'中队(消防站)',selected:false}, - {id:'4',name:'其他消防队伍',selected:false} - ] - linkageForcesList = [ - {id:'0',name:'安监',selected:false}, - {id:'1',name:'电力局',selected:false}, - {id:'2',name:'公安',selected:false}, - {id:'3',name:'海事',selected:false}, - {id:'4',name:'环保局',selected:false}, - {id:'5',name:'交通',selected:false}, - {id:'6',name:'民政',selected:false}, - {id:'7',name:'气象局',selected:false}, - {id:'8',name:'燃气局',selected:false}, - {id:'9',name:'市政',selected:false}, - {id:'10',name:'水利',selected:false}, - {id:'11',name:'通信',selected:false}, - {id:'12',name:'医疗',selected:false}, - {id:'13',name:'应急管理',selected:false}, - {id:'14',name:'住建',selected:false} - ] - keyUnitForm : FormGroup//gis右上角重点单位表单 - watertForm : FormGroup//gis右上角水源表单 - fireForceForm : FormGroup//gis右上角消防力量表单 - linkageForcesForm : FormGroup//gis右上角联动力量表单 - - selectedUnitList:any = []//选择提交的单位 - selectedWaterList:any = []//选择提交的水源 - selectedFireForceList:any = []//选择提交的消防力量 - selectedLinkageForcesList:any = []//选择提交的联动力量 - - unitAreaDefault:any = '-1'//默认单位范围 - waterAreaDefault:any = '-1'//默认水源范围 - fireForceAreaDefault:any = '-1'//默认消防力量范围 - linkageForcesAreaDefault:any = '-1'//默认联动力量范围 - - - //获得单位循环出来的checkbox列表(formControl实例) - get units():any{ - return this.keyUnitForm.get('units') - } - get waters():any{ - return this.watertForm.get('waters') - } - get fireForce():any{ - return this.fireForceForm.get('fireForce') - } - get linkageForces():any{ - return this.linkageForcesForm.get('linkageForces') - } - - async getAllBuildingType(){ - let result = await new Promise((result,reject)=>{ - this.http.get('/api/BuildingTypes/Simple').subscribe((data:any) => { - data.forEach(item => { - item.selected = false + constructor(private elementRef: ElementRef, public renderer2: Renderer2, private http: HttpClient, public snackBar: MatSnackBar, public dialog: MatDialog, public _ngZone: NgZone, private fb: FormBuilder) { } + + //右上角div + selectedTitle: number + titleList = [{ name: '重点单位', iconImg: '/assets/images/uniticon.png' }, + { name: '水源', iconImg: '/assets/images/watericon.png' }, + { name: '消防力量', iconImg: '/assets/images/xfll.png' }, + { name: '联动力量', iconImg: '/assets/images/ldll.png' }, + { name: '测量工具', iconImg: '/assets/images/distanceicon.png' }, + { name: '图层选择', iconImg: '/assets/images/coverageicon.png' } + ] + keyUnitList: any = [] + waterList = [ + { id: '0', name: '消火栓', selected: false }, + { id: '1', name: '消防水池', selected: false }, + { id: '2', name: '天然水源', selected: false }, + ] + fireForceList = [ + { id: '0', name: '总队', selected: false }, + { id: '1', name: '支队', selected: false }, + { id: '2', name: '大队', selected: false }, + { id: '3', name: '中队(消防站)', selected: false }, + { id: '4', name: '其他消防队伍', selected: false } + ] + linkageForcesList = [ + { id: '0', name: '安监', selected: false }, + { id: '1', name: '电力局', selected: false }, + { id: '2', name: '公安', selected: false }, + { id: '3', name: '海事', selected: false }, + { id: '4', name: '环保局', selected: false }, + { id: '5', name: '交通', selected: false }, + { id: '6', name: '民政', selected: false }, + { id: '7', name: '气象局', selected: false }, + { id: '8', name: '燃气局', selected: false }, + { id: '9', name: '市政', selected: false }, + { id: '10', name: '水利', selected: false }, + { id: '11', name: '通信', selected: false }, + { id: '12', name: '医疗', selected: false }, + { id: '13', name: '应急管理', selected: false }, + { id: '14', name: '住建', selected: false } + ] + keyUnitForm: FormGroup//gis右上角重点单位表单 + watertForm: FormGroup//gis右上角水源表单 + fireForceForm: FormGroup//gis右上角消防力量表单 + linkageForcesForm: FormGroup//gis右上角联动力量表单 + + selectedUnitList: any = []//选择提交的单位 + selectedWaterList: any = []//选择提交的水源 + selectedFireForceList: any = []//选择提交的消防力量 + selectedLinkageForcesList: any = []//选择提交的联动力量 + + unitAreaDefault: any = '-1'//默认单位范围 + waterAreaDefault: any = '-1'//默认水源范围 + fireForceAreaDefault: any = '-1'//默认消防力量范围 + linkageForcesAreaDefault: any = '-1'//默认联动力量范围 + + + //获得单位循环出来的checkbox列表(formControl实例) + get units(): any { + return this.keyUnitForm.get('units') + } + get waters(): any { + return this.watertForm.get('waters') + } + get fireForce(): any { + return this.fireForceForm.get('fireForce') + } + get linkageForces(): any { + return this.linkageForcesForm.get('linkageForces') + } + + async getAllBuildingType() { + let result = await new Promise((result, reject) => { + this.http.get('/api/BuildingTypes/Simple').subscribe((data: any) => { + data.forEach(item => { + item.selected = false + }) + this.keyUnitList = data + result('获取单位类型') + }) }) - this.keyUnitList = data - result('获取单位类型') - }) - }) - } - ngOnInit(): void { - window.setTimeout(()=>{ - this.mapInit() - },0) - let buildingType = this.getAllBuildingType()//获取建筑类型 - Promise.all([buildingType]).then(()=>{ - this.keyUnitForm = this.fb.group({ - units:this.buildUnits(), - allSelectedUnit:new FormControl(), - areaUnit:new FormControl() - }) - this.watertForm = this.fb.group({ - waters:this.waterUnits(), - allSelectedWater:new FormControl(), - areaWater:new FormControl() - }) - this.fireForceForm = this.fb.group({ - fireForce:this.fireForceController(), - allSelectedFireForce:new FormControl(), - areaFireForce:new FormControl() - }) - this.linkageForcesForm = this.fb.group({ - linkageForces:this.linkageForcesController(), - allSelectedLinkageForces:new FormControl(), - areaLinkageForces:new FormControl() - }) - - //将选中的push到数组 - this.units.valueChanges.subscribe(values => { - let selects:string[] = [] - values.forEach((selected:boolean,i:number) => { - selected === true && selects.push(this.keyUnitList[i].id) + } + ngOnInit(): void { + window.setTimeout(() => { + this.mapInit() + }, 0) + let buildingType = this.getAllBuildingType()//获取建筑类型 + Promise.all([buildingType]).then(() => { + this.keyUnitForm = this.fb.group({ + units: this.buildUnits(), + allSelectedUnit: new FormControl(), + areaUnit: new FormControl() + }) + this.watertForm = this.fb.group({ + waters: this.waterUnits(), + allSelectedWater: new FormControl(), + areaWater: new FormControl() + }) + this.fireForceForm = this.fb.group({ + fireForce: this.fireForceController(), + allSelectedFireForce: new FormControl(), + areaFireForce: new FormControl() + }) + this.linkageForcesForm = this.fb.group({ + linkageForces: this.linkageForcesController(), + allSelectedLinkageForces: new FormControl(), + areaLinkageForces: new FormControl() + }) + + //将选中的push到数组 + this.units.valueChanges.subscribe(values => { + let selects: string[] = [] + values.forEach((selected: boolean, i: number) => { + selected === true && selects.push(this.keyUnitList[i].id) + }); + this.selectedUnitList = selects + }) + this.waters.valueChanges.subscribe(values => { + let selects: string[] = [] + values.forEach((selected: boolean, i: number) => { + selected === true && selects.push(this.waterList[i].id) + }); + this.selectedWaterList = selects + }) + + this.fireForce.valueChanges.subscribe(values => { + let selects: string[] = [] + values.forEach((selected: boolean, i: number) => { + selected === true && selects.push(this.fireForceList[i].id) + }); + this.selectedFireForceList = selects + }) + this.linkageForces.valueChanges.subscribe(values => { + let selects: string[] = [] + values.forEach((selected: boolean, i: number) => { + selected === true && selects.push(this.linkageForcesList[i].id) + }); + this.selectedLinkageForcesList = selects + }) + this.unitSelected() + }) + } + + //构造重点单位checkbox控制器 + buildUnits() { + const arr = this.keyUnitList.map(item => { + return this.fb.control(item.selected); }); - this.selectedUnitList = selects - }) - this.waters.valueChanges.subscribe(values => { - let selects:string[] = [] - values.forEach((selected:boolean,i:number) => { - selected === true && selects.push(this.waterList[i].id) + return this.fb.array(arr); + } + //构造水源checkbox控制器 + waterUnits() { + const arr = this.waterList.map(item => { + return this.fb.control(item.selected); }); - this.selectedWaterList = selects - }) - - this.fireForce.valueChanges.subscribe(values => { - let selects:string[] = [] - values.forEach((selected:boolean,i:number) => { - selected === true && selects.push(this.fireForceList[i].id) + return this.fb.array(arr); + } + //构造消防力量checkbox控制器 + fireForceController() { + const arr = this.fireForceList.map(item => { + return this.fb.control(item.selected); }); - this.selectedFireForceList = selects - }) - this.linkageForces.valueChanges.subscribe(values => { - let selects:string[] = [] - values.forEach((selected:boolean,i:number) => { - selected === true && selects.push(this.linkageForcesList[i].id) + return this.fb.array(arr); + } + //构造联动力量checkbox控制器 + linkageForcesController() { + const arr = this.linkageForcesList.map(item => { + return this.fb.control(item.selected); }); - this.selectedLinkageForcesList = selects - }) - this.unitSelected() - }) - } - - - - //构造重点单位checkbox控制器 - buildUnits() { - const arr = this.keyUnitList.map(item => { - return this.fb.control(item.selected); - }); - return this.fb.array(arr); - } - //构造水源checkbox控制器 - waterUnits() { - const arr = this.waterList.map(item => { - return this.fb.control(item.selected); - }); - return this.fb.array(arr); - } - //构造消防力量checkbox控制器 - fireForceController() { - const arr = this.fireForceList.map(item => { - return this.fb.control(item.selected); - }); - return this.fb.array(arr); - } - //构造联动力量checkbox控制器 - linkageForcesController() { - const arr = this.linkageForcesList.map(item => { - return this.fb.control(item.selected); - }); - return this.fb.array(arr); - } - - //初始化获取勾选项 - unitSelected(){ - this.keyUnitList.forEach(item => { - if(item.selected){ - this.selectedUnitList.push(item.name) - } + return this.fb.array(arr); + } + + //初始化获取勾选项 + unitSelected() { + this.keyUnitList.forEach(item => { + if (item.selected) { + this.selectedUnitList.push(item.name) + } + }) + this.waterList.forEach(item => { + if (item.selected) { + this.selectedWaterList.push(item.name) + } + }) + this.fireForceList.forEach(item => { + if (item.selected) { + this.selectedFireForceList.push(item.name) + } + }) + this.linkageForcesList.forEach(item => { + if (item.selected) { + this.selectedLinkageForcesList.push(item.name) + } + }) + } + //地图范围圆圈---重点单位 + circle:ICircle = MapFactory.CircleInstance({ + center: null, + radius: 0, //半径 + strokeOpacity: 1, + fillOpacity: 0.4, + strokeStyle: 'dashed', + strokeDasharray: [10, 10], + // 线样式还支持 'dashed' + fillColor: '#1791fc', + zIndex: 50, }) - this.waterList.forEach(item => { - if(item.selected){ - this.selectedWaterList.push(item.name) - } + //地图范围圆圈---水源 + circleofwater:ICircle = MapFactory.CircleInstance({ + center: null, + radius: 0, //半径 + strokeOpacity: 1, + fillOpacity: 0.4, + strokeStyle: 'dashed', + strokeDasharray: [10, 10], + // 线样式还支持 'dashed' + fillColor: '#ee2200', + zIndex: 50, }) - this.fireForceList.forEach(item => { - if(item.selected){ - this.selectedFireForceList.push(item.name) - } + //地图范围圆圈---消防力量 + circleoffireForce:ICircle = MapFactory.CircleInstance({ + center: null, + radius: 0, //半径 + strokeOpacity: 1, + fillOpacity: 0.4, + strokeStyle: 'dashed', + strokeDasharray: [10, 10], + // 线样式还支持 'dashed' + fillColor: '#e830cc', + zIndex: 50, }) - this.linkageForcesList.forEach(item => { - if(item.selected){ - this.selectedLinkageForcesList.push(item.name) - } + //地图范围圆圈---联动力量 + circleoflinkageForces:ICircle = MapFactory.CircleInstance({ + center: null, + radius: 0, //半径 + strokeOpacity: 1, + fillOpacity: 0.4, + strokeStyle: 'dashed', + strokeDasharray: [10, 10], + // 线样式还支持 'dashed' + fillColor: '#f6a317', + zIndex: 50, }) - } - //地图范围圆圈---重点单位 - circle = new AMap.Circle({ - center: null, - radius: 0, //半径 - strokeOpacity: 1, - fillOpacity: 0.4, - strokeStyle: 'dashed', - strokeDasharray: [10, 10], - // 线样式还支持 'dashed' - fillColor: '#1791fc', - zIndex: 50, - }) - //地图范围圆圈---水源 - circleofwater = new AMap.Circle({ - center: null, - radius: 0, //半径 - strokeOpacity: 1, - fillOpacity: 0.4, - strokeStyle: 'dashed', - strokeDasharray: [10, 10], - // 线样式还支持 'dashed' - fillColor: '#ee2200', - zIndex: 50, - }) - //地图范围圆圈---消防力量 - circleoffireForce = new AMap.Circle({ - center: null, - radius: 0, //半径 - strokeOpacity: 1, - fillOpacity: 0.4, - strokeStyle: 'dashed', - strokeDasharray: [10, 10], - // 线样式还支持 'dashed' - fillColor: '#e830cc', - zIndex: 50, - }) - //地图范围圆圈---联动力量 - circleoflinkageForces = new AMap.Circle({ - center: null, - radius: 0, //半径 - strokeOpacity: 1, - fillOpacity: 0.4, - strokeStyle: 'dashed', - strokeDasharray: [10, 10], - // 线样式还支持 'dashed' - fillColor: '#f6a317', - zIndex: 50, - }) - - - //重点单位提交 - ketUnitSubmit(value){ - if(this.markers.length == 0){ - let paramsdata:any = { - PageSize:99999, - BuildingTypeIdList : this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] - } - this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => { - this.createUnitMarker(data.items) - }) - }else{ - this.circle.setRadius(Number(this.unitAreaDefault)) - this.circle.setCenter(this.markers[0]._position) - this.circle.setMap(this.map) - let Distance - let lnglat = new AMap.LngLat(this.selectedUnit.location.x, this.selectedUnit.location.y) // lng, lat 替换成传入的坐标 - if(this.unitAreaDefault == '0'){ - this.circle.setRadius(this.Calculationofdistance(this.map.getBounds())/2) - Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds())/2).lat - this.selectedUnit.location.y) - }else{ - Distance = Math.abs(lnglat.offset(0, this.unitAreaDefault).lat - this.selectedUnit.location.y) - } - if(this.unitAreaDefault == '-1'){//如果勾选全部 - let paramsdata:any = { - PageSize:99999, - BuildingTypeIdList : this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] + + + //重点单位提交 + ketUnitSubmit(value) { + if (this.markers.length == 0) { + let paramsdata: any = { + PageSize: 99999, + BuildingTypeIdList: this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] + } + this.http.get("/api/Companies", { params: paramsdata }).subscribe((data: any) => { + this.createUnitMarker(data.items) + }) + } else { + this.circle.setRadius(Number(this.unitAreaDefault)) + this.circle.setCenter(this.markers[0]._position) + this.circle.setMap(this.map) + let Distance + let lnglat = MapFactory.LngLatInstance(this.selectedUnit.location.x, this.selectedUnit.location.y) // lng, lat 替换成传入的坐标 + if (this.unitAreaDefault == '0') { + this.circle.setRadius(this.Calculationofdistance(this.map.getBounds()) / 2) + Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds()) / 2).lat - this.selectedUnit.location.y) + } else { + Distance = Math.abs(lnglat.offset(0, this.unitAreaDefault).lat - this.selectedUnit.location.y) + } + if (this.unitAreaDefault == '-1') {//如果勾选全部 + let paramsdata: any = { + PageSize: 99999, + BuildingTypeIdList: this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] + } + this.http.get("/api/Companies", { params: paramsdata }).subscribe((data: any) => { + data.items.forEach((i, index) => { + if (i.id == this.selectedUnit.id) { + data.items.splice(index, 1) + } + }) + this.createUnitMarker(data.items) + }) + } else { + let paramsdata: any = { + PageSize: 99999, + Lon: this.selectedUnit.location.x, + Lat: this.selectedUnit.location.y, + Distance: Distance, + BuildingTypeIdList: this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] + } + this.http.get("/api/Companies", { params: paramsdata }).subscribe((data: any) => { + data.items.forEach((i, index) => { + if (i.id == this.selectedUnit.id) { + data.items.splice(index, 1) + } + }) + this.createUnitMarker(data.items) + }) + } } - this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => { - data.items.forEach((i,index) => { - if(i.id == this.selectedUnit.id){ - data.items.splice(index,1) + } + //创建单位markers + unitCluster: any //重点单位点聚合实例 + createUnitMarker(list) { + let unitMarkerArrcluster = [] + this.unitCluster ? this.unitCluster.setData([]) : null + list.forEach((item) => { + let image + if (item.buildingTypes[0].name.indexOf('高层') != -1) { + image = '/assets/images/Highbuilding.png' + } else if (item.buildingTypes[0].name.indexOf('化工') != -1) { + image = '/assets/images/Chemicalindustry.png' + } else if (item.buildingTypes[0].name.indexOf('餐饮') != -1) { + image = '/assets/images/canyin.png' + } else if (item.buildingTypes[0].name.indexOf('厂房') != -1) { + image = '/assets/images/changfang.png' + } else if (item.buildingTypes[0].name.indexOf('储罐') != -1) { + image = '/assets/images/chuguanlei.png' + } else if (item.buildingTypes[0].name.indexOf('地下') != -1) { + image = '/assets/images/dixia.png' + } else if (item.buildingTypes[0].name.indexOf('古建筑') != -1) { + image = '/assets/images/gujianzhu.png' + } else if (item.buildingTypes[0].name.indexOf('轨道' || '地铁' || '交通') != -1) { + image = '/assets/images/guidaojiaotong.png' + } else if (item.buildingTypes[0].name.indexOf('商场' || '超市') != -1) { + image = '/assets/images/shangchangchaoshi.png' + } else if (item.buildingTypes[0].name.indexOf('隧道') != -1) { + image = '/assets/images/suidao.png' + } else if (item.buildingTypes[0].name.indexOf('危化品') != -1) { + image = '/assets/images/weihuapin.png' + } else if (item.buildingTypes[0].name.indexOf('学校' || '教育') != -1) { + image = '/assets/images/xuexiao.png' + } else if (item.buildingTypes[0].name.indexOf('医院' || '医疗') != -1) { + image = '/assets/images/yiyuan.png' + } else if (item.buildingTypes[0].name.indexOf('影' || '剧') != -1) { + image = '/assets/images/yingjuyuan.png' + } else if (item.buildingTypes[0].name.indexOf('娱乐') != -1) { + image = '/assets/images/yule.png' + } else if (item.buildingTypes[0].name.indexOf('展览' || '景点' || '景区') != -1) { + image = '/assets/images/zhanlanjianzhu.png' + } else { + image = '/assets/images/qita.png' } - }) - this.createUnitMarker(data.items) + // 用于点集合的数组 + unitMarkerArrcluster.push({ + lnglat: [item.location.x, item.location.y], + image: image, + data: item + }) }) - }else{ - let paramsdata:any = { - PageSize:99999, - Lon : this.selectedUnit.location.x, - Lat : this.selectedUnit.location.y, - Distance : Distance, - BuildingTypeIdList : this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] + + var gridSize = 60 + var count = unitMarkerArrcluster.length; + + let render = MapFactory.RenderClusterMarkerInstance(); + render.contentRender = (contextCount) => { + var factor = Math.pow(contextCount / count, 1 / 18); + var div = document.createElement('div'); + var Hue = 180 - factor * 180; + var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; + var fontColor = 'hsla(' + Hue + ',100%,90%,1)'; + var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; + var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; + div.style.backgroundColor = bgColor; + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + div.style.width = div.style.height = size + 'px'; + div.style.border = 'solid 1px ' + borderColor; + div.style.borderRadius = size / 2 + 'px'; + div.style.boxShadow = '0 0 5px ' + shadowColor; + div.innerHTML = contextCount; + div.style.lineHeight = size + 'px'; + div.style.color = fontColor; + div.style.fontSize = '14px'; + div.style.textAlign = 'center'; + return div; + }; + render.pixelRender = (contextCount) => { + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + return MapFactory.PixelInstance(-size / 2, -size / 2); + }; + + render.contentNonRender = (src) => { + return ``; + }; + render.pixelNonRender = () => { + return MapFactory.PixelInstance(-15, -15); } - this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => { - data.items.forEach((i,index) => { - if(i.id == this.selectedUnit.id){ - data.items.splice(index,1) + this.unitCluster = MapFactory.MarkerClusterInstance(this.map, unitMarkerArrcluster, { + gridSize: gridSize, // 设置网格像素大小 + render: render //自定义聚合点样式, 自定义非聚合点样式 + }); + this.unitCluster.on('click', (e) => { + if (e.clusterData.length == 1) { + let item = e.clusterData[0].data + let markerContent = + `
+
${item.name}
+
+
单位性质:
+
消防负责人:
+
+
+
防火级别:
+
消防管理人:
+
+
+
防火管辖:
+
防火监督员:
+
+
+
责任队站:
+
总建筑面积:
+
+
+
建筑信息分类:
+
总占地面积:
+
+
+
值班电话:
+
+
+
基本信息
+
导航
+
全景漫游
+
三维场景
+
查看预案
+
分享
+
+
` + // 创建一个自定义内容的 infowindow 实例 + this.infoWindow = MapFactory.InfoWindowInstance({ + position: [item.location.x, item.location.y], + offset: MapFactory.PixelInstance(0, -30), + content: markerContent, + }); + this.infoWindow.open(this.map); + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(item) })//基本信息点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(item) })//导航点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(item) })//全景漫游点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(item) })//三维场景点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(item) })//查看预案点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(item) })//分享点击事件 + } + },this) + + + } + //取消显示单位 + resetUnit() { + this.keyUnitForm.reset() + this.keyUnitForm.controls.areaUnit.setValue('-1') + this.map.remove(this.circle) + this.unitCluster ? this.unitCluster.setData([]) : null + } + + + //消防力量提交 + fireForceSubmit(value) { + if (this.markers.length == 0) { + let paramsdata: any = { + PageSize: 99999, + Levels: this.selectedFireForceList.length != 0 ? this.selectedFireForceList : -1 } - }) - this.createUnitMarker(data.items) + this.http.get("/api/CustomFireForce", { params: paramsdata }).subscribe((data: any) => { + this.createFireForceMarker(data) + }) + } else { + this.circleoffireForce.setRadius(Number(this.fireForceAreaDefault)) + this.circleoffireForce.setCenter(this.markers[0]._position) + this.circleoffireForce.setMap(this.map) + let Distance + let lnglat = MapFactory.LngLatInstance(this.selectedUnit.location.x, this.selectedUnit.location.y) // lng, lat 替换成传入的坐标 + if (this.fireForceAreaDefault == '0') { + this.circleoffireForce.setRadius(this.Calculationofdistance(this.map.getBounds()) / 2) + Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds()) / 2).lat - this.selectedUnit.location.y) + } else { + Distance = Math.abs(lnglat.offset(0, this.fireForceAreaDefault).lat - this.selectedUnit.location.y) + } + if (this.fireForceAreaDefault == '-1') {//如果勾选全部 + let paramsdata: any = { + PageSize: 99999, + Levels: this.selectedFireForceList.length != 0 ? this.selectedFireForceList : -1 + } + this.http.get("/api/CustomFireForce", { params: paramsdata }).subscribe((data: any) => { + this.createFireForceMarker(data) + }) + } else { + let paramsdata: any = { + PageSize: 99999, + Lon: this.selectedUnit.location.x, + Lat: this.selectedUnit.location.y, + Distance: Distance, + Levels: this.selectedFireForceList.length != 0 ? this.selectedFireForceList : -1 + } + this.http.get("/api/CustomFireForce", { params: paramsdata }).subscribe((data: any) => { + this.createFireForceMarker(data) + }) + } + } + } + //创建消防力量markers + fireForceCluster: any //消防力量点聚合实例 + createFireForceMarker(list) { + let fireForceMarkerArrcluster = [] + this.fireForceCluster ? this.fireForceCluster.setData([]) : null + list.forEach((item) => { + let image + if (item.forceType == 2) { + image = '/assets/fireForcesMarkers/qita.png' + } else if (item.level == 0) { + image = '/assets/fireForcesMarkers/zongdui.png' + } else if (item.level == 1) { + image = '/assets/fireForcesMarkers/zhidui.png' + } else if (item.level == 2) { + image = '/assets/fireForcesMarkers/dadui.png' + } else if (item.level == 3) { + image = '/assets/fireForcesMarkers/zhongdui.png' + } + // 用于点集合的数组 + item.fireForceDetailInfo.location ? + fireForceMarkerArrcluster.push({ + lnglat: [item.fireForceDetailInfo.location.x, item.fireForceDetailInfo.location.y], + image: image, + data: item + }) : null }) - } - } - } - //创建单位markers - unitCluster:any //重点单位点聚合实例 - createUnitMarker(list){ - let unitMarkerArrcluster = [] - this.unitCluster ? this.unitCluster.setData([]) : null - list.forEach((item) => { - let image - if(item.buildingTypes[0].name.indexOf('高层') != -1){ - image = '/assets/images/Highbuilding.png' - }else if(item.buildingTypes[0].name.indexOf('化工') != -1){ - image = '/assets/images/Chemicalindustry.png' - }else if(item.buildingTypes[0].name.indexOf('餐饮') != -1){ - image = '/assets/images/canyin.png' - }else if(item.buildingTypes[0].name.indexOf('厂房') != -1){ - image = '/assets/images/changfang.png' - }else if(item.buildingTypes[0].name.indexOf('储罐') != -1){ - image = '/assets/images/chuguanlei.png' - }else if(item.buildingTypes[0].name.indexOf('地下') != -1){ - image = '/assets/images/dixia.png' - }else if(item.buildingTypes[0].name.indexOf('古建筑') != -1){ - image = '/assets/images/gujianzhu.png' - }else if(item.buildingTypes[0].name.indexOf('轨道' || '地铁' || '交通') != -1){ - image = '/assets/images/guidaojiaotong.png' - }else if(item.buildingTypes[0].name.indexOf('商场' || '超市') != -1){ - image = '/assets/images/shangchangchaoshi.png' - }else if(item.buildingTypes[0].name.indexOf('隧道') != -1){ - image = '/assets/images/suidao.png' - }else if(item.buildingTypes[0].name.indexOf('危化品') != -1){ - image = '/assets/images/weihuapin.png' - }else if(item.buildingTypes[0].name.indexOf('学校' || '教育') != -1){ - image = '/assets/images/xuexiao.png' - }else if(item.buildingTypes[0].name.indexOf('医院' || '医疗') != -1){ - image = '/assets/images/yiyuan.png' - }else if(item.buildingTypes[0].name.indexOf('影' || '剧') != -1){ - image = '/assets/images/yingjuyuan.png' - }else if(item.buildingTypes[0].name.indexOf('娱乐') != -1){ - image = '/assets/images/yule.png' - }else if(item.buildingTypes[0].name.indexOf('展览' || '景点' || '景区') != -1){ - image = '/assets/images/zhanlanjianzhu.png' - }else{ - image = '/assets/images/qita.png' - } - // 用于点集合的数组 - unitMarkerArrcluster.push({ - lnglat : [item.location.x,item.location.y], - image : image, - data : item - }) - }) - this.map.plugin(["AMap.MarkerClusterer"],() => { - var gridSize = 60 - var count = unitMarkerArrcluster.length; - var _renderClusterMarker = function (context) { - var factor = Math.pow(context.count / count, 1 / 18); - var div = document.createElement('div'); - var Hue = 180 - factor * 180; - var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; - var fontColor = 'hsla(' + Hue + ',100%,90%,1)'; - var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; - var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; - div.style.backgroundColor = bgColor; - var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20); - div.style.width = div.style.height = size + 'px'; - div.style.border = 'solid 1px ' + borderColor; - div.style.borderRadius = size / 2 + 'px'; - div.style.boxShadow = '0 0 5px ' + shadowColor; - div.innerHTML = context.count; - div.style.lineHeight = size + 'px'; - div.style.color = fontColor; - div.style.fontSize = '14px'; - div.style.textAlign = 'center'; - context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2)); - context.marker.setContent(div) - }; - var _renderMarker = (context)=> { - var content = ``; - var offset = new AMap.Pixel(-15, -15); - context.marker.setContent(content) - context.marker.setOffset(offset) - } - this.unitCluster = new AMap.MarkerCluster(this.map, unitMarkerArrcluster, { - gridSize: gridSize, // 设置网格像素大小 - renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 - renderMarker: _renderMarker, // 自定义非聚合点样式 - }); - this.unitCluster.on('click',(e)=>{ - if(e.clusterData.length == 1){ - let item = e.clusterData[0].data - let markerContent = - `
-
${item.name}
-
-
单位性质:
-
消防负责人:
-
-
-
防火级别:
-
消防管理人:
-
-
-
防火管辖:
-
防火监督员:
-
-
-
责任队站:
-
总建筑面积:
-
-
-
建筑信息分类:
-
总占地面积:
-
-
-
值班电话:
-
-
-
基本信息
-
导航
-
全景漫游
-
三维场景
-
查看预案
-
分享
-
-
` - // 创建一个自定义内容的 infowindow 实例 - this.infoWindow = new AMap.InfoWindow({ - position: [item.location.x,item.location.y], - offset: new AMap.Pixel(0, -30), - content: markerContent, - }); - this.infoWindow.open(this.map); - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(item) })//基本信息点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(item) })//导航点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(item) })//全景漫游点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(item) })//三维场景点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(item) })//查看预案点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(item) })//分享点击事件 + + var gridSize = 60 + var count = fireForceMarkerArrcluster.length; + + let render = MapFactory.RenderClusterMarkerInstance(); + render.contentRender = (contextCount) => { + var factor = Math.pow(contextCount / count, 1 / 18); + var div = document.createElement('div'); + var Hue = 180 - factor * 180; + var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; + var fontColor = 'hsla(' + Hue + ',100%,90%,1)'; + var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; + var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; + div.style.backgroundColor = bgColor; + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + div.style.width = div.style.height = size + 'px'; + div.style.border = 'solid 1px ' + borderColor; + div.style.borderRadius = size / 2 + 'px'; + div.style.boxShadow = '0 0 5px ' + shadowColor; + div.innerHTML = contextCount; + div.style.lineHeight = size + 'px'; + div.style.color = fontColor; + div.style.fontSize = '14px'; + div.style.textAlign = 'center'; + return div; + }; + render.pixelRender = (contextCount) => { + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + return MapFactory.PixelInstance(-size / 2, -size / 2); + }; + + render.contentNonRender = (src) => { + return ``; + }; + render.pixelNonRender = () => { + return MapFactory.PixelInstance(-15, -15); } - }) - }); - - } - //取消显示单位 - resetUnit(){ - this.keyUnitForm.reset() - this.keyUnitForm.controls.areaUnit.setValue('-1') - this.map.remove(this.circle) - this.unitCluster.setData([]) - } - - - //消防力量提交 - fireForceSubmit(value){ - if(this.markers.length == 0){ - let paramsdata:any = { - PageSize:99999, - Levels : this.selectedFireForceList.length != 0 ? this.selectedFireForceList : -1 - } - this.http.get("/api/CustomFireForce",{params:paramsdata}).subscribe((data:any) => { - this.createFireForceMarker(data) - }) - }else{ - this.circleoffireForce.setRadius(Number(this.fireForceAreaDefault)) - this.circleoffireForce.setCenter(this.markers[0]._position) - this.circleoffireForce.setMap(this.map) - let Distance - let lnglat = new AMap.LngLat(this.selectedUnit.location.x, this.selectedUnit.location.y) // lng, lat 替换成传入的坐标 - if(this.fireForceAreaDefault == '0'){ - this.circleoffireForce.setRadius(this.Calculationofdistance(this.map.getBounds())/2) - Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds())/2).lat - this.selectedUnit.location.y) - }else{ - Distance = Math.abs(lnglat.offset(0, this.fireForceAreaDefault).lat - this.selectedUnit.location.y) - } - if(this.fireForceAreaDefault == '-1'){//如果勾选全部 - let paramsdata:any = { - PageSize:99999, - Levels : this.selectedFireForceList.length != 0 ? this.selectedFireForceList : -1 + this.fireForceCluster = MapFactory.MarkerClusterInstance(this.map, fireForceMarkerArrcluster, { + gridSize: gridSize, // 设置网格像素大小 + render: render //自定义聚合点样式, 自定义非聚合点样式 + }); + + } + //取消消防力量 + resetFireForce() { + this.fireForceForm.reset() + this.fireForceForm.controls.areaFireForce.setValue('-1') + this.map.remove(this.circleoffireForce) + this.fireForceCluster ? this.fireForceCluster.setData([]) : null + } + + + + + //联动力量提交 + linkageForcesSubmit(value) { + console.log(this.selectedLinkageForcesList) + if (this.markers.length == 0) { + let paramsdata: any = { + PageSize: 999999, + LinkageForceTypes: this.selectedLinkageForcesList.length != 0 ? this.selectedLinkageForcesList : -1 + } + this.http.get("/api/LinkageForces", { params: paramsdata }).subscribe((data: any) => { + console.log(data) + this.createLinkageForcesMarker(data.items) + }) + } else { + this.circleoflinkageForces.setRadius(Number(this.linkageForcesAreaDefault)) + this.circleoflinkageForces.setCenter(this.markers[0]._position) + this.circleoflinkageForces.setMap(this.map) + let Distance + let lnglat = MapFactory.LngLatInstance(this.selectedUnit.location.x, this.selectedUnit.location.y) // lng, lat 替换成传入的坐标 + if (this.linkageForcesAreaDefault == '0') { + this.circleoflinkageForces.setRadius(this.Calculationofdistance(this.map.getBounds()) / 2) + Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds()) / 2).lat - this.selectedUnit.location.y) + } else { + Distance = Math.abs(lnglat.offset(0, this.linkageForcesAreaDefault).lat - this.selectedUnit.location.y) + } + if (this.linkageForcesAreaDefault == '-1') {//如果勾选全部 + let paramsdata: any = { + PageSize: 999999, + LinkageForceTypes: this.selectedLinkageForcesList.length != 0 ? this.selectedLinkageForcesList : -1 + } + this.http.get("/api/LinkageForces", { params: paramsdata }).subscribe((data: any) => { + this.createLinkageForcesMarker(data.items) + }) + } else { + let paramsdata: any = { + PageSize: 99999, + Lon: this.selectedUnit.location.x, + Lat: this.selectedUnit.location.y, + Distance: Distance, + LinkageForceTypes: this.selectedLinkageForcesList.length != 0 ? this.selectedLinkageForcesList : -1 + } + this.http.get("/api/LinkageForces", { params: paramsdata }).subscribe((data: any) => { + this.createLinkageForcesMarker(data.items) + }) + } } - this.http.get("/api/CustomFireForce",{params:paramsdata}).subscribe((data:any) => { - this.createFireForceMarker(data) + } + //创建联动力量markers + linkageForcesCluster: any //联动力量点聚合实例 + createLinkageForcesMarker(list) { + let linkageForcesMarkerArrcluster = [] + this.linkageForcesCluster ? this.linkageForcesCluster.setData([]) : null + list.forEach((item) => { + let image + if (item.linkageForceType == 0) {//消火栓 + image = '/assets/linkageForcesMarkers/anjian.png' + } else if (item.linkageForceType == 1) {//消防水池 + image = '/assets/linkageForcesMarkers/dianliju.png' + } else if (item.linkageForceType == 2) {//天然联动力量 + image = '/assets/linkageForcesMarkers/gongan.png' + } else if (item.linkageForceType == 3) {//天然水源 + image = '/assets/linkageForcesMarkers/haishi.png' + } else if (item.linkageForceType == 4) {//天然水源 + image = '/assets/linkageForcesMarkers/huanbaoju.png' + } else if (item.linkageForceType == 5) {//天然水源 + image = '/assets/linkageForcesMarkers/jiaotong.png' + } else if (item.linkageForceType == 6) {//天然水源 + image = '/assets/linkageForcesMarkers/minzheng.png' + } else if (item.linkageForceType == 7) {//天然水源 + image = '/assets/linkageForcesMarkers/qixiangju.png' + } else if (item.linkageForceType == 8) {//天然水源 + image = '/assets/linkageForcesMarkers/ranqiju.png' + } else if (item.linkageForceType == 9) {//天然水源 + image = '/assets/linkageForcesMarkers/shizheng.png' + } else if (item.linkageForceType == 10) {//天然水源 + image = '/assets/linkageForcesMarkers/shuili.png' + } else if (item.linkageForceType == 11) {//天然水源 + image = '/assets/linkageForcesMarkers/tongxin.png' + } else if (item.linkageForceType == 12) {//天然水源 + image = '/assets/linkageForcesMarkers/yiliao.png' + } else if (item.linkageForceType == 13) {//天然水源 + image = '/assets/linkageForcesMarkers/yingjiguanli.png' + } else if (item.linkageForceType == 14) {//天然水源 + image = '/assets/linkageForcesMarkers/zhujian.png' + } + // 用于点集合的数组 + if (item.location && item.location.x) { + linkageForcesMarkerArrcluster.push({ + lnglat: [item.location.x, item.location.y], + image: image, + data: item + }) + } + // 用于点集合的数组 }) - }else{ - let paramsdata:any = { - PageSize:99999, - Lon : this.selectedUnit.location.x, - Lat : this.selectedUnit.location.y, - Distance : Distance, - Levels : this.selectedFireForceList.length != 0 ? this.selectedFireForceList : -1 + + var gridSize = 60 + var count = linkageForcesMarkerArrcluster.length; + + let render = MapFactory.RenderClusterMarkerInstance(); + render.contentRender = (contextCount) => { + var factor = Math.pow(contextCount / count, 1 / 18); + var div = document.createElement('div'); + var Hue = 180 - factor * 180; + var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; + var fontColor = 'hsla(' + Hue + ',100%,90%,1)'; + var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; + var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; + div.style.backgroundColor = bgColor; + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + div.style.width = div.style.height = size + 'px'; + div.style.border = 'solid 1px ' + borderColor; + div.style.borderRadius = size / 2 + 'px'; + div.style.boxShadow = '0 0 5px ' + shadowColor; + div.innerHTML = contextCount; + div.style.lineHeight = size + 'px'; + div.style.color = fontColor; + div.style.fontSize = '14px'; + div.style.textAlign = 'center'; + return div; + }; + render.pixelRender = (contextCount) => { + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + return MapFactory.PixelInstance(-size / 2, -size / 2); + }; + + render.contentNonRender = (src) => { + return ``; + }; + render.pixelNonRender = () => { + return MapFactory.PixelInstance(-15, -15); } - this.http.get("/api/CustomFireForce",{params:paramsdata}).subscribe((data:any) => { - this.createFireForceMarker(data) - }) - } - } - } - //创建消防力量markers - fireForceCluster:any //消防力量点聚合实例 - createFireForceMarker(list){ - let fireForceMarkerArrcluster = [] - this.fireForceCluster ? this.fireForceCluster.setData([]) : null - list.forEach((item) => { - let image - if(item.forceType == 2){ - image = '/assets/fireForcesMarkers/qita.png' - }else if(item.level == 0){ - image = '/assets/fireForcesMarkers/zongdui.png' - }else if(item.level == 1){ - image = '/assets/fireForcesMarkers/zhidui.png' - }else if(item.level == 2){ - image = '/assets/fireForcesMarkers/dadui.png' - }else if(item.level == 3){ - image = '/assets/fireForcesMarkers/zhongdui.png' - } - // 用于点集合的数组 - item.fireForceDetailInfo.location ? - fireForceMarkerArrcluster.push({ - lnglat : [item.fireForceDetailInfo.location.x,item.fireForceDetailInfo.location.y], - image : image, - data : item - }) : null - }) - this.map.plugin(["AMap.MarkerClusterer"],() => { - var gridSize = 60 - var count = fireForceMarkerArrcluster.length; - var _renderClusterMarker = function (context) { - var factor = Math.pow(context.count / count, 1 / 18); - var div = document.createElement('div'); - var Hue = 180 - factor * 180; - var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; - var fontColor = 'hsla(' + Hue + ',100%,90%,1)'; - var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; - var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; - div.style.backgroundColor = bgColor; - var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20); - div.style.width = div.style.height = size + 'px'; - div.style.border = 'solid 1px ' + borderColor; - div.style.borderRadius = size / 2 + 'px'; - div.style.boxShadow = '0 0 5px ' + shadowColor; - div.innerHTML = context.count; - div.style.lineHeight = size + 'px'; - div.style.color = fontColor; - div.style.fontSize = '14px'; - div.style.textAlign = 'center'; - context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2)); - context.marker.setContent(div) - }; - var _renderMarker = (context)=> { - var content = ``; - var offset = new AMap.Pixel(-15, -15); - context.marker.setContent(content) - context.marker.setOffset(offset) - } - this.fireForceCluster = new AMap.MarkerCluster(this.map, fireForceMarkerArrcluster, { - gridSize: gridSize, // 设置网格像素大小 - renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 - renderMarker: _renderMarker, // 自定义非聚合点样式 - }); - }); - } - //取消消防力量 - resetFireForce(){ - this.fireForceForm.reset() - this.fireForceForm.controls.areaFireForce.setValue('-1') - this.map.remove(this.circleoffireForce) - this.fireForceCluster.setData([]) - } - - - - - //联动力量提交 - linkageForcesSubmit(value){ - console.log(this.selectedLinkageForcesList) - if(this.markers.length == 0){ - let paramsdata:any = { - PageSize : 999999, - LinkageForceTypes:this.selectedLinkageForcesList.length != 0 ? this.selectedLinkageForcesList : -1 - } - this.http.get("/api/LinkageForces",{params:paramsdata}).subscribe((data:any) => { - console.log(data) - this.createLinkageForcesMarker(data.items) - }) - }else{ - this.circleoflinkageForces.setRadius(Number(this.linkageForcesAreaDefault)) - this.circleoflinkageForces.setCenter(this.markers[0]._position) - this.circleoflinkageForces.setMap(this.map) - let Distance - let lnglat = new AMap.LngLat(this.selectedUnit.location.x, this.selectedUnit.location.y) // lng, lat 替换成传入的坐标 - if(this.linkageForcesAreaDefault == '0'){ - this.circleoflinkageForces.setRadius(this.Calculationofdistance(this.map.getBounds())/2) - Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds())/2).lat - this.selectedUnit.location.y) - }else{ - Distance = Math.abs(lnglat.offset(0, this.linkageForcesAreaDefault).lat - this.selectedUnit.location.y) - } - if(this.linkageForcesAreaDefault == '-1'){//如果勾选全部 - let paramsdata:any = { - PageSize : 999999, - LinkageForceTypes:this.selectedLinkageForcesList.length != 0 ? this.selectedLinkageForcesList : -1 + + this.linkageForcesCluster = MapFactory.MarkerClusterInstance(this.map, linkageForcesMarkerArrcluster, { + gridSize: gridSize, // 设置网格像素大小 + render: render //自定义聚合点样式, 自定义非聚合点样式 + }); + + } + //取消联动力量 + resetLinkageForces() { + this.linkageForcesForm.reset() + this.linkageForcesForm.controls.areaLinkageForces.setValue('-1') + this.map.remove(this.circleoflinkageForces) + this.linkageForcesCluster ? this.linkageForcesCluster.setData([]) : null + } + + + + + + //水源提交 + waterSubmit(value) { + if (this.markers.length == 0) { + if (this.selectedWaterList.length != 0) {//勾选了水源类型 + let paramsdata: any = { + PageSize: 99999, + WaterSourceTypes: this.selectedWaterList + } + this.http.get("/api/WaterSources", { params: paramsdata }).subscribe((data: any) => { + this.createwaterMarker(data.items) + }) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请勾选想要显示的水源类型', '确定', config); + } + } else { + this.circleofwater.setRadius(Number(this.waterAreaDefault)) + this.circleofwater.setCenter(this.markers[0]._position) + this.circleofwater.setMap(this.map) + let Distance + let lnglat = MapFactory.LngLatInstance(this.selectedUnit.location.x, this.selectedUnit.location.y) // lng, lat 替换成传入的坐标 + + //如果选择当前的视野范围算出查询半径 + if (this.waterAreaDefault == '0') { + this.circleofwater.setRadius(this.Calculationofdistance(this.map.getBounds()) / 2) + Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds()) / 2).lat - this.selectedUnit.location.y) + } else { + Distance = Math.abs(lnglat.offset(0, this.waterAreaDefault).lat - this.selectedUnit.location.y) + } + //如果选择全部 + if (this.waterAreaDefault == '-1') { + if (this.selectedWaterList.length != 0) { + let paramsdata: any = { + PageSize: 99999, + WaterSourceTypes: this.selectedWaterList + } + this.http.get("/api/WaterSources", { params: paramsdata }).subscribe((data: any) => { + this.createwaterMarker(data.items) + }) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请勾选想要显示的水源类型', '确定', config); + } + + } else { + if (this.selectedWaterList.length != 0) { + let paramsdata: any = { + PageSize: 99999, + Lon: this.selectedUnit.location.x, + Lat: this.selectedUnit.location.y, + Distance: Distance, + WaterSourceTypes: this.selectedWaterList + } + this.http.get("/api/WaterSources", { params: paramsdata }).subscribe((data: any) => { + this.createwaterMarker(data.items) + }) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请勾选想要显示的水源类型', '确定', config); + } + } } - this.http.get("/api/LinkageForces",{params:paramsdata}).subscribe((data:any) => { - this.createLinkageForcesMarker(data.items) + } + //循环渲染出所有水源markers + waterCluster: any //水源聚合实例 + createwaterMarker(list) { + let waterMarkerArrcluster = [] + this.waterCluster ? this.waterCluster.setData([]) : null + list.forEach((item) => { + let image + if (item.waterSourceType == 0) {//消火栓 + image = '/assets/waterMarkers/szxhs.png' + } else if (item.waterSourceType == 1) {//消防水池 + image = '/assets/waterMarkers/fxcsc.png' + } else if (item.waterSourceType == 2) {//天然水源 + image = '/assets/waterMarkers/trsy.png' + } + // 用于点集合的数组 + waterMarkerArrcluster.push({ + lnglat: [item.location.x, item.location.y], + image: image, + data: item + }) }) - }else{ - let paramsdata:any = { - PageSize:99999, - Lon : this.selectedUnit.location.x, - Lat : this.selectedUnit.location.y, - Distance : Distance, - LinkageForceTypes:this.selectedLinkageForcesList.length != 0 ? this.selectedLinkageForcesList : -1 + + var gridSize = 60 + var count = waterMarkerArrcluster.length; + + let render = MapFactory.RenderClusterMarkerInstance(); + render.contentRender = (contextCount) => { + var factor = Math.pow(contextCount / count, 1 / 18); + var div = document.createElement('div'); + var Hue = 180 - factor * 180; + var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; + var fontColor = 'hsla(' + Hue + ',100%,90%,1)'; + var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; + var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; + div.style.backgroundColor = bgColor; + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + div.style.width = div.style.height = size + 'px'; + div.style.border = 'solid 1px ' + borderColor; + div.style.borderRadius = size / 2 + 'px'; + div.style.boxShadow = '0 0 5px ' + shadowColor; + div.innerHTML = contextCount; + div.style.lineHeight = size + 'px'; + div.style.color = fontColor; + div.style.fontSize = '14px'; + div.style.textAlign = 'center'; + return div; + }; + render.pixelRender = (contextCount) => { + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + return MapFactory.PixelInstance(-size / 2, -size / 2); + }; + + render.contentNonRender = (src) => { + return ``; + }; + render.pixelNonRender = () => { + return MapFactory.PixelInstance(-15, -15); } - this.http.get("/api/LinkageForces",{params:paramsdata}).subscribe((data:any) => { - this.createLinkageForcesMarker(data.items) - }) - } - } - } - //创建联动力量markers - linkageForcesCluster:any //联动力量点聚合实例 - createLinkageForcesMarker(list){ - let linkageForcesMarkerArrcluster = [] - this.linkageForcesCluster ? this.linkageForcesCluster.setData([]) : null - list.forEach((item) => { - let image - if(item.linkageForceType == 0){//消火栓 - image = '/assets/linkageForcesMarkers/anjian.png' - }else if(item.linkageForceType == 1){//消防水池 - image = '/assets/linkageForcesMarkers/dianliju.png' - }else if(item.linkageForceType == 2){//天然联动力量 - image = '/assets/linkageForcesMarkers/gongan.png' - }else if(item.linkageForceType == 3){//天然水源 - image = '/assets/linkageForcesMarkers/haishi.png' - }else if(item.linkageForceType == 4){//天然水源 - image = '/assets/linkageForcesMarkers/huanbaoju.png' - }else if(item.linkageForceType == 5){//天然水源 - image = '/assets/linkageForcesMarkers/jiaotong.png' - }else if(item.linkageForceType == 6){//天然水源 - image = '/assets/linkageForcesMarkers/minzheng.png' - }else if(item.linkageForceType == 7){//天然水源 - image = '/assets/linkageForcesMarkers/qixiangju.png' - }else if(item.linkageForceType == 8){//天然水源 - image = '/assets/linkageForcesMarkers/ranqiju.png' - }else if(item.linkageForceType == 9){//天然水源 - image = '/assets/linkageForcesMarkers/shizheng.png' - }else if(item.linkageForceType == 10){//天然水源 - image = '/assets/linkageForcesMarkers/shuili.png' - }else if(item.linkageForceType == 11){//天然水源 - image = '/assets/linkageForcesMarkers/tongxin.png' - }else if(item.linkageForceType == 12){//天然水源 - image = '/assets/linkageForcesMarkers/yiliao.png' - }else if(item.linkageForceType == 13){//天然水源 - image = '/assets/linkageForcesMarkers/yingjiguanli.png' - }else if(item.linkageForceType == 14){//天然水源 - image = '/assets/linkageForcesMarkers/zhujian.png' - } - // 用于点集合的数组 - if(item.location && item.location.x){ - linkageForcesMarkerArrcluster.push({ - lnglat : [item.location.x,item.location.y], - image : image, - data : item - }) - } - // 用于点集合的数组 - }) - this.map.plugin(["AMap.MarkerClusterer"],() => { - var gridSize = 60 - var count = linkageForcesMarkerArrcluster.length; - var _renderClusterMarker = function (context) { - var factor = Math.pow(context.count / count, 1 / 18); - var div = document.createElement('div'); - var Hue = 180 - factor * 180; - var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; - var fontColor = 'hsla(' + Hue + ',100%,90%,1)'; - var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; - var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; - div.style.backgroundColor = bgColor; - var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20); - div.style.width = div.style.height = size + 'px'; - div.style.border = 'solid 1px ' + borderColor; - div.style.borderRadius = size / 2 + 'px'; - div.style.boxShadow = '0 0 5px ' + shadowColor; - div.innerHTML = context.count; - div.style.lineHeight = size + 'px'; - div.style.color = fontColor; - div.style.fontSize = '14px'; - div.style.textAlign = 'center'; - context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2)); - context.marker.setContent(div) - }; - var _renderMarker = (context)=> { - var content = ``; - var offset = new AMap.Pixel(-15, -15); - context.marker.setContent(content) - context.marker.setOffset(offset) - } - this.linkageForcesCluster = new AMap.MarkerCluster(this.map, linkageForcesMarkerArrcluster, { - gridSize: gridSize, // 设置网格像素大小 - renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 - renderMarker: _renderMarker, // 自定义非聚合点样式 - }); - }); - } - //取消联动力量 - resetLinkageForces(){ - this.linkageForcesForm.reset() - this.linkageForcesForm.controls.areaLinkageForces.setValue('-1') - this.map.remove(this.circleoflinkageForces) - this.linkageForcesCluster.setData([]) - } - - - - - - //水源提交 - waterSubmit(value){ - if(this.markers.length == 0){ - if(this.selectedWaterList.length != 0){//勾选了水源类型 - let paramsdata:any = { - PageSize:99999, - WaterSourceTypes : this.selectedWaterList + + // var _renderClusterMarker = function (context) { + // var factor = Math.pow(context.count / count, 1 / 18); + // var div = document.createElement('div'); + // var Hue = 180 - factor * 180; + // var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; + // var fontColor = 'hsla(' + Hue + ',100%,90%,1)'; + // var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; + // var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; + // div.style.backgroundColor = bgColor; + // var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20); + // div.style.width = div.style.height = size + 'px'; + // div.style.border = 'solid 1px ' + borderColor; + // div.style.borderRadius = size / 2 + 'px'; + // div.style.boxShadow = '0 0 5px ' + shadowColor; + // div.innerHTML = context.count; + // div.style.lineHeight = size + 'px'; + // div.style.color = fontColor; + // div.style.fontSize = '14px'; + // div.style.textAlign = 'center'; + // context.marker.setOffset(MapFactory.PixelInstance(-size / 2, -size / 2)); + // context.marker.setContent(div) + // }; + // var _renderMarker = (context) => { + // var content = ``; + // var offset = MapFactory.PixelInstance(-15, -15); + // context.marker.setContent(content) + // context.marker.setOffset(offset) + // } + this.waterCluster = MapFactory.MarkerClusterInstance(this.map, waterMarkerArrcluster, { + gridSize: gridSize, // 设置网格像素大小 + render: render //自定义聚合点样式, 自定义非聚合点样式 + }); + + // this.waterCluster = new AMap.MarkerCluster(this.map, waterMarkerArrcluster, { + // gridSize: gridSize, // 设置网格像素大小 + // renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 + // renderMarker: _renderMarker, // 自定义非聚合点样式 + // }); + this.waterCluster.on('click', (e) => { + if (e.clusterData.length == 1) { + + } + },this) + + } + //取消显示水源 + resetWater() { + this.watertForm.reset() + this.watertForm.controls.areaWater.setValue('-1') + this.map.remove(this.circleofwater) + this.waterCluster ? this.waterCluster.setData([]) : null + } + + + //计算两地距离 + Calculationofdistance(bounds) { + let p1 = [bounds.northEast.lng, bounds.northEast.lat]; + let p2 = [bounds.northEast.lng, bounds.southWest.lat]; + // 返回 p1 到 p2 间的地面距离,单位:米 + return this.map.distance(p1, p2); + } + + //全选重点单位 + selectedAllUnit(event) { + if (event.checked) { + this.units.controls.forEach(item => { item.setValue(true) }) + } else { + this.keyUnitForm.reset() + this.keyUnitForm.controls.areaUnit.setValue('0') } - this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { - this.createwaterMarker(data.items) - }) - }else{ - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('请勾选想要显示的水源类型','确定',config); - } - }else{ - this.circleofwater.setRadius(Number(this.waterAreaDefault)) - this.circleofwater.setCenter(this.markers[0]._position) - this.circleofwater.setMap(this.map) - let Distance - let lnglat = new AMap.LngLat(this.selectedUnit.location.x, this.selectedUnit.location.y) // lng, lat 替换成传入的坐标 - - //如果选择当前的视野范围算出查询半径 - if(this.waterAreaDefault == '0'){ - this.circleofwater.setRadius(this.Calculationofdistance(this.map.getBounds())/2) - Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds())/2).lat - this.selectedUnit.location.y) - }else{ - Distance = Math.abs(lnglat.offset(0, this.waterAreaDefault).lat - this.selectedUnit.location.y) - } - //如果选择全部 - if(this.waterAreaDefault == '-1'){ - if(this.selectedWaterList.length != 0){ - let paramsdata:any = { - PageSize:99999, - WaterSourceTypes : this.selectedWaterList - } - this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { - this.createwaterMarker(data.items) - }) - }else{ - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('请勾选想要显示的水源类型','确定',config); + } + //全选水源 + selectedAllWater(event) { + if (event.checked) { + this.waters.controls.forEach(item => { item.setValue(true) }) + } else { + this.watertForm.reset() + this.watertForm.controls.areaWater.setValue('0') } - - }else{ - if(this.selectedWaterList.length != 0){ - let paramsdata:any = { - PageSize:99999, - Lon : this.selectedUnit.location.x, - Lat : this.selectedUnit.location.y, - Distance : Distance, - WaterSourceTypes :this.selectedWaterList - } - this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { - this.createwaterMarker(data.items) - }) - }else{ - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('请勾选想要显示的水源类型','确定',config); + } + //全选消防力量 + selectedAllFireForce(event) { + if (event.checked) { + this.fireForce.controls.forEach(item => { item.setValue(true) }) + } else { + this.fireForceForm.reset() + this.fireForceForm.controls.areaFireForce.setValue('0') } - } - } - } - //循环渲染出所有水源markers - waterCluster:any //水源聚合实例 - createwaterMarker(list){ - let waterMarkerArrcluster = [] - this.waterCluster ? this.waterCluster.setData([]) : null - list.forEach((item) => { - let image - if(item.waterSourceType == 0){//消火栓 - image = '/assets/waterMarkers/szxhs.png' - }else if(item.waterSourceType == 1){//消防水池 - image = '/assets/waterMarkers/fxcsc.png' - }else if(item.waterSourceType == 2){//天然水源 - image = '/assets/waterMarkers/trsy.png' - } - // 用于点集合的数组 - waterMarkerArrcluster.push({ - lnglat : [item.location.x,item.location.y], - image : image, - data : item - }) - }) - this.map.plugin(["AMap.MarkerClusterer"],() => { - var gridSize = 60 - var count = waterMarkerArrcluster.length; - var _renderClusterMarker = function (context) { - var factor = Math.pow(context.count / count, 1 / 18); - var div = document.createElement('div'); - var Hue = 180 - factor * 180; - var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; - var fontColor = 'hsla(' + Hue + ',100%,90%,1)'; - var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; - var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; - div.style.backgroundColor = bgColor; - var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20); - div.style.width = div.style.height = size + 'px'; - div.style.border = 'solid 1px ' + borderColor; - div.style.borderRadius = size / 2 + 'px'; - div.style.boxShadow = '0 0 5px ' + shadowColor; - div.innerHTML = context.count; - div.style.lineHeight = size + 'px'; - div.style.color = fontColor; - div.style.fontSize = '14px'; - div.style.textAlign = 'center'; - context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2)); - context.marker.setContent(div) - }; - var _renderMarker = (context)=> { - var content = ``; - var offset = new AMap.Pixel(-15, -15); - context.marker.setContent(content) - context.marker.setOffset(offset) - } - this.waterCluster = new AMap.MarkerCluster(this.map, waterMarkerArrcluster, { - gridSize: gridSize, // 设置网格像素大小 - renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 - renderMarker: _renderMarker, // 自定义非聚合点样式 - }); - this.waterCluster.on('click',(e)=>{ - if(e.clusterData.length == 1){ - + } + //全选联动力量 + selectedAllLinkageForces(event) { + if (event.checked) { + this.linkageForces.controls.forEach(item => { item.setValue(true) }) + } else { + this.linkageForcesForm.reset() + this.linkageForcesForm.controls.areaLinkageForces.setValue('0') } - }) - }); - - } - //取消显示水源 - resetWater(){ - this.watertForm.reset() - this.watertForm.controls.areaWater.setValue('-1') - this.map.remove(this.circleofwater) - this.waterCluster.setData([]) - } - - - //计算两地距离 - Calculationofdistance(bounds){ - let p1 = [bounds.northEast.lng, bounds.northEast.lat]; - let p2 = [bounds.northEast.lng, bounds.southWest.lat]; - // 返回 p1 到 p2 间的地面距离,单位:米 - let dis = AMap.GeometryUtil.distance(p1, p2); - return dis - } - - //全选重点单位 - selectedAllUnit(event){ - if(event.checked){ - this.units.controls.forEach(item => {item.setValue(true)}) - }else{ - this.keyUnitForm.reset() - this.keyUnitForm.controls.areaUnit.setValue('0') - } - } - //全选水源 - selectedAllWater(event){ - if(event.checked){ - this.waters.controls.forEach(item => {item.setValue(true)}) - }else{ - this.watertForm.reset() - this.watertForm.controls.areaWater.setValue('0') - } - } - //全选消防力量 - selectedAllFireForce(event){ - if(event.checked){ - this.fireForce.controls.forEach(item => {item.setValue(true)}) - }else{ - this.fireForceForm.reset() - this.fireForceForm.controls.areaFireForce.setValue('0') - } - } - //全选联动力量 - selectedAllLinkageForces(event){ - if(event.checked){ - this.linkageForces.controls.forEach(item => {item.setValue(true)}) - }else{ - this.linkageForcesForm.reset() - this.linkageForcesForm.controls.areaLinkageForces.setValue('0') - } - } - - - - - //右上角点击每一个title - clickTitle(index){ - this.selectedTitle = index - } - closertdiv(){ - this.selectedTitle = null - } - - //卫星图层 - satelliteLayer = new AMap.TileLayer.Satellite(); - satelliteModel:boolean = false - satelliteChange(e){ - e.checked ? this.map.add(this.satelliteLayer) : this.map.remove(this.satelliteLayer); - } - - //路网图层 - roadNetLayer = new AMap.TileLayer.RoadNet(); - loadModel:boolean = false - loadChange(e){ - e.checked ? this.map.add(this.roadNetLayer) : this.map.remove(this.roadNetLayer); - } - - @ViewChild( 'appLeft',{static: false} ) appLeft:any //子组件 - leftDivState:boolean = false; //左侧工作区显示隐藏 - showLeftDiv:boolean = false//左侧工作区消失 - - //左侧工作区显示隐藏 - toggleLeft (e) { - this.leftDivState = e - } - - //左侧工作区关闭 - closeDiv(){ - this.leftDivState = false - this.showLeftDiv = false - } - - map:any //地图 - markers:any = []; //markers标注 - - //地图2D 3D切换 - mapPattern:boolean = true//默认是2D - mapPatternChange(type){ - this.unitCluster = null - this.waterCluster = null - this.checkRadio = false - if(type == '2D'){ - this.mapPattern = true - this.mapInit() - }else{ - this.unitCluster ? this.unitCluster.setData([]) : null - this.mapPattern = false - this.map = new AMap.Map('map',{ - viewMode: '3D', - pitch: 60, - rotation: -35, - features: ['bg', 'road', 'point','building'], - mapStyle: 'amap://styles/light', - }); - this.map.setCity('上海市'); - } - this.satelliteModel = false - this.loadModel = false - } - - //地图初始化 - mapInit () { - let that = this - var layer = new AMap.createDefaultLayer({ - zooms:[3,20], //可见级别 - visible:true, //是否可见 - opacity:1, //透明度 - zIndex:0, //叠加层级 - resizeEnable: true //是否监控地图容器尺寸变化, - }) - that.map = new AMap.Map('map',{ - layers:[layer], //当只想显示标准图层时layers属性可缺省, - WebGLParams: { - preserveDrawingBuffer: true - } - }); - - that.map.setCity('上海市'); - AMap.plugin(["AMap.RangingTool", "AMap.MouseTool"],function () { - that.mouseTool=new AMap.MouseTool(that.map); - }); - - } - - searchText:string; //搜索单位名称 - allCompany = []; //搜索到 匹配的单位 - - measureDistance; //测距离 - distanceList = []; //测距离 点和线 - measureArea; //测面积 - mouseTool;//二合一测距和侧面积 - checkRadio=false //判断测距和侧面积是否选中 - - //测距离 开始 - startDistance(){ - this.measureArea.close(false) - this.measureDistance.turnOn() - } - - //侧面积 开始 - startArea(){ - this.measureDistance.turnOff() - this.measureArea.measureArea({ - strokeColor:'#80d8ff', - fillColor:'#80d8ff', - fillOpacity:0.3 - //同 Polygon 的 Option 设置 - }); - } - - //清空距离测量 - clearDistance(){ - this.distanceList.forEach(item=>{ - if (item.className == 'AMap.Marker') { - let parent = item.dom.parentNode - let children = item.dom.nextElementSibling - parent && children? parent.removeChild(item.dom.nextElementSibling) : null - this.map.remove(item) - } else { - this.map.remove(item) - } - }) - this.distanceList = [] //清空数组 - } - - //清空面积测量 - clearArea(){ - this.measureArea.close(true) - } - //合并测距和侧面积 - measure(type){ - switch(type){ - case 'rule':{ - this.mouseTool.rule({ - startMarkerOptions : {//可缺省 - icon: new AMap.Icon({ - size: new AMap.Size(19, 31),//图标大小 - imageSize:new AMap.Size(19, 31), - image: "https://webapi.amap.com/theme/v1.3/markers/b/start.png" - }) - }, - endMarkerOptions : {//可缺省 - icon: new AMap.Icon({ - size: new AMap.Size(19, 31),//图标大小 - imageSize:new AMap.Size(19, 31), - image: "https://webapi.amap.com/theme/v1.3/markers/b/end.png" - }), - offset: new AMap.Pixel(-9, -31) - }, - midMarkerOptions : {//可缺省 - icon: new AMap.Icon({ - size: new AMap.Size(19, 31),//图标大小 - imageSize:new AMap.Size(19, 31), - image: "https://webapi.amap.com/theme/v1.3/markers/b/mid.png" - }), - offset: new AMap.Pixel(-9, -31) - }, - lineOptions : {//可缺省 - strokeStyle: "solid", - strokeColor: "#FF33FF", - strokeOpacity: 1, - strokeWeight: 2 - } - //同 RangingTool 的 自定义 设置,缺省为默认样式 - }); - break; - } - case 'measureArea':{ - this.mouseTool.measureArea({ - strokeColor:'#80d8ff', - fillColor:'#80d8ff', - fillOpacity:0.3 + } + + + + + //右上角点击每一个title + clickTitle(index) { + this.selectedTitle = index + } + closertdiv() { + this.selectedTitle = null + } + + //卫星图层 + satelliteLayer = MapFactory.TileLayerInstance().Satellite(); + satelliteModel: boolean = false + satelliteChange(e) { + e.checked ? this.map.add(this.satelliteLayer) : this.map.remove(this.satelliteLayer); + } + + //路网图层 + roadNetLayer = MapFactory.TileLayerInstance().RoadNet(); + loadModel: boolean = false + loadChange(e) { + e.checked ? this.map.add(this.roadNetLayer) : this.map.remove(this.roadNetLayer); + } + + @ViewChild('appLeft', { static: false }) appLeft: any //子组件 + leftDivState: boolean = false; //左侧工作区显示隐藏 + showLeftDiv: boolean = false//左侧工作区消失 + + //左侧工作区显示隐藏 + toggleLeft(e) { + this.leftDivState = e + } + + //左侧工作区关闭 + closeDiv() { + this.leftDivState = false + this.showLeftDiv = false + } + + map: IMap //地图 + markers: any = []; //markers标注 + + //地图2D 3D切换 + mapPattern: boolean = true//默认是2D + mapPatternChange(type) { + this.unitCluster = null + this.waterCluster = null + this.checkRadio = false + if (type == '2D') { + this.mapPattern = true + this.mapInit() + } else { + this.unitCluster ? this.unitCluster.setData([]) : null + this.mapPattern = false + this.map = MapFactory.MapInstance('map', { + viewMode: '3D', + pitch: 60, + rotation: -35, + features: ['bg', 'road', 'point', 'building'], + mapStyle: 'amap://styles/light', + }); + this.map.setCity('上海市'); + } + this.satelliteModel = false + this.loadModel = false + } + + //地图初始化 + mapInit() { + let that = this + var layer = MapFactory.LayerInstance({ + zooms: [3, 20], //可见级别 + visible: true, //是否可见 + opacity: 1, //透明度 + zIndex: 0, //叠加层级 + resizeEnable: true //是否监控地图容器尺寸变化, + }) + that.map = MapFactory.MapInstance('map', { + layers: [layer], + WebGLParams: {preserveDrawingBuffer: true} + }); + that.map.setCity('上海市'); + that.mouseTool = MapFactory.MouseToolInstance(that.map); + + } + + searchText: string; //搜索单位名称 + allCompany = []; //搜索到 匹配的单位 + + measureDistance; //测距离 + distanceList = []; //测距离 点和线 + measureArea; //测面积 + mouseTool:IMouseTool;//二合一测距和侧面积 + checkRadio = false //判断测距和侧面积是否选中 + + //测距离 开始 + startDistance() { + this.measureArea.close(false) + this.measureDistance.turnOn() + } + + //侧面积 开始 + startArea() { + this.measureDistance.turnOff() + this.measureArea.measureArea({ + strokeColor: '#80d8ff', + fillColor: '#80d8ff', + fillOpacity: 0.3 //同 Polygon 的 Option 设置 - }); - break; - } - } - } - //合并清空 - clearnAll(){ - this.mouseTool.close(true) - this.checkRadio=false - } - - //搜索 - search () { - this.allCompany = [] - let paramsdata:any = {Name: this.searchText || ''} - this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any)=>{ - this.allCompany = data.items - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open(`搜索目标结果为${data.items.length}个`,'确定',config); - }) - } - - //清除 - clear () { - this.allCompany = [] - this.searchText = '' - this.markers ? this.markers.forEach((element,index) => { this.map.remove(element);}) : null - this.infoWindow ? this.map.remove(this.infoWindow) : null - } - - selectedUnit:any//当前打开的单位 - - //选择 单位 地图跳转 - //弹窗实例 - infoWindow:any - selectCompany (e) { - if (e.location && e.location.x && e.location.y) { - this.selectedUnit = e - this.markers.forEach((element,index) => { this.map.remove(element);}); //先删除所有标点 - this.markers = [] - - let marker = new AMap.Marker({ - map: this.map, - position: [e.location.x,e.location.y], // 基点位置, - }); - this.markers.push(marker) - - let markerContent = `
+ }); + } + + //清空距离测量 + clearDistance() { + + } + + //清空面积测量 + clearArea() { + this.measureArea.close(true) + } + //合并测距和侧面积 + measure(type) { + switch (type) { + case 'rule': { + this.mouseTool.rule({ + startMarkerOptions: {//可缺省 + icon: MapFactory.IconInstance({ + size: MapFactory.SizeInstance(19, 31),//图标大小 + imageSize: MapFactory.SizeInstance(19, 31), + image: "https://webapi.amap.com/theme/v1.3/markers/b/start.png" + }) + }, + endMarkerOptions: {//可缺省 + icon: MapFactory.IconInstance({ + size: MapFactory.SizeInstance(19, 31),//图标大小 + imageSize: MapFactory.SizeInstance(19, 31), + image: "https://webapi.amap.com/theme/v1.3/markers/b/end.png" + }), + offset: MapFactory.PixelInstance(-9, -31) + }, + midMarkerOptions: {//可缺省 + icon: MapFactory.IconInstance({ + size: MapFactory.SizeInstance(19, 31),//图标大小 + imageSize: MapFactory.SizeInstance(19, 31), + image: "https://webapi.amap.com/theme/v1.3/markers/b/mid.png" + }), + offset: MapFactory.PixelInstance(-9, -31) + }, + lineOptions: {//可缺省 + strokeStyle: "solid", + strokeColor: "#FF33FF", + strokeOpacity: 1, + strokeWeight: 2 + } + //同 RangingTool 的 自定义 设置,缺省为默认样式 + }); + break; + } + case 'measureArea': { + this.mouseTool.measureArea({ + strokeColor: '#80d8ff', + fillColor: '#80d8ff', + fillOpacity: 0.3 + //同 Polygon 的 Option 设置 + }); + break; + } + } + } + //合并清空 + clearnAll() { + this.mouseTool.close(true) + this.checkRadio = false + } + + //搜索 + search() { + this.allCompany = [] + let paramsdata: any = { Name: this.searchText || '' } + this.http.get("/api/Companies", { params: paramsdata }).subscribe((data: any) => { + this.allCompany = data.items + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open(`搜索目标结果为${data.items.length}个`, '确定', config); + }) + } + + //清除 + clear() { + this.allCompany = [] + this.searchText = '' + this.markers ? this.markers.forEach((element, index) => { this.map.remove(element); }) : null + this.infoWindow ? this.map.remove(this.infoWindow) : null + } + + selectedUnit: any//当前打开的单位 + + //选择 单位 地图跳转 + //弹窗实例 + infoWindow: any + selectCompany(e) { + if (e.location && e.location.x && e.location.y) { + this.selectedUnit = e + this.markers.forEach((element, index) => { this.map.remove(element); }); //先删除所有标点 + this.markers = [] + + let marker = MapFactory.MarkerInstance({ + map: this.map, + position: [e.location.x, e.location.y], // 基点位置, + }); + this.markers.push(marker) + + let markerContent = `
${e.name}
-
单位性质:
+
单位性质:
消防负责人:
@@ -1179,252 +1219,251 @@ export class GisLabelingComponent implements OnInit {
分享
` - // 创建一个自定义内容的 infowindow 实例 - this.infoWindow = new AMap.InfoWindow({ - position: [e.location.x,e.location.y], - offset: new AMap.Pixel(0, -30), - content: markerContent, - }); - this.infoWindow.open(this.map); - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(e) })//基本信息点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(e) })//导航点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//全景漫游点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(e) })//三维场景点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//查看预案点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(e) })//分享点击事件 - marker.on('click', (ev) => { //marker点击事件 - this.infoWindow = new AMap.InfoWindow({ - position: [e.location.x,e.location.y], - offset: new AMap.Pixel(0, -30), - content: markerContent, + // 创建一个自定义内容的 infowindow 实例 + this.infoWindow = MapFactory.InfoWindowInstance({ + position: [e.location.x, e.location.y], + offset: MapFactory.PixelInstance(0, -30), + content: markerContent, + }); + this.infoWindow.open(this.map); + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(e) })//基本信息点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(e) })//导航点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(e) })//全景漫游点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(e) })//三维场景点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(e) })//查看预案点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(e) })//分享点击事件 + marker.on('click', (ev) => { //marker点击事件 + this.infoWindow = MapFactory.InfoWindowInstance({ + position: [e.location.x, e.location.y], + offset: MapFactory.PixelInstance(0, -30), + content: markerContent, + }); + this.infoWindow.open(this.map); + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'), 'click', (event) => { this.baseInformation(e) })//基本信息点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'), 'click', (event) => { this.route(e) })//导航点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'), 'click', (event) => { this.fullViewNavigation(e) })//全景漫游点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'), 'click', (event) => { this.threeeScene(e) })//三维场景点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'), 'click', (event) => { this.seePlan(e) })//查看预案点击事件 + this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'), 'click', (event) => { this.share(e) })//分享点击事件 + }) + this.map.setZoomAndCenter(13, [marker._position[0], marker._position[1] + 0.015]); //设置地图中心点 + this.allCompany = [] + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请完善单位地理位置', '确定', config); + } + } + + //基本信息 + baseInformation(e) { + this.leftDivState = true + this.showLeftDiv = true + this.appLeft.selectBaseInfo(e) //调用子组件方法 + } + + //导航 + route(e) { + this.leftDivState = false + this.showLeftDiv = false + this.isShowRouteGIS = true + this.routeEnd = e.name + this.endCoordinate = MapFactory.LngLatInstance(e.location.x, e.location.y) + } + + //全景漫游 + fullViewNavigation(e) { + console.log(e, '全景漫游') + } + + //三维场景 + threeeScene(e) { + window.open('http://39.106.78.171:8088/%E6%BC%94%E7%A4%BA%E6%A1%88%E4%BE%8B/--SHGJHYZX/') + } + + //查看预案 + seePlan(e) { + let data = e + let dialogRef = this.dialog.open(LookPlanDialog, {//调用open方法打开对话框并且携带参数过去 + width: '1400px', + height: '800px', + id: 'lookPlanDialog', + data }); - this.infoWindow.open(this.map); - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#baseInformation'),'click',(event)=>{ this.baseInformation(e) })//基本信息点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#route'),'click',(event)=>{ this.route(e) })//导航点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#fullViewNavigation'),'click',(event)=>{ this.fullViewNavigation(e) })//全景漫游点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#threeeScene'),'click',(event)=>{ this.threeeScene(e) })//三维场景点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#seePlan'),'click',(event)=>{ this.seePlan(e) })//查看预案点击事件 - this.renderer2.listen(this.elementRef.nativeElement.querySelector('#share'),'click',(event)=>{ this.share(e) })//分享点击事件 - }) - this.map.setZoomAndCenter(13,[marker._position[0],marker._position[1]+0.015]); //设置地图中心点 - this.allCompany = [] - } else { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('请完善单位地理位置','确定',config); - } - } - - //基本信息 - baseInformation (e) { - this.leftDivState = true - this.showLeftDiv = true - this.appLeft.selectBaseInfo(e) //调用子组件方法 - } - - //导航 - route (e) { - this.leftDivState = false - this.showLeftDiv = false - this.isShowRouteGIS = true - this.routeEnd = e.name - this.endCoordinate = new AMap.LngLat(e.location.x, e.location.y) - } - - //全景漫游 - fullViewNavigation (e) { - console.log(e,'全景漫游') - } - - //三维场景 - threeeScene (e) { - window.open('http://39.106.78.171:8088/%E6%BC%94%E7%A4%BA%E6%A1%88%E4%BE%8B/--SHGJHYZX/') - } - - //查看预案 - seePlan (e) { - let data = e - let dialogRef = this.dialog.open(LookPlanDialog,{//调用open方法打开对话框并且携带参数过去 - width: '1400px', - height:'800px', - id:'lookPlanDialog', - data - }); - dialogRef.afterClosed().subscribe((data)=>{ - - }); - } - - //分享 - share (e) { - let data = { - url:'https://www.baidu.com/', - buildingType:e.buildingTypes[0].name, - address:e.address - } - let dialogRef = this.dialog.open(ShareUrlDialog,{//调用open方法打开对话框并且携带参数过去 - width: '540px', - height:'596px', - id:'shareDialog', - data}); - dialogRef.afterClosed().subscribe((data)=>{ - - }); - } - - //导航路线 - isShowRouteGIS:boolean = false; //导航路线 显隐 - routeStart:any; //起点 - routeStartList:any = [] //起点 搜索结果 - routeEnd:any; //终点 - routeEndList:any = [] //终点 搜索结果 - timeout:any; //延时器 - routeGIS:any; //查询结果 规划路线 - selectType:boolean = true; //路线选择 推荐方案/躲避用拥堵 - - //关闭导航路线 - closeRouteGIS () { - this.isShowRouteGIS = false - } - - //输入框 输入事件 - routeChange (e) { - let that = this - window.clearTimeout(this.timeout) - this.timeout = window.setTimeout(()=>{ - - that.map.getCity( function(info){ //获取当前 city - AMap.plugin(['AMap.AutoComplete'], () =>{ - var autoOptions = {city: info.city} - let keywords - e == 0 ? keywords = that.routeStart : keywords = that.routeEnd - var autoComplete = new AMap.Autocomplete(autoOptions); - autoComplete.search(keywords, function(status, result) { - if (result && result.tips && result.tips.length) { //搜索到数据时 - that._ngZone.run(()=>{ - if(e == 0){//起点 - that.routeStartList = result.tips - if(result.tips.length != 0){ - for (let index = 0; index < result.tips.length; index++) { - const element = result.tips[index]; - if(element.location){ - that.startCoordinate = new AMap.LngLat(element.location.lng, element.location.lat) - return - } - } - } - }else{//终点 - that.routeEndList = result.tips - that.endCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat) + dialogRef.afterClosed().subscribe((data) => { + + }); + } + + //分享 + share(e) { + let data = { + url: 'https://www.baidu.com/', + buildingType: e.buildingTypes[0].name, + address: e.address + } + let dialogRef = this.dialog.open(ShareUrlDialog, {//调用open方法打开对话框并且携带参数过去 + width: '540px', + height: '596px', + id: 'shareDialog', + data + }); + dialogRef.afterClosed().subscribe((data) => { + + }); + } + + //导航路线 + isShowRouteGIS: boolean = false; //导航路线 显隐 + routeStart: any; //起点 + routeStartList: any = [] //起点 搜索结果 + routeEnd: any; //终点 + routeEndList: any = [] //终点 搜索结果 + timeout: any; //延时器 + routeGIS: IDriving; //查询结果 规划路线 + selectType: boolean = true; //路线选择 推荐方案/躲避用拥堵 + + //关闭导航路线 + closeRouteGIS() { + this.isShowRouteGIS = false + } + + //输入框 输入事件 + routeChange(e) { + let that = this + window.clearTimeout(this.timeout) + this.timeout = window.setTimeout(() => { + + that.map.getCity(function (info) { //获取当前 city + var autoOptions = { city: info.city } + let keywords + e == 0 ? keywords = that.routeStart : keywords = that.routeEnd + var autoComplete = MapFactory.AutocompleteInstance(autoOptions,that); + autoComplete.search(keywords, function (status, result) { + if (result && result.tips && result.tips.length) { //搜索到数据时 + that._ngZone.run(() => { + if (e == 0) {//起点 + that.routeStartList = result.tips + if (result.tips.length != 0) { + for (let index = 0; index < result.tips.length; index++) { + const element = result.tips[index]; + if (element.location) { + that.startCoordinate = MapFactory.LngLatInstance(element.location.lng, element.location.lat) + return + } + } + } + } else {//终点 + that.routeEndList = result.tips + that.endCoordinate = MapFactory.LngLatInstance(result.tips[0].location.lng, result.tips[0].location.lat) + } + }); + + } //if + }) + }); //获取当前 city + + }, 500) + } + + //清空导航输入框 + deleteSearchGIS(e) { + if (e == 0) { + this.routeStart = null + this.routeStartList = [] + this.startCoordinate = null + } else { + this.routeEnd = null + this.routeEndList = [] + this.endCoordinate = null + } + } + + //清除路线 + clearGISRoute() { + this.routeStart = null + this.routeStartList = [] + this.routeEnd = null + this.routeEndList = [] + this.startCoordinate = null + this.endCoordinate = null + this.routeGIS ? this.routeGIS.clear() : null + this.routes = { distance: 0, time: 0, steps: [], } + this.map.setZoomAndCenter(13, [this.selectedUnit.location.x, this.selectedUnit.location.y]); //设置地图中心点 + } + + //交换起始点 + exchangeGISRoute() { + let data = this.routeStart + this.routeStart = this.routeEnd + this.routeEnd = data + this.routeStartList = [] + this.routeEndList = [] + let data2 = this.startCoordinate + this.startCoordinate = this.endCoordinate + this.endCoordinate = data2 + } + + routes: any = { distance: 0, time: 0, steps: [], };//导航查询结果 路线规划 + + startCoordinate: any//开始坐标 + endCoordinate: any//结束坐标 + + //导航查询 + queryGISRoute() { + //构造路线导航类 + let that = this + this.selectType = true + this.routeGIS ? this.routeGIS.clear() : null + this.routeGIS = MapFactory.DrivingInstance({ + map: this.map, + }); + if (!this.startCoordinate) { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('未查询到起点坐标信息,请输入有效地址', '确定', config); + return + } else if (!this.endCoordinate) { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('未查询到终点坐标信息,请输入有效地址', '确定', config); + return + } else { + this.routeGIS.search(this,this.startCoordinate, this.endCoordinate, + function (status, result) { + if (status === 'complete') { + that.routes = result.routes[0] + } else { alert('获取驾驶规划路线失败') } } - }); - - } //if - }) - }) - }); //获取当前 city - - },500) - } - - //清空导航输入框 - deleteSearchGIS (e) { - if (e==0) { - this.routeStart = null - this.routeStartList = [] - this.startCoordinate = null - } else { - this.routeEnd = null - this.routeEndList = [] - this.endCoordinate = null - } - } - - //清除路线 - clearGISRoute () { - this.routeStart = null - this.routeStartList = [] - this.routeEnd = null - this.routeEndList = [] - this.startCoordinate = null - this.endCoordinate = null - this.routeGIS? this.routeGIS.clear() : null - this.routes = { distance: 0, time: 0, steps: [], } - this.map.setZoomAndCenter(13,[this.selectedUnit.location.x,this.selectedUnit.location.y]); //设置地图中心点 - } - - //交换起始点 - exchangeGISRoute () { - let data = this.routeStart - this.routeStart = this.routeEnd - this.routeEnd = data - this.routeStartList = [] - this.routeEndList = [] - let data2 = this.startCoordinate - this.startCoordinate = this.endCoordinate - this.endCoordinate = data2 - } - - routes:any = { distance: 0, time: 0, steps: [], };//导航查询结果 路线规划 - - startCoordinate:any//开始坐标 - endCoordinate:any//结束坐标 - - //导航查询 - queryGISRoute () { - //构造路线导航类 - let that = this - this.selectType = true - this.routeGIS? this.routeGIS.clear() : null - this.routeGIS = new AMap.Driving({ - map: this.map, - }); - if(!this.startCoordinate){ - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('未查询到起点坐标信息,请输入有效地址','确定',config); - return - }else if(!this.startCoordinate){ - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('未查询到终点坐标信息,请输入有效地址','确定',config); - return - }else{ - this.routeGIS.search(this.startCoordinate,this.endCoordinate, - function(status, result) { - if (status === 'complete') { - that.routes = result.routes[0] - } else { alert('获取驾驶规划路线失败') } + ); } - ); - } - - } - - //切换 导航模式 推荐方案/躲避拥堵 - toggleRoute (e) { - let that = this - if (this.selectType != e) { - this.selectType = e - this.routeGIS? this.routeGIS.clear() : null - this.routeGIS = new AMap.Driving({ - map: this.map, - policy: e==true? AMap.DrivingPolicy.LEAST_TIME : AMap.DrivingPolicy.REAL_TRAFFIC - }); - // 根据起终点名称规划驾车导航路线 - - this.routeGIS.search(this.startCoordinate,this.endCoordinate, - function(status, result) { - if (status === 'complete') { - that.routes = result.routes[0] - } else { alert('获取驾驶规划路线失败') } + + } + + //切换 导航模式 推荐方案/躲避拥堵 + toggleRoute(e) { + let that = this + if (this.selectType != e) { + this.selectType = e + this.routeGIS ? this.routeGIS.clear() : null + this.routeGIS = MapFactory.DrivingInstance({ + map: this.map, + policy: e == true ? AMap.DrivingPolicy.LEAST_TIME : AMap.DrivingPolicy.REAL_TRAFFIC + }); + // 根据起终点名称规划驾车导航路线 + + this.routeGIS.search(this,this.startCoordinate, this.endCoordinate, + function (status, result) { + if (status === 'complete') { + that.routes = result.routes[0] + } else { alert('获取驾驶规划路线失败') } + } + ); } - ); } - } @@ -1434,291 +1473,292 @@ export class GisLabelingComponent implements OnInit { //分享 @Component({ - selector: 'shareUrl-dialog', - templateUrl: './shareUrl.html', - styleUrls: ['./shareUrl.scss'] + selector: 'shareUrl-dialog', + templateUrl: './shareUrl.html', + styleUrls: ['./shareUrl.scss'] }) export class ShareUrlDialog { - constructor(public http: HttpClient,public snackBar: MatSnackBar, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data,private render2: Renderer2) {} - - selectetime:any = [{id:0,name:'今日有效'},{id:1,name:'本周有效'},{id:2,name:'本月有效'},{id:3,name:'仅一次有效'}] - selectedTimeIndex = 0 - ngOnInit() { - this.makeCode() - } - //生成二维码 - qrCode - makeCode () { - this.qrCode = new QRCode(document.getElementById("qrcode"),{ - text: this.data.url, - width: 200, - height: 200, - colorDark : "#000000", - colorLight : "#ffffff", - correctLevel : QRCode.CorrectLevel.H - }); - } - //下载二维码 - downloadFile () { - let canvas = this.qrCode._el.querySelector("canvas") - var base64Text = canvas.toDataURL("image/png"); - let url = base64Text //createObjectURL创建一个下载Blob的url地址 - let link = document.createElement("a"); - link.style.display = "none"; - link.href = url; - link.setAttribute("download", '二维码'); - document.body.appendChild(link); - link.click(); - } - //复制链接 - copyUrl(){ - var copyTest = this.data.url - var inputTest = document.createElement('input') - inputTest.value = copyTest - document.body.appendChild(inputTest) - inputTest.select() - document.execCommand('Copy') - inputTest.className = 'oInput' - inputTest.style.display = 'none' - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('复制链接成功','确定',config); - } - selectedTime(index){ - if(this.selectedTimeIndex != index){ - this.selectedTimeIndex = index - this.qrCode.clear(); - if(index == 0){//如果今日有效 - console.log("今日") - } - if(index == 1){//如果本周有效 - console.log("本周") - this.qrCode.makeCode("http://www.w3cschool.cc") - } - if(index == 2){//如果本月有效 - console.log("本月") - } - if(index == 3){//如果仅一次有效 - console.log("一次") - } - } - } - //关闭 - closeDiv(){ - this.dialogRef.close() - } + constructor(public http: HttpClient, public snackBar: MatSnackBar, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data, private render2: Renderer2) { } + + selectetime: any = [{ id: 0, name: '今日有效' }, { id: 1, name: '本周有效' }, { id: 2, name: '本月有效' }, { id: 3, name: '仅一次有效' }] + selectedTimeIndex = 0 + ngOnInit() { + this.makeCode() + } + //生成二维码 + qrCode + makeCode() { + this.qrCode = new QRCode(document.getElementById("qrcode"), { + text: this.data.url, + width: 200, + height: 200, + colorDark: "#000000", + colorLight: "#ffffff", + correctLevel: QRCode.CorrectLevel.H + }); + } + //下载二维码 + downloadFile() { + let canvas = this.qrCode._el.querySelector("canvas") + var base64Text = canvas.toDataURL("image/png"); + let url = base64Text //createObjectURL创建一个下载Blob的url地址 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + link.setAttribute("download", '二维码'); + document.body.appendChild(link); + link.click(); + } + //复制链接 + copyUrl() { + var copyTest = this.data.url + var inputTest = document.createElement('input') + inputTest.value = copyTest + document.body.appendChild(inputTest) + inputTest.select() + document.execCommand('Copy') + inputTest.className = 'oInput' + inputTest.style.display = 'none' + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('复制链接成功', '确定', config); + } + selectedTime(index) { + if (this.selectedTimeIndex != index) { + this.selectedTimeIndex = index + this.qrCode.clear(); + if (index == 0) {//如果今日有效 + console.log("今日") + } + if (index == 1) {//如果本周有效 + console.log("本周") + this.qrCode.makeCode("http://www.w3cschool.cc") + } + if (index == 2) {//如果本月有效 + console.log("本月") + } + if (index == 3) {//如果仅一次有效 + console.log("一次") + } + } + } + //关闭 + closeDiv() { + this.dialogRef.close() + } } //查看预案 @Component({ - selector: 'lookPlan-dialog', - templateUrl: './lookPlan.html', - styleUrls: ['./lookPlan.scss'] + selector: 'lookPlan-dialog', + templateUrl: './lookPlan.html', + styleUrls: ['./lookPlan.scss'] }) export class LookPlanDialog { - constructor(public http: HttpClient,public snackBar: MatSnackBar, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data,private render2: Renderer2,public dialog: MatDialog) {} - - - ngOnInit() { - // console.log(this.data) - this.getAllPlans() - } - //关闭弹窗 - closeDiv(){ - this.dialogRef.close() - } - //查看单位详情 - lookUnitDetails(){ - window.open(`/keyUnit/viewunitinfo?id=${this.data.id}`) - } - //获得所有预案组件 - allPlanComponents:any//所有预案组件 - getAllPlans(){ - let paramsData:any = { - companyId:this.data.id, - pageNumber: 1, - pageSize: "100", - sort: "" - } - this.http.get("/api/PlanComponents",{params:paramsData}).subscribe((data:any)=>{ - this.allPlanComponents = data.items - }) - } - //查看预案 - lookPlan(e){ - if(e.planMode == 0){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('本地文件,请下载查看','确定',config); - } - if(e.planMode == 1){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('查看导入word文件','确定',config); - } - if(e.planMode == 2){ //如果是在线编辑 - let id = e.id - sessionStorage.setItem("planId",id) - sessionStorage.setItem("companyId",this.data.id) - sessionStorage.setItem("buildingTypeId",this.data.buildingTypes[0].id) - sessionStorage.setItem("editable","0") - sessionStorage.setItem("planName",e.name) - let companyId = sessionStorage.getItem("companyId") - window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); - } - if(e.planMode == 3){ //如果是跳转网页 - sessionStorage.setItem("url",e.url) - window.open(`/planManagement/webLook`) - } - } - - //点击下载 - readFile(element){ - this.uploadFileLonging = element - let data =element - const dialogRef = this.dialog.open(DownloadFile, { - width:"435px", - data - }); - dialogRef.afterClosed().subscribe( - data=>{ - if(data){ - this.downloadFileName = data.fileName - this.download = data - this.downloadFile() + constructor(public http: HttpClient, public snackBar: MatSnackBar, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data, private render2: Renderer2, public dialog: MatDialog) { } + + + ngOnInit() { + // console.log(this.data) + this.getAllPlans() + } + //关闭弹窗 + closeDiv() { + this.dialogRef.close() + } + //查看单位详情 + lookUnitDetails() { + window.open(`/keyUnit/viewunitinfo?id=${this.data.id}`) + } + //获得所有预案组件 + allPlanComponents: any//所有预案组件 + getAllPlans() { + let paramsData: any = { + companyId: this.data.id, + pageNumber: 1, + pageSize: "100", + sort: "" } - } - ); - } - - //下载↓ - selectDownloadFile:any; //选择下载的文件 - download:any; //下载文件元数据 - downloadFileName:any //下载文件的文件名 - downloadisLoading:boolean = false; //进度条loading是否加载 - downloadProgress:number = 0; //进度条进度 - - uploadFileLonging:any - downloadFile(){ - this.downloadProgress = 0 - let file = this.download - let fileSize = file.fileLength//下载文件的总大小 - let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB - - if (file && fileSize<=shardSize) { //<=10MB时直接下载 - this.downloadisLoading = true - this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{ - let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址 - let link = document.createElement("a"); - link.style.display = "none"; - link.href = url; - let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; - link.setAttribute("download", file.fileName ? file.fileName : this.data.name + "-" +this.uploadFileLonging.name + "." + suffix); - document.body.appendChild(link); - link.click(); - this.downloadisLoading = false - }) - } else if (file && fileSize > shardSize) { //>10MB时分块下载 - this.blockingDownload() //分段下载 - this.downloadisLoading = true - } - } - //分段下载并合并 - async blockingDownload () { - let file = this.download - let fileSize = file.fileLength //下载文件的总大小 - let shardSize = 3 * 1024 * 1024 //3MB一个分片 - let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段 - let allFile:any = [] //所有的file分段 - - for (let i=0;i{ - this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ - result(data) }) - }) - allFile.push(result) - - - - if (allFile.length === allSlice) { //合并文件输出给浏览器 - let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址 - let link = document.createElement("a"); - link.style.display = "none"; - link.href = url; - let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; - link.setAttribute("download", file.fileName ? file.fileName : this.data.unitname + "-" +this.uploadFileLonging.name + "." + suffix); - document.body.appendChild(link); - link.click(); - this.downloadisLoading = false - } + this.http.get("/api/PlanComponents", { params: paramsData }).subscribe((data: any) => { + this.allPlanComponents = data.items + }) + } + //查看预案 + lookPlan(e) { + if (e.planMode == 0) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('本地文件,请下载查看', '确定', config); + } + if (e.planMode == 1) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('查看导入word文件', '确定', config); + } + if (e.planMode == 2) { //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId", id) + sessionStorage.setItem("companyId", this.data.id) + sessionStorage.setItem("buildingTypeId", this.data.buildingTypes[0].id) + sessionStorage.setItem("editable", "0") + sessionStorage.setItem("planName", e.name) + let companyId = sessionStorage.getItem("companyId") + window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); + } + if (e.planMode == 3) { //如果是跳转网页 + sessionStorage.setItem("url", e.url) + window.open(`/planManagement/webLook`) + } + } + + //点击下载 + readFile(element) { + this.uploadFileLonging = element + let data = element + const dialogRef = this.dialog.open(DownloadFile, { + width: "435px", + data + }); + dialogRef.afterClosed().subscribe( + data => { + if (data) { + this.downloadFileName = data.fileName + this.download = data + this.downloadFile() + } + } + ); + } - } //for循环 + //下载↓ + selectDownloadFile: any; //选择下载的文件 + download: any; //下载文件元数据 + downloadFileName: any //下载文件的文件名 + downloadisLoading: boolean = false; //进度条loading是否加载 + downloadProgress: number = 0; //进度条进度 + + uploadFileLonging: any + downloadFile() { + this.downloadProgress = 0 + let file = this.download + let fileSize = file.fileLength//下载文件的总大小 + let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB + + if (file && fileSize <= shardSize) { //<=10MB时直接下载 + this.downloadisLoading = true + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { responseType: 'blob' },).subscribe(data => { + let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); + link.setAttribute("download", file.fileName ? file.fileName : this.data.name + "-" + this.uploadFileLonging.name + "." + suffix); + document.body.appendChild(link); + link.click(); + this.downloadisLoading = false + }) + } else if (file && fileSize > shardSize) { //>10MB时分块下载 + this.blockingDownload() //分段下载 + this.downloadisLoading = true + } + } + //分段下载并合并 + async blockingDownload() { + let file = this.download + let fileSize = file.fileLength //下载文件的总大小 + let shardSize = 3 * 1024 * 1024 //3MB一个分片 + let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段 + let allFile: any = [] //所有的file分段 + + for (let i = 0; i < allSlice; i++) { + let start = i * shardSize //每次下载文件开始位置 + let end = Math.min(fileSize, start + shardSize - 1); //每次下载文件结束为止 + + let result = await new Promise((result, reject) => { + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => { + result(data) + }) + }) + allFile.push(result) + + + + if (allFile.length === allSlice) { //合并文件输出给浏览器 + let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址 + let link = document.createElement("a"); + link.style.display = "none"; + link.href = url; + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); + link.setAttribute("download", file.fileName ? file.fileName : this.data.unitname + "-" + this.uploadFileLonging.name + "." + suffix); + document.body.appendChild(link); + link.click(); + this.downloadisLoading = false + } - } + } //for循环 - //取消分块下载 - cancelDowload () { - } + } + + //取消分块下载 + cancelDowload() { + } } //下载文件弹出框 @Component({ - selector: 'downloadfile', - templateUrl: './downloadFile.html', - styleUrls: ['./downloadFile.scss'] + selector: 'downloadfile', + templateUrl: './downloadFile.html', + styleUrls: ['./downloadFile.scss'] }) export class DownloadFile { - - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} - name:any //如果真实姓名为空时 - fileUrls:any //当前预案附件地址数组 - fileDatas:any = [] //用于循环的数组 - selectedFileIndex : any = 0 - selectedFileData : any - - ngOnInit(): void { - // console.log(this.data) - this.name = this.data.name - this.fileUrls = this.data.attachmentUrls - this.fileUrls.forEach(item=>{ - this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ - data.filePige = (data.fileLength / (1024*1024)).toFixed(2) - this.fileDatas.push(data) - this.selectedFileData = data - }) - }) - - } - - //取消 - onNoClick(): void { - this.dialogRef.close(); - } - //确定 - confirm(){ - this.dialogRef.close(this.selectedFileData); - } - - //点击想要下载的文件 - addurl(item,key){ - // console.log(item,key) - this.selectedFileIndex = key - this.selectedFileData = item - } + + constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } + name: any //如果真实姓名为空时 + fileUrls: any //当前预案附件地址数组 + fileDatas: any = [] //用于循环的数组 + selectedFileIndex: any = 0 + selectedFileData: any + + ngOnInit(): void { + // console.log(this.data) + this.name = this.data.name + this.fileUrls = this.data.attachmentUrls + this.fileUrls.forEach(item => { + this.http.get('/api/ObjectMetadata/PlanPlatform/' + item).subscribe((data: any) => { + data.filePige = (data.fileLength / (1024 * 1024)).toFixed(2) + this.fileDatas.push(data) + this.selectedFileData = data + }) + }) + + } + + //取消 + onNoClick(): void { + this.dialogRef.close(); + } + //确定 + confirm() { + this.dialogRef.close(this.selectedFileData); + } + + //点击想要下载的文件 + addurl(item, key) { + // console.log(item,key) + this.selectedFileIndex = key + this.selectedFileData = item + } } \ No newline at end of file diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 5dd308d..df5228d 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -1,8 +1,6 @@ import { Component, OnInit, Renderer2, ElementRef } from '@angular/core'; import { HttpClient } from '@angular/common/http' declare var echarts: any; -declare var AMap: any; -declare var AMapUI: any; diff --git a/src/app/key-unit/basicinfo-look/basicinfo.component.ts b/src/app/key-unit/basicinfo-look/basicinfo.component.ts index 0278bc0..21543c8 100644 --- a/src/app/key-unit/basicinfo-look/basicinfo.component.ts +++ b/src/app/key-unit/basicinfo-look/basicinfo.component.ts @@ -5,21 +5,16 @@ import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { AbstractControl, FormControl, NG_VALIDATORS, Validator } from '@angular/forms'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; import { TreeService } from '../../http-interceptors/tree.service' import { FileUploader, FileItem } from 'ng2-file-upload' import { DomSanitizer } from '@angular/platform-browser' -import { Injectable } from "@angular/core" -import { filter } from 'rxjs/operators'; -import { async } from '@angular/core/testing'; -import { MatTableDataSource } from '@angular/material/table'; -import { isNgTemplate } from '@angular/compiler'; import * as _ from 'lodash'; import Swiper from 'swiper'; import { ActivatedRoute } from '@angular/router'; import { StatisticsOfFireFightingFacilities } from '../basicinfo/basicinfo.component'; import Viewer from 'viewerjs'; -declare var AMap: any; +import { IMap, IMarker } from '@src/modules/map/declare/map'; +import { MapFactory } from '@src/modules/map/declare/factory'; @Component({ selector: 'app-basicinfo-look', @@ -131,11 +126,11 @@ export class BasicinfoLookComponent implements OnInit { isMapLabel: boolean //地图标注位置 markerPosition: any = { x: 0, y: 0 }//单位坐标 - map: any //地图实例 + map: IMap //地图实例 isGisTopBox: boolean = false//点击位置按钮 isGisTopBoxTwo: boolean = false//点击位置按钮 - oldPositionMarker: any //旧位置marker实例 - newPositionMarker: any //新位置marker实例 + oldPositionMarker: IMarker //旧位置marker实例 + newPositionMarker: IMarker //新位置marker实例 newPositionMarkerContent: any = '
' + @@ -145,7 +140,7 @@ export class BasicinfoLookComponent implements OnInit { //初始化地图 labelGis() { - this.map = new AMap.Map('container', { + this.map = MapFactory.MapInstance('container', { zoom: 12 }) this.map.on('complete', () => { @@ -156,10 +151,10 @@ export class BasicinfoLookComponent implements OnInit { if (this.isMapLabel) {//如果已经标注单位坐标 // console.log('已标注单位位置') this.map.setCenter([this.unitinfo.location.x, this.unitinfo.location.y]); - this.oldPositionMarker = new AMap.Marker({ + this.oldPositionMarker = MapFactory.MarkerInstance({ position: [this.unitinfo.location.x, this.unitinfo.location.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }) // 将 markers 添加到地图 this.map.add(this.oldPositionMarker); diff --git a/src/app/key-unit/basicinfo/basicinfo.component.ts b/src/app/key-unit/basicinfo/basicinfo.component.ts index 93f7410..b37ad82 100644 --- a/src/app/key-unit/basicinfo/basicinfo.component.ts +++ b/src/app/key-unit/basicinfo/basicinfo.component.ts @@ -5,23 +5,19 @@ import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { AbstractControl, FormControl, NG_VALIDATORS, Validator } from '@angular/forms'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; -import format from 'date-fns/format'; import { TreeService } from '../../http-interceptors/tree.service' import { FileUploader, FileItem } from 'ng2-file-upload' import { AddHouseInfo } from './addhouseinfo.component' import { DomSanitizer } from '@angular/platform-browser' -import { Injectable } from "@angular/core" -import { filter } from 'rxjs/operators'; -import { async } from '@angular/core/testing'; -import { MatTableDataSource } from '@angular/material/table'; -import { isNgTemplate } from '@angular/compiler'; import * as _ from 'lodash'; import Swiper from 'swiper'; import { LookMaster } from './lookmaster.component' import { ActivatedRoute } from '@angular/router'; import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service'; -declare var AMap: any; import Viewer from 'viewerjs'; +import { IMap, IMarker, IPlaceSearch } from '@src/modules/map/declare/map'; +import { MapFactory } from '@src/modules/map/declare/factory'; + @Component({ selector: 'app-basicinfo', templateUrl: './basicinfo.component.html', @@ -129,11 +125,11 @@ export class BasicinfoComponent implements OnInit { isMapLabel: boolean //地图标注位置 markerPosition: any = { x: 0, y: 0 }//单位坐标 - map: any //地图实例 + map: IMap //地图实例 isGisTopBox: boolean = false//点击位置按钮 isGisTopBoxTwo: boolean = false//点击位置按钮 - oldPositionMarker: any //旧位置marker实例 - newPositionMarker: any //新位置marker实例 + oldPositionMarker: IMarker //旧位置marker实例 + newPositionMarker: IMarker //新位置marker实例 newPositionMarkerContent: any = '
' + @@ -152,7 +148,7 @@ export class BasicinfoComponent implements OnInit { '
' //初始化地图 searchTitle: any//搜索内容 - placeSearch: any//地址搜索类 + placeSearch: IPlaceSearch//地址搜索类 search() { this.placeSearch.search(this.searchTitle, (status, result) => { // 搜索成功时,result即是对应的匹配数据 @@ -169,7 +165,7 @@ export class BasicinfoComponent implements OnInit { } //初始化地图 labelGis() { - this.map = new AMap.Map('container', { + this.map = MapFactory.MapInstance('container', { zoom: 12 }) this.map.on('complete', () => { @@ -179,26 +175,21 @@ export class BasicinfoComponent implements OnInit { var autoOptions = { input: "tipinput" }; - AMap.plugin(['AMap.PlaceSearch', 'AMap.AutoComplete'], () => { - var auto = new AMap.AutoComplete(autoOptions); - this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类 - auto.on("select", (e) => { - // console.log(e) - // console.log( this.newPositionMarker) - this.newPositionMarker.setPosition([e.poi.location.lng, e.poi.location.lat]) - this.markerPosition2 = { x: e.poi.location.lng, y: e.poi.location.lat } - this.map.setCenter([e.poi.location.lng, e.poi.location.lat]); //设置地图中心点 - });//注册监听,当选中某条记录时会触发 - - }); + var auto = MapFactory.AutocompleteInstance(autoOptions,this); + this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类 + auto.on("select", (e) => { + this.newPositionMarker.setPosition([e.poi.location.lng, e.poi.location.lat]) + this.markerPosition2 = { x: e.poi.location.lng, y: e.poi.location.lat } + this.map.setCenter([e.poi.location.lng, e.poi.location.lat]); //设置地图中心点 + });//注册监听,当选中某条记录时会触发 if (this.isMapLabel) {//如果已经标注单位坐标 // console.log('已标注单位位置') this.map.setCenter([this.unitinfo.location.x, this.unitinfo.location.y]); - this.oldPositionMarker = new AMap.Marker({ + this.oldPositionMarker = MapFactory.MarkerInstance({ position: [this.unitinfo.location.x, this.unitinfo.location.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }) // 将 markers 添加到地图 this.map.add(this.oldPositionMarker); @@ -222,11 +213,11 @@ export class BasicinfoComponent implements OnInit { this.newPositionMarker.setContent(this.oldPositionMarkerContent) } - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ draggable: true, position: [this.markerPosition.x, this.markerPosition.y], content: this.newPositionMarkerContentBtn, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }); this.map.add(this.newPositionMarker); @@ -237,24 +228,24 @@ export class BasicinfoComponent implements OnInit { this.markerPosition2 = { x: this.map.getCenter().lng, y: this.map.getCenter().lat } //获取当前地图中心位置 } this.newPositionMarker.on('dragend', (e) => { - let lnglat = this.map.containerToLngLat(e.pixel) + let lnglat = this.newPositionMarker.getLngLatByMarkerEvent(this.map,e); this.markerPosition2 = { x: lnglat.KL, y: lnglat.kT } // console.log(`${lnglat.KL},${lnglat.kT}`); - }) + },this) this.newPositionMarker.on('dragging', (e) => { //console.log('dragging',e) - let lnglat = this.map.containerToLngLat(e.pixel) + let lnglat = this.newPositionMarker.getLngLatByMarkerEvent(this.map,e); this.newPositionMarker.setPosition(lnglat); - }) + },this) //点击确定 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'), 'click', (event) => { this.map.clearMap(); this.isGisTopBox = true this.isGisTopBoxTwo = false - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.markerPosition2.x, this.markerPosition2.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }); this.markerPosition = this.markerPosition2 this.map.add(this.newPositionMarker); @@ -264,10 +255,10 @@ export class BasicinfoComponent implements OnInit { this.isGisTopBox = true this.isGisTopBoxTwo = false this.map.clearMap(); - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.markerPosition.x, this.markerPosition.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }); this.map.setCenter([this.markerPosition.x, this.markerPosition.y]); //设置地图中心点 this.map.add(this.newPositionMarker); @@ -277,10 +268,10 @@ export class BasicinfoComponent implements OnInit { this.map.clearMap(); this.isGisTopBox = true this.isGisTopBoxTwo = false - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.markerPosition2.x, this.markerPosition2.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }); this.markerPosition = this.markerPosition2 this.map.add(this.newPositionMarker); @@ -290,10 +281,10 @@ export class BasicinfoComponent implements OnInit { this.isGisTopBox = true this.isGisTopBoxTwo = false this.map.clearMap(); - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.markerPosition.x, this.markerPosition.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }); this.map.setCenter([this.markerPosition.x, this.markerPosition.y]); //设置地图中心点 this.map.add(this.newPositionMarker); @@ -311,11 +302,11 @@ export class BasicinfoComponent implements OnInit { this.map.setCenter(center); } - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ draggable: true, position: center, content: this.newPositionMarkerContentBtn, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }); this.map.add(this.newPositionMarker); @@ -326,25 +317,25 @@ export class BasicinfoComponent implements OnInit { this.markerPosition2 = { x: this.map.getCenter().lng, y: this.map.getCenter().lat } //获取当前地图中心位置 } this.newPositionMarker.on('dragend', (e) => { - let lnglat = this.map.containerToLngLat(e.pixel) + let lnglat = this.newPositionMarker.getLngLatByMarkerEvent(this.map,e) this.markerPosition2 = { x: lnglat.KL, y: lnglat.kT } // console.log(`${lnglat.KL},${lnglat.kT}`); - }) + },this) this.newPositionMarker.on('dragging', (e) => { //console.log('dragging',e) - let lnglat = this.map.containerToLngLat(e.pixel) + let lnglat = this.newPositionMarker.getLngLatByMarkerEvent(this.map,e) this.newPositionMarker.setPosition(lnglat); - }) + },this) //点击确定 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'), 'click', (event) => { this.isGisTopBox = true this.isGisTopBoxTwo = false this.markerPosition = this.markerPosition2 this.map.clearMap(); - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.markerPosition.x, this.markerPosition.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }); this.map.add(this.newPositionMarker); }) @@ -353,10 +344,10 @@ export class BasicinfoComponent implements OnInit { this.isGisTopBoxTwo = false this.markerPosition = this.markerPosition2 this.map.clearMap(); - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.markerPosition.x, this.markerPosition.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }); this.map.add(this.newPositionMarker); }) @@ -365,10 +356,10 @@ export class BasicinfoComponent implements OnInit { this.isGisTopBox = true this.isGisTopBoxTwo = false if (this.markerPosition.x && this.markerPosition.x != 0) {//说明之前标过点 - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.markerPosition.x, this.markerPosition.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }); this.map.setCenter([this.markerPosition.x, this.markerPosition.y]); //设置地图中心点 this.map.add(this.newPositionMarker); @@ -379,10 +370,10 @@ export class BasicinfoComponent implements OnInit { this.isGisTopBox = true this.isGisTopBoxTwo = false if (this.markerPosition.x && this.markerPosition.x != 0) {//说明之前标过点 - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.markerPosition.x, this.markerPosition.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-34, -36) + offset: MapFactory.PixelInstance(-34, -36) }); this.map.setCenter([this.markerPosition.x, this.markerPosition.y]); //设置地图中心点 this.map.add(this.newPositionMarker); @@ -1048,10 +1039,6 @@ export class BasicinfoComponent implements OnInit { //提交建筑信息 onSubmitBuildingInfo(value, item, key, invalid) { - // console.log(1,item) - // console.log(2,invalid) - // console.log(3,value) - // console.log(4,this.allunittype) if (invalid) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; diff --git a/src/app/key-unit/function-division/function-division.component.ts b/src/app/key-unit/function-division/function-division.component.ts index 0f75c4b..3251d28 100644 --- a/src/app/key-unit/function-division/function-division.component.ts +++ b/src/app/key-unit/function-division/function-division.component.ts @@ -133,24 +133,30 @@ export class FunctionDivisionComponent implements OnInit { noDataList = [] //没有 创建功能分区 的建筑 //获得所有建筑的功能分区 - getAllBuildingFunctionalZoning () { + async getAllBuildingFunctionalZoning () { this.selectBuildingFunctionalZoning = [] this.allBuildingFunctionalZoning = [] this.noDataList = [] - this.allBuilding.forEach((element,index) => { + for (let index = 0; index < this.allBuilding.length; index++) { + const element = this.allBuilding[index]; let data={buildingId: element.id} - this.http.get(`/api/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{ - if (data.length) { - element.functionalZoning = data - this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组 - this.allBuildingFunctionalZoning.push(element) - this.noDataList.push(true) - } else { - this.noDataList.push(false) - } - if (this.noDataList.length === this.allBuilding.length) { this.addVoluntarilyPartition() } - }) - }); + await new Promise((resolve,reject)=>{ + this.http.get(`/api/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{ + if (data.length) { + element.functionalZoning = data + this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组 + this.allBuildingFunctionalZoning.push(element) + this.noDataList.push(true) + } else { + this.noDataList.push(false) + } + if (this.noDataList.length === this.allBuilding.length) { this.addVoluntarilyPartition() } + resolve(data) + }) + }) + } + + } // 没有 创建 建筑功能分区时 自动创建 diff --git a/src/app/key-unit/router-gis/router-gis.component.ts b/src/app/key-unit/router-gis/router-gis.component.ts index 114a152..edc9228 100644 --- a/src/app/key-unit/router-gis/router-gis.component.ts +++ b/src/app/key-unit/router-gis/router-gis.component.ts @@ -2,6 +2,8 @@ import { HttpClient } from '@angular/common/http'; import { Component, EventEmitter, NgZone, OnInit, Output } from '@angular/core'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { ActivatedRoute } from '@angular/router'; +import { MapFactory } from '@src/modules/map/declare/factory'; +import { IDriving, IMap } from '@src/modules/map/declare/map'; declare var AMap: any; @Component({ @@ -31,14 +33,14 @@ export class RouterGISComponent implements OnInit { this.http.get(`/api/Companies/${this.route.snapshot.queryParams.id}`).subscribe((data:any)=>{ if (data.driveRouteStartPoint && data.driveRouteStartPoint.x && data.driveRouteStartPoint.y && data.driveRouteStartName) { //开始坐标 名称 this.routeStart = data.driveRouteStartName - this.startCoordinate = [data.driveRouteStartPoint.x,data.driveRouteStartPoint.y] + this.startCoordinate = MapFactory.LngLatInstance(data.driveRouteStartPoint.x, data.driveRouteStartPoint.y) } if (data.driveRouteEndPoint && data.driveRouteEndPoint.x && data.driveRouteEndPoint.y && data.driveRouteEndName) { //结束坐标 名称 this.routeEnd = data.driveRouteEndName - this.endCoordinate = [data.driveRouteEndPoint.x,data.driveRouteEndPoint.y] + this.endCoordinate = MapFactory.LngLatInstance(data.driveRouteEndPoint.x, data.driveRouteEndPoint.y) } else if (data.location && data.location.x && data.location.y) { this.routeEnd = data.name - this.endCoordinate = [data.location.x,data.location.y] + this.endCoordinate = MapFactory.LngLatInstance(data.location.x, data.location.y) } resolve('success') }) //http @@ -88,29 +90,27 @@ export class RouterGISComponent implements OnInit { //地图初始化 mapInit () { let that = this - var layer = new AMap.createDefaultLayer({ + var layer = MapFactory.LayerInstance({ zooms:[3,20], //可见级别 visible:true, //是否可见 opacity:1, //透明度 zIndex:0, //叠加层级 resizeEnable: true //是否监控地图容器尺寸变化, }) - that.map = new AMap.Map('map',{ + that.map = MapFactory.MapInstance('map',{ layers:[layer], //当只想显示标准图层时layers属性可缺省, }); that.map.setCity('上海市'); - AMap.plugin('AMap.Driving', function() { - that.startCoordinate && that.endCoordinate? that.queryGISRoute() : null - }) + that.startCoordinate && that.endCoordinate? that.queryGISRoute() : null } - map:any; //地图实例 + map:IMap; //地图实例 routeStart:any; //起点 routeStartList:any = [] //起点 搜索结果 routeEnd:any; //终点 routeEndList:any = [] //终点 搜索结果 timeout:any; //延时器 - routeGIS:any; //查询结果 规划路线 + routeGIS:IDriving; //查询结果 规划路线 selectType:boolean = true; //路线选择 推荐方案/躲避用拥堵 routes:any = { distance: 0, time: 0, steps: [], };//导航查询结果 路线规划 startCoordinate:any//开始坐标 @@ -123,34 +123,32 @@ export class RouterGISComponent implements OnInit { this.timeout = window.setTimeout(()=>{ that.map.getCity( function(info){ //获取当前 city - AMap.plugin(['AMap.AutoComplete'], () =>{ - var autoOptions = {city: info.city} - let keywords - e == 0 ? keywords = that.routeStart : keywords = that.routeEnd - var autoComplete = new AMap.Autocomplete(autoOptions); - autoComplete.search(keywords, function(status, result) { - if (result && result.tips && result.tips.length) { //搜索到数据时 - that._ngZone.run(()=>{ - if(e == 0){ - that.routeStartList = result.tips - if(result.tips.length != 0){ - for (let index = 0; index < result.tips.length; index++) { - const element = result.tips[index]; - if(element.location){ - that.startCoordinate = new AMap.LngLat(element.location.lng, element.location.lat) - return - } + var autoOptions = {city: info.city} + let keywords + e == 0 ? keywords = that.routeStart : keywords = that.routeEnd + var autoComplete = MapFactory.AutocompleteInstance(autoOptions,that); + autoComplete.search(keywords, function(status, result) { + if (result && result.tips && result.tips.length) { //搜索到数据时 + that._ngZone.run(()=>{ + if(e == 0){ + that.routeStartList = result.tips + if(result.tips.length != 0){ + for (let index = 0; index < result.tips.length; index++) { + const element = result.tips[index]; + if(element.location){ + that.startCoordinate = MapFactory.LngLatInstance(element.location.lng, element.location.lat) + return } } - }else{ - that.routeEndList = result.tips - that.endCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat) } - }); - - } //if - }) + }else{ + that.routeEndList = result.tips + that.endCoordinate = MapFactory.LngLatInstance(result.tips[0].location.lng, result.tips[0].location.lat) + } + }); + } //if }) + }); //获取当前 city },500) @@ -201,7 +199,7 @@ export class RouterGISComponent implements OnInit { let that = this this.selectType = true this.routeGIS? this.routeGIS.clear() : null - this.routeGIS = new AMap.Driving({ + this.routeGIS = MapFactory.DrivingInstance({ map: this.map, }); if(!this.startCoordinate){ @@ -217,7 +215,7 @@ export class RouterGISComponent implements OnInit { this.snackBar.open('未查询到终点坐标信息,请输入有效地址','确定',config); return }else{ - this.routeGIS.search(this.startCoordinate,this.endCoordinate, + this.routeGIS.search(this,this.startCoordinate,this.endCoordinate, function(status, result) { if (status === 'complete') { that.routes = result.routes[0] @@ -239,12 +237,12 @@ export class RouterGISComponent implements OnInit { if (this.selectType != e) { this.selectType = e this.routeGIS? this.routeGIS.clear() : null - this.routeGIS = new AMap.Driving({ + this.routeGIS = MapFactory.DrivingInstance({ map: this.map, policy: e==true? AMap.DrivingPolicy.LEAST_TIME : AMap.DrivingPolicy.REAL_TRAFFIC }); // 根据起终点名称规划驾车导航路线 - this.routeGIS.search(this.startCoordinate,this.endCoordinate, + this.routeGIS.search(this,this.startCoordinate,this.endCoordinate, function(status, result) { if (status === 'complete') { that.routes = result.routes[0] diff --git a/src/app/key-unit/six-familiarity/six-familiarity.component.ts b/src/app/key-unit/six-familiarity/six-familiarity.component.ts index 9f36c2b..cdb98e1 100644 --- a/src/app/key-unit/six-familiarity/six-familiarity.component.ts +++ b/src/app/key-unit/six-familiarity/six-familiarity.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -declare var AMap: any; +import { MapFactory } from '@src/modules/map/declare/factory'; @Component({ selector: 'app-six-familiarity', @@ -47,26 +47,11 @@ export class routerMapComponent implements OnInit { //地图初始化 mapInit () { //创建地图 - let map = new AMap.Map('contentMap', { + let map = MapFactory.MapInstance('contentMap', { resizeEnable: true, cursor: 'default', zooms:[6,18], }); - //构造路线导航类 实际路线 - let driving = new AMap.Driving({ - map: map, - showTraffic: true, - isOutline: true, - }); - driving.search( [{keyword: '广西消防总队',city:'广西'},{keyword: '万科公园里',city:'广西'},{keyword: '南宁明安医院',city:'广西'}], ); - //构造路线导航类 导航路线 - let drivingTwo = new AMap.Driving({ - map: map, - showTraffic: false, - }); - drivingTwo.search( [{keyword: '广西消防总队',city:'广西'},{keyword: '南宁明安医院',city:'广西'}], ); - //function (status,result) { console.log(status,result) } //地图路线 匹配起始点回调函数 - //new AMap.LngLat(116.379028, 39.865042), new AMap.LngLat(116.427281, 39.903719) / [{keyword: '淄博站',city:'山东'},{keyword: '淄博北站',city:'山东'}], //路线可搜索, 可用坐标 } diff --git a/src/app/key-unit/water-road/water-road.component.ts b/src/app/key-unit/water-road/water-road.component.ts index fa24d5e..1567400 100644 --- a/src/app/key-unit/water-road/water-road.component.ts +++ b/src/app/key-unit/water-road/water-road.component.ts @@ -4,6 +4,8 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { ActivatedRoute } from '@angular/router'; +import { MapFactory } from '@src/modules/map/declare/factory'; +import { ICircle, IMap, IMarker } from '@src/modules/map/declare/map'; declare var AMap: any; declare var html2canvas: any; @Component({ @@ -29,17 +31,17 @@ export class WaterRoadComponent implements OnInit { }) } - map: any //地图 - watertForm: FormGroup //gis右上角水源表单 - waterList = [ - { id: '0', name: '消火栓', selected: true }, - { id: '1', name: '消防水池', selected: true }, - { id: '2', name: '天然水源', selected: true }, - { id: '3', name: '总队', selected: true }, - { id: '4', name: '支队', selected: true }, - { id: '5', name: '大队', selected: true }, - { id: '6', name: '中队(消防站)', selected: true }, - { id: '7', name: '其他消防队伍', selected: true } + map:IMap //地图 + watertForm:FormGroup //gis右上角水源表单 + waterList = [ + {id:'0',name:'消火栓',selected:true}, + {id:'1',name:'消防水池',selected:true}, + {id:'2',name:'天然水源',selected:true}, + {id:'3',name:'总队',selected:true}, + {id:'4',name:'支队',selected:true}, + {id:'5',name:'大队',selected:true}, + {id:'6',name:'中队(消防站)',selected:true}, + {id:'7',name:'其他消防队伍',selected:true} ] fireForceList: any[] = [ @@ -48,7 +50,7 @@ export class WaterRoadComponent implements OnInit { waterAreaDefault: any = '5000' //默认水源范围 selectedWaterList: any = [] //选择提交的水源 //地图范围圆圈---水源 - circleofwater = new AMap.Circle({ + circleofwater:ICircle = MapFactory.CircleInstance({ center: null, radius: 0, //半径 strokeOpacity: 1, @@ -111,7 +113,7 @@ export class WaterRoadComponent implements OnInit { this.circleofwater.setMap(this.map) let Distance - let lnglat = new AMap.LngLat(this.unitData.location.x, this.unitData.location.y) // lng, lat 替换成传入的坐标 + let lnglat = MapFactory.LngLatInstance(this.unitData.location.x, this.unitData.location.y) // lng, lat 替换成传入的坐标 //如果选择当前的视野范围算出查询半径 if (this.waterAreaDefault == '0') { @@ -223,11 +225,12 @@ export class WaterRoadComponent implements OnInit { } }) - this.map.plugin(["AMap.MarkerClusterer"], () => { - var gridSize = 60 - var count = waterMarkerArrcluster.length; - var _renderClusterMarker = function (context) { - var factor = Math.pow(context.count / count, 1 / 18); + var gridSize = 60 + var count = waterMarkerArrcluster.length; + + let render = MapFactory.RenderClusterMarkerInstance(); + render.contentRender = (contextCount) => { + var factor = Math.pow(contextCount / count, 1 / 18); var div = document.createElement('div'); var Hue = 180 - factor * 180; var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)'; @@ -235,36 +238,38 @@ export class WaterRoadComponent implements OnInit { var borderColor = 'hsla(' + Hue + ',100%,40%,1)'; var shadowColor = 'hsla(' + Hue + ',100%,90%,1)'; div.style.backgroundColor = bgColor; - var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20); + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); div.style.width = div.style.height = size + 'px'; div.style.border = 'solid 1px ' + borderColor; div.style.borderRadius = size / 2 + 'px'; - // div.style.boxShadow = '0 0 5px ' + shadowColor; - div.innerHTML = context.count; + div.style.boxShadow = '0 0 5px ' + shadowColor; + div.innerHTML = contextCount; div.style.lineHeight = size + 'px'; div.style.color = fontColor; div.style.fontSize = '14px'; div.style.textAlign = 'center'; - context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2)); - context.marker.setContent(div) - }; - var _renderMarker = (context) => { - var content = ``; - var offset = new AMap.Pixel(-12.5, -12.5); - context.marker.setContent(content) - context.marker.setOffset(offset) - } - this.waterCluster = new AMap.MarkerCluster(this.map, waterMarkerArrcluster, { - gridSize: gridSize, // 设置网格像素大小 - renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 - renderMarker: _renderMarker, // 自定义非聚合点样式 - }); - this.waterCluster.on('click', (e) => { - if (e.clusterData.length == 1) { + return div; + }; + render.pixelRender = (contextCount) => { + var size = Math.round(30 + Math.pow(contextCount / count, 1 / 5) * 20); + return MapFactory.PixelInstance(-size / 2, -size / 2); + }; - } - }) + render.contentNonRender = (src) => { + return ``; + }; + render.pixelNonRender = () => { + return MapFactory.PixelInstance(-15, -15); + } + this.waterCluster = MapFactory.MarkerClusterInstance(this.map, waterMarkerArrcluster, { + gridSize: gridSize, // 设置网格像素大小 + render: render //自定义聚合点样式, 自定义非聚合点样式 }); + this.waterCluster.on('click',(e)=>{ + if(e.clusterData.length == 1){ + + } + },this) } @@ -273,7 +278,7 @@ export class WaterRoadComponent implements OnInit { this.watertForm.reset() this.watertForm.controls.areaWater.setValue('0') this.map.remove(this.circleofwater) - this.waterCluster.setData([]) + this.waterCluster? this.waterCluster.setData([]) : null } //计算两地距离 @@ -281,8 +286,7 @@ export class WaterRoadComponent implements OnInit { let p1 = [bounds.northEast.lng, bounds.northEast.lat]; let p2 = [bounds.northEast.lng, bounds.southWest.lat]; // 返回 p1 到 p2 间的地面距离,单位:米 - let dis = AMap.GeometryUtil.distance(p1, p2); - return dis + return this.map.distance(p1, p2); } //构造水源checkbox控制器 @@ -294,24 +298,24 @@ export class WaterRoadComponent implements OnInit { } //地图初始化 - unitMarker: any//单位标点 - newPositionMarkerContent: any = - '
' + - ' ' + - '
' - creatMap() { - this.map = new AMap.Map('center', { + unitMarker:IMarker//单位标点 + newPositionMarkerContent:any = + '
' + + ' ' + + '
' + creatMap(){ + this.map = MapFactory.MapInstance('center',{ zoom: 13, //初始地图级别 WebGLParams: { preserveDrawingBuffer: true } }); - if (this.unitData.location && this.unitData.location.x) { - this.map.setCenter([this.unitData.location.x, this.unitData.location.y]); - this.unitMarker = new AMap.Marker({ - position: [this.unitData.location.x, this.unitData.location.y], + if(this.unitData.location && this.unitData.location.x){ + this.map.setCenter([this.unitData.location.x,this.unitData.location.y]); + this.unitMarker = MapFactory.MarkerInstance({ + position: [this.unitData.location.x,this.unitData.location.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-10, -13) + offset: MapFactory.PixelInstance(-10, -13) }) // 将 markers 添加到地图 this.map.add(this.unitMarker); diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts index c138d87..19ae75f 100644 --- a/src/app/pages/login/login.component.ts +++ b/src/app/pages/login/login.component.ts @@ -1,148 +1,150 @@ -import { Component, OnInit } from '@angular/core'; +import { ApplicationRef, Component, ComponentFactoryResolver, Injector, OnInit } from '@angular/core'; import { HttpClient } from '@angular/common/http' import { Data } from '../../interface' -import { Router,ActivatedRoute } from '@angular/router' -import {CacheTokenService} from '../../http-interceptors/cache-token.service'//引入服务 -import { MatSnackBar,MatSnackBarConfig } from '@angular/material/snack-bar'; -import { MatDialog,MatDialogRef } from '@angular/material/dialog'; - - +import { Router, ActivatedRoute } from '@angular/router' +import { CacheTokenService } from '../../http-interceptors/cache-token.service'//引入服务 +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import { MatDialog, MatDialogRef } from '@angular/material/dialog'; @Component({ - selector: 'app-login', - templateUrl: './login.component.html', - styleUrls: ['./login.component.scss'], + selector: 'app-login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.scss'], }) export class LoginComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,public token:CacheTokenService,public snackBar: MatSnackBar, public dialog: MatDialog) { } - - ngOnInit() { - this.automaticLogin() - } - - errmsg :string = '' - - onSubmit(e){ - this.http.post('/api/Account/SignIn',{ - name: e.name, - password: e.password}).subscribe( (data: Data) => { - sessionStorage.setItem("level",data.level); - sessionStorage.setItem("token",data.token); - sessionStorage.setItem("refreshToken",data.refreshToken); - sessionStorage.setItem("isDefaultPassword",data.isDefaultPassword);//是否需要修改默认密码 - this.http.get('/api/Account/NavMenus').subscribe((data:any)=>{ - let isHave = data.find(item=>{ return item.url == "/statisticanalysis/home"}) - let isHaveGis = data.find(item=>{ return item.url == "/gis"}) - if (isHave) { - this.router.navigate([`/statisticanalysis/home`]) - this.dialogChangePassword() - return - } else if(isHaveGis){ - this.router.navigate([`/gis`]) - this.dialogChangePassword() - return - } else if(data.length != 0){ - this.router.navigate([`/keyUnit`]) - this.dialogChangePassword() - return - data.forEach(item => { - if(item.url){ - - } - }); - }else{ - this.snackBar.open('该用户角色未分配任何菜单', '确定', { - duration: 3000 + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService, public snackBar: MatSnackBar, public dialog: MatDialog) { + + } + + ngOnInit() { + this.automaticLogin() + } + + errmsg: string = '' + + onSubmit(e) { + this.http.post('/api/Account/SignIn', { + name: e.name, + password: e.password + }).subscribe((data: Data) => { + sessionStorage.setItem("level", data.level); + sessionStorage.setItem("token", data.token); + sessionStorage.setItem("refreshToken", data.refreshToken); + sessionStorage.setItem("isDefaultPassword", data.isDefaultPassword);//是否需要修改默认密码 + this.http.get('/api/Account/NavMenus').subscribe((data: any) => { + let isHave = data.find(item => { return item.url == "/statisticanalysis/home" }) + let isHaveGis = data.find(item => { return item.url == "/gis" }) + if (isHave) { + this.router.navigate([`/statisticanalysis/home`]) + this.dialogChangePassword() + return + } else if (isHaveGis) { + this.router.navigate([`/gis`]) + this.dialogChangePassword() + return + } else if (data.length != 0) { + this.router.navigate([`/keyUnit`]) + this.dialogChangePassword() + return + data.forEach(item => { + if (item.url) { + + } + }); + } else { + this.snackBar.open('该用户角色未分配任何菜单', '确定', { + duration: 3000 + }); + } + + }) + if (e.notlogin) { //7天免登录时 + localStorage.setItem("isnologin", "true") + localStorage.setItem("token", data.token) + localStorage.setItem("refreshToken", data.refreshToken) + } + //调用服务中的function刷新token + this.token.startUp() + }, + (err) => { this.errmsg = err } + ) + } + + + dialogChangePassword() { + if (sessionStorage.getItem('isDefaultPassword') == 'true') { + let dialogRef = this.dialog.open(ChangepasswordComponent2, + { width: '348px' }); + + dialogRef.afterClosed().subscribe((data) => { + sessionStorage.setItem('isDefaultPassword', 'false') }); - } - - }) - if(e.notlogin){ //7天免登录时 - localStorage.setItem("isnologin","true") - localStorage.setItem("token",data.token) - localStorage.setItem("refreshToken",data.refreshToken) } - //调用服务中的function刷新token - this.token.startUp() - }, - (err) => {this.errmsg = err} - ) - } - - - dialogChangePassword(){ - if(sessionStorage.getItem('isDefaultPassword') == 'true'){ - let dialogRef = this.dialog.open(ChangepasswordComponent2, - {width:'348px'}); - - dialogRef.afterClosed().subscribe((data)=>{ - sessionStorage.setItem('isDefaultPassword','false') - }); + } + } + //7天免登录自动登录 + automaticLogin() { + let isNoLogin = localStorage.getItem("isnologin") + if (isNoLogin) { //7天免登录时 + let token = localStorage.getItem("token"); + let refreshToken = localStorage.getItem("refreshToken"); + this.http.post('/api/Account/RefreshToken', { + token: token, + refreshToken: refreshToken + }).subscribe((data: any) => { + sessionStorage.setItem("level", data.level); + sessionStorage.setItem("token", data.token); + sessionStorage.setItem("refreshToken", data.refreshToken); + this.token.startUp() + this.router.navigate(['/keyUnit']) + this.snackBar.open('已自动登录', '确定', { duration: 3000 }); + }) + } //if + + } + + //打开弹窗 + open() { + this.snackBar.open('请联系管理员', '确定', { + duration: 3000 + }); } - } - //7天免登录自动登录 - automaticLogin () { - let isNoLogin = localStorage.getItem("isnologin") - if (isNoLogin) { //7天免登录时 - let token = localStorage.getItem("token"); - let refreshToken = localStorage.getItem("refreshToken"); - this.http.post('/api/Account/RefreshToken', { - token: token, - refreshToken: refreshToken}).subscribe((data:any)=>{ - sessionStorage.setItem("level",data.level); - sessionStorage.setItem("token",data.token); - sessionStorage.setItem("refreshToken",data.refreshToken); - this.token.startUp() - this.router.navigate(['/keyUnit']) - this.snackBar.open('已自动登录', '确定', {duration: 3000}); - }) - } //if - - } - - //打开弹窗 - open () { - this.snackBar.open('请联系管理员', '确定', { - duration: 3000 - }); - } } @Component({ - selector: 'app-changepassword', - templateUrl: './changePassword.html', - styleUrls: ['./changepassword.scss'] + selector: 'app-changepassword', + templateUrl: './changePassword.html', + styleUrls: ['./changepassword.scss'] }) export class ChangepasswordComponent2 implements OnInit { - - constructor(private http:HttpClient,public snackBar: MatSnackBar, - public dialogRef: MatDialogRef) { } - - ngOnInit() { - } - errmsg :string = '' - - onSubmit(e){ - this.http.put( - '/api/Account/Password', - { - newPassword: e.newPassword, - password: 'SHya119!@' - } - ).subscribe(data=> { - this.dialogRef.close(data); - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('密码修改成功','确定',config); - },(err) => - {this.errmsg = err} - ) - } + + constructor(private http: HttpClient, public snackBar: MatSnackBar, + public dialogRef: MatDialogRef) { } + + ngOnInit() { + } + errmsg: string = '' + + onSubmit(e) { + this.http.put( + '/api/Account/Password', + { + newPassword: e.newPassword, + password: 'SHya119!@' + } + ).subscribe(data => { + this.dialogRef.close(data); + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('密码修改成功', '确定', config); + }, (err) => { this.errmsg = err } + ) + } diff --git a/src/app/pages/pages-routing.module.ts b/src/app/pages/pages-routing.module.ts index b17d918..25b1d60 100644 --- a/src/app/pages/pages-routing.module.ts +++ b/src/app/pages/pages-routing.module.ts @@ -1,10 +1,8 @@ import { Routes, RouterModule } from '@angular/router'; import { NgModule } from '@angular/core'; -import { HomeComponent } from './home/home.component'; -import { HomedetailComponent } from './homedetail/homedetail.component'; + const routes: Routes = [ - { path: '', component: HomeComponent}, - { path: 'detail', component: HomedetailComponent}, + ]; @NgModule({ diff --git a/src/app/pages/pages.component.html b/src/app/pages/pages.component.html index c56369e..8b13789 100644 --- a/src/app/pages/pages.component.html +++ b/src/app/pages/pages.component.html @@ -1 +1 @@ -

pages works!

+ diff --git a/src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts b/src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts index d75ec80..e7b08f5 100644 --- a/src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts +++ b/src/app/plan-audit/fireforce-audit/fireforce-audit.component.ts @@ -2,10 +2,12 @@ import { HttpClient } from '@angular/common/http'; import { Component, Input, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; +import { MapFactory } from '@src/modules/map/declare/factory'; +import { IMap, IMarker } from '@src/modules/map/declare/map'; import Viewer from 'viewerjs' import { ViewDetailsComponent } from '../view-details/view-details.component'; declare var CryptoJS -declare var AMap: any; + @Component({ selector: 'app-fireforce-audit', templateUrl: './fireforce-audit.component.html', @@ -37,16 +39,16 @@ export class FireforceAuditComponent implements OnInit { this.FireForceDetailInfo.RelevantInfomationData ? this.AttachmentArr = JSON.parse(this.FireForceDetailInfo.RelevantInfomationData) : null console.log(789,this.ZongcontactData) setTimeout(() => { - this.map = new AMap.Map('container', { + this.map = MapFactory.MapInstance('container', { zoom:18 }) if(this.FireForceDetailInfo.location && this.FireForceDetailInfo.location.x){ this.map.setCenter([this.FireForceDetailInfo.location.x,this.FireForceDetailInfo.location.y]); - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.FireForceDetailInfo.location.x,this.FireForceDetailInfo.location.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-10, -12) + offset: MapFactory.PixelInstance(-10, -12) }) // 将 markers 添加到地图 this.map.add(this.newPositionMarker); @@ -56,8 +58,8 @@ export class FireforceAuditComponent implements OnInit { }, 0); } - map:any - newPositionMarker:any + map:IMap + newPositionMarker:IMarker newPositionMarkerContent:any = '
' + ' ' + @@ -161,32 +163,13 @@ export class FireforceAuditComponent implements OnInit { } if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){ let fetchUrl = item.objectName - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - let json={ - doc: { - docId: docId, - title: item.fileName, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + }else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) } if(suffix == 'mp4'){ const dialogRef = this.dialog.open(ViewDetailsComponent, {//调用open方法打开对话框并且携带参数过去 diff --git a/src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.ts b/src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.ts index ff71078..3ddc08d 100644 --- a/src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.ts +++ b/src/app/plan-audit/linkageforces-audit/linkageforces-audit.component.ts @@ -4,8 +4,10 @@ import { ViewDetailsComponent } from '../view-details/view-details.component'; import Viewer from 'viewerjs' import { MatSnackBar } from '@angular/material/snack-bar'; import { MatDialog } from '@angular/material/dialog'; +import { MapFactory } from '@src/modules/map/declare/factory'; +import { IMap, IMarker } from '@src/modules/map/declare/map'; declare var CryptoJS -declare var AMap: any; + @Component({ selector: 'app-linkageforces-audit', templateUrl: './linkageforces-audit.component.html', @@ -33,8 +35,8 @@ export class LinkageforcesAuditComponent implements OnInit { {id:14,name:'住建',imgUrl:'/assets/linkageForces/zhujian.png',isChecked:false} ] AttachmentArr:any//附件 - map:any - newPositionMarker:any + map:IMap + newPositionMarker:IMarker newPositionMarkerContent:any = '
' + ' ' + @@ -43,16 +45,16 @@ export class LinkageforcesAuditComponent implements OnInit { this.AttachmentArr = JSON.parse(this.LinkageForceDetailInfo.relevantInfomationData) this.LinkageForceDetailInfo.location ? null : this.LinkageForceDetailInfo.location={x:null,y:null} setTimeout(() => { - this.map = new AMap.Map('container', { + this.map = MapFactory.MapInstance('container', { zoom:18 }) if(this.LinkageForceDetailInfo.location && this.LinkageForceDetailInfo.location.x){ this.map.setCenter([this.LinkageForceDetailInfo.location.x,this.LinkageForceDetailInfo.location.y]); - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.LinkageForceDetailInfo.location.x,this.LinkageForceDetailInfo.location.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-10, -12) + offset: MapFactory.PixelInstance(-10, -12) }) // 将 markers 添加到地图 this.map.add(this.newPositionMarker); @@ -171,32 +173,13 @@ export class LinkageforcesAuditComponent implements OnInit { } if(suffix == 'docx' || suffix == 'doc' || suffix == 'pdf'){ let fetchUrl = item.objectName - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - let json={ - doc: { - docId: docId, - title: item.fileName, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + }else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) } if(suffix == 'mp4'){ const dialogRef = this.dialog.open(ViewDetailsComponent, {//调用open方法打开对话框并且携带参数过去 diff --git a/src/app/plan-audit/plan-record/plan-record.component.ts b/src/app/plan-audit/plan-record/plan-record.component.ts index 3aa2230..2b0e425 100644 --- a/src/app/plan-audit/plan-record/plan-record.component.ts +++ b/src/app/plan-audit/plan-record/plan-record.component.ts @@ -6,10 +6,10 @@ * @LastEditors: sueRimn * @LastEditTime: 2021-07-08 09:35:53 */ -import { Component, OnInit,Inject } from '@angular/core'; +import { Component, OnInit, Inject } from '@angular/core'; import { FormControl } from '@angular/forms'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; -import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { HttpClient } from '@angular/common/http' import { DomSanitizer } from '@angular/platform-browser'; import { Viewer } from 'photo-sphere-viewer'; @@ -22,69 +22,69 @@ declare var CryptoJS }) export class PlanRecordComponent implements OnInit { - constructor(private http:HttpClient,public snackBar: MatSnackBar,private sanitizer: DomSanitizer,public dialog: MatDialog) { } + constructor(private http: HttpClient, public snackBar: MatSnackBar, private sanitizer: DomSanitizer, public dialog: MatDialog) { } pcshow ngOnInit(): void { - if(window.matchMedia("(max-width: 1300px)").matches){ - this.pcshow=false - }else{ - this.pcshow=true + if (window.matchMedia("(max-width: 1300px)").matches) { + this.pcshow = false + } else { + this.pcshow = true } let level = sessionStorage.getItem("level"); - if(level == "0"){//如果是总队 + if (level == "0") {//如果是总队 this.preparelevels = [ - {name:"总队",value:"0"}, - {name:"支队",value:"1"}, - {name:"大队",value:"2"}, - {name:"中队",value:"3"} + { name: "总队", value: "0" }, + { name: "支队", value: "1" }, + { name: "大队", value: "2" }, + { name: "中队", value: "3" } ] - + } - if(level == "1"){//如果是支队 + if (level == "1") {//如果是支队 this.preparelevels = [ - {name:"支队",value:"1"}, - {name:"大队",value:"2"}, - {name:"中队",value:"3"} + { name: "支队", value: "1" }, + { name: "大队", value: "2" }, + { name: "中队", value: "3" } ] - + } - if(level == "2"){//如果是大队 + if (level == "2") {//如果是大队 this.preparelevels = [ - {name:"大队",value:"2"}, - {name:"中队",value:"3"} + { name: "大队", value: "2" }, + { name: "中队", value: "3" } ] - + } - if(level == "3"){//如果是中队 + if (level == "3") {//如果是中队 this.preparelevels = [ - {name:"中队",value:"3"} + { name: "中队", value: "3" } ] - + } - this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src); + this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src); this.getAlltabledate() } - wordShow=true + wordShow = true iframeSrc - src='' + src = '' selected = new FormControl(0); //选项卡 实例 - preparelevels:any - level=''//类型 - verifyState=''//审核状态 + preparelevels: any + level = ''//类型 + verifyState = ''//审核状态 projectlevel//组织机构 PlanLevel//编制级别 addtime//时间 endtime//结束时间 count//一共多少条 tableDate - showPvt=false//全景图是否显示 - shenheTable=[]//选中要审核的对象 + showPvt = false//全景图是否显示 + shenheTable = []//选中要审核的对象 chuorzhong//判断初审还是终审 radioid//选中的id - showtype=-1//0:word,1:全景图,2:二维三维,3:重点单位 - compantData={name:'',buildingTypes:[],address:''} + showtype = -1//0:word,1:全景图,2:二维三维,3:重点单位 + compantData = { name: '', buildingTypes: [], address: '' } organizationName planData id @@ -94,192 +94,170 @@ export class PlanRecordComponent implements OnInit { companyName //获取表格数据 - getAlltabledate(){ - - let paramsdata:any = { - Operation:this.level||[], - ContentType:Number(this.projectlevel)||[], - Level:this.PlanLevel||[], - verifyState:this.verifyState||[1,2,4,5], - QueryStartTime:this.addtime||'', - QueryEndTime:this.endtime||'' + getAlltabledate() { + + let paramsdata: any = { + Operation: this.level || [], + ContentType: Number(this.projectlevel) || [], + Level: this.PlanLevel || [], + verifyState: this.verifyState || [1, 2, 4, 5], + QueryStartTime: this.addtime || '', + QueryEndTime: this.endtime || '' } - this.http.get("/api/ContentVerifies",{params:paramsdata}).subscribe((data:any)=>{ + this.http.get("/api/ContentVerifies", { params: paramsdata }).subscribe((data: any) => { //console.log(data) - this.tableDate=data.items - this.count=data.totalCount + this.tableDate = data.items + this.count = data.totalCount }) } //提交查询 - onSubmit(value){ + onSubmit(value) { //console.log(value) this.getAlltabledate() } //刷新 - record(){ - this.verifyState='' - this.level='' - this.projectlevel='' - this.addtime='' - this.endtime='' + record() { + this.verifyState = '' + this.level = '' + this.projectlevel = '' + this.addtime = '' + this.endtime = '' let level = sessionStorage.getItem("level"); - this.PlanLevel='' + this.PlanLevel = '' this.getAlltabledate() } //表格点击事件 viewer//全景图对象 - waterData:any//需要传递给子组件的水源信息 - LinkageForceDetailInfo:any//需要传递给子组件的联动力量信息 - fireForceDetailInfo:any//需要传递给子组件的消防力量信息 - postlevel:any - bianzhi=false - tableClick(e,item){ + waterData: any//需要传递给子组件的水源信息 + LinkageForceDetailInfo: any//需要传递给子组件的联动力量信息 + fireForceDetailInfo: any//需要传递给子组件的消防力量信息 + postlevel: any + bianzhi = false + tableClick(e, item) { this.showtype = -1 //e.target.parentElement.bgColor='#2196F3' // console.log(item) - this.organizationName='' - this.itemid=item.itemId - this.id=item.id - this.fetchUrl='' - this.viewer={} - if(item.contentType == 11){ - this.bianzhi=false - window.setTimeout(()=>{ + this.organizationName = '' + this.itemid = item.itemId + this.id = item.id + this.fetchUrl = '' + this.viewer = {} + if (item.contentType == 11) { + this.bianzhi = false + window.setTimeout(() => { this.showtype = 3 - sessionStorage.setItem('companyId',item.itemId) - },0) - }else if(item.contentType == 12){ - this.bianzhi=false + sessionStorage.setItem('companyId', item.itemId) + }, 0) + } else if (item.contentType == 12) { + this.bianzhi = false //水源 - this.http.get(`/api/WaterSources/${item.itemId}`).subscribe((data)=>{ + this.http.get(`/api/WaterSources/${item.itemId}`).subscribe((data) => { this.waterData = data this.showtype = 12 }) - }else if(item.contentType == 13){ - this.bianzhi=false + } else if (item.contentType == 13) { + this.bianzhi = false //消防力量 - this.http.get(`/api/CustomFireForce/${item.itemId}`).subscribe((data:any)=>{ - if(data.forceType != 0){//如果是其他消防力量 + this.http.get(`/api/CustomFireForce/${item.itemId}`).subscribe((data: any) => { + if (data.forceType != 0) {//如果是其他消防力量 this.postlevel = 4 - }else{ + } else { this.postlevel = data.level } // console.log('xxx',data) - data.fireForceDetailInfo.location ? null : data.fireForceDetailInfo.location={x:null,y:null} + data.fireForceDetailInfo.location ? null : data.fireForceDetailInfo.location = { x: null, y: null } this.fireForceDetailInfo = data.fireForceDetailInfo this.showtype = 13 }) - }else if(item.contentType == 14){ - this.bianzhi=false + } else if (item.contentType == 14) { + this.bianzhi = false //联动力量 - this.http.get(`/api/LinkageForces/${item.itemId}`).subscribe((data:any)=>{ + this.http.get(`/api/LinkageForces/${item.itemId}`).subscribe((data: any) => { - data.location ? null : data.location={x:null,y:null} + data.location ? null : data.location = { x: null, y: null } this.LinkageForceDetailInfo = data this.showtype = 14 }) - }else{ - this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data:any)=>{ - this.companyId=data.companyId - this.companyName=data.companyName - if(data.planMode==2){ - this.bianzhi=true - this.src=`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${data.companyId}&planName=${data.name}&unitName=${data.companyName}&planCategory=${data.planCategory}&planId=${data.id}&unitTypeId=${data.company.buildingTypes[0].id}&orName=${data.company.organizationName}&orId=${data.company.organizationId}&pattern=false` + } else { + this.http.get(`/api/PlanComponents/${item.itemId}`).subscribe((data: any) => { + this.companyId = data.companyId + this.companyName = data.companyName + if (data.planMode == 2) { + this.bianzhi = true + this.src = `/planManagement/createplanonlinefive?navIsOpen=false&companyId=${data.companyId}&planName=${data.name}&unitName=${data.companyName}&planCategory=${data.planCategory}&planId=${data.id}&unitTypeId=${data.company.buildingTypes[0].id}&orName=${data.company.organizationName}&orId=${data.company.organizationId}&pattern=false` //this.src=`/keyUnit/viewunitinfoplan?id=${data.companyId}&orName=${data.company.organizationId}&orId=${data.company.organizationName}` - }else{ - this.bianzhi=false - if(data.planType!=2&&data.planType!=1){ - this.fetchUrl=data.attachmentUrls[0] - var index=this.fetchUrl.indexOf("\/") - if(this.fetchUrl.substr(0,index)=='psw'){ - this.showtype=1 - var obj=document.getElementById('viewer') - if(obj!=null){ - obj.innerHTML='' + } else { + this.bianzhi = false + if (data.planType != 2 && data.planType != 1) { + this.fetchUrl = data.attachmentUrls[0] + var index = this.fetchUrl.indexOf("\/") + if (this.fetchUrl.substr(0, index) == 'psw') { + this.showtype = 1 + var obj = document.getElementById('viewer') + if (obj != null) { + obj.innerHTML = '' } - window.setTimeout(()=>{ + window.setTimeout(() => { this.viewer = new Viewer({ container: document.querySelector('#viewer'), - panorama:'/api/Objects/PlanPlatform/'+ this.fetchUrl, - + panorama: '/api/Objects/PlanPlatform/' + this.fetchUrl, + }); }) - - }else{ + + } else { this.lookWord() } - }else{ - this.organizationName=item.organizationName + } else { + this.organizationName = item.organizationName this.planData = data this.handleData() return - + //this.src=`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1` //this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src); //window.open(`/planAudit/planpass?id=${data.companyId}&companyName=${data.companyName}&auditPlanId=${data.id}&auditStatus=${data.auditStatus}&planType=1`) } } - - - - }) + + + + }) } - - - - if(e.checked){ + + + + if (e.checked) { this.shenheTable.push(item) } - else{ - for(var i=0;i{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - //title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+this.fetchUrl - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - this.src=`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}` - this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src); - //window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) - }) + lookWord() { + this.showtype = 0 + let src + let suffix = this.fetchUrl.split('.')[this.fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = this.fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + src = `/api/Objects/PlanPlatform/` + arr.join('.') + } else if (suffix == 'pdf') { + src = `/api/Objects/PlanPlatform/` + this.fetchUrl + } + this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(src); } //查看按钮跳转 - lookNew(){ + lookNew() { window.open(this.src) } @@ -287,37 +265,37 @@ export class PlanRecordComponent implements OnInit { thirdPartyURL planType twoOrthree - handleData () { - this.compantData={name:'',buildingTypes:[],address:''} + handleData() { + this.compantData = { name: '', buildingTypes: [], address: '' } this.planType = this.planData.planMode let data = this.planData // console.log(data) - if(data.planType==1){ - this.twoOrthree=2 - }else if(data.planType==2){ - this.twoOrthree=3 + if (data.planType == 1) { + this.twoOrthree = 2 + } else if (data.planType == 2) { + this.twoOrthree = 3 } - if (this.planData.planMode==0) { //预案planMode=0时, 查看word + if (this.planData.planMode == 0) { //预案planMode=0时, 查看word //this.lookWord() - } else if (this.planData.planMode==1) { //预案planMode=1时, 解析文档 + } else if (this.planData.planMode == 1) { //预案planMode=1时, 解析文档 - } else if (this.planData.planMode==2) { //预案planMode=2时, 跳查看页面组件 - this.showtype=2 - this.http.get(`/api/Plans/${data.companyId}`).subscribe((data:any)=>{ - data && data.company? this.compantData = data.company : null + } else if (this.planData.planMode == 2) { //预案planMode=2时, 跳查看页面组件 + this.showtype = 2 + this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => { + data && data.company ? this.compantData = data.company : null }) - sessionStorage.setItem("buildingTypeId", this.compantData.buildingTypes.length? this.compantData.buildingTypes[0].id: undefined); - sessionStorage.setItem("companyId",this.companyId); - sessionStorage.setItem("planId",this.itemid); - sessionStorage.setItem("editable",'0'); - sessionStorage.setItem("planName",data.name) + sessionStorage.setItem("buildingTypeId", this.compantData.buildingTypes.length ? this.compantData.buildingTypes[0].id : undefined); + sessionStorage.setItem("companyId", this.companyId); + sessionStorage.setItem("planId", this.itemid); + sessionStorage.setItem("editable", '0'); + sessionStorage.setItem("planName", data.name) let companyId = sessionStorage.getItem("companyId") - this.thirdPartyURL=this.sanitizer.bypassSecurityTrustResourceUrl(`/keyUnit/viewunitinfoplans?id=${companyId}`); + this.thirdPartyURL = this.sanitizer.bypassSecurityTrustResourceUrl(`/keyUnit/viewunitinfoplans?id=${companyId}`); //window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`) - } else if (this.planData.planMode==3) { //预案planMode=3时, 第三方网址' - this.showtype=2 - this.http.get(`/api/Plans/${data.companyId}`).subscribe((data:any)=>{ - data && data.company? this.compantData = data.company : null + } else if (this.planData.planMode == 3) { //预案planMode=3时, 第三方网址' + this.showtype = 2 + this.http.get(`/api/Plans/${data.companyId}`).subscribe((data: any) => { + data && data.company ? this.compantData = data.company : null }) //this.dialog.open(show3D,{width:'1350px',height:'700px',data:{url:data.url}}); //打开图片弹窗 this.thirdPartyURL = this.sanitizer.bypassSecurityTrustResourceUrl(data.url) @@ -326,8 +304,8 @@ export class PlanRecordComponent implements OnInit { } //打开三维预案弹窗 - oopen3Dshow(){ - this.dialog.open(recordshow3D,{width:'1650px',height:'850px',data:{url:this.thirdPartyURL,twoOrthree:this.twoOrthree}}); + oopen3Dshow() { + this.dialog.open(recordshow3D, { width: '1650px', height: '850px', data: { url: this.thirdPartyURL, twoOrthree: this.twoOrthree } }); } } @@ -337,11 +315,11 @@ export class PlanRecordComponent implements OnInit { templateUrl: './show3D.html', styleUrls: ['./plan-record.component.scss'] }) -export class recordshow3D{ - constructor(private sanitizer: DomSanitizer,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public dialog: MatDialog) {} +export class recordshow3D { + constructor(private sanitizer: DomSanitizer, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public dialog: MatDialog) { } ngOnInit(): void { // console.log(this.data) - this.threedUrl=this.sanitizer.bypassSecurityTrustResourceUrl(this.data.url.changingThisBreaksApplicationSecurity) + this.threedUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.data.url.changingThisBreaksApplicationSecurity) } threedUrl } diff --git a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts index 24a57e5..2ca7838 100644 --- a/src/app/plan-audit/wait-examineer/wait-examineer.component.ts +++ b/src/app/plan-audit/wait-examineer/wait-examineer.component.ts @@ -14,7 +14,7 @@ import { HttpClient } from '@angular/common/http' declare var CryptoJS import { DomSanitizer } from '@angular/platform-browser'; import { Viewer as photoViewer } from 'photo-sphere-viewer'; -import Viewer from 'viewerjs'; +import Viewer from 'viewerjs'; declare var echarts: any; @@ -61,7 +61,7 @@ export class WaitExamineerComponent implements OnInit { ] } this.getAlltabledate() - this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src); + this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.src); } planTypeIndex //平面图类型 选择是总平面图还是层平面图 @@ -133,9 +133,9 @@ export class WaitExamineerComponent implements OnInit { this.getAlltabledate() } - lookImg(imgUrl){ + lookImg(imgUrl) { console.log(imgUrl) - let dom = document.getElementById(`viewerjs`) + let dom = document.getElementById(`viewerjs`) let pObjs = dom.childNodes; let node = document.createElement("img") node.style.display = "none"; @@ -144,7 +144,7 @@ export class WaitExamineerComponent implements OnInit { dom.appendChild(node) setTimeout(() => { let viewer = new Viewer(document.getElementById(`viewerjs`), { - hidden:()=>{ + hidden: () => { dom.removeChild(pObjs[0]); viewer.destroy(); } @@ -170,15 +170,15 @@ export class WaitExamineerComponent implements OnInit { this.selectedItem = item console.log(item) // console.log('当前选择的信息',JSON.parse(this.selectedItem.differentContent) ) - if(item.contentType == 11 && this.selectedItem.differentContent){ - + if (item.contentType == 11 && this.selectedItem.differentContent) { + let differentContent = JSON.parse(this.selectedItem.differentContent) - + // 单位信息 this.differentContentOfUnitInfo = differentContent.filter(item => item.propertyName == 'basicInfo') // 实景图 this.differentContentOfPicture = differentContent.filter(item => item.propertyName == 'realityImageGroups') - + //建筑信息 this.differentContentOfBuildingsInfo = JSON.parse(JSON.stringify(differentContent.filter(item => item.propertyName == 'buildings')[0])) this.differentContentOfBuildingsInfo.childrens.forEach(element => { @@ -197,7 +197,7 @@ export class WaitExamineerComponent implements OnInit { }); } - + // console.log('功能分区', this.differentContentOfFunction) @@ -319,38 +319,16 @@ export class WaitExamineerComponent implements OnInit { //毕升 lookWord() { this.showtype = 0 - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + this.fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - let filename:string - this.http.get(`/api/ObjectMetadata/PlanPlatform/${this.fetchUrl}`).subscribe((data:any)=>{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - //title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+this.fetchUrl - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - this.src=`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}` - this.iframeSrc=this.sanitizer.bypassSecurityTrustResourceUrl(this.src); - //window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) - }) + let src + let suffix = this.fetchUrl.split('.')[this.fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = this.fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + src = `/api/Objects/PlanPlatform/` + arr.join('.') + }else if (suffix == 'pdf') { + src = `/api/Objects/PlanPlatform/` + this.fetchUrl + } + this.iframeSrc = this.sanitizer.bypassSecurityTrustResourceUrl(src); } //查看按钮跳转 lookNew() { diff --git a/src/app/plan-audit/water-audit/water-audit.component.ts b/src/app/plan-audit/water-audit/water-audit.component.ts index 680375c..a62fdf0 100644 --- a/src/app/plan-audit/water-audit/water-audit.component.ts +++ b/src/app/plan-audit/water-audit/water-audit.component.ts @@ -1,5 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; -declare var AMap: any; +import { MapFactory } from '@src/modules/map/declare/factory'; +import { IMap, IMarker } from '@src/modules/map/declare/map'; + @Component({ selector: 'app-water-audit', templateUrl: './water-audit.component.html', @@ -8,8 +10,8 @@ declare var AMap: any; export class WaterAuditComponent implements OnInit { @Input() public waterData: any;//data名字根据引用场景自定义 constructor() { } - map:any - newPositionMarker:any + map:IMap + newPositionMarker:IMarker newPositionMarkerContent:any = '
' + ' ' + @@ -22,16 +24,16 @@ export class WaterAuditComponent implements OnInit { this.poolData = this.waterData.detailData this.naturalWaterData = this.waterData.detailData setTimeout(() => { - this.map = new AMap.Map('container', { + this.map = MapFactory.MapInstance('container', { zoom:18 }) if(this.waterData.location && this.waterData.location.x){ this.map.setCenter([this.waterData.location.x,this.waterData.location.y]); - this.newPositionMarker = new AMap.Marker({ + this.newPositionMarker = MapFactory.MarkerInstance({ position: [this.waterData.location.x,this.waterData.location.y], content: this.newPositionMarkerContent, - offset: new AMap.Pixel(-10, -12) + offset: MapFactory.PixelInstance(-10, -12) }) // 将 markers 添加到地图 this.map.add(this.newPositionMarker); diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.html b/src/app/plan-management/entry-plan-look/entry-plan-look.component.html index 5fbbb6b..b46cfdd 100644 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.html +++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.html @@ -80,7 +80,7 @@ 改名 编辑 - 查看 + 查看 下载 删除 diff --git a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts index ef49dae..6caf765 100644 --- a/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts +++ b/src/app/plan-management/entry-plan-look/entry-plan-look.component.ts @@ -106,8 +106,8 @@ export class EntryPlanLookComponent implements OnInit { } //查看预案 lookPlan(e) { + console.log(e) if (e.planType == 16 || e.planType == 4 || e.planType == 8) { - // console.log(e.attachmentUrls) var index = e.attachmentUrls[0].indexOf("\/") if (e.attachmentUrls[0].substr(0, index) == 'psw') { const dialogRef = this.dialog.open(PsViewer, { @@ -121,54 +121,27 @@ export class EntryPlanLookComponent implements OnInit { data: data.attachmentUrls, }); dialogRef.afterClosed().subscribe(); - } - else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf' - ||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC' - ||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */ { - let filename: string + } else { let fetchUrl = e.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse = JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data: any) => { - filename = data.fileName - let json = { - doc: { - docId: docId, - title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/` + fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: e.auditStatus != '1' && e.auditStatus != '16' ? [ - 'FILE_READ', 'FILE_WRITE', 'FILE_DOWNLOAD', 'FILE_PRINT' - ] : [ - 'FILE_READ', 'FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, + if (fetchUrl) { + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + } else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); } - var stringjson = JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) - }) + } else { + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) + } } } - /* if(e.planType == 4){ - var index=e.attachmentUrls[0].indexOf("\/") - if(e.attachmentUrls[0].substr(0,index)=='psw'){ - const dialogRef = this.dialog.open(PsViewer, { - width: '1500px', - height:'800px', - data: e.attachmentUrls[0] - }); - } - } */ if (e.planType == 1) { //如果是在线编辑 let id = e.id sessionStorage.setItem("planId", id) @@ -193,7 +166,7 @@ export class EntryPlanLookComponent implements OnInit { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - if(e.auditStatus==8){ + if (e.auditStatus == 8) { if (e.planType == 1) { //如果是在线编辑 let id = e.id sessionStorage.setItem("planId", id) @@ -206,7 +179,6 @@ export class EntryPlanLookComponent implements OnInit { } else if (e.planType == 16) { if (e.attachmentUrls == null) { - console.log(this.compantData) window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) } else { @@ -231,49 +203,49 @@ export class EntryPlanLookComponent implements OnInit { this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); } - }else{ + } else { let isTrue = confirm('编辑后审核状态会成为未审核状态,您确定要编辑吗') - if (isTrue) { - if (e.planType == 1) { //如果是在线编辑 - let id = e.id - sessionStorage.setItem("planId", id) - sessionStorage.setItem("companyId", this.companyId) - sessionStorage.setItem("buildingTypeId", this.unittypeId) - sessionStorage.setItem("editable", "1") - sessionStorage.setItem("planName", e.name) - let companyId = sessionStorage.getItem("companyId") - window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); - } - else if (e.planType == 16) { - if (e.attachmentUrls == null) { - console.log(this.compantData) - window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) + if (isTrue) { + if (e.planType == 1) { //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId", id) + sessionStorage.setItem("companyId", this.companyId) + sessionStorage.setItem("buildingTypeId", this.unittypeId) + sessionStorage.setItem("editable", "1") + sessionStorage.setItem("planName", e.name) + let companyId = sessionStorage.getItem("companyId") + window.open(`/keyUnit/editunitinfo?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); } - else { - let body = {}; - let resetAudit = true - let headers = new HttpHeaders({ - 'Content-Type': 'text/json' - }); - let options = { - headers - }; - this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { - this.getAllPlanComponents() - this.lookPlan(e) - }/* ,err => { + else if (e.planType == 16) { + if (e.attachmentUrls == null) { + console.log(this.compantData) + window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`) + } + else { + let body = {}; + let resetAudit = true + let headers = new HttpHeaders({ + 'Content-Type': 'text/json' + }); + let options = { + headers + }; + this.http.put(`/api/PlanComponents/${e.id}?resetAudit=${resetAudit}`, body, options).subscribe(data => { + this.getAllPlanComponents() + this.lookPlan(e) + }/* ,err => { this.snackBar.open(err,'确定',config); } */) - } + } - } - else { + } + else { - this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); + this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config); + } } } - } - + } allPlanComponents: any //所有预案组件 diff --git a/src/app/plan-management/meet-plan/meet-plan.component.ts b/src/app/plan-management/meet-plan/meet-plan.component.ts index 27d97c6..d3c689c 100644 --- a/src/app/plan-management/meet-plan/meet-plan.component.ts +++ b/src/app/plan-management/meet-plan/meet-plan.component.ts @@ -4,7 +4,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree' import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @@ -17,56 +17,56 @@ declare var CryptoJS }) export class MeetPlanComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } ngOnInit(): void { //console.log(window.matchMedia("(max-width: 1300px)").matches&&window.matchMedia("(max-height: 700px)").matches) - if(window.matchMedia("(max-width: 1400px)").matches){ - this.pcMore=false - this.padMore=true - this.pcfind=false - this.padjt=true - }else{ - this.pcfind=true - this.pcMore=true - this.padMore=false - this.padjt=false + if (window.matchMedia("(max-width: 1400px)").matches) { + this.pcMore = false + this.padMore = true + this.pcfind = false + this.padjt = true + } else { + this.pcfind = true + this.pcMore = true + this.padMore = false + this.padjt = false } this.levels = sessionStorage.getItem("level"); - if(this.levels == "0"){//如果是总队 + if (this.levels == "0") {//如果是总队 this.preparelevels = [ - {name:"总队",value:"1"}, - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "总队", value: "1" }, + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.levels == "1"){//如果是支队 + if (this.levels == "1") {//如果是支队 this.preparelevels = [ - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.levels == "2"){//如果是大队 + if (this.levels == "2") {//如果是大队 this.preparelevels = [ - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.levels == "3"){//如果是中队 + if (this.levels == "3") {//如果是中队 this.preparelevels = [ - {name:"中队",value:"8"} + { name: "中队", value: "8" } ] } this.getAlltabledate() } //生成word - word(id,fileName){ + word(id, fileName) { /* id :文档dom节点 fileName:文件名称(.doc) */ var header = "" + - "Export HTML to Word Document with JavaScript" + "xmlns:w='urn:schemas-microsoft-com:office:word' >" + + "Export HTML to Word Document with JavaScript" var footer = '' var sourceHTML = header + document.getElementById(id).innerHTML + footer @@ -77,12 +77,12 @@ export class MeetPlanComponent implements OnInit { fileDownload.download = fileName // 下载名称 fileDownload.click() document.body.removeChild(fileDownload) - } - levels + } + levels - preparelevels:any - plcheck:boolean //编制级别勾选框 - displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation']; + preparelevels: any + plcheck: boolean //编制级别勾选框 + displayedColumns: string[] = ['unitname', 'level', 'addname', 'addtime', 'plantype', 'passstate', 'isopen', 'projectlevel', 'operation']; tabledataSource typePlan//新预案类型 unitname//预案名称 @@ -95,97 +95,97 @@ export class MeetPlanComponent implements OnInit { unitstate//审核状态 projectlevel//编制级别 //分页 - @ViewChild(MatPaginator, {static: true}) + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any; //第几页 - + PageNumber: any; //第几页 + pcMore//pc更多 - pcput=false//pc收起 + pcput = false//pc收起 pcfind//pc查询 - padjt=false - padMore=true//pad收缩控制 - padput=false//pad收起按钮 - imgsrcopen="../../../assets/images/routdown2.png" - imgsrcdown="../../../assets/images/routup2.png" - pcInfo(){ - this.pcMore=!this.pcMore - this.pcput=!this.pcput + padjt = false + padMore = true//pad收缩控制 + padput = false//pad收起按钮 + imgsrcopen = "../../../assets/images/routdown2.png" + imgsrcdown = "../../../assets/images/routup2.png" + pcInfo() { + this.pcMore = !this.pcMore + this.pcput = !this.pcput } - padInfo(){ - this.padMore=!this.padMore - this.padput=!this.padput + padInfo() { + this.padMore = !this.padMore + this.padput = !this.padput } //获取表格数据 - getAlltabledate(){ + getAlltabledate() { let reservePlanType this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' - if(this.reservePlanType && this.reservePlanType.length != 0){ + if (this.reservePlanType && this.reservePlanType.length != 0) { reservePlanType = eval(this.reservePlanType.join("|")) - } - let paramsdata:any = { - Name:this.unitname||'', - planCategories:this.level||[6,7], + } + let paramsdata: any = { + Name: this.unitname || '', + planCategories: this.level || [6, 7], //PlanType:reservePlanType||'', - DisasterType:this.typePlan||'', - CreatorName:this.addname||'', - AuditStatus:this.unitstate|| '', - CreationTimeRangeStart:this.addtime||'', - CreationTimeRangeEnd:this.endtime||'', - PlanLevel:this.projectlevel||'', - HasChildrenPlanLevel:this.plcheck||'', + DisasterType: this.typePlan || '', + CreatorName: this.addname || '', + AuditStatus: this.unitstate || '', + CreationTimeRangeStart: this.addtime || '', + CreationTimeRangeEnd: this.endtime || '', + PlanLevel: this.projectlevel || '', + HasChildrenPlanLevel: this.plcheck || '', PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], - + PageSize: this.pageSizeOptions[0], + } - this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ + this.http.get("/api/PlanComponentsMajor", { params: paramsdata }).subscribe((data: any) => { this.length = data.totalCount this.tabledataSource = data.items }) } //分页事件 - changePage(e){ - this.PageNumber = e.pageIndex+1 + changePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAlltabledate() } //查询 - onSubmit (value) { - if(this.endtime!=undefined&&this.addtime>this.endtime){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('开始时间不能大于结束时间!','确定',config); - }else{ + onSubmit(value) { + if (this.endtime != undefined && this.addtime > this.endtime) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('开始时间不能大于结束时间!', '确定', config); + } else { this.PageNumber = 1 this.pageEvent.pageIndex = 0 this.getAlltabledate(); } - + } //删除预案 - deletePlan(id){ + deletePlan(id) { let isTrue = confirm('您确定要删除吗') - if(isTrue){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{ - this.snackBar.open('删除成功!','确定',config); - this.getAlltabledate() - },err => { - this.snackBar.open(err,'确定',config); - }) + if (isTrue) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data => { + this.snackBar.open('删除成功!', '确定', config); + this.getAlltabledate() + }, err => { + this.snackBar.open(err, '确定', config); + }) } - + } //提交审核 - submitAudit(element){ + submitAudit(element) { // console.log(element) const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; @@ -193,115 +193,96 @@ export class MeetPlanComponent implements OnInit { /* if(element.auditStatus == 4){ this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config); } */ - this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`,"").subscribe(data=>{ - this.getAlltabledate() - },err => { - this.snackBar.open(err,'确定',config); - }) - - + this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`, "").subscribe(data => { + this.getAlltabledate() + }, err => { + this.snackBar.open(err, '确定', config); + }) + + } //撤销审核 - cancelAudit(element){ + cancelAudit(element) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.http.put(`/api/PlanComponentsMajor/${element.id}/Cancel`,"").subscribe(data=>{ + this.http.put(`/api/PlanComponentsMajor/${element.id}/Cancel`, "").subscribe(data => { this.getAlltabledate() - },err => { - this.snackBar.open(err,'确定',config); + }, err => { + this.snackBar.open(err, '确定', config); }) } - - + + //查看预案 - openPlan(element){ - //fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl - let filename:string + openPlan(element) { let fetchUrl = element.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege:element.auditStatus!='1'&&element.auditStatus!='16'?[ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ]:[ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) - }) + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + } else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + } } //下载↓ - selectDownloadFile:any; //选择下载的文件 - download:any; //下载文件元数据 - downloadisLoading:boolean = false; //进度条loading加载 - downloadProgress:number=0; //进度条进度 - downloadFileName:any - fileUrls:any //当前预案附件地址 - fileDatas:any = [] - selectedFileIndex : any = 0 - selectedFileData : any - - uploadFileLonging:any + selectDownloadFile: any; //选择下载的文件 + download: any; //下载文件元数据 + downloadisLoading: boolean = false; //进度条loading加载 + downloadProgress: number = 0; //进度条进度 + downloadFileName: any + fileUrls: any //当前预案附件地址 + fileDatas: any = [] + selectedFileIndex: any = 0 + selectedFileData: any + + uploadFileLonging: any //读取下载文件信息 - readFile (element) { + readFile(element) { this.uploadFileLonging = element - element.attachmentUrls.forEach(item=>{ - this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ - data.filePige = (data.fileLength / (1024*1024)).toFixed(2) + element.attachmentUrls.forEach(item => { + this.http.get('/api/ObjectMetadata/PlanPlatform/' + item).subscribe((data: any) => { + data.filePige = (data.fileLength / (1024 * 1024)).toFixed(2) this.download = data this.downloadFile() }) }) - + } //初始化下载 - downloadFile () { + downloadFile() { this.downloadProgress = 0 let file = this.download let fileSize = file.fileLength//下载文件的总大小 let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB - if (file && fileSize<=shardSize) { //<=10MB时直接下载 + if (file && fileSize <= shardSize) { //<=10MB时直接下载 this.downloadisLoading = true // this.setFileLoading() - this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{ + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { responseType: 'blob' },).subscribe(data => { let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址 let link = document.createElement("a"); link.style.display = "none"; link.href = url; - let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; - link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); + link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix); document.body.appendChild(link); link.click(); this.downloadisLoading = false // this.setFileLoading() }) - } else if (file && fileSize > shardSize) { //>10MB时分块下载 + } else if (file && fileSize > shardSize) { //>10MB时分块下载 this.blockingDownload() //分段下载 this.downloadisLoading = true // this.setFileLoading() @@ -310,31 +291,32 @@ export class MeetPlanComponent implements OnInit { } //分段下载并合并 - async blockingDownload () { + async blockingDownload() { let file = this.download let fileSize = file.fileLength //下载文件的总大小 let shardSize = 3 * 1024 * 1024 //3MB一个分片 let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段 - let allFile:any = [] //所有的file分段 + let allFile: any = [] //所有的file分段 - for (let i=0;i{ - this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ - result(data) }) + let result = await new Promise((result, reject) => { + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => { + result(data) + }) }) allFile.push(result) - this.downloadProgress = Number((i/allSlice).toFixed(2))*100 + this.downloadProgress = Number((i / allSlice).toFixed(2)) * 100 if (allFile.length === allSlice) { //合并文件输出给浏览器 let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址 let link = document.createElement("a"); link.style.display = "none"; link.href = url; - let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; - link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); + link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix); document.body.appendChild(link); link.click(); // this.downloadProgress = 0 @@ -347,29 +329,29 @@ export class MeetPlanComponent implements OnInit { } //取消分块下载 - cancelDowload () { + cancelDowload() { } //重置 - reset(){ - this.typePlan='' - this.unitname='' - this.level='' - this.addname='' - this.addtime='' - this.endtime='' - this.reservePlanType='' - this.unitstate='' - this.projectlevel='' - this.plcheck=false + reset() { + this.typePlan = '' + this.unitname = '' + this.level = '' + this.addname = '' + this.addtime = '' + this.endtime = '' + this.reservePlanType = '' + this.unitstate = '' + this.projectlevel = '' + this.plcheck = false this.getAlltabledate() } //新增预案弹窗 - addunit(){ + addunit() { const dialogRef = this.dialog.open(newunitMeet, { width: '340px', - height:'490px', - disableClose:true + height: '490px', + disableClose: true //data: paperDataInfo }); dialogRef.afterClosed().subscribe(result => { @@ -379,12 +361,12 @@ export class MeetPlanComponent implements OnInit { } //审核结果 - auditResult(element){ + auditResult(element) { // console.log(element) const dialogRef = this.dialog.open(meetAuditResult, { - width:"400px", + width: "400px", //height:"300px", - data: {element:element} + data: { element: element } }); } @@ -396,8 +378,8 @@ export class MeetPlanComponent implements OnInit { templateUrl: './newunit.html', styleUrls: ['./newunit.scss'] }) -export class newunitMeet{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class newunitMeet { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } unitname//预案名称 level//预案级别 addname//添加人 @@ -407,182 +389,184 @@ export class newunitMeet{ projectlevel//编制级别 //上传文件↓ - file:any; //上传的文件 - fileName:any; //上传文件name - uploadisLoading:boolean = false; //进度条loading加载 - uploadProgress:number=0; //进度条进度 - objectName:any; //上传对象名 - uploadId:any; //上传分块上传事件编号 - uploadover:any = false //上传完成之后提示 - selectedPLanType:any//所选预案类型 - selectedPLanName:any//所选预案名称 - localup:boolean = false //本地上传 + file: any; //上传的文件 + fileName: any; //上传文件name + uploadisLoading: boolean = false; //进度条loading加载 + uploadProgress: number = 0; //进度条进度 + objectName: any; //上传对象名 + uploadId: any; //上传分块上传事件编号 + uploadover: any = false //上传完成之后提示 + selectedPLanType: any//所选预案类型 + selectedPLanName: any//所选预案名称 + localup: boolean = false //本地上传 defaultisshow = '0' //默认显示上传input框 //上传 - upload(){ - document.getElementById('up').click() + upload() { + document.getElementById('up').click() } -//上传文件input - filechange(e){ - this.file = e.target.files[0] || null //上传的文件 - //console.log(this.file) + //上传文件input + filechange(e) { + this.file = e.target.files[0] || null //上传的文件 + //console.log(this.file) } - //上传文件 - startUploading (planType) { - let file = this.file || null //获取上传的文件 - let fileSize = file.size || null //上传文件的总大小 - let shardSize = 5 * 1024 * 1024 //5MB一个分片 + //上传文件 + startUploading(planType) { + let file = this.file || null //获取上传的文件 + let fileSize = file.size || null //上传文件的总大小 + let shardSize = 5 * 1024 * 1024 //5MB一个分片 - if (file && fileSize<=shardSize) { //上传文件<=5MB时 - let formData = new FormData() - formData.append("file",file) - const config = new MatSnackBarConfig(); + if (file && fileSize <= shardSize) { //上传文件<=5MB时 + let formData = new FormData() + formData.append("file", file) + const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 let level = sessionStorage.getItem("level") - // console.log(level) - let PlanLevel - if(level == '0'){ - PlanLevel = 1 - } - if(level == '1'){ - PlanLevel = 2 - } - if(level == '2'){ - PlanLevel = 4 - } - if(level == '3'){ - PlanLevel = 8 - } - this.http.post('/api/Objects/PlanPlatform/meetClass',formData).subscribe((data:any)=>{ - this.objectName = data.objectName - //this.snackBar.open('上传成功!','确定',config); - - let body:any = { - Name:this.unitname||'', - PlanCategory:Number(this.level)||'', - disasterType: this.reservePlanType, - PlanLevel:PlanLevel, - PlanMode:1, - planType:16, - attachmentUrls:[`${this.objectName}`] + // console.log(level) + let PlanLevel + if (level == '0') { + PlanLevel = 1 + } + if (level == '1') { + PlanLevel = 2 + } + if (level == '2') { + PlanLevel = 4 } - // console.log(body) - this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ - this.snackBar.open('创建成功!','确定',config); - //console.log(data) - this.dialogRef.close(); - },err=>{ - this.snackBar.open('创建失败!','确定',config); + if (level == '3') { + PlanLevel = 8 + } + this.http.post('/api/Objects/PlanPlatform/meetClass', formData).subscribe((data: any) => { + this.objectName = data.objectName + //this.snackBar.open('上传成功!','确定',config); + + let body: any = { + Name: this.unitname || '', + PlanCategory: Number(this.level) || '', + disasterType: this.reservePlanType, + PlanLevel: PlanLevel, + PlanMode: 1, + planType: 16, + attachmentUrls: [`${this.objectName}`] + } + // console.log(body) + this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => { + this.snackBar.open('创建成功!', '确定', config); + //console.log(data) + this.dialogRef.close(); + }, err => { + this.snackBar.open('创建失败!', '确定', config); + }) + }, err => { + this.snackBar.open('上传失败!', '确定', config); }) - },err=>{ - this.snackBar.open('上传失败!','确定',config); - }) - } else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传 - let data = {filename: file.name} - this.uploadisLoading = true - this.http.post('/api/NewMultipartUpload/PlanPlatform/meetClass',{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 - this.objectName = data.objectName - this.uploadId = data.uploadId - this.subsectionUploading(planType) - }) - } + } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传 + let data = { filename: file.name } + this.uploadisLoading = true + this.http.post('/api/NewMultipartUpload/PlanPlatform/meetClass', {}, { params: data }).subscribe((data: any) => { //初始化分段上传 + this.objectName = data.objectName + this.uploadId = data.uploadId + this.subsectionUploading(planType) + }) + } } - PartNumberETag:any=[]; //每次返回需要保存的信息 + PartNumberETag: any = []; //每次返回需要保存的信息 //开始分段上传 - async subsectionUploading (planType) { + async subsectionUploading(planType) { let file = this.file || null //获取上传的文件 let fileSize = file.size || null //上传文件的总大小 let shardSize = 5 * 1024 * 1024 //5MB一个分片 let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整 - for (let i = 0;i < allSlice;i++) { //循环分段上传 - let start = i * shardSize //切割文件开始位置 - let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数) - let formData = new FormData() - formData.append("file",file.slice(start, end)) - - //同步写法实现异步调用 - let result = await new Promise((resolve, reject) => { - // await 需要后面返回一个 promise 对象 - this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ - let msg = { - "partNumber":data.partNumber || null, - "eTag": data.eTag || null} - resolve(msg) // 调用 promise 内置方法处理成功 - }) - }); - this.PartNumberETag.push(result) - this.uploadProgress = Number((i/allSlice).toFixed(2))*100 - - if (this.PartNumberETag.length === allSlice) { - this.uploadProgress = 100 - this.endUploading(planType)} + for (let i = 0; i < allSlice; i++) { //循环分段上传 + let start = i * shardSize //切割文件开始位置 + let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数) + let formData = new FormData() + formData.append("file", file.slice(start, end)) + + //同步写法实现异步调用 + let result = await new Promise((resolve, reject) => { + // await 需要后面返回一个 promise 对象 + this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i + 1}`, formData).subscribe((data: any) => { + let msg = { + "partNumber": data.partNumber || null, + "eTag": data.eTag || null + } + resolve(msg) // 调用 promise 内置方法处理成功 + }) + }); + this.PartNumberETag.push(result) + this.uploadProgress = Number((i / allSlice).toFixed(2)) * 100 + + if (this.PartNumberETag.length === allSlice) { + this.uploadProgress = 100 + this.endUploading(planType) + } }//for循环 } //完成分块上传 - endUploading (planType) { + endUploading(planType) { let data = this.PartNumberETag - let paramsData = {uploadId:this.uploadId} - this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - //this.snackBar.open('上传成功!','确定',config); - this.uploadProgress = 0; - this.uploadisLoading = false - this.PartNumberETag =[] //清空保存返回的信息 - this.uploadover = true - let level = sessionStorage.getItem("level") - // console.log(level) - let PlanLevel - if(level == '0'){ - PlanLevel = 1 - } - if(level == '1'){ - PlanLevel = 2 - } - if(level == '2'){ - PlanLevel = 4 - } - if(level == '3'){ - PlanLevel = 8 - } + let paramsData = { uploadId: this.uploadId } + this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`, data, { params: paramsData }).subscribe(data => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + //this.snackBar.open('上传成功!','确定',config); + this.uploadProgress = 0; + this.uploadisLoading = false + this.PartNumberETag = [] //清空保存返回的信息 + this.uploadover = true + let level = sessionStorage.getItem("level") + // console.log(level) + let PlanLevel + if (level == '0') { + PlanLevel = 1 + } + if (level == '1') { + PlanLevel = 2 + } + if (level == '2') { + PlanLevel = 4 + } + if (level == '3') { + PlanLevel = 8 + } - let body:any = { - Name:this.unitname||'', - PlanCategory:Number(this.level)||'', - disasterType: this.reservePlanType, - PlanLevel:PlanLevel, - PlanMode:1, - planType:16, - attachmentUrls:[`${this.objectName}`] - } - this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ - this.snackBar.open('创建成功!','确定',config); - this.dialogRef.close(); - },err=>{ - this.snackBar.open('创建失败!','确定',config); - }) + let body: any = { + Name: this.unitname || '', + PlanCategory: Number(this.level) || '', + disasterType: this.reservePlanType, + PlanLevel: PlanLevel, + PlanMode: 1, + planType: 16, + attachmentUrls: [`${this.objectName}`] + } + this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => { + this.snackBar.open('创建成功!', '确定', config); + this.dialogRef.close(); + }, err => { + this.snackBar.open('创建失败!', '确定', config); + }) }) } - + //取消分块上传 - cancel () { + cancel() { const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000; - this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ + config.verticalPosition = 'top'; + config.duration = 3000; + this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data => { this.uploadProgress = 0; - this.uploadisLoading= false; - (document.getElementById('up')).value = null - this.PartNumberETag =[] //清空保存返回的信息 - this.snackBar.open('取消上传成功!','确定',config); + this.uploadisLoading = false; + (document.getElementById('up')).value = null + this.PartNumberETag = [] //清空保存返回的信息 + this.snackBar.open('取消上传成功!', '确定', config); this.uploadover = false this.file = null }) @@ -590,35 +574,35 @@ export class newunitMeet{ //创建预案 - newplan(){ + newplan() { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - if(this.unitname==undefined||this.unitname==''){ - this.snackBar.open('请输入预案名称!','确定',config); + if (this.unitname == undefined || this.unitname == '') { + this.snackBar.open('请输入预案名称!', '确定', config); } - else if(this.reservePlanType==undefined||this.reservePlanType==''){ - this.snackBar.open('请输入预案类型!','确定',config); + else if (this.reservePlanType == undefined || this.reservePlanType == '') { + this.snackBar.open('请输入预案类型!', '确定', config); } - else if(this.level==undefined||this.level==''){ - this.snackBar.open('请输入预案级别!','确定',config); + else if (this.level == undefined || this.level == '') { + this.snackBar.open('请输入预案级别!', '确定', config); } - else if(this.file==undefined){ - this.snackBar.open('请先上传文件!','确定',config); + else if (this.file == undefined) { + this.snackBar.open('请先上传文件!', '确定', config); } - else{ - if(this.reservePlanType!='1'){ + else { + if (this.reservePlanType != '1') { this.startUploading("非二维") } - else{this.startUploading("二维")} - - + else { this.startUploading("二维") } + + } - + } //取消 - close(){ + close() { this.dialogRef.close(); } } @@ -629,15 +613,15 @@ export class newunitMeet{ templateUrl: './resultmeetPlan.html', styleUrls: ['./meet-plan.component.scss'] }) -export class meetAuditResult{ - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} - planName:any = this.data.element.name - commitTime:any = this.data.element.committedTime - commitOrganizationName:any = this.data.element.committerOrganizationName - - auditOrganizationName:any = this.data.element.auditorOrganizationName - auditResult:any = this.data.element.auditStatus - auditOpinion:any = this.data.element.auditOpinion +export class meetAuditResult { + constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } + planName: any = this.data.element.name + commitTime: any = this.data.element.committedTime + commitOrganizationName: any = this.data.element.committerOrganizationName + + auditOrganizationName: any = this.data.element.auditorOrganizationName + auditResult: any = this.data.element.auditStatus + auditOpinion: any = this.data.element.auditOpinion ngOnInit(): void { } onNoClick(): void { diff --git a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts index 87fb062..849ec9c 100644 --- a/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts +++ b/src/app/plan-management/onetwo-entry-plan/onetwo-entry-plan.component.ts @@ -13,7 +13,7 @@ import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @@ -30,72 +30,72 @@ declare var CryptoJS }) export class OnetwoEntryPlanComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } ngOnInit(): void { - if(window.matchMedia("(max-width: 1400px)").matches){ - this.pcMore=false - this.padMore=true - this.pcfind=false - this.padjt=true - }else{ - this.pcfind=true - this.pcMore=true - this.padMore=false - this.padjt=false + if (window.matchMedia("(max-width: 1400px)").matches) { + this.pcMore = false + this.padMore = true + this.pcfind = false + this.padjt = true + } else { + this.pcfind = true + this.pcMore = true + this.padMore = false + this.padjt = false } this.levels = sessionStorage.getItem("level"); - if(this.levels == "0"){//如果是总队 + if (this.levels == "0") {//如果是总队 this.preparelevels = [ - {name:"总队",value:"1"}, - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "总队", value: "1" }, + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.levels == "1"){//如果是支队 + if (this.levels == "1") {//如果是支队 this.preparelevels = [ - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.levels == "2"){//如果是大队 + if (this.levels == "2") {//如果是大队 this.preparelevels = [ - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.levels == "3"){//如果是中队 + if (this.levels == "3") {//如果是中队 this.preparelevels = [ - {name:"中队",value:"8"} + { name: "中队", value: "8" } ] } - this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) + this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length) this.getAlltabledate() } pcMore//pc更多 - pcput=false//pc收起 + pcput = false//pc收起 pcfind//pc查询 - padjt=false - padMore=true//pad收缩控制 - padput=false//pad收起按钮 - imgsrcopen="../../../assets/images/routdown2.png" - imgsrcdown="../../../assets/images/routup2.png" - pcInfo(){ - this.pcMore=!this.pcMore - this.pcput=!this.pcput + padjt = false + padMore = true//pad收缩控制 + padput = false//pad收起按钮 + imgsrcopen = "../../../assets/images/routdown2.png" + imgsrcdown = "../../../assets/images/routup2.png" + pcInfo() { + this.pcMore = !this.pcMore + this.pcput = !this.pcput } - padInfo(){ - this.padMore=!this.padMore - this.padput=!this.padput + padInfo() { + this.padMore = !this.padMore + this.padput = !this.padput } levels url - preparelevels:any - plcheck:boolean //编制级别勾选框 - displayedColumns: string[] = ['unitname','level','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation']; + preparelevels: any + plcheck: boolean //编制级别勾选框 + displayedColumns: string[] = ['unitname', 'level', 'addname', 'addtime', 'plantype', 'passstate', 'isopen', 'projectlevel', 'operation']; tabledataSource unitname//预案名称 level//预案级别 @@ -107,96 +107,96 @@ export class OnetwoEntryPlanComponent implements OnInit { projectlevel//编制级别 typePlan//新预案类型 //分页 - @ViewChild(MatPaginator, {static: true}) + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any; //第几页 + PageNumber: any; //第几页 //获取表格数据 - getAlltabledate(){ + getAlltabledate() { let reservePlanType this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' - if(this.reservePlanType && this.reservePlanType.length != 0){ + if (this.reservePlanType && this.reservePlanType.length != 0) { reservePlanType = eval(this.reservePlanType.join("|")) - } - let paramsdata:any = { - Name:this.unitname||'', - planCategories:this.url=='2'?2:1, + } + let paramsdata: any = { + Name: this.unitname || '', + planCategories: this.url == '2' ? 2 : 1, //PlanType:reservePlanType||'', - DisasterType:this.typePlan||'', - CreatorName:this.addname||'', - AuditStatus:this.unitstate|| '', - CreationTimeRangeStart:this.addtime||'', - CreationTimeRangeEnd:this.endtime||'', - PlanLevel:this.projectlevel||'', - HasChildrenPlanLevel:this.plcheck||'', + DisasterType: this.typePlan || '', + CreatorName: this.addname || '', + AuditStatus: this.unitstate || '', + CreationTimeRangeStart: this.addtime || '', + CreationTimeRangeEnd: this.endtime || '', + PlanLevel: this.projectlevel || '', + HasChildrenPlanLevel: this.plcheck || '', PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], - + PageSize: this.pageSizeOptions[0], + } - this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ + this.http.get("/api/PlanComponentsMajor", { params: paramsdata }).subscribe((data: any) => { this.length = data.totalCount this.tabledataSource = data.items }) } //分页事件 - changePage(e){ - this.PageNumber = e.pageIndex+1 + changePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAlltabledate() } //重置 - reset(){ - this.typePlan='' - this.unitname='' - this.level='' - this.addname='' - this.addtime='' - this.endtime='' - this.reservePlanType='' - this.unitstate='' - this.projectlevel='' - this.plcheck=false + reset() { + this.typePlan = '' + this.unitname = '' + this.level = '' + this.addname = '' + this.addtime = '' + this.endtime = '' + this.reservePlanType = '' + this.unitstate = '' + this.projectlevel = '' + this.plcheck = false this.getAlltabledate() } //查询 - onSubmit (value) { + onSubmit(value) { //console.log(value) - if(this.endtime!=undefined&&this.addtime>this.endtime){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('开始时间不能大于结束时间!','确定',config); - }else{ + if (this.endtime != undefined && this.addtime > this.endtime) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('开始时间不能大于结束时间!', '确定', config); + } else { this.PageNumber = 1 this.pageEvent.pageIndex = 0 this.getAlltabledate(); } - + } //删除预案 - deletePlan(id){ + deletePlan(id) { let isTrue = confirm('您确定要删除吗') - if(isTrue){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{ - this.snackBar.open('删除成功!','确定',config); - this.getAlltabledate() - },err => { - this.snackBar.open(err,'确定',config); - }) + if (isTrue) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data => { + this.snackBar.open('删除成功!', '确定', config); + this.getAlltabledate() + }, err => { + this.snackBar.open(err, '确定', config); + }) } - + } //提交审核 - submitAudit(element){ + submitAudit(element) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 @@ -206,69 +206,49 @@ export class OnetwoEntryPlanComponent implements OnInit { config.duration = 3000 this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config); } */ - this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`,"").subscribe(data=>{ - this.getAlltabledate() - },err => { - this.snackBar.open(err,'确定',config); - }) - - + this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`, "").subscribe(data => { + this.getAlltabledate() + }, err => { + this.snackBar.open(err, '确定', config); + }) + + } //撤销审核 - cancelAudit(element){ + cancelAudit(element) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.http.put(`/api/PlanComponentsMajor/${element.id}/Cancel`,"").subscribe(data=>{ + this.http.put(`/api/PlanComponentsMajor/${element.id}/Cancel`, "").subscribe(data => { this.getAlltabledate() - },err => { - this.snackBar.open(err,'确定',config); + }, err => { + this.snackBar.open(err, '确定', config); }) } //查看预案 - openPlan(element){ - let filename:string + openPlan(element) { let fetchUrl = element.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege:element.auditStatus!='1'&&element.auditStatus!='16'?[ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ]:[ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) - }) - - + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + }else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + element.attachmentUrls[0]) + }else{ + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + } } //新增预案弹窗 - addunit(){ + addunit() { const dialogRef = this.dialog.open(newunitComponent, { width: '340px', - height:'410px', - disableClose:true + height: '410px', + disableClose: true //data: paperDataInfo }); dialogRef.afterClosed().subscribe(result => { @@ -278,66 +258,66 @@ export class OnetwoEntryPlanComponent implements OnInit { } //审核结果 - auditResult(element){ + auditResult(element) { // console.log(element) const dialogRef = this.dialog.open(onetwoAuditResult, { - width:"400px", + width: "400px", //height:"300px", - data: {element:element} + data: { element: element } }); } //下载↓ - selectDownloadFile:any; //选择下载的文件 - download:any; //下载文件元数据 - downloadisLoading:boolean = false; //进度条loading加载 - downloadProgress:number=0; //进度条进度 - downloadFileName:any - fileUrls:any //当前预案附件地址 - fileDatas:any = [] - selectedFileIndex : any = 0 - selectedFileData : any - - uploadFileLonging:any + selectDownloadFile: any; //选择下载的文件 + download: any; //下载文件元数据 + downloadisLoading: boolean = false; //进度条loading加载 + downloadProgress: number = 0; //进度条进度 + downloadFileName: any + fileUrls: any //当前预案附件地址 + fileDatas: any = [] + selectedFileIndex: any = 0 + selectedFileData: any + + uploadFileLonging: any //读取下载文件信息 - readFile (element) { + readFile(element) { this.uploadFileLonging = element - element.attachmentUrls.forEach(item=>{ - this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ - data.filePige = (data.fileLength / (1024*1024)).toFixed(2) + element.attachmentUrls.forEach(item => { + this.http.get('/api/ObjectMetadata/PlanPlatform/' + item).subscribe((data: any) => { + data.filePige = (data.fileLength / (1024 * 1024)).toFixed(2) //console.log(data) this.download = data this.downloadFile() }) }) - + } //初始化下载 - downloadFile () { + downloadFile() { this.downloadProgress = 0 let file = this.download let fileSize = file.fileLength//下载文件的总大小 let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB - if (file && fileSize<=shardSize) { //<=10MB时直接下载 + if (file && fileSize <= shardSize) { //<=10MB时直接下载 this.downloadisLoading = true // this.setFileLoading() - this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{ + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { responseType: 'blob' },).subscribe(data => { let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址 let link = document.createElement("a"); link.style.display = "none"; link.href = url; - let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; - link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); + link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix); document.body.appendChild(link); link.click(); this.downloadisLoading = false // this.setFileLoading() }) - } else if (file && fileSize > shardSize) { //>10MB时分块下载 + } else if (file && fileSize > shardSize) { //>10MB时分块下载 this.blockingDownload() //分段下载 this.downloadisLoading = true // this.setFileLoading() @@ -346,31 +326,32 @@ export class OnetwoEntryPlanComponent implements OnInit { } //分段下载并合并 - async blockingDownload () { + async blockingDownload() { let file = this.download let fileSize = file.fileLength //下载文件的总大小 let shardSize = 3 * 1024 * 1024 //3MB一个分片 let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段 - let allFile:any = [] //所有的file分段 + let allFile: any = [] //所有的file分段 - for (let i=0;i{ - this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ - result(data) }) + let result = await new Promise((result, reject) => { + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => { + result(data) + }) }) allFile.push(result) - this.downloadProgress = Number((i/allSlice).toFixed(2))*100 + this.downloadProgress = Number((i / allSlice).toFixed(2)) * 100 if (allFile.length === allSlice) { //合并文件输出给浏览器 let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址 let link = document.createElement("a"); link.style.display = "none"; link.href = url; - let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; - link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); + link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix); document.body.appendChild(link); link.click(); // this.downloadProgress = 0 @@ -383,14 +364,14 @@ export class OnetwoEntryPlanComponent implements OnInit { } //取消分块下载 - cancelDowload () { + cancelDowload() { } - + //查看预案按钮跳转 - routerTo(element){ - sessionStorage.setItem("companyName",element.unitname) - window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].id}&operation=true&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null :element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`); + routerTo(element) { + sessionStorage.setItem("companyName", element.unitname) + window.open(`/planManagement/entryPlandetail?unitId=${element.company.id}&unitTypeId=${element.company.buildingTypes.length == 0 ? null : element.company.buildingTypes[0].id}&operation=true&pagetype=entryplan&unitName=${element.company.name}&orName=${element.company.organizationName}&unitType=${element.company.buildingTypes.length == 0 ? null : element.company.buildingTypes[0].name}&unitAdd=${element.company.address}`); } } @@ -401,10 +382,10 @@ export class OnetwoEntryPlanComponent implements OnInit { templateUrl: './newunit.html', styleUrls: ['./newunit.scss'] }) -export class newunitComponent{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class newunitComponent { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } ngOnInit(): void { - this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) + this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length) } url unitname//预案名称 @@ -416,180 +397,182 @@ export class newunitComponent{ projectlevel//编制级别 //上传文件↓ - file:any; //上传的文件 - fileName:any; //上传文件name - uploadisLoading:boolean = false; //进度条loading加载 - uploadProgress:number=0; //进度条进度 - objectName:any; //上传对象名 - uploadId:any; //上传分块上传事件编号 - uploadover:any = false //上传完成之后提示 - selectedPLanType:any//所选预案类型 - selectedPLanName:any//所选预案名称 - localup:boolean = false //本地上传 + file: any; //上传的文件 + fileName: any; //上传文件name + uploadisLoading: boolean = false; //进度条loading加载 + uploadProgress: number = 0; //进度条进度 + objectName: any; //上传对象名 + uploadId: any; //上传分块上传事件编号 + uploadover: any = false //上传完成之后提示 + selectedPLanType: any//所选预案类型 + selectedPLanName: any//所选预案名称 + localup: boolean = false //本地上传 defaultisshow = '0' //默认显示上传input框 - //上传 - upload(){ - document.getElementById('up').click() + //上传 + upload() { + document.getElementById('up').click() } -//上传文件input - filechange(e){ - this.file = e.target.files[0] || null //上传的文件 + //上传文件input + filechange(e) { + this.file = e.target.files[0] || null //上传的文件 } - //上传文件 - startUploading (planType) { - let file = this.file || null //获取上传的文件 - let fileSize = file.size || null //上传文件的总大小 - let shardSize = 5 * 1024 * 1024 //5MB一个分片 + //上传文件 + startUploading(planType) { + let file = this.file || null //获取上传的文件 + let fileSize = file.size || null //上传文件的总大小 + let shardSize = 5 * 1024 * 1024 //5MB一个分片 - if (file && fileSize<=shardSize) { //上传文件<=5MB时 - let formData = new FormData() - formData.append("file",file) - const config = new MatSnackBarConfig(); + if (file && fileSize <= shardSize) { //上传文件<=5MB时 + let formData = new FormData() + formData.append("file", file) + const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.http.post(this.url=='2'?`/api/Objects/PlanPlatform/twoClass`:'/api/Objects/PlanPlatform/oneClass',formData).subscribe((data:any)=>{ - this.objectName = data.objectName - //this.snackBar.open('上传成功!','确定',config); - let level = sessionStorage.getItem("level") + this.http.post(this.url == '2' ? `/api/Objects/PlanPlatform/twoClass` : '/api/Objects/PlanPlatform/oneClass', formData).subscribe((data: any) => { + this.objectName = data.objectName + //this.snackBar.open('上传成功!','确定',config); + let level = sessionStorage.getItem("level") // console.log(level) - let PlanLevel - if(level == '0'){ - PlanLevel = 1 + let PlanLevel + if (level == '0') { + PlanLevel = 1 } - if(level == '1'){ - PlanLevel = 2 + if (level == '1') { + PlanLevel = 2 } - if(level == '2'){ - PlanLevel = 4 + if (level == '2') { + PlanLevel = 4 } - if(level == '3'){ - PlanLevel = 8 + if (level == '3') { + PlanLevel = 8 } - let body:any = { - Name:this.unitname||'', - PlanCategory:this.url=='2'?2:1, - disasterType: this.reservePlanType, - PlanLevel:PlanLevel, - PlanMode:1, - planType:16, - attachmentUrls:[`${this.objectName}`] - } - this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ - this.snackBar.open('创建成功!','确定',config); - this.dialogRef.close(); - },err=>{ - this.snackBar.open('创建失败!','确定',config); + let body: any = { + Name: this.unitname || '', + PlanCategory: this.url == '2' ? 2 : 1, + disasterType: this.reservePlanType, + PlanLevel: PlanLevel, + PlanMode: 1, + planType: 16, + attachmentUrls: [`${this.objectName}`] + } + this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => { + this.snackBar.open('创建成功!', '确定', config); + this.dialogRef.close(); + }, err => { + this.snackBar.open('创建失败!', '确定', config); + }) + }, err => { + this.snackBar.open('上传失败!', '确定', config); }) - },err=>{ - this.snackBar.open('上传失败!','确定',config); - }) - } else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传 - let data = {filename: file.name} - this.uploadisLoading = true - this.http.post(this.url=='2'?`/api/NewMultipartUpload/PlanPlatform/twoClass`:'/api/NewMultipartUpload/PlanPlatform/oneClass',{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 - this.objectName = data.objectName - this.uploadId = data.uploadId - this.subsectionUploading(planType) - }) - } + } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传 + let data = { filename: file.name } + this.uploadisLoading = true + this.http.post(this.url == '2' ? `/api/NewMultipartUpload/PlanPlatform/twoClass` : '/api/NewMultipartUpload/PlanPlatform/oneClass', {}, { params: data }).subscribe((data: any) => { //初始化分段上传 + this.objectName = data.objectName + this.uploadId = data.uploadId + this.subsectionUploading(planType) + }) + } } - PartNumberETag:any=[]; //每次返回需要保存的信息 + PartNumberETag: any = []; //每次返回需要保存的信息 //开始分段上传 - async subsectionUploading (planType) { + async subsectionUploading(planType) { let file = this.file || null //获取上传的文件 let fileSize = file.size || null //上传文件的总大小 let shardSize = 5 * 1024 * 1024 //5MB一个分片 let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整 - for (let i = 0;i < allSlice;i++) { //循环分段上传 - let start = i * shardSize //切割文件开始位置 - let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数) - let formData = new FormData() - formData.append("file",file.slice(start, end)) - - //同步写法实现异步调用 - let result = await new Promise((resolve, reject) => { - // await 需要后面返回一个 promise 对象 - this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ - let msg = { - "partNumber":data.partNumber || null, - "eTag": data.eTag || null} - resolve(msg) // 调用 promise 内置方法处理成功 - }) - }); - this.PartNumberETag.push(result) - this.uploadProgress = Number((i/allSlice).toFixed(2))*100 - - if (this.PartNumberETag.length === allSlice) { - this.uploadProgress = 100 - this.endUploading(planType)} + for (let i = 0; i < allSlice; i++) { //循环分段上传 + let start = i * shardSize //切割文件开始位置 + let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数) + let formData = new FormData() + formData.append("file", file.slice(start, end)) + + //同步写法实现异步调用 + let result = await new Promise((resolve, reject) => { + // await 需要后面返回一个 promise 对象 + this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i + 1}`, formData).subscribe((data: any) => { + let msg = { + "partNumber": data.partNumber || null, + "eTag": data.eTag || null + } + resolve(msg) // 调用 promise 内置方法处理成功 + }) + }); + this.PartNumberETag.push(result) + this.uploadProgress = Number((i / allSlice).toFixed(2)) * 100 + + if (this.PartNumberETag.length === allSlice) { + this.uploadProgress = 100 + this.endUploading(planType) + } }//for循环 } //完成分块上传 - endUploading (planType) { + endUploading(planType) { let data = this.PartNumberETag - let paramsData = {uploadId:this.uploadId} - this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - //this.snackBar.open('上传成功!','确定',config); - this.uploadProgress = 0; - this.uploadisLoading = false - this.PartNumberETag =[] //清空保存返回的信息 - this.uploadover = true - let level = sessionStorage.getItem("level") - // console.log(level) - let PlanLevel - if(level == '0'){ - PlanLevel = 1 - } - if(level == '1'){ - PlanLevel = 2 - } - if(level == '2'){ - PlanLevel = 4 - } - if(level == '3'){ - PlanLevel = 8 - } + let paramsData = { uploadId: this.uploadId } + this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`, data, { params: paramsData }).subscribe(data => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + //this.snackBar.open('上传成功!','确定',config); + this.uploadProgress = 0; + this.uploadisLoading = false + this.PartNumberETag = [] //清空保存返回的信息 + this.uploadover = true + let level = sessionStorage.getItem("level") + // console.log(level) + let PlanLevel + if (level == '0') { + PlanLevel = 1 + } + if (level == '1') { + PlanLevel = 2 + } + if (level == '2') { + PlanLevel = 4 + } + if (level == '3') { + PlanLevel = 8 + } - let body:any = { - Name:this.unitname||'', - PlanCategory:this.url=='2'?2:1, - disasterType: this.reservePlanType, - PlanLevel:PlanLevel, - PlanMode:1, - planType:16, - attachmentUrls:[`${this.objectName}`] - } - - this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ - this.snackBar.open('创建成功!','确定',config); - this.dialogRef.close(); - },err=>{ - this.snackBar.open('创建失败!','确定',config); - }) + let body: any = { + Name: this.unitname || '', + PlanCategory: this.url == '2' ? 2 : 1, + disasterType: this.reservePlanType, + PlanLevel: PlanLevel, + PlanMode: 1, + planType: 16, + attachmentUrls: [`${this.objectName}`] + } + + this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => { + this.snackBar.open('创建成功!', '确定', config); + this.dialogRef.close(); + }, err => { + this.snackBar.open('创建失败!', '确定', config); + }) }) } - + //取消分块上传 - cancel () { - this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ + cancel() { + this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data => { this.uploadProgress = 0; - this.uploadisLoading= false; - (document.getElementById('up')).value = null - this.PartNumberETag =[] //清空保存返回的信息 + this.uploadisLoading = false; + (document.getElementById('up')).value = null + this.PartNumberETag = [] //清空保存返回的信息 const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('取消上传成功!','确定',config); + this.snackBar.open('取消上传成功!', '确定', config); this.uploadover = false this.file = null }) @@ -597,29 +580,29 @@ export class newunitComponent{ //创建预案 - newplan(){ + newplan() { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - if(this.unitname==undefined||this.reservePlanType==undefined){ - this.snackBar.open('请输入预案名称或类型!','确定',config); + if (this.unitname == undefined || this.reservePlanType == undefined) { + this.snackBar.open('请输入预案名称或类型!', '确定', config); } - else if(this.file==undefined){ - this.snackBar.open('请先上传文件!','确定',config); + else if (this.file == undefined) { + this.snackBar.open('请先上传文件!', '确定', config); } - else{ - if(this.reservePlanType!='1'){ + else { + if (this.reservePlanType != '1') { this.startUploading("非二维") } - else{this.startUploading("二维")} - - + else { this.startUploading("二维") } + + } - + } //取消按钮 - close(){ + close() { this.dialogRef.close(); } } @@ -630,15 +613,15 @@ export class newunitComponent{ templateUrl: './resultPlanonetwo.html', styleUrls: ['./onetwo-entry-plan.component.scss'] }) -export class onetwoAuditResult{ - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} - planName:any = this.data.element.name - commitTime:any = this.data.element.committedTime - commitOrganizationName:any = this.data.element.committerOrganizationName - - auditOrganizationName:any = this.data.element.auditorOrganizationName - auditResult:any = this.data.element.auditStatus - auditOpinion:any = this.data.element.auditOpinion +export class onetwoAuditResult { + constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } + planName: any = this.data.element.name + commitTime: any = this.data.element.committedTime + commitOrganizationName: any = this.data.element.committerOrganizationName + + auditOrganizationName: any = this.data.element.auditorOrganizationName + auditResult: any = this.data.element.auditStatus + auditOpinion: any = this.data.element.auditOpinion ngOnInit(): void { } onNoClick(): void { diff --git a/src/app/plan-management/open-plan/open-plan.component.ts b/src/app/plan-management/open-plan/open-plan.component.ts index e2c7106..f1e6306 100644 --- a/src/app/plan-management/open-plan/open-plan.component.ts +++ b/src/app/plan-management/open-plan/open-plan.component.ts @@ -4,7 +4,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree' import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @@ -18,8 +18,8 @@ declare var CryptoJS }) export class OpenPlanComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } - + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } + private _transformer = (node, level: number) => { //初始化tree return { expandable: !!node.children && node.children.length > 0, @@ -35,145 +35,145 @@ export class OpenPlanComponent implements OnInit { dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); myControl = new FormControl(); hasChild = (_: number, node: any) => node.expandable; - //分页 - @ViewChild(MatPaginator, {static: true}) + //分页 + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any; //第几页 + PageNumber: any; //第几页 + + displayedColumns: string[] = ['unitname', 'planname', 'addpeople', 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation']; - displayedColumns: string[] = ['unitname', 'planname', 'addpeople','addtime','plantype','auditStatus','openRange','projectlevel','operation']; - - allorganizations:any //所有组织机构 - allunittype:any //所有单位类型 - tabledataSource:any //表格数据 - preparelevels:any //编制级别 + allorganizations: any //所有组织机构 + allunittype: any //所有单位类型 + tabledataSource: any //表格数据 + preparelevels: any //编制级别 ngOnInit(): void { - if(window.matchMedia("(max-width: 1400px)").matches){ - this.pcMore=false - this.padMore=true - this.pcfind=false - this.padjt=true - }else{ - this.pcfind=true - this.pcMore=true - this.padMore=false - this.padjt=false + if (window.matchMedia("(max-width: 1400px)").matches) { + this.pcMore = false + this.padMore = true + this.pcfind = false + this.padjt = true + } else { + this.pcfind = true + this.pcMore = true + this.padMore = false + this.padjt = false } this.getunitdata(); this.getOrganizations(); this.getUnittype(); this.getAllPlanInfo(); //得到所有单位 let level = sessionStorage.getItem("level"); - if(level == "0"){//如果是总队 + if (level == "0") {//如果是总队 this.preparelevels = [ - {name:"总队",value:"1"}, - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "总队", value: "1" }, + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "1"){//如果是支队 + if (level == "1") {//如果是支队 this.preparelevels = [ - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "2"){//如果是大队 + if (level == "2") {//如果是大队 this.preparelevels = [ - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "3"){//如果是中队 + if (level == "3") {//如果是中队 this.preparelevels = [ - {name:"中队",value:"8"} + { name: "中队", value: "8" } ] } } pcMore//pc更多 - pcput=false//pc收起 + pcput = false//pc收起 pcfind//pc查询 - padjt=false - padMore=true//pad收缩控制 - padput=false//pad收起按钮 - imgsrcopen="../../../assets/images/routdown2.png" - imgsrcdown="../../../assets/images/routup2.png" - pcInfo(){ - this.pcMore=!this.pcMore - this.pcput=!this.pcput + padjt = false + padMore = true//pad收缩控制 + padput = false//pad收起按钮 + imgsrcopen = "../../../assets/images/routdown2.png" + imgsrcdown = "../../../assets/images/routup2.png" + pcInfo() { + this.pcMore = !this.pcMore + this.pcput = !this.pcput } - padInfo(){ - this.padMore=!this.padMore - this.padput=!this.padput + padInfo() { + this.padMore = !this.padMore + this.padput = !this.padput } - allPlanInfo:any //存储所有预案信息 + allPlanInfo: any //存储所有预案信息 //获得所有预案信息 - getAllPlanInfo(){ - let paramsdata:any = { + getAllPlanInfo() { + let paramsdata: any = { CompanyName: this.companyName || '', - OrganizationId: '', - HasChildrenOrganization:'', - BuildingTypeId: this.unittype || '', + OrganizationId: '', + HasChildrenOrganization: '', + BuildingTypeId: this.unittype || '', PlanType: this.reservePlanType || '', - AuditStatus:'', //审核状态 - PlanLevel: this.preparelevel || '', + AuditStatus: '', //审核状态 + PlanLevel: this.preparelevel || '', HasChildrenPlanLevel: this.plcheck || '', PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], + PageSize: this.pageSizeOptions[0], Sort: '' } - this.http.get("/api/PublicPlans",{params:paramsdata}).subscribe((data:any)=>{ + this.http.get("/api/PublicPlans", { params: paramsdata }).subscribe((data: any) => { // console.log(111,data) this.length = data.totalCount this.allPlanInfo = data - this.tabledataSource = data.items + this.tabledataSource = data.items }) } //得到当前单位信息 - getunitdata(){ + getunitdata() { this.http.get("/api/Account/Profiles").subscribe( - (data:any)=>{ - this.organizationName = data.organizationName + (data: any) => { + this.organizationName = data.organizationName } ) } - organizationName:any //当前单位组织机构名称 - treedata:any //组织机构树型数据 - newArr:any = [] - newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 + organizationName: any //当前单位组织机构名称 + treedata: any //组织机构树型数据 + newArr: any = [] + newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段 //得到当前单位所在组织机构的tree型数据 - getpresentOrganization(){ + getpresentOrganization() { this.newallorganizations = this.allorganizations this.newallorganizations.forEach(item => { item.children = [] this.newallorganizations.forEach(element => { - if(element.parentId == item.id){ + if (element.parentId == item.id) { item.children.push(element) } }); }); // console.log(666,this.organizationName) - if(this.organizationName){ + if (this.organizationName) { this.newallorganizations.forEach(item => { - if(item.name == this.organizationName){ + if (item.name == this.organizationName) { this.dataSource.data = [item] } }); - }else{ + } else { this.dataSource.data = this.tree.toTree(this.treedata); } - + } //获得所有组织机构 - getOrganizations(){ + getOrganizations() { this.http.get('/api/Organizations').subscribe( - (data:any)=>{ + (data: any) => { this.allorganizations = data this.treedata = this.tree.toTree(data); this.getpresentOrganization(); @@ -182,87 +182,69 @@ export class OpenPlanComponent implements OnInit { } //获得所有单位类型 - getUnittype(){ + getUnittype() { this.http.get('/api/BuildingTypes/Simple').subscribe( - data=>{ + data => { this.allunittype = data } ) } //跳转查看预案页面 公开预案 - routerTo(e){ + routerTo(e) { /* sessionStorage.setItem("companyName",element.companyName) window.open(`/planAudit/planpass?id=${element.companyId}&companyName=${element.companyName}&auditPlanId=${element.id}&auditStatus=${element.auditStatus}&type=6&planType=2`); */ // console.log(e) - if(e.planMode == 0||e.planMode == 1){ - //console.log(e.attachmentUrls) - var index=e.attachmentUrls[0].indexOf("\/") - if(e.attachmentUrls[0].substr(0,index)=='psw'){ - const dialogRef = this.dialog.open(GkhtmlPsViewer, { - width: '1500px', - height:'800px', - data: e.attachmentUrls[0] - }); - } - else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf' - ||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC' - ||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{ - let filename:string - let fetchUrl = e.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) - }) - } + if (e.planMode == 0 || e.planMode == 1) { + //console.log(e.attachmentUrls) + var index = e.attachmentUrls[0].indexOf("\/") + if (e.attachmentUrls[0].substr(0, index) == 'psw') { + const dialogRef = this.dialog.open(GkhtmlPsViewer, { + width: '1500px', + height: '800px', + data: e.attachmentUrls[0] + }); } - - if(e.planMode == 2){ //如果是在线编辑 - let id = e.id - sessionStorage.setItem("planId",id) - sessionStorage.setItem("companyId",e.companyId) - //sessionStorage.setItem("buildingTypeId",this.unittypeId) - sessionStorage.setItem("editable","0") - sessionStorage.setItem("planName",e.name) - let companyId = sessionStorage.getItem("companyId") - window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); - } - if(e.planMode == 3){ //如果是跳转网页 - sessionStorage.setItem("url",e.url) - window.open(`/planManagement/webLook`) + else { + let fetchUrl = e.attachmentUrls[0] + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + } else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + } } + } + + if (e.planMode == 2) { //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId", id) + sessionStorage.setItem("companyId", e.companyId) + //sessionStorage.setItem("buildingTypeId",this.unittypeId) + sessionStorage.setItem("editable", "0") + sessionStorage.setItem("planName", e.name) + let companyId = sessionStorage.getItem("companyId") + window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); + } + if (e.planMode == 3) { //如果是跳转网页 + sessionStorage.setItem("url", e.url) + window.open(`/planManagement/webLook`) + } } //分页事件 - chagePage(e){ - this.PageNumber = e.pageIndex+1 + chagePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAllPlanInfo(); - } + } //辖区中队div是否显示 - isorganizationbox:boolean = false + isorganizationbox: boolean = false //点击辖区中队树,将选择的辖区中队添加到变量 add(node) { this.isorganizationbox = false @@ -278,23 +260,23 @@ export class OpenPlanComponent implements OnInit { this.isorganizationbox = true } //关闭出现的组织机构div - closediv(){ + closediv() { this.isorganizationbox = false } //查询 - onSubmit (e) { + onSubmit(e) { this.getAllPlanInfo() } - companyName:any //单位名称 - js:any //所选组织机构 - jsId:any //所选组织机构的id + companyName: any //单位名称 + js: any //所选组织机构 + jsId: any //所选组织机构的id // jscheck:boolean //所选组织机构勾选框 - unittype:any //单位类型 - reservePlanType:any //预案类型 - preparelevel:any //编制级别 - plcheck:boolean //编制级别勾选框 + unittype: any //单位类型 + reservePlanType: any //预案类型 + preparelevel: any //编制级别 + plcheck: boolean //编制级别勾选框 //重置 - reset(){ + reset() { this.companyName = '' // this.js = '' // this.jsId = '' @@ -307,7 +289,7 @@ export class OpenPlanComponent implements OnInit { this.pageEvent.pageIndex = 0 this.PageNumber = 1 this.getAllPlanInfo(); - + } } @@ -316,14 +298,14 @@ export class OpenPlanComponent implements OnInit { templateUrl: './PsvShow.html', styleUrls: ['./open-plan.component.scss'] }) -export class GkhtmlPsViewer{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class GkhtmlPsViewer { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } ngOnInit(): void { // console.log(this.data) const viewer = new Viewer({ container: document.querySelector('#viewer'), - panorama:'/api/Objects/PlanPlatform/'+ this.data, - + panorama: '/api/Objects/PlanPlatform/' + this.data, + }); } } diff --git a/src/app/plan-management/pass-plan/pass-plan.component.ts b/src/app/plan-management/pass-plan/pass-plan.component.ts index 692ae62..973f521 100644 --- a/src/app/plan-management/pass-plan/pass-plan.component.ts +++ b/src/app/plan-management/pass-plan/pass-plan.component.ts @@ -4,7 +4,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree' import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @@ -18,8 +18,8 @@ declare var CryptoJS }) export class PassPlanComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } - + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } + private _transformer = (node, level: number) => { //初始化tree return { expandable: !!node.children && node.children.length > 0, @@ -35,239 +35,239 @@ export class PassPlanComponent implements OnInit { dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); myControl = new FormControl(); hasChild = (_: number, node: any) => node.expandable; - //分页 - @ViewChild(MatPaginator, {static: true}) + //分页 + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any; //第几页 + PageNumber: any; //第几页 - displayedColumns: string[] = ['planname', 'addpeople','level','addtime','plantype','auditStatus','openRange','projectlevel','operation']; - allorganizations:any //所有组织机构 - allunittype:any //所有单位类型 - tabledataSource:any //表格数据 + displayedColumns: string[] = ['planname', 'addpeople', 'level', 'addtime', 'plantype', 'auditStatus', 'openRange', 'projectlevel', 'operation']; + allorganizations: any //所有组织机构 + allunittype: any //所有单位类型 + tabledataSource: any //表格数据 url - preparelevels:any + preparelevels: any ngOnInit(): void { - if(window.matchMedia("(max-width: 1400px)").matches){ - this.pcMore=false - this.padMore=true - this.pcfind=false - this.padjt=true - }else{ - this.pcfind=true - this.pcMore=true - this.padMore=false - this.padjt=false + if (window.matchMedia("(max-width: 1400px)").matches) { + this.pcMore = false + this.padMore = true + this.pcfind = false + this.padjt = true + } else { + this.pcfind = true + this.pcMore = true + this.padMore = false + this.padjt = false } this.getunitdata(); this.getOrganizations(); this.getUnittype(); this.getAllPlanInfo(); let level = sessionStorage.getItem("level"); - if(level == "0"){//如果是总队 + if (level == "0") {//如果是总队 this.preparelevels = [ - {name:"总队",value:"1"}, - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "总队", value: "1" }, + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "1"){//如果是支队 + if (level == "1") {//如果是支队 this.preparelevels = [ - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "2"){//如果是大队 + if (level == "2") {//如果是大队 this.preparelevels = [ - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(level == "3"){//如果是中队 + if (level == "3") {//如果是中队 this.preparelevels = [ - {name:"中队",value:"8"} + { name: "中队", value: "8" } ] } - this.url=window.location.href.substring(window.location.href.length-1,window.location.href.length) + this.url = window.location.href.substring(window.location.href.length - 1, window.location.href.length) //console.log(this.url) } pcMore//pc更多 - pcput=false//pc收起 + pcput = false//pc收起 pcfind//pc查询 - padjt=false - padMore=true//pad收缩控制 - padput=false//pad收起按钮 - imgsrcopen="../../../assets/images/routdown2.png" - imgsrcdown="../../../assets/images/routup2.png" - pcInfo(){ - this.pcMore=!this.pcMore - this.pcput=!this.pcput + padjt = false + padMore = true//pad收缩控制 + padput = false//pad收起按钮 + imgsrcopen = "../../../assets/images/routdown2.png" + imgsrcdown = "../../../assets/images/routup2.png" + pcInfo() { + this.pcMore = !this.pcMore + this.pcput = !this.pcput } - padInfo(){ - this.padMore=!this.padMore - this.padput=!this.padput + padInfo() { + this.padMore = !this.padMore + this.padput = !this.padput } - allPlanInfo:any //存储所有预案信息 + allPlanInfo: any //存储所有预案信息 //获得所有预案信息 - getAllPlanInfo(){ + getAllPlanInfo() { let reservePlanType this.reservePlanType ? reservePlanType = JSON.parse(JSON.stringify(this.reservePlanType)) : reservePlanType = '' - if(this.reservePlanType && this.reservePlanType.length != 0){ + if (this.reservePlanType && this.reservePlanType.length != 0) { reservePlanType = eval(this.reservePlanType.join("|")) - } - let paramsdata:any = { + } + let paramsdata: any = { CompanyName: this.companyName || '', OrganizationId: this.jsId || '', - HasChildrenOrganization:this.jscheck || '', - BuildingTypeId: this.unittype || '', + HasChildrenOrganization: this.jscheck || '', + BuildingTypeId: this.unittype || '', PlanType: this.reservePlanType || '', - AuditStatus:'', //审核状态 - PlanLevel: this.preparelevel || '', + AuditStatus: '', //审核状态 + PlanLevel: this.preparelevel || '', HasChildrenPlanLevel: this.plcheck || '', - CreationTimeRangeStart:this.addtime||'', - CreationTimeRangeEnd:this.endtime||'', + CreationTimeRangeStart: this.addtime || '', + CreationTimeRangeEnd: this.endtime || '', PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], + PageSize: this.pageSizeOptions[0], Sort: '', - PlanCategories:this.planCategory + PlanCategories: this.planCategory } - this.http.get("/api/ApprovedPlans",{params:paramsdata}).subscribe((data:any)=>{ + this.http.get("/api/ApprovedPlans", { params: paramsdata }).subscribe((data: any) => { this.length = data.totalCount this.allPlanInfo = data - this.tabledataSource = data.items + this.tabledataSource = data.items }) } - colorRgb(sColor){ + colorRgb(sColor) { var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; var sColor = sColor.toLowerCase(); if (sColor && reg.test(sColor)) { - if (sColor.length === 4) { - var sColorNew = "#"; - for (var i = 1; i < 4; i += 1) { - sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); - } - sColor = sColorNew; + if (sColor.length === 4) { + var sColorNew = "#"; + for (var i = 1; i < 4; i += 1) { + sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1)); } - //处理六位的颜色值 - var sColorChange = []; - for (var i = 1; i < 7; i += 2) { - sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); - } - return sColorChange; + sColor = sColorNew; + } + //处理六位的颜色值 + var sColorChange = []; + for (var i = 1; i < 7; i += 2) { + sColorChange.push(parseInt("0x" + sColor.slice(i, i + 2))); + } + return sColorChange; } else { - return sColor; + return sColor; } } - colorHex(rgb){ + colorHex(rgb) { var _this = rgb; var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/; if (/^(rgb|RGB)/.test(_this)) { - var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); - var strHex = "#"; - for (var i = 0; i < aColor.length; i++) { - var hex:any = Number(aColor[i]).toString(16); - hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位 - if (hex === "0") { - hex += hex; - } - strHex += hex; - } - if (strHex.length !== 7) { - strHex = _this; + var aColor = _this.replace(/(?:(|)|rgb|RGB)*/g, "").split(","); + var strHex = "#"; + for (var i = 0; i < aColor.length; i++) { + var hex: any = Number(aColor[i]).toString(16); + hex = hex < 10 ? 0 + '' + hex : hex;// 保证每个rgb的值为2位 + if (hex === "0") { + hex += hex; } - return strHex; + strHex += hex; + } + if (strHex.length !== 7) { + strHex = _this; + } + return strHex; } else if (reg.test(_this)) { - var aNum = _this.replace(/#/, "").split(""); - if (aNum.length === 6) { - return _this; - } else if (aNum.length === 3) { - var numHex = "#"; - for (var i = 0; i < aNum.length; i += 1) { - numHex += (aNum[i] + aNum[i]); - } - return numHex; + var aNum = _this.replace(/#/, "").split(""); + if (aNum.length === 6) { + return _this; + } else if (aNum.length === 3) { + var numHex = "#"; + for (var i = 0; i < aNum.length; i += 1) { + numHex += (aNum[i] + aNum[i]); } + return numHex; + } } else { - return _this; + return _this; } } gradientColor(startColor, endColor, step) { let _this = this - let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式 - let startR = startRGB[0]; - let startG = startRGB[1]; - let startB = startRGB[2]; + let startRGB = _this.colorRgb(startColor);//转换为rgb数组模式 + let startR = startRGB[0]; + let startG = startRGB[1]; + let startB = startRGB[2]; - let endRGB = _this.colorRgb(endColor); - let endR = endRGB[0]; - let endG = endRGB[1]; - let endB = endRGB[2]; + let endRGB = _this.colorRgb(endColor); + let endR = endRGB[0]; + let endG = endRGB[1]; + let endB = endRGB[2]; - let sR = (endR - startR) / step;//总差值 - let sG = (endG - startG) / step; - let sB = (endB - startB) / step; + let sR = (endR - startR) / step;//总差值 + let sG = (endG - startG) / step; + let sB = (endB - startB) / step; var colorArr = []; for (var i = 0; i < step; i++) { - //计算每一步的hex值 - var hex = _this.colorHex('rgb('+ parseInt((sR * i + startR))+ ',' + parseInt((sG * i + startG))+ ',' + parseInt((sB * i + startB)) + ')'); - colorArr.push(hex); + //计算每一步的hex值 + var hex = _this.colorHex('rgb(' + parseInt((sR * i + startR)) + ',' + parseInt((sG * i + startG)) + ',' + parseInt((sB * i + startB)) + ')'); + colorArr.push(hex); } return colorArr; -} - integrity(width){ + } + integrity(width) { let _this = this - - let style:any = {} - style.width = width +'%'; - if(width < 30){ - let colorArr = this.gradientColor('#D50000', '#E53935', 30); - for(let i = 0; i < 30; i++){ - if( i == width){ + + let style: any = {} + style.width = width + '%'; + if (width < 30) { + let colorArr = this.gradientColor('#D50000', '#E53935', 30); + for (let i = 0; i < 30; i++) { + if (i == width) { style.background = colorArr[i] } } } - if(width >= 30 && width < 60){ - let colorArr = this.gradientColor('#FF9800', '#E65100', 30); - for(let i = 30; i < 60; i++){ - if( i == width){ - style.background = colorArr[i-30] + if (width >= 30 && width < 60) { + let colorArr = this.gradientColor('#FF9800', '#E65100', 30); + for (let i = 30; i < 60; i++) { + if (i == width) { + style.background = colorArr[i - 30] } } } - if(width >= 60){ - let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); - for(let i = 60; i <= 100; i++){ - if( i == width){ - style.background = colorArr[i-60] + if (width >= 60) { + let colorArr = this.gradientColor('#81C784', '#2E7D32', 41); + for (let i = 60; i <= 100; i++) { + if (i == width) { + style.background = colorArr[i - 60] } } } return style } - integrityDetails(width,zong){ - let style:any = {} - style.width = (width/zong)*100 +'%'; + integrityDetails(width, zong) { + let style: any = {} + style.width = (width / zong) * 100 + '%'; return style } //得到当前单位信息 - getunitdata(){ + getunitdata() { this.http.get("/api/Account/Profiles").subscribe( - (data:any)=>{ - this.organizationName = data.organizationName + (data: any) => { + this.organizationName = data.organizationName } ) } @@ -275,41 +275,41 @@ export class PassPlanComponent implements OnInit { endtime//结束时间 integrityScoreMin//完整度最小值 integrityScoreMax//完整度最大值 - organizationName:any //当前单位组织机构名称 - treedata:any //组织机构树型数据 - newArr:any = [] - newallorganizations:any //用于存储在原始数据基础上的每个机构增加children字段 + organizationName: any //当前单位组织机构名称 + treedata: any //组织机构树型数据 + newArr: any = [] + newallorganizations: any //用于存储在原始数据基础上的每个机构增加children字段 //得到当前单位所在组织机构的tree型数据 - getpresentOrganization(){ + getpresentOrganization() { this.newallorganizations = this.allorganizations this.newallorganizations.forEach(item => { item.children = [] this.newallorganizations.forEach(element => { - if(element.parentId == item.id){ + if (element.parentId == item.id) { item.children.push(element) } }); }); this.http.get("/api/Account/Profiles").subscribe( - (data:any)=>{ + (data: any) => { this.organizationName = data.organizationName - if(this.organizationName){ + if (this.organizationName) { this.newallorganizations.forEach(item => { - if(item.name == this.organizationName){ + if (item.name == this.organizationName) { this.dataSource.data = [item] } }); - }else{ + } else { this.dataSource.data = this.tree.toTree(this.treedata); } } ) - + } //获得所有组织机构 - getOrganizations(){ + getOrganizations() { this.http.get('/api/Organizations').subscribe( - (data:any)=>{ + (data: any) => { this.allorganizations = data this.treedata = this.tree.toTree(data); this.getpresentOrganization(); @@ -318,120 +318,102 @@ export class PassPlanComponent implements OnInit { } //获得所有单位类型 - getUnittype(){ + getUnittype() { this.http.get('/api/BuildingTypes/Simple').subscribe( - data=>{ + data => { this.allunittype = data } ) } //查看单位信息 - lookUnitInfo(element){ + lookUnitInfo(element) { // console.log(element) // const dialogRef = this.dialog.open(UnitInfo, { // width: '1500px', // height:'800px' // }); - sessionStorage.setItem("editable","0") - sessionStorage.setItem("companyName",element.company.name) - sessionStorage.setItem("companyId",element.company.id) - sessionStorage.setItem(element.company.id,JSON.stringify(element.company.companyIntegrityScore)) - window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`,'_blank'); + sessionStorage.setItem("editable", "0") + sessionStorage.setItem("companyName", element.company.name) + sessionStorage.setItem("companyId", element.company.id) + sessionStorage.setItem(element.company.id, JSON.stringify(element.company.companyIntegrityScore)) + window.open(`/keyUnit/viewunitinfo?id=${element.company.id}&usci=${element.company.usci}`, '_blank'); } //跳转查看预案页面 审核通过预案 - routerTo(e){ + routerTo(e) { // console.log(e) - if(e.planMode == 0||e.planMode == 1){ + if (e.planMode == 0 || e.planMode == 1) { //console.log(e.attachmentUrls) - var index=e.attachmentUrls[0].indexOf("\/") - if(e.attachmentUrls[0].substr(0,index)=='psw'){ + var index = e.attachmentUrls[0].indexOf("\/") + if (e.attachmentUrls[0].substr(0, index) == 'psw') { const dialogRef = this.dialog.open(GkPsViewer, { width: '1500px', - height:'800px', + height: '800px', data: e.attachmentUrls[0] }); } - else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf' - ||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC' - ||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{ - let filename:string - let fetchUrl = e.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) - }) + else { + let fetchUrl = e.attachmentUrls[0] + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + } else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); } } - - if(e.planMode == 2){ //如果是在线编辑 - let id = e.id - sessionStorage.setItem("planId",id) - sessionStorage.setItem("companyId",e.companyId) + } + + if (e.planMode == 2) { //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId", id) + sessionStorage.setItem("companyId", e.companyId) //sessionStorage.setItem("buildingTypeId",this.unittypeId) - sessionStorage.setItem("editable","0") - sessionStorage.setItem("planName",e.name) + sessionStorage.setItem("editable", "0") + sessionStorage.setItem("planName", e.name) let companyId = sessionStorage.getItem("companyId") window.open(`/keyUnit/viewunitinfoplan?id=${companyId}`); } - if(e.planMode == 3){ //如果是跳转网页 - sessionStorage.setItem("url",e.url) + if (e.planMode == 3) { //如果是跳转网页 + sessionStorage.setItem("url", e.url) window.open(`/planManagement/webLook`) } } //预案公开 - openReserve (e) { - this.http.put(`/api/PlanAudits/${e.id}/Public`,[]).subscribe(data=>{ + openReserve(e) { + this.http.put(`/api/PlanAudits/${e.id}/Public`, []).subscribe(data => { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('预案已公开','确定',config); + this.snackBar.open('预案已公开', '确定', config); }) } //预案取消公开 - closeReserve (e) { - this.http.put(`/api/PlanAudits/${e.id}/Unpublic`,[]).subscribe(data=>{ + closeReserve(e) { + this.http.put(`/api/PlanAudits/${e.id}/Unpublic`, []).subscribe(data => { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('预案已取消公开','确定',config); + this.snackBar.open('预案已取消公开', '确定', config); }) } - + //分页事件 - chagePage(e){ - this.PageNumber = e.pageIndex+1 + chagePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAllPlanInfo(); } //辖区中队div是否显示 - isorganizationbox:boolean = false + isorganizationbox: boolean = false //点击辖区中队树,将选择的辖区中队添加到变量 add(node) { this.isorganizationbox = false @@ -447,26 +429,26 @@ export class PassPlanComponent implements OnInit { this.isorganizationbox = true } //关闭出现的组织机构div - closediv(){ + closediv() { this.isorganizationbox = false } //查询 - onSubmit (e) { + onSubmit(e) { this.PageNumber = 1 this.pageEvent.pageIndex = 0 this.getAllPlanInfo(); } - companyName:any //单位名称 - js:any //所选组织机构 - jsId:any //所选组织机构的id - jscheck:boolean //所选组织机构勾选框 - unittype:any //单位类型 - reservePlanType:any //预案类型 - preparelevel:any //编制级别 - plcheck:boolean //编制级别勾选框 - planCategory=[]//预案级别 + companyName: any //单位名称 + js: any //所选组织机构 + jsId: any //所选组织机构的id + jscheck: boolean //所选组织机构勾选框 + unittype: any //单位类型 + reservePlanType: any //预案类型 + preparelevel: any //编制级别 + plcheck: boolean //编制级别勾选框 + planCategory = []//预案级别 //重置 - reset(){ + reset() { this.companyName = '' this.js = '' this.jsId = '' @@ -474,13 +456,13 @@ export class PassPlanComponent implements OnInit { this.unittype = '' this.reservePlanType = '' this.preparelevel = '' - this.addtime='' - this.endtime='' + this.addtime = '' + this.endtime = '' this.plcheck = false //重新获取初始化列表 this.pageEvent.pageIndex = 0 this.PageNumber = 1 - this.planCategory=[] + this.planCategory = [] this.getAllPlanInfo(); } } @@ -490,14 +472,14 @@ export class PassPlanComponent implements OnInit { templateUrl: './PsvShow.html', styleUrls: ['./pass-plan.component.scss'] }) -export class GkPsViewer{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class GkPsViewer { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } ngOnInit(): void { // console.log(this.data) const viewer = new Viewer({ container: document.querySelector('#viewer'), - panorama:'/api/Objects/PlanPlatform/'+ this.data, - + panorama: '/api/Objects/PlanPlatform/' + this.data, + }); } } @@ -508,8 +490,8 @@ export class GkPsViewer{ templateUrl: './unitInfo.html', styleUrls: ['./pass-plan.component.scss'] }) -export class UnitInfo{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class UnitInfo { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } ngOnInit(): void { // console.log(this.data) } diff --git a/src/app/plan-management/type-plan/type-plan.component.ts b/src/app/plan-management/type-plan/type-plan.component.ts index 1dff9e9..6eb1bb3 100644 --- a/src/app/plan-management/type-plan/type-plan.component.ts +++ b/src/app/plan-management/type-plan/type-plan.component.ts @@ -12,7 +12,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree' import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @@ -26,70 +26,70 @@ declare var CryptoJS }) export class TypePlanComponent implements OnInit { - constructor(private http:HttpClient,private router:Router,private route:ActivatedRoute,private tree: TreeService,public dialog: MatDialog,public snackBar: MatSnackBar) { } + constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, private tree: TreeService, public dialog: MatDialog, public snackBar: MatSnackBar) { } ngOnInit(): void { - if(window.matchMedia("(max-width: 1400px)").matches){ - this.pcMore=false - this.padMore=true - this.pcfind=false - this.padjt=true - }else{ - this.pcfind=true - this.pcMore=true - this.padMore=false - this.padjt=false + if (window.matchMedia("(max-width: 1400px)").matches) { + this.pcMore = false + this.padMore = true + this.pcfind = false + this.padjt = true + } else { + this.pcfind = true + this.pcMore = true + this.padMore = false + this.padjt = false } this.levels = sessionStorage.getItem("level"); - if(this.levels == "0"){//如果是总队 + if (this.levels == "0") {//如果是总队 this.preparelevels = [ - {name:"总队",value:"1"}, - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "总队", value: "1" }, + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.levels == "1"){//如果是支队 + if (this.levels == "1") {//如果是支队 this.preparelevels = [ - {name:"支队",value:"2"}, - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "支队", value: "2" }, + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.levels == "2"){//如果是大队 + if (this.levels == "2") {//如果是大队 this.preparelevels = [ - {name:"大队",value:"4"}, - {name:"中队",value:"8"} + { name: "大队", value: "4" }, + { name: "中队", value: "8" } ] } - if(this.levels == "3"){//如果是中队 + if (this.levels == "3") {//如果是中队 this.preparelevels = [ - {name:"中队",value:"8"} + { name: "中队", value: "8" } ] } this.getAlltabledate() } pcMore//pc更多 - pcput=false//pc收起 + pcput = false//pc收起 pcfind//pc查询 - padjt=false - padMore=true//pad收缩控制 - padput=false//pad收起按钮 - imgsrcopen="../../../assets/images/routdown2.png" - imgsrcdown="../../../assets/images/routup2.png" - pcInfo(){ - this.pcMore=!this.pcMore - this.pcput=!this.pcput + padjt = false + padMore = true//pad收缩控制 + padput = false//pad收起按钮 + imgsrcopen = "../../../assets/images/routdown2.png" + imgsrcdown = "../../../assets/images/routup2.png" + pcInfo() { + this.pcMore = !this.pcMore + this.pcput = !this.pcput } - padInfo(){ - this.padMore=!this.padMore - this.padput=!this.padput + padInfo() { + this.padMore = !this.padMore + this.padput = !this.padput } - + levels - preparelevels:any - plcheck:boolean //编制级别勾选框 - displayedColumns: string[] = ['unitname','addname','addtime', 'plantype', 'passstate','isopen','projectlevel','operation']; + preparelevels: any + plcheck: boolean //编制级别勾选框 + displayedColumns: string[] = ['unitname', 'addname', 'addtime', 'plantype', 'passstate', 'isopen', 'projectlevel', 'operation']; tabledataSource unitname//预案名称 level//预案级别 @@ -100,225 +100,205 @@ export class TypePlanComponent implements OnInit { unitstate//审核状态 projectlevel//编制级别 //分页 - @ViewChild(MatPaginator, {static: true}) + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any; //第几页 + PageNumber: any; //第几页 //获取表格数据 - getAlltabledate(){ - let paramsdata:any = { - Name:this.unitname||'', - planCategories:8, - CreatorName:this.addname||'', - AuditStatus:this.unitstate|| '', - CreationTimeRangeStart:this.addtime||'', - CreationTimeRangeEnd:this.endtime||'', - PlanLevel:this.projectlevel||'', - HasChildrenPlanLevel:this.plcheck||'', + getAlltabledate() { + let paramsdata: any = { + Name: this.unitname || '', + planCategories: 8, + CreatorName: this.addname || '', + AuditStatus: this.unitstate || '', + CreationTimeRangeStart: this.addtime || '', + CreationTimeRangeEnd: this.endtime || '', + PlanLevel: this.projectlevel || '', + HasChildrenPlanLevel: this.plcheck || '', PageNumber: this.PageNumber || '1', - PageSize: this.pageSizeOptions[0], - + PageSize: this.pageSizeOptions[0], + } - this.http.get("/api/PlanComponentsMajor",{params:paramsdata}).subscribe((data:any)=>{ + this.http.get("/api/PlanComponentsMajor", { params: paramsdata }).subscribe((data: any) => { this.length = data.totalCount this.tabledataSource = data.items }) } //分页事件 - changePage(e){ - this.PageNumber = e.pageIndex+1 + changePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAlltabledate() } //重置 - reset(){ - this.unitname='' - this.level='' - this.addname='' - this.addtime='' - this.endtime='' - this.unitstate='' - this.projectlevel='' - this.plcheck=false + reset() { + this.unitname = '' + this.level = '' + this.addname = '' + this.addtime = '' + this.endtime = '' + this.unitstate = '' + this.projectlevel = '' + this.plcheck = false this.getAlltabledate() } //查询 - onSubmit (value) { - if(this.endtime!=undefined&&this.addtime>this.endtime){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('开始时间不能大于结束时间!','确定',config); - }else{ + onSubmit(value) { + if (this.endtime != undefined && this.addtime > this.endtime) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('开始时间不能大于结束时间!', '确定', config); + } else { this.PageNumber = 1 this.pageEvent.pageIndex = 0 this.getAlltabledate(); } - + } //删除预案 - deletePlan(id){ + deletePlan(id) { let isTrue = confirm('您确定要删除吗') - if(isTrue){ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data=>{ - this.snackBar.open('删除成功!','确定',config); - this.getAlltabledate() - },err => { - this.snackBar.open(err,'确定',config); - }) + if (isTrue) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.http.delete(`/api/PlanComponentsMajor/${id}`).subscribe(data => { + this.snackBar.open('删除成功!', '确定', config); + this.getAlltabledate() + }, err => { + this.snackBar.open(err, '确定', config); + }) } - + } - + //提交审核 - submitAudit(element){ + submitAudit(element) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 /* if(element.auditStatus == 4){ this.snackBar.open('审核退回的预案需要修改后方可再次提交审核!','确定',config); } */ - this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`,"").subscribe(data=>{ - this.getAlltabledate() - },err => { - this.snackBar.open(err,'确定',config); - }) - - + this.http.put(`/api/PlanComponentsMajor/${element.id}/Commit`, "").subscribe(data => { + this.getAlltabledate() + }, err => { + this.snackBar.open(err, '确定', config); + }) + + } //撤销审核 - cancelAudit(element){ + cancelAudit(element) { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.http.put(`/api/PlanComponentsMajor/${element.id}/Cancel`,"").subscribe(data=>{ + this.http.put(`/api/PlanComponentsMajor/${element.id}/Cancel`, "").subscribe(data => { this.getAlltabledate() - },err => { - this.snackBar.open(err,'确定',config); + }, err => { + this.snackBar.open(err, '确定', config); }) } //查看预案 - openPlan(element){ - let filename:string + openPlan(element) { let fetchUrl = element.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: element.auditStatus!='1'&&element.auditStatus!='16'?[ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ]:[ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) - }) - - + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + } else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + } } //新增预案弹窗 - addunit(){ + addunit() { const dialogRef = this.dialog.open(newunitType, { width: '340px', - height:'330px', - disableClose:true + height: '330px', + disableClose: true //data: paperDataInfo }); dialogRef.afterClosed().subscribe(result => { this.getAlltabledate() } ); - + } //审核结果 - auditResult(element){ + auditResult(element) { // console.log(element) const dialogRef = this.dialog.open(typeAuditResult, { - width:"400px", + width: "400px", //height:"300px", - data: {element:element} + data: { element: element } }); } //下载↓ - selectDownloadFile:any; //选择下载的文件 - download:any; //下载文件元数据 - downloadisLoading:boolean = false; //进度条loading加载 - downloadProgress:number=0; //进度条进度 - downloadFileName:any - fileUrls:any //当前预案附件地址 - fileDatas:any = [] - selectedFileIndex : any = 0 - selectedFileData : any - - uploadFileLonging:any + selectDownloadFile: any; //选择下载的文件 + download: any; //下载文件元数据 + downloadisLoading: boolean = false; //进度条loading加载 + downloadProgress: number = 0; //进度条进度 + downloadFileName: any + fileUrls: any //当前预案附件地址 + fileDatas: any = [] + selectedFileIndex: any = 0 + selectedFileData: any + + uploadFileLonging: any //读取下载文件信息 - readFile (element) { + readFile(element) { this.uploadFileLonging = element - element.attachmentUrls.forEach(item=>{ - this.http.get('/api/ObjectMetadata/PlanPlatform/'+item).subscribe((data:any)=>{ - data.filePige = (data.fileLength / (1024*1024)).toFixed(2) + element.attachmentUrls.forEach(item => { + this.http.get('/api/ObjectMetadata/PlanPlatform/' + item).subscribe((data: any) => { + data.filePige = (data.fileLength / (1024 * 1024)).toFixed(2) //console.log(data) this.download = data this.downloadFile() }) }) - + } //初始化下载 - downloadFile () { + downloadFile() { this.downloadProgress = 0 let file = this.download let fileSize = file.fileLength//下载文件的总大小 let shardSize = 10 * 1024 * 1024 //文件大小是否大于10MB - if (file && fileSize<=shardSize) { //<=10MB时直接下载 + if (file && fileSize <= shardSize) { //<=10MB时直接下载 this.downloadisLoading = true // this.setFileLoading() - this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{responseType: 'blob'},).subscribe(data=>{ + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { responseType: 'blob' },).subscribe(data => { let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址 let link = document.createElement("a"); link.style.display = "none"; link.href = url; - let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; - link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); + link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix); document.body.appendChild(link); link.click(); this.downloadisLoading = false // this.setFileLoading() }) - } else if (file && fileSize > shardSize) { //>10MB时分块下载 + } else if (file && fileSize > shardSize) { //>10MB时分块下载 this.blockingDownload() //分段下载 this.downloadisLoading = true // this.setFileLoading() @@ -327,31 +307,32 @@ export class TypePlanComponent implements OnInit { } //分段下载并合并 - async blockingDownload () { + async blockingDownload() { let file = this.download let fileSize = file.fileLength //下载文件的总大小 let shardSize = 3 * 1024 * 1024 //3MB一个分片 let allSlice = Math.ceil(fileSize / shardSize) //总文件/3MB===共分多少段 - let allFile:any = [] //所有的file分段 + let allFile: any = [] //所有的file分段 - for (let i=0;i{ - this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`,{headers:{'range':`bytes= ${start}-${end}`},responseType:'blob'}).subscribe(data=>{ - result(data) }) + let result = await new Promise((result, reject) => { + this.http.get(`/api/Objects/PlanPlatform/${file.objectName}`, { headers: { 'range': `bytes= ${start}-${end}` }, responseType: 'blob' }).subscribe(data => { + result(data) + }) }) allFile.push(result) - this.downloadProgress = Number((i/allSlice).toFixed(2))*100 + this.downloadProgress = Number((i / allSlice).toFixed(2)) * 100 if (allFile.length === allSlice) { //合并文件输出给浏览器 let url = window.URL.createObjectURL(new Blob(allFile)); //createObjectURL创建一个下载Blob的url地址 let link = document.createElement("a"); link.style.display = "none"; link.href = url; - let suffix = file.objectName.substring(file.objectName.lastIndexOf(".")+1,file.objectName.length) ; - link.setAttribute("download", file.fileName + "-" +this.uploadFileLonging.name + "." + suffix); + let suffix = file.objectName.substring(file.objectName.lastIndexOf(".") + 1, file.objectName.length); + link.setAttribute("download", file.fileName + "-" + this.uploadFileLonging.name + "." + suffix); document.body.appendChild(link); link.click(); // this.downloadProgress = 0 @@ -364,7 +345,7 @@ export class TypePlanComponent implements OnInit { } //取消分块下载 - cancelDowload () { + cancelDowload() { } } @@ -375,8 +356,8 @@ export class TypePlanComponent implements OnInit { templateUrl: './newunit.html', styleUrls: ['./newunit.scss'] }) -export class newunitType{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class newunitType { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } unitname//预案名称 level//预案级别 addname//添加人 @@ -386,209 +367,211 @@ export class newunitType{ projectlevel//编制级别 reservePlanType//预案类型 //上传 - upload(){ + upload() { document.getElementById('up').click() } //上传文件↓ - file:any; //上传的文件 - fileName:any; //上传文件name - uploadisLoading:boolean = false; //进度条loading加载 - uploadProgress:number=0; //进度条进度 - objectName:any; //上传对象名 - uploadId:any; //上传分块上传事件编号 - uploadover:any = false //上传完成之后提示 - selectedPLanType:any//所选预案类型 - selectedPLanName:any//所选预案名称 - localup:boolean = false //本地上传 + file: any; //上传的文件 + fileName: any; //上传文件name + uploadisLoading: boolean = false; //进度条loading加载 + uploadProgress: number = 0; //进度条进度 + objectName: any; //上传对象名 + uploadId: any; //上传分块上传事件编号 + uploadover: any = false //上传完成之后提示 + selectedPLanType: any//所选预案类型 + selectedPLanName: any//所选预案名称 + localup: boolean = false //本地上传 defaultisshow = '0' //默认显示上传input框 //上传文件input - filechange(e){ - this.file = e.target.files[0] || null //上传的文件 + filechange(e) { + this.file = e.target.files[0] || null //上传的文件 } - //上传文件 - startUploading (planType) { - let file = this.file || null //获取上传的文件 - let fileSize = file.size || null //上传文件的总大小 - let shardSize = 5 * 1024 * 1024 //5MB一个分片 + //上传文件 + startUploading(planType) { + let file = this.file || null //获取上传的文件 + let fileSize = file.size || null //上传文件的总大小 + let shardSize = 5 * 1024 * 1024 //5MB一个分片 - if (file && fileSize<=shardSize) { //上传文件<=5MB时 - let formData = new FormData() - formData.append("file",file) - const config = new MatSnackBarConfig(); + if (file && fileSize <= shardSize) { //上传文件<=5MB时 + let formData = new FormData() + formData.append("file", file) + const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 let level = sessionStorage.getItem("level") - // console.log(level) - let PlanLevel - if(level == '0'){ - PlanLevel = 1 - } - if(level == '1'){ - PlanLevel = 2 - } - if(level == '2'){ - PlanLevel = 4 - } - if(level == '3'){ - PlanLevel = 8 - } - this.http.post(`/api/Objects/PlanPlatform/typeClass`,formData).subscribe((data:any)=>{ - this.objectName = data.objectName - //console.log('上传成功') - - let body:any = { - Name:this.unitname||'', - PlanCategory:8, - PlanLevel:PlanLevel, - PlanMode:1, - PlanType:8, - planType:16, - attachmentUrls:[`${this.objectName}`] + // console.log(level) + let PlanLevel + if (level == '0') { + PlanLevel = 1 + } + if (level == '1') { + PlanLevel = 2 } - this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ - this.snackBar.open('创建成功!','确定',config); - this.dialogRef.close(); - },err=>{ - this.snackBar.open('创建失败!','确定',config); + if (level == '2') { + PlanLevel = 4 + } + if (level == '3') { + PlanLevel = 8 + } + this.http.post(`/api/Objects/PlanPlatform/typeClass`, formData).subscribe((data: any) => { + this.objectName = data.objectName + //console.log('上传成功') + + let body: any = { + Name: this.unitname || '', + PlanCategory: 8, + PlanLevel: PlanLevel, + PlanMode: 1, + PlanType: 8, + planType: 16, + attachmentUrls: [`${this.objectName}`] + } + this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => { + this.snackBar.open('创建成功!', '确定', config); + this.dialogRef.close(); + }, err => { + this.snackBar.open('创建失败!', '确定', config); + }) + }, err => { + this.snackBar.open('上传失败!', '确定', config); }) - },err=>{ - this.snackBar.open('上传失败!','确定',config); - }) - } else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传 - let data = {filename: file.name} - this.uploadisLoading = true - this.http.post(`/api/NewMultipartUpload/PlanPlatform/typeClass`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 - this.objectName = data.objectName - this.uploadId = data.uploadId - this.subsectionUploading(planType) - }) - } + } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传 + let data = { filename: file.name } + this.uploadisLoading = true + this.http.post(`/api/NewMultipartUpload/PlanPlatform/typeClass`, {}, { params: data }).subscribe((data: any) => { //初始化分段上传 + this.objectName = data.objectName + this.uploadId = data.uploadId + this.subsectionUploading(planType) + }) + } } - PartNumberETag:any=[]; //每次返回需要保存的信息 + PartNumberETag: any = []; //每次返回需要保存的信息 //开始分段上传 - async subsectionUploading (planType) { + async subsectionUploading(planType) { let file = this.file || null //获取上传的文件 let fileSize = file.size || null //上传文件的总大小 let shardSize = 5 * 1024 * 1024 //5MB一个分片 let allSlice = Math.ceil(fileSize / shardSize) //总文件/5MB===共分多少段 向上取整 - for (let i = 0;i < allSlice;i++) { //循环分段上传 - let start = i * shardSize //切割文件开始位置 - let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数) - let formData = new FormData() - formData.append("file",file.slice(start, end)) - - //同步写法实现异步调用 - let result = await new Promise((resolve, reject) => { - // await 需要后面返回一个 promise 对象 - this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i+1}`,formData).subscribe((data:any)=>{ - let msg = { - "partNumber":data.partNumber || null, - "eTag": data.eTag || null} - resolve(msg) // 调用 promise 内置方法处理成功 - }) - }); - this.PartNumberETag.push(result) - this.uploadProgress = Number((i/allSlice).toFixed(2))*100 - - if (this.PartNumberETag.length === allSlice) { - this.uploadProgress = 100 - this.endUploading(planType)} + for (let i = 0; i < allSlice; i++) { //循环分段上传 + let start = i * shardSize //切割文件开始位置 + let end = Math.min(fileSize, start + shardSize); //切割文件结束位置 (对比取小数) + let formData = new FormData() + formData.append("file", file.slice(start, end)) + + //同步写法实现异步调用 + let result = await new Promise((resolve, reject) => { + // await 需要后面返回一个 promise 对象 + this.http.post(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}&partNumber=${i + 1}`, formData).subscribe((data: any) => { + let msg = { + "partNumber": data.partNumber || null, + "eTag": data.eTag || null + } + resolve(msg) // 调用 promise 内置方法处理成功 + }) + }); + this.PartNumberETag.push(result) + this.uploadProgress = Number((i / allSlice).toFixed(2)) * 100 + + if (this.PartNumberETag.length === allSlice) { + this.uploadProgress = 100 + this.endUploading(planType) + } }//for循环 } //完成分块上传 - endUploading (planType) { + endUploading(planType) { let data = this.PartNumberETag - let paramsData = {uploadId:this.uploadId} - this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - //console.log('创建成功') - this.uploadProgress = 0; - this.uploadisLoading = false - this.PartNumberETag =[] //清空保存返回的信息 - this.uploadover = true - let level = sessionStorage.getItem("level") - // console.log(level) - let PlanLevel - if(level == '0'){ - PlanLevel = 1 - } - if(level == '1'){ - PlanLevel = 2 - } - if(level == '2'){ - PlanLevel = 4 - } - if(level == '3'){ - PlanLevel = 8 - } + let paramsData = { uploadId: this.uploadId } + this.http.post(`/api/CompleteMultipartUpload/PlanPlatform/${this.objectName}`, data, { params: paramsData }).subscribe(data => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + //console.log('创建成功') + this.uploadProgress = 0; + this.uploadisLoading = false + this.PartNumberETag = [] //清空保存返回的信息 + this.uploadover = true + let level = sessionStorage.getItem("level") + // console.log(level) + let PlanLevel + if (level == '0') { + PlanLevel = 1 + } + if (level == '1') { + PlanLevel = 2 + } + if (level == '2') { + PlanLevel = 4 + } + if (level == '3') { + PlanLevel = 8 + } - let body:any = { - Name:this.unitname||'', - PlanCategory:8, - PlanLevel:PlanLevel, - PlanMode:1, - PlanType:8, - planType:16, - attachmentUrls:[`${this.objectName}`] - } - - this.http.post("/api/PlanComponentsMajor",body).subscribe((data:any)=>{ - this.snackBar.open('创建成功!','确定',config); - this.dialogRef.close(); - },err=>{ - this.snackBar.open('创建失败!','确定',config); - }) + let body: any = { + Name: this.unitname || '', + PlanCategory: 8, + PlanLevel: PlanLevel, + PlanMode: 1, + PlanType: 8, + planType: 16, + attachmentUrls: [`${this.objectName}`] + } + + this.http.post("/api/PlanComponentsMajor", body).subscribe((data: any) => { + this.snackBar.open('创建成功!', '确定', config); + this.dialogRef.close(); + }, err => { + this.snackBar.open('创建失败!', '确定', config); + }) }) } - + //取消分块上传 - cancel () { - this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data=>{ + cancel() { + this.http.delete(`/api/MultipartUpload/PlanPlatform/${this.objectName}?uploadId=${this.uploadId}`).subscribe(data => { this.uploadProgress = 0; - this.uploadisLoading= false; - (document.getElementById('up')).value = null - this.PartNumberETag =[] //清空保存返回的信息 + this.uploadisLoading = false; + (document.getElementById('up')).value = null + this.PartNumberETag = [] //清空保存返回的信息 const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('取消上传成功!','确定',config); + this.snackBar.open('取消上传成功!', '确定', config); this.uploadover = false this.file = null }) } //创建预案 - newplan(){ + newplan() { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - if(this.unitname==undefined||this.unitname==''){ - this.snackBar.open('请输入预案名称!','确定',config); + if (this.unitname == undefined || this.unitname == '') { + this.snackBar.open('请输入预案名称!', '确定', config); } - else if(this.file==undefined){ - this.snackBar.open('请先上传文件!','确定',config); + else if (this.file == undefined) { + this.snackBar.open('请先上传文件!', '确定', config); } - else{ - if(this.reservePlanType!='1'){ + else { + if (this.reservePlanType != '1') { this.startUploading("非二维") } - else{this.startUploading("二维")} - - + else { this.startUploading("二维") } + + } - + } //取消按钮 - close(){ + close() { this.dialogRef.close(); } } @@ -599,15 +582,15 @@ export class newunitType{ templateUrl: './resulttypePlan.html', styleUrls: ['./type-plan.component.scss'] }) -export class typeAuditResult{ - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} - planName:any = this.data.element.name - commitTime:any = this.data.element.committedTime - commitOrganizationName:any = this.data.element.committerOrganizationName - - auditOrganizationName:any = this.data.element.auditorOrganizationName - auditResult:any = this.data.element.auditStatus - auditOpinion:any = this.data.element.auditOpinion +export class typeAuditResult { + constructor(private http: HttpClient, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data, public snackBar: MatSnackBar) { } + planName: any = this.data.element.name + commitTime: any = this.data.element.committedTime + commitOrganizationName: any = this.data.element.committerOrganizationName + + auditOrganizationName: any = this.data.element.auditorOrganizationName + auditResult: any = this.data.element.auditStatus + auditOpinion: any = this.data.element.auditOpinion ngOnInit(): void { } onNoClick(): void { diff --git a/src/app/searchComponent.service.ts b/src/app/searchComponent.service.ts new file mode 100644 index 0000000..3759d8e --- /dev/null +++ b/src/app/searchComponent.service.ts @@ -0,0 +1,30 @@ +import { ApplicationRef, ComponentFactoryResolver, ComponentRef, EmbeddedViewRef, Injectable, Injector } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class SearchService { + constructor(private componentFactoryResolver: ComponentFactoryResolver, private applicationRef: ApplicationRef, private injector: Injector,) { } + + //angular 动态添加组件 + appendComponentToBody(component: any): ComponentRef { + //create a component reference + const componentRef = this.componentFactoryResolver.resolveComponentFactory(component).create(this.injector); + // attach component to the appRef so that so that it will be dirty checked. + this.applicationRef.attachView(componentRef.hostView); + + // get DOM element from component + const domElem = (componentRef.hostView as EmbeddedViewRef).rootNodes[0] as HTMLElement; + + document.body.appendChild(domElem); + + return componentRef as ComponentRef; + } + + //删除组件 + removeComponentFromBody(componentRef: ComponentRef) { + this.applicationRef.detachView(componentRef.hostView); + componentRef.destroy(); + } + +} \ No newline at end of file diff --git a/src/app/statistic-analysis/all-plan/all-plan.component.ts b/src/app/statistic-analysis/all-plan/all-plan.component.ts index 2a905dd..0327f73 100644 --- a/src/app/statistic-analysis/all-plan/all-plan.component.ts +++ b/src/app/statistic-analysis/all-plan/all-plan.component.ts @@ -12,7 +12,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree' import { MatPaginator } from '@angular/material/paginator'; import { FlatTreeControl } from '@angular/cdk/tree'; import { FormControl } from '@angular/forms'; -import { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' import { PageEvent } from '@angular/material/paginator'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @@ -28,102 +28,84 @@ declare var CryptoJS }) export class AllPlanComponent implements OnInit { - constructor(private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public route: ActivatedRoute,private router: Router) { } + constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public route: ActivatedRoute, private router: Router) { } ngOnInit(): void { this.route.queryParams.subscribe(params => { this.titlename = params['name']; this.type = params['type']; - this.jsId=params['id'] - this.tid=params.tid + this.jsId = params['id'] + this.tid = params.tid }); this.getAlltabledate() } tid - displayedColumns: string[] = ['unitname','modifiedTime','organizationName','buildingTypes','operation']; + displayedColumns: string[] = ['unitname', 'modifiedTime', 'organizationName', 'buildingTypes', 'operation']; tabledataSource titlename //上个页面传过来的名称 type //上个页面传过来:1重点单位 2预案 jsId //组织机构id //分页 - @ViewChild(MatPaginator, {static: true}) + @ViewChild(MatPaginator, { static: true }) pageEvent: PageEvent; paginator: MatPaginator; - length:any; //共多少条数据 - pageSize:any; //每页条数 + length: any; //共多少条数据 + pageSize: any; //每页条数 pageSizeOptions: number[] = [10] //设置每页条数 - PageNumber:any; //第几页 + PageNumber: any; //第几页 //分页事件 - changePage(e){ - this.PageNumber = e.pageIndex+1 + changePage(e) { + this.PageNumber = e.pageIndex + 1 this.getAlltabledate() } //返回 - goBack () { + goBack() { sessionStorage.setItem('refresh', 'true'); history.go(-1); //this.echartsData.statefulInspectionToggle = true } //获得所有预案 - getAlltabledate(){ - let paramtedate:any={ - organizationId:this.jsId||'', - planStatus:this.tid=='pieone'?'': this.type, - PlanCategory:this.tid=='pieone'?this.type:'', + getAlltabledate() { + let paramtedate: any = { + organizationId: this.jsId || '', + planStatus: this.tid == 'pieone' ? '' : this.type, + PlanCategory: this.tid == 'pieone' ? this.type : '', PageNumber: this.PageNumber || '1', PageSize: this.pageSizeOptions[0] } - this.http.get(`/api/Plans/Organizations`,{params:paramtedate}).subscribe((data:any)=>{ + this.http.get(`/api/Plans/Organizations`, { params: paramtedate }).subscribe((data: any) => { this.length = data.totalCount - this.tabledataSource=data.items + this.tabledataSource = data.items //console.log(this.tabledataSource) }) } //查看详情 - lookPlan(e){ - if(e.planType == 16||e.planType == 4||e.planType == 8){ - var index=e.attachmentUrls[0].indexOf("\/") - if(e.attachmentUrls[0].substr(0,index)=='psw'){ + lookPlan(e) { + if (e.planType == 16 || e.planType == 4 || e.planType == 8) { + var index = e.attachmentUrls[0].indexOf("\/") + if (e.attachmentUrls[0].substr(0, index) == 'psw') { const dialogRef = this.dialog.open(PsViewer, { width: '1500px', - height:'800px', + height: '800px', data: e.attachmentUrls[0] }); } - else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf' - ||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC' - ||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */{ - let filename:string - let fetchUrl = e.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse=JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data:any)=>{ - filename=data.fileName - let json={ - doc: { - docId: docId, - title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/`+fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ','FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - var stringjson=JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) - }) + else { + let fetchUrl = e.attachmentUrls[0] + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + } else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + } } } /* if(e.planType == 4){ @@ -136,18 +118,18 @@ export class AllPlanComponent implements OnInit { }); } } */ - if(e.planType == 1){ //如果是在线编辑 - let id = e.id - sessionStorage.setItem("planId",id) - sessionStorage.setItem("companyId",e.company.id) - sessionStorage.setItem("buildingTypeId",e.company.buildingTypes[0].id) - sessionStorage.setItem("editable","0") - sessionStorage.setItem("planName",e.name) + if (e.planType == 1) { //如果是在线编辑 + let id = e.id + sessionStorage.setItem("planId", id) + sessionStorage.setItem("companyId", e.company.id) + sessionStorage.setItem("buildingTypeId", e.company.buildingTypes[0].id) + sessionStorage.setItem("editable", "0") + sessionStorage.setItem("planName", e.name) let companyId = sessionStorage.getItem("companyId") window.open(`/keyUnit/viewunitinfoplan?id=${companyId}&orName=${this.route.snapshot.queryParams.orName}&orId=${this.route.snapshot.queryParams.orId}`); } - if(e.planType == 2){ //如果是跳转网页 - sessionStorage.setItem("url",e.url) + if (e.planType == 2) { //如果是跳转网页 + sessionStorage.setItem("url", e.url) window.open(`/planManagement/webLook`) } } @@ -160,13 +142,13 @@ export class AllPlanComponent implements OnInit { templateUrl: './Photo-Sphere-Viewer.html', styleUrls: ['./all-plan.component.scss'] }) -export class PsViewer{ - constructor(private router:Router,private http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) {} +export class PsViewer { + constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any) { } ngOnInit(): void { const viewer = new Viewer({ container: document.querySelector('#viewer'), - panorama:'/api/Objects/PlanPlatform/'+ this.data, - + panorama: '/api/Objects/PlanPlatform/' + this.data, + }); } } \ No newline at end of file diff --git a/src/app/statistic-analysis/home/home.component.ts b/src/app/statistic-analysis/home/home.component.ts index 169a2eb..996420f 100644 --- a/src/app/statistic-analysis/home/home.component.ts +++ b/src/app/statistic-analysis/home/home.component.ts @@ -2,737 +2,529 @@ import { Component, OnInit, Renderer2, ElementRef } from '@angular/core'; import { HttpClient } from '@angular/common/http' import { Router } from '@angular/router'; import { EchartsDataService } from '../echarts-data.service'; +import { MapFactory } from '@src/modules/map/declare/factory'; +import { IMap } from '@src/modules/map/declare/map'; declare var echarts: any; -declare var AMap: any; -declare var AMapUI: any; + @Component({ - selector: 'app-home', - templateUrl: './home.component.html', - styleUrls: ['./home.component.scss'] + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit { - constructor(private http:HttpClient, private render2: Renderer2,public element: ElementRef,private router: Router,public emitService: EchartsDataService) { } - - map:any; //地图 - yuandata - ngOnInit() { - this.level=sessionStorage.getItem("level") - this.getechartsdata() - /* this.emitService.eventEmit.subscribe((value: any) => { - if (value == 'echarts') { - setTimeout(() => { - this.updateEcharts() - }, 500); - } - }); - window.addEventListener('resize', () => { - setTimeout(() => { - this.updateEcharts() - }, 0); - }) */ - - window.setTimeout(()=>{ - /* this.unitType() - this.unitData() - this.keyUnit() */ - this.mapInit() //初始化地图 - },0) - } - - //更新echarts视图 - /* updateEcharts(){ - this.planState.resize() - this.chartDwsjcj.resize() - this.chartZdgzqy.resize() + constructor(private http: HttpClient, private render2: Renderer2, public element: ElementRef, private router: Router, public emitService: EchartsDataService) { } - } */ - //获取数据 - ordata - buildtableData - lengthdata=[]//建筑提示数据 - buildcount=0//建筑总数 - indexData=[]//建筑所有数据 - async getechartsdata(){ - let paramsdata:any = { - OrganizationId:this.orid||'', - //organizationId:'1' + map: IMap; //地图 + yuandata + ngOnInit() { + this.getechartsdata() + window.setTimeout(() => { + /* this.unitType() + this.unitData() + this.keyUnit() */ + this.mapInit() //初始化地图 + }, 0) } - //获取组织机构数据 - await this.emitService.getData(paramsdata,`/api/StatisticsAnalysis/Companies`) - this.ordata=JSON.parse(JSON.stringify(this.emitService.allDate)) - console.log(this.ordata) - this.keyUnitNum=this.ordata[0].organizationStatistics.totalCount - this.unitData() - //获取预案状态统计数据 - await this.emitService.getData(paramsdata,`/api/StatisticsAnalysis/Plans`) - this.unitType() - //获取建筑类型统计数据 - await this.emitService.getData(paramsdata,`/api/StatisticsAnalysis/BuildingTypes`) - this.keyUnit() - } - - threePlan(){ - // this.router.navigate(['/planManagement/entryPlan']) - } - twoPlan(){ - // this.router.navigate(['/planManagement/entryPlan']) - } - cardPlan(){ - // this.router.navigate(['/planManagement/entryPlan']) - } - otherPlan(){ - // this.router.navigate(['/planManagement/entryPlan']) - } + //更新echarts视图 + /* updateEcharts(){ + this.planState.resize() + this.chartDwsjcj.resize() + this.chartZdgzqy.resize() - //计划更新页面跳转 - scheduled(){ - this.router.navigate(['/statisticanalysis/scheduledUpdates']) - } - - ngOnDestroy(): void { - /* this.planState.clear() - this.planState.dispose() - this.chartDwsjcj.clear() - this.chartDwsjcj.dispose() - this.chartZdgzqy.clear() - this.chartZdgzqy.dispose() */ - - } - //初始化地图 - adcode:any //行政编码 - level//组织级别 - orid - mapInit () { - //创建地图 - this.map = new AMap.Map('chartMap', { - cursor: 'default', - zooms:[8,16], - mapStyle:"amap://styles/grey", - // bubble: true - }); - - let colors = [ - "#3366cc", "#dc3912", "#ff9900", "#109618", "#990099", "#0099c6", "#dd4477", "#66aa00", - "#b82e2e", "#316395", "#994499", "#22aa99", "#aaaa11", "#6633cc", "#e67300", "#8b0707", - "#651067", "#329262", "#5574a6", "#3b3eac" - ]; - - AMapUI.loadUI(['geo/DistrictExplorer'], (DistrictExplorer)=> { - - //创建一个实例 - let districtExplorer = new DistrictExplorer({ - map: this.map, - eventSupport: true, //打开事件支持 - }); - - // let adcode = this.adcode; //行政编码 - let adcode - if(sessionStorage.getItem("realName") == "上海总队"){ - adcode = 310000 - }else{ - adcode = 310000 - } - - districtExplorer.loadAreaNode(adcode, (error, areaNode)=> { - - //更新地图视野 - this.map.setBounds(areaNode.getBounds(), null, null, true); - - //设置定位节点,支持鼠标位置识别 - //注意节点的顺序,前面的高优先级 - districtExplorer.setAreaNodesForLocating(areaNode); - - //清除已有的绘制内容 - districtExplorer.clearFeaturePolygons(); - - //绘制子区域 - districtExplorer.renderSubFeatures(areaNode, (feature, i) =>{ - // console.log(123,feature,i) - - let fillColor = colors[i % colors.length]; - let strokeColor = colors[colors.length - 1 - i % colors.length]; - - return { - cursor: 'default', - bubble: true, - strokeColor: strokeColor, //线颜色 - strokeOpacity: 1, //线透明度 - strokeWeight: 1, //线宽 - fillColor: fillColor, //填充色 - fillOpacity: 0.5, //填充透明度 - }; - }); - - //绘制父区域 - districtExplorer.renderParentFeature(areaNode, { - cursor: 'default', - bubble: true, - strokeColor: 'black', //线颜色 - strokeOpacity: 1, //线透明度 - strokeWeight: 1, //线宽 - fillColor: null, //填充色 - fillOpacity: 0.5, //填充透明度 - }); - - // 更新地图视野以适合区划面 - this.map.setFitView(districtExplorer.getAllFeaturePolygons()); - }); - if(this.level=="0"||this.level=="1"||this.level=="2"){ - //区域内点击 - districtExplorer.on('featureClick', (e, feature) =>{ - //console.log(feature) - let paramsdata:any ={ - name:feature.properties.name, - level:Number(this.level)+1 + } */ + //获取数据 + ordata + buildtableData + lengthdata = []//建筑提示数据 + buildcount = 0//建筑总数 + indexData = []//建筑所有数据 + async getechartsdata() { + let paramsdata: any = { + OrganizationId: this.orid || '', + //organizationId:'1' } - this.http.get("/api/Organizations/GetIdByName",{params:paramsdata}).subscribe((data:any)=>{ - console.log(data) - this.orid=data[0] - this.getechartsdata() - }) - - let props = feature.properties; - adcode = props.adcode - let fillColor2 - if(props.level == 'city'){ - fillColor2 = null - }else{ - fillColor2 = '#d0daee' - } - districtExplorer.loadAreaNode(adcode, (error, areaNode)=> { - //更新地图视野 - // this.map.setBounds(areaNode.getBounds(), null, null, true); + //获取组织机构数据 + await this.emitService.getData(paramsdata, `/api/StatisticsAnalysis/Companies`) + this.ordata = JSON.parse(JSON.stringify(this.emitService.allDate)) + console.log(this.ordata) + this.keyUnitNum = this.ordata[0].organizationStatistics.totalCount + this.unitData() + //获取预案状态统计数据 + await this.emitService.getData(paramsdata, `/api/StatisticsAnalysis/Plans`) + this.unitType() + //获取建筑类型统计数据 + await this.emitService.getData(paramsdata, `/api/StatisticsAnalysis/BuildingTypes`) + this.keyUnit() + } - //设置定位节点,支持鼠标位置识别 - //注意节点的顺序,前面的高优先级 - districtExplorer.setAreaNodesForLocating(areaNode); - //清除已有的绘制内容 - districtExplorer.clearFeaturePolygons(); - - //绘制子区域 - districtExplorer.renderSubFeatures(areaNode, (feature, i) =>{ - let fillColor = colors[i % colors.length]; - // console.log(111,fillColor) - let strokeColor = colors[colors.length - 1 - i % colors.length]; - - return { - cursor: 'default', - bubble: true, - strokeColor: strokeColor, //线颜色 - strokeOpacity: 1, //线透明度 - strokeWeight: 1, //线宽 - fillColor: fillColor, //填充色 - fillOpacity: 0.5, //填充透明度 - }; - }); - - //绘制父区域 - districtExplorer.renderParentFeature(areaNode, { - cursor: 'default', - bubble: true, - strokeColor: 'black', //线颜色 - strokeOpacity: 1, //线透明度 - strokeWeight: 1, //线宽 - fillColor: fillColor2, //填充色 - fillOpacity: 0.5, //填充透明度 - }); + threePlan() { + // this.router.navigate(['/planManagement/entryPlan']) + } + twoPlan() { + // this.router.navigate(['/planManagement/entryPlan']) + } + cardPlan() { + // this.router.navigate(['/planManagement/entryPlan']) + } + otherPlan() { + // this.router.navigate(['/planManagement/entryPlan']) + } - // 更新地图视野以适合区划面 - this.map.setFitView(districtExplorer.getAllFeaturePolygons()); - }); - - //this.planState.setOption(this.planStateOptionsZhong); - //this.chartDwsjcj.setOption(this.chartDwsjcjOptionsZhong); - //this.chartZdgzqy.setOption(this.chartZdgzqyOptionsZhong); - /* this.planNum = ["0","0","3","1","6","5"] - this.keyUnitNum = 666 */ - //this.dataGetNum = 456 + //计划更新页面跳转 + scheduled() { + this.router.navigate(['/statisticanalysis/scheduledUpdates']) + } - /* this.threePlanNum = "867" - this.twoPlanNum = "485" - this.cardPlanNum = "756" - this.otherPlanNum = "658" */ - }); + ngOnDestroy(): void { + /* this.planState.clear() + this.planState.dispose() + this.chartDwsjcj.clear() + this.chartDwsjcj.dispose() + this.chartZdgzqy.clear() + this.chartZdgzqy.dispose() */ - districtExplorer.on('outsideClick', (e) => { - this.orid='' + } + //初始化地图 + adcode: any //行政编码 + level = sessionStorage.getItem("level")//组织级别 + orid + + //封装Gaode + getEchartsData(data) { + return new Promise((resolve, reject) => { + let paramsdata: any = { + name: data.properties.name, + level: Number(this.level) + 1 + } + this.http.get("/api/Organizations/GetIdByName", { params: paramsdata }).subscribe((data: any) => { + this.orid = data[0] + this.getechartsdata() + resolve('success') + }) + }) + } + setEchartsData() { + this.orid = '' this.getechartsdata() - // console.log('区域外点击'); - let adcode - if(sessionStorage.getItem("realName") == "上海总队"){ - adcode = 310000 - }else{ - adcode = 310000 - } - districtExplorer.loadAreaNode(adcode, (error, areaNode)=> { - //更新地图视野 - // this.map.setBounds(areaNode.getBounds(), null, null, true); - - //设置定位节点,支持鼠标位置识别 - //注意节点的顺序,前面的高优先级 - districtExplorer.setAreaNodesForLocating(areaNode); + } + //封装Gaode - //清除已有的绘制内容 - districtExplorer.clearFeaturePolygons(); - - //绘制子区域 - districtExplorer.renderSubFeatures(areaNode, (feature, i) =>{ - let fillColor = colors[i % colors.length]; - // console.log(111,fillColor) - let strokeColor = colors[colors.length - 1 - i % colors.length]; - - return { - cursor: 'default', - bubble: true, - strokeColor: strokeColor, //线颜色 - strokeOpacity: 1, //线透明度 - strokeWeight: 1, //线宽 - fillColor: fillColor, //填充色 - fillOpacity: 0.5, //填充透明度 - }; - }); - - //绘制父区域 - districtExplorer.renderParentFeature(areaNode, { + mapInit() { + //创建地图 + this.map = MapFactory.MapInstance('chartMap', { cursor: 'default', - bubble: true, - strokeColor: 'black', //线颜色 - strokeOpacity: 1, //线透明度 - strokeWeight: 1, //线宽 - fillColor: null, //填充色 - fillOpacity: 0.5, //填充透明度 - }); - - // 更新地图视野以适合区划面 - this.map.setFitView(districtExplorer.getAllFeaturePolygons()); + zooms: [8, 16], + mapStyle: "amap://styles/grey", }); - /* this.planState.setOption(this.planStateOptionsZhi); - this.chartDwsjcj.setOption(this.chartDwsjcjOptionsZhi); - this.chartZdgzqy.setOption(this.chartZdgzqyOptionsZhi); */ - /* this.planNum = ["0","2","2","6","7","8"] - this.keyUnitNum = 8036 - this.dataGetNum = 6578 */ + this.map.setAdministrativeAreaStyle(this, this.getEchartsData, this.setEchartsData) + } + planNum = [] + keyUnitNum + dataGetNum = 6578 + + threePlanNum = "0" + twoPlanNum = "0" + cardPlanNum = "0" + otherPlanNum = "0" + + aPlan = '0' + bPlan = '0' + cPlan = '0' + dPlan = '0' + ePlan = '0' + ngAfterViewInit(): void { + } - /* this.threePlanNum = "4374" - this.twoPlanNum = "9693" - this.cardPlanNum = "6403" - this.otherPlanNum = "2208" */ - }) - } - - - }); + planState - } - planNum = [] - keyUnitNum - dataGetNum = 6578 + //预案状态统计 + pagedata + pagedataCount + unitType() { + this.planNum = [] + this.pagedata = JSON.parse(JSON.stringify(this.emitService.allDate)) + console.log(this.pagedata) + this.pagedataCount = String(this.pagedata[0].planStatusStatistics.totalCount) + for (var i = 0; i < this.pagedataCount.length; i++) { + this.planNum.push(this.pagedataCount[i]) + } + //this.planNum.push(this.pagedataCount.split(',')) + if (this.pagedata[0].planTypeStatistics.planTypes.length <= 0) { + this.threePlanNum = '0' + this.twoPlanNum = '0' + this.cardPlanNum = '0' + this.otherPlanNum = '0' + } else { + this.pagedata[0].planTypeStatistics.planTypes.forEach((value, index, array) => { + if (array[index].planTypeName == 'Plan2D') { + this.twoPlanNum = array[index].count + } else if (array[index].planTypeName == 'Plan3D') { + this.threePlanNum = array[index].count + } else if (array[index].planTypeName == 'Other') { + this.otherPlanNum = array[index].count + } else if (array[index].planTypeName == 'PlanText') { + this.cardPlanNum = array[index].count + } + }); + } + if (this.pagedata[0].planCategoryStatistics.planCategories.length <= 0) { + this.aPlan = '0' + this.bPlan = '0' + this.cPlan = '0' + this.dPlan = '0' + this.ePlan = '0' + } else { + this.pagedata[0].planCategoryStatistics.planCategories.forEach((value, index, array) => { + if (array[index].planCategoryName == 'LevelOne') { + this.aPlan = array[index].count + } else if (array[index].planCategoryName == 'LevelTwo') { + this.bPlan = array[index].count + } else if (array[index].planCategoryName == 'LevelThree') { + this.cPlan = array[index].count + } else if (array[index].planCategoryName == 'LevelFour') { + this.dPlan = array[index].count + } else if (array[index].planCategoryName == 'LevelFive') { + this.ePlan = array[index].count + } + }); + } - threePlanNum = "0" - twoPlanNum = "0" - cardPlanNum = "0" - otherPlanNum = "0" + /* */ + let planStateOptionsZhi = { + title: { + text: `预案状态统计(${this.pagedata[0].planStatusStatistics.totalCount}份)`, + left: 'left', + textStyle: { + color: '#fff', + fontWeight: 'normal' + } + }, + tooltip: { + trigger: 'item', + formatter: '{b} : {c} ({d}%)' + }, + series: [ + { + name: '访问来源', + type: 'pie', + radius: '60%', + center: ['50%', '58%'], + label: { + show: true, + //fontSize:10, + formatter: '{b}\n{d|{c}份}', + rich: { + d: { + align: 'center', + } + }, + + }, + data: [ + { value: this.pagedata[0].planStatusStatistics.planStatuses[0] != undefined ? this.pagedata[0].planStatusStatistics.planStatuses[0].count : 0, name: '预案新增', type: 1, planStatusName: this.pagedata[0].planStatusStatistics.planStatuses[0] != undefined ? this.pagedata[0].planStatusStatistics.planStatuses[0].planStatusName : '' }, + { value: this.pagedata[0].planStatusStatistics.planStatuses[2] != undefined ? this.pagedata[0].planStatusStatistics.planStatuses[2].count : 0, name: '预案审核通过', type: 3, planStatusName: this.pagedata[0].planStatusStatistics.planStatuses[2] != undefined ? this.pagedata[0].planStatusStatistics.planStatuses[2].planStatusName : '' }, + { value: this.pagedata[0].planStatusStatistics.planStatuses[4] != undefined ? this.pagedata[0].planStatusStatistics.planStatuses[4].count : 0, name: '预案编制', type: 5, planStatusName: this.pagedata[0].planStatusStatistics.planStatuses[4] != undefined ? this.pagedata[0].planStatusStatistics.planStatuses[4].planStatusName : '' }, + { value: this.pagedata[0].planStatusStatistics.planStatuses[3] != undefined ? this.pagedata[0].planStatusStatistics.planStatuses[3].count : 0, name: '预案审核退回', type: 4, planStatusName: this.pagedata[0].planStatusStatistics.planStatuses[3] != undefined ? this.pagedata[0].planStatusStatistics.planStatuses[3].planStatusName : '' }, + { value: this.pagedata[0].planStatusStatistics.planStatuses[1] != undefined ? this.pagedata[0].planStatusStatistics.planStatuses[1].count : 0, name: '预案审核中', type: 2, planStatusName: this.pagedata[0].planStatusStatistics.planStatuses[1] != undefined ? this.pagedata[0].planStatusStatistics.planStatuses[1].planStatusName : '' } + ], + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + this.planState = echarts.init(document.getElementById('chartHynyxf'), 'walden'); + this.planState.setOption(planStateOptionsZhi); + this.planState.on("click", (params) => { + this.router.navigate(['/statisticanalysis/statePageOne']) + }) + } - aPlan = '0' - bPlan = '0' - cPlan = '0' - dPlan = '0' - ePlan = '0' - ngAfterViewInit(): void { - } + //新增、删除单位统计 + chartDwsjcj + addtable + addxdata = [] + addydata = [] + chartDwsjcjOptionsZhong = { + // color: ['#FB33C2', '#00CFF0', '#2C3DE0'], + // 标题 + title: { + text: '新增、删除单位统计', + left: 0, + top: 0, + textStyle: { + color: '#fff', + fontWeight: 'normal' + }, + }, + grid: { + left: 30, + right: 0, + }, + //图例 + legend: { + top: 0, + data: ['新增单位', '删除单位',], + icon: 'circle', + itemGap: 20, + }, + //提示框 + tooltip: { + trigger: 'axis', + }, + // x轴 + xAxis: { + type: 'category', + data: ["浦东中队", "黄浦中队", "徐汇中队", "长宁中队", "静安中队", "普陀中队", "虹口中队", "杨浦中队", "闵行中队", "宝山中队", "嘉定中队", "松江中队", "金山中队", "崇明中队"], + axisLabel: { + interval: 0, + + formatter: function (value) { + var ret = "";//拼接加\n返回的类目项 + var maxLength = 5;//每项显示文字个数 + var valLength = value.length;//X轴类目项的文字个数 + var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数 + if (rowN > 1) { //如果类目项的文字大于3, + for (var i = 0; i < rowN; i++) { + var temp = "";//每次截取的字符串 + var start = i * maxLength;//开始截取的位置 + var end = start + maxLength;//结束截取的位置 + //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 + temp = value.substring(start, end) + "\n"; + ret += temp; + } //凭借最终的字符串 + return ret; + } else { + return value; + } + } //function - planState - - - //预案状态统计 - pagedata - pagedataCount - unitType () { - this.planNum=[] - this.pagedata=JSON.parse(JSON.stringify(this.emitService.allDate)) - console.log(this.pagedata) - this.pagedataCount=String(this.pagedata[0].planStatusStatistics.totalCount) - for(var i=0;i { - if(array[index].planTypeName=='Plan2D'){ - this.twoPlanNum=array[index].count - }else if(array[index].planTypeName=='Plan3D'){ - this.threePlanNum=array[index].count - }else if(array[index].planTypeName=='Other'){ - this.otherPlanNum=array[index].count - }else if(array[index].planTypeName=='PlanText'){ - this.cardPlanNum=array[index].count - } - }); - } - if(this.pagedata[0].planCategoryStatistics.planCategories.length<=0){ - this.aPlan='0' - this.bPlan='0' - this.cPlan='0' - this.dPlan='0' - this.ePlan='0' - }else{ - this.pagedata[0].planCategoryStatistics.planCategories.forEach((value,index,array) => { - if(array[index].planCategoryName=='LevelOne'){ - this.aPlan=array[index].count - }else if(array[index].planCategoryName=='LevelTwo'){ - this.bPlan=array[index].count - }else if(array[index].planCategoryName=='LevelThree'){ - this.cPlan=array[index].count - }else if(array[index].planCategoryName=='LevelFour'){ - this.dPlan=array[index].count - }else if(array[index].planCategoryName=='LevelFive'){ - this.ePlan=array[index].count - } - }); - } - - - /* */ - let planStateOptionsZhi = { - title: { - text: `预案状态统计(${this.pagedata[0].planStatusStatistics.totalCount}份)`, - left: 'left', - textStyle:{ - color:'#fff', - fontWeight:'normal' - } - }, - tooltip: { - trigger: 'item', - formatter: '{b} : {c} ({d}%)' - }, - series: [ - { - name: '访问来源', - type: 'pie', - radius: '60%', - center: ['50%', '58%'], - label:{ - show:true, - //fontSize:10, - formatter:'{b}\n{d|{c}份}', - rich: { - d: { - align: 'center', + } + }, + // y轴 + yAxis: { + type: 'value', + splitLine: { + show: true, + lineStyle: { + color: 'rgba(255,255,255,.4)' } - }, - }, - data: [ - {value:this.pagedata[0].planStatusStatistics.planStatuses[0]!=undefined? this.pagedata[0].planStatusStatistics.planStatuses[0].count:0, name: '预案新增',type:1,planStatusName:this.pagedata[0].planStatusStatistics.planStatuses[0]!=undefined?this.pagedata[0].planStatusStatistics.planStatuses[0].planStatusName:''}, - {value:this.pagedata[0].planStatusStatistics.planStatuses[2]!=undefined? this.pagedata[0].planStatusStatistics.planStatuses[2].count:0, name: '预案审核通过',type:3,planStatusName:this.pagedata[0].planStatusStatistics.planStatuses[2]!=undefined? this.pagedata[0].planStatusStatistics.planStatuses[2].planStatusName:''}, - {value:this.pagedata[0].planStatusStatistics.planStatuses[4]!=undefined? this.pagedata[0].planStatusStatistics.planStatuses[4].count:0, name: '预案编制',type:5,planStatusName:this.pagedata[0].planStatusStatistics.planStatuses[4]!=undefined?this.pagedata[0].planStatusStatistics.planStatuses[4].planStatusName:''}, - {value:this.pagedata[0].planStatusStatistics.planStatuses[3]!=undefined? this.pagedata[0].planStatusStatistics.planStatuses[3].count:0, name: '预案审核退回',type:4,planStatusName:this.pagedata[0].planStatusStatistics.planStatuses[3]!=undefined? this.pagedata[0].planStatusStatistics.planStatuses[3].planStatusName:''}, - {value:this.pagedata[0].planStatusStatistics.planStatuses[1]!=undefined? this.pagedata[0].planStatusStatistics.planStatuses[1].count:0, name: '预案审核中',type:2,planStatusName:this.pagedata[0].planStatusStatistics.planStatuses[1]!=undefined? this.pagedata[0].planStatusStatistics.planStatuses[1].planStatusName:''} - ], - emphasis: { - itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' + }, + // 数据 + series: [ + { + name: '新增单位', + type: 'bar', + data: [88, 45, 95, 105, 75, 89, 69, 110, 96, 90, 80, 78, 94, 102], + label: { + show: false, + position: "top", + formatter: '{c}', + color: "#fff", + } + }, { + name: '删除单位', + type: 'bar', + data: [35, 33, 27, 30, 35, 36, 28, 32, 36, 22, 19, 28, 34, 36], + label: { + show: false, + position: "top", + formatter: '{c}', + color: "#fff", } } - } - ] + ], }; - this.planState = echarts.init(document.getElementById('chartHynyxf'), 'walden'); - this.planState.setOption(planStateOptionsZhi); - this.planState.on("click",(params) => { - this.router.navigate(['/statisticanalysis/statePageOne']) - }) - } + unitData() { + this.addxdata = [] + this.addydata = [] + this.addtable = JSON.parse(JSON.stringify(this.emitService.allDate)) + this.addtable[0].organizationStatistics.organizations.forEach((value, index, array) => { + this.addxdata.push(array[index].organizationName) + this.addydata.push(array[index].count) + }); + let chartDwsjcjOptionsZhi = { + // 标题 + title: { + text: `新增单位统计(${this.addtable[0].totalCount}家)`, + left: 0, + top: 0, + textStyle: { + color: '#fff', + fontWeight: 'normal' + }, + }, + grid: { + //containLabel:true, + left: 30, + right: 0, + bottom: 30 + }, + //图例 + /* legend: { + top: 0, + data: ['新增单位' ], + icon: 'circle', + itemGap: 20, + }, */ + //提示框 + tooltip: { + trigger: 'axis', + }, + // x轴 + xAxis: { + type: 'category', + data: this.addxdata, + axisLabel: { + interval: 0, + + formatter: function (value) { + var ret = "";//拼接加\n返回的类目项 + var maxLength = 5;//每项显示文字个数 + var valLength = value.length;//X轴类目项的文字个数 + var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数 + if (rowN > 1) { //如果类目项的文字大于3, + for (var i = 0; i < rowN; i++) { + var temp = "";//每次截取的字符串 + var start = i * maxLength;//开始截取的位置 + var end = start + maxLength;//结束截取的位置 + //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 + temp = value.substring(start, end) + "\n"; + ret += temp; + } //凭借最终的字符串 + return ret; + } else { + return value; + } + } //function - //新增、删除单位统计 - chartDwsjcj - addtable - addxdata=[] - addydata=[] - chartDwsjcjOptionsZhong = { - // color: ['#FB33C2', '#00CFF0', '#2C3DE0'], - // 标题 - title: { - text: '新增、删除单位统计', - left: 0, - top: 0, - textStyle:{ - color:'#fff', - fontWeight:'normal' - }, - }, - grid: { - left: 30, - right: 0, - }, - //图例 - legend: { - top: 0, - data: ['新增单位', '删除单位', ], - icon: 'circle', - itemGap: 20, - }, - //提示框 - tooltip: { - trigger: 'axis', - }, - // x轴 - xAxis: { - type: 'category', - data: ["浦东中队","黄浦中队","徐汇中队","长宁中队","静安中队","普陀中队","虹口中队","杨浦中队","闵行中队","宝山中队","嘉定中队","松江中队","金山中队","崇明中队"], - axisLabel: { - interval: 0, + } + }, + // y轴 + yAxis: { + type: 'value', + splitLine: { + show: true, + lineStyle: { + color: 'rgba(255,255,255,.4)' + } + }, + }, + // 数据 + series: [ + { + name: '新增单位', + type: 'bar', + data: this.addydata, + label: { + show: false, + position: "top", + formatter: '{c}', + color: "#fff", + }, + barMaxWidth: '20%' + } + /* , { + name: '删除单位', + type: 'bar', + data: [300, 202, 101, 134, 290, 430, 220, 490, 430, 490, 430, 202, 101, 134 ], + label: { + show: false, + position: "top", + formatter: '{c}', + color: "#fff", + } + } */ + ], + }; + this.chartDwsjcj = echarts.init(document.getElementById('chartDwsjcj'), 'walden'); + this.chartDwsjcj.setOption(chartDwsjcjOptionsZhi); + this.chartDwsjcj.on("click", (params) => { + this.router.navigate(['/statisticanalysis/addUnit_one']) + }) + } - formatter:function(value){ - var ret = "";//拼接加\n返回的类目项 - var maxLength = 5;//每项显示文字个数 - var valLength = value.length;//X轴类目项的文字个数 - var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数 - if (rowN > 1) { //如果类目项的文字大于3, - for (var i = 0; i < rowN; i++) { - var temp = "";//每次截取的字符串 - var start = i * maxLength;//开始截取的位置 - var end = start + maxLength;//结束截取的位置 - //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 - temp = value.substring(start, end) + "\n"; - ret += temp; - } //凭借最终的字符串 - return ret; - }else { - return value; - } - } //function + chartZdgzqy - } - }, - // y轴 - yAxis: { - type: 'value', - splitLine: { - show: true, - lineStyle: { - color: 'rgba(255,255,255,.4)' - } - }, - }, - // 数据 - series: [ - { - name: '新增单位', - type: 'bar', - data: [88, 45, 95, 105, 75, 89, 69, 110, 96, 90, 80, 78, 94, 102], - label: { - show: false, - position: "top", - formatter: '{c}', - color: "#fff", - } - }, { - name: '删除单位', - type: 'bar', - data: [35, 33, 27, 30, 35, 36, 28, 32, 36, 22, 19, 28, 34, 36], - label: { - show: false, - position: "top", - formatter: '{c}', - color: "#fff", - } - } - ], - }; - unitData () { - this.addxdata=[] - this.addydata=[] - this.addtable=JSON.parse(JSON.stringify(this.emitService.allDate)) - this.addtable[0].organizationStatistics.organizations.forEach((value,index,array) => { - this.addxdata.push(array[index].organizationName) - this.addydata.push(array[index].count) - }); - let chartDwsjcjOptionsZhi = { - // 标题 - title: { - text: `新增单位统计(${this.addtable[0].totalCount}家)`, - left: 0, - top: 0, - textStyle:{ - color:'#fff', - fontWeight:'normal' - }, - }, - grid: { - //containLabel:true, - left: 30, - right: 0, - bottom:30 - }, - //图例 - /* legend: { - top: 0, - data: ['新增单位' ], - icon: 'circle', - itemGap: 20, - }, */ - //提示框 - tooltip: { - trigger: 'axis', - }, - // x轴 - xAxis: { - type: 'category', - data: this.addxdata, - axisLabel: { - interval: 0, - - formatter:function(value){ - var ret = "";//拼接加\n返回的类目项 - var maxLength = 5;//每项显示文字个数 - var valLength = value.length;//X轴类目项的文字个数 - var rowN = Math.ceil(valLength / maxLength); //类目项需要换行的行数 - if (rowN > 1) { //如果类目项的文字大于3, - for (var i = 0; i < rowN; i++) { - var temp = "";//每次截取的字符串 - var start = i * maxLength;//开始截取的位置 - var end = start + maxLength;//结束截取的位置 - //这里也可以加一个是否是最后一行的判断,但是不加也没有影响,那就不加吧 - temp = value.substring(start, end) + "\n"; - ret += temp; - } //凭借最终的字符串 - return ret; - }else { - return value; - } - } //function - - } - }, - // y轴 - yAxis: { - type: 'value', - splitLine: { - show: true, - lineStyle: { - color: 'rgba(255,255,255,.4)' - } - }, - }, - // 数据 - series: [ - { - name: '新增单位', - type: 'bar', - data: this.addydata, - label: { - show: false, - position: "top", - formatter: '{c}', - color: "#fff", - }, - barMaxWidth:'20%' - } - /* , { - name: '删除单位', - type: 'bar', - data: [300, 202, 101, 134, 290, 430, 220, 490, 430, 490, 430, 202, 101, 134 ], - label: { - show: false, - position: "top", - formatter: '{c}', - color: "#fff", - } - } */ - ], - }; - this.chartDwsjcj = echarts.init(document.getElementById('chartDwsjcj'),'walden'); - this.chartDwsjcj.setOption(chartDwsjcjOptionsZhi); - this.chartDwsjcj.on("click",(params) => { - this.router.navigate(['/statisticanalysis/addUnit_one']) - }) - } - chartZdgzqy - - - //建筑类型统计 - keyUnit () { - this.buildcount=0 - this.buildtableData=JSON.parse(JSON.stringify(this.emitService.allDate)) - //console.log(this.buildtableData) - for(var i=0;i{return {name: v.buildingTypeName,value:v.count,id:v.buildingTypeId}}) - let chartZdgzqyOptionsZhi = { - title: { - text: `建筑类型统计(${this.buildcount}家)`, - top: -5, - left: 'left', - textStyle:{ - color:'#fff', - fontWeight:'normal' + //建筑类型统计 + keyUnit() { + this.buildcount = 0 + this.buildtableData = JSON.parse(JSON.stringify(this.emitService.allDate)) + //console.log(this.buildtableData) + for (var i = 0; i < this.buildtableData[0].buildingTypes.length; i++) { + this.lengthdata.push(this.buildtableData[0].buildingTypes[i].buildingTypeName) + this.buildcount = this.buildcount + this.buildtableData[0].buildingTypes[i].count + this.indexData.push(this.buildtableData[0].buildingTypes[i]) } - }, - tooltip: { - trigger: 'item', - formatter: '{b} : {c}家 ({d}%)' - }, - // legend: { - // orient: 'vertical', - // right: 150, - // top:80, - // data: ['高层', '地下', '轨道交通', '化工生产', '储罐类' , '厂房','古建筑', '商市场', '医院', '学校', '宾馆' , '娱乐场所','餐饮业', '影剧院', '展览建筑' , '隧道'] - // }, - series: [ - { - name: '访问来源', - type: 'pie', - radius: '70%', - center: ['50%', '61%'], - label:{ - show:true, - // fontSize:13, - formatter:'{b}{c}家', - rich: { - d: { - align: 'center', - } + //JSON.parse(JSON.stringify(this.indexData).replace(/buildingTypeName/g, 'name')) + this.indexData = this.indexData.map(v => { return { name: v.buildingTypeName, value: v.count, id: v.buildingTypeId } }) + let chartZdgzqyOptionsZhi = { + title: { + text: `建筑类型统计(${this.buildcount}家)`, + top: -5, + left: 'left', + textStyle: { + color: '#fff', + fontWeight: 'normal' + } }, - }, - data: this.indexData, - emphasis: { - itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - } - } - ] - }; - this.chartZdgzqy = echarts.init(document.getElementById('chartZdgzqy'), 'walden'); - this.chartZdgzqy.setOption(chartZdgzqyOptionsZhi); - this.chartZdgzqy.on("click",(params) => { - this.router.navigate(['/statisticanalysis/buildingType_one']) - }) - } + tooltip: { + trigger: 'item', + formatter: '{b} : {c}家 ({d}%)' + }, + // legend: { + // orient: 'vertical', + // right: 150, + // top:80, + // data: ['高层', '地下', '轨道交通', '化工生产', '储罐类' , '厂房','古建筑', '商市场', '医院', '学校', '宾馆' , '娱乐场所','餐饮业', '影剧院', '展览建筑' , '隧道'] + // }, + series: [ + { + name: '访问来源', + type: 'pie', + radius: '70%', + center: ['50%', '61%'], + label: { + show: true, + // fontSize:13, + formatter: '{b}{c}家', + rich: { + d: { + align: 'center', + } + }, + }, + data: this.indexData, + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + this.chartZdgzqy = echarts.init(document.getElementById('chartZdgzqy'), 'walden'); + this.chartZdgzqy.setOption(chartZdgzqyOptionsZhi); + this.chartZdgzqy.on("click", (params) => { + this.router.navigate(['/statisticanalysis/buildingType_one']) + }) + } - isNumList:boolean = true - changeNumList(){ - this.isNumList = !this.isNumList - } + isNumList: boolean = true + changeNumList() { + this.isNumList = !this.isNumList + } } diff --git a/src/app/statistic-analysis/plan-analysis-by-synthesis/plan-analysis-by-synthesis.component.ts b/src/app/statistic-analysis/plan-analysis-by-synthesis/plan-analysis-by-synthesis.component.ts index 2392154..2b42af9 100644 --- a/src/app/statistic-analysis/plan-analysis-by-synthesis/plan-analysis-by-synthesis.component.ts +++ b/src/app/statistic-analysis/plan-analysis-by-synthesis/plan-analysis-by-synthesis.component.ts @@ -353,39 +353,21 @@ export class PlanAnalysisBySynthesisComponent implements OnInit { data: e.attachmentUrls[0] }); } - else /* if(e.attachmentUrls[0].substr(e.attachmentUrls[0].length-4,e.attachmentUrls[0].length-1)=='docx'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='pdf' - ||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='doc'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='DOC' - ||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='txt'||e.attachmentUrls[0].substr(e.attachmentUrls[0].length-3,e.attachmentUrls[0].length)=='JPG') */ { - let filename: string + else { let fetchUrl = e.attachmentUrls[0] - let docIdWordArray = CryptoJS.enc.Utf8.parse(`PlanPlatform/` + fetchUrl); - let docId = CryptoJS.enc.Base64.stringify(docIdWordArray); - let jwt = sessionStorage.getItem("token"); - let rawJwt = CryptoJS.enc.Base64.parse(jwt.split('.')[1]); - let identityJson = CryptoJS.enc.Utf8.stringify(rawJwt); - let identityJsonparse = JSON.parse(identityJson) - this.http.get(`/api/ObjectMetadata/PlanPlatform/${fetchUrl}`).subscribe((data: any) => { - filename = data.fileName - let json = { - doc: { - docId: docId, - title: filename, - fetchUrl: `http://172.18.0.1:8000/api/Objects/PlanPlatform/` + fetchUrl, - }, - user: { - uid: identityJsonparse.sub, - nickName: identityJsonparse.name, - avatar: "", - privilege: [ - 'FILE_READ', 'FILE_DOWNLOAD', 'FILE_PRINT' - ], - }, - } - var stringjson = JSON.stringify(json) - var wordArray = CryptoJS.enc.Utf8.parse(stringjson); - var base64 = CryptoJS.enc.Base64.stringify(wordArray); - window.open(`http://10.81.73.39:18080/apps/editor/openPreview?data=${base64}`) - }) + let suffix = fetchUrl.split('.')[fetchUrl.split('.').length - 1].toLowerCase() + if (suffix == 'docx' || suffix == 'doc') { + let arr = fetchUrl.split('.') + arr[arr.length - 1] = 'pdf' + window.open(`/api/Objects/PlanPlatform/` + arr.join('.')) + } else if (suffix == 'pdf') { + window.open(`/api/Objects/PlanPlatform/` + fetchUrl) + } else { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('该文件类型暂不支持在线查看', '确定', config); + } } } diff --git a/src/app/tabbar/tabbar.component.html b/src/app/tabbar/tabbar.component.html index 26fecba..9774d50 100644 --- a/src/app/tabbar/tabbar.component.html +++ b/src/app/tabbar/tabbar.component.html @@ -134,7 +134,6 @@

欢迎您, {{realName}}

-
信息完整度规则 @@ -158,60 +157,62 @@ 规则说明 - 单位名称 + 单位信息 5% - 按填录入内容评判 + 填写项平分该项占比分值,信息填写完整即可 建筑信息 10% 根据创建的建筑个数平分该分值,每个建筑根据实际填写的完整度再进行评判 + + 平面图 + 10% + 总平面图1张,层平面图1张 + 四周毗邻 10% - 按4个方向均分,每个方向的属性信息要填写完整才能得分 + 按4个方向均分,每个方向的属性信息要填写完整,并且包含图片 消防设施 25% - 消防水源占30%     安全疏散占30%
消防水系统占30% + 消防水源占30%   安全疏散设施/消防泡沫系统/安全疏散模块占30%
消防水系统/自动消防设施/消防设施/消防灭火给水系统/消火栓系统模块占30%     内部消防力量占10% 重点部位 10% - 根据耐火等级做区分:一级:添加3个重点部位(1个50%,2个80%,3个满分)二级:添加2个重点部位(一个占50%)三级 添加1个重点部位 其它:填写重点提示自动满分 + 层平面图中重点部位数量大于1个,并且属性信息填写完整(包含图片) 功能分区 10% - 创建2条并填写完整得满分 + 任意建筑下功能分区信息填写两条以上并且信息填写完整 实景图 10% - 外观,保证有2张照片(占30%); 重点部位,保证有2张照片(占30%);安全出口,保证有2张照片(占40%) + 外观,保证有2张照片(占30%); + 重点部位,保证有2张照片(占30%);安全出口,保证有2张照片(占40%) CAD上传 10% - 上传2个cad文件 - - - 平面图 - 10% - 总平面图1张,建筑平面图1张 + 保证至少有1个文件,格式不限 +
+
提交审核 diff --git a/src/app/tabbar/tabbar.component.ts b/src/app/tabbar/tabbar.component.ts index 22b415c..ee414e3 100644 --- a/src/app/tabbar/tabbar.component.ts +++ b/src/app/tabbar/tabbar.component.ts @@ -76,11 +76,9 @@ export class TabbarComponent implements OnInit { } //根据usci获取当前单位的分数信息 getIntegrityScore(){ - let params:any = { - USCI : this.route.snapshot.queryParams.usci - } - this.http.get('/api/Companies',{params:params}).subscribe((data:any) => { - this.companyIntegrityScore = data.items[0].companyIntegrityScore + let unitId = sessionStorage.getItem('companyId') + this.http.get(`/api/Companies/${unitId}`).subscribe((data:any) => { + this.companyIntegrityScore = data.companyIntegrityScore }) } isSpinner:boolean = false//下载帮助文档进度 diff --git a/src/app/ui/collection-tools-plan/addPlaneFigure.html b/src/app/ui/collection-tools-plan/addPlaneFigure.html index 344170b..80cbac6 100644 --- a/src/app/ui/collection-tools-plan/addPlaneFigure.html +++ b/src/app/ui/collection-tools-plan/addPlaneFigure.html @@ -12,9 +12,9 @@
- +
diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.ts b/src/app/ui/collection-tools-plan/collection-tools.component.ts index cd34d19..22d003d 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/src/app/ui/collection-tools-plan/collection-tools.component.ts @@ -17,2324 +17,2613 @@ import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-scor import { MaskLayerService } from 'src/app/mask-layer.service'; import * as ObjectID from 'bson-objectid'; import { AxMessageSystem } from 'src/app/working-area/model/axMessageSystem'; +import { MapFactory } from 'src/modules/map/declare/factory'; +import { IMap, IMarker, IMarkOptions } from 'src/modules/map/declare/map'; declare var AMap: any declare var html2canvas: any; + declare global { - interface Window { - deleteMarker: any; - } + interface Window { + deleteMarker: any; + } } @Component({ - selector: 'app-collection-tools-plan', - templateUrl: './collection-tools.component.html', - styleUrls: ['./collection-tools.component.scss'] + selector: 'app-collection-tools-plan', + templateUrl: './collection-tools.component.html', + styleUrls: ['./collection-tools.component.scss'] }) export class CollectionToolsPlanComponent implements OnInit { - @ViewChild('canvas') canvas: WorkingAreaComponent; //父组件中获得子组件的引用 - - constructor(public renderer2: Renderer2, public _ngZone: NgZone, private maskLayerService: MaskLayerService, private tabbarService: TabbarAndScoreService, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, private element: ElementRef, public canvasData: CanvasShareDataService, private router: Router, private route: ActivatedRoute) { } - @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; - // tree配置 - private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数 - return { - expandable: !!node.children && node.children.length > 0, - name: node.name || node.Name, - level: level, - id: node.id || node.Id, - children: node.children, - isTemplate: node.isTemplate, - isNewElement: node.isNewElement, - isLook: node.isLook, - isLookPattern: node.isLookPattern || null - }; - } - treeControl = new FlatTreeControl(node => node.level, node => node.expandable); - - treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); - dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); - hasChild = (_: number, node: any) => node.expandable; - - colors = ['#076eec', '#4dd0e1', '#00ee76', '#ffff00', '#eeb422', - '#FF6A6A', '#ff0000', '#ff6eb4', '#00bfff', '#54ff9f', - '#009688', '#836fff', '#ff8c00', '#ee00ee', '#ffa07a', - '#00C500', '#00ffff', '#6495ed', '#ffdAb9', '#AA00FF'] - selected = "1" //图标大小选择框 - - allBuildings //该单位所有建筑 - beforeOneCheckedBuilding: any = { name: "总平面图" }; //当前点击选择的建筑 - checkedBuildingIndex: number = -1 //当前点击选择的建筑index - isEditPat: boolean = true //当前是否是编辑模式 - - assetName: String//素材名称 - assetWidth: number//素材宽度 - assetHeight: number//素材高度 - sliderValue: number = 0//角度滑竿的值 - sliderValueThickness: number = 0//厚度滑竿的值 - isHighLight: boolean = false//是否高亮选择框 - PropertyInfos = [] //去除图片链接真正用于循环的内容 - imagesArrNum //素材属性图片数量上限 - imagesArr = [] //属性中的图片链接集合 - clickedIndex //点击图片时的索引值 - - //传入素材对象,设置右侧属性栏内容 - canvasAssetObj //传入的素材属性对象 - isImgNumCss = false //控制上传文件input显隐 - mySwiper: any //轮播图实例 - - gallery//viewerJs实例 - //设置属性框 - setAssetsProperty(obj) { - // console.log('传进来的属性信息', obj) - //初始化viewerJs实例 - setTimeout(() => { - obj.PropertyInfos.forEach(item => { - if (item.PropertyType == 4) { - if (document.getElementById('viewerjs')) { - this.gallery = new Viewer(document.getElementById('viewerjs'), { - url: 'data-original' - }); - } + @ViewChild('canvas') canvas: WorkingAreaComponent; //父组件中获得子组件的引用 + + constructor(public renderer2: Renderer2, public _ngZone: NgZone, private maskLayerService: MaskLayerService, private tabbarService: TabbarAndScoreService, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, private element: ElementRef, public canvasData: CanvasShareDataService, private router: Router, private route: ActivatedRoute) { } + @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; + // tree配置 + private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数 + return { + expandable: !!node.children && node.children.length > 0, + name: node.name || node.Name, + level: level, + id: node.id || node.Id, + children: node.children, + isTemplate: node.isTemplate, + isNewElement: node.isNewElement, + isLook: node.isLook, + isLookPattern: node.isLookPattern || null + }; + } + treeControl = new FlatTreeControl(node => node.level, node => node.expandable); + + treeFlattener = new MatTreeFlattener(this._transformer, node => node.level, node => node.expandable, node => node.children); + dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener); + hasChild = (_: number, node: any) => node.expandable; + + colors = ['#076eec', '#4dd0e1', '#00ee76', '#ffff00', '#eeb422', + '#FF6A6A', '#ff0000', '#ff6eb4', '#00bfff', '#54ff9f', + '#009688', '#836fff', '#ff8c00', '#ee00ee', '#ffa07a', + '#00C500', '#00ffff', '#6495ed', '#ffdAb9', '#AA00FF'] + selected = "1" //图标大小选择框 + + allBuildings //该单位所有建筑 + beforeOneCheckedBuilding: any = { name: "总平面图" }; //当前点击选择的建筑 + checkedBuildingIndex: number = -1 //当前点击选择的建筑index + isEditPat: boolean = true //当前是否是编辑模式 + + assetName: String//素材名称 + assetWidth: number//素材宽度 + assetHeight: number//素材高度 + sliderValue: number = 0//角度滑竿的值 + sliderValueThickness: number = 0//厚度滑竿的值 + isHighLight: boolean = false//是否高亮选择框 + PropertyInfos = [] //去除图片链接真正用于循环的内容 + imagesArrNum //素材属性图片数量上限 + imagesArr = [] //属性中的图片链接集合 + clickedIndex //点击图片时的索引值 + + //传入素材对象,设置右侧属性栏内容 + canvasAssetObj //传入的素材属性对象 + isImgNumCss = false //控制上传文件input显隐 + mySwiper: any //轮播图实例 + + gallery//viewerJs实例 + //设置属性框 + setAssetsProperty(obj) { + console.log('传进来的属性信息', obj) + //初始化viewerJs实例 + setTimeout(() => { + obj.PropertyInfos.forEach(item => { + if (item.PropertyType == 4) { + if (document.getElementById('viewerjs')) { + this.gallery = new Viewer(document.getElementById('viewerjs'), { + url: 'data-original' + }); + } + } + }) + }, 0); + + //从颜色中取出透明度 + let color = obj.Color + let strh = color.substring(color.length - 2, color.length) + let opacity = Math.round(parseInt(strh, 16) / 255 * 100) + this.colorDivSliderValue = opacity + + this.isShowProperty = true + this.isShowAttribute = false + let _this = this + this.imagesArr = [] + this.imagesArrNum = "" + + this.canvasAssetObj = obj //将选中素材对象存到本地变量 + + this.assetName = obj.Name + this.assetWidth = obj.Width + this.assetHeight = obj.Height + this.sliderValue = obj.Angle + this.selectedcolor = obj.Color + this.PropertyInfos = obj.PropertyInfos + this.sliderValueThickness = obj.Thickness + this.PropertyInfos.forEach(item => { + if (item.PropertyType == 3) { //如果是图片链接类型 + this.imagesArr.push(item) + } + if (item.PropertyType == 4) {//图片数值上线 + this.imagesArrNum = item.PropertyValue + } + }) + + //如果存在图片则加载轮播图 + if (this.imagesArr.length) { + setTimeout(() => { + this.mySwiper = new Swiper('.swiper-container', { + loop: false, + // grabCursor: true, + // 如果需要前进后退按钮 + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, + on: { + click: function () { + _this.clickedIndex = this.clickedIndex + }, + } + }); + }, 0); + } + //判断此时图片数量是否达到上限 + if (this.imagesArr.length < this.imagesArrNum) {//如果不超出 + this.isImgNumCss = true + } else { + this.isImgNumCss = false } - }) - }, 0); - - //从颜色中取出透明度 - let color = obj.Color - let strh = color.substring(color.length - 2, color.length) - let opacity = Math.round(parseInt(strh, 16) / 255 * 100) - this.colorDivSliderValue = opacity - - this.isShowProperty = true - this.isShowAttribute = false - let _this = this - this.imagesArr = [] - this.imagesArrNum = "" - - this.canvasAssetObj = obj //将选中素材对象存到本地变量 - - this.assetName = obj.Name - this.assetWidth = obj.Width - this.assetHeight = obj.Height - this.sliderValue = obj.Angle - this.selectedcolor = obj.Color - this.PropertyInfos = obj.PropertyInfos - this.sliderValueThickness = obj.Thickness - this.PropertyInfos.forEach(item => { - if (item.PropertyType == 3) { //如果是图片链接类型 - this.imagesArr.push(item) - } - if (item.PropertyType == 4) {//图片数值上线 - this.imagesArrNum = item.PropertyValue - } - }) - - //如果存在图片则加载轮播图 - if (this.imagesArr.length) { - setTimeout(() => { - this.mySwiper = new Swiper('.swiper-container', { - loop: false, - // grabCursor: true, - // 如果需要前进后退按钮 - navigation: { - nextEl: '.swiper-button-next', - prevEl: '.swiper-button-prev', - }, - on: { - click: function () { - _this.clickedIndex = this.clickedIndex - }, - } - }); - }, 0); - } - //判断此时图片数量是否达到上限 - if (this.imagesArr.length < this.imagesArrNum) {//如果不超出 - this.isImgNumCss = true - } else { - this.isImgNumCss = false - } - } - pattern: boolean = true//默认为基本信息编辑 - //适应缩放 - adaptZoom() { - this.canvas.zoomFit() - } - //重置缩放 - resetZoom() { - this.canvas.resetCamera2D() - } - //放大图标 - iconScale() { - let number = Number(this.selected) - this.canvas.setIconScale(number) - } - - //消防要素div边框高度调节 - firecategoriesDivMouseDown(e) { - document.onmousemove = (ev) => { - let bodyHeight = document.body.clientHeight //网页宽度 - let maxHeight = this.element.nativeElement.querySelector('#rightDiv').clientHeight - 35 //最大宽度 - if (bodyHeight - ev.clientY >= maxHeight) { - this.element.nativeElement.querySelector('#firecategories').style.height = maxHeight + 'px' - this.element.nativeElement.querySelector('#property').style.height = 35 + 'px' - } else { - this.element.nativeElement.querySelector('#firecategories').style.height = (bodyHeight - ev.clientY) + 'px'; - this.element.nativeElement.querySelector('#property').style.height = (this.element.nativeElement.querySelector('#rightDiv').clientHeight - this.element.nativeElement.querySelector('#firecategories').clientHeight) + 'px' - } } - document.onmouseup = () => { - document.onmousemove = null; - document.onmouseup = null; - } - } - //左侧div边框宽度调节 - leftDivMouseDown(e) { - document.onmousemove = (ev) => { - let bodyWidth = document.body.clientWidth //网页宽度 - let maxWidth = bodyWidth - 260 - this.element.nativeElement.querySelector('#rightDiv').clientWidth //最大宽度 - if (ev.clientX - 240 >= maxWidth) { - this.element.nativeElement.querySelector('#leftDiv').style.width = maxWidth + 'px' - } else { - this.element.nativeElement.querySelector('#leftDiv').style.width = ev.clientX - 260 + 'px'; - } + pattern: boolean = true//默认为基本信息编辑 + //适应缩放 + adaptZoom() { + this.canvas.zoomFit() } - document.onmouseup = () => { - document.onmousemove = null; - document.onmouseup = null; - } - } - //右侧div边框宽度调节 - rightDivMouseDown(e) { - document.onmousemove = (ev) => { - let bodyWidth = document.body.clientWidth //网页宽度 - let maxWidth = bodyWidth - 240 - this.element.nativeElement.querySelector('#leftDiv').clientWidth //最大宽度 - if (bodyWidth - ev.clientX >= maxWidth) { - this.element.nativeElement.querySelector('#rightDiv').style.width = maxWidth + 'px' - } else { - this.element.nativeElement.querySelector('#rightDiv').style.width = bodyWidth - ev.clientX + 'px'; - } + //重置缩放 + resetZoom() { + this.canvas.resetCamera2D() + } + + + //消防要素div边框高度调节 + firecategoriesDivMouseDown(e) { + document.onmousemove = (ev) => { + let bodyHeight = document.body.clientHeight //网页宽度 + let maxHeight = this.element.nativeElement.querySelector('#rightDiv').clientHeight - 35 //最大宽度 + if (bodyHeight - ev.clientY >= maxHeight) { + this.element.nativeElement.querySelector('#firecategories').style.height = maxHeight + 'px' + this.element.nativeElement.querySelector('#property').style.height = 35 + 'px' + } else { + this.element.nativeElement.querySelector('#firecategories').style.height = (bodyHeight - ev.clientY) + 'px'; + this.element.nativeElement.querySelector('#property').style.height = (this.element.nativeElement.querySelector('#rightDiv').clientHeight - this.element.nativeElement.querySelector('#firecategories').clientHeight) + 'px' + } + } + document.onmouseup = () => { + document.onmousemove = null; + document.onmouseup = null; + } + } + + //左侧div边框宽度调节 + leftDivMouseDown(e) { + document.onmousemove = (ev) => { + let bodyWidth = document.body.clientWidth //网页宽度 + let maxWidth = bodyWidth - 260 - this.element.nativeElement.querySelector('#rightDiv').clientWidth //最大宽度 + if (ev.clientX - 240 >= maxWidth) { + this.element.nativeElement.querySelector('#leftDiv').style.width = maxWidth + 'px' + } else { + this.element.nativeElement.querySelector('#leftDiv').style.width = ev.clientX - 260 + 'px'; + } + } + document.onmouseup = () => { + document.onmousemove = null; + document.onmouseup = null; + } + } + + + //右侧div边框宽度调节 + rightDivMouseDown(e) { + document.onmousemove = (ev) => { + let bodyWidth = document.body.clientWidth //网页宽度 + let maxWidth = bodyWidth - 240 - this.element.nativeElement.querySelector('#leftDiv').clientWidth //最大宽度 + if (bodyWidth - ev.clientX >= maxWidth) { + this.element.nativeElement.querySelector('#rightDiv').style.width = maxWidth + 'px' + } else { + this.element.nativeElement.querySelector('#rightDiv').style.width = bodyWidth - ev.clientX + 'px'; + } + } + document.onmouseup = () => { + document.onmousemove = null; + document.onmouseup = null; + } + } + + //放大图标 + iconScale() { + let number = Number(this.selected) + this.canvas.setIconScale(number) + } + + //素材宽度输入框改变 + assetWidthIunput() { + this.canvasAssetObj.Width = this.assetWidth + this.canvasData.isChange = true + if (!this.isGis) { + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + + } + + //素材高度输入框改变 + assetHeightIunput() { + this.canvasAssetObj.Height = this.assetHeight + this.canvasData.isChange = true + if (!this.isGis) { + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + } + + //素材角度输入框改变 + assetAngleIunput() { + this.canvasAssetObj.Angle = this.sliderValue + this.canvasData.isChange = true + if (!this.isGis) { + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + } + + //素材厚度输入框改变 + assetThicknessIunput() { + this.canvasAssetObj.Thickness = this.sliderValueThickness + this.canvasData.isChange = true + if (!this.isGis) { + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + } + + //素材是否高亮改变----->本地操作行为 + assetHighLightIunput() { + // console.log(this.isHighLight,this.canvasAssetObj) + // let arr = [] + // arr.push(this.canvasAssetObj.Id) + // this.canvas.setHighlight(arr) + } + + //判断是否是数字类型 + myIsNaN(value) { + return typeof value === 'number' && !isNaN(value); + } + //动态属性素材input框值改变 + assetInputChange(i, e) { + let index = this.canvasAssetObj.PropertyInfos.findIndex((item) => { + return i.PropertyName == item.PropertyName + }) + if (this.myIsNaN(e.target.value)) { + e.target.value = String(e.target.value) + } + this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value + this.canvasData.isChange = true + if (!this.isGis) { + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + } + + //动态属性素材布尔值框改变radio + assetRadioChange(i, boolean) { + let index = this.canvasAssetObj.PropertyInfos.findIndex((item) => { + return i.PropertyName == item.PropertyName + }) + this.canvasAssetObj.PropertyInfos[index].PropertyValue = boolean + this.canvasData.isChange = true + } + + colorIndex//默认素材颜色 + selectedcolor//点击选择的颜色 + //选择素材颜色 + selectcolor(item, key) { + //在当前透明度基础上改变颜色 + this.selectedcolor = item + this.selectedcolor.substring(this.selectedcolor.length - 2) + this.canvasAssetObj.Color = this.selectedcolor + this.canvasData.isChange = true + if (!this.isGis) { + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + } + //颜色选择滑竿的值 + colorDivSliderValue + colorDivSliderChange() { + let colorOpacity = Math.round(255 * this.colorDivSliderValue * 0.01) + //根据滑竿值改变16进制颜色后两位 + function replacepos(text, start, stop, replacetext) { + let mystr = text.substring(0, stop - 1) + replacetext + text.substring(stop + 1); + return mystr; + } + this.selectedcolor = replacepos(this.selectedcolor, 7, 8, colorOpacity.toString(16)) + this.canvasAssetObj.Color = this.selectedcolor + this.canvasData.isChange = true + if (!this.isGis) { + this.canvas.refreshIcon(this.canvasAssetObj.Id) + } + } + + //上传素材图片 + selectFile(e) { + let imgFile = e.target.files[0] || null //上传的文件 + this.startUploading(imgFile) + } + objectName: any //上传对象名 + startUploading(imgFile) { + let _this = this + let file = imgFile || null //获取上传的文件 + let fileSize = file.size || null //上传文件的总大小 + let shardSize = 5 * 1024 * 1024 //5MB一个分片 + let companyId = sessionStorage.getItem("companyId") + if (file && fileSize <= shardSize) { //上传文件<=5MB时 + let formData = new FormData() + formData.append("file", file) + this.http.post(`api/Objects/WebPlan2D/${companyId}`, formData).subscribe((data: any) => { + this.objectName = data.objectName + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('上传成功', '确定', config) + + //在原始素材对象和需要循环图片的对象中分别push最新上传的图片 + let imgObj = { + "Tag": null, + "Order": 0, + "Enabled": false, + "Visible": false, + "Required": false, + "RuleName": null, + "RuleValue": null, + "PhysicalUnit": null, + "PropertyName": "图片", + "PropertyType": 3, + "PropertyValue": "/api/Objects/WebPlan2D/" + this.objectName + } + + this.imagesArr.push(imgObj) + this.canvasAssetObj.PropertyInfos.push(imgObj) + + setTimeout(() => { + this.mySwiper = new Swiper('.swiper-container', { + loop: false, + // grabCursor: true, + // 如果需要前进后退按钮 + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + }, + on: { + click: function () { + _this.clickedIndex = this.clickedIndex + }, + } + }); + + this.mySwiper.slideTo(this.imagesArr.length - 1) + this.gallery.update() + }, 0); + + //判断上传素材属性图片是否超出数量 超出数量则隐藏input框 + if (this.imagesArr.length < this.imagesArrNum) {//不超出input才会显示 + this.isImgNumCss = true + } else { + this.isImgNumCss = false + } + + this.canvasData.isChange = true + }) + } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传 + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('上传图片文件不允许大于5mb', '确定', config); + } + } - document.onmouseup = () => { - document.onmousemove = null; - document.onmouseup = null; - } - } - - //判断是否是数字类型 - myIsNaN(value) { - return typeof value === 'number' && !isNaN(value); - } - //素材宽度输入框改变 - assetWidthIunput() { - this.canvasAssetObj.Width = this.assetWidth - this.canvasData.isChange = true - if (!this.isGis) { - this.canvas.refreshIcon(this.canvasAssetObj.Id) - } - } - //素材高度输入框改变 - assetHeightIunput() { - this.canvasAssetObj.Height = this.assetHeight - this.canvasData.isChange = true - if (!this.isGis) { - this.canvas.refreshIcon(this.canvasAssetObj.Id) - } - } - //素材角度输入框改变 - assetAngleIunput() { - this.canvasAssetObj.Angle = this.sliderValue - this.canvasData.isChange = true - if (!this.isGis) { - this.canvas.refreshIcon(this.canvasAssetObj.Id) - } - } - //素材厚度输入框改变 - assetThicknessIunput() { - this.canvasAssetObj.Thickness = this.sliderValueThickness - this.canvasData.isChange = true - if (!this.isGis) { - this.canvas.refreshIcon(this.canvasAssetObj.Id) - } - } - //素材是否高亮改变----->本地操作行为 - assetHighLightIunput() { - // console.log(this.isHighLight,this.canvasAssetObj) - // let arr = [] - // arr.push(this.canvasAssetObj.Id) - // this.canvas.setHighlight(arr) - } - - //动态属性素材input框值改变 - assetInputChange(i, e) { - let index = this.canvasAssetObj.PropertyInfos.findIndex((item) => { - return i.PropertyName == item.PropertyName - }) - if (this.myIsNaN(e.target.value)) { - e.target.value = String(e.target.value) - } - this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value - this.canvasData.isChange = true - if (!this.isGis) { - this.canvas.refreshIcon(this.canvasAssetObj.Id) - } - } - - //动态属性素材布尔值框改变radio - assetRadioChange(i, boolean) { - let index = this.canvasAssetObj.PropertyInfos.findIndex((item) => { - return i.PropertyName == item.PropertyName - }) - this.canvasAssetObj.PropertyInfos[index].PropertyValue = boolean - this.canvasData.isChange = true - } - - colorIndex//默认素材颜色 - selectedcolor//点击选择的颜色 - //选择素材颜色 - selectcolor(item, key) { - //在当前透明度基础上改变颜色 - this.selectedcolor = item + this.selectedcolor.substring(this.selectedcolor.length - 2) - this.canvasAssetObj.Color = this.selectedcolor - this.canvasData.isChange = true - if (!this.isGis) { - this.canvas.refreshIcon(this.canvasAssetObj.Id) - } - } - //颜色选择滑竿的值 - colorDivSliderValue - colorDivSliderChange() { - let colorOpacity = Math.round(255 * this.colorDivSliderValue * 0.01) - //根据滑竿值改变16进制颜色后两位 - function replacepos(text, start, stop, replacetext) { - let mystr = text.substring(0, stop - 1) + replacetext + text.substring(stop + 1); - return mystr; - } - this.selectedcolor = replacepos(this.selectedcolor, 7, 8, colorOpacity.toString(16)) - this.canvasAssetObj.Color = this.selectedcolor - this.canvasData.isChange = true - if (!this.isGis) { - this.canvas.refreshIcon(this.canvasAssetObj.Id) - } - } - - //上传素材图片 - selectFile(e) { - let imgFile = e.target.files[0] || null //上传的文件 - this.startUploading(imgFile) - } - objectName: any //上传对象名 - startUploading(imgFile) { - let _this = this - let file = imgFile || null //获取上传的文件 - let fileSize = file.size || null //上传文件的总大小 - let shardSize = 5 * 1024 * 1024 //5MB一个分片 - let companyId = sessionStorage.getItem("companyId") - if (file && fileSize <= shardSize) { //上传文件<=5MB时 - let formData = new FormData() - formData.append("file", file) - this.http.post(`api/Objects/WebPlan2D/${companyId}`, formData).subscribe((data: any) => { - this.objectName = data.objectName + + //不能上传图片提示 + imgNumBeyond() { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('上传成功', '确定', config) - - //在原始素材对象和需要循环图片的对象中分别push最新上传的图片 - let imgObj = { - "Tag": null, - "Order": 0, - "Enabled": false, - "Visible": false, - "Required": false, - "RuleName": null, - "RuleValue": null, - "PhysicalUnit": null, - "PropertyName": "图片", - "PropertyType": 3, - "PropertyValue": "/api/Objects/WebPlan2D/" + this.objectName - } - - this.imagesArr.push(imgObj) - this.canvasAssetObj.PropertyInfos.push(imgObj) + this.snackBar.open('图片数量已达上限', '确定', config); + } - setTimeout(() => { - this.mySwiper = new Swiper('.swiper-container', { - loop: false, - // grabCursor: true, - // 如果需要前进后退按钮 - navigation: { - nextEl: '.swiper-button-next', - prevEl: '.swiper-button-prev', - }, - on: { - click: function () { - _this.clickedIndex = this.clickedIndex - }, + //删除素材属性图片 + deleteImg() { + if (this.imagesArr.length == 0) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('没有可删除的图片,请先上传', '确定', config) + } else { + // 在素材原始对象中将删除的图片去掉 + this.canvasAssetObj.PropertyInfos = [...this.canvasAssetObj.PropertyInfos.filter((item) => { + return item.PropertyValue != this.imagesArr[this.mySwiper.activeIndex].PropertyValue + })] + //在图片循环数组中将图片去掉 + this.imagesArr.splice(this.mySwiper.activeIndex, 1); + //更新swiper视图 + setTimeout(() => { + this.mySwiper.update(); + this.gallery.update() + }, 0); + + //将上传的input框显示出来 + this.isImgNumCss = true; + //清除图片缓存 + if ((document.getElementById('inputimg'))) { + (document.getElementById('inputimg')).value = null //清空input框缓存 } - }); - this.mySwiper.slideTo(this.imagesArr.length - 1) - this.gallery.update() - }, 0); + this.canvasData.isChange = true + } + } + + //动态属性方向select选择框 + direction(i, e) { + let index = this.canvasAssetObj.PropertyInfos.findIndex((item) => { + return i.PropertyName == item.PropertyName + }) + this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value + this.canvasData.isChange = true + } + + //动态属性供给区域select选择框 + supplyArea(i, e) { + let index = this.canvasAssetObj.PropertyInfos.findIndex((item) => { + return i.PropertyName == item.PropertyName + }) + this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value + this.canvasData.isChange = true + } + + //动态属性供给类型select选择框 + supplyType(i, e) { + let index = this.canvasAssetObj.PropertyInfos.findIndex((item) => { + return i.PropertyName == item.PropertyName + }) + this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value + this.canvasData.isChange = true + } + + isediticon = true //控制查看编辑模式的编辑模式小笔按钮 + + isMultipleAsset: boolean = false//框选多个素材属性显隐 + multipleAsset: any = { + Width: null, + Height: null, + Angle: null, + Thickness: null, + Color: null, + PropertyInfos: [] + }//多个素材共同属性 + multipleAssetData: any//当前多选的素材 + firstMultipleAssetData: any//当前多选的第一个素材 + ngOnInit(): void { + + let _this = this + AxMessageSystem.addListener('selectionChanged', () => { + if (this.canvas.selection.size() == 1) {//如果是单选 + this.isMultipleAsset = false + console.log('单选', this.canvas.selection.first().assetData) + this.setAssetsProperty(this.canvas.selection.first().assetData) + } else if (this.canvas.selection.size()) { + this.isShowProperty = true + this.multipleAssetData = this.canvas.selection.all() + this.firstMultipleAssetData = this.canvas.selection.first() + this.multipleAsset = { + Width: null, + Height: null, + Angle: null, + Thickness: null, + Color: null, + PropertyInfos: [] + } + this.isMultipleAsset = true + let firstAssetData = this.canvas.selection.first().assetData;//拿出第一个素材作为例子与其他素材进行对比 + let InteractiveMode = firstAssetData.InteractiveMode //素材连接方式 + let isInteractiveMode = this.canvas.selection.all().every(item => item.assetData.InteractiveMode === InteractiveMode) + if (isInteractiveMode) { + this.multipleAsset.InteractiveMode = InteractiveMode + } + let isFillMode = this.canvas.selection.all().every(item => item.assetData.FillMode === 0) //素材填充方式都为0 + if (isFillMode) { + this.multipleAsset.FillMode = 0 + } + this.canvas.selection.first().assetData.PropertyInfos.forEach(i => { + let index = 0 + this.canvas.selection.all().forEach(item => { + item.assetData.PropertyInfos.forEach(element => { + if (element.PropertyName == i.PropertyName && element.PropertyType == i.PropertyType && element.PropertyType != 3 && element.PropertyType != 4) { + index++ + if (index == this.canvas.selection.size()) { + let newElement = JSON.parse(JSON.stringify(element)) + newElement.PropertyValue = '' + this.multipleAsset.PropertyInfos.push(newElement) + } + } + }); + }) + }) + // console.log(666,_this.multipleAsset.PropertyInfos) + } else if (this.canvas.selection.size() == 0) { + this.isShowProperty = false + } + }, this) + AxMessageSystem.addListener('imageResize', (eventName, args1) => { + this.assetWidth = args1.Width + this.assetHeight = args1.Height + }, this) + if (this.router.url.indexOf("keyUnit/viewunitinfo") != -1) { //查看模式 + this.isEditPattern = false + this.isediticon = false + this.canvasData.gameMode = GameMode.Assignment + } else if (this.router.url.indexOf("keyUnit/editplaninfo") != -1) { //编辑模式 + this.canvasData.gameMode = GameMode.BasicInformation + } - //判断上传素材属性图片是否超出数量 超出数量则隐藏input框 - if (this.imagesArr.length < this.imagesArrNum) {//不超出input才会显示 - this.isImgNumCss = true + //gis模块平面图 + if ((this.router.url.indexOf("gis") != -1 || this.router.url.indexOf("waitexamineergis") != -1) && sessionStorage.getItem("gisplan") == "look") { + this.isEditPattern = false + this.isediticon = false + this.canvasData.gameMode = GameMode.Assignment } else { - this.isImgNumCss = false + this.getAllLibrary() //获取素材库 } - this.canvasData.isChange = true - }) - } else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传 - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('上传图片文件不允许大于5mb', '确定', config); - } - - } - - //不能上传图片提示 - imgNumBeyond() { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('图片数量已达上限', '确定', config); - } - //删除素材属性图片 - deleteImg() { - if (this.imagesArr.length == 0) { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('没有可删除的图片,请先上传', '确定', config) - } else { - // 在素材原始对象中将删除的图片去掉 - this.canvasAssetObj.PropertyInfos = [...this.canvasAssetObj.PropertyInfos.filter((item) => { - return item.PropertyValue != this.imagesArr[this.mySwiper.activeIndex].PropertyValue - })] - //在图片循环数组中将图片去掉 - this.imagesArr.splice(this.mySwiper.activeIndex, 1); - //更新swiper视图 - setTimeout(() => { - this.mySwiper.update(); - this.gallery.update() - }, 0); - - //将上传的input框显示出来 - this.isImgNumCss = true; - //清除图片缓存 - if ((document.getElementById('inputimg'))) { - (document.getElementById('inputimg')).value = null //清空input框缓存 - } + let that = this + window.setTimeout(() => { + document.getElementById("functionalDomainContent").oncontextmenu = function (event) { + // that.canvas.cancelPaint() + that.selectImageIndex = -1 + event.preventDefault(); + }; + }) - this.canvasData.isChange = true - } - } - - //动态属性方向select选择框 - direction(i, e) { - let index = this.canvasAssetObj.PropertyInfos.findIndex((item) => { - return i.PropertyName == item.PropertyName - }) - this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value - this.canvasData.isChange = true - } - - //动态属性供给区域select选择框 - supplyArea(i, e) { - let index = this.canvasAssetObj.PropertyInfos.findIndex((item) => { - return i.PropertyName == item.PropertyName - }) - this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value - this.canvasData.isChange = true - } - - //动态属性供给类型select选择框 - supplyType(i, e) { - let index = this.canvasAssetObj.PropertyInfos.findIndex((item) => { - return i.PropertyName == item.PropertyName - }) - this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value - this.canvasData.isChange = true - } - - isediticon = true //控制查看编辑模式的编辑模式小笔按钮 - - isMultipleAsset: boolean = false//框选多个素材属性显隐 - multipleAsset: any = { - Width: null, - Height: null, - Angle: null, - Thickness: null, - Color: null, - PropertyInfos: [] - }//多个素材共同属性 - multipleAssetData: any//当前多选的素材 - firstMultipleAssetData: any//当前多选的第一个素材 - //多选宽度共同改变 - multipleAssetWidthInput() { - this.multipleAssetData.forEach(item => { - item.assetData.Width = this.multipleAsset.Width - this.canvas.refreshIcon(item.assetData.Id) - this.canvasData.isChange = true - }) - } - //多选高度共同改变 - multipleAssetHeightInput() { - this.multipleAssetData.forEach(item => { - item.assetData.Height = this.multipleAsset.Height - this.canvas.refreshIcon(item.assetData.Id) - this.canvasData.isChange = true - }) - } - //多选角度共同改变 - multipleAssetAngleInput() { - this.multipleAssetData.forEach(item => { - item.assetData.Angle = this.multipleAsset.Angle - this.canvas.refreshIcon(item.assetData.Id) - this.canvasData.isChange = true - }) - } - //多选厚度共同改变 - multipleAssetThicknessInput() { - this.multipleAssetData.forEach(item => { - item.assetData.Thickness = this.multipleAsset.Thickness - this.canvas.refreshIcon(item.assetData.Id) - this.canvasData.isChange = true - }) - } - //多选颜色共同改变 - multipleSelectedcolor: any - multipleAssetSelectcolor(item, key) { - //在当前透明度基础上改变颜色 - this.multipleSelectedcolor = item - this.multipleAssetData.forEach(item => { - item.assetData.Color = this.multipleSelectedcolor - this.canvasData.isChange = true - this.canvas.refreshIcon(item.assetData.Id) - }) - } - //多选颜色滑竿改变 - multipleColorDivSliderChange() { - let colorOpacity = Math.round(255 * this.colorDivSliderValue * 0.01) - //根据滑竿值改变16进制颜色后两位 - function replacepos(text, start, stop, replacetext) { - let mystr = text.substring(0, stop - 1) + replacetext + text.substring(stop + 1); - return mystr; - } - this.multipleAssetData.forEach(item => { - this.multipleSelectedcolor = replacepos(this.multipleSelectedcolor, 7, 8, colorOpacity.toString(16)) - item.assetData.Color = this.multipleSelectedcolor - this.canvasData.isChange = true - this.canvas.refreshIcon(item.assetData.Id) - }) - } - //多选状态动态属性素材input框值改变 - multipleAssetInputChange(i, e) { - e.stopPropagation() - setTimeout(() => { - this.multipleAssetData.forEach(item => { - item.assetData.PropertyInfos.forEach(element => { - if (element.PropertyName == i.PropertyName) { - if (this.myIsNaN(i.PropertyValue)) { - i.PropertyValue = String(i.PropertyValue) + this.canvasData.getMessage().subscribe((message: any) => { + if (message == "send a message") { + // this.refurbishTreeData() } - element.PropertyValue = i.PropertyValue + }) + + //点击marker关闭按钮 + window.deleteMarker = () => { + this.canvasData.isChange = true + //清除地图标点 + this.planDataMarkers.forEach((element, index) => { + if (element.id == this.clickId) { + this.planDataMarkers[index].setMap(null); + } + }); + + // 删除楼层数据 + delete this.canvasData.originaleveryStoreyData.data[this.clickId]; + // 删除建筑数据 + delete this.canvasData.originalcompanyBuildingData.data[this.clickId]; + + console.log('originalcompanyBuildingData', this.canvasData.originalcompanyBuildingData) + console.log('originaleveryStoreyData', this.canvasData.originaleveryStoreyData) + + } + } + //多选宽度共同改变 + multipleAssetWidthInput() { + this.multipleAssetData.forEach(item => { + item.assetData.Width = this.multipleAsset.Width this.canvas.refreshIcon(item.assetData.Id) this.canvasData.isChange = true - } }) - }) - }, 0); - } - //多选状态动态属性素材radio框值改变 - multipleAssetRadioChange(i, value) { - // e.stopPropagation() - this.multipleAssetData.forEach(item => { - // console.log(item) - item.assetData.PropertyInfos.forEach(element => { - if (element.PropertyName == i.PropertyName) { - element.PropertyValue = value - this.canvas.refreshIcon(item.assetData.Id) - this.canvasData.isChange = true - } - }) - }) - } - //多选状态动态属性素材下拉框值改变 - multipleSupplyArea(i, e) { - e.stopPropagation() - this.multipleAssetData.forEach(item => { - item.assetData.PropertyInfos.forEach(element => { - if (element.PropertyName == i.PropertyName) { - element.PropertyValue = i.PropertyValue - this.canvas.refreshIcon(item.assetData.Id) - this.canvasData.isChange = true + } + //多选高度共同改变 + multipleAssetHeightInput() { + this.multipleAssetData.forEach(item => { + item.assetData.Height = this.multipleAsset.Height + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选角度共同改变 + multipleAssetAngleInput() { + this.multipleAssetData.forEach(item => { + item.assetData.Angle = this.multipleAsset.Angle + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选厚度共同改变 + multipleAssetThicknessInput() { + this.multipleAssetData.forEach(item => { + item.assetData.Thickness = this.multipleAsset.Thickness + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + }) + } + //多选颜色共同改变 + multipleSelectedcolor: any + multipleAssetSelectcolor(item, key) { + //在当前透明度基础上改变颜色 + this.multipleSelectedcolor = item + this.multipleAssetData.forEach(item => { + item.assetData.Color = this.multipleSelectedcolor + this.canvasData.isChange = true + this.canvas.refreshIcon(item.assetData.Id) + }) + } + //多选颜色滑竿改变 + multipleColorDivSliderChange() { + let colorOpacity = Math.round(255 * this.colorDivSliderValue * 0.01) + //根据滑竿值改变16进制颜色后两位 + function replacepos(text, start, stop, replacetext) { + let mystr = text.substring(0, stop - 1) + replacetext + text.substring(stop + 1); + return mystr; } - }) - }) - } - ngOnInit(): void { - let _this = this - AxMessageSystem.addListener('selectionChanged', () => { - if (this.canvas.selection.size() == 1) {//如果是单选 - this.isMultipleAsset = false - console.log('单选', this.canvas.selection.first().assetData) - this.setAssetsProperty(this.canvas.selection.first().assetData) - } else if (this.canvas.selection.size()) { - this.isShowProperty = true - this.multipleAssetData = this.canvas.selection.all() - this.firstMultipleAssetData = this.canvas.selection.first() - this.multipleAsset = { - Width: null, - Height: null, - Angle: null, - Thickness: null, - Color: null, - PropertyInfos: [] - } - this.isMultipleAsset = true - let firstAssetData = this.canvas.selection.first().assetData;//拿出第一个素材作为例子与其他素材进行对比 - let InteractiveMode = firstAssetData.InteractiveMode //素材连接方式 - let isInteractiveMode = this.canvas.selection.all().every(item => item.assetData.InteractiveMode === InteractiveMode) - if (isInteractiveMode) { - this.multipleAsset.InteractiveMode = InteractiveMode - } - let isFillMode = this.canvas.selection.all().every(item => item.assetData.FillMode === 0) //素材填充方式都为0 - if (isFillMode) { - this.multipleAsset.FillMode = 0 - } - this.canvas.selection.first().assetData.PropertyInfos.forEach(i => { - let index = 0 - this.canvas.selection.all().forEach(item => { + this.multipleAssetData.forEach(item => { + this.multipleSelectedcolor = replacepos(this.multipleSelectedcolor, 7, 8, colorOpacity.toString(16)) + item.assetData.Color = this.multipleSelectedcolor + this.canvasData.isChange = true + this.canvas.refreshIcon(item.assetData.Id) + }) + } + //多选状态动态属性素材input框值改变 + multipleAssetInputChange(i, e) { + e.stopPropagation() + setTimeout(() => { + this.multipleAssetData.forEach(item => { + item.assetData.PropertyInfos.forEach(element => { + if (element.PropertyName == i.PropertyName) { + if (this.myIsNaN(i.PropertyValue)) { + i.PropertyValue = String(i.PropertyValue) + } + element.PropertyValue = i.PropertyValue + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + }, 0); + } + //多选状态动态属性素材radio框值改变 + multipleAssetRadioChange(i, value) { + // e.stopPropagation() + this.multipleAssetData.forEach(item => { + // console.log(item) item.assetData.PropertyInfos.forEach(element => { - if (element.PropertyName == i.PropertyName && element.PropertyType == i.PropertyType && element.PropertyType != 3 && element.PropertyType != 4) { - index++ - if (index == this.canvas.selection.size()) { - let newElement = JSON.parse(JSON.stringify(element)) - newElement.PropertyValue = '' - this.multipleAsset.PropertyInfos.push(newElement) + if (element.PropertyName == i.PropertyName) { + element.PropertyValue = value + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true } - } - }); - }) + }) }) - // console.log(666,_this.multipleAsset.PropertyInfos) - } else if (this.canvas.selection.size() == 0) { - this.isShowProperty = false - } - }, this) - AxMessageSystem.addListener('imageResize', (eventName, args1) => { - this.assetWidth = args1.Width - this.assetHeight = args1.Height - }, this) - if (this.router.url.indexOf("keyUnit/viewunitinfo") != -1) { //查看模式 - this.isEditPattern = false - this.isediticon = false - this.canvasData.gameMode = GameMode.Assignment - } else if (this.router.url.indexOf("keyUnit/editplaninfo") != -1) { //编辑模式 - this.canvasData.gameMode = GameMode.BasicInformation - } - - //gis模块平面图 - if ((this.router.url.indexOf("gis") != -1 || this.router.url.indexOf("waitexamineergis") != -1 || this.router.url.indexOf("createplanonlinefive") != -1) && sessionStorage.getItem("gisplan") == "look") { - this.isEditPattern = false - this.isediticon = false - this.canvasData.gameMode = GameMode.Assignment - } else { - this.getAllLibrary() //获取素材库 - } - - let that = this - window.setTimeout(() => { - document.getElementById("functionalDomainContent").oncontextmenu = function (event) { - // that.canvas.cancelPaint() - that.selectImageIndex = -1 - event.preventDefault(); - }; - }) - - this.canvasData.getMessage().subscribe((message: any) => { - if (message == "send a message") { - // this.refurbishTreeData() - } - }) - - //点击marker关闭按钮 - window.deleteMarker = () => { - this.canvasData.isChange = true - //清除地图标点 - this.planDataMarkers.forEach((element, index) => { - if (element.id == this.clickId) { - this.planDataMarkers[index].setMap(null); - } - }); - - // 删除楼层数据 - delete this.canvasData.originaleveryStoreyData.data[this.clickId]; - // 删除建筑数据 - delete this.canvasData.originalcompanyBuildingData.data[this.clickId]; - - // console.log('originalcompanyBuildingData', this.canvasData.originalcompanyBuildingData) - // console.log('originaleveryStoreyData', this.canvasData.originaleveryStoreyData) - - } - } - - - ngAfterViewInit(): void { - //不是gis模块平面图 - if (this.router.url.indexOf("gis") == -1 && this.router.url.indexOf("createplanonlinefive") == -1) { - this.getSitePlan() - } - } - - copyAssetData: any //存储用于复制的素材 - //复制素材 - copyAsset() { - this.canvas.copy() - } - //粘贴素材 - pasteAsset() { - let companyId = sessionStorage.getItem("companyId") - let buildingId = this.beforeOneCheckedBuilding.id - let floorId = this.selectingSitePlan.id - this.canvas.paste(companyId, buildingId, floorId) - } - //截图 - takeScreenshot() { - if (!this.isGis) { - this.canvas.takeScreenshot(); - } else { - this.takeScreenshotGis() - } - } - canvasImg - takeScreenshotGis() { - // console.log(666666, this.selectingSitePlan) - // 使用html2canvas插件,将数据源中的数据转换成画布。 - html2canvas(document.querySelector("#planContainer"), { - useCORS: true, // 【重要】开启跨域配置, - allowTaint: true,//允许跨域图片 - taintTest: false,//是否在渲染前测试图片 - onrendered: function (canvas) { - var dataUrl = canvas.toDataURL("image/png"); + } + //多选状态动态属性素材下拉框值改变 + multipleSupplyArea(i, e) { + e.stopPropagation() + this.multipleAssetData.forEach(item => { + item.assetData.PropertyInfos.forEach(element => { + if (element.PropertyName == i.PropertyName) { + element.PropertyValue = i.PropertyValue + this.canvas.refreshIcon(item.assetData.Id) + this.canvasData.isChange = true + } + }) + }) + } + + ngAfterViewInit(): void { + //不是gis模块平面图 + if (this.router.url.indexOf("gis") == -1 && this.router.url.indexOf("createplanonlinefive") == -1) { + this.getSitePlan() + } + } + + copyAssetData: any //存储用于复制的素材 + //复制素材 + copyAsset() { + this.canvas.copy() + } + //粘贴素材 + pasteAsset() { + let companyId = sessionStorage.getItem("companyId") + let buildingId = this.beforeOneCheckedBuilding.id + let floorId = this.selectingSitePlan.id + this.canvas.paste(companyId, buildingId, floorId) + // this.renovateTreeData(false) + } + //截图 + takeScreenshot() { + if (!this.isGis) { + this.canvas.takeScreenshot(); + } else { + this.takeScreenshotGis() } - }).then(canvas => { - // 修改生成的宽度 - this.canvasImg = canvas.toDataURL("image/png"); - // console.log(this.canvasImg) - }).then(() => { - this.downloadFile(this.selectingSitePlan.name, this.canvasImg); - }) - } - downloadFile(filename, content) { - var base64Img = content; - var oA = document.createElement('a'); - oA.href = base64Img; - oA.download = filename; - var event = document.createEvent('MouseEvents'); - event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); - oA.dispatchEvent(event); - } - - isMultiSelect: boolean = false; // 多选/单选 切换 - changeMultiSelect(e) { this.canvas.setMulitSelect(this.isMultiSelect) } - isShowLegend: boolean = true; //图例是否显示 - changeLegend(e) { this.canvasData.selectPanelPoint.BackgroundImageUrl ? null : this.canvas.setLegendVisible(this.isShowLegend) } - - basicInfo: boolean = true //基本信息名称显隐 - wantToWork: boolean = true //想定作业名称显隐 - //点击基本信息名称 - basicInfoClick() { - this.basicInfo = !this.basicInfo - this.canvas.setNameVisible(this.basicInfo, 0) - } - - - isEditPattern: boolean = true //是否为编辑模式 - //进入编辑模式 - editpat() { - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('进入编辑模式', '确定', config); - this.isEditPattern = true - } - - //进入查看模式 - lookpat() { - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('进入查看模式', '确定', config); - this.isEditPattern = false - } - - //保存平面图 - saveNum: any = [] - saveSite() { - //更新用于统计的数据 - - this.canvasData.updateBuildingData() - - if (this.selectingSitePlan && this.selectingSitePlan.id) { - //打开遮罩层 - this.maskLayerService.sendMessage(true) - this.saveNum = [] - let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData)); - SitePlanData.data = JSON.stringify(SitePlanData.data) - let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); - CompanyData.data = JSON.stringify(CompanyData.data) - - let object = this.canvasData.originalcompanyBuildingData.data - console.log('建筑数据',object) - let adjoinArr = [] //毗邻数组 - if (this.pattern) {//如果是基本信息编辑模式 - for (const key in object) { - if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻 - object[key].PropertyInfos.forEach(element => { - if (element.PropertyName == "方向") { - adjoinArr.push(element.PropertyValue) - } - }); - } - } - console.log('adjoinArr',adjoinArr) - if ((new Set(adjoinArr)).size != adjoinArr.length) { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存失败,毗邻存在相同方向', '确定', config); - return false - } else { - //如果是单位 总平面图 - if (this.checkedBuildingIndex == -1) { - if (this.isGis) { - let data = JSON.parse(JSON.stringify(this.selectingSitePlan)) - data.zoomLevel = this.map.getZoom(), - data.defaultCenter = { x: this.map.getCenter().lng, y: this.map.getCenter().lat } - delete data.userId - delete data.userName - delete data.sitePlanDataInfo - this.http.put(`/api/SitePlans/${this.selectingSitePlan.id}`, data).subscribe(data => { - this.sitePlanData.forEach(element => { - if (element.id == this.selectingSitePlan.id) { - element.zoomLevel = this.map.getZoom() - element.defaultCenter = { x: this.map.getCenter().lng, y: this.map.getCenter().lat } - } - }); - }, err => { - let config = new MatSnackBarConfig(); + } + canvasImg + takeScreenshotGis() { + // console.log(666666, this.selectingSitePlan) + // 使用html2canvas插件,将数据源中的数据转换成画布。 + html2canvas(document.querySelector("#planContainer"), { + useCORS: true, // 【重要】开启跨域配置, + allowTaint: true,//允许跨域图片 + taintTest: false,//是否在渲染前测试图片 + onrendered: function (canvas) { + var dataUrl = canvas.toDataURL("image/png"); + } + }).then(canvas => { + // 修改生成的宽度 + this.canvasImg = canvas.toDataURL("image/png"); + // console.log(this.canvasImg) + }).then(() => { + this.downloadFile(this.selectingSitePlan.name, this.canvasImg); + }) + } + downloadFile(filename, content) { + var base64Img = content; + var oA = document.createElement('a'); + oA.href = base64Img; + oA.download = filename; + var event = document.createEvent('MouseEvents'); + event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + oA.dispatchEvent(event); + } + + isMultiSelect: boolean = false; // 多选/单选 切换 + changeMultiSelect(e) { this.canvas.setMulitSelect(this.isMultiSelect) } + isShowLegend: boolean = true; //图例是否显示 + changeLegend(e) { this.canvasData.selectPanelPoint.BackgroundImageUrl ? null : this.canvas.setLegendVisible(this.isShowLegend) } + + basicInfo: boolean = true //基本信息名称显隐 + wantToWork: boolean = true //想定作业名称显隐 + //点击基本信息名称 + basicInfoClick() { + this.basicInfo = !this.basicInfo + this.canvas.setNameVisible(this.basicInfo, 0) + } + + //点击想定作业名称 + wantToWorkClick() { + this.wantToWork = !this.wantToWork + this.canvas.setNameVisible(this.wantToWork, 1) + } + + isEditPattern: boolean = true //是否为编辑模式 + //进入编辑模式 + editpat() { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('进入编辑模式', '确定', config); + this.isEditPattern = true + } + + //进入查看模式 + lookpat() { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('进入查看模式', '确定', config); + this.isEditPattern = false + } + + //保存平面图 + saveNum: any = [] + saveSite() { + //更新用于统计的数据 + this.canvasData.updateBuildingData() + + if (this.selectingSitePlan && this.selectingSitePlan.id) { + //打开遮罩层 + this.maskLayerService.sendMessage(true) + this.saveNum = [] + let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData)); + SitePlanData.data = JSON.stringify(SitePlanData.data) + let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + CompanyData.data = JSON.stringify(CompanyData.data) + + let object = this.canvasData.originalcompanyBuildingData.data + let adjoinArr = [] //毗邻数组 + + if (this.pattern) {//如果是基本信息编辑模式 + for (const key in object) { + if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻 + + object[key].PropertyInfos.forEach(element => { + if (element.PropertyName == "方向") { + adjoinArr.push(element.PropertyValue) + } + }); + } + } + if ((new Set(adjoinArr)).size != adjoinArr.length) { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存失败,毗邻存在相同方向', '确定', config); + return false + } else { + //如果是单位 总平面图 + if (this.checkedBuildingIndex == -1) { + + if (this.isGis) { + let data = JSON.parse(JSON.stringify(this.selectingSitePlan)) + data.zoomLevel = this.map.getZoom(), + data.defaultCenter = { x: this.map.getCenter().lng, y: this.map.getCenter().lat } + delete data.userId + delete data.userName + delete data.sitePlanDataInfo + this.http.put(`/api/SitePlans/${this.selectingSitePlan.id}`, data).subscribe(data => { + this.sitePlanData.forEach(element => { + if (element.id == this.selectingSitePlan.id) { + element.zoomLevel = this.map.getZoom() + element.defaultCenter = { x: this.map.getCenter().lng, y: this.map.getCenter().lat } + } + }); + }, err => { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('gis保存当前视角失败', '确定', config); + }) + } + + //保存平面图数据 + this.http.post("/api/SitePlanData", SitePlanData, { + params: { + companyId: this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if (this.saveNum.length == 5) { + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功', '确定', config); + this.tabbarService.sendMessage('changeScore'); + } + }, err => { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('平面图数据保存失败', '确定', config); + }) + + //保存建筑数据 + this.http.post("/api/CompanyData", CompanyData, { + params: { + companyId: this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if (this.saveNum.length == 5) { + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功', '确定', config); + this.tabbarService.sendMessage('changeScore'); + } + }, err => { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('单位数据保存失败', '确定', config); + }) + + //批量保存单位毗邻 + let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() + this.http.post("/api/CompanyAdjoins/Batch", CompanyAdjoins, { + params: { + companyId: this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if (this.saveNum.length == 5) { + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功', '确定', config); + this.tabbarService.sendMessage('changeScore'); + } + }, err => { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + if (err == 'infos 有重复方向!') { + this.snackBar.open('单位毗邻同步失败,存在相同方向', '确定', config); + } else { + this.snackBar.open('单位毗邻同步失败', '确定', config); + } + }) + + //批量保存单位重点部位 + let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() + this.http.post("/api/CompanyImportantLocations/Batch", CompanyImportantLocations, { + params: { + companyId: this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if (this.saveNum.length == 5) { + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功', '确定', config); + this.tabbarService.sendMessage('changeScore'); + } + }, err => { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('单位重点部位同步失败', '确定', config); + }) + + //批量保存单位消防设施素材 + let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() + this.http.post("/api/CompanyFacilityAssets/Batch", CompanyFacilityAssets, { + params: { + companyId: this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if (this.saveNum.length == 5) { + this.maskLayerService.sendMessage(false) + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功', '确定', config); + this.tabbarService.sendMessage('changeScore'); + } + }, err => { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('单位消防设施素材同步失败', '确定', config); + }) + + } else { //如果是建筑 + + //建筑平面图数据 + this.http.post("/api/BuildingAreaData", SitePlanData, { + params: { + companyId: this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if (this.saveNum.length == 5) { + this.maskLayerService.sendMessage(false) + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功', '确定', config); + this.tabbarService.sendMessage('changeScore'); + } + }, err => { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('平面图数据保存失败', '确定', config); + }) + + //建筑数据 + this.http.post("/api/BuildingData", CompanyData, { + params: { + companyId: this.params.companyId + } + }).subscribe(data => { + this.saveNum.push("1") + if (this.saveNum.length == 5) { + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功', '确定', config); + this.tabbarService.sendMessage('changeScore'); + } + }, err => { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('单位数据保存失败', '确定', config); + }) + + //批量保存建筑毗邻 + let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() + this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingAdjoins).subscribe(data => { + this.saveNum.push("1") + if (this.saveNum.length == 5) { + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功', '确定', config); + this.tabbarService.sendMessage('changeScore'); + } + }, err => { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + if (err == 'infos 有重复方向!') { + this.snackBar.open('建筑毗邻同步失败,存在相同方向', '确定', config); + } else { + this.snackBar.open('建筑毗邻同步失败', '确定', config); + } + }) + + //批量保存建筑重点部位 + let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() + this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingImportantLocations).subscribe(data => { + this.saveNum.push("1") + if (this.saveNum.length == 5) { + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功', '确定', config); + this.tabbarService.sendMessage('changeScore'); + } + }, err => { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('建筑重点部位同步失败', '确定', config); + }) + + //批量保存建筑消防设施素材 + let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() + this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingFacilityAssets).subscribe(data => { + this.saveNum.push("1") + if (this.saveNum.length == 5) { + this.maskLayerService.sendMessage(false) + this.canvasData.isChange = false + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('保存成功', '确定', config); + this.tabbarService.sendMessage('changeScore'); + } + }, err => { + this.maskLayerService.sendMessage(false) + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.canvasData.isChange = true + this.snackBar.open('建筑消防设施素材同步失败', '确定', config); + }) + + } + } + } + } else { //if + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('暂无楼层数据', '确定', config); + } + } + + //获得所有的建筑物 + getAllBuildings() { + this.http.get("/api/Buildings", { + params: { + companyId: this.params.companyId + } + }).subscribe(data => { + this.allBuildings = data + }) + } + + + //创建建筑 + createBuilding() { + let data = { + allBuildings: this.allBuildings, + companyId: this.params.companyId + } + let dialogRef = this.dialog.open(CreateBuildingPlan, { data }); + dialogRef.afterClosed().subscribe(data => { + if (data == "创建成功") { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('创建成功', '确定', config); + this.getAllBuildings() + } else if (data == "创建失败") { + const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('gis保存当前视角失败', '确定', config); - }) + this.snackBar.open('创建失败', '确定', config); } + }); + } - //保存平面图数据 - this.http.post("/api/SitePlanData", SitePlanData, { - params: { - companyId: this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - if (this.saveNum.length == 5) { - this.maskLayerService.sendMessage(false) - this.canvasData.isChange = false - let config = new MatSnackBarConfig(); + //选择建筑 + checkedBuilding(item, index) { + if (this.checkedBuildingIndex != index) { + this.canvasData.selectPanelPoint = new DisposalNodeData(); + if (this.canvasData.isChange) { //true 数据被改动 + let isTrue = confirm('是否保存当前编辑数据') + if (isTrue) { //先保存数据 在切换 + let isSuccess = this.saveSite()//true的时候 先保存数据 + if (isSuccess != false) { + this.beforeOneCheckedBuilding = item + this.checkedBuildingIndex = index + if (index == -1) { //总平面图数据 + this.getSitePlan() + } else { //建筑楼层/区域数据 + this.getBuildingSitePlan(item) + } + } + } else { + this.beforeOneCheckedBuilding = item + this.checkedBuildingIndex = index + if (index == -1) { //总平面图数据 + this.getSitePlan() + } else { //建筑楼层/区域数据 + this.getBuildingSitePlan(item) + } + } + } else { //flase 数据未被改动 + this.beforeOneCheckedBuilding = item + this.checkedBuildingIndex = index + if (index == -1) { //总平面图数据 + this.getSitePlan() + } else { //建筑楼层/区域数据 + this.getBuildingSitePlan(item) + } + } //if + + } //if + } + + //编辑建筑 + editBuilding(e, item) { + e.stopPropagation(); + let dialogRef = this.dialog.open(EditBuildingPlan, { data: { item: item } }); + dialogRef.afterClosed().subscribe(data => { + if (data == "修改成功") { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('修改成功', '确定', config); + this.getAllBuildings() + } else if (data == "修改失败") { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('修改失败', '确定', config); + } + }); + } + + //删除建筑 + deleteBuilding(e, item) { + e.stopPropagation(); + if (confirm("是否删除该建筑") == true) { + let isHave = this.canvasData.allDisposalNode.find(items => { return items.buildingId === item.id }) + if (isHave == undefined) { + this.http.delete(`/api/Buildings/${item.id}`).subscribe(data => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('删除成功', '确定', config); + this.http.get("/api/Buildings", { + params: { + companyId: this.params.companyId + } + }).subscribe(data => { + this.allBuildings = data + this.beforeOneCheckedBuilding = { name: "总平面图" } + this.checkedBuildingIndex = -1 + this.getSitePlan() + }) + }, err => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('删除失败', '确定', config); + this.getAllBuildings() + }) + } else { //建筑 含有数据节点时 + const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('保存成功', '确定', config); - this.tabbarService.sendMessage('changeScore'); - } - }, err => { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.canvasData.isChange = true - this.snackBar.open('平面图数据保存失败', '确定', config); + this.snackBar.open('含有数据节点的建筑不允许删除', '确定', config); + } + } + } + + storeyData //将建筑素材和当前楼层素材合二为一 + //处理 tree 数据结构 + handleTreeData(storeyData) { + + this.storeyData = storeyData + let data = this.allFireElements //所有消防要素模板 + let treeData = [] //tree型 处理完成后的数据 + data.forEach(element => { + element.isTemplate = true //添加模板标识 + element.isLook = true //添加是否可见标识 + element.name != '其他' ? element.children = [] : null + + if (storeyData) { + for (let key in storeyData.data) { + storeyData.data[key].isLookPattern = true + if (element.id == storeyData.data[key].FireElementId) { + storeyData.data[key].isTemplate = false + storeyData.data[key].isLook = true + + element.isNewElement = true //该节点children是否存在新添加的真实素材 标识 + + //定义查看模式下能看到的元素 + element.isLookPattern = true + if (element.parentId) { + data.forEach(i => { + if (i.id == element.parentId) { + i.isLookPattern = true + } + }) + } + // + + element.children.push(storeyData.data[key]) + } + } + } + data.forEach(item => { if (item.parentId == element.id) { element.children.push(item) } }); + }); + data.forEach(element => { + if (!element.parentId) { treeData.push(element) } + }); + this.dataSource.data = treeData + this.treeControl.expandAll() + + } + + //点击树节点 + clickTreeNode(node) { + if (this.canvasData.originalcompanyBuildingData.data[node.id]) { + this.setAssetsProperty(this.canvasData.originalcompanyBuildingData.data[node.id]) + } else if (this.canvasData.originaleveryStoreyData.data[node.id]) { + this.setAssetsProperty(this.canvasData.originaleveryStoreyData.data[node.id]) + } + + //canvas上的素材高亮 + let iconHighLightArr: any = [] + if (node.isTemplate) {//如果是模板,则开始向下找 + node.children.forEach(item => { + if (item.isTemplate) {//如果子节点依旧是模板,则继续开始向下找 + item.children.forEach(i => { + iconHighLightArr.push(i.Id) + }) + } else { + iconHighLightArr.push(item.Id) + } + }) + } else { + iconHighLightArr.push(node.id) + } + this.canvas.setHighlight(iconHighLightArr) + } + hideAllTreenode: boolean = true; //全部显示/隐藏tree节点 + toggoleAllTreenode() { + this.hideAllTreenode = !this.hideAllTreenode + let list = [] + this.allFireElements.forEach(element => { + if (element.isTemplate) { this.hideAllTreenode ? element.isLook = false : element.isLook = true } + }) + this.treeControl.dataNodes.forEach(item => { + this.hideAllTreenode ? item.isLook = false : item.isLook = true + item.level === 0 ? list.push(item) : null + }) + list.forEach(item => { + this.clickLookItem(item) + }) + } + + //点击数节点的显示隐藏icon + clickLookItem(node) { + + + //修改真实素材islook属性 + for (let key in this.storeyData.data) { + if (key == node.id) { + this.storeyData.data[key].isLook = !this.storeyData.data[key].isLook + } + } + + //所有消防要素模板变化islook值 + if (node.isTemplate) { + this.allFireElements.forEach(item => { + if (item.id == node.id) { item.isLook = !item.isLook } + if (item.name == '其他' && node.name == '其他') { item.isLook = !item.isLook } }) + } + + + //子节点跟随父节点的islook变化 + if (node.children && node.children.length != 0) { + node.children.forEach(item => { + item.isLook = !node.isLook + if (item.children && item.children.length != 0) { + item.children.forEach(i => { + i.isLook = !node.isLook + }) + } + }) + } + + + const nodes = this.treeControl.dataNodes; + const expandNodes = []; + nodes.forEach((item) => { + if (item.expandable && this.treeControl.isExpanded(item)) { + expandNodes.push(item.id); + } + }); + + this.dataSource.data = [...this.dataSource.data] + + let newNodes = this.treeControl.dataNodes; + newNodes = newNodes.filter(n => { + return expandNodes.indexOf(n.id) >= 0; + }); + newNodes.forEach(item => { + this.treeControl.expand(item); + }); + + //canvas上的素材显隐 + let iconVisibleArr: any = [] + if (node.isTemplate) {//如果是模板,则开始向下找 + node.children.forEach(item => { + if (item.isTemplate) {//如果子节点依旧是模板,则继续开始向下找 + item.children.forEach(i => { + iconVisibleArr.push(i.Id) + }) + } else { + iconVisibleArr.push(item.Id) + } + }) + } else { + iconVisibleArr.push(node.id) + } + this.canvas.setIconVisible(iconVisibleArr, !node.isLook) + } + + + //封装 刷新 tree 数据 + async renovateTreeData(isRefresh: boolean = true) { + // this.allFireElements[this.allFireElements.length-1].children = [] + if (!this.selectingSitePlan.isGis) { + isRefresh ? await this.canvas.refresh() : null + this.canvas.setNameVisible(this.basicInfo, 0) + this.canvas.setNameVisible(this.wantToWork, 1) + this.canvas.setLegendVisible(this.isShowLegend) //图例显隐 + isRefresh ? this.canvasData.isChange = false : null //服务中 数据是否改动 改为false + isRefresh ? this.isShowProperty = true : null + isRefresh ? this.isShowAttribute = true : null + } else { + //加载高德地图 + this.toLoadGis() + } + + let beforeOneId = this.selectingSitePlan.id || '' //当前 选中 平面图 楼层/区域 id + let companyBuildingData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData || {})) // 当前 单位/建筑 数据 + let storeyData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData || {})) //当前 楼层 数据 + + for (let key in companyBuildingData.data) { + if (companyBuildingData.data[key].FloorId === beforeOneId) { //处理 单位/建筑 数据是否归于当前楼层下 + storeyData.data[key] = companyBuildingData.data[key] + } + } + for (let key in storeyData.data) { //筛选数据 没有匹配全部放入到 其他 数组 + let noMatch = this.allFireElements.find(every => every.id === storeyData.data[key].FireElementId) + if (!noMatch && storeyData.data[key].Id != "图例") { + this.allFireElements[this.allFireElements.length - 1].children.push(storeyData.data[key]) + } + } + this.handleTreeData(storeyData) //处理tree数据结构 + } + map: IMap + toLoadGis() { + this.map = MapFactory.MapInstance("planContainer", { + viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D', + zoom: 11, //初始化地图层级 + WebGLParams: { + preserveDrawingBuffer: true + } + }); + if (this.selectingSitePlan.defaultCenter) { + this.map.setZoom(this.selectingSitePlan.zoomLevel); //设置地图层级 + this.map.setCenter([this.selectingSitePlan.defaultCenter.x, this.selectingSitePlan.defaultCenter.y]) + } else { + this.map.setCity('上海市'); + } + + this.map.on('click', (e) => { + this.showInfoClick(e) + },this); + this.map.on("complete", () => { + for (const key in this.canvasData.originaleveryStoreyData.data) { + if (Object.prototype.hasOwnProperty.call(this.canvasData.originaleveryStoreyData.data, key)) { + const element = this.canvasData.originaleveryStoreyData.data[key]; + let editable = sessionStorage.getItem('editable') + let markerContent + if (editable == '1') { + markerContent = '' + + '
' + + `` + + `
X
` + + '
'; + } else { + markerContent = '' + + '
' + + `` + + '
'; + } + + // 将 icon 传入 marker + let startMarker = MapFactory.MarkerInstance({ + position: MapFactory.LngLatInstance(element.Point.x, element.Point.y), + // 将 html 传给 content + content: markerContent, + // 以 icon 的 [center bottom] 为原点 + //offset: MapFactory.PixelInstance(-13,-30, + offset: MapFactory.PixelInstance(-13, 30), + draggable: editable == '1' ? true : false, + } as IMarkOptions) + + startMarker.id = element.Id + startMarker.on('click', (e) => { + console.log(e) + this.clickId = e.target.id + this.setAssetsProperty(this.canvasData.originaleveryStoreyData.data[e.target.id]) + },this); + startMarker.on('dragend', (e) => { + // console.log('拖拽完成', e) + this.canvasData.isChange = true + this.clickId = e.target.id + this.canvasData.originaleveryStoreyData.data[e.target.id].Point = { x: e.lnglat.lng, y: e.lnglat.lat } + },this); + this.planDataMarkers.push(startMarker) + this.map.add(startMarker); + } + } + }); + this.map.on('rightclick', (e) => { + this.selectImage.imageUrl = null + }); + } + + + + + + + + + //陈鹏飞↓↓↓ + //陈鹏飞↓↓↓ + //陈鹏飞↓↓↓ + params = { companyId: sessionStorage.getItem('companyId') } + allFireElements: any = []; //当前 单位/建筑 下的消防要素 + + isShowAttribute: boolean = true; //属性栏 是否显示 默认数据 + isShowProperty: boolean = false //属性栏 是否有东西 + + toggleExpandPanel: boolean = false; //左侧可展开面板展开或关闭 + toggleExpandPanelRight: boolean = false; //右侧可展开面板展开或关闭 + togglePlane: boolean = true; //可展开面板平面图 显隐 + toggleMaterialBank: boolean = false; //可展开面板素材库 显隐 + toggleHandlePlans: boolean = true; //可展开面板处置预案 显隐 + //可展开面板展开或关闭 + toggle() { + this.toggleExpandPanel = !this.toggleExpandPanel + } + //可展开面板展开或关闭 + toggle2() { + this.toggleExpandPanelRight = !this.toggleExpandPanelRight + } + //可展开面板 平面图 展开或关闭 + togglePlanarGraph() { + this.togglePlane = !this.togglePlane + } + //可展开面板 素材库 展开或关闭 + toggleMaterial() { + this.toggleMaterialBank = !this.toggleMaterialBank + } + //可展开面板 处置预案 展开或关闭 + toggleHandlePlan() { + this.toggleHandlePlans = !this.toggleHandlePlans + } + + sitePlanData: any = []; //总平面图 楼层/区域 数据 + selectingSitePlan: any; //选中的 平面图 楼层/区域 + selectSitePlanIndex: number; //选中的 平面图 楼层/区域 index + + //获取总平面图 + getSitePlan() { + let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素 + let planData = this.getSitePlanCompanyData() //获取 单位 数据 + this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[0] || {} + this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据 + if (this.sitePlanData.length != 0 && this.sitePlanData[0].isGis) { + this.isGis = true + } else { + this.isGis = false + } + this.selectSitePlanIndex = 0 + + Promise.all([planData]).then((res) => { + this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 + }) + + }) + } + + //获取建筑 楼层/区域 废弃 + getBuildingSitePlan(item) { + let params = { buildingId: item.id } + let fireData = this.getFireElements(item.buildingTypes[0].id || '') //获取建筑下 消防要素 + let planData = this.getBuildingData(params) //获取 建筑 数据 + this.http.get('/api/BuildingAreas', { params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[0] || {} + this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据 + this.selectSitePlanIndex = 0 + + Promise.all([planData]).then((res) => { + this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 + }) + + }) + } + + //根据单位类型获得所有的消防要素 + getFireElements(e) { + let params = { ids: e } + return new Promise((resolve, reject) => { + this.http.get('/api/Companies/FireElements', { params }).subscribe((data: any) => { + this.allFireElements = data //所有消防要素 + let other = { + children: [], + computed: true, + id: '', + name: '其他', + order: 999, + parentId: null, + tag: "INPUT", + isLookPattern: true + } + this.allFireElements.push(other) + resolve('success') + }) + }) + } + + //获取 单位 数据 + getSitePlanCompanyData() { + return new Promise((resolve, reject) => { + this.http.get('/api/CompanyData', { params: this.params }).subscribe((data: any) => { + console.log('单位数据', data) + this.canvasData.originalcompanyBuildingData = data || {} // 单位原数据 + this.canvasData.originalcompanyBuildingData.data ? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {} + this.canvasData.originalcompanyBuildingData.version = "2.0" + this.canvasData.originalcompanyBuildingData.companyId ? null : this.canvasData.originalcompanyBuildingData.companyId = sessionStorage.getItem('companyId') + resolve('success') + }) + }) + } + + //获取 平面图 楼层数据 + getSitePlanStorey(e) { + let params = { sitePlanId: e.id } + this.http.get(`/api/SitePlanData`, { params }).subscribe((data: any) => { + console.log('平面图数据', data) + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + this.canvasData.originaleveryStoreyData.version = "2.0" + this.canvasData.originaleveryStoreyData.sitePlanId ? null : this.canvasData.originaleveryStoreyData.sitePlanId = e.id || null + this.renovateTreeData() + }) + } + + //获取 建筑 数据 + getBuildingData(e) { + return new Promise((resolve, reject) => { + this.http.get(`/api/BuildingData`, { params: e }).subscribe((data: any) => { + this.canvasData.originalcompanyBuildingData = data || {} // 建筑原数据 + this.canvasData.originalcompanyBuildingData.data ? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {} + this.canvasData.originalcompanyBuildingData.version = "2.0" + this.canvasData.originalcompanyBuildingData.buildingId ? null : this.canvasData.originalcompanyBuildingData.buildingId = e.buildingId + resolve('success') + }) + }) + } + + //获取 建筑 楼层数据 + getBuildingStorey(e) { + let params = { buildingAreaId: e.id } + this.http.get(`/api/BuildingAreaData`, { params }).subscribe((data: any) => { + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + this.canvasData.originaleveryStoreyData.version = "2.0" + this.canvasData.originaleveryStoreyData.buildingAreaId ? null : this.canvasData.originaleveryStoreyData.buildingAreaId = e.id || null + this.renovateTreeData() + }) + } + + //点击选中 平面图 楼层/区域 时 + isGis: boolean + selectSitePlan(item, index) { + console.log('点击楼层', item) + if (item.isGis) { + this.isGis = true + } else { + this.isGis = false + } + + if (this.selectSitePlanIndex != index) { + this.canvasData.selectPanelPoint = new DisposalNodeData(); + if (this.canvasData.isChange) { //true 数据被改动 + let isTrue = confirm('是否保存当前编辑数据') + if (isTrue) { //先保存数据 在切换 + let isSuccess = this.saveSite()//true的时候 先保存数据 + if (isSuccess != false) { + this.selectingSitePlan = item + this.selectSitePlanIndex = index + this.canvasData.selectStorey = item //服务中 存一份数据 + if (this.checkedBuildingIndex == -1) { //总平面图时 + this.getSitePlanStorey(item) //获取 平面图 楼层数据 + } else { //楼层/区域时 + this.getBuildingStorey(item) //获取 建筑 楼层数据 + } + } + } else { //不保存数据 直接切换 + this.selectingSitePlan = item + this.selectSitePlanIndex = index + this.canvasData.selectStorey = item //服务中 存一份数据 + if (this.checkedBuildingIndex == -1) { //总平面图时 + this.getSitePlanStorey(item) //获取 平面图 楼层数据 + this.getSitePlanCompanyData() + } else { //楼层/区域时 + this.getBuildingStorey(item) //获取 建筑 楼层数据 + let params = { buildingId: this.beforeOneCheckedBuilding.id } + this.getBuildingData(params) + } + } + + } else { //false 数据没被改动 + this.selectingSitePlan = item + this.selectSitePlanIndex = index + this.canvasData.selectStorey = item //服务中 存一份数据 + if (this.checkedBuildingIndex == -1) { //总平面图时 + this.getSitePlanStorey(item) //获取 平面图 楼层数据 + } else { //楼层/区域时 + this.getBuildingStorey(item) //获取 建筑 楼层数据 + } + } //if + + } + if (this.element.nativeElement.querySelector('#rightOperate')) { + setTimeout(() => { + this.element.nativeElement.querySelector('#rightOperate').style.position = 'fixed' + this.element.nativeElement.querySelector('#rightOperate').style.left = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().left + document.getElementById("leftDiv").offsetWidth + 'px' + this.element.nativeElement.querySelector('#rightOperate').style.top = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().top - 32 + 'px' + }, 0); + } + } + + hoverSitePlan(item,key){ + if(key == this.selectSitePlanIndex){ + if (this.element.nativeElement.querySelector('#rightOperate')) { + setTimeout(() => { + this.element.nativeElement.querySelector('#rightOperate').style.position = 'fixed' + this.element.nativeElement.querySelector('#rightOperate').style.left = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().left + document.getElementById("leftDiv").offsetWidth + 'px' + this.element.nativeElement.querySelector('#rightOperate').style.top = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().top - 32 + 'px' + }, 0); + } + } + + } + + //新增平面图 楼层/区域 + foundPanel(e) { + e.stopPropagation() + let data = { + isBuilding: this.checkedBuildingIndex == -1 ? false : true, + Panel: this.beforeOneCheckedBuilding, + order: this.sitePlanData.length ? this.sitePlanData[this.sitePlanData.length - 1].order + 1 : 0, + } + let dialogRef = this.dialog.open(leftFunctionalDomainComponentPlan, { data }); + dialogRef.afterClosed().subscribe(data => { + if (data == '总平面图') { + this.sitePlanData.length ? this.renovateSitePlan() : this.getSitePlan() + this.maskLayerService.sendMessage(false) + } else if (data == '建筑') { + this.renovateBuilding() + this.maskLayerService.sendMessage(false) + } + }) + } + + //编辑平面图 楼层/区域 + editPlaneData(e) { + let data = { + isBuilding: this.checkedBuildingIndex == -1 ? false : true, + Panel: this.beforeOneCheckedBuilding, + buildingData: e, + isGis: this.isGis + } + let dialogRef = this.dialog.open(editPlaneFigureComponentPlan, { disableClose: true, hasBackdrop: false, position: { left: '150px', top: '200px' }, data }); + dialogRef.keydownEvents().subscribe(data => { + if (data.key === 'Enter') { + this.canvas.refreshBackgroundImage() + } + }) + dialogRef.afterClosed().subscribe(data => { + if (data == '总平面图') { + let isSuccess = this.renovateSitePlan() + isSuccess.then(res => { + this.canvas.refreshBackgroundImage() + }) + } else if (data == '建筑') { + let isSuccess = this.renovateBuilding() + isSuccess.then(res => { + this.canvas.refreshBackgroundImage() + }) + } else if (data == '更新背景图') { + this.canvas.refreshBackgroundImage() + } + }) + } + + //平面图 楼层/区域 上移 + moveUp(item, index) { + if (index != 0) { + let replaceIndex = this.sitePlanData[index].order + this.sitePlanData[index].order = this.sitePlanData[index - 1].order + this.sitePlanData[index - 1].order = replaceIndex + if (this.checkedBuildingIndex == -1) { //总平面图 + this.http.put(`/api/SitePlans/${this.sitePlanData[index - 1].id}`, this.sitePlanData[index - 1]).subscribe(data => { + this.http.put(`/api/SitePlans/${this.sitePlanData[index].id}`, this.sitePlanData[index]).subscribe(data => { + this.selectSitePlanIndex = this.selectSitePlanIndex - 1 + this.renovateSitePlan() + }) + }) + } else { //楼层/区域 + this.http.put(`/api/BuildingAreas/${this.sitePlanData[index - 1].id}`, this.sitePlanData[index - 1], { params: this.params }).subscribe(data => { + this.http.put(`/api/BuildingAreas/${this.sitePlanData[index].id}`, this.sitePlanData[index], { params: this.params }).subscribe(data => { + this.selectSitePlanIndex = this.selectSitePlanIndex - 1 + this.renovateBuilding() + }) + }) + } + + } //if index + } + + //平面图 楼层/区域 下移 + moveDown(item, index) { + if (index != this.sitePlanData.length - 1) { + let replaceIndex = this.sitePlanData[index].order + this.sitePlanData[index].order = this.sitePlanData[index + 1].order + this.sitePlanData[index + 1].order = replaceIndex + if (this.checkedBuildingIndex == -1) { //总平面图 + this.http.put(`/api/SitePlans/${this.sitePlanData[index + 1].id}`, this.sitePlanData[index + 1]).subscribe(data => { + this.http.put(`/api/SitePlans/${this.sitePlanData[index].id}`, this.sitePlanData[index]).subscribe(data => { + this.selectSitePlanIndex = this.selectSitePlanIndex + 1 + this.renovateSitePlan() + }) + }) + } else { //楼层/区域 + this.http.put(`/api/BuildingAreas/${this.sitePlanData[index + 1].id}`, this.sitePlanData[index + 1], { params: this.params }).subscribe(data => { + this.http.put(`/api/BuildingAreas/${this.sitePlanData[index].id}`, this.sitePlanData[index], { params: this.params }).subscribe(data => { + this.selectSitePlanIndex = this.selectSitePlanIndex + 1 + this.renovateBuilding() + }) + }) + } + + } //if index + } + + //旋转底图 + revolveImg(item) { + if (item.isGis) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('gis底图不允许旋转', '确定', config); + return + } + item.imageAngle == 270 ? item.imageAngle = 0 : item.imageAngle = item.imageAngle + 90 + if (this.checkedBuildingIndex == -1) { //总平面图 + this.http.put(`/api/SitePlans/${item.id}`, item).subscribe(data => { + let isSuccess = this.renovateSitePlan() + isSuccess.then(res => { + this.canvas.refreshBackgroundImage(item.imageUrl, item.imageAngle) + }) + }) + } else { //楼层/区域 + this.http.put(`/api/BuildingAreas/${item.id}`, item, { params: this.params }).subscribe(data => { + let isSuccess = this.renovateBuilding() + isSuccess.then(res => { + this.canvas.refreshBackgroundImage(item.imageUrl, item.imageAngle) + }) + }) + } + + } - //保存建筑数据 - // console.log('CompanyData',CompanyData) - // CompanyData.data = "{\"图例\":{\"Id\":\"图例\",\"Name\":\"图例\",\"Angle\":0,\"Color\":\"#066EED80\",\"Point\":{\"x\":200,\"y\":200},\"Scale\":1,\"Width\":32,\"Border\":null,\"Height\":32,\"PivotX\":0,\"PivotY\":0,\"Enabled\":true,\"FloorId\":\"60d43256660b093f1c3b5aa5\",\"DrawMode\":null,\"FillMode\":null,\"GameMode\":0,\"ImageUrl\":null,\"FixedSize\":null,\"Thickness\":null,\"MultiPoint\":null,\"TemplateId\":null,\"FireElementId\":null,\"PropertyInfos\":[{\"Tag\":\"\",\"Order\":0,\"Enabled\":true,\"Visible\":true,\"Required\":false,\"RuleName\":\"\",\"RuleValue\":\"\",\"PhysicalUnit\":\"\",\"PropertyName\":\"列\",\"PropertyType\":2,\"PropertyValue\":\"2\"}],\"IsFromBuilding\":null,\"InteractiveMode\":null}}" + //删除 平面图 楼层/区域 + deletePlaneData(item) { + const isDelete = confirm('您确定要删除吗'); + if (isDelete) { + if (this.checkedBuildingIndex == -1) { //总平面图 + let isHave = this.canvasData.allDisposalNode.find(items => { return items.sitePlanId === item.id }) + if (isHave == undefined) { + this.http.delete(`/api/SitePlans/${item.id}`).subscribe(data => { + this.deleteShareData(item, -1) + }) + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('含有数据节点的楼层不允许删除', '确定', config); + } + } else { //楼层/区域 + let isHave = this.canvasData.allDisposalNode.find(items => { return items.buildingAreaId === item.id }) + if (isHave == undefined) { + this.http.delete(`/api/BuildingAreas/${item.id}`).subscribe(data => { + this.deleteShareData(item, 1) + }) + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('含有数据节点的楼层不允许删除', '确定', config); + } + } + } + } - this.http.post("/api/CompanyData", CompanyData, { - params: { - companyId: this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - if (this.saveNum.length == 5) { - this.maskLayerService.sendMessage(false) - this.canvasData.isChange = false - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功', '确定', config); - this.tabbarService.sendMessage('changeScore'); - } - }, err => { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.canvasData.isChange = true - this.snackBar.open('单位数据保存失败', '确定', config); - }) + //删除当前 单位/建筑的 共享数据中 已删除data + deleteShareData(e, isCompany) { + this.sitePlanData.forEach((element, index) => { + if (element.id === e.id) { + this.sitePlanData.splice(index, 1) + return + } + }); + let data = this.canvasData.originalcompanyBuildingData; + for (let key in data.data) { + if (data.data[key].FloorId === e.id) { //处理 单位/建筑 数据是否归于当前楼层下 + delete data.data[key] + } + } + let newData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + newData.data = JSON.stringify(newData.data) // 转换JSON 数据格式 + this.selectingSitePlan = this.sitePlanData[0] || {} + this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据 + this.selectSitePlanIndex = 0 + this.canvasData.isChange = false + if (isCompany === -1) { + this.http.post("/api/CompanyData", newData).subscribe(data => { }) + this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 + } else { + this.http.post("/api/BuildingData", newData, { params: this.params }).subscribe(data => { }) + this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 + } + } - //批量保存单位毗邻 - let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() - this.http.post("/api/CompanyAdjoins/Batch", CompanyAdjoins, { - params: { - companyId: this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - if (this.saveNum.length == 5) { - this.maskLayerService.sendMessage(false) - this.canvasData.isChange = false - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功', '确定', config); - this.tabbarService.sendMessage('changeScore'); - } - }, err => { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.canvasData.isChange = true - if (err == 'infos 有重复方向!') { - this.snackBar.open('单位毗邻同步失败,存在相同方向', '确定', config); - } else { - this.snackBar.open('单位毗邻同步失败', '确定', config); - } - }) + //复制图层 平面图 楼层/区域 + duplicateLayer(item) { + if (item.isGis) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('gis底图不允许复制', '确定', config); + return + } + this.maskLayerService.sendMessage(true) + let paramsData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data || {})) + Object.keys(paramsData).forEach((key) => { + if (key != '图例') { + let ID = ObjectID.default.generate() + paramsData[key].Id = ID + paramsData[ID] = paramsData[key] + delete paramsData[key] + } + }) //图标Id重新赋值 + if (this.checkedBuildingIndex == -1) { //总平面图 + item.id = "" + item.modifiedTime = new Date() + item.name = item.name + '(副本)' + item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 + this.http.post('/api/SitePlans', item).subscribe((data: any) => { + let newData = { + version: "2.0", + id: "", + data: JSON.stringify(paramsData) || null, + sitePlanId: data.id + } + this.http.post('/api/SitePlanData', newData, { params: this.params }).subscribe(data => { + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + Object.keys(this.canvasData.originaleveryStoreyData.data).forEach((key) => { + this.canvasData.originalcompanyBuildingData.data[key] = this.canvasData.originaleveryStoreyData.data[key]; + }); + let list = [] + //保存建筑数据 + let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + CompanyData.data = JSON.stringify(CompanyData.data) + this.http.post("/api/CompanyData", CompanyData, { params: { companyId: this.params.companyId } }).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存单位毗邻 + let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() + this.http.post("/api/CompanyAdjoins/Batch", CompanyAdjoins, { params: { companyId: this.params.companyId } }).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }, err => { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if (err == 'infos 有重复方向!') { + this.snackBar.open('单位毗邻同步失败,存在相同方向', '确定', config); + } else { + this.snackBar.open('单位毗邻同步失败', '确定', config); + } + }) + //批量保存单位重点部位 + let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() + this.http.post("/api/CompanyImportantLocations/Batch", CompanyImportantLocations, { params: { companyId: this.params.companyId } }).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存单位消防设施素材 + let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() + this.http.post("/api/CompanyFacilityAssets/Batch", CompanyFacilityAssets, { params: { companyId: this.params.companyId } }).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + }) - //批量保存单位重点部位 - let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() - this.http.post("/api/CompanyImportantLocations/Batch", CompanyImportantLocations, { - params: { - companyId: this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - if (this.saveNum.length == 5) { - this.maskLayerService.sendMessage(false) - this.canvasData.isChange = false - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功', '确定', config); - this.tabbarService.sendMessage('changeScore'); - } - }, err => { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.canvasData.isChange = true - this.snackBar.open('单位重点部位同步失败', '确定', config); }) + } else { //楼层/区域 + item.id = "" + item.modifiedTime = new Date() + item.name = item.name + '(副本)' + item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 + this.http.post('/api/BuildingAreas', item, { params: this.params }).subscribe((data: any) => { + let newData = { + version: "2.0", + id: "", + data: JSON.stringify(paramsData) || null, + buildingAreaId: data.id + } + this.http.post('/api/BuildingAreaData', newData, { params: this.params }).subscribe(data => { + this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 + this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} + Object.keys(this.canvasData.originaleveryStoreyData.data).forEach((key) => { + this.canvasData.originalcompanyBuildingData.data[key] = this.canvasData.originaleveryStoreyData.data[key]; + }); + let list = [] + //建筑数据 + let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); + CompanyData.data = JSON.stringify(CompanyData.data) + this.http.post("/api/BuildingData", CompanyData, { params: { companyId: this.params.companyId } }).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存建筑毗邻 + let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() + this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingAdjoins).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }, err => { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + if (err == 'infos 有重复方向!') { + this.snackBar.open('建筑毗邻同步失败,存在相同方向', '确定', config); + } else { + this.snackBar.open('建筑毗邻同步失败', '确定', config); + } + }) + //批量保存建筑重点部位 + let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() + this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingImportantLocations).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + //批量保存建筑消防设施素材 + let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() + this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingFacilityAssets).subscribe(data => { + list.push(1) + if (list.length === 4) { this.updateCurrentFloor() } + }) + }) - //批量保存单位消防设施素材 - let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() - this.http.post("/api/CompanyFacilityAssets/Batch", CompanyFacilityAssets, { - params: { - companyId: this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - if (this.saveNum.length == 5) { - this.maskLayerService.sendMessage(false) - this.canvasData.isChange = false - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功', '确定', config); - this.tabbarService.sendMessage('changeScore'); - } - }, err => { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.canvasData.isChange = true - this.snackBar.open('单位消防设施素材同步失败', '确定', config); }) + } + } - } else { //如果是建筑 + //复制完楼层后 刷新视图 + updateCurrentFloor() { + if (this.checkedBuildingIndex == -1) { //总平面图 + let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素 + let planData = this.getSitePlanCompanyData() //获取 单位 数据 + this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.sitePlanData.length - 1] || {} + this.canvasData.selectStorey = this.sitePlanData[this.sitePlanData.length - 1] || {} //服务中 存一份数据 + this.selectSitePlanIndex = this.sitePlanData.length - 1 + + Promise.all([fireData, planData]).then((res) => { + this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 + this.maskLayerService.sendMessage(false) + }) + + }) //重新加载 新楼层 + } else { //楼层/区域 + let params = { buildingId: this.beforeOneCheckedBuilding.id } + let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素 + let planData = this.getBuildingData(params) //获取 建筑 数据 + this.http.get('/api/BuildingAreas', { params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.sitePlanData.length - 1] || {} + this.canvasData.selectStorey = this.sitePlanData[this.sitePlanData.length - 1] || {} //服务中 存一份数据 + this.selectSitePlanIndex = this.sitePlanData.length - 1 + + Promise.all([fireData, planData]).then((res) => { + this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 + this.maskLayerService.sendMessage(false) + }) + + }) //重新加载 新楼层 + } + } - //建筑平面图数据 - this.http.post("/api/BuildingAreaData", SitePlanData, { - params: { - companyId: this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - if (this.saveNum.length == 5) { - this.maskLayerService.sendMessage(false) - this.maskLayerService.sendMessage(false) - this.canvasData.isChange = false - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功', '确定', config); - this.tabbarService.sendMessage('changeScore'); - } - }, err => { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.canvasData.isChange = true - this.snackBar.open('平面图数据保存失败', '确定', config); - }) + //平面图 楼层/区域 替换底图 + replaceBaseMap(e, item) { + e.stopPropagation(); + let file = e.target.files[0] || null //获取上传的文件 + let fileSize = file.size || null //上传文件的总大小 + let maxSize = 5 * 1024 * 1024 //5MB一个分片 + let tenSize = 100 * 1024 * 1024 //100MB限制 + if (file && file.name.toLowerCase().indexOf('png') == -1 && file.name.toLowerCase().indexOf('jpg') == -1 && file.name.toLowerCase().indexOf('jpeg') == -1) { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('请上传图片后缀为png,jpg,jpeg的文件', '确定', config); + return + } - //建筑数据 - this.http.post("/api/BuildingData", CompanyData, { - params: { - companyId: this.params.companyId - } - }).subscribe(data => { - this.saveNum.push("1") - if (this.saveNum.length == 5) { - this.maskLayerService.sendMessage(false) - this.canvasData.isChange = false - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功', '确定', config); - this.tabbarService.sendMessage('changeScore'); - } - }, err => { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.canvasData.isChange = true - this.snackBar.open('单位数据保存失败', '确定', config); + if (file && fileSize <= maxSize) { //上传文件<=5MB时 + let formData = new FormData() + formData.append("file", file) + this.http.post(`/api/Objects/WebPlan2D/${sessionStorage.getItem('companyId')}`, formData).subscribe((data: any) => { + this.renovateBaseMap('/api/Objects/WebPlan2D/' + data.objectName, item) }) + } else if (file && fileSize > maxSize && fileSize < tenSize) { //上传文件5-100MB时 + let upload = this.canvasData.sectionUpload(sessionStorage.getItem('companyId'), file) + upload.then(res => { this.renovateBaseMap('/api/Objects/PlanPlatform/' + res, item) }) + } else { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('上传底图需小于100MB', '确定', config); + } + } - //批量保存建筑毗邻 - let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() - this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingAdjoins).subscribe(data => { - this.saveNum.push("1") - if (this.saveNum.length == 5) { - this.maskLayerService.sendMessage(false) - this.canvasData.isChange = false - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功', '确定', config); - this.tabbarService.sendMessage('changeScore'); - } - }, err => { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.canvasData.isChange = true - if (err == 'infos 有重复方向!') { - this.snackBar.open('建筑毗邻同步失败,存在相同方向', '确定', config); - } else { - this.snackBar.open('建筑毗邻同步失败', '确定', config); - } - }) + //封装 替换底图 function + renovateBaseMap(e, item) { + let that = this + let img = new Image() + img.src = e + img.onload = function () { + item.imageUrl = e + item.imageWidth = img.width + item.imageHeight = img.height + if (that.checkedBuildingIndex == -1) { //总平面图 + that.http.put(`/api/SitePlans/${item.id}`, item).subscribe(data => { + let isSuccess = that.renovateSitePlan() + isSuccess.then(res => { + that.canvas.refreshBackgroundImage() + }) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + that.snackBar.open('上传底图成功', '确定', config); + }) + } else { //楼层/区域 + that.http.put(`/api/BuildingAreas/${item.id}`, item, { params: that.params }).subscribe(data => { + let isSuccess = that.renovateBuilding() + isSuccess.then(res => { + that.canvas.refreshBackgroundImage() + }) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + that.snackBar.open('上传底图成功', '确定', config); + }) + } //else + } //onload + } - //批量保存建筑重点部位 - let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() - this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingImportantLocations).subscribe(data => { - this.saveNum.push("1") - if (this.saveNum.length == 5) { - this.maskLayerService.sendMessage(false) - this.canvasData.isChange = false - let config = new MatSnackBarConfig(); + //封装 刷新总平面图 数据 + renovateSitePlan() { + return new Promise((resolve, reject) => { + this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.selectSitePlanIndex] + this.canvasData.selectStorey = this.sitePlanData[this.selectSitePlanIndex] //服务中 存一份数据 + this.canvasData.originaleveryStoreyData.sitePlanId ? null : this.canvasData.originaleveryStoreyData.sitePlanId = this.selectingSitePlan.id || null + const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('保存成功', '确定', config); - this.tabbarService.sendMessage('changeScore'); - } - }, err => { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.canvasData.isChange = true - this.snackBar.open('建筑重点部位同步失败', '确定', config); + this.snackBar.open('数据更新成功', '确定', config); + resolve('success') }) + }) + } - //批量保存建筑消防设施素材 - let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() - this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingFacilityAssets).subscribe(data => { - this.saveNum.push("1") - if (this.saveNum.length == 5) { - this.maskLayerService.sendMessage(false) - this.canvasData.isChange = false - let config = new MatSnackBarConfig(); + //封装 刷新 楼层/区域 数据 + renovateBuilding() { + let params = { + buildingId: this.beforeOneCheckedBuilding.id + } + return new Promise((resolve, reject) => { + this.http.get('/api/BuildingAreas', { params }).subscribe(data => { + this.sitePlanData = data + this.selectingSitePlan = this.sitePlanData[this.selectSitePlanIndex] + this.canvasData.selectStorey = this.sitePlanData[this.selectSitePlanIndex] //服务中 存一份数据 + this.canvasData.originaleveryStoreyData.buildingAreaId ? null : this.canvasData.originaleveryStoreyData.buildingAreaId = this.selectingSitePlan.id || null + const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('保存成功', '确定', config); - this.tabbarService.sendMessage('changeScore'); - } - }, err => { - this.maskLayerService.sendMessage(false) - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.canvasData.isChange = true - this.snackBar.open('建筑消防设施素材同步失败', '确定', config); + this.snackBar.open('数据更新成功', '确定', config); + resolve('success') }) - - } - } - } - } else { //if - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('暂无楼层数据', '确定', config); - } - } - - //获得所有的建筑物 - getAllBuildings() { - this.http.get("/api/Buildings", { - params: { - companyId: this.params.companyId - } - }).subscribe(data => { - this.allBuildings = data - }) - } - - //创建建筑 - createBuilding() { - let data = { - allBuildings: this.allBuildings, - companyId: this.params.companyId - } - let dialogRef = this.dialog.open(CreateBuildingPlan, { data }); - dialogRef.afterClosed().subscribe(data => { - if (data == "创建成功") { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('创建成功', '确定', config); - this.getAllBuildings() - } else if (data == "创建失败") { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('创建失败', '确定', config); - } - }); - } - - //选择建筑 - checkedBuilding(item, index) { - if (this.checkedBuildingIndex != index) { - this.canvasData.selectPanelPoint = new DisposalNodeData(); - if (this.canvasData.isChange) { //true 数据被改动 - let isTrue = confirm('是否保存当前编辑数据') - if (isTrue) { //先保存数据 在切换 - let isSuccess = this.saveSite()//true的时候 先保存数据 - if (isSuccess != false) { - this.beforeOneCheckedBuilding = item - this.checkedBuildingIndex = index - if (index == -1) { //总平面图数据 - this.getSitePlan() - } else { //建筑楼层/区域数据 - this.getBuildingSitePlan(item) - } - } - } else { - this.beforeOneCheckedBuilding = item - this.checkedBuildingIndex = index - if (index == -1) { //总平面图数据 - this.getSitePlan() - } else { //建筑楼层/区域数据 - this.getBuildingSitePlan(item) - } - } - } else { //flase 数据未被改动 - this.beforeOneCheckedBuilding = item - this.checkedBuildingIndex = index - if (index == -1) { //总平面图数据 - this.getSitePlan() - } else { //建筑楼层/区域数据 - this.getBuildingSitePlan(item) - } - } //if - - } //if - } - - //编辑建筑 - editBuilding(e, item) { - e.stopPropagation(); - let dialogRef = this.dialog.open(EditBuildingPlan, { data: { item: item } }); - dialogRef.afterClosed().subscribe(data => { - if (data == "修改成功") { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('修改成功', '确定', config); - this.getAllBuildings() - } else if (data == "修改失败") { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('修改失败', '确定', config); - } - }); - } - - //删除建筑 - deleteBuilding(e, item) { - e.stopPropagation(); - if (confirm("是否删除该建筑") == true) { - let isHave = this.canvasData.allDisposalNode.find(items => { return items.buildingId === item.id }) - if (isHave == undefined) { - this.http.delete(`/api/Buildings/${item.id}`).subscribe(data => { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('删除成功', '确定', config); - this.http.get("/api/Buildings", { - params: { - companyId: this.params.companyId - } - }).subscribe(data => { - this.allBuildings = data - this.beforeOneCheckedBuilding = { name: "总平面图" } - this.checkedBuildingIndex = -1 - this.getSitePlan() - }) - }, err => { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('删除失败', '确定', config); - this.getAllBuildings() }) - } else { //建筑 含有数据节点时 - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('含有数据节点的建筑不允许删除', '确定', config); - } } - } - storeyData //将建筑素材和当前楼层素材合二为一 - //处理 tree 数据结构 - handleTreeData(storeyData) { - this.storeyData = storeyData - let data = this.allFireElements //所有消防要素模板 - let treeData = [] //tree型 处理完成后的数据 - data.forEach(element => { - element.isTemplate = true //添加模板标识 - element.isLook = true //添加是否可见标识 - element.name != '其他' ? element.children = [] : null - - if (storeyData) { - for (let key in storeyData.data) { - storeyData.data[key].isLookPattern = true - if (element.id == storeyData.data[key].FireElementId) { - storeyData.data[key].isTemplate = false - storeyData.data[key].isLook = true - - element.isNewElement = true //该节点children是否存在新添加的真实素材 标识 - - //定义查看模式下能看到的元素 - element.isLookPattern = true - if (element.parentId) { - data.forEach(i => { - if (i.id == element.parentId) { - i.isLookPattern = true - } - }) - } - // - element.children.push(storeyData.data[key]) - } - } - } - data.forEach(item => { if (item.parentId == element.id) { element.children.push(item) } }); - }); - data.forEach(element => { - if (!element.parentId) { treeData.push(element) } - }); - this.dataSource.data = treeData - this.treeControl.expandAll() - - } - //点击树节点 - clickTreeNode(node) { - if (this.canvasData.originalcompanyBuildingData.data[node.id]) { - this.setAssetsProperty(this.canvasData.originalcompanyBuildingData.data[node.id]) - } else if (this.canvasData.originaleveryStoreyData.data[node.id]) { - this.setAssetsProperty(this.canvasData.originaleveryStoreyData.data[node.id]) - } - - //canvas上的素材高亮 - let iconHighLightArr: any = [] - if (node.isTemplate) {//如果是模板,则开始向下找 - node.children.forEach(item => { - if (item.isTemplate) {//如果子节点依旧是模板,则继续开始向下找 - item.children.forEach(i => { - iconHighLightArr.push(i.Id) - }) - } else { - iconHighLightArr.push(item.Id) - } - }) - } else { - iconHighLightArr.push(node.id) - } - this.canvas.setHighlight(iconHighLightArr) - } - hideAllTreenode: boolean = true; //全部显示/隐藏tree节点 - toggoleAllTreenode() { - this.hideAllTreenode = !this.hideAllTreenode - let list = [] - this.allFireElements.forEach(element => { - if (element.isTemplate) { this.hideAllTreenode ? element.isLook = false : element.isLook = true } - }) - this.treeControl.dataNodes.forEach(item => { - this.hideAllTreenode ? item.isLook = false : item.isLook = true - item.level === 0 ? list.push(item) : null - }) - list.forEach(item => { - this.clickLookItem(item) - }) - } - - //点击数节点的显示隐藏icon - clickLookItem(node) { - //修改真实素材islook属性 - for (let key in this.storeyData.data) { - if (key == node.id) { - this.storeyData.data[key].isLook = !this.storeyData.data[key].isLook - } + allLibrary: any = []; //所有素材库 + 素材 + selectLibrary: any; //选中的素材库 + selectImage: any; //选中的素材库图片 + selectImageIndex: number; //选中的素材库图片index + searchSettimeout: any; //延时器 + searchInput: string = null; //模糊搜索 input + searchLibrary: any = []; //模糊搜索 素材 + + //输入框 输入事件 + libraryChange() { + window.clearTimeout(this.searchSettimeout) + this.searchSettimeout = window.setTimeout(() => { + if (this.searchInput === "") { + this.searchLibrary = [] + } else { + this.http.get(`/api/Assets?assetName=${this.searchInput}`).subscribe((data: any) => { + this.searchLibrary = data + }) + } + }, 500) } - //所有消防要素模板变化islook值 - if (node.isTemplate) { - this.allFireElements.forEach(item => { - if (item.id == node.id) { item.isLook = !item.isLook } - if (item.name == '其他' && node.name == '其他') { item.isLook = !item.isLook } - }) + + //获取素材库 + getAllLibrary(type: string = 'input') { + this.http.get(`/api/AssetLibraries?tag=${type}`).subscribe((data: any) => { + data.forEach(element => { + element.images = [] + }); + this.allLibrary = data + this.selectImageIndex = -1 + }) } - //子节点跟随父节点的islook变化 - if (node.children && node.children.length != 0) { - node.children.forEach(item => { - item.isLook = !node.isLook - if (item.children && item.children.length != 0) { - item.children.forEach(i => { - i.isLook = !node.isLook - }) + //素材库展开面板展开时 + opened(e) { + if (!e.images.length) { //当前素材库没加载素材时 + this.http.get(`/api/Assets?libraryId=${e.id}`).subscribe((data: any) => { + e.images = data + }) } - }) } - const nodes = this.treeControl.dataNodes; - const expandNodes = []; - nodes.forEach((item) => { - if (item.expandable && this.treeControl.isExpanded(item)) { - expandNodes.push(item.id); - } - }); - this.dataSource.data = [...this.dataSource.data] - let newNodes = this.treeControl.dataNodes; - newNodes = newNodes.filter(n => { - return expandNodes.indexOf(n.id) >= 0; - }); - newNodes.forEach(item => { - this.treeControl.expand(item); - }); - - //canvas上的素材显隐 - let iconVisibleArr: any = [] - if (node.isTemplate) {//如果是模板,则开始向下找 - node.children.forEach(item => { - if (item.isTemplate) {//如果子节点依旧是模板,则继续开始向下找 - item.children.forEach(i => { - iconVisibleArr.push(i.Id) - }) + //点击选中素材库图片时 + selectImg(item, items, index) { + //如果是gis + this.selectLibrary = item.name + this.selectImage = JSON.parse(JSON.stringify(items)) + // console.log('选中图片',this.selectImage) + this.selectImageIndex = index + if (this.isGis) { + } else { - iconVisibleArr.push(item.Id) + this.canvasData.selectTemplateData = items + this.canvas.beginPaint() } - }) - } else { - iconVisibleArr.push(node.id) - } - this.canvas.setIconVisible(iconVisibleArr, !node.isLook) - } - - - //封装 刷新 tree 数据 - async renovateTreeData(isRefresh: boolean = true) { - if (!this.selectingSitePlan.isGis) { - isRefresh ? await this.canvas.refresh() : null - this.canvas.setNameVisible(this.basicInfo, 0) - this.canvas.setNameVisible(this.wantToWork, 1) - this.canvas.setLegendVisible(this.isShowLegend) //图例显隐 - isRefresh ? this.canvasData.isChange = false : null //服务中 数据是否改动 改为false - isRefresh ? this.isShowProperty = true : null - isRefresh ? this.isShowAttribute = true : null - } else { - //加载高德地图 - this.toLoadGis() - } - - let beforeOneId = this.selectingSitePlan.id || '' //当前 选中 平面图 楼层/区域 id - let companyBuildingData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData || {})) // 当前 单位/建筑 数据 - let storeyData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData || {})) //当前 楼层 数据 - - for (let key in companyBuildingData.data) { - if (companyBuildingData.data[key].FloorId === beforeOneId) { //处理 单位/建筑 数据是否归于当前楼层下 - storeyData.data[key] = companyBuildingData.data[key] - } - } - for (let key in storeyData.data) { //筛选数据 没有匹配全部放入到 其他 数组 - let noMatch = this.allFireElements.find(every => every.id === storeyData.data[key].FireElementId) - if (!noMatch && storeyData.data[key].Id != "图例") { - this.allFireElements[this.allFireElements.length - 1].children.push(storeyData.data[key]) - } } - this.handleTreeData(storeyData) //处理tree数据结构 - } - map: any - toLoadGis() { - this.map = new AMap.Map('planContainer', { - viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D', - zoom: 11, //初始化地图层级 - WebGLParams: { - preserveDrawingBuffer: true - } - }); - if (this.selectingSitePlan.defaultCenter) { - this.map.setZoom(this.selectingSitePlan.zoomLevel); //设置地图层级 - this.map.setCenter([this.selectingSitePlan.defaultCenter.x, this.selectingSitePlan.defaultCenter.y]) - } else { - this.map.setCity('上海市'); - } - - this.map.on('click', (e) => { - this.showInfoClick(e) - }); - this.map.on("complete", () => { - for (const key in this.canvasData.originaleveryStoreyData.data) { - if (Object.prototype.hasOwnProperty.call(this.canvasData.originaleveryStoreyData.data, key)) { - const element = this.canvasData.originaleveryStoreyData.data[key]; - let editable = sessionStorage.getItem('editable') - let markerContent - if (editable == '1') { - markerContent = '' + - '
' + - `` + - `
X
` + - '
'; - } else { - markerContent = '' + - '
' + - `` + - '
'; - } - - // 将 icon 传入 marker - let startMarker = new AMap.Marker({ - position: new AMap.LngLat(element.Point.x, element.Point.y), + + //存储当前gis平面图的所有图标信息 + planData = [] + //存储当前gis平面图的所有marker信息 + planDataMarkers = [] + + //地图单击事件 + clickId + showInfoClick(e) { + if (!this.selectImage || !this.selectImage.imageUrl) { + return + } + this.canvasData.isChange = true + let id = ObjectID.default.generate() + // 新增点标记 + // 点标记显示内容,HTML要素字符串 + let markerContent = '' + + '
' + + `` + + `
X
` + + '
'; + + // 将 icon 传入 marker + let startMarker: IMarker = MapFactory.MarkerInstance({ + position: MapFactory.LngLatInstance(e.lnglat.lng, e.lnglat.lat), // 将 html 传给 content content: markerContent, // 以 icon 的 [center bottom] 为原点 - offset: new AMap.Pixel(-13, -30), - draggable: editable == '1' ? true : false, - }); + offset: MapFactory.PixelInstance(-13, -30), + draggable: true, + } as IMarkOptions); - startMarker.id = element.Id - startMarker.on('click', (e) => { + startMarker.id = id + startMarker.on('click', (e) => { this.clickId = e.target.id this.setAssetsProperty(this.canvasData.originaleveryStoreyData.data[e.target.id]) - }); - startMarker.on('dragend', (e) => { + },this); + startMarker.on('dragend', (e) => { // console.log('拖拽完成', e) this.canvasData.isChange = true this.clickId = e.target.id this.canvasData.originaleveryStoreyData.data[e.target.id].Point = { x: e.lnglat.lng, y: e.lnglat.lat } - }); - this.planDataMarkers.push(startMarker) - this.map.add(startMarker); - } - } - }); - this.map.on('rightclick', (e) => { - this.selectImage.imageUrl = null - }); - } - - - //陈鹏飞↓↓↓ - //陈鹏飞↓↓↓ - //陈鹏飞↓↓↓ - params = { companyId: sessionStorage.getItem('companyId') } - allFireElements: any = []; //当前 单位/建筑 下的消防要素 - - isShowAttribute: boolean = true; //属性栏 是否显示 默认数据 - isShowProperty: boolean = false //属性栏 是否有东西 - - toggleExpandPanel: boolean = false; //左侧可展开面板展开或关闭 - toggleExpandPanelRight: boolean = false; //右侧可展开面板展开或关闭 - togglePlane: boolean = true; //可展开面板平面图 显隐 - toggleMaterialBank: boolean = false; //可展开面板素材库 显隐 - toggleHandlePlans: boolean = true; //可展开面板处置预案 显隐 - //可展开面板展开或关闭 - toggle() { - this.toggleExpandPanel = !this.toggleExpandPanel - } - //可展开面板展开或关闭 - toggle2() { - this.toggleExpandPanelRight = !this.toggleExpandPanelRight - } - //可展开面板 平面图 展开或关闭 - togglePlanarGraph() { - this.togglePlane = !this.togglePlane - } - //可展开面板 素材库 展开或关闭 - toggleMaterial() { - this.toggleMaterialBank = !this.toggleMaterialBank - } - //可展开面板 处置预案 展开或关闭 - toggleHandlePlan() { - this.toggleHandlePlans = !this.toggleHandlePlans - } - - sitePlanData: any = []; //总平面图 楼层/区域 数据 - selectingSitePlan: any; //选中的 平面图 楼层/区域 - selectSitePlanIndex: number; //选中的 平面图 楼层/区域 index - - //获取总平面图 - getSitePlan() { - let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素 - let planData = this.getSitePlanCompanyData() //获取 单位 数据 - this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { - this.sitePlanData = data - this.selectingSitePlan = this.sitePlanData[0] || {} - this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据 - if (this.sitePlanData.length != 0 && this.sitePlanData[0].isGis) { - this.isGis = true - } else { - this.isGis = false - } - this.selectSitePlanIndex = 0 + },this); + + //将图标数据添加 + let itemData = JSON.parse(JSON.stringify(this.selectImage)) + itemData.id = id + itemData.point = { x: e.lnglat.lng, y: e.lnglat.lat } + itemData = this.canvasData.deserialize(JSON.stringify(itemData))//反序列化为大写 + // 添加楼层数据 + this.canvasData.originaleveryStoreyData.data[id] = itemData; + // 添加建筑数据 + this.canvasData.originalcompanyBuildingData.data[id] = itemData; + console.log('originalcompanyBuildingData', this.canvasData.originalcompanyBuildingData) + console.log('originaleveryStoreyData', this.canvasData.originaleveryStoreyData) + + //将marker点添加 + this.planDataMarkers.push(startMarker) + this.map.add(startMarker); - Promise.all([planData]).then((res) => { - this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 - }) + } - }) - } - - //获取建筑 楼层/区域 废弃 - getBuildingSitePlan(item) { - let params = { buildingId: item.id } - let fireData = this.getFireElements(item.buildingTypes[0].id || '') //获取建筑下 消防要素 - let planData = this.getBuildingData(params) //获取 建筑 数据 - this.http.get('/api/BuildingAreas', { params }).subscribe(data => { - this.sitePlanData = data - this.selectingSitePlan = this.sitePlanData[0] || {} - this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据 - this.selectSitePlanIndex = 0 - - Promise.all([planData]).then((res) => { - this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 - }) - }) - } - - //根据单位类型获得所有的消防要素 - getFireElements(e) { - let params = { ids: e } - return new Promise((resolve, reject) => { - this.http.get('/api/Companies/FireElements', { params }).subscribe((data: any) => { - this.allFireElements = data //所有消防要素 - let other = { - children: [], - computed: true, - id: '', - name: '其他', - order: 999, - parentId: null, - tag: "INPUT", - isLookPattern: true - } - this.allFireElements.push(other) - resolve('success') - }) - }) - } - - //获取 单位 数据 - getSitePlanCompanyData() { - return new Promise((resolve, reject) => { - this.http.get('/api/CompanyData', { params: this.params }).subscribe((data: any) => { - console.log('单位数据', data) - this.canvasData.originalcompanyBuildingData = data || {} // 单位原数据 - this.canvasData.originalcompanyBuildingData.data ? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {} - this.canvasData.originalcompanyBuildingData.version = "2.0" - this.canvasData.originalcompanyBuildingData.companyId ? null : this.canvasData.originalcompanyBuildingData.companyId = sessionStorage.getItem('companyId') - resolve('success') - }) - }) - } - - //获取 平面图 楼层数据 - getSitePlanStorey(e) { - let params = { sitePlanId: e.id } - this.http.get(`/api/SitePlanData`, { params }).subscribe((data: any) => { - console.log('平面图数据', data) - this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 - this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} - this.canvasData.originaleveryStoreyData.version = "2.0" - this.canvasData.originaleveryStoreyData.sitePlanId ? null : this.canvasData.originaleveryStoreyData.sitePlanId = e.id || null - this.renovateTreeData() - }) - } - - //获取 建筑 数据 - getBuildingData(e) { - return new Promise((resolve, reject) => { - this.http.get(`/api/BuildingData`, { params: e }).subscribe((data: any) => { - this.canvasData.originalcompanyBuildingData = data || {} // 建筑原数据 - this.canvasData.originalcompanyBuildingData.data ? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {} - this.canvasData.originalcompanyBuildingData.version = "2.0" - this.canvasData.originalcompanyBuildingData.buildingId ? null : this.canvasData.originalcompanyBuildingData.buildingId = e.buildingId - resolve('success') - }) - }) - } - - //获取 建筑 楼层数据 - getBuildingStorey(e) { - let params = { buildingAreaId: e.id } - this.http.get(`/api/BuildingAreaData`, { params }).subscribe((data: any) => { - this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 - this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} - this.canvasData.originaleveryStoreyData.version = "2.0" - this.canvasData.originaleveryStoreyData.buildingAreaId ? null : this.canvasData.originaleveryStoreyData.buildingAreaId = e.id || null - this.renovateTreeData() - }) - } - - //点击选中 平面图 楼层/区域 时 - isGis: boolean - selectSitePlan(item, index) { - // console.log('点击楼层', item) - if (item.isGis) { - this.isGis = true - } else { - this.isGis = false - } - - if (this.selectSitePlanIndex != index) { - this.canvasData.selectPanelPoint = new DisposalNodeData(); - if (this.canvasData.isChange) { //true 数据被改动 - let isTrue = confirm('是否保存当前编辑数据') - if (isTrue) { //先保存数据 在切换 - let isSuccess = this.saveSite()//true的时候 先保存数据 - if (isSuccess != false) { - this.selectingSitePlan = item - this.selectSitePlanIndex = index - this.canvasData.selectStorey = item //服务中 存一份数据 - if (this.checkedBuildingIndex == -1) { //总平面图时 - this.getSitePlanStorey(item) //获取 平面图 楼层数据 - } else { //楼层/区域时 - this.getBuildingStorey(item) //获取 建筑 楼层数据 - } - } - } else { //不保存数据 直接切换 - this.selectingSitePlan = item - this.selectSitePlanIndex = index - this.canvasData.selectStorey = item //服务中 存一份数据 - if (this.checkedBuildingIndex == -1) { //总平面图时 - this.getSitePlanStorey(item) //获取 平面图 楼层数据 - this.getSitePlanCompanyData() - } else { //楼层/区域时 - this.getBuildingStorey(item) //获取 建筑 楼层数据 - let params = { buildingId: this.beforeOneCheckedBuilding.id } - this.getBuildingData(params) - } - } - } else { //false 数据没被改动 - this.selectingSitePlan = item - this.selectSitePlanIndex = index - this.canvasData.selectStorey = item //服务中 存一份数据 - if (this.checkedBuildingIndex == -1) { //总平面图时 - this.getSitePlanStorey(item) //获取 平面图 楼层数据 - } else { //楼层/区域时 - this.getBuildingStorey(item) //获取 建筑 楼层数据 - } - } //if + //处置预案 + allFirePlan: any = []; //所有灾情 + selectDisposalNode: string = ''; //当前点击tree节点 css选中样式 - } - if (this.element.nativeElement.querySelector('#rightOperate')) { - setTimeout(() => { - this.element.nativeElement.querySelector('#rightOperate').style.position = 'fixed' - this.element.nativeElement.querySelector('#rightOperate').style.left = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().left + document.getElementById("leftDiv").offsetWidth + 'px' - this.element.nativeElement.querySelector('#rightOperate').style.top = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().top - 32 + 'px' - }, 0); - } - } - hoverSitePlan(item,key){ - if(key == this.selectSitePlanIndex){ - if (this.element.nativeElement.querySelector('#rightOperate')) { - setTimeout(() => { - this.element.nativeElement.querySelector('#rightOperate').style.position = 'fixed' - this.element.nativeElement.querySelector('#rightOperate').style.left = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().left + document.getElementById("leftDiv").offsetWidth + 'px' - this.element.nativeElement.querySelector('#rightOperate').style.top = document.getElementsByClassName('sitePlanContentBox')[0].children[this.selectSitePlanIndex].getBoundingClientRect().top - 32 + 'px' - }, 0); - } - } - - } - //新增平面图 楼层/区域 - foundPanel(e) { - e.stopPropagation() - let data = { - isBuilding: this.checkedBuildingIndex == -1 ? false : true, - Panel: this.beforeOneCheckedBuilding, - order: this.sitePlanData.length ? this.sitePlanData[this.sitePlanData.length - 1].order + 1 : 0, - } - let dialogRef = this.dialog.open(leftFunctionalDomainComponentPlan, { data }); - dialogRef.afterClosed().subscribe(data => { - if (data == '总平面图') { - this.sitePlanData.length ? this.renovateSitePlan() : this.getSitePlan() - this.maskLayerService.sendMessage(false) - } else if (data == '建筑') { - this.renovateBuilding() - this.maskLayerService.sendMessage(false) - } - }) - } - - //编辑平面图 楼层/区域 - editPlaneData(e) { - let data = { - isBuilding: this.checkedBuildingIndex == -1 ? false : true, - Panel: this.beforeOneCheckedBuilding, - buildingData: e, - isGis: this.isGis - } - let dialogRef = this.dialog.open(editPlaneFigureComponentPlan, { disableClose: true, hasBackdrop: false, position: { left: '150px', top: '200px' }, data }); - dialogRef.keydownEvents().subscribe(data => { - if (data.key === 'Enter') { - this.canvas.refreshBackgroundImage() - } - }) - dialogRef.afterClosed().subscribe(data => { - if (data == '总平面图') { - let isSuccess = this.renovateSitePlan() - isSuccess.then(res => { - this.canvas.refreshBackgroundImage() - }) - } else if (data == '建筑') { - let isSuccess = this.renovateBuilding() - isSuccess.then(res => { - this.canvas.refreshBackgroundImage() - }) - } else if (data == '更新背景图') { - this.canvas.refreshBackgroundImage() - } - }) - } - - //平面图 楼层/区域 上移 - moveUp(item, index) { - if (index != 0) { - let replaceIndex = this.sitePlanData[index].order - this.sitePlanData[index].order = this.sitePlanData[index - 1].order - this.sitePlanData[index - 1].order = replaceIndex - if (this.checkedBuildingIndex == -1) { //总平面图 - this.http.put(`/api/SitePlans/${this.sitePlanData[index - 1].id}`, this.sitePlanData[index - 1]).subscribe(data => { - this.http.put(`/api/SitePlans/${this.sitePlanData[index].id}`, this.sitePlanData[index]).subscribe(data => { - this.selectSitePlanIndex = this.selectSitePlanIndex - 1 - this.renovateSitePlan() - }) - }) - } else { //楼层/区域 - this.http.put(`/api/BuildingAreas/${this.sitePlanData[index - 1].id}`, this.sitePlanData[index - 1], { params: this.params }).subscribe(data => { - this.http.put(`/api/BuildingAreas/${this.sitePlanData[index].id}`, this.sitePlanData[index], { params: this.params }).subscribe(data => { - this.selectSitePlanIndex = this.selectSitePlanIndex - 1 - this.renovateBuilding() - }) + //获取所有灾情 + getAllFirePlan() { + let params = { componentId: sessionStorage.getItem('planId') } + this.http.get('/api/Disasters', { params: params }).subscribe((data: any) => { + if (!data.length) { //该 单位没有灾情时 + let msg = { + name: '灾情', + modifiedTime: new Date(), + planComponentId: sessionStorage.getItem('planId') + } + this.http.post('/api/Disasters', msg).subscribe(data => { + this.allFirePlan.push(data) + let params = { disasterId: this.allFirePlan[0].id || '' } + this.http.get('/api/DisposalNodes', { params: params }).subscribe(data => { //所有处置节点 + this.canvasData.allDisposalNode = data + }) + }) + } else { //单位 有灾情时 + this.allFirePlan = data + let params = { disasterId: this.allFirePlan[0].id || '' } + this.http.get('/api/DisposalNodes', { params: params }).subscribe(data => { //所有处置节点 + this.canvasData.allDisposalNode = data + }) + } }) - } + } - } //if index - } - - //平面图 楼层/区域 下移 - moveDown(item, index) { - if (index != this.sitePlanData.length - 1) { - let replaceIndex = this.sitePlanData[index].order - this.sitePlanData[index].order = this.sitePlanData[index + 1].order - this.sitePlanData[index + 1].order = replaceIndex - if (this.checkedBuildingIndex == -1) { //总平面图 - this.http.put(`/api/SitePlans/${this.sitePlanData[index + 1].id}`, this.sitePlanData[index + 1]).subscribe(data => { - this.http.put(`/api/SitePlans/${this.sitePlanData[index].id}`, this.sitePlanData[index]).subscribe(data => { - this.selectSitePlanIndex = this.selectSitePlanIndex + 1 - this.renovateSitePlan() - }) + //获取所有处置节点 + getDisposalNode() { + this.selectDisposalNode = '' + let params = { disasterId: this.allFirePlan[0].id || '' } + this.http.get('/api/DisasterData/Markers', { params: params }).subscribe(data => { //灾情标签信息 + this.canvasData.allNodeMarkers = data + this.mateFireForce() }) - } else { //楼层/区域 - this.http.put(`/api/BuildingAreas/${this.sitePlanData[index + 1].id}`, this.sitePlanData[index + 1], { params: this.params }).subscribe(data => { - this.http.put(`/api/BuildingAreas/${this.sitePlanData[index].id}`, this.sitePlanData[index], { params: this.params }).subscribe(data => { - this.selectSitePlanIndex = this.selectSitePlanIndex + 1 - this.renovateBuilding() - }) + this.http.get('/api/DisposalNodes', { params: params }).subscribe(data => { //处置节点 + this.canvasData.allDisposalNode = data + this.handleHybridTree() }) - } + } - } //if index - } - - //旋转底图 - revolveImg(item) { - if (item.isGis) { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('gis底图不允许旋转', '确定', config); - return - } - item.imageAngle == 270 ? item.imageAngle = 0 : item.imageAngle = item.imageAngle + 90 - if (this.checkedBuildingIndex == -1) { //总平面图 - this.http.put(`/api/SitePlans/${item.id}`, item).subscribe(data => { - let isSuccess = this.renovateSitePlan() - isSuccess.then(res => { - this.canvas.refreshBackgroundImage(item.imageUrl, item.imageAngle) + treeData: any = []; //渲染tree处理完成数据 + defaultExpandedKeys: any = []; //首次渲染 tree展开状态 + //处理 节点 Tree数据 + handleHybridTree() { + this.defaultExpandedKeys = [] + let treeData = [] + let data = JSON.parse(JSON.stringify(this.canvasData.allDisposalNode || [])) + data.forEach(element => { + this.defaultExpandedKeys.push(element.id) + element.title = element.name //name + element.key = element.id //id + element.children = [] //children + if (element.sitePlanId || element.buildingAreaId) { //是数据节点 + element.isLeaf = true + element.isDataNode = true + } else { //不是数据节点 + element.isLeaf = false + element.isDataNode = false + } + data.forEach(item => { + item.parentId === element.id ? element.children.push(item) : null + }) + }); + data.forEach(element => { + !element.parentId ? treeData.push(element) : null }) - }) - } else { //楼层/区域 - this.http.put(`/api/BuildingAreas/${item.id}`, item, { params: this.params }).subscribe(data => { - let isSuccess = this.renovateBuilding() - isSuccess.then(res => { - this.canvas.refreshBackgroundImage(item.imageUrl, item.imageAngle) + this.treeData = [...treeData] + this.defaultExpandedKeys = [...this.defaultExpandedKeys] + } + + //刷新 treeData 保存已展开节点 + refurbishTreeData() { + this.defaultExpandedKeys = [] + let params = { disasterId: this.allFirePlan[0].id || '' } + this.http.get('/api/DisposalNodes', { params: params }).subscribe(nodeData => { //处置节点 + this.canvasData.allDisposalNode = nodeData + let oldTreeData = this.nzTreeComponent.getExpandedNodeList() + oldTreeData.forEach(item => { + this.defaultExpandedKeys.push(item.key) + }) + let treeData = [] + let data = JSON.parse(JSON.stringify(this.canvasData.allDisposalNode || [])) + data.forEach(element => { + element.title = element.name //name + element.key = element.id //id + element.children = [] //children + if (element.sitePlanId || element.buildingAreaId) { //是数据节点 + element.isLeaf = true + element.isDataNode = true + } else { //不是数据节点 + element.isLeaf = false + element.isDataNode = false + } + data.forEach(item => { + item.parentId === element.id ? element.children.push(item) : null + }) + }); + data.forEach(element => { + !element.parentId ? treeData.push(element) : null + }) + this.treeData = [...treeData] + this.defaultExpandedKeys = [...this.defaultExpandedKeys] }) - }) } - } + sitePlanIcon = { fire: 0, force: 0 } // 总平面图 火源/力量 图标 是否展示 - //删除 平面图 楼层/区域 - deletePlaneData(item) { - const isDelete = confirm('您确定要删除吗'); - if (isDelete) { - if (this.checkedBuildingIndex == -1) { //总平面图 - this.http.delete(`/api/SitePlans/${item.id}`).subscribe(data => { - this.deleteShareData(item, -1) - }) - } else { //楼层/区域 - this.http.delete(`/api/BuildingAreas/${item.id}`).subscribe(data => { - this.deleteShareData(item, 1) - }) - } + //刷新 建筑楼层 匹配 火源/力量 图标 + mateFireForce() { + let data = this.canvasData.allNodeMarkers.markers || {} + for (let key in data) { //遍历 火/力量 图标 + this.sitePlanData.forEach(element => { //楼层 + if (element.id == key) { // 相匹配时 + data[key].fireCount != 0 ? element.fire = 1 : element.fire = 0 + data[key].forceCount != 0 ? element.force = 1 : element.force = 0 + } + }); + this.allBuildings.forEach(element => { //建筑 + if (element.id == key) { // 相匹配时 + data[key].fireCount != 0 ? element.fire = 1 : element.fire = 0 + data[key].forceCount != 0 ? element.force = 1 : element.force = 0 + } + }); + if (this.params.companyId == key) { //总平面图时 + data[key].fireCount != 0 ? this.sitePlanIcon.fire = 1 : this.sitePlanIcon.fire = 0 + data[key].forceCount != 0 ? this.sitePlanIcon.force = 1 : this.sitePlanIcon.force = 0 + } + } + + let buildingMSG = this.canvasData.allNodeMarkers.highlightMarkers || {} + for (let key in buildingMSG) { + if (key === this.canvasData.selectPanelPoint.DisposalNodeId) { + for (let keys in buildingMSG[key]) { + this.sitePlanData.forEach(element => { //楼层 + if (element.id === keys) { + buildingMSG[key][keys].fireCount != 0 ? element.fire = 2 : null + buildingMSG[key][keys].forceCount != 0 ? element.force = 2 : null + } + }); + this.allBuildings.forEach(element => { //建筑 + if (element.id === keys) { // 相匹配时 + buildingMSG[key][keys].fireCount != 0 ? element.fire = 2 : null + buildingMSG[key][keys].forceCount != 0 ? element.force = 2 : null + } + }); + if (this.params.companyId === keys) { //总平面图时 + buildingMSG[key][keys].fireCount != 0 ? this.sitePlanIcon.fire = 2 : null + buildingMSG[key][keys].forceCount != 0 ? this.sitePlanIcon.force = 2 : null + } + } + } + } } - } - //删除当前 单位/建筑的 共享数据中 已删除data - deleteShareData(e, isCompany) { - this.sitePlanData.forEach((element, index) => { - if (element.id === e.id) { - this.sitePlanData.splice(index, 1) - return - } - }); - let data = this.canvasData.originalcompanyBuildingData; - for (let key in data.data) { - if (data.data[key].FloorId === e.id) { //处理 单位/建筑 数据是否归于当前楼层下 - delete data.data[key] - } + // 切换 基本信息时 刷新 删除 建筑楼层 自定义属性 + mateDeleteCustomize() { + this.canvasData.selectPanelPointBaseData = { description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: '' } + this.defaultExpandedKeys = [] + this.sitePlanIcon = { fire: 0, force: 0 } + this.sitePlanData.forEach(element => { //楼层 + delete element.fire + delete element.force + }); + this.allBuildings.forEach(element => { //建筑 + delete element.fire + delete element.force + }); } - console.log('删除e',e) - console.log('删除建筑数据',data) - let newData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); - newData.data = JSON.stringify(newData.data) // 转换JSON 数据格式 - this.selectingSitePlan = this.sitePlanData[0] || {} - this.sitePlanData[0] ? this.isGis = this.sitePlanData[0].isGis : null - this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据 - this.selectSitePlanIndex = 0 - this.canvasData.isChange = false - if (isCompany === -1) { - console.log('保存建筑数据',newData) - this.http.post("/api/CompanyData", newData).subscribe(data => { }) - this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 - } else { - this.http.post("/api/BuildingData", newData, { params: this.params }).subscribe(data => { }) - this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 - } - } - - //复制图层 平面图 楼层/区域 - duplicateLayer(item) { - if (item.isGis) { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('gis底图不允许复制', '确定', config); - return - } - this.maskLayerService.sendMessage(true) - let paramsData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data || {})) - Object.keys(paramsData).forEach((key) => { - if (key != '图例') { - let ID = ObjectID.default.generate() - paramsData[key].Id = ID - paramsData[ID] = paramsData[key] - delete paramsData[key] - } - }) //图标Id重新赋值 - if (this.checkedBuildingIndex == -1) { //总平面图 - item.id = "" - item.modifiedTime = new Date() - item.name = item.name + '(副本)' - item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 - this.http.post('/api/SitePlans', item).subscribe((data: any) => { - for (const key in paramsData) { - if (Object.prototype.hasOwnProperty.call(paramsData, key)) { - const element = paramsData[key]; - element.FloorId = data.id - } - } - let newData = { - version: "2.0", - id: "", - data: JSON.stringify(paramsData) || null, - sitePlanId: data.id - } - this.http.post('/api/SitePlanData', newData, { params: this.params }).subscribe(data => { - this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 - this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} - Object.keys(this.canvasData.originaleveryStoreyData.data).forEach((key) => { - this.canvasData.originalcompanyBuildingData.data[key] = this.canvasData.originaleveryStoreyData.data[key]; - }); - let list = [] - //保存建筑数据 - let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); - CompanyData.data = JSON.stringify(CompanyData.data) - this.http.post("/api/CompanyData", CompanyData, { params: { companyId: this.params.companyId } }).subscribe(data => { - list.push(1) - if (list.length === 4) { this.updateCurrentFloor() } - }) - //批量保存单位毗邻 - let CompanyAdjoins = this.canvasData.getCompanyAdjoinInfo() - this.http.post("/api/CompanyAdjoins/Batch", CompanyAdjoins, { params: { companyId: this.params.companyId } }).subscribe(data => { - list.push(1) - if (list.length === 4) { this.updateCurrentFloor() } - }, err => { - let config = new MatSnackBarConfig(); + + //计算差异 + countValue(e) { + e.stopPropagation() + let params = { disasterId: this.allFirePlan[0].id || '' } + this.http.get('/api/DisasterData/Diffs', { params: params }).subscribe(data => { + this.canvasData.allNodeMarkers = data + this.mateFireForce() + const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - if (err == 'infos 有重复方向!') { - this.snackBar.open('单位毗邻同步失败,存在相同方向', '确定', config); - } else { - this.snackBar.open('单位毗邻同步失败', '确定', config); - } - }) - //批量保存单位重点部位 - let CompanyImportantLocations = this.canvasData.getCompanyImportantLocations() - this.http.post("/api/CompanyImportantLocations/Batch", CompanyImportantLocations, { params: { companyId: this.params.companyId } }).subscribe(data => { - list.push(1) - if (list.length === 4) { this.updateCurrentFloor() } - }) - //批量保存单位消防设施素材 - let CompanyFacilityAssets = this.canvasData.getAllCompanyFacilityAssetInfo() - this.http.post("/api/CompanyFacilityAssets/Batch", CompanyFacilityAssets, { params: { companyId: this.params.companyId } }).subscribe(data => { - list.push(1) - if (list.length === 4) { this.updateCurrentFloor() } - }) + this.snackBar.open('计算差异完成', '确定', config); }) + } - }) - } else { //楼层/区域 - item.id = "" - item.modifiedTime = new Date() - item.name = item.name + '(副本)' - item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 - this.http.post('/api/BuildingAreas', item, { params: this.params }).subscribe((data: any) => { - for (const key in paramsData) { - if (Object.prototype.hasOwnProperty.call(paramsData, key)) { - const element = paramsData[key]; - element.FloorId = data.id - } - } - let newData = { - version: "2.0", - id: "", - data: JSON.stringify(paramsData) || null, - buildingAreaId: data.id - } - this.http.post('/api/BuildingAreaData', newData, { params: this.params }).subscribe(data => { - this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据 - this.canvasData.originaleveryStoreyData.data ? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} - Object.keys(this.canvasData.originaleveryStoreyData.data).forEach((key) => { - this.canvasData.originalcompanyBuildingData.data[key] = this.canvasData.originaleveryStoreyData.data[key]; - }); - let list = [] - //建筑数据 - let CompanyData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); - CompanyData.data = JSON.stringify(CompanyData.data) - this.http.post("/api/BuildingData", CompanyData, { params: { companyId: this.params.companyId } }).subscribe(data => { - list.push(1) - if (list.length === 4) { this.updateCurrentFloor() } - }) - //批量保存建筑毗邻 - let buildingAdjoins = this.canvasData.getBuildingAdjoinInfo() - this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingAdjoins).subscribe(data => { - list.push(1) - if (list.length === 4) { this.updateCurrentFloor() } - }, err => { - let config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - if (err == 'infos 有重复方向!') { - this.snackBar.open('建筑毗邻同步失败,存在相同方向', '确定', config); + //复制 处置预案 节点 + copyPanelPoint(e, item, treeData) { + e.stopPropagation() + if (confirm(`确定要复制 ${item.title} ?`)) { + let params = { id: item.origin.id } + let order + if (item.level == 0) { + treeData.length ? order = treeData[treeData.length - 1].order + 1 : order = 0 } else { - this.snackBar.open('建筑毗邻同步失败', '确定', config); + let parent = item.getParentNode() //获取父节点 + parent.origin.children.length ? order = parent.origin.children[parent.origin.children.length - 1].order + 1 : order = 0 } - }) - //批量保存建筑重点部位 - let buildingImportantLocations = this.canvasData.getBuildingImportantLocations() - this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingImportantLocations).subscribe(data => { - list.push(1) - if (list.length === 4) { this.updateCurrentFloor() } - }) - //批量保存建筑消防设施素材 - let buildingFacilityAssets = this.canvasData.getAllBuildingFacilityAssetInfo() - this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`, buildingFacilityAssets).subscribe(data => { - list.push(1) - if (list.length === 4) { this.updateCurrentFloor() } - }) - }) - - }) + let data = { + name: item.title + '(副本)', + level: item.level, + order: order, + description: '', + disasterId: item.origin.disasterId || '', + parentId: item.origin.parentId || null, + planComponentId: item.origin.planComponentId || '', + } + this.http.post('/api/DisposalNodes/Clone', data, { params: params }).subscribe(data => { + this.refurbishTreeData() + }) + } //isTrue } - } - - //复制完楼层后 刷新视图 - updateCurrentFloor() { - if (this.checkedBuildingIndex == -1) { //总平面图 - let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素 - let planData = this.getSitePlanCompanyData() //获取 单位 数据 - this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { - this.sitePlanData = data - this.selectingSitePlan = this.sitePlanData[this.sitePlanData.length - 1] || {} - this.canvasData.selectStorey = this.sitePlanData[this.sitePlanData.length - 1] || {} //服务中 存一份数据 - this.selectSitePlanIndex = this.sitePlanData.length - 1 - - Promise.all([fireData, planData]).then((res) => { - this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 - this.maskLayerService.sendMessage(false) - }) - }) //重新加载 新楼层 - } else { //楼层/区域 - let params = { buildingId: this.beforeOneCheckedBuilding.id } - let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素 - let planData = this.getBuildingData(params) //获取 建筑 数据 - this.http.get('/api/BuildingAreas', { params }).subscribe(data => { - this.sitePlanData = data - this.selectingSitePlan = this.sitePlanData[this.sitePlanData.length - 1] || {} - this.canvasData.selectStorey = this.sitePlanData[this.sitePlanData.length - 1] || {} //服务中 存一份数据 - this.selectSitePlanIndex = this.sitePlanData.length - 1 - - Promise.all([fireData, planData]).then((res) => { - this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 - this.maskLayerService.sendMessage(false) - }) + //删除 处置预案 节点 + deletePanelPoint(e, item) { + e.stopPropagation() + if (confirm(`确定要删除 ${item.name} ?`)) { + this.http.delete(`/api/DisposalNodes/${item.id}`).subscribe(data => { + this.refurbishTreeData() + }) + } + } - }) //重新加载 新楼层 - } - } - - //平面图 楼层/区域 替换底图 - replaceBaseMap(e, item) { - e.stopPropagation(); - let file = e.target.files[0] || null //获取上传的文件 - let fileSize = file.size || null //上传文件的总大小 - let maxSize = 5 * 1024 * 1024 //5MB一个分片 - let tenSize = 100 * 1024 * 1024 //100MB限制 - if (file && file.name.toLowerCase().indexOf('png') == -1 && file.name.toLowerCase().indexOf('jpg') == -1 && file.name.toLowerCase().indexOf('jpeg') == -1) { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('请上传图片后缀为png,jpg,jpeg的文件', '确定', config); - return - } - - if (file && fileSize <= maxSize) { //上传文件<=5MB时 - let formData = new FormData() - formData.append("file", file) - this.http.post(`/api/Objects/WebPlan2D/${sessionStorage.getItem('companyId')}`, formData).subscribe((data: any) => { - this.renovateBaseMap('/api/Objects/WebPlan2D/' + data.objectName, item) - }) - } else if (file && fileSize > maxSize && fileSize < tenSize) { //上传文件5-100MB时 - let upload = this.canvasData.sectionUpload(sessionStorage.getItem('companyId'), file) - upload.then(res => { this.renovateBaseMap('/api/Objects/PlanPlatform/' + res, item) }) - } else { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('上传底图需小于100MB', '确定', config); - } - } - - //封装 替换底图 function - renovateBaseMap(e, item) { - let that = this - let img = new Image() - img.src = e - img.onload = function () { - item.imageUrl = e - item.imageWidth = img.width - item.imageHeight = img.height - if (that.checkedBuildingIndex == -1) { //总平面图 - that.http.put(`/api/SitePlans/${item.id}`, item).subscribe(data => { - let isSuccess = that.renovateSitePlan() - isSuccess.then(res => { - that.canvas.refreshBackgroundImage() - }) - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - that.snackBar.open('上传底图成功', '确定', config); - }) - } else { //楼层/区域 - that.http.put(`/api/BuildingAreas/${item.id}`, item, { params: that.params }).subscribe(data => { - let isSuccess = that.renovateBuilding() - isSuccess.then(res => { - that.canvas.refreshBackgroundImage() - }) - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - that.snackBar.open('上传底图成功', '确定', config); - }) - } //else - } //onload - } - - //封装 刷新总平面图 数据 - renovateSitePlan() { - return new Promise((resolve, reject) => { - this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { - this.sitePlanData = data - this.selectingSitePlan = this.sitePlanData[this.selectSitePlanIndex] - this.canvasData.selectStorey = this.sitePlanData[this.selectSitePlanIndex] //服务中 存一份数据 - this.canvasData.originaleveryStoreyData.sitePlanId ? null : this.canvasData.originaleveryStoreyData.sitePlanId = this.selectingSitePlan.id || null - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('数据更新成功', '确定', config); - resolve('success') - }) - }) - } - - //封装 刷新 楼层/区域 数据 - renovateBuilding() { - let params = { - buildingId: this.beforeOneCheckedBuilding.id - } - return new Promise((resolve, reject) => { - this.http.get('/api/BuildingAreas', { params }).subscribe(data => { - this.sitePlanData = data - this.selectingSitePlan = this.sitePlanData[this.selectSitePlanIndex] - this.canvasData.selectStorey = this.sitePlanData[this.selectSitePlanIndex] //服务中 存一份数据 - this.canvasData.originaleveryStoreyData.buildingAreaId ? null : this.canvasData.originaleveryStoreyData.buildingAreaId = this.selectingSitePlan.id || null - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('数据更新成功', '确定', config); - resolve('success') - }) - }) - } - - allLibrary: any = []; //所有素材库 + 素材 - selectLibrary: any; //选中的素材库 - selectImage: any; //选中的素材库图片 - selectImageIndex: number; //选中的素材库图片index - searchSettimeout: any; //延时器 - searchInput: string = null; //模糊搜索 input - searchLibrary: any = []; //模糊搜索 素材 - - //输入框 输入事件 - libraryChange() { - window.clearTimeout(this.searchSettimeout) - this.searchSettimeout = window.setTimeout(() => { - if (this.searchInput === "") { - this.searchLibrary = [] - } else { - this.http.get(`/api/Assets?assetName=${this.searchInput}`).subscribe((data: any) => { - this.searchLibrary = data - }) - } - }, 500) - } - - //获取素材库 - getAllLibrary(type: string = 'input') { - this.http.get(`/api/AssetLibraries?tag=${type}`).subscribe((data: any) => { - data.forEach(element => { - element.images = [] - }); - this.allLibrary = data - this.selectImageIndex = -1 - }) - } - - //素材库展开面板展开时 - opened(e) { - if (!e.images.length) { //当前素材库没加载素材时 - this.http.get(`/api/Assets?libraryId=${e.id}`).subscribe((data: any) => { - e.images = data - }) + //点击 处置Tree节点 + selectanelPoint(e) { + if (!e.buildingAreaId && !e.sitePlanId) { //当前节点 不是 数据节点 时 + let msg = this.canvasData.findDisposalNode(e.id) + this.canvasData.selectPanelPointBaseData = msg + this.selectDisposalNode == msg.id ? this.selectDisposalNode = '' : this.selectDisposalNode = msg.id //选中 节点 + + } else if (e.buildingAreaId || e.sitePlanId) { //当前节点 是 数据节点 时 + let msg = this.canvasData.findDisposalNode(e.parentId) + this.canvasData.selectPanelPointBaseData = msg + this.selectDisposalNode = e.parentId //选中 节点 + + if (this.canvasData.selectPanelPoint.DisposalNodeId != e.id) { //选择节点 不是当前节点时 + let params = { nodeId: e.id } + let parameter = { //查询 节点 对应 建筑/楼层 index,id + buildingIndex: e.sitePlanId ? -1 : this.allBuildings.findIndex(item => { return item.id === e.buildingId }), //总平面图/建筑 index + storeyId: e.sitePlanId ? e.sitePlanId : e.buildingAreaId, //楼层id + } + this.http.get('/api/DisposalNodeData', { params: params }).subscribe(data => { + this.canvasData.selectPanelPoint = this.canvasData.deserialize(JSON.stringify(data || new DisposalNodeData())) //选择 当前 节点 + this.canvasData.selectPanelPoint.Data = this.canvasData.deserialize(this.canvasData.selectPanelPoint.Data) + this.seekPanelPoint(parameter) + }) + } //if + + } //else if } - } - - //点击选中素材库图片时 - selectImg(item, items, index) { - //如果是gis - this.selectLibrary = item.name - this.selectImage = JSON.parse(JSON.stringify(items)) - // console.log('选中图片',this.selectImage) - this.selectImageIndex = index - if (this.isGis) { - // console.log(this.map) - } else { - this.canvasData.selectTemplateData = items - this.canvas.beginPaint() - } - } - - //存储当前gis平面图的所有图标信息 - planData = [] - //存储当前gis平面图的所有marker信息 - planDataMarkers = [] - - //地图单击事件 - clickId - showInfoClick(e) { - if (!this.selectImage || !this.selectImage.imageUrl) { - return - } - this.canvasData.isChange = true - let id = ObjectID.default.generate() - // 新增点标记 - // 点标记显示内容,HTML要素字符串 - let markerContent = '' + - '
' + - `` + - `
X
` + - '
'; - - // 将 icon 传入 marker - let startMarker = new AMap.Marker({ - position: new AMap.LngLat(e.lnglat.lng, e.lnglat.lat), - // 将 html 传给 content - content: markerContent, - // 以 icon 的 [center bottom] 为原点 - offset: new AMap.Pixel(-13, -30), - draggable: true, - }); - - startMarker.id = id - startMarker.on('click', (e) => { - this.clickId = e.target.id - this.setAssetsProperty(this.canvasData.originaleveryStoreyData.data[e.target.id]) - }); - startMarker.on('dragend', (e) => { - // console.log('拖拽完成', e) - this.canvasData.isChange = true - this.clickId = e.target.id - this.canvasData.originaleveryStoreyData.data[e.target.id].Point = { x: e.lnglat.lng, y: e.lnglat.lat } - }); - - //将图标数据添加 - let itemData = JSON.parse(JSON.stringify(this.selectImage)) - itemData.id = id - itemData.point = { x: e.lnglat.lng, y: e.lnglat.lat } - itemData.floorId = this.selectingSitePlan.id - itemData = this.canvasData.deserialize(JSON.stringify(itemData))//反序列化为大写 - // 添加楼层数据 - this.canvasData.originaleveryStoreyData.data[id] = itemData; - // 添加建筑数据 - this.canvasData.originalcompanyBuildingData.data[id] = itemData; - console.log('originalcompanyBuildingData', this.canvasData.originalcompanyBuildingData) - console.log('originaleveryStoreyData', this.canvasData.originaleveryStoreyData) - - //将marker点添加 - this.planDataMarkers.push(startMarker) - this.map.add(startMarker); - - } - - - //查找 数据节点 对应 建筑/楼层 - seekPanelPoint(paramsData) { - this.checkedBuildingIndex = paramsData.buildingIndex - if (paramsData.buildingIndex == -1) { //总平面图时 - // console.log('走了1') - this.beforeOneCheckedBuilding = { name: "总平面图" } - let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素 - let planData = this.getSitePlanCompanyData() //获取 单位 数据 - this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { - this.sitePlanData = data - let index = this.sitePlanData.findIndex(item => { return item.id === paramsData.storeyId }) - this.selectingSitePlan = this.sitePlanData[index] || {} - this.canvasData.selectStorey = this.sitePlanData[index] || {} //服务中 存一份数据 - this.selectSitePlanIndex = index - Promise.all([fireData, planData]).then((res) => { - this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 - }) - }) //get - } else { //建筑时 - // console.log('走了2') - // console.log('allBuildings', this.allBuildings) - // console.log('paramsData', paramsData) - this.beforeOneCheckedBuilding = this.allBuildings[paramsData.buildingIndex] - let params = { buildingId: this.beforeOneCheckedBuilding.id } - let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素 - let planData = this.getBuildingData(params) //获取 建筑 数据 - this.http.get('/api/BuildingAreas', { params }).subscribe(data => { - // console.log('BuildingAreas', data) - this.sitePlanData = data - let index = this.sitePlanData.findIndex(item => { return item.id === paramsData.storeyId }) - this.selectingSitePlan = this.sitePlanData[index] || {} - this.canvasData.selectStorey = this.sitePlanData[index] || {} //服务中 存一份数据 - this.selectSitePlanIndex = index - - Promise.all([fireData, planData]).then((res) => { - this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 - }) - }) //get + + //查找 数据节点 对应 建筑/楼层 + seekPanelPoint(paramsData) { + this.checkedBuildingIndex = paramsData.buildingIndex + if (paramsData.buildingIndex == -1) { //总平面图时 + this.beforeOneCheckedBuilding = { name: "总平面图" } + let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素 + let planData = this.getSitePlanCompanyData() //获取 单位 数据 + this.http.get('/api/SitePlans', { params: this.params }).subscribe(data => { + this.sitePlanData = data + let index = this.sitePlanData.findIndex(item => { return item.id === paramsData.storeyId }) + this.selectingSitePlan = this.sitePlanData[index] || {} + this.canvasData.selectStorey = this.sitePlanData[index] || {} //服务中 存一份数据 + this.selectSitePlanIndex = index + + Promise.all([fireData, planData]).then((res) => { + this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 + }) + }) //get + } else { //建筑时 + this.beforeOneCheckedBuilding = this.allBuildings[paramsData.buildingIndex] + let params = { buildingId: this.beforeOneCheckedBuilding.id } + let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素 + let planData = this.getBuildingData(params) //获取 建筑 数据 + this.http.get('/api/BuildingAreas', { params }).subscribe(data => { + this.sitePlanData = data + let index = this.sitePlanData.findIndex(item => { return item.id === paramsData.storeyId }) + this.selectingSitePlan = this.sitePlanData[index] || {} + this.canvasData.selectStorey = this.sitePlanData[index] || {} //服务中 存一份数据 + this.selectSitePlanIndex = index + + Promise.all([fireData, planData]).then((res) => { + this.getBuildingStorey(this.selectingSitePlan) //获取 建筑 楼层数据 + }) + }) //get + } } - } @@ -2344,107 +2633,107 @@ export class CollectionToolsPlanComponent implements OnInit { //创建建筑 @Component({ - selector: 'app-createBuilding-plan', - templateUrl: './createBuilding.html', - styleUrls: ['./collection-tools.component.scss'] + selector: 'app-createBuilding-plan', + templateUrl: './createBuilding.html', + styleUrls: ['./collection-tools.component.scss'] }) export class CreateBuildingPlan { - constructor(private http: HttpClient, public dialog: MatDialog, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data) { } - - allBuildingType: any//所有的建筑类型 - selected: any; //选中的建筑 - ngOnInit(): void { - this.getAllBuildingType() - } - - //获得所有单位类型 - getAllBuildingType() { - this.http.get("/api/BuildingTypes/Simple").subscribe(data => { - this.allBuildingType = data - }) - } - - //创建建筑功能分区 - onSubmit(e) { - let companyId = sessionStorage.getItem("companyId") - let lastBuildingOrder = this.data.allBuildings.length != 0 ? this.data.allBuildings[this.data.allBuildings.length - 1].order + 1 : 0 - let data = - { - id: "", - name: e.propertyName, - order: lastBuildingOrder, - enabled: true, - companyId: companyId, - buildingTypes: [ + constructor(private http: HttpClient, public dialog: MatDialog, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data) { } + + allBuildingType: any//所有的建筑类型 + selected: any; //选中的建筑 + ngOnInit(): void { + this.getAllBuildingType() + } + + //获得所有单位类型 + getAllBuildingType() { + this.http.get("/api/BuildingTypes/Simple").subscribe(data => { + this.allBuildingType = data + }) + } + + //创建建筑功能分区 + onSubmit(e) { + let companyId = sessionStorage.getItem("companyId") + let lastBuildingOrder = this.data.allBuildings.length != 0 ? this.data.allBuildings[this.data.allBuildings.length - 1].order + 1 : 0 + let data = { - id: e.buildingId, - name: "" + id: "", + name: e.propertyName, + order: lastBuildingOrder, + enabled: true, + companyId: companyId, + buildingTypes: [ + { + id: e.buildingId, + name: "" + } + ] } - ] + this.http.post("/api/Buildings", data, { + params: { + companyId: this.data.companyId + } + }).subscribe(data => { + this.dialogRef.close("创建成功"); + }, err => { + this.dialogRef.close("创建失败"); + }) } - this.http.post("/api/Buildings", data, { - params: { - companyId: this.data.companyId - } - }).subscribe(data => { - this.dialogRef.close("创建成功"); - }, err => { - this.dialogRef.close("创建失败"); - }) - } } //编辑建筑 @Component({ - selector: 'app-editBuilding-plan', - templateUrl: './editBuilding.html', - styleUrls: ['./collection-tools.component.scss'] + selector: 'app-editBuilding-plan', + templateUrl: './editBuilding.html', + styleUrls: ['./collection-tools.component.scss'] }) export class EditBuildingPlan { - constructor(private http: HttpClient, public dialog: MatDialog, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data) { } - - defaultName: String = this.data.item.name//默认建筑名称 - defaultBuildingType: String = this.data.item.buildingTypes[0].id//默认建筑类型 - allBuildingType: any//所有的建筑类型 - - ngOnInit(): void { - this.getAllBuildingType() - } - - getAllBuildingType() { - this.http.get("/api/BuildingTypes/Simple").subscribe(data => { - this.allBuildingType = data - }) - } - - //编辑建筑信息 - onSubmit(e) { - let companyId = sessionStorage.getItem("companyId") - let data = - { - id: this.data.item.id, - name: e.propertyName, - order: this.data.item.order, - enabled: true, - companyId: companyId, - buildingTypes: [ + constructor(private http: HttpClient, public dialog: MatDialog, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data) { } + + defaultName: String = this.data.item.name//默认建筑名称 + defaultBuildingType: String = this.data.item.buildingTypes[0].id//默认建筑类型 + allBuildingType: any//所有的建筑类型 + + ngOnInit(): void { + this.getAllBuildingType() + } + + getAllBuildingType() { + this.http.get("/api/BuildingTypes/Simple").subscribe(data => { + this.allBuildingType = data + }) + } + + //编辑建筑信息 + onSubmit(e) { + let companyId = sessionStorage.getItem("companyId") + let data = { - id: e.buildingId, - name: "" + id: this.data.item.id, + name: e.propertyName, + order: this.data.item.order, + enabled: true, + companyId: companyId, + buildingTypes: [ + { + id: e.buildingId, + name: "" + } + ] } - ] + this.http.put(`/api/Buildings/${this.data.item.id}`, data, { + params: { + id: this.data.item.id, + companyId: companyId + } + }).subscribe(data => { + this.dialogRef.close("修改成功"); + }, err => { + this.dialogRef.close("修改失败"); + }) } - this.http.put(`/api/Buildings/${this.data.item.id}`, data, { - params: { - id: this.data.item.id, - companyId: companyId - } - }).subscribe(data => { - this.dialogRef.close("修改成功"); - }, err => { - this.dialogRef.close("修改失败"); - }) - } } diff --git a/src/app/working-area/model/axImageShape.ts b/src/app/working-area/model/axImageShape.ts index ddb7ccf..8a757f1 100644 --- a/src/app/working-area/model/axImageShape.ts +++ b/src/app/working-area/model/axImageShape.ts @@ -236,7 +236,7 @@ export class AxImageShape extends AxShape { if (this.rightDrag) { this.rightDrag = false; this.image.anchor.set(0.5); - this.image.position.set(this.image.position.x + (this.image.width / 2)); + this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y); } }); this.right.visible = false; diff --git a/src/app/working-area/model/axShape.ts b/src/app/working-area/model/axShape.ts index 85ab02c..7675dae 100644 --- a/src/app/working-area/model/axShape.ts +++ b/src/app/working-area/model/axShape.ts @@ -42,7 +42,7 @@ export class AxShape extends Graphics { } if (this.allowEdit) { this.mouseDragging = true; - this.mousePosition = new PIXI.Point(event.data.global.x, event.data.global.y); + this.mousePosition = event.data.getLocalPosition(this.workingArea.backgroundImage); } }) .on('pointerup', event => { @@ -53,15 +53,26 @@ export class AxShape extends Graphics { }) .on('pointermove', event => { if (this.mouseDragging) { + // const newPosition = event.data.getLocalPosition(this.workingArea.backgroundImage); + // const x = newPosition.x - this.x; + // const y = newPosition.y - this.y; + // this.workingArea.selection.all().forEach(item => { + // item.x += x; + // item.y += y; + // item.assetData.Point = new PIXI.Point(item.x, item.y); + // this.workingArea.canvasData.isChange = true; + // }); + + const newPosition = event.data.getLocalPosition(this.workingArea.backgroundImage); + const offsetX = newPosition.x - this.mousePosition.x; + const offsetY = newPosition.y - this.mousePosition.y; this.workingArea.selection.all().forEach(item => { - const x = event.data.global.x - this.mousePosition.x; - const y = event.data.global.y - this.mousePosition.y; - item.x += x * (1 / this.workingArea.camera2D.scale.x); - item.y += y * (1 / this.workingArea.camera2D.scale.y); + item.x += offsetX; + item.y += offsetY; item.assetData.Point = new PIXI.Point(item.x, item.y); this.workingArea.canvasData.isChange = true; }); - this.mousePosition = new PIXI.Point(event.data.global.x, event.data.global.y); + this.mousePosition = newPosition; } }) .on('rightclick', event => { diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index c453ce9..e784d80 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -175,7 +175,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 重大调整-主版本号增加 * 日期变更-日期版本号增加 */ - public VERSION = '1.5.0.20210507_rc'; + public VERSION = '1.5.1.20210715'; /** * 数据初始化 */ @@ -641,7 +641,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 重置画布 */ public resetCanvas() { - if(!this.init.isGis){ + if (!this.init.isGis) { this.app.renderer.resize(this.content.nativeElement.clientWidth, this.content.nativeElement.clientHeight); } } diff --git a/src/assets/kmap/Kmap.config.json b/src/assets/kmap/Kmap.config.json new file mode 100644 index 0000000..1771641 --- /dev/null +++ b/src/assets/kmap/Kmap.config.json @@ -0,0 +1,13 @@ +{ + "DIST_URL": "./kmap-service-main-kd.js", + "TOKEN": "E203F172F1A54CD5B3CEDD107B8F4E43", + "CT_SERVER_URL": "https://10.14.183.81", + + "USERMNG_SERVER": "", + "SEARCH_SERVER": "", + "WS_SERVER": "", + "ROUTING_SERVER": "", + "STORAGE_SERVER": "", + "COORDINATETYPE": "", + "INDOOR_MAP_MAX_ZOOM": 24 +} \ No newline at end of file diff --git a/src/assets/kmap/kmap-service-main-kd.js b/src/assets/kmap/kmap-service-main-kd.js new file mode 100644 index 0000000..c2a92fe --- /dev/null +++ b/src/assets/kmap/kmap-service-main-kd.js @@ -0,0 +1,81 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.KMap=e():t.KMap=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="kmap/",r(r.s=809)}([function(t,e,r){"use strict";var n=r(50),i=r.n(n),o=r(3),a=r.n(o),s=r(4),u=r.n(s),c=r(12),l=r.n(c),h=r(13),p=r.n(h),d=r(10),f=r.n(d),g=r(104),m=r.n(g),y=r(145),v=r.n(y);function A(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return p()(this,r)}}var _=function(t){l()(r,t);var e=A(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,null,[{key:"toString",value:function(){return"function Point() { [custom class Point] }"}},{key:"validate",value:function(t){var e=!1;if(Array.isArray(t)&&2===t.length){var r=t[0],n=t[1];if("number"!=typeof r||"number"!=typeof n)return e;e=r>=-180&&r<=180&&n>=-90&&n<=90}return e}}]),r}(m()(Array)),b=function(t){l()(r,t);var e=A(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,null,[{key:"toString",value:function(){return"function Unit() { [ custom class Unit ] }"}},{key:"validate",value:function(t){return new RegExp(/^(kilometers|meters|miles)$/).test(t)}}]),r}(m()(String)),x=function(t){l()(r,t);var e=A(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,null,[{key:"toString",value:function(){return"function Bound() { [ custom class Bound ] }"}},{key:"validate",value:function(t){var e="FAILURE",r=e;if(Array.isArray(t))for(var n=0;n=0&&t<=255}var P=function(t){l()(r,t);var e=A(r);function r(){return a()(this,r),e.apply(this,arguments)}return u()(r,[{key:"isInNumberScope",value:function(t){return t>=0&&t<=255}},{key:"isInFloatNumberScope",value:function(t){return t>=0&&t<=1}}],[{key:"toString",value:function(){return"function Color() { [ custom class Color ] }"}},{key:"validate",value:function(t){var e,r=/^rgb\((\d{1,3}),[ ]*(\d{1,3}),[ ]*(\d{1,3})\)$/,n=/^rgba\((\d{1,3}),[ ]*(\d{1,3}),[ ]*(\d{1,3}),[ ]*(0\.[1-9]|1)\)$/;if(t.indexOf("rgb")>=0&&r.test(t)){var i=+t.match(r)[1],o=+t.match(r)[2],a=+t.match(r)[3];if(T(i)&&T(o)&&T(a))return!0}if(t.indexOf("rgba")>=0&&n.test(t)){var s=+t.match(n)[1],u=+t.match(n)[2],c=+t.match(n)[3],l=+t.match(n)[4];if(T(s)&&T(u)&&T(c)&&((e=l)>=0&&e<=1))return!0}return!!(t.indexOf("#")>=0&&/^#(([a-f|A-F|0-9]{3})|([a-f|A-F|0-9]{6}))$/.test(t))}}]),r}(m()(String));e.a={Color:P,Point:_,Unit:b,Bound:x,ArrayPoint:w,DOM:C,String:String,Number:Number,Boolean:Boolean,Object:Object,Array:Array,Symbol:Symbol,Function:Function,GeoJSON:I,CustomDate:M,PolygonArr:S,Polygon:E}},function(t,e,r){"use strict";var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s={kedamap:!0,map:!0,userConfig:!0,config:!0,_kmap:!0,mapType:!0,spriteManager:!0,heatmapCollect:!0,relationMapCollect:!0,layerCollect:!0,modules:!0,spriteJSON:!0,spriteImageEle:!0,modulesStore:!0,isolines:!0,poiLayers:!0,visualCollect:!0,oppFun:!0,timerDevice:!0,kdIndex:!0,swipeMap:!0,LinkedMap:!0,ContextMenu:!0,locale:!0};e.a=new(function(){function t(){return i()(this,t),this.mapStore=this.mapStore||new Map,t.instance||(t.instance=this),t.instance}return a()(t,[{key:"setProps",value:function(t,e,r){if(s[e]){var n=this.mapStore.get(t)||{};n[e]=r,this.mapStore.set(t,n)}else console.error("为避免滥用,仅mapCacheConstKeys中的key可以被赋值")}},{key:"getProps",value:function(t,e){return(this.mapStore.get(t)||{})[e]}}]),t}())},function(t,e,r){"use strict";var n=r(374);r.o(n,"ConversionUtil")&&r.d(e,"ConversionUtil",(function(){return n.ConversionUtil})),r.o(n,"GeometryUtil")&&r.d(e,"GeometryUtil",(function(){return n.GeometryUtil})),r.o(n,"Queue")&&r.d(e,"Queue",(function(){return n.Queue})),r.o(n,"StompSocket")&&r.d(e,"StompSocket",(function(){return n.StompSocket})),r.o(n,"arrayIndexOf")&&r.d(e,"arrayIndexOf",(function(){return n.arrayIndexOf})),r.o(n,"arrayLength")&&r.d(e,"arrayLength",(function(){return n.arrayLength})),r.o(n,"arrayPush")&&r.d(e,"arrayPush",(function(){return n.arrayPush})),r.o(n,"arraySplice")&&r.d(e,"arraySplice",(function(){return n.arraySplice})),r.o(n,"bindAll")&&r.d(e,"bindAll",(function(){return n.bindAll})),r.o(n,"buildEmptyFeatureCollection")&&r.d(e,"buildEmptyFeatureCollection",(function(){return n.buildEmptyFeatureCollection})),r.o(n,"createDivElement")&&r.d(e,"createDivElement",(function(){return n.createDivElement})),r.o(n,"dateParse")&&r.d(e,"dateParse",(function(){return n.dateParse})),r.o(n,"domClass")&&r.d(e,"domClass",(function(){return n.domClass})),r.o(n,"domContent")&&r.d(e,"domContent",(function(){return n.domContent})),r.o(n,"domInsert")&&r.d(e,"domInsert",(function(){return n.domInsert})),r.o(n,"domStyle")&&r.d(e,"domStyle",(function(){return n.domStyle})),r.o(n,"domText")&&r.d(e,"domText",(function(){return n.domText})),r.o(n,"extend")&&r.d(e,"extend",(function(){return n.extend})),r.o(n,"formatScope")&&r.d(e,"formatScope",(function(){return n.formatScope})),r.o(n,"guid")&&r.d(e,"guid",(function(){return n.guid})),r.o(n,"inArray")&&r.d(e,"inArray",(function(){return n.inArray})),r.o(n,"isArray")&&r.d(e,"isArray",(function(){return n.isArray})),r.o(n,"isBoolean")&&r.d(e,"isBoolean",(function(){return n.isBoolean})),r.o(n,"isDef")&&r.d(e,"isDef",(function(){return n.isDef})),r.o(n,"isFalse")&&r.d(e,"isFalse",(function(){return n.isFalse})),r.o(n,"isFunction")&&r.d(e,"isFunction",(function(){return n.isFunction})),r.o(n,"isNumber")&&r.d(e,"isNumber",(function(){return n.isNumber})),r.o(n,"isOffset")&&r.d(e,"isOffset",(function(){return n.isOffset})),r.o(n,"isString")&&r.d(e,"isString",(function(){return n.isString})),r.o(n,"isTrue")&&r.d(e,"isTrue",(function(){return n.isTrue})),r.o(n,"isUndef")&&r.d(e,"isUndef",(function(){return n.isUndef})),r.o(n,"jsonParse")&&r.d(e,"jsonParse",(function(){return n.jsonParse})),r.o(n,"jsonStringify")&&r.d(e,"jsonStringify",(function(){return n.jsonStringify})),r.o(n,"matchFilterable")&&r.d(e,"matchFilterable",(function(){return n.matchFilterable})),r.o(n,"packageFeaturesToCollection")&&r.d(e,"packageFeaturesToCollection",(function(){return n.packageFeaturesToCollection})),r.o(n,"requestFrame")&&r.d(e,"requestFrame",(function(){return n.requestFrame})),r.o(n,"transformCustomFilterToMapboxFilter")&&r.d(e,"transformCustomFilterToMapboxFilter",(function(){return n.transformCustomFilterToMapboxFilter})),r.o(n,"turf")&&r.d(e,"turf",(function(){return n.turf})),r.o(n,"unfilterMapboxExpression")&&r.d(e,"unfilterMapboxExpression",(function(){return n.unfilterMapboxExpression})),r.o(n,"warn")&&r.d(e,"warn",(function(){return n.warn})),r.o(n,"xhr")&&r.d(e,"xhr",(function(){return n.xhr}));var i=r(375);r.o(i,"ConversionUtil")&&r.d(e,"ConversionUtil",(function(){return i.ConversionUtil})),r.o(i,"GeometryUtil")&&r.d(e,"GeometryUtil",(function(){return i.GeometryUtil})),r.o(i,"Queue")&&r.d(e,"Queue",(function(){return i.Queue})),r.o(i,"StompSocket")&&r.d(e,"StompSocket",(function(){return i.StompSocket})),r.o(i,"arrayIndexOf")&&r.d(e,"arrayIndexOf",(function(){return i.arrayIndexOf})),r.o(i,"arrayLength")&&r.d(e,"arrayLength",(function(){return i.arrayLength})),r.o(i,"arrayPush")&&r.d(e,"arrayPush",(function(){return i.arrayPush})),r.o(i,"arraySplice")&&r.d(e,"arraySplice",(function(){return i.arraySplice})),r.o(i,"bindAll")&&r.d(e,"bindAll",(function(){return i.bindAll})),r.o(i,"buildEmptyFeatureCollection")&&r.d(e,"buildEmptyFeatureCollection",(function(){return i.buildEmptyFeatureCollection})),r.o(i,"createDivElement")&&r.d(e,"createDivElement",(function(){return i.createDivElement})),r.o(i,"dateParse")&&r.d(e,"dateParse",(function(){return i.dateParse})),r.o(i,"domClass")&&r.d(e,"domClass",(function(){return i.domClass})),r.o(i,"domContent")&&r.d(e,"domContent",(function(){return i.domContent})),r.o(i,"domInsert")&&r.d(e,"domInsert",(function(){return i.domInsert})),r.o(i,"domStyle")&&r.d(e,"domStyle",(function(){return i.domStyle})),r.o(i,"domText")&&r.d(e,"domText",(function(){return i.domText})),r.o(i,"extend")&&r.d(e,"extend",(function(){return i.extend})),r.o(i,"formatScope")&&r.d(e,"formatScope",(function(){return i.formatScope})),r.o(i,"guid")&&r.d(e,"guid",(function(){return i.guid})),r.o(i,"inArray")&&r.d(e,"inArray",(function(){return i.inArray})),r.o(i,"isArray")&&r.d(e,"isArray",(function(){return i.isArray})),r.o(i,"isBoolean")&&r.d(e,"isBoolean",(function(){return i.isBoolean})),r.o(i,"isDef")&&r.d(e,"isDef",(function(){return i.isDef})),r.o(i,"isFalse")&&r.d(e,"isFalse",(function(){return i.isFalse})),r.o(i,"isFunction")&&r.d(e,"isFunction",(function(){return i.isFunction})),r.o(i,"isNumber")&&r.d(e,"isNumber",(function(){return i.isNumber})),r.o(i,"isOffset")&&r.d(e,"isOffset",(function(){return i.isOffset})),r.o(i,"isString")&&r.d(e,"isString",(function(){return i.isString})),r.o(i,"isTrue")&&r.d(e,"isTrue",(function(){return i.isTrue})),r.o(i,"isUndef")&&r.d(e,"isUndef",(function(){return i.isUndef})),r.o(i,"jsonParse")&&r.d(e,"jsonParse",(function(){return i.jsonParse})),r.o(i,"jsonStringify")&&r.d(e,"jsonStringify",(function(){return i.jsonStringify})),r.o(i,"matchFilterable")&&r.d(e,"matchFilterable",(function(){return i.matchFilterable})),r.o(i,"packageFeaturesToCollection")&&r.d(e,"packageFeaturesToCollection",(function(){return i.packageFeaturesToCollection})),r.o(i,"requestFrame")&&r.d(e,"requestFrame",(function(){return i.requestFrame})),r.o(i,"transformCustomFilterToMapboxFilter")&&r.d(e,"transformCustomFilterToMapboxFilter",(function(){return i.transformCustomFilterToMapboxFilter})),r.o(i,"turf")&&r.d(e,"turf",(function(){return i.turf})),r.o(i,"unfilterMapboxExpression")&&r.d(e,"unfilterMapboxExpression",(function(){return i.unfilterMapboxExpression})),r.o(i,"warn")&&r.d(e,"warn",(function(){return i.warn})),r.o(i,"xhr")&&r.d(e,"xhr",(function(){return i.xhr}));var o=r(376);r.o(o,"ConversionUtil")&&r.d(e,"ConversionUtil",(function(){return o.ConversionUtil})),r.o(o,"GeometryUtil")&&r.d(e,"GeometryUtil",(function(){return o.GeometryUtil})),r.o(o,"Queue")&&r.d(e,"Queue",(function(){return o.Queue})),r.o(o,"StompSocket")&&r.d(e,"StompSocket",(function(){return o.StompSocket})),r.o(o,"arrayIndexOf")&&r.d(e,"arrayIndexOf",(function(){return o.arrayIndexOf})),r.o(o,"arrayLength")&&r.d(e,"arrayLength",(function(){return o.arrayLength})),r.o(o,"arrayPush")&&r.d(e,"arrayPush",(function(){return o.arrayPush})),r.o(o,"arraySplice")&&r.d(e,"arraySplice",(function(){return o.arraySplice})),r.o(o,"bindAll")&&r.d(e,"bindAll",(function(){return o.bindAll})),r.o(o,"buildEmptyFeatureCollection")&&r.d(e,"buildEmptyFeatureCollection",(function(){return o.buildEmptyFeatureCollection})),r.o(o,"createDivElement")&&r.d(e,"createDivElement",(function(){return o.createDivElement})),r.o(o,"dateParse")&&r.d(e,"dateParse",(function(){return o.dateParse})),r.o(o,"domClass")&&r.d(e,"domClass",(function(){return o.domClass})),r.o(o,"domContent")&&r.d(e,"domContent",(function(){return o.domContent})),r.o(o,"domInsert")&&r.d(e,"domInsert",(function(){return o.domInsert})),r.o(o,"domStyle")&&r.d(e,"domStyle",(function(){return o.domStyle})),r.o(o,"domText")&&r.d(e,"domText",(function(){return o.domText})),r.o(o,"extend")&&r.d(e,"extend",(function(){return o.extend})),r.o(o,"formatScope")&&r.d(e,"formatScope",(function(){return o.formatScope})),r.o(o,"guid")&&r.d(e,"guid",(function(){return o.guid})),r.o(o,"inArray")&&r.d(e,"inArray",(function(){return o.inArray})),r.o(o,"isArray")&&r.d(e,"isArray",(function(){return o.isArray})),r.o(o,"isBoolean")&&r.d(e,"isBoolean",(function(){return o.isBoolean})),r.o(o,"isDef")&&r.d(e,"isDef",(function(){return o.isDef})),r.o(o,"isFalse")&&r.d(e,"isFalse",(function(){return o.isFalse})),r.o(o,"isFunction")&&r.d(e,"isFunction",(function(){return o.isFunction})),r.o(o,"isNumber")&&r.d(e,"isNumber",(function(){return o.isNumber})),r.o(o,"isOffset")&&r.d(e,"isOffset",(function(){return o.isOffset})),r.o(o,"isString")&&r.d(e,"isString",(function(){return o.isString})),r.o(o,"isTrue")&&r.d(e,"isTrue",(function(){return o.isTrue})),r.o(o,"isUndef")&&r.d(e,"isUndef",(function(){return o.isUndef})),r.o(o,"jsonParse")&&r.d(e,"jsonParse",(function(){return o.jsonParse})),r.o(o,"jsonStringify")&&r.d(e,"jsonStringify",(function(){return o.jsonStringify})),r.o(o,"matchFilterable")&&r.d(e,"matchFilterable",(function(){return o.matchFilterable})),r.o(o,"packageFeaturesToCollection")&&r.d(e,"packageFeaturesToCollection",(function(){return o.packageFeaturesToCollection})),r.o(o,"requestFrame")&&r.d(e,"requestFrame",(function(){return o.requestFrame})),r.o(o,"transformCustomFilterToMapboxFilter")&&r.d(e,"transformCustomFilterToMapboxFilter",(function(){return o.transformCustomFilterToMapboxFilter})),r.o(o,"turf")&&r.d(e,"turf",(function(){return o.turf})),r.o(o,"unfilterMapboxExpression")&&r.d(e,"unfilterMapboxExpression",(function(){return o.unfilterMapboxExpression})),r.o(o,"warn")&&r.d(e,"warn",(function(){return o.warn})),r.o(o,"xhr")&&r.d(e,"xhr",(function(){return o.xhr}));var a=r(377);r.o(a,"ConversionUtil")&&r.d(e,"ConversionUtil",(function(){return a.ConversionUtil})),r.o(a,"GeometryUtil")&&r.d(e,"GeometryUtil",(function(){return a.GeometryUtil})),r.o(a,"Queue")&&r.d(e,"Queue",(function(){return a.Queue})),r.o(a,"StompSocket")&&r.d(e,"StompSocket",(function(){return a.StompSocket})),r.o(a,"arrayIndexOf")&&r.d(e,"arrayIndexOf",(function(){return a.arrayIndexOf})),r.o(a,"arrayLength")&&r.d(e,"arrayLength",(function(){return a.arrayLength})),r.o(a,"arrayPush")&&r.d(e,"arrayPush",(function(){return a.arrayPush})),r.o(a,"arraySplice")&&r.d(e,"arraySplice",(function(){return a.arraySplice})),r.o(a,"bindAll")&&r.d(e,"bindAll",(function(){return a.bindAll})),r.o(a,"buildEmptyFeatureCollection")&&r.d(e,"buildEmptyFeatureCollection",(function(){return a.buildEmptyFeatureCollection})),r.o(a,"createDivElement")&&r.d(e,"createDivElement",(function(){return a.createDivElement})),r.o(a,"dateParse")&&r.d(e,"dateParse",(function(){return a.dateParse})),r.o(a,"domClass")&&r.d(e,"domClass",(function(){return a.domClass})),r.o(a,"domContent")&&r.d(e,"domContent",(function(){return a.domContent})),r.o(a,"domInsert")&&r.d(e,"domInsert",(function(){return a.domInsert})),r.o(a,"domStyle")&&r.d(e,"domStyle",(function(){return a.domStyle})),r.o(a,"domText")&&r.d(e,"domText",(function(){return a.domText})),r.o(a,"extend")&&r.d(e,"extend",(function(){return a.extend})),r.o(a,"formatScope")&&r.d(e,"formatScope",(function(){return a.formatScope})),r.o(a,"guid")&&r.d(e,"guid",(function(){return a.guid})),r.o(a,"inArray")&&r.d(e,"inArray",(function(){return a.inArray})),r.o(a,"isArray")&&r.d(e,"isArray",(function(){return a.isArray})),r.o(a,"isBoolean")&&r.d(e,"isBoolean",(function(){return a.isBoolean})),r.o(a,"isDef")&&r.d(e,"isDef",(function(){return a.isDef})),r.o(a,"isFalse")&&r.d(e,"isFalse",(function(){return a.isFalse})),r.o(a,"isFunction")&&r.d(e,"isFunction",(function(){return a.isFunction})),r.o(a,"isNumber")&&r.d(e,"isNumber",(function(){return a.isNumber})),r.o(a,"isOffset")&&r.d(e,"isOffset",(function(){return a.isOffset})),r.o(a,"isString")&&r.d(e,"isString",(function(){return a.isString})),r.o(a,"isTrue")&&r.d(e,"isTrue",(function(){return a.isTrue})),r.o(a,"isUndef")&&r.d(e,"isUndef",(function(){return a.isUndef})),r.o(a,"jsonParse")&&r.d(e,"jsonParse",(function(){return a.jsonParse})),r.o(a,"jsonStringify")&&r.d(e,"jsonStringify",(function(){return a.jsonStringify})),r.o(a,"matchFilterable")&&r.d(e,"matchFilterable",(function(){return a.matchFilterable})),r.o(a,"packageFeaturesToCollection")&&r.d(e,"packageFeaturesToCollection",(function(){return a.packageFeaturesToCollection})),r.o(a,"requestFrame")&&r.d(e,"requestFrame",(function(){return a.requestFrame})),r.o(a,"transformCustomFilterToMapboxFilter")&&r.d(e,"transformCustomFilterToMapboxFilter",(function(){return a.transformCustomFilterToMapboxFilter})),r.o(a,"turf")&&r.d(e,"turf",(function(){return a.turf})),r.o(a,"unfilterMapboxExpression")&&r.d(e,"unfilterMapboxExpression",(function(){return a.unfilterMapboxExpression})),r.o(a,"warn")&&r.d(e,"warn",(function(){return a.warn})),r.o(a,"xhr")&&r.d(e,"xhr",(function(){return a.xhr}));var s=r(378);r.o(s,"ConversionUtil")&&r.d(e,"ConversionUtil",(function(){return s.ConversionUtil})),r.o(s,"GeometryUtil")&&r.d(e,"GeometryUtil",(function(){return s.GeometryUtil})),r.o(s,"Queue")&&r.d(e,"Queue",(function(){return s.Queue})),r.o(s,"StompSocket")&&r.d(e,"StompSocket",(function(){return s.StompSocket})),r.o(s,"arrayIndexOf")&&r.d(e,"arrayIndexOf",(function(){return s.arrayIndexOf})),r.o(s,"arrayLength")&&r.d(e,"arrayLength",(function(){return s.arrayLength})),r.o(s,"arrayPush")&&r.d(e,"arrayPush",(function(){return s.arrayPush})),r.o(s,"arraySplice")&&r.d(e,"arraySplice",(function(){return s.arraySplice})),r.o(s,"bindAll")&&r.d(e,"bindAll",(function(){return s.bindAll})),r.o(s,"buildEmptyFeatureCollection")&&r.d(e,"buildEmptyFeatureCollection",(function(){return s.buildEmptyFeatureCollection})),r.o(s,"createDivElement")&&r.d(e,"createDivElement",(function(){return s.createDivElement})),r.o(s,"dateParse")&&r.d(e,"dateParse",(function(){return s.dateParse})),r.o(s,"domClass")&&r.d(e,"domClass",(function(){return s.domClass})),r.o(s,"domContent")&&r.d(e,"domContent",(function(){return s.domContent})),r.o(s,"domInsert")&&r.d(e,"domInsert",(function(){return s.domInsert})),r.o(s,"domStyle")&&r.d(e,"domStyle",(function(){return s.domStyle})),r.o(s,"domText")&&r.d(e,"domText",(function(){return s.domText})),r.o(s,"extend")&&r.d(e,"extend",(function(){return s.extend})),r.o(s,"formatScope")&&r.d(e,"formatScope",(function(){return s.formatScope})),r.o(s,"guid")&&r.d(e,"guid",(function(){return s.guid})),r.o(s,"inArray")&&r.d(e,"inArray",(function(){return s.inArray})),r.o(s,"isArray")&&r.d(e,"isArray",(function(){return s.isArray})),r.o(s,"isBoolean")&&r.d(e,"isBoolean",(function(){return s.isBoolean})),r.o(s,"isDef")&&r.d(e,"isDef",(function(){return s.isDef})),r.o(s,"isFalse")&&r.d(e,"isFalse",(function(){return s.isFalse})),r.o(s,"isFunction")&&r.d(e,"isFunction",(function(){return s.isFunction})),r.o(s,"isNumber")&&r.d(e,"isNumber",(function(){return s.isNumber})),r.o(s,"isOffset")&&r.d(e,"isOffset",(function(){return s.isOffset})),r.o(s,"isString")&&r.d(e,"isString",(function(){return s.isString})),r.o(s,"isTrue")&&r.d(e,"isTrue",(function(){return s.isTrue})),r.o(s,"isUndef")&&r.d(e,"isUndef",(function(){return s.isUndef})),r.o(s,"jsonParse")&&r.d(e,"jsonParse",(function(){return s.jsonParse})),r.o(s,"jsonStringify")&&r.d(e,"jsonStringify",(function(){return s.jsonStringify})),r.o(s,"matchFilterable")&&r.d(e,"matchFilterable",(function(){return s.matchFilterable})),r.o(s,"packageFeaturesToCollection")&&r.d(e,"packageFeaturesToCollection",(function(){return s.packageFeaturesToCollection})),r.o(s,"requestFrame")&&r.d(e,"requestFrame",(function(){return s.requestFrame})),r.o(s,"transformCustomFilterToMapboxFilter")&&r.d(e,"transformCustomFilterToMapboxFilter",(function(){return s.transformCustomFilterToMapboxFilter})),r.o(s,"turf")&&r.d(e,"turf",(function(){return s.turf})),r.o(s,"unfilterMapboxExpression")&&r.d(e,"unfilterMapboxExpression",(function(){return s.unfilterMapboxExpression})),r.o(s,"warn")&&r.d(e,"warn",(function(){return s.warn})),r.o(s,"xhr")&&r.d(e,"xhr",(function(){return s.xhr}));var u=r(379);r.o(u,"ConversionUtil")&&r.d(e,"ConversionUtil",(function(){return u.ConversionUtil})),r.o(u,"GeometryUtil")&&r.d(e,"GeometryUtil",(function(){return u.GeometryUtil})),r.o(u,"Queue")&&r.d(e,"Queue",(function(){return u.Queue})),r.o(u,"StompSocket")&&r.d(e,"StompSocket",(function(){return u.StompSocket})),r.o(u,"arrayIndexOf")&&r.d(e,"arrayIndexOf",(function(){return u.arrayIndexOf})),r.o(u,"arrayLength")&&r.d(e,"arrayLength",(function(){return u.arrayLength})),r.o(u,"arrayPush")&&r.d(e,"arrayPush",(function(){return u.arrayPush})),r.o(u,"arraySplice")&&r.d(e,"arraySplice",(function(){return u.arraySplice})),r.o(u,"bindAll")&&r.d(e,"bindAll",(function(){return u.bindAll})),r.o(u,"buildEmptyFeatureCollection")&&r.d(e,"buildEmptyFeatureCollection",(function(){return u.buildEmptyFeatureCollection})),r.o(u,"createDivElement")&&r.d(e,"createDivElement",(function(){return u.createDivElement})),r.o(u,"dateParse")&&r.d(e,"dateParse",(function(){return u.dateParse})),r.o(u,"domClass")&&r.d(e,"domClass",(function(){return u.domClass})),r.o(u,"domContent")&&r.d(e,"domContent",(function(){return u.domContent})),r.o(u,"domInsert")&&r.d(e,"domInsert",(function(){return u.domInsert})),r.o(u,"domStyle")&&r.d(e,"domStyle",(function(){return u.domStyle})),r.o(u,"domText")&&r.d(e,"domText",(function(){return u.domText})),r.o(u,"extend")&&r.d(e,"extend",(function(){return u.extend})),r.o(u,"formatScope")&&r.d(e,"formatScope",(function(){return u.formatScope})),r.o(u,"guid")&&r.d(e,"guid",(function(){return u.guid})),r.o(u,"inArray")&&r.d(e,"inArray",(function(){return u.inArray})),r.o(u,"isArray")&&r.d(e,"isArray",(function(){return u.isArray})),r.o(u,"isBoolean")&&r.d(e,"isBoolean",(function(){return u.isBoolean})),r.o(u,"isDef")&&r.d(e,"isDef",(function(){return u.isDef})),r.o(u,"isFalse")&&r.d(e,"isFalse",(function(){return u.isFalse})),r.o(u,"isFunction")&&r.d(e,"isFunction",(function(){return u.isFunction})),r.o(u,"isNumber")&&r.d(e,"isNumber",(function(){return u.isNumber})),r.o(u,"isOffset")&&r.d(e,"isOffset",(function(){return u.isOffset})),r.o(u,"isString")&&r.d(e,"isString",(function(){return u.isString})),r.o(u,"isTrue")&&r.d(e,"isTrue",(function(){return u.isTrue})),r.o(u,"isUndef")&&r.d(e,"isUndef",(function(){return u.isUndef})),r.o(u,"jsonParse")&&r.d(e,"jsonParse",(function(){return u.jsonParse})),r.o(u,"jsonStringify")&&r.d(e,"jsonStringify",(function(){return u.jsonStringify})),r.o(u,"matchFilterable")&&r.d(e,"matchFilterable",(function(){return u.matchFilterable})),r.o(u,"packageFeaturesToCollection")&&r.d(e,"packageFeaturesToCollection",(function(){return u.packageFeaturesToCollection})),r.o(u,"requestFrame")&&r.d(e,"requestFrame",(function(){return u.requestFrame})),r.o(u,"transformCustomFilterToMapboxFilter")&&r.d(e,"transformCustomFilterToMapboxFilter",(function(){return u.transformCustomFilterToMapboxFilter})),r.o(u,"turf")&&r.d(e,"turf",(function(){return u.turf})),r.o(u,"unfilterMapboxExpression")&&r.d(e,"unfilterMapboxExpression",(function(){return u.unfilterMapboxExpression})),r.o(u,"warn")&&r.d(e,"warn",(function(){return u.warn})),r.o(u,"xhr")&&r.d(e,"xhr",(function(){return u.xhr}));var c=r(380);r.d(e,"buildEmptyFeatureCollection",(function(){return c.a})),r.d(e,"formatScope",(function(){return c.b})),r.d(e,"packageFeaturesToCollection",(function(){return c.c}));var l=r(381);r.d(e,"createDivElement",(function(){return l.a})),r.d(e,"domClass",(function(){return l.b})),r.d(e,"domContent",(function(){return l.c})),r.d(e,"domInsert",(function(){return l.d})),r.d(e,"domStyle",(function(){return l.e})),r.d(e,"domText",(function(){return l.f}));var h=r(52);r.d(e,"arrayIndexOf",(function(){return h.a})),r.d(e,"arrayLength",(function(){return h.b})),r.d(e,"arrayPush",(function(){return h.c})),r.d(e,"arraySplice",(function(){return h.e})),r.d(e,"extend",(function(){return h.f})),r.d(e,"inArray",(function(){return h.g})),r.d(e,"isArray",(function(){return h.h})),r.d(e,"isBoolean",(function(){return h.i})),r.d(e,"isDef",(function(){return h.j})),r.d(e,"isFalse",(function(){return h.k})),r.d(e,"isFunction",(function(){return h.l})),r.d(e,"isNumber",(function(){return h.m})),r.d(e,"isOffset",(function(){return h.n})),r.d(e,"isString",(function(){return h.p})),r.d(e,"isTrue",(function(){return h.q})),r.d(e,"isUndef",(function(){return h.r})),r.d(e,"jsonParse",(function(){return h.s})),r.d(e,"jsonStringify",(function(){return h.t})),r.d(e,"warn",(function(){return h.v}));var p=r(382);r.d(e,"Queue",(function(){return p.a}));var d=r(383);r.d(e,"matchFilterable",(function(){return d.a})),r.d(e,"transformCustomFilterToMapboxFilter",(function(){return d.b})),r.d(e,"unfilterMapboxExpression",(function(){return d.c}));var f=r(243);r.d(e,"bindAll",(function(){return f.a})),r.d(e,"guid",(function(){return f.b})),r.d(e,"xhr",(function(){return f.c}));var g=r(384);r.d(e,"requestFrame",(function(){return g.a}));var m=r(385);r.d(e,"dateParse",(function(){return m.a}));var y=r(386);r.d(e,"GeometryUtil",(function(){return y.a}));var v=r(387);r.d(e,"ConversionUtil",(function(){return v.a}));var A=r(451);r.d(e,"StompSocket",(function(){return A.a}));var _=r(388);r.d(e,"turf",(function(){return _.a}))},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=!0,n=Reflect.ownKeys(t),i=0;i=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},U.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(j.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},U.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},U.prototype.number=function(t){if(!z.test(t)){if(j.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},U.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},U.prototype.keyword=function(t){if(F.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!j.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},U.prototype.neutral=function(t){if(N.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(z.test(t))return this.word=t,void(this.state=3);if(!j.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},U.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}(i),i};function q(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?q[t]=R(arguments[1]):q[t]=Q(arguments[1]):q[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?q.apply(e,t):q(t)}));if("string"==typeof t){if(t in q)return q[t]}else"EPSG"in t?q["EPSG:"+t.EPSG]=t:"ESRI"in t?q["ESRI:"+t.ESRI]=t:"IAU2000"in t?q["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(q);var W=q;var Y=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var X=["3857","900913","3785","102113"];var Z=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in W}(t))return W[t];if(function(t){return Y.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=Q(t);if(function(t){var e=k(t,"authority");if(e){var r=k(e,"epsg");return r&&X.indexOf(r)>-1}}(e))return W["EPSG:3857"];var r=function(t){var e=k(t,"extension");if(e)return k(e,"proj4")}(e);return r?R(r):e}return function(t){return"+"===t[0]}(t)?R(t):void 0},K=function(t,e){var r,n;if(t=t||{},!e)return t;for(n in e)void 0!==(r=e[n])&&(t[n]=r);return t},J=function(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)},$=function(t){return t<0?-1:1},tt=function(t){return Math.abs(t)<=T?t:t-$(t)*S},et=function(t,e,r){var n=t*r,i=.5*t;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(C-e))/n},rt=function(t,e){for(var r,n,i=.5*t,o=C-2*Math.atan(e),a=0;a<=15;a++)if(r=t*Math.sin(o),o+=n=C-2*Math.atan(e*Math.pow((1-r)/(1+r),i))-o,Math.abs(n)<=1e-10)return o;return-9999};function nt(t){return t}var it=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=J(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,n=t.x,i=t.y;if(i*I>90&&i*I<-90&&n*I>180&&n*I<-180)return null;if(Math.abs(Math.abs(i)-C)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*tt(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(M+.5*i));else{var o=Math.sin(i),a=et(this.e,i,o);e=this.x0+this.a*this.k0*tt(n-this.long0),r=this.y0-this.a*this.k0*Math.log(a)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,n=t.x-this.x0,i=t.y-this.y0;if(this.sphere)r=C-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(r=rt(this.e,o)))return null}return e=tt(this.long0+n/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:nt,inverse:nt,names:["longlat","identity"]}],ot={},at=[];function st(t,e){var r=at.length;return t.names?(at[r]=t,t.names.forEach((function(t){ot[t.toLowerCase()]=r})),this):(console.log(e),!0)}var ut={start:function(){it.forEach(st)},add:st,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==ot[e]&&at[ot[e]]?at[ot[e]]:void 0}},ct={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},lt=ct.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};ct.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var ht={};ht.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ht.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ht.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},ht.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},ht.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},ht.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},ht.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},ht.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},ht.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ht.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},ht.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},ht.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},ht.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},ht.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},ht.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},ht.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},ht.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var pt=function(t,e,r,n,i,o,a){var s={};return s.datum_type=void 0===t||"none"===t?5:4,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=1),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=2,s.datum_params[3]*=w,s.datum_params[4]*=w,s.datum_params[5]*=w,s.datum_params[6]=s.datum_params[6]/1e6+1))),a&&(s.datum_type=3,s.grids=a),s.a=r,s.b=n,s.es=i,s.ep2=o,s},dt={};function ft(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:dt[t]||null,isNull:!1}}function gt(t){return t/3600*Math.PI/180}function mt(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function yt(t){return t.map((function(t){return[gt(t.longitudeShift),gt(t.latitudeShift)]}))}function vt(t,e,r){return{name:mt(t,e+8,e+16).trim(),parent:mt(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function At(t,e,r,n){for(var i=e+176,o=[],a=0;a-1.001*C)u=-C;else if(u>C&&u<1.001*C)u=C;else{if(u<-C)return{x:-1/0,y:-1/0,z:t.z};if(u>C)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),i=Math.sin(u),a=Math.cos(u),o=i*i,{x:((n=r/Math.sqrt(1-e*o))+c)*a*Math.cos(s),y:(n+c)*a*Math.sin(s),z:(n*(1-e)+c)*i}}function wt(t,e,r,n){var i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A=t.x,_=t.y,b=t.z?t.z:0;if(i=Math.sqrt(A*A+_*_),o=Math.sqrt(A*A+_*_+b*b),i/r<1e-12){if(y=0,o/r<1e-12)return C,v=-n,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(_,A);a=b/o,h=(s=i/o)*(1-e)*(u=1/Math.sqrt(1-e*(2-e)*s*s)),p=a*u,m=0;do{m++,c=e*(l=r/Math.sqrt(1-e*p*p))/(l+(v=i*h+b*p-l*(1-e*p*p))),g=(f=a*(u=1/Math.sqrt(1-c*(2-c)*s*s)))*h-(d=s*(1-c)*u)*p,h=d,p=f}while(g*g>1e-24&&m<30);return{x:y,y:Math.atan(f/Math.abs(d)),z:v}}function Ct(t){return 1===t||2===t}var Et=function(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))}(t,e))return r;if(5===t.datum_type||5===e.datum_type)return r;var n=t.a,i=t.es;if(3===t.datum_type){if(0!==It(t,!1,r))return;n=6378137,i=.0066943799901413165}var o=e.a,a=e.b,s=e.es;if(3===e.datum_type&&(o=6378137,a=6356752.314,s=.0066943799901413165),i===s&&n===o&&!Ct(t.datum_type)&&!Ct(e.datum_type))return r;if((r=xt(r,i,n),Ct(t.datum_type)&&(r=function(t,e,r){if(1===e)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(2===e){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],c=r[6];return{x:c*(t.x-u*t.y+s*t.z)+n,y:c*(u*t.x+t.y-a*t.z)+i,z:c*(-s*t.x+a*t.y+t.z)+o}}}(r,t.datum_type,t.datum_params)),Ct(e.datum_type)&&(r=function(t,e,r){if(1===e)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(2===e){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],c=r[6],l=(t.x-n)/c,h=(t.y-i)/c,p=(t.z-o)/c;return{x:l+u*h-s*p,y:-u*l+h+a*p,z:s*l-a*h+p}}}(r,e.datum_type,e.datum_params)),r=wt(r,s,o,a),3===e.datum_type)&&0!==It(e,!0,r))return;return r};function It(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var n={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},o=[],a=0;an.y||l>n.x||d1e-12&&Math.abs(a.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=tt(o.x+r.ll[0]),n.y=o.y+r.ll[1]}else isNaN(o.x)||(n.x=t.x+o.x,n.y=t.y+o.y);return n}function St(t,e){var r,n={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(n.x),o=Math.floor(n.y),a=n.x-1*i,s=n.y-1*o,u={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return u;if(o<0||o>=e.lim[1])return u;r=o*e.lim[0]+i;var c=e.cvs[r][0],l=e.cvs[r][1];r++;var h=e.cvs[r][0],p=e.cvs[r][1];r+=e.lim[0];var d=e.cvs[r][0],f=e.cvs[r][1];r--;var g=e.cvs[r][0],m=e.cvs[r][1],y=a*s,v=a*(1-s),A=(1-a)*(1-s),_=(1-a)*s;return u.x=A*c+v*h+_*g+y*d,u.y=A*l+v*p+_*m+y*f,u}var Tt=function(t,e,r){var n,i,o,a=r.x,s=r.y,u=r.z||0,c={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==r.z)switch(0===o?(n=a,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(n=s,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(n=u,i="z"),t.axis[o]){case"e":c[i]=n;break;case"w":c[i]=-n;break;case"n":c[i]=n;break;case"s":c[i]=-n;break;case"u":void 0!==r[i]&&(c.z=n);break;case"d":void 0!==r[i]&&(c.z=-n);break;default:return null}return c},Pt=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e};function Ot(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Lt(t,e,r){var n;if(Array.isArray(r)&&(r=Pt(r)),function(t){Ot(t.x),Ot(t.y)}(r),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(r=Lt(t,n=new bt("WGS84"),r),t=n),"enu"!==t.axis&&(r=Tt(t,!1,r)),"longlat"===t.projName)r={x:r.x*E,y:r.y*E,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=Et(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*I,y:r.y*I,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),"enu"!==e.axis?Tt(e,!0,r):r}var kt=bt("WGS84");function Rt(t,e,r){var n,i,o;return Array.isArray(r)?(n=Lt(t,e,r)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(r.splice(3)):[n.x,n.y,r[2]].concat(r.splice(3)):[n.x,n.y].concat(r.splice(2)):[n.x,n.y]):(i=Lt(t,e,r),2===(o=Object.keys(r)).length||o.forEach((function(n){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;i[n]=r[n]})),i)}function Dt(t){return t instanceof bt?t:t.oProj?t.oProj:bt(t)}var Bt=function(t,e,r){t=Dt(t);var n,i=!1;return void 0===e?(e=t,t=kt,i=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=kt,i=!0),e=Dt(e),r?Rt(t,e,r):(n={forward:function(r){return Rt(t,e,r)},inverse:function(r){return Rt(e,t,r)}},i&&(n.oProj=e),n)},Nt=73,Ft=79,jt={forward:zt,inverse:function(t){var e=Vt(Wt(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:Ut};function zt(t,e){return e=e||5,function(t,e){var r="00000"+t.easting,n="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(d=t.easting,f=t.northing,g=t.zoneNumber,m=qt(g),y=Math.floor(d/1e5),v=Math.floor(f/1e5)%20,i=y,o=v,a=m,s=a-1,u="AJSAJS".charCodeAt(s),c="AFAFAF".charCodeAt(s),l=u+i-1,h=c+o,p=!1,l>90&&(l=l-90+65-1,p=!0),(l===Nt||uNt||(l>Nt||uFt||(l>Ft||u90&&(l=l-90+65-1),h>86?(h=h-86+65-1,p=!0):p=!1,(h===Nt||cNt||(h>Nt||cFt||(h>Ft||c86&&(h=h-86+65-1),String.fromCharCode(l)+String.fromCharCode(h))+r.substr(r.length-5,e)+n.substr(n.length-5,e);var i,o,a,s,u,c,l,h,p;var d,f,g,m,y,v}(function(t){var e,r,n,i,o,a,s,u=t.lat,c=t.lon,l=6378137,h=Gt(u),p=Gt(c);s=Math.floor((c+180)/6)+1,180===c&&(s=60);u>=56&&u<64&&c>=3&&c<12&&(s=32);u>=72&&u<84&&(c>=0&&c<9?s=31:c>=9&&c<21?s=33:c>=21&&c<33?s=35:c>=33&&c<42&&(s=37));a=Gt(6*(s-1)-180+3),.006739496752268451,e=l/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),r=Math.tan(h)*Math.tan(h),n=.006739496752268451*Math.cos(h)*Math.cos(h),i=Math.cos(h)*(p-a),o=l*(.9983242984503243*h-.002514607064228144*Math.sin(2*h)+2639046602129982e-21*Math.sin(4*h)-3.418046101696858e-9*Math.sin(6*h));var d=.9996*e*(i+(1-r+n)*i*i*i/6+(5-18*r+r*r+72*n-.39089081163157013)*i*i*i*i*i/120)+5e5,f=.9996*(o+e*Math.tan(h)*(i*i/2+(5-r+9*n+4*n*n)*i*i*i*i/24+(61-58*r+r*r+600*n-2.2240339282485886)*i*i*i*i*i*i/720));u<0&&(f+=1e7);return{northing:Math.round(f),easting:Math.round(d),zoneNumber:s,zoneLetter:Qt(u)}}({lat:t[1],lon:t[0]}),e)}function Ut(t){var e=Vt(Wt(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Gt(t){return t*(Math.PI/180)}function Ht(t){return t/Math.PI*180}function Vt(t){var e=t.northing,r=t.easting,n=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,a,s,u,c,l,h,p,d=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=r-5e5,m=e;n<"N"&&(m-=1e7),l=6*(i-1)-180+3,p=(h=m/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*h)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*h)+151*f*f*f/96*Math.sin(6*h),o=d/Math.sqrt(1-.00669438*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),s=.006739496752268451*Math.cos(p)*Math.cos(p),u=.99330562*d/Math.pow(1-.00669438*Math.sin(p)*Math.sin(p),1.5),c=g/(.9996*o);var y=p-o*Math.tan(p)/u*(c*c/2-(5+3*a+10*s-4*s*s-.06065547077041606)*c*c*c*c/24+(61+90*a+298*s+45*a*a-1.6983531815716497-3*s*s)*c*c*c*c*c*c/720);y=Ht(y);var v,A=(c-(1+2*a+s)*c*c*c/6+(5-2*s+28*a-3*s*s+.05391597401814761+24*a*a)*c*c*c*c*c/120)/Math.cos(p);if(A=l+Ht(A),t.accuracy){var _=Vt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});v={top:_.lat,right:_.lon,bottom:y,left:A}}else v={lat:y,lon:A};return v}function Qt(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function qt(t){var e=t%6;return 0===e&&(e=6),e}function Wt(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,n=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var a=parseInt(i,10);if(0===o||o+3>r)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;n=t.substring(o,o+=2);for(var u=qt(a),c=function(t,e){var r="AJSAJS".charCodeAt(e-1),n=1e5,i=!1;for(;r!==t.charCodeAt(0);){if(++r===Nt&&r++,r===Ft&&r++,r>90){if(i)throw"Bad character: "+t;r=65,i=!0}n+=1e5}return n}(n.charAt(0),u),l=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var r="AFAFAF".charCodeAt(e-1),n=0,i=!1;for(;r!==t.charCodeAt(0);){if(++r===Nt&&r++,r===Ft&&r++,r>86){if(i)throw"Bad character: "+t;r=65,i=!0}n+=1e5}return n}(n.charAt(1),u);l0&&(p=1e5/Math.pow(10,g),d=t.substring(o,o+g),m=parseFloat(d)*p,f=t.substring(o+g),y=parseFloat(f)*p),{easting:m+c,northing:y+l,zoneLetter:s,zoneNumber:a,accuracy:p}}function Yt(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Xt(t,e,r){if(!(this instanceof Xt))return new Xt(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var n=t.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Xt.fromMGRS=function(t){return new Xt(Ut(t))},Xt.prototype.toMGRS=function(t){return zt([this.x,this.y],t)};var Zt=Xt,Kt=.01068115234375,Jt=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*Kt))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*Kt)));var r=t*t;return e[2]=r*(.46875-t*(.013020833333333334+.007120768229166667*t)),r*=t,e[3]=r*(.3645833333333333-.005696614583333333*t),e[4]=r*t*.3076171875,e},$t=function(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))},te=function(t,e,r){for(var n=1/(1-e),i=t,o=20;o;--o){var a=Math.sin(i),s=1-e*a*a;if(i-=s=($t(i,a,Math.cos(i),r)-t)*(s*Math.sqrt(s))*n,Math.abs(s)<1e-10)return i}return i};var ee={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Jt(this.es),this.ml0=$t(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,r,n,i=t.x,o=t.y,a=tt(i-this.long0),s=Math.sin(o),u=Math.cos(o);if(this.es){var c=u*a,l=Math.pow(c,2),h=this.ep2*Math.pow(u,2),p=Math.pow(h,2),d=Math.abs(u)>1e-10?Math.tan(o):0,f=Math.pow(d,2),g=Math.pow(f,2);e=1-this.es*Math.pow(s,2),c/=Math.sqrt(e);var m=$t(o,s,u,this.en);r=this.a*(this.k0*c*(1+l/6*(1-f+h+l/20*(5-18*f+g+14*h-58*f*h+l/42*(61+179*g-g*f-479*f)))))+this.x0,n=this.a*(this.k0*(m-this.ml0+s*a*c/2*(1+l/12*(5-f+9*h+4*p+l/30*(61+g-58*f+270*h-330*f*h+l/56*(1385+543*g-g*f-3111*f))))))+this.y0}else{var y=u*Math.sin(a);if(Math.abs(Math.abs(y)-1)<1e-10)return 93;if(r=.5*this.a*this.k0*Math.log((1+y)/(1-y))+this.x0,n=u*Math.cos(a)/Math.sqrt(1-Math.pow(y,2)),(y=Math.abs(n))>=1){if(y-1>1e-10)return 93;n=0}else n=Math.acos(n);o<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=r,t.y=n,t},inverse:function(t){var e,r,n,i,o=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+a/this.k0,r=te(e,this.es,this.en),Math.abs(r)1e-10?Math.tan(r):0,l=this.ep2*Math.pow(u,2),h=Math.pow(l,2),p=Math.pow(c,2),d=Math.pow(p,2);e=1-this.es*Math.pow(s,2);var f=o*Math.sqrt(e)/this.k0,g=Math.pow(f,2);n=r-(e*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*p-9*l*p+l-4*h-g/30*(61+90*p-252*l*p+45*d+46*l-g/56*(1385+3633*p+4095*d+1574*d*p)))),i=tt(this.long0+f*(1-g/6*(1+2*p+l-g/20*(5+28*p+24*d+8*l*p+6*l-g/42*(61+662*p+1320*d+720*d*p))))/u)}else n=C*$(a),i=0;else{var m=Math.exp(o/this.k0),y=.5*(m-1/m),v=this.lat0+a/this.k0,A=Math.cos(v);e=Math.sqrt((1-Math.pow(A,2))/(1+Math.pow(y,2))),n=Math.asin(e),a<0&&(n=-n),i=0===y&&0===A?0:tt(Math.atan2(y,A)+this.long0)}return t.x=i,t.y=n,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},re=function(t){var e=Math.exp(t);return e=(e-1/e)/2},ne=function(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),n=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))},ie=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(ne(1,e)+1))),t<0?-e:e},oe=function(t,e){for(var r,n=2*Math.cos(2*e),i=t.length-1,o=t[i],a=0;--i>=0;)r=n*o-a+t[i],a=o,o=r;return e+r*Math.sin(2*e)},ae=function(t,e,r){for(var n,i,o=Math.sin(e),a=Math.cos(e),s=re(r),u=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(r),c=2*a*u,l=-2*o*s,h=t.length-1,p=t[h],d=0,f=0,g=0;--h>=0;)n=f,i=d,p=c*(f=p)-n-l*(d=g)+t[h],g=l*f-i+c*d;return[(c=o*u)*p-(l=a*s)*g,c*g+l*p]};var se={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ee.init.apply(this),this.forward=ee.forward,this.inverse=ee.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var n=oe(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(t,e){for(var r,n=2*Math.cos(e),i=t.length-1,o=t[i],a=0;--i>=0;)r=n*o-a+t[i],a=o,o=r;return Math.sin(e)*r}(this.gtu,2*n))},forward:function(t){var e=tt(t.x-this.long0),r=t.y;r=oe(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),o=Math.sin(e),a=Math.cos(e);r=Math.atan2(n,a*i),e=Math.atan2(o*i,ne(n,i*a)),e=ie(Math.tan(e));var s,u,c=ae(this.gtu,2*r,2*e);return r+=c[0],e+=c[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*r+this.Zb)+this.y0):(s=1/0,u=1/0),t.x=s,t.y=u,t},inverse:function(t){var e,r,n=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var o=ae(this.utg,2*i,2*n);i+=o[0],n+=o[1],n=Math.atan(re(n));var a=Math.sin(i),s=Math.cos(i),u=Math.sin(n),c=Math.cos(n);i=Math.atan2(a*c,ne(u,c*s)),n=Math.atan2(u,c*s),e=tt(n+this.long0),r=oe(this.cgb,i)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]};var ue={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(tt(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*E,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,se.init.apply(this),this.forward=se.forward,this.inverse=se.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},ce=function(t,e){return Math.pow((1-t)/(1+t),e)};var le={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+M)/(Math.pow(Math.tan(.5*this.lat0+M),this.C)*ce(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+M),this.C)*ce(this.e*Math.sin(r),this.ratexp))-C,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+M)/this.K,1/this.C),i=20;i>0&&(r=2*Math.atan(n*ce(this.e*Math.sin(t.y),-.5*this.e))-C,!(Math.abs(r-t.y)<1e-14));--i)t.y=r;return i?(t.x=e,t.y=r,t):null},names:["gauss"]};var he={init:function(){le.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,n,i;return t.x=tt(t.x-this.long0),le.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),n=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*n),t.x=i*r*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*r*n),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,n,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=Math.sqrt(t.x*t.x+t.y*t.y)){var a=2*Math.atan2(o,this.R2);e=Math.sin(a),r=Math.cos(a),i=Math.asin(r*this.sinc0+t.y*e*this.cosc0/o),n=Math.atan2(t.x*e,o*this.cosc0*r-t.y*this.sinc0*e)}else i=this.phic0,n=0;return t.x=n,t.y=i,le.inverse.apply(this,[t]),t.x=tt(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var pe={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+$(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*this.cons*J(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/et(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=J(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-C,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,n,i,o,a,s=t.x,u=t.y,c=Math.sin(u),l=Math.cos(u),h=tt(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=1e-10&&Math.abs(u+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*c+this.coslat0*l*Math.cos(h)),t.x=this.a*e*l*Math.sin(h)+this.x0,t.y=this.a*e*(this.coslat0*c-this.sinlat0*l*Math.cos(h))+this.y0,t):(r=2*Math.atan(this.ssfn_(u,c,this.e))-C,i=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=1e-10?(o=et(this.e,u*this.con,this.con*c),a=2*this.a*this.k0*o/this.cons,t.x=this.x0+a*Math.sin(s-this.long0),t.y=this.y0-this.con*a*Math.cos(s-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(e=2*this.a*this.k0/(1+i*Math.cos(h)),t.y=e*n):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*i*Math.cos(h))),t.y=e*(this.cosX0*n-this.sinX0*i*Math.cos(h))+this.y0),t.x=e*i*Math.sin(h)+this.x0,t))},inverse:function(t){var e,r,n,i,o;t.x-=this.x0,t.y-=this.y0;var a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var s=2*Math.atan(a/(2*this.a*this.k0));return e=this.long0,r=this.lat0,a<=1e-10?(t.x=e,t.y=r,t):(r=Math.asin(Math.cos(s)*this.sinlat0+t.y*Math.sin(s)*this.coslat0/a),e=Math.abs(this.coslat0)<1e-10?this.lat0>0?tt(this.long0+Math.atan2(t.x,-1*t.y)):tt(this.long0+Math.atan2(t.x,t.y)):tt(this.long0+Math.atan2(t.x*Math.sin(s),a*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=1e-10){if(a<=1e-10)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,n=a*this.cons/(2*this.a*this.k0),r=this.con*rt(this.e,n),e=this.con*tt(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=1e-10?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/a),e=tt(this.long0+Math.atan2(t.x*Math.sin(i),a*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*rt(this.e,Math.tan(.5*(C+o)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(C+t))*Math.pow((1-e)/(1+e),.5*r)}};var de={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,n=1/this.rf,i=2*n-Math.pow(n,2),o=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*s+this.alpha*o/2*u},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,n=e/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,u=0,c=o,l=-1e3,h=0;Math.abs(c-l)>1e-7;){if(++h>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),l=c,c=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=s,t.y=c,t},names:["somerc"]};var fe={init:function(){var t,e,r,n,i,o,a,s,u,c,l,h,p,d=0,f=0,g=0,m=0,y=0,v=0,A=0;this.no_off=(p="object"==typeof(h=this).PROJECTION?Object.keys(h.PROJECTION)[0]:h.PROJECTION,"no_uoff"in h||"no_off"in h||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(p)),this.no_rot="no_rot"in this;var _=!1;"alpha"in this&&(_=!0);var b=!1;if("rectified_grid_angle"in this&&(b=!0),_&&(A=this.alpha),b&&(d=this.rectified_grid_angle*E),_||b)f=this.longc;else if(g=this.long1,y=this.lat1,m=this.long2,v=this.lat2,Math.abs(y-v)<=1e-7||(t=Math.abs(y))<=1e-7||Math.abs(t-C)<=1e-7||Math.abs(Math.abs(this.lat0)-C)<=1e-7||Math.abs(Math.abs(v)-C)<=1e-7)throw new Error;var x=1-this.es;e=Math.sqrt(x),Math.abs(this.lat0)>1e-10?(s=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*s*s,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/x),this.A=this.B*this.k0*e/t,(i=(n=this.B*e/(r*Math.sqrt(t)))*n-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(et(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=i=1),_||b?(_?(l=Math.asin(Math.sin(A)/n),b||(d=A)):(l=d,A=Math.asin(n*Math.sin(l))),this.lam0=f-Math.asin(.5*(i-1/i)*Math.tan(l))/this.B):(o=Math.pow(et(this.e,y,Math.sin(y)),this.B),a=Math.pow(et(this.e,v,Math.sin(v)),this.B),i=this.E/o,u=(a-o)/(a+o),c=((c=this.E*this.E)-a*o)/(c+a*o),(t=g-m)<-Math.pi?m-=S:t>Math.pi&&(m+=S),this.lam0=tt(.5*(g+m)-Math.atan(c*Math.tan(.5*this.B*(g-m))/u)/this.B),l=Math.atan(2*Math.sin(this.B*tt(g-this.lam0))/(i-1/i)),d=A=Math.asin(n*Math.sin(l))),this.singam=Math.sin(l),this.cosgam=Math.cos(l),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(A))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*l,this.v_pole_n=this.ArB*Math.log(Math.tan(M-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(M+i))},forward:function(t){var e,r,n,i,o,a,s,u,c={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-C)>1e-10){if(e=.5*((o=this.E/Math.pow(et(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/o)),r=.5*(o+a),i=Math.sin(this.B*t.x),n=(e*this.singam-i*this.cosgam)/r,Math.abs(Math.abs(n)-1)<1e-10)throw new Error;u=.5*this.ArB*Math.log((1-n)/(1+n)),a=Math.cos(this.B*t.x),s=Math.abs(a)<1e-7?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+i*this.singam,a)}else u=t.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*t.y;return this.no_rot?(c.x=s,c.y=u):(s-=this.u_0,c.x=u*this.cosrot+s*this.sinrot,c.y=s*this.cosrot-u*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(t){var e,r,n,i,o,a,s,u={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),i=.5*((n=Math.exp(-this.BrA*r))-1/n),o=.5*(n+1/n),s=((a=Math.sin(this.BrA*e))*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(s)-1)<1e-10)u.x=0,u.y=s<0?-C:C;else{if(u.y=this.E/Math.sqrt((1+s)/(1-s)),u.y=rt(this.e,Math.pow(u.y,1/this.B)),u.y===1/0)throw new Error;u.x=-this.rB*Math.atan2(i*this.cosgam-a*this.singam,Math.cos(this.BrA*e))}return u.x+=this.lam0,u},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var ge={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),r=Math.cos(this.lat1),n=J(this.e,e,r),i=et(this.e,this.lat1,e),o=Math.sin(this.lat2),a=Math.cos(this.lat2),s=J(this.e,o,a),u=et(this.e,this.lat2,o),c=et(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(n/s)/Math.log(i/u):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=1e-10&&(r=$(r)*(C-2e-10));var n,i,o=Math.abs(Math.abs(r)-C);if(o>1e-10)n=et(this.e,r,Math.sin(r)),i=this.a*this.f0*Math.pow(n,this.ns);else{if((o=r*this.ns)<=0)return null;i=0}var a=this.ns*tt(e-this.long0);return t.x=this.k0*(i*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(a))+this.y0,t},inverse:function(t){var e,r,n,i,o,a=(t.x-this.x0)/this.k0,s=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+s*s),r=1):(e=-Math.sqrt(a*a+s*s),r=-1);var u=0;if(0!==e&&(u=Math.atan2(r*a,r*s)),0!==e||this.ns>0){if(r=1/this.ns,n=Math.pow(e/(this.a*this.f0),r),-9999===(i=rt(this.e,n)))return null}else i=-C;return o=tt(u/this.ns+this.long0),t.x=o,t.y=i,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc"]};var me={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,n,i,o,a,s,u=t.x,c=t.y,l=tt(u-this.long0);return e=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/e)-this.s45),n=-l*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),o=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=s*Math.cos(a)/1,t.x=s*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,n,i,o,a,s,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(e)),t.x=this.long0-r/this.alfa,a=e,s=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(s=1),a=t.y,c+=1}while(0===s&&c<15);return c>=15?null:t},names:["Krovak","krovak"]},ye=function(t,e,r,n,i){return t*i-e*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)},ve=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},Ae=function(t){return.375*t*(1+.25*t*(1+.46875*t))},_e=function(t){return.05859375*t*t*(1+.75*t)},be=function(t){return t*t*t*(35/3072)},xe=function(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)},we=function(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e};var Me={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-C)<1e-10?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<1e-10?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Ie(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=.3333333333333333*t,e=t*t,r[0]+=.17222222222222222*e,r[1]=.06388888888888888*e,e*=t,r[0]+=.10257936507936508*e,r[1]+=.0664021164021164*e,r[2]=.016415012942191543*e,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Ie(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,n,i,o,a,s,u,c,l,h=t.x,p=t.y;if(h=tt(h-this.long0),this.sphere){if(o=Math.sin(p),l=Math.cos(p),n=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+l*n:1+this.sinph0*o+this.cosph0*l*n)<=1e-10)return null;e=(r=Math.sqrt(2/r))*l*Math.sin(h),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*l*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(p+this.lat0)<1e-10)return null;r=M-.5*p,e=(r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)))*Math.sin(h),r*=n}}else{switch(s=0,u=0,c=0,n=Math.cos(h),i=Math.sin(h),o=Math.sin(p),a=Ie(this.e,o),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=a/this.qp,u=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:c=1+this.sinb1*s+this.cosb1*u*n;break;case this.EQUIT:c=1+u*n;break;case this.N_POLE:c=C+p,a=this.qp-a;break;case this.S_POLE:c=p-C,a=this.qp+a}if(Math.abs(c)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),r=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*s-this.sinb1*u*n):(c=Math.sqrt(2/(1+u*n)))*s*this.ymf,e=this.xmf*c*u*i;break;case this.N_POLE:case this.S_POLE:a>=0?(e=(c=Math.sqrt(a))*i,r=n*(this.mode===this.S_POLE?c:-c)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n,i,o,a,s,u,c,l,h=t.x/this.a,p=t.y/this.a;if(this.sphere){var d,f=0,g=0;if((r=.5*(d=Math.sqrt(h*h+p*p)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(r),f=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(d)<=1e-10?0:Math.asin(p*g/d),h*=g,p=f*d;break;case this.OBLIQ:r=Math.abs(d)<=1e-10?this.lat0:Math.asin(f*this.sinph0+p*g*this.cosph0/d),h*=g*this.cosph0,p=(f-Math.sin(r)*this.sinph0)*d;break;case this.N_POLE:p=-p,r=C-r;break;case this.S_POLE:r-=C}e=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(h,p):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(h/=this.dd,p*=this.dd,(a=Math.sqrt(h*h+p*p))<1e-10)return t.x=this.long0,t.y=this.lat0,t;i=2*Math.asin(.5*a/this.rq),n=Math.cos(i),h*=i=Math.sin(i),this.mode===this.OBLIQ?(s=n*this.sinb1+p*i*this.cosb1/a,o=this.qp*s,p=a*this.cosb1*n-p*this.sinb1*i):(s=p*i/a,o=this.qp*s,p=a*n)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(p=-p),!(o=h*h+p*p))return t.x=this.long0,t.y=this.lat0,t;s=1-o/this.qp,this.mode===this.S_POLE&&(s=-s)}e=Math.atan2(h,p),u=Math.asin(s),c=this.apa,l=u+u,r=u+c[0]*Math.sin(l)+c[1]*Math.sin(l+l)+c[2]*Math.sin(l+l+l)}return t.x=tt(this.long0+e),t.y=r,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Se=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)};var Te={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=J(this.e3,this.sin_po,this.cos_po),this.qs1=Ie(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=J(this.e3,this.sin_po,this.cos_po),this.qs2=Ie(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ie(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=Ie(this.e3,this.sin_phi,this.cos_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*tt(e-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),i=0,0!==e&&(i=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,r)),o=tt(i/this.ns0+this.long0),t.x=o,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,n,i,o,a=Se(.5*e);if(t<1e-10)return a;for(var s=t*t,u=1;u<=25;u++)if(a+=o=.5*(i=1-(n=t*(r=Math.sin(a)))*n)*i/Math.cos(a)*(e/(1-s)-r/i+.5/t*Math.log((1-n)/(1+n))),Math.abs(o)<=1e-7)return a;return null}};var Pe={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,r,n,i,o,a,s,u=t.x,c=t.y;return n=tt(u-this.long0),e=Math.sin(c),r=Math.cos(c),i=Math.cos(n),1,(o=this.sin_p14*e+this.cos_p14*r*i)>0||Math.abs(o)<=1e-10?(a=this.x0+1*this.a*r*Math.sin(n)/o,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)/o):(a=this.x0+this.infinity_dist*r*Math.sin(n),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*i)),t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),r=Math.sin(i),n=Math.cos(i),a=Se(n*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r),o=tt(this.long0+o)):(a=this.phic0,o=0),t.x=o,t.y=a,t},names:["gnom"]};var Oe={init:function(){this.sphere||(this.k0=J(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,n=t.x,i=t.y,o=tt(n-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=Ie(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,r=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=tt(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*C:C;for(var n,i,o,a,s=Math.asin(.5*e),u=0;u<30;u++)if(i=Math.sin(s),o=Math.cos(s),a=t*i,s+=n=Math.pow(1-a*a,2)/(2*o)*(e/(1-t*t)-i/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(n)<=1e-10)return s;return NaN}(this.e,2*t.y*this.k0/this.a),e=tt(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]};var Le={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,n=tt(e-this.long0),i=we(r-this.lat0);return t.x=this.x0+this.a*n*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,r=t.y;return t.x=tt(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=we(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var ke={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ve(this.es),this.e1=Ae(this.es),this.e2=_e(this.es),this.e3=be(this.es),this.ml0=this.a*ye(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,n,i=t.x,o=t.y,a=tt(i-this.long0);if(n=a*Math.sin(o),this.sphere)Math.abs(o)<=1e-10?(e=this.a*a,r=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(o),r=this.a*(we(o-this.lat0)+(1-Math.cos(n))/Math.tan(o)));else if(Math.abs(o)<=1e-10)e=this.a*a,r=-1*this.ml0;else{var s=xe(this.a,this.e,Math.sin(o))/Math.tan(o);e=s*Math.sin(n),r=this.a*ye(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*(1-Math.cos(n))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,n,i,o,a,s,u,c;if(n=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=1e-10)e=tt(n/this.a+this.long0),r=0;else{var l;for(a=this.lat0+i/this.a,s=n*n/this.a/this.a+a*a,u=a,o=20;o;--o)if(u+=c=-1*(a*(u*(l=Math.tan(u))+1)-u-.5*(u*u+s)*l)/((u-a)/l-1),Math.abs(c)<=1e-10){r=u;break}e=tt(this.long0+Math.asin(n*Math.tan(u)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=1e-10)r=0,e=tt(this.long0+n/this.a);else{var h,p,d,f,g;for(a=(this.ml0+i)/this.a,s=n*n/this.a/this.a+a*a,u=a,o=20;o;--o)if(g=this.e*Math.sin(u),h=Math.sqrt(1-g*g)*Math.tan(u),p=this.a*ye(this.e0,this.e1,this.e2,this.e3,u),d=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=c=(a*(h*(f=p/this.a)+1)-f-.5*h*(f*f+s))/(this.es*Math.sin(2*u)*(f*f+s-2*a*f)/(4*h)+(a-f)*(h*d-2/Math.sin(2*u))-d),Math.abs(c)<=1e-10){r=u;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=tt(this.long0+Math.asin(n*h/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]};var Re={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,n=t.y-this.lat0,i=r-this.long0,o=n/w*1e-5,a=i,s=1,u=0;for(e=1;e<=10;e++)s*=o,u+=this.A[e]*s;var c,l=u,h=a,p=1,d=0,f=0,g=0;for(e=1;e<=6;e++)c=d*l+p*h,p=p*l-d*h,d=c,f=f+this.B_re[e]*p-this.B_im[e]*d,g=g+this.B_im[e]*p+this.B_re[e]*d;return t.x=g*this.a+this.x0,t.y=f*this.a+this.y0,t},inverse:function(t){var e,r,n=t.x,i=t.y,o=n-this.x0,a=(i-this.y0)/this.a,s=o/this.a,u=1,c=0,l=0,h=0;for(e=1;e<=6;e++)r=c*a+u*s,u=u*a-c*s,c=r,l=l+this.C_re[e]*u-this.C_im[e]*c,h=h+this.C_im[e]*u+this.C_re[e]*c;for(var p=0;p.999999999999&&(r=.999999999999),e=Math.asin(r);var n=tt(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return t.x=n,t.y=i,t},names:["Mollweide","moll"]};var Fe={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ve(this.es),this.e1=Ae(this.es),this.e2=_e(this.es),this.e3=be(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=J(this.e,this.sinphi,this.cosphi),this.ml1=ye(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=J(this.e,this.sinphi,this.cosphi),this.ml2=ye(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=ye(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,r=t.x,n=t.y;if(this.sphere)e=this.a*(this.g-n);else{var i=ye(this.e0,this.e1,this.e2,this.e3,n);e=this.a*(this.g-i)}var o=this.ns*tt(r-this.long0),a=this.x0+e*Math.sin(o),s=this.y0+this.rh-e*Math.cos(o);return t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;if(0!==r&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere)return i=tt(this.long0+o/this.ns),n=we(this.g-r/this.a),t.x=i,t.y=n,t;var a=this.g-r/this.a;return n=Ce(a,this.e0,this.e1,this.e2,this.e3),i=tt(this.long0+o/this.ns),t.x=i,t.y=n,t},names:["Equidistant_Conic","eqdc"]};var je={init:function(){this.R=this.a},forward:function(t){var e,r,n=t.x,i=t.y,o=tt(n-this.long0);Math.abs(i)<=1e-10&&(e=this.x0+this.R*o,r=this.y0);var a=Se(2*Math.abs(i/Math.PI));(Math.abs(o)<=1e-10||Math.abs(Math.abs(i)-C)<=1e-10)&&(e=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/o-o/Math.PI),u=s*s,c=Math.sin(a),l=Math.cos(a),h=l/(c+l-1),p=h*h,d=h*(2/c-1),f=d*d,g=Math.PI*this.R*(s*(h-f)+Math.sqrt(u*(h-f)*(h-f)-(f+u)*(p-f)))/(f+u);o<0&&(g=-g),e=this.x0+g;var m=u+h;return g=Math.PI*this.R*(d*m-s*Math.sqrt((f+u)*(u+1)-m*m))/(f+u),r=i>=0?this.y0+g:this.y0-g,t.x=e,t.y=r,t},inverse:function(t){var e,r,n,i,o,a,s,u,c,l,h,p;return t.x-=this.x0,t.y-=this.y0,h=Math.PI*this.R,o=(n=t.x/h)*n+(i=t.y/h)*i,h=3*(i*i/(u=-2*(a=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(s=a-2*i*i+n*n)*s*s/u/u/u-9*a*s/u/u)/27)/(c=(a-s*s/3/u)/u)/(l=2*Math.sqrt(-c/3)),Math.abs(h)>1&&(h=h>=0?1:-1),p=Math.acos(h)/3,r=t.y>=0?(-l*Math.cos(p+Math.PI/3)-s/3/u)*Math.PI:-(-l*Math.cos(p+Math.PI/3)-s/3/u)*Math.PI,e=Math.abs(n)<1e-10?this.long0:tt(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-i*i)+o*o))/2/n),t.x=e,t.y=r,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var ze={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,w=t.x,E=t.y,I=Math.sin(t.y),M=Math.cos(t.y),S=tt(w-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(C-E)*Math.sin(S),t.y=this.y0-this.a*(C-E)*Math.cos(S),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(C+E)*Math.sin(S),t.y=this.y0+this.a*(C+E)*Math.cos(S),t):(v=this.sin_p12*I+this.cos_p12*M*Math.cos(S),y=(m=Math.acos(v))?m/Math.sin(m):1,t.x=this.x0+this.a*y*M*Math.sin(S),t.y=this.y0+this.a*y*(this.cos_p12*I-this.sin_p12*M*Math.cos(S)),t):(e=ve(this.es),r=Ae(this.es),n=_e(this.es),i=be(this.es),Math.abs(this.sin_p12-1)<=1e-10?(o=this.a*ye(e,r,n,i,C),a=this.a*ye(e,r,n,i,E),t.x=this.x0+(o-a)*Math.sin(S),t.y=this.y0-(o-a)*Math.cos(S),t):Math.abs(this.sin_p12+1)<=1e-10?(o=this.a*ye(e,r,n,i,C),a=this.a*ye(e,r,n,i,E),t.x=this.x0+(o+a)*Math.sin(S),t.y=this.y0+(o+a)*Math.cos(S),t):(s=I/M,u=xe(this.a,this.e,this.sin_p12),c=xe(this.a,this.e,I),l=Math.atan((1-this.es)*s+this.es*u*this.sin_p12/(c*M)),A=0===(h=Math.atan2(Math.sin(S),this.cos_p12*Math.tan(l)-this.sin_p12*Math.cos(S)))?Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.abs(Math.abs(h)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.asin(Math.sin(S)*Math.cos(l)/Math.sin(h)),p=this.e*this.sin_p12/Math.sqrt(1-this.es),m=u*A*(1-(_=A*A)*(g=(d=this.e*this.cos_p12*Math.cos(h)/Math.sqrt(1-this.es))*d)*(1-g)/6+(b=_*A)/8*(f=p*d)*(1-2*g)+(x=b*A)/120*(g*(4-7*g)-3*p*p*(1-7*g))-x*A/48*f),t.x=this.x0+m*Math.sin(h),t.y=this.y0+m*Math.cos(h),t))},inverse:function(t){var e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,w;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*C*this.a)return;return r=e/this.a,n=Math.sin(r),i=Math.cos(r),o=this.long0,Math.abs(e)<=1e-10?a=this.lat0:(a=Se(i*this.sin_p12+t.y*n*this.cos_p12/e),s=Math.abs(this.lat0)-C,o=Math.abs(s)<=1e-10?this.lat0>=0?tt(this.long0+Math.atan2(t.x,-t.y)):tt(this.long0-Math.atan2(-t.x,t.y)):tt(this.long0+Math.atan2(t.x*n,e*this.cos_p12*i-t.y*this.sin_p12*n))),t.x=o,t.y=a,t}return u=ve(this.es),c=Ae(this.es),l=_e(this.es),h=be(this.es),Math.abs(this.sin_p12-1)<=1e-10?(p=this.a*ye(u,c,l,h,C),e=Math.sqrt(t.x*t.x+t.y*t.y),a=Ce((p-e)/this.a,u,c,l,h),o=tt(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=a,t):Math.abs(this.sin_p12+1)<=1e-10?(p=this.a*ye(u,c,l,h,C),e=Math.sqrt(t.x*t.x+t.y*t.y),a=Ce((e-p)/this.a,u,c,l,h),o=tt(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=a,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),g=Math.atan2(t.x,t.y),d=xe(this.a,this.e,this.sin_p12),m=Math.cos(g),v=-(y=this.e*this.cos_p12*m)*y/(1-this.es),A=3*this.es*(1-v)*this.sin_p12*this.cos_p12*m/(1-this.es),x=1-v*(b=(_=e/d)-v*(1+v)*Math.pow(_,3)/6-A*(1+3*v)*Math.pow(_,4)/24)*b/2-_*b*b*b/6,f=Math.asin(this.sin_p12*Math.cos(b)+this.cos_p12*Math.sin(b)*m),o=tt(this.long0+Math.asin(Math.sin(g)*Math.sin(b)/Math.cos(f))),w=Math.sin(f),a=Math.atan2((w-this.es*x*this.sin_p12)*Math.tan(f),w*(1-this.es)),t.x=o,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]};var Ue={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,n,i,o,a,s,u=t.x,c=t.y;return n=tt(u-this.long0),e=Math.sin(c),r=Math.cos(c),i=Math.cos(n),1,((o=this.sin_p14*e+this.cos_p14*r*i)>0||Math.abs(o)<=1e-10)&&(a=1*this.a*r*Math.sin(n),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)),t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a,s;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),r=Se(e/this.a),n=Math.sin(r),i=Math.cos(r),a=this.long0,Math.abs(e)<=1e-10?(s=this.lat0,t.x=a,t.y=s,t):(s=Se(i*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-C,Math.abs(o)<=1e-10?(a=this.lat0>=0?tt(this.long0+Math.atan2(t.x,-t.y)):tt(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=s,t):(a=tt(this.long0+Math.atan2(t.x*n,e*this.cos_p14*i-t.y*this.sin_p14*n)),t.x=a,t.y=s,t))},names:["ortho"]},Ge=1,He=2,Ve=3,Qe=4,qe=5,We=6,Ye=1,Xe=2,Ze=3,Ke=4;function Je(t,e,r,n){var i;return t<1e-10?(n.value=Ye,i=0):(i=Math.atan2(e,r),Math.abs(i)<=M?n.value=Ye:i>M&&i<=C+M?(n.value=Xe,i-=C):i>C+M||i<=-(C+M)?(n.value=Ze,i=i>=0?i-T:i+T):(n.value=Ke,i+=C)),i}function $e(t,e){var r=t+e;return r<-T?r+=S:r>+T&&(r-=S),r}var tr={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=C-M/2?this.face=qe:this.lat0<=-(C-M/2)?this.face=We:Math.abs(this.long0)<=M?this.face=Ge:Math.abs(this.long0)<=C+M?this.face=this.long0>0?He:Qe:this.face=Ve,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,n,i,o,a,s={x:0,y:0},u={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,this.face===qe)i=C-e,r>=M&&r<=C+M?(u.value=Ye,n=r-C):r>C+M||r<=-(C+M)?(u.value=Xe,n=r>0?r-T:r+T):r>-(C+M)&&r<=-M?(u.value=Ze,n=r+C):(u.value=Ke,n=r);else if(this.face===We)i=C+e,r>=M&&r<=C+M?(u.value=Ye,n=-r+C):r=-M?(u.value=Xe,n=-r):r<-M&&r>=-(C+M)?(u.value=Ze,n=-r-C):(u.value=Ke,n=r>0?-r+T:-r-T);else{var c,l,h,p,d,f;this.face===He?r=$e(r,+C):this.face===Ve?r=$e(r,+T):this.face===Qe&&(r=$e(r,-C)),p=Math.sin(e),d=Math.cos(e),f=Math.sin(r),c=d*Math.cos(r),l=d*f,h=p,this.face===Ge?n=Je(i=Math.acos(c),h,l,u):this.face===He?n=Je(i=Math.acos(l),h,-c,u):this.face===Ve?n=Je(i=Math.acos(-c),h,-l,u):this.face===Qe?n=Je(i=Math.acos(-l),h,c,u):(i=n=0,u.value=Ye)}return a=Math.atan(12/T*(n+Math.acos(Math.sin(n)*Math.cos(M))-C)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),u.value===Xe?a+=C:u.value===Ze?a+=T:u.value===Ke&&(a+=1.5*T),s.x=o*Math.cos(a),s.y=o*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,t.x=s.x,t.y=s.y,t},inverse:function(t){var e,r,n,i,o,a,s,u,c,l,h,p,d={lam:0,phi:0},f={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?f.value=Ye:t.y>=0&&t.y>=Math.abs(t.x)?(f.value=Xe,e-=C):t.x<0&&-t.x>=Math.abs(t.y)?(f.value=Ze,e=e<0?e+T:e-T):(f.value=Ke,e+=C),c=T/12*Math.tan(e),o=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),a=Math.atan(o),(s=1-(n=Math.cos(e))*n*(i=Math.tan(r))*i*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===qe)u=Math.acos(s),d.phi=C-u,f.value===Ye?d.lam=a+C:f.value===Xe?d.lam=a<0?a+T:a-T:f.value===Ze?d.lam=a-C:d.lam=a;else if(this.face===We)u=Math.acos(s),d.phi=u-C,f.value===Ye?d.lam=-a+C:f.value===Xe?d.lam=-a:f.value===Ze?d.lam=-a-C:d.lam=a<0?-a-T:-a+T;else{var g,m,y;c=(g=s)*g,m=(c+=(y=c>=1?0:Math.sqrt(1-c)*Math.sin(a))*y)>=1?0:Math.sqrt(1-c),f.value===Xe?(c=m,m=-y,y=c):f.value===Ze?(m=-m,y=-y):f.value===Ke&&(c=m,m=y,y=-c),this.face===He?(c=g,g=-m,m=c):this.face===Ve?(g=-g,m=-m):this.face===Qe&&(c=g,g=m,m=-c),d.phi=Math.acos(-y)-C,d.lam=Math.atan2(m,g),this.face===He?d.lam=$e(d.lam,-C):this.face===Ve?d.lam=$e(d.lam,-T):this.face===Qe&&(d.lam=$e(d.lam,+C))}return 0!==this.es&&(l=d.phi<0?1:0,h=Math.tan(d.phi),p=this.b/Math.sqrt(h*h+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),l&&(d.phi=-d.phi)),d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},er=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],rr=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],nr=I/5,ir=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};var or={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=tt(t.x-this.long0),r=Math.abs(t.y),n=Math.floor(r*nr);n<0?n=0:n>=18&&(n=17);var i={x:ir(er[n],r=I*(r-.08726646259971647*n))*e,y:ir(rr[n],r)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*.8487+this.x0,i.y=i.y*this.a*1.3523+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(e.y>=1)e.x/=er[18][0],e.y=t.y<0?-C:C;else{var r=Math.floor(18*e.y);for(r<0?r=0:r>=18&&(r=17);;)if(rr[r][0]>e.y)--r;else{if(!(rr[r+1][0]<=e.y))break;++r}var n=rr[r],i=5*(e.y-n[0])/(rr[r+1][0]-n[0]);i=function(t,e,r,n){for(var i=e;n;--n){var o=t(i);if(i-=o,Math.abs(o)1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var o={header:i,subgrids:function(t,e,r){for(var n=[],i=0;i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function vr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&(t.index=t.index-1,r=t.list[t.index],e.changeFlag=!1),r},next:function(){var r=null;return t.index=180?180:t[0],e[1]=t[1]<=-90?-90:t[1],e[1]=t[1]>=90?90:t[1],e}var c={makePolygon:function(t){return o.a.polygon([t])},getCurrentLngLat:function(t){var e=t.getBounds();return{north:e.getNorth(),east:e.getEast(),south:e.getSouth(),west:e.getWest()}},getCurrentGeometry:function(t,e){var r=t.getBounds(),n={north:r.getNorth(),east:r.getEast(),south:r.getSouth(),west:r.getWest()};return e?o.a.polygon([[[n.west-e[0],n.north+e[1]],[n.east+e[0],n.north+e[1]],[n.east+e[0],n.south-e[1]],[n.west-e[0],n.south-e[1]],[n.west-e[0],n.north+e[1]]]]):o.a.polygon([[[n.west,n.north],[n.east,n.north],[n.east,n.south],[n.west,n.south],[n.west,n.north]]])},getCurrentBoundsByScreen:function(t,e,r){var n=t._canvas,i=n.width,s=n.height,l=[i,0],h=[i,s],p=[0,s],d=u(t.unproject([0,0]).toArray()),f=u(t.unproject(l).toArray()),g=u(t.unproject(h).toArray()),m=u(t.unproject(p).toArray()),y=o.a.polygon([[d,f,g,m,d]]),v=c.bbox(y);Math.min(v[0],v[2]),Math.max(v[0],v[2]);if(y=c.bboxPolygon(v),!e)return y;var A=[e,0],_=u(t.unproject(A).toArray()),b=(new(a.a.getProps(r,"modules").calculation())).distanceOfP2P(d,_,"kilometers");return b=b>5?5:b,o.a.buffer(y,b,{units:"kilometers"})},getBboxByScreen:function(t){var e=c.getCurrentBoundsByScreen(t).geometry.coordinates[0],r=e[0][0],n=e[1][0],i=e[2][0],o=e[3][0],a=e[0][1],s=e[1][1],u=e[2][1],l=e[3][1],h=Math.min(r,n,i,o),p=Math.max(r,n,i,o),d=Math.max(a,s,u,l);return[h,Math.min(a,s,u,l),p,d]},featureCollection:function(t){var e={type:"FeatureCollection",features:t.map((function(t){return{type:"Feature",geometry:t}}))},r=o.a.combine(e),n=[];return r&&r.features&&r.features[0]&&r.features[0].geometry&&r.features[0].geometry.coordinates&&(n=r.features[0].geometry.coordinates),n},calEncirclePoints:function(t){var e=t.map((function(t){return Object.assign({x:t.geometry.coordinates[0],y:t.geometry.coordinates[1]},{properties:t})}));return function(t,e){for(var r,n,i=0;i=0?e.push(t[r]):(e.pop(),r--);return e}(e).map((function(t){return{type:"Feature",geometry:{type:"Point",coordinates:[t.x,t.y]},properties:t.properties}}))}};function l(t,e,r){var n=(e.x-t.x)*(r.y-e.y)-(e.y-t.y)*(r.x-e.x);return n<0?-1:n>0?1:0}var h={makePolygon:function(t){return o.a.polygon([t])},getCurrentLngLat:function(t){var e=t.getBounds();return{north:e.getNorth(),east:e.getEast(),south:e.getSouth(),west:e.getWest()}},getCurrentGeometry:function(t,e){var r=t.getView().calculateExtent(),n=Object(s.h)(r,"EPSG:"+a.a.config.EPSG,"EPSG:4326"),i={north:n[1],east:n[2],south:n[3],west:n[0]};return e?o.a.polygon([[[i.west-e[0],i.north+e[1]],[i.east+e[0],i.north+e[1]],[i.east+e[0],i.south-e[1]],[i.west-e[0],i.south-e[1]],[i.west-e[0],i.north+e[1]]]]):o.a.polygon([[[i.west,i.north],[i.east,i.north],[i.east,i.south],[i.west,i.south],[i.west,i.north]]])},getCurrentBoundsByScreen:function(t,e){var r=t.getViewport(),n=i()(r.children).filter((function(t){return t instanceof HTMLCanvasElement}))[0],l=n.width,h=n.height,p=[l,0],d=[l,h],f=[0,h],g=u(Object(s.f)(t.getCoordinateFromPixel([0,0]),"EPSG:"+a.a.config.EPSG)),m=u(Object(s.f)(t.getCoordinateFromPixel(p),"EPSG:"+a.a.config.EPSG)),y=u(Object(s.f)(t.getCoordinateFromPixel(d),"EPSG:"+a.a.config.EPSG)),v=u(Object(s.f)(t.getCoordinateFromPixel(f),"EPSG:"+a.a.config.EPSG)),A=Object(s.f)(a.a.map.view.getCenter(),"EPSG:"+a.a.config.EPSG),_=c.point(A),b=o.a.polygon([[g,m,y,v,g]]),x=c.bbox(b);if(b=c.bboxPolygon(x),c.booleanWithin(_,b)||(x[0]=360-Math.abs(x[0])),x[0]=x[0]<73.34312643237152?73.34312643237152:x[0],x[0]=x[0]>135.39390768237615?135.39390768237615:x[0],x[2]=x[2]<73.34312643237152?73.34312643237152:x[2],x[2]=x[2]>135.39390768237615?135.39390768237615:x[2],b=c.bboxPolygon(x),!e)return b;var w=[e,0],C=u(Object(s.f)(t.getCoordinateFromPixel(w),"EPSG:"+a.a.config.EPSG)),E=(new a.a.modules.calculation).distanceOfP2P(g,C,"kilometers");return E=E>5?5:E,o.a.buffer(b,E,{units:"kilometers"})},getBboxByScreen:function(t){var e=c.getCurrentBoundsByScreen(t).geometry.coordinates[0],r=e[0][0],n=e[1][0],i=e[2][0],o=e[3][0],a=e[0][1],s=e[1][1],u=e[2][1],l=e[3][1],h=Math.min(r,n,i,o),p=Math.max(r,n,i,o),d=Math.max(a,s,u,l);return[h,Math.min(a,s,u,l),p,d]}};Object.setPrototypeOf(c,o.a),Object.setPrototypeOf(h,o.a),e.a=c},function(t,e,r){"use strict";r.d(e,"n",(function(){return j})),r.d(e,"m",(function(){return G})),r.d(e,"o",(function(){return H})),r.d(e,"d",(function(){return Q})),r.d(e,"p",(function(){return q})),r.d(e,"q",(function(){return W})),r.d(e,"j",(function(){return Y})),r.d(e,"h",(function(){return X})),r.d(e,"b",(function(){return Z})),r.d(e,"i",(function(){return K})),r.d(e,"r",(function(){return tt})),r.d(e,"k",(function(){return et})),r.d(e,"l",(function(){return rt})),r.d(e,"f",(function(){return J})),r.d(e,"e",(function(){return nt})),r.d(e,"g",(function(){return it})),r.d(e,"a",(function(){return n})),r.d(e,"c",(function(){return i}));var n={};r.r(n),r.d(n,"getContainer",(function(){return u})),r.d(n,"trim",(function(){return c})),r.d(n,"splitWords",(function(){return l})),r.d(n,"create",(function(){return h})),r.d(n,"remove",(function(){return p})),r.d(n,"addClass",(function(){return d})),r.d(n,"removeClass",(function(){return f})),r.d(n,"hasClass",(function(){return g})),r.d(n,"setClass",(function(){return m})),r.d(n,"getClass",(function(){return y})),r.d(n,"empty",(function(){return v})),r.d(n,"setTransform",(function(){return _})),r.d(n,"triggerResize",(function(){return b})),r.d(n,"printCanvas",(function(){return x})),r.d(n,"getViewPortScale",(function(){return w})),r.d(n,"DPR",(function(){return C}));var i={};r.r(i),r.d(i,"sum",(function(){return st})),r.d(i,"max",(function(){return ot})),r.d(i,"min",(function(){return at})),r.d(i,"mean",(function(){return ut})),r.d(i,"mode",(function(){return ct})),r.d(i,"statMap",(function(){return lt})),r.d(i,"getColumn",(function(){return ht})),r.d(i,"getSatByColumn",(function(){return pt}));var o=r(47),a=r.n(o),s=window.document.documentElement.style;function u(t){var e=t;return"string"==typeof t&&(e=document.getElementById(t)),e}function c(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function l(t){return c(t).split(/\s+/)}function h(t,e,r){var n=document.createElement(t);return n.className=e||"",r&&r.appendChild(n),n}function p(t){var e=t.parentNode;e&&e.removeChild(t)}function d(t,e){if(void 0!==t.classList)for(var r=l(e),n=0,i=r.length;n0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(r)}function m(t,e){t instanceof HTMLElement?t.className=e:t.className.baseVal=e}function y(t){return t instanceof SVGElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function v(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)}var A=function(t){if(!s)return t[0];for(var e in t)if(t[e]&&t[e]in s)return t[e];return t[0]}(["transform","WebkitTransform"]);function _(t,e){t.style[A]=e}function b(){if("function"==typeof Event)window.dispatchEvent(new Event("resize"));else{var t=window.document.createEvent("UIEvents");t.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(t)}}function x(t){var e=["padding: "+(t.height/2-8)+"px "+t.width/2+"px;","line-height: "+t.height+"px;","background-image: url("+t.toDataURL()+");"];console.log("%c\n",e.join(""))}function w(){var t,e=document.querySelector('meta[name="viewport"]');if(!e)return 1;var r=(null===(t=e.content)||void 0===t?void 0:t.split(",")).find((function(t){var e=t.split("="),r=a()(e,2),n=r[0];r[1];return"initial-scale"===n}));return r?1*r.split("=")[1]:1}var C=w()<1?1:window.devicePixelRatio,E=r(3),I=r.n(E),M=r(4),S=r.n(M),T=r(12),P=r.n(T),O=r(13),L=r.n(O),k=r(10),R=r.n(k),D=r(104);function B(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=R()(t);if(e){var i=R()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return L()(this,r)}}var N=function(t){P()(r,t);var e=B(r);function r(t,n,i){var o;return I()(this,r),(o=e.call(this,t)).status=void 0,o.url=void 0,o.status=n,o.url=i,o.name=o.constructor.name,o.message=t,o}return S()(r,[{key:"toString",value:function(){return"".concat(this.name,": ").concat(this.message," (").concat(this.status,"): ").concat(this.url)}}]),r}(r.n(D)()(Error));function F(t){var e=new XMLHttpRequest;for(var r in e.open("GET",t.url,!0),t.headers)t.headers.hasOwnProperty(r)&&e.setRequestHeader(r,t.headers[r]);return e.withCredentials="include"===t.credentials,e}var j=function(t,e){return function(t,e){var r=F(t);return r.responseType="arraybuffer",r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){var n=r.response;if(0===n.byteLength&&200===r.status)return e(new Error("http status 200 returned without content."));r.status>=200&&r.status<300&&r.response?e(null,{data:n,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new N(r.statusText,r.status,t.url))},r.send(),r}(t,(function(t,r){if(t)e(t);else if(r){var n=new window.Image;n.crossOrigin="anonymous";var i=window.URL||window.webkitURL;n.onload=function(){e(null,n),i.revokeObjectURL(n.src)};var o=new window.Blob([new Uint8Array(r.data)],{type:"image/png"});n.src=r.data.byteLength?i.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}}))},z=r(22),U=2*Math.PI*6378137/2;function G(t){var e=[1/0,1/0,-1/0,-1/0];return t.forEach((function(t){var r=t.coordinates;!function t(e,r){Array.isArray(r[0])?r.forEach((function(r){t(e,r)})):(e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{enable:!0,decimal:1},n=(t=V(t,e))[0],i=t[1],o=n*U/180,a=Math.log(Math.tan((90+i)*Math.PI/360))/(Math.PI/180);return a=a*U/180,r.enable&&(o=Number(o.toFixed(r.decimal)),a=Number(a.toFixed(r.decimal))),3===t.length?[o,a,t[2]]:[o,a]}function V(t,e){if(!1===e)return t;var r=function(t){if(null==t)throw new Error("lng is required");return(t>180||t<-180)&&((t%=360)>180&&(t=-360+t),t<-180&&(t=360+t),0===t&&(t=0)),t}(t[0]),n=function(t){if(null==t)throw new Error("lat is required");return(t>90||t<-90)&&((t%=180)>90&&(t=-180+t),t<-90&&(t=180+t),0===t&&(t=0)),t}(t[1]);return n>85&&(n=85),n<-85&&(n=-85),3===t.length?[r,n,t[2]]:[r,n]}function Q(t){var e=Math.max(Math.min(85.0511287798,t[1]),-85.0511287798),r=Math.PI/180,n=t[0]*r,i=e*r;i=Math.log(Math.tan(Math.PI/4+i/2));return n=(256<<20)*(.5/Math.PI*n+.5),i=(256<<20)*(-.5/Math.PI*i+(r=.5)),[Math.floor(n),Math.floor(i)]}function q(t,e,r){var n=Object(z.degreesToRadians)(e[1]-t[1]),i=Object(z.degreesToRadians)(e[0]-t[0]),o=Object(z.degreesToRadians)(t[1]),a=Object(z.degreesToRadians)(e[1]),s=Math.pow(Math.sin(n/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(o)*Math.cos(a);return Object(z.radiansToLength)(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)),"meters")}function W(t,e){var r=Math.abs(t[1][1]-t[0][1])*e,n=Math.abs(t[1][0]-t[0][0])*e;return[[t[0][0]-n,t[0][1]-r],[t[1][0]+n,t[1][1]+r]]}function Y(t,e){return t[0][0]<=e[0][0]&&t[0][1]<=e[0][1]&&t[1][0]>=e[1][0]&&t[1][1]>=e[1][1]}function X(t){return[[t[0],t[1]],[t[2],t[3]]]}var Z=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,r=arguments.length>1?arguments[1]:void 0;I()(this,t),this.limit=void 0,this.cache=void 0,this.destroy=void 0,this.order=void 0,this.limit=e,this.destroy=r||this.defaultDestroy,this.order=[],this.clear()}return S()(t,[{key:"clear",value:function(){var t=this;this.order.forEach((function(e){t.delete(e)})),this.cache={},this.order=[]}},{key:"get",value:function(t){var e=this.cache[t];return e&&(this.deleteOrder(t),this.appendOrder(t)),e}},{key:"set",value:function(t,e){this.cache[t]?(this.delete(t),this.cache[t]=e,this.appendOrder(t)):(Object.keys(this.cache).length===this.limit&&this.delete(this.order[0]),this.cache[t]=e,this.appendOrder(t))}},{key:"delete",value:function(t){var e=this.cache[t];e&&(this.deleteCache(t),this.deleteOrder(t),this.destroy(e,t))}},{key:"deleteCache",value:function(t){delete this.cache[t]}},{key:"deleteOrder",value:function(t){var e=this.order.findIndex((function(e){return e===t}));e>=0&&this.order.splice(e,1)}},{key:"appendOrder",value:function(t){this.order.push(t)}},{key:"defaultDestroy",value:function(t,e){return null}}]),t}();function K(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}var J,$=r(835);function tt(t){var e=$.a(t),r=[0,0,0,0];return null!=e&&(r[0]=e.r/255,r[1]=e.g/255,r[2]=e.b/255,r[3]=e.opacity),r}function et(t){return(t&&t[0])+256*(t&&t[1])+65536*(t&&t[2])-1}function rt(t){return[t+1&255,t+1>>8&255,t+1>>8>>8&255]}!function(t){t.CENTER="center",t.TOP="top",t["TOP-LEFT"]="top-left",t["TOP-RIGHT"]="top-right",t.BOTTOM="bottom",t["BOTTOM-LEFT"]="bottom-left",t.LEFT="left",t.RIGHT="right"}(J||(J={}));var nt={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function it(t,e,r){var n=t.classList;for(var i in nt)nt.hasOwnProperty(i)&&n.remove("l7-".concat(r,"-anchor-").concat(i));n.add("l7-".concat(r,"-anchor-").concat(e))}function ot(t){if(0===t.length)throw new Error("max requires at least one data point");for(var e=t[0],r=1;re&&(e=t[r]);return 1*e}function at(t){if(0===t.length)throw new Error("min requires at least one data point");for(var e=t[0],r=1;rn&&(n=i,r=e),i=1,e=t[o]):i++;return 1*r}var lt={min:at,max:ot,mean:ut,sum:st,mode:ct};function ht(t,e){return t.map((function(t){return t[e]}))}function pt(t,e){return lt[t](e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.METADATA_KEY=void 0;var n=r(77);e.METADATA_KEY=n;var i=r(727);Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return i.Container}});var o=r(139);Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return o.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return o.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return o.TargetTypeEnum}});var a=r(743);Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return a.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return a.ContainerModule}});var s=r(744);Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return s.injectable}});var u=r(745);Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return u.tagged}});var c=r(746);Object.defineProperty(e,"named",{enumerable:!0,get:function(){return c.named}});var l=r(410);Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return l.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return l.LazyServiceIdentifer}});var h=r(747);Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return h.optional}});var p=r(748);Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return p.unmanaged}});var d=r(749);Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return d.multiInject}});var f=r(750);Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return f.targetName}});var g=r(751);Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return g.postConstruct}});var m=r(408);Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return m.MetadataReader}});var y=r(172);Object.defineProperty(e,"id",{enumerable:!0,get:function(){return y.id}});var v=r(150);Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return v.decorate}});var A=r(413);Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return A.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return A.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return A.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return A.typeConstraint}});var _=r(219);Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return _.getServiceIdentifierAsString}});var b=r(752);Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return b.multiBindToService}})},function(t,e,r){var n=r(612);function i(e,r,o){return"undefined"!=typeof Reflect&&Reflect.get?(t.exports=i=Reflect.get,t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=i=function(t,e,r){var i=n(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(r):o.value}},t.exports.default=t.exports,t.exports.__esModule=!0),i(e,r,o||e)}t.exports=i,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.d(e,"c",(function(){return n})),r.d(e,"d",(function(){return o})),r.d(e,"j",(function(){return a})),r.d(e,"k",(function(){return s})),r.d(e,"i",(function(){return u})),r.d(e,"e",(function(){return c})),r.d(e,"m",(function(){return l})),r.d(e,"h",(function(){return h})),r.d(e,"l",(function(){return p})),r.d(e,"b",(function(){return d})),r.d(e,"a",(function(){return f})),r.d(e,"f",(function(){return g})),r.d(e,"g",(function(){return m}));var n=6371008.8,i={meters:n,metres:n,millimeters:1e3*n,millimetres:1e3*n,centimeters:100*n,centimetres:100*n,kilometers:n/1e3,kilometres:n/1e3,miles:n/1609.344,nauticalmiles:n/1852,inches:39.37*n,yards:n/1.0936,feet:3.28084*n,radians:1,degrees:n/111325};function o(t,e,r){if(!m(r=r||{}))throw new Error("options is invalid");var n=r.bbox,i=r.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");n&&y(n),i&&v(i);var o={type:"Feature"};return i&&(o.id=i),n&&(o.bbox=n),o.properties=e||{},o.geometry=t,o}function a(t,e,r){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!g(t[0])||!g(t[1]))throw new Error("coordinates must contain numbers");return o({type:"Point",coordinates:t},e,r)}function s(t,e,r){if(!t)throw new Error("coordinates is required");for(var n=0;n=0))throw new Error("length must be a positive number");return l(h(t,e),r||"kilometers")}function g(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function m(t){return!!t&&t.constructor===Object}function y(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!g(t))throw new Error("bbox must only contain numbers")}))}function v(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},function(t,e,r){"use strict";e.a={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"}},function(t,e,r){"use strict";r.d(e,"b",(function(){return I})),r.d(e,"a",(function(){return M}));var n=r(50),i=r.n(n),o=r(23),a=r.n(o),s=r(3),u=r.n(s),c=r(4),l=r.n(c),h=r(93),p=r.n(h),d=r(90),f=r.n(d),g=(r(62),r(463),r(250),r(160),r(55)),m=r.n(g),y=r(67);Object.prototype.hasOwnProperty;r(9),r(1);var v=r(251),A=["mousedown","mouseup","click","dblclick","contextmenu"],_=["mousemove","mouseenter","mouseleave","mouseover","mouseout"],b=["dragstart","dragging","dragend"],x="getCanvas",w=function(t,e){var r=[];m()(t)||(t=[t]);for(var n=function(n,i){var o=t[n],a={},s={};s=o.geometry,(a=o.properties).__layerId__=e,r.push({type:"Feature",properties:a,geometry:s})},i=0,o=t.length;i0&&-1!==_.indexOf(e)?c.style.cursor="pointer":0===E.length&&(c.style.cursor="grab")),E=u;var l=Object.assign({},i,{type:e,originalFeatures:u}),h=w(u,r);n(l,h)}}}},{key:"on",value:function(e){return function(r,n,i){var o=function(t,e){};if(t.off(e)(r,n),-1!==A.indexOf(r))o=t.delegate(e,r,n,t._setCommonListener(i)),y.a.on(e)(r,o,n);else if(-1!==_.indexOf(r)){switch(r){case"mouseenter":case"mouseover":o=t.delegate(e,r,n,t._setMouseEnterListener(i));break;case"mouseleave":case"mouseout":o=t.delegate(e,r,n,t._setMouseLeaveListener(i));break;default:o=t.delegate(e,r,n,t._setCommonListener(i))}y.a.on(e)("mousemove",o)}else{if(-1===b.indexOf(r))throw new Error('Layer event system do not support "'.concat(r,'" event, \n please use one of these : [').concat(A.concat(_,b).toString(),"]"));o=t.delegate(e,r,n,t._setMapboxMouseDragListener(i,e,n,r)),y.a.on(e)("mousedown",o)}t._ctxListenerSet=t._ctxListenerSet||{},t._ctxListenerSet[n]=t._ctxListenerSet[n]||{},t._ctxListenerSet[n][r]=t._ctxListenerSet[n][r]||new Set,t._ctxListenerSet[n][r].add(o)}}},{key:"_setMouseEnterListener",value:function(t){var e=!1;return function(r,n){0===n.length?e=!1:e||(e=!0,t(r,n))}}},{key:"_setMouseLeaveListener",value:function(t){var e=!1;return function(r,n){n.length>0?e=!0:e&&(e=!1,t(r,n))}}},{key:"_setCommonListener",value:function(t){return function(e,r){0!==r.length&&t(e,r)}}},{key:"_setMapboxMouseDragListener",value:function(t,e,r,n){return function(i,o){var a="inactive",s={},u={},c=M.getLayerIdsDepts(r),l=Array.from(c),h=e.getLayer(l[0]).source,p=e.getSource(h),d=p._data,f=-1;if(0===o.length)a="inactive";else if("inactive"===a){var g=(s=o[0]).properties.dataId||s.properties.id||s.properties.argsCount>1||null;a="pending",e.dragPan.disable();for(var m=0,y=d.features.length;m1||v.properties.id)===g){f=m;break}}var A=function(e){"inactive"!==a&&-1!==f&&("pending"===a&&(a="active","dragstart"===n&&t(i,[s])),d.features[f].geometry.coordinates=[e.lngLat.lng,e.lngLat.lat],p.setData(d),u=d.features[f],"dragging"===n&&t(i,[u]))};e.on("mousemove",A),e.once("mouseup",(function(){"active"===a&&"dragend"===n&&t(i,[u]),a="inactive",e.dragPan.enable(),e.off("mousemove",A),f=-1}))}}}},{key:"_setOpenLayersMouseDragListener",value:function(t,e,r,n){return function(i,o){var a="inactive",s=o[0];if(0===o.length||s.properties&&s.properties.cluster)console.warn("\n Cluster layer don't support drag event,\n Please use one of these: ".concat(A.concat(_)," \n "));else{var u=M.getLayerIdsDepts(r),c=Array.from(u)[0],l=null;if(e.forEachLayerAtPixel([i.point.x,i.point.y],(function(t){t.ol_uid===c&&(l=t)})),l){var h=i.originalFeatures;if(0===o.length)a="inactive";else if("inactive"===a){var p=h[0].getGeometry();a="pending",C(!1,e);var d=function(e){"inactive"!==a&&null!=p&&("pending"===a&&(a="active","dragstart"===n&&t(i,[s])),"dragging"===n&&t(i,[s]),p.setCoordinates([e.lngLat.lat,e.lngLat.lng]))};y.a.on(e)("mousemove",d),y.a.on(e)("mouseup",(function r(){"active"===a&&"dragend"===n&&t(i,[s]),a="inactive",C(!0,e),y.a.off(e)("mousemove",d),y.a.off(e)("mouseup",r)}))}}}}}},{key:"off",value:function(e){return function(r,n){var i=t._ctxListenerSet[n]||{};if(!p()(i)){var o=i[r];o&&0!==o.size&&o.forEach((function(t){-1!==_.indexOf(r)?y.a.off(e)("mousemove",t):-1!==b.indexOf(r)?y.a.off(e)("mousedown",t):y.a.off(e)(r,t)}))}}}},{key:"clear",value:function(e){return function(r){var n=t._ctxListenerSet[r]||{};if(!p()(n))for(var o=function(t,r){var i=Reflect.ownKeys(n)[t],o=n[i];if(!o||0===o.size)return{v:void 0};o.forEach((function(t){return y.a.off(e)(i,t)}))},a=0,s=Reflect.ownKeys(n).length;a=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r}function b(t,e){void 0===e&&(e="kilometers");var r=i[e];if(!r)throw new Error(e+" units is invalid");return t*r}function x(t,e){void 0===e&&(e="kilometers");var r=i[e];if(!r)throw new Error(e+" units is invalid");return t/r}function w(t,e){return E(x(t,e))}function C(t){var e=t%360;return e<0&&(e+=360),e}function E(t){return 180*(t%(2*Math.PI))/Math.PI}function I(t){return t%360*Math.PI/180}function M(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return b(x(t,e),r)}function S(t,e,r){if(void 0===e&&(e="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=a[e];if(!n)throw new Error("invalid original units");var i=a[r];if(!i)throw new Error("invalid final units");return t/n*i}function T(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function P(t){return!!t&&t.constructor===Object}function O(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!T(t))throw new Error("bbox must only contain numbers")}))}function L(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},function(t,e,r){var n=r(507),i=r(325),o=r(279),a=r(508);t.exports=function(t){return n(t)||i(t)||o(t)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n={IEventEmitter:Symbol.for("IEventEmitter"),ISceneService:Symbol.for("ISceneService"),IGlobalConfigService:Symbol.for("IGlobalConfigService"),ICameraService:Symbol.for("ICameraService"),ICoordinateSystemService:Symbol.for("ICoordinateSystemService"),ILayerService:Symbol.for("ILayerService"),ILayerMappingService:Symbol.for("ILayerMappingService"),ILayerStyleService:Symbol.for("ILayerStyleService"),ILogService:Symbol.for("ILogService"),IMapService:Symbol.for("IMapService"),IMarkerService:Symbol.for("IMarkerService"),IPopupService:Symbol.for("PopupService"),IFactoryMapService:Symbol.for("Factory"),IRendererService:Symbol.for("IRendererService"),IShaderModuleService:Symbol.for("IShaderModuleService"),IIconService:Symbol.for("IIconService"),IFontService:Symbol.for("IFontService"),IInteractionService:Symbol.for("IInteractionService"),IPickingService:Symbol.for("IPickingService"),IControlService:Symbol.for("IControlService"),IStyleAttributeService:Symbol.for("IStyleAttributeService"),ILayer:Symbol.for("ILayer"),ILayerPlugin:Symbol.for("ILayerPlugin"),INormalPass:Symbol.for("INormalPass"),IPostProcessor:Symbol.for("IPostProcessor"),IPostProcessingPass:Symbol.for("IPostProcessingPass"),IFactoryPostProcessingPass:Symbol.for("Factory"),IFactoryNormalPass:Symbol.for("Factory"),IMultiPassRenderer:Symbol.for("IMultiPassRenderer"),SceneID:Symbol.for("SceneID"),MapConfig:Symbol.for("MapConfig")}},function(t,e,r){"use strict";r.d(e,"b",(function(){return h})),r.d(e,"c",(function(){return p})),r.d(e,"d",(function(){return d})),r.d(e,"e",(function(){return f})),r.d(e,"f",(function(){return g})),r.d(e,"g",(function(){return m})),r.d(e,"h",(function(){return v})),r.d(e,"i",(function(){return A})),r.d(e,"j",(function(){return _})),r.d(e,"k",(function(){return b})),r.d(e,"l",(function(){return x})),r.d(e,"m",(function(){return w})),r.d(e,"n",(function(){return C})),r.d(e,"o",(function(){return E})),r.d(e,"p",(function(){return S})),r.d(e,"q",(function(){return P})),r.d(e,"r",(function(){return O})),r.d(e,"s",(function(){return k})),r.d(e,"t",(function(){return R})),r.d(e,"u",(function(){return D})),r.d(e,"v",(function(){return B})),r.d(e,"w",(function(){return N})),r.d(e,"x",(function(){return F})),r.d(e,"y",(function(){return j})),r.d(e,"z",(function(){return z})),r.d(e,"B",(function(){return U})),r.d(e,"C",(function(){return G})),r.d(e,"A",(function(){return H})),r.d(e,"a",(function(){return V}));var n=r(48),i=r(184),o=0,a=1,s=2,u=4,c=8,l=16;function h(t){for(var e=v(),r=0,n=t.length;ri&&(f|=u),dh&&(f|=s),f===o&&(f=a),f}function v(){return[1/0,1/0,-1/0,-1/0]}function A(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}function _(t){return A(1/0,1/0,-1/0,-1/0,t)}function b(t,e){var r=t[0],n=t[1];return A(r,n,r,n,e)}function x(t,e){return M(_(e),t)}function w(t,e,r,n,i){return S(_(i),t,e,r,n)}function C(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function E(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function I(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function M(t,e){for(var r=0,n=e.length;re[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function U(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function G(t,e){var r=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=r,t[2]+=r,t[1]-=n,t[3]+=n}function H(t,e,r){var n=!1,i=y(t,e),o=y(t,r);if(i===a||o===a)n=!0;else{var h,p,d=t[0],f=t[1],g=t[2],m=t[3],v=e[0],A=e[1],_=r[0],b=r[1],x=(b-A)/(_-v);o&s&&!(i&s)&&(n=(h=_-(b-m)/x)>=d&&h<=g),n||!(o&u)||i&u||(n=(p=b-(_-g)*x)>=f&&p<=m),n||!(o&c)||i&c||(n=(h=_-(b-f)/x)>=d&&h<=g),n||!(o&l)||i&l||(n=(p=b-(_-d)*x)>=f&&p<=m)}return n}function V(t,e,r){var n=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return e(n,n,2),function(t,e,r){return A(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}([n[0],n[2],n[4],n[6]],[n[1],n[3],n[5],n[7]],r)}},function(t,e,r){"use strict";function n(){return function(){throw new Error("Unimplemented abstract method.")}()}r.d(e,"b",(function(){return n})),r.d(e,"c",(function(){return o})),r.d(e,"a",(function(){return a}));var i=0;function o(t){return t.ol_uid||(t.ol_uid=String(++i))}var a="5.3.3"},function(t,e,r){"use strict";var n=r(5);e.a={isOfMetaType:function(t){return function(e){var r=e.featureTarget;return!!r&&(!!r.properties&&r.properties.meta===t)}},isShiftMousedown:function(t){return!!t.originalEvent&&(!!t.originalEvent.shiftKey&&0===t.originalEvent.button)},isActiveFeature:function(t){return!!t.featureTarget&&(!!t.featureTarget.properties&&(t.featureTarget.properties.active===n.g.activeStates.ACTIVE&&t.featureTarget.properties.meta===n.g.meta.FEATURE))},isInactiveFeature:function(t){return!!t.featureTarget&&(!!t.featureTarget.properties&&(t.featureTarget.properties.active===n.g.activeStates.INACTIVE&&t.featureTarget.properties.meta===n.g.meta.FEATURE))},noTarget:function(t){return void 0===t.featureTarget},isFeature:function(t){return!!t.featureTarget&&(!!t.featureTarget.properties&&t.featureTarget.properties.meta===n.g.meta.FEATURE)},isVertex:function(t){var e=t.featureTarget;return!!e&&(!!e.properties&&e.properties.meta===n.g.meta.VERTEX)},isShiftDown:function(t){return!!t.originalEvent&&!0===t.originalEvent.shiftKey},isEscapeKey:function(t){return 27===t.keyCode},isEnterKey:function(t){return 13===t.keyCode},isBackSpaceKey:function(t){return 8===t.keyCode},isRKey:function(t){return 82===t.keyCode},isDeleteKey:function(t){return 46===t.keyCode},true:function(){return!0}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return u})),r.d(e,"f",(function(){return n})),r.d(e,"c",(function(){return c})),r.d(e,"g",(function(){return l})),r.d(e,"h",(function(){return h})),r.d(e,"i",(function(){return p})),r.d(e,"e",(function(){return i})),r.d(e,"d",(function(){return d}));var n=r(1).a,i=function(){return!1},o=function(t){return n.getProps(t,"map").map.getBearing()},a=r(2),s=function(t,e){var r=n.getProps(e,"map").map,i=r._canvas,o=i.width,s=i.height,u=[o,0],c=[o,s],l=[0,s],h=Object(a.formatScope)(r.unproject([0,0]).toArray()),p=Object(a.formatScope)(r.unproject(u).toArray()),d=Object(a.formatScope)(r.unproject(c).toArray()),f=Object(a.formatScope)(r.unproject(l).toArray()),g=a.turf.polygon([[h,p,d,f,h]]);return t?a.turf.buffer(g,t,{units:"kilometers"}):g},u=s;function c(){return Object(a.isUndef)(n.clientId)&&(n.clientId=Object(a.guid)()),n.clientId}var l=function(t,e,r){n.getProps(r,"map").map.off(t,e)},h=function(t,e,r){n.getProps(r,"map").map.on(t,e)},p=(r(43),function(t,e){n.getProps(e,"map").map.setCenter(t)}),d=function(t){return n.getProps(t,"map").map.getZoom()}},function(t,e,r){"use strict";var n=r(76);r.d(e,"a",(function(){return n}));var i=r(156);r.d(e,"b",(function(){return i}));var o=r(247);r.d(e,"c",(function(){return o}));var a=r(223);r.d(e,"d",(function(){return a}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return g})),r.d(e,"b",(function(){return m}));var n=r(47),i=r.n(n),o=r(3),a=r.n(o),s=r(4),u=r.n(s),c=r(144),l=r.n(c),h=r(167),p=r.n(h),d=r(9),f=r(103),g=function(){function t(){a()(this,t)}return u()(t,null,[{key:"setGroupDepts",value:function(e,r,n){t.groupDepts[e][r]=n}},{key:"getGroupDepts",value:function(e,r){return t.groupDepts[e][r]}},{key:"removeGroupDepts",value:function(e,r){delete t.groupDepts[e][r]}},{key:"clearGroupDepts",value:function(e){t.groupDepts[e]={}}},{key:"getGroupDeptsCount",value:function(t){return Object.keys(this.groupDepts[t]).length}},{key:"getAllGroupOverlaysCount",value:function(){for(var t=0,e=0,r=Object.values(this.groupDepts);er)throw new Error("The maximum number of overlays cannot exceed ".concat(r));var n=e.getId();return e.getElement().classList.add(this._groupName),e.addToMap(),this._overlays[n]=e,this}},{key:"overlaysCount",get:function(){return Object.keys(this._overlays).length}},{key:"removeOverlay",value:function(t){var e=t.getId();return t.removeFromMap(),delete this._overlays[e],this}},{key:"hasOverlay",value:function(t){var e=t.getId();return!l()(this._overlays[e])}},{key:"clearOverlays",value:function(){for(var t=0,e=Object.entries(this._overlays);t0?1:0))*r,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*r))];return o[0]>i&&(o[0]=i),o[0]<-i&&(o[0]=-i),o[1]>i&&(o[1]=i),o[1]<-i&&(o[1]=-i),o}function v(t){var e=180/Math.PI,r=6378137;return[t[0]*e/r,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/r)))*e]}var A=function(t){if(!t)throw new Error("geojson is required");var e=[];return Object(l.flattenEach)(t,(function(t){!function(t,e){var r=[],n=t.geometry;if(null!==n){switch(n.type){case"Polygon":r=Object(o.c)(n);break;case"LineString":r=[Object(o.c)(n)]}r.forEach((function(r){(function(t,e){var r=[];return t.reduce((function(t,n){var o,a,s,u,c,l,h=Object(i.lineString)([t,n],e);return h.bbox=(a=n,s=(o=t)[0],u=o[1],c=a[0],l=a[1],[sc?s:c,u>l?u:l]),r.push(h),n})),r})(r,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),Object(i.featureCollection)(e)},_=r(464),b=r.n(_);function x(t,e){var r=Object(o.c)(t),n=Object(o.c)(e);if(2!==r.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==n.length)throw new Error(" line2 must only contain 2 coordinates");var a=r[0][0],s=r[0][1],u=r[1][0],c=r[1][1],l=n[0][0],h=n[0][1],p=n[1][0],d=n[1][1],f=(d-h)*(u-a)-(p-l)*(c-s),g=(p-l)*(s-h)-(d-h)*(a-l),m=(u-a)*(s-h)-(c-s)*(a-l);if(0===f)return null;var y=g/f,v=m/f;if(y>=0&&y<=1&&v>=0&&v<=1){var A=a+y*(u-a),_=s+y*(c-s);return Object(i.point)([A,_])}return null}var w=function(t,e){var r={},n=[];if("LineString"===t.type&&(t=Object(i.feature)(t)),"LineString"===e.type&&(e=Object(i.feature)(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var a=x(t,e);return a&&n.push(a),Object(i.featureCollection)(n)}var s=b()();return s.load(A(e)),Object(l.featureEach)(A(t),(function(t){Object(l.featureEach)(s.search(t),(function(e){var i=x(t,e);if(i){var a=Object(o.c)(i).join(",");r[a]||(r[a]=!0,n.push(i))}}))})),Object(i.featureCollection)(n)};var C=function(t,e,r){void 0===r&&(r={});var n=Object(i.point)([1/0,1/0],{dist:1/0}),c=0;return Object(l.flattenEach)(t,(function(t){for(var l=Object(o.c)(t),h=0;h0&&((_=A.features[0]).properties.dist=Object(u.a)(e,_,r),_.properties.location=c+Object(u.a)(p,_,r)),p.properties.dist3?Object(i.polygon)([n]):null}(e);return x?t(x,{properties:r.properties}):M(e,{properties:r.properties})}},T=r(57),P=r(19);function O(t,e,r){if(r=r||{},!Object(P.g)(r))throw new Error("options is invalid");if(!0===r.final)return function(t,e){var r=O(e,t);return r=(r+180)%360}(t,e);var n=Object(T.a)(t),i=Object(T.a)(e),o=Object(P.b)(n[0]),a=Object(P.b)(i[0]),s=Object(P.b)(n[1]),u=Object(P.b)(i[1]),c=Math.sin(a-o)*Math.cos(u),l=Math.cos(s)*Math.sin(u)-Math.sin(s)*Math.cos(u)*Math.cos(a-o);return Object(P.l)(Math.atan2(c,l))}var L=O,k=r(131);var R=function(t,e,r){if(r=r||{},!Object(P.g)(r))throw new Error("options is invalid");var n=r.units,i=Object(T.a)(t),o=Object(T.a)(e),a=Object(P.b)(o[1]-i[1]),s=Object(P.b)(o[0]-i[0]),u=Object(P.b)(i[1]),c=Object(P.b)(o[1]),l=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(u)*Math.cos(c);return Object(P.m)(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),n)};var D=function(t,e){var r=R(t,e),n=L(t,e);return Object(k.a)(t,r/2,n)};function B(t){var e=0;if(t&&t.length>0){e+=Math.abs(N(t[0]));for(var r=1;r2){for(a=0;a0?1:0))*r,n*Math.log(Math.tan(.25*Math.PI+.5*t[1]*r))];return o[0]>i&&(o[0]=i),o[0]<-i&&(o[0]=-i),o[1]>i&&(o[1]=i),o[1]<-i&&(o[1]=-i),o}function q(t){var e=180/Math.PI,r=6378137;return[t[0]*e/r,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/r)))*e]}var W=function(){return new Y};function Y(){this.reset()}Y.prototype={constructor:Y,reset:function(){this.s=this.t=0},add:function(t){Z(X,t,this.t),Z(this,X.s,this.s),this.s?this.t+=X.t:this.s=X.t},valueOf:function(){return this.s}};var X=new Y;function Z(t,e,r){var n=t.s=e+r,i=n-e,o=n-i;t.t=e-o+(r-i)}var K=1e-6,J=Math.PI,$=J/2,tt=J/4,et=2*J,rt=180/J,nt=J/180,it=Math.abs,ot=Math.atan,at=Math.atan2,st=Math.cos,ut=(Math.ceil,Math.exp),ct=(Math.floor,Math.log),lt=(Math.pow,Math.sin),ht=(Math.sign,Math.sqrt),pt=Math.tan;function dt(t){return t>1?0:t<-1?J:Math.acos(t)}function ft(t){return t>1?$:t<-1?-$:Math.asin(t)}function gt(){}function mt(t,e){t&&vt.hasOwnProperty(t.type)&&vt[t.type](t,e)}var yt={Feature:function(t,e){mt(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nJ?t-et:t<-J?t+et:t,e]}function Ot(t,e,r){return(t%=et)?e||r?Tt(kt(t),Rt(e,r)):kt(t):e||r?Rt(e,r):Pt}function Lt(t){return function(e,r){return[(e+=t)>J?e-et:e<-J?e+et:e,r]}}function kt(t){var e=Lt(t);return e.invert=Lt(-t),e}function Rt(t,e){var r=st(t),n=lt(t),i=st(e),o=lt(e);function a(t,e){var a=st(e),s=st(t)*a,u=lt(t)*a,c=lt(e),l=c*r+s*n;return[at(u*i-l*o,s*r-c*n),ft(l*i+u*o)]}return a.invert=function(t,e){var a=st(e),s=st(t)*a,u=lt(t)*a,c=lt(e),l=c*i-u*o;return[at(u*i+c*o,s*r+l*n),ft(l*r-s*n)]},a}Pt.invert=Pt;function Dt(t,e,r,n,i,o){if(r){var a=st(e),s=lt(e),u=n*r;null==i?(i=e+n*et,o=e-u/2):(i=Bt(a,i),o=Bt(a,o),(n>0?io)&&(i+=n*et));for(var c,l=i;n>0?l>o:l1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}},Ft=function(t,e){return it(t[0]-e[0])=0;--o)i.point((l=c[o])[0],l[1]);else n(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}};function Ut(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0)do{c.point(0===l||3===l?t:r,l>1?n:e)}while((l=(l+s+4)%4)!==h);else c.point(o[0],o[1])}function a(n,i){return it(n[0]-t)0?0:3:it(n[0]-r)0?2:1:it(n[1]-e)0?1:0:i>0?3:2}function s(t,e){return u(t.x,e.x)}function u(t,e){var r=a(t,1),n=a(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(a){var u,c,l,h,p,d,f,g,m,y,v,A=a,_=Nt(),b={point:x,lineStart:function(){b.point=w,c&&c.push(l=[]);y=!0,m=!1,f=g=NaN},lineEnd:function(){u&&(w(h,p),d&&m&&_.rejoin(),u.push(_.result()));b.point=x,m&&A.lineEnd()},polygonStart:function(){A=_,u=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,r=0,i=c.length;rn&&(p-o)*(n-a)>(d-a)*(t-o)&&++e:d<=n&&(p-o)*(n-a)<(d-a)*(t-o)&&--e;return e}(),r=v&&e,i=(u=Object(Gt.e)(u)).length;(r||i)&&(a.polygonStart(),r&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&zt(u,s,e,o,a),a.polygonEnd());A=a,u=c=l=null}};function x(t,e){i(t,e)&&A.point(t,e)}function w(o,a){var s=i(o,a);if(c&&l.push([o,a]),y)h=o,p=a,d=s,y=!1,s&&(A.lineStart(),A.point(o,a));else if(s&&m)A.point(o,a);else{var u=[f=Math.max(-1e9,Math.min(1e9,f)),g=Math.max(-1e9,Math.min(1e9,g))],_=[o=Math.max(-1e9,Math.min(1e9,o)),a=Math.max(-1e9,Math.min(1e9,a))];!function(t,e,r,n,i,o){var a,s=t[0],u=t[1],c=0,l=1,h=e[0]-s,p=e[1]-u;if(a=r-s,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=i-s,h||!(a<0)){if(a/=h,h<0){if(a>l)return;a>c&&(c=a)}else if(h>0){if(a0)){if(a/=p,p<0){if(a0){if(a>l)return;a>c&&(c=a)}if(a=o-u,p||!(a<0)){if(a/=p,p<0){if(a>l)return;a>c&&(c=a)}else if(p>0){if(a0&&(t[0]=s+c*h,t[1]=u+c*p),l<1&&(e[0]=s+l*h,e[1]=u+l*p),!0}}}}}(u,_,t,e,r,n)?s&&(A.lineStart(),A.point(o,a),v=!1):(m||(A.lineStart(),A.point(u[0],u[1])),A.point(_[0],_[1]),s||A.lineEnd(),v=!1)}f=o,g=a,m=s}return b}}var Vt=W(),Qt=function(t,e){var r=e[0],n=e[1],i=[lt(r),-st(r),0],o=0,a=0;Vt.reset();for(var s=0,u=t.length;s=0?1:-1,C=w*x,E=C>J,I=f*_;if(Vt.add(at(I*w*lt(C),g*b+I*st(C))),o+=E?x+w*et:x,E^p>=r^v>=r){var M=Et(wt(h),wt(y));St(M);var S=Et(i,M);St(S);var T=(E^x>=0?-1:1)*ft(S[2]);(n>T||n===T&&(M[0]||M[1]))&&(a+=E^x>=0?1:-1)}}return(o<-K||oXt&&(Xt=t);eZt&&(Zt=e)},lineStart:gt,lineEnd:gt,polygonStart:gt,polygonEnd:gt,result:function(){var t=[[Wt,Yt],[Xt,Zt]];return Xt=Zt=-(Yt=Wt=1/0),t}};function Jt(t){this._context=t}Jt.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,et)}},result:gt};W();function $t(){this._string=[]}function te(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}$t.prototype={_radius:4.5,_circle:te(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=te(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var ee=function(t,e,r,n){return function(i,o){var a,s,u,c=e(o),l=i.invert(n[0],n[1]),h=Nt(),p=e(h),d=!1,f={point:g,lineStart:y,lineEnd:v,polygonStart:function(){f.point=A,f.lineStart=_,f.lineEnd=b,s=[],a=[]},polygonEnd:function(){f.point=g,f.lineStart=y,f.lineEnd=v,s=Object(Gt.e)(s);var t=Qt(a,l);s.length?(d||(o.polygonStart(),d=!0),zt(s,ne,t,r,o)):t&&(d||(o.polygonStart(),d=!0),o.lineStart(),r(null,null,1,o),o.lineEnd()),d&&(o.polygonEnd(),d=!1),s=a=null},sphere:function(){o.polygonStart(),o.lineStart(),r(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function g(e,r){var n=i(e,r);t(e=n[0],r=n[1])&&o.point(e,r)}function m(t,e){var r=i(t,e);c.point(r[0],r[1])}function y(){f.point=m,c.lineStart()}function v(){f.point=g,c.lineEnd()}function A(t,e){u.push([t,e]);var r=i(t,e);p.point(r[0],r[1])}function _(){p.lineStart(),u=[]}function b(){A(u[0][0],u[0][1]),p.lineEnd();var t,e,r,n,i=p.clean(),c=h.result(),l=c.length;if(u.pop(),a.push(u),u=null,l)if(1&i){if((e=(r=c[0]).length-1)>0){for(d||(o.polygonStart(),d=!0),o.lineStart(),t=0;t1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(re))}return f}};function re(t){return t.length>1}function ne(t,e){return((t=t.x)[0]<0?t[1]-$-K:$-t[1])-((e=e.x)[0]<0?e[1]-$-K:$-e[1])}var ie=ee((function(){return!0}),(function(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?J:-J,u=it(o-r);it(u-J)0?$:-$),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),e=0):i!==s&&u>=J&&(it(r-i)K?ot((lt(e)*(o=st(n))*lt(r)-lt(n)*(i=st(e))*lt(t))/(i*o*a)):(e+n)/2}(r,n,o,a),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=o,n=a),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}}),(function(t,e,r,n){var i;if(null==t)i=r*$,n.point(-J,i),n.point(0,i),n.point(J,i),n.point(J,0),n.point(J,-i),n.point(0,-i),n.point(-J,-i),n.point(-J,0),n.point(-J,i);else if(it(t[0]-e[0])>K){var o=t[0]0,i=it(r)>K;function o(t,e){return st(t)*st(e)>r}function a(t,e,n){var i=[1,0,0],o=Et(wt(t),wt(e)),a=Ct(o,o),s=o[0],u=a-s*s;if(!u)return!n&&t;var c=r*a/u,l=-r*s/u,h=Et(i,o),p=Mt(i,c);It(p,Mt(o,l));var d=h,f=Ct(p,d),g=Ct(d,d),m=f*f-g*(Ct(p,p)-1);if(!(m<0)){var y=ht(m),v=Mt(d,(-f-y)/g);if(It(v,p),v=xt(v),!n)return v;var A,_=t[0],b=e[0],x=t[1],w=e[1];b<_&&(A=_,_=b,b=A);var C=b-_,E=it(C-J)0^v[1]<(it(v[0]-_)J^(_<=v[0]&&v[0]<=b)){var I=Mt(d,(-f+y)/g);return It(I,p),[v,xt(I)]}}}function s(e,r){var i=n?t:J-t,o=0;return e<-i?o|=1:e>i&&(o|=2),r<-i?o|=4:r>i&&(o|=8),o}return ee(o,(function(t){var e,r,u,c,l;return{lineStart:function(){c=u=!1,l=1},point:function(h,p){var d,f=[h,p],g=o(h,p),m=n?g?0:s(h,p):g?s(h+(h<0?J:-J),p):0;if(!e&&(c=u=g)&&t.lineStart(),g!==u&&(!(d=a(e,f))||Ft(e,d)||Ft(f,d))&&(f[0]+=K,f[1]+=K,g=o(f[0],f[1])),g!==u)l=0,g?(t.lineStart(),d=a(f,e),t.point(d[0],d[1])):(d=a(e,f),t.point(d[0],d[1]),t.lineEnd()),e=d;else if(i&&e&&n^g){var y;m&r||!(y=a(f,e,!0))||(l=0,n?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!g||e&&Ft(e,f)||t.point(f[0],f[1]),e=f,u=g,r=m},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return l|(c&&u)<<1}}}),(function(r,n,i,o){Dt(o,t,e,i,r,n)}),n?[0,-t]:[-J,t-J])};function ae(t){return function(e){var r=new se;for(var n in t)r[n]=t[n];return r.stream=e,r}}function se(){}function ue(t,e,r){var n=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),bt(r,t.stream(Kt));var a=Kt.result(),s=Math.min(n/(a[1][0]-a[0][0]),i/(a[1][1]-a[0][1])),u=+e[0][0]+(n-s*(a[1][0]+a[0][0]))/2,c=+e[0][1]+(i-s*(a[1][1]+a[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*s).translate([u,c])}function ce(t,e,r){return ue(t,[[0,0],e],r)}se.prototype={constructor:se,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var le=st(30*nt),he=function(t,e){return+e?function(t,e){function r(n,i,o,a,s,u,c,l,h,p,d,f,g,m){var y=c-n,v=l-i,A=y*y+v*v;if(A>4*e&&g--){var _=a+p,b=s+d,x=u+f,w=ht(_*_+b*b+x*x),C=ft(x/=w),E=it(it(x)-1)e||it((y*T+v*P)/A-.5)>.3||a*p+s*d+u*f2?t[2]%360*nt:0,S()):[m*rt,y*rt,v*rt]},E.precision=function(t){return arguments.length?(C=he(M,w=t*t),T()):ht(w)},E.fitExtent=function(t,e){return ue(E,t,e)},E.fitSize=function(t,e){return ce(E,t,e)},function(){return e=t.apply(this,arguments),E.invert=e.invert&&I,S()}}function ge(t){return function(e,r){var n=st(e),i=st(r),o=t(n*i);return[o*i*lt(e),o*lt(r)]}}function me(t){return function(e,r){var n=ht(e*e+r*r),i=t(n),o=lt(i),a=st(i);return[at(e*o,n*a),ft(n&&r*o/n)]}}var ye=ge((function(t){return ht(2/(1+t))}));ye.invert=me((function(t){return 2*ft(t/2)}));var ve=ge((function(t){return(t=dt(t))&&t/lt(t)}));ve.invert=me((function(t){return t}));function Ae(t,e){return[t,ct(pt(($+e)/2))]}Ae.invert=function(t,e){return[t,2*ot(ut(e))-$]};function _e(t){var e,r,n,i=de(t),o=i.center,a=i.scale,s=i.translate,u=i.clipExtent,c=null;function l(){var o=J*a(),s=i(function(t){function e(e){return(e=t(e[0]*nt,e[1]*nt))[0]*=rt,e[1]*=rt,e}return t=Ot(t[0]*nt,t[1]*nt,t.length>2?t[2]*nt:0),e.invert=function(e){return(e=t.invert(e[0]*nt,e[1]*nt))[0]*=rt,e[1]*=rt,e},e}(i.rotate()).invert([0,0]));return u(null==c?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===Ae?[[Math.max(s[0]-o,c),e],[Math.min(s[0]+o,r),n]]:[[c,Math.max(s[1]-o,e)],[r,Math.min(s[1]+o,n)]])}return i.scale=function(t){return arguments.length?(a(t),l()):a()},i.translate=function(t){return arguments.length?(s(t),l()):s()},i.center=function(t){return arguments.length?(o(t),l()):o()},i.clipExtent=function(t){return arguments.length?(null==t?c=e=r=n=null:(c=+t[0][0],e=+t[0][1],r=+t[1][0],n=+t[1][1]),l()):null==c?null:[[c,e],[r,n]]},l()}function be(t,e){return[t,e]}be.invert=be;function xe(t,e){var r=st(e),n=st(t)*r;return[r*lt(t)/n,lt(e)/n]}xe.invert=me(ot);function we(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}we.invert=function(t,e){var r,n=e,i=25;do{var o=n*n,a=o*o;n-=r=(n*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(it(r)>K&&--i>0);return[t/(.8707+(o=n*n)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),n]};function Ce(t,e){return[st(e)*lt(t),lt(e)]}Ce.invert=me(ft);function Ee(t,e){var r=st(e),n=1+st(t)*r;return[r*lt(t)/n,lt(e)/n]}Ee.invert=me((function(t){return 2*ot(t)}));function Ie(t,e){return[ct(pt(($+e)/2)),-t]}Ie.invert=function(t,e){return[-e,2*ot(ut(t))-$]};function Me(t,e,r,n){var i,o=t.properties||{},a="Feature"===t.type?t.geometry:t;if("GeometryCollection"===a.type){var s=[];return Object(G.d)(t,(function(t){var i=Me(t,e,r,n);i&&s.push(i)})),Object(P.e)(s)}var u=Object(z.a)(t),c=u[1]>50&&u[3]>50;i=c?{type:a.type,coordinates:Se(a.coordinates,Pe(a))}:function(t,e){return V(t,"mercator",e)}(a);var l,h=(new U.GeoJSONReader).read(i),p=Object(P.m)(Object(P.h)(e,r),"meters"),d=U.BufferOp.bufferOp(h,p);if(!function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((d=(new U.GeoJSONWriter).write(d)).coordinates))return(l=c?{type:d.type,coordinates:Te(d.coordinates,Pe(a))}:function(t,e){return V(t,"wgs84",e)}(d)).geometry?l:Object(P.d)(l,o)}function Se(t,e){return"object"!=typeof t[0]?e(t):t.map((function(t){return Se(t,e)}))}function Te(t,e){return"object"!=typeof t[0]?e.invert(t):t.map((function(t){return Te(t,e)}))}function Pe(t){var e=Object(j.a)(t).geometry.coordinates.reverse(),r=e.map((function(t){return-t}));return function(){var t=_e(Ie),e=t.center,r=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?r([t[0],t[1],t.length>2?t[2]+90:90]):[(t=r())[0],t[1],t[2]-90]},r([0,0,90]).scale(159.155)}().center(e).rotate(r).scale(P.c)}var Oe=function(t,e,r){var n=(r=r||{}).units,i=r.steps||64;if(!t)throw new Error("geojson is required");if("object"!=typeof r)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");i=i||64,n=n||"kilometers";var o=[];switch(t.type){case"GeometryCollection":return Object(G.d)(t,(function(t){var r=Me(t,e,n,i);r&&o.push(r)})),Object(P.e)(o);case"FeatureCollection":return Object(G.b)(t,(function(t){var r=Me(t,e,n,i);r&&Object(G.b)(r,(function(t){t&&o.push(t)}))})),Object(P.e)(o)}return Me(t,e,n,i)};var Le=function(t,e,r){void 0===r&&(r={});for(var n=r.steps||64,o=r.properties?r.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},a=[],u=0;u=Math.abs(h)?l>0?a0?s=Math.abs(h)?l>0?a<=i&&i0?s<=o&&o=Math.abs(h)?l>0?a0?s=Math.abs(h)?l>0?a<=i&&i<=u:u<=i&&i<=a:h>0?s<=o&&o<=c:c<=o&&o<=s)}var De=function(t,e,r){void 0===r&&(r={});for(var n=Object(o.b)(t),i=Object(o.c)(e),a=0;a=t[0]&&e[3]>=t[1]}(n,s))return!1;"Polygon"===a&&(u=[u]);for(var c=!1,l=0;lt[1]!=c>t[1]&&t[0]<(u-a)*(t[1]-s)/(c-s)+a&&(n=!n)}return n}function Fe(t,e){return!(t[0]>e[0])&&(!(t[2]e[1])&&!(t[3]=c&&l===i.length-1);l++){if(c>e&&0===o.length){if(!(a=e-c))return o.push(i[l]),Object(P.i)(o);s=L(i[l],i[l-1])-180,u=Object(k.a)(i[l],a,s,n),o.push(u.geometry.coordinates)}if(c>=r)return(a=r-c)?(s=L(i[l],i[l-1])-180,u=Object(k.a)(i[l],a,s,n),o.push(u.geometry.coordinates),Object(P.i)(o)):(o.push(i[l]),Object(P.i)(o));if(c>=e&&o.push(i[l]),l===i.length-1)return Object(P.i)(o);c+=R(i[l],i[l+1],n)}return Object(P.i)(i[i.length-1])};var He=function(t,e,r){if(r=r||{},!Object(P.g)(r))throw new Error("options is invalid");var n=r.units,i=r.reverse;if(!t)throw new Error("geojson is required");if(e<=0)throw new Error("segmentLength must be greater than 0");var o=[];return Object(G.c)(t,(function(t){i&&(t.geometry.coordinates=t.geometry.coordinates.reverse()),function(t,e,r,n){var i=Ue(t,{units:r});if(i<=e)return n(t);var o=i/e;Number.isInteger(o)||(o=Math.floor(o)+1);for(var a=0;a0){e+=Math.abs(Qe(t[0]));for(var r=1;r2){for(a=0;a1?t:null;case"MultiPolygon":var e=[];if(Object(G.c)(t,(function(t){We(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}var Xe=function(t,e){var r=Object(T.c)(t),n=Object(T.c)(e),i=t.properties||{};if(r=Ye(r),n=Ye(n),!r)return null;if(!n)return Object(P.d)(r,i);var o=new U.GeoJSONReader,a=o.read(r),s=o.read(n),u=U.OverlayOp.difference(a,s);if(u.isEmpty())return null;var c=(new U.GeoJSONWriter).write(u);return Object(P.d)(c,i)},Ze=r(257),Ke=r.n(Ze);var Je=function(t,e,r){void 0===r&&(r={});var n=Object(o.d)(t),a=Object(o.d)(e),s=Ke.a.union(n.coordinates,a.coordinates);return 0===s.length?null:1===s.length?Object(i.polygon)(s[0],r.properties):Object(i.multiPolygon)(s,r.properties)};var $e=function(t){var e={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}},r=Object.keys(e).reduce((function(t,e){return t[e.replace("Multi","")]=e,t}),{});function n(t,r,n){n?e[r].coordinates=e[r].coordinates.concat(t.geometry.coordinates):e[r].coordinates.push(t.geometry.coordinates),e[r].properties.push(t.properties)}return Object(l.featureEach)(t,(function(t){t.geometry&&(e[t.geometry.type]?n(t,t.geometry.type,!0):r[t.geometry.type]&&n(t,r[t.geometry.type],!1))})),Object(i.featureCollection)(Object.keys(e).filter((function(t){return e[t].coordinates.length})).sort().map((function(t){var r={type:t,coordinates:e[t].coordinates},n={collectedProperties:e[t].properties};return Object(i.feature)(r,n)})))};function tr(t,e,r){var n=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,o=e.length-1;it[1]!=c>t[1]&&t[0]<(u-a)*(t[1]-s)/(c-s)+a&&(n=!n)}return n}var er=function(t,e,r){if("object"!=typeof(r=r||{}))throw new Error("options is invalid");var n=r.ignoreBoundary;if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var i=Object(T.a)(t),o=Object(T.b)(e),a=e.geometry?e.geometry.type:e.type,s=e.bbox;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,s))return!1;"Polygon"===a&&(o=[o]);for(var u=0,c=!1;u=c&&l===n.length-1);l++){if(c>=e){var h=e-c;if(h){var p=a(n[l],n[l-1])-180;return s(n[l],h,p,r)}return Object(i.point)(n[l])}c+=Object(u.a)(n[l],n[l+1],r)}return Object(i.point)(n[n.length-1])}},i,n)},function(t,e){t.exports=function(t,e,r,n){r&&Object.defineProperty(t,e,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return i})),r.d(e,"c",(function(){return o}));var n=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},function(t,e,r){"use strict";r.d(e,"a",(function(){return u})),r.d(e,"b",(function(){return c})),r.d(e,"c",(function(){return l})),r.d(e,"e",(function(){return h})),r.d(e,"d",(function(){return p}));var n=r(53);function i(t,e,r,n){for(var i,o=0,a=t.length;o0){var u=s[0].properties;if("frontend"===r.clusterType)y.a.getProps(r.mapContainerId,"kdIndex")[r.layerId].getLeaves(u.cluster_id,Number.MAX_SAFE_INTEGER,0).map((function(t){o.push(t.properties)})),a.type="details",a.data=o;else if("backend"===r.clusterType){u.aggsName&&u.aggsValue&&("string"==typeof u.aggsValue&&(u.aggsValue.indexOf("[")>-1?u.aggsValue=JSON.parse(u.aggsValue):u.aggsValue.indexOf(",")>-1&&(u.aggsValue=u.aggsValue.split(","))),o.push({aggsName:u.aggsName,aggsValue:u.aggsValue}));var c=y.a.getProps(i.mapContainerId,"config").AGGS_CONFIG;if(c.adcode){var l=c.adcode.split(","),h=Number(l[0]),p=Number(l[1]),d=Math.floor(i.map.getZoom());d>=h&&d<=p&&(a.adCodeCluster=!0)}a.type="aggs",a.data=o}}else{a.type="details",a.clustered=!1,a.data=n.map((function(t){return t.properties}));var f={};r.backgroundIcon&&(a.data.forEach((function(t){var e=t.dataId||t.id;f[e]=t})),a.data=Object.values(f))}e(t,a)}else e(t)}))}}},{key:"buildLayer",value:function(t,e){if("heatMap"===this.layerType)this.map.addLayer({id:this.layerId,type:"heatmap",source:this.sourceId,"source-layer":t,paint:e});else if("geometry"===this.layerType){var r=this.layerId+"-line",n=this.layerId+"-circle",i=this.layerId+"-polygon";this.addCircleLayer(n),m.a.setIdDepts(this.layerId,n),this.addPolygonLayer(i),m.a.setIdDepts(this.layerId,i),this.addLineLayer(r),m.a.setIdDepts(this.layerId,r),this.callback&&this.callback(this.layerId),this.setLayerZoomRange&&this.setLayerZoomRange()}else this.backgroundIcon&&this.combineIcons(),this.icons&&this.icons.length>0&&(this.isPoiLayer?this.buildUnClusterPoiLayer(t):(this.buildUnClusterLayer(t),this.iconTextStyle&&this.buildIconTextLayer(t))),this.clustered&&"mixedCluster"!==this.layerType&&this.buildClusterLayer(t)}},{key:"buildClusterLayer",value:function(t){var e=this._buildClusterSource(this.clusteredFilters),r={id:this.layerId+"circle",type:"circle",source:this.sourceId,paint:{"circle-color":e.circleColor.length>2?e.circleColor:this.circleColor||"#51bbd6","circle-radius":e.circleRadius.length>2?e.circleRadius:this.circleRadius||18,"circle-blur":this.circleBlur||0,"circle-opacity":this.circleOpacity||1,"circle-translate":this.circleTranslate||[0,0],"circle-stroke-width":e.circleStrokeWidth.length>2?e.circleStrokeWidth:this.circleStrokeWidth||2,"circle-stroke-color":e.circleStrokeColor.length>2?e.circleStrokeColor:this.circleStrokeColor||"#BFEFFF","circle-stroke-opacity":this.circleStrokeOpacity||1},filter:["all",["any",[">","aggsCount",1],[">","point_count",1]]]};t&&(r["source-layer"]=t),this.addLayertoMap(r),m.a.setIdDepts(this.layerId,this.layerId+"circle"),this.buildCountLayer(t)}},{key:"buildUnClusterLayer",value:function(t){var e,r,n=this,i=[],o=[],a=[],s=window.devicePixelRatio>1?2:1;this.icons[0].filter?(this.icons.forEach((function(t){if(t.filter){n.filterExp=[],t.filter.forEach((function(t){n._analysisFilter(t)})),n.backgroundIcon?n.backgroundIcon.match?(n.backgroundIcon.match.forEach((function(e){var r=["all"].concat(n.filterExp);r.push(["==",["get",n.backgroundIcon.property],e.value]),i.push(r),i.push("combined-".concat(e.iconName,"-").concat(t.iconName)),a.push(["==",["get",n.backgroundIcon.property],e.value]),a.push("combined-".concat(e.iconName,"-").concat(n.defaultIconName))})),i.push(["all"].concat(n.filterExp)),i.push("combined-".concat(n.backgroundIcon.default,"-").concat(t.iconName))):(i.push(["all"].concat(n.filterExp)),i.push("combined-".concat(n.backgroundIcon.default,"-").concat(t.iconName))):(i.push(["all"].concat(n.filterExp)),i.push(t.iconName)),o.push(["all"].concat(n.filterExp));var e=1;n.backgroundIcon?(e=1/s,t.scale&&(e=t.scale/s)):e=t.scale||1,o.push(e)}})),i=i.concat(a),e=(e=["case"]).concat(i),this.backgroundIcon?e.push("combined-".concat(this.backgroundIcon.default,"-").concat(this.defaultIconName)):e.push(this.defaultIconName),r=(r=["case"]).concat(o),this.backgroundIcon?r.push(1/s):r.push(1)):this.backgroundIcon?(this.backgroundIcon.match?(e=["case"],this.backgroundIcon.match.forEach((function(t){e.push(["==",["get",n.backgroundIcon.property],t.value]),e.push("combined-".concat(t.iconName,"-").concat(n.icons[0].iconName))})),e.push("combined-".concat(this.backgroundIcon.default,"-").concat(this.icons[0].iconName))):e="combined-".concat(this.backgroundIcon.default,"-").concat(this.icons[0].iconName),r=this.icons[0].scale||1):(e=this.icons[0].iconName,r=this.icons[0].scale||1);var u=this.iconOffset||[0,0],c=0,l=this.map&&this.map.style&&this.map.style.imageManager&&this.map.style.imageManager.images;if(this.backgroundIcon&&l){var h=l[this.backgroundIcon.default];if(!h)return void console.error("业务雪碧图中未包含水滴形图标");c=-h.data.height/2,c+=12*h.pixelRatio,u=[0,c/=h.pixelRatio]}this.symbolLayerId=Object(v.b)()+"-icon";var p={id:this.symbolLayerId,type:"symbol",source:this.sourceId,layout:{"icon-image":e,"icon-size":r,"text-size":this.textSize||12,"text-field":this.showText?"{"+this.showText+"}":"","text-offset":this.textOffset||[0,1.5],"text-anchor":"top","icon-allow-overlap":!0,"text-allow-overlap":!0,"icon-offset":u},filter:["all",["any",["==",["get","aggsCount"],1],["==",["get","aggsCount"],null]]]};this.iconSize&&(p.layout["icon-size"]=["interpolate",["linear"],["zoom"],this.iconSize[2]||3,this.iconSize[0]||.5,this.iconSize[3]||19,this.iconSize[1]||1.5]),this.iconTextStyle&&delete p.layout["text-field"],t&&(p["source-layer"]=t),this.addLayertoMap(p),m.a.setIdDepts(this.layerId,this.symbolLayerId)}},{key:"combineIcons",value:function(){var t=this;this.iconCanvas=document.createElement("canvas"),this.iconContext=this.iconCanvas.getContext("2d");var e=this.map&&this.map.style&&this.map.style.imageManager&&this.map.style.imageManager.images;if(e){var r=this.icons.map((function(t){return t.iconName}));if(r.push(this.defaultIconName),this.backgroundIcon.match){var n=this.backgroundIcon.match.map((function(t){return t.iconName}));n.push(this.backgroundIcon.default),n.forEach((function(n){r.forEach((function(r){t.addImageToMap(n,r,e)}))}))}else r.forEach((function(r){t.addImageToMap(t.backgroundIcon.default,r,e)}))}}},{key:"addImageToMap",value:function(t,e,r){var n="combined-".concat(t,"-").concat(e);if(!r[n]){var i=r[t];if(i){var o=i.data.width,a=i.data.height,s=i.pixelRatio,u=i.data.data,c=new ImageData(Uint8ClampedArray.from(u),o,a);this.iconCanvas.width=o,this.iconCanvas.height=a,this.iconContext.putImageData(c,0,0);var l=y.a.getProps(this.mapContainerId,"spriteJSON")[e],h=l.x,p=l.y,d=l.width,f=l.height,g=o/2-d/2,m=(a-27*s)/2+7*s-f/2,v=y.a.getProps(this.mapContainerId,"spriteImageEle");this.iconContext.drawImage(v,h,p,d,f,g,m,d,f);var A=this.iconContext.getImageData(0,0,o,a);this.map.addImage(n,A),this.iconContext.clearRect(0,0,o,a)}else console.log("找不到雪碧图:".concat(t))}}},{key:"buildUnClusterPoiLayer",value:function(t){var e=["match",["string",["get","kindcode"]]];this.icons.forEach((function(t){e.push(t.filter),e.push(t.iconName)})),e.push(this.defaultIconName),this.symbolLayerId=Object(v.b)()+"-icon";var r={id:this.symbolLayerId,type:"symbol",source:this.sourceId,layout:{"icon-image":e,"icon-offset":this.iconOffset||[0,0],"icon-size":1,"text-size":this.textSize||12,"text-field":this.showText?"{"+this.showText+"}":"","text-offset":this.textOffset||[0,1.5],"text-anchor":"top","icon-allow-overlap":!0,"text-allow-overlap":!0},filter:["all",["all",["any",["==",["get","aggsCount"],1],["==",["get","aggsCount"],null]],["any",["==",["get","point_count"],1],["==",["get","point_count"],null]]]]};t&&(r["source-layer"]=t),this.addLayertoMap(r),m.a.setIdDepts(this.layerId,this.symbolLayerId)}},{key:"buildIconTextLayer",value:function(t){this.iconTextLayerId=Object(v.b)();var e={id:this.iconTextLayerId,type:"symbol",source:this.sourceId,layout:{"icon-image":"showTextIcon","text-size":this.iconTextStyle.textSize||12,"text-field":"{".concat(this.showText,"}"),"text-offset":this.iconTextStyle.textOffset||[0,1.5],"icon-size":1,"icon-allow-overlap":!0,"text-allow-overlap":!0===this.iconTextStyle.textAllowOverlap,"icon-text-fit":"both","icon-text-fit-padding":this.iconTextStyle.iconTextFitPadding||[0,6,0,6],"icon-ignore-placement":!0},paint:{"text-color":this.iconTextStyle.textColor||"#fff","icon-color":this.iconTextStyle.iconColor||"#1569E0"},filter:["all",["all",["any",["==",["get","aggsCount"],1],["==",["get","aggsCount"],null]],["any",["==",["get","point_count"],1],["==",["get","point_count"],null]],["all",["has",this.showText],["!=",["get",this.showText],""]]]]};t&&(e["source-layer"]=t);var n=this.map.style&&this.map.style.imageManager&&this.map.style.imageManager.images;if(n&&n.showTextIcon)this.addLayertoMap(e);else{var i=new Image,o=this;i.onload=function(){o.map.addImage("showTextIcon",i,{sdf:!0}),o.addLayertoMap(e)};var a=r(642);this.iconTextStyle.backgroundShape&&"square"===this.iconTextStyle.backgroundShape&&(a=r(643)),i.src=a}}},{key:"buildCountLayer",value:function(t){var e={id:this.layerId+"count",type:"symbol",source:this.sourceId,layout:{"text-field":"{aggsCount}","text-size":this.countTextSize||14,"text-letter-spacing":0,"text-offset":[0,0],"text-allow-overlap":!0},paint:{"text-opacity":1,"text-color":this.countTextColor||"#fff"},filter:["all",["any",[">","aggsCount",1],[">","point_count",1]]]};t&&(e["source-layer"]=t),this.addLayertoMap(e),m.a.setIdDepts(this.layerId,this.layerId+"count")}},{key:"_analysisFilter",value:function(t,e){var r=this;t.filter?(e=e?["object",["get",t.key,e]]:["object",["get",t.key]],t.filter.forEach((function(t){r._analysisFilter(t,e)}))):e?this.filterExp.push(["==",["get",t.key,e],t.value]):this.filterExp.push(["==",["get",t.key],t.value])}},{key:"_toGeojson",value:function(t){return{geometry:{coordinates:"string"==typeof t.locationpoint?JSON.parse(t.locationpoint):t.locationpoint,type:"Point"},type:"Feature",properties:I({},t)}}},{key:"_buildClusterSource",value:function(t){t.sort((function(t,e){return t.count-e.count}));for(var e=["step",["get","aggsCount"]],r=["step",["get","aggsCount"]],n=["step",["get","aggsCount"]],i=["step",["get","aggsCount"]],o=0,a=t.length;o=0&&t[0]<=180&&t[1]<=90&&t[1]>=-90&&(r=!0),r},isDOM:function(t){return"object"===("undefined"==typeof HTMLElement?"undefined":i()(HTMLElement))?t instanceof HTMLElement:t&&"object"===i()(t)&&1===t.nodeType&&"string"==typeof t.nodeName}}},function(t,e,r){"use strict";var n=r(1),i=r(9),o=r(14),a=r(31);window.kmapDebug={},e.a={actions:{},on:function(t,e){this.actions[t]=e},loadData:function(t,e,r){var s=n.a.getProps(r,"config"),u=s.CLUSTERED_RADIUS,c=u>=50?u:50;t.mixClusterRadius&&(c=u>=60?u:t.mixClusterRadius);var l={appName:s.BUSINESS_APPNAME,serviceNames:t.serviceNames||[t.serviceName],location:t.requestPolygon||o.a.getCurrentBoundsByScreen(t.map,a.a.REQUEST_POLYGON_BUFFER,r).geometry,terms:t.terms,pageSize:a.a.UN_CLUSTER_LAYER_MAXSIZE,pageNo:0,zoomLevel:t._zoom,radius:c};"ClusterOverlay"===t.layerType?(l.fetchAggFields=t.fetchAggFields,l.mvtTag=1):l.mvtTag=2,!0===t.isPublic&&(l.serviceNames=["device_base"],l.appName=s.PUBLIC_APPNAME),t.mixTerms&&(l.filterTerms=t.mixTerms),!0===t.throughNet&&(l.throughNetFlag=0,l.throughNetUrls=t.throughNetUrls),t.layerGroupId&&(l.adminNameTag=1);var h=s.SERVICE_AGGS_CLUSTER;if(t.isTypicalLayer){var p=t.requestPolygon||o.a.getCurrentBoundsByScreen(t.map,a.a.REQUEST_POLYGON_BUFFER,r).geometry;if(t.adcode)l.location=p,l.adcode=t.adcode;else if(t.typicalPolygon){var d=o.a.intersect(p,t.typicalPolygon);l.location=null==d?t.typicalPolygon:d.geometry}else delete l.location;l.geoType=2}t.request=i.a.xhr({type:"POST",url:h,body:l,success:e,error:t._onxhrerror},r)},loadUnClusterData:function(t,e,r){var s=n.a.getProps(r,"config"),u=a.a.UN_CLUSTER_LAYER_MAXSIZE;"number"==typeof t.maxCount&&(u=Math.min(t.maxCount,a.a.UN_CLUSTER_LAYER_MAXSIZE));var c={appName:s.BUSINESS_APPNAME,serviceNames:t.serviceNames||[t.serviceName],pageNo:0,pageSize:u,terms:t.terms,zoomLevel:t._zoom,location:t.requestPolygon||o.a.getCurrentBoundsByScreen(t.map,a.a.REQUEST_POLYGON_BUFFER,r).geometry};if(t.includes&&(c.includes=t.includes),t.excludes&&(c.excludes=t.excludes),!0===t.isPublic&&(c.serviceNames=["device_base"],c.appName=s.PUBLIC_APPNAME),t.mixTerms&&(c.filterTerms=t.mixTerms),!0===t.throughNet&&(c.throughNetFlag=0,c.throughNetUrls=t.throughNetUrls),t.isStatic&&(c.location={type:"Polygon",coordinates:[[[73.34312643237152,17.659756812078655],[73.34312643237152,53.60230408570581],[135.39390768237615,53.60230408570581],[135.39390768237615,17.659756812078655],[73.34312643237152,17.659756812078655]]]}),t.isTypicalLayer){var l=t.requestPolygon||o.a.getCurrentBoundsByScreen(t.map,a.a.REQUEST_POLYGON_BUFFER,r).geometry;if(t.adcode)c.location=l,c.adcode=t.adcode;else if(t.typicalPolygon){var h=o.a.intersect(l,t.typicalPolygon);c.location=null==h?t.typicalPolygon:h.geometry}else delete c.location}t.request=i.a.xhr({type:"POST",url:s.UNCLUSTER_SERVICE,body:c,success:e,error:t._onxhrerror},r)},loadPoiData:function(t,e,r){var i=n.a.getProps(r,"modules"),a=n.a.getProps(r,"map"),s=new(i.BaseService())("poi",r);t.onlyScreen&&(t.polygon=o.a.getCurrentBoundsByScreen(a.map,0,r).geometry.coordinates[0]),s.searchBySpace(t,e)},loadImages:function(t,e){var r=[];t.multi?t.urls.forEach((function(t){r.push(t.url)})):r.push(t.url),i.a.loadImage(r,e)},loadBaseData:function(t,e,r){var s=n.a.getProps(r,"config"),u={appName:s.BUSINESS_APPNAME,location:t.requestPolygon||o.a.getCurrentBoundsByScreen(t.map,a.a.REQUEST_POLYGON_BUFFER,r).geometry,terms:t.terms,adcode:t.adcode,pageSize:a.a.UN_CLUSTER_LAYER_MAXSIZE,pageNo:0,zoomLevel:t._zoom,aggType:2,dataType:t.dataType},c=a.a.CLUSTER_RADIUS;u.radius=c,t.mixTerms&&(u.filterTerms=t.mixTerms),t.request=i.a.xhr({type:"POST",url:s.BASE_DATA_AGGS,body:u,success:e,error:t._onxhrerror},r)},loadRegionData:function(t,e,r){var s=n.a.getProps(r,"config"),u={appName:s.BUSINESS_APPNAME,geometry:t.requestPolygon||o.a.getCurrentBoundsByScreen(t.map,a.a.REQUEST_POLYGON_BUFFER,r).geometry,pageSize:a.a.UN_CLUSTER_LAYER_MAXSIZE,pageNo:0,zoomLevel:t._zoom};t.request=i.a.xhr({type:"POST",url:s.GET_REGIONS,body:u,success:e,error:t._onxhrerror},r)},loadPcsRegionData:function(t,e,r){var s=n.a.getProps(r,"config"),u={appName:s.BUSINESS_APPNAME,geometry:t.requestPolygon||o.a.getCurrentBoundsByScreen(t.map,a.a.REQUEST_POLYGON_BUFFER).geometry,pageSize:a.a.UN_CLUSTER_LAYER_MAXSIZE,pageNo:0,regionLevel:"town"};t.request=i.a.xhr({type:"POST",url:s.GET_PCS_REGIONS,body:u,success:e,error:t._onxhrerror},r)}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return i})),r.d(e,"f",(function(){return o})),r.d(e,"e",(function(){return a})),r.d(e,"g",(function(){return s})),r.d(e,"h",(function(){return u})),r.d(e,"d",(function(){return c})),r.d(e,"c",(function(){return l}));r(48);function n(t,e,r){return Math.min(Math.max(t,e),r)}var i="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2};function o(t,e,r,n,i,o){var s=i-r,u=o-n;if(0!==s||0!==u){var c=((t-r)*s+(e-n)*u)/(s*s+u*u);c>1?(r=i,n=o):c>0&&(r+=s*c,n+=u*c)}return a(t,e,r,n)}function a(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function s(t){return 180*t/Math.PI}function u(t){return t*Math.PI/180}function c(t,e){var r=t%e;return r*e<0?r+e:r}function l(t,e,r){return t+r*(e-t)}},function(t,e,r){"use strict";var n=r(176),i=r.n(n),o={createDomElement:function(t){return document.createElement(t)},addEventByClass:function(t,e,r){for(var n=document.getElementsByClassName(t),i=0,o=n.length;i=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function i(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function o(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)}function a(t){return"Feature"===t.type?t.geometry:t}function s(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}},function(t,e,r){"use strict";r.d(e,"a",(function(){return a.a})),r.d(e,"d",(function(){return M})),r.d(e,"c",(function(){return T})),r.d(e,"f",(function(){return P})),r.d(e,"b",(function(){return O})),r.d(e,"e",(function(){return k})),r.d(e,"g",(function(){return R})),r.d(e,"h",(function(){return D}));r(224);var n=r(25),i=r(39),o=r(151),a=r(83),s=6378137*Math.PI,u=[-s,-s,s,s],c=[-180,-85,180,85],l=function(t){function e(e){t.call(this,{code:e,units:a.b.METERS,extent:u,global:!0,worldExtent:c,getPointResolution:function(t,e){return t/Object(i.b)(e[1]/6378137)}})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(o.a),h=[new l("EPSG:3857"),new l("EPSG:102100"),new l("EPSG:102113"),new l("EPSG:900913"),new l("urn:ogc:def:crs:EPSG:6.18:3:3857"),new l("urn:ogc:def:crs:EPSG::3857"),new l("http://www.opengis.net/gml/srs/epsg.xml#3857")];function p(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=s,u=0;ua?c=a:c<-a&&(c=-a),o[u+1]=c}return o}function d(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;a180)&&(r[0]=Object(i.d)(n+180,360)-180),r}function O(t,e){if(t===e)return!0;var r=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||L(t,e)===C)&&r}function L(t,e){var r=function(t,e){var r;return t in x&&e in x[t]&&(r=x[t][e]),r}(t.getCode(),e.getCode());return r||(r=E),r}function k(t,e){return L(M(t),M(e))}function R(t,e,r){return k(e,r)(t,void 0,t.length)}function D(t,e,r){var i=k(e,r);return Object(n.a)(t,i)}S(h),S(y),A=h,_=p,b=d,y.forEach((function(t){A.forEach((function(e){w(t,e,_),w(e,t,b)}))}))},function(t,e,r){"use strict";e.a={CHANGE:"change",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"}},function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"a",(function(){return n})),r.d(e,"c",(function(){return i})),r.d(e,"d",(function(){return c})),r.d(e,"e",(function(){return A})),r.d(e,"f",(function(){return v})),r.d(e,"g",(function(){return h})),r.d(e,"j",(function(){return g})),r.d(e,"h",(function(){return m})),r.d(e,"i",(function(){return y}));var n=function(t,e){return te?1:t>=e?0:NaN},i=function(t){var e;return 1===t.length&&(e=t,t=function(t,r){return n(e(t),r)}),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[o],r)<0?n=o+1:i=o}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[o],r)>0?i=o:n=o+1}return n}}};var o=i(n),a=o.right,s=(o.left,a);var u=function(t){return null===t?NaN:+t},c=function(t,e){var r,n,i,o=t.length,a=-1;if(null==e){for(;++a=r)for(n=i=r;++ar&&(n=r),i=r)for(n=i=r;++ar&&(n=r),i0)return[t];if((n=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s=0?(o>=p?10:o>=d?5:o>=f?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=p?10:o>=d?5:o>=f?2:1)}function y(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),o=n/i;return o>=p?i*=10:o>=d?i*=5:o>=f&&(i*=2),e=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,o=Math.floor(i),a=+r(t[o],o,t);return a+(+r(t[o+1],o+1,t)-a)*(i-o)}},A=function(t){for(var e,r,n,i=t.length,o=-1,a=0;++o=0;)for(e=(n=t[i]).length;--e>=0;)r[--a]=n[e];return r}},function(t,e,r){"use strict";e.a={enable:function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable()}),0)},disable:function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t.map.doubleClickZoom.disable()}),0)}}},function(t,e,r){var n=r(322),i=r(506),o=r(279),a=r(324);t.exports=function(t,e){return n(t)||i(t,e)||o(t,e)||a()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(252);function i(t,e){if(!t)throw new n.a(e)}},function(t,e,r){"use strict";var n=r(389);r.d(e,"ActorCircle",(function(){return n.a}));r(244);var i=r(174);r.d(e,"LineMM",(function(){return i.b})),r.d(e,"LineOL",(function(){return i.c}));var o=r(390);r.d(e,"normalizeActorOps",(function(){return o.a})),r.d(e,"normalizeLineOps",(function(){return o.b}));r(245);var a=r(391);r.d(e,"SymbolLayer",(function(){return a.a}));r(246);var s=r(392);r.d(e,"TrackLine",(function(){return s.a}));var u=r(393);r.d(e,"Tracker",(function(){return u.a}));var c=r(394);r.d(e,"ClusterLayer",(function(){return c.a}));var l=r(222);r.d(e,"CircleMM",(function(){return l.a})),r.d(e,"CircleOL",(function(){return l.b}));r(395),r(125)},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";e.a={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"}},function(t,e,r){"use strict";function n(t){return null==t}function i(t){return null!=t}function o(t){return"number"==typeof t&&!isNaN(t)}function a(t){return"boolean"==typeof t}function s(t){return!0===t}function u(t){return!1===t}function c(t){return"string"==typeof t}function l(t){return Array.isArray(t)}function h(t){return"function"==typeof t}function p(t){return l(t)&&o(t[0])&&o(t[1])}function d(t,e){return E(t,e)>-1}function f(){return window.navigator.onLine}function g(t){console.warn(t)}function m(t){return JSON.parse(t)}function y(t){return JSON.stringify(t)}function v(t,e){for(var r in e)t[r]=e[r];return t}function A(t){return Object.create(t)}r.d(e,"r",(function(){return n})),r.d(e,"j",(function(){return i})),r.d(e,"m",(function(){return o})),r.d(e,"i",(function(){return a})),r.d(e,"q",(function(){return s})),r.d(e,"k",(function(){return u})),r.d(e,"p",(function(){return c})),r.d(e,"h",(function(){return l})),r.d(e,"l",(function(){return h})),r.d(e,"n",(function(){return p})),r.d(e,"g",(function(){return d})),r.d(e,"o",(function(){return f})),r.d(e,"v",(function(){return g})),r.d(e,"s",(function(){return m})),r.d(e,"t",(function(){return y})),r.d(e,"f",(function(){return v})),r.d(e,"u",(function(){return A})),r.d(e,"c",(function(){return b})),r.d(e,"d",(function(){return x})),r.d(e,"b",(function(){return w})),r.d(e,"e",(function(){return C})),r.d(e,"a",(function(){return E}));var _=Array.prototype;function b(t,e){return _.push.call(e,t)}function x(t){return _.shift.call(t)}function w(t){return t.length}function C(t,e,r){return _.splice.call(r,t,1)}function E(t,e){return _.indexOf.call(e,t)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return o})),r.d(e,"d",(function(){return a}));var n="function"==typeof Object.assign?Object.assign:function(t,e){var r=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),i=1,o=arguments.length;i=2&&void 0===t[0].length&&void 0===t[1].length)return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function i(t){if(!t)throw new Error("coords is required");if("Feature"===t.type&&null!==t.geometry)return t.geometry.coordinates;if(t.coordinates)return t.coordinates;if(Array.isArray(t))return t;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function o(t){if(!t)throw new Error("geojson is required");if(void 0!==t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error("geojson must be a valid Feature or Geometry Object")}function a(t,e){if(!t)throw new Error((e||"geojson")+" is required");if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error((e||"geojson")+" is invalid")}},function(t,e,r){"use strict";var n;r.d(e,"a",(function(){return n})),function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN",t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.FUNC_ADD=32774]="FUNC_ADD",t[t.BLEND_EQUATION=32777]="BLEND_EQUATION",t[t.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",t[t.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",t[t.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",t[t.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",t[t.MAX_EXT=32776]="MAX_EXT",t[t.MIN_EXT=32775]="MIN_EXT",t[t.BLEND_DST_RGB=32968]="BLEND_DST_RGB",t[t.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",t[t.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",t[t.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",t[t.BLEND_COLOR=32773]="BLEND_COLOR",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",t[t.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.BUFFER_SIZE=34660]="BUFFER_SIZE",t[t.BUFFER_USAGE=34661]="BUFFER_USAGE",t[t.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK",t[t.CULL_FACE=2884]="CULL_FACE",t[t.BLEND=3042]="BLEND",t[t.DITHER=3024]="DITHER",t[t.STENCIL_TEST=2960]="STENCIL_TEST",t[t.DEPTH_TEST=2929]="DEPTH_TEST",t[t.SCISSOR_TEST=3089]="SCISSOR_TEST",t[t.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",t[t.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",t[t.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",t[t.NO_ERROR=0]="NO_ERROR",t[t.INVALID_ENUM=1280]="INVALID_ENUM",t[t.INVALID_VALUE=1281]="INVALID_VALUE",t[t.INVALID_OPERATION=1282]="INVALID_OPERATION",t[t.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",t[t.CW=2304]="CW",t[t.CCW=2305]="CCW",t[t.LINE_WIDTH=2849]="LINE_WIDTH",t[t.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",t[t.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",t[t.CULL_FACE_MODE=2885]="CULL_FACE_MODE",t[t.FRONT_FACE=2886]="FRONT_FACE",t[t.DEPTH_RANGE=2928]="DEPTH_RANGE",t[t.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",t[t.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",t[t.DEPTH_FUNC=2932]="DEPTH_FUNC",t[t.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",t[t.STENCIL_FUNC=2962]="STENCIL_FUNC",t[t.STENCIL_FAIL=2964]="STENCIL_FAIL",t[t.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",t[t.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",t[t.STENCIL_REF=2967]="STENCIL_REF",t[t.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",t[t.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",t[t.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",t[t.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",t[t.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",t[t.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",t[t.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",t[t.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",t[t.VIEWPORT=2978]="VIEWPORT",t[t.SCISSOR_BOX=3088]="SCISSOR_BOX",t[t.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",t[t.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",t[t.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",t[t.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",t[t.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",t[t.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",t[t.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",t[t.RED_BITS=3410]="RED_BITS",t[t.GREEN_BITS=3411]="GREEN_BITS",t[t.BLUE_BITS=3412]="BLUE_BITS",t[t.ALPHA_BITS=3413]="ALPHA_BITS",t[t.DEPTH_BITS=3414]="DEPTH_BITS",t[t.STENCIL_BITS=3415]="STENCIL_BITS",t[t.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",t[t.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",t[t.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",t[t.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",t[t.SAMPLES=32937]="SAMPLES",t[t.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",t[t.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",t[t.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",t[t.DONT_CARE=4352]="DONT_CARE",t[t.FASTEST=4353]="FASTEST",t[t.NICEST=4354]="NICEST",t[t.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER",t[t.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",t[t.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",t[t.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",t[t.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",t[t.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",t[t.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",t[t.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",t[t.SHADER_TYPE=35663]="SHADER_TYPE",t[t.DELETE_STATUS=35712]="DELETE_STATUS",t[t.LINK_STATUS=35714]="LINK_STATUS",t[t.VALIDATE_STATUS=35715]="VALIDATE_STATUS",t[t.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",t[t.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",t[t.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",t[t.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",t[t.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP",t[t.VENDOR=7936]="VENDOR",t[t.RENDERER=7937]="RENDERER",t[t.VERSION=7938]="VERSION",t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",t[t.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",t[t.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",t[t.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",t[t.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE=5890]="TEXTURE",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",t[t.TEXTURE0=33984]="TEXTURE0",t[t.TEXTURE1=33985]="TEXTURE1",t[t.TEXTURE2=33986]="TEXTURE2",t[t.TEXTURE3=33987]="TEXTURE3",t[t.TEXTURE4=33988]="TEXTURE4",t[t.TEXTURE5=33989]="TEXTURE5",t[t.TEXTURE6=33990]="TEXTURE6",t[t.TEXTURE7=33991]="TEXTURE7",t[t.TEXTURE8=33992]="TEXTURE8",t[t.TEXTURE9=33993]="TEXTURE9",t[t.TEXTURE10=33994]="TEXTURE10",t[t.TEXTURE11=33995]="TEXTURE11",t[t.TEXTURE12=33996]="TEXTURE12",t[t.TEXTURE13=33997]="TEXTURE13",t[t.TEXTURE14=33998]="TEXTURE14",t[t.TEXTURE15=33999]="TEXTURE15",t[t.TEXTURE16=34e3]="TEXTURE16",t[t.TEXTURE17=34001]="TEXTURE17",t[t.TEXTURE18=34002]="TEXTURE18",t[t.TEXTURE19=34003]="TEXTURE19",t[t.TEXTURE20=34004]="TEXTURE20",t[t.TEXTURE21=34005]="TEXTURE21",t[t.TEXTURE22=34006]="TEXTURE22",t[t.TEXTURE23=34007]="TEXTURE23",t[t.TEXTURE24=34008]="TEXTURE24",t[t.TEXTURE25=34009]="TEXTURE25",t[t.TEXTURE26=34010]="TEXTURE26",t[t.TEXTURE27=34011]="TEXTURE27",t[t.TEXTURE28=34012]="TEXTURE28",t[t.TEXTURE29=34013]="TEXTURE29",t[t.TEXTURE30=34014]="TEXTURE30",t[t.TEXTURE31=34015]="TEXTURE31",t[t.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",t[t.REPEAT=10497]="REPEAT",t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",t[t.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",t[t.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",t[t.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",t[t.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",t[t.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",t[t.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",t[t.COMPILE_STATUS=35713]="COMPILE_STATUS",t[t.LOW_FLOAT=36336]="LOW_FLOAT",t[t.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",t[t.HIGH_FLOAT=36338]="HIGH_FLOAT",t[t.LOW_INT=36339]="LOW_INT",t[t.MEDIUM_INT=36340]="MEDIUM_INT",t[t.HIGH_INT=36341]="HIGH_INT",t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.RENDERBUFFER=36161]="RENDERBUFFER",t[t.RGBA4=32854]="RGBA4",t[t.RGB5_A1=32855]="RGB5_A1",t[t.RGB565=36194]="RGB565",t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX=6401]="STENCIL_INDEX",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",t[t.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",t[t.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",t[t.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",t[t.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",t[t.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",t[t.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",t[t.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",t[t.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",t[t.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",t[t.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",t[t.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",t[t.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",t[t.NONE=0]="NONE",t[t.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",t[t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",t[t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",t[t.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",t[t.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",t[t.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",t[t.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",t[t.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",t[t.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",t[t.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",t[t.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",t[t.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",t[t.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL"}(n||(n={}))},function(t,e,r){"use strict";function n(t,e,r){for(var n,o,a=r||i,s=0,u=t.length,c=!1;s>1)],e))<0?s=n+1:(u=n,c=!o);return c?s:~s}function i(t,e){return t>e?1:t0){for(n=1;n0||r&&0===o)}))}r.d(e,"a",(function(){return n})),r.d(e,"f",(function(){return i})),r.d(e,"e",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"b",(function(){return s})),r.d(e,"d",(function(){return u}))},function(t,e,r){"use strict";r.r(e),r.d(e,"coordEach",(function(){return i})),r.d(e,"coordReduce",(function(){return o})),r.d(e,"propEach",(function(){return a})),r.d(e,"propReduce",(function(){return s})),r.d(e,"featureEach",(function(){return u})),r.d(e,"featureReduce",(function(){return c})),r.d(e,"coordAll",(function(){return l})),r.d(e,"geomEach",(function(){return h})),r.d(e,"geomReduce",(function(){return p})),r.d(e,"flattenEach",(function(){return d})),r.d(e,"flattenReduce",(function(){return f})),r.d(e,"segmentEach",(function(){return g})),r.d(e,"segmentReduce",(function(){return m})),r.d(e,"lineEach",(function(){return y})),r.d(e,"lineReduce",(function(){return v})),r.d(e,"findSegment",(function(){return A})),r.d(e,"findPoint",(function(){return _}));var n=r(22);function i(t,e,r){if(null!==t)for(var n,o,a,s,u,c,l,h,p=0,d=0,f=t.type,g="FeatureCollection"===f,m="Feature"===f,y=g?t.features.length:1,v=0;vc||d>l||f>h)return u=i,c=r,l=d,h=f,void(a=0);var g=Object(n.lineString)([u,i],t.properties);if(!1===e(g,r,o,f,a))return!1;a++,u=i}))&&void 0}}}))}function m(t,e,r){var n=r,i=!1;return g(t,(function(t,o,a,s,u){n=!1===i&&void 0===r?t:e(n,t,o,a,s,u),i=!0})),n}function y(t,e){if(!t)throw new Error("geojson is required");d(t,(function(t,r,i){if(null!==t.geometry){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,r,i,0,0))return!1;break;case"Polygon":for(var s=0;s5&&void 0!==arguments[5]?arguments[5]:{},h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},p=arguments.length>7?arguments[7]:void 0,d=arguments.length>8?arguments[8]:void 0,f=t.traceType,g=t.data;if(Object(u.inArray)(f,l)&&!Object(u.isUndef)(g))switch(f){case 0:r(g,e,o,a,s,c,h,p,d);break;case 1:i(g,e,h,p);break;case 3:n(g,e);break;case 4:i(g,e,h,p)}}}function p(t,e){Object(u.isDef)(t.nextGroup)?p(t.nextGroup,e):(t.nextGroup=e,e.prevGroup=t)}function d(t,e,r){var n=new c.a(r),i=t.length-1,o=i<1?e:e/i,a=Date.now();return t.reduce((function(t,e,r){var n=a+o*r,i=new c.b(e[0],e[1],n,{timestamp:n,longitude:e[0],latitude:e[1]});return 1===r?t.push(i,!1):t.push(i),t}),n)}var f=r(56),g=r(310),m=["FORWARDS","BACKWARDS"];function y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t.reduce((function(t,e){return Object(u.isArray)(e)&&Object(u.isNumber)(e[0])&&Object(u.isNumber)(e[1])&&(Object(u.isUndef)(t.prev)?(t.prev=e,t.points.push(e)):t.prev[0]===e[0]&&t.prev[1]===e[1]||(t.prev=e,t.points.push(e))),t}),{points:[],prev:null});return Object(u.arrayLength)(e.points)>=2?e.points:void 0}function v(t,e){var r=t.actorContent,n=t.actorWidth,i=t.actorHeight,o=t.actorRotation,a=t.actorIcon,c=t.actorNonBackground,l=t.actorScale,h=t.actorOffset,p=t.actorVisible,d={iconName:a,iconScale:l,iconBackground:Object(u.isTrue)(c)?void 0:"direction",iconTemplate:r,iconWidth:n,iconHeight:i,iconNorthDirection:o,actorOffset:h,actorDirection:0,actorVisible:!Object(u.isBoolean)(p)||p},f=Object(s.normalizeActorOps)(d,e);if(!Object(u.isUndef)(f))return[{value:f}]}function A(t){var e=t.entireTrackColor,r=t.entireTrackPattern,n=t.passedTrackColor,i=t.passedTrackPattern,o=t.trackWidth,a=Object(s.normalizeLineOps)({lineWidth:o,lineColor:Object(u.isString)(e)?e:"gray",linePattern:r}),c=Object(s.normalizeLineOps)({lineWidth:o,lineColor:Object(u.isString)(n)?n:"green",linePattern:i});if(!Object(u.isUndef)(a)&&!Object(u.isUndef)(c))return{filterableLineOps:[{value:a,filter:{type:"==",key:"__passed__",value:!1}},{value:c,filter:{type:"==",key:"__passed__",value:!0}}],extra:{__passed__:function(t,e){return e}}}}function _(t){var e=t.isPlan,r=t.duration,n=t.trackVisible,i={};if((!Object(u.isDef)(e)||Object(u.isBoolean)(e))&&(i.isPlan=!!Object(u.isDef)(e)&&e,(!Object(u.isDef)(r)||Object(u.isNumber)(r)&&!(r<=0))&&(i.duration=Object(u.isDef)(r)?r:1e4,!Object(u.isDef)(n)||Object(u.isBoolean)(n))))return i.trackVisible=!Object(u.isBoolean)(n)||n,i}function b(t){var e=t.autoDirection,r=t.animationFillMode,n={};if((!Object(u.isDef)(e)||Object(u.isBoolean)(e))&&(n.autoDirection=!Object(u.isDef)(e)||e,!Object(u.isDef)(r)||Object(u.inArray)(r,m)))return n.animationFillMode=Object(u.isDef)(r)?r:"BACKWARDS",n}function x(t){return{onplanned:t.onplanned,onkeypointchange:t.onkeypointchange,onanimationend:t.onanimationend,onerror:t.onerror}}var w=function(){function t(e,r){var n=this;i()(this,t),this.points=void 0,this.actorStyle=void 0,this.trackStyle=void 0,this.generalOps=void 0,this.runtimeOps=void 0,this.cycleOps=void 0,this.activeBatch=void 0,this.inited=void 0,this.tracker=void 0,this.trackLayer=void 0,this.routeEvents=void 0,this.nextFrame=void 0,this.prevTimestamp=void 0,this.needFrame=void 0,this.mapContainerId=void 0,this.mapContainerId=r,this.points=e.points,this.actorStyle=e.actorStyle,this.trackStyle=e.trackStyle,this.generalOps=e.generalOps,this.runtimeOps=e.runtimeOps,this.cycleOps=e.cycleOps,this.routeEvents={},this.activeBatch=function(t,e){for(var r=Object(u.arrayLength)(t)-1,n=e/r,i=Math.ceil(r/51),o=null,a=0;a0&&void 0!==arguments[0]?arguments[0]:{};this.tracker.setSlot(t)}},{key:"_init",value:function(){var t=Object(u.matchFilterable)({},this.actorStyle),e=this.activeBatch.tgLine.clone();if(Object(u.isUndef)(t))this._triggerError("运动对象参数异常");else if(e.isEmpty())this._triggerError("轨迹数据不存在");else{var r=e.getPointerNode();this.tracker=new s.Tracker(r,t,!0,!0,this.mapContainerId),this.tracker.tgLine=e,Object(u.isTrue)(this.generalOps.trackVisible)&&(new s.TrackLine(this.trackStyle,this,this.mapContainerId),this.trackLayer.addTracker(this.tracker)),this.needFrame=!0,this._requestFrame(),this.cycleOps.onplanned&&this.cycleOps.onplanned(this)}}},{key:"_requestFrame",value:function(){Object(u.isDef)(this.nextFrame)&&(this.nextFrame.cancel(),this.nextFrame=null),Object(u.isTrue)(this.needFrame)&&(this.nextFrame=Object(u.requestFrame)(this._onframe))}},{key:"_onframe",value:function(){var t=(new Date).getTime();if(!Object(u.isNumber)(this.prevTimestamp))return this.prevTimestamp=t,void this._requestFrame();var e=t-this.prevTimestamp;this.prevTimestamp=t,this.tracker.render(e,!0===this.runtimeOps.autoDirection?{type:"AUTO"}:{type:"NONE"},{skipped:function(){return!1},variableSpeed:!1,removeAfterPassed:!1},this.cycleOps),Object(u.isDef)(this.trackLayer)&&this.trackLayer.render((function(){return!0})),this._requestFrame()}},{key:"_onanimationend",value:function(t){this.activeBatch.nextGroup?(this.activeBatch=this.activeBatch.nextGroup,this.tracker.tgLine=this.activeBatch.tgLine.clone(),this.activeBatch.prevGroup&&(this.tracker.tgLine.assignBefore(this.activeBatch.prevGroup.tgLine),this.activeBatch.prevGroup=null),this.activeBatch.nextGroup&&this._createGroupRequest(this.activeBatch.nextGroup),this.needFrame=!0):(this.needFrame=!1,Object(u.isDef)(t)&&Object(g.isFunction)(t)&&t()),this._requestFrame()}},{key:"_createGroupRequest",value:function(t){var e=this;t.request=Object(f.driving)({coordinates:t.coordinates,mp:null,st:4,engineType:"keda"},(function(r,n){Object(u.isDef)(r)?e._triggerError(r.message):e._drived(n,t)}),this.mapContainerId)}},{key:"_drived",value:function(t,e){if(t.data&&t.data.rows&&t.data.rows[0]&&t.data.rows[0].routelatlon){var r=t.data.rows[0].routelatlon.split(";").map((function(t){var e=t.split(",");return[parseFloat(e[0]),parseFloat(e[1])]}));r.length>1?(r.length=r.length-1,e.tgLine=d(r,e.duration,!0),this.activeBatch===e&&!1===this.inited&&this._init()):this._triggerError("路径规划失败")}else this._triggerError("路径规划失败")}},{key:"_triggerError",value:function(t){Object(u.isDef)(this.cycleOps.onerror)&&this.cycleOps.onerror({type:"error",message:t})}}]),t}();function C(t,e){var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=y(t.points);if(!Object(u.isUndef)(r)){var n=v(t,e);if(!Object(u.isUndef)(n)){var i=A(t);if(!Object(u.isUndef)(i)){var o=_(t);if(!Object(u.isUndef)(o)){var a=b(t);if(!Object(u.isUndef)(a)){var s=x(t);if(!Object(u.isUndef)(s))return{points:r,actorStyle:n,trackStyle:i,generalOps:o,runtimeOps:a,cycleOps:s}}}}}}}(t,e);return Object(u.isDef)(r)?new w(r,e):void 0}var E=r(28),I=r(23),M=r.n(I),S=r(87),T=r.n(S),P=r(125);function O(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return L(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r-1&&(Object(u.arraySplice)(e,1,this.trackerList),t.trackPointLayer&&t.trackPointLayer.render(!0),t.trackPointLayer=void 0),0===Object(u.arrayLength)(this.trackerList)&&this.destroy()}},{key:"addEvent",value:function(t,e){this.pointLayer.addEvent(t,e)}},{key:"removeEvent",value:function(t){this.pointLayer.removeEvent(t)}},{key:"render",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=[],n=O(this.trackerList);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=i.getAvailablePoints().map((function(t){return t.toFeature()}));r.push.apply(r,M()(o))}}catch(t){n.e(t)}finally{n.f()}if(e)this.pointLayer.setLayerFeature(Object(u.packageFeaturesToCollection)(r));else if(r.length){var a=r.slice(-1)[0].geometry.coordinates;T()(a,this.savedLastPoint)||(this.pointLayer.setLayerFeature(Object(u.packageFeaturesToCollection)(r)),this.savedLastPoint=a)}}},{key:"hasTracker",value:function(t){return Object(u.arrayIndexOf)(t,this.trackerList)>-1}},{key:"isEmpty",value:function(){return 0===Object(u.arrayLength)(this.trackerList)}},{key:"destroy",value:function(){this.pointLayer.destroy()}}]),t}();function R(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return D(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return D(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=s)return}return o.startTime=i,o}}}({clusterOps:a,clusterZoom:c,isRealtimeTrack:r,startTime:l});if(!Object(u.isUndef)(p)){var d=function(t){var e=t.maxDuration,r=t.minAvgSpeed,n=t.autoDirection,i=t.directionMode,o=t.directionDestination,a=t.animation,s=t.toGcj02,c={};if((!Object(u.isDef)(e)||Object(u.isNumber)(e))&&(c.maxDuration=Object(u.isNumber)(e)?e:5e3,!Object(u.isDef)(r)||Object(u.isNumber)(r)&&!(r<0))){c.minAvgSpeed=Object(u.isNumber)(r)?r:0;var l={type:i};if(!Object(u.isDef)(i)||Object(u.inArray)(i,N)){if(Object(u.isDef)(i)){if("DESTINATION"===i&&!Object(u.isOffset)(o))return;l.destination=o}else{if(Object(u.isDef)(n)&&!Object(u.isBoolean)(n))return;l.type=Object(u.isTrue)(n)||Object(u.isUndef)(n)?"AUTO":"NONE"}if(c.directionModeOps=l,(!Object(u.isDef)(a)||Object(u.isBoolean)(a))&&(c.animation=!Object(u.isBoolean)(a)||a,!Object(u.isDef)(s)||Object(u.isBoolean)(s)))return c.toGcj02=!!Object(u.isBoolean)(s)&&s,c}}}(t);if(!Object(u.isUndef)(d)){var g=function(t){return{onsubscribed:t.onsubscribed,ontrackerschange:t.ontrackerschange,onkeypointchange:t.onkeypointchange,onerror:t.onerror,onjitkeypointchange:t.onjitkeypointchange}}(t);if(!Object(u.isUndef)(g)){var m=function(t,e){var r,n=[],i=R(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.actorContent,c=o.actorWidth,l=o.actorHeight,h=o.actorIcon,p=o.actorIconText,d=o.actorNonBackground,f=o.actorScale,g=o.actorRotation,m=o.actorOffset,y=o.filter,v={iconName:h,iconText:p,iconScale:f,iconBackground:Object(u.isTrue)(d)?void 0:"direction",iconTemplate:a,iconWidth:c,iconHeight:l,iconNorthDirection:g,actorOffset:m,actorDirection:0,actorVisible:!0},A=Object(s.normalizeActorOps)(v,e);if(Object(u.isUndef)(A))return;var _=void 0;if(Object(u.isDef)(y)){if(!Object(u.isArray)(y))return;if(_=B(y),Object(u.isUndef)(_))return}n.push({value:A,filter:_})}}catch(t){i.e(t)}finally{i.f()}return Object(u.arrayLength)(n)>0?n:void 0}(i,e);if(!Object(u.isUndef)(m)){var y=function(t){var e,r=[],n=R(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,o=Object(s.normalizeLineOps)(i);if(Object(u.isUndef)(o))return;r.push({value:o})}}catch(t){n.e(t)}finally{n.f()}return Object(u.arrayLength)(r)>0?{filterableLineOps:r}:void 0}(o);if(!Object(u.isUndef)(y)){var v=function(t){var e={},r={};if((!Object(u.isDef)(t.actorBufferFillColor)||Object(u.isString)(t.actorBufferFillColor))&&(e.circleFillColor=Object(u.isString)(t.actorBufferFillColor)?t.actorBufferFillColor:"rgba(255,0,0,0.5)",(!Object(u.isDef)(t.actorBufferStrokeColor)||Object(u.isString)(t.actorBufferStrokeColor))&&(e.circleStrokeColor=Object(u.isString)(t.actorBufferStrokeColor)?t.actorBufferStrokeColor:"rgba(255,0,0,0.7)",(!Object(u.isDef)(t.actorBufferVisible)||Object(u.isBoolean)(t.actorBufferVisible))&&(r.circleVisible=!!Object(u.isBoolean)(t.actorBufferVisible)&&t.actorBufferVisible,!Object(u.isDef)(t.actorBufferRadius)||Object(u.isNumber)(t.actorBufferRadius)&&!(t.actorBufferRadius<=0)))))return r.circleRadius=Object(u.isNumber)(t.actorBufferRadius)?t.actorBufferRadius:1e3,r.circleStyle=[{value:e}],r}(t);if(!Object(u.isUndef)(v))return{serverOps:h,generalOps:p,runtimeOps:d,cycleOps:g,pointStyle:n,actorStyle:m,trackStyle:y,bufferStyle:v}}}}}}}}var j=function(){function t(e,r){i()(this,t),this.serverOps=void 0,this.generalOps=void 0,this.runtimeOps=void 0,this.cycleOps=void 0,this.actorStyle=void 0,this.pointStyle=void 0,this.trackStyle=void 0,this.bufferStyle=void 0,this.id=void 0,this.clientId=void 0,this.appName=void 0,this.subscribeRequest=void 0,this.traceId=void 0,this.destination=void 0,this.trackerMap=void 0,this.performGPSSpecification=void 0,this.socketChannel=void 0,this.clusterLayer=void 0,this.moveendDelay=void 0,this.isTrackingMode=void 0,this.pointEvents=void 0,this.actorEvents=void 0,this.routeEvents=void 0,this.trackPointLayer=void 0,this.trackLayer=void 0,this.circleLayer=void 0,this.nextFrame=void 0,this.prevTimestamp=void 0,this.perspective=void 0,this.historyRequest=void 0,this.historyTGLine=void 0,this.config=void 0,this.mapContainerId=void 0,this.visibleState={},Object(u.extend)(this,e),this.mapContainerId=r,this.config=E.f.getProps(r,"config"),this.id=Object(u.guid)(),this.clientId=Object(E.c)(),this.serverOps.serviceName=e.serverOps.serviceName||"device_base",this.appName="device_base"===this.serverOps.serviceName?this.config.PUBLIC_APPNAME:this.config.BUSINESS_APPNAME,this.trackerMap={},this.pointEvents={},this.actorEvents={},this.routeEvents={},this.performGPSSpecification=h(this.runtimeOps.toGcj02),Object(u.bindAll)(["_subscribed","_onmessage","_onmapmoveend","_mapMoveendEmitter","_onframe"],this),Object(u.isTrue)(this.generalOps.isRealtimeTrack)&&Object(u.isString)(this.generalOps.startTime)?this._loadHistory():this._subscribe()}return a()(t,[{key:"destroy",value:function(){for(var t in this.historyRequest&&this.historyRequest.cancel(),this._removeBuildInMapEvent(),Object(u.isDef)(this.moveendDelay)&&clearTimeout(this.moveendDelay),Object(u.isDef)(this.nextFrame)&&this.nextFrame.cancel(),this.socketChannel.unsubscribe(this.destination),this._removeClusterLayer(),this.trackerMap)this.trackerMap[t].destroy();this.trackerMap={},this.actorEvents={},this.routeEvents={},this.performGPSSpecification=null,this._unsubscribe()}},{key:"addPointEvent",value:function(t,e){if(!Object(u.isDef)(this.pointEvents[t])){if(this.pointEvents[t]=e,!Object(u.isDef)(this.trackPointLayer))throw new Error("在没有显示关键节点的情况下,不可以对关键节点绑定事件!");this.trackPointLayer.addEvent(t,e)}}},{key:"removePointEvent",value:function(t){if(Object(u.isDef)(this.pointEvents[t])){if(delete this.pointEvents[t],!Object(u.isDef)(this.trackPointLayer))throw new Error("在没有显示关键节点的情况下,不可以对关键节点移除事件!");this.trackPointLayer.removeEvent(t)}}},{key:"addActorEvent",value:function(t,e){if(!Object(u.isDef)(this.actorEvents[t]))for(var r in this.actorEvents[t]=e,this.trackerMap)this.trackerMap[r].actor.addEvent(t,e)}},{key:"removeActorEvent",value:function(t){if(Object(u.isDef)(this.actorEvents[t])){for(var e in this.trackerMap)this.trackerMap[e].actor.removeEvent(t);delete this.actorEvents[t]}}},{key:"addRouteEvent",value:function(t,e){Object(u.isDef)(this.routeEvents[t])||(this.routeEvents[t]=e,Object(u.isDef)(this.trackLayer)&&this.trackLayer.addEvent(t,e))}},{key:"removeRouteEvent",value:function(t){Object(u.isDef)(this.routeEvents[t])&&(delete this.routeEvents[t],Object(u.isDef)(this.trackLayer)&&this.trackLayer.removeEvent(t))}},{key:"addClusterEvent",value:function(t,e){Object(u.isDef)(this.clusterLayer)&&this.clusterLayer.addEvent(t,e)}},{key:"removeClusterEvent",value:function(t){Object(u.isDef)(this.clusterLayer)&&this.clusterLayer.removeEvent(t)}},{key:"setActor",value:function(t){var e=t.gbid,r=t.actorVisible,n=t.iconTemplate,i=t.iconWidth,o=t.iconHeight,a=t.iconName,s=this.trackerMap[e];Object(u.isUndef)(s)||(Object(u.isString)(n)&&s.actor.setIconTemplate(n),Object(u.isNumber)(i)&&i>0&&s.actor.setIconWidth(i),Object(u.isNumber)(o)&&o>0&&s.actor.setIconHeight(o),Object(u.isString)(a)&&s.actor.setIconName(a),Object(u.isTrue)(r)&&(s.actor.show(),this.setActorBuffer(!0)),Object(u.isFalse)(r)&&(s.actor.hide(),this.setActorBuffer(!1)))}},{key:"setTrack",value:function(t){var e=t.gbid,r=t.visible,n=this.trackerMap[e];if(Object(u.isDef)(n)){var i=Object(u.isDef)(n.trackLine);if(Object(u.isTrue)(r)){if(Object(u.isTrue)(i))return;if(Object(u.isUndef)(this.trackLayer))for(var o in new s.TrackLine(this.trackStyle,this,this.mapContainerId),this.routeEvents)this.trackLayer.addEvent(o,this.routeEvents[o]);this.trackLayer.addTracker(n)}if(Object(u.isFalse)(r)){if(!i)return;Object(u.isDef)(this.trackLayer)&&this.trackLayer.removeTracker(n)}}}},{key:"setPoint",value:function(t){var e=t.gbid,r=t.visible,n=this.trackerMap[e];if(Object(u.isDef)(n)){if(Object(u.isTrue)(r)){if(Object(u.isUndef)(this.trackPointLayer))for(var i in new k(this.pointStyle,this,this.mapContainerId),this.pointEvents)this.trackPointLayer.addEvent(i,this.pointEvents[i]);this.trackPointLayer.addTracker(n)}Object(u.isFalse)(r)&&Object(u.isDef)(this.trackPointLayer)&&this.trackPointLayer.removeTracker(n)}}},{key:"setSlot",value:function(t){var e=t.gbid,r=t.type,n=t.visible,i=t.template,o=this.trackerMap[e];Object(u.isDef)(o)&&o.setSlot({type:r,visible:n,template:i})}},{key:"setAnimation",value:function(t,e){var r=this.trackerMap[t];Object(u.isDef)(r)&&Object(u.isBoolean)(e)&&r.setAnimation(e)}},{key:"setActorBuffer",value:function(t){if(this.generalOps.isRealtimeTrack&&this.bufferStyle.circleVisible)if(!0===t)if(this.circleLayer)for(var e in this.trackerMap)this.circleLayer.removeTracker(this.trackerMap[e]);else for(var r in new s.ActorCircle(this.bufferStyle,this,this.mapContainerId),this.trackerMap)this.circleLayer.addTracker(this.trackerMap[r]);else if(!1===t){if(this.circleLayer)for(var n in this.trackerMap)this.circleLayer.removeTracker(this.trackerMap[n])}else for(var i in new s.ActorCircle(this.bufferStyle,this,this.mapContainerId),this.trackerMap)this.circleLayer.addTracker(this.trackerMap[i])}},{key:"setPerspective",value:function(t){var e=t.type,r=t.gbid;this.generalOps.isRealtimeTrack&&(r=Object.keys(this.trackerMap)[0]),"NONE_PERSPECTIVE"===e?this.perspective={type:"NONE_PERSPECTIVE"}:"FOLLOWING_PERSPECTIVE"===e&&(this.perspective={type:"FOLLOWING_PERSPECTIVE",gbid:r})}},{key:"_requestFrame",value:function(t){Object(u.isDef)(this.nextFrame)&&(this.nextFrame.cancel(),this.nextFrame=null),Object(u.isTrue)(t)&&(this.nextFrame=Object(u.requestFrame)(this._onframe))}},{key:"_onframe",value:function(){var t=this,e=(new Date).getTime();if(!Object(u.isNumber)(this.prevTimestamp))return this.prevTimestamp=e,void this._requestFrame(!0);var r=e-this.prevTimestamp;for(var n in this.prevTimestamp=e,this.trackerMap){var i=this.trackerMap[n],o=Object(u.isUndef)(this.trackLayer)||!this.trackLayer.hasTracker(i);i.render(r,this.runtimeOps.directionModeOps,{skipped:function(e){return!t.generalOps.isRealtimeTrack&&e.getDuration()>=t.runtimeOps.maxDuration},variableSpeed:!0,removeAfterPassed:o},this.cycleOps)}if(Object(u.isDef)(this.trackLayer)&&this.trackLayer.render((function(e,r,n){return n&&r.getDuration()0&&void 0!==arguments[0]?arguments[0]:[],r=new c.a,n=R(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;r.push(new c.b(i.longitude,i.latitude,i.timestamp,i))}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"_subscribed",value:function(t,e){if(!Object(u.isUndef)(this.cycleOps.onsubscribed)&&Object(u.isFunction)(this.cycleOps.onsubscribed))if(t)this.cycleOps.onsubscribed(t,null);else{var r,n=e.traceId,i=Object(u.isDef)(e.dataList)?e.dataList:[],o=R(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;a.timestamp=Object(u.dateParse)(a.gpsTimestamp),"string"==typeof a.longitude&&(a.longitude=Number(a.longitude)),"string"==typeof a.latitude&&(a.latitude=Number(a.latitude))}}catch(t){o.e(t)}finally{o.f()}if(this.traceId=n,this.destination=Object(f.createGPSDestination)(n),Object(u.isTrue)(this.generalOps.isRealtimeTrack)&&1!==Object(u.arrayLength)(i))this.cycleOps.onsubscribed(new Error("订阅失败"),null);else{var s,c=R(i);try{for(c.s();!(s=c.n()).done;){var l=s.value;this.visibleState[l.gbid]={},this.performGPSSpecification({traceType:0,data:l},this.trackerMap,this.actorStyle,this.runtimeOps,this.historyTGLine,this.actorEvents,this.cycleOps,this.generalOps.isRealtimeTrack,this.mapContainerId)}}catch(t){c.e(t)}finally{c.f()}this.socketChannel=Object(f.installGPSSocket)(this.mapContainerId),this.socketChannel.subscribe(this.destination,this._onmessage),this._addBuildInMapEvent(),this._addClusterLayer(),this._mapMoveendEmitter(),this.cycleOps.onsubscribed(null,{instance:this})}}}}]),t}();function z(t,e){var r=F(t,e);if(!Object(u.isUndef)(r))return new j(r,e)}var U=["FORWARDS","BACKWARDS"];function G(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t.reduce((function(t,e){return Object(u.isArray)(e)&&Object(u.isNumber)(e[0])&&Object(u.isNumber)(e[1])&&(Object(u.isUndef)(t.prev)?(t.prev=e,t.points.push(e)):t.prev[0]===e[0]&&t.prev[1]===e[1]||(t.prev=e,t.points.push(e))),t}),{points:[],prev:null});return Object(u.arrayLength)(e.points)>=2?e.points:void 0}function H(t,e){var r=t.actorContent,n=t.actorWidth,i=t.actorHeight,o=t.actorRotation,a=t.actorIcon,c=t.actorNonBackground,l=t.actorScale,h=t.actorOffset,p=t.actorVisible,d={iconName:a,iconScale:l,iconBackground:Object(u.isTrue)(c)?void 0:"direction",iconTemplate:r,iconWidth:n,iconHeight:i,iconNorthDirection:o,actorOffset:h,actorDirection:0,actorVisible:!Object(u.isBoolean)(p)||p},f=Object(s.normalizeActorOps)(d,e);if(!Object(u.isUndef)(f))return[{value:f}]}function V(t){var e=t.entireTrackColor,r=t.entireTrackPattern,n=t.passedTrackColor,i=t.passedTrackPattern,o=t.trackWidth,a=Object(s.normalizeLineOps)({lineWidth:o,lineColor:Object(u.isString)(e)?e:"gray",linePattern:r}),c=Object(s.normalizeLineOps)({lineWidth:o,lineColor:Object(u.isString)(n)?n:"green",linePattern:i});if(!Object(u.isUndef)(a)&&!Object(u.isUndef)(c))return{filterableLineOps:[{value:a,filter:{type:"==",key:"__passed__",value:!1}},{value:c,filter:{type:"==",key:"__passed__",value:!0}}],extra:{__passed__:function(t,e){return e}}}}function Q(t){var e={},r={};if((!Object(u.isDef)(t.actorBufferFillColor)||Object(u.isString)(t.actorBufferFillColor))&&(e.circleFillColor=Object(u.isString)(t.actorBufferFillColor)?t.actorBufferFillColor:"rgba(255,0,0,0.5)",(!Object(u.isDef)(t.actorBufferStrokeColor)||Object(u.isString)(t.actorBufferStrokeColor))&&(e.circleStrokeColor=Object(u.isString)(t.actorBufferStrokeColor)?t.actorBufferStrokeColor:"rgba(255,0,0,0.7)",(!Object(u.isDef)(t.actorBufferVisible)||Object(u.isBoolean)(t.actorBufferVisible))&&(r.circleVisible=!!Object(u.isBoolean)(t.actorBufferVisible)&&t.actorBufferVisible,!Object(u.isDef)(t.actorBufferRadius)||Object(u.isNumber)(t.actorBufferRadius)&&!(t.actorBufferRadius<=0)))))return r.circleRadius=Object(u.isNumber)(t.actorBufferRadius)?t.actorBufferRadius:1e3,r.circleStyle=[{value:e}],r}function q(t){var e=t.isPlan,r=t.duration,n=t.trackVisible,i={};if((!Object(u.isDef)(e)||Object(u.isBoolean)(e))&&(i.isPlan=!!Object(u.isDef)(e)&&e,(!Object(u.isDef)(r)||Object(u.isNumber)(r)&&!(r<=0))&&(i.duration=Object(u.isDef)(r)?r:1e4,!Object(u.isDef)(n)||Object(u.isBoolean)(n))))return i.trackVisible=!Object(u.isBoolean)(n)||n,i}function W(t){var e=t.autoDirection,r=t.animationFillMode,n={};if((!Object(u.isDef)(e)||Object(u.isBoolean)(e))&&(n.autoDirection=!Object(u.isDef)(e)||e,!Object(u.isDef)(r)||Object(u.inArray)(r,U)))return n.animationFillMode=Object(u.isDef)(r)?r:"BACKWARDS",n}function Y(t){return{onkeypointchange:t.onkeypointchange,onanimationend:t.onanimationend,onerror:t.onerror,onplanned:t.onplanned}}var X=function(){function t(e,r){var n=this;i()(this,t),this.points=void 0,this.actorStyle=void 0,this.trackStyle=void 0,this.bufferStyle=void 0,this.generalOps=void 0,this.runtimeOps=void 0,this.cycleOps=void 0,this.tracker=void 0,this.trackLayer=void 0,this.circleLayer=void 0,this.speedRate=void 0,this.routeEvents=void 0,this.nextFrame=void 0,this.prevTimestamp=void 0,this.needFrame=void 0,this.request=void 0,this.mapContainerId=void 0,this.mapContainerId=r,this.points=e.points,this.actorStyle=e.actorStyle,this.trackStyle=e.trackStyle,this.bufferStyle=e.bufferStyle,this.generalOps=e.generalOps,this.runtimeOps=e.runtimeOps,this.cycleOps=e.cycleOps,this.routeEvents={},this.speedRate=1,Object(u.bindAll)(["_onframe","_onanimationend"],this);var o=this.cycleOps.onanimationend;this.cycleOps.onanimationend=function(){n._onanimationend(o)},this._load()}return a()(t,[{key:"pause",value:function(){this.needFrame=!1,this._requestFrame()}},{key:"play",value:function(){this.needFrame=!0,this.prevTimestamp=null,this._requestFrame()}},{key:"addTrackEvent",value:function(t,e){Object(u.isDef)(this.routeEvents[t])||(this.routeEvents[t]=e,Object(u.isDef)(this.trackLayer)&&this.trackLayer.addEvent(t,e))}},{key:"removeTrackEvent",value:function(t){Object(u.isDef)(this.routeEvents[t])&&(delete this.routeEvents[t],Object(u.isDef)(this.trackLayer)&&this.trackLayer.removeEvent(t))}},{key:"setEventTrackProgressBy",value:function(t){var e=this.needFrame;this.needFrame=!0,this.tracker.setBy(t),this._requestFrame(),this.needFrame=e}},{key:"setEventTrackProgressTo",value:function(t){var e=this.needFrame;this.needFrame=!0,this.tracker.setTo(t),this._requestFrame(),this.needFrame=e}},{key:"setSpeedRate",value:function(t){var e=parseInt(Math.abs(t));t>=1&&(this.speedRate=t),t<=-1&&(this.speedRate=1/e),this._requestFrame()}},{key:"setSlot",value:function(t){this.tracker.setSlot(t)}},{key:"destroy",value:function(){this.needFrame=!1,this._requestFrame(),this.request&&this.request.cancel(),Object(u.isDef)(this.tracker)&&(this.tracker.destroy(),this.tracker=null)}},{key:"setActorBuffer",value:function(t){this.bufferStyle.circleVisible&&(!0===t?this.circleLayer||(new s.ActorCircle(this.bufferStyle,this,this.mapContainerId),this.circleLayer.addTracker(this.tracker)):!1===t?this.circleLayer&&this.circleLayer.removeTracker(this.tracker):(new s.ActorCircle(this.bufferStyle,this,this.mapContainerId),this.circleLayer.addTracker(this.tracker)))}},{key:"_init",value:function(t){var e=Object(u.matchFilterable)({},this.actorStyle);if(Object(u.isUndef)(e))this._triggerError("运动对象参数异常");else{var r=d(t,this.generalOps.duration,!0);if(r.isEmpty())this._triggerError("轨迹数据不存在");else{var n=r.getPointerNode();this.tracker=new s.Tracker(n,e,!0,!0,this.mapContainerId),this.tracker.tgLine=r,Object(u.isTrue)(this.generalOps.trackVisible)&&(new s.TrackLine(this.trackStyle,this,this.mapContainerId),this.trackLayer.addTracker(this.tracker)),this.needFrame=!0,this._requestFrame(),this.cycleOps.onplanned&&this.cycleOps.onplanned(this)}}}},{key:"_onframe",value:function(){var t=(new Date).getTime();if(!Object(u.isNumber)(this.prevTimestamp))return this.prevTimestamp=t,void this._requestFrame();var e=this.needFrame?t-this.prevTimestamp:0;this.prevTimestamp=t,this.tracker.render(e*this.speedRate,!0===this.runtimeOps.autoDirection?{type:"AUTO"}:{type:"NONE"},{skipped:function(){return!1},variableSpeed:!1,removeAfterPassed:!1},this.cycleOps,this.runtimeOps.animationFillMode),Object(u.isDef)(this.trackLayer)&&this.trackLayer.render((function(){return!0})),Object(u.isDef)(this.circleLayer)&&this.circleLayer.render(),this._requestFrame()}},{key:"_requestFrame",value:function(){Object(u.isDef)(this.nextFrame)&&(this.nextFrame.cancel(),this.nextFrame=null),Object(u.isTrue)(this.needFrame)&&(this.nextFrame=Object(u.requestFrame)(this._onframe))}},{key:"_load",value:function(){this.request=this.generalOps.isPlan?this._loadPlannedData():this._loadUnplannedData()}},{key:"_loadPlannedData",value:function(){var t=this;return Object(f.driving)({coordinates:this.points,mp:null,st:4,engineType:"keda"},(function(e,r){if(Object(u.isDef)(e))t._triggerError(e.message);else if(r.data&&r.data.rows&&r.data.rows[0]&&r.data.rows[0].routelatlon){var n=r.data.rows[0].routelatlon.split(";").map((function(t){var e=t.split(",");return[parseFloat(e[0]),parseFloat(e[1])]}));n.length>1?(n.length=n.length-1,t._drived(n)):t._triggerError("路径规划失败")}else t._triggerError("路径规划失败")}),this.mapContainerId)}},{key:"_loadUnplannedData",value:function(){var t=this;return Object(u.requestFrame)((function(){t._drived(t.points)}))}},{key:"_triggerError",value:function(t){Object(u.isDef)(this.cycleOps.onerror)&&this.cycleOps.onerror({type:"error",message:t})}},{key:"_drived",value:function(t){this._init(t)}},{key:"_onanimationend",value:function(t){Object(u.isDef)(t)&&Object(u.isFunction)(t)&&t(),"BACKWARDS"===this.runtimeOps.animationFillMode?(this.tracker.setTo(0),this.needFrame=!0):this.needFrame=!1,this._requestFrame(),this.needFrame=!1}}]),t}();function Z(t,e){var r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,r=G(t.points);if(!Object(u.isUndef)(r)){var n=H(t,e);if(!Object(u.isUndef)(n)){var i=V(t);if(!Object(u.isUndef)(i)){var o=Q(t);if(!Object(u.isUndef)(o)){var a=q(t);if(!Object(u.isUndef)(a)){var s=W(t);if(!Object(u.isUndef)(s)){var c=Y(t);if(!Object(u.isUndef)(c))return{points:r,actorStyle:n,trackStyle:i,bufferStyle:o,generalOps:a,runtimeOps:s,cycleOps:c}}}}}}}}(t,e);return Object(u.isDef)(r)?new X(r,e):void 0}var K=r(17),J=r.n(K),$=r(12),tt=r.n($),et=r(13),rt=r.n(et),nt=r(10),it=r.n(nt),ot=r(36),at=r(9),st=r(21),ut=[14,15,16,17,18,19,20,21,22];function ct(t){return["all"].concat(t?t.map((function(t){return["==",["get",t.key],t.value]})):[])}function lt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=it()(t);if(e){var i=it()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rt()(this,r)}}var ht=function(t){tt()(r,t);var e=lt(r);function r(t,n,o){var a;return i()(this,r),(a=e.call(this,null,o)).data=t,a.renderOps=n,a.layer=null,a._visible=!0,a.init(),a}return a()(r,[{key:"init",value:function(){this.setLayerFeature(this.data)}},{key:"buildLayer",value:function(){var t,e,r,n=Object(at.b)(),i={"icon-image":(t=this.renderOps.icons,(e=t.map((function(t){return[["any"].concat([ct(t.filter)]),t.iconImage]})).reduce((function(t,e){return t.concat(e)}),["case"])).push(""),e),"icon-size":(r=this.renderOps.scaleBaseZoom,ut.reduce((function(t,e){return t.push(e),t.push(Math.pow(2,e-r)),t}),["interpolate",["linear"],["zoom"]])),"icon-rotate":["get","ObjAngle"],"icon-pitch-alignment":"map","icon-rotation-alignment":"map","icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0},o={id:n,type:"symbol",source:this.sourceId,layout:i};this.map.addLayer(o),this.layer=n,st.a.setIdDepts(this.layerId,n)}},{key:"removeLayer",value:function(){J()(it()(r.prototype),"remove",this).call(this)}},{key:"destroy",value:function(){this.removeLayer()}},{key:"on",value:function(t,e){J()(it()(r.prototype),"addEvent",this).call(this,t,e)}},{key:"off",value:function(t){J()(it()(r.prototype),"removeEvent",this).call(this,t)}},{key:"show",value:function(){this._visible=!0,J()(it()(r.prototype),"show",this).call(this)}},{key:"hide",value:function(){this._visible=!1,J()(it()(r.prototype),"hide",this).call(this)}},{key:"getVisible",value:function(){return this._visible}}]),r}(ot.a),pt=r(1),dt=r(96),ft=r(186),gt=r(166),mt=r(824);function yt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=it()(t);if(e){var i=it()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rt()(this,r)}}function vt(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return At(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return At(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function At(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{},r=[t.longitude,t.latitude];a.push({type:"Feature",geometry:{type:"Point",coordinates:r},properties:t}),e.ipcCoverageOps.ipcCoverageVisible&&u.push(e._parseIPCCoverage(r,t.deviceAttr)),e.ipcBufferOps.ipcBufferVisible&&c.push(e._parseIPCBuffer(r,t.radius))})),this.ipcBufferOps.ipcBufferVisible&&(this.ipcBufferLayer||(this.ipcBufferLayer=Object(E.e)()?new s.CircleOL(this.ipcBufferOps.style):new s.CircleMM(this.ipcBufferOps.style,null,this.mapContainerId)),this.ipcBufferLayer.setLayerFeature({type:"FeatureCollection",features:c})),this.ipcCoverageOps.ipcCoverageVisible&&(this.ipcCoverageLayer||(this.ipcCoverageLayer=Object(E.e)()?new s.CircleOL(this.ipcCoverageOps.style):new s.CircleMM(this.ipcCoverageOps.style,null,this.mapContainerId)),this.ipcCoverageLayer.setLayerFeature({type:"FeatureCollection",features:u})),this.ipcLayer||(this.ipcLayer=new s.SymbolLayer(this.ipcOps,this.mapContainerId)),this.ipcLayer.setLayerFeature({type:"FeatureCollection",features:a})}},{key:"_parseIPCCoverage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.ipc,n=void 0===r?{}:r,i=n.clearCoverage,o=n.directionType,a=n.maxCoverage,s=n.viewAngle,c=(i||a||1e3)/1e3,l=Ct[o]||0;"9"===o&&(s=360);var h=(s||360)/2,p=l-h,d=l+h,f=u.GeometryUtil.sector(t,c,p,d);return f}},{key:"_parseIPCBuffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return u.GeometryUtil.circle({type:"Feature",geometry:{type:"Point",coordinates:t},properties:{}},e/1e3,{units:"kilometers"})}},{key:"_createTracker",value:function(t){var e=t.longitude,r=t.latitude,n=new c.b(e,r,Date.now(),t),i=new s.Tracker(n,this.actorStyle[0].value,!0,null,this.mapContainerId);return this.actorBufferStyle.circleVisible&&(new s.ActorCircle(this.actorBufferStyle,this,this.mapContainerId),this.circleLayer.addTracker(i),this.circleLayer.render()),this.trackOps.trackVisible&&(new s.TrackLine(this.trackOps.trackStyle,this,this.mapContainerId),this.trackLayer.addTracker(i),this.trackLayer.render()),i}},{key:"_onmessage",value:function(t){var e=JSON.parse(t.body),r=e.data,n=e.traceType;switch(n){case 0:this._setTrackerCoordinates(r);break;case 1:this._setTrackerEnter(r);break;case 2:this._setTrackerOuter(r);break;default:console.warn("VIP Route: unknown trace type '".concat(n,"'."))}}},{key:"_setTrackerCoordinates",value:function(t){var e=t.longitude,r=t.latitude,n=t.timestamp,i=new c.b(e,r,new Date(n).getTime(),t);this.tracker.tgLine.push(i)}},{key:"_setTrackerEnter",value:function(t){var e=t.deputyGbId,r=this.tracker.tgLine.prev;if(r){var n=r.getProperty("__ipcList__")||[];if(!(n.indexOf(e)>-1)){var i=n.concat(e);r.setProperty("__ipcList__",i)}}}},{key:"_setTrackerOuter",value:function(t){var e=t.deputyGbId,r=this.tracker.tgLine.prev;if(r){var n=r.getProperty("__ipcList__")||[];if(!(n.indexOf(e)<0)){var i=n.reduce((function(t,r){return r!==e&&t.push(r),t}),[]);r.setProperty("__ipcList__",i)}}}},{key:"_requestFrame",value:function(t){Object(u.isDef)(this.nextFrame)&&(this.nextFrame.cancel(),this.nextFrame=null),Object(u.isTrue)(t)&&(this.nextFrame=Object(u.requestFrame)(this._onframe))}},{key:"_onframe",value:function(){var t=(new Date).getTime();if(!Object(u.isNumber)(this.prevTimestamp))return this.prevTimestamp=t,void this._requestFrame(!0);var e=t-this.prevTimestamp;this.prevTimestamp=t;var r=Object(u.isUndef)(this.trackLayer)||!this.trackLayer.hasTracker(this.tracker);this.tracker.render(e,!0===this.runtimeOps.autoDirection?{type:"AUTO"}:{type:"NONE"},{skipped:function(){return!1},variableSpeed:!0,removeAfterPassed:r},this.cycleOps),Object(u.isDef)(this.trackLayer)&&this.trackLayer.render((function(t,e,r){return r})),Object(u.isDef)(this.circleLayer)&&this.circleLayer.render(),this._requestFrame(!0)}}]),t}();function It(t,e){var r=wt(t,e);return r?new Et(r,e):void 0}var Mt=r(11),St=r.n(Mt),Tt=r(47),Pt=r.n(Tt);var Ot=r(474),Lt=r.n(Ot),kt=r(250),Rt=r.n(kt),Dt=[14,15,16,17,18,19,20,21,22];function Bt(t){return["all"].concat(t?t.map((function(t){return["==",["get",t.key],t.value]})):[])}function Nt(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ft(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ft(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&r.splice(n,2)};for(i.s();!(e=i.n()).done;)o()}catch(t){i.e(t)}finally{i.f()}var a=["case"].concat(n).concat(r.slice(1));this.map.setLayoutProperty(this.layer,"icon-image",a)}}},{key:"setFilter",value:function(t){this.layer&&this.map.setFilter(this.layer,t)}},{key:"buildLayer",value:function(){var t,e,r,n=Object(at.b)(),i={"icon-image":(t=this.renderOps.icons,(e=t.map((function(t){return[["any"].concat([Bt(t.filter)]),t.iconImage]})).reduce((function(t,e){return t.concat(e)}),["case"])).push(""),e),"icon-size":(r=this.renderOps.scaleBaseZoom,Dt.reduce((function(t,e){return t.push(e),t.push(Math.pow(2,e-r)),t}),["interpolate",["linear"],["zoom"]])),"icon-rotate":["get","objAngle"],"icon-pitch-alignment":"map","icon-rotation-alignment":"map","icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-allow-overlap":!0,"text-ignore-placement":!0},o={id:n,type:"symbol",source:this.sourceId,layout:i};this.map.addLayer(o),this.layer=n,st.a.setIdDepts(this.layerId,n)}},{key:"removeLayer",value:function(){J()(it()(r.prototype),"remove",this).call(this)}},{key:"destroy",value:function(){this.removeLayer()}},{key:"on",value:function(t,e){J()(it()(r.prototype),"addEvent",this).call(this,t,e)}},{key:"off",value:function(t){J()(it()(r.prototype),"removeEvent",this).call(this,t)}},{key:"show",value:function(){this._visible=!0,J()(it()(r.prototype),"show",this).call(this)}},{key:"hide",value:function(){this._visible=!1,J()(it()(r.prototype),"hide",this).call(this)}},{key:"getVisible",value:function(){return this._visible}}]),r}(ot.a);function Ut(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=it()(t);if(e){var i=it()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rt()(this,r)}}function Gt(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ht(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ht(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r15?100:t>14?200:t>13?300:1e3}},{key:"_onmoveend",value:function(){this.boundschangeDelay&&(clearTimeout(this.boundschangeDelay),this.boundschangeDelay=null),this.boundschangeDelay=setTimeout(this._dispatcherMessage,300),this._messageMinDuration=this._getMessageMinDuration();var t=this._isHideVehiclesAndPopups;this._isHideVehiclesAndPopups=Object(E.d)(this.mapContainerId)500){console.warn("".concat(o," 前后推送的点位时间相差过大,为").concat(p,"ms,总计").concat(s[o].points.length,"个点"));var d=a.properties.timestamp-200;l.properties.timestamp=d,this.attentionMap[o].points=[l],this.attentionMap[o].timestamp=d}s[o].points.push(a)}else s[o].points.push(a),s[o].timestamp=a.properties.timestamp;if(s[o].points.length>10){for(console.warn("".concat(o," 推送的点位积压过大,为").concat(s[o].points.length,"个"));s[o].points.length>10;)s[o].points.shift();this.attentionMap[o].timestamp=s[o].points[0].properties.timestamp}}}},{key:"_removeAllVehiclesAndPopups",value:function(){this.iconLayer.setLayerFeature({type:"FeatureCollection",features:[]});for(var t=0,e=Object.keys(this.attentionMap);t=8?e*=1.5:o.length>=10&&(e*=2);for(var s=0;su.properties.timestamp&&l0&&this.attentionMap[t].points.splice(0,n)}return r}},{key:"_keyFrame",value:function(){var t=this,e=Date.now()-this.prevTimestamp,r=[];if(this.iconLayer){for(var n in this.attentionMap){var i=this._getAnimationPoint(n,e);i&&(this.attentionMap[n].geojson=i,r.push(i))}this.iconLayer.setLayerFeature({type:"FeatureCollection",features:r});var o=r.map((function(t){return t.properties}));this.onmessage&&"function"==typeof this.onmessage&&this.onmessage(o)}for(var a=function(){var e=c[s],n=r.find((function(t){return t.properties.plateNo===e}));if(n){var i=n.geometry.coordinates;t._updatePopupPositionByVehPate(e,i)}},s=0,c=Object.keys(this.attentionMap);s100&&console.warn("\n MaxListenersExceededWarning: Possible MapEvent memory leak detected. ".concat(o[r].size," \n event listeners added to ").concat(r," type. Please check and make sure you really need these listeners!")),t._mapListenerDepts.set(e,o)}},{key:"_setOneTimeListenerDepts",value:function(e,r,n,i){var o=t._oneTimeMapListenerDepts.get(e)||{};o[r]=o[r]||new Map,i=i||n,o[r].set(n,i),o[r].size>100&&console.warn("\n MaxListenersExceededWarning: Possible MapEvent memory leak detected. ".concat(o[r].size," \n event listeners added to ").concat(r," type. Please check and make sure you really need these listeners!")),t._oneTimeMapListenerDepts.set(e,o)}},{key:"_onDirectlyDOMEvent",value:function(e,r){return function(n){var i=t._mapListenerDepts.get(e)||{},o=t._oneTimeMapListenerDepts.get(e)||{};if(!l()(i)||!l()(o)){var a=i[r]||new Set,s=o[r]||new Set,u=e.getContainer();a.forEach((function(t){var i=m(n,e,u.id),o=i.point,a=i.lngLat;t(Object.assign({},n,{type:r,point:o,lngLat:a,originalEvent:n,target:e}))}));for(var c=s,h=0,p=c.length;h0&&Object.defineProperty(o,"defaultPrevented",{value:!0})}var c=t._mapListenerDepts.get(e)||{};l()(c)||c[r].forEach((function(t){t(Object.assign({},{isTrusted:!1!==o.isTrusted,type:r,target:o.target,point:o.point}))}))}}}]),t}();y._directlyEvents=new WeakMap,y._delegateEvents=new WeakMap,y._mapListenerDepts=new Map,y._mapEventBindListenerSet={},y._oneTimeMapListenerDepts=new Map},function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return i})),r.d(e,"d",(function(){return o})),r.d(e,"e",(function(){return a})),r.d(e,"f",(function(){return s})),r.d(e,"g",(function(){return u})),r.d(e,"c",(function(){return c})),r.d(e,"h",(function(){return l}));r(39);function n(t,e){return t[0]+=e[0],t[1]+=e[1],t}function i(t,e){var r,n,i=t[0],o=t[1],a=e[0],s=e[1],u=a[0],c=a[1],l=s[0],h=s[1],p=l-u,d=h-c,f=0===p&&0===d?0:(p*(i-u)+d*(o-c))/(p*p+d*d||0);return f<=0?(r=u,n=c):f>=1?(r=l,n=h):(r=u+f*p,n=c+f*d),[r,n]}function o(t,e){for(var r=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){r=!1;break}return r}function a(t,e){var r=Math.cos(e),n=Math.sin(e),i=t[0]*r-t[1]*n,o=t[1]*r+t[0]*n;return t[0]=i,t[1]=o,t}function s(t,e){return t[0]*=e,t[1]*=e,t}function u(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function c(t,e){return Math.sqrt(u(t,e))}function l(t,e){return u(t,i(t,e))}},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function o(){}function a(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function s(t,e,r,n,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,n||t,o),u=i?i+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)n.call(t,e)&&r.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},c.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n0?t.animate({rotation:e,anchor:r,duration:n,easing:i.b}):t.rotate(e,r)}}function h(t,e,r,n,i){e=t.constrainResolution(e,0,i),d(t,e,r,n)}function p(t,e,r,n){var i=t.getResolution(),o=t.constrainResolution(i,e,0);if(void 0!==o){var s=t.getResolutions();o=Object(a.a)(o,t.getMinResolution()||s[s.length-1],t.getMaxResolution()||s[0])}if(r&&void 0!==o&&o!==i){var u=t.getCenter(),c=t.calculateCenterZoom(o,r);c=t.constrainCenter(c),r=[(o*u[0]-i*c[0])/(o-i),(o*u[1]-i*c[1])/(o-i)]}d(t,o,r,n)}function d(t,e,r,n){if(e){var o=t.getResolution(),a=t.getCenter();if(void 0!==o&&a&&e!==o&&n)t.animate({resolution:e,anchor:r,duration:n,easing:i.b});else{if(r){var s=t.calculateCenterZoom(e,r);t.setCenter(s)}t.setResolution(e)}}}e.a=s},function(t,e,r){"use strict";var n;r.d(e,"a",(function(){return n})),function(t){t.Hover="hover",t.Click="click",t.Select="select",t.Active="active",t.Drag="drag"}(n||(n={}))},function(t,e,r){"use strict";r.d(e,"b",(function(){return f}));var n=r(26),i=r(253),o=r(35),a=r(152),s=r(44);var u=function(t){function e(){t.call(this),this.revision_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){++this.revision_,this.dispatchEvent(s.a.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;i0?(r[0]=2*(u*s+h*i+c*a-l*o)/p,r[1]=2*(c*s+h*o+l*i-u*a)/p,r[2]=2*(l*s+h*a+u*o-c*i)/p):(r[0]=2*(u*s+h*i+c*a-l*o),r[1]=2*(c*s+h*o+l*i-u*a),r[2]=2*(l*s+h*a+u*o-c*i)),M(t,e,r),t}function T(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function P(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,l),t}function O(t,e){var r=new n.a(3);P(r,e);var i=1/r[0],o=1/r[1],a=1/r[2],s=e[0]*i,u=e[1]*o,c=e[2]*a,l=e[4]*i,h=e[5]*o,p=e[6]*a,d=e[8]*i,f=e[9]*o,g=e[10]*a,m=s+h+g,y=0;return m>0?(y=2*Math.sqrt(m+1),t[3]=.25*y,t[0]=(p-f)/y,t[1]=(d-c)/y,t[2]=(u-l)/y):s>h&&s>g?(y=2*Math.sqrt(1+s-h-g),t[3]=(p-f)/y,t[0]=.25*y,t[1]=(u+l)/y,t[2]=(d+c)/y):h>g?(y=2*Math.sqrt(1+h-s-g),t[3]=(d-c)/y,t[0]=(u+l)/y,t[1]=.25*y,t[2]=(p+f)/y):(y=2*Math.sqrt(1+g-s-h),t[3]=(u-l)/y,t[0]=(d+c)/y,t[1]=(p+f)/y,t[2]=.25*y),t}function L(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,p=i*c,d=i*l,f=o*c,g=o*l,m=a*l,y=s*u,v=s*c,A=s*l,_=n[0],b=n[1],x=n[2];return t[0]=(1-(f+m))*_,t[1]=(p+A)*_,t[2]=(d-v)*_,t[3]=0,t[4]=(p-A)*b,t[5]=(1-(h+m))*b,t[6]=(g+y)*b,t[7]=0,t[8]=(d+v)*x,t[9]=(g-y)*x,t[10]=(1-(h+f))*x,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function k(t,e,r,n,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,p=o*c,d=o*l,f=o*h,g=a*l,m=a*h,y=s*h,v=u*c,A=u*l,_=u*h,b=n[0],x=n[1],w=n[2],C=i[0],E=i[1],I=i[2],M=(1-(g+y))*b,S=(d+_)*b,T=(f-A)*b,P=(d-_)*x,O=(1-(p+y))*x,L=(m+v)*x,k=(f+A)*w,R=(m-v)*w,D=(1-(p+g))*w;return t[0]=M,t[1]=S,t[2]=T,t[3]=0,t[4]=P,t[5]=O,t[6]=L,t[7]=0,t[8]=k,t[9]=R,t[10]=D,t[11]=0,t[12]=r[0]+C-(M*C+P*E+k*I),t[13]=r[1]+E-(S*C+O*E+R*I),t[14]=r[2]+I-(T*C+L*E+D*I),t[15]=1,t}function R(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,c=r*a,l=n*a,h=n*s,p=i*a,d=i*s,f=i*u,g=o*a,m=o*s,y=o*u;return t[0]=1-h-f,t[1]=l+y,t[2]=p-m,t[3]=0,t[4]=l-y,t[5]=1-c-f,t[6]=d+g,t[7]=0,t[8]=p+m,t[9]=d-g,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function D(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function B(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}function N(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function F(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*c,t[15]=1,t}function j(t,e,r,i){var o,a,s,u,l,h,p,d,f,g,m=e[0],y=e[1],v=e[2],A=i[0],_=i[1],b=i[2],x=r[0],w=r[1],C=r[2];return Math.abs(m-x)0&&(l*=d=1/Math.sqrt(d),h*=d,p*=d);var f=u*p-c*h,g=c*l-s*p,m=s*h-u*l;return(d=f*f+g*g+m*m)>0&&(f*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=f,t[1]=g,t[2]=m,t[3]=0,t[4]=h*m-p*g,t[5]=p*f-l*m,t[6]=l*g-h*f,t[7]=0,t[8]=l,t[9]=h,t[10]=p,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function U(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function G(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function H(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function V(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function Q(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function q(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function W(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function Y(t,e){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],p=t[9],d=t[10],f=t[11],g=t[12],m=t[13],y=t[14],v=t[15],A=e[0],_=e[1],b=e[2],x=e[3],w=e[4],C=e[5],E=e[6],I=e[7],M=e[8],S=e[9],T=e[10],P=e[11],O=e[12],L=e[13],k=e[14],R=e[15];return Math.abs(r-A)<=n.b*Math.max(1,Math.abs(r),Math.abs(A))&&Math.abs(i-_)<=n.b*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(o-b)<=n.b*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-x)<=n.b*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(s-w)<=n.b*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-C)<=n.b*Math.max(1,Math.abs(u),Math.abs(C))&&Math.abs(c-E)<=n.b*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-I)<=n.b*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(h-M)<=n.b*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(p-S)<=n.b*Math.max(1,Math.abs(p),Math.abs(S))&&Math.abs(d-T)<=n.b*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(f-P)<=n.b*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(g-O)<=n.b*Math.max(1,Math.abs(g),Math.abs(O))&&Math.abs(m-L)<=n.b*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(y-k)<=n.b*Math.max(1,Math.abs(y),Math.abs(k))&&Math.abs(v-R)<=n.b*Math.max(1,Math.abs(v),Math.abs(R))}var X=f,Z=V},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct"},function(t,e,r){"use strict";r.d(e,"a",(function(){return P}));var n,i,o,a,s,u=r(11),c=r.n(u),l=r(33),h=r.n(l),p=r(3),d=r.n(p),f=r(4),g=r.n(f),m=r(6),y=r.n(m),v=(r(66),r(312)),A=r.n(v),_=r(116),b=r.n(_),x=r(480),w=r.n(x),C=r(16),E=r(8),I=r(24),M=r(94);function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function T(t){for(var e=1;e0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(Z);function et(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),J(O,t)}function rt(t,e){return e?q(t,e):new k(z(t))}var nt=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new it(t,this.predicate,this.thisArg))},t}(),it=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return m(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(S);function ot(){}function at(t,e,r){return function(n){return n.lift(new st(t,e,r))}}var st=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new ut(t,this.nextOrObserver,this.error,this.complete))},t}(),ut=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o._tapNext=ot,o._tapError=ot,o._tapComplete=ot,o._tapError=n||ot,o._tapComplete=i||ot,y(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||ot,o._tapError=r.error||ot,o._tapComplete=r.complete||ot),o}return m(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(S);var ct=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new lt(t,this.project))},t}(),lt=function(t){function e(e,r){var n=t.call(this,e)||this;return n.project=r,n.index=0,n}return m(e,t),e.prototype._next=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this._innerSub(e)},e.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var r=new X(this),n=this.destination;n.add(r),this.innerSubscription=K(t,r),this.innerSubscription!==r&&n.add(this.innerSubscription)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t){this.destination.next(t)},e}(Z);var ht=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var r=new pt(t),n=K(this.notifier,new X(r));return n&&!r.seenValue?(r.add(n),e.subscribe(r)):r},t}(),pt=function(t){function e(e){var r=t.call(this,e)||this;return r.seenValue=!1,r}return m(e,t),e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(Z),dt=r(103),ft=r(126),gt=r(67),mt=r(9),yt=r(1);function vt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p()(t);if(e){var i=p()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}var At=function(t){u()(r,t);var e=vt(r);function r(t,n){var o;if(i()(this,r),o=e.call(this),!t)return l()(o);var a=t.element,s=Object(mt.b)();a.id=s,o.mapInstance=yt.a.getProps(n,"map");var u=yt.a.getProps(n,"kedamap");return o._mapCore=o.mapInstance.map,o._overlay=new u.Marker(a,t),o._draggable=!1,o._dragSubscription=null,o._diff={},o}return a()(r,[{key:"addToMap",value:function(){return this._overlay.addTo(this._mapCore),this}},{key:"removeFromMap",value:function(){return this._overlay.remove(),this}},{key:"getLngLat",value:function(){return this._overlay.getLngLat()}},{key:"setLngLat",value:function(t){return this._overlay.setLngLat(t),this}},{key:"getElement",value:function(){return this._overlay.getElement()}},{key:"setPopup",value:function(t){return this._overlay.setPopup(t),this}},{key:"getPopup",value:function(){return this._overlay.getPopup()}},{key:"togglePopup",value:function(){return this._overlay.togglePopup(),this}},{key:"getOffset",value:function(){var t=this._overlay.getOffset();return f()(t)?t:[t.x,t.y]}},{key:"setOffset",value:function(t){return this._overlay.setOffset(t),this}},{key:"setDraggable",value:function(t){var e,r,n=this;if(this._draggable=t,this._mapCore)if(this._draggable){var i=this.getElement(),o=this._mapCore,a=F((function(t){return gt.a.on(o)("mousedown",t)})),s=F((function(t){return gt.a.on(o)("mousemove",t)})),u=F((function(t){return gt.a.on(o)("mouseup",t)})),c=F((function(t){return gt.a.on(o)("mouseleave",t)}));this._dragSubscription||(this._dragSubscription=a.pipe((e=function(t){return i.contains(t.originalEvent.target)},function(t){return t.lift(new nt(e,r))}),at((function(t){o.dragPan.disable(),i.style.cursor="move";var e=n._mapCore.project([n.getLngLat().lng,n.getLngLat().lat]);n._diff.left=t.point.x-e.x,n._diff.top=t.point.y-e.y,dt.a.fireDragEvent(t,i,"dragstart")})),function t(e,r){return"function"==typeof r?function(n){return n.pipe(t((function(t,n){return Y(e(t,n)).pipe(D((function(e,i){return r(t,e,n,i)})))})))}:function(t){return t.lift(new ct(e))}}((function(){return s.pipe(D((function(t){return dt.a.fireDragEvent(t,i,"dragging"),t})),(t=function(){for(var t=[],e=0;e1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof i&&(r=t.pop()),null===n&&1===t.length&&t[0]instanceof k?t[0]:et(r)(rt(t,n))}(c,u).pipe(at((function(t){i.style.cursor="pointer",o.dragPan.enable(),dt.a.fireDragEvent(t,i,"dragend")}))),function(e){return e.lift(new ht(t))}));var t}))).subscribe((function(t){var e=t.point.x-n._diff.left,r=t.point.y-n._diff.top,i=n._mapCore.unproject({x:e,y:r});n.setLngLat(i)})))}else this._dragSubscription&&(this._dragSubscription.unsubscribe(),this._dragSubscription=null);return this}},{key:"isDraggable",value:function(){return this._draggable}},{key:"addEvent",value:function(t,e){var r=this.getId();dt.a.on(t,"#".concat(r),e)}},{key:"removeEvent",value:function(t){var e=this.getId();dt.a.off(t,"#".concat(e))}},{key:"getId",value:function(){return this.getElement().id}},{key:"setProperty",value:function(t){return this.getElement().setAttribute("__customProps__",t),this}}]),r}(ft.a)},function(t,e,r){"use strict";(function(t,n){ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +function i(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))}function o(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function u(t,e){return t(e={exports:{}},e.exports),e.exports}r.d(e,"a",(function(){return T})),r.d(e,"b",(function(){return L})),r.d(e,"c",(function(){return I})),r.d(e,"d",(function(){return O}));var c=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t&&"number"==typeof t.length&&t.length>=0&&t.length%1==0},t.exports=e.default}));s(c);var l=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var n=e.pop();return t.call(this,e,n)}},t.exports=e.default}));s(l);var h=u((function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.fallback=s,r.wrap=u;var i,o=r.hasSetImmediate="function"==typeof t&&t,a=r.hasNextTick="object"==typeof n&&"function"==typeof n.nextTick;function s(t){setTimeout(t,0)}function u(t){return function(e){for(var r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return t((function(){return e.apply(void 0,r)}))}}i=o?t:a?n.nextTick:s,r.default=u(i)}));s(h);h.fallback,h.wrap,h.hasSetImmediate,h.hasNextTick;var p=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if((0,d.isAsync)(t))return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var n=e.pop(),i=t.apply(this,e);return o(i,n)};return(0,r.default)((function(e,r){var n;try{n=t.apply(this,e)}catch(t){return r(t)}if(n&&"function"==typeof n.then)return o(n,r);r(null,n)}))};var r=i(l),n=i(h);function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e){return t.then((function(t){a(e,null,t)}),(function(t){a(e,t&&t.message?t:new Error(t))}))}function a(t,e,r){try{t(e,r)}catch(t){(0,n.default)((function(t){throw t}),t)}}t.exports=e.default}));s(p);var d=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isAsyncIterable=e.isAsyncGenerator=e.isAsync=void 0;var r,n=(r=p)&&r.__esModule?r:{default:r};function i(t){return"AsyncFunction"===t[Symbol.toStringTag]}e.default=function(t){if("function"!=typeof t)throw new Error("expected a function");return i(t)?(0,n.default)(t):t},e.isAsync=i,e.isAsyncGenerator=function(t){return"AsyncGenerator"===t[Symbol.toStringTag]},e.isAsyncIterable=function(t){return"function"==typeof t[Symbol.asyncIterator]}}));s(d);d.isAsyncIterable,d.isAsyncGenerator,d.isAsync;var f=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){void 0===e&&(e=t.length);if(!e)throw new Error("arity is undefined");function r(){for(var r=this,n=[],i=arguments.length;i--;)n[i]=arguments[i];return"function"==typeof n[e-1]?t.apply(this,n):new Promise((function(i,o){n[e-1]=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];if(t)return o(t);i(e.length>1?e:e[0])},t.apply(r,n)}))}return Object.defineProperty(r,"name",{configurable:!0,value:"awaitable("+t.name+")"}),r},t.exports=e.default}));s(f);var g=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=o(c),n=o(d),i=o(f);function o(t){return t&&t.__esModule?t:{default:t}}e.default=(0,i.default)((function(t,e,i){var o=(0,r.default)(e)?[]:{};t(e,(function(t,e,r){(0,n.default)(t)((function(t){for(var n=[],i=arguments.length-1;i-- >0;)n[i]=arguments[i+1];n.length<2&&(n=n[0]),o[e]=n,r(t)}))}),(function(t){return i(t,o)}))}),3),t.exports=e.default}));s(g);var m=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){function e(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(null!==t){var n=t;t=null,n.apply(this,e)}}return Object.assign(e,t),e},t.exports=e.default}));s(m);var y=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()},t.exports=e.default}));s(y);var v=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if((0,r.default)(t))return function(t){var e=-1,r=t.length;return function(){return++e=e||s||o||(s=!0,t.next().then((function(t){var e=t.value,n=t.done;if(!a&&!o){if(s=!1,n)return o=!0,void(u<=0&&i(null));u++,r(e,c,h),c++,l()}})).catch(p))}function h(t,e){if(u-=1,!a)return t?p(t):!1===t?(o=!0,void(a=!0)):e===n.default||o&&u<=0?(o=!0,i(null)):void l()}function p(t){a||(s=!1,o=!0,i(t))}l()};var r,n=(r=_)&&r.__esModule?r:{default:r};t.exports=e.default}));s(b);var x=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var r=s(m),n=s(v),i=s(A),o=s(b),a=s(_);function s(t){return t&&t.__esModule?t:{default:t}}e.default=function(t){return function(e,s,u){if(u=(0,r.default)(u),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return u(null);if((0,d.isAsyncGenerator)(e))return(0,o.default)(e,t,s,u);if((0,d.isAsyncIterable)(e))return(0,o.default)(e[Symbol.asyncIterator](),t,s,u);var c=(0,n.default)(e),l=!1,h=!1,p=0,f=!1;function g(t,e){if(!h)if(p-=1,t)l=!0,u(t);else if(!1===t)l=!0,h=!0;else{if(e===a.default||l&&p<=0)return l=!0,u(null);f||m()}}function m(){for(f=!0;p0;)n[i]=arguments[i+1];if(!1!==r)return r||o===t.length?e.apply(void 0,[r].concat(n)):void a(n)}a([])})),t.exports=e.default}))),O=function(){function t(){for(var t=arguments,e=[],r=0;r=0&&l.splice(e,1)}function m(t){var e=document.createElement("style");return t.attrs.type="text/css",y(e,t.attrs),f(t,e),e}function y(t,e){Object.keys(e).forEach((function(r){t.setAttribute(r,e[r])}))}function v(t,e){var r,n,i,o;if(e.transform&&t.css){if(!(o=e.transform(t.css)))return function(){};t.css=o}if(e.singleton){var a=c++;r=u||(u=m(e)),n=b.bind(null,r,a,!1),i=b.bind(null,r,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",y(e,t.attrs),f(t,e),e}(e),n=w.bind(null,r,e),i=function(){g(r),r.href&&URL.revokeObjectURL(r.href)}):(r=m(e),n=x.bind(null,r),i=function(){g(r)});return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var r=d(t,e);return p(r,e),function(t){for(var n=[],i=0;i1)u=r;else{if(d>0){for(var f=0;fo&&(o=l),a=u,s=c}return o}function a(t,e,r,n,i){for(var a=0,s=r.length;a=o&&t<=a||!a)return{circleRadius:r[n].circleRadius||e.circleRadius||R,circleColor:r[n].circleColor||e.circleColor||D,circleStrokeWidth:r[n].circleStrokeWidth||e.circleStrokeWidth||B,circleStrokeColor:r[n].circleStrokeColor||e.circleStrokeColor||N,countTextColor:r[n].countTextColor||e.countTextColor||F,countTextSize:r[n].countTextSize||e.countTextSize||j}}return{circleRadius:e.circleRadius||R,circleColor:e.circleColor||D,circleStrokeWidth:e.circleStrokeWidth||B,circleStrokeColor:e.circleStrokeColor||N,countTextColor:e.countTextColor||F,countTextSize:e.countTextSize||j}}(r,e);return new S.c({image:new M.a({radius:n.circleRadius,stroke:new I.a({color:n.circleStrokeColor,width:n.circleStrokeWidth}),fill:new E.a({color:n.circleColor})}),text:new O({text:r+"",fill:new E.a({color:n.countTextColor}),font:n.countTextSize+"px sans-serif"})})}function H(t,e,r,n){var i=t.getGeometry().getType();if(e.icons&&"regionLayer"!==e.layerType)return new S.c({image:Q(t,e)});var o="",a=e.defaultStyles||{};switch(r=r||{},i){case"Point":o=W(t,n?{}:a,r,n);break;case"LineString":case"MultiLineString":o=Y(t,n?{}:a,r,n);break;case"MultiPoint":o=W(t,n?{}:a,r,n);break;case"MultiPolygon":case"Polygon":case"GeometryCollection":case"Circle":o=X(t,n?{}:a,r,n)}return o}var V=!0;function Q(t,e){var r="",n=1,i=t.values_;e.icons&&e.icons.length>0&&(e.icons[0].filter?e.icons.forEach((function(t){t.filter&&(t.filter.forEach((function(t){!function t(e,r){if(e.filter){if(!r[e.key])return void(V=!1);for(var n=0;n-1&&(n=t.iconName)}));var i=y.a.spriteJson[n]?y.a.spriteJson[n]:y.a.spriteJson["point-11"];return new L.a({offset:[i.x,i.y],opacity:1,rotateWithView:!0,rotation:0,scale:1,size:[i.width,i.height],crossOrigin:"anonymous",src:y.a.spriteUrl})}function W(t,e,r,n){var i,o,a,s;if(n){i=r["circle-radius"]||t.get("circle-radius")||e["circle-radius"]||3,o=r["circle-color"]||t.get("circle-color")||e["circle-color"]||"rgba(210,12,12,1)",a=r["circle-stroke-color"]||t.get("circle-stroke-color")||e["circle-stroke-color"]||o,s=r["circle-stroke-width"]||t.get("circle-stroke-width")||e["circle-stroke-width"]||0;var u={};i&&(u.radius=i),o&&(u.fill=new E.a({color:o}));var c={};return a&&(c.color=a),s&&(c.width=s),u.stroke=new I.a(c),new S.c(Object.assign(n,{image:new M.a(u)}))}return i=r["circle-radius"]||t.get("circle-radius")||e["circle-radius"]||z.circleRadius,o=r["circle-color"]||t.get("circle-color")||e["circle-color"]||z.circleColor,a=r["circle-stroke-color"]||t.get("circle-stroke-color")||e["circle-stroke-color"]||z.circleColor,s=r["circle-stroke-width"]||t.get("circle-stroke-width")||e["circle-stroke-width"]||z.circleStrokeWidth,new S.c({image:new M.a({radius:i,fill:new E.a({color:o}),stroke:new I.a({color:a,width:s})})})}function Y(t,e,r,n){var i,o,a,s;if(n){i=r["line-color"]||t.get("line-color")||e["line-color"]||"rgba(210,12,12,1)",o=r["line-dasharray"]||t.get("line-dasharray")||e["line-dasharray"],a=r["line-cap"]||t.get("line-cap")||e["line-cap"],s=r["line-width"]||t.get("line-width")||e["line-width"]||1;var u={};i&&(u.fill=new E.a({color:i}));var c={lineJoin:"round"};return i&&(c.color=i),s&&(c.width=s),o&&(c.lineDash=o),a&&(c.lineCap="round"),u.stroke=new I.a(c),new S.c(Object.assign(n,u))}return i=r["line-color"]||t.get("line-color")||e["line-color"]||z.lineColor,o=r["line-dasharray"]||t.get("line-dasharray")||e["line-dasharray"]||z.lineDasharray,a=r["line-cap"]||t.get("line-cap")||e["line-cap"]||z.lineCap,s=r["line-width"]||t.get("line-width")||e["line-width"]||z.lineWidth,new S.c({fill:new E.a({color:i}),stroke:new I.a({color:i,width:s,lineDash:o,lineJoin:"round",lineCap:a})})}function X(t,e,r,n){var i,o,a;if(n){i=r["fill-color"]||t.get("fill-color")||e["fill-color"],o=r["fill-outline-color"]||t.get("fill-outline-color")||e["fill-outline-color"],a=r["line-width"]||t.get("line-width")||e["line-width"];var s={};i&&(s.fill=new E.a({color:i}));var u={};return o&&(u.color=o),a&&(u.width=a),new S.c(Object.assign(n,s))}return i=r["fill-color"]||t.get("fill-color")||e["fill-color"]||z.fillColor,o=r["fill-outline-color"]||t.get("fill-outline-color")||e["fill-outline-color"]||z.fillOutlineColor,a=r["line-width"]||t.get("line-width")||e["line-width"]||z.lineWidth,new S.c({fill:new E.a({color:i}),stroke:new I.a({color:o,width:a})})}function Z(t,e,r){return"iconText"===r||"iconTextVector"===r?function(t,e,r){var n="iconText"===r?"properties_":"values_";if(!(t[n]&&t[n].aggsCount&&t[n].aggsCount>1)){var i=null;return i=e.iconTextStyle?new O({offsetX:e.iconTextStyle.textOffset&&e.iconTextStyle.textOffset[0]||0,offsetY:e.iconTextStyle.textOffset&&e.iconTextStyle.textOffset[1]||20,font:(e.iconTextStyle.textSize||12)+"px sans-serif",placement:"point",textAlign:"center",text:t[n][e.showText],backgroundFill:new E.a({color:e.iconTextStyle.iconColor||"#1569E0"}),padding:e.iconTextStyle.iconTextFitPadding||[0,6,0,6],fill:new E.a({color:e.iconTextStyle.textColor||"#fff"})}):new O({offsetX:0,offsetY:20,font:"12px sans-serif",placement:"point",textAlign:"center",text:t[n][e.showText]}),new S.c({text:i})}}(t,e,r):"geometry"===e.layerType||"regionLayer"===e.layerType?H(t,e):"mixedLayer"===e.layerType?U(t,e):G(t,e)}var K=r(201),J=r(25),$=r(20),tt=r(86),et=r(85),rt=function(t){function e(e,r,n){if(t.call(this),void 0!==n&&void 0===r)this.setFlatCoordinates(n,e);else{var i=r||0;this.setCenterAndRadius(e,i,n)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),void 0,this.layout)},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=t-i[0],a=e-i[1],s=o*o+a*a;if(s=r[0]||(t[1]<=r[1]&&t[3]>=r[1]||Object(J.q)(t,this.intersectsCoordinate,this))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+r;for(var i=1;i=this.transition_?1:Object(ft.a)(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(gt.a),vt=r(100),At=r(35),_t=r(265),bt=r(64),xt=function(t){function e(r,n,i,o,a,s,u,c,l,h,p,d,f,g,m){if(t.call(this,r,n,{transition:0}),this.context_={},this.loader_,this.replayState_={},this.sourceTiles_=h,this.tileKeys=[],this.extent=null,this.sourceRevision_=i,this.wrappedTileCoord=s,this.loadListenerKeys_=[],this.sourceTileListenerKeys_=[],s){var y=this.extent=l.getTileCoordExtent(s),v=l.getResolution(m),A=c.getZForResolution(v),_=m!=r[0],b=0;if(c.forEachTileCoord(y,A,function(t){var e=Object(J.v)(y,c.getTileCoordExtent(t)),r=c.getExtent();if(r&&(e=Object(J.v)(e,r,e)),Object(J.y)(e)/v>=.5&&Object(J.u)(e)/v>=.5){++b;var n=t.toString(),i=h[n];if(!i&&!_){var s=u(t,p,d);i=h[n]=new f(t,null==s?ht:st,null==s?"":s,o,a),this.sourceTileListenerKeys_.push(Object(At.a)(i,mt.a.CHANGE,g))}!i||_&&i.getState()!=ct||(i.consumers++,this.tileKeys.push(n))}}.bind(this)),_&&b==this.tileKeys.length&&this.finishLoading_(),m<=r[0]&&this.state!=ct)for(;m>l.getMinZoom();){var x=new e(r,n,i,o,a,s,u,c,l,h,p,d,f,bt.c,--m);if(x.state==ct){this.interimTile=x;break}}}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state=pt,this.changed(),this.interimTile&&this.interimTile.dispose();for(var e=0,r=this.tileKeys.length;e=0;--r){var n=this.getTile(this.tileKeys[r]).getState();n!=ct&&--t,n==ht&&++e}t==this.tileKeys.length?(this.loadListenerKeys_.forEach(At.e),this.loadListenerKeys_.length=0,this.setState(ct)):this.setState(e==this.tileKeys.length?ht:lt)},e}(yt);function wt(t,e){var r=Object(_t.a)(e,t.getFormat(),t.onLoad.bind(t),t.onError.bind(t));t.setLoader(r)}var Ct=[0,0,4096,4096],Et=function(t){function e(e,r,n,i,o,a){t.call(this,e,r,a),this.consumers=0,this.extent_=null,this.format_=i,this.features_=null,this.loader_,this.projection_=null,this.replayGroups_={},this.tileLoadFunction_=o,this.url_=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.features_=null,this.replayGroups_={},this.state=pt,this.changed(),t.prototype.disposeInternal.call(this)},e.prototype.getExtent=function(){return this.extent_||Ct},e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.getKey=function(){return this.url_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getReplayGroup=function(t,e){return this.replayGroups_[Object(dt.c)(t)+","+e]},e.prototype.load=function(){this.state==st&&(this.setState(ut),this.tileLoadFunction_(this,this.url_),this.loader_(null,NaN,null))},e.prototype.onLoad=function(t,e,r){this.setProjection(e),this.setFeatures(t),this.setExtent(r)},e.prototype.onError=function(){this.setState(lt)},e.prototype.setExtent=function(t){this.extent_=t},e.prototype.setFeatures=function(t){this.features_=t,this.setState(ct)},e.prototype.setProjection=function(t){this.projection_=t},e.prototype.setReplayGroup=function(t,e,r){this.replayGroups_[Object(dt.c)(t)+","+e]=r},e.prototype.setLoader=function(t){this.loader_=t},e}(yt);function It(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:e[0]=e[1]=t,e)}var Mt=r(48),St=r(39);function Tt(t,e,r,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=r,n):[t,e,r]}function Pt(t,e,r){return t+"/"+e+"/"+r}function Ot(t,e){var r=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,u){return a?t.replace(r,a[0].toString()).replace(n,a[1].toString()).replace(i,(function(){return(-a[2]-1).toString()})).replace(o,(function(){var t=a[0],r=e.getFullTileRange(t);return Object(Mt.a)(r,55),(r.getHeight()+a[2]).toString()})):void 0}}function Lt(t,e){for(var r=t.length,n=new Array(r),i=0;ithis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},jt.prototype.getHeight=function(){return this.maxY-this.minY+1},jt.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},jt.prototype.getWidth=function(){return this.maxX-this.minX+1},jt.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var Ut=jt,Gt=r(59),Ht=[0,0,0],Vt=function(t){var e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Object(Mt.a)(Object(Gt.d)(this.resolutions_,(function(t,e){return e-t}),!0),17),!t.origins)for(var r=0,n=this.resolutions_.length-1;r=this.minZoom;){if(o=2===this.zoomFactor_?zt(a=Math.floor(a/2),a,s=Math.floor(s/2),s,n):this.getTileRangeForExtentAndZ(u,c,n),e.call(r,c,o))return!0;--c}return!1},Vt.prototype.getExtent=function(){return this.extent_},Vt.prototype.getMaxZoom=function(){return this.maxZoom},Vt.prototype.getMinZoom=function(){return this.minZoom},Vt.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},Vt.prototype.getResolution=function(t){return this.resolutions_[t]},Vt.prototype.getResolutions=function(){return this.resolutions_},Vt.prototype.getTileCoordChildTileRange=function(t,e,r){if(t[0]r||r>e.getMaxZoom())return!1;var o,a=e.getExtent();return!(o=a?e.getTileRangeForExtentAndZ(a,r):e.getFullTileRange(r))||o.containsXY(n,i)}(t,n)?t:null},e.prototype.refresh=function(){this.tileCache.clear(),this.changed()},e.prototype.useTile=function(t,e,r,n){},e}(Bt.a),Zt=function(t){function e(e,r){t.call(this,e),this.tile=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Dt.a),Kt="tileloadstart",Jt="tileloadend",$t="tileloaderror",te=function(t){function e(e){var r=e.projection||"EPSG:3857",n=e.extent||Yt(r),i=e.tileGrid||function(t){var e=t||{},r=e.extent||Object(C.d)("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:qt(r,e.maxZoom,e.tileSize)};return new Qt(n)}({extent:n,maxZoom:e.maxZoom||22,minZoom:e.minZoom,tileSize:e.tileSize||512});t.call(this,{attributions:e.attributions,cacheSize:void 0!==e.cacheSize?e.cacheSize:128,opaque:!1,projection:r,state:e.state,tileGrid:i,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:wt,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition}),this.format_=e.format?e.format:null,this.sourceTiles_={},this.overlaps_=null==e.overlaps||e.overlaps,this.tileClass=e.tileClass?e.tileClass:Et,this.tileGrids_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTiles_={}},e.prototype.getTile=function(t,e,r,n,i){var o=Pt(t,e,r);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),u=new xt(a,null!==s?st:ht,this.getRevision(),this.format_,this.tileLoadFunction,s,this.tileUrlFunction,this.tileGrid,this.getTileGridForProjection(i),this.sourceTiles_,n,i,this.tileClass,this.handleTileChange.bind(this),a[0]);return this.tileCache.set(o,u),u},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),r=this.tileGrids_[e];if(!r){var n=this.tileGrid;r=this.tileGrids_[e]=Wt(t,void 0,n?n.getTileSize(n.getMinZoom()):void 0)}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,r){var n=It(this.getTileGridForProjection(r).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e}(function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.generateTileUrlFunction_=!e.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,this.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(this):kt,this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),e.tileUrlFunction&&this.setTileUrlFunction(e.tileUrlFunction,this.key_),this.tileLoadingKeys_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,n=Object(dt.c)(r),i=r.getState();i==ut?(this.tileLoadingKeys_[n]=!0,e=Kt):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=i==lt?$t:i==ct||i==pt?Jt:void 0),null!=e&&this.dispatchEvent(new Zt(e,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=this.urls=function(t){var e=[],r=/\{([a-z])-([a-z])\}/.exec(t);if(r){var n,i=r[1].charCodeAt(0),o=r[2].charCodeAt(0);for(n=i;n<=o;++n)e.push(t.replace(r[0],String.fromCharCode(n)));return e}if(r=r=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(r[2],10),s=parseInt(r[1],10);s<=a;s++)e.push(t.replace(r[0],s.toString()));return e}return e.push(t),e}(t);this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Lt(t,this.tileGrid),e):this.setKey(e)},e.prototype.useTile=function(t,e,r){var n=Pt(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(Xt)),ee=r(471),re=r.n(ee),ne=r(163),ie=r(135),oe=r(51),ae=r(183),se=r(262),ue=r(197),ce=r(263),le=r(114),he=r(133),pe=r(136),de=r(151),fe=r(264),ge=r(180),me=r(147),ye=r(146),ve=r(162),Ae=Object(ve.b)(),_e=function(t,e,r,n,i){this.extent_,this.id_=i,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=n};_e.prototype.get=function(t){return this.properties_[t]},_e.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===$.a.POINT?Object(J.k)(this.flatCoordinates_):Object(J.m)(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},_e.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=Object(J.s)(this.getExtent());this.flatInteriorPoints_=Object(ge.a)(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},_e.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=Object(fe.a)(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Object(ge.b)(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},_e.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Object(me.a)(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},_e.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,n=0,i=r.length;n>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(n)}}function Ce(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.pos>3}a--,1===o||2===o?(s+=t.readSVarint(),u+=t.readSVarint(),1===o&&c>l&&(n.push(c),l=c),r.push(s,u),c+=2):7===o?c>l&&(r.push(r[l],r[l+1]),c+=2):Object(Mt.a)(!1,59)}c>l&&(n.push(c),l=c)},e.prototype.createFeature_=function(t,e,r){var n,i=e.type;if(0===i)return null;var o=e.id,a=e.properties;a[this.layerName_]=e.layer.name;var s=[],u=[];this.readRawGeometry_(t,e,s,u);var c=function(t,e){var r;1===t?r=1===e?$.a.POINT:$.a.MULTI_POINT:2===t?r=1===e?$.a.LINE_STRING:$.a.MULTI_LINE_STRING:3===t&&(r=$.a.POLYGON);return r}(i,u.length);if(this.featureClass_===be)n=new this.featureClass_(c,s,u,a,o);else{var l;if(c==$.a.POLYGON){for(var h=[],p=0,d=0,f=0,g=u.length;f1?new ce.a(s,oe.a.XY,h):new he.a(s,oe.a.XY,u)}else l=c===$.a.POINT?new le.a(s,oe.a.XY):c===$.a.LINE_STRING?new ae.a(s,oe.a.XY):c===$.a.POLYGON?new he.a(s,oe.a.XY,u):c===$.a.MULTI_POINT?new ue.a(s,oe.a.XY):c===$.a.MULTI_LINE_STRING?new se.a(s,oe.a.XY,u):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var y=Object(ne.b)(l,!1,this.adaptOptions(r));n.setGeometry(y),n.setId(o),n.setProperties(a)}return n},e.prototype.getLastExtent=function(){return this.extent_},e.prototype.getType=function(){return ie.a.ARRAY_BUFFER},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=new re.a(t),i=n.readFields(xe,{}),o=[];for(var a in i)if(!r||-1!=r.indexOf(a)){for(var s=i[a],u=0,c=s.length;u=0;--n)e.remove(r[n])},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),n={feature:t,geometry:e,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n=0;--g)this.insertVertex_.apply(this,n[g])}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var r=this.dragSegments_[e][0],n=r.geometry;if(n.getType()===$.a.CIRCLE){var i=n.getCenter(),o=r.featureSegments[0],a=r.featureSegments[1];o.segment[0]=o.segment[1]=i,a.segment[0]=a.segment[1]=i,this.rBush_.update(Object(J.k)(i),o),this.rBush_.update(n.getExtent(),a)}else this.rBush_.update(Object(J.b)(r.segment),r)}return this.modified_&&(this.dispatchEvent(new Qe(Ve,this.features_,t)),this.modified_=!1),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map)},e.prototype.handlePointerAtPixel_=function(t,e){var r=e.getCoordinateFromPixel(t),n=Object(J.c)(Object(J.k)(r),e.getView().getResolution()*this.pixelTolerance_),i=this.rBush_.getInExtent(n);if(i.length>0){i.sort((function(t,e){return We(r,t)-We(r,e)}));var o=i[0],a=o.segment,s=Ye(r,o),u=e.getPixelFromCoordinate(s),c=Object(it.c)(t,u);if(c<=this.pixelTolerance_){var l={};if(o.geometry.getType()===$.a.CIRCLE&&1===o.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(s);else{var h=e.getPixelFromCoordinate(a[0]),p=e.getPixelFromCoordinate(a[1]),d=Object(it.g)(u,h),f=Object(it.g)(u,p);c=Math.sqrt(Math.min(d,f)),this.snappedToVertex_=c<=this.pixelTolerance_,this.snappedToVertex_&&(s=d>f?a[1]:a[0]),this.createOrUpdateVertexFeature_(s);for(var g=1,m=i.length;g=0;--i)c=(r=h[i])[0],l=Object(dt.c)(c.feature),c.depth&&(l+="-"+c.depth.join("-")),l in p||(p[l]={}),0===r[1]?(p[l].right=c,p[l].index=c.index):1==r[1]&&(p[l].left=c,p[l].index=c.index+1);for(l in p){switch(u=p[l].right,a=p[l].left,(s=(o=p[l].index)-1)<0&&(s=0),t=e=(n=(c=void 0!==a?a:u).geometry).getCoordinates(),d=!1,n.getType()){case $.a.MULTI_LINE_STRING:e[c.depth[0]].length>2&&(e[c.depth[0]].splice(o,1),d=!0);break;case $.a.LINE_STRING:e.length>2&&(e.splice(o,1),d=!0);break;case $.a.MULTI_POLYGON:t=t[c.depth[1]];case $.a.POLYGON:(t=t[c.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),d=!0,0===o&&(t.pop(),t.push(t[0]),s=t.length-1))}if(d){this.setGeometryCoordinates_(n,e);var f=[];if(void 0!==a&&(this.rBush_.remove(a),f.push(a.segment[0])),void 0!==u&&(this.rBush_.remove(u),f.push(u.segment[1])),void 0!==a&&void 0!==u){var g={depth:c.depth,feature:c.feature,geometry:c.geometry,index:s,segment:f};this.rBush_.insert(Object(J.b)(g.segment),g)}this.updateSegmentIndices_(n,o,c.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),h.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,r,n){this.rBush_.forEachInExtent(t.getExtent(),(function(i){i.geometry===t&&(void 0===r||void 0===i.depth||Object(Gt.b)(i.depth,r))&&i.index>e&&(i.index+=n)}))},e}(ze.b);function Ze(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ke(t){for(var e=1;e-1&&(s.aggsValue=JSON.parse(s.aggsValue)),i.push({aggsName:s.aggsName,aggsValue:s.aggsValue})),u.type="aggs",u.data=i);else 1!=s.aggsCount&&s.aggsName&&s.aggsValue?("string"==typeof s.aggsValue&&(s.aggsValue.indexOf("[")>-1?s.aggsValue=JSON.parse(s.aggsValue):s.aggsValue.indexOf(",")>-1&&(s.aggsValue=s.aggsValue.split(","))),i.push({aggsName:s.aggsName,aggsValue:s.aggsValue}),u.type="aggs",u.data=i):(u.type="details",u.clustered=!1,u.data=n.map((function(t){return t.properties})));e(t,u)}}else e(t)}))}},{key:"removeEvent",value:function(t){this.map&&m.b.off(this.map)(t,this.layerId)}},{key:"clearEvent",value:function(){m.b.clear(this.layerId)}},{key:"_addTimerDevice",value:function(t){this.dynamic&&(y.a.timerDevice=y.a.timerDevice||new K.a,this.timerDeviceId=v.a.createRandomId(16),(!this.timer||this.timer<15e3)&&(this.timer=15e3),y.a.timerDevice.add(this.timerDeviceId,this.timer,t))}},{key:"_removeTimerDevice",value:function(){this.timerDeviceId&&(y.a.timerDevice.remove(this.timerDeviceId),this.timerDeviceId=null)}},{key:"getChildLayerIds",value:function(){return m.a.getLayerIdsDepts(this.layerId)}},{key:"buildVectorSource",value:function(t){this.sources=new te({maxZoom:24,tileSize:256,format:new Ie({idProperty:this.vectorLayerName}),tileLoadFunction:function(t,e){t.setLoader((function(){var r="";if(y.a.config&&y.a.config.TOKEN){var n="".concat(y.a.config.TOKEN,"-").concat((new Date).getTime()).concat(Object(v.b)());r=btoa(n)}fetch(e,{headers:{Authorization:r}}).then((function(e){e.arrayBuffer().then((function(e){var r=t.getFormat();t.setProjection(r.readProjection(e));var n=r.readFeatures(e);t.setFeatures(n)}))}))}))},url:t})}},{key:"buildVectorLayer",value:function(){var t=this;this.layer=new De({declutter:!0,source:this.sources,style:function(e){return Z(e,t)}}),this.map.addLayer(this.layer),m.a.setIdDepts(this.layerId,this.layer.ol_uid),this.showText&&this.buildIconTextLayer()}},{key:"buildIconTextLayer",value:function(){var t=this;this.iconTextLayer=new De({declutter:!0,source:this.sources,style:function(e){return Z(e,t,"iconText")}}),this.map.addLayer(this.iconTextLayer)}},{key:"buildIconTextVectorLayer",value:function(){var t=this;this.iconTextLayer=new x.a({source:this.layerSource,style:function(e){return Z(e,t,"iconTextVector")}}),this.map.addLayer(this.iconTextLayer)}},{key:"setLayerEditable",value:function(t){if(this.opts&&!0===this.opts.dynamic)t.callback&&t.callback({status:20,error:"定时更新数据的动态图层无法进行编辑"});else{this.layerEditable=!0,t.callback&&t.callback({status:10,message:"图层".concat(t.layerId,"已进入编辑状态")});var e=this,r=new Xe({features:new Be.a(this.layerFeatures)});this.map.addInteraction(r),r.on("modifyend",(function(t,r){var n=t.target.dragSegments_[0][0].feature,i={type:"Feature",geometry:{type:"Point",coordinates:Object(C.g)(n.values_.geometry.flatCoordinates,"EPSG:".concat(y.a.config.EPSG),"EPSG:4326")},properties:n.values_},o=n.values_.id||n.values_.dataId;e.draggedFeatureList[o]=i}))}}}]),r}(g.a)},function(t,e,r){"use strict";function n(t){return Math.pow(t,3)}function i(t){return 1-n(1-t)}function o(t){return t}r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return i})),r.d(e,"c",(function(){return o}))},function(t,e,r){"use strict";var n=r(42),i=r(22);e.a=function(t,e,r){void 0===r&&(r={});var o=Object(n.b)(t),a=Object(n.b)(e),s=Object(i.degreesToRadians)(a[1]-o[1]),u=Object(i.degreesToRadians)(a[0]-o[0]),c=Object(i.degreesToRadians)(o[1]),l=Object(i.degreesToRadians)(a[1]),h=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(u/2),2)*Math.cos(c)*Math.cos(l);return Object(i.radiansToLength)(2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h)),r.units)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;e= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e137.8347,r=t[1]<.8293||t[1]>55.8271||!1;return e||r},transformlng:function(t,e){var r=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*n)+20*Math.sin(2*t*n))/3,r+=2*(20*Math.sin(t*n)+40*Math.sin(t/3*n))/3,r+=2*(150*Math.sin(t/12*n)+300*Math.sin(t/30*n))/3},transformlat:function(t,e){var r=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return r+=2*(20*Math.sin(6*t*n)+20*Math.sin(2*t*n))/3,r+=2*(20*Math.sin(e*n)+40*Math.sin(e/3*n))/3,r+=2*(160*Math.sin(e/12*n)+320*Math.sin(e*n/30))/3},wgs84togcj02:function(t){if(!(t[0]<-180||t[0]>180||t[1]<-90||t[1]>90)){var e=t[0],r=t[1],a=this.transformlat(e-105,r-35),s=this.transformlng(e-105,r-35),u=r/180*n,c=Math.sin(u);c=1-o*c*c;var l=Math.sqrt(c);return a=180*a/(i*(1-o)/(c*l)*n),[e+(s=180*s/(i/l*Math.cos(u)*n)),r+a]}console.error("坐标格式不符合规范")},gcj02towgs84:function(t){if(!(t[0]<-180||t[0]>180||t[1]<-90||t[1]>90)){var e=t[0],r=t[1],a=this.transformlat(e-105,r-35),s=this.transformlng(e-105,r-35),u=r/180*n,c=Math.sin(u);c=1-o*c*c;var l=Math.sqrt(c);return a=180*a/(i*(1-o)/(c*l)*n),[2*e-(e+(s=180*s/(i/l*Math.cos(u)*n))),2*r-(r+a)]}console.error("坐标格式不符合规范")}}},function(t,e,r){"use strict";r.d(e,"b",(function(){return u})),r.d(e,"a",(function(){return p}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(2),u=function(){function t(e,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};i()(this,t),this.lng=void 0,this.lat=void 0,this.timestamp=void 0,this.properties=void 0,this.lng=e,this.lat=r,this.timestamp=n,this.properties=o}return a()(t,[{key:"toArray",value:function(){return[this.lng,this.lat]}},{key:"toGeometry",value:function(){return{type:"Point",coordinates:this.toArray()}}},{key:"toFeature",value:function(){return{type:"Feature",geometry:this.toGeometry(),properties:this.properties}}},{key:"getLng",value:function(){return this.lng}},{key:"setLng",value:function(t){return this.lng=t,this}},{key:"getLat",value:function(){return this.lat}},{key:"setLat",value:function(t){return this.lat=t,this}},{key:"getTimestamp",value:function(){return this.timestamp}},{key:"setTimestamp",value:function(t){return this.timestamp=t,this}},{key:"getProperty",value:function(t){return this.properties[t]}},{key:"setProperty",value:function(t,e){return this.properties[t]=e,this}},{key:"getProperties",value:function(){return this.properties}},{key:"setProperties",value:function(t){return this.properties=t,this}},{key:"extend",value:function(t){return Object(s.extend)(this.properties,t),this}},{key:"clone",value:function(){return new t(this.lng,this.lat,this.timestamp,Object(s.extend)({},this.properties))}}]),t}(),c=function(){function t(e,r){i()(this,t),this.prev=void 0,this.next=void 0,this.distance=void 0,this.direction=void 0,this.duration=void 0,this.prev=e,this.next=r,this.distance=null,this.direction=null,this.duration=null}return a()(t,[{key:"toArray",value:function(){return[this.prev.toArray(),this.next.toArray()]}},{key:"toGeometry",value:function(){return{type:"LineString",coordinates:this.toArray()}}},{key:"toFeature",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{type:"Feature",geometry:this.toGeometry(),properties:Object(s.isTrue)(t)?this.prev.getProperties():this.next.getProperties()}}},{key:"getPrev",value:function(){return this.prev}},{key:"getNext",value:function(){return this.next}},{key:"getDuration",value:function(){return Object(s.isUndef)(this.duration)&&(this.duration=this.next.getTimestamp()-this.prev.getTimestamp()),this.duration}},{key:"getDirection",value:function(){return Object(s.isUndef)(this.direction)&&(this.direction=s.GeometryUtil.bearing(this.prev.toArray(),this.next.toArray())),this.direction}},{key:"getDistance",value:function(){return Object(s.isUndef)(this.distance)&&(this.distance=s.GeometryUtil.distance(this.prev.toArray(),this.next.toArray(),{units:"kilometers"})),this.distance}},{key:"extend",value:function(t){this.next.extend(t)}},{key:"breakUpNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t<=0)return this.prev;if(t>=this.getDuration())return this.next;var r=t/this.getDuration(),n=this.getDistance()*r,i=this.toFeature(),o=s.GeometryUtil.along(i,n,{units:"kilometers"}),a=o.geometry.coordinates;return new u(a[0],a[1],this.prev.getTimestamp()+t,Object(s.isTrue)(e)?this.next.getProperties():this.prev.getProperties())}}]),t}();function l(t){return"NODE INVALID: ".concat(t)}function h(t,e){return t.getTimestamp()>=e.getTimestamp()?(Object(s.warn)(l("TIMESTAMP IS SOONER THAN LAST NODE!")),!1):0===e.getLng()?(Object(s.warn)(l("LNG IS ZERO!")),!1):0===e.getLng()?(Object(s.warn)(l("LAT IS ZERO!")),!1):e.getLng()!==t.getLng()||e.getLat()!==t.getLat()||(Object(s.warn)(l("LNGLAT IS SAME!")),!1)}var p=function(){function t(e){i()(this,t),this.queue=void 0,this.infinited=void 0,this.prev=void 0,this.prevIsHead=void 0,this.pointer=void 0,this.hasChanged=void 0,this.queue=new s.Queue,this.infinited=!0===e,this.hasChanged=!0}return a()(t,[{key:"push",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Object(s.isUndef)(this.prev))return this.prev=t,void(this.prevIsHead=!0);if(!isNaN(t.getTimestamp())){var r=this.prevIsHead;if(Object(s.isTrue)(this.prevIsHead)&&h(this.prev,t)&&(e&&this.prev.setTimestamp(t.getTimestamp()-5e3),this.prevIsHead=!1),h(this.prev,t)){var n=Object(s.extend)({},this.prev.getProperties());t.setProperties(Object(s.extend)(n,t.getProperties()));var i=new c(this.prev,t);if(this.queue.enqueue(i),this.prev=t,!1===this.infinited&&this.queue.size()>500){var o=this.queue.dequeue();Object(s.isDef)(this.pointer)&&this.pointer.segment===o&&0!==this.queue.size()&&(this.pointer={segment:this.queue.peek(),passed:0,currentNode:this.queue.peek().getPrev()})}Object(s.isTrue)(r)&&(this.pointer={segment:i,passed:0,currentNode:this.prev})}}}},{key:"mergeProperties",value:function(t){Object(s.isDef)(this.prev)&&this.prev.extend(t)}},{key:"removeFirst",value:function(){this.queue.dequeue()}},{key:"size",value:function(){return this.queue.size()}},{key:"isEmpty",value:function(){return 0===this.size()}},{key:"forEach",value:function(t){var e=this,r=!0;this.queue.forEach((function(n,i,o){var a=e.pointer&&e.pointer.segment;a===n?(0===e.pointer.passed?t(n,!1):e.pointer.passed===e.pointer.segment.getDuration()?t(n,!0):(t(new c(a.getPrev(),e.pointer.currentNode),!0),t(new c(e.pointer.currentNode,a.getNext()),!1)),r=!1):Object(s.isFalse)(r)?t(n,!1):t(n,!0)}))}},{key:"getLastSegmentDuration",value:function(){return Object(s.isDef)(this.queue.last())?this.queue.last().getDuration():0}},{key:"getLastDuration",value:function(){if(Object(s.isUndef)(this.pointer))return 0;var t=this.queue.index(this.pointer.segment);if(t>-1){for(var e=0,r=t,n=this.queue.size();r500;)this.queue.dequeue()}},{key:"assignBefore",value:function(t){this.queue.assignBefore(t.queue),this.format()}},{key:"clone",value:function(){var e=new t;return e.queue=this.queue.clone(),e.prev=this.prev,e.prevIsHead=this.prevIsHead,e.pointer=this.pointer,e}}]),t}()},function(t,e,r){"use strict";r.d(e,"b",(function(){return A})),r.d(e,"a",(function(){return b}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(470),u=r.n(s),c=r(93),l=r.n(c),h=r(144),p=r.n(h),d=r(167),f=r.n(d),g=r(168),m=r.n(g),y=r(165),v=["click","dblclick","mousedown","mouseup","contextmenu"],A=["mouseenter","mouseover","mousemove","mouseout","mouseleave"],_=["dragstart","dragging","dragend"],b=function(){function t(){i()(this,t)}return a()(t,null,[{key:"on",value:function(e,r,n){if(-1!==m()(v,e))y.a.on(e,r,n,{capture:!0});else if(-1!==m()(A,e))t.registerDirectlyEvent(e,r,n);else{if(-1===m()(_,e))throw new Error("Do not support this event type ".concat(e," for overlay"));var i=document.querySelectorAll(r);f()(i,(function(r){t.registerDragEvent(r,e,n)}))}t.registeredEventTypes[r]=t.registeredEventTypes[r]||new Set,t.registeredEventTypes[r].add(e)}},{key:"clear",value:function(e){var r=t.registeredEventTypes[e]||new Set;0!==r.size&&r.forEach((function(r){return t.off(r,e)}))}},{key:"off",value:function(e,r){if(-1!==m()(v,e))y.a.off(e,r,{capture:!0});else if(-1!==m()(A,e))t.unRegisterDirectlyEvent(e,r);else{if(-1===m()(_,e))throw new Error('Overlay event system do not support "'.concat(e,'" event, \n please use one of these : [').concat(v.concat(A,_).toString(),"]"));var n=document.querySelectorAll(r);f()(n,(function(r){t.unRegisterDragEvent(r,e)}))}}},{key:"registerDirectlyEvent",value:function(e,r,n){var i=document.querySelectorAll(r);f()(i,(function(r){t._on(r,e,n)}))}},{key:"unRegisterDirectlyEvent",value:function(e,r){var n=document.querySelectorAll(r);f()(n,(function(r){t._off(r,e)}))}},{key:"registerDragEvent",value:function(e,r,n){var i=t.dragEventList.get(e)||{};i[r]=n,t.dragEventList.set(e,i)}},{key:"unRegisterDragEvent",value:function(e,r){var n=t.dragEventList.get(e);p()(n)||(delete n[r],l()(n)&&t.dragEventList.delete(e))}},{key:"fireDragEvent",value:function(e,r,n){var i=t.dragEventList.get(r);if(!p()(i)){var o=i[n];if(!p()(o)){var a=Object.assign({},e,{type:n});o.call(r,a)}}}},{key:"_on",value:function(e,r,n){var i=t.directlyEventList.get(e)||{};i[r]=i[r]||[],-1===m()(i[r],n)&&(i[r].push(n),e.addEventListener(r,n),t.directlyEventList.set(e,i))}},{key:"_off",value:function(e,r,n){var i=t.directlyEventList.get(e)||{};if(!l()(i)&&(i[r]=i[r]||[],0!==i[r].length)){if(p()(n)){var o=i[r];f()(o,(function(t){return e.removeEventListener(r,t)})),i[r]=[]}else e.removeEventListener(r,n),u()(i[r],(function(t){return t===n}));t.directlyEventList.set(e,i)}}}]),t}();b.directlyEventList=new WeakMap,b.dragEventList=new WeakMap,b.registeredEventTypes={}},function(t,e,r){var n=r(10),i=r(280),o=r(594),a=r(595);function s(e){var r="function"==typeof Map?new Map:void 0;return t.exports=s=function(t){if(null===t||!o(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return a(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},t.exports.default=t.exports,t.exports.__esModule=!0,s(e)}t.exports=s,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";function n(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=e;s=0?this.order.splice(r,0,e):this.order.push(t.layerId)}else this.order.push(t.layerId)}}},{key:"remove",value:function(t){if(this.layerObj[t]){delete this.layerObj[t];var e=this.order.indexOf(t);e>=0&&this.order.splice(e,1)}}},{key:"clear",value:function(){this.removeAllLayer(),this.layerObj={},this.order=[]}},{key:"removeAllLayer",value:function(){for(var t in this.layerObj)this.layerObj.hasOwnProperty(t)&&this.layerObj[t].removeLayer()}},{key:"get",value:function(t){return this.layerObj[t]}},{key:"getFirst",value:function(){var t=this.order[0];return t?this.layerObj[t]:null}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r(70),i=r(73),o=r(53),a=function(t){function e(e){var r=e||{};t.call(this,r),r.handleDownEvent&&(this.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(this.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(this.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(this.handleUpEvent=r.handleUpEvent),r.stopDown&&(this.stopDown=r.stopDown),this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.pointerEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==n.a.POINTERDRAG)this.handleDragEvent(t);else if(t.type==n.a.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==n.a.POINTERDOWN){var i=this.handleDownEvent(t);i&&t.preventDefault(),this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==n.a.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===n.a.POINTERDOWN||e===n.a.POINTERDRAG||e===n.a.POINTERUP}(t)){var e=t.pointerEvent,r=e.pointerId.toString();t.type==n.a.POINTERUP?delete this.trackedPointers_[r]:(t.type==n.a.POINTERDOWN||r in this.trackedPointers_)&&(this.trackedPointers_[r]=e),this.targetPointers=Object(o.c)(this.trackedPointers_)}},e}(i.a);function s(t){for(var e=t.length,r=0,n=0,i=0;io&&(c-s)*(o-u)-(i-s)*(l-u)>0&&a++:l<=o&&(c-s)*(o-u)-(i-s)*(l-u)<0&&a--,s=c,u=l}return 0!==a}function a(t,e,r,n,i,a){if(0===r.length)return!1;if(!o(t,e,r[0],n,i,a))return!1;for(var s=1,u=r.length;se.x?1:this.ye.y?1:0},C.prototype.clone=function(){},C.prototype.copy=function(){return new C(this)},C.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},C.prototype.distance3D=function(t){var e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return Math.sqrt(e*e+r*r+n*n)},C.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},C.prototype.hashCode=function(){var t=17;return 37*(t=37*t+C.hashCode(this.x))+C.hashCode(this.y)},C.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},C.prototype.interfaces_=function(){return[b,x,e]},C.prototype.getClass=function(){return C},C.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=A.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},E.DimensionalComparator.get=function(){return I},E.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},E.NULL_ORDINATE.get=function(){return A.NaN},E.X.get=function(){return 0},E.Y.get=function(){return 1},E.Z.get=function(){return 2},Object.defineProperties(C,E);var I=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new v("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};I.prototype.compare=function(t,e){var r=t,n=e,i=I.compare(r.x,n.x);if(0!==i)return i;var o=I.compare(r.y,n.y);return 0!==o?o:this._dimensionsToTest<=2?0:I.compare(r.z,n.z)},I.prototype.interfaces_=function(){return[w]},I.prototype.getClass=function(){return I},I.compare=function(t,e){return te?1:A.isNaN(t)?A.isNaN(e)?0:-1:A.isNaN(e)?1:0};var M=function(){};M.prototype.create=function(){},M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M};var S=function(){},T={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S},S.toLocationSymbol=function(t){switch(t){case S.EXTERIOR:return"e";case S.BOUNDARY:return"b";case S.INTERIOR:return"i";case S.NONE:return"-"}throw new v("Unknown location value: "+t)},T.INTERIOR.get=function(){return 0},T.BOUNDARY.get=function(){return 1},T.EXTERIOR.get=function(){return 2},T.NONE.get=function(){return-1},Object.defineProperties(S,T);var P=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},O=function(){},L={LOG_10:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.log10=function(t){var e=Math.log(t);return A.isInfinite(e)||A.isNaN(e)?e:e/O.LOG_10},O.min=function(t,e,r,n){var i=t;return er?r:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var n=arguments[0],i=arguments[1],o=arguments[2];return no?o:n}},O.wrap=function(t,e){return t<0?e- -t%e:t%e},O.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],r=arguments[2],n=t;return e>n&&(n=e),r>n&&(n=r),n}if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3],u=i;return o>u&&(u=o),a>u&&(u=a),s>u&&(u=s),u}},O.average=function(t,e){return(t+e)/2},L.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(O,L);var k=function(t){this.str=t};k.prototype.append=function(t){this.str+=t},k.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},k.prototype.toString=function(t){return this.str};var R=function(t){this.value=t};R.prototype.intValue=function(){return this.value},R.prototype.compareTo=function(t){return this.valuet?1:0},R.isNaN=function(t){return Number.isNaN(t)};var D=function(){};D.isWhitespace=function(t){return t<=32&&t>=0||127===t},D.toUpperCase=function(t){return t.toUpperCase()};var B=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var r=arguments[0];this.init(r)}else if("string"==typeof arguments[0]){var n=arguments[0];t.call(this,t.parse(n))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}},N={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};B.prototype.le=function(t){return(this._hi9?(l=!0,h="9"):h="0"+c,a.append(h),r=r.subtract(B.valueOf(c)).multiply(B.TEN),l&&r.selfAdd(B.TEN);var p=!0,d=B.magnitude(r._hi);if(d<0&&Math.abs(d)>=s-u&&(p=!1),!p)break}return e[0]=n,a.toString()},B.prototype.sqr=function(){return this.multiply(this)},B.prototype.doubleValue=function(){return this._hi+this._lo},B.prototype.subtract=function(){if(arguments[0]instanceof B){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},B.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},B.prototype.isZero=function(){return 0===this._hi&&0===this._lo},B.prototype.selfSubtract=function(){if(arguments[0]instanceof B){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},B.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},B.prototype.min=function(t){return this.le(t)?this:t},B.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof B){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1],i=null,o=null,a=null,s=null,u=null,c=null,l=null,h=null;return u=this._hi/r,h=(i=(c=B.SPLIT*u)-(i=c-u))*(a=(h=B.SPLIT*r)-(a=h-r))-(l=u*r)+i*(s=r-a)+(o=u-i)*a+o*s,h=u+(c=(this._hi-l-h+this._lo-u*n)/r),this._hi=h,this._lo=u-h+c,this}},B.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},B.prototype.divide=function(){if(arguments[0]instanceof B){var t=arguments[0],e=null,r=null,n=null,i=null,o=null,a=null,s=null,u=null;return r=(o=this._hi/t._hi)-(e=(a=B.SPLIT*o)-(e=a-o)),u=e*(n=(u=B.SPLIT*t._hi)-(n=u-t._hi))-(s=o*t._hi)+e*(i=t._hi-n)+r*n+r*i,a=(this._hi-s-u+this._lo-o*t._lo)/t._hi,new B(u=o+a,o-u+a)}if("number"==typeof arguments[0]){var c=arguments[0];return A.isNaN(c)?B.createNaN():B.copy(this).selfDivide(c,0)}},B.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},B.prototype.pow=function(t){if(0===t)return B.valueOf(1);var e=new B(this),r=B.valueOf(1),n=Math.abs(t);if(n>1)for(;n>0;)n%2==1&&r.selfMultiply(e),(n/=2)>0&&(e=e.sqr());else r=e;return t<0?r.reciprocal():r},B.prototype.ceil=function(){if(this.isNaN())return B.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new B(t,e)},B.prototype.compareTo=function(t){var e=t;return this._hie._hi?1:this._loe._lo?1:0},B.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},B.prototype.setValue=function(){if(arguments[0]instanceof B){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},B.prototype.max=function(t){return this.ge(t)?this:t},B.prototype.sqrt=function(){if(this.isZero())return B.valueOf(0);if(this.isNegative())return B.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,r=B.valueOf(e),n=this.subtract(r.sqr())._hi*(.5*t);return r.add(n)},B.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof B){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],r=null,n=null,i=null,o=null,a=null,s=null;return o=(i=this._hi+e)-(a=i-this._hi),n=(s=(o=e-a+(this._hi-o))+this._lo)+(i-(r=i+s)),this._hi=r+n,this._lo=n+(r-this._hi),this}}else if(2===arguments.length){var u=arguments[0],c=arguments[1],l=null,h=null,p=null,d=null,f=null,g=null,m=null;d=this._hi+u,h=this._lo+c,f=d-(g=d-this._hi),p=h-(m=h-this._lo);var y=(l=d+(g=(f=u-g+(this._hi-f))+h))+(g=(p=c-m+(this._lo-p))+(g+(d-l))),v=g+(l-y);return this._hi=y,this._lo=v,this}},B.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof B){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1],i=null,o=null,a=null,s=null,u=null,c=null;i=(u=B.SPLIT*this._hi)-this._hi,c=B.SPLIT*r,i=u-i,o=this._hi-i,a=c-r;var l=(u=this._hi*r)+(c=i*(a=c-a)-u+i*(s=r-a)+o*a+o*s+(this._hi*n+this._lo*r)),h=c+(i=u-l);return this._hi=l,this._lo=h,this}},B.prototype.selfSqr=function(){return this.selfMultiply(this)},B.prototype.floor=function(){if(this.isNaN())return B.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new B(t,e)},B.prototype.negate=function(){return this.isNaN()?this:new B(-this._hi,-this._lo)},B.prototype.clone=function(){},B.prototype.multiply=function(){if(arguments[0]instanceof B){var t=arguments[0];return t.isNaN()?B.createNaN():B.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return A.isNaN(e)?B.createNaN():B.copy(this).selfMultiply(e,0)}},B.prototype.isNaN=function(){return A.isNaN(this._hi)},B.prototype.intValue=function(){return Math.trunc(this._hi)},B.prototype.toString=function(){var t=B.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},B.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!0,e),n=e[0]+1,i=r;if("."===r.charAt(0))i="0"+r;else if(n<0)i="0."+B.stringOfChar("0",-n)+r;else if(-1===r.indexOf(".")){var o=n-r.length;i=r+B.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},B.prototype.reciprocal=function(){var t,e,r,n,i=null,o=null,a=null,s=null;t=(r=1/this._hi)-(i=(a=B.SPLIT*r)-(i=a-r)),o=(s=B.SPLIT*this._hi)-this._hi;var u=r+(a=(1-(n=r*this._hi)-(s=i*(o=s-o)-n+i*(e=this._hi-o)+t*o+t*e)-r*this._lo)/this._hi);return new B(u,r-u+a)},B.prototype.toSciNotation=function(){if(this.isZero())return B.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),r=this.extractSignificantDigits(!1,e),n=B.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===r.charAt(0))throw new Error("Found leading zero: "+r);var i="";r.length>1&&(i=r.substring(1));var o=r.charAt(0)+"."+i;return this.isNegative()?"-"+o+n:o+n},B.prototype.abs=function(){return this.isNaN()?B.NaN:this.isNegative()?this.negate():new B(this)},B.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},B.prototype.lt=function(t){return(this._hit._hi||this._hi===t._hi)&&this._lo>t._lo},B.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},B.prototype.trunc=function(){return this.isNaN()?B.NaN:this.isPositive()?this.floor():this.ceil()},B.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},B.prototype.interfaces_=function(){return[e,b,x]},B.prototype.getClass=function(){return B},B.sqr=function(t){return B.valueOf(t).selfMultiply(t)},B.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return B.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new B(e)}},B.sqrt=function(t){return B.valueOf(t).sqrt()},B.parse=function(t){for(var e=0,r=t.length;D.isWhitespace(t.charAt(e));)e++;var n=!1;if(e=r);){var c=t.charAt(e);if(e++,D.isDigit(c)){var l=c-"0";o.selfMultiply(B.TEN),o.selfAdd(l),a++}else{if("."!==c){if("e"===c||"E"===c){var h=t.substring(e);try{u=R.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}s=a}}var p=o,d=a-s-u;if(0===d)p=o;else if(d>0){var f=B.TEN.pow(d);p=o.divide(f)}else if(d<0){var g=B.TEN.pow(-d);p=o.multiply(g)}return n?p.negate():p},B.createNaN=function(){return new B(A.NaN,A.NaN)},B.copy=function(t){return new B(t)},B.magnitude=function(t){var e=Math.abs(t),r=Math.log(e)/Math.log(10),n=Math.trunc(Math.floor(r));return 10*Math.pow(10,n)<=e&&(n+=1),n},B.stringOfChar=function(t,e){for(var r=new k,n=0;n0){if(o<=0)return F.signum(a);n=i+o}else{if(!(i<0))return F.signum(a);if(o>=0)return F.signum(a);n=-i-o}var s=F.DP_SAFE_EPSILON*n;return a>=s||-a>=s?F.signum(a):2},F.signum=function(t){return t>0?1:t<0?-1:0},j.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(F,j);var z=function(){},U={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};U.X.get=function(){return 0},U.Y.get=function(){return 1},U.Z.get=function(){return 2},U.M.get=function(){return 3},z.prototype.setOrdinate=function(t,e,r){},z.prototype.size=function(){},z.prototype.getOrdinate=function(t,e){},z.prototype.getCoordinate=function(){},z.prototype.getCoordinateCopy=function(t){},z.prototype.getDimension=function(){},z.prototype.getX=function(t){},z.prototype.clone=function(){},z.prototype.expandEnvelope=function(t){},z.prototype.copy=function(){},z.prototype.getY=function(t){},z.prototype.toCoordinateArray=function(){},z.prototype.interfaces_=function(){return[x]},z.prototype.getClass=function(){return z},Object.defineProperties(z,U);var G=function(){},H=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(G),V=function(){};V.arraycopy=function(t,e,r,n,i){for(var o=0,a=e;at._minx?this._minx:t._minx,r=this._miny>t._miny?this._miny:t._miny,n=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return!this.isNull()&&r>=this._minx&&r<=this._maxx&&n>=this._miny&&n<=this._maxy}},q.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof q){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||rthis._maxy||nthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.isNull()?(this._minx=r,this._maxx=r,this._miny=n,this._maxy=n):(rthis._maxx&&(this._maxx=r),nthis._maxy&&(this._maxy=n))}},q.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},q.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},q.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},q.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},q.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},q.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},q.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=r,this._maxy+=r,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},q.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof q){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof C){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return this.covers(r,n)}},q.prototype.centre=function(){return this.isNull()?null:new C((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},q.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof q){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.init(r.x,n.x,r.y,n.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];it._maxx&&(e=this._minx-t._maxx);var r=0;return this._maxyt._maxy&&(r=this._miny-t._maxy),0===e?r:0===r?e:Math.sqrt(e*e+r*r)},q.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+C.hashCode(this._minx))+C.hashCode(this._maxx))+C.hashCode(this._miny))+C.hashCode(this._maxy)},q.prototype.interfaces_=function(){return[b,e]},q.prototype.getClass=function(){return q},q.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],r=arguments[2];return r.x>=(t.xe.x?t.x:e.x)&&r.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),u=Math.max(o.x,a.x),c=Math.min(n.x,i.x),l=Math.max(n.x,i.x);return!(c>u||lu||lthis.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},rt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},rt.prototype.setPrecisionModel=function(t){this._precisionModel=t},rt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;ei?n:i;else{var a=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);0!==(o=n>i?a:s)||t.equals(e)||(o=Math.max(a,s))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},rt.nonRobustComputeEdgeDistance=function(t,e,r){var n=t.x-e.x,i=t.y-e.y,o=Math.sqrt(n*n+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},nt.DONT_INTERSECT.get=function(){return 0},nt.DO_INTERSECT.get=function(){return 1},nt.COLLINEAR.get=function(){return 2},nt.NO_INTERSECTION.get=function(){return 0},nt.POINT_INTERSECTION.get=function(){return 1},nt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(rt,nt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new q(this._inputLines[0][0],this._inputLines[0][1]),r=new q(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&r.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],r=arguments[1],n=arguments[2];if(this._isProper=!1,q.intersects(r,n,e)&&0===st.orientationIndex(r,n,e)&&0===st.orientationIndex(n,r,e))return this._isProper=!0,(e.equals(r)||e.equals(n))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,r,n,i){i.x=this.smallestInAbsValue(t.x,e.x,r.x,n.x),i.y=this.smallestInAbsValue(t.y,e.y,r.y,n.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,r.x-=i.x,r.y-=i.y,n.x-=i.x,n.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,r,n,i){var o=null;try{o=Q.intersection(t,r,n,i)}catch(a){if(!(a instanceof H))throw a;o=e.nearestEndpoint(t,r,n,i)}return o},e.prototype.intersection=function(t,r,n,i){var o=this.intersectionWithNormalization(t,r,n,i);return this.isInSegmentEnvelopes(o)||(o=new C(e.nearestEndpoint(t,r,n,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,r,n){var i=t,o=Math.abs(i);return Math.abs(e)1e-4&&V.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,r,n){var i=new C(t),o=new C(e),a=new C(r),s=new C(n),u=new C;this.normalizeToEnvCentre(i,o,a,s,u);var c=this.safeHCoordinateIntersection(i,o,a,s);return c.x+=u.x,c.y+=u.y,c},e.prototype.computeCollinearIntersection=function(e,r,n,i){var o=q.intersects(e,r,n),a=q.intersects(e,r,i),s=q.intersects(n,i,e),u=q.intersects(n,i,r);return o&&a?(this._intPt[0]=n,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):s&&u?(this._intPt[0]=e,this._intPt[1]=r,t.COLLINEAR_INTERSECTION):o&&s?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||a||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=n,this._intPt[1]=r,!n.equals(r)||a||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&s?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):a&&u?(this._intPt[0]=i,this._intPt[1]=r,!i.equals(r)||o||s?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,r,n,i){var o=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,c=r.xn.x?r.x:n.x,p=r.y>n.y?r.y:n.y,d=((o>c?o:c)+(sl?a:l)+(u0&&a>0||o<0&&a<0)return t.NO_INTERSECTION;var s=st.orientationIndex(n,i,e),u=st.orientationIndex(n,i,r);return s>0&&u>0||s<0&&u<0?t.NO_INTERSECTION:0===o&&0===a&&0===s&&0===u?this.computeCollinearIntersection(e,r,n,i):(0===o||0===a||0===s||0===u?(this._isProper=!1,e.equals2D(n)||e.equals2D(i)?this._intPt[0]=e:r.equals2D(n)||r.equals2D(i)?this._intPt[0]=r:0===o?this._intPt[0]=new C(n):0===a?this._intPt[0]=new C(i):0===s?this._intPt[0]=new C(e):0===u&&(this._intPt[0]=new C(r))):(this._isProper=!0,this._intPt[0]=this.intersection(e,r,n,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,r,n){var i=t,o=st.distancePointLine(t,r,n),a=st.distancePointLine(e,r,n);return a0?r>0?-i:i:r>0?i:-i;if(0===e||0===r)return n>0?t>0?i:-i:t>0?-i:i;if(e>0?n>0?e<=n||(i=-i,o=t,t=r,r=o,o=e,e=n,n=o):e<=-n?(i=-i,r=-r,n=-n):(o=t,t=-r,r=o,o=e,e=-n,n=o):n>0?-e<=n?(i=-i,t=-t,e=-e):(o=-t,t=r,r=o,o=-e,e=n,n=o):e>=n?(t=-t,e=-e,r=-r,n=-n):(i=-i,o=-t,t=-r,r=o,o=-e,e=-n,n=o),t>0){if(!(r>0))return i;if(!(t<=r))return i}else{if(r>0)return-i;if(!(t>=r))return-i;i=-i,t=-t,r=-r}for(;;){if((n-=(a=Math.floor(r/t))*e)<0)return-i;if(n>e)return i;if(t>(r-=a*t)+r){if(en+n)return-i;r=t-r,n=e-n,i=-i}if(0===n)return 0===r?0:-i;if(0===r)return i;if((e-=(a=Math.floor(t/r))*n)<0)return i;if(e>n)return-i;if(r>(t-=a*r)+t){if(ne+e)return i;t=r-t,e=n-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var at=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};at.prototype.countSegment=function(t,e){if(t.xn&&(r=e.x,n=t.x),this._p.x>=r&&this._p.x<=n&&(this._isPointOnSegment=!0),null}if(t.y>this._p.y&&e.y<=this._p.y||e.y>this._p.y&&t.y<=this._p.y){var i=t.x-this._p.x,o=t.y-this._p.y,a=e.x-this._p.x,s=e.y-this._p.y,u=ot.signOfDet2x2(i,o,a,s);if(0===u)return this._isPointOnSegment=!0,null;s0&&this._crossingCount++}},at.prototype.isPointInPolygon=function(){return this.getLocation()!==S.EXTERIOR},at.prototype.getLocation=function(){return this._isPointOnSegment?S.BOUNDARY:this._crossingCount%2==1?S.INTERIOR:S.EXTERIOR},at.prototype.isOnSegment=function(){return this._isPointOnSegment},at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.locatePointInRing=function(){if(arguments[0]instanceof C&&P(arguments[1],z)){for(var t=arguments[0],e=arguments[1],r=new at(t),n=new C,i=new C,o=1;o1||s<0||s>1)&&(i=!0)}}else i=!0;return i?O.min(st.distancePointLine(t,r,n),st.distancePointLine(e,r,n),st.distancePointLine(r,t,e),st.distancePointLine(n,t,e)):0},st.isPointInRing=function(t,e){return st.locatePointInRing(t,e)!==S.EXTERIOR},st.computeLength=function(t){var e=t.size();if(e<=1)return 0;var r=0,n=new C;t.getCoordinate(0,n);for(var i=n.x,o=n.y,a=1;ar.y&&(r=o,n=i)}var a=n;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(r)&&a!==n);var s=n;do{s=(s+1)%e}while(t[s].equals2D(r)&&s!==n);var u=t[a],c=t[s];if(u.equals2D(r)||c.equals2D(r)||u.equals2D(c))return!1;var l=st.computeOrientation(u,r,c);return 0===l?u.x>c.x:l>0},st.locatePointInRing=function(t,e){return at.locatePointInRing(t,e)},st.distancePointLinePerpendicular=function(t,e,r){var n=(r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y),i=((e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y))/n;return Math.abs(i)*Math.sqrt(n)},st.computeOrientation=function(t,e,r){return st.orientationIndex(t,e,r)},st.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new v("Line array must contain at least one vertex");for(var r=t.distance(e[0]),n=0;n=1)return o.distance(s);var l=((a.y-o.y)*(s.x-a.x)-(a.x-o.x)*(s.y-a.y))/u;return Math.abs(l)*Math.sqrt(u)}},st.isOnLine=function(t,e){for(var r=new it,n=1;n0},yt.prototype.interfaces_=function(){return[ft]},yt.prototype.getClass=function(){return yt};var vt=function(){};vt.prototype.isInBoundary=function(t){return t>1},vt.prototype.interfaces_=function(){return[ft]},vt.prototype.getClass=function(){return vt};var At=function(){};At.prototype.isInBoundary=function(t){return 1===t},At.prototype.interfaces_=function(){return[ft]},At.prototype.getClass=function(){return At};var _t=function(){};_t.prototype.add=function(){},_t.prototype.addAll=function(){},_t.prototype.isEmpty=function(){},_t.prototype.iterator=function(){},_t.prototype.size=function(){},_t.prototype.toArray=function(){},_t.prototype.remove=function(){},(r.prototype=new Error).name="IndexOutOfBoundsException";var bt=function(){};bt.prototype.hasNext=function(){},bt.prototype.next=function(){},bt.prototype.remove=function(){};var xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(_t);(n.prototype=new Error).name="NoSuchElementException";var wt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof _t&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,_t]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var r=this.array_[t];return this.array_[t]=e,r},e.prototype.iterator=function(){return new Ct(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new r;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,r=this.array_.length;e=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var s=arguments[0],u=arguments[1];if(arguments[2])for(var c=0;c=0;l--)this.add(s[l],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof C){var h=arguments[0],p=arguments[1];if(!arguments[2]){var d=this.size();if(d>0){if(h>0&&this.get(h-1).equals2D(p))return null;if(hy&&(v=-1);for(var A=m;A!==y;A+=v)this.add(f[A],g);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new C(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,r),e}(wt),It=function(){},Mt={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Mt.ForwardComparator.get=function(){return St},Mt.BidirectionalComparator.get=function(){return Tt},Mt.coordArrayType.get=function(){return new Array(0).fill(null)},It.prototype.interfaces_=function(){return[]},It.prototype.getClass=function(){return It},It.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},It.ptNotInList=function(t,e){for(var r=0;r=t?e:[]},It.indexOf=function(t,e){for(var r=0;r0)&&(e=t[r]);return e},It.extract=function(t,e,r){e=O.clamp(e,0,t.length);var n=(r=O.clamp(r,-1,t.length))-e+1;r<0&&(n=0),e>=t.length&&(n=0),rn.length)return 1;if(0===r.length)return 0;var i=It.compare(r,n);return It.isEqualReversed(r,n)?0:i},Tt.prototype.OLDcompare=function(t,e){var r=t,n=e;if(r.lengthn.length)return 1;if(0===r.length)return 0;for(var i=It.increasingDirection(r),o=It.increasingDirection(n),a=i>0?0:r.length-1,s=o>0?0:r.length-1,u=0;u0))return e.value;e=e.right}}return null},h.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:Rt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var r,n,i=this.root_;do{if(r=i,(n=t.compareTo(i.key))<0)i=i.left;else{if(!(n>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var a={key:t,left:null,right:null,value:e,parent:r,color:Rt,getValue:function(){return this.value},getKey:function(){return this.key}};return n<0?r.left=a:r.right=a,this.fixAfterInsertion(a),this.size_++,null},h.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(s(t)===c(s(s(t)))){var e=l(s(s(t)));1===a(e)?(u(s(t),Rt),u(e,Rt),u(s(s(t)),1),t=s(s(t))):(t===l(s(t))&&(t=s(t),this.rotateLeft(t)),u(s(t),Rt),u(s(s(t)),1),this.rotateRight(s(s(t))))}else{var r=c(s(s(t)));1===a(r)?(u(s(t),Rt),u(r,Rt),u(s(s(t)),1),t=s(s(t))):(t===c(s(t))&&(t=s(t),this.rotateRight(t)),u(s(t),Rt),u(s(s(t)),1),this.rotateLeft(s(s(t))))}this.root_.color=Rt},h.prototype.values=function(){var t=new wt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=h.successor(e));)t.add(e.value);return t},h.prototype.entrySet=function(){var t=new Lt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=h.successor(e));)t.add(e);return t},h.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},h.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},h.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},h.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var r=t.parent,n=t;null!==r&&n===r.right;)n=r,r=r.parent;return r},h.prototype.size=function(){return this.size_};var Dt=function(){};Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},p.prototype=new o,(d.prototype=new p).contains=function(t){for(var e=0,r=this.array_.length;e=0;){var a=i.substring(0,o);n.add(a),o=(i=i.substring(o+r)).indexOf(e)}i.length>0&&n.add(i);for(var s=new Array(n.size()).fill(null),u=0;u0)for(var o=i;o0&&n.append(" ");for(var o=0;o0&&n.append(","),n.append(qt.toString(t.getOrdinate(i,o)))}return n.append(")"),n.toString()}},Yt.ensureValidRing=function(t,e){var r=e.size();return 0===r?e:r<=3?Yt.createClosedRing(t,e,4):e.getOrdinate(0,z.X)===e.getOrdinate(r-1,z.X)&&e.getOrdinate(0,z.Y)===e.getOrdinate(r-1,z.Y)?e:Yt.createClosedRing(t,e,r+1)},Yt.createClosedRing=function(t,e,r){var n=t.create(r,e.getDimension()),i=e.size();Yt.copy(e,0,n,0,i);for(var o=i;o0&&Yt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Ft.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return st.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Yt.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,r=0;e= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},r.MINIMUM_VALID_SIZE.get=function(){return 4},r.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,r),e}(Xt),re=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return lt.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],r=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,r)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),r=0;r0?e.createPoint(r[0]):e.createPoint():t},ae.prototype.interfaces_=function(){return[ne.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var se=function(){};se.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Xt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Kt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},se.prototype.interfaces_=function(){return[ne.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ue=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e0){var t=new k(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e3&&(n=3),n<2?new ue(r):new ue(r,n)}},le.prototype.interfaces_=function(){return[M,e]},le.prototype.getClass=function(){return le},le.instance=function(){return le.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new le},Object.defineProperties(le,he);var pe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new wt,e=this.map_.values(),r=e.next();!r.done;)t.add(r.value),r=e.next();return t},e.prototype.entrySet=function(){var t=new Lt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Pt),de=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ge){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var r=arguments[0];this._modelType=t.FIXED,this.setScale(r)}else if(arguments[0]instanceof t){var n=arguments[0];this._modelType=n._modelType,this._scale=n._scale}},fe={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};de.prototype.equals=function(t){if(!(t instanceof de))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},de.prototype.compareTo=function(t){var e=t,r=this.getMaximumSignificantDigits(),n=e.getMaximumSignificantDigits();return new R(r).compareTo(new R(n))},de.prototype.getScale=function(){return this._scale},de.prototype.isFloating=function(){return this._modelType===de.FLOATING||this._modelType===de.FLOATING_SINGLE},de.prototype.getType=function(){return this._modelType},de.prototype.toString=function(){var t="UNKNOWN";return this._modelType===de.FLOATING?t="Floating":this._modelType===de.FLOATING_SINGLE?t="Floating-Single":this._modelType===de.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},de.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return A.isNaN(t)||this._modelType===de.FLOATING_SINGLE?t:this._modelType===de.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof C){var e=arguments[0];if(this._modelType===de.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},de.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===de.FLOATING?t=16:this._modelType===de.FLOATING_SINGLE?t=6:this._modelType===de.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},de.prototype.setScale=function(t){this._scale=Math.abs(t)},de.prototype.interfaces_=function(){return[e,b]},de.prototype.getClass=function(){return de},de.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},fe.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},fe.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(de,fe);var ge=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},me={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};ge.prototype.readResolve=function(){return ge.nameToTypeMap.get(this._name)},ge.prototype.toString=function(){return this._name},ge.prototype.interfaces_=function(){return[e]},ge.prototype.getClass=function(){return ge},me.serialVersionUID.get=function(){return-552860263173159e4},me.nameToTypeMap.get=function(){return new pe},Object.defineProperties(ge,me),de.Type=ge,de.FIXED=new ge("FIXED"),de.FLOATING=new ge("FLOATING"),de.FLOATING_SINGLE=new ge("FLOATING SINGLE");var ye=function t(){this._precisionModel=new de,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?P(arguments[0],M)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof de&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},ve={serialVersionUID:{configurable:!0}};ye.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new C(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new C(t.getMinX(),t.getMinY()),new C(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new C(t.getMinX(),t.getMinY()),new C(t.getMinX(),t.getMaxY()),new C(t.getMaxX(),t.getMaxY()),new C(t.getMaxX(),t.getMinY()),new C(t.getMinX(),t.getMinY())]),null)},ye.prototype.createLineString=function(t){return t?t instanceof Array?new Xt(this.getCoordinateSequenceFactory().create(t),this):P(t,z)?new Xt(t,this):void 0:new Xt(this.getCoordinateSequenceFactory().create([]),this)},ye.prototype.createMultiLineString=function(){if(0===arguments.length)return new Ht(null,this);if(1===arguments.length){var t=arguments[0];return new Ht(t,this)}},ye.prototype.buildGeometry=function(t){for(var e=null,r=!1,n=!1,i=t.iterator();i.hasNext();){var o=i.next(),a=o.getClass();null===e&&(e=a),a!==e&&(r=!0),o.isGeometryCollectionOrDerived()&&(n=!0)}if(null===e)return this.createGeometryCollection();if(r||n)return this.createGeometryCollection(ye.toGeometryArray(t));var s=t.iterator().next();if(t.size()>1){if(s instanceof $t)return this.createMultiPolygon(ye.toPolygonArray(t));if(s instanceof Xt)return this.createMultiLineString(ye.toLineStringArray(t));if(s instanceof Kt)return this.createMultiPoint(ye.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},ye.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},ye.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof C){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(P(arguments[0],z)){var e=arguments[0];return new Kt(e,this)}}},ye.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},ye.prototype.createPolygon=function(){if(0===arguments.length)return new $t(null,null,this);if(1===arguments.length){if(P(arguments[0],z)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var r=arguments[0];return this.createPolygon(r,null)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return new $t(n,i,this)}},ye.prototype.getSRID=function(){return this._SRID},ye.prototype.createGeometryCollection=function(){if(0===arguments.length)return new Gt(null,this);if(1===arguments.length){var t=arguments[0];return new Gt(t,this)}},ye.prototype.createGeometry=function(t){return new ne(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},ye.prototype.getPrecisionModel=function(){return this._precisionModel},ye.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(P(arguments[0],z)){var e=arguments[0];return new ee(e,this)}}},ye.prototype.createMultiPolygon=function(){if(0===arguments.length)return new re(null,this);if(1===arguments.length){var t=arguments[0];return new re(t,this)}},ye.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new te(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(P(arguments[0],z)){var r=arguments[0];if(null===r)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(r.size()).fill(null),i=0;i=this.size())throw new Error;return this.array_[t]},m.prototype.push=function(t){return this.array_.push(t),t},m.prototype.pop=function(t){if(0===this.array_.length)throw new g;return this.array_.pop()},m.prototype.peek=function(){if(0===this.array_.length)throw new g;return this.array_[this.array_.length-1]},m.prototype.empty=function(){return 0===this.array_.length},m.prototype.isEmpty=function(){return this.empty()},m.prototype.search=function(t){return this.array_.indexOf(t)},m.prototype.size=function(){return this.array_.length},m.prototype.toArray=function(){for(var t=[],e=0,r=this.array_.length;e0&&this._minIndexthis._minCoord.y&&r.y>this._minCoord.y&&n===st.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Me.prototype.getRightmostSideOfSegment=function(t,e){var r=t.getEdge().getCoordinates();if(e<0||e+1>=r.length)return-1;if(r[e].y===r[e+1].y)return-1;var n=Ee.LEFT;return r[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=r,this._minCoord=e[r])},Me.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Me.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var r=e.next();r.isForward()&&this.checkForRightmostCoordinate(r)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ee.LEFT&&(this._orientedDe=this._minDe.getSym())},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me};var Se=function(t){function e(r,n){t.call(this,e.msgWithCoord(r,n)),this.pt=n?new C(n):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}($),Te=function(){this.array_=[]};Te.prototype.addLast=function(t){this.array_.push(t)},Te.prototype.removeFirst=function(){return this.array_.shift()},Te.prototype.isEmpty=function(){return 0===this.array_.length};var Pe=function(){this._finder=null,this._dirEdgeList=new wt,this._nodes=new wt,this._rightMostCoord=null,this._env=null,this._finder=new Me};Pe.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Pe.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Pe.prototype.computeNodeDepth=function(t){for(var e=null,r=t.getEdges().iterator();r.hasNext();){var n=r.next();if(n.isVisited()||n.getSym().isVisited()){e=n;break}}if(null===e)throw new Se("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Pe.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ee.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Pe.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Pe.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ee.RIGHT)>=1&&e.getDepth(Ee.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Pe.prototype.computeDepths=function(t){var e=new Lt,r=new Te,n=t.getNode();for(r.addLast(n),e.add(n),t.setVisited(!0);!r.isEmpty();){var i=r.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();e.contains(s)||(r.addLast(s),e.add(s))}}}},Pe.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},Pe.prototype.getEnvelope=function(){if(null===this._env){for(var t=new q,e=this._dirEdgeList.iterator();e.hasNext();)for(var r=e.next().getEdge().getCoordinates(),n=0;nthis.location.length){var e=new Array(3).fill(null);e[Ee.ON]=this.location[Ee.ON],e[Ee.LEFT]=S.NONE,e[Ee.RIGHT]=S.NONE,this.location=e}for(var r=0;r1&&t.append(S.toLocationSymbol(this.location[Ee.LEFT])),t.append(S.toLocationSymbol(this.location[Ee.ON])),this.location.length>1&&t.append(S.toLocationSymbol(this.location[Ee.RIGHT])),t.toString()},Oe.prototype.setLocations=function(t,e,r){this.location[Ee.ON]=t,this.location[Ee.LEFT]=e,this.location[Ee.RIGHT]=r},Oe.prototype.get=function(t){return t1},Oe.prototype.isAnyNull=function(){for(var t=0;tthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},ke.prototype.addPoints=function(t,e,r){var n=t.getCoordinates();if(e){var i=1;r&&(i=0);for(var o=i;o=0;s--)this._pts.add(n[s])}},ke.prototype.isHole=function(){return this._isHole},ke.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},ke.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!st.isPointInRing(t,e.getCoordinates()))return!1;for(var r=this._holes.iterator();r.hasNext();)if(r.next().containsPoint(t))return!1;return!0},ke.prototype.addHole=function(t){this._holes.add(t)},ke.prototype.isShell=function(){return null===this._shell},ke.prototype.getLabel=function(){return this._label},ke.prototype.getEdges=function(){return this._edges},ke.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},ke.prototype.getShell=function(){return this._shell},ke.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=e.getLocation(r,Ee.RIGHT);if(n===S.NONE)return null;if(this._label.getLocation(r)===S.NONE)return this._label.setLocation(r,n),null}},ke.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},ke.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),r=0;r=2,"found partial label"),this.computeIM(t)},Be.prototype.isInResult=function(){return this._isInResult},Be.prototype.isVisited=function(){return this._isVisited},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be};var Ne=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],r=arguments[1];this._coord=e,this._edges=r,this._label=new Le(0,S.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var r=S.NONE;if(r=this._label.getLocation(e),!t.isNull(e)){var n=t.getLocation(e);r!==S.BOUNDARY&&(r=n)}return r},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],r=arguments[1];null===this._label?this._label=new Le(e,r):this._label.setLocation(e,r)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Le)for(var r=arguments[0],n=0;n<2;n++){var i=this.computeMergedLocation(r,n);this._label.getLocation(n)===S.NONE&&this._label.setLocation(n,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=S.NONE;null!==this._label&&(e=this._label.getLocation(t));var r=null;switch(e){case S.BOUNDARY:r=S.INTERIOR;break;case S.INTERIOR:default:r=S.BOUNDARY}this._label.setLocation(t,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Be),Fe=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Fe.prototype.find=function(t){return this.nodeMap.get(t)},Fe.prototype.addNode=function(){if(arguments[0]instanceof C){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Ne){var r=arguments[0],n=this.nodeMap.get(r.getCoordinate());return null===n?(this.nodeMap.put(r.getCoordinate(),r),r):(n.mergeLabel(r),n)}},Fe.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Fe.prototype.iterator=function(){return this.nodeMap.values().iterator()},Fe.prototype.values=function(){return this.nodeMap.values()},Fe.prototype.getBoundaryNodes=function(t){for(var e=new wt,r=this.iterator();r.hasNext();){var n=r.next();n.getLabel().getLocation(t)===S.BOUNDARY&&e.add(n)}return e},Fe.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var je=function(){},ze={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je},je.isNorthern=function(t){return t===je.NE||t===je.NW},je.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},je.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var r=te?t:e)?3:r},je.isInHalfPlane=function(t,e){return e===je.SE?t===je.SE||t===je.SW:t===e||t===e+1},je.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new v("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?je.NE:je.SE:e>=0?je.NW:je.SW}if(arguments[0]instanceof C&&arguments[1]instanceof C){var r=arguments[0],n=arguments[1];if(n.x===r.x&&n.y===r.y)throw new v("Cannot compute the quadrant for two identical points "+r);return n.x>=r.x?n.y>=r.y?je.NE:je.SE:n.y>=r.y?je.NW:je.SW}},ze.NE.get=function(){return 0},ze.NW.get=function(){return 1},ze.SW.get=function(){return 2},ze.SE.get=function(){return 3},Object.defineProperties(je,ze);var Ue=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2];this._edge=e,this.init(r,n),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this._edge=i,this.init(o,a),this._label=s}};Ue.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),e.add(s)):r.addAll(a)}else n.add(o)}return n},Qe.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Qe.prototype.buildMaximalEdgeRings=function(t){for(var e=new wt,r=t.iterator();r.hasNext();){var n=r.next();if(n.isInResult()&&n.getLabel().isArea()&&null===n.getEdgeRing()){var i=new De(n,this._geometryFactory);e.add(i),i.setInResult()}}return e},Qe.prototype.placePolygonHoles=function(t,e){for(var r=e.iterator();r.hasNext();){var n=r.next();n.isHole()&&n.setShell(t)}},Qe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Qe.prototype.findEdgeRingContaining=function(t,e){for(var r=t.getLinearRing(),n=r.getEnvelopeInternal(),i=r.getCoordinateN(0),o=null,a=null,s=e.iterator();s.hasNext();){var u=s.next(),c=u.getLinearRing(),l=c.getEnvelopeInternal();null!==o&&(a=o.getLinearRing().getEnvelopeInternal());var h=!1;l.contains(n)&&st.isPointInRing(i,c.getCoordinates())&&(h=!0),h&&(null===o||a.contains(l))&&(o=u)}return o},Qe.prototype.findShell=function(t){for(var e=0,r=null,n=t.iterator();n.hasNext();){var i=n.next();i.isHole()||(r=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),r},Qe.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],r=arguments[1];Ve.linkResultDirectedEdges(r);var n=this.buildMaximalEdgeRings(e),i=new wt,o=this.buildMinimalEdgeRings(n,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Qe.prototype.interfaces_=function(){return[]},Qe.prototype.getClass=function(){return Qe};var qe=function(){};qe.prototype.getBounds=function(){},qe.prototype.interfaces_=function(){return[]},qe.prototype.getClass=function(){return qe};var We=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};We.prototype.getItem=function(){return this._item},We.prototype.getBounds=function(){return this._bounds},We.prototype.interfaces_=function(){return[qe,e]},We.prototype.getClass=function(){return We};var Ye=function(){this._size=null,this._items=null,this._size=0,this._items=new wt,this._items.add(null)};Ye.prototype.poll=function(){if(this.isEmpty())return null;var t=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),t},Ye.prototype.size=function(){return this._size},Ye.prototype.reorder=function(t){for(var e=null,r=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(r)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,r)},Ye.prototype.clear=function(){this._size=0,this._items.clear()},Ye.prototype.isEmpty=function(){return 0===this._size},Ye.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye};var Xe=function(){};Xe.prototype.visitItem=function(t){},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var Ze=function(){};Ze.prototype.insert=function(t,e){},Ze.prototype.remove=function(t,e){},Ze.prototype.query=function(){},Ze.prototype.interfaces_=function(){return[]},Ze.prototype.getClass=function(){return Ze};var Ke=function(){if(this._childBoundables=new wt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},Je={serialVersionUID:{configurable:!0}};Ke.prototype.getLevel=function(){return this._level},Ke.prototype.size=function(){return this._childBoundables.size()},Ke.prototype.getChildBoundables=function(){return this._childBoundables},Ke.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ke.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ke.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ke.prototype.interfaces_=function(){return[qe,e]},Ke.prototype.getClass=function(){return Ke},Je.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ke,Je);var $e=function(){};$e.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},$e.min=function(t){return $e.sort(t),t.get(0)},$e.sort=function(t,e){var r=t.toArray();e?Nt.sort(r,e):Nt.sort(r);for(var n=t.iterator(),i=0,o=r.length;itr.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(r)return this.expand(this._boundable1,this._boundable2,t,e),null;if(n)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new v("neither boundable is composite")},tr.prototype.isLeaves=function(){return!(tr.isComposite(this._boundable1)||tr.isComposite(this._boundable2))},tr.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},tr.prototype.expand=function(t,e,r,n){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),a=new tr(o,e,this._itemDistance);a.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=r}},rr={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};er.prototype.getNodeCapacity=function(){return this._nodeCapacity},er.prototype.lastNode=function(t){return t.get(t.size()-1)},er.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var r=e.next();r instanceof Ke?t+=this.size(r):r instanceof We&&(t+=1)}return t}},er.prototype.removeItem=function(t,e){for(var r=null,n=t.getChildBoundables().iterator();n.hasNext();){var i=n.next();i instanceof We&&i.getItem()===e&&(r=i)}return null!==r&&(t.getChildBoundables().remove(r),!0)},er.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new wt:t}if(1===arguments.length){for(var e=arguments[0],r=new wt,n=e.getChildBoundables().iterator();n.hasNext();){var i=n.next();if(i instanceof Ke){var o=this.itemsTree(i);null!==o&&r.add(o)}else i instanceof We?r.add(i.getItem()):et.shouldNeverReachHere()}return r.size()<=0?null:r}},er.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new We(t,e))},er.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new wt;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2];if(et.isTrue(r>-2),n.getLevel()===r)return i.add(n),null;for(var o=n.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof Ke?this.boundablesAtLevel(r,a,i):(et.isTrue(a instanceof We),-1===r&&i.add(a))}return null}},er.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new wt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var r=arguments[0],n=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,n)}else if(3===arguments.length)if(P(arguments[2],Xe)&&arguments[0]instanceof Object&&arguments[1]instanceof Ke)for(var i=arguments[0],o=arguments[1],a=arguments[2],s=o.getChildBoundables(),u=0;ut&&(t=n)}}return t+1}},er.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=new wt;r.add(this.createNode(e));var n=new wt(t);$e.sort(n,this.getComparator());for(var i=n.iterator();i.hasNext();){var o=i.next();this.lastNode(r).getChildBoundables().size()===this.getNodeCapacity()&&r.add(this.createNode(e)),this.lastNode(r).addChildBoundable(o)}return r},er.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},er.prototype.interfaces_=function(){return[e]},er.prototype.getClass=function(){return er},er.compareDoubles=function(t,e){return t>e?1:t0);for(var r=new wt,n=0;n0;){var h=l.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,c=h):h.expandToQueue(l,u)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var d=arguments[0],f=arguments[1],g=arguments[2],m=new We(d,f),y=new tr(this.getRoot(),m,g);return this.nearestNeighbour(y)[0]}},r.prototype.interfaces_=function(){return[Ze,e]},r.prototype.getClass=function(){return r},r.centreX=function(t){return r.avg(t.getMinX(),t.getMaxX())},r.avg=function(t,e){return(t+e)/2},r.centreY=function(t){return r.avg(t.getMinY(),t.getMaxY())},n.STRtreeNode.get=function(){return ar},n.serialVersionUID.get=function(){return 0x39920f7d5f261e0},n.xComparator.get=function(){return{interfaces_:function(){return[w]},compare:function(e,n){return t.compareDoubles(r.centreX(e.getBounds()),r.centreX(n.getBounds()))}}},n.yComparator.get=function(){return{interfaces_:function(){return[w]},compare:function(e,n){return t.compareDoubles(r.centreY(e.getBounds()),r.centreY(n.getBounds()))}}},n.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},n.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(r,n),r}(er),ar=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var r=e.next();null===t?t=new q(r.getBounds()):t.expandToInclude(r.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ke),sr=function(){};sr.prototype.interfaces_=function(){return[]},sr.prototype.getClass=function(){return sr},sr.relativeSign=function(t,e){return te?1:0},sr.compare=function(t,e,r){if(e.equals2D(r))return 0;var n=sr.relativeSign(e.x,r.x),i=sr.relativeSign(e.y,r.y);switch(t){case 0:return sr.compareValue(n,i);case 1:return sr.compareValue(i,n);case 2:return sr.compareValue(i,-n);case 3:return sr.compareValue(-n,i);case 4:return sr.compareValue(-n,-i);case 5:return sr.compareValue(-i,-n);case 6:return sr.compareValue(-i,n);case 7:return sr.compareValue(n,-i)}return et.shouldNeverReachHere("invalid octant value"),0},sr.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var ur=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];this._segString=t,this.coord=new C(e),this.segmentIndex=r,this._segmentOctant=n,this._isInterior=!e.equals2D(t.getCoordinate(r))};ur.prototype.getCoordinate=function(){return this.coord},ur.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ur.prototype.compareTo=function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:sr.compare(this._segmentOctant,this.coord,e.coord)},ur.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ur.prototype.isInterior=function(){return this._isInterior},ur.prototype.interfaces_=function(){return[b]},ur.prototype.getClass=function(){return ur};var cr=function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t};cr.prototype.getSplitCoordinates=function(){var t=new Et;this.addEndpoints();for(var e=this.iterator(),r=e.next();e.hasNext();){var n=e.next();this.addEdgeCoordinates(r,n,t),r=n}return t.toCoordinateArray()},cr.prototype.addCollapsedNodes=function(){var t=new wt;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var r=e.next().intValue();this.add(this._edge.getCoordinate(r),r)}},cr.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cr.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e=0?e>=0?r>=n?0:1:r>=n?7:6:e>=0?r>=n?3:2:r>=n?4:5}if(arguments[0]instanceof C&&arguments[1]instanceof C){var i=arguments[0],o=arguments[1],a=o.x-i.x,s=o.y-i.y;if(0===a&&0===s)throw new v("Cannot compute the octant for two identical points "+i);return lr.octant(a,s)}};var hr=function(){};hr.prototype.getCoordinates=function(){},hr.prototype.size=function(){},hr.prototype.getCoordinate=function(t){},hr.prototype.isClosed=function(){},hr.prototype.setData=function(t){},hr.prototype.getData=function(){},hr.prototype.interfaces_=function(){return[]},hr.prototype.getClass=function(){return hr};var pr=function(){};pr.prototype.addIntersection=function(t,e){},pr.prototype.interfaces_=function(){return[hr]},pr.prototype.getClass=function(){return pr};var dr=function(){this._nodeList=new cr(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};dr.prototype.getCoordinates=function(){return this._pts},dr.prototype.size=function(){return this._pts.length},dr.prototype.getCoordinate=function(t){return this._pts[t]},dr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},dr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},dr.prototype.setData=function(t){this._data=t},dr.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:lr.octant(t,e)},dr.prototype.getData=function(){return this._data},dr.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[3],o=new C(r.getIntersection(i));this.addIntersection(o,n)}},dr.prototype.toString=function(){return J.toLineString(new ue(this._pts))},dr.prototype.getNodeList=function(){return this._nodeList},dr.prototype.addIntersectionNode=function(t,e){var r=e,n=r+1;if(n=0&&r>=0||e<=0&&r<=0?Math.max(e,r):0}if(arguments[0]instanceof C){var n=arguments[0];return st.orientationIndex(this.p0,this.p1,n)}},fr.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},fr.prototype.isVertical=function(){return this.p0.x===this.p1.x},fr.prototype.equals=function(t){if(!(t instanceof fr))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},fr.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},fr.prototype.project=function(){if(arguments[0]instanceof C){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new C(t);var e=this.projectionFactor(t),r=new C;return r.x=this.p0.x+e*(this.p1.x-this.p0.x),r.y=this.p0.y+e*(this.p1.y-this.p0.y),r}if(arguments[0]instanceof fr){var n=arguments[0],i=this.projectionFactor(n.p0),o=this.projectionFactor(n.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var a=this.project(n.p0);i<0&&(a=this.p0),i>1&&(a=this.p1);var s=this.project(n.p1);return o<0&&(s=this.p0),o>1&&(s=this.p1),new fr(a,s)}},fr.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},fr.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},fr.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},fr.prototype.distancePerpendicular=function(t){return st.distancePointLinePerpendicular(t,this.p0,this.p1)},fr.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},fr.prototype.midPoint=function(){return fr.midPoint(this.p0,this.p1)},fr.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,r=this.p1.y-this.p0.y,n=e*e+r*r;return n<=0?A.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*r)/n},fr.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var r=new Array(2).fill(null),n=A.MAX_VALUE,i=null,o=this.closestPoint(t.p0);n=o.distance(t.p0),r[0]=o,r[1]=t.p0;var a=this.closestPoint(t.p1);(i=a.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||A.isNaN(e))&&(e=1),e},fr.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},fr.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},fr.prototype.distance=function(){if(arguments[0]instanceof fr){var t=arguments[0];return st.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof C){var e=arguments[0];return st.distancePointLine(e,this.p0,this.p1)}},fr.prototype.pointAlong=function(t){var e=new C;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},fr.prototype.hashCode=function(){var t=A.doubleToLongBits(this.p0.x);t^=31*A.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),r=A.doubleToLongBits(this.p1.x);return r^=31*A.doubleToLongBits(this.p1.y),e^Math.trunc(r)^Math.trunc(r>>32)},fr.prototype.interfaces_=function(){return[b,e]},fr.prototype.getClass=function(){return fr},fr.midPoint=function(t,e){return new C((t.x+e.x)/2,(t.y+e.y)/2)},gr.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(fr,gr);var mr=function(){this.tempEnv1=new q,this.tempEnv2=new q,this._overlapSeg1=new fr,this._overlapSeg2=new fr};mr.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];t.getLineSegment(e,this._overlapSeg1),r.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr};var yr=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],r=arguments[2],n=arguments[3];this._pts=t,this._start=e,this._end=r,this._context=n};yr.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},yr.prototype.computeSelect=function(t,e,r,n){var i=this._pts[e],o=this._pts[r];if(n.tempEnv1.init(i,o),r-e==1)return n.select(this,e),null;if(!t.intersects(n.tempEnv1))return null;var a=Math.trunc((e+r)/2);e=t.length-1)return t.length-1;for(var n=je.quadrant(t[r],t[r+1]),i=e+1;ir.getId()&&(r.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},r.SegmentOverlapAction.get=function(){return xr},Object.defineProperties(e,r),e}(_r),xr=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[0],r=arguments[1],n=arguments[2],i=arguments[3],o=e.getContext(),a=n.getContext();this._si.processIntersections(o,r,a,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(mr),wr=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.setQuadrantSegments(r),this.setEndCapStyle(n)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}},Cr={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};wr.prototype.getEndCapStyle=function(){return this._endCapStyle},wr.prototype.isSingleSided=function(){return this._isSingleSided},wr.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=wr.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=wr.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==wr.JOIN_ROUND&&(this._quadrantSegments=wr.DEFAULT_QUADRANT_SEGMENTS)},wr.prototype.getJoinStyle=function(){return this._joinStyle},wr.prototype.setJoinStyle=function(t){this._joinStyle=t},wr.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},wr.prototype.getSimplifyFactor=function(){return this._simplifyFactor},wr.prototype.getQuadrantSegments=function(){return this._quadrantSegments},wr.prototype.setEndCapStyle=function(t){this._endCapStyle=t},wr.prototype.getMitreLimit=function(){return this._mitreLimit},wr.prototype.setMitreLimit=function(t){this._mitreLimit=t},wr.prototype.setSingleSided=function(t){this._isSingleSided=t},wr.prototype.interfaces_=function(){return[]},wr.prototype.getClass=function(){return wr},wr.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Cr.CAP_ROUND.get=function(){return 1},Cr.CAP_FLAT.get=function(){return 2},Cr.CAP_SQUARE.get=function(){return 3},Cr.JOIN_ROUND.get=function(){return 1},Cr.JOIN_MITRE.get=function(){return 2},Cr.JOIN_BEVEL.get=function(){return 3},Cr.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Cr.DEFAULT_MITRE_LIMIT.get=function(){return 5},Cr.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(wr,Cr);var Er=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=st.COUNTERCLOCKWISE,this._inputLine=t||null},Ir={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Er.prototype.isDeletable=function(t,e,r,n){var i=this._inputLine[t],o=this._inputLine[e],a=this._inputLine[r];return!!this.isConcave(i,o,a)&&!!this.isShallow(i,o,a,n)&&this.isShallowSampled(i,o,t,r,n)},Er.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),r=this.findNextNonDeletedIndex(e),n=!1;r=0;n--)this.addPt(t[n])},Mr.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)Math.PI;)t-=Tr.PI_TIMES_2;for(;t<=-Math.PI;)t+=Tr.PI_TIMES_2;return t},Tr.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],r=arguments[1],n=r.x-e.x,i=r.y-e.y;return Math.atan2(i,n)}},Tr.isAcute=function(t,e,r){var n=t.x-e.x,i=t.y-e.y;return n*(r.x-e.x)+i*(r.y-e.y)>0},Tr.isObtuse=function(t,e,r){var n=t.x-e.x,i=t.y-e.y;return n*(r.x-e.x)+i*(r.y-e.y)<0},Tr.interiorAngle=function(t,e,r){var n=Tr.angle(e,t),i=Tr.angle(e,r);return Math.abs(i-n)},Tr.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Tr.PI_TIMES_2;t>=Tr.PI_TIMES_2&&(t=0)}else{for(;t>=Tr.PI_TIMES_2;)t-=Tr.PI_TIMES_2;t<0&&(t=0)}return t},Tr.angleBetween=function(t,e,r){var n=Tr.angle(e,t),i=Tr.angle(e,r);return Tr.diff(n,i)},Tr.diff=function(t,e){var r=null;return(r=tMath.PI&&(r=2*Math.PI-r),r},Tr.toRadians=function(t){return t*Math.PI/180},Tr.getTurn=function(t,e){var r=Math.sin(e-t);return r>0?Tr.COUNTERCLOCKWISE:r<0?Tr.CLOCKWISE:Tr.NONE},Tr.angleBetweenOriented=function(t,e,r){var n=Tr.angle(e,t),i=Tr.angle(e,r)-n;return i<=-Math.PI?i+Tr.PI_TIMES_2:i>Math.PI?i-Tr.PI_TIMES_2:i},Pr.PI_TIMES_2.get=function(){return 2*Math.PI},Pr.PI_OVER_2.get=function(){return Math.PI/2},Pr.PI_OVER_4.get=function(){return Math.PI/4},Pr.COUNTERCLOCKWISE.get=function(){return st.COUNTERCLOCKWISE},Pr.CLOCKWISE.get=function(){return st.CLOCKWISE},Pr.NONE.get=function(){return st.COLLINEAR},Object.defineProperties(Tr,Pr);var Or=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new fr,this._seg1=new fr,this._offset0=new fr,this._offset1=new fr,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],r=arguments[1],n=arguments[2];this._precisionModel=e,this._bufParams=r,this._li=new it,this._filletAngleQuantum=Math.PI/2/r.getQuadrantSegments(),r.getQuadrantSegments()>=8&&r.getJoinStyle()===wr.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)},Lr={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};Or.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var r=st.computeOrientation(this._s0,this._s1,this._s2),n=r===st.CLOCKWISE&&this._side===Ee.LEFT||r===st.COUNTERCLOCKWISE&&this._side===Ee.RIGHT;0===r?this.addCollinear(e):n?this.addOutsideTurn(r,e):this.addInsideTurn(r,e)},Or.prototype.addLineEndCap=function(t,e){var r=new fr(t,e),n=new fr;this.computeOffsetSegment(r,Ee.LEFT,this._distance,n);var i=new fr;this.computeOffsetSegment(r,Ee.RIGHT,this._distance,i);var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case wr.CAP_ROUND:this._segList.addPt(n.p1),this.addFilletArc(e,s+Math.PI/2,s-Math.PI/2,st.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case wr.CAP_FLAT:this._segList.addPt(n.p1),this._segList.addPt(i.p1);break;case wr.CAP_SQUARE:var u=new C;u.x=Math.abs(this._distance)*Math.cos(s),u.y=Math.abs(this._distance)*Math.sin(s);var c=new C(n.p1.x+u.x,n.p1.y+u.y),l=new C(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(l)}},Or.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Or.prototype.addMitreJoin=function(t,e,r,n){var i=!0,o=null;try{o=Q.intersection(e.p0,e.p1,r.p0,r.p1),(n<=0?1:o.distance(t)/Math.abs(n))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof H))throw t;o=new C(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,r,n,this._bufParams.getMitreLimit())},Or.prototype.addFilletCorner=function(t,e,r,n,i){var o=e.x-t.x,a=e.y-t.y,s=Math.atan2(a,o),u=r.x-t.x,c=r.y-t.y,l=Math.atan2(c,u);n===st.CLOCKWISE?s<=l&&(s+=2*Math.PI):s>=l&&(s-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,s,l,n,i),this._segList.addPt(r)},Or.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)0){var r=new C((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r);var n=new C((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},Or.prototype.createCircle=function(t){var e=new C(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Or.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Or.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Mr,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Or.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Or.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===wr.JOIN_BEVEL||this._bufParams.getJoinStyle()===wr.JOIN_MITRE?(t&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,st.CLOCKWISE,this._distance))},Or.prototype.closeRing=function(){this._segList.closeRing()},Or.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Lr.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Lr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Lr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Lr.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Or,Lr);var kr=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};kr.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var r=e<0,n=Math.abs(e),i=this.getSegGen(n);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,r,i);var o=i.getCoordinates();return r&&It.reverse(o),o},kr.prototype.computeSingleSidedBufferCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);if(e){r.addSegments(t,!0);var i=Er.simplify(t,-n),o=i.length-1;r.initSideSegments(i[o],i[o-1],Ee.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(i[a],!0)}else{r.addSegments(t,!1);var s=Er.simplify(t,n),u=s.length-1;r.initSideSegments(s[0],s[1],Ee.LEFT),r.addFirstSegment();for(var c=2;c<=u;c++)r.addNextSegment(s[c],!0)}r.addLastSegment(),r.closeRing()},kr.prototype.computeRingBufferCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);e===Ee.RIGHT&&(n=-n);var i=Er.simplify(t,n),o=i.length-1;r.initSideSegments(i[o-1],i[0],e);for(var a=1;a<=o;a++){var s=1!==a;r.addNextSegment(i[a],s)}r.closeRing()},kr.prototype.computeLineBufferCurve=function(t,e){var r=this.simplifyTolerance(this._distance),n=Er.simplify(t,r),i=n.length-1;e.initSideSegments(n[0],n[1],Ee.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(n[o],!0);e.addLastSegment(),e.addLineEndCap(n[i-1],n[i]);var a=Er.simplify(t,-r),s=a.length-1;e.initSideSegments(a[s],a[s-1],Ee.LEFT);for(var u=s-2;u>=0;u--)e.addNextSegment(a[u],!0);e.addLastSegment(),e.addLineEndCap(a[1],a[0]),e.closeRing()},kr.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case wr.CAP_ROUND:e.createCircle(t);break;case wr.CAP_SQUARE:e.createSquare(t)}},kr.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var r=Math.abs(e),n=this.getSegGen(r);if(t.length<=1)this.computePointCurve(t[0],n);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,n)}else this.computeLineBufferCurve(t,n);return n.getCoordinates()},kr.prototype.getBufferParameters=function(){return this._bufParams},kr.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},kr.prototype.getRingCurve=function(t,e,r){if(this._distance=r,t.length<=2)return this.getLineCurve(t,r);if(0===r)return kr.copyCoordinates(t);var n=this.getSegGen(r);return this.computeRingBufferCurve(t,e,n),n.getCoordinates()},kr.prototype.computeOffsetCurve=function(t,e,r){var n=this.simplifyTolerance(this._distance);if(e){var i=Er.simplify(t,-n),o=i.length-1;r.initSideSegments(i[o],i[o-1],Ee.LEFT),r.addFirstSegment();for(var a=o-2;a>=0;a--)r.addNextSegment(i[a],!0)}else{var s=Er.simplify(t,n),u=s.length-1;r.initSideSegments(s[0],s[1],Ee.LEFT),r.addFirstSegment();for(var c=2;c<=u;c++)r.addNextSegment(s[c],!0)}r.addLastSegment()},kr.prototype.getSegGen=function(t){return new Or(this._precisionModel,this._bufParams,t)},kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},kr.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),r=0;ri.getMaxY()||this.findStabbedSegments(t,n.getDirectedEdges(),e)}return e}if(3===arguments.length)if(P(arguments[2],xt)&&arguments[0]instanceof C&&arguments[1]instanceof Ge){for(var o=arguments[0],a=arguments[1],s=arguments[2],u=a.getEdge().getCoordinates(),c=0;cthis._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||st.computeOrientation(this._seg.p0,this._seg.p1,o)===st.RIGHT)){var l=a.getDepth(Ee.LEFT);this._seg.p0.equals(u[c])||(l=a.getDepth(Ee.RIGHT));var h=new Br(this._seg,l);s.add(h)}}else if(P(arguments[2],xt)&&arguments[0]instanceof C&&P(arguments[1],xt))for(var p=arguments[0],d=arguments[1],f=arguments[2],g=d.iterator();g.hasNext();){var m=g.next();m.isForward()&&this.findStabbedSegments(p,m,f)}},Rr.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:$e.min(e)._leftDepth},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Dr.DepthSegment.get=function(){return Br},Object.defineProperties(Rr,Dr);var Br=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new fr(t),this._leftDepth=e};Br.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var r=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==r||0!=(r=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?r:this._upwardSeg.compareTo(e._upwardSeg)},Br.prototype.compareX=function(t,e){var r=t.p0.compareTo(e.p0);return 0!==r?r:t.p1.compareTo(e.p1)},Br.prototype.toString=function(){return this._upwardSeg.toString()},Br.prototype.interfaces_=function(){return[b]},Br.prototype.getClass=function(){return Br};var Nr=function(t,e,r){this.p0=t||null,this.p1=e||null,this.p2=r||null};Nr.prototype.area=function(){return Nr.area(this.p0,this.p1,this.p2)},Nr.prototype.signedArea=function(){return Nr.signedArea(this.p0,this.p1,this.p2)},Nr.prototype.interpolateZ=function(t){if(null===t)throw new v("Supplied point is null.");return Nr.interpolateZ(t,this.p0,this.p1,this.p2)},Nr.prototype.longestSideLength=function(){return Nr.longestSideLength(this.p0,this.p1,this.p2)},Nr.prototype.isAcute=function(){return Nr.isAcute(this.p0,this.p1,this.p2)},Nr.prototype.circumcentre=function(){return Nr.circumcentre(this.p0,this.p1,this.p2)},Nr.prototype.area3D=function(){return Nr.area3D(this.p0,this.p1,this.p2)},Nr.prototype.centroid=function(){return Nr.centroid(this.p0,this.p1,this.p2)},Nr.prototype.inCentre=function(){return Nr.inCentre(this.p0,this.p1,this.p2)},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},Nr.area=function(t,e,r){return Math.abs(((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2)},Nr.signedArea=function(t,e,r){return((r.x-t.x)*(e.y-t.y)-(e.x-t.x)*(r.y-t.y))/2},Nr.det=function(t,e,r,n){return t*n-e*r},Nr.interpolateZ=function(t,e,r,n){var i=e.x,o=e.y,a=r.x-i,s=n.x-i,u=r.y-o,c=n.y-o,l=a*c-s*u,h=t.x-i,p=t.y-o,d=(c*h-s*p)/l,f=(-u*h+a*p)/l;return e.z+d*(r.z-e.z)+f*(n.z-e.z)},Nr.longestSideLength=function(t,e,r){var n=t.distance(e),i=e.distance(r),o=r.distance(t),a=n;return i>a&&(a=i),o>a&&(a=o),a},Nr.isAcute=function(t,e,r){return!!Tr.isAcute(t,e,r)&&!!Tr.isAcute(e,r,t)&&!!Tr.isAcute(r,t,e)},Nr.circumcentre=function(t,e,r){var n=r.x,i=r.y,o=t.x-n,a=t.y-i,s=e.x-n,u=e.y-i,c=2*Nr.det(o,a,s,u),l=Nr.det(a,o*o+a*a,u,s*s+u*u),h=Nr.det(o,o*o+a*a,s,s*s+u*u);return new C(n-l/c,i+h/c)},Nr.perpendicularBisector=function(t,e){var r=e.x-t.x,n=e.y-t.y,i=new Q(t.x+r/2,t.y+n/2,1),o=new Q(t.x-n+r/2,t.y+r+n/2,1);return new Q(i,o)},Nr.angleBisector=function(t,e,r){var n=e.distance(t),i=n/(n+e.distance(r)),o=r.x-t.x,a=r.y-t.y;return new C(t.x+i*o,t.y+i*a)},Nr.area3D=function(t,e,r){var n=e.x-t.x,i=e.y-t.y,o=e.z-t.z,a=r.x-t.x,s=r.y-t.y,u=r.z-t.z,c=i*u-o*s,l=o*a-n*u,h=n*s-i*a,p=c*c+l*l+h*h;return Math.sqrt(p)/2},Nr.centroid=function(t,e,r){var n=(t.x+e.x+r.x)/3,i=(t.y+e.y+r.y)/3;return new C(n,i)},Nr.inCentre=function(t,e,r){var n=e.distance(r),i=t.distance(r),o=t.distance(e),a=n+i+o,s=(n*t.x+i*e.x+o*r.x)/a,u=(n*t.y+i*e.y+o*r.y)/a;return new C(s,u)};var Fr=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new wt;var t=arguments[0],e=arguments[1],r=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=r};Fr.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),r=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(r,S.EXTERIOR,S.INTERIOR)},Fr.prototype.addPolygon=function(t){var e=this._distance,r=Ee.LEFT;this._distance<0&&(e=-this._distance,r=Ee.RIGHT);var n=t.getExteriorRing(),i=It.removeRepeatedPoints(n.getCoordinates());if(this._distance<0&&this.isErodedCompletely(n,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,r,S.EXTERIOR,S.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(a,-this._distance)||this.addPolygonRing(s,e,Ee.opposite(r),S.INTERIOR,S.EXTERIOR)}},Fr.prototype.isTriangleErodedCompletely=function(t,e){var r=new Nr(t[0],t[1],t[2]),n=r.inCentre();return st.distancePointLine(n,r.p0,r.p1)=ee.MINIMUM_VALID_SIZE&&st.isCCW(t)&&(o=i,a=n,r=Ee.opposite(r));var s=this._curveBuilder.getRingCurve(t,r,e);this.addCurve(s,o,a)},Fr.prototype.add=function(t){if(t.isEmpty())return null;t instanceof $t?this.addPolygon(t):t instanceof Xt?this.addLineString(t):t instanceof Kt?this.addPoint(t):(t instanceof te||t instanceof Ht||t instanceof re||t instanceof Gt)&&this.addCollection(t)},Fr.prototype.isErodedCompletely=function(t,e){var r=t.getCoordinates();if(r.length<4)return e<0;if(4===r.length)return this.isTriangleErodedCompletely(r,e);var n=t.getEnvelopeInternal(),i=Math.min(n.getHeight(),n.getWidth());return e<0&&2*Math.abs(e)>i},Fr.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new n;var t=this._parent.getGeometryN(this._index++);return t instanceof Gt?(this._subcollectionIterator=new zr(t),this._subcollectionIterator.next()):t},zr.prototype.remove=function(){throw new Error(this.getClass().getName())},zr.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},zr.prototype.interfaces_=function(){return[bt]},zr.prototype.getClass=function(){return zr},zr.isAtomic=function(t){return!(t instanceof Gt)};var Ur=function(){this._geom=null;var t=arguments[0];this._geom=t};Ur.prototype.locate=function(t){return Ur.locate(t,this._geom)},Ur.prototype.interfaces_=function(){return[jr]},Ur.prototype.getClass=function(){return Ur},Ur.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&st.isPointInRing(t,e.getCoordinates())},Ur.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var r=e.getExteriorRing();if(!Ur.isPointInRing(t,r))return!1;for(var n=0;n=0;r--){var n=this._edgeList.get(r),i=n.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=n}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),r=t.getDepth(Ee.LEFT),n=t.getDepth(Ee.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),r);if(this.computeDepths(0,e,i)!==n)throw new Se("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],a=arguments[1],s=arguments[2],u=o;u=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),n){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==t)continue;r=a,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;r.setNextMin(o),n=this._SCANNING_FOR_INCOMING}}n===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),r.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var r=arguments[0],n=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===r&&n++;return n}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=S.NONE,e=this.iterator();e.hasNext();){var r=e.next(),n=r.getSym();if(!r.isLineEdge()){if(r.isInResult()){t=S.INTERIOR;break}if(n.isInResult()){t=S.EXTERIOR;break}}}if(t===S.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===S.INTERIOR):(a.isInResult()&&(i=S.EXTERIOR),s.isInResult()&&(i=S.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Le(S.NONE);for(var r=this.iterator();r.hasNext();)for(var n=r.next().getEdge().getLabel(),i=0;i<2;i++){var o=n.getLocation(i);o!==S.INTERIOR&&o!==S.BOUNDARY||this._label.setLocation(i,S.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Gr),Vr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new Ne(t,new Hr)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(He),Qr=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};Qr.prototype.compareTo=function(t){var e=t;return Qr.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Qr.prototype.interfaces_=function(){return[b]},Qr.prototype.getClass=function(){return Qr},Qr.orientation=function(t){return 1===It.increasingDirection(t)},Qr.compareOriented=function(t,e,r,n){for(var i=e?1:-1,o=n?1:-1,a=e?t.length:-1,s=n?r.length:-1,u=e?0:t.length-1,c=n?0:r.length-1;;){var l=t[u].compareTo(r[c]);if(0!==l)return l;var h=(u+=i)===a,p=(c+=o)===s;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var qr=function(){this._edges=new wt,this._ocaMap=new h};qr.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var n=r.getCoordinates(),i=0;i0&&t.print(","),t.print(n[i].x+" "+n[i].y);t.println(")")}t.print(") ")},qr.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},qr.prototype.findEdgeIndex=function(t){for(var e=0;e0||!e.coord.equals2D(n);i||r--;var o=new Array(r).fill(null),a=0;o[a++]=new C(t.coord);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=e.coord),new en(o,new Le(this.edge._label))},Zr.prototype.add=function(t,e,r){var n=new Xr(t,e,r),i=this._nodeMap.get(n);return null!==i?i:(this._nodeMap.put(n,n),n)},Zr.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr};var Kr=function(){};Kr.prototype.getChainStartIndices=function(t){var e=0,r=new wt;r.add(new R(e));do{var n=this.findChainEnd(t,e);r.add(new R(n)),e=n}while(er?e:r},Jr.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,r=this.pts[this.startIndex[t+1]].x;return ee&&(n=1),this._depth[t][r]=n}}},$r.prototype.getDelta=function(t){return this._depth[t][Ee.RIGHT]-this._depth[t][Ee.LEFT]},$r.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?S.EXTERIOR:S.INTERIOR},$r.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},$r.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var r=1;r<3;r++){var n=t.getLocation(e,r);n!==S.EXTERIOR&&n!==S.INTERIOR||(this.isNull(e,r)?this._depth[e][r]=$r.depthAtLocation(n):this._depth[e][r]+=$r.depthAtLocation(n))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===S.INTERIOR&&this._depth[i][o]++}},$r.prototype.interfaces_=function(){return[]},$r.prototype.getClass=function(){return $r},$r.depthAtLocation=function(t){return t===S.EXTERIOR?0:t===S.INTERIOR?1:$r.NULL_VALUE},tn.NULL_VALUE.get=function(){return-1},Object.defineProperties($r,tn);var en=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Zr(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new $r,this._depthDelta=0,1===arguments.length){var r=arguments[0];e.call(this,r,null)}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.pts=n,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Le.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var r=t;if(this.pts.length!==r.pts.length)return!1;for(var n=!0,i=!0,o=this.pts.length,a=0;a0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Jr(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new q;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;en||this._maxyo;if(a)return!1;var s=this.intersectsToleranceSquare(t,e);return et.isTrue(!(a&&s),"Found bad envelope test"),s},sn.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new C(this._maxx,this._maxy),this._corner[1]=new C(this._minx,this._maxy),this._corner[2]=new C(this._minx,this._miny),this._corner[3]=new C(this._maxx,this._miny)},sn.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},sn.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},sn.prototype.getCoordinate=function(){return this._originalPt},sn.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},sn.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=sn.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new q(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},sn.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},sn.prototype.intersectsToleranceSquare=function(t,e){var r=!1,n=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||r&&n||t.equals(this._pt)||e.equals(this._pt)))))},sn.prototype.addSnappedNode=function(t,e){var r=t.getCoordinate(e),n=t.getCoordinate(e+1);return!!this.intersects(r,n)&&(t.addIntersection(this.getCoordinate(),e),!0)},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},un.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(sn,un);var cn=function(){this.tempEnv1=new q,this.selectedSegment=new fr};cn.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn};var ln=function(){this._index=null;var t=arguments[0];this._index=t},hn={HotPixelSnapAction:{configurable:!0}};ln.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],r=arguments[1],n=arguments[2],i=e.getSafeEnvelope(),o=new pn(e,r,n);return this._index.query(i,{interfaces_:function(){return[Xe]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln},hn.HotPixelSnapAction.get=function(){return pn},Object.defineProperties(ln,hn);var pn=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],r=arguments[1],n=arguments[2];this._hotPixel=e,this._parentEdge=r,this._hotPixelVertexIndex=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[0],r=arguments[1],n=e.getContext();if(null!==this._parentEdge&&n===this._parentEdge&&r===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cn),dn=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new wt};dn.prototype.processIntersections=function(t,e,r,n){if(t===r&&e===n)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Se))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var r=arguments[0],n=gn.precisionScaleFactor(this._argGeom,this._distance,r),i=new de(n);this.bufferFixedPrecision(i)}},gn.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===de.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},gn.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},gn.prototype.bufferOriginalPrecision=function(){try{var t=new rn(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof $))throw t;this._saveException=t}},gn.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},gn.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},gn.prototype.interfaces_=function(){return[]},gn.prototype.getClass=function(){return gn},gn.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new gn(t).getResultGeometry(e)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof lt&&"number"==typeof arguments[1]){var r=arguments[0],n=arguments[1],i=arguments[2],o=new gn(r);return o.setQuadrantSegments(i),o.getResultGeometry(n)}if(arguments[2]instanceof wr&&arguments[0]instanceof lt&&"number"==typeof arguments[1]){var a=arguments[0],s=arguments[1],u=arguments[2];return new gn(a,u).getResultGeometry(s)}}else if(4===arguments.length){var c=arguments[0],l=arguments[1],h=arguments[2],p=arguments[3],d=new gn(c);return d.setQuadrantSegments(h),d.setEndCapStyle(p),d.getResultGeometry(l)}},gn.precisionScaleFactor=function(t,e,r){var n=t.getEnvelopeInternal(),i=O.max(Math.abs(n.getMaxX()),Math.abs(n.getMaxY()),Math.abs(n.getMinX()),Math.abs(n.getMinY()))+2*(e>0?e:0),o=r-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},mn.CAP_ROUND.get=function(){return wr.CAP_ROUND},mn.CAP_BUTT.get=function(){return wr.CAP_FLAT},mn.CAP_FLAT.get=function(){return wr.CAP_FLAT},mn.CAP_SQUARE.get=function(){return wr.CAP_SQUARE},mn.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(gn,mn);var yn=function(){this._pt=[new C,new C],this._distance=A.NaN,this._isNull=!0};yn.prototype.getCoordinates=function(){return this._pt},yn.prototype.getCoordinate=function(t){return this._pt[t]},yn.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],r=arguments[1];if(this._isNull)return this.initialize(e,r),null;var n=e.distance(r);nthis._distance&&this.initialize(e,r,n)}},yn.prototype.interfaces_=function(){return[]},yn.prototype.getClass=function(){return yn};var vn=function(){};vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.computeDistance=function(){if(arguments[2]instanceof yn&&arguments[0]instanceof Xt&&arguments[1]instanceof C)for(var t=arguments[0],e=arguments[1],r=arguments[2],n=t.getCoordinates(),i=new fr,o=0;o0||this._isIn?S.INTERIOR:S.EXTERIOR)},En.prototype.interfaces_=function(){return[]},En.prototype.getClass=function(){return En};var In=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],r=arguments[1];t.call(this,e,t.INSIDE_AREA,r)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2];this._component=n,this._segIndex=i,this._pt=o}},Mn={INSIDE_AREA:{configurable:!0}};In.prototype.isInsideArea=function(){return this._segIndex===In.INSIDE_AREA},In.prototype.getCoordinate=function(){return this._pt},In.prototype.getGeometryComponent=function(){return this._component},In.prototype.getSegmentIndex=function(){return this._segIndex},In.prototype.interfaces_=function(){return[]},In.prototype.getClass=function(){return In},Mn.INSIDE_AREA.get=function(){return-1},Object.defineProperties(In,Mn);var Sn=function(t){this._pts=t||null};Sn.prototype.filter=function(t){t instanceof Kt&&this._pts.add(t)},Sn.prototype.interfaces_=function(){return[zt]},Sn.prototype.getClass=function(){return Sn},Sn.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Kt?$e.singletonList(t):Sn.getPoints(t,new wt)}if(2===arguments.length){var e=arguments[0],r=arguments[1];return e instanceof Kt?r.add(e):e instanceof Gt&&e.apply(new Sn(r)),r}};var Tn=function(){this._locations=null;var t=arguments[0];this._locations=t};Tn.prototype.filter=function(t){(t instanceof Kt||t instanceof Xt||t instanceof $t)&&this._locations.add(new In(t,0,t.getCoordinate()))},Tn.prototype.interfaces_=function(){return[zt]},Tn.prototype.getClass=function(){return Tn},Tn.getLocations=function(t){var e=new wt;return t.apply(new Tn(e)),e};var Pn=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new En,this._minDistanceLocation=null,this._minDistance=A.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=r,this._geom[1]=n,this._terminateDistance=i}};Pn.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=1-e,i=wn.getPolygons(this._geom[e]);if(i.size()>0){var o=Tn.getLocations(this._geom[n]);if(this.computeContainmentDistance(o,i,r),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[n]=r[0],this._minDistanceLocation[e]=r[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&P(arguments[0],xt)&&P(arguments[1],xt)){for(var a=arguments[0],s=arguments[1],u=arguments[2],c=0;cthis._minDistance)return null;for(var n=t.getCoordinates(),i=e.getCoordinate(),o=0;othis._minDistance)return null;for(var h=u.getCoordinates(),p=c.getCoordinates(),d=0;dthis._distance&&this.initialize(e,r,n)}},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On};var Ln=function(){};Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.computeDistance=function(){if(arguments[2]instanceof On&&arguments[0]instanceof Xt&&arguments[1]instanceof C)for(var t=arguments[0],e=arguments[1],r=arguments[2],n=new fr,i=t.getCoordinates(),o=0;o1||t<=0)throw new v("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},kn.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},kn.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},kn.prototype.computeOrientedDistance=function(t,e,r){var n=new Dn(e);if(t.apply(n),r.setMaximum(n.getMaxPointDistance()),this._densifyFrac>0){var i=new Bn(e,this._densifyFrac);t.apply(i),r.setMaximum(i.getMaxPointDistance())}},kn.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},kn.prototype.interfaces_=function(){return[]},kn.prototype.getClass=function(){return kn},kn.distance=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return new kn(t,e).distance()}if(3===arguments.length){var r=arguments[0],n=arguments[1],i=arguments[2],o=new kn(r,n);return o.setDensifyFraction(i),o.distance()}},Rn.MaxPointDistanceFilter.get=function(){return Dn},Rn.MaxDensifiedByFractionDistanceFilter.get=function(){return Bn},Object.defineProperties(kn,Rn);var Dn=function(){this._maxPtDist=new On,this._minPtDist=new On,this._euclideanDist=new Ln,this._geom=null;var t=arguments[0];this._geom=t};Dn.prototype.filter=function(t){this._minPtDist.initialize(),Ln.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Dn.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dn.prototype.interfaces_=function(){return[dt]},Dn.prototype.getClass=function(){return Dn};var Bn=function(){this._maxPtDist=new On,this._minPtDist=new On,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Bn.prototype.filter=function(t,e){if(0===e)return null;for(var r=t.getCoordinate(e-1),n=t.getCoordinate(e),i=(n.x-r.x)/this._numSubSegs,o=(n.y-r.y)/this._numSubSegs,a=0;ar){this._isValid=!1;var i=n.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+J.toLineString(i[0],i[1])+")"}},Nn.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Nn.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Nn.VERBOSE&&V.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Nn.prototype.checkNegativeValid=function(){if(!(this._input instanceof $t||this._input instanceof re||this._input instanceof Gt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},Nn.prototype.getErrorIndicator=function(){return this._errorIndicator},Nn.prototype.checkMinimumDistance=function(t,e,r){var n=new Pn(t,e,r);if(this._minDistanceFound=n.distance(),this._minDistanceFound0&&t>e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&t=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},jn.prototype.report=function(t){if(!jn.VERBOSE)return null;V.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},jn.prototype.getErrorMessage=function(){return this._errorMsg},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},jn.isValidMsg=function(t,e,r){var n=new jn(t,e,r);return n.isValid()?null:n.getErrorMessage()},jn.isValid=function(t,e,r){return!!new jn(t,e,r).isValid()},zn.VERBOSE.get=function(){return!1},zn.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(jn,zn);var Un=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};Un.prototype.getCoordinates=function(){return this._pts},Un.prototype.size=function(){return this._pts.length},Un.prototype.getCoordinate=function(t){return this._pts[t]},Un.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Un.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:lr.octant(this.getCoordinate(t),this.getCoordinate(t+1))},Un.prototype.setData=function(t){this._data=t},Un.prototype.getData=function(){return this._data},Un.prototype.toString=function(){return J.toLineString(new ue(this._pts))},Un.prototype.interfaces_=function(){return[hr]},Un.prototype.getClass=function(){return Un};var Gn=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new wt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};Gn.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Gn.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},Gn.prototype.getIntersectionSegments=function(){return this._intSegments},Gn.prototype.count=function(){return this._intersectionCount},Gn.prototype.getIntersections=function(){return this._intersections},Gn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Gn.prototype.setKeepIntersections=function(t){this._keepIntersections=t},Gn.prototype.processIntersections=function(t,e,r,n){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===r&&e===n)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(r,n))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=a,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Gn.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},Gn.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Gn.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Gn.prototype.interfaces_=function(){return[Wr]},Gn.prototype.getClass=function(){return Gn},Gn.createAllIntersectionsFinder=function(t){var e=new Gn(t);return e.setFindAllIntersections(!0),e},Gn.createAnyIntersectionFinder=function(t){return new Gn(t)},Gn.createIntersectionCounter=function(t){var e=new Gn(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Hn=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Hn.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Hn.prototype.getIntersections=function(){return this._segInt.getIntersections()},Hn.prototype.isValid=function(){return this.execute(),this._isValid},Hn.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Hn.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Gn(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new br;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Hn.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Se(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Hn.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+J.toLineString(t[0],t[1])+" and "+J.toLineString(t[2],t[3])},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn},Hn.computeIntersections=function(t){var e=new Hn(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Vn=function t(){this._nv=null;var e=arguments[0];this._nv=new Hn(t.toSegmentStrings(e))};Vn.prototype.checkValid=function(){this._nv.checkValid()},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn},Vn.toSegmentStrings=function(t){for(var e=new wt,r=t.iterator();r.hasNext();){var n=r.next();e.add(new Un(n.getCoordinates(),n))}return e},Vn.checkValid=function(t){new Vn(t).checkValid()};var Qn=function(t){this._mapOp=t};Qn.prototype.map=function(t){for(var e=new wt,r=0;r0&&n<4&&!this._preserveType?this._factory.createLineString(r):this._factory.createLinearRing(r)},Yn.prototype.interfaces_=function(){return[]},Yn.prototype.getClass=function(){return Yn};var Xn=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new fr,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Xt&&"number"==typeof arguments[1]){var e=arguments[0],r=arguments[1];t.call(this,e.getCoordinates(),r)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],i=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=i}};Xn.prototype.snapVertices=function(t,e){for(var r=this._isClosed?t.size()-1:t.size(),n=0;n=0&&t.add(o+1,new C(i),!1)}},Xn.prototype.findSegmentIndexToSnap=function(t,e){for(var r=A.MAX_VALUE,n=-1,i=0;ie&&(e=n)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Zn.computeOverlaySnapTolerance(i),Zn.computeOverlaySnapTolerance(o))}},Zn.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Zn.SNAP_PRECISION_FACTOR},Zn.snapToSelf=function(t,e,r){return new Zn(t).snapToSelf(e,r)},Kn.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Zn,Kn);var Jn=function(t){function e(e,r,n){t.call(this),this._snapTolerance=e||null,this._snapPts=r||null,this._isSelfSnap=void 0!==n&&n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var r=new Xn(t,this._snapTolerance);return r.setAllowSnappingToSourceVertices(this._isSelfSnap),r.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var r=t.toCoordinateArray(),n=this.snapLine(r,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Yn),$n=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};$n.prototype.getCommon=function(){return A.longBitsToDouble(this._commonBits)},$n.prototype.add=function(t){var e=A.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=$n.signExpBits(this._commonBits),this._isFirst=!1,null):$n.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=$n.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=$n.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},$n.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=A.longBitsToDouble(t),r="0000000000000000000000000000000000000000000000000000000000000000"+A.toBinaryString(t),n=r.substring(r.length-64);return n.substring(0,1)+" "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+e+" ]"}},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.getBit=function(t,e){return 0!=(t&1<>52},$n.zeroLowerBits=function(t,e){return t&~((1<=0;n--){if($n.getBit(t,n)!==$n.getBit(e,n))return r;r++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ri},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ni(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new C(this._commonCoord);e.x=-e.x,e.y=-e.y;var r=new ni(e);return t.apply(r),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ri},ei.Translater.get=function(){return ni},Object.defineProperties(ti,ei);var ri=function(){this._commonBitsX=new $n,this._commonBitsY=new $n};ri.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ri.prototype.getCommonCoordinate=function(){return new C(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ri.prototype.interfaces_=function(){return[dt]},ri.prototype.getClass=function(){return ri};var ni=function(){this.trans=null;var t=arguments[0];this.trans=t};ni.prototype.filter=function(t,e){var r=t.getOrdinate(e,0)+this.trans.x,n=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,r),t.setOrdinate(e,1,n)},ni.prototype.isDone=function(){return!1},ni.prototype.isGeometryChanged=function(){return!0},ni.prototype.interfaces_=function(){return[Ut]},ni.prototype.getClass=function(){return ni};var ii=function(t,e){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=t,this._geom[1]=e,this.computeSnapTolerance()};ii.prototype.selfSnap=function(t){return new Zn(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,this._cbr.add(t[0]),this._cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this._cbr.removeCommonBits(t[0].copy()),e[1]=this._cbr.removeCommonBits(t[1].copy()),e},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),r=Ii.overlayOp(e[0],e[1],t);return this.prepareResult(r)},ii.prototype.checkValid=function(t){t.isValid()||V.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=Zn.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return Zn.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,r){return new ii(t,e).getResultGeometry(r)},ii.union=function(t,e){return ii.overlayOp(t,e,Ii.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Ii.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Ii.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Ii.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,r=!1,n=null;try{e=Ii.overlayOp(this._geom[0],this._geom[1],t),r=!0}catch(t){if(!(t instanceof $))throw t;n=t}if(!r)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof $?n:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,r){return new oi(t,e).getResultGeometry(r)},oi.union=function(t,e){return oi.overlayOp(t,e,Ii.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Ii.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Ii.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Ii.DIFFERENCE)};var ai=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};ai.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai};var si=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],r=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=r}else if(3===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=n,this._xValue=i,this._obj=o}},ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};si.prototype.isDelete=function(){return this._eventType===si.DELETE},si.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},si.prototype.getObject=function(){return this._obj},si.prototype.compareTo=function(t){var e=t;return this._xValuee._xValue?1:this._eventTypee._eventType?1:0},si.prototype.getInsertEvent=function(){return this._insertEvent},si.prototype.isInsert=function(){return this._eventType===si.INSERT},si.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},si.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},si.prototype.interfaces_=function(){return[b]},si.prototype.getClass=function(){return si},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(si,ui);var ci=function(){};ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var li=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],r=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=r};li.prototype.isTrivialIntersection=function(t,e,r,n){if(t===r&&1===this._li.getIntersectionNum()){if(li.isAdjacentSegments(e,n))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&n===i||0===n&&e===i)return!0}}return!1},li.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},li.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},li.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},li.prototype.isBoundaryPointInternal=function(t,e){for(var r=e.iterator();r.hasNext();){var n=r.next().getCoordinate();if(t.isIntersection(n))return!0}return!1},li.prototype.hasProperIntersection=function(){return this._hasProper},li.prototype.hasIntersection=function(){return this._hasIntersection},li.prototype.isDone=function(){return this._isDone},li.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},li.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},li.prototype.addIntersections=function(t,e,r,n){if(t===r&&e===n)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],a=r.getCoordinates()[n],s=r.getCoordinates()[n+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),r.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,r,n)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),r.addIntersections(this._li,n,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li},li.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var hi=function(t){function e(){t.call(this),this.events=new wt,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){$e.sort(this.events);for(var t=0;te||this._maxo?1:0},fi.prototype.interfaces_=function(){return[w]},fi.prototype.getClass=function(){return fi};var gi=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],r=arguments[1],n=arguments[2];this._min=e,this._max=r,this._item=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,r){if(!this.intersects(t,e))return null;r.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),mi=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],r=arguments[1];this._node1=e,this._node2=r,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,r){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,r),null!==this._node2&&this._node2.query(t,e,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),yi=function(){this._leaves=new wt,this._root=null,this._level=0};yi.prototype.buildTree=function(){$e.sort(this._leaves,new pi.NodeComparator);for(var t=this._leaves,e=null,r=new wt;;){if(this.buildLevel(t,r),1===r.size())return r.get(0);e=t,t=r,r=e}},yi.prototype.insert=function(t,e,r){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new gi(t,e,r))},yi.prototype.query=function(t,e,r){this.init(),this._root.query(t,e,r)},yi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},yi.prototype.printNode=function(t){V.out.println(J.toLineString(new C(t._min,this._level),new C(t._max,this._level)))},yi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},yi.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var r=0;r=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),r=0,n=t.iterator();n.hasNext();){var i=n.next();e[r++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,r){if(this.isBoundaryNode(t,e))return null;r===S.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,r)},e.prototype.addPolygonRing=function(t,e,r){if(t.isEmpty())return null;var n=It.removeRepeatedPoints(t.getCoordinates());if(n.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=n[0],null;var i=e,o=r;st.isCCW(n)&&(i=r,o=e);var a=new en(n,new Le(this._argIndex,S.BOUNDARY,i,o));this._lineEdgeMap.put(t,a),this.insertEdge(a),this.insertPoint(this._argIndex,n[0],S.BOUNDARY)},e.prototype.insertPoint=function(t,e,r){var n=this._nodes.addNode(e),i=n.getLabel();null===i?n._label=new Le(t,r):i.setLocation(t,r)},e.prototype.createEdgeSetIntersector=function(){return new hi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var r=e.next(),n=r.getLabel().getLocation(t),i=r.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,n)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof re&&(this._useBoundaryDeterminationRule=!1),e instanceof $t)this.addPolygon(e);else if(e instanceof Xt)this.addLineString(e);else if(e instanceof Kt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Ht)this.addCollection(e);else if(e instanceof re)this.addCollection(e);else{if(!(e instanceof Gt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e50?(null===this._areaPtLocator&&(this._areaPtLocator=new Ai(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?S.BOUNDARY:S.INTERIOR},e}(Ve),Ci=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new wi(0,t)}else if(2===arguments.length){var e=arguments[0],r=arguments[1],n=ft.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(r.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new wi(0,e,n),this._arg[1]=new wi(1,r,n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new wi(0,i,a),this._arg[1]=new wi(1,o,a)}};Ci.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},Ci.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Ei=function(){};Ei.prototype.interfaces_=function(){return[]},Ei.prototype.getClass=function(){return Ei},Ei.map=function(){if(arguments[0]instanceof lt&&P(arguments[1],Ei.MapOp)){for(var t=arguments[0],e=arguments[1],r=new wt,n=0;n=t.size()?null:t.get(e)},ki.union=function(t){return new ki(t).union()},Ri.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(ki,Ri);var Di=function(){};Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Ii.createEmptyResult(Ii.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Ii.UNION)},t.GeoJSONReader=we,t.GeoJSONWriter=Ce,t.OverlayOp=Ii,t.UnionOp=Di,t.BufferOp=gn,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var n=r(77),i=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===n.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=i},function(t,e,r){"use strict";var n=r(25),i=r(20),o=r(86),a=r(85),s=r(39),u=function(t){function e(e,r){t.call(this),this.setCoordinates(e,r)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=Object(s.e)(t,e,i[0],i[1]);if(o=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t){return null==t}},function(t,e,r){"use strict";e.a={IDLE:0,LOADING:1,LOADED:2,ERROR:3}},function(t,e,r){"use strict";e.a={ADD:"add",REMOVE:"remove"}},function(t,e,r){"use strict";e.a={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature"}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return u})),r.d(e,"d",(function(){return c})),r.d(e,"c",(function(){return l}));var n=r(87),i=r.n(n),o=r(1),a=r(9);function s(t,e,r){var n=t.sPoint,s=t.ePoint,u=t.wayPoints,c=t.avoidArea,l=t.st,p=t.type,d=t.mapContainerId;u=function(t,e,r){t=t.split(","),e=e.split(",");var n=[];r&&r.split(";").forEach((function(t){n.push(t.split(","))}));var o=[];n&&n.forEach((function(t,e){(0===e||!i()(n[e-1],t))&&o.push(t)})),i()(o[0],t)&&o.shift(),i()(o[o.length-1],e)&&o.pop();var a=[];return o.forEach((function(t){return a.push(t.join(","))})),a=a.join(";")}(n,s,u);var f,g=o.a.getProps(d,"config").ROAD_PLAN,m=o.a.getProps(d,"config").LBS_APP_KEY,y=g.name,v=g.url,A="";"kd"===y?f=0:"mm"===y?f=1:"am"===y&&(f=2),"am"===y&&(A=g.token);var _={sPoint:n,ePoint:s,st:l,sourceType:f,serviceUrl:v};1===f&&m&&(_.key=m),u&&(_.wayPoints=u),c&&(_.avoidArea=c),2===f&&(_.key=A),2===p&&(_.sourceType=3,_.key=m||o.a.getProps(d,"config").ACCESSTOKEN,_.serviceUrl="".concat(o.a.getProps(d,"config").MAP_SERVICE_URL.split("//")[1]));var b="".concat(o.a.getProps(d,"config").COMBINE_ROUTE_PLAN);a.a.xhr({type:"POST",body:h(_).slice(1),headers:{"Content-Type":"application/x-www-form-urlencoded"},url:b,success:function(t){200===t.status&&e(t.result)},error:function(t){r(t)}},d)}function u(t){return t.toString()}function c(t){var e=t.map((function(t){return t.point}));return e.length?e.map((function(t){return t.toString()})).join(";"):""}function l(t,e,r){var n=r||o.a.getProps(e,"config").ROAD_PLAN.name;if(!t)return"";if(Array.isArray(t[0][0])&&!Array.isArray(t[0][0][0])){var i="";return t.forEach((function(t){"am"===n&&t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&t.splice(t.length-1,1);var e="";t.forEach((function(t){"mm"===n?e+=t.toString()+",":"kd"!==n&&"am"!==n||(e+=t.toString()+";")})),e=e.substring(0,e.length-1),i+=e+"|",e=""})),i.substring(0,i.length-1)}if(Array.isArray(t[0])&&!Array.isArray(t[0][0])){var a="";return"am"===n&&t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&t.splice(t.length-1,1),t.forEach((function(t){"mm"===n?a+=t.toString()+",":"kd"!==n&&"am"!==n||(a+=t.toString()+";")})),a.substring(0,a.length-1)}}function h(t){var e="?";for(var r in t)e+=r+"="+t[r]+"&";return e=e.substring(0,e.length-1)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=function(){function t(){i()(this,t)}return a()(t,null,[{key:"info",value:function(t,e){}},{key:"error",value:function(t,e){}},{key:"wsInfo",value:function(t,e,r){}},{key:"sendWsInfo",value:function(){}}]),t}()},function(t,e,r){var n=r(326),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();t.exports=o},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,c=[],l=!1,h=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!l){var t=s(p);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h1)for(var r=1;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:{};u()(this,t),this.type=void 0,this.type=e;var n=new Event(this.type);l()(this,n,r)},f=function(){function t(){u()(this,t),this.type=void 0,this._listeners={},this._oneTimeListeners={}}return a()(t,[{key:"on",value:function(t,e){this._listeners[t]=this._listeners[t]||[],this._on(e,this._listeners[t])}},{key:"off",value:function(t,e){if(void 0===e){if(this._listeners[t])for(var r=i()(this._listeners[t]),n=r.length,o=0;o0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0}},{key:"emit",value:function(t,e){var r=new d(t,e=e||{});if(this.listens(t)){var n,o=h(this._listeners&&this._listeners[t]?i()(this._listeners[t]):[]);try{for(o.s();!(n=o.n()).done;){n.value.call(this,r)}}catch(t){o.e(t)}finally{o.f()}var a,s=h(this._oneTimeListeners&&this._oneTimeListeners[t]?i()(this._oneTimeListeners[t]):[]);try{for(s.s();!(a=s.n()).done;){var u=a.value;this._off(u,this._oneTimeListeners[t]),u.call(this,r)}}catch(t){s.e(t)}finally{s.f()}}return this}},{key:"clean",value:function(){var t=this;Object.keys(this._listeners).map((function(e){return t.off(e)})),this._listeners={}}},{key:"_on",value:function(t,e){e.some((function(e){return e===t}))||e.push(t)}},{key:"_off",value:function(t,e){if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(194),u=r.n(s),c=r(5),l=function(){function t(e,r){i()(this,t),this.ctx=e,this.properties=r.properties||{},this.coordinates=r.geometry.coordinates,this.id=r.id||u()(),this.type=r.geometry.type}return a()(t,[{key:"changed",value:function(){this.ctx.store.featureChanged(this.id)}},{key:"incomingCoords",value:function(t){this.setCoordinates(t)}},{key:"setCoordinates",value:function(t){this.coordinates=t,this.changed()}},{key:"getCoordinates",value:function(){return JSON.parse(JSON.stringify(this.coordinates))}},{key:"setProperty",value:function(t,e){this.properties[t]=e}},{key:"toGeoJSON",value:function(){return JSON.parse(JSON.stringify({id:this.id,type:c.g.geojsonTypes.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))}},{key:"internal",value:function(t){var e={id:this.id,meta:c.g.meta.FEATURE,"meta:type":this.type,active:c.g.activeStates.INACTIVE,mode:t};if(this.ctx.options.userProperties)for(var r in this.properties)e["user_".concat(r)]=this.properties[r];return{type:c.g.geojsonTypes.FEATURE,properties:e,geometry:{coordinates:this.getCoordinates(),type:this.type}}}}]),t}()},function(t,e,r){"use strict";r.d(e,"b",(function(){return s})),r.d(e,"a",(function(){return h})),r.d(e,"c",(function(){return d}));var n=r(48),i=r(39),o=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,a=/^([a-z]*)$/i;function s(t){return"string"==typeof t?t:d(t)}var u,c,l=(u={},c=0,function(t){var e;if(u.hasOwnProperty(t))e=u[t];else{if(c>=1024){var r=0;for(var i in u)0==(3&r++)&&(delete u[i],--c)}e=function(t){var e,r,i,s,u;if(a.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var r=getComputedStyle(e).color;return document.body.removeChild(e),r}return""}(t)),o.exec(t)){var c,l=t.length-1;c=l<=4?1:2;var h=4===l||8===l;e=parseInt(t.substr(1+0*c,c),16),r=parseInt(t.substr(1+1*c,c),16),i=parseInt(t.substr(1+2*c,c),16),s=h?parseInt(t.substr(1+3*c,c),16):255,1==c&&(e=(e<<4)+e,r=(r<<4)+r,i=(i<<4)+i,h&&(s=(s<<4)+s)),u=[e,r,i,s/255]}else 0==t.indexOf("rgba(")?p(u=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((u=t.slice(4,-1).split(",").map(Number)).push(1),p(u)):Object(n.a)(!1,14);return u}(t),u[t]=e,++c}return e});function h(t){return Array.isArray(t)?t:l(t)}function p(t){return t[0]=Object(i.a)(t[0]+.5|0,0,255),t[1]=Object(i.a)(t[1]+.5|0,0,255),t[2]=Object(i.a)(t[2]+.5|0,0,255),t[3]=Object(i.a)(t[3],0,1),t}function d(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var r=t[1];r!=(0|r)&&(r=r+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+r+","+n+","+(void 0===t[3]?1:t[3])+")"}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return u})),r.d(e,"d",(function(){return c}));var n=r(39);function i(t,e,r,i,o,a,s){var u=(r-e)/i;if(u<3){for(;e0;){for(var p=l.pop(),d=l.pop(),f=0,g=t[d],m=t[d+1],y=t[p],v=t[p+1],A=d+i;Af&&(h=A,f=x)}f>o&&(c[(h-e)/i]=1,d+i0&&m>f)&&(g<0&&y0&&y>g)?(u=p,c=d):(o[s++]=u,o[s++]=c,l=u,h=c,u=p,c=d)}}return o[s++]=u,o[s++]=c,s}function u(t,e,r,n,i,o,a,u){for(var c=0,l=r.length;c0}function o(t,e,r,n,o){for(var a=void 0!==o&&o,s=0,u=r.length;s80*r){n=u=t[0],s=c=t[1];for(var _=r;_u&&(u=l),d>c&&(c=d);f=0!==(f=Math.max(u-n,c-s))?1/f:0}return a(v,A,r,n,s,f),A}function i(t,e,r,n,i){var o,a;if(i===S(t,e,r,n)>0)for(o=e;o=e;o-=n)a=E(o,t[o],t[o+1],a);return a&&A(a,a.next)&&(I(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!A(n,n.next)&&0!==v(n.prev,n,n.next))n=n.next;else{if(I(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function a(t,e,r,n,i,h,p){if(t){!p&&h&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=f(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(t,n,i,h);for(var d,g,m=t;t.prev!==t.next;)if(d=t.prev,g=t.next,h?u(t,n,i,h):s(t))e.push(d.i/r),e.push(t.i/r),e.push(g.i/r),I(t),t=g.next,m=g.next;else if((t=g)===m){p?1===p?a(t=c(o(t),e,r),e,r,n,i,h,2):2===p&&l(t,e,r,n,i,h):a(o(t),e,r,n,i,h,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(v(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(m(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&v(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,r,n){var i=t.prev,o=t,a=t.next;if(v(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=f(s,u,e,r,n),p=f(c,l,e,r,n),d=t.prevZ,g=t.nextZ;d&&d.z>=h&&g&&g.z<=p;){if(d!==t.prev&&d!==t.next&&m(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&v(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,g!==t.prev&&g!==t.next&&m(i.x,i.y,o.x,o.y,a.x,a.y,g.x,g.y)&&v(g.prev,g,g.next)>=0)return!1;g=g.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&m(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&v(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;g&&g.z<=p;){if(g!==t.prev&&g!==t.next&&m(i.x,i.y,o.x,o.y,a.x,a.y,g.x,g.y)&&v(g.prev,g,g.next)>=0)return!1;g=g.nextZ}return!0}function c(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!A(i,a)&&_(i,n,n.next,a)&&w(i,a)&&w(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),I(n),I(n.next),n=t=a),n=n.next}while(n!==t);return o(n)}function l(t,e,r,n,i,s){var u=t;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&y(u,c)){var l=C(u,c);return u=o(u,u.next),l=o(l,l.next),a(u,e,r,n,i,s),void a(l,e,r,n,i,s)}c=c.next}u=u.next}while(u!==t)}function h(t,e){return t.x-e.x}function p(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&&m(or.x||n.x===r.x&&d(r,n)))&&(r=n,p=u)),n=n.next}while(n!==c);return r}(t,e)){var r=C(e,t);o(e,e.next),o(r,r.next)}}function d(t,e){return v(t.prev,t,e.prev)<0&&v(e.next,t,t.next)<0}function f(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function g(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&_(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(v(t.prev,t,e.prev)||v(t,e.prev,e))||A(t,e)&&v(t.prev,t,t.next)>0&&v(e.prev,e,e.next)>0)}function v(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function A(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,r,n){var i=x(v(t,e,r)),o=x(v(t,e,n)),a=x(v(r,n,t)),s=x(v(r,n,e));return i!==o&&a!==s||(!(0!==i||!b(t,r,e))||(!(0!==o||!b(t,n,e))||(!(0!==a||!b(r,t,n))||!(0!==s||!b(r,e,n)))))}function b(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function x(t){return t>0?1:t<0?-1:0}function w(t,e){return v(t.prev,t,t.next)<0?v(t,e,t.next)>=0&&v(t,t.prev,e)>=0:v(t,e,t.prev)<0||v(t,t.next,e)<0}function C(t,e){var r=new M(t.i,t.x,t.y),n=new M(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function E(t,e,r,n){var i=new M(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function I(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function M(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,r,n){for(var i=0,o=e,a=r-n;o0&&(n+=t[i-1].length,r.holes.push(n))}return r}},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0;e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}},function(t,e,r){var n,i,o,a,s=r(50);a=function(t){"use strict";function e(){}window.THREE=t,void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;r>8&255]+r[t>>16&255]+r[t>>24&255]+"-"+r[255&e]+r[e>>8&255]+"-"+r[e>>16&15|64]+r[e>>24&255]+"-"+r[63&n|128]+r[n>>8&255]+"-"+r[n>>16&255]+r[n>>24&255]+r[255&i]+r[i>>8&255]+r[i>>16&255]+r[i>>24&255]).toUpperCase()},clamp:function(t,e,r){return Math.max(e,Math.min(r,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,r,n,i){return n+(t-e)*(i-n)/(r-e)},lerp:function(t,e,r){return(1-r)*t+r*e},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*o.DEG2RAD},radToDeg:function(t){return t*o.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,r,n,i){var o=Math.cos,a=Math.sin,s=o(r/2),u=a(r/2),c=o((e+n)/2),l=a((e+n)/2),h=o((e-n)/2),p=a((e-n)/2),d=o((n-e)/2),f=a((n-e)/2);switch(i){case"XYX":t.set(s*l,u*h,u*p,s*c);break;case"YZY":t.set(u*p,s*l,u*h,s*c);break;case"ZXZ":t.set(u*h,u*p,s*l,s*c);break;case"XZX":t.set(s*l,u*f,u*d,s*c);break;case"YXY":t.set(u*d,s*l,u*f,s*c);break;case"ZYZ":t.set(u*f,u*d,s*l,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};function a(t,e){this.x=t||0,this.y=e||0}function u(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(a.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(a.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,r=this.y,n=t.elements;return this.x=n[0]*e+n[3]*r+n[6],this.y=n[1]*e+n[4]*r+n[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(-this.y,-this.x)+Math.PI;return t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var r=Math.cos(e),n=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*r-o*n+t.x,this.y=i*n+o*r+t.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}}),Object.assign(u.prototype,{isMatrix3:!0,set:function(t,e,r,n,i,o,a,s,u){var c=this.elements;return c[0]=t,c[1]=n,c[2]=a,c[3]=e,c[4]=i,c[5]=s,c[6]=r,c[7]=o,c[8]=u,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this},extractBasis:function(t,e,r){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var r=t.elements,n=e.elements,i=this.elements,o=r[0],a=r[3],s=r[6],u=r[1],c=r[4],l=r[7],h=r[2],p=r[5],d=r[8],f=n[0],g=n[3],m=n[6],y=n[1],v=n[4],A=n[7],_=n[2],b=n[5],x=n[8];return i[0]=o*f+a*y+s*_,i[3]=o*g+a*v+s*b,i[6]=o*m+a*A+s*x,i[1]=u*f+c*y+l*_,i[4]=u*g+c*v+l*b,i[7]=u*m+c*A+l*x,i[2]=h*f+p*y+d*_,i[5]=h*g+p*v+d*b,i[8]=h*m+p*A+d*x,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*o*c-e*a*u-r*i*c+r*a*s+n*i*u-n*o*s},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var r=t.elements,n=this.elements,i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],c=r[5],l=r[6],h=r[7],p=r[8],d=p*u-c*h,f=c*l-p*s,g=h*s-u*l,m=i*d+o*f+a*g;if(0===m)return this.set(0,0,0,0,0,0,0,0,0);var y=1/m;return n[0]=d*y,n[1]=(a*h-p*o)*y,n[2]=(c*o-a*u)*y,n[3]=f*y,n[4]=(p*i-a*l)*y,n[5]=(a*s-c*i)*y,n[6]=g*y,n[7]=(o*l-h*i)*y,n[8]=(u*i-o*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,r,n,i,o,a){var s=Math.cos(i),u=Math.sin(i);this.set(r*s,r*u,-r*(s*o+u*a)+o+t,-n*u,n*s,-n*(-u*o+s*a)+a+e,0,0,1)},scale:function(t,e){var r=this.elements;return r[0]*=t,r[3]*=t,r[6]*=t,r[1]*=e,r[4]*=e,r[7]*=e,this},rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=this.elements,i=n[0],o=n[3],a=n[6],s=n[1],u=n[4],c=n[7];return n[0]=e*i+r*s,n[3]=e*o+r*u,n[6]=e*a+r*c,n[1]=-r*i+e*s,n[4]=-r*o+e*u,n[7]=-r*a+e*c,this},translate:function(t,e){var r=this.elements;return r[0]+=t*r[2],r[3]+=t*r[5],r[6]+=t*r[8],r[1]+=e*r[2],r[4]+=e*r[5],r[7]+=e*r[8],this},equals:function(t){for(var e=this.elements,r=t.elements,n=0;n<9;n++)if(e[n]!==r[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var r=0;r<9;r++)this.elements[r]=t[r+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t}});var c={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===i&&(i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),i.width=t.width,i.height=t.height;var r=i.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),e=i}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},l=0;function h(t,e,r,n,i,s,c,p,d,f){Object.defineProperty(this,"id",{value:l++}),this.uuid=o.generateUUID(),this.name="",this.image=void 0!==t?t:h.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:h.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:1001,this.wrapT=void 0!==n?n:1001,this.magFilter=void 0!==i?i:1006,this.minFilter=void 0!==s?s:1008,this.anisotropy=void 0!==d?d:1,this.format=void 0!==c?c:1023,this.internalFormat=null,this.type=void 0!==p?p:1009,this.offset=new a(0,0),this.repeat=new a(1,1),this.center=new a(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new u,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==f?f:3e3,this.version=0,this.onUpdate=null}function p(t,e,r,n){this.x=t||0,this.y=e||0,this.z=r||0,this.w=void 0!==n?n:1}function d(t,e,r){this.width=t,this.height=e,this.scissor=new p(0,0,t,e),this.scissorTest=!1,this.viewport=new p(0,0,t,e),r=r||{},this.texture=new h(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,this.texture.minFilter=void 0!==r.minFilter?r.minFilter:1006,this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null}function f(t,e,r){d.call(this,t,e,r),this.samples=4}function g(t,e,r,n){this._x=t||0,this._y=e||0,this._z=r||0,this._w=void 0!==n?n:1}h.DEFAULT_IMAGE=void 0,h.DEFAULT_MAPPING=300,h.prototype=Object.assign(Object.create(e.prototype),{constructor:h,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=o.generateUUID()),!e&&void 0===t.images[n.uuid]){var i;if(Array.isArray(n)){i=[];for(var a=0,s=n.length;a1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(h.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(p.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(p.prototype,{isVector4:!0,set:function(t,e,r,n){return this.x=t,this.y=e,this.z=r,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,r=this.y,n=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*r+o[8]*n+o[12]*i,this.y=o[1]*e+o[5]*r+o[9]*n+o[13]*i,this.z=o[2]*e+o[6]*r+o[10]*n+o[14]*i,this.w=o[3]*e+o[7]*r+o[11]*n+o[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,r,n,i,o=t.elements,a=o[0],s=o[4],u=o[8],c=o[1],l=o[5],h=o[9],p=o[2],d=o[6],f=o[10];if(Math.abs(s-c)<.01&&Math.abs(u-p)<.01&&Math.abs(h-d)<.01){if(Math.abs(s+c)<.1&&Math.abs(u+p)<.1&&Math.abs(h+d)<.1&&Math.abs(a+l+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var g=(a+1)/2,m=(l+1)/2,y=(f+1)/2,v=(s+c)/4,A=(u+p)/4,_=(h+d)/4;return g>m&&g>y?g<.01?(r=0,n=.707106781,i=.707106781):(n=v/(r=Math.sqrt(g)),i=A/r):m>y?m<.01?(r=.707106781,n=0,i=.707106781):(r=v/(n=Math.sqrt(m)),i=_/n):y<.01?(r=.707106781,n=.707106781,i=0):(r=A/(i=Math.sqrt(y)),n=_/i),this.set(r,n,i,e),this}var b=Math.sqrt((d-h)*(d-h)+(u-p)*(u-p)+(c-s)*(c-s));return Math.abs(b)<.001&&(b=1),this.x=(d-h)/b,this.y=(u-p)/b,this.z=(c-s)/b,this.w=Math.acos((a+l+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this.z=t.z+(e.z-t.z)*r,this.w=t.w+(e.w-t.w)*r,this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}),d.prototype=Object.assign(Object.create(e.prototype),{constructor:d,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),f.prototype=Object.assign(Object.create(d.prototype),{constructor:f,isWebGLMultisampleRenderTarget:!0,copy:function(t){return d.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(g,{slerp:function(t,e,r,n){return r.copy(t).slerp(e,n)},slerpFlat:function(t,e,r,n,i,o,a){var s=r[n+0],u=r[n+1],c=r[n+2],l=r[n+3],h=i[o+0],p=i[o+1],d=i[o+2],f=i[o+3];if(l!==f||s!==h||u!==p||c!==d){var g=1-a,m=s*h+u*p+c*d+l*f,y=m>=0?1:-1,v=1-m*m;if(v>Number.EPSILON){var A=Math.sqrt(v),_=Math.atan2(A,m*y);g=Math.sin(g*_)/A,a=Math.sin(a*_)/A}var b=a*y;if(s=s*g+h*b,u=u*g+p*b,c=c*g+d*b,l=l*g+f*b,g===1-a){var x=1/Math.sqrt(s*s+u*u+c*c+l*l);s*=x,u*=x,c*=x,l*=x}}t[e]=s,t[e+1]=u,t[e+2]=c,t[e+3]=l},multiplyQuaternionsFlat:function(t,e,r,n,i,o){var a=r[n],s=r[n+1],u=r[n+2],c=r[n+3],l=i[o],h=i[o+1],p=i[o+2],d=i[o+3];return t[e]=a*d+c*l+s*p-u*h,t[e+1]=s*d+c*h+u*l-a*p,t[e+2]=u*d+c*p+a*h-s*l,t[e+3]=c*d-a*l-s*h-u*p,t}}),Object.defineProperties(g.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(g.prototype,{isQuaternion:!0,set:function(t,e,r,n){return this._x=t,this._y=e,this._z=r,this._w=n,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=t._x,n=t._y,i=t._z,o=t.order,a=Math.cos,s=Math.sin,u=a(r/2),c=a(n/2),l=a(i/2),h=s(r/2),p=s(n/2),d=s(i/2);switch(o){case"XYZ":this._x=h*c*l+u*p*d,this._y=u*p*l-h*c*d,this._z=u*c*d+h*p*l,this._w=u*c*l-h*p*d;break;case"YXZ":this._x=h*c*l+u*p*d,this._y=u*p*l-h*c*d,this._z=u*c*d-h*p*l,this._w=u*c*l+h*p*d;break;case"ZXY":this._x=h*c*l-u*p*d,this._y=u*p*l+h*c*d,this._z=u*c*d+h*p*l,this._w=u*c*l-h*p*d;break;case"ZYX":this._x=h*c*l-u*p*d,this._y=u*p*l+h*c*d,this._z=u*c*d-h*p*l,this._w=u*c*l+h*p*d;break;case"YZX":this._x=h*c*l+u*p*d,this._y=u*p*l+h*c*d,this._z=u*c*d-h*p*l,this._w=u*c*l-h*p*d;break;case"XZY":this._x=h*c*l-u*p*d,this._y=u*p*l-h*c*d,this._z=u*c*d+h*p*l,this._w=u*c*l+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var r=e/2,n=Math.sin(r);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(r),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var e,r=t.elements,n=r[0],i=r[4],o=r[8],a=r[1],s=r[5],u=r[9],c=r[2],l=r[6],h=r[10],p=n+s+h;return p>0?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(l-u)*e,this._y=(o-c)*e,this._z=(a-i)*e):n>s&&n>h?(e=2*Math.sqrt(1+n-s-h),this._w=(l-u)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(o+c)/e):s>h?(e=2*Math.sqrt(1+s-n-h),this._w=(o-c)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(u+l)/e):(e=2*Math.sqrt(1+h-n-s),this._w=(a-i)/e,this._x=(o+c)/e,this._y=(u+l)/e,this._z=.25*e),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var r=t.dot(e)+1;return r<1e-6?(r=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=r):(this._x=0,this._y=-t.z,this._z=t.y,this._w=r)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=r),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(o.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var r=this.angleTo(t);if(0===r)return this;var n=Math.min(1,e/r);return this.slerp(t,n),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var r=t._x,n=t._y,i=t._z,o=t._w,a=e._x,s=e._y,u=e._z,c=e._w;return this._x=r*c+o*a+n*u-i*s,this._y=n*c+o*s+i*a-r*u,this._z=i*c+o*u+r*s-n*a,this._w=o*c-r*a-n*s-i*u,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var r=this._x,n=this._y,i=this._z,o=this._w,a=o*t._w+r*t._x+n*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=r,this._y=n,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var u=1-e;return this._w=u*o+e*this._w,this._x=u*r+e*this._x,this._y=u*n+e*this._y,this._z=u*i+e*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),l=Math.atan2(c,a),h=Math.sin((1-e)*l)/c,p=Math.sin(e*l)/c;return this._w=o*h+this._w*p,this._x=r*h+this._x*p,this._y=n*h+this._y*p,this._z=i*h+this._z*p,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},fromBufferAttribute:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var m=new v,y=new g;function v(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0}Object.assign(v.prototype,{isVector3:!0,set:function(t,e,r){return this.x=t,this.y=e,this.z=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(y.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(y.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6]*n,this.y=i[1]*e+i[4]*r+i[7]*n,this.z=i[2]*e+i[5]*r+i[8]*n,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements,o=1/(i[3]*e+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*e+i[4]*r+i[8]*n+i[12])*o,this.y=(i[1]*e+i[5]*r+i[9]*n+i[13])*o,this.z=(i[2]*e+i[6]*r+i[10]*n+i[14])*o,this},applyQuaternion:function(t){var e=this.x,r=this.y,n=this.z,i=t.x,o=t.y,a=t.z,s=t.w,u=s*e+o*n-a*r,c=s*r+a*e-i*n,l=s*n+i*r-o*e,h=-i*e-o*r-a*n;return this.x=u*s+h*-i+c*-a-l*-o,this.y=c*s+h*-o+l*-i-u*-a,this.z=l*s+h*-a+u*-o-c*-i,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[4]*r+i[8]*n,this.y=i[1]*e+i[5]*r+i[9]*n,this.z=i[2]*e+i[6]*r+i[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this.z=t.z+(e.z-t.z)*r,this},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var r=t.x,n=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=n*s-i*a,this.y=i*o-r*s,this.z=r*a-n*o,this},projectOnVector:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var r=t.dot(this)/e;return this.copy(t).multiplyScalar(r)},projectOnPlane:function(t){return m.copy(this).projectOnVector(t),this.sub(m)},reflect:function(t){return this.sub(m.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var r=this.dot(t)/e;return Math.acos(o.clamp(r,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return e*e+r*r+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,r){var n=Math.sin(e)*t;return this.x=n*Math.sin(r),this.y=Math.cos(e)*t,this.z=n*Math.cos(r),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,r){return this.x=t*Math.sin(e),this.y=r,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=r,this.z=n,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});var A=new v,_=new I,b=new v(0,0,0),x=new v(1,1,1),w=new v,C=new v,E=new v;function I(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(I.prototype,{isMatrix4:!0,set:function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g){var m=this.elements;return m[0]=t,m[4]=e,m[8]=r,m[12]=n,m[1]=i,m[5]=o,m[9]=a,m[13]=s,m[2]=u,m[6]=c,m[10]=l,m[14]=h,m[3]=p,m[7]=d,m[11]=f,m[15]=g,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new I).fromArray(this.elements)},copy:function(t){var e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],this},copyPosition:function(t){var e=this.elements,r=t.elements;return e[12]=r[12],e[13]=r[13],e[14]=r[14],this},extractBasis:function(t,e,r){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this},extractRotation:function(t){var e=this.elements,r=t.elements,n=1/A.setFromMatrixColumn(t,0).length(),i=1/A.setFromMatrixColumn(t,1).length(),o=1/A.setFromMatrixColumn(t,2).length();return e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e[3]=0,e[4]=r[4]*i,e[5]=r[5]*i,e[6]=r[6]*i,e[7]=0,e[8]=r[8]*o,e[9]=r[9]*o,e[10]=r[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,r=t.x,n=t.y,i=t.z,o=Math.cos(r),a=Math.sin(r),s=Math.cos(n),u=Math.sin(n),c=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var h=o*c,p=o*l,d=a*c,f=a*l;e[0]=s*c,e[4]=-s*l,e[8]=u,e[1]=p+d*u,e[5]=h-f*u,e[9]=-a*s,e[2]=f-h*u,e[6]=d+p*u,e[10]=o*s}else if("YXZ"===t.order){var g=s*c,m=s*l,y=u*c,v=u*l;e[0]=g+v*a,e[4]=y*a-m,e[8]=o*u,e[1]=o*l,e[5]=o*c,e[9]=-a,e[2]=m*a-y,e[6]=v+g*a,e[10]=o*s}else if("ZXY"===t.order)g=s*c,m=s*l,y=u*c,v=u*l,e[0]=g-v*a,e[4]=-o*l,e[8]=y+m*a,e[1]=m+y*a,e[5]=o*c,e[9]=v-g*a,e[2]=-o*u,e[6]=a,e[10]=o*s;else if("ZYX"===t.order)h=o*c,p=o*l,d=a*c,f=a*l,e[0]=s*c,e[4]=d*u-p,e[8]=h*u+f,e[1]=s*l,e[5]=f*u+h,e[9]=p*u-d,e[2]=-u,e[6]=a*s,e[10]=o*s;else if("YZX"===t.order){var A=o*s,_=o*u,b=a*s,x=a*u;e[0]=s*c,e[4]=x-A*l,e[8]=b*l+_,e[1]=l,e[5]=o*c,e[9]=-a*c,e[2]=-u*c,e[6]=_*l+b,e[10]=A-x*l}else"XZY"===t.order&&(A=o*s,_=o*u,b=a*s,x=a*u,e[0]=s*c,e[4]=-l,e[8]=u*c,e[1]=A*l+x,e[5]=o*c,e[9]=_*l-b,e[2]=b*l-_,e[6]=a*c,e[10]=x*l+A);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(b,t,x)},lookAt:function(t,e,r){var n=this.elements;return E.subVectors(t,e),0===E.lengthSq()&&(E.z=1),E.normalize(),w.crossVectors(r,E),0===w.lengthSq()&&(1===Math.abs(r.z)?E.x+=1e-4:E.z+=1e-4,E.normalize(),w.crossVectors(r,E)),w.normalize(),C.crossVectors(E,w),n[0]=w.x,n[4]=C.x,n[8]=E.x,n[1]=w.y,n[5]=C.y,n[9]=E.y,n[2]=w.z,n[6]=C.z,n[10]=E.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var r=t.elements,n=e.elements,i=this.elements,o=r[0],a=r[4],s=r[8],u=r[12],c=r[1],l=r[5],h=r[9],p=r[13],d=r[2],f=r[6],g=r[10],m=r[14],y=r[3],v=r[7],A=r[11],_=r[15],b=n[0],x=n[4],w=n[8],C=n[12],E=n[1],I=n[5],M=n[9],S=n[13],T=n[2],P=n[6],O=n[10],L=n[14],k=n[3],R=n[7],D=n[11],B=n[15];return i[0]=o*b+a*E+s*T+u*k,i[4]=o*x+a*I+s*P+u*R,i[8]=o*w+a*M+s*O+u*D,i[12]=o*C+a*S+s*L+u*B,i[1]=c*b+l*E+h*T+p*k,i[5]=c*x+l*I+h*P+p*R,i[9]=c*w+l*M+h*O+p*D,i[13]=c*C+l*S+h*L+p*B,i[2]=d*b+f*E+g*T+m*k,i[6]=d*x+f*I+g*P+m*R,i[10]=d*w+f*M+g*O+m*D,i[14]=d*C+f*S+g*L+m*B,i[3]=y*b+v*E+A*T+_*k,i[7]=y*x+v*I+A*P+_*R,i[11]=y*w+v*M+A*O+_*D,i[15]=y*C+v*S+A*L+_*B,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){var t=this.elements,e=t[0],r=t[4],n=t[8],i=t[12],o=t[1],a=t[5],s=t[9],u=t[13],c=t[2],l=t[6],h=t[10],p=t[14];return t[3]*(+i*s*l-n*u*l-i*a*h+r*u*h+n*a*p-r*s*p)+t[7]*(+e*s*p-e*u*h+i*o*h-n*o*p+n*u*c-i*s*c)+t[11]*(+e*u*l-e*a*p-i*o*l+r*o*p+i*a*c-r*u*c)+t[15]*(-n*a*c-e*s*l+e*a*h+n*o*l-r*o*h+r*s*c)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,r){var n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=r),this},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var r=this.elements,n=t.elements,i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5],l=n[6],h=n[7],p=n[8],d=n[9],f=n[10],g=n[11],m=n[12],y=n[13],v=n[14],A=n[15],_=d*v*h-y*f*h+y*l*g-c*v*g-d*l*A+c*f*A,b=m*f*h-p*v*h-m*l*g+u*v*g+p*l*A-u*f*A,x=p*y*h-m*d*h+m*c*g-u*y*g-p*c*A+u*d*A,w=m*d*l-p*y*l-m*c*f+u*y*f+p*c*v-u*d*v,C=i*_+o*b+a*x+s*w;if(0===C)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var E=1/C;return r[0]=_*E,r[1]=(y*f*s-d*v*s-y*a*g+o*v*g+d*a*A-o*f*A)*E,r[2]=(c*v*s-y*l*s+y*a*h-o*v*h-c*a*A+o*l*A)*E,r[3]=(d*l*s-c*f*s-d*a*h+o*f*h+c*a*g-o*l*g)*E,r[4]=b*E,r[5]=(p*v*s-m*f*s+m*a*g-i*v*g-p*a*A+i*f*A)*E,r[6]=(m*l*s-u*v*s-m*a*h+i*v*h+u*a*A-i*l*A)*E,r[7]=(u*f*s-p*l*s+p*a*h-i*f*h-u*a*g+i*l*g)*E,r[8]=x*E,r[9]=(m*d*s-p*y*s-m*o*g+i*y*g+p*o*A-i*d*A)*E,r[10]=(u*y*s-m*c*s+m*o*h-i*y*h-u*o*A+i*c*A)*E,r[11]=(p*c*s-u*d*s-p*o*h+i*d*h+u*o*g-i*c*g)*E,r[12]=w*E,r[13]=(p*y*a-m*d*a+m*o*f-i*y*f-p*o*v+i*d*v)*E,r[14]=(m*c*a-u*y*a-m*o*l+i*y*l+u*o*v-i*c*v)*E,r[15]=(u*d*a-p*c*a+p*o*l-i*d*l-u*o*f+i*c*f)*E,this},scale:function(t){var e=this.elements,r=t.x,n=t.y,i=t.z;return e[0]*=r,e[4]*=n,e[8]*=i,e[1]*=r,e[5]*=n,e[9]*=i,e[2]*=r,e[6]*=n,e[10]*=i,e[3]*=r,e[7]*=n,e[11]*=i,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,r,n))},makeTranslation:function(t,e,r){return this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var r=Math.cos(e),n=Math.sin(e),i=1-r,o=t.x,a=t.y,s=t.z,u=i*o,c=i*a;return this.set(u*o+r,u*a-n*s,u*s+n*a,0,u*a+n*s,c*a+r,c*s-n*o,0,u*s-n*a,c*s+n*o,i*s*s+r,0,0,0,0,1),this},makeScale:function(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this},makeShear:function(t,e,r){return this.set(1,e,r,0,t,1,r,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,r){var n=this.elements,i=e._x,o=e._y,a=e._z,s=e._w,u=i+i,c=o+o,l=a+a,h=i*u,p=i*c,d=i*l,f=o*c,g=o*l,m=a*l,y=s*u,v=s*c,A=s*l,_=r.x,b=r.y,x=r.z;return n[0]=(1-(f+m))*_,n[1]=(p+A)*_,n[2]=(d-v)*_,n[3]=0,n[4]=(p-A)*b,n[5]=(1-(h+m))*b,n[6]=(g+y)*b,n[7]=0,n[8]=(d+v)*x,n[9]=(g-y)*x,n[10]=(1-(h+f))*x,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},decompose:function(t,e,r){var n=this.elements,i=A.set(n[0],n[1],n[2]).length(),o=A.set(n[4],n[5],n[6]).length(),a=A.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),t.x=n[12],t.y=n[13],t.z=n[14],_.copy(this);var s=1/i,u=1/o,c=1/a;return _.elements[0]*=s,_.elements[1]*=s,_.elements[2]*=s,_.elements[4]*=u,_.elements[5]*=u,_.elements[6]*=u,_.elements[8]*=c,_.elements[9]*=c,_.elements[10]*=c,e.setFromRotationMatrix(_),r.x=i,r.y=o,r.z=a,this},makePerspective:function(t,e,r,n,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(e-t),u=2*i/(r-n),c=(e+t)/(e-t),l=(r+n)/(r-n),h=-(o+i)/(o-i),p=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=u,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,r,n,i,o){var a=this.elements,s=1/(e-t),u=1/(r-n),c=1/(o-i),l=(e+t)*s,h=(r+n)*u,p=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,r=t.elements,n=0;n<16;n++)if(e[n]!==r[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var r=0;r<16;r++)this.elements[r]=t[r+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t}});var M=new I,S=new g;function T(t,e,r,n){this._x=t||0,this._y=e||0,this._z=r||0,this._order=n||T.DefaultOrder}function P(){this.mask=1}T.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],T.DefaultOrder="XYZ",Object.defineProperties(T.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(T.prototype,{isEuler:!0,set:function(t,e,r,n){return this._x=t,this._y=e,this._z=r,this._order=n||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,r){var n=o.clamp,i=t.elements,a=i[0],s=i[4],u=i[8],c=i[1],l=i[5],h=i[9],p=i[2],d=i[6],f=i[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(n(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-n(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(u,f),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-p,a),this._z=0);break;case"ZXY":this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-p,f),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-n(p,-1,1)),Math.abs(p)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(n(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-p,a)):(this._x=0,this._y=Math.atan2(u,f));break;case"XZY":this._z=Math.asin(-n(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(u,a)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==r&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,r){return M.makeRotationFromQuaternion(t),this.setFromRotationMatrix(M,e,r)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return S.setFromEuler(this),this.setFromQuaternion(S,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new v(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(P.prototype,{set:function(t){this.mask=1<1){for(var e=0;e1){for(var e=0;e0)for(n.children=[],s=0;s0&&(r.geometries=h),p.length>0&&(r.materials=p),d.length>0&&(r.textures=d),f.length>0&&(r.images=f),a.length>0&&(r.shapes=a)}return r.object=n,r;function g(t){var e=[];for(var r in t){var n=t[r];delete n.metadata,e.push(n)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var r=0;rs)return!1}return!0}Object.assign(ot.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=t.length;si&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,r,n),this.max.set(i,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=t.count;si&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,r,n),this.max.set(i,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new v),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,W),W.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,r;return t.normal.x>0?(e=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),e<=-t.constant&&r>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(et),rt.subVectors(this.max,et),X.subVectors(t.a,et),Z.subVectors(t.b,et),K.subVectors(t.c,et),J.subVectors(Z,X),$.subVectors(K,Z),tt.subVectors(X,K);var e=[0,-J.z,J.y,0,-$.z,$.y,0,-tt.z,tt.y,J.z,0,-J.x,$.z,0,-$.x,tt.z,0,-tt.x,-J.y,J.x,0,-$.y,$.x,0,-tt.y,tt.x,0];return!!at(e,X,Z,K,rt)&&!!at(e=[1,0,0,0,1,0,0,0,1],X,Z,K,rt)&&(nt.crossVectors(J,$),at(e=[nt.x,nt.y,nt.z],X,Z,K,rt))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new v),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return W.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(W).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(q[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),q[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),q[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),q[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),q[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),q[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),q[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),q[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(q)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var st=new ot;function ut(t,e){this.center=void 0!==t?t:new v,this.radius=void 0!==e?e:-1}Object.assign(ut.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var r=this.center;void 0!==e?r.copy(e):st.setFromPoints(t).getCenter(r);for(var n=0,i=0,o=t.length;ithis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new ot),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var ct=new v,lt=new v,ht=new v,pt=new v,dt=new v,ft=new v,gt=new v;function mt(t,e){this.origin=void 0!==t?t:new v,this.direction=void 0!==e?e:new v(0,0,-1)}Object.assign(mt.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new v),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,ct)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new v),e.subVectors(t,this.origin);var r=e.dot(this.direction);return r<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var e=ct.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ct.copy(this.direction).multiplyScalar(e).add(this.origin),ct.distanceToSquared(t))},distanceSqToSegment:function(t,e,r,n){lt.copy(t).add(e).multiplyScalar(.5),ht.copy(e).sub(t).normalize(),pt.copy(this.origin).sub(lt);var i,o,a,s,u=.5*t.distanceTo(e),c=-this.direction.dot(ht),l=pt.dot(this.direction),h=-pt.dot(ht),p=pt.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(o=c*l-h,s=u*d,(i=c*h-l)>=0)if(o>=-s)if(o<=s){var f=1/d;a=(i*=f)*(i+c*(o*=f)+2*l)+o*(c*i+o+2*h)+p}else o=u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+p;else o=-u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+p;else o<=-s?a=-(i=Math.max(0,-(-c*u+l)))*i+(o=i>0?-u:Math.min(Math.max(-u,-h),u))*(o+2*h)+p:o<=s?(i=0,a=(o=Math.min(Math.max(-u,-h),u))*(o+2*h)+p):a=-(i=Math.max(0,-(c*u+l)))*i+(o=i>0?u:Math.min(Math.max(-u,-h),u))*(o+2*h)+p;else o=c>0?-u:u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+p;return r&&r.copy(this.direction).multiplyScalar(i).add(this.origin),n&&n.copy(ht).multiplyScalar(o).add(lt),a},intersectSphere:function(t,e){ct.subVectors(t.center,this.origin);var r=ct.dot(this.direction),n=ct.dot(ct)-r*r,i=t.radius*t.radius;if(n>i)return null;var o=Math.sqrt(i-n),a=r-o,s=r+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null},intersectPlane:function(t,e){var r=this.distanceToPlane(t);return null===r?null:this.at(r,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var r,n,i,o,a,s,u=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,h=this.origin;return u>=0?(r=(t.min.x-h.x)*u,n=(t.max.x-h.x)*u):(r=(t.max.x-h.x)*u,n=(t.min.x-h.x)*u),c>=0?(i=(t.min.y-h.y)*c,o=(t.max.y-h.y)*c):(i=(t.max.y-h.y)*c,o=(t.min.y-h.y)*c),r>o||i>n?null:((i>r||r!=r)&&(r=i),(o=0?(a=(t.min.z-h.z)*l,s=(t.max.z-h.z)*l):(a=(t.max.z-h.z)*l,s=(t.min.z-h.z)*l),r>s||a>n?null:((a>r||r!=r)&&(r=a),(s=0?r:n,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,ct)},intersectTriangle:function(t,e,r,n,i){dt.subVectors(e,t),ft.subVectors(r,t),gt.crossVectors(dt,ft);var o,a=this.direction.dot(gt);if(a>0){if(n)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}pt.subVectors(this.origin,t);var s=o*this.direction.dot(ft.crossVectors(pt,ft));if(s<0)return null;var u=o*this.direction.dot(dt.cross(pt));if(u<0)return null;if(s+u>a)return null;var c=-o*pt.dot(gt);return c<0?null:this.at(c/a,i)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});var yt=new v,vt=new v,At=new u;function _t(t,e){this.normal=void 0!==t?t:new v(1,0,0),this.constant=void 0!==e?e:0}Object.assign(_t.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,r,n){return this.normal.set(t,e,r),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,r){var n=yt.subVectors(r,e).cross(vt.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new v),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new v);var r=t.delta(yt),n=this.normal.dot(r);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var i=-(t.start.dot(this.normal)+this.constant)/n;return i<0||i>1?void 0:e.copy(r).multiplyScalar(i).add(t.start)},intersectsLine:function(t){var e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new v),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var r=e||At.getNormalMatrix(t),n=this.coplanarPoint(yt).applyMatrix4(t),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var bt=new v,xt=new v,wt=new v,Ct=new v,Et=new v,It=new v,Mt=new v,St=new v,Tt=new v,Pt=new v;function Ot(t,e,r){this.a=void 0!==t?t:new v,this.b=void 0!==e?e:new v,this.c=void 0!==r?r:new v}Object.assign(Ot,{getNormal:function(t,e,r,n){void 0===n&&(console.warn("THREE.Triangle: .getNormal() target is now required"),n=new v),n.subVectors(r,e),bt.subVectors(t,e),n.cross(bt);var i=n.lengthSq();return i>0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)},getBarycoord:function(t,e,r,n,i){bt.subVectors(n,e),xt.subVectors(r,e),wt.subVectors(t,e);var o=bt.dot(bt),a=bt.dot(xt),s=bt.dot(wt),u=xt.dot(xt),c=xt.dot(wt),l=o*u-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new v),0===l)return i.set(-2,-1,-1);var h=1/l,p=(u*s-a*c)*h,d=(o*c-a*s)*h;return i.set(1-p-d,d,p)},containsPoint:function(t,e,r,n){return Ot.getBarycoord(t,e,r,n,Ct),Ct.x>=0&&Ct.y>=0&&Ct.x+Ct.y<=1},getUV:function(t,e,r,n,i,o,a,s){return this.getBarycoord(t,e,r,n,Ct),s.set(0,0),s.addScaledVector(i,Ct.x),s.addScaledVector(o,Ct.y),s.addScaledVector(a,Ct.z),s},isFrontFacing:function(t,e,r,n){return bt.subVectors(r,e),xt.subVectors(t,e),bt.cross(xt).dot(n)<0}}),Object.assign(Ot.prototype,{set:function(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this},setFromPointsAndIndices:function(t,e,r,n){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return bt.subVectors(this.c,this.b),xt.subVectors(this.a,this.b),.5*bt.cross(xt).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new v),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return Ot.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new _t),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return Ot.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,r,n,i){return Ot.getUV(t,this.a,this.b,this.c,e,r,n,i)},containsPoint:function(t){return Ot.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return Ot.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new v);var r,n,i=this.a,o=this.b,a=this.c;Et.subVectors(o,i),It.subVectors(a,i),St.subVectors(t,i);var s=Et.dot(St),u=It.dot(St);if(s<=0&&u<=0)return e.copy(i);Tt.subVectors(t,o);var c=Et.dot(Tt),l=It.dot(Tt);if(c>=0&&l<=c)return e.copy(o);var h=s*l-c*u;if(h<=0&&s>=0&&c<=0)return r=s/(s-c),e.copy(i).addScaledVector(Et,r);Pt.subVectors(t,a);var p=Et.dot(Pt),d=It.dot(Pt);if(d>=0&&p<=d)return e.copy(a);var f=p*u-s*d;if(f<=0&&u>=0&&d<=0)return n=u/(u-d),e.copy(i).addScaledVector(It,n);var g=c*d-p*l;if(g<=0&&l-c>=0&&p-d>=0)return Mt.subVectors(a,o),n=(l-c)/(l-c+(p-d)),e.copy(o).addScaledVector(Mt,n);var m=1/(g+f+h);return r=f*m,n=h*m,e.copy(i).addScaledVector(Et,r).addScaledVector(It,n)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var Lt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},kt={h:0,s:0,l:0},Rt={h:0,s:0,l:0};function Dt(t,e,r){return void 0===e&&void 0===r?this.set(t):this.setRGB(t,e,r)}function Bt(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+6*(e-t)*(2/3-r):t}function Nt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ft(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function jt(t,e,r,n,i,o){this.a=t,this.b=e,this.c=r,this.normal=n&&n.isVector3?n:new v,this.vertexNormals=Array.isArray(n)?n:[],this.color=i&&i.isColor?i:new Dt,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}Object.assign(Dt.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,r){return this.r=t,this.g=e,this.b=r,this},setHSL:function(t,e,r){if(t=o.euclideanModulo(t,1),e=o.clamp(e,0,1),r=o.clamp(r,0,1),0===e)this.r=this.g=this.b=r;else{var n=r<=.5?r*(1+e):r+e-r*e,i=2*r-n;this.r=Bt(i,n,t+1/3),this.g=Bt(i,n,t),this.b=Bt(i,n,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,i=r[1],o=r[2];switch(i){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,u=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(a,s,u)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(t)){var c=r[1],l=c.length;if(3===l)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},setColorName:function(t){var e=Lt[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var r=e>0?1/e:1;return this.r=Math.pow(t.r,r),this.g=Math.pow(t.g,r),this.b=Math.pow(t.b,r),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=Nt(t.r),this.g=Nt(t.g),this.b=Nt(t.b),this},copyLinearToSRGB:function(t){return this.r=Ft(t.r),this.g=Ft(t.g),this.b=Ft(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,r,n=this.r,i=this.g,o=this.b,a=Math.max(n,i,o),s=Math.min(n,i,o),u=(s+a)/2;if(s===a)e=0,r=0;else{var c=a-s;switch(r=u<=.5?c/(a+s):c/(2-a-s),a){case n:e=(i-o)/c+(i0&&(r.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(r.morphTargets=!0),!0===this.morphNormals&&(r.morphNormals=!0),!0===this.skinning&&(r.skinning=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),e){var i=n(t.textures),o=n(t.images);i.length>0&&(r.textures=i),o.length>0&&(r.images=o)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,r=null;if(null!==e){var n=e.length;r=new Array(n);for(var i=0;i!==n;++i)r[i]=e[i].clone()}return this.clippingPlanes=r,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Ut.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Gt.prototype=Object.create(Ut.prototype),Gt.prototype.constructor=Gt,Gt.prototype.isMeshBasicMaterial=!0,Gt.prototype.copy=function(t){return Ut.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var Ht=new v;function Vt(t,e,r){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===r,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function Qt(t,e,r){Vt.call(this,new Int8Array(t),e,r)}function qt(t,e,r){Vt.call(this,new Uint8Array(t),e,r)}function Wt(t,e,r){Vt.call(this,new Uint8ClampedArray(t),e,r)}function Yt(t,e,r){Vt.call(this,new Int16Array(t),e,r)}function Xt(t,e,r){Vt.call(this,new Uint16Array(t),e,r)}function Zt(t,e,r){Vt.call(this,new Int32Array(t),e,r)}function Kt(t,e,r){Vt.call(this,new Uint32Array(t),e,r)}function Jt(t,e,r){Vt.call(this,new Float32Array(t),e,r)}function $t(t,e,r){Vt.call(this,new Float64Array(t),e,r)}function te(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function ee(t){if(0===t.length)return-1/0;for(var e=t[0],r=1,n=t.length;re&&(e=t[r]);return e}Object.defineProperty(Vt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Vt.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,r){t*=this.itemSize,r*=e.itemSize;for(var n=0,i=this.itemSize;n0,s=i[1]&&i[1].length>0,u=t.morphTargets,c=u.length;if(c>0){e=[];for(var l=0;l0){for(h=[],l=0;l0&&0===r.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),l=0;l65535?Kt:Xt)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,r){this.groups.push({start:t,count:e,materialIndex:void 0!==r?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var r=this.attributes.normal;if(void 0!==r){var n=(new u).getNormalMatrix(t);r.applyNormalMatrix(n),r.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return ne.makeRotationX(t),this.applyMatrix4(ne),this},rotateY:function(t){return ne.makeRotationY(t),this.applyMatrix4(ne),this},rotateZ:function(t){return ne.makeRotationZ(t),this.applyMatrix4(ne),this},translate:function(t,e,r){return ne.makeTranslation(t,e,r),this.applyMatrix4(ne),this},scale:function(t,e,r){return ne.makeScale(t,e,r),this.applyMatrix4(ne),this},lookAt:function(t){return ie.lookAt(t),ie.updateMatrix(),this.applyMatrix4(ie.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(oe).negate(),this.translate(oe.x,oe.y,oe.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var r=new Jt(3*e.vertices.length,3),n=new Jt(3*e.colors.length,3);if(this.setAttribute("position",r.copyVector3sArray(e.vertices)),this.setAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new Jt(e.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],r=0,n=t.length;r0){var r=new Float32Array(3*t.normals.length);this.setAttribute("normal",new Vt(r,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.setAttribute("color",new Vt(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new Vt(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new Vt(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],u=t.morphTargets[a],c=0,l=u.length;c0){var d=new Jt(4*t.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new Jt(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new ot);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var r=0,n=e.length;r0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}t.data={attributes:{}};var n=this.index;null!==n&&(t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var i=this.attributes;for(var r in i){var o=(p=i[r]).toJSON();""!==p.name&&(o.name=p.name),t.data.attributes[r]=o}var a={},s=!1;for(var r in this.morphAttributes){for(var u=this.morphAttributes[r],c=[],l=0,h=u.length;l0&&(a[r]=c,s=!0)}s&&(t.data.morphAttributes=a,t.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(t.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new ce).copy(this)},copy:function(t){var e,r,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var o=t.attributes;for(e in o){var a=o[e];this.setAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var u=[],c=s[e];for(r=0,n=c.length;rr.far?null:{distance:u,point:Ie.clone(),object:t}}function Te(t,e,r,n,i,o,s,u,c,l,h,p){de.fromBufferAttribute(i,l),fe.fromBufferAttribute(i,h),ge.fromBufferAttribute(i,p);var d=t.morphTargetInfluences;if(e.morphTargets&&o&&d){Ae.set(0,0,0),_e.set(0,0,0),be.set(0,0,0);for(var f=0,g=o.length;f0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var r,n=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===n.boundingSphere&&n.computeBoundingSphere(),pe.copy(n.boundingSphere),pe.applyMatrix4(o),!1!==t.ray.intersectsSphere(pe)&&(le.getInverse(o),he.copy(t.ray).applyMatrix4(le),null===n.boundingBox||!1!==he.intersectsBox(n.boundingBox))))if(n.isBufferGeometry){var s,u,c,l,h,p,d,f,g,m=n.index,y=n.attributes.position,v=n.morphAttributes.position,A=n.morphTargetsRelative,_=n.attributes.uv,b=n.attributes.uv2,x=n.groups,w=n.drawRange;if(null!==m)if(Array.isArray(i))for(l=0,p=x.length;l0&&(M=O);for(var L=0,k=P.length;L0)for(l=0;l0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,r;for(this.computeFaceNormals(),t=0,e=this.faces.length;t0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,r,n,i;for(r=0,n=this.faces.length;r=0;r--){var f=p[r];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a0,m=d.vertexNormals.length>0,y=1!==d.color.r||1!==d.color.g||1!==d.color.b,v=d.vertexColors.length>0,A=0;if(A=w(A,0,0),A=w(A,1,!0),A=w(A,2,!1),A=w(A,3,f),A=w(A,4,g),A=w(A,5,m),A=w(A,6,y),A=w(A,7,v),a.push(A),a.push(d.a,d.b,d.c),a.push(d.materialIndex),f){var _=this.faceVertexUvs[0][i];a.push(I(_[0]),I(_[1]),I(_[2]))}if(g&&a.push(C(d.normal)),m){var b=d.vertexNormals;a.push(C(b[0]),C(b[1]),C(b[2]))}if(y&&a.push(E(d.color)),v){var x=d.vertexColors;a.push(E(x[0]),E(x[1]),E(x[2]))}}function w(t,e,r){return r?t|1<0&&(t.data.colors=c),h.length>0&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new Re).copy(this)},copy:function(t){var e,r,n,i,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,r=s.length;e0?1:-1,l.push(S.x,S.y,S.z),h.push(O/g),h.push(1-T/m),I+=1}for(var k=0;k0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var i={};for(var o in this.extensions)!0===this.extensions[o]&&(i[o]=!0);return Object.keys(i).length>0&&(e.extensions=i),e},Ue.prototype=Object.assign(Object.create(V.prototype),{constructor:Ue,isCamera:!0,copy:function(t,e){return V.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new v),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){V.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){V.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Ge.prototype=Object.assign(Object.create(Ue.prototype),{constructor:Ge,isPerspectiveCamera:!0,copy:function(t,e){return Ue.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*o.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*o.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*o.RAD2DEG*Math.atan(Math.tan(.5*o.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,r,n,i,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*o.DEG2RAD*this.fov)/this.zoom,r=2*e,n=this.aspect*r,i=-.5*n,a=this.view;if(null!==this.view&&this.view.enabled){var s=a.fullWidth,u=a.fullHeight;i+=a.offsetX*n/s,e-=a.offsetY*r/u,n*=a.width/s,r*=a.height/u}var c=this.filmOffset;0!==c&&(i+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,e,e-r,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=V.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),He.prototype=Object.create(V.prototype),He.prototype.constructor=He,Ve.prototype=Object.create(d.prototype),Ve.prototype.constructor=Ve,Ve.prototype.isWebGLCubeRenderTarget=!0,Ve.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var r=new Q,n={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include ","\t#include ","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#include ","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV = equirectUv( direction );","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new ze({type:"CubemapFromEquirect",uniforms:Ne(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=e;var o=new Me(new Be(5,5,5),i);return r.add(o),new He(1,10,this).update(t,r),o.geometry.dispose(),o.material.dispose(),this},Qe.prototype=Object.create(h.prototype),Qe.prototype.constructor=Qe,Qe.prototype.isDataTexture=!0;var qe=new ut,We=new v;function Ye(t,e,r,n,i,o){this.planes=[void 0!==t?t:new _t,void 0!==e?e:new _t,void 0!==r?r:new _t,void 0!==n?n:new _t,void 0!==i?i:new _t,void 0!==o?o:new _t]}Object.assign(Ye.prototype,{set:function(t,e,r,n,i,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(r),a[3].copy(n),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,r=0;r<6;r++)e[r].copy(t.planes[r]);return this},setFromProjectionMatrix:function(t){var e=this.planes,r=t.elements,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],c=r[6],l=r[7],h=r[8],p=r[9],d=r[10],f=r[11],g=r[12],m=r[13],y=r[14],v=r[15];return e[0].setComponents(a-n,l-s,f-h,v-g).normalize(),e[1].setComponents(a+n,l+s,f+h,v+g).normalize(),e[2].setComponents(a+i,l+u,f+p,v+m).normalize(),e[3].setComponents(a-i,l-u,f-p,v-m).normalize(),e[4].setComponents(a-o,l-c,f-d,v-y).normalize(),e[5].setComponents(a+o,l+c,f+d,v+y).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),qe.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(qe)},intersectsSprite:function(t){return qe.center.set(0,0,0),qe.radius=.7071067811865476,qe.applyMatrix4(t.matrixWorld),this.intersectsSphere(qe)},intersectsSphere:function(t){for(var e=this.planes,r=t.center,n=-t.radius,i=0;i<6;i++)if(e[i].distanceToPoint(r)0?t.max.x:t.min.x,We.y=n.normal.y>0?t.max.y:t.min.y,We.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(We)<0)return!1}return!0},containsPoint:function(t){for(var e=this.planes,r=0;r<6;r++)if(e[r].distanceToPoint(t)<0)return!1;return!0}});var Xe={common:{diffuse:{value:new Dt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new u},uv2Transform:{value:new u},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new a(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Dt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Dt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new u}},sprite:{diffuse:{value:new Dt(15658734)},opacity:{value:1},center:{value:new a(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new u}}};function Ze(){var t=null,e=!1,r=null;function n(i,o){!1!==e&&(r(i,o),t.requestAnimationFrame(n))}return{start:function(){!0!==e&&null!==r&&(t.requestAnimationFrame(n),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){r=t},setContext:function(e){t=e}}}function Ke(t,e){var r=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var r=n.get(e);r&&(t.deleteBuffer(r.buffer),n.delete(e))},update:function(e,i){e.isInterleavedBufferAttribute&&(e=e.data);var o=n.get(e);void 0===o?n.set(e,function(e,r){var n=e.array,i=e.usage,o=t.createBuffer();t.bindBuffer(r,o),t.bufferData(r,n,i),e.onUploadCallback();var a=5126;return n instanceof Float32Array?a=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?a=5123:n instanceof Int16Array?a=5122:n instanceof Uint32Array?a=5125:n instanceof Int32Array?a=5124:n instanceof Int8Array?a=5120:n instanceof Uint8Array&&(a=5121),{buffer:o,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}(e,i)):o.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x); } else if (face == 1.0) {\n uv = vec2(-direction.x, -direction.z) / abs(direction.y); } else if (face == 2.0) {\n uv = vec2(-direction.x, direction.y) / abs(direction.z); } else if (face == 3.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x); } else if (face == 4.0) {\n uv = vec2(-direction.x, direction.z) / abs(direction.y); } else {\n uv = vec2(direction.x, direction.y) / abs(direction.z); }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},er={basic:{uniforms:Fe([Xe.common,Xe.specularmap,Xe.envmap,Xe.aomap,Xe.lightmap,Xe.fog]),vertexShader:tr.meshbasic_vert,fragmentShader:tr.meshbasic_frag},lambert:{uniforms:Fe([Xe.common,Xe.specularmap,Xe.envmap,Xe.aomap,Xe.lightmap,Xe.emissivemap,Xe.fog,Xe.lights,{emissive:{value:new Dt(0)}}]),vertexShader:tr.meshlambert_vert,fragmentShader:tr.meshlambert_frag},phong:{uniforms:Fe([Xe.common,Xe.specularmap,Xe.envmap,Xe.aomap,Xe.lightmap,Xe.emissivemap,Xe.bumpmap,Xe.normalmap,Xe.displacementmap,Xe.fog,Xe.lights,{emissive:{value:new Dt(0)},specular:{value:new Dt(1118481)},shininess:{value:30}}]),vertexShader:tr.meshphong_vert,fragmentShader:tr.meshphong_frag},standard:{uniforms:Fe([Xe.common,Xe.envmap,Xe.aomap,Xe.lightmap,Xe.emissivemap,Xe.bumpmap,Xe.normalmap,Xe.displacementmap,Xe.roughnessmap,Xe.metalnessmap,Xe.fog,Xe.lights,{emissive:{value:new Dt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:tr.meshphysical_vert,fragmentShader:tr.meshphysical_frag},toon:{uniforms:Fe([Xe.common,Xe.specularmap,Xe.aomap,Xe.lightmap,Xe.emissivemap,Xe.bumpmap,Xe.normalmap,Xe.displacementmap,Xe.gradientmap,Xe.fog,Xe.lights,{emissive:{value:new Dt(0)},specular:{value:new Dt(1118481)},shininess:{value:30}}]),vertexShader:tr.meshtoon_vert,fragmentShader:tr.meshtoon_frag},matcap:{uniforms:Fe([Xe.common,Xe.bumpmap,Xe.normalmap,Xe.displacementmap,Xe.fog,{matcap:{value:null}}]),vertexShader:tr.meshmatcap_vert,fragmentShader:tr.meshmatcap_frag},points:{uniforms:Fe([Xe.points,Xe.fog]),vertexShader:tr.points_vert,fragmentShader:tr.points_frag},dashed:{uniforms:Fe([Xe.common,Xe.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:tr.linedashed_vert,fragmentShader:tr.linedashed_frag},depth:{uniforms:Fe([Xe.common,Xe.displacementmap]),vertexShader:tr.depth_vert,fragmentShader:tr.depth_frag},normal:{uniforms:Fe([Xe.common,Xe.bumpmap,Xe.normalmap,Xe.displacementmap,{opacity:{value:1}}]),vertexShader:tr.normal_vert,fragmentShader:tr.normal_frag},sprite:{uniforms:Fe([Xe.sprite,Xe.fog]),vertexShader:tr.sprite_vert,fragmentShader:tr.sprite_frag},background:{uniforms:{uvTransform:{value:new u},t2D:{value:null}},vertexShader:tr.background_vert,fragmentShader:tr.background_frag},cube:{uniforms:Fe([Xe.envmap,{opacity:{value:1}}]),vertexShader:tr.cube_vert,fragmentShader:tr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:tr.equirect_vert,fragmentShader:tr.equirect_frag},distanceRGBA:{uniforms:Fe([Xe.common,Xe.displacementmap,{referencePosition:{value:new v},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:tr.distanceRGBA_vert,fragmentShader:tr.distanceRGBA_frag},shadow:{uniforms:Fe([Xe.lights,Xe.fog,{color:{value:new Dt(0)},opacity:{value:1}}]),vertexShader:tr.shadow_vert,fragmentShader:tr.shadow_frag}};function rr(t,e,r,n){var i,o,a=new Dt(0),s=0,u=null,c=0,l=null;function h(t,r){e.buffers.color.setClear(t.r,t.g,t.b,r,n)}return{getClearColor:function(){return a},setClearColor:function(t,e){a.set(t),h(a,s=void 0!==e?e:1)},getClearAlpha:function(){return s},setClearAlpha:function(t){h(a,s=t)},render:function(e,n,p,d){var f=n.background,g=t.xr,m=g.getSession&&g.getSession();if(m&&"additive"===m.environmentBlendMode&&(f=null),null===f?h(a,s):f&&f.isColor&&(h(f,1),d=!0),(t.autoClear||d)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||306===f.mapping)){void 0===o&&((o=new Me(new Be(1,1,1),new ze({type:"BackgroundCubeMaterial",uniforms:Ne(er.cube.uniforms),vertexShader:er.cube.vertexShader,fragmentShader:er.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(o));var y=f.isWebGLCubeRenderTarget?f.texture:f;o.material.uniforms.envMap.value=y,o.material.uniforms.flipEnvMap.value=y.isCubeTexture?-1:1,u===f&&c===y.version&&l===t.toneMapping||(o.material.needsUpdate=!0,u=f,c=y.version,l=t.toneMapping),e.unshift(o,o.geometry,o.material,0,0,null)}else f&&f.isTexture&&(void 0===i&&((i=new Me(new $e(2,2),new ze({type:"BackgroundMaterial",uniforms:Ne(er.background.uniforms),vertexShader:er.background.vertexShader,fragmentShader:er.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(i.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(i)),i.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),i.material.uniforms.uvTransform.value.copy(f.matrix),u===f&&c===f.version&&l===t.toneMapping||(i.material.needsUpdate=!0,u=f,c=f.version,l=t.toneMapping),e.unshift(i,i.geometry,i.material,0,0,null))}}}function nr(t,e,r,n){var i,o=n.isWebGL2;this.setMode=function(t){i=t},this.render=function(e,n){t.drawArrays(i,e,n),r.update(n,i)},this.renderInstances=function(n,a,s,u){if(0!==u){var c,l;if(o)c=t,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(c=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[l](i,a,s,u),r.update(s,i,u)}}}function ir(t,e,r){var n;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,a=void 0!==r.precision?r.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var u=!0===r.logarithmicDepthBuffer,c=t.getParameter(34930),l=t.getParameter(35660),h=t.getParameter(3379),p=t.getParameter(34076),d=t.getParameter(34921),f=t.getParameter(36347),g=t.getParameter(36348),m=t.getParameter(36349),y=l>0,v=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==n)return n;var r=e.get("EXT_texture_filter_anisotropic");return n=null!==r?t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:l,maxTextureSize:h,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:g,maxFragmentUniforms:m,vertexTextures:y,floatFragmentTextures:v,floatVertexTextures:y&&v,maxSamples:o?t.getParameter(36183):0}}function or(){var t=this,e=null,r=0,n=!1,i=!1,o=new _t,a=new u,s={value:null,needsUpdate:!1};function c(){s.value!==e&&(s.value=e,s.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function l(e,r,n,i){var u=null!==e?e.length:0,c=null;if(0!==u){if(c=s.value,!0!==i||null===c){var l=n+4*u,h=r.matrixWorldInverse;a.getNormalMatrix(h),(null===c||c.length65535?Kt:Xt)(r,1);d.version=a,e.update(d,34963);var f=i.get(t);f&&e.remove(f),i.set(t,d)}return{get:function(t,e){var i=n.get(e);return i||(e.addEventListener("dispose",o),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new ce).setFromObject(t)),i=e._bufferGeometry),n.set(e,i),r.memory.geometries++,i)},update:function(t){var r=t.index,n=t.attributes;for(var i in null!==r&&e.update(r,34963),n)e.update(n[i],34962);var o=t.morphAttributes;for(var i in o)for(var a=o[i],s=0,u=a.length;s0)return t;var i=e*r,o=_r[i];if(void 0===o&&(o=new Float32Array(i),_r[i]=o),0!==e){n.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=r,t[a].toArray(o,s)}return o}function Ir(t,e){if(t.length!==e.length)return!1;for(var r=0,n=t.length;r/gm;function xn(t){return t.replace(bn,wn)}function wn(t,e){var r=tr[e];if(void 0===r)throw new Error("Can not resolve #include <"+e+">");return xn(r)}var Cn=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,En=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function In(t){return t.replace(En,Sn).replace(Cn,Mn)}function Mn(t,e,r,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Sn(0,e,r,n)}function Sn(t,e,r,n){for(var i="",o=parseInt(e);o0?t.gammaFactor:1,y=r.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(vn).join("\n")}(r),v=function(t){var e=[];for(var r in t){var n=t[r];!1!==n&&e.push("#define "+r+" "+n)}return e.join("\n")}(c),A=u.createProgram();if(r.isRawShaderMaterial?((n=[v].filter(vn).join("\n")).length>0&&(n+="\n"),(i=[y,v].filter(vn).join("\n")).length>0&&(i+="\n")):(n=[Tn(r),"#define SHADER_NAME "+r.shaderName,v,r.instancing?"#define USE_INSTANCING":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+r.maxBones,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+f:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+p:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(vn).join("\n"),i=[y,Tn(r),"#define SHADER_NAME "+r.shaderName,v,r.alphaTest?"#define ALPHATEST "+r.alphaTest+(r.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+m,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+d:"",r.envMap?"#define "+f:"",r.envMap?"#define "+g:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.sheen?"#define USE_SHEEN":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+p:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensionShaderTextureLOD||r.envMap)&&r.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==r.toneMapping?"#define TONE_MAPPING":"",0!==r.toneMapping?tr.tonemapping_pars_fragment:"",0!==r.toneMapping?yn("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.outputEncoding||r.mapEncoding||r.matcapEncoding||r.envMapEncoding||r.emissiveMapEncoding||r.lightMapEncoding?tr.encodings_pars_fragment:"",r.mapEncoding?mn("mapTexelToLinear",r.mapEncoding):"",r.matcapEncoding?mn("matcapTexelToLinear",r.matcapEncoding):"",r.envMapEncoding?mn("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMapEncoding?mn("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.lightMapEncoding?mn("lightMapTexelToLinear",r.lightMapEncoding):"",r.outputEncoding?(o="linearToOutputTexel",a=r.outputEncoding,s=fn(a),"vec4 "+o+"( vec4 value ) { return LinearTo"+s[0]+s[1]+"; }"):"",r.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(vn).join("\n")),l=_n(l=An(l=xn(l),r),r),h=_n(h=An(h=xn(h),r),r),l=In(l),h=In(h),r.isWebGL2&&!r.isRawShaderMaterial){var _=!1,b=/^\s*#version\s+300\s+es\s*\n/;r.isShaderMaterial&&null!==l.match(b)&&null!==h.match(b)&&(_=!0,l=l.replace(b,""),h=h.replace(b,"")),n=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+n,i=["#version 300 es\n","#define varying in",_?"":"out highp vec4 pc_fragColor;",_?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+i}var x,w,C=i+h,E=pn(u,35633,n+l),I=pn(u,35632,C);if(u.attachShader(A,E),u.attachShader(A,I),void 0!==r.index0AttributeName?u.bindAttribLocation(A,0,r.index0AttributeName):!0===r.morphTargets&&u.bindAttribLocation(A,0,"position"),u.linkProgram(A),t.debug.checkShaderErrors){var M=u.getProgramInfoLog(A).trim(),S=u.getShaderInfoLog(E).trim(),T=u.getShaderInfoLog(I).trim(),P=!0,O=!0;if(!1===u.getProgramParameter(A,35714)){P=!1;var L=gn(u,E,"vertex"),k=gn(u,I,"fragment");console.error("THREE.WebGLProgram: shader error: ",u.getError(),"35715",u.getProgramParameter(A,35715),"gl.getProgramInfoLog",M,L,k)}else""!==M?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",M):""!==S&&""!==T||(O=!1);O&&(this.diagnostics={runnable:P,programLog:M,vertexShader:{log:S,prefix:n},fragmentShader:{log:T,prefix:i}})}return u.deleteShader(E),u.deleteShader(I),this.getUniforms=function(){return void 0===x&&(x=new hn(u,A)),x},this.getAttributes=function(){return void 0===w&&(w=function(t,e){for(var r={},n=t.getProgramParameter(e,35721),i=0;i0,maxBones:x,useVertexTexture:a,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:h.directional.length,numPointLights:h.point.length,numSpotLights:h.spot.length,numRectAreaLights:h.rectArea.length,numHemiLights:h.hemi.length,numDirLightShadows:h.directionalShadowMap.length,numPointLightShadows:h.pointShadowMap.length,numSpotLightShadows:h.spotShadowMap.length,numClippingPlanes:g,numClipIntersection:m,dithering:n.dithering,shadowMapEnabled:t.shadowMap.enabled&&d.length>0,shadowMapType:t.shadowMap.type,toneMapping:n.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:2===n.side,flipSided:1===n.side,depthPacking:void 0!==n.depthPacking&&n.depthPacking,index0AttributeName:n.index0AttributeName,extensionDerivatives:n.extensions&&n.extensions.derivatives,extensionFragDepth:n.extensions&&n.extensions.fragDepth,extensionDrawBuffers:n.extensions&&n.extensions.drawBuffers,extensionShaderTextureLOD:n.extensions&&n.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:i||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:i||null!==e.get("EXT_shader_texture_lod"),onBeforeCompile:n.onBeforeCompile}},this.getProgramCacheKey=function(e){var r=[];if(e.shaderID?r.push(e.shaderID):(r.push(e.fragmentShader),r.push(e.vertexShader)),void 0!==e.defines)for(var n in e.defines)r.push(n),r.push(e.defines[n]);if(void 0===e.isRawShaderMaterial){for(var i=0;i1&&r.sort(t||kn),n.length>1&&n.sort(e||Rn)}}}function Bn(){var t=new WeakMap;function e(r){var n=r.target;n.removeEventListener("dispose",e),t.delete(n)}return{get:function(r,n){var i,o=t.get(r);return void 0===o?(i=new Dn,t.set(r,new WeakMap),t.get(r).set(n,i),r.addEventListener("dispose",e)):void 0===(i=o.get(n))&&(i=new Dn,o.set(n,i)),i},dispose:function(){t=new WeakMap}}}function Nn(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var r;switch(e.type){case"DirectionalLight":r={direction:new v,color:new Dt};break;case"SpotLight":r={position:new v,direction:new v,color:new Dt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new v,color:new Dt,distance:0,decay:0};break;case"HemisphereLight":r={direction:new v,skyColor:new Dt,groundColor:new Dt};break;case"RectAreaLight":r={color:new Dt,position:new v,halfWidth:new v,halfHeight:new v}}return t[e.id]=r,r}}}var Fn=0;function jn(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function zn(){for(var t,e=new Nn,r=(t={},{get:function(e){if(void 0!==t[e.id])return t[e.id];var r;switch(e.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowRadius:1,shadowMapSize:new a};break;case"PointLight":r={shadowBias:0,shadowRadius:1,shadowMapSize:new a,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=r,r}}),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},i=0;i<9;i++)n.probe.push(new v);var o=new v,s=new I,u=new I;return{setup:function(t,i,a){for(var c=0,l=0,h=0,p=0;p<9;p++)n.probe[p].set(0,0,0);var d=0,f=0,g=0,m=0,y=0,v=0,A=0,_=0,b=a.matrixWorldInverse;t.sort(jn),p=0;for(var x=t.length;p\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),g=f.clone();g.defines.HORIZONAL_PASS=1;var m=new ce;m.setAttribute("position",new Vt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var y=new Me(m,f),v=this;function A(r,n){var i=e.update(y);f.uniforms.shadow_pass.value=r.map.texture,f.uniforms.resolution.value=r.mapSize,f.uniforms.radius.value=r.radius,t.setRenderTarget(r.mapPass),t.clear(),t.renderBufferDirect(n,null,i,f,y,null),g.uniforms.shadow_pass.value=r.mapPass.texture,g.uniforms.resolution.value=r.mapSize,g.uniforms.radius.value=r.radius,t.setRenderTarget(r.map),t.clear(),t.renderBufferDirect(n,null,i,g,y,null)}function _(t,e,r){var n=t<<0|e<<1|r<<2,i=u[n];return void 0===i&&(i=new Hn({depthPacking:3201,morphTargets:t,skinning:e}),u[n]=i),i}function b(t,e,r){var n=t<<0|e<<1|r<<2,i=c[n];return void 0===i&&(i=new Vn({morphTargets:t,skinning:e}),c[n]=i),i}function x(e,r,n,i,o,a,s){var u=null,c=_,p=e.customDepthMaterial;if(!0===i.isPointLight&&(c=b,p=e.customDistanceMaterial),void 0===p){var d=!1;!0===n.morphTargets&&(d=r.morphAttributes&&r.morphAttributes.position&&r.morphAttributes.position.length>0);var f=!1;!0===e.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),u=c(d,f,!0===e.isInstancedMesh)}else u=p;if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var g=u.uuid,m=n.uuid,y=l[g];void 0===y&&(y={},l[g]=y);var v=y[m];void 0===v&&(v=u.clone(),y[m]=v),u=v}return u.visible=n.visible,u.wireframe=n.wireframe,u.side=3===s?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],u.clipShadows=n.clipShadows,u.clippingPlanes=n.clippingPlanes,u.clipIntersection=n.clipIntersection,u.wireframeLinewidth=n.wireframeLinewidth,u.linewidth=n.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=o,u.farDistance=a),u}function w(r,i,o,a,s){if(!1!==r.visible){if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&3===s)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,r.matrixWorld);var u=e.update(r),c=r.material;if(Array.isArray(c))for(var l=u.groups,h=0,p=l.length;hr||i.y>r)&&(i.x>r&&(o.x=Math.floor(r/_.x),i.x=o.x*_.x,y.mapSize.x=o.x),i.y>r&&(o.y=Math.floor(r/_.y),i.y=o.y*_.y,y.mapSize.y=o.y)),null===y.map&&!y.isPointLightShadow&&3===this.type){var b={minFilter:1006,magFilter:1006,format:1023};y.map=new d(i.x,i.y,b),y.map.texture.name=m.name+".shadowMap",y.mapPass=new d(i.x,i.y,b),y.camera.updateProjectionMatrix()}null===y.map&&(b={minFilter:1003,magFilter:1003,format:1023},y.map=new d(i.x,i.y,b),y.map.texture.name=m.name+".shadowMap",y.camera.updateProjectionMatrix()),t.setRenderTarget(y.map),t.clear();for(var x=y.getViewportCount(),C=0;C=1):-1!==O.indexOf("OpenGL ES")&&(P=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(O)[1]),T=P>=2);var L=null,k={},R=new p,D=new p;function B(e,r,n){var i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;an||t.height>n)&&(i=n/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var a=e?o.floorPowerOfTwo:Math.floor,s=a(i*t.width),c=a(i*t.height);void 0===u&&(u=m(s,c));var l=r?m(s,c):u;return l.width=s,l.height=c,l.getContext("2d").drawImage(t,0,0,s,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+c+")."),l}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function v(t){return o.isPowerOfTwo(t.width)&&o.isPowerOfTwo(t.height)}function A(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function _(e,r,i,o){t.generateMipmap(e),n.get(r).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function b(r,n,i){if(!1===c)return n;if(null!==r){if(void 0!==t[r])return t[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}var o=n;return 6403===n&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===n&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===n&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function x(t){return 1003===t||1004===t||1005===t?9728:9729}function w(e){var r=e.target;r.removeEventListener("dispose",w),function(e){var r=n.get(e);void 0!==r.__webglInit&&(t.deleteTexture(r.__webglTexture),n.remove(e))}(r),r.isVideoTexture&&f.delete(r),s.memory.textures--}function C(e){var r=e.target;r.removeEventListener("dispose",C),function(e){var r=n.get(e),i=n.get(e.texture);if(e){if(void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)t.deleteFramebuffer(r.__webglFramebuffer[o]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[o]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&t.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer);n.remove(e.texture),n.remove(e)}}(r),s.memory.textures--}var E=0;function I(t,e){var i=n.get(t);if(t.isVideoTexture&&function(t){var e=s.render.frame;f.get(t)!==e&&(f.set(t,e),t.update())}(t),t.version>0&&i.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void k(i,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.activeTexture(33984+e),r.bindTexture(3553,i.__webglTexture)}function M(e,i){if(6===e.image.length){var o=n.get(e);if(e.version>0&&o.__version!==e.version){L(o,e),r.activeTexture(33984+i),r.bindTexture(34067,o.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),u=e.image[0]&&e.image[0].isDataTexture,l=[],p=0;p<6;p++)l[p]=s||u?u?e.image[p].image:e.image[p]:y(e.image[p],!1,!0,h);var d,f=l[0],g=v(f)||c,m=a.convert(e.format),x=a.convert(e.type),w=b(e.internalFormat,m,x);if(O(34067,e,g),s){for(p=0;p<6;p++){d=l[p].mipmaps;for(var C=0;C1||n.get(o).__currentAnisotropy)&&(t.texParameterf(r,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function L(e,r){void 0===e.__webglInit&&(e.__webglInit=!0,r.addEventListener("dispose",w),e.__webglTexture=t.createTexture(),s.memory.textures++)}function k(e,n,i){var o=3553;n.isDataTexture2DArray&&(o=35866),n.isDataTexture3D&&(o=32879),L(e,n),r.activeTexture(33984+i),r.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);var s=function(t){return!c&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(n)&&!1===v(n.image),u=y(n.image,s,!1,p),l=v(u)||c,h=a.convert(n.format),d=a.convert(n.type),f=b(n.internalFormat,h,d);O(o,n,l);var g,m=n.mipmaps;if(n.isDepthTexture)f=6402,c?f=1015===n.type?36012:1014===n.type?33190:1020===n.type?35056:33189:1015===n.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===n.format&&6402===f&&1012!==n.type&&1014!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=1012,d=a.convert(n.type)),1027===n.format&&6402===f&&(f=34041,1020!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=1020,d=a.convert(n.type))),r.texImage2D(3553,0,f,u.width,u.height,0,h,d,null);else if(n.isDataTexture)if(m.length>0&&l){for(var x=0,w=m.length;x0&&l){for(x=0,w=m.length;x=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),E+=1,t},this.resetTextureUnits=function(){E=0},this.setTexture2D=I,this.setTexture2DArray=function(t,e){var i=n.get(t);t.version>0&&i.__version!==t.version?k(i,t,e):(r.activeTexture(33984+e),r.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){var i=n.get(t);t.version>0&&i.__version!==t.version?k(i,t,e):(r.activeTexture(33984+e),r.bindTexture(32879,i.__webglTexture))},this.setTextureCube=M,this.setTextureCubeDynamic=S,this.setupRenderTarget=function(e){var i=n.get(e),o=n.get(e.texture);e.addEventListener("dispose",C),o.__webglTexture=t.createTexture(),s.memory.textures++;var u=!0===e.isWebGLCubeRenderTarget,l=!0===e.isWebGLMultisampleRenderTarget,h=v(e)||c;if(!c||1022!==e.texture.format||1015!==e.texture.type&&1016!==e.texture.type||(e.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),u){i.__webglFramebuffer=[];for(var p=0;p<6;p++)i.__webglFramebuffer[p]=t.createFramebuffer()}else if(i.__webglFramebuffer=t.createFramebuffer(),l)if(c){i.__webglMultisampledFramebuffer=t.createFramebuffer(),i.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var d=a.convert(e.texture.format),f=a.convert(e.texture.type),g=b(e.texture.internalFormat,d,f),m=N(e);t.renderbufferStorageMultisample(36161,m,g,e.width,e.height),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(i.__webglDepthRenderbuffer=t.createRenderbuffer(),D(i.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(u){for(r.bindTexture(34067,o.__webglTexture),O(34067,e.texture,h),p=0;p<6;p++)R(i.__webglFramebuffer[p],e,36064,34069+p);A(e.texture,h)&&_(34067,e.texture,e.width,e.height),r.bindTexture(34067,null)}else r.bindTexture(3553,o.__webglTexture),O(3553,e.texture,h),R(i.__webglFramebuffer,e,36064,3553),A(e.texture,h)&&_(3553,e.texture,e.width,e.height),r.bindTexture(3553,null);e.depthBuffer&&B(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(A(e,v(t)||c)){var i=t.isWebGLCubeRenderTarget?34067:3553,o=n.get(e).__webglTexture;r.bindTexture(i,o),_(i,e,t.width,t.height),r.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(c){var r=n.get(e);t.bindFramebuffer(36008,r.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,r.__webglFramebuffer);var i=e.width,o=e.height,a=16384;e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024),t.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),t.bindFramebuffer(36160,r.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),I(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===j&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),j=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?M(t,e):S(t,e)}}function Yn(t,e,r){var n=r.isWebGL2;return{convert:function(t){var r;if(1009===t)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(1012===t)return 5123;if(1013===t)return 5124;if(1014===t)return 5125;if(1015===t)return 5126;if(1016===t)return n?5131:null!==(r=e.get("OES_texture_half_float"))?r.HALF_FLOAT_OES:null;if(1021===t)return 6406;if(1022===t)return 6407;if(1023===t)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(1026===t)return 6402;if(1027===t)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(null===(r=e.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===t)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(null===(r=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===t)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return null!==(r=e.get("WEBGL_compressed_texture_etc1"))?r.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&null!==(r=e.get("WEBGL_compressed_texture_etc"))){if(37492===t)return r.COMPRESSED_RGB8_ETC2;if(37496===t)return r.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?null!==(r=e.get("WEBGL_compressed_texture_astc"))?t:null:36492===t?null!==(r=e.get("EXT_texture_compression_bptc"))?t:null:1020===t?n?34042:null!==(r=e.get("WEBGL_depth_texture"))?r.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Xn(t){Ge.call(this),this.cameras=t||[]}function Zn(){V.call(this),this.type="Group"}function Kn(){this._targetRay=null,this._grip=null}function Jn(t,e){var r=this,n=null,i=1,o=null,a="local-floor",s=null,u=[],c=new Map,l=new Ge;l.layers.enable(1),l.viewport=new p;var h=new Ge;h.layers.enable(2),h.viewport=new p;var d=[l,h],f=new Xn;f.layers.enable(1),f.layers.enable(2);var g=null,m=null;function y(t){var e=c.get(t.inputSource);e&&e.dispatchEvent({type:t.type})}function A(){c.forEach((function(t,e){t.disconnect(e)})),c.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),I.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}function _(t){o=t,I.setContext(n),I.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}function b(t){for(var e=n.inputSources,r=0;r=0){var c=i[s];if(void 0!==c){var l=c.normalized,h=c.itemSize;if(void 0===(x=C.get(c)))continue;var p=x.buffer,d=x.type,f=x.bytesPerElement;if(c.isInterleavedBufferAttribute){var g=c.data,v=g.stride,b=c.offset;g&&g.isInstancedInterleavedBuffer?(_.enableAttributeAndDivisor(u,g.meshPerAttribute),void 0===e._maxInstanceCount&&(e._maxInstanceCount=g.meshPerAttribute*g.count)):_.enableAttribute(u),m.bindBuffer(34962,p),_.vertexAttribPointer(u,h,d,l,v*f,b*f)}else c.isInstancedBufferAttribute?(_.enableAttributeAndDivisor(u,c.meshPerAttribute),void 0===e._maxInstanceCount&&(e._maxInstanceCount=c.meshPerAttribute*c.count)):_.enableAttribute(u),m.bindBuffer(34962,p),_.vertexAttribPointer(u,h,d,l,0,0)}else if("instanceMatrix"===s){var x;if(void 0===(x=C.get(t.instanceMatrix)))continue;p=x.buffer,d=x.type,_.enableAttributeAndDivisor(u+0,1),_.enableAttributeAndDivisor(u+1,1),_.enableAttributeAndDivisor(u+2,1),_.enableAttributeAndDivisor(u+3,1),m.bindBuffer(34962,p),m.vertexAttribPointer(u+0,4,d,!1,64,0),m.vertexAttribPointer(u+1,4,d,!1,64,16),m.vertexAttribPointer(u+2,4,d,!1,64,32),m.vertexAttribPointer(u+3,4,d,!1,64,48)}else if(void 0!==a){var w=a[s];if(void 0!==w)switch(w.length){case 2:m.vertexAttrib2fv(u,w);break;case 3:m.vertexAttrib3fv(u,w);break;case 4:m.vertexAttrib4fv(u,w);break;default:m.vertexAttrib1fv(u,w)}}}}_.disableUnusedAttributes()}}(i,r,n,s),null!==c&&m.bindBuffer(34963,h.buffer));var f=null!==c?c.count:l.count,g=r.drawRange.start*p,v=r.drawRange.count*p,b=null!==o?o.start*p:0,x=null!==o?o.count*p:1/0,w=Math.max(g,b),I=Math.min(f,g+v,b+x)-1,M=Math.max(0,I-w+1);if(0!==M){if(i.isMesh)!0===n.wireframe?(_.setLineWidth(n.wireframeLinewidth*pt()),d.setMode(1)):d.setMode(4);else if(i.isLine){var S=n.linewidth;void 0===S&&(S=1),_.setLineWidth(S*pt()),i.isLineSegments?d.setMode(1):i.isLineLoop?d.setMode(2):d.setMode(3)}else i.isPoints?d.setMode(0):i.isSprite&&d.setMode(4);if(i.isInstancedMesh)d.renderInstances(r,w,M,i.count);else if(r.isInstancedBufferGeometry){var T=Math.min(r.instanceCount,r._maxInstanceCount);d.renderInstances(r,w,M,T)}else d.render(w,M)}},this.compile=function(t,e){(g=O.get(t,e)).init(),t.traverse((function(t){t.isLight&&(g.pushLight(t),t.castShadow&&g.pushShadow(t))})),g.setupLights(e);var r={};t.traverse((function(e){var n=e.material;if(n)if(Array.isArray(n))for(var i=0;i=0&&t.numSupportedMorphTargets++}if(t.morphNormals)for(t.numSupportedMorphNormals=0,p=0;p=0&&t.numSupportedMorphNormals++;var d=n.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=st.numPlanes,n.numIntersection=st.numIntersection,d.clippingPlanes=st.uniform),n.environment=t.isMeshStandardMaterial?e.environment:null,n.fog=e.fog,n.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),n.lightsStateVersion=a,n.needsLights&&(d.ambientLightColor.value=i.state.ambient,d.lightProbe.value=i.state.probe,d.directionalLights.value=i.state.directional,d.directionalLightShadows.value=i.state.directionalShadow,d.spotLights.value=i.state.spot,d.spotLightShadows.value=i.state.spotShadow,d.rectAreaLights.value=i.state.rectArea,d.pointLights.value=i.state.point,d.pointLightShadows.value=i.state.pointShadow,d.hemisphereLights.value=i.state.hemi,d.directionalShadowMap.value=i.state.directionalShadowMap,d.directionalShadowMatrix.value=i.state.directionalShadowMatrix,d.spotShadowMap.value=i.state.spotShadowMap,d.spotShadowMatrix.value=i.state.spotShadowMatrix,d.pointShadowMap.value=i.state.pointShadowMap,d.pointShadowMatrix.value=i.state.pointShadowMatrix);var f=n.program.getUniforms(),m=hn.seqWithValue(f.seq,d);n.uniformsList=m}function St(t,e,r,n){w.resetTextureUnits();var i=e.fog,a=r.isMeshStandardMaterial?e.environment:null,s=null===G?N.outputEncoding:G.texture.encoding,u=x.get(r),c=g.state.lights;if(ut&&(ct||t!==W)){var l=t===W&&r.id===V;st.setState(r.clippingPlanes,r.clipIntersection,r.clipShadows,t,u,l)}r.version===u.__version?void 0===u.program||r.fog&&u.fog!==i||u.environment!==a||u.needsLights&&u.lightsStateVersion!==c.state.version?Mt(r,e,n):void 0===u.numClippingPlanes||u.numClippingPlanes===st.numPlanes&&u.numIntersection===st.numIntersection?u.outputEncoding!==s&&Mt(r,e,n):Mt(r,e,n):(Mt(r,e,n),u.__version=r.version);var h,p,d=!1,f=!1,y=!1,v=u.program,b=v.getUniforms(),C=u.uniforms;if(_.useProgram(v.program)&&(d=!0,f=!0,y=!0),r.id!==V&&(V=r.id,f=!0),d||W!==t){if(b.setValue(m,"projectionMatrix",t.projectionMatrix),A.logarithmicDepthBuffer&&b.setValue(m,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),W!==t&&(W=t,f=!0,y=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){var E=b.map.cameraPosition;void 0!==E&&E.setValue(m,ht.setFromMatrixPosition(t.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&b.setValue(m,"isOrthographic",!0===t.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.skinning)&&b.setValue(m,"viewMatrix",t.matrixWorldInverse)}if(r.skinning){b.setOptional(m,n,"bindMatrix"),b.setOptional(m,n,"bindMatrixInverse");var I=n.skeleton;if(I){var M=I.bones;if(A.floatVertexTextures){if(void 0===I.boneTexture){var S=Math.sqrt(4*M.length);S=o.ceilPowerOfTwo(S),S=Math.max(S,4);var P=new Float32Array(S*S*4);P.set(I.boneMatrices);var O=new Qe(P,S,S,1023,1015);I.boneMatrices=P,I.boneTexture=O,I.boneTextureSize=S}b.setValue(m,"boneTexture",I.boneTexture,w),b.setValue(m,"boneTextureSize",I.boneTextureSize)}else b.setOptional(m,I,"boneMatrices")}}return(f||u.receiveShadow!==n.receiveShadow)&&(u.receiveShadow=n.receiveShadow,b.setValue(m,"receiveShadow",n.receiveShadow)),f&&(b.setValue(m,"toneMappingExposure",N.toneMappingExposure),b.setValue(m,"toneMappingWhitePoint",N.toneMappingWhitePoint),u.needsLights&&(p=y,(h=C).ambientLightColor.needsUpdate=p,h.lightProbe.needsUpdate=p,h.directionalLights.needsUpdate=p,h.directionalLightShadows.needsUpdate=p,h.pointLights.needsUpdate=p,h.pointLightShadows.needsUpdate=p,h.spotLights.needsUpdate=p,h.spotLightShadows.needsUpdate=p,h.rectAreaLights.needsUpdate=p,h.hemisphereLights.needsUpdate=p),i&&r.fog&&T.refreshFogUniforms(C,i),T.refreshMaterialUniforms(C,r,a,tt,$),void 0!==C.ltc_1&&(C.ltc_1.value=Xe.LTC_1),void 0!==C.ltc_2&&(C.ltc_2.value=Xe.LTC_2),hn.upload(m,u.uniformsList,C,w)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(hn.upload(m,u.uniformsList,C,w),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&b.setValue(m,"center",n.center),b.setValue(m,"modelViewMatrix",n.modelViewMatrix),b.setValue(m,"normalMatrix",n.normalMatrix),b.setValue(m,"modelMatrix",n.matrixWorld),v}wt.setAnimationLoop((function(t){gt.isPresenting||xt&&xt(t)})),"undefined"!=typeof window&&wt.setContext(window),this.setAnimationLoop=function(t){xt=t,gt.setAnimationLoop(t),wt.start()},this.render=function(t,e){var r,n;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),r=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),n=arguments[3]),e&&e.isCamera){if(!F){q.geometry=null,q.program=null,q.wireframe=!1,V=-1,W=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),gt.enabled&>.isPresenting&&(e=gt.getCamera(e)),t.onBeforeRender(N,t,e,r||G),(g=O.get(t,e)).init(),lt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),at.setFromProjectionMatrix(lt),ct=this.localClippingEnabled,ut=st.init(this.clippingPlanes,ct,e),(f=P.get(t,e)).init(),Ct(t,e,0,N.sortObjects),f.finish(),!0===N.sortObjects&&f.sort(et,rt),ut&&st.beginShadows();var i=g.state.shadowsArray;mt.render(i,t,e),g.setupLights(e),ut&&st.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==r&&this.setRenderTarget(r),L.render(f,t,e,n);var o=f.opaque,a=f.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&Et(o,t,e,s),a.length&&Et(a,t,e,s)}else o.length&&Et(o,t,e),a.length&&Et(a,t,e);t.onAfterRender(N,t,e),null!==G&&(w.updateRenderTargetMipmap(G),w.updateMultisampleRenderTarget(G)),_.buffers.depth.setTest(!0),_.buffers.depth.setMask(!0),_.buffers.color.setMask(!0),_.setPolygonOffset(!1),f=null,g=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){j!==t&&null===G&&m.bindFramebuffer(36160,t),j=t},this.getActiveCubeFace=function(){return z},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return G},this.setRenderTarget=function(t,e,r){G=t,z=e,U=r,t&&void 0===x.get(t).__webglFramebuffer&&w.setupRenderTarget(t);var n=j,i=!1;if(t){var o=x.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=o[e||0],i=!0):n=t.isWebGLMultisampleRenderTarget?x.get(t).__webglMultisampledFramebuffer:o,X.copy(t.viewport),Z.copy(t.scissor),K=t.scissorTest}else X.copy(nt).multiplyScalar(tt).floor(),Z.copy(it).multiplyScalar(tt).floor(),K=ot;if(H!==n&&(m.bindFramebuffer(36160,n),H=n),_.viewport(X),_.scissor(Z),_.setScissorTest(K),i){var a=x.get(t.texture);m.framebufferTexture2D(36160,36064,34069+(e||0),a.__webglTexture,r||0)}},this.readRenderTargetPixels=function(t,e,r,n,i,o,a){if(t&&t.isWebGLRenderTarget){var s=x.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var u=!1;s!==H&&(m.bindFramebuffer(36160,s),u=!0);try{var c=t.texture,l=c.format,h=c.type;if(1023!==l&&B.convert(l)!==m.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===h||B.convert(h)===m.getParameter(35738)||1015===h&&(A.isWebGL2||y.get("OES_texture_float")||y.get("WEBGL_color_buffer_float"))||1016===h&&(A.isWebGL2?y.get("EXT_color_buffer_float"):y.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===m.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&r>=0&&r<=t.height-i&&m.readPixels(e,r,n,i,B.convert(l),B.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{u&&m.bindFramebuffer(36160,H)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,r){void 0===r&&(r=0);var n=Math.pow(2,-r),i=Math.floor(e.image.width*n),o=Math.floor(e.image.height*n),a=B.convert(e.format);w.setTexture2D(e,0),m.copyTexImage2D(3553,r,a,t.x,t.y,i,o,0),_.unbindTexture()},this.copyTextureToTexture=function(t,e,r,n){void 0===n&&(n=0);var i=e.image.width,o=e.image.height,a=B.convert(r.format),s=B.convert(r.type);w.setTexture2D(r,0),e.isDataTexture?m.texSubImage2D(3553,n,t.x,t.y,i,o,a,s,e.image.data):e.isCompressedTexture?m.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):m.texSubImage2D(3553,n,t.x,t.y,a,s,e.image),0===n&&r.generateMipmaps&&m.generateMipmap(3553),_.unbindTexture()},this.initTexture=function(t){w.setTexture2D(t,0),_.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function ei(t,e){this.name="",this.color=new Dt(t),this.density=void 0!==e?e:25e-5}function ri(t,e,r){this.name="",this.color=new Dt(t),this.near=void 0!==e?e:1,this.far=void 0!==r?r:1e3}function ni(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}Hn.prototype=Object.create(Ut.prototype),Hn.prototype.constructor=Hn,Hn.prototype.isMeshDepthMaterial=!0,Hn.prototype.copy=function(t){return Ut.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Vn.prototype=Object.create(Ut.prototype),Vn.prototype.constructor=Vn,Vn.prototype.isMeshDistanceMaterial=!0,Vn.prototype.copy=function(t){return Ut.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},Xn.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Xn,isArrayCamera:!0}),Zn.prototype=Object.assign(Object.create(V.prototype),{constructor:Zn,isGroup:!0}),Object.assign(Kn.prototype,{constructor:Kn,getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Zn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Zn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),this},update:function(t,e,r){var n=null,i=null,o=this._targetRay,a=this._grip;return t&&(null!==o&&null!==(n=e.getPose(t.targetRaySpace,r))&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)),null!==a&&t.gripSpace&&null!==(i=e.getPose(t.gripSpace,r))&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==i),this}}),Object.assign(Jn.prototype,e.prototype),Object.assign(ei.prototype,{isFogExp2:!0,clone:function(){return new ei(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(ri.prototype,{isFog:!0,clone:function(){return new ri(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(ni.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(ni.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,r){t*=this.stride,r*=e.stride;for(var n=0,i=this.stride;nt.far||e.push({distance:u,point:ui.clone(),uv:Ot.getUV(ui,fi,gi,mi,yi,vi,Ai,new a),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return V.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var xi,wi,Ci,Ei,Ii,Mi=new v,Si=new v;function Ti(){V.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Pi(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Me.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new I,this.bindMatrixInverse=new I}Ti.prototype=Object.assign(Object.create(V.prototype),{constructor:Ti,isLOD:!0,copy:function(t){V.prototype.copy.call(this,t,!1);for(var e=t.levels,r=0,n=e.length;r0){for(var r=1,n=e.length;r0){Mi.setFromMatrixPosition(this.matrixWorld);var r=t.ray.origin.distanceTo(Mi);this.getObjectForDistance(r).raycast(t,e)}},update:function(t){var e=this.levels;if(e.length>1){Mi.setFromMatrixPosition(t.matrixWorld),Si.setFromMatrixPosition(this.matrixWorld);var r=Mi.distanceTo(Si)/t.zoom;e[0].object.visible=!0;for(var n=1,i=e.length;n=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;na||(l.applyMatrix4(this.matrixWorld),(x=t.ray.origin.distanceTo(l))t.far||e.push({distance:x,point:c.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else for(g=0,m=d.length/3-1;ga||(l.applyMatrix4(this.matrixWorld),(x=t.ray.origin.distanceTo(l))t.far||e.push({distance:x,point:c.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(r.isGeometry){var _=r.vertices,b=_.length;for(g=0;ga||(l.applyMatrix4(this.matrixWorld),(x=t.ray.origin.distanceTo(l))t.far||e.push({distance:x,point:c.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}},updateMorphTargets:function(){var t,e,r,n=this.geometry;if(n.isBufferGeometry){var i=n.morphAttributes,o=Object.keys(i);if(o.length>0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Wi=new v,Yi=new v;function Xi(t,e){qi.call(this,t,e),this.type="LineSegments"}function Zi(t,e){qi.call(this,t,e),this.type="LineLoop"}function Ki(t){Ut.call(this),this.type="PointsMaterial",this.color=new Dt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Xi.prototype=Object.assign(Object.create(qi.prototype),{constructor:Xi,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,r=[],n=0,i=e.count;ni.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:u,index:e,face:null,object:a})}}function io(t,e,r,n,i,o,a,s,u){h.call(this,t,e,r,n,i,o,a,s,u),this.format=void 0!==a?a:1022,this.minFilter=void 0!==o?o:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1}function oo(t,e,r,n,i,o,a,s,u,c,l,p){h.call(this,null,o,a,s,u,c,n,i,l,p),this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function ao(t,e,r,n,i,o,a,s,u){h.call(this,t,e,r,n,i,o,a,s,u),this.needsUpdate=!0}function so(t,e,r,n,i,o,a,s,u,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&1026===c&&(r=1012),void 0===r&&1027===c&&(r=1020),h.call(this,null,n,i,o,a,s,c,r,u),this.image={width:t,height:e},this.magFilter=void 0!==a?a:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function uo(t){ce.call(this),this.type="WireframeGeometry";var e,r,n,i,o,a,s,u,c,l,h=[],p=[0,0],d={},f=["a","b","c"];if(t&&t.isGeometry){var g=t.faces;for(e=0,n=g.length;e=0?(t(y-c,m,p),d.subVectors(h,p)):(t(y+c,m,p),d.subVectors(p,h)),m-c>=0?(t(y,m-c,p),f.subVectors(h,p)):(t(y,m+c,p),f.subVectors(p,h)),l.crossVectors(d,f).normalize(),s.push(l.x,l.y,l.z),u.push(y,m)}}for(n=0;n.9&&a<.1&&(e<.2&&(o[t+0]+=1),r<.2&&(o[t+2]+=1),n<.2&&(o[t+4]+=1))}}()}(),this.setAttribute("position",new Jt(i,3)),this.setAttribute("normal",new Jt(i.slice(),3)),this.setAttribute("uv",new Jt(o,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function fo(t,e){Re.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new go(t,e)),this.mergeVertices()}function go(t,e){po.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function mo(t,e){Re.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new yo(t,e)),this.mergeVertices()}function yo(t,e){po.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function vo(t,e){Re.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ao(t,e)),this.mergeVertices()}function Ao(t,e){var r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1];po.call(this,n,[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],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function _o(t,e){Re.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new bo(t,e)),this.mergeVertices()}function bo(t,e){var r=(1+Math.sqrt(5))/2,n=1/r,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n];po.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function xo(t,e,r,n,i,o){Re.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:r,radialSegments:n,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new wo(t,e,r,n,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function wo(t,e,r,n,i){ce.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:r,radialSegments:n,closed:i},e=e||64,r=r||1,n=n||8,i=i||!1;var o=t.computeFrenetFrames(e,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var s,u,c=new v,l=new v,h=new a,p=new v,d=[],f=[],g=[],m=[];function y(i){p=t.getPointAt(i/e,p);var a=o.normals[i],s=o.binormals[i];for(u=0;u<=n;u++){var h=u/n*Math.PI*2,g=Math.sin(h),m=-Math.cos(h);l.x=m*a.x+g*s.x,l.y=m*a.y+g*s.y,l.z=m*a.z+g*s.z,l.normalize(),f.push(l.x,l.y,l.z),c.x=p.x+r*l.x,c.y=p.y+r*l.y,c.z=p.z+r*l.z,d.push(c.x,c.y,c.z)}}!function(){for(s=0;s0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),io.prototype=Object.assign(Object.create(h.prototype),{constructor:io,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),oo.prototype=Object.create(h.prototype),oo.prototype.constructor=oo,oo.prototype.isCompressedTexture=!0,ao.prototype=Object.create(h.prototype),ao.prototype.constructor=ao,ao.prototype.isCanvasTexture=!0,so.prototype=Object.create(h.prototype),so.prototype.constructor=so,so.prototype.isDepthTexture=!0,uo.prototype=Object.create(ce.prototype),uo.prototype.constructor=uo,co.prototype=Object.create(Re.prototype),co.prototype.constructor=co,lo.prototype=Object.create(ce.prototype),lo.prototype.constructor=lo,ho.prototype=Object.create(Re.prototype),ho.prototype.constructor=ho,po.prototype=Object.create(ce.prototype),po.prototype.constructor=po,fo.prototype=Object.create(Re.prototype),fo.prototype.constructor=fo,go.prototype=Object.create(po.prototype),go.prototype.constructor=go,mo.prototype=Object.create(Re.prototype),mo.prototype.constructor=mo,yo.prototype=Object.create(po.prototype),yo.prototype.constructor=yo,vo.prototype=Object.create(Re.prototype),vo.prototype.constructor=vo,Ao.prototype=Object.create(po.prototype),Ao.prototype.constructor=Ao,_o.prototype=Object.create(Re.prototype),_o.prototype.constructor=_o,bo.prototype=Object.create(po.prototype),bo.prototype.constructor=bo,xo.prototype=Object.create(Re.prototype),xo.prototype.constructor=xo,wo.prototype=Object.create(ce.prototype),wo.prototype.constructor=wo,wo.prototype.toJSON=function(){var t=ce.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},Co.prototype=Object.create(Re.prototype),Co.prototype.constructor=Co,Eo.prototype=Object.create(ce.prototype),Eo.prototype.constructor=Eo,Io.prototype=Object.create(Re.prototype),Io.prototype.constructor=Io,Mo.prototype=Object.create(ce.prototype),Mo.prototype.constructor=Mo;var So=function(t,e,r){r=r||2;var n,i,o,a,s,u,c,l=e&&e.length,h=l?e[0]*r:t.length,p=To(t,0,h,r,!0),d=[];if(!p||p.next===p.prev)return d;if(l&&(p=function(t,e,r,n){var i,o,a,s,u,c=[];for(i=0,o=e.length;i80*r){n=o=t[0],i=a=t[1];for(var f=r;fo&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-n,a-i))?1/c:0}return Oo(p,d,r,n,i,c),d};function To(t,e,r,n,i){var o,a;if(i===function(t,e,r,n){for(var i=0,o=e,a=r-n;o0)for(o=e;o=e;o-=n)a=Zo(o,t[o],t[o+1],a);return a&&Vo(a,a.next)&&(Ko(a),a=a.next),a}function Po(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Vo(n,n.next)&&0!==Ho(n.prev,n,n.next))n=n.next;else{if(Ko(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Oo(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=jo(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?ko(t,n,i,o):Lo(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Ko(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?Oo(t=Ro(Po(t),e,r),e,r,n,i,o,2):2===a&&Do(t,e,r,n,i,o):Oo(Po(t),e,r,n,i,o,1);break}}}function Lo(t){var e=t.prev,r=t,n=t.next;if(Ho(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Uo(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Ho(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ko(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Ho(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=jo(s,u,e,r,n),p=jo(c,l,e,r,n),d=t.prevZ,f=t.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&Uo(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Ho(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==t.prev&&f!==t.next&&Uo(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ho(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&Uo(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Ho(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Uo(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ho(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Ro(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Vo(i,o)&&Qo(i,n,n.next,o)&&Yo(i,o)&&Yo(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Ko(n),Ko(n.next),n=t=o),n=n.next}while(n!==t);return Po(n)}function Do(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Go(a,s)){var u=Xo(a,s);return a=Po(a,a.next),u=Po(u,u.next),Oo(a,e,r,n,i,o),void Oo(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function Bo(t,e){return t.x-e.x}function No(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&&Uo(or.x||n.x===r.x&&Fo(r,n)))&&(r=n,p=u)),n=n.next}while(n!==c);return r}(t,e)){var r=Xo(e,t);Po(e,e.next),Po(r,r.next)}}function Fo(t,e){return Ho(t.prev,t,e.prev)<0&&Ho(e.next,t,t.next)<0}function jo(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zo(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function Go(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Qo(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Yo(t,e)&&Yo(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Ho(t.prev,t,e.prev)||Ho(t,e.prev,e))||Vo(t,e)&&Ho(t.prev,t,t.next)>0&&Ho(e.prev,e,e.next)>0)}function Ho(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Vo(t,e){return t.x===e.x&&t.y===e.y}function Qo(t,e,r,n){var i=Wo(Ho(t,e,r)),o=Wo(Ho(t,e,n)),a=Wo(Ho(r,n,t)),s=Wo(Ho(r,n,e));return i!==o&&a!==s||!(0!==i||!qo(t,r,e))||!(0!==o||!qo(t,n,e))||!(0!==a||!qo(r,t,n))||!(0!==s||!qo(r,e,n))}function qo(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Wo(t){return t>0?1:t<0?-1:0}function Yo(t,e){return Ho(t.prev,t,t.next)<0?Ho(t,e,t.next)>=0&&Ho(t,t.prev,e)>=0:Ho(t,e,t.prev)<0||Ho(t,t.next,e)<0}function Xo(t,e){var r=new Jo(t.i,t.x,t.y),n=new Jo(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Zo(t,e,r,n){var i=new Jo(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ko(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Jo(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var $o={area:function(t){for(var e=t.length,r=0,n=e-1,i=0;i2&&t[e-1].equals(t[0])&&t.pop()}function ea(t,e){for(var r=0;rNumber.EPSILON){var d=Math.sqrt(h),f=Math.sqrt(c*c+l*l),g=e.x-u/d,m=e.y+s/d,y=((r.x-l/f-g)*l-(r.y+c/f-m)*c)/(s*l-u*c),v=(n=g+s*y-t.x)*n+(i=m+u*y-t.y)*i;if(v<=2)return new a(n,i);o=Math.sqrt(v/2)}else{var A=!1;s>Number.EPSILON?c>Number.EPSILON&&(A=!0):s<-Number.EPSILON?c<-Number.EPSILON&&(A=!0):Math.sign(u)===Math.sign(l)&&(A=!0),A?(n=-u,i=s,o=Math.sqrt(h)):(n=s,i=u,o=Math.sqrt(h/2))}return new a(n/o,i/o)}for(var G=[],H=0,V=O.length,Q=V-1,q=H+1;H=0;k--){for(D=k/f,B=h*Math.cos(D*Math.PI/2),R=p*Math.sin(D*Math.PI/2)+d,H=0,V=O.length;H=0;){r=H,(n=H-1)<0&&(n=t.length-1);var i=0,o=u+2*f;for(i=0;i0)&&f.push(w,C,I),(u!==r-1||c0&&A(!0),e>0&&A(!1)),this.setIndex(l),this.setAttribute("position",new Jt(h,3)),this.setAttribute("normal",new Jt(p,3)),this.setAttribute("uv",new Jt(d,2))}function _a(t,e,r,n,i,o,a){va.call(this,0,t,e,r,n,i,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:o,thetaLength:a}}function ba(t,e,r,n,i,o,a){Aa.call(this,0,t,e,r,n,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:o,thetaLength:a}}function xa(t,e,r,n){Re.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:n},this.fromBufferGeometry(new wa(t,e,r,n)),this.mergeVertices()}function wa(t,e,r,n){ce.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:n},t=t||1,e=void 0!==e?Math.max(3,e):8,r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI;var i,o,s=[],u=[],c=[],l=[],h=new v,p=new a;for(u.push(0,0,0),c.push(0,0,1),l.push(.5,.5),o=0,i=3;o<=e;o++,i+=3){var d=r+o/e*n;h.x=t*Math.cos(d),h.y=t*Math.sin(d),u.push(h.x,h.y,h.z),c.push(0,0,1),p.x=(u[i]/t+1)/2,p.y=(u[i+1]/t+1)/2,l.push(p.x,p.y)}for(i=1;i<=e;i++)s.push(i,i+1,0);this.setIndex(s),this.setAttribute("position",new Jt(u,3)),this.setAttribute("normal",new Jt(c,3)),this.setAttribute("uv",new Jt(l,2))}aa.prototype=Object.create(Re.prototype),aa.prototype.constructor=aa,sa.prototype=Object.create(na.prototype),sa.prototype.constructor=sa,ua.prototype=Object.create(Re.prototype),ua.prototype.constructor=ua,ca.prototype=Object.create(ce.prototype),ca.prototype.constructor=ca,la.prototype=Object.create(Re.prototype),la.prototype.constructor=la,ha.prototype=Object.create(ce.prototype),ha.prototype.constructor=ha,pa.prototype=Object.create(Re.prototype),pa.prototype.constructor=pa,da.prototype=Object.create(ce.prototype),da.prototype.constructor=da,fa.prototype=Object.create(Re.prototype),fa.prototype.constructor=fa,fa.prototype.toJSON=function(){var t=Re.prototype.toJSON.call(this);return ma(this.parameters.shapes,t)},ga.prototype=Object.create(ce.prototype),ga.prototype.constructor=ga,ga.prototype.toJSON=function(){var t=ce.prototype.toJSON.call(this);return ma(this.parameters.shapes,t)},ya.prototype=Object.create(ce.prototype),ya.prototype.constructor=ya,va.prototype=Object.create(Re.prototype),va.prototype.constructor=va,Aa.prototype=Object.create(ce.prototype),Aa.prototype.constructor=Aa,_a.prototype=Object.create(va.prototype),_a.prototype.constructor=_a,ba.prototype=Object.create(Aa.prototype),ba.prototype.constructor=ba,xa.prototype=Object.create(Re.prototype),xa.prototype.constructor=xa,wa.prototype=Object.create(ce.prototype),wa.prototype.constructor=wa;var Ca=Object.freeze({__proto__:null,WireframeGeometry:uo,ParametricGeometry:co,ParametricBufferGeometry:lo,TetrahedronGeometry:fo,TetrahedronBufferGeometry:go,OctahedronGeometry:mo,OctahedronBufferGeometry:yo,IcosahedronGeometry:vo,IcosahedronBufferGeometry:Ao,DodecahedronGeometry:_o,DodecahedronBufferGeometry:bo,PolyhedronGeometry:ho,PolyhedronBufferGeometry:po,TubeGeometry:xo,TubeBufferGeometry:wo,TorusKnotGeometry:Co,TorusKnotBufferGeometry:Eo,TorusGeometry:Io,TorusBufferGeometry:Mo,TextGeometry:aa,TextBufferGeometry:sa,SphereGeometry:ua,SphereBufferGeometry:ca,RingGeometry:la,RingBufferGeometry:ha,PlaneGeometry:Je,PlaneBufferGeometry:$e,LatheGeometry:pa,LatheBufferGeometry:da,ShapeGeometry:fa,ShapeBufferGeometry:ga,ExtrudeGeometry:ra,ExtrudeBufferGeometry:na,EdgesGeometry:ya,ConeGeometry:_a,ConeBufferGeometry:ba,CylinderGeometry:va,CylinderBufferGeometry:Aa,CircleGeometry:xa,CircleBufferGeometry:wa,BoxGeometry:De,BoxBufferGeometry:Be});function Ea(t){Ut.call(this),this.type="ShadowMaterial",this.color=new Dt(0),this.transparent=!0,this.setValues(t)}function Ia(t){ze.call(this,t),this.type="RawShaderMaterial"}function Ma(t){Ut.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Dt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new a(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function Sa(t){Ma.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new a(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function Ta(t){Ut.call(this),this.type="MeshPhongMaterial",this.color=new Dt(16777215),this.specular=new Dt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new a(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Pa(t){Ut.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Dt(16777215),this.specular=new Dt(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new a(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Oa(t){Ut.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new a(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function La(t){Ut.call(this),this.type="MeshLambertMaterial",this.color=new Dt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Dt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ka(t){Ut.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Dt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new a(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ra(t){zi.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Ea.prototype=Object.create(Ut.prototype),Ea.prototype.constructor=Ea,Ea.prototype.isShadowMaterial=!0,Ea.prototype.copy=function(t){return Ut.prototype.copy.call(this,t),this.color.copy(t.color),this},Ia.prototype=Object.create(ze.prototype),Ia.prototype.constructor=Ia,Ia.prototype.isRawShaderMaterial=!0,Ma.prototype=Object.create(Ut.prototype),Ma.prototype.constructor=Ma,Ma.prototype.isMeshStandardMaterial=!0,Ma.prototype.copy=function(t){return Ut.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},Sa.prototype=Object.create(Ma.prototype),Sa.prototype.constructor=Sa,Sa.prototype.isMeshPhysicalMaterial=!0,Sa.prototype.copy=function(t){return Ma.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new Dt).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},Ta.prototype=Object.create(Ut.prototype),Ta.prototype.constructor=Ta,Ta.prototype.isMeshPhongMaterial=!0,Ta.prototype.copy=function(t){return Ut.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Pa.prototype=Object.create(Ut.prototype),Pa.prototype.constructor=Pa,Pa.prototype.isMeshToonMaterial=!0,Pa.prototype.copy=function(t){return Ut.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Oa.prototype=Object.create(Ut.prototype),Oa.prototype.constructor=Oa,Oa.prototype.isMeshNormalMaterial=!0,Oa.prototype.copy=function(t){return Ut.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},La.prototype=Object.create(Ut.prototype),La.prototype.constructor=La,La.prototype.isMeshLambertMaterial=!0,La.prototype.copy=function(t){return Ut.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},ka.prototype=Object.create(Ut.prototype),ka.prototype.constructor=ka,ka.prototype.isMeshMatcapMaterial=!0,ka.prototype.copy=function(t){return Ut.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Ra.prototype=Object.create(zi.prototype),Ra.prototype.constructor=Ra,Ra.prototype.isLineDashedMaterial=!0,Ra.prototype.copy=function(t){return zi.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Da=Object.freeze({__proto__:null,ShadowMaterial:Ea,SpriteMaterial:si,RawShaderMaterial:Ia,ShaderMaterial:ze,PointsMaterial:Ki,MeshPhysicalMaterial:Sa,MeshStandardMaterial:Ma,MeshPhongMaterial:Ta,MeshToonMaterial:Pa,MeshNormalMaterial:Oa,MeshLambertMaterial:La,MeshDepthMaterial:Hn,MeshDistanceMaterial:Vn,MeshBasicMaterial:Gt,MeshMatcapMaterial:ka,LineDashedMaterial:Ra,LineBasicMaterial:zi,Material:Ut}),Ba={arraySlice:function(t,e,r){return Ba.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==r?r:t.length)):t.slice(e,r)},convertArray:function(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,r=new Array(e),n=0;n!==e;++n)r[n]=n;return r.sort((function(e,r){return t[e]-t[r]})),r},sortedArray:function(t,e,r){for(var n=t.length,i=new t.constructor(n),o=0,a=0;a!==n;++o)for(var s=r[o]*e,u=0;u!==e;++u)i[a++]=t[s+u];return i},flattenJSON:function(t,e,r,n){for(var i=1,o=t[0];void 0!==o&&void 0===o[n];)o=t[i++];if(void 0!==o){var a=o[n];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[n])&&(e.push(o.time),r.push.apply(r,a)),o=t[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[n])&&(e.push(o.time),a.toArray(r,r.length)),o=t[i++]}while(void 0!==o);else do{void 0!==(a=o[n])&&(e.push(o.time),r.push(a)),o=t[i++]}while(void 0!==o)}},subclip:function(t,e,r,n,i){i=i||30;var o=t.clone();o.name=e;for(var a=[],s=0;s=n)){l.push(u.times[p]);for(var f=0;fo.tracks[s].times[0]&&(g=o.tracks[s].times[0]);for(s=0;s=s.times[p]){var d=p*h;l=Ba.arraySlice(s.values,d)}else{var f=s.createInterpolant();f.evaluate(o),l=f.resultBuffer}"quaternion"===u&&new g(l[0],l[1],l[2],l[3]).normalize().conjugate().toArray(l);for(var m=c.times.length,y=0;y=i)break t;var s=e[1];for(t=(i=e[--r-1]))break e}o=r,r=0}for(;r>>1;te;)--o;if(++o,0!==i||o!==n){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Ba.arraySlice(r,i,o),this.values=Ba.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==i;a++){var s=r[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==n&&Ba.isTypedArray(n)){a=0;for(var u=n.length;a!==u;++a){var c=n[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),t=!1;break}}}return t},optimize:function(){for(var t=Ba.arraySlice(this.times),e=Ba.arraySlice(this.values),r=this.getValueSize(),n=2302===this.getInterpolation(),i=1,o=t.length-1,a=1;a0){for(t[i]=t[o],f=o*r,g=i*r,p=0;p!==r;++p)e[g+p]=e[f+p];++i}return i!==t.length?(this.times=Ba.arraySlice(t,0,i),this.values=Ba.arraySlice(e,0,i*r)):(this.times=t,this.values=e),this},clone:function(){var t=Ba.arraySlice(this.times,0),e=Ba.arraySlice(this.values,0),r=new(0,this.constructor)(this.name,t,e);return r.createInterpolant=this.createInterpolant,r}}),Ga.prototype=Object.assign(Object.create(Ua.prototype),{constructor:Ga,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ha.prototype=Object.assign(Object.create(Ua.prototype),{constructor:Ha,ValueTypeName:"color"}),Va.prototype=Object.assign(Object.create(Ua.prototype),{constructor:Va,ValueTypeName:"number"}),Qa.prototype=Object.assign(Object.create(Na.prototype),{constructor:Qa,interpolate_:function(t,e,r,n){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,u=(r-e)/(n-e),c=s+a;s!==c;s+=4)g.slerpFlat(i,0,o,s-a,o,s,u);return i}}),qa.prototype=Object.assign(Object.create(Ua.prototype),{constructor:qa,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new Qa(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Wa.prototype=Object.assign(Object.create(Ua.prototype),{constructor:Wa,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ya.prototype=Object.assign(Object.create(Ua.prototype),{constructor:Ya,ValueTypeName:"vector"}),Object.assign(Xa,{parse:function(t){for(var e=[],r=t.tracks,n=1/(t.fps||1),i=0,o=r.length;i!==o;++i)e.push(Za(r[i]).scale(n));return new Xa(t.name,t.duration,e,t.blendMode)},toJSON:function(t){for(var e=[],r=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode},i=0,o=r.length;i!==o;++i)e.push(Ua.toJSON(r[i]));return n},CreateFromMorphTargetSequence:function(t,e,r,n){for(var i=e.length,o=[],a=0;a1){var c=n[h=u[1]];c||(n[h]=c=[]),c.push(s)}}var l=[];for(var h in n)l.push(Xa.CreateFromMorphTargetSequence(h,n[h],e,r));return l},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var r=function(t,e,r,n,i){if(0!==r.length){var o=[],a=[];Ba.flattenJSON(r,o,a,n),0!==o.length&&i.push(new t(e,o,a))}},n=[],i=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.blendMode,u=t.hierarchy||[],c=0;c0||0===t.search(/^data\:image\/jpeg/);i.format=n?1022:1023,i.needsUpdate=!0,void 0!==e&&e(i)}),r,n),i}}),Object.assign(cs.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var r=this.getUtoTmapping(t);return this.getPoint(r,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],r=0;r<=t;r++)e.push(this.getPoint(r/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],r=0;r<=t;r++)e.push(this.getPointAt(r/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,r,n=[],i=this.getPoint(0),o=0;for(n.push(0),r=1;r<=t;r++)o+=(e=this.getPoint(r/t)).distanceTo(i),n.push(o),i=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var r,n=this.getLengths(),i=0,o=n.length;r=e||t*n[o-1];for(var a,s=0,u=o-1;s<=u;)if((a=n[i=Math.floor(s+(u-s)/2)]-r)<0)s=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(n[i=u]===r)return i/(o-1);var c=n[i];return(i+(r-c)/(n[i+1]-c))/(o-1)},getTangent:function(t,e){var r=t-1e-4,n=t+1e-4;r<0&&(r=0),n>1&&(n=1);var i=this.getPoint(r),o=this.getPoint(n),s=e||(i.isVector2?new a:new v);return s.copy(o).sub(i).normalize(),s},getTangentAt:function(t,e){var r=this.getUtoTmapping(t);return this.getTangent(r,e)},computeFrenetFrames:function(t,e){var r,n,i,a=new v,s=[],u=[],c=[],l=new v,h=new I;for(r=0;r<=t;r++)n=r/t,s[r]=this.getTangentAt(n,new v),s[r].normalize();u[0]=new v,c[0]=new v;var p=Number.MAX_VALUE,d=Math.abs(s[0].x),f=Math.abs(s[0].y),g=Math.abs(s[0].z);for(d<=p&&(p=d,a.set(1,0,0)),f<=p&&(p=f,a.set(0,1,0)),g<=p&&a.set(0,0,1),l.crossVectors(s[0],a).normalize(),u[0].crossVectors(s[0],l),c[0].crossVectors(s[0],u[0]),r=1;r<=t;r++)u[r]=u[r-1].clone(),c[r]=c[r-1].clone(),l.crossVectors(s[r-1],s[r]),l.length()>Number.EPSILON&&(l.normalize(),i=Math.acos(o.clamp(s[r-1].dot(s[r]),-1,1)),u[r].applyMatrix4(h.makeRotationAxis(l,i))),c[r].crossVectors(s[r],u[r]);if(!0===e)for(i=Math.acos(o.clamp(u[0].dot(u[t]),-1,1)),i/=t,s[0].dot(l.crossVectors(u[0],u[t]))>0&&(i=-i),r=1;r<=t;r++)u[r].applyMatrix4(h.makeRotationAxis(s[r],i*r)),c[r].crossVectors(s[r],u[r]);return{tangents:s,normals:u,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),ls.prototype=Object.create(cs.prototype),ls.prototype.constructor=ls,ls.prototype.isEllipseCurve=!0,ls.prototype.getPoint=function(t,e){for(var r=e||new a,n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)n;)i-=n;i0?0:(Math.floor(Math.abs(l)/u)+1)*u:0===h&&l===u-1&&(l=u-2,h=1),this.closed||l>0?r=s[(l-1)%u]:(ds.subVectors(s[0],s[1]).add(s[0]),r=ds),n=s[l%u],i=s[(l+1)%u],this.closed||l+2n.length-2?n.length-1:o+1],h=n[o>n.length-3?n.length-1:o+2];return r.set(vs(s,u.x,c.x,l.x,h.x),vs(s,u.y,c.y,l.y,h.y)),r},Ms.prototype.copy=function(t){cs.prototype.copy.call(this,t),this.points=[];for(var e=0,r=t.points.length;e=e){var i=r[n]-e,o=this.curves[n],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}n++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,r=0,n=this.curves.length;r1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},copy:function(t){cs.prototype.copy.call(this,t),this.curves=[];for(var e=0,r=t.curves.length;e0){var c=u.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(u);var l=u.getPoint(1);return this.currentPoint.copy(l),this},copy:function(t){return Ts.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Ts.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Ts.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Os.prototype=Object.assign(Object.create(Ps.prototype),{constructor:Os,getPointsHoles:function(t){for(var e=[],r=0,n=this.holes.length;r0:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var i in t.uniforms){var o=t.uniforms[i];switch(n.uniforms[i]={},o.type){case"t":n.uniforms[i].value=r(o.value);break;case"c":n.uniforms[i].value=(new Dt).setHex(o.value);break;case"v2":n.uniforms[i].value=(new a).fromArray(o.value);break;case"v3":n.uniforms[i].value=(new v).fromArray(o.value);break;case"v4":n.uniforms[i].value=(new p).fromArray(o.value);break;case"m3":n.uniforms[i].value=(new u).fromArray(o.value);case"m4":n.uniforms[i].value=(new I).fromArray(o.value);break;default:n.uniforms[i].value=o.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var s in t.extensions)n.extensions[s]=t.extensions[s];if(void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=r(t.map)),void 0!==t.matcap&&(n.matcap=r(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=r(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=r(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=r(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){var c=t.normalScale;!1===Array.isArray(c)&&(c=[c,c]),n.normalScale=(new a).fromArray(c)}return void 0!==t.displacementMap&&(n.displacementMap=r(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=r(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=r(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=r(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=r(t.specularMap)),void 0!==t.envMap&&(n.envMap=r(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=r(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=r(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=r(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=r(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=r(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=r(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new a).fromArray(t.clearcoatNormalScale)),n},setTextures:function(t){return this.textures=t,this}});var Ws={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",r=0,n=t.length;r0){var o=new as(new Ja(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;aNumber.EPSILON){if(c<0&&(a=e[o],u=-u,s=e[i],c=-c),t.ys.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var l=c*(t.x-a.x)-u*(t.y-a.y);if(0===l)return!0;if(l<0)continue;n=!n}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return n}var i=$o.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return r(o);var a,s,u,c=[];if(1===o.length)return s=o[0],(u=new Os).curves=s.curves,c.push(u),c;var l=!i(o[0].getPoints());l=t?!l:l;var h,p,d=[],f=[],g=[],m=0;f[m]=void 0,g[m]=[];for(var y=0,v=o.length;y1){for(var A=!1,_=[],b=0,x=f.length;b0&&(A||(g=d))}y=0;for(var S=f.length;y0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(r,n,this._addIndex*e,1,e);for(var u=e,c=e+e;u!==c;++u)if(r[u]!==r[u+e]){a.setValue(r,n);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,r=this.valueSize,n=r*this._origIndex;t.getValue(e,n);for(var i=r,o=n;i!==o;++i)e[i]=e[n+i%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){for(var t=this._addIndex*this.valueSize,e=t+this.valueSize,r=t;r=.5)for(var o=0;o!==i;++o)t[e+o]=t[r+o]},_slerp:function(t,e,r,n){g.slerpFlat(t,e,t,e,t,r,n)},_slerpAdditive:function(t,e,r,n,i){var o=this._workIndex*i;g.multiplyQuaternionsFlat(t,o,t,e,t,r),g.slerpFlat(t,e,t,e,t,o,n)},_lerp:function(t,e,r,n,i){for(var o=1-n,a=0;a!==i;++a){var s=e+a;t[s]=t[s]*o+t[r+a]*n}},_lerpAdditive:function(t,e,r,n,i){for(var o=0;o!==i;++o){var a=e+o;t[a]=t[a]+t[r+o]*n}}});var Tu=new RegExp("[\\[\\]\\.:\\/]","g"),Pu="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Ou=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Lu=/(WCOD+)?/.source.replace("WCOD",Pu),ku=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ru=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Du=new RegExp("^"+Ou+Lu+ku+Ru+"$"),Bu=["material","materials","bones"];function Nu(t,e,r){var n=r||Fu.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function Fu(t,e,r){this.path=e,this.parsedPath=r||Fu.parseTrackName(e),this.node=Fu.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function ju(){this.uuid=o.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,r=arguments.length;e!==r;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function zu(t,e,r,n){this._mixer=t,this._clip=e,this._localRoot=r||null,this.blendMode=n||e.blendMode;for(var i=e.tracks,o=i.length,a=new Array(o),s={endingStart:2400,endingEnd:2400},u=0;u!==o;++u){var c=i[u].createInterpolant(null);a[u]=c,c.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Uu(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Gu(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Hu(t,e,r){ni.call(this,t,e),this.meshPerAttribute=r||1}function Vu(t,e,r,n){this.ray=new mt(t,e),this.near=r||0,this.far=n||1/0,this.camera=null,this.layers=new P,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Qu(t,e){return t.distance-e.distance}function qu(t,e,r,n){if(t.layers.test(e.layers)&&t.raycast(e,r),!0===n)for(var i=t.children,o=0,a=i.length;o=e){var l=e++,h=t[l];r[h.uuid]=c,t[c]=h,r[u]=l,t[l]=s;for(var p=0,d=i;p!==d;++p){var f=n[p],g=f[l],m=f[c];f[c]=g,f[l]=m}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,r=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,o=i.length,a=0,s=arguments.length;a!==s;++a){var u=arguments[a],c=u.uuid,l=n[c];if(void 0!==l)if(delete n[c],l0){var u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case 2501:for(var l=0,h=u.length;l!==h;++l)u[l].evaluate(a),c[l].accumulateAdditive(s);break;case 2500:default:for(l=0,h=u.length;l!==h;++l)u[l].evaluate(a),c[l].accumulate(n,s)}}}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var r=this._weightInterpolant;if(null!==r){var n=r.evaluate(t)[0];e*=n,t>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var r=this._timeScaleInterpolant;null!==r&&(e*=r.evaluate(t)[0],t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,r=this._clip.duration,n=this.loop,i=this._loopCount,o=2202===n;if(0===t)return-1===i?e:o&&1==(1&i)?r-e:e;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=r)e=r;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=r||e<0){var a=Math.floor(e/r);e-=r*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?r:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var u=t<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=e;if(o&&1==(1&i))return r-e}return e},_setEndings:function(t,e,r){var n=this._interpolantSettings;r?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(t,e,r){var n=this._mixer,i=n.time,o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=r,this}}),Uu.prototype=Object.assign(Object.create(e.prototype),{constructor:Uu,_bindAction:function(t,e){var r=t._localRoot||this._root,n=t._clip.tracks,i=n.length,o=t._propertyBindings,a=t._interpolants,s=r.uuid,u=this._bindingsByRootAndName,c=u[s];void 0===c&&(c={},u[s]=c);for(var l=0;l!==i;++l){var h=n[l],p=h.name,d=c[p];if(void 0!==d)o[l]=d;else{if(void 0!==(d=o[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=e&&e._propertyBindings[l].binding.parsedPath;++(d=new Su(Fu.create(r,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),o[l]=d}a[l].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,r=t._clip.uuid,n=this._actionsByClip[r];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,r,e)}for(var i=t._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,r=0,n=e.length;r!==n;++r){var i=e[r];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;for(var e=this._actions,r=this._nActiveActions,n=this.time+=t,i=Math.sign(t),o=this._accuIndex^=1,a=0;a!==r;++a)e[a]._update(n,t,i,o);var s=this._bindings,u=this._nActiveBindings;for(a=0;a!==u;++a)s[a].apply(o);return this},setTime:function(t){this.time=0;for(var e=0;ethis.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new a),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new a),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return Xu.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var Ku=new v,Ju=new v;function $u(t,e){this.start=void 0!==t?t:new v,this.end=void 0!==e?e:new v}function tc(t){V.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Object.assign($u.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new v),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new v),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new v),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){Ku.subVectors(t,this.start),Ju.subVectors(this.end,this.start);var r=Ju.dot(Ju),n=Ju.dot(Ku)/r;return e&&(n=o.clamp(n,0,1)),n},closestPointToPoint:function(t,e,r){var n=this.closestPointToPointParameter(t,e);return void 0===r&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),r=new v),this.delta(r).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),tc.prototype=Object.create(V.prototype),tc.prototype.constructor=tc,tc.prototype.isImmediateRenderObject=!0;var ec=new v;function rc(t,e){V.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var r=new ce,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,o=1;i<32;i++,o++){var a=i/32*Math.PI*2,s=o/32*Math.PI*2;n.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}r.setAttribute("position",new Jt(n,3));var u=new zi({fog:!1,toneMapped:!1});this.cone=new Xi(r,u),this.add(this.cone),this.update()}rc.prototype=Object.create(V.prototype),rc.prototype.constructor=rc,rc.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},rc.prototype.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),ec.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ec),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var nc=new v,ic=new I,oc=new I;function ac(t){for(var e=function t(e){var r=[];e&&e.isBone&&r.push(e);for(var n=0;n.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Sc.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Sc,e)}},Tc.prototype.setLength=function(t,e,r){void 0===e&&(e=.2*t),void 0===r&&(r=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()},Tc.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Tc.prototype.copy=function(t){return V.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Tc.prototype.clone=function(){return(new this.constructor).copy(this)},Pc.prototype=Object.create(Xi.prototype),Pc.prototype.constructor=Pc;var Oc=Math.pow(2,8),Lc=[.125,.215,.35,.446,.526,.582],kc=5+Lc.length,Rc={3e3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},Dc=new js,Bc=function(){for(var t=[],e=[],r=[],n=8,i=0;i4?a=Lc[i-8+4-1]:0==i&&(a=0),r.push(a);for(var s=1/(o-1),u=-s/2,c=1+s/2,l=[u,u,c,u,c,c,u,u,c,c,u,c],h=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var g=f%3*2/3-1,m=f>2?0:-1,y=[g,m,0,g+2/3,m,0,g+2/3,m+1,0,g,m,0,g+2/3,m+1,0,g,m+1,0];h.set(y,18*f),p.set(l,12*f);var v=[f,f,f,f,f,f];d.set(v,6*f)}var A=new ce;A.setAttribute("position",new Vt(h,3)),A.setAttribute("uv",new Vt(p,2)),A.setAttribute("faceIndex",new Vt(d,1)),t.push(A),n>4&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:r}}(),Nc=Bc._lodPlanes,Fc=Bc._sizeLods,jc=Bc._sigmas,zc=null,Uc=(1+Math.sqrt(5))/2,Gc=1/Uc,Hc=[new v(1,1,1),new v(-1,1,1),new v(1,1,-1),new v(-1,1,-1),new v(0,Uc,Gc),new v(0,Uc,-Gc),new v(Gc,0,Uc),new v(-Gc,0,Uc),new v(Uc,Gc,0),new v(-Uc,Gc,0)];function Vc(t){var e,r,n,i;this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=(e=20,r=new Float32Array(e),n=new v(0,1,0),(i=new Ia({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:Rc[3e3]},outputEncoding:{value:Rc[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#define ENVMAP_TYPE_CUBE_UV\n#include \n\nvec3 getSample(float theta, vec3 axis) {\n\tfloat cosTheta = cos(theta);\n\t// Rodrigues' axis-angle rotation\n\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\tif (all(equal(axis, vec3(0.0))))\n\t\taxis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\taxis = normalize(axis);\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n\tfor (int i = 1; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfloat theta = dTheta * float(i);\n\t\tgl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n\t\tgl_FragColor.rgb += weights[i] * getSample(theta, axis);\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",i),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function Qc(t){var e=new d(3*Oc,3*Oc,t);return e.texture.mapping=306,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function qc(t,e,r,n,i){t.viewport.set(e,r,n,i),t.scissor.set(e,r,n,i)}function Wc(){var t=new Ia({uniforms:{envMap:{value:null},texelSize:{value:new a(1,1)},inputEncoding:{value:Rc[3e3]},outputEncoding:{value:Rc[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#include \n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv = equirectUv( outputDirection );\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function Yc(){var t=new Ia({uniforms:{envMap:{value:null},inputEncoding:{value:Rc[3e3]},outputEncoding:{value:Rc[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:!1,depthWrite:!1});return t.type="CubemapToCubeUV",t}function Xc(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ys.call(this,t),this.type="catmullrom",this.closed=!0}function Zc(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ys.call(this,t),this.type="catmullrom"}function Kc(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),ys.call(this,t),this.type="catmullrom"}Vc.prototype={constructor:Vc,fromScene:function(t,e,r,n){void 0===e&&(e=0),void 0===r&&(r=.1),void 0===n&&(n=100),zc=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(t,r,n,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i},fromEquirectangular:function(t){return t.magFilter=1003,t.minFilter=1003,t.generateMipmaps=!1,this.fromCubemap(t)},fromCubemap:function(t){zc=this._renderer.getRenderTarget();var e=this._allocateTargets(t);return this._textureToCubeUV(t,e),this._applyPMREM(e),this._cleanup(e),e},compileCubemapShader:function(){null===this._cubemapShader&&(this._cubemapShader=Yc(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){null===this._equirectShader&&(this._equirectShader=Wc(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var t=0;t2?Oc:0,Oc,Oc),s.setRenderTarget(n),s.render(t,i)}s.toneMapping=c,s.toneMappingExposure=l,s.outputEncoding=u,s.setClearColor(h,p)},_textureToCubeUV:function(t,e){var r=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Yc()):null==this._equirectShader&&(this._equirectShader=Wc());var n=t.isCubeTexture?this._cubemapShader:this._equirectShader,i=new Me(Nc[0],n),o=n.uniforms;o.envMap.value=t,t.isCubeTexture||o.texelSize.value.set(1/t.image.width,1/t.image.height),o.inputEncoding.value=Rc[t.encoding],o.outputEncoding.value=Rc[e.texture.encoding],qc(e,0,0,3*Oc,2*Oc),r.setRenderTarget(e),r.render(i,Dc)},_applyPMREM:function(t){var e=this._renderer,r=e.autoClear;e.autoClear=!1;for(var n=1;n20&&console.warn("sigmaRadians, "+i+", is too large and will clip, as it requested "+f+" samples when the maximum is set to 20");for(var g=[],m=0,y=0;y<20;++y){var v=y/d,A=Math.exp(-v*v/2);g.push(A),0==y?m+=A:y4?n-8+4:0),3*_,2*_),s.setRenderTarget(e),s.render(c,Dc)}},cs.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(cs.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Ts.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new Re,r=0,n=t.length;rt[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]1&&void 0!==arguments[1]?arguments[1]:0;return[[t.point.x-e,t.point.y-e],[t.point.x+e,t.point.y+e]]}(t,n):e,o={};r.options.styles&&(o.layers=r.options.styles.map((function(t){return t.id}))),o.point=[t.lngLat.lng,t.lngLat.lat];var a=r.map.queryRenderedFeatures(i,o);"ol"===r.map.type&&(a=a.map((function(t){return{geometry:t.getGeometry(),properties:t.values_}}))),a=a.filter((function(t){return t.properties&&-1!==l.indexOf(t.properties.meta)||t.values_&&t.values_.meta}));var s=new c.a,h=[];return a.forEach((function(t){var e=t.properties.id;s.has(e)||(s.add(e),h.push(t))})),u(h)}e.a={click:function(t,e,r){return h(t,e,r,r.options.clickBuffer)},touch:function(t,e,r){return h(t,e,r,r.options.touchBuffer)}}},function(t,e){t.exports=function(t){return void 0===t}},function(t,e){const r={};function n(t){return"function"==typeof t}function i(t){return t===Object(t)}function o(t,e){var r=!1;return"string"==typeof e?e=[e]:"[object Array]"===Object.prototype.toString.call(e)?0===e.length&&(r=!0):r=!0,n(t)&&t(r,r?[]:e),r}function a(t,e){var i;if(n(r[t])){try{i=r[t](e)}catch(e){i=["Problem with custom definition for "+t+": "+e]}if("string"==typeof result&&(i=[i]),"[object Array]"===Object.prototype.toString.call(i))return i}return[]}e.define=function(t,e){return!(!(t in c)||!n(e))&&(r[t]=e,!0)},e.isPosition=function(t,e){var r=[];return Array.isArray(t)?(t.length<=1&&r.push("Position must be at least two elements"),t.forEach((function(t,e){"number"!=typeof t&&r.push("Position must only contain numbers. Item "+t+" at index "+e+" is invalid.")}))):r.push("Position must be an array"),o(e,r=r.concat(a("Position",t)))},e.isGeoJSONObject=e.valid=function(t,e){if(i(t)){var r=[];if("type"in t){if(s[t.type])return s[t.type](t,e);if(u[t.type])return u[t.type](t,e);r.push('type must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection"')}else r.push('must have a member with the name "type"');return o(e,r=r.concat(a("GeoJSONObject",t)))}return o(e,["must be a JSON Object"])},e.isGeometryObject=function(t,e){if(!i(t))return o(e,["must be a JSON Object"]);var r=[];if("type"in t){if(u[t.type])return u[t.type](t,e);r.push('type must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon" or "GeometryCollection"')}else r.push('must have a member with the name "type"');return o(e,r=r.concat(a("GeometryObject",t)))},e.isPoint=function(t,r){if(!i(t))return o(r,["must be a JSON Object"]);var n=[];return"bbox"in t&&e.isBbox(t.bbox,(function(t,e){t||(n=n.concat(e))})),"type"in t?"Point"!==t.type&&n.push('type must be "Point"'):n.push('must have a member with the name "type"'),"coordinates"in t?e.isPosition(t.coordinates,(function(t,e){t||n.push("Coordinates must be a single position")})):n.push('must have a member with the name "coordinates"'),o(r,n=n.concat(a("Point",t)))},e.isMultiPointCoor=function(t,r){var n=[];return Array.isArray(t)?t.forEach((function(t,r){e.isPosition(t,(function(t,e){t||(e[0]="at "+r+": ".concat(e[0]),n=n.concat(e))}))})):n.push("coordinates must be an array"),o(r,n)},e.isMultiPoint=function(t,r){if(!i(t))return o(r,["must be a JSON Object"]);var n=[];return"bbox"in t&&e.isBbox(t.bbox,(function(t,e){t||(n=n.concat(e))})),"type"in t?"MultiPoint"!==t.type&&n.push('type must be "MultiPoint"'):n.push('must have a member with the name "type"'),"coordinates"in t?e.isMultiPointCoor(t.coordinates,(function(t,e){t||(n=n.concat(e))})):n.push('must have a member with the name "coordinates"'),o(r,n=n.concat(a("MultiPoint",t)))},e.isLineStringCoor=function(t,r){var n=[];return Array.isArray(t)?t.length>1?t.forEach((function(t,r){e.isPosition(t,(function(t,e){t||(e[0]="at "+r+": ".concat(e[0]),n=n.concat(e))}))})):n.push("coordinates must have at least two elements"):n.push("coordinates must be an array"),o(r,n)},e.isLineString=function(t,r){if(!i(t))return o(r,["must be a JSON Object"]);var n=[];return"bbox"in t&&e.isBbox(t.bbox,(function(t,e){t||(n=n.concat(e))})),"type"in t?"LineString"!==t.type&&n.push('type must be "LineString"'):n.push('must have a member with the name "type"'),"coordinates"in t?e.isLineStringCoor(t.coordinates,(function(t,e){t||(n=n.concat(e))})):n.push('must have a member with the name "coordinates"'),o(r,n=n.concat(a("LineString",t)))},e.isMultiLineStringCoor=function(t,r){var n=[];Array.isArray(t)?t.forEach((function(t,r){e.isLineStringCoor(t,(function(t,e){t||(e[0]="at "+r+": ".concat(e[0]),n=n.concat(e))}))})):n.push("coordinates must be an array"),o(r,n)},e.isMultiLineString=function(t,r){if(!i(t))return o(r,["must be a JSON Object"]);var n=[];return"bbox"in t&&e.isBbox(t.bbox,(function(t,e){t||(n=n.concat(e))})),"type"in t?"MultiLineString"!==t.type&&n.push('type must be "MultiLineString"'):n.push('must have a member with the name "type"'),"coordinates"in t?e.isMultiLineStringCoor(t.coordinates,(function(t,e){t||(n=n.concat(e))})):n.push('must have a member with the name "coordinates"'),o(r,n=n.concat(a("MultiPoint",t)))},e.isPolygonCoor=function(t,r){var n=[];return Array.isArray(t)?t.forEach((function(t,r){!function(t,r){var n=[];Array.isArray(t)?(t.forEach((function(t,r){e.isPosition(t,(function(t,e){t||(e[0]="at "+r+": ".concat(e[0]),n=n.concat(e))}))})),t[0].toString()!==t[t.length-1].toString()&&n.push("The first and last positions must be equivalent"),t.length<4&&n.push("coordinates must have at least four positions")):n.push("coordinates must be an array"),o(r,n)}(t,(function(t,e){t||(e[0]="at "+r+": ".concat(e[0]),n=n.concat(e))}))})):n.push("coordinates must be an array"),o(r,n)},e.isPolygon=function(t,r){if(!i(t))return o(r,["must be a JSON Object"]);var n=[];return"bbox"in t&&e.isBbox(t.bbox,(function(t,e){t||(n=n.concat(e))})),"type"in t?"Polygon"!==t.type&&n.push('type must be "Polygon"'):n.push('must have a member with the name "type"'),"coordinates"in t?e.isPolygonCoor(t.coordinates,(function(t,e){t||(n=n.concat(e))})):n.push('must have a member with the name "coordinates"'),o(r,n=n.concat(a("Polygon",t)))},e.isMultiPolygonCoor=function(t,r){var n=[];Array.isArray(t)?t.forEach((function(t,r){e.isPolygonCoor(t,(function(t,e){t||(e[0]="at "+r+": ".concat(e[0]),n=n.concat(e))}))})):n.push("coordinates must be an array"),o(r,n)},e.isMultiPolygon=function(t,r){if(!i(t))return o(r,["must be a JSON Object"]);var n=[];return"bbox"in t&&e.isBbox(t.bbox,(function(t,e){t||(n=n.concat(e))})),"type"in t?"MultiPolygon"!==t.type&&n.push('type must be "MultiPolygon"'):n.push('must have a member with the name "type"'),"coordinates"in t?e.isMultiPolygonCoor(t.coordinates,(function(t,e){t||(n=n.concat(e))})):n.push('must have a member with the name "coordinates"'),o(r,n=n.concat(a("MultiPolygon",t)))},e.isGeometryCollection=function(t,r){if(!i(t))return o(r,["must be a JSON Object"]);var n=[];return"bbox"in t&&e.isBbox(t.bbox,(function(t,e){t||(n=n.concat(e))})),"type"in t?"GeometryCollection"!==t.type&&n.push('type must be "GeometryCollection"'):n.push('must have a member with the name "type"'),"geometries"in t?Array.isArray(t.geometries)?t.geometries.forEach((function(t,r){e.isGeometryObject(t,(function(t,e){t||(e[0]="at "+r+": ".concat(e[0]),n=n.concat(e))}))})):n.push('"geometries" must be an array'):n.push('must have a member with the name "geometries"'),o(r,n=n.concat(a("GeometryCollection",t)))},e.isFeature=function(t,r){if(!i(t))return o(r,["must be a JSON Object"]);var n=[];return"bbox"in t&&e.isBbox(t.bbox,(function(t,e){t||(n=n.concat(e))})),"type"in t?"Feature"!==t.type&&n.push('type must be "Feature"'):n.push('must have a member with the name "type"'),"properties"in t||n.push('must have a member with the name "properties"'),"geometry"in t?null!==t.geometry&&e.isGeometryObject(t.geometry,(function(t,e){t||(n=n.concat(e))})):n.push('must have a member with the name "geometry"'),o(r,n=n.concat(a("Feature",t)))},e.isFeatureCollection=function(t,r){if(!i(t))return o(r,["must be a JSON Object"]);var n=[];return"bbox"in t&&e.isBbox(t.bbox,(function(t,e){t||(n=n.concat(e))})),"type"in t?"FeatureCollection"!==t.type&&n.push('type must be "FeatureCollection"'):n.push('must have a member with the name "type"'),"features"in t?Array.isArray(t.features)?t.features.forEach((function(t,r){e.isFeature(t,(function(t,e){t||(e[0]="at "+r+": ".concat(e[0]),n=n.concat(e))}))})):n.push('"Features" must be an array'):n.push('must have a member with the name "Features"'),o(r,n=n.concat(a("FeatureCollection",t)))},e.isBbox=function(t,e){var r=[];Array.isArray(t)?t.length%2!=0&&r.push("bbox, must be a 2*n array"):r.push("bbox must be an array"),o(e,r=r.concat(a("Bbox",t)))};const s={Feature:e.isFeature,FeatureCollection:e.isFeatureCollection},u={Point:e.isPoint,MultiPoint:e.isMultiPoint,LineString:e.isLineString,MultiLineString:e.isMultiLineString,Polygon:e.isPolygon,MultiPolygon:e.isMultiPolygon,GeometryCollection:e.isGeometryCollection},c={Feature:e.isFeature,FeatureCollection:e.isFeatureCollection,Point:e.isPoint,MultiPoint:e.isMultiPoint,LineString:e.isLineString,MultiLineString:e.isMultiLineString,Polygon:e.isPolygon,MultiPolygon:e.isMultiPolygon,GeometryCollection:e.isGeometryCollection,Bbox:e.isBox,Position:e.isPosition,GeoJSON:e.isGeoJSONObject,GeometryObject:e.isGeometryObject};e.allTypes=c},function(t,e,r){"use strict";function n(t,e,r,n,i,o){for(var a=o||[],s=0,u=e;u>1;o0},e.prototype.removeEventListener=function(t,e){var r=this.listeners_[t];if(r){var n=r.indexOf(e);t in this.pendingRemovals_?(r[n]=o.c,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t])}},e}(n.a);e.a=s},function(t,e,r){"use strict";r.d(e,"a",(function(){return a})),r.d(e,"b",(function(){return s})),r.d(e,"c",(function(){return u})),r.d(e,"d",(function(){return c}));var n=r(25),i=r(109),o=r(261);function a(t,e,r,i,a){var s=Object(n.p)(Object(n.h)(),t,e,r,i);return!!Object(n.z)(a,s)&&(!!Object(n.f)(a,s)||(s[0]>=a[0]&&s[2]<=a[2]||(s[1]>=a[1]&&s[3]<=a[3]||Object(o.a)(t,e,r,i,(function(t,e){return Object(n.A)(a,t,e)})))))}function s(t,e,r,n,i){for(var o=0,s=r.length;or&&(r=o),la&&(a=l),oc&&(c=p)}));var l=e;return r+l.lat>o.LAT_RENDERED_MAX&&(l.lat=o.LAT_RENDERED_MAX-r),a+l.lat>o.LAT_MAX&&(l.lat=o.LAT_MAX-a),n+l.lat=o.LNG_MAX&&(l.lng-=360*Math.ceil(Math.abs(l.lng)/360)),l}},function(t,e,r){"use strict";var n=r(154),i=r(5);e.a=function(t,e){var r=Object(n.a)(t.map((function(t){return t.toGeoJSON()})),e);t.forEach((function(t){var e,n=t.getCoordinates(),o=function(t){var e={lng:t[0]+r.lng,lat:t[1]+r.lat};return[e.lng,e.lat]},a=function(t){return t.map((function(t){return o(t)}))};t.type===i.g.geojsonTypes.POINT?e=o(n):t.type===i.g.geojsonTypes.LINE_STRING||t.type===i.g.geojsonTypes.MULTI_POINT?e=n.map(o):t.type===i.g.geojsonTypes.POLYGON||t.type===i.g.geojsonTypes.MULTI_LINE_STRING?(e=n.map(a),t.center&&(t.center=o(t.center)),t.properties.center&&(t.properties.center=o(t.properties.center))):t.type===i.g.geojsonTypes.MULTI_POLYGON&&(e=n.map((function(t){return t.map((function(t){return a(t)}))}))),t.incomingCoords(e)}))}},function(t,e,r){"use strict";r.r(e),r.d(e,"create",(function(){return i})),r.d(e,"clone",(function(){return o})),r.d(e,"fromValues",(function(){return a})),r.d(e,"copy",(function(){return s})),r.d(e,"set",(function(){return u})),r.d(e,"add",(function(){return c})),r.d(e,"subtract",(function(){return l})),r.d(e,"multiply",(function(){return h})),r.d(e,"divide",(function(){return p})),r.d(e,"ceil",(function(){return d})),r.d(e,"floor",(function(){return f})),r.d(e,"min",(function(){return g})),r.d(e,"max",(function(){return m})),r.d(e,"round",(function(){return y})),r.d(e,"scale",(function(){return v})),r.d(e,"scaleAndAdd",(function(){return A})),r.d(e,"distance",(function(){return _})),r.d(e,"squaredDistance",(function(){return b})),r.d(e,"length",(function(){return x})),r.d(e,"squaredLength",(function(){return w})),r.d(e,"negate",(function(){return C})),r.d(e,"inverse",(function(){return E})),r.d(e,"normalize",(function(){return I})),r.d(e,"dot",(function(){return M})),r.d(e,"cross",(function(){return S})),r.d(e,"lerp",(function(){return T})),r.d(e,"random",(function(){return P})),r.d(e,"transformMat2",(function(){return O})),r.d(e,"transformMat2d",(function(){return L})),r.d(e,"transformMat3",(function(){return k})),r.d(e,"transformMat4",(function(){return R})),r.d(e,"rotate",(function(){return D})),r.d(e,"angle",(function(){return B})),r.d(e,"zero",(function(){return N})),r.d(e,"str",(function(){return F})),r.d(e,"exactEquals",(function(){return j})),r.d(e,"equals",(function(){return z})),r.d(e,"len",(function(){return G})),r.d(e,"sub",(function(){return H})),r.d(e,"mul",(function(){return V})),r.d(e,"div",(function(){return Q})),r.d(e,"dist",(function(){return q})),r.d(e,"sqrDist",(function(){return W})),r.d(e,"sqrLen",(function(){return Y})),r.d(e,"forEach",(function(){return X}));var n=r(34);function i(){var t=new n.a(2);return n.a!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new n.a(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var r=new n.a(2);return r[0]=t,r[1]=e,r}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,r){return t[0]=e,t[1]=r,t}function c(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function l(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function h(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function p(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function f(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function g(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function m(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function v(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function A(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function _(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function b(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function x(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function w(t){var e=t[0],r=t[1];return e*e+r*r}function C(t,e){return t[0]=-e[0],t[1]=-e[1],t}function E(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function I(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function M(t,e){return t[0]*e[0]+t[1]*e[1]}function S(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function T(t,e,r,n){var i=e[0],o=e[1];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t}function P(t,e){e=e||1;var r=2*n.c()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function O(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function L(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function k(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function R(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function D(t,e,r,n){var i=e[0]-r[0],o=e[1]-r[1],a=Math.sin(n),s=Math.cos(n);return t[0]=i*s-o*a+r[0],t[1]=i*a+o*s+r[1],t}function B(t,e){var r=t[0],n=t[1],i=e[0],o=e[1],a=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+o*o),s=a&&(r*i+n*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function N(t){return t[0]=0,t[1]=0,t}function F(t){return"vec2("+t[0]+", "+t[1]+")"}function j(t,e){return t[0]===e[0]&&t[1]===e[1]}function z(t,e){var r=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(r-o)<=n.b*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.b*Math.max(1,Math.abs(i),Math.abs(a))}var U,G=x,H=l,V=h,Q=p,q=_,W=b,Y=w,X=(U=i(),function(t,e,r,n,i,o){var a,s;for(e||(e=2),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;ai.g.LAT_RENDERED_MAX||o[1]i.g.LAT_RENDERED_MAX||a[1]1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=t.geometry,u=s.type,c=s.coordinates,l=t.properties&&t.properties.id,h=[];function p(t){return!!e.selectedPaths&&-1!==e.selectedPaths.indexOf(t)}function d(t,r){var i="",a=null;t.forEach((function(t,s){var u=null!=r?"".concat(r,".").concat(s):String(s),c=Object(n.a)(l,t,u,p(u));if(e.midpoints&&a){var d=o(l,a,c,e.map);d&&h.push(d)}a=c;var f=JSON.stringify(t);i!==f&&h.push(c),0===s&&(i=f)}))}function f(){var r=u.replace(i.g.geojsonTypes.MULTI_PREFIX,"");c.forEach((function(n,o){var s={type:i.g.geojsonTypes.FEATURE,properties:t.properties,geometry:{type:r,coordinates:n}};h=h.concat(a(s,e,o))}))}return u===i.g.geojsonTypes.POINT?h.push(Object(n.a)(l,c,r,p(r))):u===i.g.geojsonTypes.POLYGON?c.forEach((function(t,e){d(t,null!==r?"".concat(r,".").concat(e):String(e))})):u===i.g.geojsonTypes.LINE_STRING?d(c,r):0===u.indexOf(i.g.geojsonTypes.MULTI_PREFIX)&&f(),h}},function(t,e,r){var n=r(149),i=r(112);t.exports=function(t){return"number"==typeof t||i(t)&&"[object Number]"==n(t)}},function(t,e,r){"use strict";r.r(e);var n=r(60);function i(t){var e=[1/0,1/0,-1/0,-1/0];return Object(n.coordEach)(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]g&&y.push(Object(n.a)(t,e,g,l).geometry.coordinates),Object(i.i)(y,d)},u=r(54),c=r(57);function l(t){var e=t%360;return e<0&&(e+=360),e}e.a=function(t,e,r,n,a){if(a=a||{},!Object(i.g)(a))throw new Error("options is invalid");if(!t)throw new Error("center is required");if(null==r)throw new Error("bearing1 is required");if(null==n)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof a)throw new Error("options must be an object");if(l(r)===l(n))return o(t,e,a);var h=Object(c.b)(t),p=s(t,e,r,n,a),d=[[h]];return Object(u.a)(p,(function(t){d[0].push(t)})),d[0].push(h),Object(i.k)(d)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return b}));var n=r(23),i=r.n(n),o=r(3),a=r.n(o),s=r(4),u=r.n(s);function c(){if(!(this instanceof c))return new c;this.size=0,this.uid=0,this.selectors=[],this.selectorObjects={},this.indexes=Object.create(this.indexes),this.activeIndexes=[]}var l=window.document.documentElement,h=l.matches||l.webkitMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.msMatchesSelector;c.prototype.matchesSelector=function(t,e){return h.call(t,e)},c.prototype.querySelectorAll=function(t,e){return e.querySelectorAll(t)},c.prototype.indexes=[];var p=/^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;c.prototype.indexes.push({name:"ID",selector:function(t){var e;if(e=t.match(p))return e[0].slice(1)},element:function(t){if(t.id)return[t.id]}});var d=/^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;c.prototype.indexes.push({name:"CLASS",selector:function(t){var e;if(e=t.match(d))return e[0].slice(1)},element:function(t){var e=t.className;if(e){if("string"==typeof e)return e.split(/\s/);if("object"==typeof e&&"baseVal"in e)return e.baseVal.split(/\s/)}}});var f,g=/^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;c.prototype.indexes.push({name:"TAG",selector:function(t){var e;if(e=t.match(g))return e[0].toUpperCase()},element:function(t){return[t.nodeName.toUpperCase()]}}),c.prototype.indexes.default={name:"UNIVERSAL",selector:function(){return!0},element:function(){return[!0]}},f="function"==typeof window.Map?window.Map:function(){function t(){this.map={}}return t.prototype.get=function(t){return this.map[t+" "]},t.prototype.set=function(t,e){this.map[t+" "]=e},t}();var m=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;function y(t,e){var r,n,i,o,a,s,u=(t=t.slice(0).concat(t.default)).length,c=e,l=[];do{if(m.exec(""),(i=m.exec(c))&&(c=i[3],i[2]||!c))for(r=0;rs||nu},b=function(){function t(){a()(this,t)}return u()(t,null,[{key:"setDelegateContainer",value:function(e){t.delegateContainer=e||window.document}},{key:"delegate",value:function(e){var r=(1===e.eventPhase?t.captureEvents:t.bubbleEvents)[e.type];if(r){var n=e.target,i=t.matches(r,n,1===e.eventPhase);if(i.length){t.collectEventStops(e,"stopPropagation"),t.collectEventStops(e,"stopImmediatePropagation"),t.defineCurrentTarget(e,t.getCurrentTarget);for(var o=0,a=i.length;o10&&console.warn("\n MaxListenersExceededWarning: Possible DOM event memory leak detected. ".concat(s._matches.length," \n event listeners added to ").concat(e.type," type. Please check and make sure you really need these listeners!"));for(var u=0,c=s._matches.length;u0)for(var a=0;a3&&void 0!==arguments[3]?arguments[3]:{},o=!!i.capture,a=o?t.captureEvents:t.bubbleEvents,s=a[e];if(!s){s=new c,a[e]=s;document.addEventListener(e,t.delegate,o)}s.add(r,n)}},{key:"fire",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r}))}},{key:"off",value:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!!n.capture,o=i?t.captureEvents:t.bubbleEvents,a=o[e];if(a&&(a.remove(r),!a.size)){delete o[e];var s=e;document.removeEventListener(s,t.delegate,i)}}}]),t}();b.bubbleEvents={},b.captureEvents={},b.propagationStopped=new WeakMap,b.immediatePropagationStopped=new WeakMap,b.currentTargets=new WeakMap,b.currentTargetDesc=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget"),b.delegateContainer=window.document},function(t,e,r){"use strict";r.d(e,"d",(function(){return c})),r.d(e,"a",(function(){return h})),r.d(e,"b",(function(){return p}));var n=r(48),i=r(20),o=r(319),a=r(185),s=r(187),u=function(t){var e=t||{};this.geometry_=null,this.geometryFunction_=d,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex};function c(t){var e;if("function"==typeof t)e=t;else{var r;if(Array.isArray(t))r=t;else Object(n.a)("function"==typeof t.getZIndex,41),r=[t];e=function(){return r}}return e}u.prototype.clone=function(){var t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new u({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},u.prototype.getRenderer=function(){return this.renderer_},u.prototype.setRenderer=function(t){this.renderer_=t},u.prototype.getGeometry=function(){return this.geometry_},u.prototype.getGeometryFunction=function(){return this.geometryFunction_},u.prototype.getFill=function(){return this.fill_},u.prototype.setFill=function(t){this.fill_=t},u.prototype.getImage=function(){return this.image_},u.prototype.setImage=function(t){this.image_=t},u.prototype.getStroke=function(){return this.stroke_},u.prototype.setStroke=function(t){this.stroke_=t},u.prototype.getText=function(){return this.text_},u.prototype.setText=function(t){this.text_=t},u.prototype.getZIndex=function(){return this.zIndex_},u.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=d,this.geometry_=t},u.prototype.setZIndex=function(t){this.zIndex_=t};var l=null;function h(t,e){if(!l){var r=new a.a({color:"rgba(255,255,255,0.4)"}),n=new s.a({color:"#3399CC",width:1.25});l=[new u({image:new o.a({fill:r,stroke:n,radius:5}),fill:r,stroke:n})]}return l}function p(){var t={},e=[255,255,255,1],r=[0,153,255,1];return t[i.a.POLYGON]=[new u({fill:new a.a({color:[255,255,255,.5]})})],t[i.a.MULTI_POLYGON]=t[i.a.POLYGON],t[i.a.LINE_STRING]=[new u({stroke:new s.a({color:e,width:5})}),new u({stroke:new s.a({color:r,width:3})})],t[i.a.MULTI_LINE_STRING]=t[i.a.LINE_STRING],t[i.a.CIRCLE]=t[i.a.POLYGON].concat(t[i.a.LINE_STRING]),t[i.a.POINT]=[new u({image:new o.a({radius:6,fill:new a.a({color:r}),stroke:new s.a({color:e,width:1.5})}),zIndex:1/0})],t[i.a.MULTI_POINT]=t[i.a.POINT],t[i.a.GEOMETRY_COLLECTION]=t[i.a.POLYGON].concat(t[i.a.LINE_STRING],t[i.a.POINT]),t}function d(t){return t.getGeometry()}e.c=u},function(t,e,r){var n=r(328),i=r(361),o=r(349),a=r(55);t.exports=function(t,e){return(a(t)?n:i)(t,o(e))}},function(t,e,r){var n=r(368),i=r(294),o=Math.max;t.exports=function(t,e,r){var a=null==t?0:t.length;if(!a)return-1;var s=null==r?0:i(r);return s<0&&(s=o(a+s,0)),n(t,e,s)}},,function(t,e,r){var n=r(520),i=r(525);t.exports=function(t,e){var r=i(t,e);return n(r)?r:void 0}},function(t,e,r){var n=r(90),i=r(284);t.exports=function(t){return null!=t&&i(t.length)&&!n(t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}},function(t,e,r){"use strict";(function(t,n){r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return s}));var i=r(110),o={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document,process:"object"===(void 0===n?"undefined":Object(i.a)(n))&&n},a=o.window||o.self||o.global,s=o.process||{};console}).call(this,r(123),r(124))},function(t,e,r){"use strict";r.d(e,"a",(function(){return w})),r.d(e,"b",(function(){return E})),r.d(e,"c",(function(){return I}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(17),u=r.n(s),c=r(12),l=r.n(c),h=r(13),p=r.n(h),d=r(10),f=r.n(d),g=r(36),m=r(96),y=r(186),v=r(166),A=r(187),_=r(21),b=r(2);function x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return p()(this,r)}}var w=[0,1,2,3],C={0:"road-tap-100",1:"road-tap-101",2:"road-tap-102",3:"road-tap-103"},E=function(t){l()(r,t);var e=x(r);function r(t,n,o){var a;return i()(this,r),(a=e.call(this,null,o)).style=void 0,a.data=void 0,a._layerIds=void 0,a._visible=void 0,a.beforeLayerId=void 0,a.mapContainerId=void 0,a.mapContainerId=o,a.style=t.filterableLineOps,a.data=Object(b.buildEmptyFeatureCollection)(),a.beforeLayerId=n,a._layerIds=[],a._visible=!0,a.init(),a}return a()(r,[{key:"init",value:function(){this.setLayerFeature(this.data)}},{key:"buildLayer",value:function(){for(var t=0,e=Object(b.arrayLength)(this.style);t1}},{key:"addCoordinate",value:function(t,e,r){this.changed();var n=parseInt(t,10);this.coordinates.splice(n,0,[e,r])}},{key:"getCoordinate",value:function(t){var e=parseInt(t,10);return JSON.parse(JSON.stringify(this.coordinates[e]))}},{key:"removeCoordinate",value:function(t){this.changed(),this.coordinates.splice(parseInt(t,10),1)}},{key:"updateCoordinate",value:function(t,e,r){var n=parseInt(t,10);this.coordinates[n]=[e,r],this.changed()}}]),r}(r(127).a)},function(t,e,r){"use strict";r.d(e,"a",(function(){return f}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(12),u=r.n(s),c=r(13),l=r.n(c),h=r(10),p=r.n(h);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p()(t);if(e){var i=p()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}var f=function(t){u()(r,t);var e=d(r);function r(t,n){var o;return i()(this,r),(o=e.call(this,t,n)).coordinates=o.coordinates.map((function(t){return t.slice(0,-1)})),o}return a()(r,[{key:"isValid",value:function(){return 0!==this.coordinates.length&&this.coordinates.every((function(t){return t.length>2}))}},{key:"incomingCoords",value:function(t){this.coordinates=t.map((function(t){return t.slice(0,-1)})),this.changed()}},{key:"setCoordinates",value:function(t){this.coordinates=t,this.changed()}},{key:"addCoordinate",value:function(t,e,r){this.changed();var n=t.split(".").map((function(t){return parseInt(t,10)}));this.coordinates[n[0]].splice(n[1],0,[e,r])}},{key:"removeCoordinate",value:function(t){this.changed();var e=t.split(".").map((function(t){return parseInt(t,10)})),r=this.coordinates[e[0]];r&&(r.splice(e[1],1),r.length<3&&this.coordinates.splice(e[0],1))}},{key:"getCoordinate",value:function(t){var e=t.split(".").map((function(t){return parseInt(t,10)})),r=this.coordinates[e[0]];return r[e[1]]?JSON.parse(JSON.stringify(r[e[1]])):[]}},{key:"getCoordinates",value:function(){return this.coordinates.map((function(t){return t.concat([t[0]])}))}},{key:"updateCoordinate",value:function(t,e,r){this.changed();var n=t.split("."),i=parseInt(n[0],10),o=parseInt(n[1],10);void 0===this.coordinates[i]&&(this.coordinates[i]=[]),this.coordinates[i][o]=[e,r]}}]),r}(r(127).a)},function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return a}));var n=r(59),i=r(109);function o(t,e,r,o,a,s,u){for(var c,l,h,p,d,f,g,m=a[s+1],y=[],v=0,A=r.length;vx&&(h=(p+d)/2,Object(i.c)(t,e,r,o,h,m)&&(b=h,x=w)),p=d}return isNaN(b)&&(b=a[s]),u?(u.push(b,m,x),u):[b,m,x]}function a(t,e,r,n,i){for(var a=[],s=0,u=r.length;s=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);ro&&(d=0,p++),s[t]={x:d,y:h+30*p,width:30,height:30,advance:n},d+=30}}));var f=n+2*i;return{mapping:s,xOffset:d,yOffset:h+p*f,canvasHeight:C(h+(p+1)*f)}}(S({getFontWidth:function(t){return p.measureText(t).width},fontHeight:1*a,buffer:s,characterSet:e,maxCanvasWidth:1024},r&&{mapping:r.mapping,xOffset:r.xOffset,yOffset:r.yOffset})),f=d.mapping,g=d.canvasHeight,m=d.xOffset,v=d.yOffset,A=p.getImageData(0,0,h.width,h.height);if(h.height=g,p.putImageData(A,0,0),P(p,i,a,o),u){var _,b=new y.a(a,s,c,l,i,o),x=p.getImageData(0,0,b.size,b.size),w=E(e);try{for(w.s();!(_=w.n()).done;){var I=_.value;O(b.draw(I),x),p.putImageData(x,f[I].x,f[I].y)}}catch(t){w.e(t)}finally{w.f()}}else{var M,T=E(e);try{for(T.s();!(M=T.n()).done;){var L=M.value;p.fillText(L,f[L].x,f[L].y+1*a)}}catch(t){T.e(t)}finally{T.f()}}return{xOffset:m,yOffset:v,mapping:f,data:h,width:h.width,height:h.height}}},{key:"getKey",value:function(){var t=this.fontOptions,e=t.fontFamily,r=t.fontWeight,n=t.fontSize,i=t.buffer,o=t.sdf,a=t.radius,s=t.cutoff;return o?"".concat(e," ").concat(r," ").concat(n," ").concat(i," ").concat(a," ").concat(s):"".concat(e," ").concat(r," ").concat(n," ").concat(i)}},{key:"getNewChars",value:function(t,e){var r=this.cache.get(t);if(!r)return e;var n=[],i=r.mapping,o=new Set(Object.keys(i));return new Set(e).forEach((function(t){o.has(t)||n.push(t)})),n}}]),t}())||x,R=r(12),D=r.n(R),B=r(13),N=r.n(B),F=r(10),j=r.n(F);function z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=j()(t);if(e){var i=j()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return N()(this,r)}}var U,G,H=Object(o.injectable)()(L=function(t){D()(r,t);var e=z(r);function r(){var t;p()(this,r);for(var n=arguments.length,i=new Array(n),o=0;or&&(w(u,s,o),i=0,o=a+o+e,a=0,s=[]),s.push({icon:l,xOffset:i}),i=i+h+e,a=Math.max(a,h)}}}catch(t){c.e(t)}finally{c.f()}return s.length>0&&w(u,s,o),{mapping:u,canvasHeight:C(a+o+e)}}(this.iconData,3,1024),e=t.mapping,r=t.canvasHeight;this.iconMap=e,this.canvasHeight=r}},{key:"loadImage",value:function(t){return new Promise((function(e,r){if(t instanceof HTMLImageElement)e(t);else{var n=new Image;n.crossOrigin="anonymous",n.onload=function(){e(n)},n.onerror=function(){r(new Error("Could not load image at "+t))},n.src=t instanceof File?URL.createObjectURL(t):t}}))}}]),r}(n.EventEmitter))||L,V=r(47),Q=r.n(V),q=r(29),W=Object(o.injectable)()(U=function(){function t(){p()(this,t),this.viewport=void 0,this.overridedViewProjectionMatrix=void 0,this.jitteredViewProjectionMatrix=void 0,this.jitteredProjectionMatrix=void 0,this.viewMatrixInverse=void 0,this.cameraPosition=void 0}return f()(t,[{key:"init",value:function(){}},{key:"update",value:function(t){this.viewport=t,this.viewMatrixInverse=q.a.invert(q.a.create(),this.getViewMatrix()),this.cameraPosition=[this.viewMatrixInverse[12],this.viewMatrixInverse[13],this.viewMatrixInverse[14]]}},{key:"getProjectionMatrix",value:function(){return this.jitteredProjectionMatrix||this.viewport.getProjectionMatrix()}},{key:"getViewMatrix",value:function(){return this.viewport.getViewMatrix()}},{key:"getViewMatrixUncentered",value:function(){return this.viewport.getViewMatrixUncentered()}},{key:"getViewProjectionMatrixUncentered",value:function(){return this.viewport.getViewProjectionMatrixUncentered()}},{key:"getViewProjectionMatrix",value:function(){return this.overridedViewProjectionMatrix||this.jitteredViewProjectionMatrix||this.viewport.getViewProjectionMatrix()}},{key:"getZoom",value:function(){return this.viewport.getZoom()}},{key:"getZoomScale",value:function(){return this.viewport.getZoomScale()}},{key:"getCenter",value:function(){var t=this.viewport.getCenter(),e=Q()(t,2);return[e[0],e[1]]}},{key:"getFocalDistance",value:function(){return this.viewport.getFocalDistance()}},{key:"getCameraPosition",value:function(){return this.cameraPosition}},{key:"projectFlat",value:function(t,e){return this.viewport.projectFlat(t,e)}},{key:"setViewProjectionMatrix",value:function(t){this.overridedViewProjectionMatrix=t}},{key:"jitterProjectionMatrix",value:function(t,e){var r=q.a.fromTranslation(q.a.create(),[t,e,0]);this.jitteredProjectionMatrix=q.a.multiply(q.a.create(),r,this.viewport.getProjectionMatrix()),this.jitteredViewProjectionMatrix=q.a.multiply(q.a.create(),this.jitteredProjectionMatrix,this.viewport.getViewMatrix())}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0,this.jitteredViewProjectionMatrix=void 0}}]),t}())||U;function Y(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r-1&&this.controls.splice(e,1),t.remove(),this}},{key:"addControls",value:function(){var t=this;this.unAddControls.forEach((function(e){e.addTo(t.scene),t.controls.push(e)})),this.unAddControls=[]}},{key:"destroy",value:function(){var t,e=Y(this.controls);try{for(e.s();!(t=e.n()).done;){t.value.remove()}}catch(t){e.e(t)}finally{e.f()}this.controls=[],this.clearControlPos()}},{key:"initControlPos",value:function(){var t=this.controlCorners={},e="l7-",r=this.controlContainer=g.a.create("div","l7-control-container",this.container);function n(n,i){var o=e+n+" "+e+i;t[n+i]=g.a.create("div",o,r)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")}},{key:"clearControlPos",value:function(){for(var t in this.controlCorners)this.controlCorners[t]&&g.a.remove(this.controlCorners[t]);this.controlContainer&&g.a.remove(this.controlContainer),delete this.controlCorners,delete this.controlContainer}}]),t}())||G,tt=Object(o.injectable)()(Z=function(){function t(){p()(this,t),this.container=void 0,this.scene=void 0,this.mapsService=void 0,this.markers=[],this.markerLayers=[],this.unAddMarkers=[],this.unAddMarkerLayers=[]}return f()(t,[{key:"addMarkerLayer",value:function(t){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markerLayers.push(t),t.addTo(this.scene)):this.unAddMarkerLayers.push(t)}},{key:"removeMarkerLayer",value:function(t){t.destroy(),this.markerLayers.indexOf(t);var e=this.markerLayers.indexOf(t);e>-1&&this.markerLayers.splice(e,1)}},{key:"addMarker",value:function(t){this.mapsService.map&&this.mapsService.getMarkerContainer()?(this.markers.push(t),t.addTo(this.scene)):this.unAddMarkers.push(t)}},{key:"addMarkers",value:function(){var t=this;this.unAddMarkers.forEach((function(e){e.addTo(t.scene),t.markers.push(e)})),this.unAddMarkers=[]}},{key:"addMarkerLayers",value:function(){var t=this;this.unAddMarkerLayers.forEach((function(e){t.markerLayers.push(e),e.addTo(t.scene)})),this.unAddMarkers=[]}},{key:"removeMarker",value:function(t){t.remove(),this.markers.indexOf(t);var e=this.markers.indexOf(t);e>-1&&this.markers.splice(e,1)}},{key:"removeAllMarkers",value:function(){this.destroy()}},{key:"init",value:function(t){this.scene=t,this.mapsService=t.get(u.a.IMapService)}},{key:"destroy",value:function(){this.markers.forEach((function(t){t.remove()})),this.markers=[],this.markerLayers.forEach((function(t){t.destroy()})),this.markerLayers=[]}},{key:"removeMakerLayerMarker",value:function(t){t.destroy()}}]),t}())||Z,et=Object(o.injectable)()(K=function(){function t(){p()(this,t),this.scene=void 0,this.popup=void 0,this.mapsService=void 0,this.unAddPopup=void 0}return f()(t,[{key:"removePopup",value:function(t){t.remove()}},{key:"destroy",value:function(){this.popup.remove()}},{key:"addPopup",value:function(t){this.popup&&this.popup.remove(),this.mapsService.map&&this.mapsService.getMarkerContainer()?(t.addTo(this.scene),this.popup=t):this.unAddPopup=t}},{key:"initPopup",value:function(){this.unAddPopup&&(this.addPopup(this.unAddPopup),this.unAddPopup=null)}},{key:"init",value:function(t){this.scene=t,this.mapsService=t.get(u.a.IMapService)}}]),t}())||K,rt=r(270),nt=r.n(rt),it={MapToken:"您正在使用 Demo测试地图token,如果生产环境中使用去对应地图请注册Token",SDK:"请确认引入了mapbox-gl api且在L7之前引入"};function ot(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function at(t){for(var e=1;ed-1*g.a.DPR||_<0||b>f-1*g.a.DPR||b<0)return!1;if(0!==(m=h({x:Math.floor(_/e.pickBufferScale),y:Math.floor((f-(o+1)*g.a.DPR)/e.pickBufferScale),width:1,height:1,data:new Uint8Array(4),framebuffer:e.pickingFBO}))[0]||0!==m[1]||0!==m[2]){var x=Object(g.k)(m),w=t.getSource().getFeatureById(x);x!==t.getCurrentPickId()&&"mousemove"===s&&(s="mouseenter");var C={x:i,y:o,type:s,lngLat:a,featureId:x,feature:w,target:u};w&&(c=!0,t.setCurrentPickId(x),e.triggerHoverOnLayer(t,C))}else{var E={x:i,y:o,lngLat:a,type:null!==t.getCurrentPickId()&&"mousemove"===s?"mouseout":"un"+s,featureId:null,target:u,feature:null};e.triggerHoverOnLayer(t,re(re({},E),{},{type:"unpick"})),e.triggerHoverOnLayer(t,E),t.setCurrentPickId(null)}if(v&&e.highlightPickedFeature(t,m),A&&"click"===s&&(null===(n=m)||void 0===n?void 0:n.toString())!==[0,0,0,0].toString()){var I=Object(g.k)(m);null===t.getCurrentSelectedId()||I!==t.getCurrentSelectedId()?(e.selectFeature(t,m),t.setCurrentSelectedId(I)):(e.selectFeature(t,new Uint8Array([0,0,0,0])),t.setCurrentSelectedId(null))}return c}}var e,r,n;return f()(t,[{key:"init",value:function(t){var e=this.rendererService,r=e.createTexture2D,n=e.createFramebuffer,i=(e.getViewportSize,(0,e.getContainer)().getBoundingClientRect()),o=i.width,a=i.height;o*=g.a.DPR,a*=g.a.DPR,this.pickBufferScale=this.configService.getSceneConfig(t).pickBufferScale||1,this.pickingFBO=n({color:r({width:Math.round(o/this.pickBufferScale),height:Math.round(a/this.pickBufferScale),wrapS:te.a.CLAMP_TO_EDGE,wrapT:te.a.CLAMP_TO_EDGE})}),this.interactionService.on(Dt.a.Hover,this.pickingAllLayer.bind(this))}},{key:"boxPickLayer",value:(n=Kt()($t.a.mark((function t(e,r,n){var i,o,a,s=this;return $t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=this.rendererService,o=i.useFramebuffer,a=i.clear,i.getContainer,this.resizePickingFBO(),o(this.pickingFBO,(function(){a({framebuffer:s.pickingFBO,color:[0,0,0,0],stencil:0,depth:1}),e.hooks.beforePickingEncode.call(),e.renderModels(),e.hooks.afterPickingEncode.call();var t=s.pickBox(e,r);n(t)}));case 3:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return n.apply(this,arguments)})},{key:"pickBox",value:function(t,e){var r,n=this,i=e.map((function(t){var e=t<0?0:t;return Math.floor(e*g.a.DPR/n.pickBufferScale)})),o=Q()(i,4),a=o[0],s=o[1],u=o[2],c=o[3],l=this.rendererService,h=(l.getViewportSize,l.readPixels),p=(0,l.getContainer)().getBoundingClientRect(),d=p.width,f=p.height;if(d*=g.a.DPR,f*=g.a.DPR,a>(d-1)*g.a.DPR/this.pickBufferScale||u<0||s>(f-1)*g.a.DPR/this.pickBufferScale||c<0)return[];var m=Math.min(d/this.pickBufferScale,u)-a,y=Math.min(f/this.pickBufferScale,c)-s;r=h({x:a,y:Math.floor(f/this.pickBufferScale-(c+1)),width:m,height:y,data:new Uint8Array(m*y*4),framebuffer:this.pickingFBO});for(var v=[],A={},_=0;_0&&void 0!==arguments[0])||arguments[0];p()(this,t),this.autoStart=void 0,this.startTime=0,this.oldTime=0,this.running=!1,this.elapsedTime=0,this.autoStart=e}return f()(t,[{key:"start",value:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}},{key:"stop",value:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}},{key:"getElapsedTime",value:function(){return this.getDelta(),this.elapsedTime}},{key:"getDelta",value:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}]),t}(),ve=(ne=Object(o.injectable)(),ie=Object(o.inject)(u.a.IRendererService),oe=Object(o.inject)(u.a.IGlobalConfigService),ne((se=function(){function t(){p()(this,t),this.clock=new ye,this.alreadyInRendering=!1,this.layers=[],this.layerRenderID=void 0,this.sceneInited=!1,this.animateInstanceCount=0,ht()(this,"renderService",ue,this),ht()(this,"configService",ce,this)}return f()(t,[{key:"add",value:function(t){this.sceneInited&&t.init(),this.layers.push(t)}},{key:"initLayers",value:function(){this.sceneInited=!0,this.layers.forEach((function(t){t.inited||t.init()}))}},{key:"getLayers",value:function(){return this.layers}},{key:"getLayer",value:function(t){return this.layers.find((function(e){return e.id===t}))}},{key:"getLayerByName",value:function(t){return this.layers.find((function(e){return e.name===t}))}},{key:"remove",value:function(t){var e=this.layers.indexOf(t);e>-1&&this.layers.splice(e,1),t.emit("remove",null),t.destroy(),this.renderLayers()}},{key:"removeAllLayers",value:function(){this.destroy()}},{key:"renderLayers",value:function(){this.alreadyInRendering||(this.alreadyInRendering=!0,this.clear(),this.updateRenderOrder(),this.layers.filter((function(t){return t.inited})).filter((function(t){return t.isVisible()})).forEach((function(t){t.hooks.beforeRenderData.call(),t.hooks.beforeRender.call(),t.render(),t.hooks.afterRender.call()})),this.alreadyInRendering=!1)}},{key:"updateRenderOrder",value:function(){this.layers.sort((function(t,e){return t.zIndex-e.zIndex}))}},{key:"destroy",value:function(){this.layers.forEach((function(t){return t.destroy()})),this.layers=[],this.renderLayers()}},{key:"startAnimate",value:function(){0==this.animateInstanceCount++&&(this.clock.start(),this.runRender())}},{key:"stopAnimate",value:function(){0==--this.animateInstanceCount&&(this.stopRender(),this.clock.stop())}},{key:"clear",value:function(){this.renderService.clear({color:[0,0,0,0],depth:1,stencil:0,framebuffer:null})}},{key:"runRender",value:function(){this.renderLayers(),this.layerRenderID=requestAnimationFrame(this.runRender.bind(this))}},{key:"stopRender",value:function(){cancelAnimationFrame(this.layerRenderID)}}]),t}(),ue=dt()(se.prototype,"renderService",[ie],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ce=dt()(se.prototype,"configService",[oe],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ae=se))||ae),Ae=r(115),_e=r.n(Ae),be=r(23),xe=r.n(be),we=r(116),Ce=r.n(we),Ee=function(){function t(e){var r=this;p()(this,t),this.name=void 0,this.type=void 0,this.scale=void 0,this.descriptor=void 0,this.featureBufferLayout=[],this.needRescale=!1,this.needRemapping=!1,this.needRegenerateVertices=!1,this.featureRange={startIndex:0,endIndex:1/0},this.vertexAttribute=void 0,this.defaultCallback=function(t){var e;return 0===t.length?(null===(e=r.scale)||void 0===e?void 0:e.defaultValues)||[]:t.map((function(t,e){var n;return(null===(n=r.scale)||void 0===n?void 0:n.scalers[e].func)(t)}))},this.setProps(e)}return f()(t,[{key:"setProps",value:function(t){Object.assign(this,t)}},{key:"mapping",value:function(t){var e;if(null!==(e=this.scale)&&void 0!==e&&e.callback){var r,n=null===(r=this.scale)||void 0===r?void 0:r.callback.apply(r,xe()(t));if(!Ce()(n))return[n]}return this.defaultCallback(t)}},{key:"resetDescriptor",value:function(){this.descriptor&&(this.descriptor.buffer.data=[])}}]),t}();function Ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Me(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,i=this.attributes.find((function(e){return e.name===t}));if(i&&i.descriptor){var o=i.descriptor,a=o.update,s=o.buffer,u=o.size,c=void 0===u?0:u,l=Se[s.type||te.a.FLOAT];if(a){var h=this.featureLayout,p=h.elements,d=h.sizePerElement,f=p.slice(r,n);if(!f.length)return;var g=f[0].offset,m=g*c*l,y=f.map((function(t,r){for(var n=t.featureIdx,i=t.vertices,o=t.normals,s=i.length/d,u=[],c=0;c2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(Re.a)(this,t),this.storage=je(n),this.id=e,this.config={},Object.assign(this.config,r),this._loadConfiguration()}return Object(De.a)(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function Ue(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));var o=t.width*r,a=t.height*r,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),s]}var Ge={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function He(t){return"string"==typeof t?Ge[t.toUpperCase()]||Ge.WHITE:t}function Ve(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=function(t,e){if(!t)return;if("string"==typeof t)return Qe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qe(t,e)}(t))){var e=0,r=function(){};return{s:r,n:function(){return e>=t.length?{done:!0}:{done:!1,value:t[e++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return o=t.done,t},e:function(t){a=!0,i=t},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function Qe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:["constructor"],n=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(n),o=Ve(i);try{var a=function(){var n=e.value;"function"==typeof t[n]&&(r.find((function(t){return n===t}))||(t[n]=t[n].bind(t)))};for(o.s();!(e=o.n()).done;)a()}catch(t){o.e(t)}finally{o.f()}}function We(t,e){if(!t)throw new Error(e||"Assertion failed")}var Ye=r(173);function Xe(){var t;if(Fe&&Ye.b.performance)t=Ye.b.performance.now();else if(Ye.a.hrtime){var e=Ye.a.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var Ze={debug:Fe&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Ke={enabled:!0,level:0};function Je(){}var $e={},tr={once:!0};function er(t){for(var e in t)for(var r in t[e])return r||"untitled";return"empty"}var rr,nr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.id;Object(Re.a)(this,t),this.id=r,this.VERSION=Ne,this._startTs=Xe(),this._deltaTs=Xe(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new ze("__probe-".concat(this.id,"__"),Ke),this.userData={},this.timeStamp("".concat(this.id," started")),qe(this),Object.seal(this)}return Object(De.a)(t,[{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Xe()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Xe()-this._deltaTs).toPrecision(10))}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"assert",value:function(t,e){We(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,Ze.warn,arguments,tr)}},{key:"error",value:function(t){return this._getLogFunction(0,t,Ze.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,Ze.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,Ze.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){return this._getLogFunction(t,e,Ze.debug||Ze.info,arguments,tr)}},{key:"table",value:function(t,e,r){return e?this._getLogFunction(t,e,console.table||Je,r&&[r],{tag:er(e)}):Je}},{key:"image",value:function(t){var e=t.logLevel,n=t.priority,i=t.image,o=t.message,a=void 0===o?"":o,s=t.scale,u=void 0===s?1:s;return this._shouldLog(e||n)?Fe?function(t){var e=t.image,r=t.message,n=void 0===r?"":r,i=t.scale,o=void 0===i?1:i;if("string"==typeof e){var a=new Image;return a.onload=function(){var t,e=Ue(a,n,o);(t=console).log.apply(t,ke(e))},a.src=e,Je}var s=e.nodeName||"";if("img"===s.toLowerCase()){var u;return(u=console).log.apply(u,ke(Ue(e,n,o))),Je}if("canvas"===s.toLowerCase()){var c=new Image;return c.onload=function(){var t;return(t=console).log.apply(t,ke(Ue(c,n,o)))},c.src=e.toDataURL(),Je}return Je}({image:i,message:a,scale:u}):function(t){var e=t.image,n=(t.message,t.scale),i=void 0===n?1:n,o=null;try{o=r(758)}catch(t){}if(o)return function(){return o(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then((function(t){return console.log(t)}))};return Je}({image:i,message:a,scale:u}):Je}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.updateConfiguration(function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},t,e))}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||Je)}},{key:"group",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},n=r=or({logLevel:t,message:e,opts:r}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},r,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||Je)}},{key:"withGroup",value:function(t,e,r){this.group(t,e)();try{r()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=ir(t)}},{key:"_getLogFunction",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4?arguments[4]:void 0;if(this._shouldLog(t)){var o;i=or({logLevel:t,message:e,args:n,opts:i}),We(r=r||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=Xe();var a=i.tag||i.message;if(i.once){if($e[a])return Je;$e[a]=Xe()}return e=ar(this.id,i.message,i),(o=r).bind.apply(o,[console,e].concat(ke(i.args)))}return Je}},{key:"level",set:function(t){this.setLevel(t)},get:function(){return this.getLevel()}},{key:"priority",set:function(t){this.level=t},get:function(){return this.level}}]),t}();function ir(t){if(!t)return 0;var e;switch(Object(Pe.a)(t)){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return We(Number.isFinite(e)&&e>=0),e}function or(t){var e=t.logLevel,r=t.message;t.logLevel=ir(e);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==r;);switch(t.args=n,Object(Pe.a)(e)){case"string":case"function":void 0!==r&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e)}"function"==typeof t.message&&(t.message=t.message());var i=Object(Pe.a)(t.message);return We("string"===i||"object"===i),Object.assign(t,t.opts)}function ar(t,e,r){if("string"==typeof e){var n=r.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}((s=r.total)<10?"".concat(s.toFixed(2),"ms"):s<100?"".concat(s.toFixed(1),"ms"):s<1e3?"".concat(s.toFixed(0),"ms"):"".concat((s/1e3).toFixed(2),"s")):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),i=e,o=r.color,a=r.background,Fe||"string"!=typeof i||(o&&(o=He(o),i="[".concat(o,"m").concat(i,"")),a&&(o=He(a),i="[".concat(a+10,"m").concat(i,""))),e=i}var i,o,a,s;return e}nr.VERSION=Ne;var sr=new nr({id:"L7"}).enable(!1);sr.priority=5;var ur,cr,lr,hr,pr,dr,fr,gr,mr,yr,vr,Ar,_r,br,xr,wr,Cr,Er,Ir,Mr,Sr,Tr,Pr,Or,Lr,kr,Rr,Dr,Br,Nr,Fr,jr,zr,Ur,Gr,Hr=Object(o.injectable)()(rr=function(){function t(){p()(this,t)}return f()(t,[{key:"error",value:function(t){sr.error(t)()}},{key:"warn",value:function(t){sr.probe(1,t)()}},{key:"info",value:function(t){sr.info(3,t)()}},{key:"debug",value:function(t){sr.probe(4,t)()}}]),t}())||rr,Vr=r(80),Qr=r(317),qr=r.n(Qr),Wr=(window.document.documentElement.style,0);function Yr(t){var e=t;if("string"==typeof t&&(e=document.getElementById(t)),e){var r=document.createElement("div");return r.style.cssText+="\n position: absolute;\n z-index:2;\n height: 100%;\n width: 100%;\n pointer-events: none;\n ",r.id="l7-scene-".concat(Wr++),r.classList.add("l7-scene"),e.appendChild(r),r}return null}function Xr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=j()(t);if(e){var i=j()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return N()(this,r)}}var Zr=(ur=Object(o.injectable)(),cr=Object(o.inject)(u.a.SceneID),lr=Object(o.inject)(u.a.IIconService),hr=Object(o.inject)(u.a.IFontService),pr=Object(o.inject)(u.a.IControlService),dr=Object(o.inject)(u.a.ILogService),fr=Object(o.inject)(u.a.IGlobalConfigService),gr=Object(o.inject)(u.a.IMapService),mr=Object(o.inject)(u.a.ICoordinateSystemService),yr=Object(o.inject)(u.a.IRendererService),vr=Object(o.inject)(u.a.ILayerService),Ar=Object(o.inject)(u.a.ICameraService),_r=Object(o.inject)(u.a.IInteractionService),br=Object(o.inject)(u.a.IPickingService),xr=Object(o.inject)(u.a.IShaderModuleService),wr=Object(o.inject)(u.a.IMarkerService),Cr=Object(o.inject)(u.a.IPopupService),ur((Ir=function(t){D()(n,t);var e,r=Xr(n);function n(){var t;return p()(this,n),(t=r.call(this)).destroyed=!1,t.loaded=!1,ht()(t,"id",Mr,Lt()(t)),ht()(t,"iconService",Sr,Lt()(t)),ht()(t,"fontService",Tr,Lt()(t)),ht()(t,"controlService",Pr,Lt()(t)),ht()(t,"logger",Or,Lt()(t)),ht()(t,"configService",Lr,Lt()(t)),ht()(t,"map",kr,Lt()(t)),ht()(t,"coordinateSystemService",Rr,Lt()(t)),ht()(t,"rendererService",Dr,Lt()(t)),ht()(t,"layerService",Br,Lt()(t)),ht()(t,"cameraService",Nr,Lt()(t)),ht()(t,"interactionService",Fr,Lt()(t)),ht()(t,"pickingService",jr,Lt()(t)),ht()(t,"shaderModuleService",zr,Lt()(t)),ht()(t,"markerService",Ur,Lt()(t)),ht()(t,"popupService",Gr,Lt()(t)),t.inited=!1,t.initPromise=void 0,t.rendering=!1,t.$container=void 0,t.canvas=void 0,t.markerContainer=void 0,t.hooks=void 0,t.handleWindowResized=function(){t.emit("resize"),t.$container&&(t.initContainer(),g.a.triggerResize(),t.coordinateSystemService.needRefresh=!0,t.render())},t.handleMapCameraChanged=function(e){t.cameraService.update(e),t.render()},t.hooks={init:new Vr.a},t}return f()(n,[{key:"init",value:function(t){var e=this;this.configService.setSceneConfig(this.id,t),this.shaderModuleService.registerBuiltinModules(),this.iconService.init(),this.fontService.init(),this.hooks.init.tapPromise("initMap",Kt()($t.a.mark((function t(){return $t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Promise((function(t){e.map.onCameraChanged((function(r){e.cameraService.init(),e.cameraService.update(r),t()})),e.map.init()}));case 2:e.map.onCameraChanged(e.handleMapCameraChanged),e.map.addMarkerContainer(),e.markerService.addMarkers(),e.markerService.addMarkerLayers(),e.popupService.initPopup(),e.interactionService.init(),e.interactionService.on(Dt.a.Drag,e.addSceneEvent.bind(e)),e.logger.debug("map ".concat(e.id," loaded"));case 10:case"end":return t.stop()}}),t)})))),this.hooks.init.tapPromise("initRenderer",Kt()($t.a.mark((function t(){var r;return $t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=Yr(e.configService.getSceneConfig(e.id).id||""),e.$container=r,!r){t.next=11;break}return e.canvas=g.a.create("canvas","",r),e.setCanvas(),t.next=7,e.rendererService.init(e.canvas,e.configService.getSceneConfig(e.id));case 7:qr()(e.$container,e.handleWindowResized),window.matchMedia("screen and (-webkit-min-device-pixel-ratio: 1.5)").addListener(e.handleWindowResized),t.next=12;break;case 11:e.logger.error("容器 id 不存在");case 12:e.pickingService.init(e.id),e.logger.debug("scene ".concat(e.id," renderer loaded"));case 14:case"end":return t.stop()}}),t)})))),this.initPromise=this.hooks.init.promise(),this.render()}},{key:"addLayer",value:function(t){this.logger.debug("add layer ".concat(t.name," to scene ").concat(this.id)),this.layerService.add(t),this.render()}},{key:"render",value:(e=Kt()($t.a.mark((function t(){return $t.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.rendering&&!this.destroyed){t.next=2;break}return t.abrupt("return");case 2:if(this.rendering=!0,this.inited){t.next=13;break}return t.next=6,this.initPromise;case 6:this.destroyed&&this.destroy(),this.logger.info(" render inited"),this.layerService.initLayers(),this.controlService.addControls(),this.loaded=!0,this.emit("loaded"),this.inited=!0;case 13:this.layerService.renderLayers(),this.logger.debug("scene ".concat(this.id," render")),this.rendering=!1;case 16:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"getSceneContainer",value:function(){return this.$container}},{key:"exportPng",value:function(t){var e,r=null===(e=this.$container)||void 0===e?void 0:e.getElementsByTagName("canvas")[0];return this.render(),"jpg"===t?null==r?void 0:r.toDataURL("image/jpeg"):null==r?void 0:r.toDataURL("image/png")}},{key:"getSceneConfig",value:function(){return this.configService.getSceneConfig(this.id)}},{key:"addMarkerContainer",value:function(){var t=this.$container.parentElement;null!==t&&(this.markerContainer=g.a.create("div","l7-marker-container",t))}},{key:"getMarkerContainer",value:function(){return this.markerContainer}},{key:"destroy",value:function(){this.inited?(this.emit("destroy"),this.layerService.destroy(),this.rendererService.destroy(),this.map.destroy(),this.interactionService.destroy(),this.controlService.destroy(),this.markerService.destroy(),this.removeAllListeners(),this.inited=!1,Object(Qr.unbind)(this.$container,this.handleWindowResized),window.matchMedia("screen and (min-resolution: 2dppx)").removeListener(this.handleWindowResized)):this.destroyed=!0}},{key:"initContainer",value:function(){var t,e,r=g.a.DPR,n=(null===(t=this.$container)||void 0===t?void 0:t.clientWidth)||400,i=(null===(e=this.$container)||void 0===e?void 0:e.clientHeight)||300,o=this.canvas;o&&(o.width=n*r,o.height=i*r,o.style.width="".concat(n,"px"),o.style.height="".concat(i,"px")),this.rendererService.viewport({x:0,y:0,width:r*n,height:r*i})}},{key:"setCanvas",value:function(){var t,e,r=g.a.DPR,n=(null===(t=this.$container)||void 0===t?void 0:t.clientWidth)||400,i=(null===(e=this.$container)||void 0===e?void 0:e.clientHeight)||300,o=this.canvas;o.width=n*r,o.height=i*r,o.style.width="".concat(n,"px"),o.style.height="".concat(i,"px")}},{key:"addSceneEvent",value:function(t){this.emit(t.type,t)}}]),n}(n.EventEmitter),Mr=dt()(Ir.prototype,"id",[cr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Sr=dt()(Ir.prototype,"iconService",[lr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Tr=dt()(Ir.prototype,"fontService",[hr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pr=dt()(Ir.prototype,"controlService",[pr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Or=dt()(Ir.prototype,"logger",[dr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Lr=dt()(Ir.prototype,"configService",[fr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),kr=dt()(Ir.prototype,"map",[gr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Rr=dt()(Ir.prototype,"coordinateSystemService",[mr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Dr=dt()(Ir.prototype,"rendererService",[yr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Br=dt()(Ir.prototype,"layerService",[vr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Nr=dt()(Ir.prototype,"cameraService",[Ar],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fr=dt()(Ir.prototype,"interactionService",[_r],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),jr=dt()(Ir.prototype,"pickingService",[br],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),zr=dt()(Ir.prototype,"shaderModuleService",[xr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ur=dt()(Ir.prototype,"markerService",[wr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gr=dt()(Ir.prototype,"popupService",[Cr],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Er=Ir))||Er),Kr=r(272),Jr=r.n(Kr);var $r,tn=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g;function en(t){var e={};return{content:t=t.replace(tn,(function(t,r,n){var i=n.split(":"),o=i[0].trim(),a="";switch(i.length>1&&(a=i[1].trim()),r){case"bool":a="true"===a;break;case"float":case"int":a=Number(a);break;case"vec2":case"vec3":case"vec4":case"ivec2":case"ivec3":case"ivec4":case"mat2":case"mat3":case"mat4":a=a?a.replace("[","").replace("]","").split(",").reduce((function(t,e){return t.push(Number(e.trim())),t}),[]):new Array(function(t){var e=0;switch(t){case"vec2":case"ivec2":e=2;break;case"vec3":case"ivec3":e=3;break;case"vec4":case"ivec4":case"mat2":e=4;break;case"mat3":e=9;break;case"mat4":e=16}return e}(r)).fill(0)}return e[o]=a,"uniform ".concat(r," ").concat(o,";\n")})),uniforms:e}}function rn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function nn(t){for(var e=1;e world coords\nvec2 project_mercator(vec2 lnglat) {\n float x = lnglat.x;\n return vec2(\n radians(x) + PI,\n PI - log(tan(PI * 0.25 + radians(lnglat.y) * 0.5))\n );\n}\n\nfloat project_scale(float meters) {\n return meters * u_PixelsPerMeter.z;\n}\n\n\n// offset coords -> world coords\nvec4 project_offset(vec4 offset) {\n float dy = offset.y;\n dy = clamp(dy, -1., 1.);\n vec3 pixels_per_unit = u_PixelsPerDegree + u_PixelsPerDegree2 * dy;\n return vec4(offset.xyz * pixels_per_unit, offset.w);\n}\n\nvec3 project_normal(vec3 normal) {\n vec4 normal_modelspace = u_ModelMatrix * vec4(normal, 0.0);\n return normalize(normal_modelspace.xyz * u_PixelsPerMeter);\n}\n\nvec3 project_offset_normal(vec3 vector) {\n if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01\n || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // normals generated by the polygon tesselator are in lnglat offsets instead of meters\n return normalize(vector * u_PixelsPerDegree);\n }\n return project_normal(vector);\n}\n// || u_CoordinateSystem < COORDINATE_SYSTEM_P20_OFFSET + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_P20_OFFSET - 0.01\n// reverse Y\nvec3 reverse_offset_normal(vec3 vector) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 ||u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET ) {\n return vector * vec3(1.0, -1.0, 1.0);\n }\n return vector;\n}\n\nvec4 project_position(vec4 position) {\n float a = COORDINATE_SYSTEM_LNGLAT_OFFSET;\n float b = COORDINATE_SYSTEM_P20_OFFSET;\n float c = COORDINATE_SYSTEM_LNGLAT;\n if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n float X = position.x - u_ViewportCenter.x;\n float Y = position.y - u_ViewportCenter.y;\n return project_offset(vec4(X, Y, position.z, position.w));\n }\n if (u_CoordinateSystem < COORDINATE_SYSTEM_LNGLAT + 0.01 && u_CoordinateSystem >COORDINATE_SYSTEM_LNGLAT - 0.01) {\n return vec4(\n project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale,\n project_scale(position.z),\n position.w\n );\n }\n\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20) {\n return vec4(\n (project_mercator(position.xy) * WORLD_SCALE * u_ZoomScale - vec2(215440491., 106744817.)) * vec2(1., -1.),\n project_scale(position.z),\n position.w\n );\n }\n return position;\n\n // TODO: 瓦片坐标系 & 常规世界坐标系\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / u_ViewportSize * u_DevicePixelRatio * 2.0;\n return offset * u_FocalDistance;\n}\n\nfloat project_pixel(float pixel) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1\n return pixel * pow(2.0, (19.0 - u_Zoom));\n }\n return pixel;\n}\nvec2 project_pixel(vec2 pixel) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // P20 坐标系下,为了和 Web 墨卡托坐标系统一,zoom 默认减1\n return pixel * pow(2.0, (19.0 - u_Zoom));\n }\n return pixel * -1.;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // Needs to be divided with project_uCommonUnitsPerMeter\n position.w *= u_PixelsPerMeter.z;\n }\n return viewProjectionMatrix * position + center;\n}\n\n// Projects from common space coordinates to clip space\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(\n position,\n u_ViewProjectionMatrix,\n u_ViewportCenterProjection\n );\n}\n\nvec4 unproject_clipspace_to_position(vec4 clipspacePos, mat4 u_InverseViewProjectionMatrix) {\n vec4 pos = u_InverseViewProjectionMatrix * (clipspacePos - u_ViewportCenterProjection);\n\n if (u_CoordinateSystem == COORDINATE_SYSTEM_METER_OFFSET ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n // Needs to be divided with project_uCommonUnitsPerMeter\n pos.w = pos.w / u_PixelsPerMeter.z;\n }\n return pos;\n}\n\n\nbool isEqual( float a, float b) {\n return a< b + 0.001 && a > b - 0.001;\n}\n\n",fs:""}),this.registerModule("project",{vs:"\n#define E 2.718281828459045\nvec2 ProjectFlat(vec2 lnglat){\n float maxs=85.0511287798;\n float lat=max(min(maxs,lnglat.y),-maxs);\n float scale= 268435456.;\n float d=PI/180.;\n float x=lnglat.x*d;\n float y=lat*d;\n y=log(tan((PI/4.)+(y/2.)));\n\n float a=.5/PI,\n b=.5,\n c=-.5/PI;\n d=.5;\n x=scale*(a*x+b);\n y=scale*(c*y+d);\n return vec2(x,y);\n}\n\nvec2 unProjectFlat(vec2 px){\n float a=.5/PI;\n float b=.5;\n float c=-.5/PI;\n float d=.5;\n float scale = 268435456.;\n float x=(px.x/scale-b)/a;\n float y=(px.y/scale-d)/c;\n y=(atan(pow(E,y))-(PI/4.))*2.;\n d=PI/180.;\n float lat=y/d;\n float lng=x/d;\n return vec2(lng,lat);\n}\n\nfloat pixelDistance(vec2 from, vec2 to) {\n vec2 a1 = ProjectFlat(from);\n vec2 b1 = ProjectFlat(to);\n return distance(a1, b1);\n}\n",fs:""}),this.registerModule("sdf_2d",{vs:"",fs:"/**\n * 2D signed distance field functions\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\n */\n\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\n\nfloat sdCircle(vec2 p, float r) {\n return length(p) - r;\n}\n\nfloat sdEquilateralTriangle(vec2 p) {\n float k = sqrt(3.0);\n p.x = abs(p.x) - 1.0;\n p.y = p.y + 1.0/k;\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\n p.x -= clamp( p.x, -2.0, 0.0 );\n return -length(p)*sign(p.y);\n}\n\nfloat sdBox(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\n}\n\nfloat sdPentagon(vec2 p, float r) {\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\n p.x = abs(p.x);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagon(vec2 p, float r) {\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdOctogon(vec2 p, float r) {\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\n p = abs(p);\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\n return length(p)*sign(p.y);\n}\n\nfloat sdHexagram(vec2 p, float r) {\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\n p = abs(p);\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\n return length(p)*sign(p.y);\n}\n\nfloat sdRhombus(vec2 p, vec2 b) {\n vec2 q = abs(p);\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\n}\n\nfloat sdVesica(vec2 p, float r, float d) {\n p = abs(p);\n float b = sqrt(r*r-d*d); // can delay this sqrt\n return ((p.y-b)*d>p.x*b)\n ? length(p-vec2(0.0,b))\n : length(p-vec2(-d,0.0))-r;\n}\n"}),this.registerModule("lighting",{vs:"// Blinn-Phong model\n// apply lighting in vertex shader instead of fragment shader\n// @see https://learnopengl.com/Advanced-Lighting/Advanced-Lighting\nuniform float u_Ambient : 1.0;\nuniform float u_Diffuse : 1.0;\nuniform float u_Specular : 1.0;\nuniform int u_NumOfDirectionalLights : 1;\nuniform int u_NumOfSpotLights : 0;\n\n#define SHININESS 32.0\n#define MAX_NUM_OF_DIRECTIONAL_LIGHTS 3\n#define MAX_NUM_OF_SPOT_LIGHTS 3\n\nstruct DirectionalLight {\n vec3 direction;\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n};\n\nstruct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n float constant;\n float linear;\n float quadratic;\n float angle;\n float blur;\n float exponent;\n};\n\nuniform DirectionalLight u_DirectionalLights[MAX_NUM_OF_DIRECTIONAL_LIGHTS];\nuniform SpotLight u_SpotLights[MAX_NUM_OF_SPOT_LIGHTS];\n\nvec3 calc_directional_light(DirectionalLight light, vec3 normal, vec3 viewDir) {\n vec3 lightDir = normalize(light.direction);\n // diffuse shading\n float diff = max(dot(normal, lightDir), 0.0);\n // Blinn-Phong specular shading\n vec3 halfwayDir = normalize(lightDir + viewDir);\n float spec = pow(max(dot(normal, halfwayDir), 0.0), SHININESS);\n\n vec3 ambient = light.ambient * u_Ambient;\n vec3 diffuse = light.diffuse * diff * u_Diffuse;\n vec3 specular = light.specular * spec * u_Specular;\n\n return ambient + diffuse + specular;\n}\n\n// vec3 calc_spot_light(SpotLight light, vec3 normal, vec3 fragPos, vec3 viewDir) {\n// vec3 lightDir = normalize(light.position - fragPos);\n// // diffuse shading\n// float diff = max(dot(normal, lightDir), 0.0);\n// // specular shading\n// vec3 reflectDir = reflect(-lightDir, normal);\n// float spec = pow(max(dot(viewDir, reflectDir), 0.0), SHININESS);\n// // attenuation\n// float distance = length(light.position - fragPos);\n// float attenuation = 1.0 / (light.constant + light.linear * distance +\n// light.quadratic * (distance * distance));\n\n// vec3 ambient = light.ambient * u_Ambient;\n// vec3 diffuse = light.diffuse * diff * u_Diffuse;\n// vec3 specular = light.specular * spec * u_Specular;\n\n// float spotEffect = dot(normalize(light.direction), -lightDir);\n// float spotCosCutoff = cos(light.angle / 180.0 * PI);\n// float spotCosOuterCutoff = cos((light.angle + light.blur) / 180.0 * PI);\n// float spotCosInnerCutoff = cos((light.angle - light.blur) / 180.0 * PI);\n// if (spotEffect > spotCosCutoff) {\n// spotEffect = pow(smoothstep(spotCosOuterCutoff, spotCosInnerCutoff, spotEffect), light.exponent);\n// } else {\n// spotEffect = 0.0;\n// }\n\n// return ambient + attenuation * (spotEffect * diffuse + specular);\n// }\n\nvec3 calc_lighting(vec3 position, vec3 normal, vec3 viewDir) {\n vec3 weight = vec3(0.0);\n for (int i = 0; i < MAX_NUM_OF_DIRECTIONAL_LIGHTS; i++) {\n if (i >= u_NumOfDirectionalLights) {\n break;\n }\n weight += calc_directional_light(u_DirectionalLights[i], normal, viewDir);\n }\n // for (int i = 0; i < MAX_NUM_OF_SPOT_LIGHTS; i++) {\n // if (i >= u_NumOfSpotLights) {\n // break;\n // }\n // weight += calc_spot_light(u_SpotLights[i], normal, position, viewDir);\n // }\n return weight;\n}\n",fs:""}),this.registerModule("light",{vs:"#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\n\nfloat calc_lighting(vec4 pos) {\n\n vec3 worldPos = vec3(pos * u_ModelMatrix);\n\n vec3 worldNormal = a_Normal;\n // //cal light weight\n vec3 viewDir = normalize(u_CameraPosition - worldPos);\n\n vec3 lightDir = normalize(vec3(1, -10.5, 12));\n\n vec3 halfDir = normalize(viewDir+lightDir);\n // //lambert\n float lambert = dot(worldNormal, lightDir);\n //specular\n float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);\n //sum to light weight\n float lightWeight = ambientRatio + diffuseRatio * lambert + specularRatio * specular;\n\n return lightWeight;\n}\n",fs:""}),this.registerModule("picking",{vs:"attribute vec3 a_PickingColor;\nvarying vec4 v_PickingResult;\n\nuniform vec3 u_PickingColor : [0, 0, 0];\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\nuniform float u_PickingThreshold : 1.0;\nuniform float u_PickingBuffer: 0.0;\n\n#define PICKING_NONE 0.0\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\n abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\n abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\n}\n\nvoid setPickingColor(vec3 pickingColor) {\n // compares only in highlight stage\n v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\n\n // Stores the picking color so that the fragment shader can render it during picking\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\n\nfloat setPickingSize(float x) {\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\n}\n",fs:"varying vec4 v_PickingResult;\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\nuniform float u_PickingStage : 0.0;\n\n#define PICKING_NONE 0.0\n#define PICKING_ENCODE 1.0\n#define PICKING_HIGHLIGHT 2.0\n#define COLOR_SCALE 1. / 255.\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 filterHighlightColor(vec4 color) {\n bool selected = bool(v_PickingResult.a);\n\n if (selected) {\n vec4 highLightColor = u_HighlightColor * COLOR_SCALE;\n\n float highLightAlpha = highLightColor.a;\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\n\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\n return vec4(resultRGB, color.a);\n } else {\n return color;\n }\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 filterPickingColor(vec4 color) {\n vec3 pickingColor = v_PickingResult.rgb;\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\n discard;\n }\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\n}\n\n/*\n * Returns picking color if picking is enabled if not\n * highlight color if this item is selected, otherwise unmodified argument.\n */\nvec4 filterColor(vec4 color) {\n return filterPickingColor(filterHighlightColor(color));\n}\n"})}},{key:"registerModule",value:function(t,e){if(!this.rawContentCache[t]){var r=e.vs,n=e.fs,i=e.uniforms,o=en(r),a=o.content,s=o.uniforms,u=en(n),c=u.content,l=u.uniforms;this.rawContentCache[t]={fs:c,uniforms:nn(nn(nn({},s),l),i),vs:a}}}},{key:"destroy",value:function(){this.moduleCache={},this.rawContentCache={}}},{key:"getModule",value:function(t){var e=this;if(this.moduleCache[t])return this.moduleCache[t];var r=this.rawContentCache[t].vs,n=this.rawContentCache[t].fs,i=this.processModule(r,[],"vs"),o=i.content,a=i.includeList,s=this.processModule(n,[],"fs"),u=s.content,c=s.includeList,l=u,h=Jr()(a.concat(c).concat(t)).reduce((function(t,r){return nn(nn({},t),e.rawContentCache[r].uniforms)}),{});return pn.test(u)||(l="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n#endif\n"+u),this.moduleCache[t]={fs:l.trim(),uniforms:h,vs:o.trim()},this.moduleCache[t]}},{key:"processModule",value:function(t,e,r){var n=this;return{content:t.replace(dn,(function(t,i){var o=i.split(" ")[0].replace(/"/g,"");if(e.indexOf(o)>-1)return"";var a=n.rawContentCache[o][r];return e.push(o),n.processModule(a,e,r).content})),includeList:e}}}]),t}())||$r,gn=r(17),mn=r.n(gn),yn=r(94),vn=(on=Object(o.injectable)(),an=Object(o.inject)(u.a.IShaderModuleService),on((un=function(){function t(){p()(this,t),ht()(this,"shaderModuleService",cn,this),this.rendererService=void 0,this.cameraService=void 0,this.mapService=void 0,this.interactionService=void 0,this.layerService=void 0,this.config=void 0}return f()(t,[{key:"getName",value:function(){return""}},{key:"getType",value:function(){return yn.a.Normal}},{key:"init",value:function(t,e){this.config=e,this.rendererService=t.getContainer().get(u.a.IRendererService),this.cameraService=t.getContainer().get(u.a.ICameraService),this.mapService=t.getContainer().get(u.a.IMapService),this.interactionService=t.getContainer().get(u.a.IInteractionService),this.layerService=t.getContainer().get(u.a.ILayerService)}},{key:"render",value:function(t){}}]),t}(),cn=dt()(un.prototype,"shaderModuleService",[an],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),sn=un))||sn);function An(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=j()(t);if(e){var i=j()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return N()(this,r)}}var _n,bn,xn,wn,Cn,En=Object(o.injectable)()(ln=function(t){D()(r,t);var e=An(r);function r(){return p()(this,r),e.apply(this,arguments)}return f()(r,[{key:"getName",value:function(){return"clear"}},{key:"init",value:function(t,e){mn()(j()(r.prototype),"init",this).call(this,t,e)}},{key:"render",value:function(){this.rendererService.clear({color:[0,0,0,0],depth:1,framebuffer:null})}}]),r}(vn))||ln;function In(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Mn(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mn(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rp||v<0||A>d||A<0))l(t.pickingFBO,(function(){var e;if(0!==(a=c({x:Math.round(v),y:Math.round(d-(n+1)*g.a.DPR),width:1,height:1,data:new Uint8Array(4),framebuffer:t.pickingFBO}))[0]||0!==a[1]||0!==a[2]){t.logger.debug("picked");var s=Object(g.k)(a),u=t.layer.getSource().getFeatureById(s),l={x:r,y:n,type:o,lngLat:i,featureId:s,feature:u};u&&(t.layer.setCurrentPickId(s),t.triggerHoverOnLayer(l))}else{var h={x:r,y:n,lngLat:i,type:null===t.layer.getCurrentPickId()?"un"+o:"mouseout",featureId:null,feature:null};t.triggerHoverOnLayer(Dn(Dn({},h),{},{type:"unpick"})),t.triggerHoverOnLayer(h),t.layer.setCurrentPickId(null)}m&&t.highlightPickedFeature(a),y&&"click"===o&&(null===(e=a)||void 0===e?void 0:e.toString())!==[0,0,0,0].toString()&&t.selectFeature(a)}))}},t}return f()(r,[{key:"getType",value:function(){return yn.a.Normal}},{key:"getName",value:function(){return"pixelPicking"}},{key:"init",value:function(t,e){mn()(j()(r.prototype),"init",this).call(this,t,e),this.layer=t;var n=this.rendererService,i=n.createTexture2D,o=n.createFramebuffer,a=(0,n.getViewportSize)(),s=a.width,u=a.height;this.pickingFBO=o({color:i({width:s,height:u,wrapS:te.a.CLAMP_TO_EDGE,wrapT:te.a.CLAMP_TO_EDGE})}),this.interactionService.on(Dt.a.Hover,this.pickFromPickingFBO),this.interactionService.on(Dt.a.Select,this.selectFeatureHandle.bind(this)),this.interactionService.on(Dt.a.Active,this.highlightFeatureHandle.bind(this))}},{key:"render",value:function(t){var e=this;if(!this.alreadyInRendering){var r=this.rendererService,n=r.getViewportSize,i=r.useFramebuffer,o=r.clear,a=n(),s=a.width,u=a.height;this.alreadyInRendering=!0,this.width===s&&this.height===u||(this.pickingFBO.resize({width:s,height:u}),this.width=s,this.height=u),i(this.pickingFBO,(function(){o({framebuffer:e.pickingFBO,color:[0,0,0,0],stencil:0,depth:1});var r=e.layer.multiPassRenderer.getRenderFlag();e.layer.multiPassRenderer.setRenderFlag(!1),t.hooks.beforePickingEncode.call(),t.render(),t.hooks.afterPickingEncode.call(),e.layer.multiPassRenderer.setRenderFlag(r),e.alreadyInRendering=!1}))}}},{key:"triggerHoverOnLayer",value:function(t){this.layer.emit(t.type,t)}},{key:"highlightPickedFeature",value:function(t){var e=Q()(t,3),r=e[0],n=e[1],i=e[2];this.layer.hooks.beforeHighlight.call([r,n,i]),this.layerService.renderLayers()}},{key:"selectFeature",value:function(t){var e=Q()(t,3),r=e[0],n=e[1],i=e[2];this.layer.hooks.beforeSelect.call([r,n,i]),this.layerService.renderLayers()}},{key:"selectFeatureHandle",value:function(t){var e=t.featureId,r=Object(g.l)(e);this.selectFeature(new Uint8Array(r))}},{key:"highlightFeatureHandle",value:function(t){var e=t.featureId,r=Object(g.l)(e);this.highlightPickedFeature(new Uint8Array(r))}}]),r}(vn),Ln=dt()(On.prototype,"logger",[Tn],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Pn=On))||Pn),jn=r(78);function zn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Un(t){for(var e=1;e0;)r+=n*(i%e),i=Math.floor(i/e),n/=e;return r}var Ui=1,Gi=(Si=Object(o.injectable)(),Ti=Object(o.inject)(u.a.IShaderModuleService),Pi=Object(o.inject)(u.a.ILogService),Si((Li=function(t){D()(r,t);var e=Fi(r);function r(){var t;p()(this,r);for(var n=arguments.length,i=new Array(n),o=0;o=1&&(o(this.copyRenderTarget,(function(){e.outputModel.draw({uniforms:{u_Texture:e.outputRenderTarget}})})),o(t.multiPassRenderer.getPostProcessor().getReadFBO(),(function(){e.copyModel.draw({uniforms:{u_Texture:e.copyRenderTarget}})})),t.multiPassRenderer.getPostProcessor().render(t));var d=this.prevRenderTarget;this.prevRenderTarget=this.outputRenderTarget,this.outputRenderTarget=d,this.frame++,this.cameraService.clearJitterProjectionMatrix()}},{key:"isFinished",value:function(){return this.frame>=this.haltonSequence.length}},{key:"resetFrame",value:function(){this.frame=0}},{key:"stopAccumulating",value:function(){this.accumulatingId=0,window.clearTimeout(this.timer)}},{key:"createTriangleModel",value:function(t,e,r){this.shaderModuleService.registerModule(t,{vs:"attribute vec2 a_Position;\n\nvarying vec2 v_UV;\n\nvoid main() {\n v_UV = 0.5 * (a_Position + 1.0);\n gl_Position = vec4(a_Position, 0., 1.);\n}",fs:e});var n=this.shaderModuleService.getModule(t),i=n.vs,o=n.fs,a=n.uniforms,s=this.rendererService,u=s.createAttribute,c=s.createBuffer;return(0,s.createModel)(Ni({vs:i,fs:o,attributes:{a_Position:u({buffer:c({data:[-4,-4,4,-4,0,4],type:te.a.FLOAT}),size:2})},uniforms:Ni({},a),depth:{enable:!1},count:3},r))}}]),r}(vn),ki=dt()(Li.prototype,"shaderModuleService",[Ti],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ri=dt()(Li.prototype,"logger",[Pi],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oi=Li))||Oi),Hi=new o.Container;Hi.bind(u.a.IGlobalConfigService).to(ct).inSingletonScope(),Hi.bind(u.a.IShaderModuleService).to(fn).inSingletonScope(),Hi.bind(u.a.ILogService).to(Hr).inSingletonScope(),Object(o.decorate)(Object(o.injectable)(),n.EventEmitter),Hi.bind(u.a.IEventEmitter).to(n.EventEmitter);var Vi=s()(Hi,!1),Qi=function(t){var e=Vi.lazyInject(t);return function(t,r,n){e.call(this,t,r),n&&(n.initializer=function(){return t[r]})}},qi=(e.c=Hi,0);function Wi(){var t=new o.Container;return t.parent=Hi,t.bind(u.a.SceneID).toConstantValue("".concat(qi++)),t.bind(u.a.ILayerService).to(ve).inSingletonScope(),t.bind(u.a.ISceneService).to(Zr).inSingletonScope(),t.bind(u.a.ICameraService).to(W).inSingletonScope(),t.bind(u.a.ICoordinateSystemService).to(Pt).inSingletonScope(),t.bind(u.a.IInteractionService).to(Xt).inSingletonScope(),t.bind(u.a.IPickingService).to(me).inSingletonScope(),t.bind(u.a.IControlService).to($).inSingletonScope(),t.bind(u.a.IMarkerService).to(tt).inSingletonScope(),t.bind(u.a.IIconService).to(H).inSingletonScope(),t.bind(u.a.IFontService).to(k).inSingletonScope(),t.bind(u.a.IPopupService).to(et).inSingletonScope(),t.bind(u.a.INormalPass).to(En).whenTargetNamed("clear"),t.bind(u.a.INormalPass).to(Fn).whenTargetNamed("pixelPicking"),t.bind(u.a.INormalPass).to(Di).whenTargetNamed("render"),t.bind(u.a.INormalPass).to(Gi).whenTargetNamed("taa"),t.bind(u.a.IFactoryNormalPass).toFactory((function(t){return function(e){return t.container.getNamed(u.a.INormalPass,e)}})),t.bind(u.a.IPostProcessingPass).to(ni).whenTargetNamed("copy"),t.bind(u.a.IPostProcessingPass).to(Vn).whenTargetNamed("blurH"),t.bind(u.a.IPostProcessingPass).to(Xn).whenTargetNamed("blurV"),t.bind(u.a.IPostProcessingPass).to(mi).whenTargetNamed("noise"),t.bind(u.a.IPostProcessingPass).to(Ei).whenTargetNamed("sepia"),t.bind(u.a.IPostProcessingPass).to(ti).whenTargetNamed("colorHalftone"),t.bind(u.a.IPostProcessingPass).to(ui).whenTargetNamed("hexagonalPixelate"),t.bind(u.a.IPostProcessingPass).to(di).whenTargetNamed("ink"),t.bind(u.a.IFactoryPostProcessingPass).toFactory((function(t){return function(e){var r=t.container.getNamed(u.a.IPostProcessingPass,e);return r.setName(e),r}})),t}function Yi(t){var e=new o.Container;return e.parent=t,e.bind(u.a.IStyleAttributeService).to(Te).inSingletonScope(),e.bind(u.a.IMultiPassRenderer).to(kn).inSingletonScope(),e.bind(u.a.IPostProcessor).to(Ii).inSingletonScope(),e}},function(t,e,r){var n=r(542),i=r(236),o=r(285),a=o&&o.isTypedArray,s=a?i(a):n;t.exports=s},function(t,e){var r=t.exports=function(t,e){if(e||(e=16),void 0===t&&(t=128),t<=0)return"0";for(var n=Math.log(Math.pow(2,t))/Math.log(e),i=2;n===1/0;i*=2)n=Math.log(Math.pow(2,t/i))/Math.log(e)*i;var o=n-Math.floor(n),a="";for(i=0;i=Math.pow(2,t)?r(t,e):a};r.rack=function(t,e,n){var i=function(i){var a=0;do{if(a++>10){if(!n)throw new Error("too many ID collisions, use more bits");t+=n}var s=r(t,e)}while(Object.hasOwnProperty.call(o,s));return o[s]=i,s},o=i.hats={};return i.get=function(t){return i.hats[t]},i.set=function(t,e){return i.hats[t]=e,i},i.bits=t||128,i.base=e||16,i}},function(t,e,r){"use strict";function n(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e0){var c=s.map((function(t){return n[t.index]=!0,e.remove({index:t.index},h),t.geojson}));c.push(t),t=a.apply(this,c)}if(0===s.length)break}r.push(t)})),Object(s.e)(r)}function h(t,e){return t.index===e.index}e.a=function(t,e){var r,n,i,o=function(t){var e=t&&t.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]];return Object(s.k)(e)}(e),a=(r=t,n=[],i=[],Object(c.c)(r,(function(t){var e=t.geometry.coordinates,r=e[0],o=e.slice(1);n.push(Object(s.k)([r])),o.forEach((function(t){i.push(Object(s.k)([t]))}))})),[Object(s.e)(n),Object(s.e)(i)]),u=a[0],h=a[1];return function(t,e,r){var n=[];return n.push(t.geometry.coordinates[0]),Object(c.c)(e,(function(t){n.push(t.geometry.coordinates[0])})),Object(c.c)(r,(function(t){n.push(t.geometry.coordinates[0])})),Object(s.k)(n)}(o,u=l(u),h=l(h))}},function(t,e,r){"use strict";var n=r(26),i=r(199),o=r(118),a=r(253),s=r(59),u=r(48),c=r(35),l=r(95),h=r(44),p=r(25),d=r(265),f=r(64);function g(t,e){return[[-1/0,-1/0,1/0,1/0]]}var m=r(53),y=r(266),v=r(198),A=r(119),_=r(225),b=function(t){function e(e,r){t.call(this,e),this.feature=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(l.a),x=function(t){function e(e){var r=e||{};t.call(this,{attributions:r.attributions,projection:void 0,state:v.a.READY,wrapX:void 0===r.wrapX||r.wrapX}),this.loader_=f.c,this.format_=r.format,this.overlaps_=null==r.overlaps||r.overlaps,this.url_=r.url,void 0!==r.loader?this.loader_=r.loader:void 0!==this.url_&&(Object(u.a)(this.format_,7),this.loader_=Object(d.b)(this.url_,this.format_)),this.strategy_=void 0!==r.strategy?r.strategy:g;var n,o,a=void 0===r.useSpatialIndex||r.useSpatialIndex;this.featuresRtree_=a?new _.a:null,this.loadedExtentsRtree_=new _.a,this.nullGeometryFeatures_={},this.idIndex_={},this.undefIdIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(n=r.features).getArray()),a||void 0!==n||(n=new i.a(o)),void 0!==o&&this.addFeaturesInternal(o),void 0!==n&&this.bindFeaturesCollection_(n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=Object(n.c)(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var i=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new b(A.a.ADDFEATURE,t))}},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Object(c.a)(e,h.a.CHANGE,this.handleFeatureChange_,this),Object(c.a)(e,a.a.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var r=!0,n=e.getId();return void 0!==n?n.toString()in this.idIndex_?r=!1:this.idIndex_[n.toString()]=e:(Object(u.a)(!(t in this.undefIdIndex_),30),this.undefIdIndex_[t]=e),r},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],i=[],o=0,a=t.length;o\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,n,r),t.apply(this,arguments)}}u="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;r-1}function S(t){return t.trim().split(/\s+/g)}function T(t,e,r){if(t.indexOf&&!r)return t.indexOf(e);for(var n=0;nr[e]})):n.sort()),n}function L(t,e){for(var r,n,i=e[0].toUpperCase()+e.slice(1),o=0;o1&&!r.firstMultiple?r.firstMultiple=G(e):1===i&&(r.firstMultiple=!1);var o=r.firstInput,a=r.firstMultiple,s=a?a.center:o.center,u=e.center=H(n);e.timeStamp=d(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=W(s,u),e.distance=q(s,u),function(t,e){var r=e.center,n=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:r.x,y:r.y});e.deltaX=i.x+(r.x-n.x),e.deltaY=i.y+(r.y-n.y)}(r,e),e.offsetDirection=Q(e.deltaX,e.deltaY);var c=V(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=p(c.x)>p(c.y)?c.x:c.y,e.scale=a?(l=a.pointers,h=n,q(h[0],h[1],j)/q(l[0],l[1],j)):1,e.rotation=a?function(t,e){return W(e[1],e[0],j)+W(t[1],t[0],j)}(a.pointers,n):0,e.maxPointers=r.prevInput?e.pointers.length>r.prevInput.maxPointers?e.pointers.length:r.prevInput.maxPointers:e.pointers.length,function(t,e){var r,n,i,o,a=t.lastInterval||e,s=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(s>25||void 0===a.velocity)){var u=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,l=V(s,u,c);n=l.x,i=l.y,r=p(l.x)>p(l.y)?l.x:l.y,o=Q(u,c),t.lastInterval=e}else r=a.velocity,n=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=r,e.velocityX=n,e.velocityY=i,e.direction=o}(r,e);var l,h;var f=t.element;I(e.srcEvent.target,f)&&(f=e.srcEvent.target);e.target=f}(t,r),t.emit("hammer.input",r),t.recognize(r),t.session.prevInput=r}function G(t){for(var e=[],r=0;r=p(e)?t<0?2:4:e<0?8:16}function q(t,e,r){r||(r=F);var n=e[r[0]]-t[r[0]],i=e[r[1]]-t[r[1]];return Math.sqrt(n*n+i*i)}function W(t,e,r){r||(r=F);var n=e[r[0]]-t[r[0]],i=e[r[1]]-t[r[1]];return 180*Math.atan2(i,n)/Math.PI}z.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(R(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(R(this.element),this.evWin,this.domHandler)}};var Y={mousedown:1,mousemove:2,mouseup:4};function X(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,z.apply(this,arguments)}_(X,z,{handler:function(t){var e=Y[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},K={2:"touch",3:"pen",4:"mouse",5:"kinect"},J="pointerdown",$="pointermove pointerup pointercancel";function tt(){this.evEl=J,this.evWin=$,z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(J="MSPointerDown",$="MSPointerMove MSPointerUp MSPointerCancel"),_(tt,z,{handler:function(t){var e=this.store,r=!1,n=t.type.toLowerCase().replace("ms",""),i=Z[n],o=K[t.pointerType]||t.pointerType,a="touch"==o,s=T(e,t.pointerId,"pointerId");1&i&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):12&i&&(r=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),r&&e.splice(s,1))}});var et={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function rt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,z.apply(this,arguments)}function nt(t,e){var r=P(t.touches),n=P(t.changedTouches);return 12&e&&(r=O(r.concat(n),"identifier",!0)),[r,n]}_(rt,z,{handler:function(t){var e=et[t.type];if(1===e&&(this.started=!0),this.started){var r=nt.call(this,t,e);12&e&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:r[0],changedPointers:r[1],pointerType:"touch",srcEvent:t})}}});var it={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ot(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},z.apply(this,arguments)}function at(t,e){var r=P(t.touches),n=this.targetIds;if(3&e&&1===r.length)return n[r[0].identifier]=!0,[r,r];var i,o,a=P(t.changedTouches),s=[],u=this.target;if(o=r.filter((function(t){return I(t.target,u)})),1===e)for(i=0;i-1&&n.splice(t,1)}),2500)}}function lt(t){for(var e=t.srcEvent.clientX,r=t.srcEvent.clientY,n=0;n-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,r=this.state;function n(r){e.manager.emit(r,t)}r<8&&n(e.options.event+mt(r)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),r>=8&&n(e.options.event+mt(r))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;te.threshold&&i&e.direction},attrTest:function(t){return At.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=yt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(bt,At,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),_(xt,gt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,n=t.distancee.time;if(this._input=t,!n||!r||12&t.eventType&&!i)this.reset();else if(1&t.eventType)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),_(wt,At,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),_(Ct,At,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _t.prototype.getTouchAction.call(this)},attrTest:function(t){var e,r=this.options.direction;return 30&r?e=t.overallVelocity:6&r?e=t.overallVelocityX:24&r&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&r&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&p(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=yt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),_(Et,gt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},process:function(t){var e=this.options,r=t.pointers.length===e.pointers,n=t.distance=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(t,e,r,i,o){for(var a,s=[e,r];s.length;)(r=s.pop())-(e=s.pop())<=i||(a=e+Math.ceil((r-e)/i/2)*i,n(t,a,e,r,o),s.push(e,a,a,r))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!f(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),s=g(r.children.splice(o,r.children.length-o));s.height=r.height,s.leaf=r.leaf,a(r,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,u,c,l,p,d,f,g,m,y,v;for(c=l=1/0,n=e;n<=r-e;n++)i=s(t,0,n,this.toBBox),o=s(t,n,r,this.toBBox),d=i,f=o,g=void 0,m=void 0,y=void 0,v=void 0,g=Math.max(d.minX,f.minX),m=Math.max(d.minY,f.minY),y=Math.min(d.maxX,f.maxX),v=Math.min(d.maxY,f.maxY),a=Math.max(0,y-g)*Math.max(0,v-m),u=h(i)+h(o),a=e;i--)o=t.children[i],u(l,t.leaf?a(o):o),h+=p(l);return h},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)u(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():a(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return C})),r.d(e,"b",(function(){return E}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(17),u=r.n(s),c=r(12),l=r.n(c),h=r(13),p=r.n(h),d=r(10),f=r.n(d),g=r(2),m=r(36),y=r(96),v=r(186),A=r(166),_=r(187),b=r(185),x=r(21);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return p()(this,r)}}var C=function(t){l()(r,t);var e=w(r);function r(t,n,o){var a;return i()(this,r),(a=e.call(this,null,o)).style=void 0,a.data=void 0,a._layerIds=void 0,a._visible=void 0,a.style=t,a.data=Object(g.isDef)(n)?n:Object(g.buildEmptyFeatureCollection)(),a._layerIds=[],a._visible=!0,a}return a()(r,[{key:"init",value:function(){this.setLayerFeature(this.data)}},{key:"buildLayer",value:function(){for(var t=0,e=Object(g.arrayLength)(this.style);t0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function M(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function S(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],c=r[2]*n[3]-r[3]*n[2],l=e[0],h=e[1],p=e[2],d=e[3];return t[0]=h*c-p*u+d*s,t[1]=-l*c+p*a-d*o,t[2]=l*u-h*a+d*i,t[3]=-l*s+h*o-p*i,t}function T(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function P(t,e){var r,i,o,a,s,u;e=e||1;do{s=(r=2*n.c()-1)*r+(i=2*n.c()-1)*i}while(s>=1);do{u=(o=2*n.c()-1)*o+(a=2*n.c()-1)*a}while(u>=1);var c=Math.sqrt((1-s)/u);return t[0]=e*r,t[1]=e*i,t[2]=e*o*c,t[3]=e*a*c,t}function O(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function L(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*o-u*i,h=c*i+u*n-a*o,p=c*o+a*i-s*n,d=-a*n-s*i-u*o;return t[0]=l*c+d*-a+h*-u-p*-s,t[1]=h*c+d*-s+p*-a-l*-u,t[2]=p*c+d*-u+l*-s-h*-a,t[3]=e[3],t}function k(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function R(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function D(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function B(t,e){var r=t[0],i=t[1],o=t[2],a=t[3],s=e[0],u=e[1],c=e[2],l=e[3];return Math.abs(r-s)<=n.b*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-u)<=n.b*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=n.b*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-l)<=n.b*Math.max(1,Math.abs(a),Math.abs(l))}var N,F=l,j=h,z=p,U=_,G=b,H=x,V=w,Q=(N=i(),function(t,e,r,n,i,o){var a,s;for(e||(e=4),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a=e[1]?t[1]:e[1],u=t[0]>=e[0]?t[0]:e[0],c=t[1]<=e[1]?t[1]:e[1],l=u,h=s,p=a,d=c;return r.push(a,s),n.push(p,d),i.push(l,h),o.push(u,c),[].concat([n,r,i,o,n])}},function(t,e,r){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r + * Copyright (c) 2018 Niklas von Hertzen + * Released under MIT License + */ +var n;n=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=27)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var r=0;r3?r[3]:null]):function(t){var e=t.match(o);return!!e&&[parseInt(e[1][0]+e[1][0],16),parseInt(e[1][1]+e[1][1],16),parseInt(e[1][2]+e[1][2],16),null]}(e)||function(t){var e=t.match(s);return!!e&&[Number(e[1]),Number(e[2]),Number(e[3]),null]}(e)||function(t){var e=t.match(u);return!!(e&&e.length>4)&&[Number(e[1]),Number(e[2]),Number(e[3]),Number(e[4])]}(e)||function(t){var e=l[t.toLowerCase()];return e||!1}(e)||function(t){var e=t.match(a);return!!e&&[parseInt(e[1].substring(0,2),16),parseInt(e[1].substring(2,4),16),parseInt(e[1].substring(4,6),16),null]}(e)||[0,0,0,null],c=n(i,4),h=c[0],p=c[1],d=c[2],f=c[3];this.r=h,this.g=p,this.b=d,this.a=f}return i(t,[{key:"isTransparent",value:function(){return 0===this.a}},{key:"toString",value:function(){return null!==this.a&&1!==this.a?"rgba("+this.r+","+this.g+","+this.b+","+this.a+")":"rgb("+this.r+","+this.g+","+this.b+")"}}]),t}();e.default=c;var l={transparent:[0,0,0,0],aliceblue:[240,248,255,null],antiquewhite:[250,235,215,null],aqua:[0,255,255,null],aquamarine:[127,255,212,null],azure:[240,255,255,null],beige:[245,245,220,null],bisque:[255,228,196,null],black:[0,0,0,null],blanchedalmond:[255,235,205,null],blue:[0,0,255,null],blueviolet:[138,43,226,null],brown:[165,42,42,null],burlywood:[222,184,135,null],cadetblue:[95,158,160,null],chartreuse:[127,255,0,null],chocolate:[210,105,30,null],coral:[255,127,80,null],cornflowerblue:[100,149,237,null],cornsilk:[255,248,220,null],crimson:[220,20,60,null],cyan:[0,255,255,null],darkblue:[0,0,139,null],darkcyan:[0,139,139,null],darkgoldenrod:[184,134,11,null],darkgray:[169,169,169,null],darkgreen:[0,100,0,null],darkgrey:[169,169,169,null],darkkhaki:[189,183,107,null],darkmagenta:[139,0,139,null],darkolivegreen:[85,107,47,null],darkorange:[255,140,0,null],darkorchid:[153,50,204,null],darkred:[139,0,0,null],darksalmon:[233,150,122,null],darkseagreen:[143,188,143,null],darkslateblue:[72,61,139,null],darkslategray:[47,79,79,null],darkslategrey:[47,79,79,null],darkturquoise:[0,206,209,null],darkviolet:[148,0,211,null],deeppink:[255,20,147,null],deepskyblue:[0,191,255,null],dimgray:[105,105,105,null],dimgrey:[105,105,105,null],dodgerblue:[30,144,255,null],firebrick:[178,34,34,null],floralwhite:[255,250,240,null],forestgreen:[34,139,34,null],fuchsia:[255,0,255,null],gainsboro:[220,220,220,null],ghostwhite:[248,248,255,null],gold:[255,215,0,null],goldenrod:[218,165,32,null],gray:[128,128,128,null],green:[0,128,0,null],greenyellow:[173,255,47,null],grey:[128,128,128,null],honeydew:[240,255,240,null],hotpink:[255,105,180,null],indianred:[205,92,92,null],indigo:[75,0,130,null],ivory:[255,255,240,null],khaki:[240,230,140,null],lavender:[230,230,250,null],lavenderblush:[255,240,245,null],lawngreen:[124,252,0,null],lemonchiffon:[255,250,205,null],lightblue:[173,216,230,null],lightcoral:[240,128,128,null],lightcyan:[224,255,255,null],lightgoldenrodyellow:[250,250,210,null],lightgray:[211,211,211,null],lightgreen:[144,238,144,null],lightgrey:[211,211,211,null],lightpink:[255,182,193,null],lightsalmon:[255,160,122,null],lightseagreen:[32,178,170,null],lightskyblue:[135,206,250,null],lightslategray:[119,136,153,null],lightslategrey:[119,136,153,null],lightsteelblue:[176,196,222,null],lightyellow:[255,255,224,null],lime:[0,255,0,null],limegreen:[50,205,50,null],linen:[250,240,230,null],magenta:[255,0,255,null],maroon:[128,0,0,null],mediumaquamarine:[102,205,170,null],mediumblue:[0,0,205,null],mediumorchid:[186,85,211,null],mediumpurple:[147,112,219,null],mediumseagreen:[60,179,113,null],mediumslateblue:[123,104,238,null],mediumspringgreen:[0,250,154,null],mediumturquoise:[72,209,204,null],mediumvioletred:[199,21,133,null],midnightblue:[25,25,112,null],mintcream:[245,255,250,null],mistyrose:[255,228,225,null],moccasin:[255,228,181,null],navajowhite:[255,222,173,null],navy:[0,0,128,null],oldlace:[253,245,230,null],olive:[128,128,0,null],olivedrab:[107,142,35,null],orange:[255,165,0,null],orangered:[255,69,0,null],orchid:[218,112,214,null],palegoldenrod:[238,232,170,null],palegreen:[152,251,152,null],paleturquoise:[175,238,238,null],palevioletred:[219,112,147,null],papayawhip:[255,239,213,null],peachpuff:[255,218,185,null],peru:[205,133,63,null],pink:[255,192,203,null],plum:[221,160,221,null],powderblue:[176,224,230,null],purple:[128,0,128,null],rebeccapurple:[102,51,153,null],red:[255,0,0,null],rosybrown:[188,143,143,null],royalblue:[65,105,225,null],saddlebrown:[139,69,19,null],salmon:[250,128,114,null],sandybrown:[244,164,96,null],seagreen:[46,139,87,null],seashell:[255,245,238,null],sienna:[160,82,45,null],silver:[192,192,192,null],skyblue:[135,206,235,null],slateblue:[106,90,205,null],slategray:[112,128,144,null],slategrey:[112,128,144,null],snow:[255,250,250,null],springgreen:[0,255,127,null],steelblue:[70,130,180,null],tan:[210,180,140,null],teal:[0,128,128,null],thistle:[216,191,216,null],tomato:[255,99,71,null],turquoise:[64,224,208,null],violet:[238,130,238,null],wheat:[245,222,179,null],white:[255,255,255,null],whitesmoke:[245,245,245,null],yellow:[255,255,0,null],yellowgreen:[154,205,50,null]};e.TRANSPARENT=new c([0,0,0,0])},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var r=0;r1&&(n/=g,o/=g,a/=g,s/=g,u/=g,h/=g,p/=g,d/=g);var m=t.width-a,y=t.height-h,v=t.width-u,A=t.height-d;return{topLeftOuter:n>0||o>0?l(t.left,t.top,n,o,c.TOP_LEFT):new i.default(t.left,t.top),topLeftInner:n>0||o>0?l(t.left+e[3].borderWidth,t.top+e[0].borderWidth,Math.max(0,n-e[3].borderWidth),Math.max(0,o-e[0].borderWidth),c.TOP_LEFT):new i.default(t.left+e[3].borderWidth,t.top+e[0].borderWidth),topRightOuter:a>0||s>0?l(t.left+m,t.top,a,s,c.TOP_RIGHT):new i.default(t.left+t.width,t.top),topRightInner:a>0||s>0?l(t.left+Math.min(m,t.width+e[3].borderWidth),t.top+e[0].borderWidth,m>t.width+e[3].borderWidth?0:a-e[3].borderWidth,s-e[0].borderWidth,c.TOP_RIGHT):new i.default(t.left+t.width-e[1].borderWidth,t.top+e[0].borderWidth),bottomRightOuter:u>0||h>0?l(t.left+v,t.top+y,u,h,c.BOTTOM_RIGHT):new i.default(t.left+t.width,t.top+t.height),bottomRightInner:u>0||h>0?l(t.left+Math.min(v,t.width-e[3].borderWidth),t.top+Math.min(y,t.height+e[0].borderWidth),Math.max(0,u-e[1].borderWidth),h-e[2].borderWidth,c.BOTTOM_RIGHT):new i.default(t.left+t.width-e[1].borderWidth,t.top+t.height-e[2].borderWidth),bottomLeftOuter:p>0||d>0?l(t.left,t.top+A,p,d,c.BOTTOM_LEFT):new i.default(t.left,t.top+t.height),bottomLeftInner:p>0||d>0?l(t.left+e[3].borderWidth,t.top+A,Math.max(0,p-e[3].borderWidth),d-e[2].borderWidth,c.BOTTOM_LEFT):new i.default(t.left+e[3].borderWidth,t.top+t.height-e[2].borderWidth)}},{TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_RIGHT:2,BOTTOM_LEFT:3}),l=function(t,e,r,n,a){var s=(Math.sqrt(2)-1)/3*4,u=r*s,l=n*s,h=t+r,p=e+n;switch(a){case c.TOP_LEFT:return new o.default(new i.default(t,p),new i.default(t,p-l),new i.default(h-u,e),new i.default(h,e));case c.TOP_RIGHT:return new o.default(new i.default(t,e),new i.default(t+u,e),new i.default(h,p-l),new i.default(h,p));case c.BOTTOM_RIGHT:return new o.default(new i.default(h,e),new i.default(h,e+l),new i.default(t+u,p),new i.default(t,p));case c.BOTTOM_LEFT:default:return new o.default(new i.default(h,p),new i.default(h-u,p),new i.default(t,e+l),new i.default(t,e))}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.contains=function(t,e){return 0!=(t&e)},e.distance=function(t,e){return Math.sqrt(t*t+e*e)},e.copyCSSStyles=function(t,e){for(var r=t.length-1;r>=0;r--){var n=t.item(r);"content"!==n&&e.style.setProperty(n,t.getPropertyValue(n))}return e},e.SMALL_IMAGE="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseBackgroundImage=e.parseBackground=e.calculateBackgroundRepeatPath=e.calculateBackgroundPosition=e.calculateBackgroungPositioningArea=e.calculateBackgroungPaintingArea=e.calculateGradientBackgroundSize=e.calculateBackgroundSize=e.BACKGROUND_ORIGIN=e.BACKGROUND_CLIP=e.BACKGROUND_SIZE=e.BACKGROUND_REPEAT=void 0;var n=c(r(0)),i=c(r(1)),o=c(r(31)),a=c(r(7)),s=r(2),u=r(17);function c(t){return t&&t.__esModule?t:{default:t}}var l=e.BACKGROUND_REPEAT={REPEAT:0,NO_REPEAT:1,REPEAT_X:2,REPEAT_Y:3},h=e.BACKGROUND_SIZE={AUTO:0,CONTAIN:1,COVER:2,LENGTH:3},p=e.BACKGROUND_CLIP={BORDER_BOX:0,PADDING_BOX:1,CONTENT_BOX:2},d=e.BACKGROUND_ORIGIN=p,f=function t(e){switch(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e){case"contain":this.size=h.CONTAIN;break;case"cover":this.size=h.COVER;break;case"auto":this.size=h.AUTO;break;default:this.value=new i.default(e)}},g=(e.calculateBackgroundSize=function(t,e,r){var n=0,i=0,a=t.size;if(a[0].size===h.CONTAIN||a[0].size===h.COVER){var s=r.width/r.height,u=e.width/e.height;return s0&&(t=i.substr(0,e).toLowerCase(),i=i.substr(e)),"none"!==(i=i.toLowerCase())&&r.push({prefix:t,method:i,args:n})}n=[],i=a=""};return t.split("").forEach((function(t){if(0!==s||!e.test(t)){switch(t){case'"':o?o===t&&(o=null):o=t;break;case"(":if(o)break;if(0===s)return void(s=1);u++;break;case")":if(o)break;if(1===s){if(0===u)return s=0,void c();u--}break;case",":if(o)break;if(0===s)return void c();if(1===s&&0===u&&!i.match(/^url$/i))return n.push(a.trim()),void(a="")}0===s?i+=t:a+=t}})),c(),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PATH={VECTOR:0,BEZIER_CURVE:1,CIRCLE:2}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(t,e){for(var r=0;r0&&this.style.visibility===I.VISIBILITY.VISIBLE}},{key:"isAbsolutelyPositioned",value:function(){return this.style.position!==b.POSITION.STATIC&&this.style.position!==b.POSITION.RELATIVE}},{key:"isPositioned",value:function(){return this.style.position!==b.POSITION.STATIC}},{key:"isFloating",value:function(){return this.style.float!==p.FLOAT.NONE}},{key:"isRootElement",value:function(){return null===this.parent}},{key:"isTransformed",value:function(){return null!==this.style.transform}},{key:"isPositionedWithZIndex",value:function(){return this.isPositioned()&&!this.style.zIndex.auto}},{key:"isInlineLevel",value:function(){return(0,s.contains)(this.style.display,h.DISPLAY.INLINE)||(0,s.contains)(this.style.display,h.DISPLAY.INLINE_BLOCK)||(0,s.contains)(this.style.display,h.DISPLAY.INLINE_FLEX)||(0,s.contains)(this.style.display,h.DISPLAY.INLINE_GRID)||(0,s.contains)(this.style.display,h.DISPLAY.INLINE_LIST_ITEM)||(0,s.contains)(this.style.display,h.DISPLAY.INLINE_TABLE)}},{key:"isInlineBlockOrInlineTable",value:function(){return(0,s.contains)(this.style.display,h.DISPLAY.INLINE_BLOCK)||(0,s.contains)(this.style.display,h.DISPLAY.INLINE_TABLE)}}]),t}();e.default=k;var R=function(t,e){if(t instanceof t.ownerDocument.defaultView.SVGSVGElement||t instanceof SVGSVGElement){var r=new XMLSerializer;return e.loadImage("data:image/svg+xml,"+encodeURIComponent(r.serializeToString(t)))}switch(t.tagName){case"IMG":var n=t;return e.loadImage(n.currentSrc||n.src);case"CANVAS":var i=t;return e.loadCanvas(i);case"IFRAME":var o=t.getAttribute("data-html2canvas-internal-iframe-key");if(o)return o}return null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(5);e.default=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=n.PATH.VECTOR,this.x=e,this.y=r,isNaN(e)&&console.error("Invalid x value given for Vector"),isNaN(r)&&console.error("Invalid y value given for Vector")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseListStyle=e.parseListStyleType=e.LIST_STYLE_TYPE=e.LIST_STYLE_POSITION=void 0;var n=r(4),i=e.LIST_STYLE_POSITION={INSIDE:0,OUTSIDE:1},o=e.LIST_STYLE_TYPE={NONE:-1,DISC:0,CIRCLE:1,SQUARE:2,DECIMAL:3,CJK_DECIMAL:4,DECIMAL_LEADING_ZERO:5,LOWER_ROMAN:6,UPPER_ROMAN:7,LOWER_GREEK:8,LOWER_ALPHA:9,UPPER_ALPHA:10,ARABIC_INDIC:11,ARMENIAN:12,BENGALI:13,CAMBODIAN:14,CJK_EARTHLY_BRANCH:15,CJK_HEAVENLY_STEM:16,CJK_IDEOGRAPHIC:17,DEVANAGARI:18,ETHIOPIC_NUMERIC:19,GEORGIAN:20,GUJARATI:21,GURMUKHI:22,HEBREW:22,HIRAGANA:23,HIRAGANA_IROHA:24,JAPANESE_FORMAL:25,JAPANESE_INFORMAL:26,KANNADA:27,KATAKANA:28,KATAKANA_IROHA:29,KHMER:30,KOREAN_HANGUL_FORMAL:31,KOREAN_HANJA_FORMAL:32,KOREAN_HANJA_INFORMAL:33,LAO:34,LOWER_ARMENIAN:35,MALAYALAM:36,MONGOLIAN:37,MYANMAR:38,ORIYA:39,PERSIAN:40,SIMP_CHINESE_FORMAL:41,SIMP_CHINESE_INFORMAL:42,TAMIL:43,TELUGU:44,THAI:45,TIBETAN:46,TRAD_CHINESE_FORMAL:47,TRAD_CHINESE_INFORMAL:48,UPPER_ARMENIAN:49,DISCLOSURE_OPEN:50,DISCLOSURE_CLOSED:51},a=e.parseListStyleType=function(t){switch(t){case"disc":return o.DISC;case"circle":return o.CIRCLE;case"square":return o.SQUARE;case"decimal":return o.DECIMAL;case"cjk-decimal":return o.CJK_DECIMAL;case"decimal-leading-zero":return o.DECIMAL_LEADING_ZERO;case"lower-roman":return o.LOWER_ROMAN;case"upper-roman":return o.UPPER_ROMAN;case"lower-greek":return o.LOWER_GREEK;case"lower-alpha":return o.LOWER_ALPHA;case"upper-alpha":return o.UPPER_ALPHA;case"arabic-indic":return o.ARABIC_INDIC;case"armenian":return o.ARMENIAN;case"bengali":return o.BENGALI;case"cambodian":return o.CAMBODIAN;case"cjk-earthly-branch":return o.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return o.CJK_HEAVENLY_STEM;case"cjk-ideographic":return o.CJK_IDEOGRAPHIC;case"devanagari":return o.DEVANAGARI;case"ethiopic-numeric":return o.ETHIOPIC_NUMERIC;case"georgian":return o.GEORGIAN;case"gujarati":return o.GUJARATI;case"gurmukhi":return o.GURMUKHI;case"hebrew":return o.HEBREW;case"hiragana":return o.HIRAGANA;case"hiragana-iroha":return o.HIRAGANA_IROHA;case"japanese-formal":return o.JAPANESE_FORMAL;case"japanese-informal":return o.JAPANESE_INFORMAL;case"kannada":return o.KANNADA;case"katakana":return o.KATAKANA;case"katakana-iroha":return o.KATAKANA_IROHA;case"khmer":return o.KHMER;case"korean-hangul-formal":return o.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return o.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return o.KOREAN_HANJA_INFORMAL;case"lao":return o.LAO;case"lower-armenian":return o.LOWER_ARMENIAN;case"malayalam":return o.MALAYALAM;case"mongolian":return o.MONGOLIAN;case"myanmar":return o.MYANMAR;case"oriya":return o.ORIYA;case"persian":return o.PERSIAN;case"simp-chinese-formal":return o.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return o.SIMP_CHINESE_INFORMAL;case"tamil":return o.TAMIL;case"telugu":return o.TELUGU;case"thai":return o.THAI;case"tibetan":return o.TIBETAN;case"trad-chinese-formal":return o.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return o.TRAD_CHINESE_INFORMAL;case"upper-armenian":return o.UPPER_ARMENIAN;case"disclosure-open":return o.DISCLOSURE_OPEN;case"disclosure-closed":return o.DISCLOSURE_CLOSED;case"none":default:return o.NONE}},s=(e.parseListStyle=function(t){var e=(0,n.parseBackgroundImage)(t.getPropertyValue("list-style-image"));return{listStyleType:a(t.getPropertyValue("list-style-type")),listStyleImage:e.length?e[0]:null,listStylePosition:s(t.getPropertyValue("list-style-position"))}},function(t){switch(t){case"inside":return i.INSIDE;case"outside":default:return i.OUTSIDE}})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var r=0;r0?e+r.toUpperCase():t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(23),i=function(t){return 0===t[0]&&255===t[1]&&0===t[2]&&255===t[3]},o={get SUPPORT_RANGE_BOUNDS(){var t=function(t){if(t.createRange){var e=t.createRange();if(e.getBoundingClientRect){var r=t.createElement("boundtest");r.style.height="123px",r.style.display="block",t.body.appendChild(r),e.selectNode(r);var n=e.getBoundingClientRect(),i=Math.round(n.height);if(t.body.removeChild(r),123===i)return!0}}return!1}(document);return Object.defineProperty(o,"SUPPORT_RANGE_BOUNDS",{value:t}),t},get SUPPORT_SVG_DRAWING(){var t=function(t){var e=new Image,r=t.createElement("canvas"),n=r.getContext("2d");e.src="data:image/svg+xml,";try{n.drawImage(e,0,0),r.toDataURL()}catch(t){return!1}return!0}(document);return Object.defineProperty(o,"SUPPORT_SVG_DRAWING",{value:t}),t},get SUPPORT_BASE64_DRAWING(){return function(t){var e=function(t,e){var r=new Image,n=t.createElement("canvas"),i=n.getContext("2d");return new Promise((function(t){r.src=e;var o=function(){try{i.drawImage(r,0,0),n.toDataURL()}catch(e){return t(!1)}return t(!0)};r.onload=o,r.onerror=function(){return t(!1)},!0===r.complete&&setTimeout((function(){o()}),500)}))}(document,t);return Object.defineProperty(o,"SUPPORT_BASE64_DRAWING",{value:function(){return e}}),e}},get SUPPORT_FOREIGNOBJECT_DRAWING(){var t="function"==typeof Array.from&&"function"==typeof window.fetch?function(t){var e=t.createElement("canvas");e.width=100,e.height=100;var r=e.getContext("2d");r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,100,100);var o=new Image,a=e.toDataURL();o.src=a;var s=(0,n.createForeignObjectSVG)(100,100,0,0,o);return r.fillStyle="red",r.fillRect(0,0,100,100),(0,n.loadSerializedSVG)(s).then((function(e){r.drawImage(e,0,0);var o=r.getImageData(0,0,100,100).data;r.fillStyle="red",r.fillRect(0,0,100,100);var s=t.createElement("div");return s.style.backgroundImage="url("+a+")",s.style.height="100px",i(o)?(0,n.loadSerializedSVG)((0,n.createForeignObjectSVG)(100,100,0,0,s)):Promise.reject(!1)})).then((function(t){return r.drawImage(t,0,0),i(r.getImageData(0,0,100,100).data)})).catch((function(t){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(o,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:t}),t},get SUPPORT_CORS_IMAGES(){var t=void 0!==(new Image).crossOrigin;return Object.defineProperty(o,"SUPPORT_CORS_IMAGES",{value:t}),t},get SUPPORT_RESPONSE_TYPE(){var t="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(o,"SUPPORT_RESPONSE_TYPE",{value:t}),t},get SUPPORT_CORS_XHR(){var t="withCredentials"in new XMLHttpRequest;return Object.defineProperty(o,"SUPPORT_CORS_XHR",{value:t}),t}};e.default=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTextDecoration=e.TEXT_DECORATION_LINE=e.TEXT_DECORATION=e.TEXT_DECORATION_STYLE=void 0;var n,i=r(0),o=(n=i)&&n.__esModule?n:{default:n},a=e.TEXT_DECORATION_STYLE={SOLID:0,DOUBLE:1,DOTTED:2,DASHED:3,WAVY:4},s=e.TEXT_DECORATION={NONE:null},u=e.TEXT_DECORATION_LINE={UNDERLINE:1,OVERLINE:2,LINE_THROUGH:3,BLINK:4},c=function(t){switch(t){case"underline":return u.UNDERLINE;case"overline":return u.OVERLINE;case"line-through":return u.LINE_THROUGH}return u.BLINK};e.parseTextDecoration=function(t){var e,r="none"===(e=t.textDecorationLine?t.textDecorationLine:t.textDecoration)?null:e.split(" ").map(c);return null===r?s.NONE:{textDecorationLine:r,textDecorationColor:t.textDecorationColor?new o.default(t.textDecorationColor):null,textDecorationStyle:function(t){switch(t){case"double":return a.DOUBLE;case"dotted":return a.DOTTED;case"dashed":return a.DASHED;case"wavy":return a.WAVY}return a.SOLID}(t.textDecorationStyle)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseBorder=e.BORDER_SIDES=e.BORDER_STYLE=void 0;var n,i=r(0),o=(n=i)&&n.__esModule?n:{default:n},a=e.BORDER_STYLE={NONE:0,SOLID:1},s=e.BORDER_SIDES={TOP:0,RIGHT:1,BOTTOM:2,LEFT:3},u=Object.keys(s).map((function(t){return t.toLowerCase()}));e.parseBorder=function(t){return u.map((function(e){var r=new o.default(t.getPropertyValue("border-"+e+"-color")),n=function(t){switch(t){case"none":return a.NONE}return a.SOLID}(t.getPropertyValue("border-"+e+"-style")),i=parseFloat(t.getPropertyValue("border-"+e+"-width"));return{borderColor:r,borderStyle:n,borderWidth:isNaN(i)?0:i}}))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toCodePoints=function(t){for(var e=[],r=0,n=t.length;r=55296&&i<=56319&&r>10),i%1024+56320)),(r+1===t||e.length>16384)&&(n+=String.fromCharCode.apply(String,e),e.length=0)}return n};for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="undefined"==typeof Uint8Array?[]:new Uint8Array(256),o=0;o>4,h[o++]=(15&s)<<4|u>>2,h[o++]=(3&u)<<6|63&c;return l},e.polyUint16Array=function(t){for(var e=t.length,r=[],n=0;nr?A(t,i,o.length>0):n.integers.reduce((function(e,r,i){for(;t>=r;)t-=r,e+=n.values[i];return e}),"")+o},g=function(t,e,r,n){var i="";do{r||t--,i=n(t)+i,t/=e}while(t*e>=e);return i},m=function(t,e,r,n,i){var o=r-e+1;return(t<0?"-":"")+(g(Math.abs(t),o,n,(function(t){return(0,s.fromCodePoint)(Math.floor(t%o)+e)}))+i)},y=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:". ",n=e.length;return g(Math.abs(t),n,!1,(function(t){return e[Math.floor(t%n)]}))+r},v=function(t,e,r,i,o,s){if(t<-9999||t>9999)return A(t,a.LIST_STYLE_TYPE.CJK_DECIMAL,o.length>0);var u=Math.abs(t),c=o;if(0===u)return e[0]+c;for(var l=0;u>0&&l<=4;l++){var h=u%10;0===h&&(0,n.contains)(s,1)&&""!==c?c=e[h]+c:h>1||1===h&&0===l||1===h&&1===l&&(0,n.contains)(s,2)||1===h&&1===l&&(0,n.contains)(s,4)&&t>100||1===h&&l>1&&(0,n.contains)(s,8)?c=e[h]+(l>0?r[l-1]:"")+c:1===h&&l>0&&(c=r[l-1]+c),u=Math.floor(u/10)}return(t<0?i:"")+c},A=e.createCounterText=function(t,e,r){var n=r?". ":"",i=r?"、":"",o=r?", ":"";switch(e){case a.LIST_STYLE_TYPE.DISC:return"•";case a.LIST_STYLE_TYPE.CIRCLE:return"◦";case a.LIST_STYLE_TYPE.SQUARE:return"◾";case a.LIST_STYLE_TYPE.DECIMAL_LEADING_ZERO:var s=m(t,48,57,!0,n);return s.length<4?"0"+s:s;case a.LIST_STYLE_TYPE.CJK_DECIMAL:return y(t,"〇一二三四五六七八九",i);case a.LIST_STYLE_TYPE.LOWER_ROMAN:return f(t,1,3999,l,a.LIST_STYLE_TYPE.DECIMAL,n).toLowerCase();case a.LIST_STYLE_TYPE.UPPER_ROMAN:return f(t,1,3999,l,a.LIST_STYLE_TYPE.DECIMAL,n);case a.LIST_STYLE_TYPE.LOWER_GREEK:return m(t,945,969,!1,n);case a.LIST_STYLE_TYPE.LOWER_ALPHA:return m(t,97,122,!1,n);case a.LIST_STYLE_TYPE.UPPER_ALPHA:return m(t,65,90,!1,n);case a.LIST_STYLE_TYPE.ARABIC_INDIC:return m(t,1632,1641,!0,n);case a.LIST_STYLE_TYPE.ARMENIAN:case a.LIST_STYLE_TYPE.UPPER_ARMENIAN:return f(t,1,9999,h,a.LIST_STYLE_TYPE.DECIMAL,n);case a.LIST_STYLE_TYPE.LOWER_ARMENIAN:return f(t,1,9999,h,a.LIST_STYLE_TYPE.DECIMAL,n).toLowerCase();case a.LIST_STYLE_TYPE.BENGALI:return m(t,2534,2543,!0,n);case a.LIST_STYLE_TYPE.CAMBODIAN:case a.LIST_STYLE_TYPE.KHMER:return m(t,6112,6121,!0,n);case a.LIST_STYLE_TYPE.CJK_EARTHLY_BRANCH:return y(t,"子丑寅卯辰巳午未申酉戌亥",i);case a.LIST_STYLE_TYPE.CJK_HEAVENLY_STEM:return y(t,"甲乙丙丁戊己庚辛壬癸",i);case a.LIST_STYLE_TYPE.CJK_IDEOGRAPHIC:case a.LIST_STYLE_TYPE.TRAD_CHINESE_INFORMAL:return v(t,"零一二三四五六七八九","十百千萬","負",i,14);case a.LIST_STYLE_TYPE.TRAD_CHINESE_FORMAL:return v(t,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",i,15);case a.LIST_STYLE_TYPE.SIMP_CHINESE_INFORMAL:return v(t,"零一二三四五六七八九","十百千萬","负",i,14);case a.LIST_STYLE_TYPE.SIMP_CHINESE_FORMAL:return v(t,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",i,15);case a.LIST_STYLE_TYPE.JAPANESE_INFORMAL:return v(t,"〇一二三四五六七八九","十百千万","マイナス",i,0);case a.LIST_STYLE_TYPE.JAPANESE_FORMAL:return v(t,"零壱弐参四伍六七八九","拾百千万","マイナス",i,7);case a.LIST_STYLE_TYPE.KOREAN_HANGUL_FORMAL:return v(t,"영일이삼사오육칠팔구","십백천만","마이너스",o,7);case a.LIST_STYLE_TYPE.KOREAN_HANJA_INFORMAL:return v(t,"零一二三四五六七八九","十百千萬","마이너스",o,0);case a.LIST_STYLE_TYPE.KOREAN_HANJA_FORMAL:return v(t,"零壹貳參四五六七八九","拾百千","마이너스",o,7);case a.LIST_STYLE_TYPE.DEVANAGARI:return m(t,2406,2415,!0,n);case a.LIST_STYLE_TYPE.GEORGIAN:return f(t,1,19999,d,a.LIST_STYLE_TYPE.DECIMAL,n);case a.LIST_STYLE_TYPE.GUJARATI:return m(t,2790,2799,!0,n);case a.LIST_STYLE_TYPE.GURMUKHI:return m(t,2662,2671,!0,n);case a.LIST_STYLE_TYPE.HEBREW:return f(t,1,10999,p,a.LIST_STYLE_TYPE.DECIMAL,n);case a.LIST_STYLE_TYPE.HIRAGANA:return y(t,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case a.LIST_STYLE_TYPE.HIRAGANA_IROHA:return y(t,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case a.LIST_STYLE_TYPE.KANNADA:return m(t,3302,3311,!0,n);case a.LIST_STYLE_TYPE.KATAKANA:return y(t,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case a.LIST_STYLE_TYPE.KATAKANA_IROHA:return y(t,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case a.LIST_STYLE_TYPE.LAO:return m(t,3792,3801,!0,n);case a.LIST_STYLE_TYPE.MONGOLIAN:return m(t,6160,6169,!0,n);case a.LIST_STYLE_TYPE.MYANMAR:return m(t,4160,4169,!0,n);case a.LIST_STYLE_TYPE.ORIYA:return m(t,2918,2927,!0,n);case a.LIST_STYLE_TYPE.PERSIAN:return m(t,1776,1785,!0,n);case a.LIST_STYLE_TYPE.TAMIL:return m(t,3046,3055,!0,n);case a.LIST_STYLE_TYPE.TELUGU:return m(t,3174,3183,!0,n);case a.LIST_STYLE_TYPE.THAI:return m(t,3664,3673,!0,n);case a.LIST_STYLE_TYPE.TIBETAN:return m(t,3872,3881,!0,n);case a.LIST_STYLE_TYPE.DECIMAL:default:return m(t,48,57,!0,n)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var r=0;rt.height?(t.left+=(t.width-t.height)/2,t.width=t.height):t.width0&&o){var a=e.ownerDocument.createElement("html2canvaswrapper");(0,l.copyCSSStyles)(e.ownerDocument.defaultView.getComputedStyle(e,null),a),a.style.position="absolute",a.style.left=r.bounds.left+"px",a.style.top=r.bounds.top+"px",i||(a.style.whiteSpace="nowrap");var s=e.ownerDocument.createTextNode(t);a.appendChild(s),o.appendChild(a),r.childNodes.push(n.default.fromTextNode(s,r)),o.removeChild(a)}}),x=function(t){var e="password"===t.type?new Array(t.value.length+1).join("•"):t.value;return 0===e.length?t.placeholder||"":e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTextBounds=e.TextBounds=void 0;var n,i=r(2),o=r(11),a=r(10),s=(n=a)&&n.__esModule?n:{default:n},u=r(24),c=e.TextBounds=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.text=e,this.bounds=r},l=(e.parseTextBounds=function(t,e,r){for(var n=0!==e.style.letterSpacing?(0,u.toCodePoints)(t).map((function(t){return(0,u.fromCodePoint)(t)})):(0,u.breakWords)(t,e),i=n.length,a=r.parentNode?r.parentNode.ownerDocument.defaultView:null,p=a?a.pageXOffset:0,d=a?a.pageYOffset:0,f=[],g=0,m=0;m0)if(s.default.SUPPORT_RANGE_BOUNDS)f.push(new c(y,h(r,g,y.length,p,d)));else{var v=r.splitText(y.length);f.push(new c(y,l(r,p,d))),r=v}else s.default.SUPPORT_RANGE_BOUNDS||(r=r.splitText(y.length));g+=y.length}return f},function(t,e,r){var n=t.ownerDocument.createElement("html2canvaswrapper");n.appendChild(t.cloneNode(!0));var o=t.parentNode;if(o){o.replaceChild(n,t);var a=(0,i.parseBounds)(n,e,r);return n.firstChild&&o.replaceChild(n.firstChild,n),a}return new i.Bounds(0,0,0,0)}),h=function(t,e,r,n,o){var a=t.ownerDocument.createRange();return a.setStart(t,e),a.setEnd(t,e+r),i.Bounds.fromClientRect(a.getBoundingClientRect(),n,o)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var r=0;r5e4)throw new Error("Recursion error while parsing node tree");for(var g,m=e.firstChild;m;m=g){g=m.nextSibling;var y=m.ownerDocument.defaultView;if(m instanceof y.Text||m instanceof Text||y.parent&&m instanceof y.parent.Text)m.data.trim().length>0&&r.childNodes.push(o.default.fromTextNode(m,r));else if(m instanceof y.HTMLElement||m instanceof HTMLElement||y.parent&&m instanceof y.parent.HTMLElement){if(-1===l.indexOf(m.nodeName)){var v=new i.default(m,r,h,f++);if(v.isVisible()){"INPUT"===m.tagName?(0,a.inlineInputElement)(m,v):"TEXTAREA"===m.tagName?(0,a.inlineTextAreaElement)(m,v):"SELECT"===m.tagName?(0,a.inlineSelectElement)(m,v):v.style.listStyle&&v.style.listStyle.listStyleType!==u.LIST_STYLE_TYPE.NONE&&(0,s.inlineListItemElement)(m,v,h);var A="TEXTAREA"!==m.tagName,_=p(v,m);if(_||d(v)){var b=_||v.isPositioned()?c.getRealParentStackingContext():c,x=new n.default(v,b,_);b.contexts.push(x),A&&t(m,v,x,h,f)}else c.children.push(v),A&&t(m,v,c,h,f)}}}else if(m instanceof y.SVGSVGElement||m instanceof SVGSVGElement||y.parent&&m instanceof y.parent.SVGSVGElement){var w=new i.default(m,r,h,f++),C=p(w,m);if(C||d(w)){var E=C||w.isPositioned()?c.getRealParentStackingContext():c,I=new n.default(w,E,C);E.contexts.push(I)}else c.children.push(w)}}},p=function(t,e){return t.isRootElement()||t.isPositionedWithZIndex()||t.style.opacity<1||t.isTransformed()||f(t,e)},d=function(t){return t.isPositioned()||t.isFloating()},f=function(t,e){return"BODY"===e.nodeName&&t.parent instanceof i.default&&t.parent.style.background.backgroundColor.isTransparent()}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=function(){function t(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"strict",r=[],n=[],i=[];return t.forEach((function(t,o){var a=F.get(t);if(a>l?(i.push(!0),a-=l):i.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(t))return n.push(o),r.push(16);if(4===a||11===a){if(0===o)return n.push(o),r.push(E);var s=r[o-1];return-1===H.indexOf(s)?(n.push(n[o-1]),r.push(s)):(n.push(o),r.push(E))}return n.push(o),31===a?r.push("strict"===e?v:P):a===R||29===a?r.push(E):43===a?t>=131072&&t<=196605||t>=196608&&t<=262141?r.push(P):r.push(E):void r.push(a)})),[n,r,i]},W=function(t,e,r,n){var i=n[r];if(Array.isArray(t)?-1!==t.indexOf(i):t===i)for(var o=r;o<=n.length;){var a=n[++o];if(a===e)return!0;if(a!==h)break}if(i===h)for(var s=r;s>0;){var u=n[--s];if(Array.isArray(t)?-1!==t.indexOf(u):t===u)for(var c=r;c<=n.length;){var l=n[++c];if(l===e)return!0;if(l!==h)break}if(u!==h)break}return!1},Y=function(t,e){for(var r=t;r>=0;){var n=e[r];if(n!==h)return n;r--}return 0},X=function(t,e,r,n,i){if(0===r[n])return B;var o=n-1;if(Array.isArray(i)&&!0===i[o])return B;var a=o-1,s=o+1,u=e[o],c=a>=0?e[a]:0,l=e[s];if(2===u&&3===l)return B;if(-1!==z.indexOf(u))return D;if(-1!==z.indexOf(l))return B;if(-1!==U.indexOf(l))return B;if(8===Y(o,e))return N;if(11===F.get(t[o])&&(l===P||l===I||l===M))return B;if(7===u||7===l)return B;if(9===u)return B;if(-1===[h,p,d].indexOf(u)&&9===l)return B;if(-1!==[f,g,m,_,C].indexOf(l))return B;if(Y(o,e)===A)return B;if(W(23,A,o,e))return B;if(W([f,g],v,o,e))return B;if(W(12,12,o,e))return B;if(u===h)return N;if(23===u||23===l)return B;if(16===l||16===u)return N;if(-1!==[p,d,v].indexOf(l)||14===u)return B;if(36===c&&-1!==Q.indexOf(u))return B;if(u===C&&36===l)return B;if(l===y&&-1!==j.concat(y,m,b,P,I,M).indexOf(u))return B;if(-1!==j.indexOf(l)&&u===b||-1!==j.indexOf(u)&&l===b)return B;if(u===w&&-1!==[P,I,M].indexOf(l)||-1!==[P,I,M].indexOf(u)&&l===x)return B;if(-1!==j.indexOf(u)&&-1!==G.indexOf(l)||-1!==G.indexOf(u)&&-1!==j.indexOf(l))return B;if(-1!==[w,x].indexOf(u)&&(l===b||-1!==[A,d].indexOf(l)&&e[s+1]===b)||-1!==[A,d].indexOf(u)&&l===b||u===b&&-1!==[b,C,_].indexOf(l))return B;if(-1!==[b,C,_,f,g].indexOf(l))for(var E=o;E>=0;){var R=e[E];if(R===b)return B;if(-1===[C,_].indexOf(R))break;E--}if(-1!==[w,x].indexOf(l))for(var H=-1!==[f,g].indexOf(u)?a:o;H>=0;){var q=e[H];if(q===b)return B;if(-1===[C,_].indexOf(q))break;H--}if(O===u&&-1!==[O,L,S,T].indexOf(l)||-1!==[L,S].indexOf(u)&&-1!==[L,k].indexOf(l)||-1!==[k,T].indexOf(u)&&l===k)return B;if(-1!==V.indexOf(u)&&-1!==[y,x].indexOf(l)||-1!==V.indexOf(l)&&u===w)return B;if(-1!==j.indexOf(u)&&-1!==j.indexOf(l))return B;if(u===_&&-1!==j.indexOf(l))return B;if(-1!==j.concat(b).indexOf(u)&&l===A||-1!==j.concat(b).indexOf(l)&&u===g)return B;if(41===u&&41===l){for(var X=r[o],Z=1;X>0&&41===e[--X];)Z++;if(Z%2!=0)return B}return u===I&&l===M?B:N},Z=(e.lineBreakAtIndex=function(t,e){if(0===e)return B;if(e>=t.length)return D;var r=q(t),n=o(r,2),i=n[0],a=n[1];return X(t,a,i,e)},function(t,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var r=q(t,e.lineBreak),n=o(r,3),i=n[0],a=n[1],s=n[2];return"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(a=a.map((function(t){return-1!==[b,E,R].indexOf(t)?P:t}))),[i,a,"keep-all"===e.wordBreak?s.map((function(e,r){return e&&t[r]>=19968&&t[r]<=40959})):null]}),K=(e.inlineBreakOpportunities=function(t,e){var r=(0,c.toCodePoints)(t),n=B,i=Z(r,e),a=o(i,3),s=a[0],u=a[1],l=a[2];return r.forEach((function(t,e){n+=(0,c.fromCodePoint)(t)+(e>=r.length-1?D:X(r,u,s,e+1,l))})),n},function(){function t(e,r,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._codePoints=e,this.required=r===D,this.start=n,this.end=i}return i(t,[{key:"slice",value:function(){return c.fromCodePoint.apply(void 0,function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e=l)return{done:!0};for(var t=B;p>o,l=e.UTRIE2_DATA_BLOCK_LENGTH=1<>o,d=e.UTRIE2_INDEX_2_BMP_LENGTH=c+p,f=e.UTRIE2_UTF8_2B_INDEX_2_OFFSET=d,g=e.UTRIE2_UTF8_2B_INDEX_2_LENGTH=32,m=e.UTRIE2_INDEX_1_OFFSET=f+g,y=e.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=65536>>a,v=e.UTRIE2_INDEX_2_BLOCK_LENGTH=1<=0){if(t<55296||t>56319&&t<=65535)return e=((e=this.index[t>>o])<>o)])<>a),e=this.index[e],e+=t>>o&A,e=((e=this.index[e])<0?r.width:n.width,o="number"==typeof r.height&&r.height>0?r.height:n.height;i>0&&o>0&&e.target.clip([(0,a.calculatePaddingBoxPath)(t.curvedBounds)],(function(){e.target.drawImage(r,new a.Bounds(0,0,i,o),n)}))}}},n=t.getClipPaths();n.length?this.target.clip(n,r):r()}},{key:"renderNodeBackgroundAndBorders",value:function(t){var e=this,r=!t.style.background.backgroundColor.isTransparent()||t.style.background.backgroundImage.length,n=t.style.border.some((function(t){return t.borderStyle!==h.BORDER_STYLE.NONE&&!t.borderColor.isTransparent()})),i=function(){var n=(0,l.calculateBackgroungPaintingArea)(t.curvedBounds,t.style.background.backgroundClip);r&&e.target.clip([n],(function(){t.style.background.backgroundColor.isTransparent()||e.target.fill(t.style.background.backgroundColor),e.renderBackgroundImage(t)})),t.style.border.forEach((function(r,n){r.borderStyle===h.BORDER_STYLE.NONE||r.borderColor.isTransparent()||e.renderBorder(r,n,t.curvedBounds)}))};if(r||n){var o=t.parent?t.parent.getClipPaths():[];o.length?this.target.clip(o,i):i()}}},{key:"renderBackgroundImage",value:function(t){var e=this;t.style.background.backgroundImage.slice(0).reverse().forEach((function(r){"url"===r.source.method&&r.source.args.length?e.renderBackgroundRepeat(t,r):/gradient/i.test(r.source.method)&&e.renderBackgroundGradient(t,r)}))}},{key:"renderBackgroundRepeat",value:function(t,e){var r=this.options.imageStore.get(e.source.args[0]);if(r){var n=(0,l.calculateBackgroungPositioningArea)(t.style.background.backgroundOrigin,t.bounds,t.style.padding,t.style.border),i=(0,l.calculateBackgroundSize)(e,r,n),o=(0,l.calculateBackgroundPosition)(e.position,i,n),a=(0,l.calculateBackgroundRepeatPath)(e,o,i,n,t.bounds),s=Math.round(n.left+o.x),u=Math.round(n.top+o.y);this.target.renderRepeat(a,r,i,s,u)}}},{key:"renderBackgroundGradient",value:function(t,e){var r=(0,l.calculateBackgroungPositioningArea)(t.style.background.backgroundOrigin,t.bounds,t.style.padding,t.style.border),n=(0,l.calculateGradientBackgroundSize)(e,r),i=(0,l.calculateBackgroundPosition)(e.position,n,r),o=new a.Bounds(Math.round(r.left+i.x),Math.round(r.top+i.y),n.width,n.height),u=(0,s.parseGradient)(t,e.source,o);if(u)switch(u.type){case s.GRADIENT_TYPE.LINEAR_GRADIENT:this.target.renderLinearGradient(o,u);break;case s.GRADIENT_TYPE.RADIAL_GRADIENT:this.target.renderRadialGradient(o,u)}}},{key:"renderBorder",value:function(t,e,r){this.target.drawShape((0,a.parsePathForBorder)(r,e),t.borderColor)}},{key:"renderStack",value:function(t){var e=this;if(t.container.isVisible()){var r=t.getOpacity();r!==this._opacity&&(this.target.setOpacity(t.getOpacity()),this._opacity=r);var n=t.container.style.transform;null!==n?this.target.transform(t.container.bounds.left+n.transformOrigin[0].value,t.container.bounds.top+n.transformOrigin[1].value,n.transform,(function(){return e.renderStackContent(t)})):this.renderStackContent(t)}}},{key:"renderStackContent",value:function(t){var e=f(t),r=i(e,5),n=r[0],o=r[1],a=r[2],s=r[3],u=r[4],c=d(t),l=i(c,2),h=l[0],p=l[1];this.renderNodeBackgroundAndBorders(t.container),n.sort(g).forEach(this.renderStack,this),this.renderNodeContent(t.container),p.forEach(this.renderNode,this),s.forEach(this.renderStack,this),u.forEach(this.renderStack,this),h.forEach(this.renderNode,this),o.forEach(this.renderStack,this),a.sort(g).forEach(this.renderStack,this)}},{key:"render",value:function(t){var e=this;this.options.backgroundColor&&this.target.rectangle(this.options.x,this.options.y,this.options.width,this.options.height,this.options.backgroundColor),this.renderStack(t);var r=this.target.getTarget();return r.then((function(t){return e.options.logger.log("Render completed"),t}))}}]),t}();e.default=p;var d=function(t){for(var e=[],r=[],n=t.children.length,i=0;i0?n.push(u):r.push(u):u.container.isFloating()?i.push(u):o.push(u)}return[e,r,n,i,o]},g=function(t,e){return t.container.style.zIndex.order>e.container.style.zIndex.order?1:t.container.style.zIndex.ordere.container.index?1:-1}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformWebkitRadialGradientArgs=e.parseGradient=e.RadialGradient=e.LinearGradient=e.RADIAL_GRADIENT_SHAPE=e.GRADIENT_TYPE=void 0;var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=(c(r(6)),r(53)),o=c(r(0)),a=r(1),s=c(a),u=r(3);function c(t){return t&&t.__esModule?t:{default:t}}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var h=/^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i,p=/^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i,d=/(px)|%|( 0)$/i,f=/^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i,g=/^\s*(circle|ellipse)?\s*((?:([\d.]+)(px|r?em|%)\s*(?:([\d.]+)(px|r?em|%))?)|closest-side|closest-corner|farthest-side|farthest-corner)?\s*(?:at\s*(?:(left|center|right)|([\d.]+)(px|r?em|%))\s+(?:(top|center|bottom)|([\d.]+)(px|r?em|%)))?(?:\s|$)/i,m=e.GRADIENT_TYPE={LINEAR_GRADIENT:0,RADIAL_GRADIENT:1},y=e.RADIAL_GRADIENT_SHAPE={CIRCLE:0,ELLIPSE:1},v={left:new s.default("0%"),top:new s.default("0%"),center:new s.default("50%"),right:new s.default("100%"),bottom:new s.default("100%")},A=e.LinearGradient=function t(e,r){l(this,t),this.type=m.LINEAR_GRADIENT,this.colorStops=e,this.direction=r},_=e.RadialGradient=function t(e,r,n,i){l(this,t),this.type=m.RADIAL_GRADIENT,this.colorStops=e,this.shape=r,this.center=n,this.radius=i},b=(e.parseGradient=function(t,e,r){var n=e.args,i=e.method,o=e.prefix;return"linear-gradient"===i?x(n,r,!!o):"gradient"===i&&"linear"===n[0]?x(["to bottom"].concat(O(n.slice(3))),r,!!o):"radial-gradient"===i?w(t,"-webkit-"===o?P(n):n,r):"gradient"===i&&"radial"===n[0]?w(t,O(P(n.slice(1))),r):void 0},function(t,e,r){for(var n=[],i=e;it.optimumDistance)?{optimumCorner:i,optimumDistance:o}:t}),{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},T=function(t,e,r,n,i){var o=r.x,a=r.y,s=0,c=0;switch(t){case"closest-side":e===y.CIRCLE?s=c=Math.min(Math.abs(o),Math.abs(o-i.width),Math.abs(a),Math.abs(a-i.height)):e===y.ELLIPSE&&(s=Math.min(Math.abs(o),Math.abs(o-i.width)),c=Math.min(Math.abs(a),Math.abs(a-i.height)));break;case"closest-corner":if(e===y.CIRCLE)s=c=Math.min((0,u.distance)(o,a),(0,u.distance)(o,a-i.height),(0,u.distance)(o-i.width,a),(0,u.distance)(o-i.width,a-i.height));else if(e===y.ELLIPSE){var l=Math.min(Math.abs(a),Math.abs(a-i.height))/Math.min(Math.abs(o),Math.abs(o-i.width)),h=S(i,o,a,!0);c=l*(s=(0,u.distance)(h.x-o,(h.y-a)/l))}break;case"farthest-side":e===y.CIRCLE?s=c=Math.max(Math.abs(o),Math.abs(o-i.width),Math.abs(a),Math.abs(a-i.height)):e===y.ELLIPSE&&(s=Math.max(Math.abs(o),Math.abs(o-i.width)),c=Math.max(Math.abs(a),Math.abs(a-i.height)));break;case"farthest-corner":if(e===y.CIRCLE)s=c=Math.max((0,u.distance)(o,a),(0,u.distance)(o,a-i.height),(0,u.distance)(o-i.width,a),(0,u.distance)(o-i.width,a-i.height));else if(e===y.ELLIPSE){var p=Math.max(Math.abs(a),Math.abs(a-i.height))/Math.max(Math.abs(o),Math.abs(o-i.width)),d=S(i,o,a,!1);c=p*(s=(0,u.distance)(d.x-o,(d.y-a)/p))}break;default:s=n.x||0,c=void 0!==n.y?n.y:s}return{x:s,y:c}},P=e.transformWebkitRadialGradientArgs=function(t){var e="",r="",n="",i="",o=0,a=/^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i,s=/^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i,u=t[o].match(a);u&&o++;var c=t[o].match(/^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i);c&&(e=c[1]||"","contain"===(n=c[2]||"")?n="closest-side":"cover"===n&&(n="farthest-corner"),o++);var l=t[o].match(s);l&&o++;var h=t[o].match(a);h&&o++;var p=t[o].match(s);p&&o++;var d=h||u;d&&d[1]&&(i=d[1]+(/^\d+$/.test(d[1])?"px":""),d[2]&&(i+=" "+d[2]+(/^\d+$/.test(d[2])?"px":"")));var f=p||l;return f&&(r=f[0],f[1]||(r+="px")),!i||e||r||n||(r=i,i=""),i&&(i="at "+i),[[e,n,r,i].filter((function(t){return!!t})).join(" ")].concat(t.slice(o))},O=function(t){return t.map((function(t){return t.match(f)})).map((function(e,r){if(!e)return t[r];switch(e[1]){case"from":return e[4]+" 0%";case"to":return e[4]+" 100%";case"color-stop":return"%"===e[3]?e[4]+" "+e[2]:e[4]+" "+100*parseFloat(e[2])+"%"}}))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=/([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;e.parseAngle=function(t){var e=t.match(n);if(e){var r=parseFloat(e[1]);switch(e[2].toLowerCase()){case"deg":return Math.PI*r/180;case"grad":return Math.PI/200*r;case"rad":return r;case"turn":return 2*Math.PI*r}}return null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cloneWindow=e.DocumentCloner=void 0;var n=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var r=0;r1&&(r.backgroundColor=""),r.backgroundImage=t.join(",")})),t instanceof HTMLImageElement&&this.resourceLoader.inlineImage(t.src).then((function(e){if(e&&t instanceof HTMLImageElement&&t.parentNode){var r=t.parentNode,n=(0,u.copyCSSStyles)(t.style,e.cloneNode(!1));r.replaceChild(n,t)}})).catch((function(t){e.logger.log("Unable to load image",t)}))}}},{key:"inlineFonts",value:function(t){var e=this;return Promise.all(Array.from(t.styleSheets).map((function(r){return r.href?fetch(r.href).then((function(t){return t.text()})).then((function(t){return g(t,r.href)})).catch((function(t){return e.logger.log("Unable to load stylesheet",t),[]})):f(r,t)}))).then((function(t){return t.reduce((function(t,e){return t.concat(e)}),[])})).then((function(t){return Promise.all(t.map((function(t){return fetch(t.formats[0].src).then((function(t){return t.blob()})).then((function(t){return new Promise((function(e,r){var n=new FileReader;n.onerror=r,n.onload=function(){var t=n.result;e(t)},n.readAsDataURL(t)}))})).then((function(e){return t.fontFace.setProperty("src",'url("'+e+'")'),"@font-face {"+t.fontFace.cssText+" "}))})))})).then((function(r){var n=t.createElement("style");n.textContent=r.join("\n"),e.documentElement.appendChild(n)}))}},{key:"createElementClone",value:function(t){var e=this;if(this.copyStyles&&t instanceof HTMLCanvasElement){var r=t.ownerDocument.createElement("img");try{return r.src=t.toDataURL(),r}catch(t){this.logger.log("Unable to clone canvas contents, canvas is tainted")}}if(t instanceof HTMLIFrameElement){var n=t.cloneNode(!1),i=E();n.setAttribute("data-html2canvas-internal-iframe-key",i);var a=(0,o.parseBounds)(t,0,0),s=a.width,c=a.height;return this.resourceLoader.cache[i]=M(t,this.options).then((function(t){return e.renderer(t,{async:e.options.async,allowTaint:e.options.allowTaint,backgroundColor:"#ffffff",canvas:null,imageTimeout:e.options.imageTimeout,logging:e.options.logging,proxy:e.options.proxy,removeContainer:e.options.removeContainer,scale:e.options.scale,foreignObjectRendering:e.options.foreignObjectRendering,useCORS:e.options.useCORS,target:new l.default,width:s,height:c,x:0,y:0,windowWidth:t.ownerDocument.defaultView.innerWidth,windowHeight:t.ownerDocument.defaultView.innerHeight,scrollX:t.ownerDocument.defaultView.pageXOffset,scrollY:t.ownerDocument.defaultView.pageYOffset},e.logger.child(i))})).then((function(e){return new Promise((function(r,i){var o=document.createElement("img");o.onload=function(){return r(e)},o.onerror=i,o.src=e.toDataURL(),n.parentNode&&n.parentNode.replaceChild((0,u.copyCSSStyles)(t.ownerDocument.defaultView.getComputedStyle(t),o),n)}))})),n}if(t instanceof HTMLStyleElement&&t.sheet&&t.sheet.cssRules){var h=[].slice.call(t.sheet.cssRules,0).reduce((function(t,r){try{return r&&r.cssText?t+r.cssText:t}catch(n){return e.logger.log("Unable to access cssText property",r.name),t}}),""),p=t.cloneNode(!1);return p.textContent=h,p}return t.cloneNode(!1)}},{key:"cloneNode",value:function(t){var e=t.nodeType===Node.TEXT_NODE?document.createTextNode(t.nodeValue):this.createElementClone(t),r=t.ownerDocument.defaultView,n=t instanceof r.HTMLElement?r.getComputedStyle(t):null,i=t instanceof r.HTMLElement?r.getComputedStyle(t,":before"):null,o=t instanceof r.HTMLElement?r.getComputedStyle(t,":after"):null;this.referenceElement===t&&e instanceof r.HTMLElement&&(this.clonedReferenceElement=e),e instanceof r.HTMLBodyElement&&x(e);for(var a=(0,h.parseCounterReset)(n,this.pseudoContentData),s=(0,h.resolvePseudoContent)(t,i,this.pseudoContentData),c=t.firstChild;c;c=c.nextSibling)c.nodeType===Node.ELEMENT_NODE&&("SCRIPT"===c.nodeName||c.hasAttribute("data-html2canvas-ignore")||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(c))||this.copyStyles&&"STYLE"===c.nodeName||e.appendChild(this.cloneNode(c));var l=(0,h.resolvePseudoContent)(t,o,this.pseudoContentData);if((0,h.popCounters)(a,this.pseudoContentData),t instanceof r.HTMLElement&&e instanceof r.HTMLElement)switch(i&&this.inlineAllImages(y(t,e,i,s,v)),o&&this.inlineAllImages(y(t,e,o,l,A)),!n||!this.copyStyles||t instanceof HTMLIFrameElement||(0,u.copyCSSStyles)(n,e),this.inlineAllImages(e),0===t.scrollTop&&0===t.scrollLeft||this.scrolledElements.push([e,t.scrollLeft,t.scrollTop]),t.nodeName){case"CANVAS":this.copyStyles||m(t,e);break;case"TEXTAREA":case"SELECT":e.value=t.value}return e}}]),t}(),f=function(t,e){return(t.cssRules?Array.from(t.cssRules):[]).filter((function(t){return t.type===CSSRule.FONT_FACE_RULE})).map((function(t){for(var r=(0,c.parseBackgroundImage)(t.style.getPropertyValue("src")),n=[],i=0;i0&&"complete"===r.readyState&&(clearInterval(e),n(t))}),50)}}))},P=(e.cloneWindow=function(t,e,r,n,i,o){var a=new d(r,n,i,!1,o),s=t.defaultView.pageXOffset,u=t.defaultView.pageYOffset;return S(t,e).then((function(i){var o=i.contentWindow,c=o.document,l=T(i).then((function(){a.scrolledElements.forEach(C),o.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||o.scrollY===e.top&&o.scrollX===e.left||(c.documentElement.style.top=-e.top+"px",c.documentElement.style.left=-e.left+"px",c.documentElement.style.position="absolute");var s=Promise.resolve([i,a.clonedReferenceElement,a.resourceLoader]),u=n.onclone;return a.clonedReferenceElement instanceof o.HTMLElement||a.clonedReferenceElement instanceof t.defaultView.HTMLElement||a.clonedReferenceElement instanceof HTMLElement?"function"==typeof u?Promise.resolve().then((function(){return u(c)})).then((function(){return s})):s:Promise.reject("Error finding the "+r.nodeName+" in the cloned document")}));return c.open(),c.write(P(document.doctype)+""),function(t,e,r){!t.defaultView||e===t.defaultView.pageXOffset&&r===t.defaultView.pageYOffset||t.defaultView.scrollTo(e,r)}(r.ownerDocument,s,u),c.replaceChild(c.adoptNode(a.documentElement),c.documentElement),c.close(),l}))},function(t){var e="";return t&&(e+=""),e})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ResourceStore=void 0;var n,i=function(){function t(t,e){for(var r=0;r0&&r.push({type:s.ATTRIBUTE,value:h[0]});break;case"counter":if(h.length>0){var f={type:s.COUNTER,name:h[0]};h.length>1&&(f.format=h[1]),r.push(f)}break;case"counters":if(h.length>0){var g={type:s.COUNTERS,name:h[0]};h.length>1&&(g.glue=h[1]),h.length>2&&(g.format=h[2]),r.push(g)}break;case"url":h.length>0&&r.push({type:s.URL,value:h[0]})}a=!1,u=""}break;case",":i?u+=d:a&&(h.push(u),u="");break;case" ":case"\t":i?u+=d:u&&(c(r,u),u="");break;default:u+=d}"\\"!==d&&(o=!1)}return u&&c(r,u),e&&(e[t]=r),r}),c=function(t,e){switch(e){case"open-quote":t.push({type:s.OPENQUOTE});break;case"close-quote":t.push({type:s.CLOSEQUOTE})}},l=function(t,e,r){var n=t.quotes?t.quotes.split(/\s+/):["'\"'","'\"'"],i=2*r;return i>=n.length&&(i=n.length-2),e||++i,n[i].replace(/^["']|["']$/g,"")},h=function(t,e,r){for(var n=t.length,a="",s=0;s0&&(a+=e||""),a+=(0,i.createCounterText)(t[s],(0,o.parseListStyleType)(r||"decimal"),!1);return a}}])},t.exports=n()},function(t,e,r){var n=r(231),i=r(515),o=r(516),a=r(517),s=r(518),u=r(519);function c(t){var e=this.__data__=new n(t);this.size=e.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},function(t,e,r){var n=r(510),i=r(511),o=r(512),a=r(513),s=r(514);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t1&&void 0!==arguments[1]?arguments[1]:{};i.editableInit=r.options.editableInit,i.featureDraggable=r.options.featureDraggable;var o={},a=e.reduce((function(e,r){return e[r]=t[r],e}),new n.default(r));function s(t){return function(e){a[t](o,e)}}return{start:function(){o=a.onSetup(i),this.on("drag",(function(){return!0}),s("onDrag")),this.on("click",(function(){return!0}),s("onClick")),this.on("mousemove",(function(){return!0}),s("onMouseMove")),this.on("mousedown",(function(){return!0}),s("onMouseDown")),this.on("mouseup",(function(){return!0}),s("onMouseUp")),this.on("mouseout",(function(){return!0}),s("onMouseOut")),this.on("keyup",(function(){return!0}),s("onKeyUp")),this.on("keydown",(function(){return!0}),s("onKeyDown")),this.on("touchstart",(function(){return!0}),s("onTouchStart")),this.on("touchmove",(function(){return!0}),s("onTouchMove")),this.on("touchend",(function(){return!0}),s("onTouchEnd")),this.on("tap",(function(){return!0}),s("onTap"))},stop:function(){a.onStop(o)},trash:function(){a.onTrash(o)},combineFeatures:function(){a.onCombineFeatures(o)},uncombineFeatures:function(){a.onUncombineFeatures(o)},render:function(t,e){a.toDisplayFeatures(o,t,e)}}}}},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return f}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(12),u=r.n(s),c=r(13),l=r.n(c),h=r(10),p=r.n(h);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p()(t);if(e){var i=p()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}var f=function(t){u()(r,t);var e=d(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"onSetup",value:function(){}},{key:"onDrag",value:function(){}},{key:"onClick",value:function(){}},{key:"onMouseMove",value:function(){}},{key:"onMouseDown",value:function(){}},{key:"onMouseUp",value:function(){}},{key:"onMouseOut",value:function(){}},{key:"onKeyUp",value:function(){}},{key:"onKeyDown",value:function(){}},{key:"onTouchStart",value:function(){}},{key:"onTouchMove",value:function(){}},{key:"onTouchEnd",value:function(){}},{key:"onTap",value:function(){}},{key:"onStop",value:function(){}},{key:"onTrash",value:function(){}},{key:"onCombineFeature",value:function(){}},{key:"onUncombineFeature",value:function(){}},{key:"toDisplayFeatures",value:function(){throw new Error("You must overwrite toDisplayFeatures")}}]),r}(r(249).default)},function(t,e,r){"use strict";r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return o}));var n=r(9);r.d(e,"b",(function(){return n.b}));var i=n.a.xhr,o=n.a.bindAll},function(t,e,r){"use strict";r.d(e,"a",(function(){return h}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(2),u=r(28),c=r(245),l=r(246);r(706);var h=function(){function t(e,r,n){i()(this,t),this.tgNode=void 0,this.actorIcon=void 0,this.actorOffset=void 0,this.actorDirection=void 0,this.actorVisible=void 0,this.Overlay=void 0,this.overlayId=void 0,this.mapContainerId=void 0,this.modules=void 0,this.mapContainerId=n,this.modules=u.f.getProps(this.mapContainerId,"modules");var o=r.actorIcon,a=r.actorOffset,h=r.actorDirection,p=r.actorVisible;this.tgNode=e,this.actorOffset=Object(s.isDef)(a)?a:[0,0],this.actorDirection=Object(s.isDef)(h)?h:0,this.actorVisible=!Object(s.isDef)(p)||p,this.actorIcon=function(t,e){return Object(s.isDef)(t.iconName)?new c.a(t,e):new l.a(t,e)}(o,this.mapContainerId),this.actorIcon.addTo(this),this.Overlay=this.modules.customOverlay(),Object(s.isTrue)(this.actorVisible)&&this._ensureOverlay()}return a()(t,[{key:"setTGNode",value:function(t){return this.tgNode=t,this.Overlay.setCustomOverlayById({id:this.overlayId,point:this.tgNode.toArray(),customProps:Object(s.jsonStringify)(this.tgNode.getProperties())}),this.actorIcon.renderIconText(),this}},{key:"setActorDirection",value:function(t){this.actorDirection=t,this.actorIcon.renderDirection()}},{key:"show",value:function(){this.actorVisible=!0,this._ensureOverlay(),this.Overlay.showCustomOverlayById({type:"id",id:this.overlayId})}},{key:"hide",value:function(){this.actorVisible=!1,Object(s.isDef)(this.overlayId)&&this.Overlay.hideCustomOverlayById({type:"id",id:this.overlayId})}},{key:"addEvent",value:function(t,e){this._ensureOverlay(),this.Overlay.addEvent({selector:"#".concat(this.overlayId),event:t,handler:e})}},{key:"removeEvent",value:function(t){this._ensureOverlay(),this.Overlay.removeEvent({selector:"#".concat(this.overlayId),event:t})}},{key:"setIconTemplate",value:function(t){this.actorIcon.setIconTemplate(t)}},{key:"setIconWidth",value:function(t){this.actorIcon.setIconWidth(t)}},{key:"setIconHeight",value:function(t){this.actorIcon.setIconHeight(t)}},{key:"setIconName",value:function(t){this.actorIcon.setIconName(t)}},{key:"setIconText",value:function(t){this.actorIcon.setIconText(t)}},{key:"setIconScale",value:function(t){this.actorIcon.setIconScale(t)}},{key:"setIconBackground",value:function(t){this.actorIcon.setIconBackground(t)}},{key:"getDirection",value:function(){return this.actorDirection}},{key:"getProperty",value:function(t){return this.tgNode.getProperty(t)}},{key:"getProperties",value:function(){return this.tgNode.getProperties()}},{key:"destroy",value:function(){this.tgNode=null,this.actorIcon=null,Object(s.isDef)(this.overlayId)&&this.Overlay.removeCustomOverlayById({id:this.overlayId}),this.Overlay=null}},{key:"_ensureOverlay",value:function(){Object(s.isUndef)(this.overlayId)&&(this.overlayId=this.Overlay.addCustomOverlay({element:this.actorIcon.getContainer(),style:this.actorIcon.getOverlayStyle(),offset:this.actorOffset,anchor:"center",point:this.tgNode.toArray(),customProps:Object(s.jsonStringify)(this.tgNode.getProperties())}))}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return m}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(12),u=r.n(s),c=r(13),l=r.n(c),h=r(10),p=r.n(h),d=r(28),f=r(2);function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p()(t);if(e){var i=p()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}var m=function(t){u()(r,t);var e=g(r);function r(t,n){var o;return i()(this,r),(o=e.call(this)).iconName=void 0,o.iconText=void 0,o.iconScale=void 0,o.iconBackground=void 0,o.iconNorthDirection=void 0,o.spriteGroup=void 0,o.textDom=void 0,o.mapContainerId=void 0,o.mapContainerId=n,o._setupOps(t),o._setupContainer(),o}return a()(r,[{key:"renderDirection",value:function(){Object(f.isDef)(this.spriteGroup)&&Object(f.isDef)(this.target)&&this.spriteGroup.setRotation(360-Object(d.a)(this.mapContainerId)+this.target.getDirection())}},{key:"_parseActorIconText",value:function(t,e){if(!e)return"";return/\{\w+\}/.test(e)?e.replace(/\{\w+\}/g,(function(e){var r=e.replace(/[{}]/g,""),n=t[r];return n||e})):t[e]}},{key:"renderIconText",value:function(){if(Object(f.isDef)(this.textDom)&&Object(f.isDef)(this.target)){var t=this._parseActorIconText(this.target.getProperties(),this.iconText);Object(f.domText)(this.textDom,t)}}},{key:"setIconName",value:function(t){Object(f.isDef)(this.spriteGroup)&&(this.spriteGroup.setIcon(t),this.iconName=t)}},{key:"setIconText",value:function(t){this.iconText=t,this.renderIconText()}},{key:"setIconScale",value:function(t){}},{key:"setIconBackground",value:function(t){return Object(f.isDef)(this.spriteGroup)&&(this.spriteGroup.setIcon(t),this.iconBackground=t),!0}},{key:"_setupContainer",value:function(){var t=d.f.getProps(this.mapContainerId,"spriteManager");this.spriteGroup=t.getSpriteGroupWidthBackground(this.iconName,this.iconScale,this.iconBackground),Object(f.domInsert)(this.spriteGroup.element,this.container),Object(f.isDef)(this.iconText)&&(this.textDom=Object(f.createDivElement)(),Object(f.domClass)(this.textDom,"TRACKER_ACTOR_ICON_TEXT"),Object(f.domInsert)(this.textDom,this.container))}},{key:"_setupOps",value:function(t){var e=t.iconName,r=t.iconText,n=t.iconScale,i=t.iconBackground,o=t.iconNorthDirection;this.iconName=e,this.iconText=r,this.iconScale=Object(f.isDef)(n)?n:1,this.iconBackground=i,this.iconNorthDirection=Object(f.isDef)(o)?o:0}}]),r}(r(269).a)},function(t,e,r){"use strict";r.d(e,"a",(function(){return m}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(12),u=r.n(s),c=r(13),l=r.n(c),h=r(10),p=r.n(h),d=r(2),f=r(28);function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p()(t);if(e){var i=p()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l()(this,r)}}var m=function(t){u()(r,t);var e=g(r);function r(t,n){var o;return i()(this,r),(o=e.call(this)).iconTemplate=void 0,o.iconWidth=void 0,o.iconHeight=void 0,o.iconNorthDirection=void 0,o.mapContainerId=void 0,o.mapContainerId=n,o._setupOps(t),o._setupContainer(),o}return a()(r,[{key:"renderDirection",value:function(){Object(d.domStyle)(this.container,{transform:"rotate(".concat(this.iconNorthDirection+(360-Object(f.a)(this.mapContainerId))+this.target.getDirection(),"deg)")})}},{key:"setIconTemplate",value:function(t){this.iconTemplate=t,Object(d.domContent)(this.container,this.iconTemplate)}},{key:"setIconWidth",value:function(t){this.iconWidth=t,Object(d.domStyle)(this.container,{width:"".concat(this.iconWidth,"px")})}},{key:"setIconHeight",value:function(t){this.iconHeight=t,Object(d.domStyle)(this.container,{height:"".concat(this.iconHeight,"px")})}},{key:"getOverlayStyle",value:function(){return"width:".concat(this.iconWidth,"px;height:").concat(this.iconHeight,"px")}},{key:"_setupContainer",value:function(){Object(d.domStyle)(this.container,{transform:"rotate(".concat(this.iconNorthDirection,"deg)"),width:"".concat(this.iconWidth,"px"),height:"".concat(this.iconHeight,"px"),overflow:"hidden"}),Object(d.domContent)(this.container,this.iconTemplate)}},{key:"_setupOps",value:function(t){var e=t.iconTemplate,r=t.iconWidth,n=t.iconHeight,i=t.iconNorthDirection;this.iconTemplate=e,this.iconWidth=Object(d.isDef)(r)?r:20,this.iconHeight=Object(d.isDef)(n)?n:20,this.iconNorthDirection=Object(d.isDef)(i)?i:0}}]),r}(r(269).a)},function(t,e,r){"use strict";r.r(e),r.d(e,"create",(function(){return i})),r.d(e,"clone",(function(){return o})),r.d(e,"length",(function(){return a})),r.d(e,"fromValues",(function(){return s})),r.d(e,"copy",(function(){return u})),r.d(e,"set",(function(){return c})),r.d(e,"add",(function(){return l})),r.d(e,"subtract",(function(){return h})),r.d(e,"multiply",(function(){return p})),r.d(e,"divide",(function(){return d})),r.d(e,"ceil",(function(){return f})),r.d(e,"floor",(function(){return g})),r.d(e,"min",(function(){return m})),r.d(e,"max",(function(){return y})),r.d(e,"round",(function(){return v})),r.d(e,"scale",(function(){return A})),r.d(e,"scaleAndAdd",(function(){return _})),r.d(e,"distance",(function(){return b})),r.d(e,"squaredDistance",(function(){return x})),r.d(e,"squaredLength",(function(){return w})),r.d(e,"negate",(function(){return C})),r.d(e,"inverse",(function(){return E})),r.d(e,"normalize",(function(){return I})),r.d(e,"dot",(function(){return M})),r.d(e,"cross",(function(){return S})),r.d(e,"lerp",(function(){return T})),r.d(e,"hermite",(function(){return P})),r.d(e,"bezier",(function(){return O})),r.d(e,"random",(function(){return L})),r.d(e,"transformMat4",(function(){return k})),r.d(e,"transformMat3",(function(){return R})),r.d(e,"transformQuat",(function(){return D})),r.d(e,"rotateX",(function(){return B})),r.d(e,"rotateY",(function(){return N})),r.d(e,"rotateZ",(function(){return F})),r.d(e,"angle",(function(){return j})),r.d(e,"zero",(function(){return z})),r.d(e,"str",(function(){return U})),r.d(e,"exactEquals",(function(){return G})),r.d(e,"equals",(function(){return H})),r.d(e,"sub",(function(){return Q})),r.d(e,"mul",(function(){return q})),r.d(e,"div",(function(){return W})),r.d(e,"dist",(function(){return Y})),r.d(e,"sqrDist",(function(){return X})),r.d(e,"len",(function(){return Z})),r.d(e,"sqrLen",(function(){return K})),r.d(e,"forEach",(function(){return J}));var n=r(34);function i(){var t=new n.a(3);return n.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=new n.a(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function a(t){var e=t[0],r=t[1],n=t[2];return Math.hypot(e,r,n)}function s(t,e,r){var i=new n.a(3);return i[0]=t,i[1]=e,i[2]=r,i}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function c(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function l(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function h(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function p(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function d(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function f(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function g(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function m(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function y(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function v(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function A(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function _(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function b(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.hypot(r,n,i)}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}function w(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function C(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function E(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function I(t,e){var r=e[0],n=e[1],i=e[2],o=r*r+n*n+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function M(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function S(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function T(t,e,r,n){var i=e[0],o=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t}function P(t,e,r,n,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,c=a*(o-1),l=a*(3-2*o);return t[0]=e[0]*s+r[0]*u+n[0]*c+i[0]*l,t[1]=e[1]*s+r[1]*u+n[1]*c+i[1]*l,t[2]=e[2]*s+r[2]*u+n[2]*c+i[2]*l,t}function O(t,e,r,n,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,l=3*o*s,h=3*u*a,p=u*o;return t[0]=e[0]*c+r[0]*l+n[0]*h+i[0]*p,t[1]=e[1]*c+r[1]*l+n[1]*h+i[1]*p,t[2]=e[2]*c+r[2]*l+n[2]*h+i[2]*p,t}function L(t,e){e=e||1;var r=2*n.c()*Math.PI,i=2*n.c()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=i*e,t}function k(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function R(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function D(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,h=o*s-n*c,p=n*u-i*s,d=i*p-o*h,f=o*l-n*p,g=n*h-i*l,m=2*a;return l*=m,h*=m,p*=m,d*=2,f*=2,g*=2,t[0]=s+l+d,t[1]=u+h+f,t[2]=c+p+g,t}function B(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function N(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function F(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function j(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+a*a+s*s),c=u&&M(t,e)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function z(t){return t[0]=0,t[1]=0,t[2]=0,t}function U(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function G(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function H(t,e){var r=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(r-a)<=n.b*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=n.b*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-u)<=n.b*Math.max(1,Math.abs(o),Math.abs(u))}var V,Q=h,q=p,W=d,Y=b,X=x,Z=a,K=w,J=(V=i(),function(t,e,r,n,i,o){var a,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a0&&t.screenY>0){var e=this.mapsService.getContainer();null!==e&&e.focus()}}}]),r}(v.EventEmitter),C=r(18),E=r.n(C);function I(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}!function(t){h()(r,t);var e=I(r);function r(t){var n;return s()(this,r),(n=e.call(this,t)).layerControlInputs=void 0,n.layers=void 0,n.lastZIndex=void 0,n.handlingClick=void 0,n.layersLink=void 0,n.baseLayersList=void 0,n.separator=void 0,n.overlaysList=void 0,n.form=void 0,n.layerControlInputs=[],n.layers=[],n.lastZIndex=0,n.handlingClick=!1,n.initLayers(),Object(y.i)(["checkDisabledLayers","onLayerChange","collapse","extend","expand","onInputClick"],E()(n)),n}c()(r,[{key:"getDefault",value:function(){return{collapsed:!0,position:m.PositionType.TOPRIGHT,autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,name:"layers"}}},{key:"onAdd",value:function(){var t=this;return this.initLayout(),this.update(),this.mapsService.on("zoomend",this.checkDisabledLayers),this.layers.forEach((function(e){e.layer.on("remove",t.onLayerChange),e.layer.on("add",t.onLayerChange)})),this.container}},{key:"addVisualLayer",value:function(t,e){return this.addLayer(t,e,!0),this.mapsService?this.update():this}},{key:"expand",value:function(){var t=this.renderService.getViewportSize().height;y.a.addClass(this.container,"l7-control-layers-expanded"),this.form.style.height="null";var e=t-(this.container.offsetTop+50);return e1,this.baseLayersList.style.display=t?"":"none"),this.separator.style.display=e&&t?"":"none",this}},{key:"checkDisabledLayers",value:function(){for(var t,e,r=this.layerControlInputs,n=this.mapsService.getZoom(),i=r.length-1;i>=0;i--)if(t=r[i],(e=this.layerService.getLayer(t.layerId))&&e.inited){var o=e.getMinZoom(),a=e.getMaxZoom();t.disabled=na}}},{key:"addLayer",value:function(t,e,r){this.mapsService&&(t.on("add",this.onLayerChange),t.on("remove",this.onLayerChange)),this.layers.push({layer:t,name:e,overlay:r});var n=this.controlOption,i=n.sortLayers,o=n.sortFunction,a=n.autoZIndex;i&&this.layers.sort((function(t,e){return o(t.layer,e.layer,t.name,e.name)})),a&&t.setZIndex&&(this.lastZIndex++,t.setZIndex(this.lastZIndex)),this.expandIfNotCollapsed()}},{key:"expandIfNotCollapsed",value:function(){return this.mapsService&&!this.controlOption.collapsed&&this.expand(),this}},{key:"onLayerChange",value:function(t){this.handlingClick||this.update();var e=this.layerService.getLayer(t.target.layerId),r=null!=e&&e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;r&&this.emit(r,e)}},{key:"createRadioElement",value:function(t,e){var r='",n=document.createElement("div");return n.innerHTML=r,n.firstChild}},{key:"addItem",value:function(t){var e,r=document.createElement("label"),n=this.layerService.getLayer(t.layer.id),i=n&&n.inited&&t.layer.isVisible();t.overlay?((e=document.createElement("input")).type="checkbox",e.className="l7-control-layers-selector",e.defaultChecked=i):e=this.createRadioElement("l7-base-layers",i),this.layerControlInputs.push(e),e.layerId=t.layer.id,e.addEventListener("click",this.onInputClick);var o=document.createElement("span");o.innerHTML=" "+t.name;var a=document.createElement("div");return r.appendChild(a),a.appendChild(e),a.appendChild(o),(t.overlay?this.overlaysList:this.baseLayersList).appendChild(r),this.checkDisabledLayers(),r}},{key:"onInputClick",value:function(){var t,e,r=this.layerControlInputs,n=[],i=[];this.handlingClick=!0;for(var o=r.length-1;o>=0;o--)t=r[o],e=this.layerService.getLayer(t.layerId),t.checked?n.push(e):t.checked||i.push(e);i.forEach((function(t){t.hide()})),n.forEach((function(t){t.show()})),this.handlingClick=!1}}])}(w);function M(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}var S=function(t){h()(r,t);var e=M(r);function r(){return s()(this,r),e.apply(this,arguments)}return c()(r,[{key:"getDefault",value:function(){return{position:n.BOTTOMLEFT,name:"logo"}}},{key:"onAdd",value:function(){var t=y.a.create("div","l7-control-logo"),e=y.a.create("a","l7-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://antv.alipay.com/l7",e.setAttribute("aria-label","AntV logo"),e.setAttribute("rel","noopener nofollow"),t.appendChild(e),t}},{key:"onRemove",value:function(){return null}}]),r}(w);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}!function(t){h()(r,t);var e=T(r);function r(t){var n;return s()(this,r),(n=e.call(this,t)).mScale=void 0,n.iScale=void 0,Object(y.i)(["update"],E()(n)),n}c()(r,[{key:"getDefault",value:function(){return{position:n.BOTTOMLEFT,maxWidth:100,metric:!0,updateWhenIdle:!1,imperial:!1,name:"scale"}}},{key:"onAdd",value:function(){var t=y.a.create("div","l7-control-scale");this.addScales("l7-control-scale-line",t);var e=this.controlOption.updateWhenIdle;return this.mapsService.on(e?"moveend":"mapmove",this.update),this.mapsService.on(e?"zoomend":"zoomchange",this.update),this.update(),t}},{key:"onRemove",value:function(){var t=this.controlOption.updateWhenIdle;this.mapsService.off(t?"zoomend":"zoomchange",this.update),this.mapsService.off(t?"moveend":"mapmove",this.update)}},{key:"update",value:function(){var t=this.mapsService,e=this.controlOption.maxWidth,r=t.getSize()[1]/2,n=t.containerToLngLat([0,r]),i=t.containerToLngLat([e,r]),o=Object(y.p)([n.lng,n.lat],[i.lng,i.lat]);this.updateScales(o)}},{key:"updateScales",value:function(t){var e=this.controlOption,r=e.metric,n=e.imperial;r&&t&&this.updateMetric(t),n&&t&&this.updateImperial(t)}},{key:"updateMetric",value:function(t){var e=this.getRoundNum(t),r=e<1e3?e+" m":e/1e3+" km";this.updateScale(this.mScale,r,e/t)}},{key:"updateImperial",value:function(t){var e,r,n,i=3.2808399*t;i>5280?(e=i/5280,r=this.getRoundNum(e),this.updateScale(this.iScale,r+" mi",r/e)):(n=this.getRoundNum(i),this.updateScale(this.iScale,n+" ft",n/i))}},{key:"updateScale",value:function(t,e,r){var n=this.controlOption.maxWidth;t.style.width=Math.round(n*r)+"px",t.innerHTML=e}},{key:"getRoundNum",value:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),r=t/e;return e*(r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:1)}},{key:"addScales",value:function(t,e){var r=this.controlOption,n=r.metric,i=r.imperial;n&&(this.mScale=y.a.create("div",t,e)),i&&(this.iScale=y.a.create("div",t,e))}}])}(w);function P(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=g()(t);if(e){var i=g()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return d()(this,r)}}!function(t){h()(r,t);var e=P(r);function r(t){var n;return s()(this,r),(n=e.call(this,t)).disabled=void 0,n.zoomInButton=void 0,n.zoomOutButton=void 0,Object(y.i)(["updateDisabled","zoomIn","zoomOut"],E()(n)),n}c()(r,[{key:"getDefault",value:function(){return{position:n.TOPLEFT,zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out",name:"zoom"}}},{key:"onAdd",value:function(){var t=y.a.create("div","l7-control-zoom l7-bar");return this.zoomInButton=this.createButton(this.controlOption.zoomInText,this.controlOption.zoomInTitle,"l7-control-zoom-in",t,this.zoomIn),this.zoomOutButton=this.createButton(this.controlOption.zoomOutText,this.controlOption.zoomOutTitle,"l7-control-zoom-out",t,this.zoomOut),this.mapsService.on("zoomend",this.updateDisabled),this.mapsService.on("zoomchange",this.updateDisabled),this.updateDisabled(),t}},{key:"onRemove",value:function(){this.mapsService.off("zoomend",this.updateDisabled),this.mapsService.off("zoomchange",this.updateDisabled)}},{key:"disable",value:function(){return this.disabled=!0,this.updateDisabled(),this}},{key:"enable",value:function(){return this.disabled=!1,this.updateDisabled(),this}},{key:"zoomIn",value:function(){!this.disabled&&this.mapsService.getZoom()this.mapsService.getMinZoom()&&this.mapsService.zoomOut()}},{key:"createButton",value:function(t,e,r,n,i){var o=y.a.create("a",r,n);return o.innerHTML=t,o.title=e,o.href="javascript:void(0)",o.addEventListener("click",i),o}},{key:"updateDisabled",value:function(){var t=this.mapsService;y.a.removeClass(this.zoomInButton,"l7-disabled"),y.a.removeClass(this.zoomOutButton,"l7-disabled"),(this.disabled||t.getZoom()<=t.getMinZoom())&&y.a.addClass(this.zoomOutButton,"l7-disabled"),(this.disabled||t.getZoom()>=t.getMaxZoom())&&y.a.addClass(this.zoomInButton,"l7-disabled")}}])}(w);function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function L(t){for(var e=1;e180||Math.abs(a[1][0])>180){if(s.x>c){var h=this.mapsService.lngLatToContainer([i-360,o]);s.x=h.x}if(s.x<0){var p=this.mapsService.lngLatToContainer([i+360,o]);s.x=p.x}}(s.x>c||s.x<0||s.y>l||s.y<0)&&(e.style.display="none"),e.style.left=s.x+r[0]+"px",e.style.top=s.y-r[1]+"px"}}}},{key:"init",value:function(){var t=this,e=this.markerOption.element,r=this.markerOption,n=r.color,i=r.anchor;if(!e){this.defaultMarker=!0,e=y.a.create("div"),this.markerOption.element=e;var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","48px"),o.setAttributeNS(null,"width","48px"),o.setAttributeNS(null,"viewBox","0 0 1024 1024");var a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttributeNS(null,"d","M512 490.666667C453.12 490.666667 405.333333 442.88 405.333333 384 405.333333 325.12 453.12 277.333333 512 277.333333 570.88 277.333333 618.666667 325.12 618.666667 384 618.666667 442.88 570.88 490.666667 512 490.666667M512 85.333333C346.88 85.333333 213.333333 218.88 213.333333 384 213.333333 608 512 938.666667 512 938.666667 512 938.666667 810.666667 608 810.666667 384 810.666667 218.88 677.12 85.333333 512 85.333333Z"),a.setAttributeNS(null,"fill",n),o.appendChild(a),e.appendChild(o)}y.a.addClass(e,"l7-marker"),Object.keys(this.markerOption.style||{}).forEach((function(r){var n,i,o=(null===(n=t.markerOption)||void 0===n?void 0:n.style)&&(null===(i=t.markerOption)||void 0===i?void 0:i.style[r]);e&&(e.style[r]=o)})),e.addEventListener("click",(function(e){t.onMapClick(e)})),e.addEventListener("click",this.eventHandle),Object(y.g)(e,i,"marker")}},{key:"registerMarkerEvent",value:function(t){t.addEventListener("mousemove",this.eventHandle),t.addEventListener("click",this.eventHandle),t.addEventListener("mousedown",this.eventHandle),t.addEventListener("mouseup",this.eventHandle),t.addEventListener("dblclick",this.eventHandle),t.addEventListener("contextmenu",this.eventHandle),t.addEventListener("mouseover",this.eventHandle),t.addEventListener("mouseout",this.eventHandle)}},{key:"unRegisterMarkerEvent",value:function(){var t=this.getElement();t.removeEventListener("mousemove",this.eventHandle),t.removeEventListener("click",this.eventHandle),t.removeEventListener("mousedown",this.eventHandle),t.removeEventListener("mouseup",this.eventHandle),t.removeEventListener("dblclick",this.eventHandle),t.removeEventListener("contextmenu",this.eventHandle),t.removeEventListener("mouseover",this.eventHandle),t.removeEventListener("mouseout",this.eventHandle)}},{key:"addDragHandler",value:function(t){throw new Error("Method not implemented.")}},{key:"onUp",value:function(t){throw new Error("Method not implemented.")}}]),r}(v.EventEmitter),D=r(270),B=r.n(D),N=r(273),F=r.n(N);function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function z(t){for(var e=1;e-1&&this.markers.splice(e,1)}},{key:"getMarkers",value:function(){return this.markerLayerOption.cluster?this.clusterMarkers:this.markers}},{key:"addMarkers",value:function(){var t=this;this.getMarkers().forEach((function(e){e.addTo(t.scene)}))}},{key:"clear",value:function(){this.markers.forEach((function(t){t.remove()})),this.clusterMarkers.forEach((function(t){t.remove()})),this.mapsService.off("camerachange",this.update),this.markers=[],this.clusterMarkers=[]}},{key:"destroy",value:function(){this.clear(),this.removeAllListeners()}},{key:"addPoint",value:function(t,e){var r=t.getLnglat(),n={geometry:{type:"Point",coordinates:[r.lng,r.lat]},properties:z(z({},t.getExtData()),{},{marker_id:e})};this.points.push(n)}},{key:"initCluster",value:function(){if(this.markerLayerOption.cluster){var t=this.markerLayerOption.clusterOption,e=t.radius,r=t.minZoom,n=void 0===r?0:r,i=t.maxZoom;this.clusterIndex=new F.a({radius:e,minZoom:n,maxZoom:i}),this.clusterIndex.load(this.points)}}},{key:"getClusterMarker",value:function(t,e){var r=this,n=t[0].concat(t[1]),i=this.clusterIndex.getClusters(n,e);this.clusterMarkers.forEach((function(t){t.remove()})),this.clusterMarkers=[],i.forEach((function(t){var e,n=r.markerLayerOption.clusterOption,i=n.field,a=n.method;if(t.properties&&null!==(e=t.properties)&&void 0!==e&&e.cluster_id){var s,u=r.getLeaves(null===(s=t.properties)||void 0===s?void 0:s.cluster_id);if(t.properties.clusterData=u,i&&a){var c=null==u?void 0:u.map((function(t){return o()({},i,t.properties[i])})),l=y.c.getColumn(c,i),h=y.c.getSatByColumn(a,l),p="point_"+a;t.properties[p]=h.toFixed(2)}}var d=r.clusterMarker(t);r.clusterMarkers.push(d),d.addTo(r.scene)}))}},{key:"getLeaves",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return t?this.clusterIndex.getLeaves(t,e,r):null}},{key:"clusterMarker",value:function(t){var e=this.markerLayerOption.clusterOption.element,r=void 0===e?this.generateElement.bind(this):e;return new R({element:r(t)}).setLnglat({lng:t.geometry.coordinates[0],lat:t.geometry.coordinates[1]})}},{key:"normalMarker",value:function(t){var e=t.properties.marker_id;return this.markers[e]}},{key:"update",value:function(){var t=this.mapsService.getZoom(),e=this.mapsService.getBounds();(!this.bbox||Math.abs(t-this.zoom)>=1||!Object(y.j)(this.bbox,e))&&(this.bbox=Object(y.q)(e,.5),this.zoom=Math.floor(t),this.getClusterMarker(this.bbox,this.zoom))}},{key:"generateElement",value:function(t){var e=y.a.create("div","l7-marker-cluster"),r=y.a.create("div","",e),n=y.a.create("span","",r),i=this.markerLayerOption.clusterOption,o=i.field,a=i.method;t.properties.point_count=t.properties.point_count||1;var s=o&&a?t.properties["point_"+a]||t.properties[o]:t.properties.point_count;return n.textContent=s,e}}])}(v.EventEmitter);function G(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function H(t){for(var e=1;e2}))}},{key:"incomingCoords",value:function(t){this.coordinates=t.map((function(t){return t.slice(0,-1)})),this.changed()}},{key:"setCoordinates",value:function(t){this.coordinates=t,this.changed()}},{key:"addCoordinate",value:function(t,e,r){this.changed();var n=t.split(".").map((function(t){return parseInt(t,10)}));this.coordinates[n[0]].splice(n[1],0,[e,r])}},{key:"removeCoordinate",value:function(t){this.changed();var e=t.split(".").map((function(t){return parseInt(t,10)})),r=this.coordinates[e[0]];r&&(r.splice(e[1],1),r.length<3&&this.coordinates.splice(e[0],1))}},{key:"getCoordinate",value:function(t){var e=t.split(".").map((function(t){return parseInt(t,10)})),r=this.coordinates[e[0]];return JSON.parse(JSON.stringify(r[e[1]]))}},{key:"getCoordinates",value:function(){return this.coordinates.map((function(t){return t.concat([t[0]])}))}},{key:"updateCoordinate",value:function(t,e,r){this.changed();var n=t.split("."),i=parseInt(n[0],10),o=parseInt(n[1],10);if(0===o)this.center=[e,r],this.coordinates[i][o]=this.center;else if(1===o)this.start=[e,r],this.coordinates[i][o]=this.start;else if(2===o){var a=this.center,s=this.start,u=[e,r];this.pos=u;var c=A.a.bearing(a,s),l=A.a.bearing(a,u),h=A.a.distance(a,s),p=A.a.sector(a,h,c,l).geometry.coordinates[0].slice(0,-1);this.coordinates=[p]}void 0===this.coordinates[i]&&(this.coordinates[i]=[])}}]),r}(r(127).a),x=function(){function t(e){i()(this,t),this.map=e.map,this.drawConfig=JSON.parse(JSON.stringify(e.options||{})),this._ctx=e}return a()(t,[{key:"setSelected",value:function(t){return this._ctx.store.setSelected(t)}},{key:"setSelectedCoordinates",value:function(t){var e=this;this._ctx.store.setSelectedCoordinates(t),t.reduce((function(t,r){return void 0===t[r.feature_id]&&(t[r.feature_id]=!0,e._ctx.store.get(r.feature_id).changed()),t}),{})}},{key:"getSelected",value:function(){return this._ctx.store.getSelected()}},{key:"getSelectedIds",value:function(){return this._ctx.store.getSelectedIds()}},{key:"isSelected",value:function(t){return this._ctx.store.isSelected(t)}},{key:"getFeature",value:function(t){return this._ctx.store.get(t)}},{key:"select",value:function(t){return this._ctx.store.select(t)}},{key:"deselect",value:function(t){return this._ctx.store.deselect(t)}},{key:"deleteFeature",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._ctx.store.delete(t,e)}},{key:"addFeature",value:function(t){return this._ctx.store.add(t)}},{key:"clearSelectedFeatures",value:function(){return this._ctx.store.clearSelected()}},{key:"clearSelectedCoordinates",value:function(){return this._ctx.store.clearSelectedCoordinates()}},{key:"setActionableState",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={trash:t.trash||!1,combineFeatures:t.combineFeatures||!1,uncombineFeatures:t.uncombineFeatures||!1};return this._ctx.events.actionable(e)}},{key:"changeMode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._ctx.events.changeMode(t,e,r)}},{key:"updateUIClasses",value:function(t){return this._ctx.ui.queueMapClasses(t)}},{key:"activateUIButton",value:function(t){return this._ctx.ui.setActiveButton(t)}},{key:"featuresAt",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"click";if("click"!==r&&"touch"!==r)throw new Error("invalid buffer type");return u.a[r](t,e,this._ctx)}},{key:"newFeature",value:function(t){var e=t.geometry.type;return e===s.g.geojsonTypes.POINT?new c.a(this._ctx,t):e===s.g.geojsonTypes.LINE_STRING?new l.a(this._ctx,t):e===s.g.geojsonTypes.POLYGON?new h.a(this._ctx,t):new p.a(this._ctx,t)}},{key:"newRectangle",value:function(){}},{key:"newTriangle",value:function(){}},{key:"newSector",value:function(t){return new b(this._ctx,t)}},{key:"newEllipse",value:function(){}},{key:"newArc",value:function(){}},{key:"isInstanceOf",value:function(t,e){if(t===s.g.geojsonTypes.POINT)return e instanceof c.a;if(t===s.g.geojsonTypes.LINE_STRING)return e instanceof l.a;if(t===s.g.geojsonTypes.POLYGON)return e instanceof h.a;if("MultiFeature"===t)return e instanceof p.a;throw new Error("Unknown feature class: ".concat(t))}},{key:"doRender",value:function(t){return this._ctx.store.featureChanged(t)}}]),t}()},function(t,e,r){var n=r(293),i=r(292),o=r(294),a=Math.ceil,s=Math.max;t.exports=function(t,e,r){e=(r?i(t,e,r):void 0===e)?1:s(o(e),0);var u=null==t?0:t.length;if(!u||e<1)return[];for(var c=0,l=0,h=Array(a(u/e));c0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(u.b);e.a=c},function(t,e,r){"use strict";var n=r(26),i=function(t){function e(e){var r="Assertion failed. See https://openlayers.org/en/"+("latest"===n.a?n.a:"v"+n.a.split("-")[0])+"/doc/errors/#"+e+" for details.";t.call(this,r),this.code=e,this.name="AssertionError",this.message=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error);e.a=i},function(t,e,r){"use strict";e.a={PROPERTYCHANGE:"propertychange"}},function(t,e,r){"use strict";var n=function(){this.disposed_=!1};n.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},n.prototype.disposeInternal=function(){},e.a=n},function(t,e,r){"use strict";var n=r(141),i=r(19);e.a=function(t,e){if(e=e||{},!Object(i.g)(e))throw new Error("options is invalid");var r=e.properties;if(!t)throw new Error("geojson is required");var o=Object(n.a)(t),a=(o[0]+o[2])/2,s=(o[1]+o[3])/2;return Object(i.j)([a,s],r)}},function(t,e,r){"use strict";function n(t){var e={type:"Feature"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"properties":case"geometry":return;default:e[r]=t[r]}})),e.properties=function t(e){var r={};return e?(Object.keys(e).forEach((function(n){var i=e[n];"object"==typeof i?null===i?r[n]=null:i.length?r[n]=i.map((function(t){return t})):r[n]=t(i):r[n]=i})),r):r}(t.properties),e.geometry=i(t.geometry),e}function i(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return i(t)})),e):(e.coordinates=function t(e){if("object"!=typeof e[0])return e.slice();return e.map((function(e){return t(e)}))}(t.coordinates),e)}e.a=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return n(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(r){switch(r){case"type":case"features":return;default:e[r]=t[r]}})),e.features=t.features.map((function(t){return n(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return i(t);default:throw new Error("unknown GeoJSON type")}}},function(t,e,r){(function(e){t.exports=function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var r=0;r + * @license MIT + * @preserve + */var i=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function o(t,e){return t>e?1:t0))break;if(null===e.right)break;if(r(t,e.right.key)>0&&(u=e.right,e.right=u.left,u.left=e,null===(e=u).right))break;o.right=e,o=e,e=e.right}}return o.right=e.left,a.left=e.right,e.left=n.right,e.right=n.left,e}function s(t,e,r,n){var o=new i(t,e);if(null===r)return o.left=o.right=null,o;var s=n(t,(r=a(t,r,n)).key);return s<0?(o.left=r.left,o.right=r,r.left=null):s>=0&&(o.right=r.right,o.left=r,r.right=null),o}function u(t,e,r){var n=null,i=null;if(e){var o=r((e=a(t,e,r)).key,t);0===o?(n=e.left,i=e.right):o<0?(i=e.right,e.right=null,n=e):(n=e.left,e.left=null,i=e)}return{left:n,right:i}}var c=function(){function t(t){void 0===t&&(t=o),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=s(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var r=new i(t,e);null===this._root&&(r.left=r.right=null,this._size++,this._root=r);var n=this._comparator,o=a(t,this._root,n),s=n(t,o.key);return 0===s?this._root=o:(s<0?(r.left=o.left,r.right=o,o.left=null):s>0&&(r.right=o.right,r.left=o,o.right=null),this._size++,this._root=r),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,r){var n;return null===e?null:0===r(t,(e=a(t,e,r)).key)?(null===e.left?n=e.right:(n=a(t,e.left,r)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=a(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,r=this._comparator;e;){var n=r(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=a(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,r=this._comparator;e;){var n=r(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var r=this._root,n=[],i=!1;!i;)null!==r?(n.push(r),r=r.left):0!==n.length?(r=n.pop(),t.call(e,r),r=r.right):i=!0;return this},t.prototype.range=function(t,e,r,n){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,e)>0)break;if(o(a.key,t)>=0&&r.call(n,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var r=e.key;return t.push(r)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var r=e.data;return t.push(r)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,r=!1,n=0,i=[];!r;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),n===t)return e;n++,e=e.right}else r=!0;return null},t.prototype.next=function(t){var e=this._root,r=null;if(t.right){for(r=t.right;r.left;)r=r.left;return r}for(var n=this._comparator;e;){var i=n(t.key,e.key);if(0===i)break;i<0?(r=e,e=e.left):e=e.right}return r},t.prototype.prev=function(t){var e=this._root,r=null;if(null!==t.left){for(r=t.left;r.right;)r=r.right;return r}for(var n=this._comparator;e;){var i=n(t.key,e.key);if(0===i)break;i<0?e=e.left:(r=e,e=e.right)}return r},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){for(var e=t,r=[],n=!1,o=new i(null,null),a=o;!n;)e?(r.push(e),e=e.left):r.length>0?e=(e=a=a.next=r.pop()).right:n=!0;return a.next=null,o.next}(this._root)},t.prototype.load=function(t,e,r){void 0===e&&(e=[]),void 0===r&&(r=!1);var n=t.length,o=this._comparator;if(r&&function t(e,r,n,i,o){if(!(n>=i)){for(var a=e[n+i>>1],s=n-1,u=i+1;;){do{s++}while(o(e[s],a)<0);do{u--}while(o(e[u],a)>0);if(s>=u)break;var c=e[s];e[s]=e[u],e[u]=c,c=r[s],r[s]=r[u],r[u]=c}t(e,r,n,u,o),t(e,r,u+1,i,o)}}(t,e,0,n-1,o),null===this._root)this._root=function t(e,r,n,o){var a=o-n;if(a>0){var s=n+Math.floor(a/2),u=e[s],c=r[s],l=new i(u,c);return l.left=t(e,r,n,s),l.right=t(e,r,s+1,o),l}return null}(t,e,0,n),this._size=n;else{var a=function(t,e,r){for(var n=new i(null,null),o=n,a=t,s=e;null!==a&&null!==s;)r(a.key,s.key)<0?(o.next=a,a=a.next):(o.next=s,s=s.next),o=o.next;return null!==a?o.next=a:null!==s&&(o.next=s),n.next}(this.toList(),function(t,e){for(var r=new i(null,null),n=r,o=0;o0){var o=r+Math.floor(i/2),a=t(e,r,o),s=e.head;return s.left=a,e.head=e.head.next,s.right=t(e,o+1,n),s}return null}({head:a},0,n)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return function t(e,r,n,i,o){if(e){i(r+(n?"└── ":"├── ")+o(e)+"\n");var a=r+(n?" ":"│ ");e.left&&t(e.left,a,!1,i,o),e.right&&t(e.right,a,!0,i,o)}}(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,r){var n=this._comparator,i=u(t,this._root,n),o=i.left,c=i.right;n(t,e)<0?c=s(e,r,c,n):o=s(e,r,o,n),this._root=function(t,e,r){return null===e?t:(null===t||((e=a(t.key,e,r)).left=t),e)}(o,c,n)},t.prototype.split=function(t){return u(t,this._root,this._comparator)},t}(),l=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},h=function(t,e){if(e.ur.xe.x?1:t.ye.y?1:0}}]),n(e,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,r=0,n=e.length;r=0&&u>=0?ac?-1:0:o<0&&u<0?ac?1:0:uo?1:0}}}]),e}(),I=0,M=function(){function e(r,n,i,o){t(this,e),this.id=++I,this.leftSE=r,r.segment=this,r.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=r,this.rings=i,this.windings=o}return n(e,null,[{key:"compare",value:function(t,e){var r=t.leftSE.point.x,n=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(oa&&s>u)return-1;var l=t.comparePoint(e.leftSE.point);if(l<0)return 1;if(l>0)return-1;var h=e.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(r>n){if(as&&a>c)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(as)return 1;if(io){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(i!==o){var m=u-a,y=i-r,v=c-s,A=o-n;if(m>y&&vA)return-1}return i>o?1:ic?1:t.ide.id?1:0}}]),n(e,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:te?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,r=this.rightSE.point,n=this.vector();if(e.x===r.x)return t.x===e.x?0:t.x0&&s.swapEvents(),E.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),r}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,r=this.windings.length;e0){var o=r;r=n,n=o}if(r.prev===n){var a=r;r=n,n=a}for(var s=0,u=n.rings.length;s0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));i=r,o=t,a=-1}return new e(new E(i,!0),new E(o,!1),[n],[a])}}]),e}(),S=function(){function e(r,n,i){if(t(this,e),!Array.isArray(r)||0===r.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=i,this.segments=[],"number"!=typeof r[0][0]||"number"!=typeof r[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=y.round(r[0][0],r[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var a=o,s=1,u=r.length;sthis.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),a=c)}o.x===a.x&&o.y===a.y||this.segments.push(M.fromRing(a,o,this))}return n(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,r=this.segments.length;ethis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=n}return n(e,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,r=this.interiorRings.length;ethis.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=n}return n(e,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,r=this.polys.length;e0&&(t=n)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),e}(),L=function(){function e(r){t(this,e),this.exteriorRing=r,r.poly=this,this.interiorRings=[]}return n(e,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,r=this.interiorRings.length;e1&&void 0!==arguments[1]?arguments[1]:M.compare;t(this,e),this.queue=r,this.tree=new c(n),this.segments=[]}return n(e,[{key:"process",value:function(t){var e=t.segment,r=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),r;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=n,o=n,a=void 0,s=void 0;void 0===a;)null===(i=this.tree.prev(i))?a=null:void 0===i.key.consumedBy&&(a=i.key);for(;void 0===s;)null===(o=this.tree.next(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);if(t.isLeft){var u=null;if(a){var c=a.getIntersection(e);if(null!==c&&(e.isAnEndpoint(c)||(u=c),!a.isAnEndpoint(c)))for(var l=this._splitSafely(a,c),h=0,p=l.length;h0?(this.tree.remove(e),r.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var x=a.getIntersection(s);if(null!==x){if(!a.isAnEndpoint(x))for(var w=this._splitSafely(a,x),C=0,I=w.length;CD)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var x=new R(g),w=g.size,C=g.pop();C;){var I=C.key;if(g.size===w){var M=I.segment;throw new Error("Unable to pop() ".concat(I.isLeft?"left":"right"," SweepEvent ")+"[".concat(I.point.x,", ").concat(I.point.y,"] from segment #").concat(M.id," ")+"[".concat(M.leftSE.point.x,", ").concat(M.leftSE.point.y,"] -> ")+"[".concat(M.rightSE.point.x,", ").concat(M.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(g.size>D)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(x.segments.length>B)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=x.process(I),T=0,L=S.length;T1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;n1?e-1:0),n=1;nthis.highWaterMark},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(o.a.CLEAR)},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t,e){for(var r=this.oldest_;r;)t.call(e,r.value_,r.key_,this),r=r.newer},e.prototype.get=function(t){var e=this.entries_[t];return Object(n.a)(void 0!==e,15),e===this.newest_||(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e),e.value_},e.prototype.remove=function(t){var e=this.entries_[t];return Object(n.a)(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},e.prototype.getValues=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},e.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},e.prototype.set=function(t,e){Object(n.a)(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},e.prototype.setSize=function(t){this.highWaterMark=t},e.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},e}(i.a);e.a=a},function(t,e,r){"use strict";var n=r(26),i=function(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale};i.prototype.clone=function(){return new i({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},i.prototype.getOpacity=function(){return this.opacity_},i.prototype.getRotateWithView=function(){return this.rotateWithView_},i.prototype.getRotation=function(){return this.rotation_},i.prototype.getScale=function(){return this.scale_},i.prototype.getSnapToPixel=function(){return!1},i.prototype.getAnchor=function(){return Object(n.b)()},i.prototype.getImage=function(t){return Object(n.b)()},i.prototype.getHitDetectionImage=function(t){return Object(n.b)()},i.prototype.getImageState=function(){return Object(n.b)()},i.prototype.getImageSize=function(){return Object(n.b)()},i.prototype.getHitDetectionImageSize=function(){return Object(n.b)()},i.prototype.getOrigin=function(){return Object(n.b)()},i.prototype.getSize=function(){return Object(n.b)()},i.prototype.setOpacity=function(t){this.opacity_=t},i.prototype.setRotateWithView=function(t){this.rotateWithView_=t},i.prototype.setRotation=function(t){this.rotation_=t},i.prototype.setScale=function(t){this.scale_=t},i.prototype.setSnapToPixel=function(t){},i.prototype.listenImageChange=function(t,e){return Object(n.b)()},i.prototype.load=function(){Object(n.b)()},i.prototype.unlistenImageChange=function(t,e){Object(n.b)()},e.a=i},function(t,e,r){"use strict";var n=r(26),i=r(75),o=r(25),a=r(146),s=r(43),u=r(83),c=r(162),l=Object(c.b)(),h=function(t){function e(){t.call(this),this.extent_=Object(o.h)(),this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return Object(n.b)()},e.prototype.closestPointXY=function(t,e,r,i){return Object(n.b)()},e.prototype.containsXY=function(t,e){return!1},e.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Object(n.b)()},e.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),Object(o.B)(this.extent_,t)},e.prototype.rotate=function(t,e){Object(n.b)()},e.prototype.scale=function(t,e,r){Object(n.b)()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Object(n.b)()},e.prototype.getType=function(){return Object(n.b)()},e.prototype.applyTransform=function(t){Object(n.b)()},e.prototype.intersectsExtent=function(t){return Object(n.b)()},e.prototype.translate=function(t,e){Object(n.b)()},e.prototype.transform=function(t,e){var r=Object(s.d)(t),n=r.getUnits()==u.b.TILE_PIXELS?function(t,n,i){var u=r.getExtent(),h=r.getWorldExtent(),p=Object(o.u)(h)/Object(o.u)(u);return Object(c.a)(l,h[0],h[3],p,-p,0,0,0),Object(a.c)(t,0,t.length,i,l,n),Object(s.e)(r,e)(t,n,i)}:Object(s.e)(r,e);return this.applyTransform(n),this},e}(i.a);e.a=h},function(t,e,r){"use strict";function n(t,e,r,n,i,o){for(var a,s=[t[e],t[e+1]],u=[];e+n=200&&u.status<300){var o,a=e.getType();a==i.a.JSON||a==i.a.TEXT?o=u.responseText:a==i.a.XML?(o=u.responseXML)||(o=(new DOMParser).parseFromString(u.responseText,"application/xml")):a==i.a.ARRAY_BUFFER&&(o=u.response),o?r.call(this,e.readFeatures(o,{featureProjection:s}),e.readProjection(o),e.getLastExtent()):n.call(this)}else n.call(this)}.bind(this),u.onerror=function(){n.call(this)}.bind(this),u.send()}}function a(t,e){return o(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),n.c)}},function(t,e,r){"use strict";var n=r(26),i=r(75),o=r(43),a=r(198),s=function(t){function e(e){t.call(this),this.projection_=Object(o.d)(e.projection),this.attributions_=u(e.attributions),this.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,this.loading=!1,this.state_=void 0!==e.state?e.state:a.a.READY,this.wrapX_=void 0!==e.wrapX&&e.wrapX}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolutions=function(){return Object(n.b)()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=u(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(i.a);function u(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}e.a=s},function(t,e,r){"use strict";e.a={IMAGE:"IMAGE",TILE:"TILE",VECTOR_TILE:"VECTOR_TILE",VECTOR:"VECTOR"}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n="undefined"==typeof window?{}:window,i=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame||function(t){return n.setTimeout(t,1e3/60)};n.cancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelAnimationFrame||n.msCancelAnimationFrame},function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(2);function u(t){return"Sprite Icon can not set icon ".concat(t)}function c(t){return"Template Icon can not set icon ".concat(t)}var l=function(){function t(){i()(this,t),this.container=void 0,this.target=void 0,this.container=Object(s.createDivElement)(),Object(s.domClass)(this.container,"TRACKER_ACTOR")}return a()(t,[{key:"addTo",value:function(t){Object(s.isDef)(this.target)||(this.target=t,this.renderDirection(),this.renderIconText())}},{key:"remove",value:function(){Object(s.isUndef)(this.target)||(this.target=null)}},{key:"getContainer",value:function(){return this.container}},{key:"setIconTemplate",value:function(t){Object(s.warn)(u("template"))}},{key:"setIconWidth",value:function(t){Object(s.warn)(u("width"))}},{key:"setIconHeight",value:function(t){Object(s.warn)(u("height"))}},{key:"setIconName",value:function(t){Object(s.warn)(c("name"))}},{key:"setIconText",value:function(t){Object(s.warn)(c("text"))}},{key:"setIconScale",value:function(t){Object(s.warn)(c("scale"))}},{key:"setIconBackground",value:function(t){Object(s.warn)(c("background"))}},{key:"setIconNorthDirection",value:function(t){Object(s.warn)("icon north direction can be set")}},{key:"getOverlayStyle",value:function(){return""}},{key:"renderDirection",value:function(){}},{key:"renderIconText",value:function(){}}]),t}()},function(t,e,r){var n=r(414),i=r(291)((function(t,e,r){n(t,e,r)}));t.exports=i},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(228);function i(t,e){if(t){if("string"==typeof t)return Object(n.a)(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(t,e):void 0}}},function(t,e,r){var n=r(761);t.exports=function(t){return t&&t.length?n(t):[]}},function(t,e,r){t.exports=function(){"use strict";function t(r,n,i,o,a,s){if(!(a-o<=i)){var u=o+a>>1;!function t(r,n,i,o,a,s){for(;a>o;){if(a-o>600){var u=a-o+1,c=i-o+1,l=Math.log(u),h=.5*Math.exp(2*l/3),p=.5*Math.sqrt(l*h*(u-h)/u)*(c-u/2<0?-1:1),d=Math.max(o,Math.floor(i-c*h/u+p)),f=Math.min(a,Math.floor(i+(u-c)*h/u+p));t(r,n,i,d,f,s)}var g=n[2*i+s],m=o,y=a;for(e(r,n,o,i),n[2*a+s]>g&&e(r,n,o,a);mg;)y--}n[2*o+s]===g?e(r,n,o,y):(y++,e(r,n,y,a)),y<=i&&(o=y+1),i<=y&&(a=y-1)}}(r,n,u,o,a,s%2),t(r,n,i,o,u-1,s+1),t(r,n,i,u+1,a,s+1)}}function e(t,e,n,i){r(t,n,i),r(e,2*n,2*i),r(e,2*n+1,2*i+1)}function r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function n(t,e,r,n){var i=t-r,o=e-n;return i*i+o*o}var i=function(t){return t[0]},o=function(t){return t[1]},a=function(e,r,n,a,s){void 0===r&&(r=i),void 0===n&&(n=o),void 0===a&&(a=64),void 0===s&&(s=Float64Array),this.nodeSize=a,this.points=e;for(var u=e.length<65536?Uint16Array:Uint32Array,c=this.ids=new u(e.length),l=this.coords=new s(2*e.length),h=0;h=r&&s<=i&&u>=n&&u<=o&&l.push(t[f]);else{var g=Math.floor((d+p)/2);s=e[2*g],u=e[2*g+1],s>=r&&s<=i&&u>=n&&u<=o&&l.push(t[g]);var m=(h+1)%2;(0===h?r<=s:n<=u)&&(c.push(d),c.push(g-1),c.push(m)),(0===h?i>=s:o>=u)&&(c.push(g+1),c.push(p),c.push(m))}}return l}(this.ids,this.coords,t,e,r,n,this.nodeSize)},a.prototype.within=function(t,e,r){return function(t,e,r,i,o,a){for(var s=[0,t.length-1,0],u=[],c=o*o;s.length;){var l=s.pop(),h=s.pop(),p=s.pop();if(h-p<=a)for(var d=p;d<=h;d++)n(e[2*d],e[2*d+1],r,i)<=c&&u.push(t[d]);else{var f=Math.floor((p+h)/2),g=e[2*f],m=e[2*f+1];n(g,m,r,i)<=c&&u.push(t[f]);var y=(l+1)%2;(0===l?r-o<=g:i-o<=m)&&(s.push(p),s.push(f-1),s.push(y)),(0===l?r+o>=g:i+o>=m)&&(s.push(f+1),s.push(h),s.push(y))}}return u}(this.ids,this.coords,t,e,r,this.nodeSize)};var s,u={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},c=Math.fround||(s=new Float32Array(1),function(t){return s[0]=+t,s[0]}),l=function(t){this.options=y(Object.create(u),t),this.trees=new Array(this.options.maxZoom+1)};function h(t,e,r,n,i){return{x:c(t),y:c(e),zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function p(t,e){var r=t.geometry.coordinates,n=r[0],i=r[1];return{x:c(g(n)),y:c(m(i)),zoom:1/0,index:e,parentId:-1}}function d(t){return{type:"Feature",id:t.id,properties:f(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function f(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return y(y({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function g(t){return t/360+.5}function m(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function y(t,e){for(var r in e)t[r]=e[r];return t}function v(t){return t.x}function A(t){return t.y}return l.prototype.load=function(t){var e=this.options,r=e.log,n=e.minZoom,i=e.maxZoom,o=e.nodeSize;r&&console.time("total time");var s="prepare "+t.length+" points";r&&console.time(s),this.points=t;for(var u=[],c=0;c=n;l--){var h=+Date.now();u=this._cluster(u,l),this.trees[l]=new a(u,v,A,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",l,u.length,+Date.now()-h)}return r&&console.timeEnd("total time"),this},l.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],c=[],l=0,h=u.range(g(r),m(o),g(i),m(n));le&&(g+=A.numPoints||1)}if(g>=s){for(var _=l.x*f,b=l.y*f,x=a&&f>1?this._map(l,!0):null,w=(c<<5)+(e+1)+this.points.length,C=0,E=d;C1)for(var T=0,P=d;T>5},l.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},l.prototype._map=function(t,e){if(t.numPoints)return e?y({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?y({},n):n},l}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return h}));var n=r(11),i=r.n(n),o=r(23),a=r.n(o),s=r(275),u=r.n(s);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e=0}(t)===e?t:t.reverse()}t.exports=function t(e,r){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(i(t,r)),e;case"GeometryCollection":return e.geometries=e.geometries.map(i(t,r)),e;case"Feature":return e.geometry=t(e.geometry,r),e;case"Polygon":case"MultiPolygon":return function(t,e){"Polygon"===t.type?t.coordinates=o(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(i(o,e)));return t}(e,r);default:return e}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return c}));var n=r(11),i=r.n(n),o=r(273),a=r.n(o);function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){const s=o-i+1,u=n-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1),p=Math.max(i,Math.floor(n-u*l/s+h)),d=Math.min(o,Math.floor(n+(s-u)*l/s+h));t(e,r,n,p,d,a)}const s=r[2*n+a];let u=i,c=o;for(l(e,r,i,n),r[2*o+a]>s&&l(e,r,i,o);us;)c--}r[2*i+a]===s?l(e,r,i,c):(c++,l(e,r,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}(t,e,a,n,i,o%2),c(t,e,r,n,a-1,o+1),c(t,e,r,a+1,i,o+1)}function l(t,e,r,n){h(t,r,n),h(e,2*r,2*n),h(e,2*r+1,2*n+1)}function h(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n){const i=t-r,o=e-n;return i*i+o*o}const d=t=>t[0],f=t=>t[1];class g{constructor(t,e=d,r=f,n=64,i=Float64Array){this.nodeSize=n,this.points=t;const o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new i(2*t.length);for(let n=0;n=r&&c<=i&&l>=n&&l<=o&&u.push(t[a]);continue}const f=Math.floor((d+p)/2);c=e[2*f],l=e[2*f+1],c>=r&&c<=i&&l>=n&&l<=o&&u.push(t[f]);const g=(h+1)%2;(0===h?r<=c:n<=l)&&(s.push(d),s.push(f-1),s.push(g)),(0===h?i>=c:o>=l)&&(s.push(f+1),s.push(p),s.push(g))}return u}(this.ids,this.coords,t,e,r,n,this.nodeSize)}within(t,e,r){return function(t,e,r,n,i,o){const a=[0,t.length-1,0],s=[],u=i*i;for(;a.length;){const c=a.pop(),l=a.pop(),h=a.pop();if(l-h<=o){for(let i=h;i<=l;i++)p(e[2*i],e[2*i+1],r,n)<=u&&s.push(t[i]);continue}const d=Math.floor((h+l)/2),f=e[2*d],g=e[2*d+1];p(f,g,r,n)<=u&&s.push(t[d]);const m=(c+1)%2;(0===c?r-i<=f:n-i<=g)&&(a.push(h),a.push(d-1),a.push(m)),(0===c?r+i>=f:n+i>=g)&&(a.push(d+1),a.push(l),a.push(m))}return s}(this.ids,this.coords,t,e,r,this.nodeSize)}}function m(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=n;c--){var l=+Date.now();s=this._cluster(s,c),this.trees[c]=new g(s,M,S,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-l)}return r&&console.timeEnd("total time"),this}},{key:"getClusters",value:function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}var u,c=this.trees[this._limitZoom(e)],l=[],h=m(c.range(C(r),E(o),C(i),E(n)));try{for(h.s();!(u=h.n()).done;){var p=u.value,d=c.points[p];l.push(d.numPoints?x(d):this.points[d.index])}}catch(t){h.e(t)}finally{h.f()}return l}},{key:"getClustersCached",value:function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClustersCached([r,n,180,o],e),s=this.getClustersCached([-180,n,i,o],e);return a.concat(s)}var u,c=this.trees[this._limitZoom(e)],l=[],h=m(this._range(c.ids,c.coords,C(r),E(o),C(i),E(n),c.nodeSize));try{for(h.s();!(u=h.n()).done;){var p=u.value,d=c.points[p];l.push(x(d))}}catch(t){h.e(t)}finally{h.f()}return l}},{key:"_range",value:function(t,e,r,n,i,o,a){for(var s,u,c=[0,t.length-1,0],l=[];c.length;){var h=c.pop(),p=c.pop(),d=c.pop();if(p-d<=a)for(var f=d;f<=p;f++)s=e[2*f],u=e[2*f+1],s>=r&&s<=i&&u>=n&&u<=o&&l.push(t[f]);else{var g=Math.floor((d+p)/2);s=e[2*g],u=e[2*g+1],s>=r&&s<=i&&u>=n&&u<=o&&l.push(t[g]);var m=(h+1)%2;(0===h?r<=s:n<=u)&&(c.push(d),c.push(g-1),c.push(m)),(0===h?i>=s:o>=u)&&(c.push(g+1),c.push(p),c.push(m))}}return l}},{key:"getChildren",value:function(t){var e=t>>5,r=t%32,n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var o=i.points[e];if(!o)throw new Error(n);var a,s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),u=[],c=m(i.within(o.x,o.y,s));try{for(c.s();!(a=c.n()).done;){var l=a.value,h=i.points[l];h.parentId===t&&u.push(h.numPoints?x(h):this.points[h.index])}}catch(t){c.e(t)}finally{c.f()}if(0===u.length)throw new Error(n);return u}},{key:"getLeaves",value:function(t,e,r){e=e||10,r=r||0;var n=[];return this._appendLeaves(n,t,e,r,0),n}},{key:"getTile",value:function(t,e,r){var n=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,a=o.extent,s=o.radius/a,u=(r-s)/i,c=(r+1+s)/i,l={features:[]};return this._addTileFeatures(n.range((e-s)/i,u,(e+1+s)/i,c),n.points,e,r,i,l),0===e&&this._addTileFeatures(n.range(1-s/i,u,1,c),n.points,i,r,i,l),e===i-1&&this._addTileFeatures(n.range(0,u,s/i,c),n.points,-1,r,i,l),l.features.length?l:null}},{key:"getClusterExpansionZoom",value:function(t){for(var e=t%32-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e}},{key:"_appendLeaves",value:function(t,e,r,n,i){var o,a=m(this.getChildren(e));try{for(a.s();!(o=a.n()).done;){var s=o.value,u=s.properties;if(u&&u.cluster?i+u.point_count<=n?i+=u.point_count:i=this._appendLeaves(t,u.cluster_id,r,n,i):i=1e4?"".concat(Math.round(e/1e3),"k"):e>=1e3?"".concat(Math.round(e/100)/10,"k"):e;return I(I({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function C(t){return t/360+.5}function E(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function I(t,e){for(var r in e)t[r]=e[r];return t}function M(t){return t.x}function S(t){return t.y}},function(t,e,r){"use strict";var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(17),u=r.n(s),c=r(12),l=r.n(c),h=r(13),p=r.n(h),d=r(10),f=r.n(d),g=r(36),m=r(9),y=r(21);function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return p()(this,r)}}var A=function(t){l()(r,t);var e=v(r);function r(t,n,o){var a;return i()(this,r),(a=e.call(this,null,o)).data=t,a.painter=n,a.layers=[],a._visible=!0,a.init(),a}return a()(r,[{key:"init",value:function(){this.setLayerFeature(this.data)}},{key:"buildLayer",value:function(){for(var t in this.painter){var e=this.painter[t],r=e.paint,n=e.filter,i=Object(m.b)();this.map.addLayer({id:i,type:"line",source:this.sourceId,paint:r,layout:{"line-join":"round","line-cap":"round"},filter:n}),this.layers.push(i),y.a.setIdDepts(this.layerId,i)}}},{key:"removeLayer",value:function(){u()(f()(r.prototype),"remove",this).call(this)}},{key:"destroy",value:function(){this.removeLayer()}},{key:"on",value:function(t,e){u()(f()(r.prototype),"addEvent",this).call(this,t,e)}},{key:"off",value:function(t){u()(f()(r.prototype),"removeEvent",this).call(this,t)}},{key:"show",value:function(){this._visible=!0,u()(f()(r.prototype),"show",this).call(this)}},{key:"hide",value:function(){this._visible=!1,u()(f()(r.prototype),"hide",this).call(this)}},{key:"getVisible",value:function(){return this._visible}}]),r}(g.a),_=r(475),b=r.n(_),x=(r(1),r(96)),w=r(186),C=r(166),E=r(187);function I(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return p()(this,r)}}var M={mm:A,kd:A,ol:function(t){l()(r,t);var e=I(r);function r(t,n){var o;return i()(this,r),(o=e.call(this)).data=t,o.painter=n,o.layer=null,o._visible=!0,o.init(),o}return a()(r,[{key:"init",value:function(){this.setLayerFeature(this.data)}},{key:"buildLayer",value:function(){var t=this;this.layer=new w.a({map:this.map,source:this.layerSource,style:function(e){var r=e.values_,n=Object.keys(t.painter).find((function(e){return function t(e,r){if(!Array.isArray(e))return!0;var n=b()(e),i=n[0],o=n.slice(1);if("all"===i)return o.every((function(e){return t(e,r)}));if("any"===i)return 0===o.length||o.some((function(e){return t(e,r)}));if("=="===i){var a=o[0],s=o[1];return a=Array.isArray(a)?a[1]:a,r[a]===s}return!0}(t.painter[e].filter,r)})),i=t.painter[n].paint,o={lineJoin:"round",lineCap:"round"};return i["line-width"]&&(o.width=i["line-width"]),i["line-color"]&&(o.color=i["line-color"]),i["line-dash"]&&(o.lineDash=i["line-dash"]),new C.c({stroke:new E.a(o)})}}),y.a.setIdDepts(this.layerId,this.layer.ol_uid)}},{key:"removeLayer",value:function(){u()(f()(r.prototype),"remove",this).call(this)}},{key:"destroy",value:function(){this.removeLayer()}},{key:"on",value:function(t,e){u()(f()(r.prototype),"addEvent",this).call(this,t,e)}},{key:"off",value:function(t){u()(f()(r.prototype),"removeEvent",this).call(this,t)}},{key:"show",value:function(){this._visible=!0,u()(f()(r.prototype),"show",this).call(this)}},{key:"hide",value:function(){this._visible=!1,u()(f()(r.prototype),"hide",this).call(this)}},{key:"getVisible",value:function(){return this._visible}}]),r}(x.a)};e.a=M.kd},function(t,e,r){var n=r(323);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,r(e,n)}t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){var n=r(170)(r(122),"Map");t.exports=n},function(t,e,r){var n=r(526),i=r(533),o=r(535),a=r(536),s=r(537);function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991}},function(t,e,r){(function(t){var n=r(326),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&n.process,s=function(){try{var t=o&&o.require&&o.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}).call(this,r(190)(t))},function(t,e,r){var n=r(548),i=r(336),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),n(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=s},function(t,e){t.exports=function(t,e){for(var r=-1,n=e.length,i=t.length;++r1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++ni?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0?t.map((function(t){return e(t)})):[e(t.x),e(t.y),e(t.z)]:e(t)},degreeify:function(t){function e(t){return 360*(t=t||0)/(2*Math.PI)}return"object"===n(t)?[e(t.x),e(t.y),e(t.z)]:e(t)},projectToWorld:function(t){var e=[-s.MERCATOR_A*s.DEG2RAD*t[0]*s.PROJECTION_WORLD_SIZE,-s.MERCATOR_A*Math.log(Math.tan(.25*Math.PI+.5*s.DEG2RAD*t[1]))*s.PROJECTION_WORLD_SIZE];if(t[2]){var r=this.projectedUnitsPerMeter(t[1]);e.push(t[2]*r)}else e.push(0);return new a.Vector3(e[0],e[1],e[2])},projectedUnitsPerMeter:function(t){return Math.abs(s.WORLD_SIZE/Math.cos(s.DEG2RAD*t)/s.EARTH_CIRCUMFERENCE)},_scaleVerticesToMeters:function(t,e){for(var r=this.projectedUnitsPerMeter(t[1]),n=(this.projectToWorld(t),0);n(n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function u(t,e,n,i){var o=new r(t,e,n,i);return function(t){return o.solve(t)}}var c=u(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function h(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function p(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function y(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function v(t,e){return-1!==t.indexOf(e,t.length-e.length)}function A(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function _(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?A(t,b):t}var x={};function w(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function C(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function E(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var S=null;function T(t){if(null==S){var e=t.navigator?t.navigator.userAgent:null;S=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return S}function P(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var O,L,k,R,D=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),B=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,N=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,F={now:D,frame:function(t){var e=B(t);return{cancel:function(){return N(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return O||(O=a.document.createElement("a")),O.href=t,O.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==L&&(L=a.matchMedia("(prefers-reduced-motion: reduce)")),L.matches)}},j={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},z={supported:!1,testSupport:function(t){!U&&R&&(G?H(t):k=t)}},U=!1,G=!1;function H(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,R),t.isContextLost())return;z.supported=!0}catch(t){}t.deleteTexture(e),U=!0}a.document&&((R=a.document.createElement("img")).onload=function(){k&&H(k),k=null,G=!0},R.onerror=function(){U=!0,k=null},R.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var V="01",Q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function q(t){return 0===t.indexOf("mapbox:")}Q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",V,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},Q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},Q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},Q.prototype.normalizeStyleURL=function(t,e){if(!q(t))return t;var r=Z(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Q.prototype.normalizeGlyphsURL=function(t,e){if(!q(t))return t;var r=Z(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},Q.prototype.normalizeSourceURL=function(t,e){if(!q(t))return t;var r=Z(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},Q.prototype.normalizeSpriteURL=function(t,e,r,n){var i=Z(t);return q(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,K(i))},Q.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!q(t))return t;var r=Z(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(F.devicePixelRatio>=2||512===e?"@2x":"")+(z.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,r,n){var i=this;if(j.EVENTS_URL){var o=Z(j.EVENTS_URL);o.params.push("access_token="+(n||j.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.12.0-dev",skuId:V,userId:this.anonId},s=e?p(a,e):a,u={url:K(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,rt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(j.EVENTS_URL&&n||j.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return q(t)||Y(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}($),nt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){j.EVENTS_URL&&j.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return q(t)||Y(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(j.ACCESS_TOKEN),n=r?r.u:j.ACCESS_TOKEN,i=n!==this.eventData.tokenU;m(this.anonId)||(this.anonId=g(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}($)),it=nt.postTurnstileEvent.bind(nt),ot=new rt,at=ot.postMapLoadEvent.bind(ot),st=500,ut=50;function ct(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function lt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,pt=1/0;function dt(){return null==ht&&(ht=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ht}var ft={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ft);var gt,mt,yt=function(t){function e(e,r,n){401===r&&Y(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),vt=I()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},At=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(vt())&&!/^\w+:/.test(r))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:vt(),signal:n.signal}),o=!1,s=!1,u=(r=i.url).indexOf("sku=")>0&&Y(r);"json"===t.type&&i.headers.set("Accept","application/json");var c=function(r,n,o){if(!s){if(r&&"SecurityError"!==r.message&&w(r),n&&o)return l(n);var c=Date.now();a.fetch(i).then((function(r){if(r.ok){var n=u?r.clone():null;return l(r,n,c)}return e(new yt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){s||(n&&u&&function(t,e,r){if(ct(),tt){var n={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=M(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var r=new a.Response(e,n);ct(),tt&&tt.then((function(e){return e.put(lt(t.url),r)})).catch((function(t){return w(t.message)}))})))}}(i,n,u),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(ct(),!tt)return e(null);var r=lt(t.url);tt.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=M(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}(i,c):c(null,null),{cancel:function(){s=!0,o||n.abort()}}}(t,e);if(I()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new a.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new yt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},_t=function(t,e){return At(p(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return At(p(t,{method:"POST"}),e)};gt=[],mt=0;var xt=function(t,e){if(z.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),mt>=j.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return gt.push(r),r}mt++;var n=!1,i=function(){if(!n)for(n=!0,mt--;gt.length&&mt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Mt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var St={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},zoomOffset:{type:"number",default:0},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},zoomOffset:{type:"number",default:0},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},zoomOffset:{type:"number",default:0},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Tt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Pt(t){var e=t.value;return e?[new Tt(t.key,e,"constants have been deprecated as of v8")]:[]}function Ot(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Yt=[Bt,Nt,Ft,jt,zt,Vt,Ut,qt(Gt),Qt];function Xt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Xt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Yt;r255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),c=s.indexOf(")");if(-1!==u&&c+1===s.length){var l=s.substr(0,u),h=s.substr(u+1,c-(u+1)).split(","),p=1;switch(l){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,f=o(h[1]),g=o(h[2]),m=g<=.5?g*(f+1):g+f-g*f,y=2*g-m;return[n(255*a(y,m,d+1/3)),n(255*a(y,m,d)),n(255*a(y,m,d-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,$t=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};$t.parse=function(t){if(t){if(t instanceof $t)return t;if("string"==typeof t){var e=Jt(t);if(e)return new $t(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},$t.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],n=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+n+")"},$t.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},$t.black=new $t(0,0,0,1),$t.white=new $t(1,1,1,1),$t.transparent=new $t(0,0,0,0),$t.red=new $t(1,0,0,1);var te=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};te.prototype.compare=function(t,e){return this.collator.compare(t,e)},te.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ee=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},re=function(t){this.sections=t};re.fromString=function(t){return new re([new ee(t,null,null,null,null)])},re.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},re.factory=function(t){return t instanceof re?t:re.fromString(t)},re.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},re.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function oe(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof $t)return!0;if(t instanceof te)return!0;if(t instanceof re)return!0;if(t instanceof ne)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in le)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=le[s],n++}else o=Gt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=qt(o,a)}else r=le[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var pe=function(t){this.type=Vt,this.sections=t};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Nt)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,qt(Ft))))return null;var c=null;if(a["text-color"]&&!(c=e.parse(a["text-color"],1,zt)))return null;var l=n[n.length-1];l.scale=s,l.font=u,l.textColor=c}else{var h=e.parse(t[o],1,Gt);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new pe(n)},pe.prototype.evaluate=function(t){return new re(this.sections.map((function(e){var r=e.content.evaluate(t);return ae(r)===Qt?new ee("",r,null,null,null):new ee(se(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},pe.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var fe={"to-boolean":jt,"to-color":zt,"to-number":Nt,"to-string":Ft},ge=function(t,e){this.type=t,this.args=e};ge.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=fe[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":ie(e[0],e[1],e[2],e[3])))return new $t(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ce(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function xe(t,e){var r,n,i=(180+t[0])/360,o=(r=t[1],void 0===(n=e.projection)&&(n="EPSG:3857"),"EPSG:3857"===n?(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360:(90-r)/360),a=Math.pow(2,e.z);return[Math.round(i*a*8192),Math.round(o*a*8192)]}function we(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Ce(t,e){for(var r,n,i,o,a,s,u,c=!1,l=0,h=e.length;l0&&s<0||a<0&&s>0}function Me(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}_e(e,t)}function ke(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Fe(t,e)&&(r=!1)})),r}De.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(oe(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new ce("Input is not a number.");o=a-1}return 0}ze.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},ze.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new he(e,[t]):"coerce"===r?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,e.typeAnnotation||"coerce");else o=r(o,a,e.typeAnnotation||"assert")}if(!(o instanceof ue)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof je)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return!1;if(e instanceof Ae)return!1;if(e instanceof De)return!1;var r=e instanceof ge||e instanceof he,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ue})),!!n&&Be(e)&&Fe(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new ye;try{o=new ue(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},ze.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new ze(this.registry,n,e||null,i,this.errors)},ze.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Rt(n,t))},ze.prototype.checkSubtype=function(t,e){var r=Xt(t,e);return r&&this.error(r),r};var Ge=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var l=e.parse(s,c,i);if(!l)return null;i=i||l.type,n.push([a,l])}return new Ge(i,r,n)},Ge.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ue(e,n)].evaluate(t)},Ge.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ve=Object.freeze({__proto__:null,number:He,color:function(t,e,r){return new $t(He(t.r,e.r,r),He(t.g,e.g,r),He(t.b,e.b,r),He(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return He(t,e[n],r)}))}}),Qe=6/29*3*(6/29),qe=Math.PI/180,We=180/Math.PI;function Ye(t){return t>.008856451679035631?Math.pow(t,1/3):t/Qe+4/29}function Xe(t){return t>6/29?t*t*t:Qe*(t-4/29)}function Ze(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ke(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Je(t){var e=Ke(t.r),r=Ke(t.g),n=Ke(t.b),i=Ye((.4124564*e+.3575761*r+.1804375*n)/.95047),o=Ye((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Ye((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function $e(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Xe(e),r=.95047*Xe(r),n=1.08883*Xe(n),new $t(Ze(3.2404542*r-1.5371385*e-.4985314*n),Ze(-.969266*r+1.8760108*e+.041556*n),Ze(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function tr(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var er={forward:Je,reverse:$e,interpolate:function(t,e,r){return{l:He(t.l,e.l,r),a:He(t.a,e.a,r),b:He(t.b,e.b,r),alpha:He(t.alpha,e.alpha,r)}}},rr={forward:function(t){var e=Je(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*We;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*qe,r=t.c;return $e({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:tr(t.h,e.h,r),c:He(t.c,e.c,r),l:He(t.l,e.l,r),alpha:He(t.alpha,e.alpha,r)}}},nr=Object.freeze({__proto__:null,lab:er,hcl:rr}),ir=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Nt)))return null;var u=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=zt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var l=0;l=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var g=e.parse(p,f,c);if(!g)return null;c=c||g.type,u.push([h,g])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new ir(c,r,n,i,u):e.error("Type "+Wt(c)+" is not interpolatable.")},ir.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=Ue(e,n),a=ir.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Ve[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?rr.reverse(rr.interpolate(rr.forward(s),rr.forward(u),a)):er.reverse(er.interpolate(er.forward(s),er.forward(u),a))},ir.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ce("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return r[e]},ur.prototype.eachChild=function(t){t(this.index),t(this.input)},ur.prototype.outputDefined=function(){return!1},ur.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var cr=function(t,e){this.type=jt,this.needle=t,this.haystack=e};cr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Gt),n=e.parse(t[2],2,Gt);return r&&n?Zt(r.type,[jt,Ft,Nt,Bt,Gt])?new cr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead"):null},cr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Kt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(ae(e))+" instead.");if(!Kt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(ae(r))+" instead.");return r.indexOf(e)>=0},cr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},cr.prototype.outputDefined=function(){return!0},cr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var lr=function(t,e,r){this.type=Nt,this.needle=t,this.haystack=e,this.fromIndex=r};lr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Gt),n=e.parse(t[2],2,Gt);if(!r||!n)return null;if(!Zt(r.type,[jt,Ft,Nt,Bt,Gt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Wt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Nt);return i?new lr(r,n,i):null}return new lr(r,n)},lr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Kt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Wt(ae(e))+" instead.");if(!Kt(r,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Wt(ae(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},lr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};hr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ae(p)))return null}else r=ae(p);if(void 0!==i[String(p)])return c.error("Branch labels must be unique.");i[String(p)]=o.length}var d=e.parse(u,a,n);if(!d)return null;n=n||d.type,o.push(d)}var f=e.parse(t[1],1,Gt);if(!f)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?"value"!==f.type.kind&&e.concat(1).checkSubtype(r,f.type)?null:new hr(r,n,f,i,o,g):null},hr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ae(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},hr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},hr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},hr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Gt),n=e.parse(t[2],2,Nt);if(!r||!n)return null;if(!Zt(r.type,[qt(Gt),Ft,Gt]))return e.error("Expected first argument to be of type array or string, but found "+Wt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Nt);return i?new dr(r.type,r,n,i):null}return new dr(r.type,r,n)},dr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Kt(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Wt(ae(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},dr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},dr.prototype.outputDefined=function(){return!1},dr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var yr=mr("==",(function(t,e,r){return e===r}),gr),vr=mr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!gr(0,e,r,n)})),Ar=mr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),br=mr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),xr=mr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),wr=function(t,e,r,n,i){this.type=Ft,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};wr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Nt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Ft)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Ft)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Nt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Nt))?null:new wr(r,i,o,a,s)},wr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},wr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},wr.prototype.outputDefined=function(){return!1},wr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Cr=function(t){this.type=Nt,this.input=t};Cr.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Wt(r.type)+" instead."):new Cr(r):null},Cr.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ce("Expected value to be of type string or array, but found "+Wt(ae(e))+" instead.")},Cr.prototype.eachChild=function(t){t(this.input)},Cr.prototype.outputDefined=function(){return!1},Cr.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Er={"==":yr,"!=":vr,">":_r,"<":Ar,">=":xr,"<=":br,array:he,at:ur,boolean:he,case:pr,coalesce:ar,collator:Ae,format:pe,image:de,in:cr,"index-of":lr,interpolate:ir,"interpolate-hcl":ir,"interpolate-lab":ir,length:Cr,let:sr,literal:ue,match:hr,number:he,"number-format":wr,object:he,slice:dr,step:Ge,string:he,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:je,within:De};function Ir(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=ie(r,n,i,a);if(s)throw new ce(s);return new $t(r/255*a,n/255*a,i/255*a,a)}function Mr(t,e){return t in e}function Sr(t,e){var r=e[t];return void 0===r?null:r}function Tr(t){return{type:t}}function Pr(t){return{result:"success",value:t}}function Or(t){return{result:"error",value:t}}function Lr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function kr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Rr(t){return!!t.expression&&t.expression.interpolated}function Dr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Br(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Nr(t){return t}function Fr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function jr(t,e,r,n,i){return Fr(typeof r===i?n[r]:void 0,t.default,e.default)}function zr(t,e,r){if("number"!==Dr(r))return Fr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Ue(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Ur(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Dr(r))return Fr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=Ue(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],c=Ve[e.type]||Nr;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=nr[t.colorSpace];c=function(t,e){return l.reverse(l.interpolate(l.forward(t),l.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,a)}}:c(s,u,a)}function Gr(t,e,r){return"color"===e.type?r=$t.parse(r):"formatted"===e.type?r=re.fromString(r.toString()):"resolvedImage"===e.type?r=ne.fromString(r.toString()):Dr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Fr(r,t.default,e.default)}ve.register(Er,{error:[{kind:"error"},[Ft],function(t,e){throw new ce(e[0].evaluate(t))}],typeof:[Ft,[Gt],function(t,e){return Wt(ae(e[0].evaluate(t)))}],"to-rgba":[qt(Nt,4),[zt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[zt,[Nt,Nt,Nt],Ir],rgba:[zt,[Nt,Nt,Nt,Nt],Ir],has:{type:jt,overloads:[[[Ft],function(t,e){return Mr(e[0].evaluate(t),t.properties())}],[[Ft,Ut],function(t,e){var r=e[1];return Mr(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:Gt,overloads:[[[Ft],function(t,e){return Sr(e[0].evaluate(t),t.properties())}],[[Ft,Ut],function(t,e){var r=e[1];return Sr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Gt,[Ft],function(t,e){return Sr(e[0].evaluate(t),t.featureState||{})}],properties:[Ut,[],function(t){return t.properties()}],"geometry-type":[Ft,[],function(t){return t.geometryType()}],id:[Gt,[],function(t){return t.id()}],zoom:[Nt,[],function(t){return t.globals.zoom}],"heatmap-density":[Nt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Nt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Gt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Nt,Tr(Nt),function(t,e){for(var r=0,n=0,i=e;n":[jt,[Ft,Gt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>o}],"filter-id->":[jt,[Gt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[jt,[Ft,Gt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[jt,[Gt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[jt,[Ft,Gt],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],o=n.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[jt,[Gt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[jt,[Gt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[jt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[jt,[qt(Ft)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[jt,[qt(Gt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[jt,[Ft,qt(Gt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[jt,[Ft,qt(Gt)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:jt,overloads:[[[jt,jt],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Tr(jt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Er}function Qr(t,e){var r=new ze(Er,[],e?function(t){var e={color:zt,string:Ft,number:Nt,enum:Ft,boolean:jt,formatted:Vt,resolvedImage:Qt};return"array"===t.type?qt(e[t.value]||Gt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Pr(new Hr(n,e)):Or(r.errors)}Hr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Hr.prototype.evaluate=function(t,e,r,n,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var qr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ne(e.expression)};qr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},qr.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var Wr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ne(e.expression),this.interpolationType=n};function Yr(t,e){if("error"===(t=Qr(t,e)).result)return t;var r=t.value.expression,n=Be(r);if(!n&&!Lr(e))return Or([new Rt("","data expressions not supported")]);var i=Fe(r,["zoom"]);if(!i&&!kr(e))return Or([new Rt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof sr)r=t(e.result);else if(e instanceof ar)for(var n=0,i=e.args;nn.maximum?[new Tt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function $r(t){var e,r,n,i=t.valueSpec,o=Lt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,c="array"===Dr(t.value.stops)&&"array"===Dr(t.value.stops[0])&&"object"===Dr(t.value.stops[0][0]),l=Zr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Tt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Kr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Dr(r)&&0===r.length&&e.push(new Tt(t.key,r,"array must have at least one stop")),e},default:function(t){return xn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&l.push(new Tt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||l.push(new Tt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Rr(t.valueSpec)&&l.push(new Tt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Lr(t.valueSpec)?l.push(new Tt(t.key,t.value,"property functions not supported")):s&&!kr(t.valueSpec)&&l.push(new Tt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||l.push(new Tt(t.key,t.value,'"property" property is required')),l;function h(t){var e=[],o=t.value,s=t.key;if("array"!==Dr(o))return[new Tt(s,o,"array expected, "+Dr(o)+" found")];if(2!==o.length)return[new Tt(s,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==Dr(o[0]))return[new Tt(s,o,"object expected, "+Dr(o[0])+" found")];if(void 0===o[0].zoom)return[new Tt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Tt(s,o,"object stop key must have value")];if(n&&n>Lt(o[0].zoom))return[new Tt(s,o[0].zoom,"stop zoom values must appear in ascending order")];Lt(o[0].zoom)!==n&&(n=Lt(o[0].zoom),r=void 0,a={}),e=e.concat(Zr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Jr,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Vr(kt(o[1]))?e.concat([new Tt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(xn({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=Dr(t.value),u=Lt(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Tt(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Tt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var l="number expected, "+s+" found";return Lr(i)&&void 0===o&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Tt(t.key,c,l)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function sn(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?un(t[1],t[2],"=="):"!="===r?hn(un(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?un(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(sn))):"all"===r?["all"].concat(t.slice(1).map(sn)):"none"===r?["all"].concat(t.slice(1).map(sn).map(hn)):"in"===r?cn(t[1],t.slice(2)):"!in"===r?hn(cn(t[1],t.slice(2))):"has"===r?ln(t[1]):"!has"===r?hn(ln(t[1])):"within"!==r||t}function un(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function cn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(an)]]:["filter-in-small",t,["literal",e]]}}function ln(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function hn(t){return["!",t]}function pn(t){return rn(kt(t.value))?tn(Ot({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Dr(r))return[new Tt(n,r,"array expected, "+Dr(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new Tt(n,r,"filter array must have at least 1 element")];switch(a=a.concat(en({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Lt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Lt(r[1])&&a.push(new Tt(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new Tt(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Dr(r[1]))&&a.push(new Tt(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=l[d+0]&&n>=l[d+1])?(a[p]=!0,o.push(c[p])):a[p]=!1}}},kn.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),c=this._convertToCellCoord(e),l=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=u;p<=l;p++)for(var d=c;d<=h;d++){var f=this.d*d+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(d),this._convertFromCellCoord(p+1),this._convertFromCellCoord(d+1)))&&i.call(this,t,e,r,n,f,o,a,s))return}},kn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},kn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},kn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n=0)){var l=t[c];u[c]=Bn[s].shallow.indexOf(c)>=0?l:Un(l,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function Gn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||jn(t)||zn(t)||ArrayBuffer.isView(t)||t instanceof Rn)return t;if(Array.isArray(t))return t.map(Gn);if("object"==typeof t){var e=t.$name||"Object",r=Bn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,o=Object.keys(t);i=0?s:Gn(s)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Hn=function(){this.first=!0};Hn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Qn(t){for(var e=0,r=t;e=65097&&t<=65103)||Vn["CJK Compatibility Ideographs"](t)||Vn["CJK Compatibility"](t)||Vn["CJK Radicals Supplement"](t)||Vn["CJK Strokes"](t)||!(!Vn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Vn["CJK Unified Ideographs Extension A"](t)||Vn["CJK Unified Ideographs"](t)||Vn["Enclosed CJK Letters and Months"](t)||Vn["Hangul Compatibility Jamo"](t)||Vn["Hangul Jamo Extended-A"](t)||Vn["Hangul Jamo Extended-B"](t)||Vn["Hangul Jamo"](t)||Vn["Hangul Syllables"](t)||Vn.Hiragana(t)||Vn["Ideographic Description Characters"](t)||Vn.Kanbun(t)||Vn["Kangxi Radicals"](t)||Vn["Katakana Phonetic Extensions"](t)||Vn.Katakana(t)&&12540!==t||!(!Vn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Vn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Vn["Unified Canadian Aboriginal Syllabics"](t)||Vn["Unified Canadian Aboriginal Syllabics Extended"](t)||Vn["Vertical Forms"](t)||Vn["Yijing Hexagram Symbols"](t)||Vn["Yi Syllables"](t)||Vn["Yi Radicals"](t))))}function Wn(t){return!(qn(t)||function(t){return!!(Vn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Vn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Vn["Letterlike Symbols"](t)||Vn["Number Forms"](t)||Vn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Vn["Control Pictures"](t)&&9251!==t||Vn["Optical Character Recognition"](t)||Vn["Enclosed Alphanumerics"](t)||Vn["Geometric Shapes"](t)||Vn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Vn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Vn["CJK Symbols and Punctuation"](t)||Vn.Katakana(t)||Vn["Private Use Area"](t)||Vn["CJK Compatibility Forms"](t)||Vn["Small Form Variants"](t)||Vn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Yn(t){return t>=1424&&t<=2303||Vn["Arabic Presentation Forms-A"](t)||Vn["Arabic Presentation Forms-B"](t)}function Xn(t,e){return!(!e&&Yn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Vn.Khmer(t))}function Zn(t){for(var e=0,r=t;e-1&&(Jn="error"),Kn&&Kn(t)};function ei(){ri.fire(new Et("pluginStateChange",{pluginStatus:Jn,pluginURL:$n}))}var ri=new Mt,ni=function(){return Jn},ii=function(){if("deferred"!==Jn||!$n)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Jn="loading",ei(),$n&&_t({url:$n},(function(t){t?ti(t):(Jn="loaded",ei())}))},oi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Jn||null!=oi.applyArabicShaping},isLoading:function(){return"loading"===Jn},setState:function(t){Jn=t.pluginStatus,$n=t.pluginURL},isParsed:function(){return null!=oi.applyArabicShaping&&null!=oi.processBidirectionalText&&null!=oi.processStyledBidirectionalText},getPluginURL:function(){return $n}},ai=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Hn,this.transition={})};ai.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var si=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Br(t))return new Xr(t,e);if(Vr(t)){var r=Yr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=$t.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};si.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},si.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var ui=function(t){this.property=t,this.value=new si(t,void 0)};ui.prototype.transitioned=function(t,e){return new li(this.property,this.value,e,p({},t.transition,this.transition),t.now)},ui.prototype.untransitioned=function(){return new li(this.property,this.value,null,{},0)};var ci=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ci.prototype.getValue=function(t){return b(this._values[t].value.value)},ci.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ui(this._values[t].property)),this._values[t].value=new si(this._values[t].property,null===e?void 0:b(e))},ci.prototype.getTransition=function(t){return b(this._values[t].transition)},ci.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ui(this._values[t].property)),this._values[t].transition=b(e)||void 0},ci.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return i};var hi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};hi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new fi(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(mi),vi=function(t){this.specification=t};vi.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new ai(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ai(Math.floor(e.zoom),e)),t.expression.evaluate(new ai(Math.floor(e.zoom+1),e)),e)}},vi.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},vi.prototype.interpolate=function(t){return t};var Ai=function(t){this.specification=t};Ai.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},Ai.prototype.interpolate=function(){return!1};var _i=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new si(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new ui(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Nn("DataDrivenProperty",mi),Nn("DataConstantProperty",gi),Nn("CrossFadedDataDrivenProperty",yi),Nn("CrossFadedProperty",vi),Nn("ColorRampProperty",Ai);var bi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new pi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ci(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new fi(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Pn,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return v(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Tn,"layers."+this.id+".paint."+t,t,e,r))return!1;if(v(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),_(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&On(this,t.call(Mn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:St,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof di&&Lr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Mt),xi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},wi=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ci=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ei(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=xi[t.type].BYTES_PER_ELEMENT,o=r=Ii(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Ii(r,Math.max(n,e)),alignment:e}}function Ii(t,e){return Math.ceil(t/e)*e}Ci.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ci.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Ci.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ci.prototype.clear=function(){this.length=0},Ci.prototype.resize=function(t){this.reserve(t),this.length=t},Ci.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Ci.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Ci);Mi.prototype.bytesPerElement=4,Nn("StructArrayLayout2i4",Mi);var Si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Ci);Si.prototype.bytesPerElement=8,Nn("StructArrayLayout4i8",Si);var Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Ci);Ti.prototype.bytesPerElement=12,Nn("StructArrayLayout2i4i12",Ti);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Ci);Pi.prototype.bytesPerElement=8,Nn("StructArrayLayout2i4ub8",Pi);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Ci);Oi.prototype.bytesPerElement=8,Nn("StructArrayLayout2f8",Oi);var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u,c)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=u,this.uint16[h+8]=c,this.uint16[h+9]=l,t},e}(Ci);Li.prototype.bytesPerElement=20,Nn("StructArrayLayout10ui20",Li);var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,u,c,l,h)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,h,p){var d=12*t;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=i,this.uint16[d+4]=o,this.uint16[d+5]=a,this.uint16[d+6]=s,this.uint16[d+7]=u,this.int16[d+8]=c,this.int16[d+9]=l,this.int16[d+10]=h,this.int16[d+11]=p,t},e}(Ci);ki.prototype.bytesPerElement=24,Nn("StructArrayLayout4i4ui4i24",ki);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Ci);Ri.prototype.bytesPerElement=12,Nn("StructArrayLayout3f12",Ri);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Ci);Di.prototype.bytesPerElement=4,Nn("StructArrayLayout1ul4",Di);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c){var l=10*t,h=5*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+3]=i,this.int16[l+4]=o,this.int16[l+5]=a,this.uint32[h+3]=s,this.uint16[l+8]=u,this.uint16[l+9]=c,t},e}(Ci);Bi.prototype.bytesPerElement=20,Nn("StructArrayLayout6i1ul2ui20",Bi);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Ci);Ni.prototype.bytesPerElement=12,Nn("StructArrayLayout2i2i2i12",Ni);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Ci);Fi.prototype.bytesPerElement=16,Nn("StructArrayLayout2f1f2i16",Fi);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Ci);ji.prototype.bytesPerElement=12,Nn("StructArrayLayout2ub2f12",ji);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Ci);zi.prototype.bytesPerElement=6,Nn("StructArrayLayout3ui6",zi);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y){var v=24*t,A=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[A+2]=o,this.uint32[A+3]=a,this.uint32[A+4]=s,this.uint16[v+10]=u,this.uint16[v+11]=c,this.uint16[v+12]=l,this.float32[A+7]=h,this.float32[A+8]=p,this.uint8[_+36]=d,this.uint8[_+37]=f,this.uint8[_+38]=g,this.uint32[A+10]=m,this.int16[v+22]=y,t},e}(Ci);Ui.prototype.bytesPerElement=48,Nn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ui);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,w,C,E,I,M){var S=this.length;return this.resize(S+1),this.emplace(S,t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,w,C,E,I,M)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,w,C,E,I,M,S){var T=34*t,P=17*t;return this.int16[T+0]=e,this.int16[T+1]=r,this.int16[T+2]=n,this.int16[T+3]=i,this.int16[T+4]=o,this.int16[T+5]=a,this.int16[T+6]=s,this.int16[T+7]=u,this.uint16[T+8]=c,this.uint16[T+9]=l,this.uint16[T+10]=h,this.uint16[T+11]=p,this.uint16[T+12]=d,this.uint16[T+13]=f,this.uint16[T+14]=g,this.uint16[T+15]=m,this.uint16[T+16]=y,this.uint16[T+17]=v,this.uint16[T+18]=A,this.uint16[T+19]=_,this.uint16[T+20]=b,this.uint16[T+21]=x,this.uint16[T+22]=w,this.uint32[P+12]=C,this.float32[P+13]=E,this.float32[P+14]=I,this.float32[P+15]=M,this.float32[P+16]=S,t},e}(Ci);Gi.prototype.bytesPerElement=68,Nn("StructArrayLayout8i15ui1ul4f68",Gi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Ci);Hi.prototype.bytesPerElement=4,Nn("StructArrayLayout1f4",Hi);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Ci);Vi.prototype.bytesPerElement=6,Nn("StructArrayLayout3i6",Vi);var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(Ci);Qi.prototype.bytesPerElement=8,Nn("StructArrayLayout1ul2ui8",Qi);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Ci);qi.prototype.bytesPerElement=4,Nn("StructArrayLayout2ui4",qi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Ci);Wi.prototype.bytesPerElement=2,Nn("StructArrayLayout1ui2",Wi);var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Ci);Yi.prototype.bytesPerElement=16,Nn("StructArrayLayout4f16",Yi);var Xi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(wi);Xi.prototype.size=20;var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Xi(this,t)},e}(Bi);Nn("CollisionBoxArray",Zi);var Ki=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(wi);Ki.prototype.size=48;var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ki(this,t)},e}(Ui);Nn("PlacedSymbolArray",Ji);var $i=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(wi);$i.prototype.size=68;var to=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new $i(this,t)},e}(Gi);Nn("SymbolInstanceArray",to);var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Hi);Nn("GlyphOffsetArray",eo);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Vi);Nn("SymbolLineVertexArray",ro);var no=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(wi);no.prototype.size=8;var io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new no(this,t)},e}(Qi);Nn("FeatureIndexArray",io);var oo=Ei([{name:"a_pos",components:2,type:"Int16"}],4).members,ao=function(t){void 0===t&&(t=[]),this.segments=t};function so(t,e){return 256*(t=l(Math.floor(t),0,255))+l(Math.floor(e),0,255)}ao.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>ao.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+ao.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>ao.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},ao.prototype.get=function(){return this.segments},ao.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(c)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),lo=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),ho=co,po=lo;ho.murmur3=co,ho.murmur2=po;var fo=function(){this.ids=[],this.positions=[],this.indexed=!1};fo.prototype.add=function(t,e,r,n){this.ids.push(mo(t)),this.positions.push(e,r,n)},fo.prototype.getPositions=function(t){for(var e=mo(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},fo.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n>1],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;yo(e,a,s),yo(r,3*a,3*s),yo(r,3*a+1,3*s+1),yo(r,3*a+2,3*s+2)}s-na.x+1||ua.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function zo(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Uo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Mi,this.indexArray=new zi,this.segments=new ao,this.programConfigurations=new Ro(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Go(t,e){for(var r=0;r1){if(qo(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Zo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function Ko(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function Jo(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var o=C(t,e,r[0]);return o!==C(t,e,r[1])||o!==C(t,e,r[2])||o!==C(t,e,r[3])}function $o(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ta(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ea(t,e,r,n,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===r&&a._rotate(-n);for(var s=[],u=0;u=8192||l<0||l>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;zo(this.layoutVertexArray,c,l,-1,-1),zo(this.layoutVertexArray,c,l,1,-1),zo(this.layoutVertexArray,c,l,1,1),zo(this.layoutVertexArray,c,l,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Nn("CircleBucket",Uo,{omit:["layers"]});var ra=new _i({"circle-sort-key":new mi(St.layout_circle["circle-sort-key"])}),na={paint:new _i({"circle-radius":new mi(St.paint_circle["circle-radius"]),"circle-color":new mi(St.paint_circle["circle-color"]),"circle-blur":new mi(St.paint_circle["circle-blur"]),"circle-opacity":new mi(St.paint_circle["circle-opacity"]),"circle-translate":new gi(St.paint_circle["circle-translate"]),"circle-translate-anchor":new gi(St.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new gi(St.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new gi(St.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new mi(St.paint_circle["circle-stroke-width"]),"circle-stroke-color":new mi(St.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new mi(St.paint_circle["circle-stroke-opacity"])}),layout:ra},ia="undefined"!=typeof Float32Array?Float32Array:Array;function oa(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function aa(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],d=e[10],f=e[11],g=e[12],m=e[13],y=e[14],v=e[15],A=r[0],_=r[1],b=r[2],x=r[3];return t[0]=A*n+_*s+b*h+x*g,t[1]=A*i+_*u+b*p+x*m,t[2]=A*o+_*c+b*d+x*y,t[3]=A*a+_*l+b*f+x*v,t[4]=(A=r[4])*n+(_=r[5])*s+(b=r[6])*h+(x=r[7])*g,t[5]=A*i+_*u+b*p+x*m,t[6]=A*o+_*c+b*d+x*y,t[7]=A*a+_*l+b*f+x*v,t[8]=(A=r[8])*n+(_=r[9])*s+(b=r[10])*h+(x=r[11])*g,t[9]=A*i+_*u+b*p+x*m,t[10]=A*o+_*c+b*d+x*y,t[11]=A*a+_*l+b*f+x*v,t[12]=(A=r[12])*n+(_=r[13])*s+(b=r[14])*h+(x=r[15])*g,t[13]=A*i+_*u+b*p+x*m,t[14]=A*o+_*c+b*d+x*y,t[15]=A*a+_*l+b*f+x*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var sa,ua=aa;function ca(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}sa=new ia(3),ia!=Float32Array&&(sa[0]=0,sa[1]=0,sa[2]=0),function(){var t=new ia(4);ia!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var la=(function(){var t=new ia(2);ia!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,na)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Uo(t)},e.prototype.queryRadius=function(t){var e=t;return $o("circle-radius",this,e)+$o("circle-stroke-width",this,e)+ta(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=ea(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),l="map"===this.paint.get("circle-pitch-alignment"),h=l?u:function(t,e){return t.map((function(t){return ha(t,e)}))}(u,s),p=l?c*a:c,d=0,f=n;dt.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u80*r){n=o=t[0],i=a=t[1];for(var f=r;fo&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-n,a-i))?1/c:0}return Ta(p,d,r,n,i,c),d}function Ma(t,e,r,n,i){var o,a;if(i===Ka(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Ya(o,t[o],t[o+1],a);return a&&Ga(a,a.next)&&(Xa(a),a=a.next),a}function Sa(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Ga(n,n.next)&&0!==Ua(n.prev,n,n.next))n=n.next;else{if(Xa(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Ta(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Na(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Oa(t,n,i,o):Pa(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Xa(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?Ta(t=La(Sa(t),e,r),e,r,n,i,o,2):2===a&&ka(t,e,r,n,i,o):Ta(Sa(t),e,r,n,i,o,1);break}}}function Pa(t){var e=t.prev,r=t,n=t.next;if(Ua(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(ja(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Ua(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Oa(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Ua(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,c=Na(i.x=c&&p&&p.z<=l;){if(h!==t.prev&&h!==t.next&&ja(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Ua(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&ja(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ua(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;h&&h.z>=c;){if(h!==t.prev&&h!==t.next&&ja(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Ua(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=l;){if(p!==t.prev&&p!==t.next&&ja(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ua(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function La(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Ga(i,o)&&Ha(i,n,n.next,o)&&qa(i,o)&&qa(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Xa(n),Xa(n.next),n=t=o),n=n.next}while(n!==t);return Sa(n)}function ka(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&za(a,s)){var u=Wa(a,s);return a=Sa(a,a.next),u=Sa(u,u.next),Ta(a,e,r,n,i,o),void Ta(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function Ra(t,e){return t.x-e.x}function Da(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&&ja(or.x||n.x===r.x&&Ba(r,n)))&&(r=n,p=u)),n=n.next}while(n!==c);return r}(t,e)){var r=Wa(e,t);Sa(e,e.next),Sa(r,r.next)}}function Ba(t,e){return Ua(t.prev,t,e.prev)<0&&Ua(e.next,t,t.next)<0}function Na(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Fa(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function za(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Ha(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(qa(t,e)&&qa(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Ua(t.prev,t,e.prev)||Ua(t,e.prev,e))||Ga(t,e)&&Ua(t.prev,t,t.next)>0&&Ua(e.prev,e,e.next)>0)}function Ua(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Ga(t,e){return t.x===e.x&&t.y===e.y}function Ha(t,e,r,n){var i=Qa(Ua(t,e,r)),o=Qa(Ua(t,e,n)),a=Qa(Ua(r,n,t)),s=Qa(Ua(r,n,e));return i!==o&&a!==s||!(0!==i||!Va(t,r,e))||!(0!==o||!Va(t,n,e))||!(0!==a||!Va(r,t,n))||!(0!==s||!Va(r,e,n))}function Va(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Qa(t){return t>0?1:t<0?-1:0}function qa(t,e){return Ua(t.prev,t,t.next)<0?Ua(t,e,t.next)>=0&&Ua(t,t.prev,e)>=0:Ua(t,e,t.prev)<0||Ua(t,t.next,e)<0}function Wa(t,e){var r=new Za(t.i,t.x,t.y),n=new Za(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Ya(t,e,r,n){var i=new Za(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Xa(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Za(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ka(t,e,r,n){for(var i=0,o=e,a=r-n;on;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*c/a+l)),Math.min(i,Math.floor(r+(a-s)*c/a+l)),o)}var h=e[r],p=n,d=i;for($a(e,n,r),o(e[i],h)>0&&$a(e,n,i);p0;)d--}0===o(e[n],h)?$a(e,n,d):$a(e,++d,i),d<=r&&(n=d+1),r<=d&&(i=d-1)}}(t,e,r||0,n||t.length-1,i||ts)}function $a(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function ts(t,e){return te?1:0}function es(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},Ca.default=Ea;var os=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Mi,this.indexArray=new zi,this.indexArray2=new qi,this.programConfigurations=new Ro(t.layers,t.zoom),this.segments=new ao,this.segments2=new ao,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};os.prototype.populate=function(t,e,r){this.hasPattern=ns("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(o--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},hs.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,c]},hs.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),c=hs.types[this.type];function l(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function ys(t,e,r){if(3===t){var n=new fs(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}gs.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new ls(this._pbf,e,this.extent,this._keys,this._values)};var vs={VectorTile:function(t,e){this.layers=t.readFields(ys,{},e)},VectorTileFeature:ls,VectorTileLayer:fs},As=vs.VectorTileFeature.types,_s=Math.pow(2,13);function bs(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*_s)+a,i*_s*2,o*_s*2,Math.round(s))}var xs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ti,this.indexArray=new zi,this.programConfigurations=new Ro(t.layers,t.zoom),this.segments=new ao,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function ws(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}xs.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=ns("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||L.every((function(t){return t.y<0}))||L.every((function(t){return t.y>8192}))))for(var g=0,m=0;m=1){var v=f[m-1];if(!ws(y,v)){h.vertexLength+4>ao.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var A=y.sub(v)._perp()._unit(),_=v.dist(y);g+_>32768&&(g=0),bs(this.layoutVertexArray,y.x,y.y,A.x,A.y,0,0,g),bs(this.layoutVertexArray,y.x,y.y,A.x,A.y,0,1,g),bs(this.layoutVertexArray,v.x,v.y,A.x,A.y,0,0,g+=_),bs(this.layoutVertexArray,v.x,v.y,A.x,A.y,0,1,g);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+u>ao.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===As[t.type]){for(var x=[],w=[],C=h.vertexLength,E=0,I=s;E>3}if(i--,1===n||2===n)o+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new Ps(o,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},ks.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,c]},ks.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),c=ks.types[this.type];function l(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function js(t,e,r){if(3===t){var n=new Bs(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}Ns.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Ls(this._pbf,e,this.extent,this._keys,this._values)};var zs={VectorTile:function(t,e){this.layers=t.readFields(js,{},e)},VectorTileFeature:Ls,VectorTileLayer:Bs},Us=Math.cos(Math.PI/180*37.5),Gs=Math.pow(2,14)/.5,Hs=function(t,e){var r=this;this.projection=e,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){r.gradients[t.id]={}})),this.layoutVertexArray=new Pi,this.layoutVertexArray2=new Oi,this.indexArray=new zi,this.programConfigurations=new Ro(t.layers,t.zoom),this.segments=new ao,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Hs.prototype.populate=function(t,e,r){this.hasPattern=ns("line",this.layers,e);for(var n=this.layers[0].layout.get("line-sort-key"),i=[],o=0,a=t;o=2&&t[u-1].equals(t[u-2]);)u--;for(var c=0;c0;if(w&&y>c){var E=l.dist(d);if(E>2*h){var I=l.sub(l.sub(d)._mult(h/E)._round());this.updateDistance(d,I),this.addCurrentVertex(I,g,0,0,p),d=I}}var M=d&&f,S=M?r:s?"butt":n;if(M&&"round"===S&&(bi&&(S="bevel"),"bevel"===S&&(b>2&&(S="flipbevel"),b100)v=m.mult(-1);else{var T=b*g.add(m).mag()/g.sub(m).mag();v._perp()._mult(T*(C?-1:1))}this.addCurrentVertex(l,v,0,0,p),this.addCurrentVertex(l,v.mult(-1),0,0,p)}else if("bevel"===S||"fakeround"===S){var P=-Math.sqrt(b*b-1),O=C?P:0,L=C?0:P;if(d&&this.addCurrentVertex(l,g,O,L,p),"fakeround"===S)for(var k=Math.round(180*x/Math.PI/20),R=1;R2*h){var z=l.add(f.sub(l)._mult(h/j)._round());this.updateDistance(l,z),this.addCurrentVertex(z,m,0,0,p),l=z}}}}},Hs.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>Gs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Hs.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Gs-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Hs.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Hs.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Nn("LineBucket",Hs,{omit:["layers","patternFeatures"]});var Vs=new _i({"line-cap":new gi(St.layout_line["line-cap"]),"line-join":new mi(St.layout_line["line-join"]),"line-miter-limit":new gi(St.layout_line["line-miter-limit"]),"line-round-limit":new gi(St.layout_line["line-round-limit"]),"line-sort-key":new mi(St.layout_line["line-sort-key"])}),Qs={paint:new _i({"line-opacity":new mi(St.paint_line["line-opacity"]),"line-color":new mi(St.paint_line["line-color"]),"line-translate":new gi(St.paint_line["line-translate"]),"line-translate-anchor":new gi(St.paint_line["line-translate-anchor"]),"line-width":new mi(St.paint_line["line-width"]),"line-gap-width":new mi(St.paint_line["line-gap-width"]),"line-offset":new mi(St.paint_line["line-offset"]),"line-blur":new mi(St.paint_line["line-blur"]),"line-dasharray":new vi(St.paint_line["line-dasharray"]),"line-pattern":new yi(St.paint_line["line-pattern"]),"line-gradient":new Ai(St.paint_line["line-gradient"])}),layout:Vs},qs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new ai(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=p({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(mi))(Qs.paint.properties["line-width"].specification);qs.useIntegerZoom=!0;var Ws=function(t){function e(e){t.call(this,e,Qs),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ge,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=qs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Hs(t)},e.prototype.queryRadius=function(t){var e=t,r=Ys($o("line-width",this,e),$o("line-gap-width",this,e)),n=$o("line-offset",this,e);return r/2+Math.abs(n)+ta(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,o,a,s){var u=ea(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*Ys(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(n=function(t,e){for(var r=[],n=new i(0,0),o=0;o=3)for(var o=0;o0?e+2*t:t}var Xs=Ei([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Zs=Ei([{name:"a_projected_pos",components:3,type:"Float32"}],4),Ks=(Ei([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ei([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Js=(Ei([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ei([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),$s=Ei([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function tu(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),oi.applyArabicShaping&&(t=oi.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ei([{name:"triangle",components:3,type:"Uint16"}]),Ei([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ei([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ei([{type:"Float32",name:"offsetX"}]),Ei([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var eu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},ru=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,h=r?i-1:0,p=r?-1:1,d=t[e+h];for(h+=p,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=p,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+h],h+=p,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},nu=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=f,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=f,a/=256,c-=8);t[r+d-f]|=128*g},iu=ou;function ou(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ou.Varint=0,ou.Fixed64=1,ou.Bytes=2,ou.Fixed32=5;var au="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function su(t){return t.type===ou.Bytes?t.readVarint()+t.pos:t.pos+1}function uu(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function cu(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function lu(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function bu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function xu(t,e,r){1===t&&r.readMessage(wu,e)}function wu(t,e,r){if(3===t){var n=r.readMessage(Cu,{}),i=n.width,o=n.height,a=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new ma({width:i+6,height:o+6},n.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function Cu(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function Eu(t){for(var e=0,r=0,n=0,i=t;n=0;p--){var d=a[p];if(!(h.w>d.w||h.h>d.h)){if(h.x=d.x,h.y=d.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===d.w&&h.h===d.h){var f=a.pop();p>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Au(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=bu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Au(this.buf,this.pos)+4294967296*Au(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Au(this.buf,this.pos)+4294967296*bu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=ru(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ru(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return uu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return uu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return uu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return uu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return uu(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return uu(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&au?function(t,e,r){return au.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==ou.Bytes)return t.push(this.readVarint(e));var r=su(this);for(t=t||[];this.pos127;);else if(e===ou.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ou.Fixed32)this.pos+=4;else{if(e!==ou.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&cu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),nu(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),nu(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&cu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ou.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,lu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,hu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,fu,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,pu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,du,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,gu,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,mu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,yu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,vu,e)},writeBytesField:function(t,e){this.writeTag(t,ou.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ou.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ou.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ou.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ou.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ou.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ou.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ou.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ou.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ou.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Iu=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},Mu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Mu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Mu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Mu.tlbr.get=function(){return this.tl.concat(this.br)},Mu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Iu.prototype,Mu);var Su=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=Eu(i),a=new ya({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],c=r[s].paddedRect;ya.copy(u.data,a,{x:0,y:0},{x:c.x+1,y:c.y+1},u.data)}for(var l in e){var h=e[l],p=n[l].paddedRect,d=p.x+1,f=p.y+1,g=h.data.width,m=h.data.height;ya.copy(h.data,a,{x:0,y:0},{x:d,y:f},h.data),ya.copy(h.data,a,{x:0,y:m-1},{x:d,y:f-1},{width:g,height:1}),ya.copy(h.data,a,{x:0,y:0},{x:d,y:f+m},{width:g,height:1}),ya.copy(h.data,a,{x:g-1,y:0},{x:d-1,y:f},{width:1,height:m}),ya.copy(h.data,a,{x:0,y:0},{x:d+g,y:f},{width:1,height:m})}this.image=a,this.iconPositions=r,this.patternPositions=n};Su.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new Iu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},Su.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},Su.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]})}},Nn("ImagePosition",Iu),Nn("ImageAtlas",Su);var Tu={horizontal:1,vertical:2,horizontalOnly:3},Pu=function(){this.scale=1,this.fontStack="",this.imageName=null};Pu.forText=function(t,e){var r=new Pu;return r.scale=t||1,r.fontStack=e,r},Pu.forImage=function(t){var e=new Pu;return e.imageName=t,e};var Ou=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Lu(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g){var m,y=Ou.fromFeature(t,i);h===Tu.vertical&&y.verticalizePunctuation();var v=oi.processBidirectionalText,A=oi.processStyledBidirectionalText;if(v&&1===y.sections.length){m=[];for(var _=0,b=v(y.toString(),ju(y,c,o,e,n,d,f));_0&&F>E&&(E=F)}else{var j=r[M.fontStack],z=j&&j[T];if(z&&z.rect)L=z.rect,O=z.metrics;else{var U=e[M.fontStack],G=U&&U[T];if(!G)continue;O=G.metrics}P=24*(b-M.scale)}D?(t.verticalizable=!0,C.push({glyph:T,imageName:k,x:p,y:d+P,vertical:D,scale:M.scale,fontStack:M.fontStack,sectionIndex:S,metrics:O,rect:L}),p+=R*M.scale+c):(C.push({glyph:T,imageName:k,x:p,y:d+P,vertical:D,scale:M.scale,fontStack:M.fontStack,sectionIndex:S,metrics:O,rect:L}),p+=O.advance*M.scale+c)}0!==C.length&&(f=Math.max(p-c,f),Uu(C,0,C.length-1,m,E)),p=0;var H=o*b+E;w.lineOffset=Math.max(E,x),d+=H,g=Math.max(H,g),++y}else d+=o,++y}var V,Q=d- -17,q=zu(a),W=q.horizontalAlign,Y=q.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var c,l=(e-r)*i;c=o!==a?-s*n- -17:(-n*u+.5)*a;for(var h=0,p=t;h=0&&n>=t&&ku[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},Ou.prototype.substring=function(t,e){var r=new Ou;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Ou.prototype.toString=function(){return this.text},Ou.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Ou.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Pu.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var ku={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ru={};function Du(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Bu(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,h=0,p=0;p-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],c=0;sn;)c-=u.shift().angleDelta;if(c>i)return!1;a++,s+=l.dist(h)}return!0}function Xu(t){for(var e=0,r=0;rc){var f=(c-u)/d,g=He(h.x,p.x,f),m=He(h.y,p.y,f),y=new Hu(g,m,p.angleTo(h),l);return y._round(),!a||Yu(t,y,s,a,e)?y:void 0}u+=d}}function $u(t,e,r,n,i,o,a,s,u){var c=Zu(n,o,a),l=Ku(n,i),h=l*a,p=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h=0&&b=0&&x=0&&d+l<=h){var w=new Hu(b,x,A,g);w._round(),i&&!Yu(e,w,a,i,o)||f.push(w)}}p+=v}return u||f.length||s||(f=t(e,p/2,n,i,o,a,s,!0,c)),f}(t,p?e/2*s%e:(l/2+2*o)*a*s%e,e,c,r,h,p,!1,u)}function tc(t,e,r,n,o){for(var a=[],s=0;s=n&&p.x>=n||(h.x>=n?h=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x>=n&&(p=new i(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y>=o&&p.y>=o||(h.y>=o?h=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round():p.y>=o&&(p=new i(h.x+(o-h.y)/(p.y-h.y)*(p.x-h.x),o)._round()),c&&h.equals(c[c.length-1])||a.push(c=[h]),c.push(p)))))}return a}function ec(t,e,r,n){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,c=a.paddedRect.h-2,l=t.right-t.left,h=t.bottom-t.top,p=a.stretchX||[[0,u]],d=a.stretchY||[[0,c]],f=function(t,e){return t+e[1]-e[0]},g=p.reduce(f,0),m=d.reduce(f,0),y=u-g,v=c-m,A=0,_=g,b=0,x=m,w=0,C=y,E=0,I=v;if(a.content&&n){var M=a.content;A=rc(p,0,M[0]),b=rc(d,0,M[1]),_=rc(p,M[0],M[2]),x=rc(d,M[1],M[3]),w=M[0]-A,E=M[1]-b,C=M[2]-M[0]-_,I=M[3]-M[1]-x}var S=function(n,o,u,c){var p=ic(n.stretch-A,_,l,t.left),d=oc(n.fixed-w,C,n.stretch,g),f=ic(o.stretch-b,x,h,t.top),y=oc(o.fixed-E,I,o.stretch,m),v=ic(u.stretch-A,_,l,t.left),M=oc(u.fixed-w,C,u.stretch,g),S=ic(c.stretch-b,x,h,t.top),T=oc(c.fixed-E,I,c.stretch,m),P=new i(p,f),O=new i(v,f),L=new i(v,S),k=new i(p,S),R=new i(d/s,y/s),D=new i(M/s,T/s),B=e*Math.PI/180;if(B){var N=Math.sin(B),F=Math.cos(B),j=[F,-N,N,F];P._matMult(j),O._matMult(j),k._matMult(j),L._matMult(j)}var z=n.stretch+n.fixed,U=o.stretch+o.fixed;return{tl:P,tr:O,bl:k,br:L,tex:{x:a.paddedRect.x+1+z,y:a.paddedRect.y+1+U,w:u.stretch+u.fixed-z,h:c.stretch+c.fixed-U},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:D,minFontScaleX:C/s/l,minFontScaleY:I/s/h,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var T=nc(p,y,g),P=nc(d,v,m),O=0;O0&&(f=Math.max(10,f),this.circleDiameter=f)}else{var g=a.top*s-u,m=a.bottom*s+u,y=a.left*s-u,v=a.right*s+u,A=a.collisionPadding;if(A&&(y-=A[0]*s,g-=A[1]*s,v+=A[2]*s,m+=A[3]*s),l){var _=new i(y,g),b=new i(v,g),x=new i(y,m),w=new i(v,m),C=l*Math.PI/180;_._rotate(C),b._rotate(C),x._rotate(C),w._rotate(C),y=Math.min(_.x,b.x,x.x,w.x),v=Math.max(_.x,b.x,x.x,w.x),g=Math.min(_.y,b.y,x.y,w.y),m=Math.max(_.y,b.y,x.y,w.y)}t.emplaceBack(e.x,e.y,y,g,v,m,r,n,o)}this.boxEndIndex=t.length},sc=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=uc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function uc(t,e){return te?1:0}function cc(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],c=0;ca)&&(a=l.x),(!c||l.y>s)&&(s=l.y)}var h=Math.min(a-n,s-o),p=h/2,d=new sc([],lc);if(0===h)return new i(n,o);for(var f=n;fm.d||!m.d)&&(m=v,r&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,y)),v.max-m.d<=e||(d.push(new hc(v.p.x-(p=v.h/2),v.p.y-p,p,t)),d.push(new hc(v.p.x+p,v.p.y-p,p,t)),d.push(new hc(v.p.x-p,v.p.y+p,p,t)),d.push(new hc(v.p.x+p,v.p.y+p,p,t)),y+=4)}return r&&(console.log("num probes: "+y),console.log("best distance: "+m.d)),m.p}function lc(t,e){return e.max-t.max}function hc(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=l.y>t.y&&t.x<(l.x-c.x)*(t.y-c.y)/(l.y-c.y)+c.x&&(r=!r),n=Math.min(n,Xo(t,c,l))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}sc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},sc.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},sc.prototype.peek=function(){return this.data[0]},sc.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},sc.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var pc=Number.POSITIVE_INFINITY;function dc(t,e){return e[1]!==pc?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function fc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function gc(t,e,r,n,o,a,s,u,c,l,h,p,d,f,g){var m=function(t,e,r,n,o,a,s,u){for(var c=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,l=[],h=0,p=e.positionedLines;h32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===y.kind&&((v=[128*f.compositeTextSizes[0].evaluate(s,{},g),128*f.compositeTextSizes[1].evaluate(s,{},g)])[0]>32640||v[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,v,u,a,s,l,e,c.lineStartIndex,c.lineLength,d,g);for(var A=0,_=h;A<_.length;A+=1)p[_[A]]=t.text.placedSymbolArray.length-1;return 4*m.length}function mc(t){for(var e in t)return t[e];return null}function yc(t,e,r,n){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,l=i.get("symbol-sort-key");if(this.features=[],u||c){for(var h=e.iconDependencies,p=e.glyphDependencies,d=e.availableImages,f=new ai(this.zoom),g=0,m=t;g=0;for(var R=0,D=C.sections;R=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u0},Cc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Cc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Cc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Cc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Cc.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Nn("SymbolBucket",Cc,{omit:["layers","collisionBoxArray","features","compareText"]}),Cc.MAX_GLYPHS=65535,Cc.addDynamicAttributes=_c;var Ec=new _i({"symbol-placement":new gi(St.layout_symbol["symbol-placement"]),"symbol-spacing":new gi(St.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new gi(St.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new mi(St.layout_symbol["symbol-sort-key"]),"symbol-z-order":new gi(St.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new gi(St.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new gi(St.layout_symbol["icon-ignore-placement"]),"icon-optional":new gi(St.layout_symbol["icon-optional"]),"icon-rotation-alignment":new gi(St.layout_symbol["icon-rotation-alignment"]),"icon-size":new mi(St.layout_symbol["icon-size"]),"icon-text-fit":new gi(St.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new gi(St.layout_symbol["icon-text-fit-padding"]),"icon-image":new mi(St.layout_symbol["icon-image"]),"icon-rotate":new mi(St.layout_symbol["icon-rotate"]),"icon-padding":new gi(St.layout_symbol["icon-padding"]),"icon-keep-upright":new gi(St.layout_symbol["icon-keep-upright"]),"icon-offset":new mi(St.layout_symbol["icon-offset"]),"icon-anchor":new mi(St.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new gi(St.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new gi(St.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new gi(St.layout_symbol["text-rotation-alignment"]),"text-field":new mi(St.layout_symbol["text-field"]),"text-font":new mi(St.layout_symbol["text-font"]),"text-size":new mi(St.layout_symbol["text-size"]),"text-max-width":new mi(St.layout_symbol["text-max-width"]),"text-line-height":new gi(St.layout_symbol["text-line-height"]),"text-letter-spacing":new mi(St.layout_symbol["text-letter-spacing"]),"text-justify":new mi(St.layout_symbol["text-justify"]),"text-radial-offset":new mi(St.layout_symbol["text-radial-offset"]),"text-variable-anchor":new gi(St.layout_symbol["text-variable-anchor"]),"text-anchor":new mi(St.layout_symbol["text-anchor"]),"text-max-angle":new gi(St.layout_symbol["text-max-angle"]),"text-writing-mode":new gi(St.layout_symbol["text-writing-mode"]),"text-rotate":new mi(St.layout_symbol["text-rotate"]),"text-padding":new gi(St.layout_symbol["text-padding"]),"text-keep-upright":new gi(St.layout_symbol["text-keep-upright"]),"text-transform":new mi(St.layout_symbol["text-transform"]),"text-offset":new mi(St.layout_symbol["text-offset"]),"text-allow-overlap":new gi(St.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new gi(St.layout_symbol["text-ignore-placement"]),"text-optional":new gi(St.layout_symbol["text-optional"])}),Ic={paint:new _i({"icon-opacity":new mi(St.paint_symbol["icon-opacity"]),"icon-color":new mi(St.paint_symbol["icon-color"]),"icon-halo-color":new mi(St.paint_symbol["icon-halo-color"]),"icon-halo-width":new mi(St.paint_symbol["icon-halo-width"]),"icon-halo-blur":new mi(St.paint_symbol["icon-halo-blur"]),"icon-translate":new gi(St.paint_symbol["icon-translate"]),"icon-translate-anchor":new gi(St.paint_symbol["icon-translate-anchor"]),"text-opacity":new mi(St.paint_symbol["text-opacity"]),"text-color":new mi(St.paint_symbol["text-color"],{runtimeType:zt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new mi(St.paint_symbol["text-halo-color"]),"text-halo-width":new mi(St.paint_symbol["text-halo-width"]),"text-halo-blur":new mi(St.paint_symbol["text-halo-blur"]),"text-translate":new gi(St.paint_symbol["text-translate"]),"text-translate-anchor":new gi(St.paint_symbol["text-translate-anchor"])}),layout:Ec},Mc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Bt,this.defaultValue=t};Mc.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Mc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Mc.prototype.outputDefined=function(){return!1},Mc.prototype.serialize=function(){return null},Nn("FormatSectionOverride",Mc,{omit:["defaultValue"]});var Sc=function(t){function e(e,r){void 0===r&&(r="EPSG:3857"),t.call(this,e,Ic),this.projection=r}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;o",targetMapId:n,sourceMapId:o.mapId})}}},Gc.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else I()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Gc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Gc.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Gn(e.error)):n(null,Gn(e.data)))}else{var i=!1,o=T(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?Un(e):null,data:Un(n,o)},o)}:function(t){i=!0},s=null,u=Gn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],u.source)[c[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Gc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var qc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};qc.prototype.setNorthEast=function(t){return this._ne=t instanceof Wc?new Wc(t.lng,t.lat):Wc.convert(t),this},qc.prototype.setSouthWest=function(t){return this._sw=t instanceof Wc?new Wc(t.lng,t.lat):Wc.convert(t),this},qc.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Wc)e=t,r=t;else{if(!(t instanceof qc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(qc.convert(t)):this.extend(Wc.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Wc(e.lng,e.lat),this._ne=new Wc(r.lng,r.lat)),this},qc.prototype.getCenter=function(){return new Wc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},qc.prototype.getSouthWest=function(){return this._sw},qc.prototype.getNorthEast=function(){return this._ne},qc.prototype.getNorthWest=function(){return new Wc(this.getWest(),this.getNorth())},qc.prototype.getSouthEast=function(){return new Wc(this.getEast(),this.getSouth())},qc.prototype.getWest=function(){return this._sw.lng},qc.prototype.getSouth=function(){return this._sw.lat},qc.prototype.getEast=function(){return this._ne.lng},qc.prototype.getNorth=function(){return this._ne.lat},qc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},qc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},qc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},qc.prototype.contains=function(t){var e=Wc.convert(t),r=e.lng,n=e.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},qc.convert=function(t){return!t||t instanceof qc?t:new qc(t)};var Wc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Wc.prototype.wrap=function(){return new Wc(h(this.lng,-180,180),this.lat)},Wc.prototype.toArray=function(){return[this.lng,this.lat]},Wc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Wc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},Wc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new qc(new Wc(this.lng-r,this.lat-e),new Wc(this.lng+r,this.lat+e))},Wc.convert=function(t){if(t instanceof Wc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Wc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Wc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var Yc=2*Math.PI*6371008.8;function Xc(t){return Yc*Math.cos(t*Math.PI/180)}function Zc(t){return(180+t)/360}function Kc(t,e){return void 0===e&&(e="EPSG:3857"),"EPSG:3857"===e?(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360:(90-t)/360}function Jc(t,e){return t/Xc(e)}function $c(t,e){return void 0===e&&(e="EPSG:3857"),"EPSG:3857"===e?360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90:l(90-360*t,-90,90)}var tl=function(t,e,r,n){void 0===r&&(r=0),void 0===n&&(n="EPSG:3857"),this.x=+t,this.y=+e,this.z=+r,this.projection=n};tl.fromLngLat=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r="EPSG:3857");var n=Wc.convert(t);return new tl(Zc(n.lng),Kc(n.lat,r),Jc(e,n.lat),r)},tl.prototype.toLngLat=function(){return new Wc(360*this.x-180,$c(this.y,this.projection))},tl.prototype.toAltitude=function(){return void 0===(t=this.projection)&&(t="EPSG:3857"),this.z*Xc($c(this.y,t));var t},tl.prototype.meterInMercatorCoordinateUnits=function(){return 1/Yc*(t=$c(this.y,this.projection),1/Math.cos(t*Math.PI/180));var t};var el=function(t,e,r,n){void 0===n&&(n="EPSG:3857"),this.z=t,this.x=e,this.y=r,this.projection=n,this.key=il(0,t,t,e,r)};el.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},el.prototype.url=function(t,e,r){var n=("EPSG:3857"===this.projection?Hc:Qc)(this.x,this.y,this.z),i=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<this.canonical.z?new nl(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y,this.projection):new nl(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e,this.projection)},nl.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?il(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):il(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},nl.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},nl.prototype.children=function(t){if(this.overscaledZ>=t)return[new nl(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y,this.projection)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new nl(e,this.wrap,e,r,n,this.projection),new nl(e,this.wrap,e,r+1,n,this.projection),new nl(e,this.wrap,e,r,n+1,this.projection),new nl(e,this.wrap,e,r+1,n+1,this.projection)]},nl.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},ol.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},ol.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},ol.prototype.getPixels=function(){return new ya({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},ol.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,c=o;c=0&&l[3]>=0&&s.insert(a,l[0],l[1],l[2],l[3])}},ll.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new("EPSG:3857"===this.projection?vs:zs).VectorTile(new iu(this.rawTileData)).layers,this.sourceLayerCoder=new al(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ll.prototype.query=function(t,e,r,n){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=on(a.filter),c=t.queryGeometry,l=t.queryPadding*s,h=pl(c),p=this.grid.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l),d=pl(t.cameraQueryGeometry),f=0,g=this.grid3D.query(d.minX-l,d.minY-l,d.maxX+l,d.maxY+l,(function(e,r,n,o){return function(t,e,r,n,o){for(var a=0,s=t;a=u.x&&o>=u.y)return!0}var c=[new i(e,r),new i(e,o),new i(n,o),new i(n,r)];if(t.length>2)for(var l=0,h=c;l=0)return!0;return!1}(o,h)){var p=this.sourceLayerCoder.decode(r),d=this.vtLayers[p].feature(n);if(i.filter(new ai(this.tileID.overscaledZ),d))for(var f=this.getId(d,p),g=0;gn)i=!1;else if(e)if(this.expirationTimeut&&(t.getActor().send("enforceCacheSizeLimit",st),pt=0)},t.cgcs2000Mvt=zs,t.clamp=l,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=tc,t.clone=function(t){var e=new ia(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new ia(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=$s,t.config=j,t.create=function(){var t=new ia(16);return ia!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new ia(9);return ia!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new ia(4);return ia!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Qr,t.createLayout=Ei,t.createStyleLayer=function(t,e){return"custom"===t.type?new kc(t,e):new Rc[t.type](t,e)},t.cross=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var n=0;n0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=He,t.offscreenCanvasSupported=dt,t.ortho=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new iu(t).readFields(xu,[])},t.pbf=iu,t.performSymbolLayout=function(t,e,r,n,i,o,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var l=t.textSizeData,h=l.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new ai(l.minZoom),a),u["text-size"].possiblyEvaluate(new ai(h),a)]}if("composite"===t.iconSizeData.kind){var p=t.iconSizeData,d=p.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new ai(p.minZoom),a),u["icon-size"].possiblyEvaluate(new ai(d),a)]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new ai(t.zoom+1),a),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new ai(t.zoom+1),a),c.textMaxSize=u["text-size"].possiblyEvaluate(new ai(18));for(var f=24*s.get("text-line-height"),g="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),m=s.get("text-keep-upright"),y=s.get("text-size"),v=function(){var o=_[A],u=s.get("text-font").evaluate(o,{},a).join(","),l=y.evaluate(o,{},a),h=c.layoutTextSize.evaluate(o,{},a),p=c.layoutIconSize.evaluate(o,{},a),d={horizontal:{},vertical:void 0},v=o.text,b=[0,0];if(v){var x=v.toString(),C=24*s.get("text-letter-spacing").evaluate(o,{},a),E=function(t){for(var e=0,r=t;e=8192||h.y<0||h.y>=8192||function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,C,E){var I,M,S,T,P,O=t.addToLineVertexArray(e,r),L=0,k=0,R=0,D=0,B=-1,N=-1,F={},j=ho(""),z=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(z=(I=s.layout.get("text-offset").evaluate(_,{},C).map((function(t){return 24*t})))[0],U=I[1]):(z=24*s.layout.get("text-radial-offset").evaluate(_,{},C),U=pc),t.allowVerticalPlacement&&n.vertical){var G=s.layout.get("text-rotate").evaluate(_,{},C)+90;T=new ac(u,e,c,l,h,n.vertical,p,d,f,G),a&&(P=new ac(u,e,c,l,h,a,m,y,f,G))}if(i){var H=s.layout.get("icon-rotate").evaluate(_,{}),V="none"!==s.layout.get("icon-text-fit"),Q=ec(i,H,x,V),q=a?ec(a,H,x,V):void 0;S=new ac(u,e,c,l,h,i,m,y,!1,H),L=4*Q.length;var W=t.iconSizeData,Y=null;"source"===W.kind?(Y=[128*s.layout.get("icon-size").evaluate(_,{})])[0]>32640&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===W.kind&&((Y=[128*b.compositeIconSizes[0].evaluate(_,{},C),128*b.compositeIconSizes[1].evaluate(_,{},C)])[0]>32640||Y[1]>32640)&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,Q,Y,A,v,_,!1,e,O.lineStartIndex,O.lineLength,-1,C),B=t.icon.placedSymbolArray.length-1,q&&(k=4*q.length,t.addSymbols(t.icon,q,Y,A,v,_,Tu.vertical,e,O.lineStartIndex,O.lineLength,-1,C),N=t.icon.placedSymbolArray.length-1)}for(var X in n.horizontal){var Z=n.horizontal[X];if(!M){j=ho(Z.text);var K=s.layout.get("text-rotate").evaluate(_,{},C);M=new ac(u,e,c,l,h,Z,p,d,f,K)}var J=1===Z.positionedLines.length;if(R+=gc(t,e,Z,o,s,f,_,g,O,n.vertical?Tu.horizontal:Tu.horizontalOnly,J?Object.keys(n.horizontal):[X],F,B,b,C),J)break}n.vertical&&(D+=gc(t,e,n.vertical,o,s,f,_,g,O,Tu.vertical,["vertical"],F,N,b,C));var $=M?M.boxStartIndex:t.collisionBoxArray.length,tt=M?M.boxEndIndex:t.collisionBoxArray.length,et=T?T.boxStartIndex:t.collisionBoxArray.length,rt=T?T.boxEndIndex:t.collisionBoxArray.length,nt=S?S.boxStartIndex:t.collisionBoxArray.length,it=S?S.boxEndIndex:t.collisionBoxArray.length,ot=P?P.boxStartIndex:t.collisionBoxArray.length,at=P?P.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(M,st),st=ut(T,st),st=ut(S,st);var ct=(st=ut(P,st))>-1?1:0;ct&&(st*=E/24),t.glyphOffsetArray.length>=Cc.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,B,N,j,$,tt,et,rt,nt,it,ot,at,c,R,D,L,k,ct,0,p,z,U,st)}(t,h,s,r,n,i,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,b,E,u,A,x,I,f,e,o,c,l,a)};if("line"===M)for(var O=0,L=tc(e.geometry,0,0,8192,8192);O1){var z=Ju(j,C,r.vertical||g,n,24,v);z&&P(j,z)}}else if("Polygon"===e.type)for(var U=0,G=es(e.geometry,0);U=S.maxzoom||"none"!==S.visibility&&(a(M,this.zoom,n),(g[S.id]=S.createBucket({index:l.bucketLayerIDs.length,layers:M,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,m,this.tileID.canonical),l.bucketLayerIDs.push(M.map((function(t){return t.id}))))}}}var T=t.mapObject(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(T).length?o.send("getGlyphs",{uid:this.uid,stacks:T},(function(t,e){h||(h=t,p=e,L.call(u))})):p={};var P=Object.keys(m.iconDependencies);P.length?o.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,d=e,L.call(u))})):d={};var O=Object.keys(m.patternDependencies);function L(){if(h)return s(h);if(p&&d&&f){var e=new i(p),r=new t.ImageAtlas(d,f);for(var o in g){var u=g[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,n),t.performSymbolLayout(u,p,e.positions,d,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,n),u.addFeatures(m,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:t.values(g).filter((function(t){return!t.isEmpty()})),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?e.positions:null})}}O.length?o.send("getImages",{icons:O,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,f=e,L.call(u))})):f={},L.call(this)};var u=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};u.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete n.loading[i],e||!o)return s.status="done",n.loaded[i]=s,r(e);var u=o.rawData,c={};o.expires&&(c.expires=o.expires),o.cacheControl&&(c.cacheControl=o.cacheControl);var l={};if(a){var h=a.finish();h&&(l.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:u.slice(0)},n,c,l))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},u.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},u.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var c=t.window.ImageBitmap,l=function(){this.loaded={}};function h(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r=0!=!!e&&t.reverse()}l.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,o=e.rawImageData,a=c&&o instanceof c?this.getImageData(o):o,s=new t.DEMData(n,a,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},l.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},l.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var d=function(e,r){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,this.projection=r,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function M(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*l/s+h)),Math.min(o,Math.floor(n+(s-u)*l/s+h)),a)}var p=r[2*n+a],d=i,f=o;for(T(e,r,i,n),r[2*o+a]>p&&T(e,r,i,o);dp;)f--}r[2*i+a]===p?T(e,r,i,f):T(e,r,++f,o),f<=n&&(i=f+1),n<=f&&(o=f-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};R.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,c=[0,t.length-1,0],l=[];c.length;){var h=c.pop(),p=c.pop(),d=c.pop();if(p-d<=a)for(var f=d;f<=p;f++)u=e[2*f+1],(s=e[2*f])>=r&&s<=i&&u>=n&&u<=o&&l.push(t[f]);else{var g=Math.floor((d+p)/2);u=e[2*g+1],(s=e[2*g])>=r&&s<=i&&u>=n&&u<=o&&l.push(t[g]);var m=(h+1)%2;(0===h?r<=s:n<=u)&&(c.push(d),c.push(g-1),c.push(m)),(0===h?i>=s:o>=u)&&(c.push(g+1),c.push(p),c.push(m))}}return l}(this.ids,this.coords,t,e,r,n,this.nodeSize)},R.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var c=a.pop(),l=a.pop(),h=a.pop();if(l-h<=o)for(var p=h;p<=l;p++)O(e[2*p],e[2*p+1],r,n)<=u&&s.push(t[p]);else{var d=Math.floor((h+l)/2),f=e[2*d],g=e[2*d+1];O(f,g,r,n)<=u&&s.push(t[d]);var m=(c+1)%2;(0===c?r-i<=f:n-i<=g)&&(a.push(h),a.push(d-1),a.push(m)),(0===c?r+i>=f:n+i>=g)&&(a.push(d+1),a.push(l),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var D={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},B=function(t){this.options=H(Object.create(D),t),this.trees=new Array(this.options.maxZoom+1)};function N(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function F(t,e){var r=t.geometry.coordinates,n=r[1];return{x:U(r[0]),y:G(n),zoom:1/0,index:e,parentId:-1}}function j(t){return{type:"Feature",id:t.id,properties:z(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function z(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return H(H({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function U(t){return t/360+.5}function G(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function H(t,e){for(var r in e)t[r]=e[r];return t}function V(t){return t.x}function Q(t){return t.y}function q(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function W(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)Y(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*c-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(c-o,2))),i=u,o=c}var l=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,c=e[r],l=e[r+1],h=e[n],p=e[n+1],d=r+3;da)o=d,a=f;else if(f===a){var g=Math.abs(d-s);gi&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,l,r),e[l+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function J(t,e,r,n){for(var i=0;i1?1:r}function et(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],c=0;c=r&&f=n)){var g=[];if("Point"===p||"MultiPoint"===p)rt(h,g,r,n,i);else if("LineString"===p)nt(h,g,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)ot(h,g,r,n,i,!1);else if("Polygon"===p)ot(h,g,r,n,i,!0);else if("MultiPolygon"===p)for(var m=0;m=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function nt(t,e,r,n,i,o,a){for(var s,u,c=it(t),l=0===i?st:ut,h=t.start,p=0;pr&&(u=l(c,d,f,m,y,r),a&&(c.start=h+s*u)):v>n?A=r&&(u=l(c,d,f,m,y,r),_=!0),A>n&&v<=n&&(u=l(c,d,f,m,y,n),_=!0),!o&&_&&(a&&(c.end=h+s*u),e.push(c),c=it(t)),a&&(h+=s)}var b=t.length-3;d=t[b],f=t[b+1],g=t[b+2],(v=0===i?d:f)>=r&&v<=n&&at(c,d,f,g),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&at(c,c[0],c[1],c[2]),c.length&&e.push(c)}function it(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function ot(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=l),h>a.maxY&&(a.maxY=h)}return a}function ft(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var l=+Date.now();s=this._cluster(s,c),this.trees[c]=new R(s,V,Q,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-l)}return r&&console.timeEnd("total time"),this},B.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],c=[],l=0,h=u.range(U(r),G(o),U(i),G(n));le&&(p+=g.numPoints||1)}if(p>=o){for(var m=u.x*h,y=u.y*h,v=i&&h>1?this._map(u,!0):null,A=(s<<5)+(e+1)+this.points.length,_=0,b=l;_1)for(var C=0,E=l;C>5},B.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},B.prototype._map=function(t,e){if(t.numPoints)return e?H({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?H({},n):n},yt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},yt.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,c=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var l=1<1&&console.time("creation"),p=this.tiles[h]=dt(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var f=1<1&&console.time("clipping");var g,m,y,v,A,_,b=.5*u.buffer/u.extent,x=.5-b,w=.5+b,C=1+b;g=m=y=v=null,A=et(t,l,r-b,r+w,0,p.minX,p.maxX,u),_=et(t,l,r+x,r+C,0,p.minX,p.maxX,u),t=null,A&&(g=et(A,l,n-b,n+w,1,p.minY,p.maxY,u),m=et(A,l,n+x,n+C,1,p.minY,p.maxY,u),A=null),_&&(y=et(_,l,n-b,n+w,1,p.minY,p.maxY,u),v=et(_,l,n+x,n+C,1,p.minY,p.maxY,u),_=null),c>1&&console.timeEnd("clipping"),s.push(g||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},yt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,c=t,l=e,h=r;!u&&c>0;)c--,l=Math.floor(l/2),h=Math.floor(h/2),u=this.tiles[vt(c,l,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,l,h),o>1&&console.time("drilling down"),this.splitTile(u.source,c,l,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?ht(this.tiles[s],i):null):null};var xt=function(t){return t[0]},wt=function(t){return t[1]},Ct=function(t,e,r,n,i){void 0===e&&(e=xt),void 0===r&&(r=wt),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new i(2*t.length),u=0;u>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*l/s+h)),Math.min(o,Math.floor(n+(s-u)*l/s+h)),a)}var p=r[2*n+a],d=i,f=o;for(At(e,r,i,n),r[2*o+a]>p&&At(e,r,i,o);dp;)f--}r[2*i+a]===p?At(e,r,i,f):At(e,r,++f,o),f<=n&&(i=f+1),n<=f&&(o=f-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};Ct.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,c=[0,t.length-1,0],l=[];c.length;){var h=c.pop(),p=c.pop(),d=c.pop();if(p-d<=a)for(var f=d;f<=p;f++)u=e[2*f+1],(s=e[2*f])>=r&&s<=i&&u>=n&&u<=o&&l.push(t[f]);else{var g=Math.floor((d+p)/2);u=e[2*g+1],(s=e[2*g])>=r&&s<=i&&u>=n&&u<=o&&l.push(t[g]);var m=(h+1)%2;(0===h?r<=s:n<=u)&&(c.push(d),c.push(g-1),c.push(m)),(0===h?i>=s:o>=u)&&(c.push(g+1),c.push(p),c.push(m))}}return l}(this.ids,this.coords,t,e,r,n,this.nodeSize)},Ct.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var c=a.pop(),l=a.pop(),h=a.pop();if(l-h<=o)for(var p=h;p<=l;p++)bt(e[2*p],e[2*p+1],r,n)<=u&&s.push(t[p]);else{var d=Math.floor((h+l)/2),f=e[2*d],g=e[2*d+1];bt(f,g,r,n)<=u&&s.push(t[d]);var m=(c+1)%2;(0===c?r-i<=f:n-i<=g)&&(a.push(h),a.push(d-1),a.push(m)),(0===c?r+i>=f:n+i>=g)&&(a.push(d+1),a.push(l),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var Et={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},It=function(t){this.options=kt(Object.create(Et),t),this.trees=new Array(this.options.maxZoom+1)};function Mt(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function St(t,e){var r=t.geometry.coordinates,n=r[1];return{x:Ot(r[0]),y:Lt(n),zoom:1/0,index:e,parentId:-1}}function Tt(t){return{type:"Feature",id:t.id,properties:Pt(t),geometry:{type:"Point",coordinates:[(r=t.x,360*(r-.5)),(e=t.y,90-360*e)]}};var e,r}function Pt(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return kt(kt({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function Ot(t){return t/360+.5}function Lt(t){var e=.25-t/360;return e<0?0:e>.5?.5:e}function kt(t,e){for(var r in e)t[r]=e[r];return t}function Rt(t){return t.x}function Dt(t){return t.y}function Bt(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function Nt(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)Ft(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*c-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(c-o,2))),i=u,o=c}var l=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,c=e[r],l=e[r+1],h=e[n],p=e[n+1],d=r+3;da)o=d,a=f;else if(f===a){var g=Math.abs(d-s);gi&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,l,r),e[l+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function Gt(t,e,r,n){for(var i=0;i.5?.5:e}function Qt(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],c=0;c=r&&f=n)){var g=[];if("Point"===p||"MultiPoint"===p)qt(h,g,r,n,i);else if("LineString"===p)Wt(h,g,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)Xt(h,g,r,n,i,!1);else if("Polygon"===p)Xt(h,g,r,n,i,!0);else if("MultiPolygon"===p)for(var m=0;m=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function Wt(t,e,r,n,i,o,a){for(var s,u,c=Yt(t),l=0===i?Kt:Jt,h=t.start,p=0;pr&&(u=l(c,d,f,m,y,r),a&&(c.start=h+s*u)):v>n?A=r&&(u=l(c,d,f,m,y,r),_=!0),A>n&&v<=n&&(u=l(c,d,f,m,y,n),_=!0),!o&&_&&(a&&(c.end=h+s*u),e.push(c),c=Yt(t)),a&&(h+=s)}var b=t.length-3;d=t[b],f=t[b+1],g=t[b+2],(v=0===i?d:f)>=r&&v<=n&&Zt(c,d,f,g),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&Zt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function Yt(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Xt(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=l),h>a.maxY&&(a.maxY=h)}return a}function ie(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var l=+Date.now();s=this._cluster(s,c),this.trees[c]=new Ct(s,Rt,Dt,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-l)}return r&&console.timeEnd("total time"),this},It.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],c=[],l=0,h=u.range(Ot(r),Lt(o),Ot(i),Lt(n));le&&(p+=g.numPoints||1)}if(p>=o){for(var m=u.x*h,y=u.y*h,v=i&&h>1?this._map(u,!0):null,A=(s<<5)+(e+1)+this.points.length,_=0,b=l;_1)for(var C=0,E=l;C>5},It.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},It.prototype._map=function(t,e){if(t.numPoints)return e?kt({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?kt({},n):n},se.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},se.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,c=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var l=1<1&&console.time("creation"),p=this.tiles[h]=ne(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var f=1<1&&console.time("clipping");var g,m,y,v,A,_,b=.5*u.buffer/u.extent,x=.5-b,w=.5+b,C=1+b;g=m=y=v=null,A=Qt(t,l,r-b,r+w,0,p.minX,p.maxX,u),_=Qt(t,l,r+x,r+C,0,p.minX,p.maxX,u),t=null,A&&(g=Qt(A,l,n-b,n+w,1,p.minY,p.maxY,u),m=Qt(A,l,n+x,n+C,1,p.minY,p.maxY,u),A=null),_&&(y=Qt(_,l,n-b,n+w,1,p.minY,p.maxY,u),v=Qt(_,l,n+x,n+C,1,p.minY,p.maxY,u),_=null),c>1&&console.timeEnd("clipping"),s.push(g||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},se.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,c=t,l=e,h=r;!u&&c>0;)c--,l=Math.floor(l/2),h=Math.floor(h/2),u=this.tiles[ue(c,l,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,l,h),o>1&&console.time("drilling down"),this.splitTile(u.source,c,l,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?ee(this.tiles[s],i):null):null};var le=function(e){function r(t,r,n,i){e.call(this,t,r,n,ce),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(o,a){if(o||!a)return r(o);if("object"!=typeof a)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function y(t,e,r,n,i,o,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:i,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],A.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var i=0,a=u;i1&&(s=t[++a]);var c=Math.abs(u-s.left),l=Math.abs(u-s.right),h=Math.min(c,l),p=void 0,d=i/r*(n+1);if(s.isDash){var f=n-Math.abs(d);p=Math.sqrt(h*h+f*f)}else p=n-Math.sqrt(h*h+d*d);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},w.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],c=0;c1&&(u=t[++s]);var l=Math.abs(c-u.left),h=Math.abs(c-u.right),p=Math.min(l,h);this.data[a+c]=Math.max(0,Math.min(255,(u.isDash?p:-p)+128))}},w.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=n&&e.x=i&&e.y0&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),n.projection=this.map.transform.projection,this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),O=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),L=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.projection=i.projection,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,o){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):o&&(n.image=o,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map((function(e,n){return t.MercatorCoordinate.fromLngLat(e,n,r.projection)}));this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,o=-1/0,a=0,s=e;ar.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,O.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(L),R=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,O.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},j.prototype.has=function(t){return t.wrapped().key in this.data},j.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},j.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},j.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},j.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},j.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},j.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},j.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var o=this._tiles[i];if(!(n[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){n[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),o=this._getLoadedTile(i);if(o)return o}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(e*r*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var n in this._tiles){var i=this._tiles[n];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}for(var o in this._tiles=r,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y,n.projection)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-r.maxOverzooming,this._source.minzoom),s=Math.max(o+r.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(Lt(this._source.type)){for(var c={},l={},h=0,p=Object.keys(u);hthis._source.maxzoom){var m=f.children(this._source.maxzoom)[0],y=this.getTile(m);if(y&&y.hasData()){n[m.key]=m;continue}}else{var v=f.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var A=g.wasRequested(),_=f.overscaledZ-1;_>=o;--_){var b=f.scaledTo(_);if(i[b.key])break;if(i[b.key]=!0,!(g=this.getTile(b))&&A&&(g=this._addTile(b)),g&&(n[b.key]=b,A=g.wasRequested(),g.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var o=0,a=e;o0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=n?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),c=s.map((function(t){return a.pointCoordinate(t)})),l=this.getIds(),h=1/0,p=1/0,d=-1/0,f=-1/0,g=0,m=c;g=0&&y[1].y+m>=0){var v=u.map((function(t){return s.getTilePoint(t)})),A=c.map((function(t){return s.getTilePoint(t)}));o.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:A,scale:g})}}},A=0;A=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Ot(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Lt(t){return"raster"===t||"image"===t||"video"===t}function kt(){return new t.window.Worker(Gh.workerUrl)}Pt.maxOverzooming=10,Pt.maxUnderzooming=3;var Rt="mapboxgl_preloaded_worker_pool",Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-a)/s:0;return this.points[o].mult(1-u).add(this.points[r].mult(u))};var Zt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function re(e,r,n,i,o,a,s,u){var c=i?e.textSizeData:e.iconSizeData,l=t.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var d=e.lineVertexArray,f=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,g=n.transform.width/n.transform.height,m=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function oe(e,r,n,i,o,a,s,u,c,l,h,p,d,f){var g,m=r/24,y=e.lineOffsetX*m,v=e.lineOffsetY*m;if(e.numGlyphs>1){var A=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,x=ne(m,u,y,v,n,h,p,e,c,a,d);if(!x)return{notEnoughRoom:!0};var w=$t(x.first.point,s).point,C=$t(x.last.point,s).point;if(i&&!n){var E=ie(e.writingMode,w,C,f);if(E)return E}g=[x.first];for(var I=e.glyphStartIndex+1;I0?P.point:ae(p,T,M,1,o),L=ie(e.writingMode,M,O,f);if(L)return L}var k=se(m*u.getoffsetX(e.glyphStartIndex),y,v,n,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,d);if(!k)return{notEnoughRoom:!0};g=[k]}for(var R=0,D=g;R0?1:-1,g=0;i&&(f*=-1,g=Math.PI),f<0&&(g+=Math.PI);for(var m=f>0?u+s:u+s+1,y=o,v=o,A=0,_=0,b=Math.abs(d),x=[];A+_<=b;){if((m+=f)=c)return null;if(v=y,x.push(y),void 0===(y=p[m])){var w=new t.Point(l.getx(m),l.gety(m)),C=$t(w,h);if(C.signedDistanceFromCamera>0)y=p[m]=C.point;else{var E=m-f;y=ae(0===A?a:new t.Point(l.getx(E),l.gety(E)),w,v,b-A+1,h)}}A+=_,_=v.dist(y)}var I=(b-A)/_,M=y.sub(v),S=M.mult(I)._add(v);S._add(M._unit()._perp()._mult(n*f));var T=g+Math.atan2(y.y-v.y,y.x-v.x);return x.push(S),{point:S,angle:T,path:x}}Zt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Zt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Zt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Zt.prototype._insertBoxCell=function(t,e,r,n,i,o){this.boxCells[i].push(o)},Zt.prototype._insertCircleCell=function(t,e,r,n,i,o){this.circleCells[i].push(o)},Zt.prototype._query=function(t,e,r,n,i,o){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:a},Zt.prototype._queryCircle=function(t,e,r,n,i){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!n&&[];var c=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,c,{hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),n?c.length>0:c},Zt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Zt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Zt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Zt.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=a.seenUids,c=this.boxCells[i];if(null!==c)for(var l=this.bboxes,h=0,p=c;h=l[f+0]&&n>=l[f+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[d],x1:l[f],y1:l[f+1],x2:l[f+2],y2:l[f+3]})}}}var g=this.circleCells[i];if(null!==g)for(var m=this.circles,y=0,v=g;ya*a+s*s},Zt.prototype._circleAndRectCollide=function(t,e,r,n,i,o,a){var s=(o-n)/2,u=Math.abs(t-(n+s));if(u>s+r)return!1;var c=(a-i)/2,l=Math.abs(e-(i+c));if(l>c+r)return!1;if(u<=s||l<=c)return!0;var h=u-s,p=l-c;return h*h+p*p<=r*r};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ce(t,e){for(var r=0;r=1;O--)P.push(S.path[O]);for(var L=1;L0){for(var B=P[0].clone(),N=P[0].clone(),F=1;F=E.x&&N.x<=I.x&&B.y>=E.y&&N.y<=I.y?[P]:N.xI.x||N.yI.y?[]:t.clipLine([P],E.x,E.y,I.x,I.y)}for(var j=0,z=D;j=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(g=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:m,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:g},this.markUsedJustification(p,t,h,d),p.allowVerticalPlacement&&(this.markUsedOrientation(p,d,h),this.placedOrientations[h.crossTileID]=d),{shift:y,placedGlyphBoxes:v}):void 0},be.prototype.placeLayerBucketPart=function(e,r,n){var i=this,o=e.parameters,a=o.bucket,s=o.layout,u=o.posMatrix,c=o.textLabelPlaneMatrix,l=o.labelToScreenMatrix,h=o.textPixelRatio,p=o.holdingForFade,d=o.collisionBoxArray,f=o.partiallyEvaluatedTextSize,g=o.collisionGroup,m=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),A=s.get("icon-allow-overlap"),_="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),x="none"!==s.get("icon-text-fit"),w="viewport-y"===s.get("symbol-z-order"),C=v&&(A||!a.hasIconData()||y),E=A&&(v||!a.hasTextData()||m);!a.collisionArrays&&d&&a.deserializeCollisionBoxes(d);var I=function(e,o){if(!r[e.crossTileID])if(p)i.placements[e.crossTileID]=new ge(!1,!1,!1);else{var d,w=!1,I=!1,M=!0,S=null,T={box:null,offscreen:null},P={box:null,offscreen:null},O=null,L=null,k=0,R=0,D=0;o.textFeatureIndex?k=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(k=e.featureIndex),o.verticalTextFeatureIndex&&(R=o.verticalTextFeatureIndex);var B=o.textBox;if(B){var N=function(r){var n=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,n=o,e))}return n},F=function(r,n){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i0&&(j=j.filter((function(t){return t!==z.anchor}))).unshift(z.anchor)}var U=function(t,r,n){for(var o=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,l=x&&!A?r:null,p={box:[],offscreen:!1},d=v?2*j.length:j.length,f=0;f=j.length,e,a,n,l);if(m&&(p=m.placedGlyphBoxes)&&p.box&&p.box.length){w=!0,S=m.shift;break}}return p};F((function(){return U(B,o.iconBox,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&!(T&&T.box&&T.box.length)&&e.numVerticalGlyphVertices>0&&r?U(r,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),T&&(w=T.box,M=T.offscreen);var G=N(T&&T.box);if(!w&&i.prevPlacement){var H=i.prevPlacement.variableOffsets[e.crossTileID];H&&(i.variableOffsets[e.crossTileID]=H,i.markUsedJustification(a,H.anchor,e,G))}}else{var V=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,v,h,u,g.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(a,r,e),i.placedOrientations[e.crossTileID]=r),n};F((function(){return V(B,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?V(r,t.WritingMode.vertical):{box:null,offscreen:null}})),N(T&&T.box&&T.box.length)}}if(w=(d=T)&&d.box&&d.box.length>0,M=d&&d.offscreen,e.useRuntimeCollisionCircles){var Q=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),q=t.evaluateSizeForFeature(a.textSizeData,f,Q),W=s.get("text-padding");O=i.collisionIndex.placeCollisionCircles(v,Q,a.lineVertexArray,a.glyphOffsetArray,q,u,c,l,n,b,g.predicate,e.collisionCircleDiameter,W),w=v||O.circles.length>0&&!O.collisionDetected,M=M&&O.offscreen}if(o.iconFeatureIndex&&(D=o.iconFeatureIndex),o.iconBox){var Y=function(t){var e=x&&S?_e(t,S.x,S.y,_,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,A,h,u,g.predicate)};I=P&&P.box&&P.box.length&&o.verticalIconBox?(L=Y(o.verticalIconBox)).box.length>0:(L=Y(o.iconBox)).box.length>0,M=M&&L.offscreen}var X=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,Z=y||0===e.numIconVertices;if(X||Z?Z?X||(I=I&&w):w=I&&w:I=w=I&&w,w&&d&&d.box&&i.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),a.bucketInstanceId,P&&P.box&&R?R:k,g.ID),I&&L&&i.collisionIndex.insertCollisionBox(L.box,s.get("icon-ignore-placement"),a.bucketInstanceId,D,g.ID),O&&(w&&i.collisionIndex.insertCollisionCircles(O.circles,s.get("text-ignore-placement"),a.bucketInstanceId,k,g.ID),n)){var K=a.bucketInstanceId,J=i.collisionCircleArrays[K];void 0===J&&(J=i.collisionCircleArrays[K]=new me);for(var $=0;$=0;--S){var T=M[S];I(a.symbolInstances.get(T),a.collisionArrays[T])}else for(var P=e.symbolInstanceStart;P=0&&(e.text.placedSymbolArray.get(u).crossTileID=o>=0&&u!==o?0:n.crossTileID)}},be.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=r===t.WritingMode.vertical?r:0,a=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];a0,v=i.placedOrientations[o.crossTileID],A=v===t.WritingMode.vertical,_=v===t.WritingMode.horizontal||v===t.WritingMode.horizontalOnly;if(s>0||u>0){var b=Pe(m.text);f(e.text,s,A?Oe:b),f(e.text,u,_?Oe:b);var x=m.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=x||A?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=x||_?1:0);var w=i.variableOffsets[o.crossTileID];w&&i.markUsedJustification(e,w.anchor,o,v);var C=i.placedOrientations[o.crossTileID];C&&(i.markUsedJustification(e,"left",o,C),i.markUsedOrientation(e,C,o))}if(y){var E=Pe(m.icon),I=!(p&&o.verticalPlacedIconSymbolIndex&&A);o.placedIconSymbolIndex>=0&&(f(e.icon,o.numIconVertices,I?E:Oe),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=m.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(f(e.icon,o.numVerticalIconVertices,I?Oe:E),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var M=e.collisionArrays[n];if(M){var S=new t.Point(0,0);if(M.textBox||M.verticalTextBox){var T=!0;if(c){var P=i.variableOffsets[g];P?(S=Ae(P.anchor,P.width,P.height,P.textOffset,P.textBoxScale),l&&S._rotate(h?i.transform.angle:-i.transform.angle)):T=!1}M.textBox&&xe(e.textCollisionBox.collisionVertexArray,m.text.placed,!T||A,S.x,S.y),M.verticalTextBox&&xe(e.textCollisionBox.collisionVertexArray,m.text.placed,!T||_,S.x,S.y)}var O=Boolean(!_&&M.verticalIconBox);M.iconBox&&xe(e.iconCollisionBox.collisionVertexArray,m.icon.placed,O,p?S.x:0,p?S.y:0),M.verticalIconBox&&xe(e.iconCollisionBox.collisionVertexArray,m.icon.placed,!O,p?S.x:0,p?S.y:0)}}},m=0;mt},be.prototype.setStale=function(){this.stale=!0};var we=Math.pow(2,25),Ce=Math.pow(2,24),Ee=Math.pow(2,17),Ie=Math.pow(2,16),Me=Math.pow(2,9),Se=Math.pow(2,8),Te=Math.pow(2,1);function Pe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*we+e*Ce+r*Ee+e*Ie+r*Me+e*Se+r*Te+e}var Oe=0,Le=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Le.prototype.continuePlacement=function(t,e,r,n,i){for(var o=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new Le(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ke.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Re=512/t.EXTENT/2,De=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var c=a[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var l=0;l1?"@2x":"",u=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,l())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,a||(a=t,o=e,l())}));function l(){if(a)n(a);else if(i&&o){var e=t.browser.getImageData(o),r={};for(var s in i){var u=i[s],c=u.width,l=u.height,h=u.x,p=u.y,d=u.sdf,f=u.pixelRatio,g=u.stretchX,m=u.stretchY,y=u.content,v=new t.RGBAImage({width:c,height:l});t.RGBAImage.copy(e,v,{x:h,y:p},{x:0,y:0},{width:c,height:l}),r[s]={data:v,pixelRatio:f,sdf:d,stretchX:g,stretchY:m,content:y}}n(null,r)}}return{cancel:function(){u&&(u.cancel(),u=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var o=this.sourceCaches[e]=new Pt(e,r,this.dispatcher,this.map.transform.projection);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(je(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e,this.map.transform.projection)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e,this.map.transform.projection),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),n)||(o.setLayoutProperty(r,n,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),n)||(o.setPaintProperty(r,n,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,o=this.sourceCaches[n];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(a,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){n[a]=o;for(var s=0,u=t;s=0;d--){var f=this._order[d];if(r(f))for(var g=i.length-1;g>=0;g--){var m=i[g].feature;if(n[m.layer.id] 0.5) {\r\ngl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {gl_FragColor*=.1;\r\n}\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nattribute vec2 a_shift;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\ngl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\n}"),$e=yr("varying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying float v_perspective_ratio;\r\nvarying float v_collision;\r\nvoid main() {\r\nfloat alpha=0.5*min(v_perspective_ratio,1.0);\r\nfloat stroke_radius=0.9*max(v_perspective_ratio,1.0);\r\nfloat distance_to_center=length(v_extrude);\r\nfloat distance_to_edge=abs(distance_to_center-v_radius);\r\nfloat opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);\r\nvec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);\r\ngl_FragColor=color*alpha*opacity_t;\r\n}","attribute vec2 a_pos;\r\nattribute float a_radius;\r\nattribute vec2 a_flags;\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_inv_matrix;\r\nuniform vec2 u_viewport_size;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying float v_perspective_ratio;\r\nvarying float v_collision;\r\nvec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);\r\nvec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);\r\nrayStart.xyz/=rayStart.w;\r\nrayEnd.xyz /=rayEnd.w;\r\nhighp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);\r\nreturn mix(rayStart.xyz,rayEnd.xyz,t);\r\n}\r\nvoid main() {\r\nvec2 quadCenterPos=a_pos;\r\nfloat radius=a_radius;\r\nfloat collision=a_flags.x;\r\nfloat vertexIdx=a_flags.y;\r\nvec2 quadVertexOffset=vec2(\r\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));\r\nvec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);\r\nvec4 clipPos=u_matrix*vec4(tilePos,1.0);\r\nhighp float camera_to_anchor_distance=clipPos.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;\r\nv_radius=radius;\r\nv_extrude=quadVertexExtent*padding_factor;\r\nv_perspective_ratio=collision_perspective_ratio;\r\nv_collision=collision;\r\ngl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);\r\n}"),tr=yr("uniform highp vec4 u_color;\r\nuniform sampler2D u_overlay;\r\nvarying vec2 v_uv;\r\nvoid main() {\r\nvec4 overlay_color=texture2D(u_overlay,v_uv);\r\ngl_FragColor=mix(u_color,overlay_color,overlay_color.a);\r\n}","attribute vec2 a_pos;\r\nvarying vec2 v_uv;\r\nuniform mat4 u_matrix;\r\nuniform float u_overlay_scale;\r\nvoid main() {v_uv=a_pos/8192.0;\r\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);\r\n}"),er=yr("#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_FragColor=color*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),rr=yr("varying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\nfloat dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=outline_color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),nr=yr("uniform vec2 u_texsize;\r\nuniform sampler2D u_image;\r\nuniform float u_fade;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),ir=yr("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\ngl_FragColor=mix(color1,color2,u_fade)*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec3 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);\r\n}"),or=yr("varying vec4 v_color;\r\nvoid main() {\r\ngl_FragColor=v_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec4 v_color;\r\n#pragma mapbox: define highp float base\r\n#pragma mapbox: define highp float height\r\n#pragma mapbox: define highp vec4 color\r\nvoid main() {\r\n#pragma mapbox: initialize highp float base\r\n#pragma mapbox: initialize highp float height\r\n#pragma mapbox: initialize highp vec4 color\r\nvec3 normal=a_normal_ed.xyz;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\ngl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;\r\nv_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);\r\ncolor+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);\r\nv_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);\r\nv_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);\r\nv_color*=u_opacity;\r\n}"),ar=yr("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\nvec4 mixedColor=mix(color1,color2,u_fade);\r\ngl_FragColor=mixedColor*v_lighting;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_height_factor;\r\nuniform vec3 u_scale;\r\nuniform float u_vertical_gradient;\r\nuniform lowp float u_opacity;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec3 normal=a_normal_ed.xyz;\r\nfloat edgedistance=a_normal_ed.w;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\nfloat z=t > 0.0 ? height : base;\r\ngl_Position=u_matrix*vec4(a_pos,z,1);\r\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\r\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);\r\nv_lighting=vec4(0.0,0.0,0.0,1.0);\r\nfloat directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);\r\ndirectional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);\r\nif (normal.y !=0.0) {directional*=(\r\n(1.0-u_vertical_gradient)+\n(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));\r\n}\r\nv_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\r\nv_lighting*=u_opacity;\r\n}"),sr=yr("#ifdef GL_ES\r\nprecision highp float;\r\n#endif\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_dimension;\r\nuniform float u_zoom;\r\nuniform vec4 u_unpack;\r\nfloat getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;\r\ndata.a=-1.0;\r\nreturn dot(data,u_unpack)/4.0;\r\n}\r\nvoid main() {\r\nvec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);\r\nfloat b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);\r\nfloat c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);\r\nfloat d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);\r\nfloat e=getElevation(v_pos,0.0);\r\nfloat f=getElevation(v_pos+vec2(epsilon.x,0),0.0);\r\nfloat g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);\r\nfloat h=getElevation(v_pos+vec2(0,epsilon.y),0.0);\r\nfloat i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\r\nfloat exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;\r\nvec2 deriv=vec2(\r\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\r\n)/pow(2.0,exaggeration+(19.2562-u_zoom));\r\ngl_FragColor=clamp(vec4(\r\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_dimension;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nhighp vec2 epsilon=1.0/u_dimension;\r\nfloat scale=(u_dimension.x-2.0)/u_dimension.x;\r\nv_pos=(a_texture_pos/8192.0)*scale+epsilon;\r\n}"),ur=yr("uniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_latrange;\r\nuniform vec2 u_light;\r\nuniform vec4 u_shadow;\r\nuniform vec4 u_highlight;\r\nuniform vec4 u_accent;\r\n#define PI 3.141592653589793\r\nvoid main() {\r\nvec4 pixel=texture2D(u_image,v_pos);\r\nvec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);\r\nfloat aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);\r\nfloat intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;\r\nfloat maxValue=0.5*PI;\r\nfloat scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);\r\nfloat shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);\r\nvec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);\r\ngl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=a_texture_pos/8192.0;\r\n}"),cr=yr("uniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_linesofar;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),lr=yr("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\nvarying highp vec2 v_uv;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nattribute float a_uv_x;\r\nattribute float a_split_index;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform float u_image_height;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp vec2 v_uv;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nhighp float texel_height=1.0/u_image_height;\r\nhighp float half_texel_height=0.5*texel_height;\r\nv_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),hr=yr("uniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform mediump vec3 u_scale;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\r\nvec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);\r\nvec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);\r\nfloat aspect_a=display_size_a.y/v_width;\r\nfloat aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);\r\nfloat x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);\r\nfloat y=0.5*v_normal.y+0.5;\r\nvec2 texel_size=1.0/u_texsize;\r\nvec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));\r\nvec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));\r\nvec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\r\ngl_FragColor=color*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_units_to_pixels;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\nvarying float v_width;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_linesofar=a_linesofar;\r\nv_width2=vec2(outset,inset);\r\nv_width=floorwidth;\r\n}"),pr=yr("uniform lowp float u_device_pixel_ratio;\r\nuniform sampler2D u_image;\r\nuniform float u_sdfgamma;\r\nuniform float u_mix;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat sdfdist_a=texture2D(u_image,v_tex_a).a;\r\nfloat sdfdist_b=texture2D(u_image,v_tex_b).a;\r\nfloat sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);\r\nalpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_patternscale_a;\r\nuniform float u_tex_y_a;\r\nuniform vec2 u_patternscale_b;\r\nuniform float u_tex_y_b;\r\nuniform vec2 u_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;\r\nvec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);\r\nv_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);\r\nv_width2=vec2(outset,inset);\r\n}"),dr=yr("uniform float u_fade_t;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image0;\r\nuniform sampler2D u_image1;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nuniform float u_brightness_low;\r\nuniform float u_brightness_high;\r\nuniform float u_saturation_factor;\r\nuniform float u_contrast_factor;\r\nuniform vec3 u_spin_weights;\r\nvoid main() {vec4 color0=texture2D(u_image0,v_pos0);\r\nvec4 color1=texture2D(u_image1,v_pos1);\r\nif (color0.a > 0.0) {\r\ncolor0.rgb=color0.rgb/color0.a;\r\n}\r\nif (color1.a > 0.0) {\r\ncolor1.rgb=color1.rgb/color1.a;\r\n}\r\nvec4 color=mix(color0,color1,u_fade_t);\r\ncolor.a*=u_opacity;\r\nvec3 rgb=color.rgb;rgb=vec3(\r\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;\r\nrgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);\r\nvec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);\r\ngl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_tl_parent;\r\nuniform float u_scale_parent;\r\nuniform float u_buffer_scale;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;\r\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\r\n}"),fr=yr("uniform sampler2D u_texture;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nlowp float alpha=opacity*v_fade_opacity;\r\ngl_FragColor=texture2D(u_texture,v_tex)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;\r\nuniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform float u_fade_change;\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nvec2 a_minFontScale=a_pixeloffset.zw/256.0;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);\r\nv_tex=a_tex/u_texsize;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nv_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\n}"),gr=yr("#define SDF_PX 8.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform bool u_is_text;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nvec2 tex=v_data0.xy;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fade_opacity=v_data1[2];\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec4 a_pixeloffset;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nvec2 a_pxoffset=a_pixeloffset.xy;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0=a_tex/u_texsize;\r\nv_data1=vec3(gamma_scale,size,interpolated_fade_opacity);\r\n}"),mr=yr("#define SDF_PX 8.0\r\n#define SDF 1.0\r\n#define ICON 0.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform sampler2D u_texture_icon;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nfloat fade_opacity=v_data1[2];\r\nif (v_data1.w==ICON) {\r\nvec2 tex_icon=v_data0.zw;\r\nlowp float alpha=opacity*fade_opacity;\r\ngl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\nreturn;\r\n}\r\nvec2 tex=v_data0.xy;\r\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fontScale=size/24.0;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nuniform vec2 u_texsize_icon;\r\nvarying vec4 v_data0;\r\nvarying vec4 v_data1;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nfloat a_size_min=floor(a_size[0]*0.5);\r\nfloat is_sdf=a_size[0]-2.0*a_size_min;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size_min,a_size[1],u_size_t)/128.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size_min/128.0;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=size/24.0;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0.xy=a_tex/u_texsize;\r\nv_data0.zw=a_tex/u_texsize_icon;\r\nv_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);\r\n}");function yr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var o="float"===n?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:a}}var vr=Object.freeze({__proto__:null,prelude:Qe,background:qe,backgroundPattern:We,circle:Ye,clippingMask:Xe,heatmap:Ze,heatmapTexture:Ke,collisionBox:Je,collisionCircle:$e,debug:tr,fill:er,fillOutline:rr,fillOutlinePattern:nr,fillPattern:ir,fillExtrusion:or,fillExtrusionPattern:ar,hillshadePrepare:sr,hillshade:ur,line:cr,lineGradient:lr,linePattern:hr,lineSDF:pr,raster:dr,symbolIcon:fr,symbolSDF:gr,symbolTextAndIcon:mr}),Ar=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function _r(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}br.prototype.draw=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g){var m,y=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);d&&d.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var A=(m={},m[y.LINES]=2,m[y.TRIANGLES]=3,m[y.LINE_STRIP]=1,m)[e],_=0,b=l.get();_0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Hr(i.paint.get("raster-hue-rotate"))};var o,a};function Hr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Vr,Qr=function(t,e,r,n,i,o,a,s,u,c){var l=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:l.cameraToCenterDistance,u_pitch:l.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:l.width/l.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},qr=function(e,r,n,i,o,a,s,u,c,l,h){var p=o.transform;return t.extend(Qr(e,r,n,i,o,a,s,u,c,l),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Wr=function(e,r,n,i,o,a,s,u,c,l){return t.extend(qr(e,r,n,i,o,a,s,u,!0,c,!0),{u_texsize_icon:l,u_texture_icon:1})},Yr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Xr=function(e,r,n,i,o,a){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,u=a.height,c=Math.pow(2,n.tileID.overscaledZ),l=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=l*(n.tileID.canonical.x+n.tileID.wrap*c),p=l*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/pe(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,a,n,o),{u_matrix:e,u_opacity:r})},Zr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,i,o,a,s){for(var u=e.context,c=u.gl,l=e.useProgram("collisionBox"),h=[],p=0,d=0,f=0;f0){var b=t.create(),x=v;t.mul(b,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,y.placementViewportMatrix),h.push({circleArray:_,circleOffset:d,transform:x,invTransform:b}),d=p+=_.length/4}A&&l.draw(u,c.LINES,Et.disabled,It.disabled,e.colorModeForRenderPass(),St.disabled,Pr(v,e.transform,m),n.id,A.layoutVertexBuffer,A.indexBuffer,A.segments,null,e.transform.zoom,null,null,A.collisionVertexBuffer)}}if(s&&h.length){var w=e.useProgram("collisionCircle"),C=new t.StructArrayLayout2f1f2i16;C.resize(4*p),C._trim();for(var E=0,I=0,M=h;I=0&&(g[y.associatedIconIndex]={shiftedAnchor:C,angle:E})}else ce(y.numGlyphs,d)}if(h){f.clear();for(var M=e.icon.placedSymbolArray,S=0;S0){var s=t.browser.now(),u=(s-e.timeAdded)/a,c=r?(s-r.timeAdded)/a:-1,l=n.getSource(),h=o.coveringZoomLevel({tileSize:l.tileSize,roundZoom:l.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),d=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-c,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}var ln=new t.Color(1,0,0,1),hn=new t.Color(0,1,0,1),pn=new t.Color(0,0,1,1),dn=new t.Color(1,0,1,1),fn=new t.Color(0,1,1,1);function gn(t,e,r,n){yn(t,0,e+r/2,t.transform.width,r,n)}function mn(t,e,r,n){yn(t,e-r/2,0,r,t.transform.height,n)}function yn(e,r,n,i,o,a){var s=e.context,u=s.gl;u.enable(u.SCISSOR_TEST),u.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),u.disable(u.SCISSOR_TEST)}function vn(e,r,n){var i=e.context,o=i.gl,a=n.posMatrix,s=e.useProgram("debug"),u=Et.disabled,c=It.disabled,l=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,u,c,l,St.disabled,Lr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=r.getTileByID(n.key).latestRawTileData,p=Math.floor((h&&h.byteLength||0)/1024),d=r.getTile(n).tileSize,f=512/Math.min(d,512)*(n.overscaledZ/e.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,g+" "+p+"kb"),s.draw(i,o.TRIANGLES,u,c,Mt.alphaBlended,St.disabled,Lr(a,t.Color.transparent,f),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var An={symbol:function(e,r,n,i,o){if("translucent"===e.renderPass){var a=It.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,o,a,s){for(var u=r.transform,c="map"===o,l="map"===a,h=0,p=e;h256&&this.clearStencil(),r.setColorMode(Mt.disabled),r.setDepthMode(Et.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new It({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new It({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,o=n[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s=0;this.currentLayer--){var _=this.style._layers[i[this.currentLayer]],b=o[_.source],x=l[_.source];this._renderTileClippingMasks(_,x),this.renderLayer(this,b,_,x)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},_n.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},_n.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new br(this.context,t,vr[t],e,Zr[t],this._showOverdrawInspector)),this.cache[r]},_n.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},_n.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},_n.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},_n.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var bn=function(t,e){this.points=t,this.planes=e};bn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),n=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],r,n)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new bn(o,a)};var xn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};xn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o=0;if(0===a)return 0;a!==r.length&&(n=!1)}if(n)return 2;for(var u=0;u<3;u++){for(var c=Number.MAX_VALUE,l=-Number.MAX_VALUE,h=0;hthis.max[u]-this.min[u])return 0}return 1};var wn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};wn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},wn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},wn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},wn.prototype.clone=function(){return new wn(this.top,this.bottom,this.left,this.right)},wn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Cn=function(e,r,n,i,o,a){void 0===a&&(a="EPSG:3857"),this.projection=a||"EPSG:3857",this.tileSize=512,this.maxValidLatitude="EPSG:3857"===this.projection?85.051129:90,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={}},En={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Cn.prototype.clone=function(){var t=new Cn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.projection);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},En.minZoom.get=function(){return this._minZoom},En.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},En.maxZoom.get=function(){return this._maxZoom},En.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},En.minPitch.get=function(){return this._minPitch},En.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},En.maxPitch.get=function(){return this._maxPitch},En.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},En.renderWorldCopies.get=function(){return this._renderWorldCopies},En.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},En.worldSize.get=function(){return this.tileSize*this.scale},En.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},En.size.get=function(){return new t.Point(this.width,this.height)},En.bearing.get=function(){return-this.angle/Math.PI*180},En.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},En.pitch.get=function(){return this._pitch/Math.PI*180},En.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},En.fov.get=function(){return this._fov/Math.PI*180},En.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},En.zoom.get=function(){return this._zoom},En.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},En.center.get=function(){return this._center},En.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},En.padding.get=function(){return this._edgeInsets.toJSON()},En.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},En.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Cn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Cn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Cn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Cn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),u=Math.floor(Math.max(n.x,i.x,o.x,a.x)),c=s-1;c<=u+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},Cn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center,0,this.projection),o=Math.pow(2,r),a=[o*i.x,o*i.y,0],s=bn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),u=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(u=r);var c=function(t){return{aabb:new xn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},l=[],h=[],p=r,d=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var f=1;f<=3;f++)l.push(c(-f)),l.push(c(f));for(l.push(c(0));l.length>0;){var g=l.pop(),m=g.x,y=g.y,v=g.fullyVisible;if(!v){var A=g.aabb.intersects(s);if(0===A)continue;v=2===A}var _=g.aabb.distanceX(a),b=g.aabb.distanceY(a),x=Math.max(Math.abs(_),Math.abs(b));if(g.zoom===p||x>3+(1<=u)h.push({tileID:new t.OverscaledTileID(g.zoom===p?d:g.zoom,g.wrap,g.zoom,m,y,this.projection),distanceSq:t.sqrLen([a[0]-.5-m,a[1]-.5-y])});else for(var w=0;w<4;w++){var C=(m<<1)+w%2,E=(y<<1)+(w>>1);l.push({aabb:g.aabb.quadrant(w),zoom:g.zoom+1,x:C,y:E,wrap:g.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Cn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},En.unmodified.get=function(){return this._unmodified},Cn.prototype.zoomScale=function(t){return Math.pow(2,t)},Cn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Cn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r,this.projection)*this.worldSize)},Cn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize,0,this.projection).toLngLat()},En.point.get=function(){return this.project(this.center)},Cn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(n.x-i.x),o.y-(n.y-i.y),0,this.projection);this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},Cn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Cn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Cn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e,null,this.projection)},Cn.prototype.coordinateLocation=function(t){return t.toLngLat()},Cn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],o=n[3],a=r[1]/i,s=n[1]/o,u=r[2]/i,c=n[2]/o,l=u===c?0:(0-u)/(c-u);return new t.MercatorCoordinate(t.number(r[0]/i,n[0]/o,l)/this.worldSize,t.number(a,s,l)/this.worldSize,0,this.projection)},Cn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Cn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Cn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Cn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Cn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,r?this.alignedProjMatrix:this.projMatrix,u),i[n]=new Float32Array(u),i[n]},Cn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Cn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,o=-90,a=90,s=-180,u=180,c=this.size,l=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1],this.projection)*this.worldSize,e=(a=t.mercatorYfromLat(h[0],this.projection)*this.worldSize)-oa&&(i=a-m)}if(this.lngRange){var y=d.x,v=c.x/2;y-vu&&(n=u-v)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:d.x,void 0!==i?i:d.y))),this._unmodified=l,this._constraining=!1}},Cn.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,n=this._fov*(.5+e.y/this.height),i=Math.sin(n)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-n,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),c=this.height/50,l=new Float64Array(16);t.perspective(l,this._fov,this.width/this.height,c,u),l[8]=2*-e.x/this.width,l[9]=2*e.y/this.height,t.scale(l,l,[1,-1,1]),t.translate(l,l,[0,0,-this.cameraToCenterDistance]),t.rotateX(l,l,this._pitch),t.rotateZ(l,l,this.angle),t.translate(l,l,[-a,-s,0]),this.mercatorMatrix=t.scale([],l,[this.worldSize,this.worldSize,this.worldSize]),t.scale(l,l,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=l,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),f=Math.sin(this.angle),g=a-Math.round(a)+d*h+f*p,m=s-Math.round(s)+d*p+f*h,y=new Float64Array(l);if(t.translate(y,y,[g>.5?g-1:g,m>.5?m-1:m,0]),this.alignedProjMatrix=y,l=t.create(),t.scale(l,l,[this.width/2,-this.height/2,1]),t.translate(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=t.create(),t.scale(l,l,[1,-1,1]),t.translate(l,l,[-1,-1,0]),t.scale(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(l=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Cn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Cn.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},Cn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,o=r.x,a=r.y,s=0,u=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},In.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var Mn={linearity:.3,easing:t.bezier(0,0,.3,1)},Sn=t.extend({deceleration:2500,maxSpeed:1400},Mn),Tn=t.extend({deceleration:20,maxSpeed:1400},Mn),Pn=t.extend({deceleration:1e3,maxSpeed:360},Mn),On=t.extend({deceleration:1e3,maxSpeed:90},Mn),Ln=function(t){this._map=t,this.clear()};function kn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Ln.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Dn(t.type,this._map,t))},Fn.prototype.dblclick=function(t){return this._firePreventable(new Dn(t.type,this._map,t))},Fn.prototype.mouseover=function(t){this._map.fire(new Dn(t.type,this._map,t))},Fn.prototype.mouseout=function(t){this._map.fire(new Dn(t.type,this._map,t))},Fn.prototype.touchstart=function(t){return this._firePreventable(new Bn(t.type,this._map,t))},Fn.prototype.touchmove=function(t){this._map.fire(new Bn(t.type,this._map,t))},Fn.prototype.touchend=function(t){this._map.fire(new Bn(t.type,this._map,t))},Fn.prototype.touchcancel=function(t){this._map.fire(new Bn(t.type,this._map,t))},Fn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Fn.prototype.isEnabled=function(){return!0},Fn.prototype.isActive=function(){return!1},Fn.prototype.enable=function(){},Fn.prototype.disable=function(){};var jn=function(t){this._map=t};jn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},jn.prototype.mousemove=function(t){this._map.fire(new Dn(t.type,this._map,t))},jn.prototype.mousedown=function(){this._delayContextMenu=!0},jn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},jn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Dn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},jn.prototype.isEnabled=function(){return!0},jn.prototype.isActive=function(){return!1},jn.prototype.enable=function(){},jn.prototype.disable=function(){};var zn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Un(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Gn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Hn=function(t){this.singleTap=new Gn(t),this.numTaps=t.numTaps,this.reset()};Hn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Hn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Hn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Hn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(n)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Vn=function(){this._zoomIn=new Hn({numTouches:1,numTaps:2}),this._zoomOut=new Hn({numTouches:2,numTaps:1}),this.reset()};Vn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Vn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Vn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Vn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},Vn.prototype.touchcancel=function(){this.reset()},Vn.prototype.enable=function(){this._enabled=!0},Vn.prototype.disable=function(){this._enabled=!1,this.reset()},Vn.prototype.isEnabled=function(){return this._enabled},Vn.prototype.isActive=function(){return this._active};var Qn={0:1,2:2},qn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};qn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},qn.prototype._correctButton=function(t,e){return!1},qn.prototype._move=function(t,e){return{}},qn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},qn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=Qn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)0&&(this._active=!0);var i=Un(n,r),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var u in i){var c=i[u],l=this._touches[u];l&&(o._add(c),a._add(c.sub(l)),s++,i[u]=c)}if(this._touches=i,!(sMath.abs(t.x)}var ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ni(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ni(t)&&ni(e)&&o}},e}(Kn),oi={panStep:100,bearingStep:15,pitchStep:10},ai=function(){var t=oi;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep};function si(t){return t*(2-t)}ai.prototype.reset=function(){this._active=!1},ai.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:si,zoom:r?Math.round(u)+r*(t.shiftKey?2:1):u,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},ai.prototype.enable=function(){this._enabled=!0},ai.prototype.disable=function(){this._enabled=!1,this.reset()},ai.prototype.isEnabled=function(){return this._enabled},ai.prototype.isActive=function(){return this._active};var ui=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)},ci={isCompatibleEngine:{configurable:!0}};ui.prototype.setZoomRate=function(t){this._defaultZoomRate=t},ui.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},ui.prototype.isEnabled=function(){return!!this._enabled},ui.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},ui.prototype.isZooming=function(){return!!this._zooming},ui.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},ui.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ui.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},ui.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},ui.prototype._start=function(e){if(this._delta){this._isZoomIn=this._delta>0,this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ci.isCompatibleEngine.get=function(){var t=!1;if(this._map&&this._map.style){var e=this._map.style._order[0];e&&(t="custom"===this._map.style._layers[e].type)}return t},ui.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,u=this._startZoom,c=this._easing;this.isCompatibleEngine&&(this._isZoomIn?(a=Math.ceil,su&&(this._targetZoom=s=u)),s=a(s));var l,h=!1;if("wheel"===this._type&&u&&c){var p=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),d=c(p);l=t.number(u,s,d),p<1?this._frameId||(this._frameId=!0):h=!0}else l=s,h=!0;return this._active=!0,h&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!h,zoomDelta:l-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ui.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},ui.prototype.reset=function(){this._active=!1},Object.defineProperties(ui.prototype,ci);var li=function(t,e){this._clickZoom=t,this._tapZoom=e};li.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},li.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},li.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},li.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var hi=function(){this.reset()};hi.prototype.reset=function(){this._active=!1},hi.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},hi.prototype.enable=function(){this._enabled=!0},hi.prototype.disable=function(){this._enabled=!1,this.reset()},hi.prototype.isEnabled=function(){return this._enabled},hi.prototype.isActive=function(){return this._active};var pi=function(){this._tap=new Hn({numTouches:1,numTaps:1}),this.reset()};pi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},pi.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},pi.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},pi.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},pi.prototype.touchcancel=function(){this.reset()},pi.prototype.enable=function(){this._enabled=!0},pi.prototype.disable=function(){this._enabled=!1,this.reset()},pi.prototype.isEnabled=function(){return this._enabled},pi.prototype.isActive=function(){return this._active};var di=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};di.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},di.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},di.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},di.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var fi=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};fi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},fi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},fi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},fi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var gi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};gi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},gi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},gi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},gi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},gi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},gi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var mi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function vi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var Ai=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ln(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;oo?Math.min(2,b):Math.max(.5,b),x=Math.pow(m,1-e),w=i.unproject(A.add(_.mult(e*x)).mult(g));i.setLocationAtPoint(i.renderWorldCopies?w.wrap():w,f)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),c=this.getPadding(),l="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:u,d="padding"in e?e.padding:o.padding,f=o.zoomScale(l-a),g=t.Point.convert(e.offset),m=o.centerPoint.add(g),y=o.pointLocation(m),v=t.LngLat.convert(e.center||y);this._normalizeCenter(v);var A=o.project(y),_=o.project(v).sub(A),b=e.curve,x=Math.max(o.width,o.height),w=x/f,C=_.mag();if("minZoom"in e){var E=t.clamp(Math.min(e.minZoom,a,l),o.minZoom,o.maxZoom),I=x/o.zoomScale(E-a);b=Math.sqrt(I/C*2)}var M=b*b;function S(t){var e=(w*w-x*x+(t?-1:1)*M*M*C*C)/(2*(t?w:x)*M*C);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function P(t){return(Math.exp(t)+Math.exp(-t))/2}var O=S(0),L=function(t){return P(O)/P(O+b*t)},k=function(t){return x*((P(O)*(T(e=O+b*t)/P(e))-T(O))/M)/C;var e},R=(S(1)-O)/b;if(Math.abs(C)<1e-6||!isFinite(R)){if(Math.abs(x-w)<1e-6)return this.easeTo(e,r);var D=we.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==u,this._padding=!o.isPaddingEqual(d),this._prepareEase(r,!1),this._ease((function(e){var i=e*R,f=1/L(i);o.zoom=1===e?l:a+o.scaleZoom(f),n._rotating&&(o.bearing=t.number(s,h,e)),n._pitching&&(o.pitch=t.number(u,p,e)),n._padding&&(o.interpolatePadding(c,d,e),m=o.centerPoint.add(g));var y=1===e?v:o.unproject(A.add(_.mult(k(i))).mult(f));o.setLocationAtPoint(o.renderWorldCopies?y.wrap():y,m),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop()}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),bi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};bi.prototype.getDefaultPosition=function(){return"bottom-right"},bi.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},bi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},bi.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},bi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var xi=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};xi.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xi.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},xi.prototype.getDefaultPosition=function(){return"bottom-left"},xi.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},xi.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},xi.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var wi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};wi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},wi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var i=new Cn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies,e.projection);if(n.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new wi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Ci,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ii))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ai(this,e),this._hash=e.hash&&new In("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new bi({customAttribution:e.customAttribution})),this.addControl(new xi,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(i.__proto__=n),(i.prototype=Object.create(n&&n.prototype)).constructor=i;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,r){if(void 0===r&&e.getDefaultPosition&&(r=e.getDefaultPosition()),void 0===r&&(r="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},i.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var o=!this._moving;return o&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var a=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(i,new Dn(t,i,n.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(i,new Dn(t,i,n.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(i,new Dn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},i.prototype.on=function(t,e,r){if(void 0===r)return n.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},i.prototype.once=function(t,e,r){if(void 0===r)return n.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,r);for(var o in i.delegates)this.once(o,i.delegates[o]);return this},i.prototype.off=function(t,e,r){var i=this;return void 0===r?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var o=n[t],a=0;a180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}ki.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},ki.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},ki.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},ki.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},ki.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},ki.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},ki.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},ki.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},ki.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},ki.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)e.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Ui)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Fi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Fi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":zi--,Ui=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++zi>1?(e={maximumAge:6e5,timeout:0},Ui=!0):(e=this.options.positionOptions,Ui=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Hi={maxWidth:100,unit:"metric"},Vi=function(e){this.options=t.extend({},Hi,e),t.bindAll(["_onMove","setUnit"],this)};function Qi(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([n,i]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){var u=3.2808*s;u>5280?qi(e,n,u/5280,t._getUIString("ScaleControl.Miles")):qi(e,n,u,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?qi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?qi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):qi(e,n,s,t._getUIString("ScaleControl.Meters"))}function qi(t,e,r,n){var i,o,a,s=(i=r,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/r)+"px",t.innerHTML=s+" "+n}Vi.prototype.getDefaultPosition=function(){return"bottom-left"},Vi.prototype._onMove=function(){Qi(this._map,this._container,this.options)},Vi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Vi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Vi.prototype.setUnit=function(t){this.options.unit=t,Qi(this._map,this._container,this.options)};var Wi=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Wi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Wi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Wi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Wi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Wi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Wi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Wi.prototype._isFullscreen=function(){return this._fullscreen},Wi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Wi.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Yi={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},Xi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Yi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createContent=function(){this._content&&r.remove(this._content),this._content=r.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ri(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,u=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+a.bottom.ythis._map.transform.height-c?["bottom"]:[],i.xthis._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var l=i.add(a[o]).round();r.setTransform(this._container,Di[o]+" translate("+l.x+"px,"+l.y+"px)"),Bi(this._container,o,"popup")}},n.prototype._onClose=function(){this.remove()},n}(t.Evented);function Zi(){return function(){throw new Error("Unimplemented abstract method.")}()}var Ki=0;function Ji(t){return t.ol_uid||(t.ol_uid=String(++Ki))}var $i=function(t){function e(e){var r="Assertion failed. See https://openlayers.org/en/v"+"5.3.3".split("-")[0]+"/doc/errors/#"+e+" for details.";t.call(this,r),this.code=e,this.name="AssertionError",this.message=r}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),to="function"==typeof Object.assign?Object.assign:function(t,e){var r=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),i=1,o=arguments.length;i0},e.prototype.removeEventListener=function(t,e){var r=this.listeners_[t];if(r){var n=r.indexOf(e);t in this.pendingRemovals_?(r[n]=go,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t])}},e}(ho),Ao=function(t){function e(){t.call(this),this.revision_=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.changed=function(){++this.revision_,this.dispatchEvent("change")},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;i0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;ee?1:t0){for(n=1;n=e.length){for(var i=[],o=0;o-1&&t.splice(r,1)}),this.dedupTimeout_)}},e}(zo),Ca=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]],Ea=function(t){function e(e){t.call(this),this.element_=e,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.registerSources=function(){if(Bo)this.registerSource("native",new pa(this));else if(No)this.registerSource("ms",new na(this));else{var t=new qo(this);this.registerSource("mouse",t),Do&&this.registerSource("touch",new wa(this,t))}this.register_()},e.prototype.registerSource=function(t,e){var r=e,n=r.getEvents();n&&(n.forEach(function(t){var e=r.getHandlerForEvent(t);e&&(this.eventMap_[t]=e.bind(r))}.bind(this)),this.eventSourceList_.push(r))},e.prototype.register_=function(){for(var t=this.eventSourceList_.length,e=0;ethis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(lo(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(lo(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(lo),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),t.prototype.disposeInternal.call(this)},e}(vo),Ma=function(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}};Ma.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,eo(this.queuedElements_)},Ma.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,r=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(r);return delete this.queuedElements_[n],r},Ma.prototype.enqueue=function(t){var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},Ma.prototype.getCount=function(){return this.elements_.length},Ma.prototype.getLeftChildIndex_=function(t){return 2*t+1},Ma.prototype.getRightChildIndex_=function(t){return 2*t+2},Ma.prototype.getParentIndex_=function(t){return t-1>>1},Ma.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},Ma.prototype.isEmpty=function(){return 0===this.elements_.length},Ma.prototype.isKeyQueued=function(t){return t in this.queuedElements_},Ma.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},Ma.prototype.siftUp_=function(t){for(var e=this.elements_,r=this.priorities_,n=e.length,i=e[t],o=r[t],a=t;t>1;){var s=this.getLeftChildIndex_(t),u=this.getRightChildIndex_(t),c=ut;){var a=this.getParentIndex_(e);if(!(n[a]>o))break;r[e]=r[a],n[e]=n[a],e=a}r[e]=i,n[e]=o},Ma.prototype.reprioritize=function(){var t,e,r,n=this.priorityFunction_,i=this.elements_,o=this.priorities_,a=0,s=i.length;for(e=0;e0;)i=(n=this.dequeue()[0]).getKey(),5===(r=n.getState())?a=!0:0!==r||i in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[i]=!0,++this.tilesLoading_,++o,n.load());0===o&&a&&this.tileChangeCallback_()},e}(Ma);function Ta(t,e,r){return Math.min(Math.max(t,e),r)}var Pa="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2};function Oa(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return La(t,e,r,n)}function La(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function ka(t){return t*Math.PI/180}function Ra(t,e){var r=t%e;return r*e<0?r+e:r}function Da(t,e,r){return t+r*(e-t)}function Ba(t){return t}function Na(t,e){return void 0!==t?0:void 0}function Fa(t,e){return void 0!==t?t+e:void 0}function ja(t,e){return t[0]+=e[0],t[1]+=e[1],t}function za(t,e){var r=Math.cos(e),n=Math.sin(e),i=t[1]*r+t[0]*n;return t[0]=t[0]*r-t[1]*n,t[1]=i,t}function Ua(t,e){return t[0]*=e,t[1]*=e,t}function Ga(t){return Math.pow(t,3)}function Ha(t){return 1-Ga(1-t)}function Va(t){return 3*t*t-2*t*t*t}function Qa(t){return t}function qa(t){for(var e=[1/0,1/0,-1/0,-1/0],r=0,n=t.length;rt[2]&&(i|=4),nt[3]&&(i|=2),0===i&&(i=1),i}function ts(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}function es(t){return ts(1/0,1/0,-1/0,-1/0,t)}function rs(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ns(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t}function is(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function os(t,e,r,n,i){for(;re[0]?t[0]:e[0],n[1]=t[1]>e[1]?t[1]:e[1],n[2]=t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function As(t){return t[2]1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=Ms,s=0;sa?u=a:u<-a&&(u=-a),o[s+1]=u}return o},Is=function(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;a1)s=r;else{if(p>0){for(var d=0;di&&(i=c),o=s,a=u}return i}function hu(t,e,r,n,i,o,a,s,u,c,l){if(e==r)return c;var h,p;if(0===i){if((p=La(a,s,t[e],t[e+1]))0&&g>d)&&(f<0&&m0&&m>f)?(s=h,u=p):(o[a++]=s,o[a++]=u,c=s,l=u,s=h,u=p)}}return o[a++]=s,o[a++]=u,a}var vu=function(t){function e(e,r){t.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?this.setCoordinates(e,r):this.setFlatCoordinates(r,e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){return n0;){for(var h=c.pop(),p=c.pop(),d=0,f=t[p],g=t[p+1],m=t[h],y=t[h+1],v=p+n;vd&&(l=v,d=A)}d>i&&(u[(l-e)/n]=1,p+no&&(c-s)*(o-u)-(i-s)*(l-u)>0&&a++:l<=o&&(c-s)*(o-u)-(i-s)*(l-u)<0&&a--,s=c,u=l}return 0!==a}function xu(t,e,r,n,i,o){if(0===r.length)return!1;if(!bu(t,e,r[0],n,i,o))return!1;for(var a=1,s=r.length;a=i[0]&&o[2]<=i[2]||o[1]>=i[1]&&o[3]<=i[3]||function(t,e,r,n,i,o){for(var a,s=[t[e],t[e+1]],u=[];e+n=u&&a<=l),n||!(4&o)||4&i||(n=(s=d-(p-l)*f)>=c&&s<=h),n||!(8&o)||8&i||(n=(a=p-(d-c)/f)>=u&&a<=l),n||!(16&o)||16&i||(n=(s=d-(p-u)*f)>=c&&s<=h)}return n}(i,t,e)})))}function Cu(t,e,r,n){for(;e0}function Iu(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a_&&xu(t,0,r,n,c=(l+h)/2,f)&&(A=c,_=b),l=h}return isNaN(A)&&(A=i[0]),[A,f,_]}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new Au(this.getFlatInteriorPoint(),"XYM")},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new vu(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,n=[],i=0,o=0,a=r.length;o1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n),!this.isDef()){var i=arguments[n-1];return i.center&&this.setCenter(i.center),void 0!==i.zoom&&this.setZoom(i.zoom),void 0!==i.rotation&&this.setRotation(i.rotation),void(e&&Pu(e,!0))}for(var o=Date.now(),a=this.getCenter().slice(),s=this.getResolution(),u=this.getRotation(),c=[],l=0;l0},e.prototype.getInteracting=function(){return this.hints_[1]>0},e.prototype.cancelAnimations=function(){this.setHint(0,-this.hints_[0]);for(var t=0,e=this.animations_.length;t=0;--r){for(var n=this.animations_[r],i=!0,o=0,a=n.length;o0?(t-s.start)/s.duration:1;u>=1?(s.complete=!0,u=1):i=!1;var c=s.easing(u);if(s.sourceCenter){var l=s.sourceCenter[0],h=s.sourceCenter[1];this.set("center",[l+c*(s.targetCenter[0]-l),h+c*(s.targetCenter[1]-h)])}if(s.sourceResolution&&s.targetResolution){var p=1===c?s.targetResolution:s.sourceResolution+c*(s.targetResolution-s.sourceResolution);s.anchor&&this.set("center",this.calculateCenterZoom(p,s.anchor)),this.set("resolution",p)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var d=1===c?Ra(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+c*(s.targetRotation-s.sourceRotation);s.anchor&&this.set("center",this.calculateCenterRotate(d,s.anchor)),this.set("rotation",d)}if(e=!0,!s.complete)break}}if(i){this.animations_[r]=null,this.setHint(0,-1);var f=n[0].callback;f&&Pu(f,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},e.prototype.calculateCenterRotate=function(t,e){var r,n=this.getCenter();return void 0!==n&&(za(r=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),ja(r,e)),r},e.prototype.calculateCenterZoom=function(t,e){var r,n=this.getCenter(),i=this.getResolution();return void 0!==n&&void 0!==i&&(r=[e[0]-t*(e[0]-n[0])/i,e[1]-t*(e[1]-n[1])/i]),r},e.prototype.getSizeFromViewport_=function(){var t=[100,100],e='.ol-viewport[data-view="'+Ji(this)+'"]',r=document.querySelector(e);if(r){var n=getComputedStyle(r);t[0]=parseInt(n.width,10),t[1]=parseInt(n.height,10)}return t},e.prototype.constrainCenter=function(t){return this.constraints_.center(t)},e.prototype.constrainResolution=function(t,e,r){return this.constraints_.resolution(t,e||0,r||0)},e.prototype.constrainRotation=function(t,e){return this.constraints_.rotation(t,e||0)},e.prototype.getCenter=function(){return this.get("center")},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){var e=t||this.getSizeFromViewport_();return ps(this.getCenter(),this.getResolution(),this.getRotation(),e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get("resolution")},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){var r=e||this.getSizeFromViewport_(),n=ys(t)/r[0],i=ds(t)/r[1];return Math.max(n,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.maxResolution_,n=Math.log(r/this.minResolution_)/Math.log(e);return function(t){return r/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get("rotation")},e.prototype.getValueForResolutionFunction=function(t){var e=t||2,r=this.maxResolution_,n=Math.log(r/this.minResolution_)/Math.log(e);return function(t){return Math.log(r/t)/Math.log(e)/n}},e.prototype.getState=function(t){var e=this.getCenter(),r=this.getProjection(),n=this.getResolution(),i=n/t,o=this.getRotation();return{center:[Math.round(e[0]/i)*i,Math.round(e[1]/i)*i],projection:void 0!==r?r:null,resolution:n,rotation:o,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,r,n=this.minZoom_||0;if(this.resolutions_){var i=ma(this.resolutions_,t,1);n=i,e=this.resolutions_[i],r=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,r=this.zoomFactor_;return n+Math.log(e/t)/Math.log(r)},e.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},e.prototype.fit=function(t,e){var r,n=e||{},i=n.size;i||(i=this.getSizeFromViewport_()),Array.isArray(t)?r=Su(t):"Circle"===t.getType()?(r=Su(t=t.getExtent())).rotate(this.getRotation(),ls(t)):r=t;var o,a=void 0!==n.padding?n.padding:[0,0,0,0],s=void 0===n.constrainResolution||n.constrainResolution,u=void 0!==n.nearest&&n.nearest;o=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.constrainResolution(this.maxResolution_,n.maxZoom-this.minZoom_,0):0;for(var c=r.getFlatCoordinates(),l=this.getRotation(),h=Math.cos(-l),p=Math.sin(-l),d=1/0,f=1/0,g=-1/0,m=-1/0,y=r.getStride(),v=0,A=c.length;v=0;--n)if(t[n]!=e[n]){r=!1;break}return r}(t.sourceCenter,t.targetCenter))&&t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation}function Lu(t,e){var r=document.createElement("canvas");return t&&(r.width=t),e&&(r.height=e),r.getContext("2d")}function ku(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function Ru(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var Du=function(t){function e(e){t.call(this);var r=to({},e);r.opacity=void 0!==e.opacity?e.opacity:1,r.visible=void 0===e.visible||e.visible,r.zIndex=e.zIndex,r.maxResolution=void 0!==e.maxResolution?e.maxResolution:1/0,r.minResolution=void 0!==e.minResolution?e.minResolution:0,this.setProperties(r),this.state_=null}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getType=function(){return this.type},e.prototype.getLayerState=function(){var t=this.state_||{layer:this,managed:!0};return t.opacity=Ta(this.getOpacity(),0,1),t.sourceState=this.getSourceState(),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=this.getZIndex()||0,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),this.state_=t,t},e.prototype.getLayersArray=function(t){return Zi()},e.prototype.getLayerStatesArray=function(t){return Zi()},e.prototype.getExtent=function(){return this.get("extent")},e.prototype.getMaxResolution=function(){return this.get("maxResolution")},e.prototype.getMinResolution=function(){return this.get("minResolution")},e.prototype.getOpacity=function(){return this.get("opacity")},e.prototype.getSourceState=function(){return Zi()},e.prototype.getVisible=function(){return this.get("visible")},e.prototype.getZIndex=function(){return this.get("zIndex")},e.prototype.setExtent=function(t){this.set("extent",t)},e.prototype.setMaxResolution=function(t){this.set("maxResolution",t)},e.prototype.setMinResolution=function(t){this.set("minResolution",t)},e.prototype.setOpacity=function(t){this.set("opacity",t)},e.prototype.setVisible=function(t){this.set("visible",t)},e.prototype.setZIndex=function(t){this.set("zIndex",t)},e}(bo),Bu=function(t){function e(e){var r=e||{},n=to({},r);delete n.layers;var i=r.layers;t.call(this,n),this.layersListenerKeys_=[],this.listenerKeys_={},so(this,wo("layers"),this.handleLayersChanged_,this),i?Array.isArray(i)&&(i=new Eo(i.slice(),{unique:!0})):i=new Eo(void 0,{unique:!0}),this.setLayers(i)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(lo),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(so(t,"add",this.handleLayersAdd_,this),so(t,"remove",this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(lo);eo(this.listenerKeys_);for(var r=t.getArray(),n=0,i=r.length;n=0;r--){var n=e[r];if(n.getActive()&&!n.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,n=r;if(t){var i=t.viewHints;i[0]&&(r=this.loadTilesWhileAnimating_?8:0,n=2),i[1]&&(r=this.loadTilesWhileInteracting_?8:0,n=2)}e.getTilesLoading()0&&t[1]>0}(r)&&n&&n.isDef()){for(var s=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),u=this.getLayerGroup().getLayerStatesArray(),c={},l=0,h=u.length;l=t.minResolution&&e0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!va(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,i=e.length;n0?t.animate({rotation:0,duration:this.duration_,easing:Ha}):t.setRotation(0))},e}(Uu);function Yu(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var n="rotate("+r+"rad)";if(this.autoHide_){var i=this.element.classList.contains("ol-hidden");i||0!==r?i&&0!==r&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.msTransform=n,this.label_.style.webkitTransform=n,this.label_.style.transform=n}this.rotation_=r}}var Xu=function(t){function e(e){var r=e||{};t.call(this,{element:document.createElement("div"),target:r.target});var n=void 0!==r.className?r.className:"ol-zoom",i=void 0!==r.delta?r.delta:1,o=void 0!==r.zoomInLabel?r.zoomInLabel:"+",a=void 0!==r.zoomOutLabel?r.zoomOutLabel:"−",s=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",u=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=n+"-in",c.setAttribute("type","button"),c.title=s,c.appendChild("string"==typeof o?document.createTextNode(o):o),so(c,"click",this.handleClick_.bind(this,i));var l=document.createElement("button");l.className=n+"-out",l.setAttribute("type","button"),l.title=u,l.appendChild("string"==typeof a?document.createTextNode(a):a),so(l,"click",this.handleClick_.bind(this,-i));var h=this.element;h.className=n+" ol-unselectable ol-control",h.appendChild(c),h.appendChild(l),this.duration_=void 0!==r.duration?r.duration:250}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var r=e.getResolution();if(r){var n=e.constrainResolution(r,t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:n,duration:this.duration_,easing:Ha})):e.setResolution(n)}}},e}(Uu),Zu=function(t,e,r){this.decay_=t,this.minVelocity_=e,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0};Zu.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},Zu.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},Zu.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[r+2]>t;)r-=3;var n=this.points_[e+2]-this.points_[r+2];if(n<1e3/60)return!1;var i=this.points_[e]-this.points_[r],o=this.points_[e+1]-this.points_[r+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/n,this.initialVelocity_>this.minVelocity_},Zu.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},Zu.prototype.getAngle=function(){return this.angle_};var Ku=function(t){function e(e){t.call(this),e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getActive=function(){return this.get("active")},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set("active",t)},e.prototype.setMap=function(t){this.map_=t},e}(bo);function Ju(t,e,r,n){e=t.constrainRotation(e,0),$u(t,e,r,n)}function $u(t,e,r,n){if(void 0!==e){var i=t.getRotation(),o=t.getCenter();void 0!==i&&o&&n>0?t.animate({rotation:e,anchor:r,duration:n,easing:Ha}):t.rotate(e,r)}}function tc(t,e,r,n){var i=t.getResolution(),o=t.constrainResolution(i,e,0);if(void 0!==o){var a=t.getResolutions();o=Ta(o,t.getMinResolution()||a[a.length-1],t.getMaxResolution()||a[0])}if(r&&void 0!==o&&o!==i){var s=t.getCenter(),u=t.calculateCenterZoom(o,r);u=t.constrainCenter(u),r=[(o*s[0]-i*u[0])/(o-i),(o*s[1]-i*u[1])/(o-i)]}ec(t,o,r,n)}function ec(t,e,r,n){if(e){var i=t.getResolution(),o=t.getCenter();if(void 0!==i&&o&&e!==i&&n)t.animate({resolution:e,anchor:r,duration:n,easing:Ha});else{if(r){var a=t.calculateCenterZoom(e,r);t.setCenter(a)}t.setResolution(e)}}}var rc=function(t){function e(e){t.call(this,{handleEvent:nc});var r=e||{};this.delta_=r.delta?r.delta:1,this.duration_=void 0!==r.duration?r.duration:250}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Ku);function nc(t){var e=!1;if(t.type==Fo.DBLCLICK){var r=t.coordinate,n=t.originalEvent.shiftKey?-this.delta_:this.delta_;tc(t.map.getView(),n,r,this.duration_),t.preventDefault(),e=!0}return!e}var ic=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},oc=function(t){return t.target.getTargetElement()===document.activeElement},ac=po,sc=function(t){var e=t.originalEvent;return 0==e.button&&!(Oo&&Lo&&e.ctrlKey)},uc=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},cc=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},lc=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},hc=function(t){return"mouse"==t.pointerEvent.pointerType},pc=function(t){function e(e){var r=e||{};t.call(this,r),r.handleDownEvent&&(this.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(this.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(this.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(this.handleUpEvent=r.handleUpEvent),r.stopDown&&(this.stopDown=r.stopDown),this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.pointerEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Fo.POINTERDRAG)this.handleDragEvent(t);else if(t.type==Fo.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==Fo.POINTERDOWN){var n=this.handleDownEvent(t);n&&t.preventDefault(),this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Fo.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===Fo.POINTERDOWN||e===Fo.POINTERDRAG||e===Fo.POINTERUP}(t)){var e=t.pointerEvent,r=e.pointerId.toString();t.type==Fo.POINTERUP?delete this.trackedPointers_[r]:(t.type==Fo.POINTERDOWN||r in this.trackedPointers_)&&(this.trackedPointers_[r]=e),this.targetPointers=function(t){var e=[];for(var r in t)e.push(t[r]);return e}(this.trackedPointers_)}},e}(Ku);function dc(t){for(var e=t.length,r=0,n=0,i=0;i0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(pc),gc=function(t){function e(e){var r=e||{};t.call(this,{stopDown:fo}),this.condition_=r.condition?r.condition:ic,this.lastAngle_=void 0,this.duration_=void 0!==r.duration?r.duration:250}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleDragEvent=function(t){if(hc(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==Na){var n=e.getSize(),i=t.pixel,o=Math.atan2(n[1]/2-i[1],i[0]-n[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_,s=r.getRotation();$u(r,s-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){if(!hc(t))return!0;var e=t.map.getView();e.setHint(1,-1);var r=e.getRotation();return Ju(e,r,void 0,this.duration_),!1},e.prototype.handleDownEvent=function(t){return!(!hc(t)||!sc(t)||!this.condition_(t)||(t.map.getView().setHint(1,1),this.lastAngle_=void 0,0))},e}(pc),mc=function(t){function e(e){t.call(this),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r=this.element_.style;r.left=Math.min(t[0],e[0])+"px",r.top=Math.min(t[1],e[1])+"px",r.width=Math.abs(e[0]-t[0])+"px",r.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left=e.top=e.width=e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new Mu([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(ho),yc=function(t){function e(e,r,n){t.call(this,e),this.coordinate=r,this.mapBrowserEvent=n}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(mo),vc=function(t){function e(e){var r=e||{};t.call(this,{condition:r.condition?r.condition:cc,className:r.className||"ol-dragzoom",onBoxEnd:Ac}),this.duration_=void 0!==r.duration?r.duration:200,this.out_=void 0!==r.out&&r.out}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(function(t){function e(e){t.call(this);var r=e||{};this.box_=new mc(r.className||"ol-dragbox"),this.minArea_=void 0!==r.minArea?r.minArea:64,this.onBoxEnd_=r.onBoxEnd?r.onBoxEnd:go,this.startPixel_=null,this.condition_=r.condition?r.condition:ac,this.boxEndCondition_=r.boxEndCondition?r.boxEndCondition:this.defaultBoxEndCondition}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.defaultBoxEndCondition=function(t,e,r){var n=r[0]-e[0],i=r[1]-e[1];return n*n+i*i>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){hc(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new yc("boxdrag",t.coordinate,t)))},e.prototype.handleUpEvent=function(t){return!hc(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new yc("boxend",t.coordinate,t))),!1)},e.prototype.handleDownEvent=function(t){return!(!hc(t)||!sc(t)||!this.condition_(t)||(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new yc("boxstart",t.coordinate,t)),0))},e}(pc));function Ac(){var t=this.getMap(),e=t.getView(),r=t.getSize(),n=this.getGeometry().getExtent();if(this.out_){var i=e.calculateExtent(r),o=function(t,e){return function(t,e){for(var r=0,n=e.length;rthis.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel"),"trackpad"===this.mode_){var a=n.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):a.setHint(1,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var s=a.getResolution()*Math.pow(2,r/this.trackpadDeltaPerZoom_),u=a.getMinResolution(),c=a.getMaxResolution(),l=0;if(sc&&(s=Math.min(s,c*this.trackpadZoomBuffer_),l=-1),this.lastAnchor_){var h=a.calculateCenterZoom(s,this.lastAnchor_);a.setCenter(a.constrainCenter(h))}return a.setResolution(s),0===l&&this.constrainResolution_&&a.animate({resolution:a.constrainResolution(s,r>0?-1:1),easing:Ha,anchor:this.lastAnchor_,duration:this.duration_}),l>0?a.animate({resolution:u,easing:Ha,anchor:this.lastAnchor_,duration:500}):l<0&&a.animate({resolution:c,easing:Ha,anchor:this.lastAnchor_,duration:500}),this.startTime_=o,!1}this.delta_+=r;var p=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),p),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations(),tc(e,-Ta(this.delta_,-1,1),this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Ku),Ec=function(t){function e(e){var r=e||{},n=r;n.stopDown||(n.stopDown=fo),t.call(this,n),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==r.threshold?r.threshold:.3,this.duration_=void 0!==r.duration?r.duration:250}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],n=this.targetPointers[1],i=Math.atan2(n.clientY-r.clientY,n.clientX-r.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Na){var u=a.getViewport().getBoundingClientRect(),c=dc(this.targetPointers);if(c[0]-=u.left,c[1]-=u.top,this.anchor_=a.getCoordinateFromPixel(c),this.rotating_){var l=s.getRotation();a.render(),$u(s,l+e,this.anchor_)}}},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView();if(e.setHint(1,-1),this.rotating_){var r=e.getRotation();Ju(e,r,this.anchor_,this.duration_)}return!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().setHint(1,1),!0}return!1},e}(pc),Ic=function(t){function e(e){var r=e||{},n=r;n.stopDown||(n.stopDown=fo),t.call(this,n),this.constrainResolution_=r.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==r.duration?r.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],n=this.targetPointers[1],i=r.clientX-n.clientX,o=r.clientY-n.clientY,a=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,u=s.getView(),c=u.getResolution(),l=u.getMaxResolution(),h=u.getMinResolution(),p=c*e;p>l?(e=l/c,p=l):pe.getMaxResolution())&&function(t,e,r,n,i){e=t.constrainResolution(e,0,i),ec(t,e,r,n)}(e,r,this.anchor_,this.duration_,this.lastScaleDelta_-1),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().setHint(1,1),!0}return!1},e}(pc);function Mc(t,e,r,n){for(var i=t[e],o=t[e+1],a=0,s=e+n;sthis.highWaterMark},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent("clear")},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t,e){for(var r=this.oldest_;r;)t.call(e,r.value_,r.key_,this),r=r.newer},e.prototype.get=function(t){var e=this.entries_[t];return e===this.newest_||(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e),e.value_},e.prototype.remove=function(t){var e=this.entries_[t];return e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},e.prototype.getValues=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},e.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},e.prototype.set=function(t,e){var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},e.prototype.setSize=function(t){this.highWaterMark=t},e.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},e}(vo),Lc=[0,0,0,1],kc=[],Rc=[0,0,0,1],Dc=[0,0,0,0],Bc=new Oc,Nc={},Fc=null,jc={},zc=function(){var t,e,r=Nc,n=["monospace","serif"],i=n.length,o="wmytzilWMYTZIL@#/&?$%10";function a(t){for(var r=Uc(),a=100;a<=700;a+=300){for(var s=a+" ",u=!0,c=0;ce?1:0}return function(r,n,i,o,a){!function e(r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1);e(r,n,Math.max(i,Math.floor(n-u*l/s+h)),Math.min(o,Math.floor(n+(s-u)*l/s+h)),a)}var p=r[n],d=i,f=o;for(t(r,i,n),a(r[o],p)>0&&t(r,i,o);d0;)f--}0===a(r[i],p)?t(r,i,f):t(r,++f,o),f<=n&&(i=f+1),n<=f&&(o=f-1)}}(r,n,i||0,o||r.length-1,a||e)}}()})),Jc=tl,$c=tl;function tl(t,e){if(!(this instanceof tl))return new tl(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function el(t,e,r){if(!r)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function hl(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function pl(t,e,r,n,i){for(var o,a=[e,r];a.length;)(r=a.pop())-(e=a.pop())<=n||(o=e+Math.ceil((r-e)/n/2)*n,Kc(t,o,e,r,i),a.push(e,o,o,r))}tl.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!ll(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),a=hl(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,rl(r,this.toBBox),rl(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)},_splitRoot:function(t,e){this.data=hl([t,e]),this.data.height=t.height+1,this.data.leaf=!1,rl(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,s,u,c,l,h,p,d,f,g,m;for(u=c=1/0,n=e;n<=r-e;n++)h=i=nl(t,0,n,this.toBBox),p=o=nl(t,n,r,this.toBBox),d=Math.max(h.minX,p.minX),f=Math.max(h.minY,p.minY),g=Math.min(h.maxX,p.maxX),m=Math.min(h.maxY,p.maxY),a=Math.max(0,g-d)*Math.max(0,m-f),s=sl(i)+sl(o),a=e;i--)o=t.children[i],il(u,t.leaf?a(o):o),c+=ul(u);return c},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)il(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():rl(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}},Jc.default=$c;var dl=function(t){function e(e,r,n,i,o){t.call(this,e,r,n,void 0!==o?0:2),this.loader_=void 0!==o?o:null,this.canvas_=i,this.error_=null}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=3):this.state=2,this.changed()},e.prototype.load=function(){0==this.state&&(this.state=1,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(function(t){function e(e,r,n,i){t.call(this),this.extent=e,this.pixelRatio_=n,this.resolution=r,this.state=i}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.changed=function(){this.dispatchEvent("change")},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Zi()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){Zi()},e}(vo)),fl=function(t){function e(e,r,n,i,o){t.call(this,e),this.vectorContext=r,this.frameState=n,this.context=i,this.glContext=o}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(mo),gl=function(){};gl.prototype.drawCustom=function(t,e,r){},gl.prototype.drawGeometry=function(t){},gl.prototype.setStyle=function(t){},gl.prototype.drawCircle=function(t,e){},gl.prototype.drawFeature=function(t,e){},gl.prototype.drawGeometryCollection=function(t,e){},gl.prototype.drawLineString=function(t,e){},gl.prototype.drawMultiLineString=function(t,e){},gl.prototype.drawMultiPoint=function(t,e){},gl.prototype.drawMultiPolygon=function(t,e){},gl.prototype.drawPoint=function(t,e){},gl.prototype.drawPolygon=function(t,e){},gl.prototype.drawText=function(t,e){},gl.prototype.setFillStrokeStyle=function(t,e){},gl.prototype.setImageStyle=function(t,e){},gl.prototype.setTextStyle=function(t,e){};var ml=function(t){function e(e,r,n,i,o){t.call(this),this.context_=e,this.pixelRatio_=r,this.extent_=n,this.transform_=i,this.viewRotation_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.drawImages_=function(t,e,r,n){if(this.image_){var i=_s(t,e,r,2,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,s=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=s*this.imageOpacity_);var u=this.imageRotation_;this.imageRotateWithView_&&(u+=this.viewRotation_);for(var c=0,l=i.length;cthis.maxCacheSize_){var t=0;for(var e in this.cache_)0!=(3&t++)||this.cache_[e].hasListener()||(delete this.cache_[e],--this.cacheSize_)}},yl.prototype.get=function(t,e,r){var n=vl(t,e,r);return n in this.cache_?this.cache_[n]:null},yl.prototype.set=function(t,e,r,n){var i=vl(t,e,r);this.cache_[i]=n,++this.cacheSize_},yl.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var Al=new yl,_l=function(t){function e(e){t.call(this),this.map_=e,this.layerRenderers_={},this.layerRendererListeners_={},this.layerRendererConstructors_=[]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.dispatchRenderEvent=function(t,e){Zi()},e.prototype.registerLayerRenderers=function(t){this.layerRendererConstructors_.push.apply(this.layerRendererConstructors_,t)},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;iu(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),function(t){var e,r=(e=t)[0]*e[3]-e[1]*e[2],n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5];t[0]=a/r,t[1]=-i/r,t[2]=-o/r,t[3]=n/r,t[4]=(o*u-a*s)/r,t[5]=-(n*u-i*s)/r}(tu(n,r))},e.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_)this.removeLayerRendererByKey_(t).dispose()},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o,a){var s,u=e.viewState,c=u.resolution;function l(t,r){var o=e.layerStates[Ji(r)].managed;if(!(Ji(t)in e.skippedFeatureUids)||o)return n.call(i,t,o?r:null)}var h=u.projection,p=t;if(h.canWrapX()){var d=h.getExtent(),f=ys(d),g=t[0];(gd[2])&&(p=[g+f*Math.ceil((d[0]-g)/f),t[1]])}var m,y=e.layerStatesArray;for(m=y.length-1;m>=0;--m){var v=y[m],A=v.layer;if(Vu(v,c)&&o.call(a,A)){var _=this.getLayerRenderer(A),b=A.getSource();if(b&&(s=_.forEachFeatureAtCoordinate(b.getWrapX()?p:t,e,r,l)),s)return s}}},e.prototype.forEachLayerAtPixel=function(t,e,r,n,i,o,a){return Zi()},e.prototype.hasFeatureAtCoordinate=function(t,e,r,n,i){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,po,this,n,i)},e.prototype.getLayerRenderer=function(t){var e=Ji(t);if(e in this.layerRenderers_)return this.layerRenderers_[e];for(var r,n=0,i=this.layerRendererConstructors_.length;n=0;--u){var d=l[u],f=d.layer;if(Vu(d,c)&&o.call(a,f)&&(s=this.getLayerRenderer(f).forEachLayerAtCoordinate(p,e,r,n,i)))return s}},e.prototype.registerLayerRenderers=function(e){t.prototype.registerLayerRenderers.call(this,e);for(var r=0,n=e.length;r=0||wl.push(i)}},e}(_l),El=function(t){function e(e){t.call(this,e),this.transform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clip=function(t,e,r){var n=e.pixelRatio,i=e.size[0]*n,o=e.size[1]*n,a=e.viewState.rotation,s=gs(r),u=ms(r),c=cs(r),l=us(r);eu(e.coordinateToPixelTransform,s),eu(e.coordinateToPixelTransform,u),eu(e.coordinateToPixelTransform,c),eu(e.coordinateToPixelTransform,l),t.save(),qc(t,-a,i/2,o/2),t.beginPath(),t.moveTo(s[0]*n,s[1]*n),t.lineTo(u[0]*n,u[1]*n),t.lineTo(c[0]*n,c[1]*n),t.lineTo(l[0]*n,l[1]*n),t.clip(),qc(t,a,i/2,o/2)},e.prototype.dispatchComposeEvent_=function(t,e,r,n){var i=this.getLayer();if(i.hasListener(t)){var o=r.size[0]*r.pixelRatio,a=r.size[1]*r.pixelRatio,s=r.viewState.rotation;qc(e,-s,o/2,a/2);var u=void 0!==n?n:this.getTransform(r,0),c=new ml(e,r.pixelRatio,r.extent,u,r.viewState.rotation),l=new fl(t,c,r,e,null);i.dispatchEvent(l),qc(e,s,o/2,a/2)}},e.prototype.forEachLayerAtCoordinate=function(t,e,r,n,i){return this.forEachFeatureAtCoordinate(t,e,r,po)?n.call(i,this.getLayer(),null):void 0},e.prototype.postCompose=function(t,e,r,n){this.dispatchComposeEvent_("postcompose",t,e,n)},e.prototype.preCompose=function(t,e,r){this.dispatchComposeEvent_("precompose",t,e,r)},e.prototype.dispatchRenderEvent=function(t,e,r){this.dispatchComposeEvent_("render",t,e,r)},e.prototype.getTransform=function(t,e){var r=t.viewState,n=t.pixelRatio,i=n/r.resolution;return iu(this.transform_,n*t.size[0]/2,n*t.size[1]/2,i,-i,-r.rotation,-r.center[0]+e,-r.center[1])},e.prototype.composeFrame=function(t,e,r){Zi()},e.prototype.prepareFrame=function(t,e){return Zi()},e}(function(t){function e(e){t.call(this),this.layer_=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createLoadedTileFinder=function(t,e,r){return function(n,i){return t.forEachLoadedTile(e,n,i,(function(t){r[n]||(r[n]={}),r[n][t.tileCoord.toString()]=t}))}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n){},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},e.prototype.hasFeatureAtCoordinate=function(t,e){return!1},e.prototype.loadImage=function(t){var e=t.getState();return 2!=e&&3!=e&&so(t,"change",this.handleImageChange_,this),0==e&&(t.load(),e=t.getState()),2==e},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&"ready"==t.getSourceState()&&this.changed()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(t,e,r){var n=Ji(t);n in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,e,r,n){var i=Ji(e),o=r.toString();i in t?o in t[i]?t[i][o].extend(n):t[i][o]=n:(t[i]={},t[i][o]=n)},e.prototype.manageTilePyramid=function(t,e,r,n,i,o,a,s,u,c){var l=Ji(e);l in t.wantedTiles||(t.wantedTiles[l]={});var h,p,d,f,g,m,y=t.wantedTiles[l],v=t.tileQueue;for(m=r.getMinZoom();m<=a;++m)for(p=r.getTileRangeForExtentAndZ(o,m,p),d=r.getResolution(m),f=p.minX;f<=p.maxX;++f)for(g=p.minY;g<=p.maxY;++g)a-m<=s?(0==(h=e.getTile(m,f,g,n,i)).getState()&&(y[h.getKey()]=!0,v.isKeyQueued(h.getKey())||v.enqueue([h,l,r.getTileCoordCenter(h.tileCoord),d])),void 0!==u&&u.call(c,h)):e.useTile(m,f,g,i)},e}(Ao)),Il=function(t){function e(e){t.call(this,e),this.coordinateToCanvasPixelTransform=[1,0,0,1,0,0],this.hitCanvasContext_=null}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.composeFrame=function(t,e,r){this.preCompose(r,t);var n=this.getImage();if(n){var i=e.extent,o=void 0!==i&&!Ka(i,t.extent)&&vs(i,t.extent);o&&this.clip(r,t,i);var a=this.getImageTransform(),s=r.globalAlpha;r.globalAlpha=e.opacity;var u=a[5],c=n.width*a[0],l=n.height*a[3];c>=.5&&l>=.5&&r.drawImage(n,0,0,+n.width,+n.height,Math.round(a[4]),Math.round(u),Math.round(c),Math.round(l)),r.globalAlpha=s,o&&r.restore()}this.postCompose(r,t,e)},e.prototype.getImage=function(){return Zi()},e.prototype.getImageTransform=function(){return Zi()},e.prototype.forEachLayerAtCoordinate=function(t,e,r,n,i){if(this.getImage()){var o=eu(this.coordinateToCanvasPixelTransform,t.slice());Ua(o,e.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=Lu(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),o[0],o[1],1,1,0,0,1,1);var a=this.hitCanvasContext_.getImageData(0,0,1,1).data;return a[3]>0?n.call(i,this.getLayer(),a):void 0}},e}(El),Ml=function(t){function e(r){if(t.call(this,r),this.image_=null,this.imageTransform_=[1,0,0,1,0,0],this.skippedFeatures_=[],this.vectorRenderer_=null,"VECTOR"===r.getType())for(var n=0,i=wl.length;nthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},Sl.prototype.getHeight=function(){return this.maxY-this.minY+1},Sl.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},Sl.prototype.getWidth=function(){return this.maxX-this.minX+1},Sl.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var Pl=function(t){function e(e,r){t.call(this,e),this.context=r?null:Lu(),this.renderedExtent_=null,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=[1/0,1/0,-1/0,-1/0],this.tmpTileRange_=new Sl(0,0,0,0),this.imageTransform_=[1,0,0,1,0,0],this.zDirection=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return 2==r||4==r||3==r&&!n},e.prototype.getTile=function(t,e,r,n,i){var o=this.getLayer(),a=o.getSource().getTile(t,e,r,n,i);return 3==a.getState()&&(o.getUseInterimTilesOnError()?o.getPreload()>0&&(this.newTiles_=!0):a.setState(2)),this.isDrawableTile_(a)||(a=a.getInterimTile()),a},e.prototype.prepareFrame=function(t,e){var r=t.pixelRatio,n=t.size,i=t.viewState,o=i.projection,a=i.resolution,s=i.center,u=this.getLayer(),c=u.getSource(),l=c.getRevision(),h=c.getTileGridForProjection(o),p=h.getZForResolution(a,this.zDirection),d=h.getResolution(p),f=Math.round(a/d)||1,g=t.extent;if(void 0!==e.extent&&(g=fs(g,e.extent)),As(g))return!1;var m=h.getTileRangeForExtentAndZ(g,p),y=h.getTileRangeExtent(p,m),v=c.getTilePixelRatio(r),A={};A[p]={};var _,b,x,w=this.createLoadedTileFinder(c,o,A),C=t.viewHints,E=C[0]||C[1],I=this.tmpExtent,M=this.tmpTileRange_;for(this.newTiles_=!1,b=m.minX;b<=m.maxX;++b)for(x=m.minY;x<=m.maxY;++x)if(!(Date.now()-t.time>16&&E)){if(_=this.getTile(p,b,x,r,o),this.isDrawableTile_(_)){var S=Ji(this);if(2==_.getState()){A[p][_.tileCoord.toString()]=_;var T=_.inTransition(S);this.newTiles_||!T&&-1!==this.renderedTiles.indexOf(_)||(this.newTiles_=!0)}if(1===_.getAlpha(S,t.time))continue}var P=h.getTileCoordChildTileRange(_.tileCoord,M,I),O=!1;P&&(O=w(p+1,P)),O||h.forEachTileCoordParentTileRange(_.tileCoord,w,null,M,I)}var L=d*r/v*f;if(!(this.renderedResolution&&Date.now()-t.time>16&&E)&&(this.newTiles_||!this.renderedExtent_||!Ka(this.renderedExtent_,g)||this.renderedRevision!=l||f!=this.oversampling_||!E&&L!=this.renderedResolution)){var k=this.context;if(k){var R=c.getTilePixelSize(p,r,o),D=Math.round(m.getWidth()*R[0]/f),B=Math.round(m.getHeight()*R[1]/f),N=k.canvas;N.width!=D||N.height!=B?(this.oversampling_=f,N.width=D,N.height=B):((this.renderedExtent_&&!rs(y,this.renderedExtent_)||this.renderedRevision!=l)&&k.clearRect(0,0,D,B),f=this.oversampling_)}this.renderedTiles.length=0;var F,j,z,U,G,H,V,Q,q=Object.keys(A).map(Number);for(q.sort((function(t,e){return t===p?1:e===p?-1:t>e?1:t0},e.prototype.drawTileImage=function(t,e,r,n,i,o,a,s,u){var c=this.getTileImage(t);if(c){var l=Ji(this),h=u?t.getAlpha(l,e.time):1,p=this.getLayer().getSource();1!==h||p.getOpaque(e.viewState.projection)||this.context.clearRect(n,i,o,a);var d=h!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=h),this.context.drawImage(c,s,s,c.width-2*s,c.height-2*s,n,i,o,a),d&&this.context.restore(),1!==h?e.animate=!0:u&&t.endTransition(l)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getImageTransform=function(){return this.imageTransform_},e.prototype.getTileImage=function(t){return t.getImage()},e}(Il);Pl.handles=function(t){return"TILE"===t.getType()},Pl.create=function(t,e){return new Pl(e)};var Ol=function(){};function Ll(t,e,r,n,i,o,a,s){for(var u,c,l=[],h=t[e]>t[r-n],p=i.length,d=t[e],f=t[e+1],g=t[e+=n],m=t[e+1],y=0,v=Math.sqrt(Math.pow(g-d,2)+Math.pow(m-f,2)),A="",_=0,b=0;b0?-Math.PI:Math.PI),void 0!==c){var M=I-c;if(M+=M>Math.PI?-2*Math.PI:M<-Math.PI?2*Math.PI:0,Math.abs(M)>s)return null}var S=E/v,T=Da(d,g,S),P=Da(f,m,S);c==I?(h&&(u[0]=T,u[1]=P,u[2]=w/2),u[4]=A):(_=w,u=[T,P,w/2,I,A=x],h?l.unshift(u):l.push(u),c=I),a+=w}return l}Ol.prototype.getReplay=function(t,e){return Zi()},Ol.prototype.isEmpty=function(){return Zi()},Ol.prototype.addDeclutter=function(t){return Zi()};var kl=[8],Rl=[12],Dl=[1],Bl=[3],Nl=["Polygon","Circle","LineString","Image","Text","Default"],Fl={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},jl=[1/0,1/0,-1/0,-1/0],zl=[1,0,0,1,0,0],Ul=function(t){function e(e,r,n,i,o,a){t.call(this),this.declutterTree=a,this.tolerance=e,this.maxExtent=r,this.overlaps=o,this.pixelRatio=i,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.replayTextBackground_=function(t,e,r,n,i,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},e.prototype.replayImage_=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y){var v,A,_,b,x=m||y,w=f+c>n.width?n.width-c:f,C=s+l>n.height?n.height-l:s,E=g[3]+w*p+g[1],I=g[0]+C*p+g[2],M=(e-=i*=p)-g[3],S=(r-=o*=p)-g[0];(x||0!==h)&&(v=[M,S],A=[M+E,S],_=[M+E,S+I],b=[M,S+I]);var T=null;if(0!==h){var P=e+i,O=r+o;T=iu(zl,P,O,1,1,h,-P,-O),es(jl),is(jl,eu(zl,v)),is(jl,eu(zl,A)),is(jl,eu(zl,_)),is(jl,eu(zl,b))}else ts(M,S,M+E,S+I,jl);var L=t.canvas,k=y?y[2]*p/2:0,R=jl[0]-k<=L.width&&jl[2]+k>=0&&jl[1]-k<=L.height&&jl[3]+k>=0;if(d&&(e=Math.round(e),r=Math.round(r)),a){if(!R&&1==a[4])return;ns(a,jl);var D=R?[t,T?T.slice(0):null,u,n,c,l,w,C,e,r,p]:null;D&&x&&D.push(m,y,v,A,_,b),a.push(D)}else R&&(x&&this.replayTextBackground_(t,v,A,_,b,m,y),Yc(t,T,u,n,c,l,w,C,e,r,p))},e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatCoordinates=function(t,e,r,n,i,o){var a=this.coordinates.length,s=this.getBufferedMaxExtent();o&&(e+=n);var u,c,l,h=[t[e],t[e+1]],p=[NaN,NaN],d=!0;for(u=e+n;u5){var r=t[4];if(1==r||r==t.length-5){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(!this.declutterTree.collides(n)){this.declutterTree.insert(n);for(var i=5,o=t.length;i11&&this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12]),Yc.apply(void 0,a))}}t.length=5,es(t)}}},e.prototype.replay_=function(t,e,r,n,i,o,a){var s;this.pixelCoordinates_&&va(e,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=_s(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),tu(this.renderedTransform_,e));for(var u,c,l,h,p,d,f,g,m,y,v,A,_=!ro(r),b=0,x=n.length,w=0,C=0,E=0,I=null,M=null,S=this.coordinateCache_,T=this.viewRotation_,P={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:T},O=this.instructions!=n||this.overlaps?0:200;bO&&(this.fill_(t),C=0),E>O&&(t.stroke(),E=0),C||E||(t.beginPath(),h=p=NaN),++b;break;case 2:var k=s[w=L[1]],R=s[w+1],D=s[w+2]-k,B=s[w+3]-R,N=Math.sqrt(D*D+B*B);t.moveTo(k+N,R),t.arc(k,R,N,0,2*Math.PI,!0),++b;break;case 3:t.closePath(),++b;break;case 4:w=L[1],u=L[2];var F=L[4],j=6==L.length?L[5]:void 0;P.geometry=L[3],P.feature=y,b in S||(S[b]=[]);var z=S[b];j?j(s,w,u,2,z):(z[0]=s[w],z[1]=s[w+1],z.length=2),F(z,P),++b;break;case 6:w=L[1],u=L[2],m=L[3],c=L[4],l=L[5],g=o?null:L[6];var U=L[7],G=L[8],H=L[9],V=L[10],Q=L[12],q=L[13],W=L[14],Y=void 0,X=void 0,Z=void 0;for(L.length>16?(Y=L[15],X=L[16],Z=L[17]):(Y=Dc,X=Z=!1),L[11]&&(Q+=T);wthis.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t,e){var r=t.fillStyle,n=[10,r];return"string"!=typeof r&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[11,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e,r){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t,r)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,n=t.lineCap,i=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,u=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=n||i!=t.currentLineDash&&!va(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=u)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=n,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=u)},e.prototype.endGeometry=function(t,e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var r=[7,e];this.instructions.push(r),this.hitDetectionInstructions.push(r)},e.prototype.getBufferedMaxExtent=function(){return this.bufferedMaxExtent_||(this.bufferedMaxExtent_=Ya(this.maxExtent),this.maxLineWidth>0&&Wa(this.bufferedMaxExtent_,this.resolution*(this.maxLineWidth+1)/2,this.bufferedMaxExtent_)),this.bufferedMaxExtent_},e}(gl),Gl=function(t){function e(e,r,n,i,o,a){t.call(this,e,r,n,i,o,a),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.drawCoordinates_=function(t,e,r,n){return this.appendFlatCoordinates(t,e,r,n,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,n);this.instructions.push([6,i,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([6,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.drawCoordinates_(r,0,r.length,n);this.instructions.push([6,i,o,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([6,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0},e.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),n=t.getSize(),i=t.getHitDetectionImage(1),o=t.getImage(1),a=t.getOrigin();this.anchorX_=r[0],this.anchorY_=r[1],this.declutterGroup_=e,this.hitDetectionImage_=i,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=a[0],this.originY_=a[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.width_=n[0]},e}(Ul),Hl=function(t){function e(e,r,n,i,o,a){t.call(this,e,r,n,i,o,a)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.drawFlatCoordinates_=function(t,e,r,n){var i=[9,this.coordinates.length,this.appendFlatCoordinates(t,e,r,n,!1,!1)];return this.instructions.push(i),this.hitDetectionInstructions.push(i),r},e.prototype.drawLineString=function(t,e){var r=this.state;if(void 0!==r.strokeStyle&&void 0!==r.lineWidth){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([11,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Dl);var n=t.getFlatCoordinates(),i=t.getStride();this.drawFlatCoordinates_(n,0,n.length,i),this.hitDetectionInstructions.push(Rl),this.endGeometry(t,e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state;if(void 0!==r.strokeStyle&&void 0!==r.lineWidth){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([11,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Dl);for(var n=t.getEnds(),i=t.getFlatCoordinates(),o=t.getStride(),a=0,s=0,u=n.length;st&&(y>m&&(m=y,f=v,g=o),y=0,v=o-i)),a=s,l=p,h=d),u=A,c=_}return(y+=s)>m?[v,o]:[f,g]}var ql={Circle:Vl,Default:Ul,Image:Gl,LineString:Hl,Polygon:Vl,Text:function(t){function e(e,r,n,i,o,a){t.call(this,e,r,n,i,o,a),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},Bc.prune()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.drawText=function(t,e){var r=this.textState_;if(""!==this.text_&&r&&(this.textFillState_||this.textStrokeState_)){var n,i,o=this.coordinates.length,a=t.getType(),s=null,u=2,c=2;if("line"===r.placement){if(!vs(this.getBufferedMaxExtent(),t.getExtent()))return;var l;if(s=t.getFlatCoordinates(),c=t.getStride(),"LineString"==a)l=[s.length];else if("MultiLineString"==a)l=t.getEnds();else if("Polygon"==a)l=t.getEnds().slice(0,1);else if("MultiPolygon"==a){var h=t.getEndss();for(l=[],n=0,i=h.length;n=A)&&s.push(_[n],_[n+1]);if(0==(u=s.length))return}u=this.appendFlatCoordinates(s,0,u,c,!1,!1),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,t),this.hitDetectionInstructions.push(this.createFill(this.state,t))),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e),this.drawTextImage_(v,o,u),this.endGeometry(t,e)}}},e.prototype.getImage=function(t,e,r,n){var i,o=n+e+t+r+this.pixelRatio;if(!Bc.containsKey(o)){var a=n?this.strokeStates[n]||this.textStrokeState_:null,s=r?this.fillStates[r]||this.textFillState_:null,u=this.textStates[e]||this.textState_,c=u.scale*this.pixelRatio,l=Fl[u.textAlign||"center"],h=n&&a.lineWidth?a.lineWidth:0,p=t.split("\n"),d=p.length,f=[],g=function(t,e,r){for(var n=e.length,i=0,o=0;o=o;)Xl(r,t+i,t+o),Xl(r,t+o,t+i),Xl(r,t-o,t+i),Xl(r,t-i,t+o),Xl(r,t-i,t-o),Xl(r,t-o,t-i),Xl(r,t+o,t-i),Xl(r,t+i,t-o),2*((a+=1+2*++o)-i)+1>0&&(a+=1-2*(i-=1));return Yl[t]=r,r}(n);function f(t){for(var e=l.getImageData(0,0,u,u).data,r=0;r0){var i=void 0;return(!h||"Image"!=p&&"Text"!=p||-1!==h.indexOf(t))&&(i=o(t)),i||void l.clearRect(0,0,u,u)}}this.declutterTree_&&(h=this.declutterTree_.all().map((function(t){return t.value})));var g,m,y,v,A,_=Object.keys(this.replaysByZIndex_).map(Number);for(_.sort(ga),g=_.length-1;g>=0;--g){var b=_[g].toString();for(y=this.replaysByZIndex_[b],m=Nl.length-1;m>=0;--m)if(void 0!==(v=y[p=Nl[m]]))if(!a||"Image"!=p&&"Text"!=p){if(A=v.replayHitDetection(l,c,r,i,f,s))return A}else{var x=a[b];x?x.push(v,c.slice(0)):a[b]=[v,c.slice(0)]}}},e.prototype.getClipCoords=function(t){var e=this.maxExtent_,r=e[0],n=e[1],i=e[2],o=e[3],a=[r,n,r,o,i,o,i,n];return _s(a,0,8,2,t,a),a},e.prototype.getReplay=function(t,e){var r=void 0!==t?t.toString():"0",n=this.replaysByZIndex_[r];void 0===n&&(this.replaysByZIndex_[r]=n={});var i=n[e];return void 0===i&&(i=new(0,ql[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),n[e]=i),i},e.prototype.getReplays=function(){return this.replaysByZIndex_},e.prototype.isEmpty=function(){return ro(this.replaysByZIndex_)},e.prototype.replay=function(t,e,r,n,i,o,a){var s=Object.keys(this.replaysByZIndex_).map(Number);s.sort(ga),t.save(),this.clip(t,e);var u,c,l,h,p,d,f=o||Nl;for(u=0,c=s.length;u=i)for(n=i;nc[2];)++O,h=this.getTransform(e,P*O),f.replay(g,h,u,o,I),T-=P}if(qc(g,u,M/2,S/2),_&&this.dispatchRenderEvent(g,e,h),g!=t){if(A){var L=t.globalAlpha;t.globalAlpha=r.opacity,t.drawImage(g.canvas,-y,-v),t.globalAlpha=L}else t.drawImage(g.canvas,-y,-v);g.translate(-y,-v)}A||(g.globalAlpha=C)}d&&t.restore()},e.prototype.composeFrame=function(t,e,r){var n=this.getTransform(t,0);this.preCompose(r,t,n),this.compose(r,t,e),this.postCompose(r,t,e,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){if(this.replayGroup_){var o=e.viewState.resolution,a=e.viewState.rotation,s=this.getLayer(),u={};return this.replayGroup_.forEachFeatureAtCoordinate(t,o,a,r,{},(function(t){var e=Ji(t);if(!(e in u))return u[e]=!0,n.call(i,t,s)}),null)}},e.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t,e){var r=this.getLayer(),n=r.getSource(),i=t.viewHints[0],o=t.viewHints[1],a=r.getUpdateWhileAnimating(),s=r.getUpdateWhileInteracting();if(!this.dirty_&&!a&&i||!s&&o)return!0;var u=t.extent,c=t.viewState,l=c.projection,h=c.resolution,p=t.pixelRatio,d=r.getRevision(),f=r.getRenderBuffer(),g=r.getRenderOrder();void 0===g&&(g=Kl);var m=Wa(u,f*h),y=c.projection.getExtent();if(n.getWrapX()&&c.projection.canWrapX()&&!Ka(y,t.extent)){var v=ys(y),A=Math.max(ys(m)/2,v);m[0]=y[0]-A,m[2]=y[2]+A}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==d&&this.renderedRenderOrder_==g&&Ka(this.renderedExtent_,m))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var _=new Wl($l(h,p),m,h,p,n.getOverlaps(),this.declutterTree_,r.getRenderBuffer());n.loadFeatures(m,h,l);var b=function(t){var e,n=t.getStyleFunction()||r.getStyleFunction();if(n&&(e=n(t,h)),e){var i=this.renderFeature(t,h,p,e,_);this.dirty_=this.dirty_||i}}.bind(this);if(g){var x=[];n.forEachFeatureInExtent(m,(function(t){x.push(t)})),x.sort(g);for(var w=0,C=x.length;w=0;--_){var b=m[_];if(5!=b.getState())for(var x=b.tileCoord,w=y.getTileCoordExtent(x,this.tmpExtent)[0]-b.extent[0],C=void 0,E=0,I=b.tileKeys.length;E=this.minZoom;){if(o=2===this.zoomFactor_?Tl(a=Math.floor(a/2),a,s=Math.floor(s/2),s,n):this.getTileRangeForExtentAndZ(u,c,n),e.call(r,c,o))return!0;--c}return!1},hh.prototype.getExtent=function(){return this.extent_},hh.prototype.getMaxZoom=function(){return this.maxZoom},hh.prototype.getMinZoom=function(){return this.minZoom},hh.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},hh.prototype.getResolution=function(t){return this.resolutions_[t]},hh.prototype.getResolutions=function(){return this.resolutions_},hh.prototype.getTileCoordChildTileRange=function(t,e,r){if(t[0]=this.transition_?1:Ga(n/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(vo),vh=function(t){function e(e,r,n,i,o,a){t.call(this,e,r,a),this.crossOrigin_=i,this.src_=n,this.image_=new Image,null!==i&&(this.image_.crossOrigin=i),this.imageListenerKeys_=null,this.tileLoadFunction_=o}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.disposeInternal=function(){1==this.state&&(this.unlistenImage_(),this.image_=Ah()),this.interimTile&&this.interimTile.dispose(),this.state=5,this.changed(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.image_=Ah(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;this.state=t.naturalWidth&&t.naturalHeight?2:4,this.unlistenImage_(),this.changed()},e.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.imageListenerKeys_=[uo(this.image_,"error",this.handleImageError_,this),uo(this.image_,"load",this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},e.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(lo),this.imageListenerKeys_=null},e}(yh);function Ah(){var t=Lu(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var _h=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.expireCache=function(t){for(;this.canExpireCache();){var e=this.peekLast(),r=e.tileCoord[0].toString();if(r in t&&t[r].contains(e.tileCoord))break;this.pop().dispose()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=(e=this.peekFirstKey(),e.split("/").map(Number))[0];this.forEach((function(e){e.tileCoord[0]!==t&&(this.remove(uh(e.tileCoord)),e.dispose())}),this)}var e},e}(Oc);function bh(t,e,r,n){var i=Xs(r,e,t),o=Hs(e,n,r),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var s=t.getMetersPerUnit();void 0!==s&&(o/=s);var u=t.getExtent();if(!u||Za(u,i)){var c=Hs(t,o,i)/o;isFinite(c)&&c>0&&(o/=c)}return o}function xh(t,e,r,n){var i=r-t,o=n-e,a=Math.sqrt(i*i+o*o);return[Math.round(r+i/a),Math.round(n+o/a)]}var wh=function(t,e,r,n,i){this.sourceProj_=t,this.targetProj_=e;var o={},a=Ys(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return o[e]||(o[e]=a(t)),o[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&ys(n)==ys(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ys(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ys(this.targetProj_.getExtent()):null;var s=gs(r),u=ms(r),c=cs(r),l=us(r),h=this.transformInv_(s),p=this.transformInv_(u),d=this.transformInv_(c),f=this.transformInv_(l);if(this.addQuad_(s,u,c,l,h,p,d,f,10),this.wrapsXInSource_){var g=1/0;this.triangles_.forEach((function(t,e,r){g=Math.min(g,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-g>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-g>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-g>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-g>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r.5&&l<1,d=!1;if(u>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(d=ys(qa([t,e,r,n]))/this.targetWorldWidth_>.25||d),!p&&this.sourceProj_.isGlobal()&&l&&(d=l>.25||d)),d||!this.maxSourceExtent_||vs(c,this.maxSourceExtent_)){if(!(d||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1]))){if(!(u>0))return;d=!0}if(u>0){if(!d){var f,g=this.transformInv_([(t[0]+r[0])/2,(t[1]+r[1])/2]);f=p?(Ra(i[0],h)+Ra(a[0],h))/2-Ra(g[0],h):(i[0]+a[0])/2-g[0];var m=(i[1]+a[1])/2-g[1];d=f*f+m*m>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var y=[(e[0]+r[0])/2,(e[1]+r[1])/2],v=this.transformInv_(y),A=[(n[0]+t[0])/2,(n[1]+t[1])/2],_=this.transformInv_(A);this.addQuad_(t,e,y,A,i,o,v,_,u-1),this.addQuad_(A,y,r,n,_,v,a,s,u-1)}else{var b=[(t[0]+e[0])/2,(t[1]+e[1])/2],x=this.transformInv_(b),w=[(r[0]+n[0])/2,(r[1]+n[1])/2],C=this.transformInv_(w);this.addQuad_(t,b,w,n,i,x,C,s,u-1),this.addQuad_(b,e,r,w,x,o,a,C,u-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,r,n,i,a,s),this.addTriangle_(t,e,r,i,o,a)}},wh.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,r,n){var i=e.source;is(t,i[0]),is(t,i[1]),is(t,i[2])})),t},wh.prototype.getTriangles=function(){return this.triangles_};var Ch=function(t){function e(e,r,n,i,o,a,s,u,c,l,h){t.call(this,o,0),this.renderEdges_=void 0!==h&&h,this.pixelRatio_=s,this.gutter_=u,this.canvas_=null,this.sourceTileGrid_=r,this.targetTileGrid_=i,this.wrappedTileCoord_=a||o,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;var p=i.getTileCoordExtent(this.wrappedTileCoord_),d=this.targetTileGrid_.getExtent(),f=this.sourceTileGrid_.getExtent(),g=d?fs(p,d):p;if(0!==ss(g)){var m=e.getExtent();m&&(f=f?fs(f,m):m);var y=i.getResolution(this.wrappedTileCoord_[0]),v=bh(e,n,ls(g),y);if(!isFinite(v)||v<=0)this.state=4;else if(this.triangulation_=new wh(e,n,g,f,v*(void 0!==l?l:.5)),0!==this.triangulation_.getTriangles().length){this.sourceZ_=r.getZForResolution(v);var A=this.triangulation_.calculateSourceExtent();if(f&&(e.canWrapX()?(A[1]=Ta(A[1],f[1],f[3]),A[3]=Ta(A[3],f[1],f[3])):A=fs(A,f)),ss(A)){for(var _=r.getTileRangeForExtentAndZ(A,this.sourceZ_),b=_.minX;b<=_.maxX;b++)for(var x=_.minY;x<=_.maxY;x++){var w=c(this.sourceZ_,b,x,s);w&&this.sourceTiles_.push(w)}0===this.sourceTiles_.length&&(this.state=4)}else this.state=4}else this.state=4}else this.state=4}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.disposeInternal=function(){1==this.state&&this.unlistenSources_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,n){e&&2==e.getState()&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=3;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),n="number"==typeof r?r:r[0],i="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=function(t,e,r,n,i,o,a,s,u,c,l){var h=Lu(Math.round(r*t),Math.round(r*e));if(0===u.length)return h.canvas;h.scale(r,r);var p=[1/0,1/0,-1/0,-1/0];u.forEach((function(t,e,r){ns(p,t.extent)}));var d=ys(p),f=ds(p),g=Lu(Math.round(r*d/n),Math.round(r*f/n)),m=r/n;u.forEach((function(t,e,r){var n=t.extent[0]-p[0],i=-(t.extent[3]-p[3]),o=ys(t.extent),a=ds(t.extent);g.drawImage(t.image,c,c,t.image.width-2*c,t.image.height-2*c,n*m,i*m,o*m,a*m)}));var y=gs(a);return s.getTriangles().forEach((function(t,e,i){var a=t.source,s=t.target,u=a[0][0],c=a[0][1],l=a[1][0],d=a[1][1],f=a[2][0],m=a[2][1],v=(s[0][0]-y[0])/o,A=-(s[0][1]-y[1])/o,_=(s[1][0]-y[0])/o,b=-(s[1][1]-y[1])/o,x=(s[2][0]-y[0])/o,w=-(s[2][1]-y[1])/o,C=u,E=c;u=0,c=0;var I=function(t){for(var e=t.length,r=0;ri&&(i=a,n=o)}if(0===i)return null;var s=t[n];t[n]=t[r],t[r]=s;for(var u=r+1;u=0;p--){h[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*h[p]}return h}([[l-=C,d-=E,0,0,_-v],[f-=C,m-=E,0,0,x-v],[0,0,l,d,b-A],[0,0,f,m,w-A]]);if(I){h.save(),h.beginPath();var M=(v+_+x)/3,S=(A+b+w)/3,T=xh(M,S,v,A),P=xh(M,S,_,b),O=xh(M,S,x,w);h.moveTo(P[0],P[1]),h.lineTo(T[0],T[1]),h.lineTo(O[0],O[1]),h.clip(),h.transform(I[0],I[2],I[1],I[3],v,A),h.translate(p[0]-C,p[3]-E),h.scale(n/r,-n/r),h.drawImage(g.canvas,0,0),h.restore()}})),l&&(h.save(),h.strokeStyle="black",h.lineWidth=1,s.getTriangles().forEach((function(t,e,r){var n=t.target,i=(n[0][0]-y[0])/o,a=-(n[0][1]-y[1])/o,s=(n[1][0]-y[0])/o,u=-(n[1][1]-y[1])/o,c=(n[2][0]-y[0])/o,l=-(n[2][1]-y[1])/o;h.beginPath(),h.moveTo(s,u),h.lineTo(i,a),h.lineTo(c,l),h.closePath(),h.stroke()})),h.restore()),h.canvas}(n,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=2}this.changed()},e.prototype.load=function(){if(0==this.state){this.state=1,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,n){var i=e.getState();if(0==i||1==i){t++;var o=so(e,"change",(function(r){var n=e.getState();2!=n&&3!=n&&4!=n||(lo(o),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,r){0==t.getState()&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(lo),this.sourcesListenerKeys_=null},e}(yh);function Eh(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,r,n){return o=Ih(i=Mh(t),void 0,void 0),new hh({extent:i,origin:hs(i,"top-left"),resolutions:o,tileSize:void 0});var i,o}(t),t.setDefaultTileGrid(e)),e}function Ih(t,e,r){for(var n=void 0!==e?e:42,i=ds(t),o=ys(t),a=ju(void 0!==r?r:256),s=Math.max(o/a[0],i/a[1]),u=n+1,c=new Array(u),l=0;lr||r>e.getMaxZoom())return!1;var o,a=e.getExtent();return!(o=a?e.getTileRangeForExtentAndZ(a,r):e.getFullTileRange(r))||o.containsXY(n,i)}(t,n)?t:null},e.prototype.refresh=function(){this.tileCache.clear(),this.changed()},e.prototype.useTile=function(t,e,r,n){},e}(Xc),Th=function(t){function e(e,r){t.call(this,e),this.tile=r}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(mo),Ph=function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Oh,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,this.tileClass=void 0!==e.tileClass?e.tileClass:vh,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==r?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[n];i.expireCache(i==r?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!qs(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!qs(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!qs(e,t)){var r=Ji(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=Eh(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||qs(e,t))return this.tileCache;var r=Ji(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new _h(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,r,n,i,o){var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),u=s?this.tileUrlFunction(s,n,i):void 0,c=new this.tileClass(a,void 0!==u?0:4,void 0!==u?u:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=o,so(c,"change",this.handleTileChange,this),c},e.prototype.getTile=function(t,e,r,n,i){var o=this.getProjection();if(o&&i&&!qs(o,i)){var a,s=this.getTileCacheForProjection(i),u=[t,e,r],c=uh(u);s.containsKey(c)&&(a=s.get(c));var l=this.getKey();if(a&&a.key==l)return a;var h=this.getTileGridForProjection(o),p=this.getTileGridForProjection(i),d=this.getTileCoordForTileUrlFunction(u,i),f=new Ch(o,h,i,p,u,d,this.getTilePixelRatio(n),this.getGutter(),function(t,e,r,n){return this.getTileInternal(t,e,r,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return f.key=l,a?(f.interimTile=a,f.refreshInterimChain(),s.replace(c,f)):s.set(c,f),f}return this.getTileInternal(t,e,r,n,o||i)},e.prototype.getTileInternal=function(t,e,r,n,i){var o=null,a=sh(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var u=o;(o=this.createTile_(t,e,r,n,i,s)).interimTile=0==u.getState()?u.interimTile:u,o.refreshInterimChain(),this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,r,n,i,s),this.tileCache.set(a,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var r=Gs(t);if(r){var n=Ji(r);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.generateTileUrlFunction_=!e.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,this.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(this):gh,this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),e.tileUrlFunction&&this.setTileUrlFunction(e.tileUrlFunction,this.key_),this.tileLoadingKeys_={}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,n=Ji(r),i=r.getState();1==i?(this.tileLoadingKeys_[n]=!0,e="tileloadstart"):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=3==i?"tileloaderror":2==i||5==i?"tileloadend":void 0),null!=e&&this.dispatchEvent(new Th(e,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=this.urls=mh(t);this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var r=t.length,n=new Array(r),i=0;i0&&(this.tileUrlFunction=fh(i.map(Rh.bind(this))))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.setTileUrlFunction(fh(t.map(Rh.bind(this))),e)},e.prototype.getDimensions=function(){return this.dimensions_},e.prototype.getFormat=function(){return this.format_},e.prototype.getLayer=function(){return this.layer_},e.prototype.getMatrixSet=function(){return this.matrixSet_},e.prototype.getRequestEncoding=function(){return this.requestEncoding_},e.prototype.getStyle=function(){return this.style_},e.prototype.getVersion=function(){return this.version_},e.prototype.getKeyForDimensions_=function(){var t=0,e=[];for(var r in this.dimensions_)e[t++]=r+"-"+this.dimensions_[r];return e.join("/")},e.prototype.updateDimensions=function(t){to(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},e}(Ph);function Rh(t){var e=this.requestEncoding_,r={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};"KVP"==e&&to(r,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t="KVP"==e?Lh(t,r):t.replace(/\{(\w+?)\}/g,(function(t,e){return e.toLowerCase()in r?r[e.toLowerCase()]:t}));var n=this.tileGrid,i=this.dimensions_;return function(r,o,a){if(r){var s={TileMatrix:n.getMatrixId(r[0]),TileCol:r[1],TileRow:-r[2]-1};to(s,i);var u=t;return"KVP"==e?Lh(u,s):u.replace(/\{(\w+?)\}/g,(function(t,e){return s[e]}))}}}var Dh=function(t){function e(e){var r=e||{},n=void 0!==r.projection?r.projection:"EPSG:3857",i=void 0!==r.tileGrid?r.tileGrid:function(t){var e=t||{},r=e.extent||Gs("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Ih(r,e.maxZoom,e.tileSize)};return new hh(n)}({extent:Mh(n),maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,opaque:r.opaque,projection:n,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible})}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Ph),Bh=function(t){function e(e){var r=e||{},n=r.params||{};t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,opaque:!(!("TRANSPARENT"in n)||n.TRANSPARENT),projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:r.tileClass,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,tileUrlFunction:Nh,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition}),this.gutter_=void 0!==r.gutter?r.gutter:0,this.params_=n,this.v13_=!0,this.serverType_=r.serverType,this.hidpi_=void 0===r.hidpi||r.hidpi,this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.updateV13_(),this.setKey(this.getKeyForParams_())}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getGetFeatureInfoUrl=function(t,e,r,n){var i=Gs(r),o=this.getProjection(),a=this.getTileGrid();a||(a=this.getTileGridForProjection(i));var s=a.getTileCoordForCoordAndResolution(t,e);if(!(a.getResolutions().length<=s[0])){var u=a.getResolution(s[0]),c=a.getTileCoordExtent(s,this.tmpExtent_),l=ju(a.getTileSize(s[0]),this.tmpSize),h=this.gutter_;0!==h&&(l=Nu(l,h,this.tmpSize),c=Wa(c,u*h,c)),o&&o!==i&&(u=bh(o,i,t,u),c=function(t,e,r){var n,i,o=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return e(o,o,2),n=[o[0],o[2],o[4],o[6]],i=[o[1],o[3],o[5],o[7]],ts(Math.min.apply(null,n),Math.min.apply(null,i),Math.max.apply(null,n),Math.max.apply(null,i),void 0)}(c,Ys(i,o)),t=Xs(t,i,o));var p={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};to(p,this.params_,n);var d=Math.floor((t[0]-c[0])/u),f=Math.floor((c[3]-t[1])/u);return p[this.v13_?"I":"X"]=d,p[this.v13_?"J":"Y"]=f,this.getRequestUrl_(s,l,c,1,o||i,p)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,n,i,o){var a=this.urls;if(a){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=n)switch(this.serverType_){case"geoserver":var s=90*n+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case"mapserver":o.MAP_RESOLUTION=90*n;break;case"carmentaserver":case"qgis":o.DPI=90*n}var u,c=i.getAxisOrientation(),l=r;return this.v13_&&"ne"==c.substr(0,2)&&(u=r[0],l[0]=r[1],l[1]=u,u=r[2],l[2]=r[3],l[3]=u),o.BBOX=l.join(","),Lh(1==a.length?a[0]:a[Ra(ch(t),a.length)],o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.updateParams=function(t){to(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){this.v13_=function(t,e){for(var r=(""+t).split("."),n="1.3".split("."),i=0;ia)return 1;if(a>o)return-1}return 0}(this.params_.VERSION||"1.3.0")>=0},e}(Ph);function Nh(t,e,r){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(r)),!(n.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var i=n.getResolution(t[0]),o=n.getTileCoordExtent(t,this.tmpExtent_),a=ju(n.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=Nu(a,s,this.tmpSize),o=Wa(o,i*s,o)),1!=e&&(a=Fu(a,e,this.tmpSize));var u={SERVICE:"WMS",VERSION:"1.3.0",REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return to(u,this.params_),this.getRequestUrl_(t,a,o,e,r,u)}}var Fh=function(t){function e(e){var r=e||{};t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,tileUrlFunction:jh,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition}),this.params_=r.params||{},this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.setKey(this.getKeyForParams_())}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,n,i,o){var a=this.urls;if(a){var s=i.getCode().split(":").pop();return o.SIZE=e[0]+","+e[1],o.BBOX=r.join(","),o.BBOXSR=s,o.IMAGESR=s,o.DPI=Math.round(o.DPI?o.DPI*n:90*n),Lh((1==a.length?a[0]:a[Ra(ch(t),a.length)]).replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),o)}},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.updateParams=function(t){to(this.params_,t),this.setKey(this.getKeyForParams_())},e}(Ph);function jh(t,e,r){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(r)),!(n.getResolutions().length<=t[0])){var i=n.getTileCoordExtent(t,this.tmpExtent_),o=ju(n.getTileSize(t[0]),this.tmpSize);1!=e&&(o=Fu(o,e,this.tmpSize));var a={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return to(a,this.params_),this.getRequestUrl_(t,o,i,e,r,a)}}var zh=function(t){function e(e){var r=e||{},n=to({},r);delete n.preload,delete n.useInterimTilesOnError,t.call(this,n),this.setPreload(void 0!==r.preload?r.preload:0),this.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),this.type="TILE"}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getPreload=function(){return this.get("preload")},e.prototype.setPreload=function(t){this.set("preload",t)},e.prototype.getUseInterimTilesOnError=function(){return this.get("useInterimTilesOnError")},e.prototype.setUseInterimTilesOnError=function(t){this.set("useInterimTilesOnError",t)},e}(Hu),Uh=function(t){void 0===t&&(t="EPSG:4326"),this.layerIds=[],this.olSources=[],this.olLayers=[],this.projection=t,this.olMap=this.createOlMap(),this.olExtent=[]};Uh.prototype.createOlMap=function(){var t=document.createElement("div");return document.body.appendChild(t),t.style.cssText="position:fixed;opacity:0;z-index:-1;",this.olMap=new oh({target:t,view:new Tu({projection:this.projection,center:[0,0],zoom:10})}),this.olMap.interactions.clear(),this.olMap.controls.clear(),this.olMap},Uh.prototype.createOlLayer=function(t,e){var r,n,i=e.tileOptions,o=e.setTileLoadFunction;switch(t){case"WMTS":n=new ph(i.tileGrid),r=new kh(Object.assign(i,{tileGrid:n}));break;case"WMS":n=new ph(i.tileGrid),r=new Bh(Object.assign(i,{tileGrid:n}));break;case"XYZ":i.tileGrid?(n=new ph(i.tileGrid),r=new Dh(Object.assign(i,{tileGrid:n}))):r=new Dh(Object.assign(i));break;case"TILE_IMAGE":i.tileGrid?(n=new ph(i.tileGrid),r=new Ph(Object.assign(i,{tileGrid:n}))):r=new Ph(Object.assign(i));break;case"ARCGIS_MAPSERVER":r=new Fh({url:i.url,crossOrigin:"anonymous"});break;default:throw new Error("暂不支持此类型服务的添加,请选择WMTS或XYZ")}o&&r.setTileLoadFunction(o);var a=new zh({source:r});return this.olLayers.push(a),this.olSources.push(r),this.olMap.addLayer(a),a},Uh.prototype.resizeCanvas=function(t,e){var r=t.getCanvas(),n=r.clientWidth,i=r.clientHeight,o=e.getTargetElement();n===o.clientWidth&&i===o.clientHeight||(o.style.width=n+"px",o.style.height=i+"px",e.updateSize())},Uh.prototype.createCustomWMTSLayer=function(){var e=this,r=this.olMap,n=t.uuid();return this.layerIds.push(n),{id:n,type:"custom",onAdd:function(t,n){e.resizeCanvas(t,r),this.map=t,this.gl=n;var i=n.createShader(n.VERTEX_SHADER);if(this.vertexShader=i,n.shaderSource(i,"\n attribute vec2 a_position;\n attribute vec2 a_texCoord;\n uniform vec2 u_resolution;\n varying vec2 v_texCoord;\n void main() {\n vec2 zeroToOne = a_position / u_resolution;\n vec2 zeroToTwo = zeroToOne * 2.0;\n vec2 clipSpace = zeroToTwo - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n v_texCoord = a_texCoord;\n }\n "),n.compileShader(i),!n.getShaderParameter(i,n.COMPILE_STATUS))return console.error(n.getShaderInfoLog(i)),void n.deleteShader(i);var o=n.createShader(n.FRAGMENT_SHADER);return this.fragmentShader=o,n.shaderSource(o,"\n #ifdef GL_ES\n precision mediump float;\n #endif\n uniform sampler2D u_image;\n varying vec2 v_texCoord;\n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord);\n }\n "),n.compileShader(o),n.getShaderParameter(o,n.COMPILE_STATUS)?(this.program=n.createProgram(),n.attachShader(this.program,i),n.attachShader(this.program,o),n.linkProgram(this.program),n.getProgramParameter(this.program,n.LINK_STATUS)?(this.positionLocation=n.getAttribLocation(this.program,"a_position"),this.texcoordLocation=n.getAttribLocation(this.program,"a_texCoord"),this.resolutionLocation=n.getUniformLocation(this.program,"u_resolution"),this.positionBuffer=n.createBuffer(),this.texcoordBuffer=n.createBuffer(),void(this.texture=n.createTexture())):(console.error(n.getProgramInfoLog(this.program)),void n.deleteProgram(this.program))):(console.error(n.getShaderInfoLog(o)),void n.deleteShader(o))},render:function(t,r){e.resizeCanvas(this.map,e.olMap),t.useProgram(this.program),t.bindBuffer(t.ARRAY_BUFFER,this.positionBuffer);var n=e.olMap.getTargetElement().getElementsByTagName("canvas")[0];e.setRectangle(t,0,0,n.width,n.height),t.bindBuffer(t.ARRAY_BUFFER,this.texcoordBuffer),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),t.STATIC_DRAW),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.enableVertexAttribArray(this.positionLocation),t.bindBuffer(t.ARRAY_BUFFER,this.positionBuffer),t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(this.texcoordLocation),t.bindBuffer(t.ARRAY_BUFFER,this.texcoordBuffer),t.vertexAttribPointer(this.texcoordLocation,2,t.FLOAT,!1,0,0),t.uniform2f(this.resolutionLocation,t.canvas.width,t.canvas.height),t.drawArrays(t.TRIANGLES,0,6)}}},Uh.prototype.setRectangle=function(t,e,r,n,i){var o=e+n,a=r+i;t.bufferData(t.ARRAY_BUFFER,new Float32Array([e,r,o,r,e,a,e,a,o,r,o,a]),t.STATIC_DRAW)},Uh.prototype.updatePosition=function(){var t=this.map.getCenter().toArray(),e=this.map.getZoom();if("EPSG:3857"===this.projection){var r=Xs(t,"EPSG:4326","EPSG:3857");this.olMap.getView().setCenter(r)}else this.olMap.getView().setCenter(t);this.olMap.getView().setZoom(e+1),this.olMap.renderSync()},Uh.prototype.addLayerToMap=function(t,e){var r=this;this.map=t;var n=this,i=this.createCustomWMTSLayer();return this.updatePosition(),e?this.map.addLayer(i,e):this.map.addLayer(i),t.on("move",(function(){r.updatePosition()})),t.on("rotate",(function(){var e=t.getBearing();r.olMap.getView().setRotation(-Math.PI/180*e)})),this.olMap.on("rendercomplete",(function(){r.map.triggerRepaint()})),this.olSources.forEach((function(t){t.on("tileloadend",(function(){n.map.triggerRepaint()}))})),this},Uh.prototype.remove=function(){var t=this;this.layerIds.forEach((function(e){t.map.removeLayer(e)})),this.layerIds=[],this.olLayers.forEach((function(e){t.olMap.removeLayer(e)})),this.olLayers=[],t.olMap.render(),t.map.triggerRepaint()};var Gh={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ti,NavigationControl:Li,GeolocateControl:Gi,AttributionControl:bi,ScaleControl:Vi,FullscreenControl:Wi,Popup:Xi,Marker:Fi,Style:He,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,CustomTileLayer:Uh,Evented:t.Evented,config:t.config,prewarm:function(){Ft().acquire(Rt)},clearPrewarmedResources:function(){var t=Bt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Rt),Bt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Dt.workerCount},set workerCount(t){Dt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Gh})),r}()},function(t,e,r){var n=r(600);function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var r=1;r2){for(u=0;u0;function u(r,n){var i=t.get(r);if(t.ctx.options.tooltipOpts.tooltipText){if(t.ctx.options.tooltipOpts.tooltipEndText){var o=t.ctx.options.tooltipOpts.tooltipText||t.local("draw.start"),a=t.ctx.options.tooltipOpts.tooltipEndText;(0===i.coordinates.length||i.coordinates[0]&&0===i.coordinates[0].length)&&t.ctx.helpToolTip.updateTooltip(o),"Rectangle"===i.properties._type_||"Circle"===i.properties._type_?(i.coordinates[0].length>0&&"Rectangle"===i.properties._type_&&t.ctx.helpToolTip.updateTooltip(a),i.coordinates[0].length>0&&"Circle"===i.properties._type_&&i.radius&&t.ctx.helpToolTip.updateTooltip(a)):"LineString"===i.properties._type_?2===i.coordinates.length&&t.ctx.helpToolTip.updateTooltip(a):"Arrow"===i.properties._type_?i.coordinates[0].length>0&&t.ctx.helpToolTip.updateTooltip(a):"Polygon"===i.properties._type_||"Triangle"===i.properties._type_?(2===i.coordinates[0].length||i.coordinates[0].length>2)&&t.ctx.helpToolTip.updateTooltip(a):"Sector"===i.properties._type_&&(2===i.coordinates[0].length||i.coordinates[0].length>2)&&t.ctx.helpToolTip.updateTooltip(a)}}else{var s=t.ctx.options.tooltipOpts.tooltipText||t.local("draw.start");(0===i.coordinates.length||i.coordinates[0]&&0===i.coordinates[0].length)&&t.ctx.helpToolTip.updateTooltip(s),"Rectangle"===i.properties._type_||"Circle"===i.properties._type_?(0===i.coordinates[0].length&&t.ctx.helpToolTip.updateTooltip(t.local("draw.drag")),i.coordinates[0].length>0&&"Rectangle"===i.properties._type_&&t.ctx.helpToolTip.updateTooltip(t.local("draw.release")),i.coordinates[0].length>0&&"Circle"===i.properties._type_&&i.radius&&t.ctx.helpToolTip.updateTooltip(i.radius.toFixed(2)+t.local("draw.km"))):"LineString"===i.properties._type_?2===i.coordinates.length&&t.ctx.helpToolTip.updateTooltip(t.local("draw.double.end")):"Arrow"===i.properties._type_?i.coordinates[0].length>0&&t.ctx.helpToolTip.updateTooltip(t.local("draw.click.end")):"Polygon"===i.properties._type_?2===i.coordinates[0].length?t.ctx.helpToolTip.updateTooltip(t.local("draw.continue")):i.coordinates[0].length>2&&t.ctx.helpToolTip.updateTooltip(t.local("draw.double.end")):("Triangle"===i.properties._type_||"Sector"===i.properties._type_)&&(2===i.coordinates[0].length?t.ctx.helpToolTip.updateTooltip(t.local("draw.continue")):i.coordinates[0].length>2&&t.ctx.helpToolTip.updateTooltip(t.local("draw.click.end")))}var u=i.internal(e);t.ctx.events.currentModeRender(u,(function(e){t.sources[n].push(e)}))}if(r.forEach((function(t){return u(t,"hot")})),o.forEach((function(t){return u(t,"cold")})),s&&t.ctx.map.getSource(n.g.sources.COLD).setData({type:n.g.geojsonTypes.FEATURE_COLLECTION,features:t.sources.cold}),t.ctx.map.getSource(n.g.sources.HOT).setData({type:n.g.geojsonTypes.FEATURE_COLLECTION,features:t.sources.hot}),t._emitSelectionChange&&(t.ctx.map.fire(n.g.events.SELECTION_CHANGE,{features:t.getSelected().map((function(t){return t?t.toGeoJSON():{}})),points:t.getSelectedCoordinates().map((function(t){return{type:n.g.geojsonTypes.FEATURE,properties:{},geometry:{type:n.g.geojsonTypes.POINT,coordinates:t.coordinates}}}))}),t._emitSelectionChange=!1),t._deletedFeaturesToEmit.length){var c=t._deletedFeaturesToEmit.map((function(t){return t.toGeoJSON()}));t._deletedFeaturesToEmit=[],t.ctx.map.fire(n.g.events.DELETE,{features:c})}function l(){t.isDirty=!1,t.clearChangedIds()}l(),t.ctx.map.fire(n.g.events.RENDER,{})}},function(t,e,r){"use strict";e.a={POSTCOMPOSE:"postcompose",PRECOMPOSE:"precompose",RENDER:"render",RENDERCOMPLETE:"rendercomplete"}},function(t,e){t.exports=function(t){if(!t||!t.type)return null;var e=r[t.type];if(!e)return null;if("geometry"===e)return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]};if("feature"===e)return{type:"FeatureCollection",features:[t]};if("featurecollection"===e)return t};var r={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),f(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),l(n,t,n.depth)}function u(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function c(t,e){return t}function l(t,r,n){if(t.customInspect&&r&&w(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return y(i)||(i=l(t,i,n)),i}var o=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(f(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),x(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return h(r);if(0===a.length){if(w(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(A(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return t.stylize(Date.prototype.toString.call(r),"date");if(x(r))return h(r)}var c,_="",C=!1,E=["{","}"];(d(r)&&(C=!0,E=["[","]"]),w(r))&&(_=" [Function"+(r.name?": "+r.name:"")+"]");return A(r)&&(_=" "+RegExp.prototype.toString.call(r)),b(r)&&(_=" "+Date.prototype.toUTCString.call(r)),x(r)&&(_=" "+h(r)),0!==a.length||C&&0!=r.length?n<0?A(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=C?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,_,E)):E[0]+_+E[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),S(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=g(r)?l(t,u.value,null):l(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function g(t){return null===t}function m(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function A(t){return _(t)&&"[object RegExp]"===C(t)}function _(t){return"object"==typeof t&&null!==t}function b(t){return _(t)&&"[object Date]"===C(t)}function x(t){return _(t)&&("[object Error]"===C(t)||t instanceof Error)}function w(t){return"function"==typeof t}function C(t){return Object.prototype.toString.call(t)}function E(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(v(o)&&(o=Object({NODE_ENV:"production",MAP_TYPE:"kd",VERSION:"v2.19.0"}).NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=f,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=y,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=v,e.isRegExp=A,e.isObject=_,e.isDate=b,e.isError=x,e.isFunction=w,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(709);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(){var t=new Date,e=[E(t.getHours()),E(t.getMinutes()),E(t.getSeconds())].join(":");return[t.getDate(),I[t.getMonth()],e].join(" ")}function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",M(),e.format.apply(e,arguments))},e.inherits=r(710),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e;if("function"!=typeof(e=t[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o1?2:1,x=function(){function t(e,r){i()(this,t),this._url=e.spriteURL,this._width=e.width,this._height=e.height,this._x=e.x,this._y=e.y,this._ratio=e.pixelRatio,this._scale="number"==typeof r&&!isNaN(r)&&r>0?r:1,this._container=document.createElement("div"),this._icon=document.createElement("div"),this._container.appendChild(this._icon),this._setupStyle()}return a()(t,[{key:"config",set:function(t){this._width=t.width,this._height=t.height,this._x=t.x,this._y=t.y,this._ratio=t.pixelRatio,this._url=t.spriteURL,this._setupStyle()}},{key:"scale",set:function(t){this._scale=t,this._setupStyle()}},{key:"width",get:function(){return this._calWidth()}},{key:"height",get:function(){return this._calHeight()}},{key:"element",get:function(){return this._container}},{key:"_setupStyle",value:function(){this._container.style="\n width: ".concat(this._calWidth(),"px;\n height: ").concat(this._calHeight(),"px;\n position: relative;\n "),this._icon.style="\n width: ".concat(this._width,"px;\n height: ").concat(this._height,"px;\n background-image: url(").concat(this._url,");\n background-repeat: no-repeat;\n background-position: ").concat(-this._x,"px ").concat(-this._y,"px;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%) scale(").concat(this._scale,");\n ")}},{key:"_calWidth",value:function(){return this._width/this._ratio*this._scale}},{key:"_calHeight",value:function(){return this._height/this._ratio*this._scale}}]),t}(),w=function(){function t(e,r){i()(this,t),this._width=e.width,this._height=e.height,this._ratio=e.pixelRatio,this._scale="number"==typeof r&&!isNaN(r)&&r>0?r:1,this._container=document.createElement("div"),this._setupStyle()}return a()(t,[{key:"config",set:function(t){this._width=t.width,this._height=t.height,this._ratio=t.pixelRatio,this._setupStyle()}},{key:"scale",set:function(t){this._scale=t,this._setupStyle()}},{key:"width",get:function(){return this._calWidth()}},{key:"height",get:function(){return this._calHeight()}},{key:"element",get:function(){return this._container}},{key:"_setupStyle",value:function(){this._container.style="\n width: ".concat(this._calWidth(),"px;\n height: ").concat(this._calHeight(),"px;\n position: relative;\n ")}},{key:"_calWidth",value:function(){return this._width/this._ratio*this._scale}},{key:"_calHeight",value:function(){return this._height/this._ratio*this._scale}}]),t}(),C=function(){function t(e,r,n){i()(this,t),this.back=e,this.icon=r,this.spriteManager=g.a.getProps(n,"spriteManager"),this.backContainer=document.createElement("div"),this.backContainer.appendChild(this.back.element),this.iconContainer=document.createElement("div"),this.iconContainer.appendChild(this.icon.element),this.container=document.createElement("div"),this.container.appendChild(this.backContainer),this.container.appendChild(this.iconContainer),this.rotation=this.back instanceof w?0:180,this._setupStyle()}return a()(t,[{key:"setRotation",value:function(t){this.rotation=t,this._setupStyle()}},{key:"setBack",value:function(t){var e=this.spriteManager.getSpriteConfig(t);e&&(this.back.config=e,this._setupStyle())}},{key:"setIcon",value:function(t){var e=this.spriteManager.getSpriteConfig(t);e&&(this.icon.config=e,this._setupStyle())}},{key:"width",get:function(){return this.back.width}},{key:"height",get:function(){return this.back.height}},{key:"element",get:function(){return this.container}},{key:"_setupStyle",value:function(){this.container.style="\n width: ".concat(this.back.width,"px;\n height: ").concat(this.back.height,"px;\n position: relative;\n "),this.backContainer.style="\n width: ".concat(this.back.width,"px;\n height: ").concat(this.back.height,"px;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%) rotate(").concat(this.back instanceof w?0:this.rotation,"deg);\n "),this.iconContainer.style="\n width: ".concat(this.icon.width,"px;\n height: ").concat(this.icon.height,"px;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%) rotate(").concat(this.back instanceof w?this.rotation:0,"deg);\n ")}}]),t}(),E=function(){function t(e,r){i()(this,t),r||console.error("mapContainerId undefined..."),this.mapContainerId=r;var n=g.a.getProps(r,"config"),o=_.a.toAbsUrl(e),a=b>1?"@2x":"";this.spriteURL=this._normalizeURL(o,a,".png"),this.spriteJsonURL=this._normalizeURL(o,a,".json"),this.spriteJSON={},n.SPRITE_URL.indexOf("/sprite")}return a()(t,[{key:"_normalizeURL",value:function(t,e,r){return t+e+r}},{key:"_load",value:function(){var t=this,e=this;_.a.xhr({noAuth:!0,type:"GET",url:this.spriteJsonURL,headers:{Accept:"application/json"},success:function(e){g.a.setProps(t.mapContainerId,"spriteJSON",e)},error:function(t){console.error(t)}},this.mapContainerId);var r=new Image;r.crossOrigin="Anonymous",r.onload=function(){g.a.setProps(e.mapContainerId,"spriteImageEle",r)},r.src=this.spriteURL}},{key:"_hasImage",value:function(t){return!!this.spriteJSON[t]}},{key:"getSpriteConfig",value:function(t){if(this.spriteJSON[t])return Object.assign({},this.spriteJSON[t]);g.a.getProps(this.mapContainerId,"spriteJSON");var e=g.a.getProps(this.mapContainerId,"map").map,r=e&&e.style&&e.style.imageManager&&e.style.imageManager.images,n=r&&r[t];if(n){var i=n.pixelRatio,o=n.data.width,a=n.data.height,s=n.data.data,u=document.createElement("canvas"),c=u.getContext("2d"),l=new ImageData(Uint8ClampedArray.from(s),o,a);u.width=o,u.height=a,c.putImageData(l,0,0);var h=u.toDataURL();return this.spriteJSON[t]={x:0,y:0,width:o,height:a,pixelRatio:i,sdf:n.sdf,spriteURL:h},Object.assign({},this.spriteJSON[t])}return null}},{key:"getSpriteGroup",value:function(t,e,r){var n=t;if(!0===r){var i=this.getSpriteConfig(n);if(i){var o=new w(i,e),a=new x(i,e);return new C(o,a,this.mapContainerId)}}else{var s=this.getSpriteConfig("direction"),u=this.getSpriteConfig(n);if(s&&u){var c=new x(s,e),l=new x(u,e);return new C(c,l,this.mapContainerId)}}return null}},{key:"getSpriteImg",value:function(t){var e=this.getSpriteConfig(t);return e||null}},{key:"getSpriteGroupWidthBackground",value:function(t,e,r){var n=r,i=t;if("string"!=typeof n){var o=this.getSpriteConfig(i);if(o){var a=new w(o,e),s=new x(o,e);return new C(a,s,this.mapContainerId)}}else{var u=this.getSpriteConfig(n),c=this.getSpriteConfig(i);if(u&&c){var l=new x(u,e),h=new x(c,e);return new C(l,h,this.mapContainerId)}}return null}}]),t}();r(14),r(31);function I(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return p()(this,r)}}var M=null,S=null,T=function(t){l()(r,t);var e=I(r);function r(t,n){var o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i()(this,r),o=e.call(this),S=u()(o),o.mapContainerId=t,o.spritePromise=Promise.resolve(),o.miniId=a.miniId,o.onLoadMap=a.onLoadMap,o.mapStatus=n,o.kedamap=g.a.getProps(o.mapContainerId,"kedamap"),g.a.setProps(o.mapContainerId,"mapType","KD"),o.mapConfig=g.a.getProps(o.mapContainerId,"config"),o.userConfig=g.a.getProps(o.mapContainerId,"userConfig"),o._userConfig=_.a.deepClone(o.userConfig),o.onLoadMap&&(o._userConfig.onLoadMap=o.onLoadMap),o.mapModules=g.a.getProps(o.mapContainerId,"modules"),o.mapInstance=g.a.getProps(o.mapContainerId,"map"),2===o.mapConfig.DEFAULT_MAP_SERVICE_TYPE&&(o.isCompatibleEngine=!0),o.type="map",o.userConfig.renderMapFlag?o.buildMap(o.miniId):o.callBack(),o}return a()(r,[{key:"clearMap",value:function(){this._clearTrack(),this.mapModules&&this.mapModules.geometry&&this.mapModules.geometry()&&this.mapModules.geometry().clear(),this.mapModules&&this.mapModules.base&&this.mapModules.base()&&this.mapModules.base().scales&&(this.mapModules.base().scales=null);var t=g.a.getProps(this.mapContainerId,"heatmapCollect"),e=g.a.getProps(this.mapContainerId,"relationMapCollect"),r=g.a.getProps(this.mapContainerId,"layerCollect");t&&Object.keys(t.layerObj).length>0&&t.clear(),e&&Object.keys(e.layerObj).length>0&&e.clear(),r&&r.clear(),r=null,g.a.setProps(this.mapContainerId,"modulesStore",null),M=null,this.map&&(this.map.remove(),this.map=null)}},{key:"buildMap",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";t||this.clearMap();var e=this,r=this.userConfig,n=new E(this.mapConfig.SPRITE_URL,this.mapContainerId);g.a.setProps(this.mapContainerId,"spriteManager",n);var i=r.style,o="EPSG:3857";if(this.isCompatibleEngine){var a=this.mapConfig.MAP_DATA_SOURCE.lastIndexOf("/"),s=this.mapConfig.MAP_DATA_SOURCE.substring(0,a);i={version:8,name:"kmapserver-vector-fresh",metadata:{},center:[116.433015,39.911172],zoom:10,bearing:0,pitch:0,sources:{},glyphs:"".concat(s,"/fonts/{fontstack}/{range}.pbf"),sprite:_.a.toAbsUrl(this.mapConfig.SPRITE_URL_FRESH),layers:[],created:"2019-05-11T08:16:14.734Z",id:1,modified:"2019-07-05T05:47:52.222Z",owner:"kmaper",visibility:"public",draft:!1},o=this.mapConfig.compatibleMapStyle.projection||"EPSG:4326"}M=this.map=this._map=new this.kedamap.Map({container:t||r.containerId,style:this.mapStatus?this.mapConfig.SATELLITE_STYLE:i,maxZoom:r.maxZoom,minZoom:r.minZoom,isIntScrollZoom:!!r.isIntScrollZoom,crs:"4326"===r.crs?"EPSG:4490":"EPSG:3857",center:r.center,zoom:r.zoom,pitch:r.pitch,bearing:r.bearing,pitchWithRotate:!this.isCompatibleEngine,maxTileCacheSize:r.maxTileCacheSize,preserveDrawingBuffer:r.preserveDrawingBuffer||!0,renderWorldCopies:!1,projection:o,crossSourceCollisions:!r.hasOwnProperty("crossSourceCollisions")||r.crossSourceCollisions,transformRequest:function(t,r){if("Tile"!==r)return{url:t};var n="";if(e.mapConfig&&e.mapConfig.TOKEN){var i="".concat(e.mapConfig.TOKEN,"-").concat((new Date).getTime()).concat(Object(_.b)());n=btoa(i)}return{url:t,headers:{Authorization:n}}}}),this.mapConfig.SPRITE_URL&&!t&&(this.spritePromise=_.a.addSpriteToMap(this,this.mapContainerId,this.mapConfig.SPRITE_URL));var u=this.map.getContainer();A.a.setDelegateContainer(u),M.on("load",(function(){e.isCompatibleEngine?(e.loadCompatibleLayers("default"),setTimeout((function(){e.load()}),1050)):e.load()}))}},{key:"load",value:function(){var t=this;this.userConfig.defaultLoad&&this.userConfig.defaultLoad.map((function(e){t.map.addSource(e.id,{type:"geojson",data:e.source}),t.map.addLayer(Object.assign({id:e.id,source:e.id},e.style))}));if(this.mapConfig.CLOUND_MAP){var e=this.mapConfig.CLOUND_MAP+"/tile/{z}/{y}/{x}",r="clound_map_layer"+Object(_.b)();this.map.addLayer({id:r,type:"raster",source:{id:r,type:"raster",tiles:[e],tileSize:256}})}this.userConfig.initStyle=this.map.getStyle(),this.callBack()}},{key:"loadCompatibleLayers",value:function(t){var e=this,r=this.mapConfig.compatibleMapStyle,n=r.scenes[t];if(!n)throw Error("场景名称不存在");n.forEach((function(t){var n=_.a.deepClone(r.layers[t]);switch(n.serviceType){case"BING_MAP":e.getBingLayerOpts(n,t);break;case"SHUTU":e.getShuTuLayerOpts(n,t);break;case"TILE_IMAGE":e.getTileImageLayerOpts(n,t);break;case"WMS":e.getWMSLayerOpts(n,t);break;case"ARCGIS_MAPSERVER":e.addArcGISMapServer(n,t);break;default:e.createOlLayer(n.serviceType,n,t)}}));var i=this.map.style._order||[],o="";i.length>0&&(o=i[0]),o?this.CustomTileLayer.addLayerToMap(this.map,o):this.CustomTileLayer.addLayerToMap(this.map)}},{key:"getBingLayerOpts",value:function(t,e){var r=["x","y","z","type","url","serviceType","tileGrid","auth"],n="";for(var i in t)r.includes(i)||(n="".concat(n).concat(i,"=").concat(t[i],"&"));n=n.substr(0,n.length-1),t.wrapX=!1,t.crossOrigin="anonymous",t.projection=t.projection?t.projection:"EPSG:4326",t.tileUrlFunction=function(e){if(!e)return"";for(var r=e[0],i="",o=e[1],a=-e[2]-1,s=0;s>=1,a>>=1;return"".concat(t.url)+i+"?"+"".concat(n)},this.createOlLayer("XYZ",t)}},{key:"getShuTuLayerOpts",value:function(t,e){var r=this,n=t.tileCoordOffset,i=0,o=-1,a=0;n&&(i=n.x,o=n.y,a=n.z),t.tileUrlFunction=function(e){var n=r.zeroPad(e[0]+a,2,10),s=r.zeroPad(e[1]+i,8,16),u=r.zeroPad(-e[2]+o,8,16);return"".concat(t.url)+"".concat(t.z)+n+"/"+"".concat(t.y)+u+"/"+"".concat(t.x)+s+".png"},this.createOlLayer("TILE_IMAGE",t)}},{key:"getTileImageLayerOpts",value:function(t,e){t.tileUrlFunction=function(e){if(!e)return"";var r=e[0],n=e[1],i=e[2]+1;n<0&&(n=-n),i<0&&(i=-i);var o="";"route"===t.urlType?(o="".concat(t.url).concat(r,"/").concat(i,"/").concat(n),o+=t.params||""):o=t.url+"".concat(t.x,"=").concat(n,"&").concat(t.y,"=").concat(i,"&").concat(t.z,"=").concat(r);return o},this.createOlLayer("TILE_IMAGE",t,e)}},{key:"addArcGISMapServer",value:function(t,e){this.createOlLayer("ARCGIS_MAPSERVER",t,e)}},{key:"getWMSLayerOpts",value:function(t,e){t.tileUrlFunction=function(){return t.url},t.params={LAYERS:t.layers},this.createOlLayer("WMS",t,e)}},{key:"zeroPad",value:function(t,e,r){for(var n=t.toString(r||10);n.length1?e.push("p"+i+" = p"+i+" * ut + p"+(i+1)+" * t"):e.push("return p"+i+" * ut + p"+(i+1)+" * t");n>1&&e.push("")}return e=["return function bezier"+t+"(arr, t) {",e.map((function(t){return" "+t})).join("\n"),"}"].join("\n"),Function(e)()}t.exports=function(t,e){return n(t.length)(t,e)},t.exports.prepare=n},function(t,e,r){var n=r(666),i=r(668),o=r(346),a=r(292),s=o((function(t,e){if(null==t)return[];var r=e.length;return r>1&&a(t,e[0],e[1])?e=[]:r>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,n(e,1),[])}));t.exports=s},function(t,e){function r(t){var e=t.target||t.srcElement;e.__resizeRAF__&&cancelAnimationFrame(e.__resizeRAF__),e.__resizeRAF__=requestAnimationFrame((function(){var r=e.__resizeTrigger__,n=r&&r.__resizeListeners__;n&&n.forEach((function(e){e.call(r,t)}))}))}e=function(t,e){var n,i=this.document,o=i.attachEvent;if("undefined"!=typeof navigator&&(n=navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/Edge/)),!t.__resizeListeners__)if(t.__resizeListeners__=[],o)t.__resizeTrigger__=t,t.attachEvent("onresize",r);else{"static"===getComputedStyle(t).position&&(t.style.position="relative");var a=t.__resizeTrigger__=i.createElement("object");a.setAttribute("style","position: absolute; top: 0; left: 0; height: 100%; width: 100%; pointer-events: none; z-index: -1; opacity: 0;"),a.setAttribute("class","resize-sensor"),a.setAttribute("tabindex","-1"),a.__resizeElement__=t,a.onload=function(){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__,this.contentDocument.defaultView.addEventListener("resize",r)},a.type="text/html",n&&t.appendChild(a),a.data="about:blank",n||t.appendChild(a)}t.__resizeListeners__.push(e)};t.exports="undefined"==typeof window?e:e.bind(window),t.exports.unbind=function(t,e){var n=document.attachEvent,i=t.__resizeListeners__||[];if(e){var o=i.indexOf(e);-1!==o&&i.splice(o,1)}else i=t.__resizeListeners__=[];if(!i.length){if(n)t.detachEvent("onresize",r);else if(t.__resizeTrigger__){var a=t.__resizeTrigger__.contentDocument,s=a&&a.defaultView;s&&(s.removeEventListener("resize",r),delete s.__resizeTrigger__),t.__resizeTrigger__=!t.removeChild(t.__resizeTrigger__)}delete t.__resizeListeners__}}},function(t,e,r){var n=r(781),i=r(350);t.exports=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=i(r))==r?r:0),void 0!==e&&(e=(e=i(e))==e?e:0),n(i(t),e,r)}},function(t,e,r){"use strict";var n=r(128);function i(t){return Array.isArray(t)?Object(n.c)(t):t}var o,a,s=r(100),u=r(134),c=r(117),l=(a={},function(t){if(o||(o=document.createElement("div").style),!(t in a)){o.font=t;var e=o.fontFamily;if(o.font="",!e)return null;a[t]=e.split(/,\s?/)}return a[t]}),h=r(53),p=r(258),d=r(162),f=[0,0,0,1],g=[0,0,0,1],m=new p.a,y={},v=null,A={};!function(){var t,e,r=y,n=["monospace","serif"],i=n.length,o="wmytzilWMYTZIL@#/&?$%10";function a(t){for(var r=_(),a=100;a<=700;a+=300){for(var s=a+" ",u=!0,c=0;ct.length)&&(e=t.length);for(var r=0,n=new Array(e);r\n \n 工具\n \n
\n
    \n ',l.a.getDomById(this.containId).appendChild(t),this.buildToolsList(),this.expand()}},{key:"expand",value:function(){var t=this;document.getElementById(this.boxId).addEventListener("click",(function(e){this.classList.contains("kmap_toolbox_active")?(this.classList.remove("kmap_toolbox_active"),document.getElementById(t.parentId).classList.remove("kmap_toolbox_options_active"),document.getElementById(t.parentId).style.height="0px"):(this.classList.add("kmap_toolbox_active"),document.getElementById(t.parentId).classList.add("kmap_toolbox_options_active"),document.getElementById(t.parentId).style.height=34*t.options.length+12+"px")}))}},{key:"buildToolsList",value:function(){for(var t=this,e=l.a.getDomById(this.parentId),r=document.createDocumentFragment(),n=0;n\n ").concat(h[this.options[n]].text,""),r.appendChild(i)}e.appendChild(r),this.options.forEach((function(e){l.a.addEventById(e,"click",t.callTools.bind(t))}))}},{key:"destory",value:function(){l.a.removeEventById(this.parentId,"click",this.callToolFun),l.a.removeEventById(this.boxId,"click",this.expandFun),l.a.getDomById(this.id).innerHTML=""}},{key:"callTools",value:function(t){var e=this;switch("LI"===t.target.tagName?t.target.id:t.target.parentElement.id){case"forward":this.kmap.forward();break;case"goBack":this.kmap.goBack();break;case"zoomTo":this.kmap.zoomTo({zoom:5});break;case"fullMap":this.kmap.mapFull({ended:function(t){}});break;case"reset":this.kmap.reset();break;case"eagle":this.eagle_on?(document.getElementById("kmap-iconicon-eagle").style.color="#999999",t.target.style.color="#333333",this.kmap.eagle({flag:!1}),this.eagle_on=!1):(document.getElementById("kmap-iconicon-eagle").style.color="#2C82FF",t.target.style.color="#2C82FF",this.kmap.eagle({flag:!0}),this.eagle_on=!0);break;case"scale":this.scale_on?(document.getElementById("kmap-iconicon-scale").style.color="#999999",t.target.style.color="#333333",this.kmap.scale({flag:!1,anchor:"bottom-left"}),this.scale_on=!1):(document.getElementById("kmap-iconicon-scale").style.color="#2C82FF",t.target.style.color="#2C82FF",this.kmap.scale({flag:!0,anchor:"bottom-left"}),this.scale_on=!0);break;case"screenshot":this.kmap.screenshot({callback:function(t){e.screenshotFun(t)}});break;case"customScreenshot":this.kmap.removeAllGeometries(),this.kmap.drawRectangle({callback:function(t){var r=t.data,n={lng:r.coordinates[0][1][0],lat:r.coordinates[0][1][1]},i={lng:r.coordinates[0][3][0],lat:r.coordinates[0][3][1]};e.kmap.customScreenshot({nwPoint:n,sePoint:i,callback:function(t){e.customScreenshotFun(t)}})}})}}}]),t}(),d=function(){function t(e,r){a()(this,t),this.mapContainerId=r,this.kmap=c.a.getProps(this.mapContainerId,"_kmap"),this.containId=c.a.getProps(this.mapContainerId,"userConfig").containerId,this.styleType=e,this.buildHtml()}return u()(t,[{key:"buildHtml",value:function(){var t=document.createElement("div");"light"===this.styleType?t.classList.add("kmap_toolbox_zoom_controller_container_light"):"dark"===this.styleType&&t.classList.add("kmap_toolbox_zoom_controller_container_dark"),t.classList.add("kmap_toolbox_zoom_controller_container"),t.innerHTML='\n
    \n \n
    \n
    \n \n
    ',l.a.getDomById(this.containId).appendChild(t),l.a.addEventById("zoomIn","click",this.callTools.bind(this)),l.a.addEventById("zoomOut","click",this.callTools.bind(this))}},{key:"callTools",value:function(t){switch("SPAN"===t.target.tagName?t.target.id:t.target.parentElement.id){case"zoomIn":this.kmap.zoomIn();break;case"zoomOut":this.kmap.zoomOut()}}}]),t}(),f=function(){function t(e,r){var n=this;a()(this,t),this.mapContainerId=r,this.kmap=c.a.getProps(this.mapContainerId,"_kmap"),this.containId=c.a.getProps(this.mapContainerId,"userConfig").containerId,this.funcs=["moveUp","moveLeft","moveDown","moveRight","pitchDown","pitchUp","rotateLeft","rotateRight","compass"],this.currentPitchDegree=0,this.currentBearingDegree=0,this.stepDegree=15,this.styleType=e,this.buildHtml(),this._handlerMouseMove=this.handlerMouseMove.bind(this),this.kmap.addEventOnMap({event:"mousedown",handler:function(){n.kmap.addEventOnMap({event:"mousemove",handler:n._handlerMouseMove})}}),this.kmap.addEventOnMap({event:"mouseup",handler:function(){n.kmap.removeEventOnMap({event:"mousemove",handler:n._handlerMouseMove})}}),this.kmap.addEventOnMap({event:"moveend",handler:this._handlerMouseMove}),this.handlerMouseMove()}return u()(t,[{key:"buildHtml",value:function(){var t=this,e=document.createElement("div");"light"===this.styleType?e.classList.add("kmap_toolbox_compass_container_light"):"dark"===this.styleType&&e.classList.add("kmap_toolbox_compass_container_dark"),e.classList.add("kmap_toolbox_compass_container"),e.innerHTML='\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n
    \n
    \n
    ',l.a.getDomById(this.containId).appendChild(e),this.funcs.forEach((function(e){l.a.addEventById(e,"click",t.callTools.bind(t))}))}},{key:"callTools",value:function(t){switch("svg"===t.target.tagName?t.target.id:t.target.parentElement.id){case"moveUp":this.kmap.moveBy({type:0,value:100,skewing:"top"});break;case"moveDown":this.kmap.moveBy({type:0,value:100,skewing:"bottom"});break;case"moveLeft":this.kmap.moveBy({type:0,value:100,skewing:"left"});break;case"moveRight":this.kmap.moveBy({type:0,value:100,skewing:"right"});break;case"pitchDown":this.kmap.setPitch({degree:this.currentPitchDegree+this.stepDegree});break;case"pitchUp":this.kmap.setPitch({degree:this.currentPitchDegree-this.stepDegree});break;case"rotateLeft":c.a.getProps(this.mapContainerId,"map").map.easeTo({bearing:this.currentBearingDegree+this.stepDegree,animate:!0,duration:500},{isTrusted:!1});break;case"rotateRight":c.a.getProps(this.mapContainerId,"map").map.easeTo({bearing:this.currentBearingDegree-this.stepDegree,animate:!0,duration:500},{isTrusted:!1});break;case"compass":this.kmap.setBearing({degree:this.currentBearingDegree=0})}}},{key:"handlerMouseMove",value:function(t){var e=this,r=document.getElementById("pitchDown"),n=document.getElementById("pitchUp");this.kmap.getPitch({callback:function(t){e.currentPitchDegree=t.data,document.getElementById("kmap_toolbox_compass_inner_comp").style.transform="rotateX(".concat(e.currentPitchDegree,"deg)"),0===e.currentPitchDegree?n.classList.contains("disabled")||n.classList.add("disabled"):60===e.currentPitchDegree?r.classList.contains("disabled")||r.classList.add("disabled"):(n.classList.contains("disabled")&&n.classList.remove("disabled"),r.classList.contains("disabled")&&r.classList.remove("disabled"))}}),this.kmap.getBearing({callback:function(t){e.currentBearingDegree=t.data,document.getElementById("compass").style.transform="rotate(".concat(-e.currentBearingDegree,"deg)")}})}}]),t}(),g=function(){function t(e){a()(this,t),this.mapContainerId=e.mapContainerId,this.map=c.a.getProps(this.mapContainerId,"map").map,this.toolBox=e.toolBox||!1,this.toolBoxOptions=e.toolBoxOptions||["forward","goBack","zoomTo","fullMap","scale","reset","eagle"],this.zoomControl=e.zoomControl||!1,this.compass=e.compass||!1,this.styleType=e.styleType||"light",this.init()}return u()(t,[{key:"init",value:function(){this.toolBox&&this.addControl("toolBox",this.toolBoxOptions),this.zoomControl&&this.addControl("zoomControl"),this.compass&&this.addControl("compass")}},{key:"addControl",value:function(t,e){switch(t){case"toolBox":this.toolBoxObj=new p(e,this.styleType,this.mapContainerId);break;case"zoomControl":this.scaleObj=new d(this.styleType,this.mapContainerId);break;case"compass":this.compassObj=new f(this.styleType,this.mapContainerId)}}}]),t}()},function(t,e){t.exports="data:application/vnd.ms-fontobject;base64,nBsAAPQaAAABAAIAAAAAAAIABQMAAAAAAAABAJABAAAAAExQAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAdj1xswAAAAAAAAAAAAAAAAAAAAAAABAAaQBjAG8AbgBmAG8AbgB0AAAADgBSAGUAZwB1AGwAYQByAAAAFgBWAGUAcgBzAGkAbwBuACAAMQAuADAAAAAQAGkAYwBvAG4AZgBvAG4AdAAAAAAAAAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzJIOlRPAAABfAAAAFZjbWFw1q3c2gAAAkgAAAL6Z2x5ZlGSpnQAAAWAAAARaGhlYWQYsCFNAAAA4AAAADZoaGVhB94EWAAAALwAAAAkaG10eHUPAAAAAAHUAAAAdGxvY2E3TjsoAAAFRAAAADxtYXhwATYAmQAAARgAAAAgbmFtZT5U/n0AABboAAACbXBvc3QneXJrAAAZWAAAAZoAAQAAA4D/gABcBLoAAAAABAAAAQAAAAAAAAAAAAAAAAAAAB0AAQAAAAEAALNxPXZfDzz1AAsEAAAAAADayG6oAAAAANrIbqgAAP+ABAADgAAAAAgAAgAAAAAAAAABAAAAHQCNAA8AAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKAB4ALAABREZMVAAIAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAAAAQQJAZAABQAIAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA8cTyVAOA/4AAXAOAAIAAAAABAAAAAAAABAAAAAS6AAAEVQAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAFAAAAAwAAACwAAAAEAAABmgABAAAAAACUAAMAAQAAACwAAwAKAAABmgAEAGgAAAAIAAgAAgAA8cXySvJU//8AAPHE8jPyU///AAAAAAAAAAEACAAKADgAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAAUABUAFgAXABgAGQAaABsAHAANAA4ADwAQABEAEwASAAABBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAFgAAAAAAAAABwAAPHEAADxxAAAAAEAAPHFAADxxQAAAAIAAPIzAADyMwAAAAMAAPI0AADyNAAAAAQAAPI1AADyNQAAAAUAAPI2AADyNgAAAAYAAPI3AADyNwAAAAcAAPI4AADyOAAAAAgAAPI5AADyOQAAAAkAAPI6AADyOgAAAAoAAPI7AADyOwAAAAsAAPI8AADyPAAAAAwAAPI9AADyPQAAABQAAPI+AADyPgAAABUAAPI/AADyPwAAABYAAPJAAADyQAAAABcAAPJBAADyQQAAABgAAPJCAADyQgAAABkAAPJDAADyQwAAABoAAPJEAADyRAAAABsAAPJFAADyRQAAABwAAPJGAADyRgAAAA0AAPJHAADyRwAAAA4AAPJIAADySAAAAA8AAPJJAADySQAAABAAAPJKAADySgAAABEAAPJTAADyUwAAABMAAPJUAADyVAAAABIAAAAAAAAAMgCEAKgAzAEoATYBzAIGAiICOgKUAs4DWAPUBBgEdASWBNgFpgX0Bn4GoAbsBxwHgAgQCDQItAABAAAAAAO7AwIAGwAANyMuATUmEiU1NDY3NhcBFhQHAQYmPQEOAQcOAbkHBgkLlwElBgcOCgE7Bgb+xQobP/tQAQtfAg0HGQFQMNoHCwIGC/7IBhIH/sYKDA3WBF58BwcAAAAAAgAAAAADeALtACEAMwAANw4BKwEuATU0Njc+ATc1PgE3NhYXARYUBwEOAScmJzUOATc+ATMyFh0BNycVFAYHDgEHNsYDDwsJCg0eHzGndwEKCQkUCAEgCQn+4AgUCRMBabW2K0wSDhPPzxENfaEoUIAJDAMTCxtmNlRqDbwLEAIFAwj+4gobCf7fBwQFChS0Dl6ZDA0UDYrP0IgNEwEIZlI9AAABAAD/1QPtAv4AEQAACQEWFA4BIyEiLgE0NwE+ATIWAisBuQgNGA78jg4YDQgBuQcXGhcC5f0/DBwZDg4ZHAwCwQsNDQAAAAABAAAAAAOCAoEAEAAAARY+ASYnJSYiBwUOAR4BNyUDDRc3JwUW/sYUMhT+xhYFJjgXAQ0BEBIFKjcS+hAQ+hI3KwQS1wAAAAACAAD/lQPDA1YALAA2AAABLgEnLgEnJi8BJiIGDwEGDwEOARceARcuASc+AT8BNjc2NzYWFx4BBzY3PgElJicuATUWFw4BA8AOYAYoiyQbZr8XMywQCwIBBEUkIy3WlEdTAQIiHwgNDTQ9QYM9NAwDHxcTEv6SDQsyK2lfESsBXS9YA0VfExA2ZQwWEw8CAglt+32X1ikgZT8oSBsHCwkhCA0PGhs2AhQfGDqoBAYbXwUwQxALAAAAAQAAAAADbgHCAAMAABM1IRWSAtwBPoSEAAAAAAIAAP/AA8ADQAALAF8AAAEOAQceARc+ATcuAQMiJjciJicuATc2Ji8BJiMuAScuAScGJjc+AScHBgciJjc0NhceARcUFjcyFgcOARcWNicmFhcyBgcGFhcWBicuATcuAQcOATcGFjcmNhcWBgcOAQIAvv0FBf2+vv0FBf0CAQ0EAjghAxAUAi9FIR0SAiEGAS4rBjQeBh8qERAKAg0BPkICIwcnMgYvICgHLQU8CAFreQYaaFM0MQEiLQMZAgE3JQcEUwRIhAM+awMEJQFQA0AF/b6+/QUF/b6+/fzcGSMYGQEyGwMyDwMCATAiASIOAjdLBmAMCQcBBgUIUREBFxcCAiASGhsWDAUIPgoMjgoIDXUaAxQXAR0YAxUZB0UUDFpBBAErAU88BVcAAAEAAP+/A8IDQQAjAAATPgE3MTIWBw4BFR4BNzU0Nz4BFwUWFxYGBwUGIyImJzUjLgFACbCMBAEEV2QQt38GCRsMAWoFBAgFDP6XCQsOFAEMv/8B0YXGJAcCH4dVc40FXAkICwUH3wQEDBgI3wUSDVwD5QAAAQAA/64CXgNSAA0AAAURMzY3NCYnNx4BFQYCAaNXHAE5Njs8PgFhUQE0YGlmw1clX9Zwkv78AAABAAAAAANuAu4ACwAAAREzESEVIREjESE1Ab6EASz+1IT+1AHCASz+1IT+1AEshAAEAAD/tAPAA0wADwAeACwANQAABQYkJz4BNxYENyc+ATcOARMmJAcfAQ4BBz4BNzYEFwEmNTQ+ATIeARUUBwYiNzI2NCYiBhQWAjCe/wA6ETQRWgFspFdQakUa2YVa/o2fLCpHb0YZ2p2dAQE6/kajM1pmWjOjDh4PHygoPigoPg2bkQcfB8FRo0IhJxOZzgIsxEGjJCAVMRWZzRQNm5H+enqONFg0NFg0jnoJySk9KSk9KQABAAD/vwPCA0EAIwAAEx4BFzEyNicuATU+ARcVFBceATclNjc2JiclJiMiBgcVIw4BQAmwjAQBBFdkELd/BgkbDAFqBQQIBQz+lwkLDhQBDL//AS+FxiQHAh+HVXSMBVwJCAsFB98DBQwYCN8FEg1cA+UAAAUAAP+mA8ADWwAYACQAOQBFAFkAAAEhLgE/AT4BMhYfATc+ATIWHwEeAQcOASMBNDYyFhcVDgEuATUVNDYyFhcRHgEXITIWFAYHIS4BJxEBFAYiJj0BPgEyFhU1FAYiJjURLgEnIS4BNDY3IR4BFwK1/p4VFAk3BRATEAQWXAQQExAFfQUBBgIPC/3WEx0SAQESHRMTHRIBASMaApMOExMO/W03SQEC6hMcFAESHRMTHBQBIxr9bQ4TEw4CkzdJAQEAASUTXgkKCgklmggKCgjUCRQJCQoCOQ4UEw9HDxQBFA7kDhQUDv7XHCUBFB4TAQJMOgEo/b0OFBQOSQ8UFA/YDxMUDgE0HCUBARQdEwECTTkAAA8AAAAAA8ADAAABAAwAEAAUABoAIAAmACwAMgA4AD4ARgBMAFIAWQAAASM3IREjNRU1IREjNQcjNTMHIzUzBSM1MxUjATUzFSM1ETUzFSM1BzMVIzUzITMVIzUzITMVIzUzITMVIzUzIzMVIzUzFTMnFSM1MxURFSM1MxURFSM1MxU1AgA4cAGIOP54OOA4OHA4OAEYcHBwAmg4ODg4qHBwcP7ocHBw/uhwcHD+6HBwcOA4cDg4ODg4ODg4OALJN/6AQEBAAQk3Nzdvbzc3N/4Sbm5u/u5upaVuNzc3Nzc3Nzc3bjfbbW1tARJubm4BEm1ubm4AAAAAAQAAAAADwAKAAC0AACU1NDYyFhcVMxE+ATIWFREUBgchLgE1ETQ2MhYXETM1PgEyFhcVMzU+ATIWFxUCnxklGAFzARglGRkS/NYSGRklGAFzARglGAF3ARglGAHm3hYdHRbeAWcWHBwW/mYWHAEBHBYBmhYcHBb+md4WHR0W3t4WHR0W3gAAAAQAAAAAA8ADXgAQABIAJgA6AAABIR4BFxEOASMhIiYnET4BNzMhBSEVMxUeATI2NzUhFR4BMjY3NTMBIzU+ATchHgEXFSM1NCYjISIGFQEgAkwkLwEBLyT9KCQvAQEvJMwBQAEE/LiMAR8wHwEBUAEfMB8BjP23UwE7LQEjLDwBUw0J/t0JDQKpATIm/gkmMjMlAfcmMgGxO4YMEREMhoYMEREMhgESJS07AQE7LSUlCQ0NCQAAAAAEAAD/gAK7A4AAAgAFAAYADwAABQMhAxMhOwEuASIGFBYyNgIAugF0urr+jLovARooGhooGoACAAIA/gAUGhooGhoAAAEAAAAAA4wDJAAgAAABJiIHCQEuAQ4BHwEJAQcGHgE2NwkBHgE+AS8BCQE3NiYDdhQ0FP7p/ukTMicEEAQBGP7oBBAEJzITARcBFxQyJwQQBf7pARcFDwMDEBMT/ukBFxICIzIVBf7o/ugFFTEjARIBF/7pEwIkMhUFARgBGAUUMAAAAAMAAP/KA9cDNgBzAIAAjAAAATIWFxUXHgEfARYOASYnLgEvARUUBgcjIiY9AQcOAQ8BMzIWHwEOASsBFx4BHwE1NDY/AR4BFxU3PgE/ASMiJi8BPgE7AR4BFAYHIwcOAQ8BFQYHFQchBSc3ISU1Jy4BLwEjIiYvATQ2OwE3PgE/ATU0NjcXHgEUBgciJi8BNz4BFyIGDwEXHgE+ATQmAfkOEgEMLUsbCAYGFxgIEzYhBg8MBg4SBTNHDAEnDBICAQESDigBDEgzBQ8LBg4SAQQyRwsBJgwSAgEBEg6WDhERDi4CDmZLCgEMUgIb/k0jkf2bAa0KTGkOAS0MEgIBEw4tAg9oSwoPCwUjLy8jIC0EAQEELSAOFAIBAQMWHRMVAzUSDi4CCS8lCwwYDwULHCYIAScMEQMSDigBC0cyBA8MBg4SBTNIDAEoDBICAQESDicBDEczBQ8LBg4TARIbEgEKS2gPAi0RCQIg2kRJqwsBDmlMCg8LBg4TCktmDgItDBED6AEuRi4BKh8JCCApLBINBgYPEQMUHhYAAAABAAAAAAP+AoIALwAAASIHBQYHNS4BIgYHER4BMjY3NRYXBR4BPgE9ARYXBR4BPgE3ES4CBgcFBgc1NCYCOhEO/tsEAwEQGhABARAaEAEDBAElDR4bEAYLASUNHhwPAQEPHB4N/tsKByACgQrJAwO6DBERDP48DBERDLoDA8kJAg8aEK4LCMkJAg8aEAGSEBoPAgnJCAuuFyAAAAAFAAAAAAMjAtkADgAeAC4APgBaAAABMhYHEQ4BByEuAScRNDMFIyIGFREUFjsBMjY3ETQmNyMiBhURFBYXMzI2NxE0JiUjIgYHERQWOwEyNjcRNCYTFx4BBwYfAR4BDwEOASclLgE/AT4BHwE2Nz4BAuYHCgMBIRn+jBghAQ4BBCUFDQkJJQUMAQl5JQUNCQklBQwBCf7vJAUNAQoJJAUNAQkSrgcJAQIJlAsMAQUCEQr97woNAgQCEQuUDAICDAIJBgf+YxghAQEiGwGZDYAHB/70BAkGBwEMBAkBBgf+9AQJAQcHAQwECQEHB/70BAkGBwENAwkBTxwBDAgODBcCEQscCg0CVAESChwLDAEYCA4ICQABAAAAAALBAeMAEAAAASYOAR8BFjI/ATYuAQYPAScBeQwlDAugCh4KoAgDFBoJh4cB1A8GIw7ADAzAChkRAgqiowAAAAEAAAAAA7QCggAvAAABMhcFFhc1NDYyFhURFAYiJj0BBgcFDgEuAT0BBgcFDgEuATURND4BFhcFFhc1PgECLBIOASUEAxEZEREZEQQD/tsNHhwQBgv+2wwfGxAQGx8MASULBgEfAoEKyQMDugwREQz+PAwREQy6AwPJCQIPGhCuCwjJCQIPGhABkhAaDwIJyQgLrhgfAAAAAgAAAAADCAKzAA8AHwAAATMyFhURFAYrASImNRE0NiEzMhYVERQGKwEiJjURNDYBIkURGBcSRREYGAGIRREYGBFFERgYArIYEP3sERcYEAIUEBgYEP3sEBgYEAIUEBgABAAAAAADKQKaACYAMgA+AEIAAAEVIyIHFREUFzMhMjc1ETQnKwE1Mx4BFxURDgEHIyEuASc1ET4BNwEyHgEGByMiLgE2PwEyHgEGByMiLgE2PwEVIzUBdEEHAwcDAZoHAwcDJiYlMwQBLyUH/mYlMwQBLyUBMBEXAhQRvREXAhQRvREXAhQRvREXAhQR1c0CmVIHA/6GCAIHAwF6CAJSAS8kCP6GJTMEAS8kCAF6JTME/sQWIRgDFiEYA4UWIRgDFiEYA7dSUgAHAAAAAAOkAvkACwAYAB4AJgA+AEkAWQAAAR4BFw4BBy4BJz4BBR4BNxYXBiYnLgE+ASUGHgI3JyIHFzYuAgEyHgEVFAcOAQcGIyImJz4BNyYnJjQ+ARciBhQWMjY0Jy4BBxcWFxYUBwYPAScmJyY0NgLeVHACAnBUVG8CAm/+BEq+Zg4VeeZaCQEQGAHqHgdLZCtTHRm2DgcnPf7JQGxAEkdjEBAQUm0CAR0aKhogQG1ANUtLaUslEi8YCxkUFxcTGgsKGhMYLwGSAm9UVG8DA29UVG++PzgLHxoSPkwIGBMCRStkSgce+wu2IUQ7IQGhPWg+LikSZkgBIBgLFQccLDR7aD1pR2ZGRmYjEhMvAQITFj8WEgMBAQMSFj8sAAABAAAAAANLAtAAEQAACQEGLgI1ETQ+ATIXAR4BFAYDL/32DRwYDQ0ZGw0CCg0PDwFR/uYHAQ8YDgI0DhgPBv7mCBgeGAAAAAAEAAAAAAN8AvkAHgA3AEIAUAAAARceAQ8BDgEmPwEGBwYkJy4BPgEXHgE3NjcnLgE+AQMyHgEUBwYHHgEVDgEiJic+ATcmJyY0PgEXIgYUHgE2NCcuAQcXFhcWFAYjJyYnJjQ2AuF+DRABDwIgHAIFWnCI/vVmCQEQGApa7HpqVD4MEAMU/0BtPx8bKhoeAm2jbQIBHRoqGiBAbUA1S0tqSiUSLxgLGRQXLiEKGhMYLwEeEAITDYQRDhUSMkgfJThWCRgTAQdNMCAdRwcCFBkQAdk8aXs0KxwIFAsYICAYCxQIHCs1emk9aUdmRgFHZiMSEi4BAxMWPysBAxIVPy0AAAASAN4AAQAAAAAAAAAVAAAAAQAAAAAAAQAIABUAAQAAAAAAAgAHAB0AAQAAAAAAAwAIACQAAQAAAAAABAAIACwAAQAAAAAABQALADQAAQAAAAAABgAIAD8AAQAAAAAACgArAEcAAQAAAAAACwATAHIAAwABBAkAAAAqAIUAAwABBAkAAQAQAK8AAwABBAkAAgAOAL8AAwABBAkAAwAQAM0AAwABBAkABAAQAN0AAwABBAkABQAWAO0AAwABBAkABgAQAQMAAwABBAkACgBWARMAAwABBAkACwAmAWkKQ3JlYXRlZCBieSBpY29uZm9udAppY29uZm9udFJlZ3VsYXJpY29uZm9udGljb25mb250VmVyc2lvbiAxLjBpY29uZm9udEdlbmVyYXRlZCBieSBzdmcydHRmIGZyb20gRm9udGVsbG8gcHJvamVjdC5odHRwOi8vZm9udGVsbG8uY29tAAoAQwByAGUAYQB0AGUAZAAgAGIAeQAgAGkAYwBvAG4AZgBvAG4AdAAKAGkAYwBvAG4AZgBvAG4AdABSAGUAZwB1AGwAYQByAGkAYwBvAG4AZgBvAG4AdABpAGMAbwBuAGYAbwBuAHQAVgBlAHIAcwBpAG8AbgAgADEALgAwAGkAYwBvAG4AZgBvAG4AdABHAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAHMAdgBnADIAdAB0AGYAIABmAHIAbwBtACAARgBvAG4AdABlAGwAbABvACAAcAByAG8AagBlAGMAdAAuAGgAdAB0AHAAOgAvAC8AZgBvAG4AdABlAGwAbABvAC4AYwBvAG0AAAAAAgAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdAQIBAwEEAQUBBgEHAQgBCQEKAQsBDAENAQ4BDwEQAREBEgETARQBFQEWARcBGAEZARoBGwEcAR0BHgAKanVtcF9ob3ZlcgRqdW1wD2ljb24tYXJyb3ctZmFjZQ9pY29uLWFycm93LWxpbmUOaWNvbi1lYWdsZS1leWUPaWNvbi1taW51cy1zaWduD2ljb24tZnVsbHNjcmVlbg1pY29uLWJhY2t3YXJkDWljb24tcm90YXRpbmcOaWNvbi1wbHVzLXNpZ24KaWNvbi1yZXNldAxpY29uLWZvcndhcmQQaWNvbi1zY3JlZW5zaG90cxtpY29uLVNjYWxpbmctb2YtcG9zaXRpb25pbmcKaWNvbi1zY2FsZQlpY29uLXRvb2wMaWNvbi1jb21wYXNzBWNsb3NlB3Zpc3VhbDEEYmFjawZkZWxldGUEcHVsbAdmb3J3YXJkBHN0b3AEbGlzdAx2aXN1YWxfY2xvc2UEcGxheQZ2aXN1YWwAAAAA"},function(t,e,r){var n=r(215),i=r(577),o=r(579);t.exports=function(t,e){return o(i(t,e,n),t+"")}},function(t,e,r){var n=r(348),i=r(210);t.exports=function(t,e){return t&&n(t,e,i)}},function(t,e,r){var n=r(583)();t.exports=n},function(t,e,r){var n=r(215);t.exports=function(t){return"function"==typeof t?t:n}},function(t,e,r){var n=r(585),i=r(62),o=r(216),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=s.test(t);return r||u.test(t)?c(t.slice(2),r?2:8):a.test(t)?NaN:+t}},function(t,e,r){"use strict";r.r(e);var n=r(159),i=r(154),o=r(46),a=r(5),s=r(27),u=r(155),c=s.a.noTarget,l=s.a.isOfMetaType,h=s.a.isInactiveFeature,p=s.a.isShiftDown,d=l(a.g.meta.VERTEX),f=l(a.g.meta.MIDPOINT),g={fireUpdate:function(){this.map.fire(a.g.events.UPDATE,{action:a.g.updateActions.CHANGE_COORDINATES,features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(t){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:t.selectedCoordPaths.length>0})},startDragging:function(t,e){this.map.dragPan.disable(),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},stopDragging:function(t){this.map.dragPan.enable(),t.dragMoving=!1,t.canDragMove=!1,t.dragMoveLocation=null},onVertex:function(t,e){this.startDragging(t,e);var r=e.featureTarget.properties,n=t.selectedCoordPaths.indexOf(r.coord_path);p(e)||-1!==n?p(e)&&-1===n&&t.selectedCoordPaths.push(r.coord_path):t.selectedCoordPaths=[r.coord_path];var i=this.pathsToCoordinates(t.featureId,t.selectedCoordPaths);this.setSelectedCoordinates(i)},onMidpoint:function(t,e){this.startDragging(t,e);var r=e.featureTarget.properties;t.feature.addCoordinate(r.coord_path,r.lng,r.lat),this.fireUpdate(),t.selectedCoordPaths=[r.coord_path]},pathsToCoordinates:function(t,e){return e.map((function(e){return{feature_id:t,coord_path:e}}))},onFeature:function(t,e){0===t.selectedCoordPaths.length?this.startDragging(t,e):this.stopDragging(t)},dragFeature:function(t,e,r){Object(u.a)(this.getSelected(),r),t.dragMoveLocation=e.lngLat},dragVertex:function(t,e,r){for(var n=t.selectedCoordPaths.map((function(e){return t.feature.getCoordinate(e)})),o=n.map((function(t){return{type:a.g.geojsonTypes.FEATURE,properties:{},geometry:{type:a.g.geojsonTypes.POINT,coordinates:t}}})),s=Object(i.a)(o,r),u=0;u0?this.dragVertex(t,e,r):this.dragFeature(t,e,r),t.dragMoveLocation=e.lngLat}},g.onClick=function(t,e){return c(e)?this.clickNoTarget(t,e):s.a.isActiveFeature(e)?this.clickActiveFeature(t,e):h(e)?this.clickInactive(t,e):void this.stopDragging(t)},g.onTap=function(t,e){return c(e)?this.clickNoTarget(t,e):s.a.isActiveFeature(e)?this.clickActiveFeature(t,e):h(e)?this.clickInactive(t,e):void 0},g.onTouchEnd=g.onMouseUp=function(t){t.dragMoving&&this.fireUpdate(),this.stopDragging(t)},e.default=g},function(t,e,r){"use strict";r.r(e);var n=r(159),i=r(154),o=r(46),a=r(5),s=r(27),u=r(155),c=s.a.noTarget,l=s.a.isOfMetaType,h=s.a.isInactiveFeature,p=s.a.isShiftDown,d=l(a.g.meta.VERTEX),f=l(a.g.meta.MIDPOINT),g={fireUpdate:function(){this.map.fire(a.g.events.UPDATE,{action:a.g.updateActions.CHANGE_COORDINATES,features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(t){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:t.selectedCoordPaths.length>0})},startDragging:function(t,e){this.map.dragPan.disable(),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},stopDragging:function(t){this.map.dragPan.enable(),t.dragMoving=!1,t.canDragMove=!1,t.dragMoveLocation=null},onVertex:function(t,e){this.startDragging(t,e);var r=e.featureTarget.properties,n=t.selectedCoordPaths.indexOf(r.coord_path);p(e)||-1!==n?p(e)&&-1===n&&t.selectedCoordPaths.push(r.coord_path):t.selectedCoordPaths=[r.coord_path];var i=this.pathsToCoordinates(t.featureId,t.selectedCoordPaths);this.setSelectedCoordinates(i)},onMidpoint:function(t,e){this.startDragging(t,e);var r=e.featureTarget.properties;t.feature.addCoordinate(r.coord_path,r.lng,r.lat),this.fireUpdate(),t.selectedCoordPaths=[r.coord_path]},pathsToCoordinates:function(t,e){return e.map((function(e){return{feature_id:t,coord_path:e}}))},onFeature:function(t,e){0===t.selectedCoordPaths.length?this.startDragging(t,e):this.stopDragging(t)},dragFeature:function(t,e,r){Object(u.a)(this.getSelected(),r),t.dragMoveLocation=e.lngLat},dragVertex:function(t,e,r){for(var n=t.selectedCoordPaths.map((function(e){return t.feature.getCoordinate(e)})),o=n.map((function(t){return{type:a.g.geojsonTypes.FEATURE,properties:{},geometry:{type:a.g.geojsonTypes.POINT,coordinates:t}}})),s=Object(i.a)(o,r),u=0;u0?this.dragVertex(t,e,r):this.dragFeature(t,e,r),t.dragMoveLocation=e.lngLat}},g.onClick=function(t,e){return c(e)?this.clickNoTarget(t,e):s.a.isActiveFeature(e)?this.clickActiveFeature(t,e):h(e)?this.clickInactive(t,e):void this.stopDragging(t)},g.onTap=function(t,e){return c(e)?this.clickNoTarget(t,e):s.a.isActiveFeature(e)?this.clickActiveFeature(t,e):h(e)?this.clickInactive(t,e):void 0},g.onTouchEnd=g.onMouseUp=function(t){t.dragMoving&&this.fireUpdate(),this.stopDragging(t)},e.default=g},function(t,e,r){"use strict";r.r(e);var n=r(27),i=r(46),o=r(5),a=r(200),s=r(226),u={onSetup:function(){var t=this.newFeature({type:o.g.geojsonTypes.FEATURE,properties:{_type_:o.g.geojsonTypes.CIRCLE},geometry:{type:o.g.geojsonTypes.POLYGON,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),i.a.disable(this),this.updateUIClasses({mouse:o.g.cursors.ADD}),this.activateUIButton(o.g.types.CIRCLE),this.activateUIButton(o.g.types.LINE),this.setActionableState({trash:!0}),{circle:t,currentVertexPosition:0}},onMouseMove:function(t,e){var r=t,i=r.currentVertexPosition,u=r.circle;if(0!==i){var c=Object(a.a)(u.center[1],u.center[0],e.lngLat.lat,e.lngLat.lng),l=Object(s.a)(u.center,c);u.setCoordinates([l]),u.radius=c,t.line.updateCoordinate(2,e.lngLat.lng,e.lngLat.lat),i=l.length,n.a.isVertex(e)&&this.updateUIClasses({mouse:o.g.cursors.POINTER}),t=Object.assign(t,{currentVertexPosition:i,circle:u})}},onMouseDown:function(t,e){if(!t.line){var r=this.newFeature({type:o.g.geojsonTypes.FEATURE,properties:{_type_:o.g.geojsonTypes.LINE_STRING},geometry:{type:o.g.geojsonTypes.LINE_STRING,coordinates:[]}});this.addFeature(r),t.line=r}this.map.dragPan.disable();var i=t,a=i.circle,u=i.currentVertexPosition;if(u>0)return this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[a.id]});n.a.isVertex(e)&&this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[a.id]}),this.updateUIClasses({mouse:o.g.cursors.ADD}),a.center=[e.lngLat.lng,e.lngLat.lat];var c=Object(s.a)([e.lngLat.lng,e.lngLat.lat],0);a.setCoordinates([c]),u=c.length,this.map.fire(o.g.events.CLICK,Object.assign(e,{features:[t.circle.toGeoJSON()],center:a.center,radius:a.radius})),t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===t.direction?t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat):t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat),t=Object.assign(t,{currentVertexPosition:u,circle:a})},onDrag:function(t,e){u.onMouseMove(t,e)},onMouseUp:function(t,e){this.map.dragPan.enable();var r=t.circle;if(t.currentVertexPosition>0)return this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[r.id]})},onKeyUp:function(t){var e=t.circle;n.a.isEscapeKey&&(this.deleteFeature(e.id,{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)),n.a.isEnterKey&&this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[e.id]})},onStop:function(t){var e=t.circle,r=t.currentVertexPosition,n=t.line;n&&(this.deleteFeature(n.id,{silent:!0}),delete t.line),this.updateUIClasses({mouse:o.g.cursors.NONE}),i.a.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.id)&&(e.removeCoordinate("0.".concat(r)),e.isValid()?this.map.fire(o.g.events.CREATE,{features:[e.toGeoJSON()],center:e.center,radius:e.radius}):(this.deleteFeature([e.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT,{},{silent:!0})))},toDisplayFeatures:function(t,e,r){var n=t.circle,i=e.properties.id===n.id;if(e.properties.active=i?o.g.activeStates.ACTIVE:o.g.activeStates.INACTIVE,!i)return r(e);if(0!==e.geometry.coordinates.length){var a=e.geometry.coordinates[0].length;if(!(a<3))return e.properties.meta=o.g.meta.FEATURE,a>3?r(e):void 0}},onTrash:function(t){var e=t.circle;this.deleteFeature([e.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)}};e.default=u},function(t,e,r){"use strict";r.r(e);var n=r(23),i=r.n(n),o=r(27),a=r(181),s=r(46),u=r(5),c=r(88),l={onSetup:function(t){var e,r,n=(t=t||{}).featureId,o="forward";if(n){if(!(e=this.getFeature(n)))throw new Error("Could not find a feature with the provided featureId");var a=t.from;if(a&&"Feature"===a.type&&a.geometry&&"Point"===a.geometry.type&&(a=a.geometry),a&&"Point"===a.type&&a.coordinates&&2===a.coordinates.length&&(a=a.coordinates),!a||!Array.isArray(a))throw new Error("Please use the `from` property to indicate which point to continue the line from");var c=e.coordinates.length-1;if(e.coordinates[c][0]===a[0]&&e.coordinates[c][1]===a[1]){var l;r=c+1,(l=e).addCoordinate.apply(l,[r].concat(i()(e.coordinates[c])))}else{if(e.coordinates[0][0]!==a[0]||e.coordinates[0][1]!==a[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");var h;o="backwards",r=0,(h=e).addCoordinate.apply(h,[r].concat(i()(e.coordinates[0])))}}else e=this.newFeature({type:u.g.geojsonTypes.FEATURE,properties:{_type_:u.g.geojsonTypes.LINE_STRING},geometry:{type:u.g.geojsonTypes.LINE_STRING,coordinates:[]}}),r=0,this.addFeature(e);return this.clearSelectedFeatures(),s.a.disable(this),this.updateUIClasses({mouse:u.g.cursors.ADD}),this.activateUIButton(u.g.types.LINE),this.setActionableState({trash:!0}),{line:e,currentVertexPosition:r,direction:o}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&Object(a.a)(e,t.line.coordinates[t.currentVertexPosition-1])||"backwards"===t.direction&&Object(a.a)(e,t.line.coordinates[t.currentVertexPosition+1]))return this.changeMode(u.g.modes.SIMPLE_SELECT,{featureIds:[t.line.id]});t._history=[],this.updateUIClasses({mouse:u.g.cursors.ADD}),t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===t.direction?(t.currentVertexPosition++,t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),this.map.fire("draw.edit",Object.assign(e,{features:[t.line.toGeoJSON()]}))):t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(u.g.modes.SIMPLE_SELECT,{featureIds:[t.line.id]})},onMouseMove:function(t,e){t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),o.a.isVertex(e)&&this.updateUIClasses({mouse:u.g.cursors.POINTER})}};l.onTap=l.onClick=function(t,e){if(o.a.isVertex(e))return this.clickOnVertex(t,e);this.clickAnywhere(t,e),this.map.fire(u.g.events.CLICK,Object.assign(e,{features:[t.line.toGeoJSON()]}))},l.onKeyUp=function(t,e){if(o.a.isEnterKey(e))this.changeMode(u.g.modes.SIMPLE_SELECT,{featureIds:[t.line.id]});else if(o.a.isEscapeKey(e))this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(u.g.modes.SIMPLE_SELECT);else if(o.a.isBackSpaceKey(e)){if(t.currentVertexPosition>1){var r=t.line.coordinates[parseInt(t.currentVertexPosition-1,10)];t._history||(t._history=[]),t._history.push(r),t.line.removeCoordinate(t.currentVertexPosition-1),t.currentVertexPosition--,this.map.fire(u.g.events.RETREAT,Object.assign(e,{features:[t.line.toGeoJSON()]}))}}else if(o.a.isRKey(e)&&t._history&&t._history.length>0){var n=t._history.pop();t.line.addCoordinate(t.currentVertexPosition,n[0],n[1]),t.currentVertexPosition++,this.map.fire(u.g.events.RESTORE,Object.assign(e,{features:[t.line.toGeoJSON()]}))}},l.onStop=function(t){s.a.enable(this),this.activateUIButton(),void 0!==this.getFeature(t.line.id)&&(t.line.removeCoordinate("".concat(t.currentVertexPosition)),t.line.isValid()?this.map.fire(u.g.events.CREATE,{features:[t.line.toGeoJSON()]}):(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(u.g.modes.SIMPLE_SELECT,{},{silent:!0})))},l.onTrash=function(t){this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(u.g.modes.SIMPLE_SELECT)},l.toDisplayFeatures=function(t,e,r){var n=e.properties.id===t.line.id;if(e.properties.active=n?u.g.activeStates.ACTIVE:u.g.activeStates.INACTIVE,!n)return r(e);e.geometry.coordinates.length<2||(e.properties.meta=u.g.meta.FEATURE,r(Object(c.a)(t.line.id,e.geometry.coordinates["forward"===t.direction?e.geometry.coordinates.length-2:1],"".concat("forward"===t.direction?e.geometry.coordinates.length-2:1),!1)),r(e))},e.default=l},function(t,e,r){"use strict";r.r(e);var n=r(27),i=r(5),o={onSetup:function(){var t=this.newFeature({type:i.g.geojsonTypes.FEATURE,properties:{_type_:i.g.geojsonTypes.POINT},geometry:{type:i.g.geojsonTypes.POINT,coordinates:[]}});return this.addFeature(t),this.clearSelectedFeatures(),this.updateUIClasses({mouse:i.g.cursors.ADD}),this.activateUIButton(i.g.types.POINT),this.setActionableState({trash:!0}),{point:t}},stopDrawingAndRemove:function(t){this.deleteFeature([t.point.id],{silent:!0}),this.changeMode(i.g.modes.SIMPLE_SELECT)}};o.onTap=o.onClick=function(t,e){this.updateUIClasses({mouse:i.g.cursors.MOVE}),t.point.updateCoordinate("",e.lngLat.lng,e.lngLat.lat),this.map.fire(i.g.events.CREATE,{features:[t.point.toGeoJSON()]}),this.changeMode(i.g.modes.SIMPLE_SELECT,{featureIds:[t.point.id]})},o.onStop=function(t){this.activateUIButton(),t.point.getCoordinate().length||this.deleteFeature([t.point.id],{silent:!0})},o.toDisplayFeatures=function(t,e,r){var n=e.properties.id===t.point.id;if(e.properties.active=n?i.g.activeStates.ACTIVE:i.g.activeStates.INACTIVE,!n)return r(e)},o.onTrash=o.stopDrawingAndRemove,o.onKeyUp=function(t,e){if(n.a.isEscapeKey(e)||n.a.isEnterKey(e))return this.stopDrawingAndRemove(t,e)},e.default=o},function(t,e,r){"use strict";r.r(e);var n=r(27),i=r(46),o=r(5),a=r(181),s=r(88),u=(r(357),{onSetup:function(){var t=this.newFeature({type:o.g.geojsonTypes.FEATURE,properties:{_type_:o.g.geojsonTypes.POLYGON},geometry:{type:o.g.geojsonTypes.POLYGON,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),i.a.disable(this),this.updateUIClasses({mouse:o.g.cursors.ADD}),this.activateUIButton(o.g.types.POLYGON),this.setActionableState({trash:!0}),{polygon:t,currentVertexPosition:0}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&Object(a.a)(e,t.polygon.coordinates[0][t.currentVertexPosition-1]))return this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[t.polygon.id]});t._history=[],this.updateUIClasses({mouse:o.g.cursors.ADD}),t.polygon.updateCoordinate("0.".concat(t.currentVertexPosition),e.lngLat.lng,e.lngLat.lat),t.currentVertexPosition++,t.polygon.updateCoordinate("0.".concat(t.currentVertexPosition),e.lngLat.lng,e.lngLat.lat),this.map.fire("draw.edit",Object.assign(e,{features:[t.polygon.toGeoJSON()]}))},clickOnVertex:function(t){return this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},onMouseMove:function(t,e){t.polygon.updateCoordinate("0.".concat(t.currentVertexPosition),e.lngLat.lng,e.lngLat.lat),n.a.isVertex(e)&&this.updateUIClasses({mouse:o.g.cursors.POINTER})}});u.onTap=u.onClick=function(t,e){return n.a.isVertex(e)?this.clickOnVertex(t,e):(this.map.fire(o.g.events.CLICK,Object.assign(e,{features:[t.polygon.toGeoJSON()]})),this.clickAnywhere(t,e))},u.onKeyUp=function(t,e){if(n.a.isEscapeKey(e))this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT);else if(n.a.isEnterKey(e))this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[t.polygon.id]});else if(n.a.isBackSpaceKey(e)){if(t.currentVertexPosition>1&&t.currentVertexPosition>2){var r=t.polygon.coordinates[0][("0."+(t.currentVertexPosition-1)).split(".").map((function(t){return parseInt(t,10)}))[1]];t._history||(t._history=[]),t._history.push(r),t.polygon.removeCoordinate("0."+(t.currentVertexPosition-1)),t.currentVertexPosition--,this.map.fire(o.g.events.RETREAT,Object.assign(e,{features:[t.polygon.toGeoJSON()]}))}}else if(n.a.isRKey(e)&&t._history&&t._history.length>0){var i=t._history.pop();t.polygon.addCoordinate("0."+t.currentVertexPosition,i[0],i[1]),t.currentVertexPosition++,this.map.fire(o.g.events.RESTORE,Object.assign(e,{features:[t.polygon.toGeoJSON()]}))}},u.onStop=function(t){this.updateUIClasses({mouse:o.g.cursors.NONE}),i.a.enable(this),this.activateUIButton(),void 0!==this.getFeature(t.polygon.id)&&(t.polygon.removeCoordinate("0.".concat(t.currentVertexPosition)),t.polygon.isValid()?this.map.fire(o.g.events.CREATE,{features:[t.polygon.toGeoJSON()]}):(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT,{},{silent:!0})))},u.toDisplayFeatures=function(t,e,r){var n=e.properties.id===t.polygon.id;if(e.properties.active=n?o.g.activeStates.ACTIVE:o.g.activeStates.INACTIVE,!n)return r(e);if(0!==e.geometry.coordinates.length){var i=e.geometry.coordinates[0].length;if(!(i<3)){if(e.properties.meta=o.g.meta.FEATURE,r(Object(s.a)(t.polygon.id,e.geometry.coordinates[0][0],"0.0",!1)),i>3){var a=e.geometry.coordinates[0].length-3;r(Object(s.a)(t.polygon.id,e.geometry.coordinates[0][a],"0.".concat(a),!1))}if(i<=4){var u=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];if(r({type:o.g.geojsonTypes.FEATURE,properties:e.properties,geometry:{coordinates:u,type:o.g.geojsonTypes.LINE_STRING}}),3===i)return}return r(e)}}},u.onTrash=function(t){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)},e.default=u},function(t,e){},function(t,e,r){"use strict";r.r(e);var n=r(27),i=r(46),o=r(5),a=(r(88),r(227)),s={onSetup:function(){var t=this.newFeature({type:o.g.geojsonTypes.FEATURE,properties:{_type_:o.g.geojsonTypes.RECTANGLE},geometry:{type:o.g.geojsonTypes.POLYGON,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),i.a.disable(this),this.updateUIClasses({mouse:o.g.cursors.ADD}),this.activateUIButton(o.g.types.RECTANGLE),this.setActionableState({trash:!0}),{rectangle:t,currentVertexPosition:0}},onMouseDown:function(t,e){this.map.dragPan.disable();var r=t,i=r.rectangle,s=r.currentVertexPosition;if(s>0)return this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[i.id]});n.a.isVertex(e)&&this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[i.id]}),this.updateUIClasses({mouse:o.g.cursors.ADD}),i.onePoint=[e.lngLat.lng,e.lngLat.lat];var u=Object(a.a)(i.onePoint,i.onePoint);i.setCoordinates([u]),s=u.length,this.map.fire(o.g.events.CLICK,Object.assign(e,{features:[t.rectangle.toGeoJSON()]})),t=Object.assign(t,{rectangle:i,currentVertexPosition:s})},onDrag:function(t,e){s.onMouseMove(t,e)},onMouseUp:function(t,e){this.map.dragPan.enable();var r=t.rectangle;if(t.currentVertexPosition>0)return this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[r.id]})},onMouseMove:function(t,e){var r=t,i=r.rectangle,s=r.currentVertexPosition;if(0!==s){var u=[e.lngLat.lng,e.lngLat.lat];i.threePoint=u;var c=Object(a.a)(i.onePoint,u);i.setCoordinates([c]),s=c.length,n.a.isVertex(e)&&this.updateUIClasses({mouse:o.g.cursors.POINTER}),t=Object.assign(t,{currentVertexPosition:s,rectangle:i})}},onKeyUp:function(t){var e=t.rectangle;n.a.isEscapeKey&&(this.deleteFeature(e.id,{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)),n.a.isEnterKey&&this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[e.id]})},onStop:function(t){var e=t.rectangle,r=t.currentVertexPosition;this.updateUIClasses({mouse:o.g.cursors.NONE}),i.a.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.id)&&(e.removeCoordinate("0.".concat(r)),e.isValid()?this.map.fire(o.g.events.CREATE,{features:[e.toGeoJSON()]}):(this.deleteFeature([e.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT,{},{silent:!0})))},onTrash:function(t){this.deleteFeature([t.rectangle.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)},toDisplayFeatures:function(t,e,r){var n=t.rectangle,i=e.properties.id===n.id;if(e.properties.active=i?o.g.activeStates.ACTIVE:o.g.activeStates.INACTIVE,!i)return r(e);if(0!==e.geometry.coordinates.length&&!(e.geometry.coordinates[0].length<4))return e.properties.meta=o.g.meta.FEATURE,r(e)}};e.default=s},function(t,e,r){"use strict";r.r(e);var n=r(27),i=r(46),o=r(5),a=r(88),s={onSetup:function(){var t=this.newSector({type:o.g.geojsonTypes.FEATURE,properties:{_type_:o.g.geojsonTypes.SECTOR},geometry:{type:o.g.geojsonTypes.POLYGON,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),i.a.disable(this),this.updateUIClasses({mouse:o.g.cursors.ADD}),this.activateUIButton(o.g.types.SECTOR),this.setActionableState({trash:!0}),{sector:t,currentVertexPosition:0}},onClick:function(t,e){var r=t,i=r.sector,a=r.currentVertexPosition;return a>1||n.a.isVertex(e)?this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[i.id]}):(this.updateUIClasses({mouse:o.g.cursors.ADD}),i.updateCoordinate("0."+a,e.lngLat.lng,e.lngLat.lat),a++,this.map.fire(o.g.events.CLICK,Object.assign(e,{features:[t.sector.toGeoJSON()]})),void(t=Object.assign(t,{currentVertexPosition:a,sector:i})))},onMouseMove:function(t,e){var r=t,i=r.sector,a=r.currentVertexPosition;0!==a&&(i.updateCoordinate("0."+a,e.lngLat.lng,e.lngLat.lat),n.a.isVertex(e)&&this.updateUIClasses({mouse:o.g.cursors.POINTER}),t=Object.assign(t,{sector:i,currentVertexPosition:a}))},onStop:function(t){var e=t.sector,r=t.currentVertexPosition;this.updateUIClasses({mouse:o.g.cursors.NONE}),i.a.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.id)&&(e.removeCoordinate("0.".concat(r)),e.isValid()?this.map.fire(o.g.events.CREATE,{features:[e.toGeoJSON()],center:e.center}):(this.deleteFeature([e.id],{slient:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT,{},{slient:!0})))},toDisplayFeatures:function(t,e,r){var n=t.sector,i=t.currentVertexPosition,s=e.properties.id===n.id;if(e.properties.active=s?o.g.activeStates.ACTIVE:o.g.activeStates.INACTIVE,!s)return r(e);if(0!==e.geometry.coordinates.length){var u=e.geometry.coordinates[0].length;if(!(u<3)){if(e.properties.meta=o.g.meta.FEATURE,r(Object(a.a)(n.id,e.geometry.coordinates[0][0],"0.0",!1)),u>4){var c=e.geometry.coordinates[0].length-1;r(Object(a.a)(n.id,e.geometry.coordinates[0][c],"0."+c,!1))}if(2===i&&r(Object(a.a)(n.id,e.geometry.coordinates[0][1],"0.1",!1)),u<=4){var l=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];if(r({type:o.g.geojsonTypes.FEATURE,properties:e.properties,geometry:{coordinates:l,type:o.g.geojsonTypes.LINE_STRING}}),3===u)return}return r(e)}}},onTrash:function(t){var e=t.sector;this.deleteFeature([e.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)}};e.default=s},function(t,e,r){"use strict";r.r(e);var n=r(27),i=r(46),o=r(5),a=r(181),s=r(88),u={onSetup:function(){var t=this.newFeature({type:o.g.geojsonTypes.FEATURE,properties:{_type_:o.g.geojsonTypes.TRIANGLE},geometry:{type:o.g.geojsonTypes.POLYGON,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),i.a.disable(this),this.updateUIClasses({mouse:o.g.cursors.ADD}),this.activateUIButton(o.g.types.TRIANGLE),this.setActionableState({trash:!0}),{triangle:t,currentVertexPosition:0}},clickAnywhere:function(t,e){var r=t,n=r.triangle,i=r.currentVertexPosition;return i>0&&Object(a.a)(e,n.coordinates[0][i-1])?this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[n.id]}):(this.updateUIClasses({mouse:o.g.cursors.ADD}),n.updateCoordinate("0.".concat(i),e.lngLat.lng,e.lngLat.lat),i++,n.updateCoordinate("0.".concat(i),e.lngLat.lng,e.lngLat.lat),t=Object.assign(t,{triangle:n,currentVertexPosition:i}),i>=3?this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[n.id]}):void 0)},clickOnVertex:function(t){var e=t.triangle;return this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[e.id]})}};u.onTap=u.onClick=function(t,e){return n.a.isVertex(e)?this.clickOnVertex(t,e):(this.map.fire(o.g.events.CLICK,Object.assign(e,{features:[t.triangle.toGeoJSON()]})),this.clickAnywhere(t,e))},u.onKeyUp=function(t,e){var r=t.triangle;n.a.isEscapeKey(e)?(this.deleteFeature([r.id],{slient:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)):n.a.isEnterKey(e)&&this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[r.id]})},u.onMouseMove=function(t,e){var r=t.triangle,i=t.currentVertexPosition;r.updateCoordinate("0.".concat(i),e.lngLat.lng,e.lngLat.lat),n.a.isVertex(e)&&this.updateUIClasses({mouse:o.g.cursors.POINTER})},u.onStop=function(t){var e=t.triangle,r=t.currentVertexPosition;this.updateUIClasses({mouse:o.g.cursors.NONE}),i.a.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.id)&&(e.removeCoordinate("0.".concat(r)),e.isValid()?this.map.fire(o.g.events.CREATE,{features:[e.toGeoJSON()]}):(this.deleteFeature([e.id],{slient:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT,{},{slient:!0})))},u.toDisplayFeatures=function(t,e,r){var n=t.triangle,i=e.properties.id===n.id;if(e.properties.active=i?o.g.activeStates.ACTIVE:o.g.activeStates.INACTIVE,!i)return r(e);if(0!==e.geometry.coordinates.length){var a=e.geometry.coordinates[0].length;if(!(a<3)){if(e.properties.meta=o.g.meta.FEATURE,r(Object(s.a)(n.id,e.geometry.coordinates[0][0],"0.0",!1)),a>3){var u=e.geometry.coordinates[0].length-3;r(Object(s.a)(n.id,e.geometry.coordinates[0][u],"0.".concat(u),!1))}if(a<=4){var c=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];if(r({type:o.g.geojsonTypes.FEATURE,properties:e.properties,geometry:{coordinates:c,type:o.g.geojsonTypes.LINE_STRING}}),3===a)return}return r(e)}}},u.onTrash=function(t){var e=t.triangle;this.deleteFeature([e.id],{slient:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)},e.default=u},function(t,e,r){var n=r(347),i=r(613)(n);t.exports=i},function(t,e,r){var n=r(363),i=r(619),o=r(364);t.exports=function(t,e,r,a,s,u){var c=1&r,l=t.length,h=e.length;if(l!=h&&!(c&&h>l))return!1;var p=u.get(t),d=u.get(e);if(p&&d)return p==e&&d==t;var f=-1,g=!0,m=2&r?new n:void 0;for(u.set(t,e),u.set(e,t);++f=180?180:t[0],e[1]=t[1]<=-90?-90:t[1],e[1]=t[1]>=90?90:t[1],e}},function(t,e,r){"use strict";r.d(e,"a",(function(){return s})),r.d(e,"b",(function(){return u})),r.d(e,"e",(function(){return c})),r.d(e,"d",(function(){return l})),r.d(e,"f",(function(){return h})),r.d(e,"c",(function(){return p}));var n=r(52);function i(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r-1}(t)?[(e=t).type,["get",e.key],e.value]:function(t){return Object(n.a)(t.type,c)>-1}(t)?function(t){if(Object(n.r)(t.filter)||0===Object(n.b)(t.filter))return["all"];var e,r=[l[t.type]],o=i(t.filter);try{for(o.s();!(e=o.n()).done;){var a=e.value;r.push(h(a))}}catch(t){o.e(t)}finally{o.f()}return r}(t):["all"];var e}},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=window.requestAnimationFrame||window.webkitRequestAnimationFrame,i=window.cancelAnimationFrame||window.webkitCancelAnimationFrame;function o(t){var e=n(t);return{cancel:function(){return i(e)}}}},function(t,e,r){"use strict";function n(t){return 2===t.length?t:"0".concat(t)}function i(t){return t.getFullYear().toString()}function o(t){return n((t.getMonth()+1).toString())}function a(t){return n(t.getDate().toString())}function s(t){return n(t.getHours().toString())}function u(t){return n(t.getMinutes().toString())}function c(t){return n(t.getSeconds().toString())}function l(t){var e=new Date(t);return[[i(e),o(e),a(e)].join("-"),[s(e),u(e),c(e)].join(":")].join(" ")}r.d(e,"a",(function(){return l}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n=r(14).a},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(101),i=(n.a.wgs84togcj02,n.a)},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n=r(32).a},function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(28),u=r(2),c=r(222),l=function(){function t(e,r,n){i()(this,t),this.style=void 0,this.trackerList=void 0,this.circleLayer=void 0,this.target=void 0,this.style=e,this.trackerList=[],this.circleLayer=Object(s.e)()?new c.b(this.style.circleStyle):new c.a(this.style.circleStyle,null,n),this.target=r,this.target.circleLayer=this}return a()(t,[{key:"addTracker",value:function(t){-1===Object(u.arrayIndexOf)(t,this.trackerList)&&(Object(u.arrayPush)(t,this.trackerList),t.circleLayer=this)}},{key:"removeTracker",value:function(t){var e=Object(u.arrayIndexOf)(t,this.trackerList);e>-1&&(Object(u.arraySplice)(e,1,this.trackerList),t.circleLayer=null),0===Object(u.arrayLength)(this.trackerList)&&this.destroy()}},{key:"addEvent",value:function(t,e){this.circleLayer.addEvent(t,e)}},{key:"removeEvent",value:function(t){this.circleLayer.removeEvent(t)}},{key:"render",value:function(){var t=this,e=this.trackerList.reduce((function(e,r){return e.concat(r.getBufferFeature(t.style.circleRadius))}),[]);this.circleLayer.setLayerFeature(Object(u.packageFeaturesToCollection)(e))}},{key:"isEmpty",value:function(){return 0===Object(u.arrayLength)(this.trackerList)}},{key:"destroy",value:function(){this.circleLayer.destroy(),Object(u.isDef)(this.target)&&(this.target.circleLayer=null)}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return a})),r.d(e,"b",(function(){return s}));var n=r(28),i=r(2),o=r(174);function a(t,e){var r=t.actorOffset,o=t.actorDirection,a=t.actorVisible,s=function(t,e){var r=t.iconName,o=t.iconText,a=t.iconScale,s=t.iconBackground,u=t.iconNorthDirection,c=n.f.getProps(e,"spriteManager"),l={};if(!Object(i.isUndef)(c.getSpriteConfig(r))&&(l.iconName=r,(!Object(i.isDef)(o)||Object(i.isString)(o))&&(l.iconText=o,(!Object(i.isDef)(a)||Object(i.isNumber)(a)&&!(a<=0))&&(l.iconScale=a,(!Object(i.isDef)(s)||!Object(i.isUndef)(c.getSpriteConfig(s)))&&(l.iconBackground=s,!Object(i.isDef)(u)||Object(i.isNumber)(u))))))return l.iconNorthDirection=u,l}(t,e)||function(t){var e=t.iconTemplate,r=t.iconWidth,n=t.iconHeight,o=t.iconNorthDirection,a={};if(!Object(i.isUndef)(e)&&Object(i.isString)(e)&&(a.iconTemplate=e,(!Object(i.isDef)(r)||Object(i.isNumber)(r)&&!(r<0))&&(a.iconWidth=r,(!Object(i.isDef)(n)||Object(i.isNumber)(n)&&!(n<0))&&(a.iconHeight=n,!Object(i.isDef)(o)||Object(i.isNumber)(o)))))return a.iconNorthDirection=o,a}(t),u={};if(!Object(i.isUndef)(s)&&(u.actorIcon=s,(!Object(i.isDef)(r)||Object(i.isOffset)(r))&&(u.actorOffset=r,(!Object(i.isDef)(o)||Object(i.isNumber)(o))&&(u.actorDirection=o,!Object(i.isDef)(a)||Object(i.isBoolean)(a)))))return u.actorVisible=a,u}function s(t){var e=t.lineWidth,r=t.lineColor,n=t.lineIsDash,a=t.linePattern,s={};if((!Object(i.isDef)(e)||Object(i.isNumber)(e)&&!(e<=0))&&(s.lineWidth=Object(i.isDef)(e)?e:6,(!Object(i.isDef)(r)||Object(i.isString)(r))&&(s.lineColor=Object(i.isDef)(r)?r:"gray",(!Object(i.isDef)(n)||Object(i.isBoolean)(n))&&(s.lineIsDash=!!Object(i.isTrue)(n)&&n,!Object(i.isDef)(a)||Object(i.inArray)(a,o.a)))))return s.linePattern=Object(i.isDef)(a)?a:null,s}},function(t,e,r){"use strict";r.d(e,"a",(function(){return I}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(17),u=r.n(s),c=r(12),l=r.n(c),h=r(13),p=r.n(h),d=r(10),f=r.n(d),g=r(36),m=r(96),y=r(28),v=r(2),A=r(21),_=r(186),b=r(166),x=r(824);function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=f()(t);if(e){var i=f()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return p()(this,r)}}var C=function(t){l()(r,t);var e=w(r);function r(t,n){var o;return i()(this,r),(o=e.call(this,null,n)).style=void 0,o.data=void 0,o._layerIds=void 0,o._visible=void 0,o.style=t,o.data=Object(v.buildEmptyFeatureCollection)(),o._layerIds=[],o._visible=!0,o.init(),o}return a()(r,[{key:"init",value:function(){this.setLayerFeature(this.data)}},{key:"buildLayer",value:function(){var t=Object(v.guid)(),e={id:t,type:"symbol",source:this.sourceId,layout:{"icon-image":this.style.iconName,"icon-size":1,"icon-allow-overlap":!0,"text-allow-overlap":!0,"icon-text-fit":"both","icon-ignore-placement":!0}};this.map.addLayer(e),this._layerIds.push(t),A.a.setIdDepts(this.layerId,t)}},{key:"removeLayer",value:function(){u()(f()(r.prototype),"remove",this).call(this)}},{key:"destroy",value:function(){this.removeLayer()}},{key:"on",value:function(t,e){u()(f()(r.prototype),"addEvent",this).call(this,t,e)}},{key:"off",value:function(t){u()(f()(r.prototype),"removeEvent",this).call(this,t)}},{key:"show",value:function(){this._visible=!0,u()(f()(r.prototype),"show",this).call(this)}},{key:"hide",value:function(){this._visible=!1,u()(f()(r.prototype),"hide",this).call(this)}},{key:"getVisible",value:function(){return this._visible}}]),r}(g.a),E=function(t){l()(r,t);var e=w(r);function r(t){var n;return i()(this,r),(n=e.call(this)).style=void 0,n.data=void 0,n.layer=void 0,n._visible=void 0,n.style=t,n.data=Object(v.buildEmptyFeatureCollection)(),n._visible=!0,n.init(),n}return a()(r,[{key:"init",value:function(){this.setLayerFeature(this.data)}},{key:"buildLayer",value:function(){var t=this.style.iconName,e=y.f.spriteJson[t]?y.f.spriteJson[t]:y.f.spriteJson["marker-15-6"];this.layer=new _.a({map:this.map,source:this.layerSource,style:function(t){return new b.c({image:new x.a({offset:[e.x,e.y],opacity:1,rotateWithView:!0,rotation:0,scale:1,size:[e.width,e.height],crossOrigin:"anonymous",src:y.f.spriteUrl})})}}),A.a.setIdDepts(this.layerId,this.layer.ol_uid)}},{key:"removeLayer",value:function(){u()(f()(r.prototype),"remove",this).call(this)}},{key:"destroy",value:function(){this.removeLayer()}},{key:"on",value:function(t,e){u()(f()(r.prototype),"addEvent",this).call(this,t,e)}},{key:"off",value:function(t){u()(f()(r.prototype),"removeEvent",this).call(this,t)}},{key:"show",value:function(){this._visible=!0,u()(f()(r.prototype),"show",this).call(this)}},{key:"hide",value:function(){this._visible=!1,u()(f()(r.prototype),"hide",this).call(this)}},{key:"getVisible",value:function(){return this._visible}}]),r}(m.a),I=Object(y.e)()?E:C},function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(174),u=r(2),c=r(28),l=function(){function t(e,r,n){i()(this,t),this.trackStyle=void 0,this.trackerList=void 0,this.trackLineLayer=void 0,this.target=void 0,this.trackStyle=e,this.trackerList=[];var o=r.trackPointLayer?r.trackPointLayer.pointLayer.getLayerId():"";this.trackLineLayer=Object(c.e)()?new s.c(e):new s.b(e,o,n),this.target=r,this.target.trackLayer=this}return a()(t,[{key:"addTracker",value:function(t){-1===Object(u.arrayIndexOf)(t,this.trackerList)&&(Object(u.arrayPush)(t,this.trackerList),t.trackLine=this)}},{key:"removeTracker",value:function(t){var e=Object(u.arrayIndexOf)(t,this.trackerList);e>-1&&(Object(u.arraySplice)(e,1,this.trackerList),t.trackLine=null),0===Object(u.arrayLength)(this.trackerList)&&this.destroy()}},{key:"addEvent",value:function(t,e){this.trackLineLayer.addEvent(t,e)}},{key:"removeEvent",value:function(t){this.trackLineLayer.removeEvent(t)}},{key:"render",value:function(t){var e=this,r=this.trackerList.reduce((function(r,n){return r.concat(n.getTrackFeatures(t,e.trackStyle.extra))}),[]);this.trackLineLayer.setLayerFeature(Object(u.packageFeaturesToCollection)(r))}},{key:"hasTracker",value:function(t){return Object(u.arrayIndexOf)(t,this.trackerList)>-1}},{key:"isEmpty",value:function(){return 0===Object(u.arrayLength)(this.trackerList)}},{key:"destroy",value:function(){this.trackLineLayer.destroy(),Object(u.isDef)(this.target)&&(this.target.trackLayer=null)}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return d}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(175),u=r.n(s),c=r(244),l=r(102),h=r(2),p=r(28),d=function(){function t(e,r,n,o,a){i()(this,t),this.gbid=void 0,this.actor=void 0,this.trackLine=void 0,this.trackPointLayer=void 0,this.circleLayer=void 0,this.tgLine=void 0,this.topSlot=void 0,this.bottomSlot=void 0,this.dragableSlot=void 0,this.animation=void 0,this.isOffscreen=void 0,this.points=[],this.pointLayer=void 0,this.firstPoint=void 0,this.mapContainerId=void 0,this.modules=void 0,this.isSetToEnd=void 0,this.mapContainerId=a,this.modules=p.f.getProps(this.mapContainerId,"modules"),this.gbid=e.getProperty("gbid"),this.actor=new c.a(e,r,this.mapContainerId),this.tgLine=new l.a(o),this.tgLine.push(e),this.animation=n,this.firstPoint=e,this.isOffscreen=!1}return a()(t,[{key:"addPoint",value:function(t){this.points.push(t)}},{key:"getAvailablePoints",value:function(){var t=this.getTGNode();return this.points.filter((function(e){return e.getTimestamp()<=t.getTimestamp()}))}},{key:"setBy",value:function(t){this.tgLine.setBy(t)}},{key:"setTo",value:function(t){this.tgLine.setTo(t)}},{key:"setAnimation",value:function(t){this.animation=t}},{key:"setSlot",value:function(t){var e=t.type,r=t.visible,n=t.template,i="",o="",a=[0,0],s="";switch(e){case 0:i="bottom",o="topSlot",a=[0,-10],s="bottom";break;case 1:i="top",o="bottomSlot",a=[0,10],s="top";break;case 2:i="bottom",o="dragableSlot",a=[0,-50],s="bottom";break;default:return}var u=this.modules.popup();Object(h.isFalse)(r)?Object(h.isDef)(this[o])&&(u.removePopup({popup:this[o]}),this[o]=null):Object(h.isTrue)(r)?Object(h.isDef)(this[o])?Object(h.isDef)(n)&&Object(h.isString)(n)&&u.setPopupsPropById({id:this[o],point:this.actor.tgNode.toArray(),htmlText:n}):Object(h.isDef)(n)&&Object(h.isString)(n)&&(this[o]=u.addPopup({point:this.actor.tgNode.toArray(),closeOnClick:!1,closeButton:!1,htmlText:n,anchor:i,offset:a,tipPosition:s})):Object(h.isDef)(this[o])&&Object(h.isDef)(n)&&Object(h.isString)(n)&&u.setPopupsPropById({id:this[o],point:this.actor.tgNode.toArray(),htmlText:n})}},{key:"getTGNode",value:function(){return this.actor.tgNode}},{key:"updateDynamicLocation",value:function(t){this.trackPointLayer&&this.addPoint(u()(t)),this.tgLine.push(t)}},{key:"updateStaticProperties",value:function(t){this.tgLine.mergeProperties(t)}},{key:"render",value:function(t,e,r,n){var i=this;if(n.onkeypointchange){var o=n.onkeypointchange;(n=Object.assign({},n)).onkeypointchange=function(t){o({gbid:i.gbid,properties:t.getProperties()})}}if(this.tgLine.updatePointer(t,r,n),!0===this.tgLine.hasChanged){this.tgLine.hasChanged=!1;var a=this.tgLine.getPointerNode();if(this.actor.setTGNode(a),this._updatePopup(a),"AUTO"===e.type)this.actor.setActorDirection(this.tgLine.getPointerDirection());else if("DESTINATION"===e.type){var s=h.GeometryUtil.bearing(a.toArray(),e.destination);this.actor.setActorDirection(s)}}}},{key:"getTrackFeatures",value:function(t,e){var r=[];return this.tgLine.forEach((function(n,i){var o=n.toFeature();if(Object(h.isDef)(e))for(var a in e)o.properties[a]=e[a](n,i);t(o,n,i)&&r.push(o)})),r}},{key:"getBufferFeature",value:function(t){var e={type:"Feature",geometry:{type:"Point",coordinates:this.actor.tgNode.toArray()},properties:{}};return h.GeometryUtil.circle(e,t/1e3,{units:"kilometers"})}},{key:"destroy",value:function(){this.trackPointLayer&&(this.trackPointLayer.removeTracker(this),this.trackPointLayer=void 0,this.points=[]),Object(h.isDef)(this.trackLine)&&(this.trackLine.removeTracker(this),this.trackLine=null),Object(h.isDef)(this.circleLayer)&&(this.circleLayer.removeTracker(this),this.circleLayer=null),Object(h.isDef)(this.actor)&&(this.actor.destroy(),this.actor=null),this._removeSlot(),this.tgLine=null}},{key:"_removeSlot",value:function(){var t=this.modules.popup();Object(h.isDef)(this.topSlot)&&t.removePopup({popup:this.topSlot}),Object(h.isDef)(this.bottomSlot)&&t.removePopup({popup:this.bottomSlot}),Object(h.isDef)(this.dragableSlot)&&t.removePopup({popup:this.dragableSlot})}},{key:"_updatePopup",value:function(t){Object(h.isDef)(this.topSlot)&&this.modules.popup().setPopupsPropById({id:this.topSlot,point:t.toArray()}),Object(h.isDef)(this.bottomSlot)&&this.modules.popup().setPopupsPropById({id:this.bottomSlot,point:t.toArray()}),Object(h.isDef)(this.dragableSlot)&&this.modules.popup().setPopupsPropById({id:this.dragableSlot,point:t.toArray()})}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return d}));var n=r(11),i=r.n(n),o=r(3),a=r.n(o),s=r(4),u=r.n(s),c=r(28),l=r(2);function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function p(t){for(var e=1;e0?1:+t}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;r>8&255]+p[t>>16&255]+p[t>>24&255]+"-"+p[255&e]+p[e>>8&255]+"-"+p[e>>16&15|64]+p[e>>24&255]+"-"+p[63&r|128]+p[r>>8&255]+"-"+p[r>>16&255]+p[r>>24&255]+p[255&n]+p[n>>8&255]+p[n>>16&255]+p[n>>24&255]).toUpperCase()},clamp:function(t,e,r){return Math.max(e,Math.min(r,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,r,n,i){return n+(t-e)*(i-n)/(r-e)},lerp:function(t,e,r){return(1-r)*t+r*e},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*g.DEG2RAD},radToDeg:function(t){return t*g.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,r,n,i){var o=Math.cos,a=Math.sin,s=o(r/2),u=a(r/2),c=o((e+n)/2),l=a((e+n)/2),h=o((e-n)/2),p=a((e-n)/2),d=o((n-e)/2),f=a((n-e)/2);switch(i){case"XYX":t.set(s*l,u*h,u*p,s*c);break;case"YZY":t.set(u*p,s*l,u*h,s*c);break;case"ZXZ":t.set(u*h,u*p,s*l,s*c);break;case"XZX":t.set(s*l,u*f,u*d,s*c);break;case"YXY":t.set(u*d,s*l,u*f,s*c);break;case"ZYZ":t.set(u*f,u*d,s*l,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};function m(t,e){this.x=t||0,this.y=e||0}function y(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}e.MathUtils=e.Math=g,Object.defineProperties(m.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(m.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,r=this.y,n=t.elements;return this.x=n[0]*e+n[3]*r+n[6],this.y=n[1]*e+n[4]*r+n[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var r=Math.cos(e),n=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*r-o*n+t.x,this.y=i*n+o*r+t.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}}),Object.assign(y.prototype,{isMatrix3:!0,set:function(t,e,r,n,i,o,a,s,u){var c=this.elements;return c[0]=t,c[1]=n,c[2]=a,c[3]=e,c[4]=i,c[5]=s,c[6]=r,c[7]=o,c[8]=u,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this},extractBasis:function(t,e,r){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var r=t.elements,n=e.elements,i=this.elements,o=r[0],a=r[3],s=r[6],u=r[1],c=r[4],l=r[7],h=r[2],p=r[5],d=r[8],f=n[0],g=n[3],m=n[6],y=n[1],v=n[4],A=n[7],_=n[2],b=n[5],x=n[8];return i[0]=o*f+a*y+s*_,i[3]=o*g+a*v+s*b,i[6]=o*m+a*A+s*x,i[1]=u*f+c*y+l*_,i[4]=u*g+c*v+l*b,i[7]=u*m+c*A+l*x,i[2]=h*f+p*y+d*_,i[5]=h*g+p*v+d*b,i[8]=h*m+p*A+d*x,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*o*c-e*a*u-r*i*c+r*a*s+n*i*u-n*o*s},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var r=t.elements,n=this.elements,i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],c=r[5],l=r[6],h=r[7],p=r[8],d=p*u-c*h,f=c*l-p*s,g=h*s-u*l,m=i*d+o*f+a*g;if(0===m)return this.set(0,0,0,0,0,0,0,0,0);var y=1/m;return n[0]=d*y,n[1]=(a*h-p*o)*y,n[2]=(c*o-a*u)*y,n[3]=f*y,n[4]=(p*i-a*l)*y,n[5]=(a*s-c*i)*y,n[6]=g*y,n[7]=(o*l-h*i)*y,n[8]=(u*i-o*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,r,n,i,o,a){var s=Math.cos(i),u=Math.sin(i);this.set(r*s,r*u,-r*(s*o+u*a)+o+t,-n*u,n*s,-n*(-u*o+s*a)+a+e,0,0,1)},scale:function(t,e){var r=this.elements;return r[0]*=t,r[3]*=t,r[6]*=t,r[1]*=e,r[4]*=e,r[7]*=e,this},rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=this.elements,i=n[0],o=n[3],a=n[6],s=n[1],u=n[4],c=n[7];return n[0]=e*i+r*s,n[3]=e*o+r*u,n[6]=e*a+r*c,n[1]=-r*i+e*s,n[4]=-r*o+e*u,n[7]=-r*a+e*c,this},translate:function(t,e){var r=this.elements;return r[0]+=t*r[2],r[3]+=t*r[5],r[6]+=t*r[8],r[1]+=e*r[2],r[4]+=e*r[5],r[7]+=e*r[8],this},equals:function(t){for(var e=this.elements,r=t.elements,n=0;n<9;n++)if(e[n]!==r[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var r=0;r<9;r++)this.elements[r]=t[r+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t}});var v={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if((0,l.default)(t,HTMLCanvasElement))e=t;else{void 0===f&&(f=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),f.width=t.width,f.height=t.height;var r=f.getContext("2d");(0,l.default)(t,ImageData)?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),e=f}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}};e.ImageUtils=v;var A=0;function _(t,e,r,n,i,o,a,s,u,c){Object.defineProperty(this,"id",{value:A++}),this.uuid=g.generateUUID(),this.name="",this.image=void 0!==t?t:_.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:_.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:1001,this.wrapT=void 0!==n?n:1001,this.magFilter=void 0!==i?i:1006,this.minFilter=void 0!==o?o:1008,this.anisotropy=void 0!==u?u:1,this.format=void 0!==a?a:1023,this.internalFormat=null,this.type=void 0!==s?s:1009,this.offset=new m(0,0),this.repeat=new m(1,1),this.center=new m(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new y,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:3e3,this.version=0,this.onUpdate=null}function b(t,e,r,n){this.x=t||0,this.y=e||0,this.z=r||0,this.w=void 0!==n?n:1}function x(t,e,r){this.width=t,this.height=e,this.scissor=new b(0,0,t,e),this.scissorTest=!1,this.viewport=new b(0,0,t,e),r=r||{},this.texture=new _(void 0,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==r.generateMipmaps&&r.generateMipmaps,this.texture.minFilter=void 0!==r.minFilter?r.minFilter:1006,this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null}function w(t,e,r){x.call(this,t,e,r),this.samples=4}function C(t,e,r,n){this._x=t||0,this._y=e||0,this._z=r||0,this._w=void 0!==n?n:1}_.DEFAULT_IMAGE=void 0,_.DEFAULT_MAPPING=300,_.prototype=Object.assign(Object.create(h.prototype),{constructor:_,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=g.generateUUID()),!e&&void 0===t.images[n.uuid]){var i;if(Array.isArray(n)){i=[];for(var o=0,a=n.length;o1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(_.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(b.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(b.prototype,{isVector4:!0,set:function(t,e,r,n){return this.x=t,this.y=e,this.z=r,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,r=this.y,n=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*r+o[8]*n+o[12]*i,this.y=o[1]*e+o[5]*r+o[9]*n+o[13]*i,this.z=o[2]*e+o[6]*r+o[10]*n+o[14]*i,this.w=o[3]*e+o[7]*r+o[11]*n+o[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,r,n,i,o=t.elements,a=o[0],s=o[4],u=o[8],c=o[1],l=o[5],h=o[9],p=o[2],d=o[6],f=o[10];if(Math.abs(s-c)<.01&&Math.abs(u-p)<.01&&Math.abs(h-d)<.01){if(Math.abs(s+c)<.1&&Math.abs(u+p)<.1&&Math.abs(h+d)<.1&&Math.abs(a+l+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var g=(a+1)/2,m=(l+1)/2,y=(f+1)/2,v=(s+c)/4,A=(u+p)/4,_=(h+d)/4;return g>m&&g>y?g<.01?(r=0,n=.707106781,i=.707106781):(n=v/(r=Math.sqrt(g)),i=A/r):m>y?m<.01?(r=.707106781,n=0,i=.707106781):(r=v/(n=Math.sqrt(m)),i=_/n):y<.01?(r=.707106781,n=.707106781,i=0):(r=A/(i=Math.sqrt(y)),n=_/i),this.set(r,n,i,e),this}var b=Math.sqrt((d-h)*(d-h)+(u-p)*(u-p)+(c-s)*(c-s));return Math.abs(b)<.001&&(b=1),this.x=(d-h)/b,this.y=(u-p)/b,this.z=(c-s)/b,this.w=Math.acos((a+l+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this.z=t.z+(e.z-t.z)*r,this.w=t.w+(e.w-t.w)*r,this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}),x.prototype=Object.assign(Object.create(h.prototype),{constructor:x,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),w.prototype=Object.assign(Object.create(x.prototype),{constructor:w,isWebGLMultisampleRenderTarget:!0,copy:function(t){return x.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(C,{slerp:function(t,e,r,n){return r.copy(t).slerp(e,n)},slerpFlat:function(t,e,r,n,i,o,a){var s=r[n+0],u=r[n+1],c=r[n+2],l=r[n+3],h=i[o+0],p=i[o+1],d=i[o+2],f=i[o+3];if(l!==f||s!==h||u!==p||c!==d){var g=1-a,m=s*h+u*p+c*d+l*f,y=m>=0?1:-1,v=1-m*m;if(v>Number.EPSILON){var A=Math.sqrt(v),_=Math.atan2(A,m*y);g=Math.sin(g*_)/A,a=Math.sin(a*_)/A}var b=a*y;if(s=s*g+h*b,u=u*g+p*b,c=c*g+d*b,l=l*g+f*b,g===1-a){var x=1/Math.sqrt(s*s+u*u+c*c+l*l);s*=x,u*=x,c*=x,l*=x}}t[e]=s,t[e+1]=u,t[e+2]=c,t[e+3]=l},multiplyQuaternionsFlat:function(t,e,r,n,i,o){var a=r[n],s=r[n+1],u=r[n+2],c=r[n+3],l=i[o],h=i[o+1],p=i[o+2],d=i[o+3];return t[e]=a*d+c*l+s*p-u*h,t[e+1]=s*d+c*h+u*l-a*p,t[e+2]=u*d+c*p+a*h-s*l,t[e+3]=c*d-a*l-s*h-u*p,t}}),Object.defineProperties(C.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(C.prototype,{isQuaternion:!0,set:function(t,e,r,n){return this._x=t,this._y=e,this._z=r,this._w=n,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=t._x,n=t._y,i=t._z,o=t.order,a=Math.cos,s=Math.sin,u=a(r/2),c=a(n/2),l=a(i/2),h=s(r/2),p=s(n/2),d=s(i/2);switch(o){case"XYZ":this._x=h*c*l+u*p*d,this._y=u*p*l-h*c*d,this._z=u*c*d+h*p*l,this._w=u*c*l-h*p*d;break;case"YXZ":this._x=h*c*l+u*p*d,this._y=u*p*l-h*c*d,this._z=u*c*d-h*p*l,this._w=u*c*l+h*p*d;break;case"ZXY":this._x=h*c*l-u*p*d,this._y=u*p*l+h*c*d,this._z=u*c*d+h*p*l,this._w=u*c*l-h*p*d;break;case"ZYX":this._x=h*c*l-u*p*d,this._y=u*p*l+h*c*d,this._z=u*c*d-h*p*l,this._w=u*c*l+h*p*d;break;case"YZX":this._x=h*c*l+u*p*d,this._y=u*p*l+h*c*d,this._z=u*c*d-h*p*l,this._w=u*c*l-h*p*d;break;case"XZY":this._x=h*c*l-u*p*d,this._y=u*p*l-h*c*d,this._z=u*c*d+h*p*l,this._w=u*c*l+h*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var r=e/2,n=Math.sin(r);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(r),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var e,r=t.elements,n=r[0],i=r[4],o=r[8],a=r[1],s=r[5],u=r[9],c=r[2],l=r[6],h=r[10],p=n+s+h;return p>0?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(l-u)*e,this._y=(o-c)*e,this._z=(a-i)*e):n>s&&n>h?(e=2*Math.sqrt(1+n-s-h),this._w=(l-u)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(o+c)/e):s>h?(e=2*Math.sqrt(1+s-n-h),this._w=(o-c)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(u+l)/e):(e=2*Math.sqrt(1+h-n-s),this._w=(a-i)/e,this._x=(o+c)/e,this._y=(u+l)/e,this._z=.25*e),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var r=t.dot(e)+1;return r<1e-6?(r=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=r):(this._x=0,this._y=-t.z,this._z=t.y,this._w=r)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=r),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(g.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var r=this.angleTo(t);if(0===r)return this;var n=Math.min(1,e/r);return this.slerp(t,n),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var r=t._x,n=t._y,i=t._z,o=t._w,a=e._x,s=e._y,u=e._z,c=e._w;return this._x=r*c+o*a+n*u-i*s,this._y=n*c+o*s+i*a-r*u,this._z=i*c+o*u+r*s-n*a,this._w=o*c-r*a-n*s-i*u,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var r=this._x,n=this._y,i=this._z,o=this._w,a=o*t._w+r*t._x+n*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=r,this._y=n,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var u=1-e;return this._w=u*o+e*this._w,this._x=u*r+e*this._x,this._y=u*n+e*this._y,this._z=u*i+e*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),l=Math.atan2(c,a),h=Math.sin((1-e)*l)/c,p=Math.sin(e*l)/c;return this._w=o*h+this._w*p,this._x=r*h+this._x*p,this._y=n*h+this._y*p,this._z=i*h+this._z*p,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},fromBufferAttribute:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var E=new M,I=new C;function M(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0}Object.assign(M.prototype,{isVector3:!0,set:function(t,e,r){return this.x=t,this.y=e,this.z=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(I.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(I.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6]*n,this.y=i[1]*e+i[4]*r+i[7]*n,this.z=i[2]*e+i[5]*r+i[8]*n,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements,o=1/(i[3]*e+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*e+i[4]*r+i[8]*n+i[12])*o,this.y=(i[1]*e+i[5]*r+i[9]*n+i[13])*o,this.z=(i[2]*e+i[6]*r+i[10]*n+i[14])*o,this},applyQuaternion:function(t){var e=this.x,r=this.y,n=this.z,i=t.x,o=t.y,a=t.z,s=t.w,u=s*e+o*n-a*r,c=s*r+a*e-i*n,l=s*n+i*r-o*e,h=-i*e-o*r-a*n;return this.x=u*s+h*-i+c*-a-l*-o,this.y=c*s+h*-o+l*-i-u*-a,this.z=l*s+h*-a+u*-o-c*-i,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[4]*r+i[8]*n,this.y=i[1]*e+i[5]*r+i[9]*n,this.z=i[2]*e+i[6]*r+i[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,r){return this.x=t.x+(e.x-t.x)*r,this.y=t.y+(e.y-t.y)*r,this.z=t.z+(e.z-t.z)*r,this},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var r=t.x,n=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=n*s-i*a,this.y=i*o-r*s,this.z=r*a-n*o,this},projectOnVector:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var r=t.dot(this)/e;return this.copy(t).multiplyScalar(r)},projectOnPlane:function(t){return E.copy(this).projectOnVector(t),this.sub(E)},reflect:function(t){return this.sub(E.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var r=this.dot(t)/e;return Math.acos(g.clamp(r,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return e*e+r*r+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,r){var n=Math.sin(e)*t;return this.x=n*Math.sin(r),this.y=Math.cos(e)*t,this.z=n*Math.cos(r),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,r){return this.x=t*Math.sin(e),this.y=r,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=r,this.z=n,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});var S=new M,T=new D,P=new M(0,0,0),O=new M(1,1,1),L=new M,k=new M,R=new M;function D(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(D.prototype,{isMatrix4:!0,set:function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g){var m=this.elements;return m[0]=t,m[4]=e,m[8]=r,m[12]=n,m[1]=i,m[5]=o,m[9]=a,m[13]=s,m[2]=u,m[6]=c,m[10]=l,m[14]=h,m[3]=p,m[7]=d,m[11]=f,m[15]=g,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new D).fromArray(this.elements)},copy:function(t){var e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],this},copyPosition:function(t){var e=this.elements,r=t.elements;return e[12]=r[12],e[13]=r[13],e[14]=r[14],this},extractBasis:function(t,e,r){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this},extractRotation:function(t){var e=this.elements,r=t.elements,n=1/S.setFromMatrixColumn(t,0).length(),i=1/S.setFromMatrixColumn(t,1).length(),o=1/S.setFromMatrixColumn(t,2).length();return e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e[3]=0,e[4]=r[4]*i,e[5]=r[5]*i,e[6]=r[6]*i,e[7]=0,e[8]=r[8]*o,e[9]=r[9]*o,e[10]=r[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,r=t.x,n=t.y,i=t.z,o=Math.cos(r),a=Math.sin(r),s=Math.cos(n),u=Math.sin(n),c=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var h=o*c,p=o*l,d=a*c,f=a*l;e[0]=s*c,e[4]=-s*l,e[8]=u,e[1]=p+d*u,e[5]=h-f*u,e[9]=-a*s,e[2]=f-h*u,e[6]=d+p*u,e[10]=o*s}else if("YXZ"===t.order){var g=s*c,m=s*l,y=u*c,v=u*l;e[0]=g+v*a,e[4]=y*a-m,e[8]=o*u,e[1]=o*l,e[5]=o*c,e[9]=-a,e[2]=m*a-y,e[6]=v+g*a,e[10]=o*s}else if("ZXY"===t.order)g=s*c,m=s*l,y=u*c,v=u*l,e[0]=g-v*a,e[4]=-o*l,e[8]=y+m*a,e[1]=m+y*a,e[5]=o*c,e[9]=v-g*a,e[2]=-o*u,e[6]=a,e[10]=o*s;else if("ZYX"===t.order)h=o*c,p=o*l,d=a*c,f=a*l,e[0]=s*c,e[4]=d*u-p,e[8]=h*u+f,e[1]=s*l,e[5]=f*u+h,e[9]=p*u-d,e[2]=-u,e[6]=a*s,e[10]=o*s;else if("YZX"===t.order){var A=o*s,_=o*u,b=a*s,x=a*u;e[0]=s*c,e[4]=x-A*l,e[8]=b*l+_,e[1]=l,e[5]=o*c,e[9]=-a*c,e[2]=-u*c,e[6]=_*l+b,e[10]=A-x*l}else"XZY"===t.order&&(A=o*s,_=o*u,b=a*s,x=a*u,e[0]=s*c,e[4]=-l,e[8]=u*c,e[1]=A*l+x,e[5]=o*c,e[9]=_*l-b,e[2]=b*l-_,e[6]=a*c,e[10]=x*l+A);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(P,t,O)},lookAt:function(t,e,r){var n=this.elements;return R.subVectors(t,e),0===R.lengthSq()&&(R.z=1),R.normalize(),L.crossVectors(r,R),0===L.lengthSq()&&(1===Math.abs(r.z)?R.x+=1e-4:R.z+=1e-4,R.normalize(),L.crossVectors(r,R)),L.normalize(),k.crossVectors(R,L),n[0]=L.x,n[4]=k.x,n[8]=R.x,n[1]=L.y,n[5]=k.y,n[9]=R.y,n[2]=L.z,n[6]=k.z,n[10]=R.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var r=t.elements,n=e.elements,i=this.elements,o=r[0],a=r[4],s=r[8],u=r[12],c=r[1],l=r[5],h=r[9],p=r[13],d=r[2],f=r[6],g=r[10],m=r[14],y=r[3],v=r[7],A=r[11],_=r[15],b=n[0],x=n[4],w=n[8],C=n[12],E=n[1],I=n[5],M=n[9],S=n[13],T=n[2],P=n[6],O=n[10],L=n[14],k=n[3],R=n[7],D=n[11],B=n[15];return i[0]=o*b+a*E+s*T+u*k,i[4]=o*x+a*I+s*P+u*R,i[8]=o*w+a*M+s*O+u*D,i[12]=o*C+a*S+s*L+u*B,i[1]=c*b+l*E+h*T+p*k,i[5]=c*x+l*I+h*P+p*R,i[9]=c*w+l*M+h*O+p*D,i[13]=c*C+l*S+h*L+p*B,i[2]=d*b+f*E+g*T+m*k,i[6]=d*x+f*I+g*P+m*R,i[10]=d*w+f*M+g*O+m*D,i[14]=d*C+f*S+g*L+m*B,i[3]=y*b+v*E+A*T+_*k,i[7]=y*x+v*I+A*P+_*R,i[11]=y*w+v*M+A*O+_*D,i[15]=y*C+v*S+A*L+_*B,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){var t=this.elements,e=t[0],r=t[4],n=t[8],i=t[12],o=t[1],a=t[5],s=t[9],u=t[13],c=t[2],l=t[6],h=t[10],p=t[14];return t[3]*(+i*s*l-n*u*l-i*a*h+r*u*h+n*a*p-r*s*p)+t[7]*(+e*s*p-e*u*h+i*o*h-n*o*p+n*u*c-i*s*c)+t[11]*(+e*u*l-e*a*p-i*o*l+r*o*p+i*a*c-r*u*c)+t[15]*(-n*a*c-e*s*l+e*a*h+n*o*l-r*o*h+r*s*c)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,r){var n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=r),this},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var r=this.elements,n=t.elements,i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],c=n[5],l=n[6],h=n[7],p=n[8],d=n[9],f=n[10],g=n[11],m=n[12],y=n[13],v=n[14],A=n[15],_=d*v*h-y*f*h+y*l*g-c*v*g-d*l*A+c*f*A,b=m*f*h-p*v*h-m*l*g+u*v*g+p*l*A-u*f*A,x=p*y*h-m*d*h+m*c*g-u*y*g-p*c*A+u*d*A,w=m*d*l-p*y*l-m*c*f+u*y*f+p*c*v-u*d*v,C=i*_+o*b+a*x+s*w;if(0===C)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var E=1/C;return r[0]=_*E,r[1]=(y*f*s-d*v*s-y*a*g+o*v*g+d*a*A-o*f*A)*E,r[2]=(c*v*s-y*l*s+y*a*h-o*v*h-c*a*A+o*l*A)*E,r[3]=(d*l*s-c*f*s-d*a*h+o*f*h+c*a*g-o*l*g)*E,r[4]=b*E,r[5]=(p*v*s-m*f*s+m*a*g-i*v*g-p*a*A+i*f*A)*E,r[6]=(m*l*s-u*v*s-m*a*h+i*v*h+u*a*A-i*l*A)*E,r[7]=(u*f*s-p*l*s+p*a*h-i*f*h-u*a*g+i*l*g)*E,r[8]=x*E,r[9]=(m*d*s-p*y*s-m*o*g+i*y*g+p*o*A-i*d*A)*E,r[10]=(u*y*s-m*c*s+m*o*h-i*y*h-u*o*A+i*c*A)*E,r[11]=(p*c*s-u*d*s-p*o*h+i*d*h+u*o*g-i*c*g)*E,r[12]=w*E,r[13]=(p*y*a-m*d*a+m*o*f-i*y*f-p*o*v+i*d*v)*E,r[14]=(m*c*a-u*y*a-m*o*l+i*y*l+u*o*v-i*c*v)*E,r[15]=(u*d*a-p*c*a+p*o*l-i*d*l-u*o*f+i*c*f)*E,this},scale:function(t){var e=this.elements,r=t.x,n=t.y,i=t.z;return e[0]*=r,e[4]*=n,e[8]*=i,e[1]*=r,e[5]*=n,e[9]*=i,e[2]*=r,e[6]*=n,e[10]*=i,e[3]*=r,e[7]*=n,e[11]*=i,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,r,n))},makeTranslation:function(t,e,r){return this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var r=Math.cos(e),n=Math.sin(e),i=1-r,o=t.x,a=t.y,s=t.z,u=i*o,c=i*a;return this.set(u*o+r,u*a-n*s,u*s+n*a,0,u*a+n*s,c*a+r,c*s-n*o,0,u*s-n*a,c*s+n*o,i*s*s+r,0,0,0,0,1),this},makeScale:function(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this},makeShear:function(t,e,r){return this.set(1,e,r,0,t,1,r,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,r){var n=this.elements,i=e._x,o=e._y,a=e._z,s=e._w,u=i+i,c=o+o,l=a+a,h=i*u,p=i*c,d=i*l,f=o*c,g=o*l,m=a*l,y=s*u,v=s*c,A=s*l,_=r.x,b=r.y,x=r.z;return n[0]=(1-(f+m))*_,n[1]=(p+A)*_,n[2]=(d-v)*_,n[3]=0,n[4]=(p-A)*b,n[5]=(1-(h+m))*b,n[6]=(g+y)*b,n[7]=0,n[8]=(d+v)*x,n[9]=(g-y)*x,n[10]=(1-(h+f))*x,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},decompose:function(t,e,r){var n=this.elements,i=S.set(n[0],n[1],n[2]).length(),o=S.set(n[4],n[5],n[6]).length(),a=S.set(n[8],n[9],n[10]).length();this.determinant()<0&&(i=-i),t.x=n[12],t.y=n[13],t.z=n[14],T.copy(this);var s=1/i,u=1/o,c=1/a;return T.elements[0]*=s,T.elements[1]*=s,T.elements[2]*=s,T.elements[4]*=u,T.elements[5]*=u,T.elements[6]*=u,T.elements[8]*=c,T.elements[9]*=c,T.elements[10]*=c,e.setFromRotationMatrix(T),r.x=i,r.y=o,r.z=a,this},makePerspective:function(t,e,r,n,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(e-t),u=2*i/(r-n),c=(e+t)/(e-t),l=(r+n)/(r-n),h=-(o+i)/(o-i),p=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=u,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,r,n,i,o){var a=this.elements,s=1/(e-t),u=1/(r-n),c=1/(o-i),l=(e+t)*s,h=(r+n)*u,p=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*u,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,r=t.elements,n=0;n<16;n++)if(e[n]!==r[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var r=0;r<16;r++)this.elements[r]=t[r+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t}});var B=new D,N=new C;function F(t,e,r,n){this._x=t||0,this._y=e||0,this._z=r||0,this._order=n||F.DefaultOrder}function j(){this.mask=1}F.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],F.DefaultOrder="XYZ",Object.defineProperties(F.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(F.prototype,{isEuler:!0,set:function(t,e,r,n){return this._x=t,this._y=e,this._z=r,this._order=n||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,r){var n=g.clamp,i=t.elements,o=i[0],a=i[4],s=i[8],u=i[1],c=i[5],l=i[9],h=i[2],p=i[6],d=i[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(n(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-n(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(u,c)):(this._y=Math.atan2(-h,o),this._z=0);break;case"ZXY":this._x=Math.asin(n(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(u,o));break;case"ZYX":this._y=Math.asin(-n(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(n(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,d));break;case"XZY":this._z=Math.asin(-n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==r&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,r){return B.makeRotationFromQuaternion(t),this.setFromRotationMatrix(B,e,r)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return N.setFromEuler(this),this.setFromQuaternion(N,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new M(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(j.prototype,{set:function(t){this.mask=1<1){for(var e=0;e1){for(var e=0;e0)for(n.children=[],s=0;s0&&(r.geometries=h),p.length>0&&(r.materials=p),d.length>0&&(r.textures=d),f.length>0&&(r.images=f),a.length>0&&(r.shapes=a)}return r.object=n,r;function g(t){var e=[];for(var r in t){var n=t[r];delete n.metadata,e.push(n)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var r=0;rs)return!1}return!0}Object.assign(ft.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=t.length;si&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,r,n),this.max.set(i,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,u=t.count;si&&(i=c),l>o&&(o=l),h>a&&(a=h)}return this.min.set(e,r,n),this.max.set(i,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new M),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,rt),rt.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,r;return t.normal.x>0?(e=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),e<=-t.constant&&r>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(lt),ht.subVectors(this.max,lt),it.subVectors(t.a,lt),ot.subVectors(t.b,lt),at.subVectors(t.c,lt),st.subVectors(ot,it),ut.subVectors(at,ot),ct.subVectors(it,at);var e=[0,-st.z,st.y,0,-ut.z,ut.y,0,-ct.z,ct.y,st.z,0,-st.x,ut.z,0,-ut.x,ct.z,0,-ct.x,-st.y,st.x,0,-ut.y,ut.x,0,-ct.y,ct.x,0];return!!gt(e,it,ot,at,ht)&&!!gt(e=[1,0,0,0,1,0,0,0,1],it,ot,at,ht)&&(pt.crossVectors(st,ut),gt(e=[pt.x,pt.y,pt.z],it,ot,at,ht))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new M),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return rt.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(rt).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(et[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),et[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),et[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),et[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),et[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),et[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),et[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),et[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(et)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var mt=new ft;function yt(t,e){this.center=void 0!==t?t:new M,this.radius=void 0!==e?e:-1}Object.assign(yt.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var r=this.center;void 0!==e?r.copy(e):mt.setFromPoints(t).getCenter(r);for(var n=0,i=0,o=t.length;ithis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new ft),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var vt=new M,At=new M,_t=new M,bt=new M,xt=new M,wt=new M,Ct=new M;function Et(t,e){this.origin=void 0!==t?t:new M,this.direction=void 0!==e?e:new M(0,0,-1)}Object.assign(Et.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new M),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,vt)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new M),e.subVectors(t,this.origin);var r=e.dot(this.direction);return r<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var e=vt.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(vt.copy(this.direction).multiplyScalar(e).add(this.origin),vt.distanceToSquared(t))},distanceSqToSegment:function(t,e,r,n){At.copy(t).add(e).multiplyScalar(.5),_t.copy(e).sub(t).normalize(),bt.copy(this.origin).sub(At);var i,o,a,s,u=.5*t.distanceTo(e),c=-this.direction.dot(_t),l=bt.dot(this.direction),h=-bt.dot(_t),p=bt.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(o=c*l-h,s=u*d,(i=c*h-l)>=0)if(o>=-s)if(o<=s){var f=1/d;a=(i*=f)*(i+c*(o*=f)+2*l)+o*(c*i+o+2*h)+p}else o=u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+p;else o=-u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+p;else o<=-s?a=-(i=Math.max(0,-(-c*u+l)))*i+(o=i>0?-u:Math.min(Math.max(-u,-h),u))*(o+2*h)+p:o<=s?(i=0,a=(o=Math.min(Math.max(-u,-h),u))*(o+2*h)+p):a=-(i=Math.max(0,-(c*u+l)))*i+(o=i>0?u:Math.min(Math.max(-u,-h),u))*(o+2*h)+p;else o=c>0?-u:u,a=-(i=Math.max(0,-(c*o+l)))*i+o*(o+2*h)+p;return r&&r.copy(this.direction).multiplyScalar(i).add(this.origin),n&&n.copy(_t).multiplyScalar(o).add(At),a},intersectSphere:function(t,e){vt.subVectors(t.center,this.origin);var r=vt.dot(this.direction),n=vt.dot(vt)-r*r,i=t.radius*t.radius;if(n>i)return null;var o=Math.sqrt(i-n),a=r-o,s=r+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null},intersectPlane:function(t,e){var r=this.distanceToPlane(t);return null===r?null:this.at(r,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var r,n,i,o,a,s,u=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,h=this.origin;return u>=0?(r=(t.min.x-h.x)*u,n=(t.max.x-h.x)*u):(r=(t.max.x-h.x)*u,n=(t.min.x-h.x)*u),c>=0?(i=(t.min.y-h.y)*c,o=(t.max.y-h.y)*c):(i=(t.max.y-h.y)*c,o=(t.min.y-h.y)*c),r>o||i>n?null:((i>r||r!=r)&&(r=i),(o=0?(a=(t.min.z-h.z)*l,s=(t.max.z-h.z)*l):(a=(t.max.z-h.z)*l,s=(t.min.z-h.z)*l),r>s||a>n?null:((a>r||r!=r)&&(r=a),(s=0?r:n,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,vt)},intersectTriangle:function(t,e,r,n,i){xt.subVectors(e,t),wt.subVectors(r,t),Ct.crossVectors(xt,wt);var o,a=this.direction.dot(Ct);if(a>0){if(n)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}bt.subVectors(this.origin,t);var s=o*this.direction.dot(wt.crossVectors(bt,wt));if(s<0)return null;var u=o*this.direction.dot(xt.cross(bt));if(u<0)return null;if(s+u>a)return null;var c=-o*bt.dot(Ct);return c<0?null:this.at(c/a,i)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});var It=new M,Mt=new M,St=new y;function Tt(t,e){this.normal=void 0!==t?t:new M(1,0,0),this.constant=void 0!==e?e:0}Object.assign(Tt.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,r,n){return this.normal.set(t,e,r),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,r){var n=It.subVectors(r,e).cross(Mt.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new M),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new M);var r=t.delta(It),n=this.normal.dot(r);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var i=-(t.start.dot(this.normal)+this.constant)/n;return i<0||i>1?void 0:e.copy(r).multiplyScalar(i).add(t.start)},intersectsLine:function(t){var e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new M),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var r=e||St.getNormalMatrix(t),n=this.coplanarPoint(It).applyMatrix4(t),i=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(i),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var Pt=new M,Ot=new M,Lt=new M,kt=new M,Rt=new M,Dt=new M,Bt=new M,Nt=new M,Ft=new M,jt=new M;function zt(t,e,r){this.a=void 0!==t?t:new M,this.b=void 0!==e?e:new M,this.c=void 0!==r?r:new M}Object.assign(zt,{getNormal:function(t,e,r,n){void 0===n&&(console.warn("THREE.Triangle: .getNormal() target is now required"),n=new M),n.subVectors(r,e),Pt.subVectors(t,e),n.cross(Pt);var i=n.lengthSq();return i>0?n.multiplyScalar(1/Math.sqrt(i)):n.set(0,0,0)},getBarycoord:function(t,e,r,n,i){Pt.subVectors(n,e),Ot.subVectors(r,e),Lt.subVectors(t,e);var o=Pt.dot(Pt),a=Pt.dot(Ot),s=Pt.dot(Lt),u=Ot.dot(Ot),c=Ot.dot(Lt),l=o*u-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new M),0===l)return i.set(-2,-1,-1);var h=1/l,p=(u*s-a*c)*h,d=(o*c-a*s)*h;return i.set(1-p-d,d,p)},containsPoint:function(t,e,r,n){return zt.getBarycoord(t,e,r,n,kt),kt.x>=0&&kt.y>=0&&kt.x+kt.y<=1},getUV:function(t,e,r,n,i,o,a,s){return this.getBarycoord(t,e,r,n,kt),s.set(0,0),s.addScaledVector(i,kt.x),s.addScaledVector(o,kt.y),s.addScaledVector(a,kt.z),s},isFrontFacing:function(t,e,r,n){return Pt.subVectors(r,e),Ot.subVectors(t,e),Pt.cross(Ot).dot(n)<0}}),Object.assign(zt.prototype,{set:function(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this},setFromPointsAndIndices:function(t,e,r,n){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return Pt.subVectors(this.c,this.b),Ot.subVectors(this.a,this.b),.5*Pt.cross(Ot).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new M),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return zt.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Tt),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return zt.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,r,n,i){return zt.getUV(t,this.a,this.b,this.c,e,r,n,i)},containsPoint:function(t){return zt.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return zt.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new M);var r,n,i=this.a,o=this.b,a=this.c;Rt.subVectors(o,i),Dt.subVectors(a,i),Nt.subVectors(t,i);var s=Rt.dot(Nt),u=Dt.dot(Nt);if(s<=0&&u<=0)return e.copy(i);Ft.subVectors(t,o);var c=Rt.dot(Ft),l=Dt.dot(Ft);if(c>=0&&l<=c)return e.copy(o);var h=s*l-c*u;if(h<=0&&s>=0&&c<=0)return r=s/(s-c),e.copy(i).addScaledVector(Rt,r);jt.subVectors(t,a);var p=Rt.dot(jt),d=Dt.dot(jt);if(d>=0&&p<=d)return e.copy(a);var f=p*u-s*d;if(f<=0&&u>=0&&d<=0)return n=u/(u-d),e.copy(i).addScaledVector(Dt,n);var g=c*d-p*l;if(g<=0&&l-c>=0&&p-d>=0)return Bt.subVectors(a,o),n=(l-c)/(l-c+(p-d)),e.copy(o).addScaledVector(Bt,n);var m=1/(g+f+h);return r=f*m,n=h*m,e.copy(i).addScaledVector(Rt,r).addScaledVector(Dt,n)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var Ut={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Gt={h:0,s:0,l:0},Ht={h:0,s:0,l:0};function Vt(t,e,r){return void 0===e&&void 0===r?this.set(t):this.setRGB(t,e,r)}function Qt(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+6*(e-t)*(2/3-r):t}function qt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Wt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Yt(t,e,r,n,i,o){this.a=t,this.b=e,this.c=r,this.normal=n&&n.isVector3?n:new M,this.vertexNormals=Array.isArray(n)?n:[],this.color=i&&i.isColor?i:new Vt,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}Object.assign(Vt.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,r){return this.r=t,this.g=e,this.b=r,this},setHSL:function(t,e,r){if(t=g.euclideanModulo(t,1),e=g.clamp(e,0,1),r=g.clamp(r,0,1),0===e)this.r=this.g=this.b=r;else{var n=r<=.5?r*(1+e):r+e-r*e,i=2*r-n;this.r=Qt(i,n,t+1/3),this.g=Qt(i,n,t),this.b=Qt(i,n,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,i=r[1],o=r[2];switch(i){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,u=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(a,s,u)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(t)){var c=r[1],l=c.length;if(3===l)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},setColorName:function(t){var e=Ut[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var r=e>0?1/e:1;return this.r=Math.pow(t.r,r),this.g=Math.pow(t.g,r),this.b=Math.pow(t.b,r),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=qt(t.r),this.g=qt(t.g),this.b=qt(t.b),this},copyLinearToSRGB:function(t){return this.r=Wt(t.r),this.g=Wt(t.g),this.b=Wt(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,r,n=this.r,i=this.g,o=this.b,a=Math.max(n,i,o),s=Math.min(n,i,o),u=(s+a)/2;if(s===a)e=0,r=0;else{var c=a-s;switch(r=u<=.5?c/(a+s):c/(2-a-s),a){case n:e=(i-o)/c+(i0&&(r.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(r.morphTargets=!0),!0===this.morphNormals&&(r.morphNormals=!0),!0===this.skinning&&(r.skinning=!0),!1===this.visible&&(r.visible=!1),!1===this.toneMapped&&(r.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),e){var i=n(t.textures),o=n(t.images);i.length>0&&(r.textures=i),o.length>0&&(r.images=o)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,r=null;if(null!==e){var n=e.length;r=new Array(n);for(var i=0;i!==n;++i)r[i]=e[i].clone()}return this.clippingPlanes=r,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Zt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Kt.prototype=Object.create(Zt.prototype),Kt.prototype.constructor=Kt,Kt.prototype.isMeshBasicMaterial=!0,Kt.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var Jt=new M;function $t(t,e,r){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===r,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function te(t,e,r){$t.call(this,new Int8Array(t),e,r)}function ee(t,e,r){$t.call(this,new Uint8Array(t),e,r)}function re(t,e,r){$t.call(this,new Uint8ClampedArray(t),e,r)}function ne(t,e,r){$t.call(this,new Int16Array(t),e,r)}function ie(t,e,r){$t.call(this,new Uint16Array(t),e,r)}function oe(t,e,r){$t.call(this,new Int32Array(t),e,r)}function ae(t,e,r){$t.call(this,new Uint32Array(t),e,r)}function se(t,e,r){$t.call(this,new Float32Array(t),e,r)}function ue(t,e,r){$t.call(this,new Float64Array(t),e,r)}function ce(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function le(t){if(0===t.length)return-1/0;for(var e=t[0],r=1,n=t.length;re&&(e=t[r]);return e}Object.defineProperty($t.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign($t.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,r){t*=this.itemSize,r*=e.itemSize;for(var n=0,i=this.itemSize;n0,a=i[1]&&i[1].length>0,s=t.morphTargets,u=s.length;if(u>0){e=[];for(var c=0;c0){for(l=[],c=0;c0&&0===r.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),c=0;c65535?ae:ie)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,r){this.groups.push({start:t,count:e,materialIndex:void 0!==r?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var r=this.attributes.normal;if(void 0!==r){var n=(new y).getNormalMatrix(t);r.applyNormalMatrix(n),r.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return pe.makeRotationX(t),this.applyMatrix4(pe),this},rotateY:function(t){return pe.makeRotationY(t),this.applyMatrix4(pe),this},rotateZ:function(t){return pe.makeRotationZ(t),this.applyMatrix4(pe),this},translate:function(t,e,r){return pe.makeTranslation(t,e,r),this.applyMatrix4(pe),this},scale:function(t,e,r){return pe.makeScale(t,e,r),this.applyMatrix4(pe),this},lookAt:function(t){return de.lookAt(t),de.updateMatrix(),this.applyMatrix4(de.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(fe).negate(),this.translate(fe.x,fe.y,fe.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var r=new se(3*e.vertices.length,3),n=new se(3*e.colors.length,3);if(this.setAttribute("position",r.copyVector3sArray(e.vertices)),this.setAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new se(e.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],r=0,n=t.length;r0){var r=new Float32Array(3*t.normals.length);this.setAttribute("normal",new $t(r,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.setAttribute("color",new $t(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new $t(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new $t(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],u=t.morphTargets[a],c=0,l=u.length;c0){var d=new se(4*t.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new se(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new ft);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var r=0,n=e.length;r0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}t.data={attributes:{}};var n=this.index;null!==n&&(t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var i=this.attributes;for(var r in i){var o=(p=i[r]).toJSON();""!==p.name&&(o.name=p.name),t.data.attributes[r]=o}var a={},s=!1;for(var r in this.morphAttributes){for(var u=this.morphAttributes[r],c=[],l=0,h=u.length;l0&&(a[r]=c,s=!0)}s&&(t.data.morphAttributes=a,t.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(t.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new ve).copy(this)},copy:function(t){var e,r,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var o=t.attributes;for(e in o){var a=o[e];this.setAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var u=[],c=s[e];for(r=0,n=c.length;rr.far?null:{distance:u,point:De.clone(),object:t}}function Fe(t,e,r,n,i,o,a,s,u,c,l,h){xe.fromBufferAttribute(i,c),we.fromBufferAttribute(i,l),Ce.fromBufferAttribute(i,h);var p=t.morphTargetInfluences;if(e.morphTargets&&o&&p){Se.set(0,0,0),Te.set(0,0,0),Pe.set(0,0,0);for(var d=0,f=o.length;d0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var r,n=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===n.boundingSphere&&n.computeBoundingSphere(),be.copy(n.boundingSphere),be.applyMatrix4(o),!1!==t.ray.intersectsSphere(be)&&(Ae.getInverse(o),_e.copy(t.ray).applyMatrix4(Ae),null===n.boundingBox||!1!==_e.intersectsBox(n.boundingBox))))if(n.isBufferGeometry){var a,s,u,c,l,h,p,d,f,g=n.index,y=n.attributes.position,v=n.morphAttributes.position,A=n.morphTargetsRelative,_=n.attributes.uv,b=n.attributes.uv2,x=n.groups,w=n.drawRange;if(null!==g)if(Array.isArray(i))for(c=0,h=x.length;c0&&(M=O);for(var L=0,k=P.length;L0)for(c=0;c0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,r;for(this.computeFaceNormals(),t=0,e=this.faces.length;t0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,r,n,i;for(r=0,n=this.faces.length;r=0;r--){var f=p[r];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a0,m=d.vertexNormals.length>0,y=1!==d.color.r||1!==d.color.g||1!==d.color.b,v=d.vertexColors.length>0,A=0;if(A=w(A,0,0),A=w(A,1,!0),A=w(A,2,!1),A=w(A,3,f),A=w(A,4,g),A=w(A,5,m),A=w(A,6,y),A=w(A,7,v),a.push(A),a.push(d.a,d.b,d.c),a.push(d.materialIndex),f){var _=this.faceVertexUvs[0][i];a.push(I(_[0]),I(_[1]),I(_[2]))}if(g&&a.push(C(d.normal)),m){var b=d.vertexNormals;a.push(C(b[0]),C(b[1]),C(b[2]))}if(y&&a.push(E(d.color)),v){var x=d.vertexColors;a.push(E(x[0]),E(x[1]),E(x[2]))}}function w(t,e,r){return r?t|1<0&&(t.data.colors=c),h.length>0&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new He).copy(this)},copy:function(t){var e,r,n,i,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,r=s.length;e0?1:-1,d.push(S.x,S.y,S.z),f.push(O/u),f.push(1-T/c),E+=1}for(var k=0;k0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var i={};for(var o in this.extensions)!0===this.extensions[o]&&(i[o]=!0);return Object.keys(i).length>0&&(e.extensions=i),e},Ze.prototype=Object.assign(Object.create($.prototype),{constructor:Ze,isCamera:!0,copy:function(t,e){return $.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new M),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){$.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){$.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Ke.prototype=Object.assign(Object.create(Ze.prototype),{constructor:Ke,isPerspectiveCamera:!0,copy:function(t,e){return Ze.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*g.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*g.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*g.RAD2DEG*Math.atan(Math.tan(.5*g.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,r,n,i,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=r,this.view.offsetY=n,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*g.DEG2RAD*this.fov)/this.zoom,r=2*e,n=this.aspect*r,i=-.5*n,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*n/a,e-=o.offsetY*r/s,n*=o.width/a,r*=o.height/s}var u=this.filmOffset;0!==u&&(i+=t*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,e,e-r,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=$.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),Je.prototype=Object.create($.prototype),Je.prototype.constructor=Je,$e.prototype=Object.create(x.prototype),$e.prototype.constructor=$e,$e.prototype.isWebGLCubeRenderTarget=!0,$e.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var r=new tt,n={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include ","\t#include ","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#include ","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV = equirectUv( direction );","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new Xe({type:"CubemapFromEquirect",uniforms:qe(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=e;var o=new Be(new Qe(5,5,5),i);return r.add(o),new Je(1,10,this).update(t,r),o.geometry.dispose(),o.material.dispose(),this},tr.prototype=Object.create(_.prototype),tr.prototype.constructor=tr,tr.prototype.isDataTexture=!0;var er=new yt,rr=new M;function nr(t,e,r,n,i,o){this.planes=[void 0!==t?t:new Tt,void 0!==e?e:new Tt,void 0!==r?r:new Tt,void 0!==n?n:new Tt,void 0!==i?i:new Tt,void 0!==o?o:new Tt]}Object.assign(nr.prototype,{set:function(t,e,r,n,i,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(r),a[3].copy(n),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,r=0;r<6;r++)e[r].copy(t.planes[r]);return this},setFromProjectionMatrix:function(t){var e=this.planes,r=t.elements,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],c=r[6],l=r[7],h=r[8],p=r[9],d=r[10],f=r[11],g=r[12],m=r[13],y=r[14],v=r[15];return e[0].setComponents(a-n,l-s,f-h,v-g).normalize(),e[1].setComponents(a+n,l+s,f+h,v+g).normalize(),e[2].setComponents(a+i,l+u,f+p,v+m).normalize(),e[3].setComponents(a-i,l-u,f-p,v-m).normalize(),e[4].setComponents(a-o,l-c,f-d,v-y).normalize(),e[5].setComponents(a+o,l+c,f+d,v+y).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),er.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(er)},intersectsSprite:function(t){return er.center.set(0,0,0),er.radius=.7071067811865476,er.applyMatrix4(t.matrixWorld),this.intersectsSphere(er)},intersectsSphere:function(t){for(var e=this.planes,r=t.center,n=-t.radius,i=0;i<6;i++)if(e[i].distanceToPoint(r)0?t.max.x:t.min.x,rr.y=n.normal.y>0?t.max.y:t.min.y,rr.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(rr)<0)return!1}return!0},containsPoint:function(t){for(var e=this.planes,r=0;r<6;r++)if(e[r].distanceToPoint(t)<0)return!1;return!0}});var ir={common:{diffuse:{value:new Vt(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new y},uv2Transform:{value:new y},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new m(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Vt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Vt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new y}},sprite:{diffuse:{value:new Vt(15658734)},opacity:{value:1},center:{value:new m(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new y}}};function or(){var t=null,e=!1,r=null;function n(i,o){!1!==e&&(r(i,o),t.requestAnimationFrame(n))}return{start:function(){!0!==e&&null!==r&&(t.requestAnimationFrame(n),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){r=t},setContext:function(e){t=e}}}function ar(t,e){var r=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var r=n.get(e);r&&(t.deleteBuffer(r.buffer),n.delete(e))},update:function(e,i){e.isInterleavedBufferAttribute&&(e=e.data);var o=n.get(e);void 0===o?n.set(e,function(e,r){var n=e.array,i=e.usage,o=t.createBuffer();t.bindBuffer(r,o),t.bufferData(r,n,i),e.onUploadCallback();var a=5126;return(0,l.default)(n,Float32Array)?a=5126:(0,l.default)(n,Float64Array)?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):(0,l.default)(n,Uint16Array)?a=5123:(0,l.default)(n,Int16Array)?a=5122:(0,l.default)(n,Uint32Array)?a=5125:(0,l.default)(n,Int32Array)?a=5124:(0,l.default)(n,Int8Array)?a=5120:(0,l.default)(n,Uint8Array)&&(a=5121),{buffer:o,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}(e,i)):o.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x); } else if (face == 1.0) {\n uv = vec2(-direction.x, -direction.z) / abs(direction.y); } else if (face == 2.0) {\n uv = vec2(-direction.x, direction.y) / abs(direction.z); } else if (face == 3.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x); } else if (face == 4.0) {\n uv = vec2(-direction.x, direction.z) / abs(direction.y); } else {\n uv = vec2(direction.x, direction.y) / abs(direction.z); }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"};e.ShaderChunk=cr;var lr={basic:{uniforms:We([ir.common,ir.specularmap,ir.envmap,ir.aomap,ir.lightmap,ir.fog]),vertexShader:cr.meshbasic_vert,fragmentShader:cr.meshbasic_frag},lambert:{uniforms:We([ir.common,ir.specularmap,ir.envmap,ir.aomap,ir.lightmap,ir.emissivemap,ir.fog,ir.lights,{emissive:{value:new Vt(0)}}]),vertexShader:cr.meshlambert_vert,fragmentShader:cr.meshlambert_frag},phong:{uniforms:We([ir.common,ir.specularmap,ir.envmap,ir.aomap,ir.lightmap,ir.emissivemap,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.fog,ir.lights,{emissive:{value:new Vt(0)},specular:{value:new Vt(1118481)},shininess:{value:30}}]),vertexShader:cr.meshphong_vert,fragmentShader:cr.meshphong_frag},standard:{uniforms:We([ir.common,ir.envmap,ir.aomap,ir.lightmap,ir.emissivemap,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.roughnessmap,ir.metalnessmap,ir.fog,ir.lights,{emissive:{value:new Vt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:cr.meshphysical_vert,fragmentShader:cr.meshphysical_frag},toon:{uniforms:We([ir.common,ir.specularmap,ir.aomap,ir.lightmap,ir.emissivemap,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.gradientmap,ir.fog,ir.lights,{emissive:{value:new Vt(0)},specular:{value:new Vt(1118481)},shininess:{value:30}}]),vertexShader:cr.meshtoon_vert,fragmentShader:cr.meshtoon_frag},matcap:{uniforms:We([ir.common,ir.bumpmap,ir.normalmap,ir.displacementmap,ir.fog,{matcap:{value:null}}]),vertexShader:cr.meshmatcap_vert,fragmentShader:cr.meshmatcap_frag},points:{uniforms:We([ir.points,ir.fog]),vertexShader:cr.points_vert,fragmentShader:cr.points_frag},dashed:{uniforms:We([ir.common,ir.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:cr.linedashed_vert,fragmentShader:cr.linedashed_frag},depth:{uniforms:We([ir.common,ir.displacementmap]),vertexShader:cr.depth_vert,fragmentShader:cr.depth_frag},normal:{uniforms:We([ir.common,ir.bumpmap,ir.normalmap,ir.displacementmap,{opacity:{value:1}}]),vertexShader:cr.normal_vert,fragmentShader:cr.normal_frag},sprite:{uniforms:We([ir.sprite,ir.fog]),vertexShader:cr.sprite_vert,fragmentShader:cr.sprite_frag},background:{uniforms:{uvTransform:{value:new y},t2D:{value:null}},vertexShader:cr.background_vert,fragmentShader:cr.background_frag},cube:{uniforms:We([ir.envmap,{opacity:{value:1}}]),vertexShader:cr.cube_vert,fragmentShader:cr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:cr.equirect_vert,fragmentShader:cr.equirect_frag},distanceRGBA:{uniforms:We([ir.common,ir.displacementmap,{referencePosition:{value:new M},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:cr.distanceRGBA_vert,fragmentShader:cr.distanceRGBA_frag},shadow:{uniforms:We([ir.lights,ir.fog,{color:{value:new Vt(0)},opacity:{value:1}}]),vertexShader:cr.shadow_vert,fragmentShader:cr.shadow_frag}};function hr(t,e,r,n){var i,o,a=new Vt(0),s=0,u=null,c=0,l=null;function h(t,r){e.buffers.color.setClear(t.r,t.g,t.b,r,n)}return{getClearColor:function(){return a},setClearColor:function(t,e){a.set(t),h(a,s=void 0!==e?e:1)},getClearAlpha:function(){return s},setClearAlpha:function(t){h(a,s=t)},render:function(e,n,p,d){var f=n.background,g=t.xr,m=g.getSession&&g.getSession();if(m&&"additive"===m.environmentBlendMode&&(f=null),null===f?h(a,s):f&&f.isColor&&(h(f,1),d=!0),(t.autoClear||d)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||306===f.mapping)){void 0===o&&((o=new Be(new Qe(1,1,1),new Xe({type:"BackgroundCubeMaterial",uniforms:qe(lr.cube.uniforms),vertexShader:lr.cube.vertexShader,fragmentShader:lr.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,r){this.matrixWorld.copyPosition(r.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(o));var y=f.isWebGLCubeRenderTarget?f.texture:f;o.material.uniforms.envMap.value=y,o.material.uniforms.flipEnvMap.value=y.isCubeTexture?-1:1,u===f&&c===y.version&&l===t.toneMapping||(o.material.needsUpdate=!0,u=f,c=y.version,l=t.toneMapping),e.unshift(o,o.geometry,o.material,0,0,null)}else f&&f.isTexture&&(void 0===i&&((i=new Be(new ur(2,2),new Xe({type:"BackgroundMaterial",uniforms:qe(lr.background.uniforms),vertexShader:lr.background.vertexShader,fragmentShader:lr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(i.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(i)),i.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),i.material.uniforms.uvTransform.value.copy(f.matrix),u===f&&c===f.version&&l===t.toneMapping||(i.material.needsUpdate=!0,u=f,c=f.version,l=t.toneMapping),e.unshift(i,i.geometry,i.material,0,0,null))}}}function pr(t,e,r,n){var i,o=n.isWebGL2;this.setMode=function(t){i=t},this.render=function(e,n){t.drawArrays(i,e,n),r.update(n,i)},this.renderInstances=function(n,a,s,u){if(0!==u){var c,l;if(o)c=t,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(c=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[l](i,a,s,u),r.update(s,i,u)}}}function dr(t,e,r){var n;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&(0,l.default)(t,WebGL2RenderingContext)||"undefined"!=typeof WebGL2ComputeRenderingContext&&(0,l.default)(t,WebGL2ComputeRenderingContext),a=void 0!==r.precision?r.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var u=!0===r.logarithmicDepthBuffer,c=t.getParameter(34930),h=t.getParameter(35660),p=t.getParameter(3379),d=t.getParameter(34076),f=t.getParameter(34921),g=t.getParameter(36347),m=t.getParameter(36348),y=t.getParameter(36349),v=h>0,A=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==n)return n;var r=e.get("EXT_texture_filter_anisotropic");return n=null!==r?t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:u,maxTextures:c,maxVertexTextures:h,maxTextureSize:p,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:g,maxVaryings:m,maxFragmentUniforms:y,vertexTextures:v,floatFragmentTextures:A,floatVertexTextures:v&&A,maxSamples:o?t.getParameter(36183):0}}function fr(){var t=this,e=null,r=0,n=!1,i=!1,o=new Tt,a=new y,s={value:null,needsUpdate:!1};function u(){s.value!==e&&(s.value=e,s.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function c(e,r,n,i){var u=null!==e?e.length:0,c=null;if(0!==u){if(c=s.value,!0!==i||null===c){var l=n+4*u,h=r.matrixWorldInverse;a.getNormalMatrix(h),(null===c||c.length65535?ae:ie)(r,1);d.version=a,e.update(d,34963);var f=i.get(t);f&&e.remove(f),i.set(t,d)}return{get:function(t,e){var i=n.get(e);return i||(e.addEventListener("dispose",o),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new ve).setFromObject(t)),i=e._bufferGeometry),n.set(e,i),r.memory.geometries++,i)},update:function(t){var r=t.index,n=t.attributes;for(var i in null!==r&&e.update(r,34963),n)e.update(n[i],34962);var o=t.morphAttributes;for(var i in o)for(var a=o[i],s=0,u=a.length;s0)return t;var i=e*r,o=Tr[i];if(void 0===o&&(o=new Float32Array(i),Tr[i]=o),0!==e){n.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=r,t[a].toArray(o,s)}return o}function Dr(t,e){if(t.length!==e.length)return!1;for(var r=0,n=t.length;r/gm;function On(t){return t.replace(Pn,Ln)}function Ln(t,e){var r=cr[e];if(void 0===r)throw new Error("Can not resolve #include <"+e+">");return On(r)}var kn=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Rn=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function Dn(t){return t.replace(Rn,Nn).replace(kn,Bn)}function Bn(t,e,r,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Nn(t,e,r,n)}function Nn(t,e,r,n){for(var i="",o=parseInt(e);o0?t.gammaFactor:1,m=r.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Mn).join("\n")}(r),y=function(t){var e=[];for(var r in t){var n=t[r];!1!==n&&e.push("#define "+r+" "+n)}return e.join("\n")}(u),v=s.createProgram();if(r.isRawShaderMaterial?((n=[y].filter(Mn).join("\n")).length>0&&(n+="\n"),(i=[m,y].filter(Mn).join("\n")).length>0&&(i+="\n")):(n=[Fn(r),"#define SHADER_NAME "+r.shaderName,y,r.instancing?"#define USE_INSTANCING":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+g,"#define MAX_BONES "+r.maxBones,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+d:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&!1===r.flatShading?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+h:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Mn).join("\n"),i=[m,Fn(r),"#define SHADER_NAME "+r.shaderName,y,r.alphaTest?"#define ALPHATEST "+r.alphaTest+(r.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+g,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+p:"",r.envMap?"#define "+d:"",r.envMap?"#define "+f:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.sheen?"#define USE_SHEEN":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+h:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensionShaderTextureLOD||r.envMap)&&r.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==r.toneMapping?"#define TONE_MAPPING":"",0!==r.toneMapping?cr.tonemapping_pars_fragment:"",0!==r.toneMapping?In("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.outputEncoding||r.mapEncoding||r.matcapEncoding||r.envMapEncoding||r.emissiveMapEncoding||r.lightMapEncoding?cr.encodings_pars_fragment:"",r.mapEncoding?En("mapTexelToLinear",r.mapEncoding):"",r.matcapEncoding?En("matcapTexelToLinear",r.matcapEncoding):"",r.envMapEncoding?En("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMapEncoding?En("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.lightMapEncoding?En("lightMapTexelToLinear",r.lightMapEncoding):"",r.outputEncoding?("linearToOutputTexel",o=r.outputEncoding,a=wn(o),"vec4 linearToOutputTexel( vec4 value ) { return LinearTo"+a[0]+a[1]+"; }"):"",r.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Mn).join("\n")),c=Tn(c=Sn(c=On(c),r),r),l=Tn(l=Sn(l=On(l),r),r),c=Dn(c),l=Dn(l),r.isWebGL2&&!r.isRawShaderMaterial){var A=!1,_=/^\s*#version\s+300\s+es\s*\n/;r.isShaderMaterial&&null!==c.match(_)&&null!==l.match(_)&&(A=!0,c=c.replace(_,""),l=l.replace(_,"")),n=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+n,i=["#version 300 es\n","#define varying in",A?"":"out highp vec4 pc_fragColor;",A?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+i}var b,x,w=i+l,C=bn(s,35633,n+c),E=bn(s,35632,w);if(s.attachShader(v,C),s.attachShader(v,E),void 0!==r.index0AttributeName?s.bindAttribLocation(v,0,r.index0AttributeName):!0===r.morphTargets&&s.bindAttribLocation(v,0,"position"),s.linkProgram(v),t.debug.checkShaderErrors){var I=s.getProgramInfoLog(v).trim(),M=s.getShaderInfoLog(C).trim(),S=s.getShaderInfoLog(E).trim(),T=!0,P=!0;if(!1===s.getProgramParameter(v,35714)){T=!1;var O=Cn(s,C,"vertex"),L=Cn(s,E,"fragment");console.error("THREE.WebGLProgram: shader error: ",s.getError(),"35715",s.getProgramParameter(v,35715),"gl.getProgramInfoLog",I,O,L)}else""!==I?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",I):""!==M&&""!==S||(P=!1);P&&(this.diagnostics={runnable:T,programLog:I,vertexShader:{log:M,prefix:n},fragmentShader:{log:S,prefix:i}})}return s.deleteShader(C),s.deleteShader(E),this.getUniforms=function(){return void 0===b&&(b=new _n(s,v)),b},this.getAttributes=function(){return void 0===x&&(x=function(t,e){for(var r={},n=t.getProgramParameter(e,35721),i=0;i0,maxBones:x,useVertexTexture:a,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:h.directional.length,numPointLights:h.point.length,numSpotLights:h.spot.length,numRectAreaLights:h.rectArea.length,numHemiLights:h.hemi.length,numDirLightShadows:h.directionalShadowMap.length,numPointLightShadows:h.pointShadowMap.length,numSpotLightShadows:h.spotShadowMap.length,numClippingPlanes:g,numClipIntersection:m,dithering:n.dithering,shadowMapEnabled:t.shadowMap.enabled&&d.length>0,shadowMapType:t.shadowMap.type,toneMapping:n.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:2===n.side,flipSided:1===n.side,depthPacking:void 0!==n.depthPacking&&n.depthPacking,index0AttributeName:n.index0AttributeName,extensionDerivatives:n.extensions&&n.extensions.derivatives,extensionFragDepth:n.extensions&&n.extensions.fragDepth,extensionDrawBuffers:n.extensions&&n.extensions.drawBuffers,extensionShaderTextureLOD:n.extensions&&n.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:i||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:i||null!==e.get("EXT_shader_texture_lod"),onBeforeCompile:n.onBeforeCompile}},this.getProgramCacheKey=function(e){var r=[];if(e.shaderID?r.push(e.shaderID):(r.push(e.fragmentShader),r.push(e.vertexShader)),void 0!==e.defines)for(var n in e.defines)r.push(n),r.push(e.defines[n]);if(void 0===e.isRawShaderMaterial){for(var i=0;i1&&r.sort(t||Gn),n.length>1&&n.sort(e||Hn)}}}function Qn(){var t=new WeakMap;function e(r){var n=r.target;n.removeEventListener("dispose",e),t.delete(n)}return{get:function(r,n){var i,o=t.get(r);return void 0===o?(i=new Vn,t.set(r,new WeakMap),t.get(r).set(n,i),r.addEventListener("dispose",e)):void 0===(i=o.get(n))&&(i=new Vn,o.set(n,i)),i},dispose:function(){t=new WeakMap}}}function qn(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var r;switch(e.type){case"DirectionalLight":r={direction:new M,color:new Vt};break;case"SpotLight":r={position:new M,direction:new M,color:new Vt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new M,color:new Vt,distance:0,decay:0};break;case"HemisphereLight":r={direction:new M,skyColor:new Vt,groundColor:new Vt};break;case"RectAreaLight":r={color:new Vt,position:new M,halfWidth:new M,halfHeight:new M}}return t[e.id]=r,r}}}var Wn=0;function Yn(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Xn(){for(var t,e=new qn,r=(t={},{get:function(e){if(void 0!==t[e.id])return t[e.id];var r;switch(e.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowRadius:1,shadowMapSize:new m};break;case"PointLight":r={shadowBias:0,shadowRadius:1,shadowMapSize:new m,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=r,r}}),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},i=0;i<9;i++)n.probe.push(new M);var o=new M,a=new D,s=new D;return{setup:function(t,i,u){for(var c=0,l=0,h=0,p=0;p<9;p++)n.probe[p].set(0,0,0);var d=0,f=0,g=0,m=0,y=0,v=0,A=0,_=0,b=u.matrixWorldInverse;t.sort(Yn),p=0;for(var x=t.length;p\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=h.clone();p.defines.HORIZONAL_PASS=1;var d=new ve;d.setAttribute("position",new $t(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var f=new Be(d,h),g=this;function y(r,n){var i=e.update(f);h.uniforms.shadow_pass.value=r.map.texture,h.uniforms.resolution.value=r.mapSize,h.uniforms.radius.value=r.radius,t.setRenderTarget(r.mapPass),t.clear(),t.renderBufferDirect(n,null,i,h,f,null),p.uniforms.shadow_pass.value=r.mapPass.texture,p.uniforms.resolution.value=r.mapSize,p.uniforms.radius.value=r.radius,t.setRenderTarget(r.map),t.clear(),t.renderBufferDirect(n,null,i,p,f,null)}function v(t,e,r){var n=t<<0|e<<1|r<<2,i=s[n];return void 0===i&&(i=new Jn({depthPacking:3201,morphTargets:t,skinning:e}),s[n]=i),i}function A(t,e,r){var n=t<<0|e<<1|r<<2,i=u[n];return void 0===i&&(i=new $n({morphTargets:t,skinning:e}),u[n]=i),i}function _(e,r,n,i,o,a,s){var u=null,h=v,p=e.customDepthMaterial;if(!0===i.isPointLight&&(h=A,p=e.customDistanceMaterial),void 0===p){var d=!1;!0===n.morphTargets&&(d=r.morphAttributes&&r.morphAttributes.position&&r.morphAttributes.position.length>0);var f=!1;!0===e.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),u=h(d,f,!0===e.isInstancedMesh)}else u=p;if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var g=u.uuid,m=n.uuid,y=c[g];void 0===y&&(y={},c[g]=y);var _=y[m];void 0===_&&(_=u.clone(),y[m]=_),u=_}return u.visible=n.visible,u.wireframe=n.wireframe,u.side=3===s?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:l[n.side],u.clipShadows=n.clipShadows,u.clippingPlanes=n.clippingPlanes,u.clipIntersection=n.clipIntersection,u.wireframeLinewidth=n.wireframeLinewidth,u.linewidth=n.linewidth,!0===i.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=o,u.farDistance=a),u}function w(r,i,o,a,s){if(!1!==r.visible){if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&(r.castShadow||r.receiveShadow&&3===s)&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,r.matrixWorld);var u=e.update(r),c=r.material;if(Array.isArray(c))for(var l=u.groups,h=0,p=l.length;hr||i.y>r)&&(i.x>r&&(o.x=Math.floor(r/A.x),i.x=o.x*A.x,v.mapSize.x=o.x),i.y>r&&(o.y=Math.floor(r/A.y),i.y=o.y*A.y,v.mapSize.y=o.y)),null===v.map&&!v.isPointLightShadow&&3===this.type){var _={minFilter:1006,magFilter:1006,format:1023};v.map=new x(i.x,i.y,_),v.map.texture.name=m.name+".shadowMap",v.mapPass=new x(i.x,i.y,_),v.camera.updateProjectionMatrix()}null===v.map&&(_={minFilter:1003,magFilter:1003,format:1023},v.map=new x(i.x,i.y,_),v.map.texture.name=m.name+".shadowMap",v.camera.updateProjectionMatrix()),t.setRenderTarget(v.map),t.clear();for(var b=v.getViewportCount(),C=0;C=1):-1!==R.indexOf("OpenGL ES")&&(k=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(R)[1]),L=k>=2);var D=null,B={},N=new b,F=new b;function j(e,r,n){var i=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;an||t.height>n)&&(i=n/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&(0,l.default)(t,HTMLImageElement)||"undefined"!=typeof HTMLCanvasElement&&(0,l.default)(t,HTMLCanvasElement)||"undefined"!=typeof ImageBitmap&&(0,l.default)(t,ImageBitmap)){var o=e?g.floorPowerOfTwo:Math.floor,a=o(i*t.width),s=o(i*t.height);void 0===h&&(h=_(a,s));var u=r?_(a,s):h;return u.width=a,u.height=s,u.getContext("2d").drawImage(t,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+s+")."),u}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function x(t){return g.isPowerOfTwo(t.width)&&g.isPowerOfTwo(t.height)}function w(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function C(e,r,i,o){t.generateMipmap(e),n.get(r).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function E(r,n,i){if(!1===p)return n;if(null!==r){if(void 0!==t[r])return t[r];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+r+"'")}var o=n;return 6403===n&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===n&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===n&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function I(t){return 1003===t||1004===t||1005===t?9728:9729}function M(e){var r=e.target;r.removeEventListener("dispose",M),function(e){var r=n.get(e);void 0!==r.__webglInit&&(t.deleteTexture(r.__webglTexture),n.remove(e))}(r),r.isVideoTexture&&v.delete(r),s.memory.textures--}function S(e){var r=e.target;r.removeEventListener("dispose",S),function(e){var r=n.get(e),i=n.get(e.texture);if(e){if(void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)t.deleteFramebuffer(r.__webglFramebuffer[o]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[o]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&t.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer);n.remove(e.texture),n.remove(e)}}(r),s.memory.textures--}var T=0;function P(t,e){var i=n.get(t);if(t.isVideoTexture&&function(t){var e=s.render.frame;v.get(t)!==e&&(v.set(t,e),t.update())}(t),t.version>0&&i.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void N(i,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.activeTexture(33984+e),r.bindTexture(3553,i.__webglTexture)}function O(e,i){if(6===e.image.length){var a=n.get(e);if(e.version>0&&a.__version!==e.version){B(a,e),r.activeTexture(33984+i),r.bindTexture(34067,a.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),u=e.image[0]&&e.image[0].isDataTexture,c=[],l=0;l<6;l++)c[l]=s||u?u?e.image[l].image:e.image[l]:b(e.image[l],!1,!0,f);var h,d=c[0],g=x(d)||p,m=o.convert(e.format),y=o.convert(e.type),v=E(e.internalFormat,m,y);if(D(34067,e,g),s){for(l=0;l<6;l++){h=c[l].mipmaps;for(var A=0;A1||n.get(o).__currentAnisotropy)&&(t.texParameterf(r,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function B(e,r){void 0===e.__webglInit&&(e.__webglInit=!0,r.addEventListener("dispose",M),e.__webglTexture=t.createTexture(),s.memory.textures++)}function N(e,n,i){var a=3553;n.isDataTexture2DArray&&(a=35866),n.isDataTexture3D&&(a=32879),B(e,n),r.activeTexture(33984+i),r.bindTexture(a,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);var s=function(t){return!p&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(n)&&!1===x(n.image),u=b(n.image,s,!1,m),c=x(u)||p,l=o.convert(n.format),h=o.convert(n.type),d=E(n.internalFormat,l,h);D(a,n,c);var f,g=n.mipmaps;if(n.isDepthTexture)d=6402,p?d=1015===n.type?36012:1014===n.type?33190:1020===n.type?35056:33189:1015===n.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===n.format&&6402===d&&1012!==n.type&&1014!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=1012,h=o.convert(n.type)),1027===n.format&&6402===d&&(d=34041,1020!==n.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=1020,h=o.convert(n.type))),r.texImage2D(3553,0,d,u.width,u.height,0,l,h,null);else if(n.isDataTexture)if(g.length>0&&c){for(var y=0,v=g.length;y0&&c){for(y=0,v=g.length;y=d&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+d),T+=1,t},this.resetTextureUnits=function(){T=0},this.setTexture2D=P,this.setTexture2DArray=function(t,e){var i=n.get(t);t.version>0&&i.__version!==t.version?N(i,t,e):(r.activeTexture(33984+e),r.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(t,e){var i=n.get(t);t.version>0&&i.__version!==t.version?N(i,t,e):(r.activeTexture(33984+e),r.bindTexture(32879,i.__webglTexture))},this.setTextureCube=O,this.setTextureCubeDynamic=L,this.setupRenderTarget=function(e){var i=n.get(e),a=n.get(e.texture);e.addEventListener("dispose",S),a.__webglTexture=t.createTexture(),s.memory.textures++;var u=!0===e.isWebGLCubeRenderTarget,c=!0===e.isWebGLMultisampleRenderTarget,l=x(e)||p;if(!p||1022!==e.texture.format||1015!==e.texture.type&&1016!==e.texture.type||(e.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),u){i.__webglFramebuffer=[];for(var h=0;h<6;h++)i.__webglFramebuffer[h]=t.createFramebuffer()}else if(i.__webglFramebuffer=t.createFramebuffer(),c)if(p){i.__webglMultisampledFramebuffer=t.createFramebuffer(),i.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var d=o.convert(e.texture.format),f=o.convert(e.texture.type),g=E(e.texture.internalFormat,d,f),m=z(e);t.renderbufferStorageMultisample(36161,m,g,e.width,e.height),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(i.__webglDepthRenderbuffer=t.createRenderbuffer(),j(i.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(u){for(r.bindTexture(34067,a.__webglTexture),D(34067,e.texture,l),h=0;h<6;h++)F(i.__webglFramebuffer[h],e,36064,34069+h);w(e.texture,l)&&C(34067,e.texture,e.width,e.height),r.bindTexture(34067,null)}else r.bindTexture(3553,a.__webglTexture),D(3553,e.texture,l),F(i.__webglFramebuffer,e,36064,3553),w(e.texture,l)&&C(3553,e.texture,e.width,e.height),r.bindTexture(3553,null);e.depthBuffer&&function(e){var r=n.get(e),i=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),P(r.depthTexture,0);var i=n.get(r.depthTexture).__webglTexture;if(1026===r.depthTexture.format)t.framebufferTexture2D(36160,36096,3553,i,0);else{if(1027!==r.depthTexture.format)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,i,0)}}(r.__webglFramebuffer,e)}else if(i){r.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,r.__webglFramebuffer[o]),r.__webglDepthbuffer[o]=t.createRenderbuffer(),j(r.__webglDepthbuffer[o],e,!1)}else t.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),j(r.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(w(e,x(t)||p)){var i=t.isWebGLCubeRenderTarget?34067:3553,o=n.get(e).__webglTexture;r.bindTexture(i,o),C(i,e,t.width,t.height),r.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(p){var r=n.get(e);t.bindFramebuffer(36008,r.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,r.__webglFramebuffer);var i=e.width,o=e.height,a=16384;e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024),t.blitFramebuffer(0,0,i,o,0,0,i,o,a,9728),t.bindFramebuffer(36160,r.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),U=!0),t=t.texture),P(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===G&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),G=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?O(t,e):L(t,e)}}function ni(t,e,r){var n=r.isWebGL2;return{convert:function(t){var r;if(1009===t)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(1012===t)return 5123;if(1013===t)return 5124;if(1014===t)return 5125;if(1015===t)return 5126;if(1016===t)return n?5131:null!==(r=e.get("OES_texture_half_float"))?r.HALF_FLOAT_OES:null;if(1021===t)return 6406;if(1022===t)return 6407;if(1023===t)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(1026===t)return 6402;if(1027===t)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(null===(r=e.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===t)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(null===(r=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===t)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return null!==(r=e.get("WEBGL_compressed_texture_etc1"))?r.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&null!==(r=e.get("WEBGL_compressed_texture_etc"))){if(37492===t)return r.COMPRESSED_RGB8_ETC2;if(37496===t)return r.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?null!==(r=e.get("WEBGL_compressed_texture_astc"))?t:null:36492===t?null!==(r=e.get("EXT_texture_compression_bptc"))?t:null:1020===t?n?34042:null!==(r=e.get("WEBGL_depth_texture"))?r.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function ii(t){Ke.call(this),this.cameras=t||[]}function oi(){$.call(this),this.type="Group"}function ai(){this._targetRay=null,this._grip=null}function si(t,e){var r=this,n=null,i=1,o=null,a="local-floor",s=null,u=[],c=new Map,l=new Ke;l.layers.enable(1),l.viewport=new b;var h=new Ke;h.layers.enable(2),h.viewport=new b;var p=[l,h],d=new ii;d.layers.enable(1),d.layers.enable(2);var f=null,g=null;function m(t){var e=c.get(t.inputSource);e&&e.dispatchEvent({type:t.type})}function y(){c.forEach((function(t,e){t.disconnect(e)})),c.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),E.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}function v(t){o=t,E.setContext(n),E.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}function A(t){for(var e=n.inputSources,r=0;r=0){var c=i[s];if(void 0!==c){var l=c.normalized,h=c.itemSize;if(void 0===(x=w.get(c)))continue;var p=x.buffer,g=x.type,m=x.bytesPerElement;if(c.isInterleavedBufferAttribute){var A=c.data,_=A.stride,b=c.offset;A&&A.isInstancedInterleavedBuffer?(v.enableAttributeAndDivisor(u,A.meshPerAttribute),void 0===e._maxInstanceCount&&(e._maxInstanceCount=A.meshPerAttribute*A.count)):v.enableAttribute(u),d.bindBuffer(34962,p),v.vertexAttribPointer(u,h,g,l,_*m,b*m)}else c.isInstancedBufferAttribute?(v.enableAttributeAndDivisor(u,c.meshPerAttribute),void 0===e._maxInstanceCount&&(e._maxInstanceCount=c.meshPerAttribute*c.count)):v.enableAttribute(u),d.bindBuffer(34962,p),v.vertexAttribPointer(u,h,g,l,0,0)}else if("instanceMatrix"===s){var x;if(void 0===(x=w.get(t.instanceMatrix)))continue;p=x.buffer,g=x.type,v.enableAttributeAndDivisor(u+0,1),v.enableAttributeAndDivisor(u+1,1),v.enableAttributeAndDivisor(u+2,1),v.enableAttributeAndDivisor(u+3,1),d.bindBuffer(34962,p),d.vertexAttribPointer(u+0,4,g,!1,64,0),d.vertexAttribPointer(u+1,4,g,!1,64,16),d.vertexAttribPointer(u+2,4,g,!1,64,32),d.vertexAttribPointer(u+3,4,g,!1,64,48)}else if(void 0!==a){var C=a[s];if(void 0!==C)switch(C.length){case 2:d.vertexAttrib2fv(u,C);break;case 3:d.vertexAttrib3fv(u,C);break;case 4:d.vertexAttrib4fv(u,C);break;default:d.vertexAttrib1fv(u,C)}}}}v.disableUnusedAttributes()}}(i,r,n,s),null!==c&&d.bindBuffer(34963,h.buffer));var m=null!==c?c.count:l.count,A=r.drawRange.start*p,_=r.drawRange.count*p,b=null!==o?o.start*p:0,x=null!==o?o.count*p:1/0,E=Math.max(A,b),I=Math.min(m,A+_,b+x)-1,M=Math.max(0,I-E+1);if(0!==M){if(i.isMesh)!0===n.wireframe?(v.setLineWidth(n.wireframeLinewidth*pt()),g.setMode(1)):g.setMode(4);else if(i.isLine){var S=n.linewidth;void 0===S&&(S=1),v.setLineWidth(S*pt()),i.isLineSegments?g.setMode(1):i.isLineLoop?g.setMode(2):g.setMode(3)}else i.isPoints?g.setMode(0):i.isSprite&&g.setMode(4);if(i.isInstancedMesh)g.renderInstances(r,E,M,i.count);else if(r.isInstancedBufferGeometry){var T=Math.min(r.instanceCount,r._maxInstanceCount);g.renderInstances(r,E,M,T)}else g.render(E,M)}},this.compile=function(t,e){(p=P.get(t,e)).init(),t.traverse((function(t){t.isLight&&(p.pushLight(t),t.castShadow&&p.pushShadow(t))})),p.setupLights(e);var r={};t.traverse((function(e){var n=e.material;if(n)if(Array.isArray(n))for(var i=0;i=0&&t.numSupportedMorphTargets++}if(t.morphNormals)for(t.numSupportedMorphNormals=0,d=0;d=0&&t.numSupportedMorphNormals++;var f=n.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=st.numPlanes,n.numIntersection=st.numIntersection,f.clippingPlanes=st.uniform),n.environment=t.isMeshStandardMaterial?e.environment:null,n.fog=e.fog,n.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),n.lightsStateVersion=a,n.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.directionalLightShadows.value=i.state.directionalShadow,f.spotLights.value=i.state.spot,f.spotLightShadows.value=i.state.spotShadow,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.pointLightShadows.value=i.state.pointShadow,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var g=n.program.getUniforms(),m=_n.seqWithValue(g.seq,f);n.uniformsList=m}function St(t,e,r,n){x.resetTextureUnits();var i=e.fog,o=r.isMeshStandardMaterial?e.environment:null,a=null===G?N.outputEncoding:G.texture.encoding,s=_.get(r),u=p.state.lights;if(ut&&(ct||t!==q)){var c=t===q&&r.id===V;st.setState(r.clippingPlanes,r.clipIntersection,r.clipShadows,t,s,c)}r.version===s.__version?void 0===s.program||r.fog&&s.fog!==i||s.environment!==o||s.needsLights&&s.lightsStateVersion!==u.state.version?Mt(r,e,n):void 0===s.numClippingPlanes||s.numClippingPlanes===st.numPlanes&&s.numIntersection===st.numIntersection?s.outputEncoding!==a&&Mt(r,e,n):Mt(r,e,n):(Mt(r,e,n),s.__version=r.version);var l,h,f=!1,m=!1,A=!1,b=s.program,w=b.getUniforms(),C=s.uniforms;if(v.useProgram(b.program)&&(f=!0,m=!0,A=!0),r.id!==V&&(V=r.id,m=!0),f||q!==t){if(w.setValue(d,"projectionMatrix",t.projectionMatrix),y.logarithmicDepthBuffer&&w.setValue(d,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),q!==t&&(q=t,m=!0,A=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){var E=w.map.cameraPosition;void 0!==E&&E.setValue(d,ht.setFromMatrixPosition(t.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&w.setValue(d,"isOrthographic",!0===t.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.skinning)&&w.setValue(d,"viewMatrix",t.matrixWorldInverse)}if(r.skinning){w.setOptional(d,n,"bindMatrix"),w.setOptional(d,n,"bindMatrixInverse");var I=n.skeleton;if(I){var M=I.bones;if(y.floatVertexTextures){if(void 0===I.boneTexture){var T=Math.sqrt(4*M.length);T=g.ceilPowerOfTwo(T),T=Math.max(T,4);var P=new Float32Array(T*T*4);P.set(I.boneMatrices);var O=new tr(P,T,T,1023,1015);I.boneMatrices=P,I.boneTexture=O,I.boneTextureSize=T}w.setValue(d,"boneTexture",I.boneTexture,x),w.setValue(d,"boneTextureSize",I.boneTextureSize)}else w.setOptional(d,I,"boneMatrices")}}return(m||s.receiveShadow!==n.receiveShadow)&&(s.receiveShadow=n.receiveShadow,w.setValue(d,"receiveShadow",n.receiveShadow)),m&&(w.setValue(d,"toneMappingExposure",N.toneMappingExposure),w.setValue(d,"toneMappingWhitePoint",N.toneMappingWhitePoint),s.needsLights&&(h=A,(l=C).ambientLightColor.needsUpdate=h,l.lightProbe.needsUpdate=h,l.directionalLights.needsUpdate=h,l.directionalLightShadows.needsUpdate=h,l.pointLights.needsUpdate=h,l.pointLightShadows.needsUpdate=h,l.spotLights.needsUpdate=h,l.spotLightShadows.needsUpdate=h,l.rectAreaLights.needsUpdate=h,l.hemisphereLights.needsUpdate=h),i&&r.fog&&S.refreshFogUniforms(C,i),S.refreshMaterialUniforms(C,r,o,$,J),void 0!==C.ltc_1&&(C.ltc_1.value=ir.LTC_1),void 0!==C.ltc_2&&(C.ltc_2.value=ir.LTC_2),_n.upload(d,s.uniformsList,C,x)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(_n.upload(d,s.uniformsList,C,x),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&w.setValue(d,"center",n.center),w.setValue(d,"modelViewMatrix",n.modelViewMatrix),w.setValue(d,"normalMatrix",n.normalMatrix),w.setValue(d,"modelMatrix",n.matrixWorld),b}wt.setAnimationLoop((function(t){gt.isPresenting||xt&&xt(t)})),"undefined"!=typeof window&&wt.setContext(window),this.setAnimationLoop=function(t){xt=t,gt.setAnimationLoop(t),wt.start()},this.render=function(t,e){var r,n;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),r=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),n=arguments[3]),e&&e.isCamera){if(!F){Q.geometry=null,Q.program=null,Q.wireframe=!1,V=-1,q=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),gt.enabled&>.isPresenting&&(e=gt.getCamera(e)),t.onBeforeRender(N,t,e,r||G),(p=P.get(t,e)).init(),lt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),at.setFromProjectionMatrix(lt),ct=this.localClippingEnabled,ut=st.init(this.clippingPlanes,ct,e),(h=T.get(t,e)).init(),Ct(t,e,0,N.sortObjects),h.finish(),!0===N.sortObjects&&h.sort(et,rt),ut&&st.beginShadows();var i=p.state.shadowsArray;mt.render(i,t,e),p.setupLights(e),ut&&st.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==r&&this.setRenderTarget(r),O.render(h,t,e,n);var o=h.opaque,a=h.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&Et(o,t,e,s),a.length&&Et(a,t,e,s)}else o.length&&Et(o,t,e),a.length&&Et(a,t,e);t.onAfterRender(N,t,e),null!==G&&(x.updateRenderTargetMipmap(G),x.updateMultisampleRenderTarget(G)),v.buffers.depth.setTest(!0),v.buffers.depth.setMask(!0),v.buffers.color.setMask(!0),v.setPolygonOffset(!1),h=null,p=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){j!==t&&null===G&&d.bindFramebuffer(36160,t),j=t},this.getActiveCubeFace=function(){return z},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return G},this.setRenderTarget=function(t,e,r){G=t,z=e,U=r,t&&void 0===_.get(t).__webglFramebuffer&&x.setupRenderTarget(t);var n=j,i=!1;if(t){var o=_.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=o[e||0],i=!0):n=t.isWebGLMultisampleRenderTarget?_.get(t).__webglMultisampledFramebuffer:o,Y.copy(t.viewport),X.copy(t.scissor),Z=t.scissorTest}else Y.copy(nt).multiplyScalar($).floor(),X.copy(it).multiplyScalar($).floor(),Z=ot;if(H!==n&&(d.bindFramebuffer(36160,n),H=n),v.viewport(Y),v.scissor(X),v.setScissorTest(Z),i){var a=_.get(t.texture);d.framebufferTexture2D(36160,36064,34069+(e||0),a.__webglTexture,r||0)}},this.readRenderTargetPixels=function(t,e,r,n,i,o,a){if(t&&t.isWebGLRenderTarget){var s=_.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var u=!1;s!==H&&(d.bindFramebuffer(36160,s),u=!0);try{var c=t.texture,l=c.format,h=c.type;if(1023!==l&&B.convert(l)!==d.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===h||B.convert(h)===d.getParameter(35738)||1015===h&&(y.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||1016===h&&(y.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===d.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&r>=0&&r<=t.height-i&&d.readPixels(e,r,n,i,B.convert(l),B.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{u&&d.bindFramebuffer(36160,H)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,r){void 0===r&&(r=0);var n=Math.pow(2,-r),i=Math.floor(e.image.width*n),o=Math.floor(e.image.height*n),a=B.convert(e.format);x.setTexture2D(e,0),d.copyTexImage2D(3553,r,a,t.x,t.y,i,o,0),v.unbindTexture()},this.copyTextureToTexture=function(t,e,r,n){void 0===n&&(n=0);var i=e.image.width,o=e.image.height,a=B.convert(r.format),s=B.convert(r.type);x.setTexture2D(r,0),e.isDataTexture?d.texSubImage2D(3553,n,t.x,t.y,i,o,a,s,e.image.data):e.isCompressedTexture?d.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):d.texSubImage2D(3553,n,t.x,t.y,a,s,e.image),0===n&&r.generateMipmaps&&d.generateMipmap(3553),v.unbindTexture()},this.initTexture=function(t){x.setTexture2D(t,0),v.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function li(t,e){this.name="",this.color=new Vt(t),this.density=void 0!==e?e:25e-5}function hi(t,e,r){this.name="",this.color=new Vt(t),this.near=void 0!==e?e:1,this.far=void 0!==r?r:1e3}function pi(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}Jn.prototype=Object.create(Zt.prototype),Jn.prototype.constructor=Jn,Jn.prototype.isMeshDepthMaterial=!0,Jn.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},$n.prototype=Object.create(Zt.prototype),$n.prototype.constructor=$n,$n.prototype.isMeshDistanceMaterial=!0,$n.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},ii.prototype=Object.assign(Object.create(Ke.prototype),{constructor:ii,isArrayCamera:!0}),oi.prototype=Object.assign(Object.create($.prototype),{constructor:oi,isGroup:!0}),Object.assign(ai.prototype,{constructor:ai,getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new oi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new oi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),this},update:function(t,e,r){var n=null,i=null,o=this._targetRay,a=this._grip;return t&&(null!==o&&null!==(n=e.getPose(t.targetRaySpace,r))&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)),null!==a&&t.gripSpace&&null!==(i=e.getPose(t.gripSpace,r))&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==i),this}}),Object.assign(si.prototype,h.prototype),Object.assign(li.prototype,{isFogExp2:!0,clone:function(){return new li(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(hi.prototype,{isFog:!0,clone:function(){return new hi(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(pi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(pi.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,r){t*=this.stride,r*=e.stride;for(var n=0,i=this.stride;nt.far||e.push({distance:s,point:yi.clone(),uv:zt.getUV(yi,wi,Ci,Ei,Ii,Mi,Si,new m),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return $.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var Oi,Li,ki,Ri,Di,Bi=new M,Ni=new M;function Fi(){$.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function ji(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Be.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new D,this.bindMatrixInverse=new D}Fi.prototype=Object.assign(Object.create($.prototype),{constructor:Fi,isLOD:!0,copy:function(t){$.prototype.copy.call(this,t,!1);for(var e=t.levels,r=0,n=e.length;r0){for(var r=1,n=e.length;r0){Bi.setFromMatrixPosition(this.matrixWorld);var r=t.ray.origin.distanceTo(Bi);this.getObjectForDistance(r).raycast(t,e)}},update:function(t){var e=this.levels;if(e.length>1){Bi.setFromMatrixPosition(t.matrixWorld),Ni.setFromMatrixPosition(this.matrixWorld);var r=Bi.distanceTo(Ni)/t.zoom;e[0].object.visible=!0;for(var n=1,i=e.length;n=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;na||(l.applyMatrix4(this.matrixWorld),(b=t.ray.origin.distanceTo(l))t.far||e.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else for(g=0,m=d.length/3-1;ga||(l.applyMatrix4(this.matrixWorld),(b=t.ray.origin.distanceTo(l))t.far||e.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(r.isGeometry){var A=r.vertices,_=A.length;for(g=0;g<_-1;g+=h){var b;$i.distanceSqToSegment(A[g],A[g+1],l,c)>a||(l.applyMatrix4(this.matrixWorld),(b=t.ray.origin.distanceTo(l))t.far||e.push({distance:b,point:c.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}},updateMorphTargets:function(){var t,e,r,n=this.geometry;if(n.isBufferGeometry){var i=n.morphAttributes,o=Object.keys(i);if(o.length>0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ro=new M,no=new M;function io(t,e){eo.call(this,t,e),this.type="LineSegments"}function oo(t,e){eo.call(this,t,e),this.type="LineLoop"}function ao(t){Zt.call(this),this.type="PointsMaterial",this.color=new Vt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}io.prototype=Object.assign(Object.create(eo.prototype),{constructor:io,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,r=[],n=0,i=e.count;ni.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:u,index:e,face:null,object:a})}}function fo(t,e,r,n,i,o,a,s,u){_.call(this,t,e,r,n,i,o,a,s,u),this.format=void 0!==a?a:1022,this.minFilter=void 0!==o?o:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1}function go(t,e,r,n,i,o,a,s,u,c,l,h){_.call(this,null,o,a,s,u,c,n,i,l,h),this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function mo(t,e,r,n,i,o,a,s,u){_.call(this,t,e,r,n,i,o,a,s,u),this.needsUpdate=!0}function yo(t,e,r,n,i,o,a,s,u,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&1026===c&&(r=1012),void 0===r&&1027===c&&(r=1020),_.call(this,null,n,i,o,a,s,c,r,u),this.image={width:t,height:e},this.magFilter=void 0!==a?a:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}function vo(t){ve.call(this),this.type="WireframeGeometry";var e,r,n,i,o,a,s,u,c,l,h=[],p=[0,0],d={},f=["a","b","c"];if(t&&t.isGeometry){var g=t.faces;for(e=0,n=g.length;e=0?(t(y-c,m,p),d.subVectors(h,p)):(t(y+c,m,p),d.subVectors(p,h)),m-c>=0?(t(y,m-c,p),f.subVectors(h,p)):(t(y,m+c,p),f.subVectors(p,h)),l.crossVectors(d,f).normalize(),s.push(l.x,l.y,l.z),u.push(y,m)}}for(n=0;n.9&&a<.1&&(e<.2&&(o[t+0]+=1),r<.2&&(o[t+2]+=1),n<.2&&(o[t+4]+=1))}}()}(),this.setAttribute("position",new se(i,3)),this.setAttribute("normal",new se(i.slice(),3)),this.setAttribute("uv",new se(o,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function wo(t,e){He.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Co(t,e)),this.mergeVertices()}function Co(t,e){xo.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Eo(t,e){He.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Io(t,e)),this.mergeVertices()}function Io(t,e){xo.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Mo(t,e){He.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new So(t,e)),this.mergeVertices()}function So(t,e){var r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1];xo.call(this,n,[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],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function To(t,e){He.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Po(t,e)),this.mergeVertices()}function Po(t,e){var r=(1+Math.sqrt(5))/2,n=1/r,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n];xo.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Oo(t,e,r,n,i,o){He.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:r,radialSegments:n,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Lo(t,e,r,n,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Lo(t,e,r,n,i){ve.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:r,radialSegments:n,closed:i},e=e||64,r=r||1,n=n||8,i=i||!1;var o=t.computeFrenetFrames(e,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,u=new M,c=new M,l=new m,h=new M,p=[],d=[],f=[],g=[];function y(i){h=t.getPointAt(i/e,h);var a=o.normals[i],l=o.binormals[i];for(s=0;s<=n;s++){var f=s/n*Math.PI*2,g=Math.sin(f),m=-Math.cos(f);c.x=m*a.x+g*l.x,c.y=m*a.y+g*l.y,c.z=m*a.z+g*l.z,c.normalize(),d.push(c.x,c.y,c.z),u.x=h.x+r*c.x,u.y=h.y+r*c.y,u.z=h.z+r*c.z,p.push(u.x,u.y,u.z)}}!function(){for(a=0;a0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),fo.prototype=Object.assign(Object.create(_.prototype),{constructor:fo,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),go.prototype=Object.create(_.prototype),go.prototype.constructor=go,go.prototype.isCompressedTexture=!0,mo.prototype=Object.create(_.prototype),mo.prototype.constructor=mo,mo.prototype.isCanvasTexture=!0,yo.prototype=Object.create(_.prototype),yo.prototype.constructor=yo,yo.prototype.isDepthTexture=!0,vo.prototype=Object.create(ve.prototype),vo.prototype.constructor=vo,Ao.prototype=Object.create(He.prototype),Ao.prototype.constructor=Ao,_o.prototype=Object.create(ve.prototype),_o.prototype.constructor=_o,bo.prototype=Object.create(He.prototype),bo.prototype.constructor=bo,xo.prototype=Object.create(ve.prototype),xo.prototype.constructor=xo,wo.prototype=Object.create(He.prototype),wo.prototype.constructor=wo,Co.prototype=Object.create(xo.prototype),Co.prototype.constructor=Co,Eo.prototype=Object.create(He.prototype),Eo.prototype.constructor=Eo,Io.prototype=Object.create(xo.prototype),Io.prototype.constructor=Io,Mo.prototype=Object.create(He.prototype),Mo.prototype.constructor=Mo,So.prototype=Object.create(xo.prototype),So.prototype.constructor=So,To.prototype=Object.create(He.prototype),To.prototype.constructor=To,Po.prototype=Object.create(xo.prototype),Po.prototype.constructor=Po,Oo.prototype=Object.create(He.prototype),Oo.prototype.constructor=Oo,Lo.prototype=Object.create(ve.prototype),Lo.prototype.constructor=Lo,Lo.prototype.toJSON=function(){var t=ve.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},ko.prototype=Object.create(He.prototype),ko.prototype.constructor=ko,Ro.prototype=Object.create(ve.prototype),Ro.prototype.constructor=Ro,Do.prototype=Object.create(He.prototype),Do.prototype.constructor=Do,Bo.prototype=Object.create(ve.prototype),Bo.prototype.constructor=Bo;function No(t,e,r,n,i){var o,a;if(i===function(t,e,r,n){for(var i=0,o=e,a=r-n;o0)for(o=e;o=e;o-=n)a=ia(o,t[o],t[o+1],a);return a&&Jo(a,a.next)&&(oa(a),a=a.next),a}function Fo(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Jo(n,n.next)&&0!==Ko(n.prev,n,n.next))n=n.next;else{if(oa(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function jo(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Wo(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Uo(t,n,i,o):zo(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),oa(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?jo(t=Go(Fo(t),e,r),e,r,n,i,o,2):2===a&&Ho(t,e,r,n,i,o):jo(Fo(t),e,r,n,i,o,1);break}}}function zo(t){var e=t.prev,r=t,n=t.next;if(Ko(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Xo(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Ko(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Uo(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Ko(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=Wo(s,u,e,r,n),p=Wo(c,l,e,r,n),d=t.prevZ,f=t.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&Xo(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Ko(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==t.prev&&f!==t.next&&Xo(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ko(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&Xo(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Ko(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&Xo(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Ko(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Go(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Jo(i,o)&&$o(i,n,n.next,o)&&ra(i,o)&&ra(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),oa(n),oa(n.next),n=t=o),n=n.next}while(n!==t);return Fo(n)}function Ho(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Zo(a,s)){var u=na(a,s);return a=Fo(a,a.next),u=Fo(u,u.next),jo(a,e,r,n,i,o),void jo(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function Vo(t,e){return t.x-e.x}function Qo(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&&Xo(or.x||n.x===r.x&&qo(r,n)))&&(r=n,p=u)),n=n.next}while(n!==c);return r}(t,e)){var r=na(e,t);Fo(e,e.next),Fo(r,r.next)}}function qo(t,e){return Ko(t.prev,t,e.prev)<0&&Ko(e.next,t,t.next)<0}function Wo(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Yo(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function Zo(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&$o(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(ra(t,e)&&ra(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Ko(t.prev,t,e.prev)||Ko(t,e.prev,e))||Jo(t,e)&&Ko(t.prev,t,t.next)>0&&Ko(e.prev,e,e.next)>0)}function Ko(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Jo(t,e){return t.x===e.x&&t.y===e.y}function $o(t,e,r,n){var i=ea(Ko(t,e,r)),o=ea(Ko(t,e,n)),a=ea(Ko(r,n,t)),s=ea(Ko(r,n,e));return i!==o&&a!==s||!(0!==i||!ta(t,r,e))||!(0!==o||!ta(t,n,e))||!(0!==a||!ta(r,t,n))||!(0!==s||!ta(r,e,n))}function ta(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function ea(t){return t>0?1:t<0?-1:0}function ra(t,e){return Ko(t.prev,t,t.next)<0?Ko(t,e,t.next)>=0&&Ko(t,t.prev,e)>=0:Ko(t,e,t.prev)<0||Ko(t,t.next,e)<0}function na(t,e){var r=new aa(t.i,t.x,t.y),n=new aa(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function ia(t,e,r,n){var i=new aa(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function oa(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function aa(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var sa={area:function(t){for(var e=t.length,r=0,n=e-1,i=0;i80*r){n=o=t[0],i=a=t[1];for(var f=r;fo&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-n,a-i))?1/c:0}return jo(p,d,r,n,i,c),d}(r,n);for(a=0;a2&&t[e-1].equals(t[0])&&t.pop()}function ca(t,e){for(var r=0;rNumber.EPSILON){var p=Math.sqrt(l),d=Math.sqrt(u*u+c*c),f=e.x-s/p,g=e.y+a/p,y=((r.x-c/d-f)*c-(r.y+u/d-g)*u)/(a*c-s*u),v=(n=f+a*y-t.x)*n+(i=g+s*y-t.y)*i;if(v<=2)return new m(n,i);o=Math.sqrt(v/2)}else{var A=!1;a>Number.EPSILON?u>Number.EPSILON&&(A=!0):a<-Number.EPSILON?u<-Number.EPSILON&&(A=!0):Math.sign(s)===Math.sign(c)&&(A=!0),A?(n=-s,i=a,o=Math.sqrt(l)):(n=a,i=s,o=Math.sqrt(l/2))}return new m(n/o,i/o)}for(var G=[],H=0,V=O.length,Q=V-1,q=H+1;H=0;k--){for(D=k/d,B=l*Math.cos(D*Math.PI/2),R=h*Math.sin(D*Math.PI/2)+p,H=0,V=O.length;H=0;){r=H,(n=H-1)<0&&(n=t.length-1);var i=0,o=s+2*d;for(i=0;i0)&&f.push(x,w,E),(u!==r-1||c0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new se(l,3)),this.setAttribute("normal",new se(h,3)),this.setAttribute("uv",new se(p,2))}function Sa(t,e,r,n,i,o,a){Ia.call(this,0,t,e,r,n,i,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:o,thetaLength:a}}function Ta(t,e,r,n,i,o,a){Ma.call(this,0,t,e,r,n,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:o,thetaLength:a}}function Pa(t,e,r,n){He.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:n},this.fromBufferGeometry(new Oa(t,e,r,n)),this.mergeVertices()}function Oa(t,e,r,n){ve.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:n},t=t||1,e=void 0!==e?Math.max(3,e):8,r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI;var i,o,a=[],s=[],u=[],c=[],l=new M,h=new m;for(s.push(0,0,0),u.push(0,0,1),c.push(.5,.5),o=0,i=3;o<=e;o++,i+=3){var p=r+o/e*n;l.x=t*Math.cos(p),l.y=t*Math.sin(p),s.push(l.x,l.y,l.z),u.push(0,0,1),h.x=(s[i]/t+1)/2,h.y=(s[i+1]/t+1)/2,c.push(h.x,h.y)}for(i=1;i<=e;i++)a.push(i,i+1,0);this.setIndex(a),this.setAttribute("position",new se(s,3)),this.setAttribute("normal",new se(u,3)),this.setAttribute("uv",new se(c,2))}fa.prototype=Object.create(He.prototype),fa.prototype.constructor=fa,ga.prototype=Object.create(ha.prototype),ga.prototype.constructor=ga,ma.prototype=Object.create(He.prototype),ma.prototype.constructor=ma,ya.prototype=Object.create(ve.prototype),ya.prototype.constructor=ya,va.prototype=Object.create(He.prototype),va.prototype.constructor=va,Aa.prototype=Object.create(ve.prototype),Aa.prototype.constructor=Aa,_a.prototype=Object.create(He.prototype),_a.prototype.constructor=_a,ba.prototype=Object.create(ve.prototype),ba.prototype.constructor=ba,xa.prototype=Object.create(He.prototype),xa.prototype.constructor=xa,xa.prototype.toJSON=function(){var t=He.prototype.toJSON.call(this);return Ca(this.parameters.shapes,t)},wa.prototype=Object.create(ve.prototype),wa.prototype.constructor=wa,wa.prototype.toJSON=function(){var t=ve.prototype.toJSON.call(this);return Ca(this.parameters.shapes,t)},Ea.prototype=Object.create(ve.prototype),Ea.prototype.constructor=Ea,Ia.prototype=Object.create(He.prototype),Ia.prototype.constructor=Ia,Ma.prototype=Object.create(ve.prototype),Ma.prototype.constructor=Ma,Sa.prototype=Object.create(Ia.prototype),Sa.prototype.constructor=Sa,Ta.prototype=Object.create(Ma.prototype),Ta.prototype.constructor=Ta,Pa.prototype=Object.create(He.prototype),Pa.prototype.constructor=Pa,Oa.prototype=Object.create(ve.prototype),Oa.prototype.constructor=Oa;var La=Object.freeze({__proto__:null,WireframeGeometry:vo,ParametricGeometry:Ao,ParametricBufferGeometry:_o,TetrahedronGeometry:wo,TetrahedronBufferGeometry:Co,OctahedronGeometry:Eo,OctahedronBufferGeometry:Io,IcosahedronGeometry:Mo,IcosahedronBufferGeometry:So,DodecahedronGeometry:To,DodecahedronBufferGeometry:Po,PolyhedronGeometry:bo,PolyhedronBufferGeometry:xo,TubeGeometry:Oo,TubeBufferGeometry:Lo,TorusKnotGeometry:ko,TorusKnotBufferGeometry:Ro,TorusGeometry:Do,TorusBufferGeometry:Bo,TextGeometry:fa,TextBufferGeometry:ga,SphereGeometry:ma,SphereBufferGeometry:ya,RingGeometry:va,RingBufferGeometry:Aa,PlaneGeometry:sr,PlaneBufferGeometry:ur,LatheGeometry:_a,LatheBufferGeometry:ba,ShapeGeometry:xa,ShapeBufferGeometry:wa,ExtrudeGeometry:la,ExtrudeBufferGeometry:ha,EdgesGeometry:Ea,ConeGeometry:Sa,ConeBufferGeometry:Ta,CylinderGeometry:Ia,CylinderBufferGeometry:Ma,CircleGeometry:Pa,CircleBufferGeometry:Oa,BoxGeometry:Ve,BoxBufferGeometry:Qe});function ka(t){Zt.call(this),this.type="ShadowMaterial",this.color=new Vt(0),this.transparent=!0,this.setValues(t)}function Ra(t){Xe.call(this,t),this.type="RawShaderMaterial"}function Da(t){Zt.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Vt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function Ba(t){Da.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new m(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function Na(t){Zt.call(this),this.type="MeshPhongMaterial",this.color=new Vt(16777215),this.specular=new Vt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Fa(t){Zt.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Vt(16777215),this.specular=new Vt(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ja(t){Zt.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function za(t){Zt.call(this),this.type="MeshLambertMaterial",this.color=new Vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ua(t){Zt.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Vt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new m(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ga(t){Xi.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}ka.prototype=Object.create(Zt.prototype),ka.prototype.constructor=ka,ka.prototype.isShadowMaterial=!0,ka.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this},Ra.prototype=Object.create(Xe.prototype),Ra.prototype.constructor=Ra,Ra.prototype.isRawShaderMaterial=!0,Da.prototype=Object.create(Zt.prototype),Da.prototype.constructor=Da,Da.prototype.isMeshStandardMaterial=!0,Da.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},Ba.prototype=Object.create(Da.prototype),Ba.prototype.constructor=Ba,Ba.prototype.isMeshPhysicalMaterial=!0,Ba.prototype.copy=function(t){return Da.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new Vt).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},Na.prototype=Object.create(Zt.prototype),Na.prototype.constructor=Na,Na.prototype.isMeshPhongMaterial=!0,Na.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Fa.prototype=Object.create(Zt.prototype),Fa.prototype.constructor=Fa,Fa.prototype.isMeshToonMaterial=!0,Fa.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},ja.prototype=Object.create(Zt.prototype),ja.prototype.constructor=ja,ja.prototype.isMeshNormalMaterial=!0,ja.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},za.prototype=Object.create(Zt.prototype),za.prototype.constructor=za,za.prototype.isMeshLambertMaterial=!0,za.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Ua.prototype=Object.create(Zt.prototype),Ua.prototype.constructor=Ua,Ua.prototype.isMeshMatcapMaterial=!0,Ua.prototype.copy=function(t){return Zt.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Ga.prototype=Object.create(Xi.prototype),Ga.prototype.constructor=Ga,Ga.prototype.isLineDashedMaterial=!0,Ga.prototype.copy=function(t){return Xi.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Ha=Object.freeze({__proto__:null,ShadowMaterial:ka,SpriteMaterial:mi,RawShaderMaterial:Ra,ShaderMaterial:Xe,PointsMaterial:ao,MeshPhysicalMaterial:Ba,MeshStandardMaterial:Da,MeshPhongMaterial:Na,MeshToonMaterial:Fa,MeshNormalMaterial:ja,MeshLambertMaterial:za,MeshDepthMaterial:Jn,MeshDistanceMaterial:$n,MeshBasicMaterial:Kt,MeshMatcapMaterial:Ua,LineDashedMaterial:Ga,LineBasicMaterial:Xi,Material:Zt}),Va={arraySlice:function(t,e,r){return Va.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==r?r:t.length)):t.slice(e,r)},convertArray:function(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(0,l.default)(t,DataView)},getKeyframeOrder:function(t){for(var e=t.length,r=new Array(e),n=0;n!==e;++n)r[n]=n;return r.sort((function(e,r){return t[e]-t[r]})),r},sortedArray:function(t,e,r){for(var n=t.length,i=new t.constructor(n),o=0,a=0;a!==n;++o)for(var s=r[o]*e,u=0;u!==e;++u)i[a++]=t[s+u];return i},flattenJSON:function(t,e,r,n){for(var i=1,o=t[0];void 0!==o&&void 0===o[n];)o=t[i++];if(void 0!==o){var a=o[n];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[n])&&(e.push(o.time),r.push.apply(r,a)),o=t[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[n])&&(e.push(o.time),a.toArray(r,r.length)),o=t[i++]}while(void 0!==o);else do{void 0!==(a=o[n])&&(e.push(o.time),r.push(a)),o=t[i++]}while(void 0!==o)}},subclip:function(t,e,r,n,i){i=i||30;var o=t.clone();o.name=e;for(var a=[],s=0;s=n)){l.push(u.times[p]);for(var f=0;fo.tracks[s].times[0]&&(g=o.tracks[s].times[0]);for(s=0;s=s.times[p]){var d=p*h;l=Va.arraySlice(s.values,d)}else{var f=s.createInterpolant();f.evaluate(o),l=f.resultBuffer}"quaternion"===u&&new C(l[0],l[1],l[2],l[3]).normalize().conjugate().toArray(l);for(var g=c.times.length,m=0;m=i)break t;var s=e[1];for(t=(i=e[--r-1]))break e}o=r,r=0}for(;r>>1;te;)--o;if(++o,0!==i||o!==n){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Va.arraySlice(r,i,o),this.values=Va.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==i;a++){var s=r[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==n&&Va.isTypedArray(n)){a=0;for(var u=n.length;a!==u;++a){var c=n[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),t=!1;break}}}return t},optimize:function(){for(var t=Va.arraySlice(this.times),e=Va.arraySlice(this.values),r=this.getValueSize(),n=2302===this.getInterpolation(),i=1,o=t.length-1,a=1;a0){for(t[i]=t[o],f=o*r,g=i*r,p=0;p!==r;++p)e[g+p]=e[f+p];++i}return i!==t.length?(this.times=Va.arraySlice(t,0,i),this.values=Va.arraySlice(e,0,i*r)):(this.times=t,this.values=e),this},clone:function(){var t=Va.arraySlice(this.times,0),e=Va.arraySlice(this.values,0),r=new(0,this.constructor)(this.name,t,e);return r.createInterpolant=this.createInterpolant,r}}),Za.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Za,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ka.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Ka,ValueTypeName:"color"}),Ja.prototype=Object.assign(Object.create(Xa.prototype),{constructor:Ja,ValueTypeName:"number"}),$a.prototype=Object.assign(Object.create(Qa.prototype),{constructor:$a,interpolate_:function(t,e,r,n){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,u=(r-e)/(n-e),c=s+a;s!==c;s+=4)C.slerpFlat(i,0,o,s-a,o,s,u);return i}}),ts.prototype=Object.assign(Object.create(Xa.prototype),{constructor:ts,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new $a(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),es.prototype=Object.assign(Object.create(Xa.prototype),{constructor:es,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),rs.prototype=Object.assign(Object.create(Xa.prototype),{constructor:rs,ValueTypeName:"vector"}),Object.assign(ns,{parse:function(t){for(var e=[],r=t.tracks,n=1/(t.fps||1),i=0,o=r.length;i!==o;++i)e.push(is(r[i]).scale(n));return new ns(t.name,t.duration,e,t.blendMode)},toJSON:function(t){for(var e=[],r=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode},i=0,o=r.length;i!==o;++i)e.push(Xa.toJSON(r[i]));return n},CreateFromMorphTargetSequence:function(t,e,r,n){for(var i=e.length,o=[],a=0;a1){var c=n[h=u[1]];c||(n[h]=c=[]),c.push(s)}}var l=[];for(var h in n)l.push(ns.CreateFromMorphTargetSequence(h,n[h],e,r));return l},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var r=function(t,e,r,n,i){if(0!==r.length){var o=[],a=[];Va.flattenJSON(r,o,a,n),0!==o.length&&i.push(new t(e,o,a))}},n=[],i=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.blendMode,u=t.hierarchy||[],c=0;c0||0===t.search(/^data\:image\/jpeg/);i.format=n?1022:1023,i.needsUpdate=!0,void 0!==e&&e(i)}),r,n),i}}),Object.assign(ys.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var r=this.getUtoTmapping(t);return this.getPoint(r,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],r=0;r<=t;r++)e.push(this.getPoint(r/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],r=0;r<=t;r++)e.push(this.getPointAt(r/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,r,n=[],i=this.getPoint(0),o=0;for(n.push(0),r=1;r<=t;r++)o+=(e=this.getPoint(r/t)).distanceTo(i),n.push(o),i=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var r,n=this.getLengths(),i=0,o=n.length;r=e||t*n[o-1];for(var a,s=0,u=o-1;s<=u;)if((a=n[i=Math.floor(s+(u-s)/2)]-r)<0)s=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(n[i=u]===r)return i/(o-1);var c=n[i];return(i+(r-c)/(n[i+1]-c))/(o-1)},getTangent:function(t,e){var r=t-1e-4,n=t+1e-4;r<0&&(r=0),n>1&&(n=1);var i=this.getPoint(r),o=this.getPoint(n),a=e||(i.isVector2?new m:new M);return a.copy(o).sub(i).normalize(),a},getTangentAt:function(t,e){var r=this.getUtoTmapping(t);return this.getTangent(r,e)},computeFrenetFrames:function(t,e){var r,n,i,o=new M,a=[],s=[],u=[],c=new M,l=new D;for(r=0;r<=t;r++)n=r/t,a[r]=this.getTangentAt(n,new M),a[r].normalize();s[0]=new M,u[0]=new M;var h=Number.MAX_VALUE,p=Math.abs(a[0].x),d=Math.abs(a[0].y),f=Math.abs(a[0].z);for(p<=h&&(h=p,o.set(1,0,0)),d<=h&&(h=d,o.set(0,1,0)),f<=h&&o.set(0,0,1),c.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],c),u[0].crossVectors(a[0],s[0]),r=1;r<=t;r++)s[r]=s[r-1].clone(),u[r]=u[r-1].clone(),c.crossVectors(a[r-1],a[r]),c.length()>Number.EPSILON&&(c.normalize(),i=Math.acos(g.clamp(a[r-1].dot(a[r]),-1,1)),s[r].applyMatrix4(l.makeRotationAxis(c,i))),u[r].crossVectors(a[r],s[r]);if(!0===e)for(i=Math.acos(g.clamp(s[0].dot(s[t]),-1,1)),i/=t,a[0].dot(c.crossVectors(s[0],s[t]))>0&&(i=-i),r=1;r<=t;r++)s[r].applyMatrix4(l.makeRotationAxis(a[r],i*r)),u[r].crossVectors(a[r],s[r]);return{tangents:a,normals:s,binormals:u}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),vs.prototype=Object.create(ys.prototype),vs.prototype.constructor=vs,vs.prototype.isEllipseCurve=!0,vs.prototype.getPoint=function(t,e){for(var r=e||new m,n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)n;)i-=n;i0?0:(Math.floor(Math.abs(l)/u)+1)*u:0===h&&l===u-1&&(l=u-2,h=1),this.closed||l>0?r=s[(l-1)%u]:(bs.subVectors(s[0],s[1]).add(s[0]),r=bs),n=s[l%u],i=s[(l+1)%u],this.closed||l+2n.length-2?n.length-1:o+1],l=n[o>n.length-3?n.length-1:o+2];return r.set(Is(a,s.x,u.x,c.x,l.x),Is(a,s.y,u.y,c.y,l.y)),r},Ds.prototype.copy=function(t){ys.prototype.copy.call(this,t),this.points=[];for(var e=0,r=t.points.length;e=e){var i=r[n]-e,o=this.curves[n],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}n++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,r=0,n=this.curves.length;r1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},copy:function(t){ys.prototype.copy.call(this,t),this.curves=[];for(var e=0,r=t.curves.length;e0){var c=u.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(u);var l=u.getPoint(1);return this.currentPoint.copy(l),this},copy:function(t){return Ns.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Ns.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Ns.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),js.prototype=Object.assign(Object.create(Fs.prototype),{constructor:js,getPointsHoles:function(t){for(var e=[],r=0,n=this.holes.length;r0:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var i in t.uniforms){var o=t.uniforms[i];switch(n.uniforms[i]={},o.type){case"t":n.uniforms[i].value=r(o.value);break;case"c":n.uniforms[i].value=(new Vt).setHex(o.value);break;case"v2":n.uniforms[i].value=(new m).fromArray(o.value);break;case"v3":n.uniforms[i].value=(new M).fromArray(o.value);break;case"v4":n.uniforms[i].value=(new b).fromArray(o.value);break;case"m3":n.uniforms[i].value=(new y).fromArray(o.value);case"m4":n.uniforms[i].value=(new D).fromArray(o.value);break;default:n.uniforms[i].value=o.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var a in t.extensions)n.extensions[a]=t.extensions[a];if(void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=r(t.map)),void 0!==t.matcap&&(n.matcap=r(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=r(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=r(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=r(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),n.normalScale=(new m).fromArray(s)}return void 0!==t.displacementMap&&(n.displacementMap=r(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=r(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=r(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=r(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=r(t.specularMap)),void 0!==t.envMap&&(n.envMap=r(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=r(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=r(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=r(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=r(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=r(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=r(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new m).fromArray(t.clearcoatNormalScale)),n},setTextures:function(t){return this.textures=t,this}});var eu={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",r=0,n=t.length;r0){var o=new fs(new as(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;aNumber.EPSILON){if(c<0&&(a=e[o],u=-u,s=e[i],c=-c),t.ys.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var l=c*(t.x-a.x)-u*(t.y-a.y);if(0===l)return!0;if(l<0)continue;n=!n}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return n}var i=sa.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return r(o);var a,s,u,c=[];if(1===o.length)return s=o[0],(u=new js).curves=s.curves,c.push(u),c;var l=!i(o[0].getPoints());l=t?!l:l;var h,p,d=[],f=[],g=[],m=0;f[m]=void 0,g[m]=[];for(var y=0,v=o.length;y1){for(var A=!1,_=[],b=0,x=f.length;b0&&(A||(g=d))}y=0;for(var S=f.length;y0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(r,n,this._addIndex*e,1,e);for(var u=e,c=e+e;u!==c;++u)if(r[u]!==r[u+e]){a.setValue(r,n);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,r=this.valueSize,n=r*this._origIndex;t.getValue(e,n);for(var i=r,o=n;i!==o;++i)e[i]=e[n+i%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){for(var t=this._addIndex*this.valueSize,e=t+this.valueSize,r=t;r=.5)for(var o=0;o!==i;++o)t[e+o]=t[r+o]},_slerp:function(t,e,r,n){C.slerpFlat(t,e,t,e,t,r,n)},_slerpAdditive:function(t,e,r,n,i){var o=this._workIndex*i;C.multiplyQuaternionsFlat(t,o,t,e,t,r),C.slerpFlat(t,e,t,e,t,o,n)},_lerp:function(t,e,r,n,i){for(var o=1-n,a=0;a!==i;++a){var s=e+a;t[s]=t[s]*o+t[r+a]*n}},_lerpAdditive:function(t,e,r,n,i){for(var o=0;o!==i;++o){var a=e+o;t[a]=t[a]+t[r+o]*n}}});var Nu=new RegExp("[\\[\\]\\.:\\/]","g"),Fu="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",ju=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),zu=/(WCOD+)?/.source.replace("WCOD",Fu),Uu=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Gu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Hu=new RegExp("^"+ju+zu+Uu+Gu+"$"),Vu=["material","materials","bones"];function Qu(t,e,r){var n=r||qu.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function qu(t,e,r){this.path=e,this.parsedPath=r||qu.parseTrackName(e),this.node=qu.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Wu(){this.uuid=g.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,r=arguments.length;e!==r;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function Yu(t,e,r,n){this._mixer=t,this._clip=e,this._localRoot=r||null,this.blendMode=n||e.blendMode;for(var i=e.tracks,o=i.length,a=new Array(o),s={endingStart:2400,endingEnd:2400},u=0;u!==o;++u){var c=i[u].createInterpolant(null);a[u]=c,c.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Xu(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Zu(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Ku(t,e,r){pi.call(this,t,e),this.meshPerAttribute=r||1}function Ju(t,e,r,n){this.ray=new Et(t,e),this.near=r||0,this.far=n||1/0,this.camera=null,this.layers=new j,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function $u(t,e){return t.distance-e.distance}function tc(t,e,r,n){if(t.layers.test(e.layers)&&t.raycast(e,r),!0===n)for(var i=t.children,o=0,a=i.length;o=e){var l=e++,h=t[l];r[h.uuid]=c,t[c]=h,r[u]=l,t[l]=s;for(var p=0,d=i;p!==d;++p){var f=n[p],g=f[l],m=f[c];f[c]=g,f[l]=m}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,r=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,o=i.length,a=0,s=arguments.length;a!==s;++a){var u=arguments[a],c=u.uuid,l=n[c];if(void 0!==l)if(delete n[c],l0){var u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case 2501:for(var l=0,h=u.length;l!==h;++l)u[l].evaluate(a),c[l].accumulateAdditive(s);break;case 2500:default:for(l=0,h=u.length;l!==h;++l)u[l].evaluate(a),c[l].accumulate(n,s)}}}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var r=this._weightInterpolant;if(null!==r){var n=r.evaluate(t)[0];e*=n,t>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var r=this._timeScaleInterpolant;null!==r&&(e*=r.evaluate(t)[0],t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e))}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,r=this._clip.duration,n=this.loop,i=this._loopCount,o=2202===n;if(0===t)return-1===i?e:o&&1==(1&i)?r-e:e;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=r)e=r;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=r||e<0){var a=Math.floor(e/r);e-=r*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?r:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var u=t<0;this._setEndings(u,!u,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=e;if(o&&1==(1&i))return r-e}return e},_setEndings:function(t,e,r){var n=this._interpolantSettings;r?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(t,e,r){var n=this._mixer,i=n.time,o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=e,a[1]=i+t,s[1]=r,this}}),Xu.prototype=Object.assign(Object.create(h.prototype),{constructor:Xu,_bindAction:function(t,e){var r=t._localRoot||this._root,n=t._clip.tracks,i=n.length,o=t._propertyBindings,a=t._interpolants,s=r.uuid,u=this._bindingsByRootAndName,c=u[s];void 0===c&&(c={},u[s]=c);for(var l=0;l!==i;++l){var h=n[l],p=h.name,d=c[p];if(void 0!==d)o[l]=d;else{if(void 0!==(d=o[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=e&&e._propertyBindings[l].binding.parsedPath;++(d=new Bu(qu.create(r,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),o[l]=d}a[l].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,r=t._clip.uuid,n=this._actionsByClip[r];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,r,e)}for(var i=t._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,r=0,n=e.length;r!==n;++r){var i=e[r];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;for(var e=this._actions,r=this._nActiveActions,n=this.time+=t,i=Math.sign(t),o=this._accuIndex^=1,a=0;a!==r;++a)e[a]._update(n,t,i,o);var s=this._bindings,u=this._nActiveBindings;for(a=0;a!==u;++a)s[a].apply(o);return this},setTime:function(t){this.time=0;for(var e=0;ethis.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new m),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new m),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return nc.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var oc=new M,ac=new M;function sc(t,e){this.start=void 0!==t?t:new M,this.end=void 0!==e?e:new M}function uc(t){$.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Object.assign(sc.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new M),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new M),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new M),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){oc.subVectors(t,this.start),ac.subVectors(this.end,this.start);var r=ac.dot(ac),n=ac.dot(oc)/r;return e&&(n=g.clamp(n,0,1)),n},closestPointToPoint:function(t,e,r){var n=this.closestPointToPointParameter(t,e);return void 0===r&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),r=new M),this.delta(r).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),uc.prototype=Object.create($.prototype),uc.prototype.constructor=uc,uc.prototype.isImmediateRenderObject=!0;var cc=new M;function lc(t,e){$.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var r=new ve,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,o=1;i<32;i++,o++){var a=i/32*Math.PI*2,s=o/32*Math.PI*2;n.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}r.setAttribute("position",new se(n,3));var u=new Xi({fog:!1,toneMapped:!1});this.cone=new io(r,u),this.add(this.cone),this.update()}lc.prototype=Object.create($.prototype),lc.prototype.constructor=lc,lc.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},lc.prototype.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),cc.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(cc),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var hc=new M,pc=new D,dc=new D;function fc(t){for(var e=function t(e){var r=[];e&&e.isBone&&r.push(e);for(var n=0;n.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Bc.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Bc,e)}},Nc.prototype.setLength=function(t,e,r){void 0===e&&(e=.2*t),void 0===r&&(r=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()},Nc.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Nc.prototype.copy=function(t){return $.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Nc.prototype.clone=function(){return(new this.constructor).copy(this)},Fc.prototype=Object.create(io.prototype),Fc.prototype.constructor=Fc;var jc=Math.pow(2,8),zc=[.125,.215,.35,.446,.526,.582],Uc=5+zc.length,Gc=(i={},(0,a.default)(i,3e3,0),(0,a.default)(i,3001,1),(0,a.default)(i,3002,2),(0,a.default)(i,3004,3),(0,a.default)(i,3005,4),(0,a.default)(i,3006,5),(0,a.default)(i,3007,6),i),Hc=new Ws,Vc=function(){for(var t=[],e=[],r=[],n=8,i=0;i4?a=zc[i-8+4-1]:0==i&&(a=0),r.push(a);for(var s=1/(o-1),u=-s/2,c=1+s/2,l=[u,u,c,u,c,c,u,u,c,c,u,c],h=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var g=f%3*2/3-1,m=f>2?0:-1,y=[g,m,0,g+2/3,m,0,g+2/3,m+1,0,g,m,0,g+2/3,m+1,0,g,m+1,0];h.set(y,18*f),p.set(l,12*f);var v=[f,f,f,f,f,f];d.set(v,6*f)}var A=new ve;A.setAttribute("position",new $t(h,3)),A.setAttribute("uv",new $t(p,2)),A.setAttribute("faceIndex",new $t(d,1)),t.push(A),n>4&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:r}}(),Qc=Vc._lodPlanes,qc=Vc._sizeLods,Wc=Vc._sigmas,Yc=null,Xc=(1+Math.sqrt(5))/2,Zc=1/Xc,Kc=[new M(1,1,1),new M(-1,1,1),new M(1,1,-1),new M(-1,1,-1),new M(0,Xc,Zc),new M(0,Xc,-Zc),new M(Zc,0,Xc),new M(-Zc,0,Xc),new M(Xc,Zc,0),new M(-Xc,Zc,0)];function Jc(t){var e;this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=(20,(e=new Ra({defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(20)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new M(0,1,0)},inputEncoding:{value:Gc[3e3]},outputEncoding:{value:Gc[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t","\n\n#define ENVMAP_TYPE_CUBE_UV\n#include \n\nvec3 getSample(float theta, vec3 axis) {\n\tfloat cosTheta = cos(theta);\n\t// Rodrigues' axis-angle rotation\n\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\tif (all(equal(axis, vec3(0.0))))\n\t\taxis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\taxis = normalize(axis);\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n\tfor (int i = 1; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfloat theta = dTheta * float(i);\n\t\tgl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n\t\tgl_FragColor.rgb += weights[i] * getSample(theta, axis);\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:0,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",e),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function $c(t){return void 0!==t&&1009===t.type&&(3e3===t.encoding||3001===t.encoding||3007===t.encoding)}function tl(t){var e=new x(3*jc,3*jc,t);return e.texture.mapping=306,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function el(t,e,r,n,i){t.viewport.set(e,r,n,i),t.scissor.set(e,r,n,i)}function rl(){var t=new Ra({uniforms:{envMap:{value:null},texelSize:{value:new m(1,1)},inputEncoding:{value:Gc[3e3]},outputEncoding:{value:Gc[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t","\n\n#include \n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv = equirectUv( outputDirection );\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:0,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function nl(){var t=new Ra({uniforms:{envMap:{value:null},inputEncoding:{value:Gc[3e3]},outputEncoding:{value:Gc[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t","\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:0,depthTest:!1,depthWrite:!1});return t.type="CubemapToCubeUV",t}function il(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Es.call(this,t),this.type="catmullrom",this.closed=!0}function ol(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Es.call(this,t),this.type="catmullrom"}function al(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Es.call(this,t),this.type="catmullrom"}Jc.prototype={constructor:Jc,fromScene:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;Yc=this._renderer.getRenderTarget();var i=this._allocateTargets();return this._sceneToCubeUV(t,r,n,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i},fromEquirectangular:function(t){return t.magFilter=1003,t.minFilter=1003,t.generateMipmaps=!1,this.fromCubemap(t)},fromCubemap:function(t){Yc=this._renderer.getRenderTarget();var e=this._allocateTargets(t);return this._textureToCubeUV(t,e),this._applyPMREM(e),this._cleanup(e),e},compileCubemapShader:function(){null===this._cubemapShader&&(this._cubemapShader=nl(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){null===this._equirectShader&&(this._equirectShader=rl(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var t=0;t2?jc:0,jc,jc),s.setRenderTarget(n),s.render(t,i)}s.toneMapping=c,s.toneMappingExposure=l,s.outputEncoding=u,s.setClearColor(h,p)},_textureToCubeUV:function(t,e){var r=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=nl()):null==this._equirectShader&&(this._equirectShader=rl());var n=t.isCubeTexture?this._cubemapShader:this._equirectShader,i=new Be(Qc[0],n),o=n.uniforms;o.envMap.value=t,t.isCubeTexture||o.texelSize.value.set(1/t.image.width,1/t.image.height),o.inputEncoding.value=Gc[t.encoding],o.outputEncoding.value=Gc[e.texture.encoding],el(e,0,0,3*jc,2*jc),r.setRenderTarget(e),r.render(i,Hc)},_applyPMREM:function(t){var e=this._renderer,r=e.autoClear;e.autoClear=!1;for(var n=1;n20&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(f," samples when the maximum is set to ").concat(20));for(var g=[],m=0,y=0;y<20;++y){var v=y/d,A=Math.exp(-v*v/2);g.push(A),0==y?m+=A:y4?n-8+4:0),3*_,2*_),s.setRenderTarget(e),s.render(c,Hc)}},e.LineStrip=0,e.LinePieces=1,e.NoColors=0,e.FaceColors=1,e.VertexColors=2,ys.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(ys.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Ns.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new He,r=0,n=t.length;rr-2?r-1:u+1],g=t[u>r-3?r-1:u+2]);var m=l*l,y=l*m;n.push([p(h[0],d[0],f[0],g[0],l,m,y),p(h[1],d[1],f[1],g[1],l,m,y)])}return n}function h(t){var e=t.length,r=[],n=c(t[0],t[1]),i=n/2;i=i(n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var o=a;function a(t,e){this.x=t,this.y=e}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var s="undefined"!=typeof self?self:{},u=Math.pow(2,53)-1;function c(t,e,n,i){var o=new r(t,e,n,i);return function(t){return o.solve(t)}}var l=c(.25,.1,.25,1);function h(t,e,r){return Math.min(r,Math.max(e,t))}function p(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function d(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function y(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function v(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function A(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function b(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function x(t){return Array.isArray(t)?t.map(x):"object"==n(t)&&t?_(t,x):t}var w={};function C(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function E(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function I(t){for(var e=0,r=0,n=t.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,n,i){var o=n||i;return e[r]=!o||o.toLowerCase(),""})),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r}return e}var T=null;function P(t){if(null==T){var e=t.navigator?t.navigator.userAgent:null;T=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return T}function O(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var L,k,R,D,B=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),N=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,F=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,j={now:B,frame:function(t){var e=N(t);return{cancel:function(){return F(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return L||(L=s.document.createElement("a")),L.href=t,L.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==k&&(k=s.matchMedia("(prefers-reduced-motion: reduce)")),k.matches)}},z={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){!G&&D&&(H?V(t):R=t)}},G=!1,H=!1;function V(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,D),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),G=!0}s.document&&((D=s.document.createElement("img")).onload=function(){R&&V(R),R=null,H=!0},D.onerror=function(){G=!0,R=null},D.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var Q="01",q=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function W(t){return 0===t.indexOf("mapbox:")}q.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Q,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},q.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},q.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},q.prototype.normalizeStyleURL=function(t,e){if(!W(t))return t;var r=K(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeGlyphsURL=function(t,e){if(!W(t))return t;var r=K(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSourceURL=function(t,e){if(!W(t))return t;var r=K(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},q.prototype.normalizeSpriteURL=function(t,e,r,n){var i=K(t);return W(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+e+r,J(i))},q.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!W(t))return t;var r=K(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(j.devicePixelRatio>=2||512===e?"@2x":"")+(U.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var n=this._customAccessToken||function(t){for(var e=0,r=t;e=0&&t.params.splice(i,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!z.REQUIRE_ACCESS_TOKEN)return J(t);if(!(e=e||z.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),J(t)};var Y=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(t){return Y.test(t)}var Z=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match(Z);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function J(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function $(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(s.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var tt=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};tt.prototype.getStorageKey=function(t){var e,r=$(z.ACCESS_TOKEN);return e=r&&r.u?s.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):z.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},tt.prototype.fetchEventData=function(){var t=O("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var n=s.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var i=s.localStorage.getItem(r);i&&(this.anonId=i)}catch(t){C("Unable to read from LocalStorage")}},tt.prototype.saveEventData=function(){var t=O("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){C("Unable to write to LocalStorage")}},tt.prototype.processRequests=function(t){},tt.prototype.postEvent=function(t,e,r,n){var i=this;if(z.EVENTS_URL){var o=K(z.EVENTS_URL);o.params.push("access_token="+(n||z.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.0",skuId:Q,userId:this.anonId},s=e?d(a,e):a,u={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=xt(u,(function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n)}))}},tt.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var et,rt,nt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(z.EVENTS_URL&&n||z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return W(t)||X(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=m()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}(tt),it=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){z.EVENTS_URL&&z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return W(t)||X(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=$(z.ACCESS_TOKEN),n=r?r.u:z.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=m(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}(tt)),ot=it.postTurnstileEvent.bind(it),at=new nt,st=at.postMapLoadEvent.bind(at),ut=500,ct=50;function lt(){s.caches&&!et&&(et=s.caches.open("mapbox-tiles"))}function ht(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var pt,dt=1/0;function ft(){return null==pt&&(pt=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),pt}var gt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(gt);var mt,yt,vt=function(t){function e(e,r,n){401===r&&X(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),At=M()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href},_t=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(At())&&!/^\w+:/.test(r))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,n=new s.AbortController,i=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:At(),signal:n.signal}),o=!1,a=!1,u=(r=i.url).indexOf("sku=")>0&&X(r);"json"===t.type&&i.headers.set("Accept","application/json");var c=function(r,n,o){if(!a){if(r&&"SecurityError"!==r.message&&C(r),n&&o)return l(n);var c=Date.now();s.fetch(i).then((function(r){if(r.ok){var n=u?r.clone():null;return l(r,n,c)}return e(new vt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(r,n,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){a||(n&&u&&function(t,e,r){if(lt(),et){var n={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var i=S(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===rt)try{new Response(new ReadableStream),rt=!0}catch(t){rt=!1}rt?e(t.body):t.blob().then(e)}(e,(function(e){var r=new s.Response(e,n);lt(),et&&et.then((function(e){return e.put(ht(t.url),r)})).catch((function(t){return C(t.message)}))})))}}(i,n,u),o=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){a||e(new Error(t.message))}))};return u?function(t,e){if(lt(),!et)return e(null);var r=ht(t.url);et.then((function(t){t.match(r).then((function(n){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),r=S(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i)})).catch(e)})).catch(e)}(i,c):c(null,null),{cancel:function(){a=!0,o||n.abort()}}}(t,e);if(M()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new s.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response)}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else e(new vt(r.statusText,r.status,t.url))},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},bt=function(t,e){return _t(d(t,{type:"arrayBuffer"}),e)},xt=function(t,e){return _t(d(t,{method:"POST"}),e)},wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";mt=[],yt=0;function Ct(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function Et(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1)}}var It=function(t,e){void 0===e&&(e={}),d(this,e),this.type=t},Mt=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",d({error:e},r))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(It),St=function(){};St.prototype.on=function(t,e){return this._listeners=this._listeners||{},Ct(t,e,this._listeners),this},St.prototype.off=function(t,e){return Et(t,e,this._listeners),Et(t,e,this._oneTimeListeners),this},St.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Ct(t,e,this._oneTimeListeners),this},St.prototype.fire=function(t,e){"string"==typeof t&&(t=new It(t,e||{}));var r=t.type;if(this.listens(r)){t.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},St.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Tt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Pt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Ot(t){var e=t.value;return e?[new Pt(t.key,e,"constants have been deprecated as of v8")]:[]}function Lt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Xt=[Nt,Ft,jt,zt,Ut,Qt,Gt,Wt(Ht),qt];function Zt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Zt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=Xt;r255?255:t}function i(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in r)return r[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),c=s.indexOf(")");if(-1!==u&&c+1===s.length){var l=s.substr(0,u),h=s.substr(u+1,c-(u+1)).split(","),p=1;switch(l){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,f=o(h[1]),g=o(h[2]),m=g<=.5?g*(f+1):g+f-g*f,y=2*g-m;return[n(255*a(y,m,d+1/3)),n(255*a(y,m,d)),n(255*a(y,m,d-1/3)),p];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],n=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+n+")"},te.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var re=function(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new re(t,null,null,null,null)])},ne.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ae(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,r=t;e2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[s],n++}else o=Ht;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}r=Wt(o,a)}else r=he[i];for(var u=[];n1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var de=function(t){this.type=Qt,this.sections=t};de.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==n(r))return e.error("First argument must be an image or text section.");for(var i=[],o=!1,a=1;a<=t.length-1;++a){var s=t[a];if(o&&"object"==n(s)&&!Array.isArray(s)){o=!1;var u=null;if(s["font-scale"]&&!(u=e.parse(s["font-scale"],1,Ft)))return null;var c=null;if(s["text-font"]&&!(c=e.parse(s["text-font"],1,Wt(jt))))return null;var l=null;if(s["text-color"]&&!(l=e.parse(s["text-color"],1,Ut)))return null;var h=i[i.length-1];h.scale=u,h.font=c,h.textColor=l}else{var p=e.parse(t[a],1,Ht);if(!p)return null;var d=p.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,i.push({content:p,scale:null,font:null,textColor:null})}}return new de(i)},de.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var r=e.content.evaluate(t);return se(r)===qt?new re("",r,null,null,null):new re(ue(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},de.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},fe.prototype.eachChild=function(t){t(this.input)},fe.prototype.outputDefined=function(){return!1},fe.prototype.serialize=function(){return["image",this.input.serialize()]};var ge={"to-boolean":zt,"to-color":Ut,"to-number":Ft,"to-string":jt},me=function(t,e){this.type=t,this.args=e};me.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=ge[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new le(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s=e[2]||t[1]<=e[1]||t[3]>=e[3])}function we(t,e){var r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(r*i*8192),Math.round(n*i*8192)]}function Ce(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Ee(t,e){for(var r,n,i,o,a,s,u,c=!1,l=0,h=e.length;l0&&s<0||a<0&&s>0}function Se(t,e,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}be(e,t)}function Re(t,e,r,n){for(var i=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],a=[],s=0,u=t;s=0)return!1;var r=!0;return t.eachChild((function(t){r&&!je(t,e)&&(r=!1)})),r}Be.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ae(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;ne))throw new le("Input is not a number.");o=a-1}return 0}Ue.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Ue.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new pe(e,[t]):"coerce"===r?new me(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+n(i)+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var o=this.registry[i];if(o){var a=o.parse(t,this);if(!a)return null;if(this.expectedType){var s=this.expectedType,u=a.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==u.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==u.kind&&"string"!==u.kind){if(this.checkSubtype(s,u))return null}else a=r(a,s,e.typeAnnotation||"coerce");else a=r(a,s,e.typeAnnotation||"assert")}if(!(a instanceof ce)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof ze)return t(e.boundExpression);if(e instanceof Ae&&"error"===e.name)return!1;if(e instanceof _e)return!1;if(e instanceof Be)return!1;var r=e instanceof me||e instanceof pe,n=!0;return e.eachChild((function(e){n=r?n&&t(e):n&&e instanceof ce})),!!n&&Ne(e)&&je(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var c=new ve;try{a=new ce(a.type,a.evaluate(c))}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==n(t)?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+n(t)+" instead.")},Ue.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Ue(this.registry,n,e||null,i,this.errors)},Ue.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Dt(n,t))},Ue.prototype.checkSubtype=function(t,e){var r=Zt(t,e);return r&&this.error(r),r};var He=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var l=e.parse(s,c,i);if(!l)return null;i=i||l.type,n.push([a,l])}return new He(i,r,n)},He.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ge(e,n)].evaluate(t)},He.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Qe=Object.freeze({__proto__:null,number:Ve,color:function(t,e,r){return new te(Ve(t.r,e.r,r),Ve(t.g,e.g,r),Ve(t.b,e.b,r),Ve(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return Ve(t,e[n],r)}))}}),qe=6/29*3*(6/29),We=Math.PI/180,Ye=180/Math.PI;function Xe(t){return t>.008856451679035631?Math.pow(t,1/3):t/qe+4/29}function Ze(t){return t>6/29?t*t*t:qe*(t-4/29)}function Ke(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Je(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $e(t){var e=Je(t.r),r=Je(t.g),n=Je(t.b),i=Xe((.4124564*e+.3575761*r+.1804375*n)/.95047),o=Xe((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Xe((.0193339*e+.119192*r+.9503041*n)/1.08883)),alpha:t.a}}function tr(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ze(e),r=.95047*Ze(r),n=1.08883*Ze(n),new te(Ke(3.2404542*r-1.5371385*e-.4985314*n),Ke(-.969266*r+1.8760108*e+.041556*n),Ke(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function er(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var rr={forward:$e,reverse:tr,interpolate:function(t,e,r){return{l:Ve(t.l,e.l,r),a:Ve(t.a,e.a,r),b:Ve(t.b,e.b,r),alpha:Ve(t.alpha,e.alpha,r)}}},nr={forward:function(t){var e=$e(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*Ye;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*We,r=t.c;return tr({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:er(t.h,e.h,r),c:Ve(t.c,e.c,r),l:Ve(t.l,e.l,r),alpha:Ve(t.alpha,e.alpha,r)}}},ir=Object.freeze({__proto__:null,lab:rr,hcl:nr}),or=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,Ft)))return null;var u=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Ut:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var l=0;l=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var g=e.parse(p,f,c);if(!g)return null;c=c||g.type,u.push([h,g])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new or(c,r,n,i,u):e.error("Type "+Yt(c)+" is not interpolatable.")},or.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var o=Ge(e,n),a=or.interpolationFactor(this.interpolation,n,e[o],e[o+1]),s=r[o].evaluate(t),u=r[o+1].evaluate(t);return"interpolate"===this.operator?Qe[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?nr.reverse(nr.interpolate(nr.forward(s),nr.forward(u),a)):rr.reverse(rr.interpolate(rr.forward(s),rr.forward(u),a))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new le("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new le("Array index must be an integer, but found "+e+" instead.");return r[e]},cr.prototype.eachChild=function(t){t(this.index),t(this.input)},cr.prototype.outputDefined=function(){return!1},cr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var lr=function(t,e){this.type=zt,this.needle=t,this.haystack=e};lr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ht),n=e.parse(t[2],2,Ht);return r&&n?Kt(r.type,[zt,jt,Ft,Nt,Ht])?new lr(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Yt(r.type)+" instead"):null},lr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return!1;if(!Jt(e,["boolean","string","number","null"]))throw new le("Expected first argument to be of type boolean, string, number or null, but found "+Yt(se(e))+" instead.");if(!Jt(r,["string","array"]))throw new le("Expected second argument to be of type array or string, but found "+Yt(se(r))+" instead.");return r.indexOf(e)>=0},lr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},lr.prototype.outputDefined=function(){return!0},lr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hr=function(t,e,r){this.type=Ft,this.needle=t,this.haystack=e,this.fromIndex=r};hr.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ht),n=e.parse(t[2],2,Ht);if(!r||!n)return null;if(!Kt(r.type,[zt,jt,Ft,Nt,Ht]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Yt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new hr(r,n,i):null}return new hr(r,n)},hr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!Jt(e,["boolean","string","number","null"]))throw new le("Expected first argument to be of type boolean, string, number or null, but found "+Yt(se(e))+" instead.");if(!Jt(r,["string","array"]))throw new le("Expected second argument to be of type array or string, but found "+Yt(se(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},hr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hr.prototype.outputDefined=function(){return!1},hr.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pr=function(t,e,r,n,i,o){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};pr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,se(p)))return null}else r=se(p);if(void 0!==i[String(p)])return c.error("Branch labels must be unique.");i[String(p)]=o.length}var d=e.parse(u,a,n);if(!d)return null;n=n||d.type,o.push(d)}var f=e.parse(t[1],1,Ht);if(!f)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?"value"!==f.type.kind&&e.concat(1).checkSubtype(r,f.type)?null:new pr(r,n,f,i,o,g):null},pr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Ht),n=e.parse(t[2],2,Ft);if(!r||!n)return null;if(!Kt(r.type,[Wt(Ht),jt,Ht]))return e.error("Expected first argument to be of type array or string, but found "+Yt(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new fr(r.type,r,n,i):null}return new fr(r.type,r,n)},fr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!Jt(e,["string","array"]))throw new le("Expected first argument to be of type array or string, but found "+Yt(se(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},fr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},fr.prototype.outputDefined=function(){return!1},fr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var vr=yr("==",(function(t,e,r){return e===r}),mr),Ar=yr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!mr(0,e,r,n)})),_r=yr("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),xr=yr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),wr=yr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),Cr=function(t,e,r,n,i){this.type=jt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Cr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Ft);if(!r)return null;var i=t[2];if("object"!=n(i)||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var o=null;if(i.locale&&!(o=e.parse(i.locale,1,jt)))return null;var a=null;if(i.currency&&!(a=e.parse(i.currency,1,jt)))return null;var s=null;if(i["min-fraction-digits"]&&!(s=e.parse(i["min-fraction-digits"],1,Ft)))return null;var u=null;return i["max-fraction-digits"]&&!(u=e.parse(i["max-fraction-digits"],1,Ft))?null:new Cr(r,o,a,s,u)},Cr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Cr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Cr.prototype.outputDefined=function(){return!1},Cr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Er=function(t){this.type=Ft,this.input=t};Er.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+Yt(r.type)+" instead."):new Er(r):null},Er.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new le("Expected value to be of type string or array, but found "+Yt(se(e))+" instead.")},Er.prototype.eachChild=function(t){t(this.input)},Er.prototype.outputDefined=function(){return!1},Er.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ir={"==":vr,"!=":Ar,">":br,"<":_r,">=":wr,"<=":xr,array:pe,at:cr,boolean:pe,case:dr,coalesce:sr,collator:_e,format:de,image:fe,in:lr,"index-of":hr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Er,let:ur,literal:ce,match:pr,number:pe,"number-format":Cr,object:pe,slice:fr,step:He,string:pe,"to-boolean":me,"to-color":me,"to-number":me,"to-string":me,var:ze,within:Be};function Mr(t,e){var r=e[0],n=e[1],i=e[2],o=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=oe(r,n,i,a);if(s)throw new le(s);return new te(r/255*a,n/255*a,i/255*a,a)}function Sr(t,e){return t in e}function Tr(t,e){var r=e[t];return void 0===r?null:r}function Pr(t){return{type:t}}function Or(t){return{result:"success",value:t}}function Lr(t){return{result:"error",value:t}}function kr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Rr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Dr(t){return!!t.expression&&t.expression.interpolated}function Br(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":n(t)}function Nr(t){return"object"==n(t)&&null!==t&&!Array.isArray(t)}function Fr(t){return t}function jr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function zr(t,e,r,i,o){return jr(n(r)===o?i[r]:void 0,t.default,e.default)}function Ur(t,e,r){if("number"!==Br(r))return jr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Ge(t.stops.map((function(t){return t[0]})),r);return t.stops[i][1]}function Gr(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Br(r))return jr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=Ge(t.stops.map((function(t){return t[0]})),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],c=Qe[e.type]||Fr;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=ir[t.colorSpace];c=function(t,e){return l.reverse(l.interpolate(l.forward(t),l.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return c(r,n,a)}}:c(s,u,a)}function Hr(t,e,r){return"color"===e.type?r=te.parse(r):"formatted"===e.type?r=ne.fromString(r.toString()):"resolvedImage"===e.type?r=ie.fromString(r.toString()):Br(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),jr(r,t.default,e.default)}Ae.register(Ir,{error:[{kind:"error"},[jt],function(t,e){throw new le(e[0].evaluate(t))}],typeof:[jt,[Ht],function(t,e){return Yt(se(e[0].evaluate(t)))}],"to-rgba":[Wt(Ft,4),[Ut],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ut,[Ft,Ft,Ft],Mr],rgba:[Ut,[Ft,Ft,Ft,Ft],Mr],has:{type:zt,overloads:[[[jt],function(t,e){return Sr(e[0].evaluate(t),t.properties())}],[[jt,Gt],function(t,e){var r=e[1];return Sr(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:Ht,overloads:[[[jt],function(t,e){return Tr(e[0].evaluate(t),t.properties())}],[[jt,Gt],function(t,e){var r=e[1];return Tr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Ht,[jt],function(t,e){return Tr(e[0].evaluate(t),t.featureState||{})}],properties:[Gt,[],function(t){return t.properties()}],"geometry-type":[jt,[],function(t){return t.geometryType()}],id:[Ht,[],function(t){return t.id()}],zoom:[Ft,[],function(t){return t.globals.zoom}],"heatmap-density":[Ft,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ft,[],function(t){return t.globals.lineProgress||0}],accumulated:[Ht,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ft,Pr(Ft),function(t,e){for(var r=0,n=0,i=e;n":[zt,[jt,Ht],function(t,e){var r=e[0],i=e[1],o=t.properties()[r.value],a=i.value;return n(o)==n(a)&&o>a}],"filter-id->":[zt,[Ht],function(t,e){var r=e[0],i=t.id(),o=r.value;return n(i)==n(o)&&i>o}],"filter-<=":[zt,[jt,Ht],function(t,e){var r=e[0],i=e[1],o=t.properties()[r.value],a=i.value;return n(o)==n(a)&&o<=a}],"filter-id-<=":[zt,[Ht],function(t,e){var r=e[0],i=t.id(),o=r.value;return n(i)==n(o)&&i<=o}],"filter->=":[zt,[jt,Ht],function(t,e){var r=e[0],i=e[1],o=t.properties()[r.value],a=i.value;return n(o)==n(a)&&o>=a}],"filter-id->=":[zt,[Ht],function(t,e){var r=e[0],i=t.id(),o=r.value;return n(i)==n(o)&&i>=o}],"filter-has":[zt,[Ht],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[zt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[zt,[Wt(jt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[zt,[Wt(Ht)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[zt,[jt,Wt(Ht)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[zt,[jt,Wt(Ht)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:zt,overloads:[[[zt,zt],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Pr(zt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Ir}function qr(t,e){var r=new Ue(Ir,[],e?function(t){var e={color:Ut,string:jt,number:Ft,enum:jt,boolean:zt,formatted:Qt,resolvedImage:qt};return"array"===t.type?Wt(e[t.value]||Ht,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Or(new Vr(n,e)):Lr(r.errors)}Vr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Vr.prototype.evaluate=function(t,e,r,n,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new le("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Wr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Fe(e.expression)};Wr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},Wr.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var Yr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Fe(e.expression),this.interpolationType=n};function Xr(t,e){if("error"===(t=qr(t,e)).result)return t;var r=t.value.expression,n=Ne(r);if(!n&&!kr(e))return Lr([new Dt("","data expressions not supported")]);var i=je(r,["zoom"]);if(!i&&!Rr(e))return Lr([new Dt("","zoom expressions not supported")]);var o=function t(e){var r=null;if(e instanceof ur)r=t(e.result);else if(e instanceof sr)for(var n=0,i=e.args;nn.maximum?[new Pt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function tn(t){var e,r,n,i=t.valueSpec,o=kt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,c="array"===Br(t.value.stops)&&"array"===Br(t.value.stops[0])&&"object"===Br(t.value.stops[0][0]),l=Kr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Pt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Jr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Br(r)&&0===r.length&&e.push(new Pt(t.key,r,"array must have at least one stop")),e},default:function(t){return wn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&l.push(new Pt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||l.push(new Pt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Dr(t.valueSpec)&&l.push(new Pt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!kr(t.valueSpec)?l.push(new Pt(t.key,t.value,"property functions not supported")):s&&!Rr(t.valueSpec)&&l.push(new Pt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||l.push(new Pt(t.key,t.value,'"property" property is required')),l;function h(t){var e=[],o=t.value,s=t.key;if("array"!==Br(o))return[new Pt(s,o,"array expected, "+Br(o)+" found")];if(2!==o.length)return[new Pt(s,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==Br(o[0]))return[new Pt(s,o,"object expected, "+Br(o[0])+" found")];if(void 0===o[0].zoom)return[new Pt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Pt(s,o,"object stop key must have value")];if(n&&n>kt(o[0].zoom))return[new Pt(s,o[0].zoom,"stop zoom values must appear in ascending order")];kt(o[0].zoom)!==n&&(n=kt(o[0].zoom),r=void 0,a={}),e=e.concat(Kr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:$r,value:p}}))}else e=e.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Qr(Rt(o[1]))?e.concat([new Pt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(wn({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,n){var s=Br(t.value),u=kt(t.value),c=null!==t.value?t.value:n;if(e){if(s!==e)return[new Pt(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Pt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var l="number expected, "+s+" found";return kr(i)&&void 0===o&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Pt(t.key,c,l)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function un(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?cn(t[1],t[2],"=="):"!="===r?pn(cn(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?cn(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(un))):"all"===r?["all"].concat(t.slice(1).map(un)):"none"===r?["all"].concat(t.slice(1).map(un).map(pn)):"in"===r?ln(t[1],t.slice(2)):"!in"===r?pn(ln(t[1],t.slice(2))):"has"===r?hn(t[1]):"!has"===r?pn(hn(t[1])):"within"!==r||t}function cn(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function ln(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return n(t)!=n(e[0])}))?["filter-in-large",t,["literal",e.sort(sn)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function pn(t){return["!",t]}function dn(t){return nn(Rt(t.value))?en(Lt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,n=e.key;if("array"!==Br(r))return[new Pt(n,r,"array expected, "+Br(r)+" found")];var i,o=e.styleSpec,a=[];if(r.length<1)return[new Pt(n,r,"filter array must have at least 1 element")];switch(a=a.concat(rn({key:n+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),kt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===kt(r[1])&&a.push(new Pt(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new Pt(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(i=Br(r[1]))&&a.push(new Pt(n+"[1]",r[1],"string expected, "+i+" found"));for(var s=2;s=l[d+0]&&n>=l[d+1])?(a[p]=!0,o.push(c[p])):a[p]=!1}}},Rn.prototype._forEachCell=function(t,e,r,n,i,o,a,s){for(var u=this._convertToCellCoord(t),c=this._convertToCellCoord(e),l=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=u;p<=l;p++)for(var d=c;d<=h;d++){var f=this.d*d+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(d),this._convertFromCellCoord(p+1),this._convertFromCellCoord(d+1)))&&i.call(this,t,e,r,n,f,o,a,s))return}},Rn.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Rn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Rn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,n=0;n=0)){var h=t[l];c[l]=Nn[u].shallow.indexOf(l)>=0?h:Gn(h,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==u&&(c.$name=u),c}throw new Error("can't serialize object of type "+n(t))}function Hn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||zn(t)||Un(t)||ArrayBuffer.isView(t)||t instanceof Dn)return t;if(Array.isArray(t))return t.map(Hn);if("object"==n(t)){var e=t.$name||"Object",r=Nn[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var i=Object.create(r.prototype),o=0,a=Object.keys(t);o=0?u:Hn(u)}}return i}throw new Error("can't deserialize object of type "+n(t))}var Vn=function(){this.first=!0};Vn.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function qn(t){for(var e=0,r=t;e=65097&&t<=65103)||Qn["CJK Compatibility Ideographs"](t)||Qn["CJK Compatibility"](t)||Qn["CJK Radicals Supplement"](t)||Qn["CJK Strokes"](t)||!(!Qn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Qn["CJK Unified Ideographs Extension A"](t)||Qn["CJK Unified Ideographs"](t)||Qn["Enclosed CJK Letters and Months"](t)||Qn["Hangul Compatibility Jamo"](t)||Qn["Hangul Jamo Extended-A"](t)||Qn["Hangul Jamo Extended-B"](t)||Qn["Hangul Jamo"](t)||Qn["Hangul Syllables"](t)||Qn.Hiragana(t)||Qn["Ideographic Description Characters"](t)||Qn.Kanbun(t)||Qn["Kangxi Radicals"](t)||Qn["Katakana Phonetic Extensions"](t)||Qn.Katakana(t)&&12540!==t||!(!Qn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Qn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Qn["Unified Canadian Aboriginal Syllabics"](t)||Qn["Unified Canadian Aboriginal Syllabics Extended"](t)||Qn["Vertical Forms"](t)||Qn["Yijing Hexagram Symbols"](t)||Qn["Yi Syllables"](t)||Qn["Yi Radicals"](t))))}function Yn(t){return!(Wn(t)||function(t){return!!(Qn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Qn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Qn["Letterlike Symbols"](t)||Qn["Number Forms"](t)||Qn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Qn["Control Pictures"](t)&&9251!==t||Qn["Optical Character Recognition"](t)||Qn["Enclosed Alphanumerics"](t)||Qn["Geometric Shapes"](t)||Qn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Qn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Qn["CJK Symbols and Punctuation"](t)||Qn.Katakana(t)||Qn["Private Use Area"](t)||Qn["CJK Compatibility Forms"](t)||Qn["Small Form Variants"](t)||Qn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Xn(t){return t>=1424&&t<=2303||Qn["Arabic Presentation Forms-A"](t)||Qn["Arabic Presentation Forms-B"](t)}function Zn(t,e){return!(!e&&Xn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Qn.Khmer(t))}function Kn(t){for(var e=0,r=t;e-1&&($n="error"),Jn&&Jn(t)};function ri(){ni.fire(new It("pluginStateChange",{pluginStatus:$n,pluginURL:ti}))}var ni=new St,ii=function(){return $n},oi=function(){if("deferred"!==$n||!ti)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$n="loading",ri(),ti&&bt({url:ti},(function(t){t?ei(t):($n="loaded",ri())}))},ai={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===$n||null!=ai.applyArabicShaping},isLoading:function(){return"loading"===$n},setState:function(t){$n=t.pluginStatus,ti=t.pluginURL},isParsed:function(){return null!=ai.applyArabicShaping&&null!=ai.processBidirectionalText&&null!=ai.processStyledBidirectionalText},getPluginURL:function(){return ti}},si=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Vn,this.transition={})};si.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var ui=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Nr(t))return new Zr(t,e);if(Qr(t)){var r=Xr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};ui.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},ui.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var ci=function(t){this.property=t,this.value=new ui(t,void 0)};ci.prototype.transitioned=function(t,e){return new hi(this.property,this.value,e,d({},t.transition,this.transition),t.now)},ci.prototype.untransitioned=function(){return new hi(this.property,this.value,null,{},0)};var li=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};li.prototype.getValue=function(t){return x(this._values[t].value.value)},li.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ci(this._values[t].property)),this._values[t].value=new ui(this._values[t].property,null===e?void 0:x(e))},li.prototype.getTransition=function(t){return x(this._values[t].transition)},li.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ci(this._values[t].property)),this._values[t].transition=x(e)||void 0},li.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}return i};var pi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};pi.prototype.possiblyEvaluate=function(t,e,r){for(var n=new gi(this._properties),i=0,o=Object.keys(this._values);in.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(yi),Ai=function(t){this.specification=t};Ai.prototype.possiblyEvaluate=function(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new si(Math.floor(e.zoom-1),e)),t.expression.evaluate(new si(Math.floor(e.zoom),e)),t.expression.evaluate(new si(Math.floor(e.zoom+1),e)),e)}},Ai.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Ai.prototype.interpolate=function(t){return t};var _i=function(t){this.specification=t};_i.prototype.possiblyEvaluate=function(t,e,r,n){return!!t.expression.evaluate(e,null,{},r,n)},_i.prototype.interpolate=function(){return!1};var bi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new ui(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new ci(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};Fn("DataDrivenProperty",yi),Fn("DataConstantProperty",mi),Fn("CrossFadedDataDrivenProperty",vi),Fn("CrossFadedProperty",Ai),Fn("ColorRampProperty",_i);var xi=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new di(r.layout)),r.paint)){for(var n in this._transitionablePaint=new li(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new gi(r.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(On,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return A(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Pn,"layers."+this.id+".paint."+t,t,e,r))return!1;if(A(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var n=this._transitionablePaint._values[t],i="cross-faded-data-driven"===n.property.specification["property-type"],o=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),b(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Ln(this,t.call(Sn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Tt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof fi&&kr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(St),wi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ci=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ei=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Ii(t,e){void 0===e&&(e=1);var r=0,n=0;return{members:t.map((function(t){var i=wi[t.type].BYTES_PER_ELEMENT,o=r=Mi(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Mi(r,Math.max(n,e)),alignment:e}}function Mi(t,e){return Math.ceil(t/e)*e}Ei.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ei.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Ei.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ei.prototype.clear=function(){this.length=0},Ei.prototype.resize=function(t){this.reserve(t),this.length=t},Ei.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Ei.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Ei);Si.prototype.bytesPerElement=4,Fn("StructArrayLayout2i4",Si);var Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,t},e}(Ei);Ti.prototype.bytesPerElement=8,Fn("StructArrayLayout4i8",Ti);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Ei);Pi.prototype.bytesPerElement=12,Fn("StructArrayLayout2i4i12",Pi);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Ei);Oi.prototype.bytesPerElement=8,Fn("StructArrayLayout2i4ub8",Oi);var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Ei);Li.prototype.bytesPerElement=8,Fn("StructArrayLayout2f8",Li);var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,n,i,o,a,s,u,c)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=u,this.uint16[h+8]=c,this.uint16[h+9]=l,t},e}(Ei);ki.prototype.bytesPerElement=20,Fn("StructArrayLayout10ui20",ki);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,h){var p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,o,a,s,u,c,l,h)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,h,p){var d=12*t;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=i,this.uint16[d+4]=o,this.uint16[d+5]=a,this.uint16[d+6]=s,this.uint16[d+7]=u,this.int16[d+8]=c,this.int16[d+9]=l,this.int16[d+10]=h,this.int16[d+11]=p,t},e}(Ei);Ri.prototype.bytesPerElement=24,Fn("StructArrayLayout4i4ui4i24",Ri);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(Ei);Di.prototype.bytesPerElement=12,Fn("StructArrayLayout3f12",Di);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Ei);Bi.prototype.bytesPerElement=4,Fn("StructArrayLayout1ul4",Bi);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,o,a,s,u)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c){var l=10*t,h=5*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+3]=i,this.int16[l+4]=o,this.int16[l+5]=a,this.uint32[h+3]=s,this.uint16[l+8]=u,this.uint16[l+9]=c,t},e}(Ei);Ni.prototype.bytesPerElement=20,Fn("StructArrayLayout6i1ul2ui20",Ni);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,o)},e.prototype.emplace=function(t,e,r,n,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Ei);Fi.prototype.bytesPerElement=12,Fn("StructArrayLayout2i2i2i12",Fi);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i)},e.prototype.emplace=function(t,e,r,n,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Ei);ji.prototype.bytesPerElement=16,Fn("StructArrayLayout2f1f2i16",ji);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t},e}(Ei);zi.prototype.bytesPerElement=12,Fn("StructArrayLayout2ub2f12",zi);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(Ei);Ui.prototype.bytesPerElement=6,Fn("StructArrayLayout3ui6",Ui);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m){var y=this.length;return this.resize(y+1),this.emplace(y,t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y){var v=24*t,A=12*t,_=48*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[A+2]=o,this.uint32[A+3]=a,this.uint32[A+4]=s,this.uint16[v+10]=u,this.uint16[v+11]=c,this.uint16[v+12]=l,this.float32[A+7]=h,this.float32[A+8]=p,this.uint8[_+36]=d,this.uint8[_+37]=f,this.uint8[_+38]=g,this.uint32[A+10]=m,this.int16[v+22]=y,t},e}(Ei);Gi.prototype.bytesPerElement=48,Fn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Gi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,w,C,E,I,M){var S=this.length;return this.resize(S+1),this.emplace(S,t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,w,C,E,I,M)},e.prototype.emplace=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,w,C,E,I,M,S){var T=34*t,P=17*t;return this.int16[T+0]=e,this.int16[T+1]=r,this.int16[T+2]=n,this.int16[T+3]=i,this.int16[T+4]=o,this.int16[T+5]=a,this.int16[T+6]=s,this.int16[T+7]=u,this.uint16[T+8]=c,this.uint16[T+9]=l,this.uint16[T+10]=h,this.uint16[T+11]=p,this.uint16[T+12]=d,this.uint16[T+13]=f,this.uint16[T+14]=g,this.uint16[T+15]=m,this.uint16[T+16]=y,this.uint16[T+17]=v,this.uint16[T+18]=A,this.uint16[T+19]=_,this.uint16[T+20]=b,this.uint16[T+21]=x,this.uint16[T+22]=w,this.uint32[P+12]=C,this.float32[P+13]=E,this.float32[P+14]=I,this.float32[P+15]=M,this.float32[P+16]=S,t},e}(Ei);Hi.prototype.bytesPerElement=68,Fn("StructArrayLayout8i15ui1ul4f68",Hi);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Ei);Vi.prototype.bytesPerElement=4,Fn("StructArrayLayout1f4",Vi);var Qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(Ei);Qi.prototype.bytesPerElement=6,Fn("StructArrayLayout3i6",Qi);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},e.prototype.emplace=function(t,e,r,n){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t},e}(Ei);qi.prototype.bytesPerElement=8,Fn("StructArrayLayout1ul2ui8",qi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Ei);Wi.prototype.bytesPerElement=4,Fn("StructArrayLayout2ui4",Wi);var Yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Ei);Yi.prototype.bytesPerElement=2,Fn("StructArrayLayout1ui2",Yi);var Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},e.prototype.emplace=function(t,e,r,n,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,t},e}(Ei);Xi.prototype.bytesPerElement=16,Fn("StructArrayLayout4f16",Xi);var Zi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new o(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ci);Zi.prototype.size=20;var Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Zi(this,t)},e}(Ni);Fn("CollisionBoxArray",Ki);var Ji=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ci);Ji.prototype.size=48;var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ji(this,t)},e}(Gi);Fn("PlacedSymbolArray",$i);var to=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ci);to.prototype.size=68;var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new to(this,t)},e}(Hi);Fn("SymbolInstanceArray",eo);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Vi);Fn("GlyphOffsetArray",ro);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Qi);Fn("SymbolLineVertexArray",no);var io=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ci);io.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new io(this,t)},e}(qi);Fn("FeatureIndexArray",oo);var ao=Ii([{name:"a_pos",components:2,type:"Int16"}],4).members,so=function(t){void 0===t&&(t=[]),this.segments=t};function uo(t,e){return 256*(t=h(Math.floor(t),0,255))+h(Math.floor(e),0,255)}so.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>so.MAX_VERTEX_ARRAY_LENGTH&&C("Max vertices per segment is "+so.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>so.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},so.prototype.get=function(){return this.segments},so.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(c)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),ho=e((function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,o=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),po=lo,fo=ho;po.murmur3=lo,po.murmur2=fo;var go=function(){this.ids=[],this.positions=[],this.indexed=!1};go.prototype.add=function(t,e,r,n){this.ids.push(yo(t)),this.positions.push(e,r,n)},go.prototype.getPositions=function(t){for(var e=yo(t),r=0,n=this.ids.length-1;r>1;this.ids[i]>=e?n=i:r=i+1}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},go.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){for(;n>1],a=n-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;vo(e,a,s),vo(r,3*a,3*s),vo(r,3*a+1,3*s+1),vo(r,3*a+2,3*s+2)}s-na.x+1||ua.y+1)&&C("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Uo(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?zo(t):[]}}function Go(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)}var Ho=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Si,this.indexArray=new Ui,this.segments=new so,this.programConfigurations=new Do(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Vo(t,e){for(var r=0;r1){if(Yo(t,e))return!0;for(var n=0;n1?r:r.sub(e)._mult(i)._add(e))}function Jo(t,e){for(var r,n,i,o=!1,a=0;ae.y!=(i=r[u]).y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function $o(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function ta(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var o=E(t,e,r[0]);return o!==E(t,e,r[1])||o!==E(t,e,r[2])||o!==E(t,e,r[3])}function ea(t,e,r){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ra(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function na(t,e,r,n,i){if(!e[0]&&!e[1])return t;var a=o.convert(e)._mult(i);"viewport"===r&&a._rotate(-n);for(var s=[],u=0;u=8192||l<0||l>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),p=h.vertexLength;Go(this.layoutVertexArray,c,l,-1,-1),Go(this.layoutVertexArray,c,l,1,-1),Go(this.layoutVertexArray,c,l,1,1),Go(this.layoutVertexArray,c,l,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n)},Fn("CircleBucket",Ho,{omit:["layers"]});var ia=new bi({"circle-sort-key":new yi(Tt.layout_circle["circle-sort-key"])}),oa={paint:new bi({"circle-radius":new yi(Tt.paint_circle["circle-radius"]),"circle-color":new yi(Tt.paint_circle["circle-color"]),"circle-blur":new yi(Tt.paint_circle["circle-blur"]),"circle-opacity":new yi(Tt.paint_circle["circle-opacity"]),"circle-translate":new mi(Tt.paint_circle["circle-translate"]),"circle-translate-anchor":new mi(Tt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new mi(Tt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new mi(Tt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new yi(Tt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new yi(Tt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new yi(Tt.paint_circle["circle-stroke-opacity"])}),layout:ia},aa="undefined"!=typeof Float32Array?Float32Array:Array;function sa(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ua(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],d=e[10],f=e[11],g=e[12],m=e[13],y=e[14],v=e[15],A=r[0],_=r[1],b=r[2],x=r[3];return t[0]=A*n+_*s+b*h+x*g,t[1]=A*i+_*u+b*p+x*m,t[2]=A*o+_*c+b*d+x*y,t[3]=A*a+_*l+b*f+x*v,t[4]=(A=r[4])*n+(_=r[5])*s+(b=r[6])*h+(x=r[7])*g,t[5]=A*i+_*u+b*p+x*m,t[6]=A*o+_*c+b*d+x*y,t[7]=A*a+_*l+b*f+x*v,t[8]=(A=r[8])*n+(_=r[9])*s+(b=r[10])*h+(x=r[11])*g,t[9]=A*i+_*u+b*p+x*m,t[10]=A*o+_*c+b*d+x*y,t[11]=A*a+_*l+b*f+x*v,t[12]=(A=r[12])*n+(_=r[13])*s+(b=r[14])*h+(x=r[15])*g,t[13]=A*i+_*u+b*p+x*m,t[14]=A*o+_*c+b*d+x*y,t[15]=A*a+_*l+b*f+x*v,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var ca,la=ua;function ha(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}ca=new aa(3),aa!=Float32Array&&(ca[0]=0,ca[1]=0,ca[2]=0),function(){var t=new aa(4);aa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var pa=(function(){var t=new aa(2);aa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,oa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Ho(t)},e.prototype.queryRadius=function(t){var e=t;return ea("circle-radius",this,e)+ea("circle-stroke-width",this,e)+ra(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,a,s){for(var u=na(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),c=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),l="map"===this.paint.get("circle-pitch-alignment"),h=l?u:function(t,e){return t.map((function(t){return da(t,e)}))}(u,s),p=l?c*a:c,d=0,f=n;dt.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u80*r){n=o=t[0],i=a=t[1];for(var f=r;fo&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-n,a-i))?1/c:0}return Oa(p,d,r,n,i,c),d}function Ta(t,e,r,n,i){var o,a;if(i===$a(t,e,r,n)>0)for(o=e;o=e;o-=n)a=Za(o,t[o],t[o+1],a);return a&&Va(a,a.next)&&(Ka(a),a=a.next),a}function Pa(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Va(n,n.next)&&0!==Ha(n.prev,n,n.next))n=n.next;else{if(Ka(n),(n=e=n.prev)===n.next)break;r=!0}}while(r||n!==e);return e}function Oa(t,e,r,n,i,o,a){if(t){!a&&o&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=ja(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,o,a,s,u,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1)}(i)}(t,n,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?ka(t,n,i,o):La(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Ka(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?Oa(t=Ra(Pa(t),e,r),e,r,n,i,o,2):2===a&&Da(t,e,r,n,i,o):Oa(Pa(t),e,r,n,i,o,1);break}}}function La(t){var e=t.prev,r=t,n=t.next;if(Ha(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Ua(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Ha(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ka(t,e,r,n){var i=t.prev,o=t,a=t.next;if(Ha(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,c=ja(i.x=c&&p&&p.z<=l;){if(h!==t.prev&&h!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Ha(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ha(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;h&&h.z>=c;){if(h!==t.prev&&h!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Ha(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;p&&p.z<=l;){if(p!==t.prev&&p!==t.next&&Ua(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ha(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function Ra(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Va(i,o)&&Qa(i,n,n.next,o)&&Ya(i,o)&&Ya(o,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(o.i/r),Ka(n),Ka(n.next),n=t=o),n=n.next}while(n!==t);return Pa(n)}function Da(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Ga(a,s)){var u=Xa(a,s);return a=Pa(a,a.next),u=Pa(u,u.next),Oa(a,e,r,n,i,o),void Oa(u,e,r,n,i,o)}s=s.next}a=a.next}while(a!==t)}function Ba(t,e){return t.x-e.x}function Na(t,e){if(e=function(t,e){var r,n=e,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&&Ua(or.x||n.x===r.x&&Fa(r,n)))&&(r=n,p=u)),n=n.next}while(n!==c);return r}(t,e)){var r=Xa(e,t);Pa(e,e.next),Pa(r,r.next)}}function Fa(t,e){return Ha(t.prev,t,e.prev)<0&&Ha(e.next,t,t.next)<0}function ja(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function za(t){var e=t,r=t;do{(e.x=0&&(t-a)*(n-s)-(r-a)*(e-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function Ga(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Qa(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(Ya(t,e)&&Ya(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(Ha(t.prev,t,e.prev)||Ha(t,e.prev,e))||Va(t,e)&&Ha(t.prev,t,t.next)>0&&Ha(e.prev,e,e.next)>0)}function Ha(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Va(t,e){return t.x===e.x&&t.y===e.y}function Qa(t,e,r,n){var i=Wa(Ha(t,e,r)),o=Wa(Ha(t,e,n)),a=Wa(Ha(r,n,t)),s=Wa(Ha(r,n,e));return i!==o&&a!==s||!(0!==i||!qa(t,r,e))||!(0!==o||!qa(t,n,e))||!(0!==a||!qa(r,t,n))||!(0!==s||!qa(r,e,n))}function qa(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Wa(t){return t>0?1:t<0?-1:0}function Ya(t,e){return Ha(t.prev,t,t.next)<0?Ha(t,e,t.next)>=0&&Ha(t,t.prev,e)>=0:Ha(t,e,t.prev)<0||Ha(t,t.next,e)<0}function Xa(t,e){var r=new Ja(t.i,t.x,t.y),n=new Ja(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Za(t,e,r,n){var i=new Ja(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ka(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ja(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function $a(t,e,r,n){for(var i=0,o=e,a=r-n;on;){if(i-n>600){var a=i-n+1,s=r-n+1,u=Math.log(a),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(s-a/2<0?-1:1);t(e,r,Math.max(n,Math.floor(r-s*c/a+l)),Math.min(i,Math.floor(r+(a-s)*c/a+l)),o)}var h=e[r],p=n,d=i;for(es(e,n,r),o(e[i],h)>0&&es(e,n,i);p0;)d--}0===o(e[n],h)?es(e,n,d):es(e,++d,i),d<=r&&(n=d+1),r<=d&&(i=d-1)}}(t,e,r||0,n||t.length-1,i||rs)}function es(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function rs(t,e){return te?1:0}function ns(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;a1)for(var u=0;u0&&r.holes.push(n+=t[i-1].length)}return r},Ia.default=Ma;var ss=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Si,this.indexArray=new Ui,this.indexArray2=new Wi,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.segments2=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ss.prototype.populate=function(t,e,r){this.hasPattern=os("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(i--,1===n||2===n)a+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new o(a,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&u.push(e),u},ds.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,u,s,c]},ds.prototype.toGeoJSON=function(t,e,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),c=ds.types[this.type];function l(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}function As(t,e,r){if(3===t){var n=new ms(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}ys.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new ps(this._pbf,e,this.extent,this._keys,this._values)};var _s={VectorTile:function(t,e){this.layers=t.readFields(As,{},e)},VectorTileFeature:ps,VectorTileLayer:ms},bs=_s.VectorTileFeature.types,xs=Math.pow(2,13);function ws(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,2*Math.floor(n*xs)+a,i*xs*2,o*xs*2,Math.round(s))}var Cs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Pi,this.indexArray=new Ui,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Es(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Cs.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=os("fill-extrusion",this.layers,e);for(var n=0,i=t;n8192}))||L.every((function(t){return t.y<0}))||L.every((function(t){return t.y>8192}))))for(var g=0,m=0;m=1){var v=f[m-1];if(!Es(y,v)){h.vertexLength+4>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var A=y.sub(v)._perp()._unit(),_=v.dist(y);g+_>32768&&(g=0),ws(this.layoutVertexArray,y.x,y.y,A.x,A.y,0,0,g),ws(this.layoutVertexArray,y.x,y.y,A.x,A.y,0,1,g),ws(this.layoutVertexArray,v.x,v.y,A.x,A.y,0,0,g+=_),ws(this.layoutVertexArray,v.x,v.y,A.x,A.y,0,1,g);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+u>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===bs[t.type]){for(var x=[],w=[],C=h.vertexLength,E=0,I=s;E=2&&t[u-1].equals(t[u-2]);)u--;for(var c=0;c0;if(w&&y>c){var E=l.dist(d);if(E>2*h){var I=l.sub(l.sub(d)._mult(h/E)._round());this.updateDistance(d,I),this.addCurrentVertex(I,g,0,0,p),d=I}}var M=d&&f,S=M?r:s?"butt":n;if(M&&"round"===S&&(bi&&(S="bevel"),"bevel"===S&&(b>2&&(S="flipbevel"),b100)v=m.mult(-1);else{var T=b*g.add(m).mag()/g.sub(m).mag();v._perp()._mult(T*(C?-1:1))}this.addCurrentVertex(l,v,0,0,p),this.addCurrentVertex(l,v.mult(-1),0,0,p)}else if("bevel"===S||"fakeround"===S){var P=-Math.sqrt(b*b-1),O=C?P:0,L=C?0:P;if(d&&this.addCurrentVertex(l,g,O,L,p),"fakeround"===S)for(var k=Math.round(180*x/Math.PI/20),R=1;R2*h){var z=l.add(f.sub(l)._mult(h/j)._round());this.updateDistance(l,z),this.addCurrentVertex(z,m,0,0,p),l=z}}}}},Ds.prototype.addCurrentVertex=function(t,e,r,n,i,o){void 0===o&&(o=!1);var a=e.y*n-e.x,s=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,i),this.addHalfVertex(t,a,s,o,!0,-n,i),this.distance>Rs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,o))},Ds.prototype.addHalfVertex=function(t,e,r,n,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Rs-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Ds.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ds.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Fn("LineBucket",Ds,{omit:["layers","patternFeatures"]});var Bs=new bi({"line-cap":new mi(Tt.layout_line["line-cap"]),"line-join":new yi(Tt.layout_line["line-join"]),"line-miter-limit":new mi(Tt.layout_line["line-miter-limit"]),"line-round-limit":new mi(Tt.layout_line["line-round-limit"]),"line-sort-key":new yi(Tt.layout_line["line-sort-key"])}),Ns={paint:new bi({"line-opacity":new yi(Tt.paint_line["line-opacity"]),"line-color":new yi(Tt.paint_line["line-color"]),"line-translate":new mi(Tt.paint_line["line-translate"]),"line-translate-anchor":new mi(Tt.paint_line["line-translate-anchor"]),"line-width":new yi(Tt.paint_line["line-width"]),"line-gap-width":new yi(Tt.paint_line["line-gap-width"]),"line-offset":new yi(Tt.paint_line["line-offset"]),"line-blur":new yi(Tt.paint_line["line-blur"]),"line-dasharray":new Ai(Tt.paint_line["line-dasharray"]),"line-pattern":new vi(Tt.paint_line["line-pattern"]),"line-gradient":new _i(Tt.paint_line["line-gradient"])}),layout:Bs},Fs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new si(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=d({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(yi))(Ns.paint.properties["line-width"].specification);Fs.useIntegerZoom=!0;var js=function(t){function e(e){t.call(this,e,Ns),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof He,this.gradientVersion=(this.gradientVersion+1)%u)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=Fs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ds(t)},e.prototype.queryRadius=function(t){var e=t,r=zs(ea("line-width",this,e),ea("line-gap-width",this,e)),n=ea("line-offset",this,e);return r/2+Math.abs(n)+ra(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,s){var u=na(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*zs(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(n=function(t,e){for(var r=[],n=new o(0,0),i=0;i=3)for(var o=0;o0?e+2*t:t}var Us=Ii([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Gs=Ii([{name:"a_projected_pos",components:3,type:"Float32"}],4),Hs=(Ii([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ii([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Vs=(Ii([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ii([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Qs=Ii([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function qs(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),ai.applyArabicShaping&&(t=ai.applyArabicShaping(t)),t}(t.text,e,r)})),t}Ii([{name:"triangle",components:3,type:"Uint16"}]),Ii([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Ii([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Ii([{type:"Float32",name:"offsetX"}]),Ii([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ws={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ys=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,l=-7,h=r?i-1:0,p=r?-1:1,d=t[e+h];for(h+=p,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=p,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+h],h+=p,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},Xs=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=f,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=f,a/=256,c-=8);t[r+d-f]|=128*g},Zs=Ks;function Ks(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ks.Varint=0,Ks.Fixed64=1,Ks.Bytes=2,Ks.Fixed32=5;var Js="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $s(t){return t.type===Ks.Bytes?t.readVarint()+t.pos:t.pos+1}function tu(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function eu(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function ru(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function du(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function fu(t,e,r){1===t&&r.readMessage(gu,e)}function gu(t,e,r){if(3===t){var n=r.readMessage(mu,{}),i=n.width,o=n.height,a=n.left,s=n.top,u=n.advance;e.push({id:n.id,bitmap:new va({width:i+6,height:o+6},n.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function mu(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function yu(t){for(var e=0,r=0,n=0,i=t;n=0;p--){var d=a[p];if(!(h.w>d.w||h.h>d.h)){if(h.x=d.x,h.y=d.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===d.w&&h.h===d.h){var f=a.pop();p>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=du(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*du(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ys(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ys(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return tu(t,n,e);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return tu(t,n,e);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return tu(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Js?function(t,e,r){return Js.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Ks.Bytes)return t.push(this.readVarint(e));var r=$s(this);for(t=t||[];this.pos127;);else if(e===Ks.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ks.Fixed32)this.pos+=4;else{if(e!==Ks.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7)}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&eu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Xs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Xs(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&eu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Ks.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,au,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ou,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,su,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,uu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,cu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,lu,e)},writeBytesField:function(t,e){this.writeTag(t,Ks.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ks.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ks.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ks.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var vu=function(t,e){var r=e.pixelRatio,n=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n},Au={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Au.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Au.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Au.tlbr.get=function(){return this.tl.concat(this.br)},Au.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(vu.prototype,Au);var _u=function(t,e){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,r,i),this.addImages(e,n,i);var o=yu(i),a=new Aa({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],c=r[s].paddedRect;Aa.copy(u.data,a,{x:0,y:0},{x:c.x+1,y:c.y+1},u.data)}for(var l in e){var h=e[l],p=n[l].paddedRect,d=p.x+1,f=p.y+1,g=h.data.width,m=h.data.height;Aa.copy(h.data,a,{x:0,y:0},{x:d,y:f},h.data),Aa.copy(h.data,a,{x:0,y:m-1},{x:d,y:f-1},{width:g,height:1}),Aa.copy(h.data,a,{x:0,y:0},{x:d,y:f+m},{width:g,height:1}),Aa.copy(h.data,a,{x:g-1,y:0},{x:d-1,y:f},{width:1,height:m}),Aa.copy(h.data,a,{x:0,y:0},{x:d+g,y:f},{width:1,height:m})}this.image=a,this.iconPositions=r,this.patternPositions=n};_u.prototype.addImages=function(t,e,r){for(var n in t){var i=t[n],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(o),e[n]=new vu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},_u.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},_u.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;r.update(e.data,void 0,{x:n[0],y:n[1]})}},Fn("ImagePosition",vu),Fn("ImageAtlas",_u);var bu={horizontal:1,vertical:2,horizontalOnly:3},xu=function(){this.scale=1,this.fontStack="",this.imageName=null};xu.forText=function(t,e){var r=new xu;return r.scale=t||1,r.fontStack=e,r},xu.forImage=function(t){var e=new xu;return e.imageName=t,e};var wu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Cu(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g){var m,y=wu.fromFeature(t,i);h===bu.vertical&&y.verticalizePunctuation();var v=ai.processBidirectionalText,A=ai.processStyledBidirectionalText;if(v&&1===y.sections.length){m=[];for(var _=0,b=v(y.toString(),Ou(y,c,o,e,n,d,f));_0&&F>E&&(E=F)}else{var j=r[M.fontStack],z=j&&j[T];if(z&&z.rect)L=z.rect,O=z.metrics;else{var U=e[M.fontStack],G=U&&U[T];if(!G)continue;O=G.metrics}P=24*(b-M.scale)}D?(t.verticalizable=!0,C.push({glyph:T,imageName:k,x:p,y:d+P,vertical:D,scale:M.scale,fontStack:M.fontStack,sectionIndex:S,metrics:O,rect:L}),p+=R*M.scale+c):(C.push({glyph:T,imageName:k,x:p,y:d+P,vertical:D,scale:M.scale,fontStack:M.fontStack,sectionIndex:S,metrics:O,rect:L}),p+=O.advance*M.scale+c)}0!==C.length&&(f=Math.max(p-c,f),ku(C,0,C.length-1,m,E)),p=0;var H=o*b+E;w.lineOffset=Math.max(E,x),d+=H,g=Math.max(H,g),++y}else d+=o,++y}var V,Q=d- -17,q=Lu(a),W=q.horizontalAlign,Y=q.verticalAlign;(function(t,e,r,n,i,o,a,s,u){var c,l=(e-r)*i;c=o!==a?-s*n- -17:(-n*u+.5)*a;for(var h=0,p=t;h=0&&n>=t&&Eu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},wu.prototype.substring=function(t,e){var r=new wu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},wu.prototype.toString=function(){return this.text},wu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},wu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(xu.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,n=0;n=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Eu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Iu={};function Mu(t,e,r,n,i,o){if(e.imageName){var a=n[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=r[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Su(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,h=0,p=0;p-r/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],c=0;sn;)c-=u.shift().angleDelta;if(c>i)return!1;a++,s+=l.dist(h)}return!0}function Uu(t){for(var e=0,r=0;rc){var f=(c-u)/d,g=Ve(h.x,p.x,f),m=Ve(h.y,p.y,f),y=new Du(g,m,p.angleTo(h),l);return y._round(),!a||zu(t,y,s,a,e)?y:void 0}u+=d}}function Qu(t,e,r,n,i,o,a,s,u){var c=Gu(n,o,a),l=Hu(n,i),h=l*a,p=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h=0&&b=0&&x=0&&d+l<=h){var w=new Du(b,x,A,g);w._round(),i&&!zu(e,w,a,i,o)||f.push(w)}}p+=v}return u||f.length||s||(f=t(e,p/2,n,i,o,a,s,!0,c)),f}(t,p?e/2*s%e:(l/2+2*o)*a*s%e,e,c,r,h,p,!1,u)}function qu(t,e,r,n,i){for(var a=[],s=0;s=n&&p.x>=n||(h.x>=n?h=new o(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round():p.x>=n&&(p=new o(n,h.y+(n-h.x)/(p.x-h.x)*(p.y-h.y))._round()),h.y>=i&&p.y>=i||(h.y>=i?h=new o(h.x+(i-h.y)/(p.y-h.y)*(p.x-h.x),i)._round():p.y>=i&&(p=new o(h.x+(i-h.y)/(p.y-h.y)*(p.x-h.x),i)._round()),c&&h.equals(c[c.length-1])||a.push(c=[h]),c.push(p)))))}return a}function Wu(t,e,r,n){var i=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,c=a.paddedRect.h-2,l=t.right-t.left,h=t.bottom-t.top,p=a.stretchX||[[0,u]],d=a.stretchY||[[0,c]],f=function(t,e){return t+e[1]-e[0]},g=p.reduce(f,0),m=d.reduce(f,0),y=u-g,v=c-m,A=0,_=g,b=0,x=m,w=0,C=y,E=0,I=v;if(a.content&&n){var M=a.content;A=Yu(p,0,M[0]),b=Yu(d,0,M[1]),_=Yu(p,M[0],M[2]),x=Yu(d,M[1],M[3]),w=M[0]-A,E=M[1]-b,C=M[2]-M[0]-_,I=M[3]-M[1]-x}var S=function(n,i,u,c){var p=Zu(n.stretch-A,_,l,t.left),d=Ku(n.fixed-w,C,n.stretch,g),f=Zu(i.stretch-b,x,h,t.top),y=Ku(i.fixed-E,I,i.stretch,m),v=Zu(u.stretch-A,_,l,t.left),M=Ku(u.fixed-w,C,u.stretch,g),S=Zu(c.stretch-b,x,h,t.top),T=Ku(c.fixed-E,I,c.stretch,m),P=new o(p,f),O=new o(v,f),L=new o(v,S),k=new o(p,S),R=new o(d/s,y/s),D=new o(M/s,T/s),B=e*Math.PI/180;if(B){var N=Math.sin(B),F=Math.cos(B),j=[F,-N,N,F];P._matMult(j),O._matMult(j),k._matMult(j),L._matMult(j)}var z=n.stretch+n.fixed,U=i.stretch+i.fixed;return{tl:P,tr:O,bl:k,br:L,tex:{x:a.paddedRect.x+1+z,y:a.paddedRect.y+1+U,w:u.stretch+u.fixed-z,h:c.stretch+c.fixed-U},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:D,minFontScaleX:C/s/l,minFontScaleY:I/s/h,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var T=Xu(p,y,g),P=Xu(d,v,m),O=0;O0&&(f=Math.max(10,f),this.circleDiameter=f)}else{var g=a.top*s-u,m=a.bottom*s+u,y=a.left*s-u,v=a.right*s+u,A=a.collisionPadding;if(A&&(y-=A[0]*s,g-=A[1]*s,v+=A[2]*s,m+=A[3]*s),l){var _=new o(y,g),b=new o(v,g),x=new o(y,m),w=new o(v,m),C=l*Math.PI/180;_._rotate(C),b._rotate(C),x._rotate(C),w._rotate(C),y=Math.min(_.x,b.x,x.x,w.x),v=Math.max(_.x,b.x,x.x,w.x),g=Math.min(_.y,b.y,x.y,w.y),m=Math.max(_.y,b.y,x.y,w.y)}t.emplaceBack(e.x,e.y,y,g,v,m,r,n,i)}this.boxEndIndex=t.length},$u=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function tc(t,e){return te?1:0}function ec(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,a=-1/0,s=-1/0,u=t[0],c=0;ca)&&(a=l.x),(!c||l.y>s)&&(s=l.y)}var h=Math.min(a-n,s-i),p=h/2,d=new $u([],rc);if(0===h)return new o(n,i);for(var f=n;fm.d||!m.d)&&(m=v,r&&console.log("found best %d after %d probes",Math.round(1e4*v.d)/1e4,y)),v.max-m.d<=e||(d.push(new nc(v.p.x-(p=v.h/2),v.p.y-p,p,t)),d.push(new nc(v.p.x+p,v.p.y-p,p,t)),d.push(new nc(v.p.x-p,v.p.y+p,p,t)),d.push(new nc(v.p.x+p,v.p.y+p,p,t)),y+=4)}return r&&(console.log("num probes: "+y),console.log("best distance: "+m.d)),m.p}function rc(t,e){return e.max-t.max}function nc(t,e,r,n){this.p=new o(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=l.y>t.y&&t.x<(l.x-c.x)*(t.y-c.y)/(l.y-c.y)+c.x&&(r=!r),n=Math.min(n,Ko(t,c,l))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}$u.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$u.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},$u.prototype.peek=function(){return this.data[0]},$u.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n},$u.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var ic=Number.POSITIVE_INFINITY;function oc(t,e){return e[1]!==ic?function(t,e,r){var n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,i]}(t,e[0],e[1]):function(t,e){var r=0,n=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e}return[r,n]}(t,e[0])}function ac(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function sc(t,e,r,n,i,a,s,u,c,l,h,p,d,f,g){var m=function(t,e,r,n,i,a,s,u){for(var c=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,l=[],h=0,p=e.positionedLines;h32640&&C(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===y.kind&&((v=[128*f.compositeTextSizes[0].evaluate(s,{},g),128*f.compositeTextSizes[1].evaluate(s,{},g)])[0]>32640||v[1]>32640)&&C(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,v,u,a,s,l,e,c.lineStartIndex,c.lineLength,d,g);for(var A=0,_=h;A<_.length;A+=1)p[_[A]]=t.text.placedSymbolArray.length-1;return 4*m.length}function uc(t){for(var e in t)return t[e];return null}function cc(t,e,r,n){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,l=i.get("symbol-sort-key");if(this.features=[],u||c){for(var h=e.iconDependencies,p=e.glyphDependencies,d=e.availableImages,f=new si(this.zoom),g=0,m=t;g=0;for(var L=0,k=C.sections;L=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u0},yc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},yc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},yc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},yc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},yc.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Fn("SymbolBucket",yc,{omit:["layers","collisionBoxArray","features","compareText"]}),yc.MAX_GLYPHS=65535,yc.addDynamicAttributes=dc;var vc=new bi({"symbol-placement":new mi(Tt.layout_symbol["symbol-placement"]),"symbol-spacing":new mi(Tt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new mi(Tt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new yi(Tt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new mi(Tt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new mi(Tt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new mi(Tt.layout_symbol["icon-ignore-placement"]),"icon-optional":new mi(Tt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new mi(Tt.layout_symbol["icon-rotation-alignment"]),"icon-size":new yi(Tt.layout_symbol["icon-size"]),"icon-text-fit":new mi(Tt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new mi(Tt.layout_symbol["icon-text-fit-padding"]),"icon-image":new yi(Tt.layout_symbol["icon-image"]),"icon-rotate":new yi(Tt.layout_symbol["icon-rotate"]),"icon-padding":new mi(Tt.layout_symbol["icon-padding"]),"icon-keep-upright":new mi(Tt.layout_symbol["icon-keep-upright"]),"icon-offset":new yi(Tt.layout_symbol["icon-offset"]),"icon-anchor":new yi(Tt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new mi(Tt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new mi(Tt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new mi(Tt.layout_symbol["text-rotation-alignment"]),"text-field":new yi(Tt.layout_symbol["text-field"]),"text-font":new yi(Tt.layout_symbol["text-font"]),"text-size":new yi(Tt.layout_symbol["text-size"]),"text-max-width":new yi(Tt.layout_symbol["text-max-width"]),"text-line-height":new mi(Tt.layout_symbol["text-line-height"]),"text-letter-spacing":new yi(Tt.layout_symbol["text-letter-spacing"]),"text-justify":new yi(Tt.layout_symbol["text-justify"]),"text-radial-offset":new yi(Tt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new mi(Tt.layout_symbol["text-variable-anchor"]),"text-anchor":new yi(Tt.layout_symbol["text-anchor"]),"text-max-angle":new mi(Tt.layout_symbol["text-max-angle"]),"text-writing-mode":new mi(Tt.layout_symbol["text-writing-mode"]),"text-rotate":new yi(Tt.layout_symbol["text-rotate"]),"text-padding":new mi(Tt.layout_symbol["text-padding"]),"text-keep-upright":new mi(Tt.layout_symbol["text-keep-upright"]),"text-transform":new yi(Tt.layout_symbol["text-transform"]),"text-offset":new yi(Tt.layout_symbol["text-offset"]),"text-allow-overlap":new mi(Tt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new mi(Tt.layout_symbol["text-ignore-placement"]),"text-optional":new mi(Tt.layout_symbol["text-optional"])}),Ac={paint:new bi({"icon-opacity":new yi(Tt.paint_symbol["icon-opacity"]),"icon-color":new yi(Tt.paint_symbol["icon-color"]),"icon-halo-color":new yi(Tt.paint_symbol["icon-halo-color"]),"icon-halo-width":new yi(Tt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new yi(Tt.paint_symbol["icon-halo-blur"]),"icon-translate":new mi(Tt.paint_symbol["icon-translate"]),"icon-translate-anchor":new mi(Tt.paint_symbol["icon-translate-anchor"]),"text-opacity":new yi(Tt.paint_symbol["text-opacity"]),"text-color":new yi(Tt.paint_symbol["text-color"],{runtimeType:Ut,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new yi(Tt.paint_symbol["text-halo-color"]),"text-halo-width":new yi(Tt.paint_symbol["text-halo-width"]),"text-halo-blur":new yi(Tt.paint_symbol["text-halo-blur"]),"text-translate":new mi(Tt.paint_symbol["text-translate"]),"text-translate-anchor":new mi(Tt.paint_symbol["text-translate-anchor"])}),layout:vc},_c=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Nt,this.defaultValue=t};_c.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},_c.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},_c.prototype.outputDefined=function(){return!1},_c.prototype.serialize=function(){return null},Fn("FormatSectionOverride",_c,{omit:["defaultValue"]});var bc=function(t){function e(e){t.call(this,e,Ac)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;o",targetMapId:n,sourceMapId:o.mapId})}}},Dc.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else M()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e)},Dc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Dc.prototype.processTask=function(t,e){var r=this;if(""===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(Hn(e.error)):n(null,Hn(e.data)))}else{var i=!1,o=P(this.globalScope)?void 0:[],a=e.hasCallback?function(e,n){i=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?Gn(e):null,data:Gn(n,o)},o)}:function(t){i=!0},s=null,u=Hn(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],u.source)[c[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Dc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Nc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Nc.prototype.setNorthEast=function(t){return this._ne=t instanceof Fc?new Fc(t.lng,t.lat):Fc.convert(t),this},Nc.prototype.setSouthWest=function(t){return this._sw=t instanceof Fc?new Fc(t.lng,t.lat):Fc.convert(t),this},Nc.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof Fc)e=t,r=t;else{if(!(t instanceof Nc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Nc.convert(t)):this.extend(Fc.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Fc(e.lng,e.lat),this._ne=new Fc(r.lng,r.lat)),this},Nc.prototype.getCenter=function(){return new Fc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Nc.prototype.getSouthWest=function(){return this._sw},Nc.prototype.getNorthEast=function(){return this._ne},Nc.prototype.getNorthWest=function(){return new Fc(this.getWest(),this.getNorth())},Nc.prototype.getSouthEast=function(){return new Fc(this.getEast(),this.getSouth())},Nc.prototype.getWest=function(){return this._sw.lng},Nc.prototype.getSouth=function(){return this._sw.lat},Nc.prototype.getEast=function(){return this._ne.lng},Nc.prototype.getNorth=function(){return this._ne.lat},Nc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Nc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Nc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Nc.prototype.contains=function(t){var e=Fc.convert(t),r=e.lng,n=e.lat,i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i},Nc.convert=function(t){return!t||t instanceof Nc?t:new Nc(t)};var Fc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Fc.prototype.wrap=function(){return new Fc(p(this.lng,-180,180),this.lat)},Fc.prototype.toArray=function(){return[this.lng,this.lat]},Fc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Fc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},Fc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Nc(new Fc(this.lng-r,this.lat-e),new Fc(this.lng+r,this.lat+e))},Fc.convert=function(t){if(t instanceof Fc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Fc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==n(t)&&null!==t)return new Fc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var jc=2*Math.PI*6371008.8;function zc(t){return jc*Math.cos(t*Math.PI/180)}function Uc(t){return(180+t)/360}function Gc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Hc(t,e){return t/zc(e)}function Vc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Qc=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r};Qc.fromLngLat=function(t,e){void 0===e&&(e=0);var r=Fc.convert(t);return new Qc(Uc(r.lng),Gc(r.lat),Hc(e,r.lat))},Qc.prototype.toLngLat=function(){return new Fc(360*this.x-180,Vc(this.y))},Qc.prototype.toAltitude=function(){return this.z*zc(Vc(this.y))},Qc.prototype.meterInMercatorCoordinateUnits=function(){return 1/jc*(t=Vc(this.y),1/Math.cos(t*Math.PI/180));var t};var qc=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Xc(0,t,t,e,r)};qc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},qc.prototype.url=function(t,e){var r,n,i,o,a,s=(n=this.y,i=this.z,o=Bc(256*(r=this.x),256*(n=Math.pow(2,i)-n-1),i),a=Bc(256*(r+1),256*(n+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,r){for(var n,i="",o=t;o>0;o--)i+=(e&(n=1<this.canonical.z?new Yc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Yc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Yc.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Xc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Xc(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},Yc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},Yc.prototype.children=function(t){if(this.overscaledZ>=t)return[new Yc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Yc(e,this.wrap,e,r,n),new Yc(e,this.wrap,e,r+1,n),new Yc(e,this.wrap,e,r,n+1),new Yc(e,this.wrap,e,r+1,n+1)]},Yc.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Zc.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},Zc.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Zc.prototype.getPixels=function(){return new Aa({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Zc.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,c=o;c=0&&l[3]>=0&&s.insert(a,l[0],l[1],l[2],l[3])}},el.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new _s.VectorTile(new Zs(this.rawTileData)).layers,this.sourceLayerCoder=new Kc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},el.prototype.query=function(t,e,r,n){var i=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=an(a.filter),c=t.queryGeometry,l=t.queryPadding*s,h=nl(c),p=this.grid.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l),d=nl(t.cameraQueryGeometry),f=0,g=this.grid3D.query(d.minX-l,d.minY-l,d.maxX+l,d.maxY+l,(function(e,r,n,i){return function(t,e,r,n,i){for(var a=0,s=t;a=u.x&&i>=u.y)return!0}var c=[new o(e,r),new o(e,i),new o(n,i),new o(n,r)];if(t.length>2)for(var l=0,h=c;l=0)return!0;return!1}(o,h)){var p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(n);if(i.needGeometry){var g=Uo(f,!0);if(!i.filter(new si(this.tileID.overscaledZ),g,this.tileID.canonical))return}else if(!i.filter(new si(this.tileID.overscaledZ),f))return;for(var m=this.getId(f,p),y=0;yn)i=!1;else if(e)if(this.expirationTimect&&(t.getActor().send("enforceCacheSizeLimit",ut),dt=0)},t.clamp=h,t.clearTileCache=function(t){var e=s.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=qu,t.clone=function(t){var e=new aa(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=x,t.clone$2=function(t){var e=new aa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Qs,t.config=z,t.create=function(){var t=new aa(16);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new aa(9);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new aa(4);return aa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=qr,t.createLayout=Ii,t.createStyleLayer=function(t){return"custom"===t.type?new Ic(t):new Mc[t.type](t)},t.cross=function(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var i=0;i=z.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:e,callback:r,cancelled:!1,cancel:function(){this.cancelled=!0}};return mt.push(n),n}yt++;var i=!1,o=function(){if(!i)for(i=!0,yt--;mt.length&&yt0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ve,t.offscreenCanvasSupported=ft,t.ortho=function(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new Zs(t).readFields(fu,[])},t.pbf=Zs,t.performSymbolLayout=function(t,e,r,n,i,o,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var l=t.textSizeData,h=l.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new si(l.minZoom),a),u["text-size"].possiblyEvaluate(new si(h),a)]}if("composite"===t.iconSizeData.kind){var p=t.iconSizeData,d=p.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new si(p.minZoom),a),u["icon-size"].possiblyEvaluate(new si(d),a)]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new si(t.zoom+1),a),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new si(t.zoom+1),a),c.textMaxSize=u["text-size"].possiblyEvaluate(new si(18));for(var f=24*s.get("text-line-height"),g="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),m=s.get("text-keep-upright"),y=s.get("text-size"),v=function(){var o=_[A],u=s.get("text-font").evaluate(o,{},a).join(","),l=y.evaluate(o,{},a),h=c.layoutTextSize.evaluate(o,{},a),p=c.layoutIconSize.evaluate(o,{},a),d={horizontal:{},vertical:void 0},v=o.text,b=[0,0];if(v){var x=v.toString(),w=24*s.get("text-letter-spacing").evaluate(o,{},a),E=function(t){for(var e=0,r=t;e=8192||h.y<0||h.y>=8192||function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,w,E){var I,M,S,T,P,O=t.addToLineVertexArray(e,r),L=0,k=0,R=0,D=0,B=-1,N=-1,F={},j=po(""),z=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(z=(I=s.layout.get("text-offset").evaluate(_,{},w).map((function(t){return 24*t})))[0],U=I[1]):(z=24*s.layout.get("text-radial-offset").evaluate(_,{},w),U=ic),t.allowVerticalPlacement&&n.vertical){var G=s.layout.get("text-rotate").evaluate(_,{},w)+90;T=new Ju(u,e,c,l,h,n.vertical,p,d,f,G),a&&(P=new Ju(u,e,c,l,h,a,m,y,f,G))}if(i){var H=s.layout.get("icon-rotate").evaluate(_,{}),V="none"!==s.layout.get("icon-text-fit"),Q=Wu(i,H,x,V),q=a?Wu(a,H,x,V):void 0;S=new Ju(u,e,c,l,h,i,m,y,!1,H),L=4*Q.length;var W=t.iconSizeData,Y=null;"source"===W.kind?(Y=[128*s.layout.get("icon-size").evaluate(_,{})])[0]>32640&&C(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===W.kind&&((Y=[128*b.compositeIconSizes[0].evaluate(_,{},w),128*b.compositeIconSizes[1].evaluate(_,{},w)])[0]>32640||Y[1]>32640)&&C(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,Q,Y,A,v,_,!1,e,O.lineStartIndex,O.lineLength,-1,w),B=t.icon.placedSymbolArray.length-1,q&&(k=4*q.length,t.addSymbols(t.icon,q,Y,A,v,_,bu.vertical,e,O.lineStartIndex,O.lineLength,-1,w),N=t.icon.placedSymbolArray.length-1)}for(var X in n.horizontal){var Z=n.horizontal[X];if(!M){j=po(Z.text);var K=s.layout.get("text-rotate").evaluate(_,{},w);M=new Ju(u,e,c,l,h,Z,p,d,f,K)}var J=1===Z.positionedLines.length;if(R+=sc(t,e,Z,o,s,f,_,g,O,n.vertical?bu.horizontal:bu.horizontalOnly,J?Object.keys(n.horizontal):[X],F,B,b,w),J)break}n.vertical&&(D+=sc(t,e,n.vertical,o,s,f,_,g,O,bu.vertical,["vertical"],F,N,b,w));var $=M?M.boxStartIndex:t.collisionBoxArray.length,tt=M?M.boxEndIndex:t.collisionBoxArray.length,et=T?T.boxStartIndex:t.collisionBoxArray.length,rt=T?T.boxEndIndex:t.collisionBoxArray.length,nt=S?S.boxStartIndex:t.collisionBoxArray.length,it=S?S.boxEndIndex:t.collisionBoxArray.length,ot=P?P.boxStartIndex:t.collisionBoxArray.length,at=P?P.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(M,st),st=ut(T,st),st=ut(S,st);var ct=(st=ut(P,st))>-1?1:0;ct&&(st*=E/24),t.glyphOffsetArray.length>=yc.MAX_GLYPHS&&C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,B,N,j,$,tt,et,rt,nt,it,ot,at,c,R,D,L,k,ct,0,p,z,U,st)}(t,h,s,r,n,i,p,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,y,b,E,u,A,x,I,f,e,o,c,l,a)};if("line"===M)for(var O=0,L=qu(e.geometry,0,0,8192,8192);O1){var z=Vu(j,w,r.vertical||g,n,24,v);z&&P(j,z)}}else if("Polygon"===e.type)for(var U=0,G=ns(e.geometry,0);U=S.maxzoom||"none"!==S.visibility&&(s(M,this.zoom,n),(g[S.id]=S.createBucket({index:l.bucketLayerIDs.length,layers:M,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,m,this.tileID.canonical),l.bucketLayerIDs.push(M.map((function(t){return t.id}))))}}}var T=t.mapObject(m.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(T).length?i.send("getGlyphs",{uid:this.uid,stacks:T},(function(t,e){h||(h=t,p=e,L.call(u))})):p={};var P=Object.keys(m.iconDependencies);P.length?i.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,d=e,L.call(u))})):d={};var O=Object.keys(m.patternDependencies);function L(){if(h)return a(h);if(p&&d&&f){var e=new o(p),r=new t.ImageAtlas(d,f);for(var i in g){var u=g[i];u instanceof t.SymbolBucket?(s(u.layers,this.zoom,n),t.performSymbolLayout(u,p,e.positions,d,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(s(u.layers,this.zoom,n),u.addFeatures(m,this.tileID.canonical,r.patternPositions))}this.status="done",a(null,{buckets:t.values(g).filter((function(t){return!t.isEmpty()})),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?e.positions:null})}}O.length?i.send("getImages",{icons:O,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,f=e,L.call(u))})):f={},L.call(this)};var c=function(t,e,r,n){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=n||u,this.loading={},this.loaded={}};c.prototype.loadTile=function(e,r){var n=this,i=e.uid;this.loading||(this.loading={});var o=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new a(e);s.abort=this.loadVectorData(e,(function(e,a){if(delete n.loading[i],e||!a)return s.status="done",n.loaded[i]=s,r(e);var u=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var l={};if(o){var h=o.finish();h&&(l.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return r(e);r(null,t.extend({rawTileData:u.slice(0)},n,c,l))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},c.prototype.reloadTile=function(t,e){var r=this,n=this.loaded,i=t.uid,o=this;if(n&&n[i]){var a=n[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,n){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,r.availableImages,o.actor,i)),e(t,n)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},c.prototype.abortTile=function(t,e){var r=this.loading,n=t.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),e()},c.prototype.removeTile=function(t,e){var r=this.loaded,n=t.uid;r&&r[n]&&delete r[n],e()};var l=t.window.ImageBitmap,h=function(){this.loaded={}};function p(t,e){if(0!==t.length){d(t[0],e);for(var r=1;r=0!=!!e&&t.reverse()}h.prototype.loadTile=function(e,r){var n=e.uid,i=e.encoding,o=e.rawImageData,a=l&&o instanceof l?this.getImageData(o):o,s=new t.DEMData(n,a,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},h.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:r.width,height:r.height},r.data)},h.prototype.removeTile=function(t){var e=this.loaded,r=t.uid;e&&e[r]&&delete e[r]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,g=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};g.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,n=this._feature.geometry;r>31}function T(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s>1;!function t(e,r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1);t(e,r,n,Math.max(i,Math.floor(n-u*l/s+h)),Math.min(o,Math.floor(n+(s-u)*l/s+h)),a)}var p=r[2*n+a],d=i,f=o;for(O(e,r,i,n),r[2*o+a]>p&&O(e,r,i,o);dp;)f--}r[2*i+a]===p?O(e,r,i,f):O(e,r,++f,o),f<=n&&(i=f+1),n<=f&&(o=f-1)}}(e,r,s,i,o,a%2),t(e,r,n,i,s-1,a+1),t(e,r,n,s+1,o,a+1)}}(a,s,n,0,a.length-1,0)};B.prototype.range=function(t,e,r,n){return function(t,e,r,n,i,o,a){for(var s,u,c=[0,t.length-1,0],l=[];c.length;){var h=c.pop(),p=c.pop(),d=c.pop();if(p-d<=a)for(var f=d;f<=p;f++)u=e[2*f+1],(s=e[2*f])>=r&&s<=i&&u>=n&&u<=o&&l.push(t[f]);else{var g=Math.floor((d+p)/2);u=e[2*g+1],(s=e[2*g])>=r&&s<=i&&u>=n&&u<=o&&l.push(t[g]);var m=(h+1)%2;(0===h?r<=s:n<=u)&&(c.push(d),c.push(g-1),c.push(m)),(0===h?i>=s:o>=u)&&(c.push(g+1),c.push(p),c.push(m))}}return l}(this.ids,this.coords,t,e,r,n,this.nodeSize)},B.prototype.within=function(t,e,r){return function(t,e,r,n,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var c=a.pop(),l=a.pop(),h=a.pop();if(l-h<=o)for(var p=h;p<=l;p++)k(e[2*p],e[2*p+1],r,n)<=u&&s.push(t[p]);else{var d=Math.floor((h+l)/2),f=e[2*d],g=e[2*d+1];k(f,g,r,n)<=u&&s.push(t[d]);var m=(c+1)%2;(0===c?r-i<=f:n-i<=g)&&(a.push(h),a.push(d-1),a.push(m)),(0===c?r+i>=f:n+i>=g)&&(a.push(d+1),a.push(l),a.push(m))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)};var N={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},F=function(t){this.options=Q(Object.create(N),t),this.trees=new Array(this.options.maxZoom+1)};function j(t,e,r,n,i){return{x:t,y:e,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function z(t,e){var r=t.geometry.coordinates,n=r[1];return{x:H(r[0]),y:V(n),zoom:1/0,index:e,parentId:-1}}function U(t){return{type:"Feature",id:t.id,properties:G(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,r=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var e,r,n}function G(t){var e=t.numPoints,r=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return Q(Q({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function H(t){return t/360+.5}function V(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function Q(t,e){for(var r in e)t[r]=e[r];return t}function q(t){return t.x}function W(t){return t.y}function Y(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return(a=t-r)*a+(s=e-n)*s}function X(t,e,r,n){var i={id:void 0===t?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)Z(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n0&&(a+=n?(i*c-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(c-o,2))),i=u,o=c}var l=e.length-3;e[2]=1,function t(e,r,n,i){for(var o,a=i,s=n-r>>1,u=n-r,c=e[r],l=e[r+1],h=e[n],p=e[n+1],d=r+3;da)o=d,a=f;else if(f===a){var g=Math.abs(d-s);gi&&(o-r>3&&t(e,r,o,i),e[o+2]=a,n-o>3&&t(e,o,n,i))}(e,0,l,r),e[l+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function tt(t,e,r,n){for(var i=0;i1?1:r}function nt(t,e,r,n,i,o,a,s){if(n/=e,o>=(r/=e)&&a=n)return null;for(var u=[],c=0;c=r&&f=n)){var g=[];if("Point"===p||"MultiPoint"===p)it(h,g,r,n,i);else if("LineString"===p)ot(h,g,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)st(h,g,r,n,i,!1);else if("Polygon"===p)st(h,g,r,n,i,!0);else if("MultiPolygon"===p)for(var m=0;m=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function ot(t,e,r,n,i,o,a){for(var s,u,c=at(t),l=0===i?ct:lt,h=t.start,p=0;pr&&(u=l(c,d,f,m,y,r),a&&(c.start=h+s*u)):v>n?A=r&&(u=l(c,d,f,m,y,r),_=!0),A>n&&v<=n&&(u=l(c,d,f,m,y,n),_=!0),!o&&_&&(a&&(c.end=h+s*u),e.push(c),c=at(t)),a&&(h+=s)}var b=t.length-3;d=t[b],f=t[b+1],g=t[b+2],(v=0===i?d:f)>=r&&v<=n&&ut(c,d,f,g),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&ut(c,c[0],c[1],c[2]),c.length&&e.push(c)}function at(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function st(t,e,r,n,i,o){for(var a=0;aa.maxX&&(a.maxX=l),h>a.maxY&&(a.maxY=h)}return a}function mt(t,e,r,n){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:n))r.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;i&&function(t,e){for(var r=0,n=0,i=t.length,o=i-2;n0===e)for(n=0,i=t.length;n24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n=n;c--){var l=+Date.now();s=this._cluster(s,c),this.trees[c]=new B(s,q,W,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-l)}return r&&console.timeEnd("total time"),this},F.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),i=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)r=-180,i=180;else if(r>i){var a=this.getClusters([r,n,180,o],e),s=this.getClusters([-180,n,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],c=[],l=0,h=u.range(H(r),V(o),H(i),V(n));le&&(p+=g.numPoints||1)}if(p>=o){for(var m=u.x*h,y=u.y*h,v=i&&h>1?this._map(u,!0):null,A=(s<<5)+(e+1)+this.points.length,_=0,b=l;_1)for(var C=0,E=l;C>5},F.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},F.prototype._map=function(t,e){if(t.numPoints)return e?Q({},t.properties):t.properties;var r=this.points[t.index].properties,n=this.options.map(r);return e&&n===r?Q({},n):n},vt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},vt.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],u=this.options,c=u.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var l=1<1&&console.time("creation"),p=this.tiles[h]=gt(t,e,r,n,u),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+e;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var f=1<1&&console.time("clipping");var g,m,y,v,A,_,b=.5*u.buffer/u.extent,x=.5-b,w=.5+b,C=1+b;g=m=y=v=null,A=nt(t,l,r-b,r+w,0,p.minX,p.maxX,u),_=nt(t,l,r+x,r+C,0,p.minX,p.maxX,u),t=null,A&&(g=nt(A,l,n-b,n+w,1,p.minY,p.maxY,u),m=nt(A,l,n+x,n+C,1,p.minY,p.maxY,u),A=null),_&&(y=nt(_,l,n-b,n+w,1,p.minY,p.maxY,u),v=nt(_,l,n+x,n+C,1,p.minY,p.maxY,u),_=null),c>1&&console.timeEnd("clipping"),s.push(g||[],e+1,2*r,2*n),s.push(m||[],e+1,2*r,2*n+1),s.push(y||[],e+1,2*r+1,2*n),s.push(v||[],e+1,2*r+1,2*n+1)}}},vt.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,c=t,l=e,h=r;!u&&c>0;)c--,l=Math.floor(l/2),h=Math.floor(h/2),u=this.tiles[At(c,l,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,l,h),o>1&&console.time("drilling down"),this.splitTile(u.source,c,l,h,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?dt(this.tiles[s],i):null):null};var bt=function(e){function r(t,r,n,i){e.call(this,t,r,n,_t),i&&(this.loadGeoJSON=i)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,i=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var o=!!(i&&i.request&&i.request.collectResourceTiming)&&new t.RequestPerformance(i.request);this.loadGeoJSON(i,(function(a,s){if(a||!s)return r(a);if("object"!=n(s))return r(new Error("Input data given to '"+i.source+"' is not a valid GeoJSON object."));!function t(e,r){var n,i=e&&e.type;if("FeatureCollection"===i)for(n=0;n=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var d=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1))}function v(t,e,r,n,i,o,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:r,id:i,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],_.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var i=0,a=u;i1&&(s=t[++a]);var c=Math.abs(u-s.left),l=Math.abs(u-s.right),h=Math.min(c,l),p=void 0,d=i/r*(n+1);if(s.isDash){var f=n-Math.abs(d);p=Math.sqrt(h*h+f*f)}else p=n-Math.sqrt(h*h+d*d);this.data[o+u]=Math.max(0,Math.min(255,p+128))}},C.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var r=t[e],n=t[e+1];r.zeroLength?t.splice(e,1):n&&n.isDash===r.isDash&&(n.left=r.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],c=0;c1&&(u=t[++s]);var l=Math.abs(c-u.left),h=Math.abs(c-u.right),p=Math.min(l,h);this.data[a+c]=Math.max(0,Math.min(255,(u.isDash?p:-p)+128))}},C.prototype.addDash=function(e,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=n&&e.x=i&&e.y0&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,i,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+10&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)r.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},n),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var n=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(t,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),e(t))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var n=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(t.Evented),L=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),k=function(e){function r(t,r,n,i){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(e,r){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,o){n._loaded=!0,i?n.fire(new t.ErrorEvent(i)):o&&(n.image=o,e&&(n.coordinates=e),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(t){this.map=t,this.load()},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var r=1/0,n=1/0,i=-1/0,o=-1/0,a=0,s=e;ar.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(k),D=function(e){function r(r,n,i,o){e.call(this,r,n,i,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,L.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},z.prototype.has=function(t){return t.wrapped().key in this.data},z.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},z.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},z.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},z.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},z.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,n=void 0===e?0:this.data[r].indexOf(e),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},z.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},z.prototype.filter=function(t){var e=[];for(var r in this.data)for(var n=0,i=this.data[r];n1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype._retainLoadedChildren=function(t,e,r,n){for(var i in this._tiles){var o=this._tiles[i];if(!(n[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){n[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var n=t.overscaledZ-1;n>=e;n--){var i=t.scaledTo(n),o=this._getLoadedTile(i);if(o)return o}},r.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},r.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(e*r*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(i)},r.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r={};for(var n in this._tiles){var i=this._tiles[n];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),r[i.tileID.key]=i}for(var o in this._tiles=r,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},r.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return n._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-r.maxOverzooming,this._source.minzoom),s=Math.max(o+r.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(kt(this._source.type)){for(var c={},l={},h=0,p=Object.keys(u);hthis._source.maxzoom){var m=f.children(this._source.maxzoom)[0],y=this.getTile(m);if(y&&y.hasData()){n[m.key]=m;continue}}else{var v=f.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var A=g.wasRequested(),_=f.overscaledZ-1;_>=o;--_){var b=f.scaledTo(_);if(i[b.key])break;if(i[b.key]=!0,!(g=this.getTile(b))&&A&&(g=this._addTile(b)),g&&(n[b.key]=b,A=g.wasRequested(),g.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}e.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var o=0,a=e;o0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},r.prototype.tilesIn=function(e,r,n){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=n?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),c=s.map((function(t){return a.pointCoordinate(t)})),l=this.getIds(),h=1/0,p=1/0,d=-1/0,f=-1/0,g=0,m=c;g=0&&y[1].y+m>=0){var v=u.map((function(t){return s.getTilePoint(t)})),A=c.map((function(t){return s.getTilePoint(t)}));o.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:A,scale:g})}}},A=0;A=t.browser.now())return!0}return!1},r.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},r.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},r.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},r.prototype.setDependencies=function(t,e,r){var n=this._tiles[t];n&&n.setDependencies(e,r)},r.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},r}(t.Evented);function Lt(t,e){var r=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function kt(t){return"raster"===t||"image"===t||"video"===t}function Rt(){return new t.window.Worker(Zi.workerUrl)}Ot.maxOverzooming=10,Ot.maxUnderzooming=3;var Dt="mapboxgl_preloaded_worker_pool",Bt=function(){this.active={}};Bt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-a)/s:0;return this.points[o].mult(1-u).add(this.points[r].mult(u))};var Kt=function(t,e,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o=-e[0]&&r<=e[0]&&n>=-e[1]&&n<=e[1]}function ne(e,r,n,i,o,a,s,u){var c=i?e.textSizeData:e.iconSizeData,l=t.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],p=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var d=e.lineVertexArray,f=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,g=n.transform.width/n.transform.height,m=!1,y=0;yMath.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?r.yn.x)?{needsFlipping:!0}:null}function ae(e,r,n,i,o,a,s,u,c,l,h,p,d,f){var g,m=r/24,y=e.lineOffsetX*m,v=e.lineOffsetY*m;if(e.numGlyphs>1){var A=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,x=ie(m,u,y,v,n,h,p,e,c,a,d);if(!x)return{notEnoughRoom:!0};var w=te(x.first.point,s).point,C=te(x.last.point,s).point;if(i&&!n){var E=oe(e.writingMode,w,C,f);if(E)return E}g=[x.first];for(var I=e.glyphStartIndex+1;I0?P.point:se(p,T,M,1,o),L=oe(e.writingMode,M,O,f);if(L)return L}var k=ue(m*u.getoffsetX(e.glyphStartIndex),y,v,n,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,d);if(!k)return{notEnoughRoom:!0};g=[k]}for(var R=0,D=g;R0?1:-1,g=0;i&&(f*=-1,g=Math.PI),f<0&&(g+=Math.PI);for(var m=f>0?u+s:u+s+1,y=o,v=o,A=0,_=0,b=Math.abs(d),x=[];A+_<=b;){if((m+=f)=c)return null;if(v=y,x.push(y),void 0===(y=p[m])){var w=new t.Point(l.getx(m),l.gety(m)),C=te(w,h);if(C.signedDistanceFromCamera>0)y=p[m]=C.point;else{var E=m-f;y=se(0===A?a:new t.Point(l.getx(E),l.gety(E)),w,v,b-A+1,h)}}A+=_,_=v.dist(y)}var I=(b-A)/_,M=y.sub(v),S=M.mult(I)._add(v);S._add(M._unit()._perp()._mult(n*f));var T=g+Math.atan2(y.y-v.y,y.x-v.x);return x.push(S),{point:S,angle:T,path:x}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,r,n){this._forEachCell(e-n,r-n,e+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,r,n,i,o){this.boxCells[i].push(o)},Kt.prototype._insertCircleCell=function(t,e,r,n,i,o){this.circleCells[i].push(o)},Kt.prototype._query=function(t,e,r,n,i,o){if(r<0||t>this.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:a},Kt.prototype._queryCircle=function(t,e,r,n,i){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!n&&[];var c=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,c,{hitTest:n,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},i),n?c.length>0:c},Kt.prototype.query=function(t,e,r,n,i){return this._query(t,e,r,n,!1,i)},Kt.prototype.hitTest=function(t,e,r,n,i){return this._query(t,e,r,n,!0,i)},Kt.prototype.hitTestCircle=function(t,e,r,n){return this._queryCircle(t,e,r,!0,n)},Kt.prototype._queryCell=function(t,e,r,n,i,o,a,s){var u=a.seenUids,c=this.boxCells[i];if(null!==c)for(var l=this.bboxes,h=0,p=c;h=l[f+0]&&n>=l[f+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[d],x1:l[f],y1:l[f+1],x2:l[f+2],y2:l[f+3]})}}}var g=this.circleCells[i];if(null!==g)for(var m=this.circles,y=0,v=g;ya*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,r,n,i,o,a){var s=(o-n)/2,u=Math.abs(t-(n+s));if(u>s+r)return!1;var c=(a-i)/2,l=Math.abs(e-(i+c));if(l>c+r)return!1;if(u<=s||l<=c)return!0;var h=u-s,p=l-c;return h*h+p*p<=r*r};var ce=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function le(t,e){for(var r=0;r=1;O--)P.push(S.path[O]);for(var L=1;L0){for(var B=P[0].clone(),N=P[0].clone(),F=1;F=E.x&&N.x<=I.x&&B.y>=E.y&&N.y<=I.y?[P]:N.xI.x||N.yI.y?[]:t.clipLine([P],E.x,E.y,I.x,I.y)}for(var j=0,z=D;j=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},pe.prototype.isInsideGrid=function(t,e,r,n){return r>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(g=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:m,width:r,height:n,anchor:t,textBoxScale:i,prevAnchor:g},this.markUsedJustification(p,t,h,d),p.allowVerticalPlacement&&(this.markUsedOrientation(p,d,h),this.placedOrientations[h.crossTileID]=d),{shift:y,placedGlyphBoxes:v}):void 0},xe.prototype.placeLayerBucketPart=function(e,r,n){var i=this,o=e.parameters,a=o.bucket,s=o.layout,u=o.posMatrix,c=o.textLabelPlaneMatrix,l=o.labelToScreenMatrix,h=o.textPixelRatio,p=o.holdingForFade,d=o.collisionBoxArray,f=o.partiallyEvaluatedTextSize,g=o.collisionGroup,m=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),A=s.get("icon-allow-overlap"),_="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),x="none"!==s.get("icon-text-fit"),w="viewport-y"===s.get("symbol-z-order"),C=v&&(A||!a.hasIconData()||y),E=A&&(v||!a.hasTextData()||m);!a.collisionArrays&&d&&a.deserializeCollisionBoxes(d);var I=function(e,o){if(!r[e.crossTileID])if(p)i.placements[e.crossTileID]=new me(!1,!1,!1);else{var d,w=!1,I=!1,M=!0,S=null,T={box:null,offscreen:null},P={box:null,offscreen:null},O=null,L=null,k=0,R=0,D=0;o.textFeatureIndex?k=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(k=e.featureIndex),o.verticalTextFeatureIndex&&(R=o.verticalTextFeatureIndex);var B=o.textBox;if(B){var N=function(r){var n=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!r&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,n=o,e))}return n},F=function(r,n){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i0&&(j=j.filter((function(t){return t!==z.anchor}))).unshift(z.anchor)}var U=function(t,r,n){for(var o=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,l=x&&!A?r:null,p={box:[],offscreen:!1},d=v?2*j.length:j.length,f=0;f=j.length,e,a,n,l);if(m&&(p=m.placedGlyphBoxes)&&p.box&&p.box.length){w=!0,S=m.shift;break}}return p};F((function(){return U(B,o.iconBox,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&!(T&&T.box&&T.box.length)&&e.numVerticalGlyphVertices>0&&r?U(r,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),T&&(w=T.box,M=T.offscreen);var G=N(T&&T.box);if(!w&&i.prevPlacement){var H=i.prevPlacement.variableOffsets[e.crossTileID];H&&(i.variableOffsets[e.crossTileID]=H,i.markUsedJustification(a,H.anchor,e,G))}}else{var V=function(t,r){var n=i.collisionIndex.placeCollisionBox(t,v,h,u,g.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(a,r,e),i.placedOrientations[e.crossTileID]=r),n};F((function(){return V(B,t.WritingMode.horizontal)}),(function(){var r=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?V(r,t.WritingMode.vertical):{box:null,offscreen:null}})),N(T&&T.box&&T.box.length)}}if(w=(d=T)&&d.box&&d.box.length>0,M=d&&d.offscreen,e.useRuntimeCollisionCircles){var Q=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),q=t.evaluateSizeForFeature(a.textSizeData,f,Q),W=s.get("text-padding");O=i.collisionIndex.placeCollisionCircles(v,Q,a.lineVertexArray,a.glyphOffsetArray,q,u,c,l,n,b,g.predicate,e.collisionCircleDiameter,W),w=v||O.circles.length>0&&!O.collisionDetected,M=M&&O.offscreen}if(o.iconFeatureIndex&&(D=o.iconFeatureIndex),o.iconBox){var Y=function(t){var e=x&&S?be(t,S.x,S.y,_,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,A,h,u,g.predicate)};I=P&&P.box&&P.box.length&&o.verticalIconBox?(L=Y(o.verticalIconBox)).box.length>0:(L=Y(o.iconBox)).box.length>0,M=M&&L.offscreen}var X=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,Z=y||0===e.numIconVertices;if(X||Z?Z?X||(I=I&&w):w=I&&w:I=w=I&&w,w&&d&&d.box&&i.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),a.bucketInstanceId,P&&P.box&&R?R:k,g.ID),I&&L&&i.collisionIndex.insertCollisionBox(L.box,s.get("icon-ignore-placement"),a.bucketInstanceId,D,g.ID),O&&(w&&i.collisionIndex.insertCollisionCircles(O.circles,s.get("text-ignore-placement"),a.bucketInstanceId,k,g.ID),n)){var K=a.bucketInstanceId,J=i.collisionCircleArrays[K];void 0===J&&(J=i.collisionCircleArrays[K]=new ye);for(var $=0;$=0;--S){var T=M[S];I(a.symbolInstances.get(T),a.collisionArrays[T])}else for(var P=e.symbolInstanceStart;P=0&&(e.text.placedSymbolArray.get(u).crossTileID=o>=0&&u!==o?0:n.crossTileID)}},xe.prototype.markUsedOrientation=function(e,r,n){for(var i=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=r===t.WritingMode.vertical?r:0,a=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];a0,v=i.placedOrientations[o.crossTileID],A=v===t.WritingMode.vertical,_=v===t.WritingMode.horizontal||v===t.WritingMode.horizontalOnly;if(s>0||u>0){var b=Oe(m.text);f(e.text,s,A?Le:b),f(e.text,u,_?Le:b);var x=m.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=x||A?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=x||_?1:0);var w=i.variableOffsets[o.crossTileID];w&&i.markUsedJustification(e,w.anchor,o,v);var C=i.placedOrientations[o.crossTileID];C&&(i.markUsedJustification(e,"left",o,C),i.markUsedOrientation(e,C,o))}if(y){var E=Oe(m.icon),I=!(p&&o.verticalPlacedIconSymbolIndex&&A);o.placedIconSymbolIndex>=0&&(f(e.icon,o.numIconVertices,I?E:Le),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=m.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(f(e.icon,o.numVerticalIconVertices,I?Le:E),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var M=e.collisionArrays[n];if(M){var S=new t.Point(0,0);if(M.textBox||M.verticalTextBox){var T=!0;if(c){var P=i.variableOffsets[g];P?(S=_e(P.anchor,P.width,P.height,P.textOffset,P.textBoxScale),l&&S._rotate(h?i.transform.angle:-i.transform.angle)):T=!1}M.textBox&&we(e.textCollisionBox.collisionVertexArray,m.text.placed,!T||A,S.x,S.y),M.verticalTextBox&&we(e.textCollisionBox.collisionVertexArray,m.text.placed,!T||_,S.x,S.y)}var O=Boolean(!_&&M.verticalIconBox);M.iconBox&&we(e.iconCollisionBox.collisionVertexArray,m.icon.placed,O,p?S.x:0,p?S.y:0),M.verticalIconBox&&we(e.iconCollisionBox.collisionVertexArray,m.icon.placed,!O,p?S.x:0,p?S.y:0)}}},m=0;mt},xe.prototype.setStale=function(){this.stale=!0};var Ce=Math.pow(2,25),Ee=Math.pow(2,24),Ie=Math.pow(2,17),Me=Math.pow(2,16),Se=Math.pow(2,9),Te=Math.pow(2,8),Pe=Math.pow(2,1);function Oe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*Ce+e*Ee+r*Ie+e*Me+r*Se+e*Te+r*Pe+e}var Le=0,ke=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ke.prototype.continuePlacement=function(t,e,r,n,i){for(var o=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new ke(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Re.prototype.commit=function(t){return this.placement.commit(t),this.placement};var De=512/t.EXTENT/2,Be=function(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;nt.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var c=a[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var l=0;l1?"@2x":"",u=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,l())})),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,a||(a=t,o=e,l())}));function l(){if(a)n(a);else if(i&&o){var e=t.browser.getImageData(o),r={};for(var s in i){var u=i[s],c=u.width,l=u.height,h=u.x,p=u.y,d=u.sdf,f=u.pixelRatio,g=u.stretchX,m=u.stretchY,y=u.content,v=new t.RGBAImage({width:c,height:l});t.RGBAImage.copy(e,v,{x:h,y:p},{x:0,y:0},{width:c,height:l}),r[s]={data:v,pixelRatio:f,sdf:d,stretchX:g,stretchY:m,content:y}}n(null,r)}}return{cancel:function(){u&&(u.cancel(),u=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new t.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(e){var r=this.sourceCaches[e.source];if(r){var n=e.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(t){for(var e=[],r=0,n=t;r0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},r.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,r,null,n))){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var o=this.sourceCaches[e]=new Ot(e,r,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var o=e.id;if(this.getLayer(o))this.fire(new t.ErrorEvent(new Error('Layer with id "'+o+'" already exists on this map')));else{var a;if("custom"===e.type){if(ze(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e)}else{if("object"==n(e.source)&&(this.addSource(o,e.source),e=t.clone$1(e),e=t.extend(e,{source:o})),this._validate(t.validateStyle.layer,"layers."+o,e,{arrayIndex:-1},i))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:o}}),this._serializedLayers[a.id]=a.serialize()}var s=r?this._order.indexOf(r):this._order.length;if(r&&-1===s)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(s,0,o),this._layerOrderChanged=!0,this._layers[o]=a,this._removedLayers[o]&&a.source&&"custom"!==a.type){var u=this._removedLayers[o];delete this._removedLayers[o],u.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var n=this._order.indexOf(e);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.hasLayer=function(t){return t in this._layers},r.prototype.setLayerZoomRange=function(e,r,n){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(e,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=t.clone$1(r),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),n)||(o.setLayoutProperty(r,n,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(e,r){var n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(e,r,n,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),n)||(o.setPaintProperty(r,n,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=e.sourceLayer,o=this.sourceCaches[n];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var n=e.source,i=this.sourceCaches[n];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(a,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},r.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},n={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(r(a)){n[a]=o;for(var s=0,u=t;s=0;d--){var f=this._order[d];if(r(f))for(var g=i.length-1;g>=0;g--){var m=i[g].feature;if(n[m.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),tr=vr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),er=vr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),rr=vr("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),nr=vr("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ir=vr("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),or=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),ar=vr("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),sr=vr("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),ur=vr("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),cr=vr("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),lr=vr("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),pr=vr("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),dr=vr("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),fr=vr("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),gr=vr("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),mr=vr("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),yr=vr("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function vr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(r,(function(t,e,r,n,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,n,i){var o="float"===n?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+o+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:a}}var Ar=Object.freeze({__proto__:null,prelude:qe,background:We,backgroundPattern:Ye,circle:Xe,clippingMask:Ze,heatmap:Ke,heatmapTexture:Je,collisionBox:$e,collisionCircle:tr,debug:er,fill:rr,fillOutline:nr,fillOutlinePattern:ir,fillPattern:or,fillExtrusion:ar,fillExtrusionPattern:sr,hillshadePrepare:ur,hillshade:cr,line:lr,lineGradient:hr,linePattern:pr,lineSDF:dr,raster:fr,symbolIcon:gr,symbolSDF:mr,symbolTextAndIcon:yr}),_r=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function br(t){for(var e=[],r=0;r>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}xr.prototype.draw=function(t,e,r,n,i,o,a,s,u,c,l,h,p,d,f,g){var m,y=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(n),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);d&&d.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var A=(m={},m[y.LINES]=2,m[y.TRIANGLES]=3,m[y.LINE_STRIP]=1,m)[e],_=0,b=l.get();_0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Hr(i.paint.get("raster-hue-rotate"))};var o,a};function Hr(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Vr,Qr=function(t,e,r,n,i,o,a,s,u,c){var l=i.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:l.cameraToCenterDistance,u_pitch:l.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:l.width/l.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},qr=function(e,r,n,i,o,a,s,u,c,l,h){var p=o.transform;return t.extend(Qr(e,r,n,i,o,a,s,u,c,l),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Wr=function(e,r,n,i,o,a,s,u,c,l){return t.extend(qr(e,r,n,i,o,a,s,u,!0,c,!0),{u_texsize_icon:l,u_texture_icon:1})},Yr=function(t,e,r){return{u_matrix:t,u_opacity:e,u_color:r}},Xr=function(e,r,n,i,o,a){return t.extend(function(t,e,r,n){var i=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),a=r.imageManager.getPixelSize(),s=a.width,u=a.height,c=Math.pow(2,n.tileID.overscaledZ),l=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=l*(n.tileID.canonical.x+n.tileID.wrap*c),p=l*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/de(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,a,n,o),{u_matrix:e,u_opacity:r})},Zr={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function Kr(e,r,n,i,o,a,s){for(var u=e.context,c=u.gl,l=e.useProgram("collisionBox"),h=[],p=0,d=0,f=0;f0){var b=t.create(),x=v;t.mul(b,y.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,y.placementViewportMatrix),h.push({circleArray:_,circleOffset:d,transform:x,invTransform:b}),d=p+=_.length/4}A&&l.draw(u,c.LINES,It.disabled,Mt.disabled,e.colorModeForRenderPass(),Tt.disabled,Or(v,e.transform,m),n.id,A.layoutVertexBuffer,A.indexBuffer,A.segments,null,e.transform.zoom,null,null,A.collisionVertexBuffer)}}if(s&&h.length){var w=e.useProgram("collisionCircle"),C=new t.StructArrayLayout2f1f2i16;C.resize(4*p),C._trim();for(var E=0,I=0,M=h;I=0&&(g[y.associatedIconIndex]={shiftedAnchor:C,angle:E})}else le(y.numGlyphs,d)}if(h){f.clear();for(var M=e.icon.placedSymbolArray,S=0;S0){var s=t.browser.now(),u=(s-e.timeAdded)/a,c=r?(s-r.timeAdded)/a:-1,l=n.getSource(),h=o.coveringZoomLevel({tileSize:l.tileSize,roundZoom:l.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),d=p&&e.refreshedUponExpiration?1:t.clamp(p?u:1-c,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}var ln=new t.Color(1,0,0,1),hn=new t.Color(0,1,0,1),pn=new t.Color(0,0,1,1),dn=new t.Color(1,0,1,1),fn=new t.Color(0,1,1,1);function gn(t,e,r,n){yn(t,0,e+r/2,t.transform.width,r,n)}function mn(t,e,r,n){yn(t,e-r/2,0,r,t.transform.height,n)}function yn(e,r,n,i,o,a){var s=e.context,u=s.gl;u.enable(u.SCISSOR_TEST),u.scissor(r*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),u.disable(u.SCISSOR_TEST)}function vn(e,r,n){var i=e.context,o=i.gl,a=n.posMatrix,s=e.useProgram("debug"),u=It.disabled,c=Mt.disabled,l=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,u,c,l,Tt.disabled,kr(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=r.getTileByID(n.key).latestRawTileData,p=Math.floor((h&&h.byteLength||0)/1024),d=r.getTile(n).tileSize,f=512/Math.min(d,512)*(n.overscaledZ/e.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,n=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,g+" "+p+"kb"),s.draw(i,o.TRIANGLES,u,c,St.alphaBlended,Tt.disabled,kr(a,t.Color.transparent,f),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var An={symbol:function(e,r,n,i,o){if("translucent"===e.renderPass){var a=Mt.disabled,s=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,r,n,i,o,a,s){for(var u=r.transform,c="map"===o,l="map"===a,h=0,p=e;h256&&this.clearStencil(),r.setColorMode(St.disabled),r.setDepthMode(It.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Mt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Mt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},_n.prototype.stencilConfigForOverlap=function(t){var e,r=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=n[n.length-1].overscaledZ,o=n[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s=0;this.currentLayer--){var _=this.style._layers[i[this.currentLayer]],b=o[_.source],x=l[_.source];this._renderTileClippingMasks(_,x),this.renderLayer(this,b,_,x)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},_n.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),r=this.imageManager.getPattern(t.to.toString());return!e||!r},_n.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new xr(this.context,t,Ar[t],e,Zr[t],this._showOverdrawInspector)),this.cache[r]},_n.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},_n.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},_n.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},_n.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var bn=function(t,e){this.points=t,this.planes=e};bn.fromInvProjectionMatrix=function(e,r,n){var i=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*i)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),n=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],r,n)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new bn(o,a)};var xn=function(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};xn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],n=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o=0;if(0===a)return 0;a!==r.length&&(n=!1)}if(n)return 2;for(var u=0;u<3;u++){for(var c=Number.MAX_VALUE,l=-Number.MAX_VALUE,h=0;hthis.max[u]-this.min[u])return 0}return 1};var wn=function(t,e,r,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=n};wn.prototype.interpolate=function(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,n)),this},wn.prototype.getCenter=function(e,r){var n=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+r-this.bottom)/2,0,r);return new t.Point(n,i)},wn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},wn.prototype.clone=function(){return new wn(this.top,this.bottom,this.left,this.right)},wn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Cn=function(e,r,n,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={}},En={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Cn.prototype.clone=function(){var t=new Cn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},En.minZoom.get=function(){return this._minZoom},En.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},En.maxZoom.get=function(){return this._maxZoom},En.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},En.minPitch.get=function(){return this._minPitch},En.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},En.maxPitch.get=function(){return this._maxPitch},En.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},En.renderWorldCopies.get=function(){return this._renderWorldCopies},En.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},En.worldSize.get=function(){return this.tileSize*this.scale},En.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},En.size.get=function(){return new t.Point(this.width,this.height)},En.bearing.get=function(){return-this.angle/Math.PI*180},En.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},En.pitch.get=function(){return this._pitch/Math.PI*180},En.pitch.set=function(e){var r=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},En.fov.get=function(){return this._fov/Math.PI*180},En.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},En.zoom.get=function(){return this._zoom},En.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},En.center.get=function(){return this._center},En.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},En.padding.get=function(){return this._edgeInsets.toJSON()},En.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},En.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Cn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Cn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},Cn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Cn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,o.x,a.x)),u=Math.floor(Math.max(n.x,i.x,o.x,a.x)),c=s-1;c<=u+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},Cn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),n=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=[o*i.x,o*i.y,0],s=bn.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),u=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(u=r);var c=function(t){return{aabb:new xn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},l=[],h=[],p=r,d=e.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var f=1;f<=3;f++)l.push(c(-f)),l.push(c(f));for(l.push(c(0));l.length>0;){var g=l.pop(),m=g.x,y=g.y,v=g.fullyVisible;if(!v){var A=g.aabb.intersects(s);if(0===A)continue;v=2===A}var _=g.aabb.distanceX(a),b=g.aabb.distanceY(a),x=Math.max(Math.abs(_),Math.abs(b));if(g.zoom===p||x>3+(1<=u)h.push({tileID:new t.OverscaledTileID(g.zoom===p?d:g.zoom,g.wrap,g.zoom,m,y),distanceSq:t.sqrLen([a[0]-.5-m,a[1]-.5-y])});else for(var w=0;w<4;w++){var C=(m<<1)+w%2,E=(y<<1)+(w>>1);l.push({aabb:g.aabb.quadrant(w),zoom:g.zoom+1,x:C,y:E,wrap:g.wrap,fullyVisible:v})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Cn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},En.unmodified.get=function(){return this._unmodified},Cn.prototype.zoomScale=function(t){return Math.pow(2,t)},Cn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Cn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},Cn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},En.point.get=function(){return this.project(this.center)},Cn.prototype.setLocationAtPoint=function(e,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(n.x-i.x),o.y-(n.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},Cn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Cn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Cn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},Cn.prototype.coordinateLocation=function(t){return t.toLngLat()},Cn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],o=n[3],a=r[1]/i,s=n[1]/o,u=r[2]/i,c=n[2]/o,l=u===c?0:(0-u)/(c-u);return new t.MercatorCoordinate(t.number(r[0]/i,n[0]/o,l)/this.worldSize,t.number(a,s,l)/this.worldSize)},Cn.prototype.coordinatePoint=function(e){var r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix),new t.Point(r[0]/r[3],r[1]/r[3])},Cn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Cn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Cn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Cn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,r?this.alignedProjMatrix:this.projMatrix,u),i[n]=new Float32Array(u),i[n]},Cn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Cn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,n,i,o=-90,a=90,s=-180,u=180,c=this.size,l=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(a=t.mercatorYfromLat(h[0])*this.worldSize)-oa&&(i=a-m)}if(this.lngRange){var y=d.x,v=c.x/2;y-vu&&(n=u-v)}void 0===n&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==n?n:d.x,void 0!==i?i:d.y))),this._unmodified=l,this._constraining=!1}},Cn.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,n=this._fov*(.5+e.y/this.height),i=Math.sin(n)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-n,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),c=this.height/50,l=new Float64Array(16);t.perspective(l,this._fov,this.width/this.height,c,u),l[8]=2*-e.x/this.width,l[9]=2*e.y/this.height,t.scale(l,l,[1,-1,1]),t.translate(l,l,[0,0,-this.cameraToCenterDistance]),t.rotateX(l,l,this._pitch),t.rotateZ(l,l,this.angle),t.translate(l,l,[-a,-s,0]),this.mercatorMatrix=t.scale([],l,[this.worldSize,this.worldSize,this.worldSize]),t.scale(l,l,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=l,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,p=this.height%2/2,d=Math.cos(this.angle),f=Math.sin(this.angle),g=a-Math.round(a)+d*h+f*p,m=s-Math.round(s)+d*p+f*h,y=new Float64Array(l);if(t.translate(y,y,[g>.5?g-1:g,m>.5?m-1:m,0]),this.alignedProjMatrix=y,l=t.create(),t.scale(l,l,[this.width/2,-this.height/2,1]),t.translate(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=t.create(),t.scale(l,l,[1,-1,1]),t.translate(l,l,[-1,-1,0]),t.scale(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(l=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Cn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Cn.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},Cn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var n=r.x,i=r.y,o=r.x,a=r.y,s=0,u=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},In.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Mn={linearity:.3,easing:t.bezier(0,0,.3,1)},Sn=t.extend({deceleration:2500,maxSpeed:1400},Mn),Tn=t.extend({deceleration:20,maxSpeed:1400},Mn),Pn=t.extend({deceleration:1e3,maxSpeed:360},Mn),On=t.extend({deceleration:1e3,maxSpeed:90},Mn),Ln=function(t){this._map=t,this.clear()};function kn(t,e){(!t.duration||t.duration0&&r-e[0].time>160;)e.shift()},Ln.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n=this._clickTolerance||this._map.fire(new Dn(t.type,this._map,t))},Fn.prototype.dblclick=function(t){return this._firePreventable(new Dn(t.type,this._map,t))},Fn.prototype.mouseover=function(t){this._map.fire(new Dn(t.type,this._map,t))},Fn.prototype.mouseout=function(t){this._map.fire(new Dn(t.type,this._map,t))},Fn.prototype.touchstart=function(t){return this._firePreventable(new Bn(t.type,this._map,t))},Fn.prototype.touchmove=function(t){this._map.fire(new Bn(t.type,this._map,t))},Fn.prototype.touchend=function(t){this._map.fire(new Bn(t.type,this._map,t))},Fn.prototype.touchcancel=function(t){this._map.fire(new Bn(t.type,this._map,t))},Fn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Fn.prototype.isEnabled=function(){return!0},Fn.prototype.isActive=function(){return!1},Fn.prototype.enable=function(){},Fn.prototype.disable=function(){};var jn=function(t){this._map=t};jn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},jn.prototype.mousemove=function(t){this._map.fire(new Dn(t.type,this._map,t))},jn.prototype.mousedown=function(){this._delayContextMenu=!0},jn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},jn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Dn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},jn.prototype.isEnabled=function(){return!0},jn.prototype.isActive=function(){return!1},jn.prototype.enable=function(){},jn.prototype.disable=function(){};var zn=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Un(t,e){for(var r={},n=0;nthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),n=0,i=e;n30)&&(this.aborted=!0)}}},Gn.prototype.touchend=function(t,e,r){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Hn=function(t){this.singleTap=new Gn(t),this.numTaps=t.numTaps,this.reset()};Hn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Hn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Hn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Hn.prototype.touchend=function(t,e,r){var n=this.singleTap.touchend(t,e,r);if(n){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(n)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Vn=function(){this._zoomIn=new Hn({numTouches:1,numTaps:2}),this._zoomOut=new Hn({numTouches:2,numTaps:1}),this.reset()};Vn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Vn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},Vn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},Vn.prototype.touchend=function(t,e,r){var n=this,i=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},Vn.prototype.touchcancel=function(){this.reset()},Vn.prototype.enable=function(){this._enabled=!0},Vn.prototype.disable=function(){this._enabled=!1,this.reset()},Vn.prototype.isEnabled=function(){return this._enabled},Vn.prototype.isActive=function(){return this._active};var Qn={0:1,2:2},qn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};qn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},qn.prototype._correctButton=function(t,e){return!1},qn.prototype._move=function(t,e){return{}},qn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=r.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},qn.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(t,e){var r=Qn[e];return void 0===t.buttons||(t.buttons&r)!==r}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(r)0&&(this._active=!0);var i=Un(n,r),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var u in i){var c=i[u],l=this._touches[u];l&&(o._add(c),a._add(c.sub(l)),s++,i[u]=c)}if(this._touches=i,!(sMath.abs(t.x)}var ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ni(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,r){var n=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,i=e.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ni(t)&&ni(e)&&o}},e}(Kn),oi={panStep:100,bearingStep:15,pitchStep:10},ai=function(){var t=oi;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function si(t){return t*(2-t)}ai.prototype.reset=function(){this._active=!1},ai.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,n=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:si,zoom:r?Math.round(u)+r*(t.shiftKey?2:1):u,bearing:s.getBearing()+n*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},ai.prototype.enable=function(){this._enabled=!0},ai.prototype.disable=function(){this._enabled=!1,this.reset()},ai.prototype.isEnabled=function(){return this._enabled},ai.prototype.isActive=function(){return this._active},ai.prototype.disableRotation=function(){this._rotationDisabled=!0},ai.prototype.enableRotation=function(){this._rotationDisabled=!1};var ui=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};ui.prototype.setZoomRate=function(t){this._defaultZoomRate=t},ui.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},ui.prototype.isEnabled=function(){return!!this._enabled},ui.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},ui.prototype.isZooming=function(){return!!this._zooming},ui.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},ui.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ui.prototype.wheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}},ui.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},ui.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ui.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:r.zoom,u=this._startZoom,c=this._easing,l=!1;if("wheel"===this._type&&u&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=c(h);a=t.number(u,s,p),h<1?this._frameId||(this._frameId=!0):l=!0}else a=s,l=!0;return this._active=!0,l&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!l,zoomDelta:a-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ui.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var n=this._prevEase,i=(t.browser.now()-n.start)/n.duration,o=n.easing(i+.01)-n.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r},ui.prototype.reset=function(){this._active=!1};var ci=function(t,e){this._clickZoom=t,this._tapZoom=e};ci.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ci.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ci.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ci.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var li=function(){this.reset()};li.prototype.reset=function(){this._active=!1},li.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var hi=function(){this._tap=new Hn({numTouches:1,numTaps:1}),this.reset()};hi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},hi.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},hi.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=e[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,r)},hi.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},hi.prototype.touchcancel=function(){this.reset()},hi.prototype.enable=function(){this._enabled=!0},hi.prototype.disable=function(){this._enabled=!1,this.reset()},hi.prototype.isEnabled=function(){return this._enabled},hi.prototype.isActive=function(){return this._active};var pi=function(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r};pi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},pi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},pi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},pi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var di=function(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r};di.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},di.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},di.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},di.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var fi=function(t,e,r,n){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};fi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},fi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},fi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},fi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},fi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},fi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var gi=function(t){return t.zoom||t.drag||t.pitch||t.rotate},mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function yi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var vi=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ln(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;oo?Math.min(2,b):Math.max(.5,b),x=Math.pow(m,1-e),w=i.unproject(A.add(_.mult(e*x)).mult(g));i.setLocationAtPoint(i.renderWorldCopies?w.wrap():w,f)}n._fireMoveEvents(r)}),(function(t){n._afterEase(r,t)}),e),this},r.prototype._prepareEase=function(e,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},r.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},r.prototype._afterEase=function(e,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},r.prototype.flyTo=function(e,r){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),c=this.getPadding(),l="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:u,d="padding"in e?e.padding:o.padding,f=o.zoomScale(l-a),g=t.Point.convert(e.offset),m=o.centerPoint.add(g),y=o.pointLocation(m),v=t.LngLat.convert(e.center||y);this._normalizeCenter(v);var A=o.project(y),_=o.project(v).sub(A),b=e.curve,x=Math.max(o.width,o.height),w=x/f,C=_.mag();if("minZoom"in e){var E=t.clamp(Math.min(e.minZoom,a,l),o.minZoom,o.maxZoom),I=x/o.zoomScale(E-a);b=Math.sqrt(I/C*2)}var M=b*b;function S(t){var e=(w*w-x*x+(t?-1:1)*M*M*C*C)/(2*(t?w:x)*M*C);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function P(t){return(Math.exp(t)+Math.exp(-t))/2}var O=S(0),L=function(t){return P(O)/P(O+b*t)},k=function(t){return x*((P(O)*(T(e=O+b*t)/P(e))-T(O))/M)/C;var e},R=(S(1)-O)/b;if(Math.abs(C)<1e-6||!isFinite(R)){if(Math.abs(x-w)<1e-6)return this.easeTo(e,r);var D=we.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==u,this._padding=!o.isPaddingEqual(d),this._prepareEase(r,!1),this._ease((function(e){var i=e*R,f=1/L(i);o.zoom=1===e?l:a+o.scaleZoom(f),n._rotating&&(o.bearing=t.number(s,h,e)),n._pitching&&(o.pitch=t.number(u,p,e)),n._padding&&(o.interpolatePadding(c,d,e),m=o.centerPoint.add(g));var y=1===e?v:o.unproject(A.add(_.mult(k(i))).mult(f));o.setLocationAtPoint(o.renderWorldCopies?y.wrap():y,m),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),e),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(e,r,n){!1===n.animate||0===n.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var n=Math.abs(e-r);return Math.abs(e-360-r)180?-360:r<-180?360:0}},r}(t.Evented),_i=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};_i.prototype.getDefaultPosition=function(){return"bottom-right"},_i.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},_i.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},_i.prototype._setElementTitle=function(t,e){var r=this._map._getUIString("AttributionControl."+e);t.title=r,t.setAttribute("aria-label",r)},_i.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},_i.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=r.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},_i.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var bi=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};bi.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},bi.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},bi.prototype.getDefaultPosition=function(){return"bottom-left"},bi.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},bi.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},bi.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var xi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};xi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},xi.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,n=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var n=new Cn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(i.call(this,n,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new xi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},wi,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ei))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new vi(this,e),this._hash=e.hash&&new In("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new _i({customAttribution:e.customAttribution})),this.addControl(new bi,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},o.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this},o.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},o.prototype.resize=function(e){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var o=!this._moving;return o&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},o.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},o.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},o.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},o.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},o.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},o.prototype._createDelegatedListener=function(t,e,r){var n,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){var a=i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(i,new Dn(t,i,n.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(n){(i.getLayer(e)?i.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(i,new Dn(t,i,n.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(i,new Dn(t,i,e.originalEvent)))}}}}return{layer:e,listener:r,delegates:(n={},n[t]=function(t){var n=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,r.call(i,t),delete t.features)},n)}},o.prototype.on=function(t,e,r){if(void 0===r)return i.prototype.on.call(this,t,e);var n=this._createDelegatedListener(t,e,r);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n),n.delegates)this.on(o,n.delegates[o]);return this},o.prototype.once=function(t,e,r){if(void 0===r)return i.prototype.once.call(this,t,e);var n=this._createDelegatedListener(t,e,r);for(var o in n.delegates)this.once(o,n.delegates[o]);return this},o.prototype.off=function(t,e,r){var n=this;return void 0===r?i.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(i){for(var o=i[t],a=0;a180;){var s=n.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Li.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},Li.prototype.move=function(t,e){var r=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Li.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Li.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},Li.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},Li.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},Li.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Li.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Li.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Li.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=r}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),Fi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ji=0,zi=!1,Ui=function(e){function n(r){e.call(this),this.options=t.extend({},Fi,r),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Bi?n(Bi):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){n(Bi="denied"!==t.state)})):n(Bi=!!t.window.navigator.geolocation),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ji=0,zi=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),r=t.coords;return e&&(r.longitudee.getEast()||r.latitudee.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),o,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),r=this._map.unproject([1,t]),n=e.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&zi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ni(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ni({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ji--,zi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++ji>1?(e={maximumAge:6e5,timeout:0},zi=!0):(e=this.options.positionOptions,zi=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Gi={maxWidth:100,unit:"metric"},Hi=function(e){this.options=t.extend({},Gi,e),t.bindAll(["_onMove","setUnit"],this)};function Vi(t,e,r){var n=r&&r.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([n,i]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){var u=3.2808*s;u>5280?Qi(e,n,u/5280,t._getUIString("ScaleControl.Miles")):Qi(e,n,u,t._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Qi(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Qi(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):Qi(e,n,s,t._getUIString("ScaleControl.Meters"))}function Qi(t,e,r,n){var i,o,a,s=(i=r,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/r)+"px",t.innerHTML=s+" "+n}Hi.prototype.getDefaultPosition=function(){return"bottom-left"},Hi.prototype._onMove=function(){Vi(this._map,this._container,this.options)},Hi.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Hi.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Hi.prototype.setUnit=function(t){this.options.unit=t,Vi(this._map,this._container,this.options)};var qi=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};qi.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},qi.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},qi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},qi.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},qi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},qi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},qi.prototype._isFullscreen=function(){return this._fullscreen},qi.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},qi.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Wi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Yi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Xi=function(e){function n(r){e.call(this),this.options=t.extend(Object.create(Wi),r),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var r,n=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ki(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var n=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-r),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var i=t.Point.convert(r);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,u=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+a.bottom.ythis._map.transform.height-c?["bottom"]:[],i.xthis._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var l=i.add(a[o]).round();r.setTransform(this._container,Ri[o]+" translate("+l.x+"px,"+l.y+"px)"),Di(this._container,o,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Yi);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented),Zi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Si,NavigationControl:Oi,GeolocateControl:Ui,AttributionControl:_i,ScaleControl:Hi,FullscreenControl:qi,Popup:Xi,Marker:Ni,Style:Ve,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){jt().acquire(Dt)},clearPrewarmedResources:function(){var t=Nt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Dt),Nt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Bt.workerCount},set workerCount(t){Bt.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return Zi})),r}()},function(t,e,r){"use strict";var n=r(4);Object.defineProperty(e,"__esModule",{value:!0}),e.Pass=e.EffectComposer=void 0;var i=n(r(15)),o=r(3),a=r(20),s=r(18),u=r(65),c=function(t,e){if(this.renderer=t,void 0===e){var r={minFilter:o.LinearFilter,magFilter:o.LinearFilter,format:o.RGBAFormat,stencilBuffer:!1},n=t.getSize(new o.Vector2);this._pixelRatio=t.getPixelRatio(),this._width=n.width,this._height=n.height,(e=new o.WebGLRenderTarget(this._width*this._pixelRatio,this._height*this._pixelRatio,r)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===a.CopyShader_EX&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===s.ShaderPass&&console.error("THREE.EffectComposer relies on ShaderPass"),a.CopyShader_EX.uniforms.tDiffuse=new o.CanvasTexture(this.renderer.domElement),this.clock=new o.Clock};e.EffectComposer=c,Object.assign(c.prototype,{swapBuffers:function(){var t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t},addPass:function(t){"tDiffuse"!==t.textureID&&this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},insertPass:function(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},isLastEnabledPass:function(t){for(var e=t+1;e\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(t){return new n.ShaderMaterial({defines:{NUM_MIPS:t},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),s.BlurDirectionX=new n.Vector2(1,0),s.BlurDirectionY=new n.Vector2(0,1)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.drawAnimatePoint=e.drawAnimateLine=e.drawPolygon=e.drawLine=e.drawHoneycombPoint=e.drawRectPoint=e.drawPie=e.drawSector=e.drawCirclePoint=void 0,e.drawCirclePoint=function(t,e,r){t.beginPath(),t.arc(e[0],e[1],r.radius,0,2*Math.PI),t.shadowColor=r.shadowColor,t.shadowBlur=r.shadowBlur,t.fillStyle=r.fillStyle,t.strokeStyle=r.strokeStyle,t.lineWidth=r.lineWidth,t.globalCompositeOperation=r.globalCompositeOperation,t.stroke(),t.fill()},e.drawSector=function(t,e,r,n,i,o){t.beginPath(),t.arc(e[0],e[1],r,n,i),t.shadowColor=o.shadowColor,t.shadowBlur=o.shadowBlur,t.fillStyle=o.fillStyle,t.strokeStyle=o.strokeStyle,t.lineWidth=o.lineWidth,t.globalCompositeOperation=o.globalCompositeOperation,t.fill(),t.closePath()},e.drawPie=function(t,e,r,n){var i=0,o=0;r.forEach((function(t){i+=t.num})),t.shadowColor=n.shadowColor,t.shadowBlur=n.shadowBlur,t.strokeStyle=n.strokeStyle,t.lineWidth=n.lineWidth,r.forEach((function(r){t.beginPath(),t.moveTo(e[0],e[1]),t.fillStyle=r.color,r.start=o,r.end=o+2*Math.PI*(r.num/i),r.radius=r.radius?r.radius:n.radius,o=r.end,t.arc(e[0],e[1],r.radius,r.start,r.end),t.stroke(),t.fill()})),document.getElementsByClassName("overlay-canvas")[0].addEventListener("mousemove",(function(i){var a=i.offsetX,s=i.offsetY;r.forEach((function(t){!function(t,e,r,n,i){var o=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),a=Math.acos((t[0]-e[0])/o);return t[1]=n&&a<=i&&o<=r}([a,s],e,t.radius,t.start,t.end)?(t.radius=n.radius,t.shadowColor=n.shadowColor,t.shadowBlur=n.shadowBlur):(t.radius===n.radius&&(t.radius*=1.1),t.shadowColor="rgba(0, 0, 0, 0.5)",t.shadowBlur=10)})),t.clearRect(0,0,t.canvas.width,t.canvas.height),r.forEach((function(r){t.shadowColor=r.shadowColor?r.shadowColor:n.shadowColor,t.shadowBlur=r.shadowBlur?r.shadowBlur:n.shadowBlur,t.beginPath(),t.moveTo(e[0],e[1]),t.fillStyle=r.color,o=r.end,t.arc(e[0],e[1],r.radius,r.start,r.end),t.fill()}))})),t.closePath()},e.drawRectPoint=function(t,e){},e.drawHoneycombPoint=function(t,e){},e.drawLine=function(t,e,r){t.beginPath(),console.log(e),e.forEach((function(e,r){0===r?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1])})),t.lineWidth=r.lineWidth,t.strokeStyle=r.strokeStyle,t.shadowColor=r.shadowColor,t.shadowBlur=r.shadowBlur,t.globalCompositeOperation=r.globalCompositeOperation,t.stroke(),t.closePath()},e.drawPolygon=function(t,e,r){t.beginPath(),e[0].forEach((function(e,r){0===r?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1])})),t.lineWidth=r.lineWidth,t.strokeStyle=r.strokeStyle,t.shadowColor=r.shadowColor,t.shadowBlur=r.shadowBlur,t.globalCompositeOperation=r.globalCompositeOperation,t.stroke(),t.closePath()},e.drawAnimateLine=function(t,e,r){var n=r.trailLength,i=e.positions,o=Math.floor(n*i.length);t.globalCompositeOperation="destination-in",t.fillStyle="rgba(0,0,0,0.95)",t.fillRect(0,0,t.canvas.width,t.canvas.height),t.globalAlpha=1,t.beginPath(),i.slice(e.step,e.step+o).forEach((function(e,n){0===n?t.moveTo.apply(t,e):t.lineTo.apply(t,e),e[2]?t.strokeStyle=e[2]:t.strokeStyle=r.color})),t.lineWidth=r.lineWidth,t.shadowColor=r.shadowColor,t.shadowBlur=r.shadowBlur,t.globalCompositeOperation=r.globalCompositeOperation,t.stroke(),t.closePath(),e.step++,e.step>e.positions.length-1&&(e.step=0)},e.drawAnimatePoint=function(t,e,r){var n=r.maxRadius;e.radius+=.5,e.radius>n&&(e.radius=0);var i=t.globalCompositeOperation;t.globalCompositeOperation="destination-in",t.fillRect(0,0,t.canvas.width,t.canvas.height),t.globalAlpha=.95,t.globalCompositeOperation=i,t.beginPath(),t.arc(e.positions[0],e.positions[1],e.radius,0,2*Math.PI),t.closePath(),t.strokeStyle=e.color||r.color,t.lineWidth=2,t.stroke()}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.resize=e.refresh=e.remove=e.drawPolygon=e.drawLine=e.drawCircle=e.drawPolyLine=e.drawText=e.drawDashCircle=e.drawSector=e.forceInitZrender=void 0;var i,o=n(r(38)),a=n(r(17));function s(){if(!i){var t=document.getElementsByClassName("overlay-canvas")[0];i=o.default.init(t,{devicePixelRatio:window.devicePixelRatio}),c()}}function u(t,e){var r=e.maxX,n=(e.minX,e.maxY),i=e.minY;return new o.default.LinearGradient(r,i,r,n,[{offset:0,color:t[0]},{offset:1,color:t[1]}],!0)}function c(){i.resize()}e.forceInitZrender=function(){var t=document.getElementsByClassName("overlay-canvas")[0];i=o.default.init(t,{devicePixelRatio:window.devicePixelRatio}),c()},e.drawSector=function(t,e,r,n,u,c){var l=c.fill,h=void 0===l?"red":l,p=(c.strokeStyle,c.lineWidth,c.shadowBlur),d=void 0===p?20:p,f=c.shadowColor,g=void 0===f?"#aaa":f;s();var m,y=new o.default.Sector({shape:{cx:t[0],cy:t[1],r:e,r0:r,startAngle:n,endAngle:u},style:{fill:a.default.isArrayLikeObject(h)?(m=h,new o.default.LinearGradient(0,1,1,1,[{offset:0,color:m[0]},{offset:1,color:m[1]}])):h,lineWidth:0,shadowBlur:d,shadowColor:g}});return i.add(y),y},e.drawDashCircle=function(t,e,r){for(var n=2*Math.PI/32,a=n/2,s=[],u=0;u<32;u++){var c=new o.default.Arc({shape:{cx:t[0],cy:t[1],r:e-e/8,startAngle:n*u,endAngle:n*u+a},style:{stroke:o.default.color.lerp(.5*(Math.sin(u*Math.PI*2/32)+1),["#E2E7FC",r],!1),lineWidth:e/4,z:100}});i.add(c),s.push(c)}return s},e.drawText=function(t,e,r){if(r.textContent&&r.textContent.length>4){var n=r.textContent.substr(0,4),a=r.textContent.substr(4),s=new o.default.Circle({shape:{cx:t[0],cy:t[1],r:e},style:{text:n,fill:r.fillStyle,textWidth:e,textHeight:e,textRect:{x:t[0]-3*e/4,y:t[1]-e/2,width:1.5*e,height:e},textOffset:[0,-5],textAlign:"center",textVerticalAlign:"middle",fontWeight:r.fontWeight,fontSize:r.fontSize,fontFamily:r.fontFamily,textFill:r.textFill,truncate:{outerWidth:1.5*e,outerHeight:e},z:0}}),u=new o.default.Circle({shape:{cx:t[0],cy:t[1],r:e},style:{text:a,fill:"transparent",textWidth:e,textHeight:e,textRect:{x:t[0]-3*e/4,y:t[1]-e/2,width:1.5*e,height:e},textAlign:"center",textVerticalAlign:"middle",textOffset:[0,9],fontWeight:r.fontWeight,fontSize:r.fontSize,fontFamily:r.fontFamily,textFill:r.textFill,truncate:{outerWidth:1.5*e,outerHeight:e},z:0}});return i.add(s),i.add(u),[s,u]}var c=new o.default.Circle({shape:{cx:t[0],cy:t[1],r:e},style:{fill:r.fillStyle,textWidth:e,textHeight:e,textRect:{x:t[0]-3*e/4,y:t[1]-e/2,width:1.5*e,height:e},textAlign:"center",textVerticalAlign:"middle",fontWeight:r.fontWeight,fontSize:r.fontSize,fontFamily:r.fontFamily,textFill:r.textFill,truncate:{outerWidth:1.5*e,outerHeight:e},z:0}});return i.add(c),c},e.drawPolyLine=function(t,e,r){var n=e.strokeColor,c=e.lineWidth,l=e.shadowColor,h=e.shadowBlur,p=e.opacity,d=e.globalCompositeOperation,f=r.maxX,g=r.minX,m=r.maxY,y=r.minY;s();var v=new o.default.Polyline({shape:{points:t},style:{stroke:a.default.isArrayLikeObject(n)?u(n,{maxX:f,minX:g,maxY:m,minY:y}):n,lineWidth:c||5,shadowBlur:h,shadowColor:l,shadowOffsetY:10,opacity:p,blend:d}});return i.add(v),v},e.drawCircle=function(t,e,r){var n=r.strokeColor,a=r.lineWidth,u=r.shadowColor,c=r.shadowBlur,l=r.fillStyle,h=r.globalCompositeOperation;s();var p=new o.default.Circle({shape:{cx:t[0],cy:t[1],r:e},style:{stroke:n,lineWidth:a,shadowBlur:c,shadowColor:u,fill:l,blend:h}});return i.add(p),p},e.drawLine=function(t,e,r,n){var c=r.strokeColor,l=r.lineWidth,h=r.shadowColor,p=r.shadowBlur,d=r.opacity,f=r.globalCompositeOperation,g=n.maxX,m=n.minX,y=n.maxY,v=n.minY;s();var A=new o.default.Line({shape:{x1:t[0],y1:t[1],x2:e[0],y2:e[1]},style:{stroke:a.default.isArrayLikeObject(c)?u(c,{maxX:g,minX:m,maxY:y,minY:v}):c,lineWidth:l,shadowBlur:p,shadowColor:h,opacity:d,shadowOffsetY:0,blend:f}});return i.add(A),A},e.drawPolygon=function(t,e,r){var n=e.fillStyle,c=e.strokeColor,l=e.lineWidth,h=e.shadowColor,p=e.shadowBlur,d=e.opacity,f=e.globalCompositeOperation,g=r.maxX,m=r.minX,y=r.maxY,v=r.minY;s();var A,_=new o.default.Polygon({shape:{points:t},style:{fill:a.default.isArrayLikeObject(n)?(A=n,new o.default.RadialGradient(.5,.5,.7,[{offset:0,color:A[0]},{offset:1,color:A[1]}])):n,stroke:a.default.isArrayLikeObject(c)?u(c,{maxX:g,minX:m,maxY:y,minY:v}):c,lineWidth:l,shadowBlur:p,shadowColor:h,opacity:d,shadowOffsetY:30,shadowOffsetX:10,blend:f}});return i.add(_),_},e.remove=function(t){i&&i.remove(t)},e.refresh=function(){i.refreshImmediately()},e.resize=c},function(t,e){t.exports=function(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pass=s;var n,i,o,a=r(3);function s(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}Object.assign(s.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),s.FullScreenQuad=(n=new a.OrthographicCamera(-1,1,1,-1,0,1),i=new a.PlaneBufferGeometry(2,2),o=function(t){this._mesh=new a.Mesh(i,t)},Object.defineProperty(o.prototype,"material",{get:function(){return this._mesh.material},set:function(t){this._mesh.material=t}}),Object.assign(o.prototype,{dispose:function(){this._mesh.geometry.dispose()},render:function(t){t.render(this._mesh,n)}}),o)},function(t,e,r){"use strict";var n=r(4)(r(5));Object.defineProperty(e,"__esModule",{value:!0});var i=["Point","LineString","MultiLineString","Polygon","MultiPolygon"];function o(t){return"object"===(0,n.default)(t)&&null!==t}function a(t){return null!=t&&!u(t)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)}function s(t){return a(t)&&o(t)}function u(t){return"function"==typeof t}function c(t){return o(t)&&~i.indexOf(t.type)&&s(t.coordinates)}e.default={isGeojson:function(t){return!!o(t)&&("FeatureCollection"===t.type?t.features&&a(t.features):"Feature"===t.type?t.geometry&&c(t.geometry)&&t.properties&&o(t.properties):!!~i.indexOf(t.type)&&c(t))},isGeometry:c,isFunction:u,isArrayLike:a,isArrayLikeObject:s,isObjectLike:o}},function(t,e,r){"use strict";var n=r(4);Object.defineProperty(e,"__esModule",{value:!0}),e.ShaderPass=void 0;var i=n(r(15)),o=r(3),a=r(16),s=function(t,e){a.Pass.call(this),this.textureID=void 0!==e?e:"tDiffuse",(0,i.default)(t,o.ShaderMaterial)?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=o.UniformsUtils.clone(t.uniforms),this.material=new o.ShaderMaterial({defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new a.Pass.FullScreenQuad(this.material)};e.ShaderPass=s,s.prototype=Object.assign(Object.create(a.Pass.prototype),{constructor:s,render:function(t,e,r){this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}})},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};e.FXAAShader=n},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(23),e),i(r(44),e),i(r(62),e)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(24),e),i(r(39),e),i(r(42),e)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(25);Object.defineProperty(e,"CanvasCurve",{enumerable:!0,get:function(){return n.Curve}});var i=r(36);Object.defineProperty(e,"CanvasGreatCircle",{enumerable:!0,get:function(){return i.GreatCircle}});var o=r(37);Object.defineProperty(e,"CanvasLine",{enumerable:!0,get:function(){return o.Line}})},function(t,e,r){"use strict";var n=r(4)(r(5)),i=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Curve=void 0;var o=i(r(0)),a=i(r(1)),s=r(2),u=r(7),c=r(13),l=r(8),h=function(){function t(t){this.map=t,this.sourceId=s.guid(),this.layerId=s.guid(),this._listener={},this.buildCanvas()}return t.prototype.setData=function(t){return this.sourceData=t,this},t.prototype.parse=function(t){return this.parseCfg=t,this},t.prototype.style=function(t){return this.styleOpts=a.default.canvas("line",t),this},t.prototype.animate=function(t){var e=this;this.animationOpts=t;var r=this.map._canvasContainer,n=this.map._canvas;if(this.animationOpts){var i=this.animationCanvas=document.createElement("canvas");i.style.position="absolute",i.className="overlay-animation-canvas",i.style.pointerEvents="none",i.width=parseInt(n.style.width),i.height=parseInt(n.style.height),r.appendChild(i),this.map.on("resize",(function(){e.animationCanvas.width=e.map._canvas.width,e.animationCanvas.height=e.map._canvas.height,e.animationCanvas.style.width=e.map._canvas.style.width,e.animationCanvas.style.height=e.map._canvas.style.height}))}return this},t.prototype.render=function(){this.buildSource(),this.buildLayer()},t.prototype.buildSource=function(){var t=this.parseCfg.type||"geojson";this.parsedData=o.default[t](this.sourceData,this.parseCfg),this.curveData=u.getBezierLine(t,this.parsedData,l.lnglatToPixel(this.map)),this.animationData=o.default.animation("line",this.curveData)},t.prototype.buildCanvas=function(){var t=this,e=this.map._canvasContainer,r=this.map._canvas,n=this.canvas=document.createElement("canvas");n.style.position="absolute",n.className="overlay-canvas",n.width=parseInt(r.style.width),n.height=parseInt(r.style.height),e.appendChild(n),this.map.on("resize",(function(){t.canvas.width=t.map._canvas.width,t.canvas.height=t.map._canvas.height,t.canvas.style.width=t.map._canvas.style.width,t.canvas.style.height=t.map._canvas.style.height}))},t.prototype.drawAnimate=function(t){var e=this,r=this.animationCanvas.getContext("2d");t.forEach((function(t){c.drawAnimateLine(r,t,e.animationOpts)}))},t.prototype.buildLayer=function(){var t=this,e=this.canvas.getContext("2d");if("object"===(0,n.default)(this.curveData)&&"FeatureCollection"===this.curveData.type?this.curveData.features.forEach((function(r){c.drawLine(e,r.geometry.coordinates,t.styleOpts)})):this.curveData.forEach((function(r){c.drawLine(e,r.coordinates,t.styleOpts)})),this.animationOpts){var r=this.animationOpts.duration;this._timer=window.setInterval((function(){t.drawAnimate(t.animationData)}),r)}},t.prototype.show=function(){this.map.setLayoutProperty(this.layerId,"visibility","visible")},t.prototype.hide=function(){this.map.setLayoutProperty(this.layerId,"visibility","none")},t.prototype.update=function(t,e){var r=e.type||"geojson",n=o.default[r](t,e);this.map.getSource(this.sourceId).setData(n)},t.prototype._moveHandler=function(){var t=this.canvas.getContext("2d");null==t||t.clearRect(0,0,this.canvas.width,this.canvas.height),this.render()},t.prototype.on=function(t){return this.event=t,this.circles.forEach((function(e){e.on(t.type,(function(){t.listener(e)}))})),this},t.prototype.off=function(t){return this.circles.forEach((function(e){e.off(t)})),this.event=null,this},t}();e.Curve=h},function(t,e,r){var n=r(27),i=r(28),o=r(29),a=r(30);t.exports=function(t){return n(t)||i(t)||o(t)||a()}},function(t,e,r){var n=r(19);t.exports=function(t){if(Array.isArray(t))return n(t)}},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},function(t,e,r){var n=r(19);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(t,e,r){(function(t,i){var o; +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){var a="Expected a function",s="__lodash_placeholder__",u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",l="[object Array]",h="[object Boolean]",p="[object Date]",d="[object Error]",f="[object Function]",g="[object GeneratorFunction]",m="[object Map]",y="[object Number]",v="[object Object]",A="[object RegExp]",_="[object Set]",b="[object String]",x="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",E="[object DataView]",I="[object Float32Array]",M="[object Float64Array]",S="[object Int8Array]",T="[object Int16Array]",P="[object Int32Array]",O="[object Uint8Array]",L="[object Uint16Array]",k="[object Uint32Array]",R=/\b__p \+= '';/g,D=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,N=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,j=RegExp(N.source),z=RegExp(F.source),U=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,W=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(W.source),X=/^\s+|\s+$/g,Z=/^\s+/,K=/\s+$/,J=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$=/\{\n\/\* \[wrapped with (.+)\] \*/,tt=/,? & /,et=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,rt=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,it=/\w*$/,ot=/^[-+]0x[0-9a-f]+$/i,at=/^0b[01]+$/i,st=/^\[object .+?Constructor\]$/,ut=/^0o[0-7]+$/i,ct=/^(?:0|[1-9]\d*)$/,lt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ht=/($^)/,pt=/['\n\r\u2028\u2029\\]/g,dt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ft="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",gt="["+ft+"]",mt="["+dt+"]",yt="\\d+",vt="[a-z\\xdf-\\xf6\\xf8-\\xff]",At="[^\\ud800-\\udfff"+ft+yt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",_t="\\ud83c[\\udffb-\\udfff]",bt="[^\\ud800-\\udfff]",xt="(?:\\ud83c[\\udde6-\\uddff]){2}",wt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ct="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Et="(?:"+vt+"|"+At+")",It="(?:"+Ct+"|"+At+")",Mt="(?:"+mt+"|"+_t+")?",St="[\\ufe0e\\ufe0f]?"+Mt+"(?:\\u200d(?:"+[bt,xt,wt].join("|")+")[\\ufe0e\\ufe0f]?"+Mt+")*",Tt="(?:"+["[\\u2700-\\u27bf]",xt,wt].join("|")+")"+St,Pt="(?:"+[bt+mt+"?",mt,xt,wt,"[\\ud800-\\udfff]"].join("|")+")",Ot=RegExp("['’]","g"),Lt=RegExp(mt,"g"),kt=RegExp(_t+"(?="+_t+")|"+Pt+St,"g"),Rt=RegExp([Ct+"?"+vt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[gt,Ct,"$"].join("|")+")",It+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[gt,Ct+Et,"$"].join("|")+")",Ct+"?"+Et+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ct+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yt,Tt].join("|"),"g"),Dt=RegExp("[\\u200d\\ud800-\\udfff"+dt+"\\ufe0e\\ufe0f]"),Bt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ft=-1,jt={};jt[I]=jt[M]=jt[S]=jt[T]=jt[P]=jt[O]=jt["[object Uint8ClampedArray]"]=jt[L]=jt[k]=!0,jt[c]=jt[l]=jt[C]=jt[h]=jt[E]=jt[p]=jt[d]=jt[f]=jt[m]=jt[y]=jt[v]=jt[A]=jt[_]=jt[b]=jt[w]=!1;var zt={};zt[c]=zt[l]=zt[C]=zt[E]=zt[h]=zt[p]=zt[I]=zt[M]=zt[S]=zt[T]=zt[P]=zt[m]=zt[y]=zt[v]=zt[A]=zt[_]=zt[b]=zt[x]=zt[O]=zt["[object Uint8ClampedArray]"]=zt[L]=zt[k]=!0,zt[d]=zt[f]=zt[w]=!1;var Ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Gt=parseFloat,Ht=parseInt,Vt="object"==n(t)&&t&&t.Object===Object&&t,Qt="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,qt=Vt||Qt||Function("return this")(),Wt=e&&!e.nodeType&&e,Yt=Wt&&"object"==n(i)&&i&&!i.nodeType&&i,Xt=Yt&&Yt.exports===Wt,Zt=Xt&&Vt.process,Kt=function(){try{return Yt&&Yt.require&&Yt.require("util").types||Zt&&Zt.binding&&Zt.binding("util")}catch(t){}}(),Jt=Kt&&Kt.isArrayBuffer,$t=Kt&&Kt.isDate,te=Kt&&Kt.isMap,ee=Kt&&Kt.isRegExp,re=Kt&&Kt.isSet,ne=Kt&&Kt.isTypedArray;function ie(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function oe(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function he(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function ke(t,e){for(var r=t.length;r--&&_e(e,t[r],0)>-1;);return r}function Re(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&++n;return n}var De=Ee({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Be=Ee({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ne(t){return"\\"+Ut[t]}function Fe(t){return Dt.test(t)}function je(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function ze(t,e){return function(r){return t(e(r))}}function Ue(t,e){for(var r=-1,n=t.length,i=0,o=[];++r",""":'"',"'":"'"}),qe=function t(e){var r,i=(e=null==e?qt:qe.defaults(qt.Object(),e,qe.pick(qt,Nt))).Array,o=e.Date,dt=e.Error,ft=e.Function,gt=e.Math,mt=e.Object,yt=e.RegExp,vt=e.String,At=e.TypeError,_t=i.prototype,bt=ft.prototype,xt=mt.prototype,wt=e["__core-js_shared__"],Ct=bt.toString,Et=xt.hasOwnProperty,It=0,Mt=(r=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",St=xt.toString,Tt=Ct.call(mt),Pt=qt._,kt=yt("^"+Ct.call(Et).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dt=Xt?e.Buffer:void 0,Ut=e.Symbol,Vt=e.Uint8Array,Qt=Dt?Dt.allocUnsafe:void 0,Wt=ze(mt.getPrototypeOf,mt),Yt=mt.create,Zt=xt.propertyIsEnumerable,Kt=_t.splice,ye=Ut?Ut.isConcatSpreadable:void 0,Ee=Ut?Ut.iterator:void 0,We=Ut?Ut.toStringTag:void 0,Ye=function(){try{var t=Ji(mt,"defineProperty");return t({},"",{}),t}catch(t){}}(),Xe=e.clearTimeout!==qt.clearTimeout&&e.clearTimeout,Ze=o&&o.now!==qt.Date.now&&o.now,Ke=e.setTimeout!==qt.setTimeout&&e.setTimeout,Je=gt.ceil,$e=gt.floor,tr=mt.getOwnPropertySymbols,er=Dt?Dt.isBuffer:void 0,rr=e.isFinite,nr=_t.join,ir=ze(mt.keys,mt),or=gt.max,ar=gt.min,sr=o.now,ur=e.parseInt,cr=gt.random,lr=_t.reverse,hr=Ji(e,"DataView"),pr=Ji(e,"Map"),dr=Ji(e,"Promise"),fr=Ji(e,"Set"),gr=Ji(e,"WeakMap"),mr=Ji(mt,"create"),yr=gr&&new gr,vr={},Ar=Io(hr),_r=Io(pr),br=Io(dr),xr=Io(fr),wr=Io(gr),Cr=Ut?Ut.prototype:void 0,Er=Cr?Cr.valueOf:void 0,Ir=Cr?Cr.toString:void 0;function Mr(t){if(Ha(t)&&!La(t)&&!(t instanceof Or)){if(t instanceof Pr)return t;if(Et.call(t,"__wrapped__"))return Mo(t)}return new Pr(t)}var Sr=function(){function t(){}return function(e){if(!Ga(e))return{};if(Yt)return Yt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Tr(){}function Pr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Or(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Lr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Xr(t,e,r,n,i,o){var a,s=1&e,u=2&e,l=4&e;if(r&&(a=i?r(t,n,i,o):r(t)),void 0!==a)return a;if(!Ga(t))return t;var d=La(t);if(d){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&Et.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!s)return mi(t,a)}else{var w=eo(t),R=w==f||w==g;if(Ba(t))return li(t,s);if(w==v||w==c||R&&!i){if(a=u||R?{}:no(t),!s)return u?function(t,e){return yi(t,to(t),e)}(t,function(t,e){return t&&yi(e,_s(e),t)}(a,t)):function(t,e){return yi(t,$i(t),e)}(t,Qr(a,t))}else{if(!zt[w])return i?t:{};a=function(t,e,r){var n,i=t.constructor;switch(e){case C:return hi(t);case h:case p:return new i(+t);case E:return function(t,e){var r=e?hi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case I:case M:case S:case T:case P:case O:case"[object Uint8ClampedArray]":case L:case k:return pi(t,r);case m:return new i;case y:case b:return new i(t);case A:return function(t){var e=new t.constructor(t.source,it.exec(t));return e.lastIndex=t.lastIndex,e}(t);case _:return new i;case x:return n=t,Er?mt(Er.call(n)):{}}}(t,w,s)}}o||(o=new Br);var D=o.get(t);if(D)return D;o.set(t,a),Ya(t)?t.forEach((function(n){a.add(Xr(n,e,r,n,t,o))})):Va(t)&&t.forEach((function(n,i){a.set(i,Xr(n,e,r,i,t,o))}));var B=d?void 0:(l?u?Qi:Vi:u?_s:As)(t);return ae(B||t,(function(n,i){B&&(n=t[i=n]),Gr(a,i,Xr(n,e,r,i,t,o))})),a}function Zr(t,e,r){var n=r.length;if(null==t)return!n;for(t=mt(t);n--;){var i=r[n],o=e[i],a=t[i];if(void 0===a&&!(i in t)||!o(a))return!1}return!0}function Kr(t,e,r){if("function"!=typeof t)throw new At(a);return Ao((function(){t.apply(void 0,r)}),e)}function Jr(t,e,r,n){var i=-1,o=le,a=!0,s=t.length,u=[],c=e.length;if(!s)return u;r&&(e=pe(e,Te(r))),n?(o=he,a=!1):e.length>=200&&(o=Oe,a=!1,e=new Dr(e));t:for(;++i-1},kr.prototype.set=function(t,e){var r=this.__data__,n=Hr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Rr.prototype.clear=function(){this.size=0,this.__data__={hash:new Lr,map:new(pr||kr),string:new Lr}},Rr.prototype.delete=function(t){var e=Zi(this,t).delete(t);return this.size-=e?1:0,e},Rr.prototype.get=function(t){return Zi(this,t).get(t)},Rr.prototype.has=function(t){return Zi(this,t).has(t)},Rr.prototype.set=function(t,e){var r=Zi(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Dr.prototype.add=Dr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dr.prototype.has=function(t){return this.__data__.has(t)},Br.prototype.clear=function(){this.__data__=new kr,this.size=0},Br.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Br.prototype.get=function(t){return this.__data__.get(t)},Br.prototype.has=function(t){return this.__data__.has(t)},Br.prototype.set=function(t,e){var r=this.__data__;if(r instanceof kr){var n=r.__data__;if(!pr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Rr(n)}return r.set(t,e),this.size=r.size,this};var $r=_i(un),tn=_i(cn,!0);function en(t,e){var r=!0;return $r(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function rn(t,e,r){for(var n=-1,i=t.length;++n0&&r(s)?e>1?on(s,e-1,r,n,i):de(i,s):n||(i[i.length]=s)}return i}var an=bi(),sn=bi(!0);function un(t,e){return t&&an(t,e,As)}function cn(t,e){return t&&sn(t,e,As)}function ln(t,e){return ce(e,(function(e){return ja(t[e])}))}function hn(t,e){for(var r=0,n=(e=ai(e,t)).length;null!=t&&re}function gn(t,e){return null!=t&&Et.call(t,e)}function mn(t,e){return null!=t&&e in mt(t)}function yn(t,e,r){for(var n=r?he:le,o=t[0].length,a=t.length,s=a,u=i(a),c=1/0,l=[];s--;){var h=t[s];s&&e&&(h=pe(h,Te(e))),c=ar(h.length,c),u[s]=!r&&(e||o>=120&&h.length>=120)?new Dr(s&&h):void 0}h=t[0];var p=-1,d=u[0];t:for(;++p=s?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Ln(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)s!==t&&Kt.call(s,u,1),Kt.call(t,u,1);return t}function Rn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;oo(i)?Kt.call(t,i,1):Jn(t,i)}}return t}function Dn(t,e){return t+$e(cr()*(e-t+1))}function Bn(t,e){var r="";if(!t||e<1||e>9007199254740991)return r;do{e%2&&(r+=t),(e=$e(e/2))&&(t+=t)}while(e);return r}function Nn(t,e){return _o(fo(t,e,Qs),t+"")}function Fn(t){return Fr(Ss(t))}function jn(t,e){var r=Ss(t);return wo(r,Yr(e,0,r.length))}function zn(t,e,r,n){if(!Ga(t))return t;for(var i=-1,o=(e=ai(e,t)).length,a=o-1,s=t;null!=s&&++io?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=i(o);++n>>1,a=t[o];null!==a&&!Za(a)&&(r?a<=e:a=200){var c=e?null:Bi(t);if(c)return Ge(c);a=!1,i=Oe,u=new Dr}else u=e?[]:s;t:for(;++n=n?t:Vn(t,e,r)}var ci=Xe||function(t){return qt.clearTimeout(t)};function li(t,e){if(e)return t.slice();var r=t.length,n=Qt?Qt(r):new t.constructor(r);return t.copy(n),n}function hi(t){var e=new t.constructor(t.byteLength);return new Vt(e).set(new Vt(t)),e}function pi(t,e){var r=e?hi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function di(t,e){if(t!==e){var r=void 0!==t,n=null===t,i=t==t,o=Za(t),a=void 0!==e,s=null===e,u=e==e,c=Za(e);if(!s&&!c&&!o&&t>e||o&&a&&u&&!s&&!c||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!c&&t1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&ao(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=mt(e);++n-1?i[o?e[a]:a]:void 0}}function Ii(t){return Hi((function(e){var r=e.length,n=r,i=Pr.prototype.thru;for(t&&e.reverse();n--;){var o=e[n];if("function"!=typeof o)throw new At(a);if(i&&!s&&"wrapper"==Wi(o))var s=new Pr([],!0)}for(n=s?n:r;++n1&&A.reverse(),h&&cs))return!1;var c=o.get(t),l=o.get(e);if(c&&l)return c==e&&l==t;var h=-1,p=!0,d=2&r?new Dr:void 0;for(o.set(t,e),o.set(e,t);++h-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(J,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return ae(u,(function(r){var n="_."+r[0];e&r[1]&&!le(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match($);return e?e[1].split(tt):[]}(n),r)))}function xo(t){var e=0,r=0;return function(){var n=sr(),i=16-(n-r);if(r=n,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function wo(t,e){var r=-1,n=t.length,i=n-1;for(e=void 0===e?n:e;++r1?t[e-1]:void 0;return r="function"==typeof r?(t.pop(),r):void 0,Wo(t,r)}));function ta(t){var e=Mr(t);return e.__chain__=!0,e}function ea(t,e){return e(t)}var ra=Hi((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,i=function(e){return Wr(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Or&&oo(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ea,args:[i],thisArg:void 0}),new Pr(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)})),na=vi((function(t,e,r){Et.call(t,r)?++t[r]:qr(t,r,1)})),ia=Ei(Oo),oa=Ei(Lo);function aa(t,e){return(La(t)?ae:$r)(t,Xi(e,3))}function sa(t,e){return(La(t)?se:tn)(t,Xi(e,3))}var ua=vi((function(t,e,r){Et.call(t,r)?t[r].push(e):qr(t,r,[e])})),ca=Nn((function(t,e,r){var n=-1,o="function"==typeof e,a=Ra(t)?i(t.length):[];return $r(t,(function(t){a[++n]=o?ie(e,t,r):vn(t,e,r)})),a})),la=vi((function(t,e,r){qr(t,r,e)}));function ha(t,e){return(La(t)?pe:In)(t,Xi(e,3))}var pa=vi((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),da=Nn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ao(t,e[0],e[1])?e=[]:r>2&&ao(e[0],e[1],e[2])&&(e=[e[0]]),On(t,on(e,1),[])})),fa=Ze||function(){return qt.Date.now()};function ga(t,e,r){return e=r?void 0:e,Fi(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function ma(t,e){var r;if("function"!=typeof e)throw new At(a);return t=rs(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=void 0),r}}var ya=Nn((function(t,e,r){var n=1;if(r.length){var i=Ue(r,Yi(ya));n|=32}return Fi(t,n,e,r,i)})),va=Nn((function(t,e,r){var n=3;if(r.length){var i=Ue(r,Yi(va));n|=32}return Fi(e,n,t,r,i)}));function Aa(t,e,r){var n,i,o,s,u,c,l=0,h=!1,p=!1,d=!0;if("function"!=typeof t)throw new At(a);function f(e){var r=n,o=i;return n=i=void 0,l=e,s=t.apply(o,r)}function g(t){return l=t,u=Ao(y,e),h?f(t):s}function m(t){var r=t-c;return void 0===c||r>=e||r<0||p&&t-l>=o}function y(){var t=fa();if(m(t))return v(t);u=Ao(y,function(t){var r=e-(t-c);return p?ar(r,o-(t-l)):r}(t))}function v(t){return u=void 0,d&&n?f(t):(n=i=void 0,s)}function A(){var t=fa(),r=m(t);if(n=arguments,i=this,c=t,r){if(void 0===u)return g(c);if(p)return ci(u),u=Ao(y,e),f(c)}return void 0===u&&(u=Ao(y,e)),s}return e=is(e)||0,Ga(r)&&(h=!!r.leading,o=(p="maxWait"in r)?or(is(r.maxWait)||0,e):o,d="trailing"in r?!!r.trailing:d),A.cancel=function(){void 0!==u&&ci(u),l=0,n=c=i=u=void 0},A.flush=function(){return void 0===u?s:v(fa())},A}var _a=Nn((function(t,e){return Kr(t,1,e)})),ba=Nn((function(t,e,r){return Kr(t,is(e)||0,r)}));function xa(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new At(a);var r=function r(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(xa.Cache||Rr),r}function wa(t){if("function"!=typeof t)throw new At(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}xa.Cache=Rr;var Ca=si((function(t,e){var r=(e=1==e.length&&La(e[0])?pe(e[0],Te(Xi())):pe(on(e,1),Te(Xi()))).length;return Nn((function(n){for(var i=-1,o=ar(n.length,r);++i=e})),Oa=An(function(){return arguments}())?An:function(t){return Ha(t)&&Et.call(t,"callee")&&!Zt.call(t,"callee")},La=i.isArray,ka=Jt?Te(Jt):function(t){return Ha(t)&&dn(t)==C};function Ra(t){return null!=t&&Ua(t.length)&&!ja(t)}function Da(t){return Ha(t)&&Ra(t)}var Ba=er||iu,Na=$t?Te($t):function(t){return Ha(t)&&dn(t)==p};function Fa(t){if(!Ha(t))return!1;var e=dn(t);return e==d||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!qa(t)}function ja(t){if(!Ga(t))return!1;var e=dn(t);return e==f||e==g||"[object AsyncFunction]"==e||"[object Proxy]"==e}function za(t){return"number"==typeof t&&t==rs(t)}function Ua(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Ga(t){var e=n(t);return null!=t&&("object"==e||"function"==e)}function Ha(t){return null!=t&&"object"==n(t)}var Va=te?Te(te):function(t){return Ha(t)&&eo(t)==m};function Qa(t){return"number"==typeof t||Ha(t)&&dn(t)==y}function qa(t){if(!Ha(t)||dn(t)!=v)return!1;var e=Wt(t);if(null===e)return!0;var r=Et.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Ct.call(r)==Tt}var Wa=ee?Te(ee):function(t){return Ha(t)&&dn(t)==A},Ya=re?Te(re):function(t){return Ha(t)&&eo(t)==_};function Xa(t){return"string"==typeof t||!La(t)&&Ha(t)&&dn(t)==b}function Za(t){return"symbol"==n(t)||Ha(t)&&dn(t)==x}var Ka=ne?Te(ne):function(t){return Ha(t)&&Ua(t.length)&&!!jt[dn(t)]},Ja=ki(En),$a=ki((function(t,e){return t<=e}));function ts(t){if(!t)return[];if(Ra(t))return Xa(t)?Ve(t):mi(t);if(Ee&&t[Ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Ee]());var e=eo(t);return(e==m?je:e==_?Ge:Ss)(t)}function es(t){return t?(t=is(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function rs(t){var e=es(t),r=e%1;return e==e?r?e-r:e:0}function ns(t){return t?Yr(rs(t),0,4294967295):0}function is(t){if("number"==typeof t)return t;if(Za(t))return NaN;if(Ga(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ga(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(X,"");var r=at.test(t);return r||ut.test(t)?Ht(t.slice(2),r?2:8):ot.test(t)?NaN:+t}function os(t){return yi(t,_s(t))}function as(t){return null==t?"":Zn(t)}var ss=Ai((function(t,e){if(lo(e)||Ra(e))yi(e,As(e),t);else for(var r in e)Et.call(e,r)&&Gr(t,r,e[r])})),us=Ai((function(t,e){yi(e,_s(e),t)})),cs=Ai((function(t,e,r,n){yi(e,_s(e),t,n)})),ls=Ai((function(t,e,r,n){yi(e,As(e),t,n)})),hs=Hi(Wr),ps=Nn((function(t,e){t=mt(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&ao(e[0],e[1],i)&&(n=1);++r1),e})),yi(t,Qi(t),r),n&&(r=Xr(r,7,Ui));for(var i=e.length;i--;)Jn(r,e[i]);return r})),Cs=Hi((function(t,e){return null==t?{}:function(t,e){return Ln(t,e,(function(e,r){return gs(t,r)}))}(t,e)}));function Es(t,e){if(null==t)return{};var r=pe(Qi(t),(function(t){return[t]}));return e=Xi(e),Ln(t,r,(function(t,r){return e(t,r[0])}))}var Is=Ni(As),Ms=Ni(_s);function Ss(t){return null==t?[]:Pe(t,As(t))}var Ts=wi((function(t,e,r){return e=e.toLowerCase(),t+(r?Ps(e):e)}));function Ps(t){return Fs(as(t).toLowerCase())}function Os(t){return(t=as(t))&&t.replace(lt,De).replace(Lt,"")}var Ls=wi((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),ks=wi((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Rs=xi("toLowerCase"),Ds=wi((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Bs=wi((function(t,e,r){return t+(r?" ":"")+Fs(e)})),Ns=wi((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Fs=xi("toUpperCase");function js(t,e,r){return t=as(t),void 0===(e=r?void 0:e)?function(t){return Bt.test(t)}(t)?function(t){return t.match(Rt)||[]}(t):function(t){return t.match(et)||[]}(t):t.match(e)||[]}var zs=Nn((function(t,e){try{return ie(t,void 0,e)}catch(t){return Fa(t)?t:new dt(t)}})),Us=Hi((function(t,e){return ae(e,(function(e){e=Eo(e),qr(t,e,ya(t[e],t))})),t}));function Gs(t){return function(){return t}}var Hs=Ii(),Vs=Ii(!0);function Qs(t){return t}function qs(t){return wn("function"==typeof t?t:Xr(t,1))}var Ws=Nn((function(t,e){return function(r){return vn(r,t,e)}})),Ys=Nn((function(t,e){return function(r){return vn(t,r,e)}}));function Xs(t,e,r){var n=As(e),i=ln(e,n);null!=r||Ga(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=ln(e,As(e)));var o=!(Ga(r)&&"chain"in r&&!r.chain),a=ja(t);return ae(i,(function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__),i=r.__actions__=mi(this.__actions__);return i.push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,de([this.value()],arguments))})})),t}function Zs(){}var Ks=Pi(pe),Js=Pi(ue),$s=Pi(me);function tu(t){return so(t)?Ce(Eo(t)):function(t){return function(e){return hn(e,t)}}(t)}var eu=Li(),ru=Li(!0);function nu(){return[]}function iu(){return!1}var ou,au=Ti((function(t,e){return t+e}),0),su=Di("ceil"),uu=Ti((function(t,e){return t/e}),1),cu=Di("floor"),lu=Ti((function(t,e){return t*e}),1),hu=Di("round"),pu=Ti((function(t,e){return t-e}),0);return Mr.after=function(t,e){if("function"!=typeof e)throw new At(a);return t=rs(t),function(){if(--t<1)return e.apply(this,arguments)}},Mr.ary=ga,Mr.assign=ss,Mr.assignIn=us,Mr.assignInWith=cs,Mr.assignWith=ls,Mr.at=hs,Mr.before=ma,Mr.bind=ya,Mr.bindAll=Us,Mr.bindKey=va,Mr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return La(t)?t:[t]},Mr.chain=ta,Mr.chunk=function(t,e,r){e=(r?ao(t,e,r):void 0===e)?1:or(rs(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var o=0,a=0,s=i(Je(n/e));oi?0:i+r),(n=void 0===n||n>i?i:rs(n))<0&&(n+=i),n=r>n?0:ns(n);r>>0)?(t=as(t))&&("string"==typeof e||null!=e&&!Wa(e))&&!(e=Zn(e))&&Fe(t)?ui(Ve(t),0,r):t.split(e,r):[]},Mr.spread=function(t,e){if("function"!=typeof t)throw new At(a);return e=null==e?0:or(rs(e),0),Nn((function(r){var n=r[e],i=ui(r,0,e);return n&&de(i,n),ie(t,this,i)}))},Mr.tail=function(t){var e=null==t?0:t.length;return e?Vn(t,1,e):[]},Mr.take=function(t,e,r){return t&&t.length?Vn(t,0,(e=r||void 0===e?1:rs(e))<0?0:e):[]},Mr.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?Vn(t,(e=n-(e=r||void 0===e?1:rs(e)))<0?0:e,n):[]},Mr.takeRightWhile=function(t,e){return t&&t.length?ti(t,Xi(e,3),!1,!0):[]},Mr.takeWhile=function(t,e){return t&&t.length?ti(t,Xi(e,3)):[]},Mr.tap=function(t,e){return e(t),t},Mr.throttle=function(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new At(a);return Ga(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Aa(t,e,{leading:n,maxWait:e,trailing:i})},Mr.thru=ea,Mr.toArray=ts,Mr.toPairs=Is,Mr.toPairsIn=Ms,Mr.toPath=function(t){return La(t)?pe(t,Eo):Za(t)?[t]:mi(Co(as(t)))},Mr.toPlainObject=os,Mr.transform=function(t,e,r){var n=La(t),i=n||Ba(t)||Ka(t);if(e=Xi(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:Ga(t)&&ja(o)?Sr(Wt(t)):{}}return(i?ae:un)(t,(function(t,n,i){return e(r,t,n,i)})),r},Mr.unary=function(t){return ga(t,1)},Mr.union=Ho,Mr.unionBy=Vo,Mr.unionWith=Qo,Mr.uniq=function(t){return t&&t.length?Kn(t):[]},Mr.uniqBy=function(t,e){return t&&t.length?Kn(t,Xi(e,2)):[]},Mr.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Kn(t,void 0,e):[]},Mr.unset=function(t,e){return null==t||Jn(t,e)},Mr.unzip=qo,Mr.unzipWith=Wo,Mr.update=function(t,e,r){return null==t?t:$n(t,e,oi(r))},Mr.updateWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:$n(t,e,oi(r),n)},Mr.values=Ss,Mr.valuesIn=function(t){return null==t?[]:Pe(t,_s(t))},Mr.without=Yo,Mr.words=js,Mr.wrap=function(t,e){return Ea(oi(e),t)},Mr.xor=Xo,Mr.xorBy=Zo,Mr.xorWith=Ko,Mr.zip=Jo,Mr.zipObject=function(t,e){return ni(t||[],e||[],Gr)},Mr.zipObjectDeep=function(t,e){return ni(t||[],e||[],zn)},Mr.zipWith=$o,Mr.entries=Is,Mr.entriesIn=Ms,Mr.extend=us,Mr.extendWith=cs,Xs(Mr,Mr),Mr.add=au,Mr.attempt=zs,Mr.camelCase=Ts,Mr.capitalize=Ps,Mr.ceil=su,Mr.clamp=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=is(r))==r?r:0),void 0!==e&&(e=(e=is(e))==e?e:0),Yr(is(t),e,r)},Mr.clone=function(t){return Xr(t,4)},Mr.cloneDeep=function(t){return Xr(t,5)},Mr.cloneDeepWith=function(t,e){return Xr(t,5,e="function"==typeof e?e:void 0)},Mr.cloneWith=function(t,e){return Xr(t,4,e="function"==typeof e?e:void 0)},Mr.conformsTo=function(t,e){return null==e||Zr(t,e,As(e))},Mr.deburr=Os,Mr.defaultTo=function(t,e){return null==t||t!=t?e:t},Mr.divide=uu,Mr.endsWith=function(t,e,r){t=as(t),e=Zn(e);var n=t.length,i=r=void 0===r?n:Yr(rs(r),0,n);return(r-=e.length)>=0&&t.slice(r,i)==e},Mr.eq=Sa,Mr.escape=function(t){return(t=as(t))&&z.test(t)?t.replace(F,Be):t},Mr.escapeRegExp=function(t){return(t=as(t))&&Y.test(t)?t.replace(W,"\\$&"):t},Mr.every=function(t,e,r){var n=La(t)?ue:en;return r&&ao(t,e,r)&&(e=void 0),n(t,Xi(e,3))},Mr.find=ia,Mr.findIndex=Oo,Mr.findKey=function(t,e){return ve(t,Xi(e,3),un)},Mr.findLast=oa,Mr.findLastIndex=Lo,Mr.findLastKey=function(t,e){return ve(t,Xi(e,3),cn)},Mr.floor=cu,Mr.forEach=aa,Mr.forEachRight=sa,Mr.forIn=function(t,e){return null==t?t:an(t,Xi(e,3),_s)},Mr.forInRight=function(t,e){return null==t?t:sn(t,Xi(e,3),_s)},Mr.forOwn=function(t,e){return t&&un(t,Xi(e,3))},Mr.forOwnRight=function(t,e){return t&&cn(t,Xi(e,3))},Mr.get=fs,Mr.gt=Ta,Mr.gte=Pa,Mr.has=function(t,e){return null!=t&&ro(t,e,gn)},Mr.hasIn=gs,Mr.head=Ro,Mr.identity=Qs,Mr.includes=function(t,e,r,n){t=Ra(t)?t:Ss(t),r=r&&!n?rs(r):0;var i=t.length;return r<0&&(r=or(i+r,0)),Xa(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&_e(t,e,r)>-1},Mr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:rs(r);return i<0&&(i=or(n+i,0)),_e(t,e,i)},Mr.inRange=function(t,e,r){return e=es(e),void 0===r?(r=e,e=0):r=es(r),function(t,e,r){return t>=ar(e,r)&&t=-9007199254740991&&t<=9007199254740991},Mr.isSet=Ya,Mr.isString=Xa,Mr.isSymbol=Za,Mr.isTypedArray=Ka,Mr.isUndefined=function(t){return void 0===t},Mr.isWeakMap=function(t){return Ha(t)&&eo(t)==w},Mr.isWeakSet=function(t){return Ha(t)&&"[object WeakSet]"==dn(t)},Mr.join=function(t,e){return null==t?"":nr.call(t,e)},Mr.kebabCase=Ls,Mr.last=Fo,Mr.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=n;return void 0!==r&&(i=(i=rs(r))<0?or(n+i,0):ar(i,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,i):Ae(t,xe,i,!0)},Mr.lowerCase=ks,Mr.lowerFirst=Rs,Mr.lt=Ja,Mr.lte=$a,Mr.max=function(t){return t&&t.length?rn(t,Qs,fn):void 0},Mr.maxBy=function(t,e){return t&&t.length?rn(t,Xi(e,2),fn):void 0},Mr.mean=function(t){return we(t,Qs)},Mr.meanBy=function(t,e){return we(t,Xi(e,2))},Mr.min=function(t){return t&&t.length?rn(t,Qs,En):void 0},Mr.minBy=function(t,e){return t&&t.length?rn(t,Xi(e,2),En):void 0},Mr.stubArray=nu,Mr.stubFalse=iu,Mr.stubObject=function(){return{}},Mr.stubString=function(){return""},Mr.stubTrue=function(){return!0},Mr.multiply=lu,Mr.nth=function(t,e){return t&&t.length?Pn(t,rs(e)):void 0},Mr.noConflict=function(){return qt._===this&&(qt._=Pt),this},Mr.noop=Zs,Mr.now=fa,Mr.pad=function(t,e,r){t=as(t);var n=(e=rs(e))?He(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Oi($e(i),r)+t+Oi(Je(i),r)},Mr.padEnd=function(t,e,r){t=as(t);var n=(e=rs(e))?He(t):0;return e&&ne){var n=t;t=e,e=n}if(r||t%1||e%1){var i=cr();return ar(t+i*(e-t+Gt("1e-"+((i+"").length-1))),e)}return Dn(t,e)},Mr.reduce=function(t,e,r){var n=La(t)?fe:Ie,i=arguments.length<3;return n(t,Xi(e,4),r,i,$r)},Mr.reduceRight=function(t,e,r){var n=La(t)?ge:Ie,i=arguments.length<3;return n(t,Xi(e,4),r,i,tn)},Mr.repeat=function(t,e,r){return e=(r?ao(t,e,r):void 0===e)?1:rs(e),Bn(as(t),e)},Mr.replace=function(){var t=arguments,e=as(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Mr.result=function(t,e,r){var n=-1,i=(e=ai(e,t)).length;for(i||(i=1,t=void 0);++n9007199254740991)return[];var r=4294967295,n=ar(t,4294967295);t-=4294967295;for(var i=Se(n,e=Xi(e));++r=o)return t;var s=r-He(n);if(s<1)return n;var u=a?ui(a,0,s).join(""):t.slice(0,s);if(void 0===i)return u+n;if(a&&(s+=u.length-s),Wa(i)){if(t.slice(s).search(i)){var c,l=u;for(i.global||(i=yt(i.source,as(it.exec(i))+"g")),i.lastIndex=0;c=i.exec(l);)var h=c.index;u=u.slice(0,void 0===h?s:h)}}else if(t.indexOf(Zn(i),s)!=s){var p=u.lastIndexOf(i);p>-1&&(u=u.slice(0,p))}return u+n},Mr.unescape=function(t){return(t=as(t))&&j.test(t)?t.replace(N,Qe):t},Mr.uniqueId=function(t){var e=++It;return as(t)+e},Mr.upperCase=Ns,Mr.upperFirst=Fs,Mr.each=aa,Mr.eachRight=sa,Mr.first=Ro,Xs(Mr,(ou={},un(Mr,(function(t,e){Et.call(Mr.prototype,e)||(ou[e]=t)})),ou),{chain:!1}),Mr.VERSION="4.17.20",ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Mr[t].placeholder=Mr})),ae(["drop","take"],(function(t,e){Or.prototype[t]=function(r){r=void 0===r?1:or(rs(r),0);var n=this.__filtered__&&!e?new Or(this):this.clone();return n.__filtered__?n.__takeCount__=ar(r,n.__takeCount__):n.__views__.push({size:ar(r,4294967295),type:t+(n.__dir__<0?"Right":"")}),n},Or.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ae(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Or.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Xi(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),ae(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Or.prototype[t]=function(){return this[r](1).value()[0]}})),ae(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Or.prototype[t]=function(){return this.__filtered__?new Or(this):this[r](1)}})),Or.prototype.compact=function(){return this.filter(Qs)},Or.prototype.find=function(t){return this.filter(t).head()},Or.prototype.findLast=function(t){return this.reverse().find(t)},Or.prototype.invokeMap=Nn((function(t,e){return"function"==typeof t?new Or(this):this.map((function(r){return vn(r,t,e)}))})),Or.prototype.reject=function(t){return this.filter(wa(Xi(t)))},Or.prototype.slice=function(t,e){t=rs(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Or(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),void 0!==e&&(r=(e=rs(e))<0?r.dropRight(-e):r.take(e-t)),r)},Or.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Or.prototype.toArray=function(){return this.take(4294967295)},un(Or.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),i=Mr[n?"take"+("last"==e?"Right":""):e],o=n||/^find/.test(e);i&&(Mr.prototype[e]=function(){var e=this.__wrapped__,a=n?[1]:arguments,s=e instanceof Or,u=a[0],c=s||La(e),l=function(t){var e=i.apply(Mr,de([t],a));return n&&h?e[0]:e};c&&r&&"function"==typeof u&&1!=u.length&&(s=c=!1);var h=this.__chain__,p=!!this.__actions__.length,d=o&&!h,f=s&&!p;if(!o&&c){e=f?e:new Or(this);var g=t.apply(e,a);return g.__actions__.push({func:ea,args:[l],thisArg:void 0}),new Pr(g,h)}return d&&f?t.apply(this,a):(g=this.thru(l),d?n?g.value()[0]:g.value():g)})})),ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=_t[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Mr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(La(i)?i:[],t)}return this[r]((function(r){return e.apply(La(r)?r:[],t)}))}})),un(Or.prototype,(function(t,e){var r=Mr[e];if(r){var n=r.name+"";Et.call(vr,n)||(vr[n]=[]),vr[n].push({name:e,func:r})}})),vr[Mi(void 0,2).name]=[{name:"wrapper",func:void 0}],Or.prototype.clone=function(){var t=new Or(this.__wrapped__);return t.__actions__=mi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=mi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=mi(this.__views__),t},Or.prototype.reverse=function(){if(this.__filtered__){var t=new Or(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Or.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=La(t),n=e<0,i=r?t.length:0,o=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},Mr.prototype.plant=function(t){for(var e,r=this;r instanceof Tr;){var n=Mo(r);n.__index__=0,n.__values__=void 0,e?i.__wrapped__=n:e=n;var i=n;r=r.__wrapped__}return i.__wrapped__=t,e},Mr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Or){var e=t;return this.__actions__.length&&(e=new Or(this)),(e=e.reverse()).__actions__.push({func:ea,args:[Go],thisArg:void 0}),new Pr(e,this.__chain__)}return this.thru(Go)},Mr.prototype.toJSON=Mr.prototype.valueOf=Mr.prototype.value=function(){return ei(this.__wrapped__,this.__actions__)},Mr.prototype.first=Mr.prototype.head,Ee&&(Mr.prototype[Ee]=function(){return this}),Mr}();qt._=qe,void 0===(o=function(){return qe}.call(e,r,e,i))||(i.exports=o)}).call(this)}).call(this,r(32),r(33)(t))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==("undefined"==typeof window?"undefined":n(window))&&(r=window)}t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";var n=r(4);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(5)),o=Math.PI/180,a=180/Math.PI,s=function(t,e){this.lon=t,this.lat=e,this.x=o*t,this.y=o*e};s.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},s.prototype.antipode=function(){var t=-1*this.lat,e=this.lon<0?180+this.lon:-1*(180-this.lon);return new s(e,t)};var u=function(){this.coords=[],this.length=0};u.prototype.move_to=function(t){this.length++,this.coords.push(t)};var c=function(t){this.properties=t||{},this.geometries=[]};c.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],e=0;e=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}l.prototype.interpolate=function(t){var e=Math.sin((1-t)*this.g)/Math.sin(this.g),r=Math.sin(t*this.g)/Math.sin(this.g),n=e*Math.cos(this.start.y)*Math.cos(this.start.x)+r*Math.cos(this.end.y)*Math.cos(this.end.x),i=e*Math.cos(this.start.y)*Math.sin(this.start.x)+r*Math.cos(this.end.y)*Math.sin(this.end.x),o=e*Math.sin(this.start.y)+r*Math.sin(this.end.y),s=a*Math.atan2(o,Math.sqrt(Math.pow(n,2)+Math.pow(i,2)));return[a*Math.atan2(i,n),s]},l.prototype.Arc=function(t,e){var r=[];if(!t||t<=2)r.push([this.start.lon,this.start.lat]),r.push([this.end.lon,this.end.lat]);else for(var n=1/(t-1),i=0;if&&(y>p&&mp&&yl&&(l=v)}var A=[];if(s&&l0&&Math.abs(x-r[b-1][0])>f){var w=parseFloat(r[b-1][0]),C=parseFloat(r[b-1][1]),E=parseFloat(r[b][0]),I=parseFloat(r[b][1]);if(w>-180&&w-180&&r[b-1][0]p&&w<180&&-180===E&&b+1p&&r[b-1][0]<180){_.push([180,r[b][1]]),b++,_.push([r[b][0],r[b][1]]);continue}if(wp){var M=w;w=E,E=M;var S=C;C=I,I=S}if(w>p&&E=180&&wp?180:-180,P]),(_=[]).push([r[b-1][0]>p?-180:180,P]),A.push(_)}else _=[],A.push(_);_.push([x,r[b][1]])}else _.push([r[b][0],r[b][1]])}}else{var O=[];A.push(O);for(var L=0;Lt&&(t=n[0]),n[0]r&&(r=n[1]),n[1]t&&(t=n[0]),n[0]r&&(r=n[1]),n[1]=11),domSupported:"undefined"!=typeof document}),p={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},d={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},f=Object.prototype.toString,g=Array.prototype,m=g.forEach,y=g.filter,v=g.slice,A=g.map,_=g.reduce,b={};function x(t){if(null==t||"object"!==(0,c.default)(t))return t;var e=t,r=f.call(t);if("[object Array]"===r){if(!q(t)){e=[];for(var n=0,i=t.length;n3&&(n=yt.call(n,1));for(var o=e.length,a=0;a4&&(n=yt.call(n,1,n.length-1));for(var o=n[n.length-1],a=e.length,s=0;s>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[s]+":0",i[u]+":0",n[1-s]+":auto",i[1-u]+":auto",""].join("!important;"),t.appendChild(a),r.push(a)}return r}(e,o),o,i);if(a)return a(t,r,n),!0}return!1}(It,t,n,i))return r.zrX=It[0],void(r.zrY=It[1])}r.zrX=r.zrY=0}function Tt(t){return t||window.event}function Pt(t,e,r){if(null!=(e=Tt(e)).zrX)return e;var n=e.type;if(n&&n.indexOf("touch")>=0){var i="touchend"!==n?e.targetTouches[0]:e.changedTouches[0];i&&Mt(t,i,e,r)}else Mt(t,e,e,r),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var o=e.button;return null==e.which&&void 0!==o&&Et.test(e.type)&&(e.which=1&o?1:2&o?3:4&o?2:0),e}var Ot=Ct?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0},Lt=function(){this._track=[]};function kt(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}Lt.prototype={constructor:Lt,recognize:function(t,e,r){return this._doTrack(t,e,r),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,r){var n=t.touches;if(n){for(var i={points:[],touches:[],target:e,event:t},o=0,a=n.length;o1&&i&&i.length>1){var a=kt(i)/kt(o);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((n=i)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function Dt(){Ot(this.event)}function Bt(){}Bt.prototype.dispose=function(){};var Nt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Ft=function(t,e,r,n){vt.call(this),this.storage=t,this.painter=e,this.painterRoot=n,r=r||new Bt,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,gt.call(this),this.setHandlerProxy(r)};function jt(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var n,i=t;i;){if(i.clipPath&&!i.clipPath.contain(e,r))return!1;i.silent&&(n=!0),i=i.parent}return!n||"silent"}return!1}function zt(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}Ft.prototype={constructor:Ft,setHandlerProxy:function(t){this.proxy&&this.proxy.dispose(),t&&(k(Nt,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},mousemove:function(t){var e=t.zrX,r=t.zrY,n=zt(this,e,r),i=this._hovered,o=i.target;o&&!o.__zr&&(o=(i=this.findHover(i.x,i.y)).target);var a=this._hovered=n?{x:e,y:r}:this.findHover(e,r),s=a.target,u=this.proxy;u.setCursor&&u.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(i,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},mouseout:function(t){var e=t.zrEventControl,r=t.zrIsToLocalDOM;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&!r&&this.trigger("globalout",{type:"globalout",event:t})},resize:function(t){this._hovered={}},dispatch:function(t,e){var r=this[t];r&&r.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,r){var n=(t=t||{}).target;if(!n||!n.silent){for(var i="on"+e,o=function(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:Dt}}(e,t,r);n&&(n[i]&&(o.cancelBubble=n[i].call(n,o)),n.trigger(e,o),n=n.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer((function(t){"function"==typeof t[i]&&t[i].call(t,o),t.trigger&&t.trigger(e,o)})))}},findHover:function(t,e,r){for(var n=this.storage.getDisplayList(),i={x:t,y:e},o=n.length-1;o>=0;o--){var a;if(n[o]!==r&&!n[o].ignore&&(a=jt(n[o],t,e))&&(!i.topTarget&&(i.topTarget=n[o]),"silent"!==a)){i.target=n[o];break}}return i},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new Lt);var r=this._gestureMgr;"start"===e&&r.clear();var n=r.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&r.clear(),n){var i=n.type;t.gestureEvent=i,this.dispatchToElement({target:n.target},i,n.event)}}},k(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){Ft.prototype[t]=function(e){var r,n,i=e.zrX,o=e.zrY,a=zt(this,i,o);if("mouseup"===t&&a||(n=(r=this.findHover(i,o)).target),"mousedown"===t)this._downEl=n,this._downPoint=[e.zrX,e.zrY],this._upEl=n;else if("mouseup"===t)this._upEl=n;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||ut(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(r,t,e)}})),O(Ft,vt),O(Ft,gt);var Ut="undefined"==typeof Float32Array?Array:Float32Array;function Gt(){var t=new Ut(6);return Ht(t),t}function Ht(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Qt(t,e,r){var n=e[0]*r[0]+e[2]*r[1],i=e[1]*r[0]+e[3]*r[1],o=e[0]*r[2]+e[2]*r[3],a=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],u=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t}function qt(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function Wt(t,e,r){var n=e[0],i=e[2],o=e[4],a=e[1],s=e[3],u=e[5],c=Math.sin(r),l=Math.cos(r);return t[0]=n*l+a*c,t[1]=-n*c+a*l,t[2]=i*l+s*c,t[3]=-i*c+l*s,t[4]=l*o+c*u,t[5]=l*u-c*o,t}function Yt(t,e,r){var n=r[0],i=r[1];return t[0]=e[0]*n,t[1]=e[1]*i,t[2]=e[2]*n,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*i,t}function Xt(t,e){var r=e[0],n=e[2],i=e[4],o=e[1],a=e[3],s=e[5],u=r*a-o*n;return u?(u=1/u,t[0]=a*u,t[1]=-o*u,t[2]=-n*u,t[3]=r*u,t[4]=(n*s-a*i)*u,t[5]=(o*i-r*s)*u,t):null}var Zt=(Object.freeze||Object)({create:Gt,identity:Ht,copy:Vt,mul:Qt,translate:qt,rotate:Wt,scale:Yt,invert:Xt,clone:function(t){var e=Gt();return Vt(e,t),e}}),Kt=Ht;function Jt(t){return t>5e-5||t<-5e-5}var $t=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},te=$t.prototype;te.transform=null,te.needLocalTransform=function(){return Jt(this.rotation)||Jt(this.position[0])||Jt(this.position[1])||Jt(this.scale[0]-1)||Jt(this.scale[1]-1)};var ee=[];te.updateTransform=function(){var t=this.parent,e=t&&t.transform,r=this.needLocalTransform(),n=this.transform;if(r||e){n=n||Gt(),r?this.getLocalTransform(n):Kt(n),e&&(r?Qt(n,t.transform,n):Vt(n,t.transform)),this.transform=n;var i=this.globalScaleRatio;if(null!=i&&1!==i){this.getGlobalScale(ee);var o=ee[0]<0?-1:1,a=ee[1]<0?-1:1,s=((ee[0]-o)*i+o)/ee[0]||0,u=((ee[1]-a)*i+a)/ee[1]||0;n[0]*=s,n[1]*=s,n[2]*=u,n[3]*=u}this.invTransform=this.invTransform||Gt(),Xt(this.invTransform,n)}else n&&Kt(n)},te.getLocalTransform=function(t){return $t.getLocalTransform(this,t)},te.setTransform=function(t){var e=this.transform,r=t.dpr||1;e?t.setTransform(r*e[0],r*e[1],r*e[2],r*e[3],r*e[4],r*e[5]):t.setTransform(r,0,0,r,0,0)},te.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var re=[],ne=Gt();te.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],r=t[2]*t[2]+t[3]*t[3],n=this.position,i=this.scale;Jt(e-1)&&(e=Math.sqrt(e)),Jt(r-1)&&(r=Math.sqrt(r)),t[0]<0&&(e=-e),t[3]<0&&(r=-r),n[0]=t[4],n[1]=t[5],i[0]=e,i[1]=r,this.rotation=Math.atan2(-t[1]/r,t[0]/e)}},te.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(Qt(re,t.invTransform,e),e=re);var r=this.origin;r&&(r[0]||r[1])&&(ne[4]=r[0],ne[5]=r[1],Qt(re,e,ne),re[4]-=r[0],re[5]-=r[1],e=re),this.setLocalTransform(e)}},te.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},te.transformCoordToLocal=function(t,e){var r=[t,e],n=this.invTransform;return n&&ht(r,r,n),r},te.transformCoordToGlobal=function(t,e){var r=[t,e],n=this.transform;return n&&ht(r,r,n),r},$t.getLocalTransform=function(t,e){Kt(e=e||[]);var r=t.origin,n=t.scale||[1,1],i=t.rotation||0,o=t.position||[0,0];return r&&(e[4]-=r[0],e[5]-=r[1]),Yt(e,e,n),i&&Wt(e,e,i),r&&(e[4]+=r[0],e[5]+=r[1]),e[4]+=o[0],e[5]+=o[1],e};var ie={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=.4*Math.asin(1/r)/(2*Math.PI),-r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,r=.1;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,r=.1;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=.4*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-ie.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*ie.bounceIn(2*t):.5*ie.bounceOut(2*t-1)+.5}};function oe(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}oe.prototype={constructor:oe,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var r=(t-this._startTime-this._pausedTime)/this._life;if(!(r<0)){r=Math.min(r,1);var n=this.easing,i="string"==typeof n?ie[n]:n,o="function"==typeof i?i(r):r;return this.fire("frame",o),1===r?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var ae=function(){this.head=null,this.tail=null,this._len=0},se=ae.prototype;se.insert=function(t){var e=new ue(t);return this.insertEntry(e),e},se.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},se.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._len--},se.len=function(){return this._len},se.clear=function(){this.head=this.tail=null,this._len=0};var ue=function(t){this.value=t,this.next,this.prev},ce=function(t){this._list=new ae,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},le=ce.prototype;le.put=function(t,e){var r=this._list,n=this._map,i=null;if(null==n[t]){var o=r.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=r.head;r.remove(s),delete n[s.key],i=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new ue(e),a.key=t,r.insertEntry(a),n[t]=a}return i},le.get=function(t){var e=this._map[t],r=this._list;if(null!=e)return e!==r.tail&&(r.remove(e),r.insertEntry(e)),e.value},le.clear=function(){this._list.clear(),this._map={}};var he={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function pe(t){return(t=Math.round(t))<0?0:t>255?255:t}function de(t){return t<0?0:t>1?1:t}function fe(t){return t.length&&"%"===t.charAt(t.length-1)?pe(parseFloat(t)/100*255):pe(parseInt(t,10))}function ge(t){return t.length&&"%"===t.charAt(t.length-1)?de(parseFloat(t)/100):de(parseFloat(t))}function me(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function ye(t,e,r){return t+(e-t)*r}function ve(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function Ae(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var _e=new ce(20),be=null;function xe(t,e){be&&Ae(be,e),be=_e.put(t,be||e.slice())}function we(t,e){if(t){e=e||[];var r=_e.get(t);if(r)return Ae(e,r);var n,i=(t+="").replace(/ /g,"").toLowerCase();if(i in he)return Ae(e,he[i]),xe(t,e),e;if("#"===i.charAt(0))return 4===i.length?(n=parseInt(i.substr(1),16))>=0&&n<=4095?(ve(e,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),xe(t,e),e):void ve(e,0,0,0,1):7===i.length?(n=parseInt(i.substr(1),16))>=0&&n<=16777215?(ve(e,(16711680&n)>>16,(65280&n)>>8,255&n,1),xe(t,e),e):void ve(e,0,0,0,1):void 0;var o=i.indexOf("("),a=i.indexOf(")");if(-1!==o&&a+1===i.length){var s=i.substr(0,o),u=i.substr(o+1,a-(o+1)).split(","),c=1;switch(s){case"rgba":if(4!==u.length)return void ve(e,0,0,0,1);c=ge(u.pop());case"rgb":return 3!==u.length?void ve(e,0,0,0,1):(ve(e,fe(u[0]),fe(u[1]),fe(u[2]),c),xe(t,e),e);case"hsla":return 4!==u.length?void ve(e,0,0,0,1):(u[3]=ge(u[3]),Ce(u,e),xe(t,e),e);case"hsl":return 3!==u.length?void ve(e,0,0,0,1):(Ce(u,e),xe(t,e),e);default:return}}ve(e,0,0,0,1)}}function Ce(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=ge(t[1]),i=ge(t[2]),o=i<=.5?i*(n+1):i+n-i*n,a=2*i-o;return ve(e=e||[],pe(255*me(a,o,r+1/3)),pe(255*me(a,o,r)),pe(255*me(a,o,r-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Ee(t){var e=we(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Ie(t,e,r){if(e&&e.length&&t>=0&&t<=1){r=r||[];var n=t*(e.length-1),i=Math.floor(n),o=Math.ceil(n),a=e[i],s=e[o],u=n-i;return r[0]=pe(ye(a[0],s[0],u)),r[1]=pe(ye(a[1],s[1],u)),r[2]=pe(ye(a[2],s[2],u)),r[3]=de(ye(a[3],s[3],u)),r}}var Me=Ie;function Se(t,e,r){if(e&&e.length&&t>=0&&t<=1){var n=t*(e.length-1),i=Math.floor(n),o=Math.ceil(n),a=we(e[i]),s=we(e[o]),u=n-i,c=Pe([pe(ye(a[0],s[0],u)),pe(ye(a[1],s[1],u)),pe(ye(a[2],s[2],u)),de(ye(a[3],s[3],u))],"rgba");return r?{color:c,leftIndex:i,rightIndex:o,value:n}:c}}var Te=Se;function Pe(t,e){if(t&&t.length){var r=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(r+=","+t[3]),e+"("+r+")"}}var Oe=(Object.freeze||Object)({parse:we,lift:function(t,e){var r=we(t);if(r){for(var n=0;n<3;n++)r[n]=e<0?r[n]*(1-e)|0:(255-r[n])*e+r[n]|0,r[n]>255?r[n]=255:t[n]<0&&(r[n]=0);return Pe(r,4===r.length?"rgba":"rgb")}},toHex:Ee,fastLerp:Ie,fastMapToColor:Me,lerp:Se,mapToColor:Te,modifyHSL:function(t,e,r,n){if(t=we(t))return t=function(t){if(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),u=s-a,c=(s+a)/2;if(0===u)e=0,r=0;else{r=c<.5?u/(s+a):u/(2-s-a);var l=((s-n)/6+u/2)/u,h=((s-i)/6+u/2)/u,p=((s-o)/6+u/2)/u;n===s?e=p-h:i===s?e=1/3+l-p:o===s&&(e=2/3+h-l),e<0&&(e+=1),e>1&&(e-=1)}var d=[360*e,r,c];return null!=t[3]&&d.push(t[3]),d}}(t),null!=e&&(t[0]=function(t){return(t=Math.round(t))<0?0:t>360?360:t}(e)),null!=r&&(t[1]=ge(r)),null!=n&&(t[2]=ge(n)),Pe(Ce(t),"rgba")},modifyAlpha:function(t,e){if((t=we(t))&&null!=e)return t[3]=de(e),Pe(t,"rgba")},stringify:Pe}),Le=Array.prototype.slice;function ke(t,e){return t[e]}function Re(t,e,r){t[e]=r}function De(t,e,r){return(e-t)*r+t}function Be(t,e,r){return r>.5?e:t}function Ne(t,e,r,n,i){var o=t.length;if(1===i)for(var a=0;ai)t.length=i;else for(var o=n;o=0&&!(g[r]<=e);r--);r=Math.min(r,c-2)}else{for(r=S;re);r++);r=Math.min(r-1,c-2)}S=r,T=e;var n=g[r+1]-g[r];if(0!==n)if(w=(e-g[r])/n,u)if(E=m[r],C=m[0===r?r:r-1],I=m[r>c-2?c-1:r+1],M=m[r>c-3?c-1:r+2],h)ze(C,E,I,M,w,w*w,w*w*w,a(t,i),f);else{if(p)o=ze(C,E,I,M,w,w*w,w*w*w,P,1),o=He(P);else{if(d)return Be(E,I,w);o=Ue(C,E,I,M,w,w*w,w*w*w)}s(t,i,o)}else if(h)Ne(m[r],m[r+1],w,a(t,i),f);else{var o;if(p)Ne(m[r],m[r+1],w,P,1),o=He(P);else{if(d)return Be(m[r],m[r+1],w);o=De(m[r],m[r+1],w)}s(t,i,o)}},ondestroy:r});return e&&"spline"!==e&&(O.easing=e),O}}}var Qe=function(t,e,r,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=r||ke,this._setter=n||Re,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};Qe.prototype={when:function(t,e){var r=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!r[n]){r[n]=[];var i=this._getter(this._target,n);if(null==i)continue;0!==t&&r[n].push({time:0,value:Ge(i)})}r[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t0&&e.animate(r,!1).when(null==o?500:o,u).delay(a||0)}(t,"",t,e,r,n,s);var u=t.animators.slice(),c=u.length;function l(){--c||o&&o()}c||o&&o();for(var h=0;h=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height},clone:function(){return new ar(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},ar.create=function(t){return new ar(t.x,t.y,t.width,t.height)};var sr=function(t){for(var e in Je.call(this,t=t||{}),t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};function ur(t,e,r,n){var i=e+1;if(i===r)return 1;if(n(t[i++],t[e])<0){for(;i=0;)i++;return i-e}function cr(t,e,r,n,i){for(n===e&&n++;n>>1])<0?u=o:s=o+1;var c=n-s;switch(c){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;c>0;)t[s+c]=t[s+c-1],c--}t[s]=a}}function lr(t,e,r,n,i,o){var a=0,s=0,u=1;if(o(t,e[r+i])>0){for(s=n-i;u0;)a=u,(u=1+(u<<1))<=0&&(u=s);u>s&&(u=s),a+=i,u+=i}else{for(s=i+1;us&&(u=s);var c=a;a=i-u,u=i-c}for(a++;a>>1);o(t,e[r+l])>0?a=l+1:u=l}return u}function hr(t,e,r,n,i,o){var a=0,s=0,u=1;if(o(t,e[r+i])<0){for(s=i+1;us&&(u=s);var c=a;a=i-u,u=i-c}else{for(s=n-i;u=0;)a=u,(u=1+(u<<1))<=0&&(u=s);u>s&&(u=s),a+=i,u+=i}for(a++;a>>1);o(t,e[r+l])<0?u=l:a=l+1}return u}function pr(t,e){var r,n,i=7,o=0,a=[];function s(s){var u=r[s],c=n[s],l=r[s+1],h=n[s+1];n[s]=c+h,s===o-3&&(r[s+1]=r[s+2],n[s+1]=n[s+2]),o--;var p=hr(t[l],t,u,c,0,e);u+=p,0!=(c-=p)&&0!==(h=lr(t[u+c-1],t,l,h,h-1,e))&&(c<=h?function(r,n,o,s){var u=0;for(u=0;u=7||d>=7);if(f)break;g<0&&(g=0),g+=2}if((i=g)<1&&(i=1),1===n){for(u=0;u=0;u--)t[d+u]=t[p+u];if(0===n){y=!0;break}}if(t[h--]=a[l--],1==--s){y=!0;break}if(0!=(m=s-lr(t[c],a,0,s,s-1,e))){for(s-=m,d=1+(h-=m),p=1+(l-=m),u=0;u=7||m>=7);if(y)break;f<0&&(f=0),f+=2}if((i=f)<1&&(i=1),1===s){for(d=1+(h-=n),p=1+(c-=n),u=n-1;u>=0;u--)t[d+u]=t[p+u];t[h]=a[l]}else{if(0===s)throw new Error;for(p=h-(s-1),u=0;u=0;u--)t[d+u]=t[p+u];t[h]=a[l]}else for(p=h-(s-1),u=0;u1;){var t=o-2;if(t>=1&&n[t-1]<=n[t]+n[t+1]||t>=2&&n[t-2]<=n[t]+n[t-1])n[t-1]n[t+1])break;s(t)}},this.forceMergeRuns=function(){for(;o>1;){var t=o-2;t>0&&n[t-1]=32;)e|=1&t,t>>=1;return t+e}(i);do{if((o=ur(t,r,n,e))s&&(u=s),cr(t,r,r+u,r+o,e),o=u}a.pushRun(r,o),a.mergeRuns(),i-=o,r+=o}while(0!==i);a.forceMergeRuns()}}}function fr(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}sr.prototype={constructor:sr,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,r=0;r=0&&(r.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,r=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),(0,u.default)(t,sr)&&t.addChildrenToStorage(e)),r&&r.refresh()},remove:function(t){var e=this.__zr,r=this.__storage,n=this._children,i=T(n,t);return i<0||(n.splice(i,1),t.parent=null,r&&(r.delFromStorage(t),(0,u.default)(t,sr)&&t.delChildrenFromStorage(r)),e&&e.refresh()),this},removeAll:function(){var t,e,r=this._children,n=this.__storage;for(e=0;e=0&&(this.delFromStorage(t),this._roots.splice(i,1),(0,u.default)(t,sr)&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:fr};var mr={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},yr=function(t,e,r){return mr.hasOwnProperty(e)?r*t.dpr:r},vr=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],Ar=function(t){this.extendFrom(t,!1)};function _r(t,e,r){var n=null==e.x?0:e.x,i=null==e.x2?1:e.x2,o=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(n=n*r.width+r.x,i=i*r.width+r.x,o=o*r.height+r.y,a=a*r.height+r.y),n=isNaN(n)?0:n,i=isNaN(i)?1:i,o=isNaN(o)?0:o,a=isNaN(a)?0:a,t.createLinearGradient(n,o,i,a)}function br(t,e,r){var n=r.width,i=r.height,o=Math.min(n,i),a=null==e.x?.5:e.x,s=null==e.y?.5:e.y,u=null==e.r?.5:e.r;return e.global||(a=a*n+r.x,s=s*i+r.y,u*=o),t.createRadialGradient(a,s,0,a,s,u)}for(var xr=Ar.prototype={constructor:Ar,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,r){var n=r&&r.style,i=!n||1!==t.__attrCachedBy;t.__attrCachedBy=1;for(var o=0;o0},extendFrom:function(t,e){if(t)for(var r in t)!t.hasOwnProperty(r)||!0!==e&&(!1===e?this.hasOwnProperty(r):null==t[r])||(this[r]=t[r])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,r){for(var n=("radial"===e.type?br:_r)(t,e,r),i=e.colorStops,o=0;o5e3&&(Br=0,Dr={}),Br++,Dr[r]=i,i}function zr(t,e,r,n,i,o,a,s){return a?function(t,e,r,n,i,o,a,s){var u=Kr(t,{rich:a,truncate:s,font:e,textAlign:r,textPadding:i,textLineHeight:o}),c=u.outerWidth,l=u.outerHeight;return new ar(Ur(0,c,r),Gr(0,l,n),c,l)}(t,e,r,n,i,o,a,s):function(t,e,r,n,i,o,a){var s=Zr(t,e,i,o,a),u=jr(t,e);i&&(u+=i[1]+i[3]);var c=s.outerHeight,l=new ar(Ur(0,u,r),Gr(0,c,n),u,c);return l.lineHeight=s.lineHeight,l}(t,e,r,n,i,o,s)}function Ur(t,e,r){return"right"===r?t-=e:"center"===r&&(t-=e/2),t}function Gr(t,e,r){return"middle"===r?t-=e/2:"bottom"===r&&(t-=e),t}function Hr(t,e,r){var n=e.textPosition,i=e.textDistance,o=r.x,a=r.y;i=i||0;var s=r.height,u=r.width,c=s/2,l="left",h="top";switch(n){case"left":o-=i,a+=c,l="right",h="middle";break;case"right":o+=i+u,a+=c,h="middle";break;case"top":o+=u/2,a-=i,l="center",h="bottom";break;case"bottom":o+=u/2,a+=s+i,l="center";break;case"inside":o+=u/2,a+=c,l="center",h="middle";break;case"insideLeft":o+=i,a+=c,h="middle";break;case"insideRight":o+=u-i,a+=c,l="right",h="middle";break;case"insideTop":o+=u/2,a+=i,l="center";break;case"insideBottom":o+=u/2,a+=s-i,l="center",h="bottom";break;case"insideTopLeft":o+=i,a+=i;break;case"insideTopRight":o+=u-i,a+=i,l="right";break;case"insideBottomLeft":o+=i,a+=s-i,h="bottom";break;case"insideBottomRight":o+=u-i,a+=s-i,l="right",h="bottom"}return(t=t||{}).x=o,t.y=a,t.textAlign=l,t.textVerticalAlign=h,t}function Vr(t,e,r,n,i){if(!e)return"";var o=(t+"").split("\n");i=Qr(e,r,n,i);for(var a=0,s=o.length;a=o;s++)a-=o;var u=jr(r,e);return u>a&&(r="",u=0),a=t-u,n.ellipsis=r,n.ellipsisWidth=u,n.contentWidth=a,n.containerWidth=t,n}function qr(t,e){var r=e.containerWidth,n=e.font,i=e.contentWidth;if(!r)return"";var o=jr(t,n);if(o<=r)return t;for(var a=0;;a++){if(o<=i||a>=e.maxIterations){t+=e.ellipsis;break}var s=0===a?Wr(t,i,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*i/o):0;o=jr(t=t.substr(0,s),n)}return""===t&&(t=e.placeholder),t}function Wr(t,e,r,n){for(var i=0,o=0,a=t.length;ol)t="",a=[];else if(null!=h)for(var p=Qr(h-(r?r[1]+r[3]:0),e,i.ellipsis,{minChar:i.minChar,placeholder:i.placeholder}),d=0,f=a.length;di&&Jr(r,t.substring(i,o)),Jr(r,n[2],n[1]),i=Nr.lastIndex}id)return{lines:[],width:0,height:0};T.textWidth=jr(T.text,b);var w=A.textWidth,C=null==w||"auto"===w;if("string"==typeof w&&"%"===w.charAt(w.length-1))T.percentWidth=w,c.push(T),w=0;else{if(C){w=T.textWidth;var E=A.textBackgroundColor,I=E&&E.image;I&&Rr(I=Or(I))&&(w=Math.max(w,I.width*x/I.height))}var M=_?_[1]+_[3]:0;w+=M;var S=null!=p?p-y:null;null!=S&&Sl&&(r*=l/(a=r+n),n*=l/a),i+o>l&&(i*=l/(a=i+o),o*=l/a),n+i>h&&(n*=h/(a=n+i),i*=h/a),r+o>h&&(r*=h/(a=r+o),o*=h/a),t.moveTo(s+r,c),t.lineTo(s+l-n,c),0!==n&&t.arc(s+l-n,c+n,n,-Math.PI/2,0),t.lineTo(s+l,c+h-i),0!==i&&t.arc(s+l-i,c+h-i,i,0,Math.PI/2),t.lineTo(s+o,c+h),0!==o&&t.arc(s+o,c+h-o,o,Math.PI/2,Math.PI),t.lineTo(s,c+r),0!==r&&t.arc(s+r,c+r,r,Math.PI,1.5*Math.PI)}Fr.measureText=function(t,e){var r=S();return r.font=e||"12px sans-serif",r.measureText(t)};var tn={left:1,right:1,center:1},en={top:1,bottom:1,middle:1},rn=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],nn={},on={};function an(t){return sn(t),k(t.rich,sn),t}function sn(t){if(t){t.font=function(t){var e=(t.fontSize||t.fontFamily)&&[t.fontStyle,t.fontWeight,(t.fontSize||12)+"px",t.fontFamily||"sans-serif"].join(" ");return e&&Q(e)||t.textFont||t.font}(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||tn[e]?e:"left";var r=t.textVerticalAlign||t.textBaseline;"center"===r&&(r="middle"),t.textVerticalAlign=null==r||en[r]?r:"top",t.textPadding&&(t.textPadding=V(t.textPadding))}}function un(t,e,r,n,i,o){n.rich?function(t,e,r,n,i,o){9!==o&&(e.__attrCachedBy=0);var a=t.__textCotentBlock;a&&!t.__dirtyText||(a=t.__textCotentBlock=Kr(r,n)),function(t,e,r,n,i){var o=r.width,a=r.outerWidth,s=r.outerHeight,u=n.textPadding,c=fn(on,t,n,i),l=c.baseX,h=c.baseY,p=c.textAlign,d=c.textVerticalAlign;cn(e,n,i,l,h);var f=Ur(l,a,p),g=Gr(h,s,d),m=f,y=g;u&&(m+=u[3],y+=u[0]);var v=m+o;hn(n)&&pn(t,e,n,f,g,a,s);for(var A=0;A=0&&"right"===(_=x[T]).textAlign;)ln(t,e,_,n,C,y,S,"right"),E-=_.width,S-=_.width,T--;for(M+=(o-(M-m)-(v-S)-E)/2;I<=T;)ln(t,e,_=x[I],n,C,y,M+_.width/2,"center"),M+=_.width,I++;y+=C}}(t,e,a,n,i)}(t,e,r,n,i,o):function(t,e,r,n,i,o){var a,s=hn(n),u=!1,c=2===e.__attrCachedBy;9!==o?(o&&(a=o.style,u=!s&&c&&a),e.__attrCachedBy=s?0:2):c&&(e.__attrCachedBy=0);var l=n.font||"12px sans-serif";u&&l===(a.font||"12px sans-serif")||(e.font=l);var h=t.__computedFont;t.__styleFont!==l&&(t.__styleFont=l,h=t.__computedFont=e.font);var p=n.textPadding,d=n.textLineHeight,f=t.__textCotentBlock;f&&!t.__dirtyText||(f=t.__textCotentBlock=Zr(r,h,p,d,n.truncate));var g=f.outerHeight,m=f.lines,y=f.lineHeight,v=fn(on,t,n,i),A=v.baseX,_=v.baseY,b=v.textAlign||"left",x=v.textVerticalAlign;cn(e,n,i,A,_);var w=Gr(_,g,x),C=A,E=w;if(s||p){var I=jr(r,h);p&&(I+=p[1]+p[3]);var M=Ur(A,I,b);s&&pn(t,e,n,M,w,I,g),p&&(C=An(A,b,p),E+=p[0])}e.textAlign=b,e.textBaseline="middle",e.globalAlpha=n.opacity||1;for(var S=0;S=0?parseFloat(t)/100*e:parseFloat(t):t}function An(t,e,r){return"right"===e?t-r[1]:"center"===e?t+r[3]/2-r[1]/2:t+r[3]}function _n(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}var bn=new ar,xn=function(){};function wn(t){for(var e in Je.call(this,t=t||{}),t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new Ar(t.style,this),this._rect=null,this.__clipPaths=null}function Cn(t){wn.call(this,t)}function En(t){return parseInt(t,10)}xn.prototype={constructor:xn,drawRectText:function(t,e){var r=this.style;e=r.textRect||e,this.__dirty&&an(r);var n=r.text;if(null!=n&&(n+=""),_n(n,r)){t.save();var i=this.transform;r.transformText?this.setTransform(t):i&&(bn.copy(e),bn.applyTransform(i),e=bn),un(this,t,n,r,e,9),t.restore()}}},wn.prototype={constructor:wn,type:"displayable",__dirty:!0,invisible:!1,z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,globalScaleRatio:1,beforeBrush:function(t){},afterBrush:function(t){},brush:function(t,e){},getBoundingRect:function(){},contain:function(t,e){return this.rectContain(t,e)},traverse:function(t,e){t.call(e,this)},rectContain:function(t,e){var r=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(r[0],r[1])},dirty:function(){this.__dirty=this.__dirtyText=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(t){return this.animate("style",t)},attrKV:function(t,e){"style"!==t?Je.prototype.attrKV.call(this,t,e):this.style.set(e)},setStyle:function(t,e){return this.style.set(t,e),this.dirty(!1),this},useStyle:function(t){return this.style=new Ar(t,this),this.dirty(!1),this},calculateTextPosition:null},P(wn,Je),O(wn,xn),Cn.prototype={constructor:Cn,type:"image",brush:function(t,e){var r=this.style,n=r.image;r.bind(t,this,e);var i=this._image=Lr(n,this._image,this,this.onload);if(i&&Rr(i)){var o=r.x||0,a=r.y||0,s=r.width,u=r.height,c=i.width/i.height;if(null==s&&null!=u?s=u*c:null==u&&null!=s?u=s/c:null==s&&null==u&&(s=i.width,u=i.height),this.setTransform(t),r.sWidth&&r.sHeight){var l=r.sx||0,h=r.sy||0;t.drawImage(i,l,h,r.sWidth,r.sHeight,o,a,s,u)}else if(r.sx&&r.sy){var p=s-(l=r.sx),d=u-(h=r.sy);t.drawImage(i,l,h,p,d,o,a,s,u)}else t.drawImage(i,o,a,s,u);null!=r.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))}},getBoundingRect:function(){var t=this.style;return this._rect||(this._rect=new ar(t.x||0,t.y||0,t.width||0,t.height||0)),this._rect}},P(Cn,wn);var In=new ar(0,0,0,0),Mn=new ar(0,0,0,0),Sn=function(t,e,r){this.type="canvas";var n=!t.nodeName||"CANVAS"===t.nodeName.toUpperCase();this._opts=r=C({},r||{}),this.dpr=r.devicePixelRatio||We,this._singleCanvas=n,this.root=t;var i=t.style;i&&(i["-webkit-tap-highlight-color"]="transparent",i["-webkit-user-select"]=i["user-select"]=i["-webkit-touch-callout"]="none",t.innerHTML=""),this.storage=e;var o=this._zlevelList=[],a=this._layers={};if(this._layerConfig={},this._needsManuallyCompositing=!1,n){var s=t.width,u=t.height;null!=r.width&&(s=r.width),null!=r.height&&(u=r.height),this.dpr=r.devicePixelRatio||1,t.width=s*this.dpr,t.height=u*this.dpr,this._width=s,this._height=u;var c=new Sr(t,this,this.dpr);c.__builtin__=!0,c.initContext(),a[314159]=c,c.zlevel=314159,o.push(314159),this._domRoot=t}else{this._width=this._getSize(0),this._height=this._getSize(1);var l=this._domRoot=function(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}(this._width,this._height);t.appendChild(l)}this._hoverlayer=null,this._hoverElements=[]};Sn.prototype={constructor:Sn,getType:function(){return"canvas"},isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(t){var e=this.storage.getDisplayList(!0),r=this._zlevelList;this._redrawId=Math.random(),this._paintList(e,t,this._redrawId);for(var n=0;n=0&&r.splice(n,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,r=0;r15)break}s.__drawIndex=m,s.__drawIndex0&&t>n[0]){for(a=0;at);a++);o=r[n[a]]}if(n.splice(a+1,0,t),r[t]=e,!e.virtual)if(o){var u=o.dom;u.nextSibling?s.insertBefore(e.dom,u.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}else Ye("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var r,n,i=this._zlevelList;for(n=0;n0?.01:0),this._needsManuallyCompositing),s.__builtin__||Ye("ZLevel "+u+" has been used by unkown layer "+s.id),s!==i&&(s.__used=!0,s.__startIndex!==r&&(s.__dirty=!0),s.__startIndex=r,s.incremental?s.__drawIndex=-1:s.__drawIndex=r,e(r),i=s),a.__dirty&&(s.__dirty=!0,s.incremental&&s.__drawIndex<0&&(s.__drawIndex=r))}e(r),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var r=this._layerConfig;r[t]?w(r[t],e,!0):r[t]=e;for(var n=0;n=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),r=0;r-1e-8&&t<1e-8}function ui(t){return t>1e-8||t<-1e-8}function ci(t,e,r,n,i){var o=1-i;return o*o*(o*t+3*i*e)+i*i*(i*n+3*o*r)}function li(t,e,r,n,i){var o=1-i;return 3*(((e-t)*o+2*(r-e)*i)*o+(n-r)*i*i)}function hi(t,e,r,n,i){var o=6*r-12*e+6*t,a=9*e+3*n-3*t-9*r,s=3*e-3*t,u=0;if(si(a))ui(o)&&(l=-s/o)>=0&&l<=1&&(i[u++]=l);else{var c=o*o-4*a*s;if(si(c))i[0]=-o/(2*a);else if(c>0){var l,h=ri(c),p=(-o-h)/(2*a);(l=(-o+h)/(2*a))>=0&&l<=1&&(i[u++]=l),p>=0&&p<=1&&(i[u++]=p)}}return u}function pi(t,e,r,n,i,o){var a=(e-t)*i+t,s=(r-e)*i+e,u=(n-r)*i+r,c=(s-a)*i+a,l=(u-s)*i+s,h=(l-c)*i+c;o[0]=t,o[1]=a,o[2]=c,o[3]=h,o[4]=h,o[5]=l,o[6]=u,o[7]=n}function di(t,e,r,n){var i=1-n;return i*(i*t+2*n*e)+n*n*r}function fi(t,e,r,n){return 2*((1-n)*(e-t)+n*(r-e))}function gi(t,e,r){var n=t+r-2*e;return 0===n?.5:(t-e)/n}function mi(t,e,r,n,i){var o=(e-t)*n+t,a=(r-e)*n+e,s=(a-o)*n+o;i[0]=t,i[1]=o,i[2]=s,i[3]=s,i[4]=a,i[5]=r}var yi=Math.min,vi=Math.max,Ai=Math.sin,_i=Math.cos,bi=2*Math.PI,xi=K(),wi=K(),Ci=K();function Ei(t,e,r,n,i,o){i[0]=yi(t,r),i[1]=yi(e,n),o[0]=vi(t,r),o[1]=vi(e,n)}var Ii=[],Mi=[];function Si(t,e,r,n,i,o,a,s,u,c){var l,h=hi,p=ci,d=h(t,r,i,a,Ii);for(u[0]=1/0,u[1]=1/0,c[0]=-1/0,c[1]=-1/0,l=0;l1e-4)return s[0]=t-r,s[1]=e-n,u[0]=t+r,void(u[1]=e+n);if(xi[0]=_i(i)*r+t,xi[1]=Ai(i)*n+e,wi[0]=_i(o)*r+t,wi[1]=Ai(o)*n+e,c(s,xi,wi),l(u,xi,wi),(i%=bi)<0&&(i+=bi),(o%=bi)<0&&(o+=bi),i>o&&!a?o+=bi:ii&&(Ci[0]=_i(d)*r+t,Ci[1]=Ai(d)*n+e,c(s,Ci,s),l(u,Ci,u))}var Oi={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Li=[],ki=[],Ri=[],Di=[],Bi=Math.min,Ni=Math.max,Fi=Math.cos,ji=Math.sin,zi=Math.sqrt,Ui=Math.abs,Gi="undefined"!=typeof Float32Array,Hi=function(t){this._saveData=!t,this._saveData&&(this.data=[]),this._ctx=null};function Vi(t,e,r,n,i,o,a){if(0===i)return!1;var s,u=i;if(a>e+u&&a>n+u||at+u&&o>r+u||oe+h&&l>n+h&&l>o+h&&l>s+h||lt+h&&c>r+h&&c>i+h&&c>a+h||c=0&&fe+c&&u>n+c&&u>o+c||ut+c&&s>r+c&&s>i+c||s=0&&mthis._ux||Ui(e-this._yi)>this._uy||this._len<5;return this.addData(Oi.L,t,e),this._ctx&&r&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),r&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,r,n,i,o){return this.addData(Oi.C,t,e,r,n,i,o),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,r,n,i,o):this._ctx.bezierCurveTo(t,e,r,n,i,o)),this._xi=i,this._yi=o,this},quadraticCurveTo:function(t,e,r,n){return this.addData(Oi.Q,t,e,r,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,r,n):this._ctx.quadraticCurveTo(t,e,r,n)),this._xi=r,this._yi=n,this},arc:function(t,e,r,n,i,o){return this.addData(Oi.A,t,e,r,r,n,i-n,0,o?0:1),this._ctx&&this._ctx.arc(t,e,r,n,i,o),this._xi=Fi(i)*r+t,this._yi=ji(i)*r+e,this},arcTo:function(t,e,r,n,i){return this._ctx&&this._ctx.arcTo(t,e,r,n,i),this},rect:function(t,e,r,n){return this._ctx&&this._ctx.rect(t,e,r,n),this.addData(Oi.R,t,e,r,n),this},closePath:function(){this.addData(Oi.Z);var t=this._ctx,e=this._x0,r=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,r),t.closePath()),this._xi=e,this._yi=r,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if((0,u.default)(t,Array)){this._lineDash=t,this._dashIdx=0;for(var e=0,r=0;re.length&&(this._expandData(),e=this.data);for(var r=0;r0&&d<=t||l<0&&d>=t||0===l&&(h>0&&f<=e||h<0&&f>=e);)d+=l*(r=a[n=this._dashIdx]),f+=h*r,this._dashIdx=(n+1)%g,l>0&&du||h>0&&fc||s[n%2?"moveTo":"lineTo"](l>=0?Bi(d,t):Ni(d,t),h>=0?Bi(f,e):Ni(f,e));l=d-t,h=f-e,this._dashOffset=-zi(l*l+h*h)},_dashedBezierTo:function(t,e,r,n,i,o){var a,s,u,c,l,h=this._dashSum,p=this._dashOffset,d=this._lineDash,f=this._ctx,g=this._xi,m=this._yi,y=ci,v=0,A=this._dashIdx,_=d.length,b=0;for(p<0&&(p=h+p),p%=h,a=0;a<1;a+=.1)s=y(g,t,r,i,a+.1)-y(g,t,r,i,a),u=y(m,e,n,o,a+.1)-y(m,e,n,o,a),v+=zi(s*s+u*u);for(;A<_&&!((b+=d[A])>p);A++);for(a=(b-p)/v;a<=1;)c=y(g,t,r,i,a),l=y(m,e,n,o,a),A%2?f.moveTo(c,l):f.lineTo(c,l),a+=d[A]/v,A=(A+1)%_;A%2!=0&&f.lineTo(i,o),s=i-c,u=o-l,this._dashOffset=-zi(s*s+u*u)},_dashedQuadraticTo:function(t,e,r,n){var i=r,o=n;r=(r+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,r,n,i,o)},toStatic:function(){var t=this.data;(0,u.default)(t,Array)&&(t.length=this._len,Gi&&(this.data=new Float32Array(t)))},getBoundingRect:function(){Li[0]=Li[1]=Ri[0]=Ri[1]=Number.MAX_VALUE,ki[0]=ki[1]=Di[0]=Di[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,r=0,n=0,i=0,o=0;ou||Ui(a-i)>c||h===l-1)&&(t.lineTo(o,a),n=o,i=a);break;case Oi.C:t.bezierCurveTo(s[h++],s[h++],s[h++],s[h++],s[h++],s[h++]),n=s[h-2],i=s[h-1];break;case Oi.Q:t.quadraticCurveTo(s[h++],s[h++],s[h++],s[h++]),n=s[h-2],i=s[h-1];break;case Oi.A:var d=s[h++],f=s[h++],g=s[h++],m=s[h++],y=s[h++],v=s[h++],A=s[h++],_=s[h++],b=g>m?g:m,x=g>m?1:g/m,w=g>m?m/g:1,C=y+v;Math.abs(g-m)>.001?(t.translate(d,f),t.rotate(A),t.scale(x,w),t.arc(0,0,b,y,C,1-_),t.scale(1/x,1/w),t.rotate(-A),t.translate(-d,-f)):t.arc(d,f,b,y,C,1-_),1===h&&(e=Fi(y)*g+d,r=ji(y)*m+f),n=Fi(C)*g+d,i=ji(C)*m+f;break;case Oi.R:e=n=s[h],r=i=s[h+1],t.rect(s[h++],s[h++],s[h++],s[h++]);break;case Oi.Z:t.closePath(),n=e,i=r}}}},Hi.CMD=Oi;var Wi=2*Math.PI;function Yi(t){return(t%=Wi)<0&&(t+=Wi),t}var Xi=2*Math.PI;function Zi(t,e,r,n,i,o,a,s,u){if(0===a)return!1;var c=a;s-=t,u-=e;var l=Math.sqrt(s*s+u*u);if(l-c>r||l+ci&&(i+=Xi);var p=Math.atan2(u,s);return p<0&&(p+=Xi),p>=n&&p<=i||p+Xi>=n&&p+Xi<=i}function Ki(t,e,r,n,i,o){if(o>e&&o>n||oi?a:0}var Ji=Hi.CMD,$i=2*Math.PI,to=[-1,-1,-1],eo=[-1,-1];function ro(t,e,r,n,i,o,a,s,u,c){if(c>e&&c>n&&c>o&&c>s||c=0&&C<=1&&(o[d++]=C);else{var f=h*h-4*l*p;if(si(f)){var g=h/l,m=-g/2;(C=-s/a+g)>=0&&C<=1&&(o[d++]=C),m>=0&&m<=1&&(o[d++]=m)}else if(f>0){var y=ri(f),v=l*s+1.5*a*(-h+y),A=l*s+1.5*a*(-h-y);(C=(-s-((v=v<0?-ei(-v,1/3):ei(v,1/3))+(A=A<0?-ei(-A,1/3):ei(A,1/3))))/(3*a))>=0&&C<=1&&(o[d++]=C)}else{var _=(2*l*s-3*a*h)/(2*ri(l*l*l)),b=Math.acos(_)/3,x=ri(l),w=Math.cos(b),C=(-s-2*x*w)/(3*a),E=(m=(-s+x*(w+ni*Math.sin(b)))/(3*a),(-s+x*(w-ni*Math.sin(b)))/(3*a));C>=0&&C<=1&&(o[d++]=C),m>=0&&m<=1&&(o[d++]=m),E>=0&&E<=1&&(o[d++]=E)}}return d}(e,n,o,s,c,to);if(0===h)return 0;for(var p,d,f=0,g=-1,m=0;m1&&(void 0,l=eo[0],eo[0]=eo[1],eo[1]=l),p=ci(e,n,o,s,eo[0]),g>1&&(d=ci(e,n,o,s,eo[1]))),2===g?ye&&s>n&&s>o||s=0&&l<=1&&(i[u++]=l);else{var c=a*a-4*o*s;if(si(c))(l=-a/(2*o))>=0&&l<=1&&(i[u++]=l);else if(c>0){var l,h=ri(c),p=(-a-h)/(2*o);(l=(-a+h)/(2*o))>=0&&l<=1&&(i[u++]=l),p>=0&&p<=1&&(i[u++]=p)}}return u}(e,n,o,s,to);if(0===u)return 0;var c=gi(e,n,o);if(c>=0&&c<=1){for(var l=0,h=di(e,n,o,c),p=0;pr||s<-r)return 0;var u=Math.sqrt(r*r-s*s);to[0]=-u,to[1]=u;var c=Math.abs(n-i);if(c<1e-4)return 0;if(c%$i<1e-4){n=0,i=$i;var l=o?1:-1;return a>=to[0]+t&&a<=to[1]+t?l:0}o?(u=n,n=Yi(i),i=Yi(u)):(n=Yi(n),i=Yi(i)),n>i&&(i+=$i);for(var h=0,p=0;p<2;p++){var d=to[p];if(d+t>a){var f=Math.atan2(s,d);l=o?1:-1,f<0&&(f=$i+f),(f>=n&&f<=i||f+$i>=n&&f+$i<=i)&&(f>Math.PI/2&&f<1.5*Math.PI&&(l=-l),h+=l)}}return h}function oo(t,e,r,n,i){for(var o,a,s=0,u=0,c=0,l=0,h=0,p=0;p1&&(r||(s+=Ki(u,c,l,h,n,i))),1===p&&(l=u=t[p],h=c=t[p+1]),d){case Ji.M:u=l=t[p++],c=h=t[p++];break;case Ji.L:if(r){if(Vi(u,c,t[p],t[p+1],e,n,i))return!0}else s+=Ki(u,c,t[p],t[p+1],n,i)||0;u=t[p++],c=t[p++];break;case Ji.C:if(r){if(Qi(u,c,t[p++],t[p++],t[p++],t[p++],t[p],t[p+1],e,n,i))return!0}else s+=ro(u,c,t[p++],t[p++],t[p++],t[p++],t[p],t[p+1],n,i)||0;u=t[p++],c=t[p++];break;case Ji.Q:if(r){if(qi(u,c,t[p++],t[p++],t[p],t[p+1],e,n,i))return!0}else s+=no(u,c,t[p++],t[p++],t[p],t[p+1],n,i)||0;u=t[p++],c=t[p++];break;case Ji.A:var f=t[p++],g=t[p++],m=t[p++],y=t[p++],v=t[p++],A=t[p++];p+=1;var _=1-t[p++],b=Math.cos(v)*m+f,x=Math.sin(v)*y+g;p>1?s+=Ki(u,c,b,x,n,i):(l=b,h=x);var w=(n-f)*y/m+f;if(r){if(Zi(f,g,y,v,v+A,_,e,w,i))return!0}else s+=io(f,g,y,v,v+A,_,w,i);u=Math.cos(v+A)*m+f,c=Math.sin(v+A)*y+g;break;case Ji.R:if(l=u=t[p++],h=c=t[p++],b=l+t[p++],x=h+t[p++],r){if(Vi(l,h,b,h,e,n,i)||Vi(b,h,b,x,e,n,i)||Vi(b,x,l,x,e,n,i)||Vi(l,x,l,h,e,n,i))return!0}else s+=Ki(b,h,b,x,n,i),s+=Ki(l,x,l,h,n,i);break;case Ji.Z:if(r){if(Vi(u,c,l,h,e,n,i))return!0}else s+=Ki(u,c,l,h,n,i);u=l,c=h}}return r||(o=c,a=h,Math.abs(o-a)<1e-4)||(s+=Ki(u,c,l,h,n,i)||0),0!==s}var ao=Er.prototype.getCanvasPattern,so=Math.abs,uo=new Hi(!0);function co(t){wn.call(this,t),this.path=null}co.prototype={constructor:co,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(t,e){var r,n=this.style,i=this.path||uo,o=n.hasStroke(),a=n.hasFill(),s=n.fill,u=n.stroke,c=a&&!!s.colorStops,l=o&&!!u.colorStops,h=a&&!!s.image,p=o&&!!u.image;n.bind(t,this,e),this.setTransform(t),this.__dirty&&(c&&(r=r||this.getBoundingRect(),this._fillGradient=n.getGradient(t,s,r)),l&&(r=r||this.getBoundingRect(),this._strokeGradient=n.getGradient(t,u,r))),c?t.fillStyle=this._fillGradient:h&&(t.fillStyle=ao.call(s,t)),l?t.strokeStyle=this._strokeGradient:p&&(t.strokeStyle=ao.call(u,t));var d=n.lineDash,f=n.lineDashOffset,g=!!t.setLineDash,m=this.getGlobalScale();if(i.setScale(m[0],m[1],this.segmentIgnoreThreshold),this.__dirtyPath||d&&!g&&o?(i.beginPath(t),d&&!g&&(i.setLineDash(d),i.setLineDashOffset(f)),this.buildPath(i,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),a)if(null!=n.fillOpacity){var y=t.globalAlpha;t.globalAlpha=n.fillOpacity*n.opacity,i.fill(t),t.globalAlpha=y}else i.fill(t);d&&g&&(t.setLineDash(d),t.lineDashOffset=f),o&&(null!=n.strokeOpacity?(y=t.globalAlpha,t.globalAlpha=n.strokeOpacity*n.opacity,i.stroke(t),t.globalAlpha=y):i.stroke(t)),d&&g&&t.setLineDash([]),null!=n.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(t,e,r){},createPathProxy:function(){this.path=new Hi},getBoundingRect:function(){var t=this._rect,e=this.style,r=!t;if(r){var n=this.path;n||(n=this.path=new Hi),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),t=n.getBoundingRect()}if(this._rect=t,e.hasStroke()){var i=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||r){i.copy(t);var o=e.lineWidth,a=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(o=Math.max(o,this.strokeContainThreshold||4)),a>1e-10&&(i.width+=o/a,i.height+=o/a,i.x-=o/a/2,i.y-=o/a/2)}return i}return t},contain:function(t,e){var r=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),i=this.style;if(t=r[0],e=r[1],n.contain(t,e)){var o=this.path.data;if(i.hasStroke()){var a=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(i.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,r,n){return oo(t,e,!0,r,n)}(o,a/s,t,e)))return!0}if(i.hasFill())return function(t,e,r){return oo(t,0,!1,e,r)}(o,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):wn.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var r=this.shape;if(r){if(j(t))for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);else r[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&so(t[0]-1)>1e-10&&so(t[3]-1)>1e-10?Math.sqrt(so(t[0]*t[3]-t[2]*t[1])):1}},co.extend=function(t){var e=function(e){co.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var r=t.shape;if(r){this.shape=this.shape||{};var n=this.shape;for(var i in r)!n.hasOwnProperty(i)&&r.hasOwnProperty(i)&&(n[i]=r[i])}t.init&&t.init.call(this,e)};for(var r in P(e,co),t)"style"!==r&&"shape"!==r&&(e.prototype[r]=t[r]);return e},P(co,wn);var lo=Hi.CMD,ho=[[],[],[]],po=Math.sqrt,fo=Math.atan2,go=Math.sqrt,mo=Math.sin,yo=Math.cos,vo=Math.PI,Ao=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},_o=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(Ao(t)*Ao(e))},bo=function(t,e){return(t[0]*e[1]1&&(a*=go(f),s*=go(f));var g=(i===o?-1:1)*go((a*a*(s*s)-a*a*(d*d)-s*s*(p*p))/(a*a*(d*d)+s*s*(p*p)))||0,m=g*a*d/s,y=g*-s*p/a,v=(t+r)/2+yo(h)*m-mo(h)*y,A=(e+n)/2+mo(h)*m+yo(h)*y,_=bo([1,0],[(p-m)/a,(d-y)/s]),b=[(p-m)/a,(d-y)/s],x=[(-1*p-m)/a,(-1*d-y)/s],w=bo(b,x);_o(b,x)<=-1&&(w=vo),_o(b,x)>=1&&(w=0),0===o&&w>0&&(w-=2*vo),1===o&&w<0&&(w+=2*vo),l.addData(c,v,A,a,s,_,w,h,o)}var wo=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Co=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Eo(t,e){var r=function(t){if(!t)return new Hi;for(var e,r=0,n=0,i=r,o=n,a=new Hi,s=Hi.CMD,u=t.match(wo),c=0;c=2){if(i&&"spline"!==i){var o=function(t,e,r,n){var i,o,a,s,u=[],c=[],l=[],h=[];if(n){a=[1/0,1/0],s=[-1/0,-1/0];for(var p=0,d=t.length;pr-2?r-1:h+1],c=t[h>r-3?r-1:h+2]);var f=p*p,g=p*f;n.push([No(s[0],d[0],u[0],c[0],p,f,g),No(s[1],d[1],u[1],c[1],p,f,g)])}return n}(n,r)),t.moveTo(n[0][0],n[0][1]),s=1;for(var h=n.length;s=4&&(s={x:parseFloat(l[0]||0),y:parseFloat(l[1]||0),width:parseFloat(l[2]),height:parseFloat(l[3])})}if(s&&null!=o&&null!=a&&(u=function(t,e,r){var n=e/t.width,i=r/t.height,o=Math.min(n,i);return{scale:[o,o],position:[-(t.x+t.width/2)*o+e/2,-(t.y+t.height/2)*o+r/2]}}(s,o,a),!e.ignoreViewBox)){var h=n;(n=new sr).add(h),h.scale=u.scale.slice(),h.position=u.position.slice()}return e.ignoreRootClip||null==o||null==a||n.setClipPath(new ko({shape:{x:0,y:0,width:o,height:a}})),{root:n,width:o,height:a,viewBoxRect:s,viewBoxTransform:u}},Vo.prototype._parseNode=function(t,e){var r,n,i=t.nodeName.toLowerCase();if("defs"===i?this._isDefine=!0:"text"===i&&(this._isText=!0),this._isDefine){if(n=qo[i]){var o=n.call(this,t),a=t.getAttribute("id");a&&(this._defs[a]=o)}}else(n=Qo[i])&&(r=n.call(this,t,e),e.add(r));for(var s=t.firstChild;s;)1===s.nodeType&&this._parseNode(s,r),3===s.nodeType&&this._isText&&this._parseText(s,r),s=s.nextSibling;"defs"===i?this._isDefine=!1:"text"===i&&(this._isText=!1)},Vo.prototype._parseText=function(t,e){if(1===t.nodeType){var r=t.getAttribute("dx")||0,n=t.getAttribute("dy")||0;this._textX+=parseFloat(r),this._textY+=parseFloat(n)}var i=new So({style:{text:t.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});Wo(e,i),Zo(t,i,this._defs);var o=i.style.fontSize;o&&o<9&&(i.style.fontSize=9,i.scale=i.scale||[1,1],i.scale[0]*=o/9,i.scale[1]*=o/9);var a=i.getBoundingRect();return this._textX+=a.width,e.add(i),i};var Qo={g:function(t,e){var r=new sr;return Wo(e,r),Zo(t,r,this._defs),r},rect:function(t,e){var r=new ko;return Wo(e,r),Zo(t,r,this._defs),r.setShape({x:parseFloat(t.getAttribute("x")||0),y:parseFloat(t.getAttribute("y")||0),width:parseFloat(t.getAttribute("width")||0),height:parseFloat(t.getAttribute("height")||0)}),r},circle:function(t,e){var r=new To;return Wo(e,r),Zo(t,r,this._defs),r.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),r:parseFloat(t.getAttribute("r")||0)}),r},line:function(t,e){var r=new Bo;return Wo(e,r),Zo(t,r,this._defs),r.setShape({x1:parseFloat(t.getAttribute("x1")||0),y1:parseFloat(t.getAttribute("y1")||0),x2:parseFloat(t.getAttribute("x2")||0),y2:parseFloat(t.getAttribute("y2")||0)}),r},ellipse:function(t,e){var r=new Ro;return Wo(e,r),Zo(t,r,this._defs),r.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),rx:parseFloat(t.getAttribute("rx")||0),ry:parseFloat(t.getAttribute("ry")||0)}),r},polygon:function(t,e){var r=t.getAttribute("points");r&&(r=Yo(r));var n=new jo({shape:{points:r||[]}});return Wo(e,n),Zo(t,n,this._defs),n},polyline:function(t,e){var r=new co;Wo(e,r),Zo(t,r,this._defs);var n=t.getAttribute("points");return n&&(n=Yo(n)),new zo({shape:{points:n||[]}})},image:function(t,e){var r=new Cn;return Wo(e,r),Zo(t,r,this._defs),r.setStyle({image:t.getAttribute("xlink:href"),x:t.getAttribute("x"),y:t.getAttribute("y"),width:t.getAttribute("width"),height:t.getAttribute("height")}),r},text:function(t,e){var r=t.getAttribute("x")||0,n=t.getAttribute("y")||0,i=t.getAttribute("dx")||0,o=t.getAttribute("dy")||0;this._textX=parseFloat(r)+parseFloat(i),this._textY=parseFloat(n)+parseFloat(o);var a=new sr;return Wo(e,a),Zo(t,a,this._defs),a},tspan:function(t,e){var r=t.getAttribute("x"),n=t.getAttribute("y");null!=r&&(this._textX=parseFloat(r)),null!=n&&(this._textY=parseFloat(n));var i=t.getAttribute("dx")||0,o=t.getAttribute("dy")||0,a=new sr;return Wo(e,a),Zo(t,a,this._defs),this._textX+=i,this._textY+=o,a},path:function(t,e){var r=Io(t.getAttribute("d")||"");return Wo(e,r),Zo(t,r,this._defs),r}},qo={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||0,10),r=parseInt(t.getAttribute("y1")||0,10),n=parseInt(t.getAttribute("x2")||10,10),i=parseInt(t.getAttribute("y2")||0,10),o=new Go(e,r,n,i);return function(t,e){for(var r=t.firstChild;r;){if(1===r.nodeType){var n=r.getAttribute("offset");n=n.indexOf("%")>0?parseInt(n,10)/100:n?parseFloat(n):0;var i=r.getAttribute("stop-color")||"#000000";e.addColorStop(n,i)}r=r.nextSibling}}(t,o),o},radialgradient:function(t){}};function Wo(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),E(e.__inheritedStyle,t.__inheritedStyle))}function Yo(t){for(var e=Q(t).split(Ho),r=[],n=0;n0;o-=2){var a=i[o],s=i[o-1];switch(n=n||Gt(),s){case"translate":a=Q(a).split(Ho),qt(n,n,[parseFloat(a[0]),parseFloat(a[1]||0)]);break;case"scale":a=Q(a).split(Ho),Yt(n,n,[parseFloat(a[0]),parseFloat(a[1]||a[0])]);break;case"rotate":a=Q(a).split(Ho),Wt(n,n,parseFloat(a[0]));break;case"skew":a=Q(a).split(Ho),console.warn("Skew transform is not supported yet");break;case"matrix":a=Q(a).split(Ho),n[0]=parseFloat(a[0]),n[1]=parseFloat(a[1]),n[2]=parseFloat(a[2]),n[3]=parseFloat(a[3]),n[4]=parseFloat(a[4]),n[5]=parseFloat(a[5])}}e.setLocalTransform(n)}}(t,e),C(i,function(t){var e=t.getAttribute("style"),r={};if(!e)return r;var n,i={};for(ta.lastIndex=0;null!=(n=ta.exec(e));)i[n[1]]=n[2];for(var o in Xo)Xo.hasOwnProperty(o)&&null!=i[o]&&(r[Xo[o]]=i[o]);return r}(t)),!n))for(var a in Xo)if(Xo.hasOwnProperty(a)){var s=t.getAttribute(a);null!=s&&(i[Xo[a]]=s)}var u=o?"textFill":"fill",c=o?"textStroke":"stroke";e.style=e.style||new Ar;var l=e.style;null!=i.fill&&l.set(u,Jo(i.fill,r)),null!=i.stroke&&l.set(c,Jo(i.stroke,r)),k(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(t){var e="lineWidth"===t&&o?"textStrokeWidth":t;null!=i[t]&&l.set(e,parseFloat(i[t]))})),i.textBaseline&&"auto"!==i.textBaseline||(i.textBaseline="alphabetic"),"alphabetic"===i.textBaseline&&(i.textBaseline="bottom"),"start"===i.textAlign&&(i.textAlign="left"),"end"===i.textAlign&&(i.textAlign="right"),k(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],(function(t){null!=i[t]&&l.set(t,i[t])})),i.lineDash&&(e.style.lineDash=Q(i.lineDash).split(Ho)),l[c]&&"none"!==l[c]&&(e[c]=!0),e.__inheritedStyle=i}var Ko=/url\(\s*#(.*?)\)/;function Jo(t,e){var r=e&&t&&t.match(Ko);return r?e[Q(r[1])]:t}var $o=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g,ta=/([^\s:;]+)\s*:\s*([^:;]+)/g,ea=co.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var t=this.__dirtyPath,e=this.shape.paths,r=0;r=11?function(){var t,e=this.__clipPaths,r=this.style;if(e)for(var n=0;n4?o*wa(2*xa/r)/wa(xa/r):o/3);var s=xa/r,u=-xa/2,c=n+o*wa(u),l=i+o*Ca(u);u+=s,t.moveTo(c,l);for(var h,p=0,d=2*r-1;p-1e-4}function Ua(t,e){e&&Ga(t,"transform","matrix("+La.call(e,",")+")")}function Ga(t,e,r){(!r||"linear"!==r.type&&"radial"!==r.type)&&t.setAttribute(e,r)}function Ha(t,e,r,n){if(function(t,e){var r=e?t.textFill:t.fill;return null!=r&&"none"!==r}(e,r)){var i=r?e.textFill:e.fill;Ga(t,"fill",i="transparent"===i?"none":i),Ga(t,"fill-opacity",null!=e.fillOpacity?e.fillOpacity*e.opacity:e.opacity)}else Ga(t,"fill","none");if(function(t,e){var r=e?t.textStroke:t.stroke;return null!=r&&"none"!==r}(e,r)){var o=r?e.textStroke:e.stroke;Ga(t,"stroke",o="transparent"===o?"none":o),Ga(t,"stroke-width",(r?e.textStrokeWidth:e.lineWidth)/(!r&&e.strokeNoScale?n.getLineScale():1)),Ga(t,"paint-order",r?"stroke":"fill"),Ga(t,"stroke-opacity",null!=e.strokeOpacity?e.strokeOpacity:e.opacity),e.lineDash?(Ga(t,"stroke-dasharray",e.lineDash.join(",")),Ga(t,"stroke-dashoffset",ka(e.lineDashOffset||0))):Ga(t,"stroke-dasharray",""),e.lineCap&&Ga(t,"stroke-linecap",e.lineCap),e.lineJoin&&Ga(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&Ga(t,"stroke-miterlimit",e.miterLimit)}else Ga(t,"stroke","none")}var Va={brush:function(t){var e=t.style,r=t.__svgEl;r||(r=Pa("path"),t.__svgEl=r),t.path||t.createPathProxy();var n=t.path;if(t.__dirtyPath){n.beginPath(),n.subPixelOptimize=!1,t.buildPath(n,t.shape),t.__dirtyPath=!1;var i=function(t){for(var e=[],r=t.data,n=t.len(),i=0;i=Na:-p>=Na),y=p>0?p%Na:p%Na+Na,v=!1;v=!!m||!za(g)&&y>=Ba==!!f;var A=ja(s+c*Da(h)),_=ja(u+l*Ra(h));m&&(p=f?Na-1e-4:1e-4-Na,v=!0,9===i&&e.push("M",A,_));var b=ja(s+c*Da(h+p)),x=ja(u+l*Ra(h+p));e.push("A",ja(c),ja(l),ka(d*Fa),+v,+f,b,x);break;case Oa.Z:o="Z";break;case Oa.R:b=ja(r[i++]),x=ja(r[i++]);var w=ja(r[i++]),C=ja(r[i++]);e.push("M",b,x,"L",b+w,x,"L",b+w,x+C,"L",b,x+C,"L",b,x)}o&&e.push(o);for(var E=0;EM){for(;E=i&&c+1>=o){for(var l=[],h=0;h=i&&h+1>=o)return es(0,s.components);u[r]=s}else u[r]=void 0}a++}for(;a<=s;){var d=p();if(d)return d}},pushComponent:function(t,e,r){var n=t[t.length-1];n&&n.added===e&&n.removed===r?t[t.length-1]={count:n.count+1,added:e,removed:r}:t.push({count:1,added:e,removed:r})},extractCommon:function(t,e,r,n){for(var i=e.length,o=r.length,a=t.newPos,s=a-n,u=0;a+1=0;--n)if(e[n]===t)return!0;return!1}),r):null:r[0]},is.prototype.update=function(t,e){if(t){var r=this.getDefs(!1);if(t[this._domName]&&r.contains(t[this._domName]))"function"==typeof e&&e(t);else{var n=this.add(t);n&&(t[this._domName]=n)}}},is.prototype.addDom=function(t){this.getDefs(!0).appendChild(t)},is.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},is.prototype.getDoms=function(){var t=this.getDefs(!1);if(!t)return[];var e=[];return k(this._tagNames,(function(r){var n=t.getElementsByTagName(r);e=e.concat([].slice.call(n))})),e},is.prototype.markAllUnused=function(){var t=this.getDoms(),e=this;k(t,(function(t){t[e._markLabel]="0"}))},is.prototype.markUsed=function(t){t&&(t[this._markLabel]="1")},is.prototype.removeUnused=function(){var t=this.getDefs(!1);if(t){var e=this.getDoms(),r=this;k(e,(function(e){"1"!==e[r._markLabel]&&t.removeChild(e)}))}},is.prototype.getSvgProxy=function(t){return(0,u.default)(t,co)?Va:(0,u.default)(t,Cn)?Qa:(0,u.default)(t,So)?qa:Va},is.prototype.getTextSvgElement=function(t){return t.__textSvgEl},is.prototype.getSvgElement=function(t){return t.__svgEl},P(os,is),os.prototype.addWithoutUpdate=function(t,e){if(e&&e.style){var r=this;k(["fill","stroke"],(function(n){if(e.style[n]&&("linear"===e.style[n].type||"radial"===e.style[n].type)){var i,o=e.style[n],a=r.getDefs(!0);o._dom?(i=o._dom,a.contains(o._dom)||r.addDom(i)):i=r.add(o),r.markUsed(e);var s=i.getAttribute("id");t.setAttribute(n,"url(#"+s+")")}}))}},os.prototype.add=function(t){var e;if("linear"===t.type)e=this.createElement("linearGradient");else{if("radial"!==t.type)return Ye("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},os.prototype.update=function(t){var e=this;is.prototype.update.call(this,t,(function(){var r=t.type,n=t._dom.tagName;"linear"===r&&"linearGradient"===n||"radial"===r&&"radialGradient"===n?e.updateDom(t,t._dom):(e.removeDom(t),e.add(t))}))},os.prototype.updateDom=function(t,e){if("linear"===t.type)e.setAttribute("x1",t.x),e.setAttribute("y1",t.y),e.setAttribute("x2",t.x2),e.setAttribute("y2",t.y2);else{if("radial"!==t.type)return void Ye("Illegal gradient type.");e.setAttribute("cx",t.x),e.setAttribute("cy",t.y),e.setAttribute("r",t.r)}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var r=t.colorStops,n=0,i=r.length;n-1){var s=we(a)[3],u=Ee(a);o.setAttribute("stop-color","#"+u),o.setAttribute("stop-opacity",s)}else o.setAttribute("stop-color",r[n].color);e.appendChild(o)}t._dom=e},os.prototype.markUsed=function(t){if(t.style){var e=t.style.fill;e&&e._dom&&is.prototype.markUsed.call(this,e._dom),(e=t.style.stroke)&&e._dom&&is.prototype.markUsed.call(this,e._dom)}},P(as,is),as.prototype.update=function(t){var e=this.getSvgElement(t);e&&this.updateDom(e,t.__clipPaths,!1);var r=this.getTextSvgElement(t);r&&this.updateDom(r,t.__clipPaths,!0),this.markUsed(t)},as.prototype.updateDom=function(t,e,r){if(e&&e.length>0){var n,i,o=this.getDefs(!0),a=e[0],s=r?"_textDom":"_dom";a[s]?(i=a[s].getAttribute("id"),n=a[s],o.contains(n)||o.appendChild(n)):(i="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",i),o.appendChild(n),a[s]=n);var u=this.getSvgProxy(a);if(a.transform&&a.parent.invTransform&&!r){var c=Array.prototype.slice.call(a.transform);Qt(a.transform,a.parent.invTransform,a.transform),u.brush(a),a.transform=c}else u.brush(a);var l=this.getSvgElement(a);n.innerHTML="",n.appendChild(l.cloneNode()),t.setAttribute("clip-path","url(#"+i+")"),e.length>1&&this.updateDom(n,e.slice(1),r)}else t&&t.setAttribute("clip-path","none")},as.prototype.markUsed=function(t){var e=this;t.__clipPaths&&k(t.__clipPaths,(function(t){t._dom&&is.prototype.markUsed.call(e,t._dom),t._textDom&&is.prototype.markUsed.call(e,t._textDom)}))},P(ss,is),ss.prototype.addWithoutUpdate=function(t,e){if(e&&us(e.style)){var r;e._shadowDom?(r=e._shadowDom,this.getDefs(!0).contains(e._shadowDom)||this.addDom(r)):r=this.add(e),this.markUsed(e);var n=r.getAttribute("id");t.style.filter="url(#"+n+")"}},ss.prototype.add=function(t){var e=this.createElement("filter");return t._shadowDomId=t._shadowDomId||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-shadow-"+t._shadowDomId),this.updateDom(t,e),this.addDom(e),e},ss.prototype.update=function(t,e){if(us(e.style)){var r=this;is.prototype.update.call(this,e,(function(){r.updateDom(e,e._shadowDom)}))}else this.remove(t,e)},ss.prototype.remove=function(t,e){null!=e._shadowDomId&&(this.removeDom(t),t.style.filter="")},ss.prototype.updateDom=function(t,e){var r=e.getElementsByTagName("feDropShadow");r=0===r.length?this.createElement("feDropShadow"):r[0];var n,i,o,a,s=t.style,u=t.scale&&t.scale[0]||1,c=t.scale&&t.scale[1]||1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,i=s.shadowOffsetY||0,o=s.shadowBlur,a=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(e,s);n=s.textShadowOffsetX||0,i=s.textShadowOffsetY||0,o=s.textShadowBlur,a=s.textShadowColor}r.setAttribute("dx",n/u),r.setAttribute("dy",i/c),r.setAttribute("flood-color",a);var l=o/2/u+" "+o/2/c;r.setAttribute("stdDeviation",l),e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width",Math.ceil(o/2*200)+"%"),e.setAttribute("height",Math.ceil(o/2*200)+"%"),e.appendChild(r),t._shadowDom=e},ss.prototype.markUsed=function(t){t._shadowDom&&is.prototype.markUsed.call(this,t._shadowDom)};var ms=function(t,e,r,n){this.root=t,this.storage=e,this._opts=r=C({},r||{});var i=Pa("svg");i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("version","1.1"),i.setAttribute("baseProfile","full"),i.style.cssText="user-select:none;position:absolute;left:0;top:0;";var o=Pa("g");i.appendChild(o);var a=Pa("g");i.appendChild(a),this.gradientManager=new os(n,a),this.clipPathManager=new as(n,a),this.shadowManager=new ss(n,a);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=i,this._svgRoot=a,this._backgroundRoot=o,this._viewport=s,t.appendChild(s),s.appendChild(i),this.resize(r.width,r.height),this._visibleList=[]};ms.prototype={constructor:ms,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getSvgDom:function(){return this._svgDom},getSvgRoot:function(){return this._svgRoot},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},setBackgroundColor:function(t){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var e=Pa("rect");e.setAttribute("width",this.getWidth()),e.setAttribute("height",this.getHeight()),e.setAttribute("x",0),e.setAttribute("y",0),e.setAttribute("id",0),e.style.fill=t,this._backgroundRoot.appendChild(e),this._backgroundNode=e},_paintList:function(t){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var e,r,n=this._svgRoot,i=this._visibleList,o=t.length,a=[];for(e=0;e=0;--n)if(r[n]===t)return!0;return!1}),e):null:e[0]},resize:function(t,e){var r=this._viewport;r.style.display="none";var n=this._opts;if(null!=t&&(n.width=t),null!=e&&(n.height=e),t=this._getSize(0),e=this._getSize(1),r.style.display="",this._width!==t||this._height!==e){this._width=t,this._height=e;var i=r.style;i.width=t+"px",i.height=e+"px";var o=this._svgDom;o.setAttribute("width",t),o.setAttribute("height",e)}this._backgroundNode&&(this._backgroundNode.setAttribute("width",t),this._backgroundNode.setAttribute("height",e))},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,r=["width","height"][t],n=["clientWidth","clientHeight"][t],i=["paddingLeft","paddingTop"][t],o=["paddingRight","paddingBottom"][t];if(null!=e[r]&&"auto"!==e[r])return parseFloat(e[r]);var a=this.root,s=document.defaultView.getComputedStyle(a);return(a[n]||cs(s[r])||cs(a.style[r]))-(cs(s[i])||0)-(cs(s[o])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},toDataURL:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(this._svgDom.outerHTML.replace(/>\n\r<"))}},k(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],(function(t){var e;ms.prototype[t]=(e=t,function(){Ye('In SVG mode painter not support method "'+e+'"')})})),$n("svg",ms);var ys,vs="urn:schemas-microsoft-com:vml",As="undefined"==typeof window?null:window,_s=!1,bs=As&&As.document;function xs(t){return ys(t)}if(bs&&!h.canvasSupported)try{!bs.namespaces.zrvml&&bs.namespaces.add("zrvml",vs),ys=function(t){return bs.createElement("')}}catch(t){ys=function(t){return bs.createElement("<"+t+' xmlns="'+vs+'" class="zrvml">')}}var ws,Cs=Hi.CMD,Es=Math.round,Is=Math.sqrt,Ms=Math.abs,Ss=Math.cos,Ts=Math.sin,Ps=Math.max;if(!h.canvasSupported){var Os=21600,Ls=Os/2,ks=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=Os+","+Os,t.coordorigin="0,0"},Rs=function(t,e,r){return"rgb("+[t,e,r].join(",")+")"},Ds=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},Bs=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},Ns=function(t,e,r){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+r},Fs=vn,js=function(t,e,r){var n=we(e);r=+r,isNaN(r)&&(r=1),n&&(t.color=Rs(n[0],n[1],n[2]),t.opacity=r*n[3])},zs=function(t){var e=we(t);return[Rs(e[0],e[1],e[2]),e[3]]},Us=function(t,e,r,n){var i="fill"===e,o=t.getElementsByTagName(e)[0];null!=r[e]&&"none"!==r[e]&&(i||!i&&r.lineWidth)?(t[i?"filled":"stroked"]="true",(0,u.default)(r[e],Uo)&&Bs(t,o),o||(o=xs(e)),i?function(t,e,r){var n=e.fill;if(null!=n)if((0,u.default)(n,Uo)){var i,o=0,a=[0,0],s=0,c=1,l=r.getBoundingRect(),h=l.width,p=l.height;if("linear"===n.type){i="gradient";var d=r.transform,f=[n.x*h,n.y*p],g=[n.x2*h,n.y2*p];d&&(ht(f,f,d),ht(g,g,d));var m=g[0]-f[0],y=g[1]-f[1];(o=180*Math.atan2(m,y)/Math.PI)<0&&(o+=360),o<1e-6&&(o=0)}else{i="gradientradial",f=[n.x*h,n.y*p],d=r.transform;var v=r.scale,A=h,_=p;a=[(f[0]-l.x)/A,(f[1]-l.y)/_],d&&ht(f,f,d),A/=v[0]*Os,_/=v[1]*Os;var b=Ps(A,_);s=0/b,c=2*n.r/b-s}var x=n.colorStops.slice();x.sort((function(t,e){return t.offset-e.offset}));for(var w=x.length,C=[],E=[],I=0;I=2){var T=C[0][0],P=C[1][0],O=C[0][1]*e.opacity,L=C[1][1]*e.opacity;t.type=i,t.method="none",t.focus="100%",t.angle=o,t.color=T,t.color2=P,t.colors=E.join(","),t.opacity=L,t.opacity2=O}"radial"===i&&(t.focusposition=a.join(","))}else js(t,n,e.opacity)}(o,r,n):function(t,e){e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||(0,u.default)(e.stroke,Uo)||js(t,e.stroke,e.opacity)}(o,r),Ds(t,o)):(t[i?"filled":"stroked"]="false",Bs(t,o))},Gs=[[],[],[]];co.prototype.brushVML=function(t){var e=this.style,r=this._vmlEl;r||(r=xs("shape"),ks(r),this._vmlEl=r),Us(r,"fill",e,this),Us(r,"stroke",e,this);var n=this.transform,i=null!=n,o=r.getElementsByTagName("stroke")[0];if(o){var a=e.lineWidth;if(i&&!e.strokeNoScale){var s=n[0]*n[3]-n[1]*n[2];a*=Is(Ms(s))}o.weight=a+"px"}var u=this.path||(this.path=new Hi);this.__dirtyPath&&(u.beginPath(),u.subPixelOptimize=!1,this.buildPath(u,this.shape),u.toStatic(),this.__dirtyPath=!1),r.path=function(t,e){var r,n,i,o,a,s,u=Cs.M,c=Cs.C,l=Cs.L,h=Cs.A,p=Cs.Q,d=[],f=t.data,g=t.len();for(o=0;o.01?k&&(R+=.0125):Math.abs(D-S)<1e-4?k&&RM?A-=.0125:A+=.0125:k&&DS?v+=.0125:v-=.0125),d.push(B,Es(((M-T)*C+x)*Os-Ls),",",Es(((S-P)*E+w)*Os-Ls),",",Es(((M+T)*C+x)*Os-Ls),",",Es(((S+P)*E+w)*Os-Ls),",",Es((R*C+x)*Os-Ls),",",Es((D*E+w)*Os-Ls),",",Es((v*C+x)*Os-Ls),",",Es((A*E+w)*Os-Ls)),a=v,s=A;break;case Cs.R:var N=Gs[0],F=Gs[1];N[0]=f[o++],N[1]=f[o++],F[0]=N[0]+f[o++],F[1]=N[1]+f[o++],e&&(ht(N,N,e),ht(F,F,e)),N[0]=Es(N[0]*Os-Ls),F[0]=Es(F[0]*Os-Ls),N[1]=Es(N[1]*Os-Ls),F[1]=Es(F[1]*Os-Ls),d.push(" m ",N[0],",",N[1]," l ",F[0],",",N[1]," l ",F[0],",",F[1]," l ",N[0],",",F[1]);break;case Cs.Z:d.push(" x ")}if(r>0){d.push(n);for(var j=0;j100&&(Qs=0,Vs={});var r,n=qs.style;try{n.font=t,r=n.fontFamily.split(",")[0]}catch(t){}e={style:n.fontStyle||"normal",variant:n.fontVariant||"normal",weight:n.fontWeight||"normal",size:0|parseFloat(n.fontSize||12),family:r||"Microsoft YaHei"},Vs[t]=e,Qs++}return e}(i.font),y=m.style+" "+m.variant+" "+m.weight+" "+m.size+'px "'+m.family+'"';r=r||zr(o,y,f,g,i.textPadding,i.textLineHeight);var v=this.transform;if(v&&!n&&(Ws.copy(e),Ws.applyTransform(v),e=Ws),n)p=e.x,d=e.y;else{var A=i.textPosition;if((0,u.default)(A,Array))p=e.x+Fs(A[0],e.width),d=e.y+Fs(A[1],e.height),f=f||"left";else{var _=this.calculateTextPosition?this.calculateTextPosition({},i,e):Hr({},i,e);p=_.x,d=_.y,f=f||_.textAlign,g=g||_.textVerticalAlign}}p=Ur(p,r.width,f),d=Gr(d,r.height,g),d+=r.height/2;var b,x,w,C=xs,E=this._textVmlEl;E?x=(b=(w=E.firstChild).nextSibling).nextSibling:(E=C("line"),b=C("path"),x=C("textpath"),w=C("skew"),x.style["v-text-align"]="left",ks(E),b.textpathok=!0,x.on=!0,E.from="0 0",E.to="1000 0.05",Ds(E,w),Ds(E,b),Ds(E,x),this._textVmlEl=E);var I=[p,d],M=E.style;v&&n?(ht(I,I,v),w.on=!0,w.matrix=v[0].toFixed(3)+","+v[2].toFixed(3)+","+v[1].toFixed(3)+","+v[3].toFixed(3)+",0,0",w.offset=(Es(I[0])||0)+","+(Es(I[1])||0),w.origin="0 0",M.left="0px",M.top="0px"):(w.on=!1,M.left=Es(p)+"px",M.top=Es(d)+"px"),x.string=String(o).replace(/&/g,"&").replace(/"/g,""");try{x.style.font=y}catch(t){}Us(E,"fill",{fill:i.textFill,opacity:i.opacity},this),Us(E,"stroke",{stroke:i.textStroke,opacity:i.opacity,lineDash:i.lineDash||null},this),E.style.zIndex=Ns(this.zlevel,this.z,this.z2),Ds(t,E)}},Xs=function(t){Bs(t,this._textVmlEl),this._textVmlEl=null},Zs=function(t){Ds(t,this._textVmlEl)},Ks=[xn,wn,Cn,co,So],Js=0;Jst[i+1].num&&(o=t[i],t[i]=t[i+1],t[i+1]=o)}t.forEach((function(t){var n=t.num/e,i=2*Math.PI*n>Math.PI/18?2*Math.PI*n:Math.PI/18;t.startAngle=r,t.endAngle=i+r<2*Math.PI?i+r:2*Math.PI,r=t.endAngle}))},t.prototype.remove=function(){this.canvas&&(this.clearSectors(),this.clearArcs(),this.clearText(),this.map.off("move",this._moveHandler),this.map.off("mousemove",this._mapMoveHandler),this.map.off("resize",this._resizeHandler))},t}();e.Pie=c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(43);Object.defineProperty(e,"CanvasPolygon",{enumerable:!0,get:function(){return n.Polygon}})},function(t,e,r){"use strict";var n=r(4)(r(5)),i=function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Polygon=void 0;var o=i(r(0)),a=i(r(1)),s=r(2),u=r(8),c=r(14),l=function(){function t(t){this.map=t,this.sourceId=s.guid(),this.layerId=s.guid(),this.buildCanvas(),this.polygons=[],this._isShow=!0,this._moveHandler=this.moveHandler.bind(this),this.map.on("move",this._moveHandler),this._resizeHandler=this.resizeHandler.bind(this)}return t.prototype.setData=function(t){return this.sourceData=t,this},t.prototype.parse=function(t){return this.parseCfg=t,this},t.prototype.style=function(t){return this.styleOpts=a.default.canvas("polygon",t),this},t.prototype.resizeHandler=function(){this.canvas.style.width=this.map._canvas.style.width,this.canvas.style.height=this.map._canvas.style.height,c.resize(),this.moveHandler()},t.prototype.animate=function(t){var e=this;this.animationOpts=t;var r=this.map._canvasContainer,n=this.map._canvas;if(this.animationOpts){var i=this.animationCanvas=document.createElement("canvas");i.style.position="absolute",i.className="overlay-animation-canvas",i.style.pointerEvents="none",i.width=parseInt(n.style.width),i.height=parseInt(n.style.height),r.appendChild(i),this.map.on("resize",(function(){c.resize(),e.moveHandler()}))}return this},t.prototype.render=function(){this.buildSource(),this.buildLayer(),this._isShow?this.show():this.hide()},t.prototype.buildSource=function(){var t=this.parseCfg.type||"geojson",e=u.lnglatToPixel(this.map);this.parsedData=o.default.pixel("polygon",o.default[t](this.sourceData,this.parseCfg.type),e)},t.prototype.buildCanvas=function(){var t=this.map._canvasContainer;if(document.getElementsByClassName("overlay-canvas")[0])this.canvas=document.getElementsByClassName("overlay-canvas")[0];else{var e=this.canvas=document.createElement("canvas");e.style.position="absolute",e.className="overlay-canvas",this.canvas.width=this.map._canvas.width,this.canvas.height=this.map._canvas.height,this.canvas.style.width=this.map._canvas.style.width,this.canvas.style.height=this.map._canvas.style.height,t.appendChild(e),c.forceInitZrender()}this.map.on("resize",this._resizeHandler)},t.prototype.buildLayer=function(){var t=this,e=(this.canvas.getContext("2d"),this.calcExtends()),r=e.maxX,i=e.minX,o=e.maxY,a=e.minY;if("object"===(0,n.default)(this.parsedData)&&"FeatureCollection"===this.parsedData.type?this.parsedData.features.forEach((function(e){var n=c.drawPolygon(e.geometry.coordinates[0],{fillStyle:t.styleOpts.fillStyle,strokeColor:t.styleOpts.strokeStyle,lineWidth:t.styleOpts.lineWidth,shadowColor:t.styleOpts.shadowColor,shadowBlur:t.styleOpts.shadowBlur,opacity:t.styleOpts.opacity,globalCompositeOperation:t.styleOpts.globalCompositeOperation},{maxX:r,minX:i,maxY:o,minY:a});n.sourceProp=e.properties,t.polygons.push(n)})):this.parsedData.forEach((function(e){var n=c.drawPolygon(e.coordinates[0],{fillStyle:t.styleOpts.fillStyle,strokeColor:t.styleOpts.strokeStyle,lineWidth:t.styleOpts.lineWidth,shadowColor:t.styleOpts.shadowColor,shadowBlur:t.styleOpts.shadowBlur,opacity:t.styleOpts.opacity,globalCompositeOperation:t.styleOpts.globalCompositeOperation},{maxX:r,minX:i,maxY:o,minY:a});n.sourceProp=e.properties,t.polygons.push(n)})),this.animationOpts){var s=this.animationOpts.duration;this._timer&&window.clearInterval(this._timer),this._timer=window.setInterval((function(){t.drawAnimate(t.animationData)}),s)}},t.prototype.calcExtends=function(){var t=-1/0,e=1/0,r=-1/0,i=1/0;return"object"===(0,n.default)(this.parsedData)&&"FeatureCollection"===this.parsedData.type?this.parsedData.features.forEach((function(n){n.geometry.coordinates[0].forEach((function(n){n[0]>t&&(t=n[0]),n[0]r&&(r=n[1]),n[1]t&&(t=n[0]),n[0]r&&(r=n[1]),n[1]=e+r&&(this._liftValue=r/50),t.position.z<=e-r&&(this._liftValue=-r/50),t.translateZ(this._liftValue),i},t.prototype.buildLayer=function(){this.map.addLayer(this.layer),this.map.on("resize",this._resizeHandler)},t.prototype.resizeHandler=function(){this.map.removeLayer(this.layerId),this.map.addLayer(this.layer)},t.prototype.show=function(){this.map.setLayoutProperty(this.layerId,"visibility","visible")},t.prototype.hide=function(){this.map.setLayoutProperty(this.layerId,"visibility","none")},t.prototype.on=function(t){throw new Error("Method not implemented.")},t.prototype.off=function(t){throw new Error("Method not implemented.")},t.prototype.update=function(t,e){var r=e.type||"geojson",n=u.default[r](t,e);this.map.getSource(this.sourceId).setData(n)},t}();e.Octahedral=A},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(70);Object.defineProperty(e,"WebGLWaterFlow",{enumerable:!0,get:function(){return n.WaterFlow}});var i=r(74);Object.defineProperty(e,"WebGLBuilding",{enumerable:!0,get:function(){return i.Building}})},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},a=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e=.15?(i.value.x=0,i.value.y=.075):i.value.y>=.15&&(i.value.y=i.value.y-.15),u.visible=!1,C.matrixWorld.copy(u.matrixWorld),E.matrixWorld.copy(u.matrixWorld),C.onBeforeRender(t,e,r),E.onBeforeRender(t,e,r),u.visible=!0}}else console.error("THREE.Water: Required component Refractor not found.");else console.error("THREE.Water: Required component Reflector not found.")};e.Water=a,(a.prototype=Object.create(n.Mesh.prototype)).constructor=a,a.WaterShader={uniforms:{color:{type:"c",value:null},reflectivity:{type:"f",value:0},tReflectionMap:{type:"t",value:null},tRefractionMap:{type:"t",value:null},tNormalMap0:{type:"t",value:null},tNormalMap1:{type:"t",value:null},textureMatrix:{type:"m4",value:null},config:{type:"v4",value:new n.Vector4}},vertexShader:["#include ","#include ","#include ","uniform mat4 textureMatrix;","varying vec4 vCoord;","varying vec2 vUv;","varying vec3 vToEye;","void main() {","\tvUv = uv;","\tvCoord = textureMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvToEye = cameraPosition - worldPosition.xyz;","\tvec4 mvPosition = viewMatrix * worldPosition;","\tgl_Position = projectionMatrix * mvPosition;","\t#include ","\t#include ","}"].join("\n"),fragmentShader:["#include ","#include ","#include ","uniform sampler2D tReflectionMap;","uniform sampler2D tRefractionMap;","uniform sampler2D tNormalMap0;","uniform sampler2D tNormalMap1;","#ifdef USE_FLOWMAP","\tuniform sampler2D tFlowMap;","#else","\tuniform vec2 flowDirection;","#endif","uniform vec3 color;","uniform float reflectivity;","uniform vec4 config;","varying vec4 vCoord;","varying vec2 vUv;","varying vec3 vToEye;","void main() {","\t#include ","\tfloat flowMapOffset0 = config.x;","\tfloat flowMapOffset1 = config.y;","\tfloat halfCycle = config.z;","\tfloat scale = config.w;","\tvec3 toEye = normalize( vToEye );","\tvec2 flow;","\t#ifdef USE_FLOWMAP","\t\tflow = texture2D( tFlowMap, vUv ).rg * 2.0 - 1.0;","\t#else","\t\tflow = flowDirection;","\t#endif","\tflow.x *= - 1.0;","\tvec4 normalColor0 = texture2D( tNormalMap0, ( vUv * scale ) + flow * flowMapOffset0 );","\tvec4 normalColor1 = texture2D( tNormalMap1, ( vUv * scale ) + flow * flowMapOffset1 );","\tfloat flowLerp = abs( halfCycle - flowMapOffset0 ) / halfCycle;","\tvec4 normalColor = mix( normalColor0, normalColor1, flowLerp );","\tvec3 normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );","\tfloat theta = max( dot( toEye, normal ), 0.0 );","\tfloat reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 5.0 );","\tvec3 coord = vCoord.xyz / vCoord.w;","\tvec2 uv = coord.xy + coord.z * normal.xz * 0.05;","\tvec4 reflectColor = texture2D( tReflectionMap, vec2( 1.0 - uv.x, uv.y ) );","\tvec4 refractColor = texture2D( tRefractionMap, uv );","\tgl_FragColor = vec4( color, 1.0 ) * mix( refractColor, reflectColor, reflectance );","\t#include ","\t#include ","\t#include ","}"].join("\n")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Reflector=void 0;var n=r(3),i=function t(e,r){n.Mesh.call(this,e),this.type="Reflector";var i=this,o=void 0!==(r=r||{}).color?new n.Color(r.color):new n.Color(8355711),a=r.textureWidth||512,s=r.textureHeight||512,u=r.clipBias||0,c=r.shader||t.ReflectorShader,l=void 0!==r.encoding?r.encoding:n.LinearEncoding,h=new n.Plane,p=new n.Vector3,d=new n.Vector3,f=new n.Vector3,g=new n.Matrix4,m=new n.Vector3(0,0,-1),y=new n.Vector4,v=new n.Vector3,A=new n.Vector3,_=new n.Vector4,b=new n.Matrix4,x=new n.PerspectiveCamera,w={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBFormat,stencilBuffer:!1,encoding:l},C=new n.WebGLRenderTarget(a,s,w);n.MathUtils.isPowerOfTwo(a)&&n.MathUtils.isPowerOfTwo(s)||(C.texture.generateMipmaps=!1);var E=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(c.uniforms),fragmentShader:c.fragmentShader,vertexShader:c.vertexShader});E.uniforms.tDiffuse.value=C.texture,console.log(" renderTarget.texture",C.texture),E.uniforms.color.value=o,E.uniforms.textureMatrix.value=b,this.material=E,this.onBeforeRender=function(t,e,r){if(d.setFromMatrixPosition(i.matrixWorld),f.setFromMatrixPosition(r.matrixWorld),g.extractRotation(i.matrixWorld),p.set(0,0,1),p.applyMatrix4(g),v.subVectors(d,f),!(v.dot(p)>0)){v.reflect(p).negate(),v.add(d),g.extractRotation(r.matrixWorld),m.set(0,0,-1),m.applyMatrix4(g),m.add(f),A.subVectors(d,m),A.reflect(p).negate(),A.add(d),x.position.copy(v),x.up.set(0,1,0),x.up.applyMatrix4(g),x.up.reflect(p),x.lookAt(A),x.far=r.far,x.updateMatrixWorld(),x.projectionMatrix.copy(r.projectionMatrix),b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(x.projectionMatrix),b.multiply(x.matrixWorldInverse),b.multiply(i.matrixWorld),h.setFromNormalAndCoplanarPoint(p,d),h.applyMatrix4(x.matrixWorldInverse),y.set(h.normal.x,h.normal.y,h.normal.z,h.constant);var n=x.projectionMatrix;_.x=(Math.sign(y.x)+n.elements[8])/n.elements[0],_.y=(Math.sign(y.y)+n.elements[9])/n.elements[5],_.z=-1,_.w=(1+n.elements[10])/n.elements[14],y.multiplyScalar(2/y.dot(_)),n.elements[2]=y.x,n.elements[6]=y.y,n.elements[10]=y.z+1-u,n.elements[14]=y.w,i.visible=!1;var o=t.getRenderTarget(),a=t.xr.enabled,s=t.shadowMap.autoUpdate;t.xr.enabled=!1,t.shadowMap.autoUpdate=!1,t.setRenderTarget(C),t.state.buffers.depth.setMask(!0),!1===t.autoClear&&t.clear(),t.render(e,x),t.xr.enabled=a,t.shadowMap.autoUpdate=s,t.setRenderTarget(o);var c=r.viewport;void 0!==c&&t.state.viewport(c),i.visible=!0}},this.getRenderTarget=function(){return C}};e.Reflector=i,(i.prototype=Object.create(n.Mesh.prototype)).constructor=i,i.ReflectorShader={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec4 vUv;","void main() {","\tvUv = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec4 vUv;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );","}","void main() {","\tvec4 base = texture2DProj( tDiffuse, vUv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Refractor=void 0;var n=r(3),i=function t(e,r){n.Mesh.call(this,e),this.type="Refractor";var i=this,o=void 0!==(r=r||{}).color?new n.Color(r.color):new n.Color(8355711),a=r.textureWidth||512,s=r.textureHeight||512,u=r.clipBias||0,c=r.shader||t.RefractorShader,l=void 0!==r.encoding?r.encoding:n.LinearEncoding,h=new n.PerspectiveCamera;h.matrixAutoUpdate=!1,h.userData.refractor=!0;var p=new n.Plane,d=new n.Matrix4,f={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBFormat,stencilBuffer:!1,encoding:l},g=new n.WebGLRenderTarget(a,s,f);n.MathUtils.isPowerOfTwo(a)&&n.MathUtils.isPowerOfTwo(s)||(g.texture.generateMipmaps=!1),this.material=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,transparent:!0}),this.material.uniforms.color.value=o,this.material.uniforms.tDiffuse.value=g.texture,this.material.uniforms.textureMatrix.value=d;var m,y,v,A,_,b,x,w,C=(m=new n.Vector3,y=new n.Vector3,v=new n.Matrix4,A=new n.Vector3,_=new n.Vector3,function(t){return m.setFromMatrixPosition(i.matrixWorld),y.setFromMatrixPosition(t.matrixWorld),A.subVectors(m,y),v.extractRotation(i.matrixWorld),_.set(0,0,1),_.applyMatrix4(v),A.dot(_)<0}),E=function(){var t=new n.Vector3,e=new n.Vector3,r=new n.Quaternion,o=new n.Vector3;return function(){i.matrixWorld.decompose(e,r,o),t.set(0,0,1).applyQuaternion(r).normalize(),t.negate(),p.setFromNormalAndCoplanarPoint(t,e)}}(),I=(b=new n.Plane,x=new n.Vector4,w=new n.Vector4,function(t){h.matrixWorld.copy(t.matrixWorld),h.matrixWorldInverse.getInverse(h.matrixWorld),h.projectionMatrix.copy(t.projectionMatrix),h.far=t.far,b.copy(p),b.applyMatrix4(h.matrixWorldInverse),x.set(b.normal.x,b.normal.y,b.normal.z,b.constant);var e=h.projectionMatrix;w.x=(Math.sign(x.x)+e.elements[8])/e.elements[0],w.y=(Math.sign(x.y)+e.elements[9])/e.elements[5],w.z=-1,w.w=(1+e.elements[10])/e.elements[14],x.multiplyScalar(2/x.dot(w)),e.elements[2]=x.x,e.elements[6]=x.y,e.elements[10]=x.z+1-u,e.elements[14]=x.w});this.onBeforeRender=function(t,e,r){!0!==r.userData.refractor&&1!=!C(r)&&(E(),function(t){d.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),d.multiply(t.projectionMatrix),d.multiply(t.matrixWorldInverse),d.multiply(i.matrixWorld)}(r),I(r),function(t,e,r){i.visible=!1;var n=t.getRenderTarget(),o=t.xr.enabled,a=t.shadowMap.autoUpdate;t.xr.enabled=!1,t.shadowMap.autoUpdate=!1,t.setRenderTarget(g),!1===t.autoClear&&t.clear(),t.render(e,h),t.xr.enabled=o,t.shadowMap.autoUpdate=a,t.setRenderTarget(n);var s=r.viewport;void 0!==s&&t.state.viewport(s),i.visible=!0}(t,e,r))},this.getRenderTarget=function(){return g}};e.Refractor=i,(i.prototype=Object.create(n.Mesh.prototype)).constructor=i,i.RefractorShader={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec4 vUv;","void main() {","\tvUv = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec4 vUv;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );","}","void main() {","\tvec4 base = texture2DProj( tDiffuse, vUv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")}},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},a=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e 0. && height < 0.5 * maxH ) {\n\t\t\t\t\t\t\t\t\ta_color = vec4(112./255.,231./255.,253./255.,1.0);\n\t\t\t\t\t\t\t\t}else if( height > 0.5 * maxH && height < maxH){\n\t\t\t\t\t\t\t\t\ta_color = vec4(5./255.,108./255.,184./255.,1.0);\n\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t a_color = vec4(112./255.,231./255.,253./255.,1.0);\n }\n vec4 AmbientColor = vec4(u_lightColor, 1.0) * a_color;//环境光\n vec4 diffuseColor = a_color * vec4(u_lightColor, 1.0) * nDotL;//漫反射光的颜色\n gl_FragColor = a_color * (AmbientColor + diffuseColor);\n\t\t\t\t\t\t}\n\t\t\t\t",fs_c:"\n\t\t\t\t\t\tvarying vec3 iPosition;\n\t\t\t\t\t\tvarying vec2 vUv;\n\t\t\t\t\t\tuniform float maxH;\n \n //添加光照效果\n uniform vec3 u_lightDirection;\n\t\t\t\t\t\tvarying vec3 vNormal;\n\t\t\t\t\t\tvec3 u_lightColor = vec3(0.9, 0.9, 0.9);//光线的颜色\n\n\t\t\t\t\t\tvoid main(){\n\n\t\t\t\t\t\t \tvec3 faceNormal = normalize(vNormal);//表面的法向量\n\t\t\t\t\t\t\t\t//获取入射光线与法向量的夹角\n\t\t\t\t\t\t\t\tfloat nDotL = max(dot(u_lightDirection, faceNormal), 0.0);\n\n\t\t\t\t\t\t\t\tfloat height = iPosition.z;\n\t\t\t\t\t\t\t\t\n float maxH = "+(r-.1)+" - 0.1;\n\n vec4 a_color;\n\n\t\t\t\t\t\t\t\tif( height > 0. && height < 0.2 * maxH ) {\n\t\t\t\t\t\t\t\t\ta_color = vec4(126./255.,228./255.,251./255.,1.0);\n\t\t\t\t\t\t\t\t}else if( height > 0.2 * maxH && height < 0.25 * maxH){\n\t\t\t\t\t\t\t\t\ta_color = vec4(25./255.,73./255.,101./255.,1.0);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if( height > 0.25 * maxH && height < 0.45 * maxH){\n\t\t\t\t\t\t\t\t\ta_color = vec4(71./255.,180./255.,227./255.,1.0);\n\t\t\t\t\t\t\t\t}else if( height > 0.45 * maxH && height < maxH){\n\t\t\t\t\t\t\t\t\ta_color = vec4(6./255.,22./255.,44./255.,1.0);\n\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\ta_color = vec4(35./255.,157./255.,251./255.,1.0);\n }\n \n vec4 AmbientColor = vec4(u_lightColor, 1.0) * a_color;//环境光\n vec4 diffuseColor = a_color * vec4(u_lightColor, 1.0) * nDotL;//漫反射光的颜色\n gl_FragColor = a_color * (AmbientColor + diffuseColor);\n\t\t\t\t\t\t}\n\t\t\t\t",fs_d:"\n\t\t\t\t\t\tvarying vec3 iPosition;\n\t\t\t\t\t\tvarying vec2 vUv;\n\t\t\t\t\t\tuniform float maxH;\n \n //添加光照效果\n uniform vec3 u_lightDirection;\n\t\t\t\t\t\tvarying vec3 vNormal;\n\t\t\t\t\t\tvec3 u_lightColor = vec3(0.9, 0.9, 0.9);//光线的颜色\n\n\t\t\t\t\t\tvoid main(){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvec3 faceNormal = normalize(vNormal);//表面的法向量\n\n\t\t\t\t\t\t\t\t//获取入射光线与法向量的夹角\n\t\t\t\t\t\t\t\tfloat nDotL = max(dot(u_lightDirection, faceNormal), 0.0);\n\n\t\t\t\t\t\t\t\tfloat height = iPosition.z;\n\t\t\t\t\t\t\t\t\n float maxH = "+(r-.1)+" - 0.1;\n\n vec4 a_color;\n\n\t\t\t\t\t\t\t\tif( height > 0. && height < 0.05 * maxH ) {\n a_color = vec4(177./255.,229./255.,240./255.,1.0);\n\t\t\t\t\t\t\t\t}else if( height > 0.05 * maxH && height < 0.25 * maxH){\n a_color = vec4(6./255.,22./255.,44./255.,1.0);\n\t\t\t\t\t\t\t\t}else if( height > 0.25 * maxH && height < 0.3 * maxH){\n a_color = vec4(177./255.,229./255.,240./255.,1.0);\t\n\t\t\t\t\t\t\t\t}else if( height > 0.3 * maxH && height < 0.4 * maxH){\n a_color = vec4(6./255.,22./255.,44./255.,1.0);\t\n\t\t\t\t\t\t\t\t}else if( height > 0.4 * maxH && height < 0.42 * maxH){\n a_color = vec4(177./255.,229./255.,240./255.,1.0);\t\n\t\t\t\t\t\t\t\t}else if( height > 0.42 * maxH && height < 0.5 * maxH){\n a_color = vec4(6./255.,22./255.,44./255.,1.0);\t\n\t\t\t\t\t\t\t\t}else if( height > 0.5 * maxH && height < 0.52 * maxH){\n\t\t\t\t\t\t\t\t\tvec4 AmbientColor = vec4(u_lightColor, 1.0) * vec4(177./255.,229./255.,240./255.,1.0);//环境光\n\n\t\t\t\t\t\t\t\t\tvec4 diffuseColor = vec4(177./255.,229./255.,240./255.,1.0) * vec4(u_lightColor, 1.0) * nDotL;//漫反射光的颜色\n\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(177./255.,229./255.,240./255.,1.0) * (AmbientColor + diffuseColor);\n\t\t\t\t\t\t\t\t}else if( height > 0.52 * maxH && height < 0.7 * maxH){\n\t\t\t\t\t\t\t\t\tvec4 AmbientColor = vec4(u_lightColor, 1.0) * vec4(6./255.,22./255.,44./255.,1.0);//环境光\n\n\t\t\t\t\t\t\t\t\tvec4 diffuseColor = vec4(6./255.,22./255.,44./255.,1.0) * vec4(u_lightColor, 1.0) * nDotL;//漫反射光的颜色\n\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(6./255.,22./255.,44./255.,1.0) * (AmbientColor + diffuseColor);\n\t\t\t\t\t\t\t\t}else if( height > 0.7 * maxH && height < 0.72 * maxH){\n\t\t\t\t\t\t\t\t\tvec4 AmbientColor = vec4(u_lightColor, 1.0) * vec4(177./255.,229./255.,240./255.,1.0);//环境光\n\n\t\t\t\t\t\t\t\t\tvec4 diffuseColor = vec4(177./255.,229./255.,240./255.,1.0) * vec4(u_lightColor, 1.0) * nDotL;//漫反射光的颜色\n\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(177./255.,229./255.,240./255.,1.0) * (AmbientColor + diffuseColor);\n\t\t\t\t\t\t\t\t}else if( height > 0.72 * maxH && height < 0.9 * maxH){\n\t\t\t\t\t\t\t\t\tvec4 AmbientColor = vec4(u_lightColor, 1.0) * vec4(6./255.,22./255.,44./255.,1.0);//环境光\n\n\t\t\t\t\t\t\t\t\tvec4 diffuseColor = vec4(6./255.,22./255.,44./255.,1.0) * vec4(u_lightColor, 1.0) * nDotL;//漫反射光的颜色\n\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(6./255.,22./255.,44./255.,1.0) * (AmbientColor + diffuseColor);\n\t\t\t\t\t\t\t\t}else if( height > 0.9 * maxH && height < 0.95 * maxH){\n\t\t\t\t\t\t\t\t\tvec4 AmbientColor = vec4(u_lightColor, 1.0) * vec4(177./255.,229./255.,240./255.,1.0);//环境光\n\n\t\t\t\t\t\t\t\t\tvec4 diffuseColor = vec4(177./255.,229./255.,240./255.,1.0) * vec4(u_lightColor, 1.0) * nDotL;//漫反射光的颜色\n\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(177./255.,229./255.,240./255.,1.0) * (AmbientColor + diffuseColor);\n\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\tvec4 AmbientColor = vec4(u_lightColor, 1.0) * vec4(35./255.,157./255.,251./255.,1.0);//环境光\n\n\t\t\t\t\t\t\t\t\tvec4 diffuseColor = vec4(35./255.,157./255.,251./255.,1.0) * vec4(u_lightColor, 1.0) * nDotL;//漫反射光的颜色\n\t\t\t\t\t\t\t\t\tgl_FragColor = vec4(35./255.,157./255.,251./255.,1.0) * (AmbientColor + diffuseColor);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t"};return o=r<50?u.fs_a:r<100?u.fs_b:r<300?u.fs_c:u.fs_d,new d.Mesh(s,new d.ShaderMaterial({uniforms:{u_lightDirection:{value:new d.Vector3(-5,10,20).normalize()}},vertexShader:u.vs,fragmentShader:o,transparent:!1}))}))},t.prototype.buildSource=function(){var t=this;this.map_center=[this.map.getCenter().lng,this.map.getCenter().lat];var e=t.map_center,r=h.default.MercatorCoordinate.fromLngLat(e,0),n={translateX:r.x,translateY:r.y,translateZ:r.z,rotateX:0,rotateY:0,rotateZ:0,scale:t.meterInMercatorCoordinateUnits(r.y)};this.layer=new p.MapboxCore(this.map).genCustomLayer(this.layerId,(function(e,r){var n=this,i=t.map.getCanvas(),o=i.width,a=i.height;this.camera=new d.Camera,this.scene=new d.Scene;var s=new d.DirectionalLight(16777215);s.position.set(0,-70,100).normalize(),this.scene.add(s);var u=new d.DirectionalLight(16777215);u.position.set(0,70,100).normalize(),this.scene.add(u),this.renderer=new d.WebGLRenderer({canvas:e.getCanvas(),context:r,antiallias:!0}),this.renderer.sortObjects=!0;var c=new g.RenderPass(this.scene,this.camera),l=new m.UnrealBloomPass(new d.Vector2(o,a),0,0,0);this.composer=new f.EffectComposer(this.renderer),this.composer.setSize(o,a),this.composer.addPass(c),this.composer.addPass(l),t.createBuildings().forEach((function(t){n.scene.add(t)})),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.autoClear=!1}),(function(t,e){this.renderer.state.reset(),this.renderer.render(this.scene,this.camera)}),n)},t.prototype.rotate=function(t){var e=this;window.requestAnimationFrame((function(){e.rotate(t)})),t.rotateZ(.01)},t.prototype.buildLayer=function(){this.map.addLayer(this.layer),this.map.on("resize",this._resizeHandler)},t.prototype.resizeHandler=function(){this.map.removeLayer(this.layerId),this.map.addLayer(this.layer)},t.prototype.show=function(){this.map.setLayoutProperty(this.layerId,"visibility","visible")},t.prototype.hide=function(){this.map.setLayoutProperty(this.layerId,"visibility","none")},t.prototype.on=function(t){throw new Error("Method not implemented.")},t.prototype.off=function(t){throw new Error("Method not implemented.")},t.prototype.update=function(t,e){var r=e.type||"geojson",n=u.default[r](t,e);this.map.getSource(this.sourceId).setData(n)},t}();e.Building=y},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(76);Object.defineProperty(e,"WebGLCirlceSpread",{enumerable:!0,get:function(){return n.CirlceSpread}})},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},a=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e("+o+". - 0.1)){\n discard; \n }\n gl_FragColor = vec4(color,alphay * ( 1.0 - alphax ) ); \n\n }\n "},h=new d.Mesh(c,new d.ShaderMaterial({uniforms:{time:{value:3*Math.PI/2},radius:{value:10}},vertexShader:l.vs,fragmentShader:l.fs,side:d.DoubleSide,depthTest:!1,transparent:!0}));h.renderOrder=9;var p=setInterval((function(){r>i&&(r=10),h.material.uniforms.radius.value=r,h.geometry=new d.ExtrudeGeometry(t.circleShape.apply(t,a(t.lonlatToThree.apply(t,a(e.geometry.coordinates,[0])),[r])),u),r+=100}),100);return t.timerCollection.push(p),h}))},t.prototype.buildSource=function(){var t=this;this.map_center=[this.map.getCenter().lng,this.map.getCenter().lat];var e=t.map_center,r=h.default.MercatorCoordinate.fromLngLat(e,0),n={translateX:r.x,translateY:r.y,translateZ:r.z,rotateX:0,rotateY:0,rotateZ:0,scale:t.meterInMercatorCoordinateUnits(r.y)};this.layer=new p.MapboxCore(this.map).genCustomLayer(this.layerId,(function(e,r){var n=this,i=t.map.getCanvas(),o=i.width,a=i.height;this.camera=new d.Camera,this.scene=new d.Scene;var s=new d.DirectionalLight(16777215);s.position.set(0,-70,100).normalize(),this.scene.add(s);var u=new d.DirectionalLight(16777215);u.position.set(0,70,100).normalize(),this.scene.add(u),this.renderer=new d.WebGLRenderer({canvas:e.getCanvas(),context:r,antiallias:!0}),this.renderer.sortObjects=!0;var c=new g.RenderPass(this.scene,this.camera),l=new m.UnrealBloomPass(new d.Vector2(o,a),1,0,0);this.composer=new f.EffectComposer(this.renderer),this.composer.setSize(o,a),this.composer.addPass(c),this.composer.addPass(l),t.createCircleSpread().forEach((function(t){n.scene.add(t)})),this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.autoClear=!1}),(function(t,e){this.composer.render()}),n)},t.prototype.buildLayer=function(){this.map.addLayer(this.layer),this.map.on("resize",this._resizeHandler)},t.prototype.resizeHandler=function(){this.map.removeLayer(this.layerId),this.map.addLayer(this.layer)},t.prototype.show=function(){this.map.setLayoutProperty(this.layerId,"visibility","visible")},t.prototype.hide=function(){this.map.setLayoutProperty(this.layerId,"visibility","none")},t.prototype.on=function(t){throw new Error("Method not implemented.")},t.prototype.off=function(t){throw new Error("Method not implemented.")},t.prototype.update=function(t,e){var r=e.type||"geojson",n=u.default[r](t,e);this.map.getSource(this.sourceId).setData(n)},t}();e.CirlceSpread=y}])},function(t,e,r){"use strict";r.d(e,"c",(function(){return Ge})),r.d(e,"b",(function(){return ue})),r.d(e,"a",(function(){return Yt}));var n,i,o,a,s,u=r(8),c=r(3),l=r.n(c),h=r(4),p=r.n(h),d=r(12),f=r.n(d),g=r(13),m=r.n(g),y=r(10),v=r.n(y),A=r(115),_=r.n(A),b=r(11),x=r.n(b),w=r(33),C=r.n(w),E=r(18),I=r.n(E),M=r(6),S=r.n(M),T=(r(66),r(62)),P=r.n(T),O=r(90),L=r.n(O),k=r(80),R=r(15),D=r(69),B=r(490),N=r.n(B),F=r(16);var j,z,U,G,H,V,Q,q,W=(n=Object(F.injectable)(),i=Object(F.inject)(u.TYPES.IGlobalConfigService),n((a=function(){function t(){l()(this,t),C()(this,"configService",s,this),this.enabled=void 0}return p()(t,[{key:"apply",value:function(t,e){var r=this,n=(e.rendererService,e.postProcessingPassFactory),i=e.normalPassFactory;t.hooks.init.tap("MultiPassRendererPlugin",(function(){var e=t.getLayerConfig(),o=e.enableMultiPassRenderer,a=e.passes,s=void 0===a?[]:a;r.enabled=!!o&&!1!==t.getLayerConfig().enableMultiPassRenderer,r.enabled&&(t.multiPassRenderer=r.createMultiPassRenderer(t,s,n,i),t.multiPassRenderer.setRenderFlag(!0))})),t.hooks.beforeRender.tap("MultiPassRendererPlugin",(function(){}))}},{key:"createMultiPassRenderer",value:function(t,e,r,n){var i=t.multiPassRenderer,o=t.getLayerConfig(),a=o.enablePicking;o.enableTAA;return a&&i.add(n("pixelPicking")),i}}]),t}(),s=S()(a.prototype,"configService",[i],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),o=a))||o),Y=(j={},x()(j,u.BlendType.additive,{enable:!0,func:{srcRGB:u.gl.ONE,dstRGB:u.gl.ONE,srcAlpha:1,dstAlpha:1}}),x()(j,u.BlendType.none,{enable:!1}),x()(j,u.BlendType.normal,{enable:!0,func:{srcRGB:u.gl.SRC_ALPHA,dstRGB:u.gl.ONE_MINUS_SRC_ALPHA,srcAlpha:1,dstAlpha:1}}),x()(j,u.BlendType.subtractive,{enable:!0,func:{srcRGB:u.gl.ONE,dstRGB:u.gl.ONE,srcAlpha:u.gl.ZERO,dstAlpha:u.gl.ONE_MINUS_SRC_COLOR},equation:{rgb:u.gl.FUNC_SUBTRACT,alpha:u.gl.FUNC_SUBTRACT}}),x()(j,u.BlendType.max,{enable:!0,func:{srcRGB:u.gl.ONE,dstRGB:u.gl.ONE},equation:{rgb:u.gl.MAX_EXT}}),x()(j,u.BlendType.min,{enable:!0,func:{srcRGB:u.gl.ONE,dstRGB:u.gl.ONE},equation:{rgb:u.gl.MIN_EXT}}),j),X={properties:{enablePicking:{type:"boolean"},enableHighlight:{type:"boolean"},highlightColor:{oneOf:[{type:"array",items:{type:"number",minimum:0,maximum:1}},{type:"string"}]}}};function Z(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return K(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};return l()(this,r),(t=e.call(this)).id="".concat(at++),t.name="".concat(at),t.type=void 0,t.visible=!0,t.zIndex=0,t.minZoom=void 0,t.maxZoom=void 0,t.inited=!1,t.layerModelNeedUpdate=!1,t.pickedFeatureID=null,t.selectedFeatureID=null,t.styleNeedUpdate=!1,t.dataState={dataSourceNeedUpdate:!1,dataMappingNeedUpdate:!1,filterNeedUpdate:!1,featureScaleNeedUpdate:!1,StyleAttrNeedUpdate:!1},t.hooks={init:new k.b,afterInit:new k.b,beforeRender:new k.b,beforeRenderData:new k.d,afterRender:new k.c,beforePickingEncode:new k.c,afterPickingEncode:new k.c,beforeHighlight:new k.c(["pickedColor"]),afterHighlight:new k.c,beforeSelect:new k.c(["pickedColor"]),afterSelect:new k.c,beforeDestroy:new k.c,afterDestroy:new k.c},t.models=[],t.multiPassRenderer=void 0,t.plugins=void 0,t.sourceOption=void 0,t.layerModel=void 0,C()(t,"logger",V,I()(t)),C()(t,"configService",Q,I()(t)),C()(t,"shaderModuleService",q,I()(t)),t.cameraService=void 0,t.coordinateService=void 0,t.iconService=void 0,t.fontService=void 0,t.pickingService=void 0,t.rendererService=void 0,t.layerService=void 0,t.interactionService=void 0,t.mapService=void 0,t.styleAttributeService=void 0,t.layerSource=void 0,t.postProcessingPassFactory=void 0,t.normalPassFactory=void 0,t.animateOptions={enable:!1},t.container=void 0,t.encodedData=void 0,t.configSchema=void 0,t.currentPickId=null,t.rawConfig=void 0,t.needUpdateConfig=void 0,t.pendingStyleAttributes=[],t.scaleOptions={},t.animateStartTime=void 0,t.aniamateStatus=!1,t.sourceEvent=function(){t.dataState.dataSourceNeedUpdate=!0;var e=t.getLayerConfig(),r=e.autoFit,n=e.fitBoundsOptions;r&&t.fitBounds(n),t.emit("dataUpdate"),t.reRender()},t.name=n.name||t.id,t.zIndex=n.zIndex||0,t.rawConfig=n,t}return p()(r,[{key:"getLayerConfig",value:function(){return this.configService.getLayerConfig(this.id)}},{key:"updateLayerConfig",value:function(t){if(this.inited){var e=this.container.get(u.TYPES.SceneID);this.configService.setLayerConfig(e,this.id,$($($({},this.configService.getLayerConfig(this.id)),this.needUpdateConfig),t)),this.needUpdateConfig={}}else this.needUpdateConfig=$($({},this.needUpdateConfig),t)}},{key:"setContainer",value:function(t){this.container=t}},{key:"getContainer",value:function(){return this.container}},{key:"addPlugin",value:function(t){return this.plugins.push(t),this}},{key:"init",value:function(){var t=this,e=this.container.get(u.TYPES.SceneID),r=this.rawConfig.enableMultiPassRenderer,n=void 0!==r&&r;this.configService.setLayerConfig(e,this.id,{enableMultiPassRenderer:n}),this.iconService=this.container.get(u.TYPES.IIconService),this.fontService=this.container.get(u.TYPES.IFontService),this.rendererService=this.container.get(u.TYPES.IRendererService),this.layerService=this.container.get(u.TYPES.ILayerService),this.interactionService=this.container.get(u.TYPES.IInteractionService),this.pickingService=this.container.get(u.TYPES.IPickingService),this.mapService=this.container.get(u.TYPES.IMapService),this.cameraService=this.container.get(u.TYPES.ICameraService),this.coordinateService=this.container.get(u.TYPES.ICoordinateSystemService),this.postProcessingPassFactory=this.container.get(u.TYPES.IFactoryPostProcessingPass),this.normalPassFactory=this.container.get(u.TYPES.IFactoryNormalPass),this.styleAttributeService=this.container.get(u.TYPES.IStyleAttributeService),this.multiPassRenderer=this.container.get(u.TYPES.IMultiPassRenderer),this.multiPassRenderer.setLayer(this),this.pendingStyleAttributes.forEach((function(e){var r=e.attributeName,n=e.attributeField,i=e.attributeValues,o=e.updateOptions;t.styleAttributeService.updateStyleAttribute(r,{scale:$({field:n},t.splitValuesAndCallbackInAttribute(i,t.getLayerConfig()[r]))},o)})),this.pendingStyleAttributes=[],this.plugins=this.container.getAll(u.TYPES.ILayerPlugin);var i,o=Z(this.plugins);try{for(o.s();!(i=o.n()).done;){i.value.apply(this,{rendererService:this.rendererService,mapService:this.mapService,styleAttributeService:this.styleAttributeService,normalPassFactory:this.normalPassFactory,postProcessingPassFactory:this.postProcessingPassFactory})}}catch(t){o.e(t)}finally{o.f()}return this.hooks.init.call(),this.hooks.afterInit.call(),this.emit("inited",{target:this,type:"inited"}),this.emit("add",{target:this,type:"add"}),this}},{key:"prepareBuildModel",value:function(){this.inited=!0,this.updateLayerConfig($($({},this.getDefaultConfig()),this.rawConfig));var t=this.getLayerConfig().animateOption;null!=t&&t.enable&&(this.layerService.startAnimate(),this.aniamateStatus=!0)}},{key:"color",value:function(t,e,r){return this.updateStyleAttribute("color",t,e,r),this}},{key:"rotate",value:function(t,e,r){return this.updateStyleAttribute("rotate",t,e,r),this}},{key:"size",value:function(t,e,r){return this.updateStyleAttribute("size",t,e,r),this}},{key:"filter",value:function(t,e,r){return this.updateStyleAttribute("filter",t,e,r),this}},{key:"shape",value:function(t,e,r){return this.updateStyleAttribute("shape",t,e,r),this}},{key:"label",value:function(t,e,r){return this.pendingStyleAttributes.push({attributeName:"label",attributeField:t,attributeValues:e,updateOptions:r}),this}},{key:"animate",value:function(t){var e={};return P()(t)?(e.enable=!0,e=$($({},e),t)):e.enable=t,this.updateLayerConfig({animateOption:e}),this}},{key:"source",value:function(t,e){return this.sourceOption={data:t,options:e},this}},{key:"setData",value:function(t,e){var r=this;return this.inited?this.layerSource.setData(t,e):this.on("inited",(function(){r.layerSource.setData(t,e)})),this}},{key:"style",value:function(t){var e=this,r=t.passes,n=_()(t,["passes"]);return r&&function(t){return t.map((function(t){return"string"==typeof t&&(t=[t,{}]),t}))}(r).forEach((function(t){var r=e.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(t[0]);r&&r.updateOptions(t[1])})),this.rawConfig=$($({},this.rawConfig),n),this.container&&(this.updateLayerConfig(this.rawConfig),this.styleNeedUpdate=!0),this}},{key:"scale",value:function(t,e){return P()(t)?this.scaleOptions=$($({},this.scaleOptions),t):this.scaleOptions[t]=e,this}},{key:"render",value:function(){return this.renderModels(),this}},{key:"active",value:function(t){var e={};return e.enableHighlight=!!P()(t)||t,P()(t)?(e.enableHighlight=!0,t.color&&(e.highlightColor=t.color)):e.enableHighlight=!!t,this.updateLayerConfig(e),this}},{key:"setActive",value:function(t,e){var r=this;if(P()(t)){var n=t.x,i=void 0===n?0:n,o=t.y,a=void 0===o?0:o;this.updateLayerConfig({highlightColor:P()(e)?e.color:this.getLayerConfig().highlightColor}),this.pick({x:i,y:a})}else this.updateLayerConfig({pickedFeatureID:t,highlightColor:P()(e)?e.color:this.getLayerConfig().highlightColor}),this.hooks.beforeSelect.call(Object(R.l)(t)).then((function(){setTimeout((function(){r.reRender()}),1)}))}},{key:"select",value:function(t){var e={};return e.enableSelect=!!P()(t)||t,P()(t)?(e.enableSelect=!0,t.color&&(e.selectColor=t.color)):e.enableSelect=!!t,this.updateLayerConfig(e),this}},{key:"setSelect",value:function(t,e){var r=this;if(P()(t)){var n=t.x,i=void 0===n?0:n,o=t.y,a=void 0===o?0:o;this.updateLayerConfig({selectColor:P()(e)?e.color:this.getLayerConfig().selectColor}),this.pick({x:i,y:a})}else this.updateLayerConfig({pickedFeatureID:t,selectColor:P()(e)?e.color:this.getLayerConfig().selectColor}),this.hooks.beforeSelect.call(Object(R.l)(t)).then((function(){setTimeout((function(){r.reRender()}),1)}))}},{key:"setBlend",value:function(t){this.updateLayerConfig({blend:t}),this.layerModelNeedUpdate=!0,this.reRender()}},{key:"show",value:function(){return this.updateLayerConfig({visible:!0}),this.reRender(),this}},{key:"hide",value:function(){return this.updateLayerConfig({visible:!1}),this.reRender(),this}},{key:"setIndex",value:function(t){return this.zIndex=t,this.layerService.updateRenderOrder(),this}},{key:"setCurrentPickId",value:function(t){this.currentPickId=t}},{key:"getCurrentPickId",value:function(){return this.currentPickId}},{key:"setCurrentSelectedId",value:function(t){this.selectedFeatureID=t}},{key:"getCurrentSelectedId",value:function(){return this.selectedFeatureID}},{key:"isVisible",value:function(){var t=this.mapService.getZoom(),e=this.getLayerConfig(),r=e.visible,n=e.minZoom,i=void 0===n?-1/0:n,o=e.maxZoom;return!!r&&t>=i&&t<=(void 0===o?1/0:o)}},{key:"setMinZoom",value:function(t){return this.updateLayerConfig({minZoom:t}),this}},{key:"getMinZoom",value:function(){return this.getLayerConfig().minZoom}},{key:"getMaxZoom",value:function(){return this.getLayerConfig().maxZoom}},{key:"get",value:function(t){return this.getLayerConfig()[t]}},{key:"setMaxZoom",value:function(t){return this.updateLayerConfig({maxZoom:t}),this}},{key:"fitBounds",value:function(t){if(!this.inited)return this.updateLayerConfig({autoFit:!0}),this;var e=this.getSource().extent;return e.some((function(t){return Math.abs(t)===1/0}))||this.mapService.fitBounds([[e[0],e[1]],[e[2],e[3]]],t),this}},{key:"destroy",value:function(){this.hooks.beforeDestroy.call(),this.layerSource.off("update",this.sourceEvent),this.multiPassRenderer.destroy(),this.styleAttributeService.clearAllAttributes(),this.hooks.afterDestroy.call(),this.emit("remove",{target:this,type:"remove"}),this.removeAllListeners()}},{key:"clear",value:function(){this.styleAttributeService.clearAllAttributes()}},{key:"clearModels",value:function(){this.models.forEach((function(t){return t.destroy()})),this.layerModel.clearModels()}},{key:"isDirty",value:function(){return!!(this.styleAttributeService.getLayerStyleAttributes()||[]).filter((function(t){return t.needRescale||t.needRemapping||t.needRegenerateVertices})).length}},{key:"setSource",value:function(t){this.layerSource=t;var e=this.mapService.getZoom();this.layerSource.cluster&&this.layerSource.updateClusterData(e),this.layerSource.on("update",this.sourceEvent)}},{key:"getSource",value:function(){return this.layerSource}},{key:"getScaleOptions",value:function(){return this.scaleOptions}},{key:"setEncodedData",value:function(t){this.encodedData=t}},{key:"getEncodedData",value:function(){return this.encodedData}},{key:"getConfigSchemaForValidation",value:function(){return this.configSchema||(this.configSchema=N()([X,this.getConfigSchema()])),this.configSchema}},{key:"getLegendItems",value:function(t){var e=this.styleAttributeService.getLayerAttributeScale(t);return e?e.ticks?e.ticks().map((function(r){return x()({value:r},t,e(r))})):e.invertExtent?e.range().map((function(r){return x()({value:e.invertExtent(r)},t,r)})):void 0:[]}},{key:"pick",value:function(t){var e=t.x,r=t.y;this.interactionService.triggerHover({x:e,y:r})}},{key:"boxSelect",value:function(t,e){this.pickingService.boxPickLayer(this,t,e)}},{key:"buildLayerModel",value:function(t){var e=t.moduleName,r=t.vertexShader,n=t.fragmentShader,i=t.triangulation,o=_()(t,["moduleName","vertexShader","fragmentShader","triangulation"]);this.shaderModuleService.registerModule(e,{vs:r,fs:n});var a=this.shaderModuleService.getModule(e),s=a.vs,c=a.fs,l=a.uniforms,h=this.rendererService.createModel,p=this.styleAttributeService.createAttributesAndIndices(this.encodedData,i);return h($({attributes:p.attributes,uniforms:l,fs:c,vs:s,elements:p.elements,blend:Y[u.BlendType.normal]},o))}},{key:"getTime",value:function(){return this.layerService.clock.getDelta()}},{key:"setAnimateStartTime",value:function(){this.animateStartTime=this.layerService.clock.getElapsedTime()}},{key:"stopAnimate",value:function(){this.aniamateStatus&&(this.layerService.stopAnimate(),this.aniamateStatus=!1,this.updateLayerConfig({animateOption:{enable:!1}}))}},{key:"getLayerAnimateTime",value:function(){return this.layerService.clock.getElapsedTime()-this.animateStartTime}},{key:"needPick",value:function(t){var e=this.getLayerConfig(),r=e.enableHighlight,n=void 0===r||r,i=e.enableSelect,o=void 0===i||i,a=-1!==this.eventNames().indexOf(t)||-1!==this.eventNames().indexOf("un"+t);return"click"!==t&&"dblclick"!==t||!o||(a=!0),"mousemove"!==t||!n&&-1===this.eventNames().indexOf("mouseenter")&&-1===this.eventNames().indexOf("unmousemove")&&-1===this.eventNames().indexOf("mouseout")||(a=!0),this.isVisible()&&a}},{key:"buildModels",value:function(){throw new Error("Method not implemented.")}},{key:"rebuildModels",value:function(){throw new Error("Method not implemented.")}},{key:"renderModels",value:function(){var t=this;return this.layerModelNeedUpdate&&this.layerModel&&(this.models=this.layerModel.buildModels(),this.hooks.beforeRender.call(),this.layerModelNeedUpdate=!1),this.models.forEach((function(e){e.draw({uniforms:t.layerModel.getUninforms()})})),this}},{key:"getConfigSchema",value:function(){throw new Error("Method not implemented.")}},{key:"getModelType",value:function(){throw new Error("Method not implemented.")}},{key:"getDefaultConfig",value:function(){return{}}},{key:"reRender",value:function(){this.inited&&this.layerService.renderLayers()}},{key:"splitValuesAndCallbackInAttribute",value:function(t,e){return{values:L()(t)?void 0:t||e,callback:L()(t)?t:void 0}}},{key:"updateStyleAttribute",value:function(t,e,r,n){this.inited?this.styleAttributeService.updateStyleAttribute(t,{scale:$({field:e},this.splitValuesAndCallbackInAttribute(r,this.getLayerConfig()[e]))},n):this.pendingStyleAttributes.push({attributeName:t,attributeField:e,attributeValues:r,updateOptions:n})}}]),r}(D.EventEmitter),V=S()(H.prototype,"logger",[z],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Q=S()(H.prototype,"configService",[U],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),q=S()(H.prototype,"shaderModuleService",[G],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),H),ut=(et=Object(u.lazyInject)(u.TYPES.IGlobalConfigService),rt=Object(u.lazyInject)(u.TYPES.IShaderModuleService),nt=function(){function t(e){l()(this,t),this.triangulation=void 0,this.layer=void 0,C()(this,"configService",it,this),C()(this,"shaderModuleService",ot,this),this.rendererService=void 0,this.iconService=void 0,this.fontService=void 0,this.styleAttributeService=void 0,this.mapService=void 0,this.cameraService=void 0,this.layerService=void 0,this.layer=e,this.rendererService=e.getContainer().get(u.TYPES.IRendererService),this.styleAttributeService=e.getContainer().get(u.TYPES.IStyleAttributeService),this.mapService=e.getContainer().get(u.TYPES.IMapService),this.iconService=e.getContainer().get(u.TYPES.IIconService),this.fontService=e.getContainer().get(u.TYPES.IFontService),this.cameraService=e.getContainer().get(u.TYPES.ICameraService),this.layerService=e.getContainer().get(u.TYPES.ILayerService),this.registerBuiltinAttributes(),this.startModelAnimate()}return p()(t,[{key:"getBlend",value:function(){var t=this.layer.getLayerConfig().blend,e=void 0===t?"normal":t;return Y[u.BlendType[e]]}},{key:"getDefaultStyle",value:function(){return{}}},{key:"getUninforms",value:function(){throw new Error("Method not implemented.")}},{key:"getAnimateUniforms",value:function(){return{}}},{key:"needUpdate",value:function(){return!1}},{key:"buildModels",value:function(){throw new Error("Method not implemented.")}},{key:"initModels",value:function(){throw new Error("Method not implemented.")}},{key:"clearModels",value:function(){}},{key:"getAttribute",value:function(){throw new Error("Method not implemented.")}},{key:"render",value:function(){throw new Error("Method not implemented.")}},{key:"registerBuiltinAttributes",value:function(){throw new Error("Method not implemented.")}},{key:"animateOption2Array",value:function(t){return[t.enable?0:1,t.duration||4,t.interval||.2,t.trailLength||.1]}},{key:"startModelAnimate",value:function(){this.layer.getLayerConfig().animateOption.enable&&this.layer.setAnimateStartTime()}}]),t}(),it=S()(nt.prototype,"configService",[et],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),ot=S()(nt.prototype,"shaderModuleService",[rt],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),nt),ct=r(47),lt=r.n(ct),ht=r(23),pt=r.n(ht),dt=r(137),ft=r.n(dt),gt=r(29),mt=gt.b.create(),yt=(gt.b.create(),gt.b.create()),vt=gt.b.create(),At=gt.b.create();function _t(t,e){return gt.b.set(t,-e[1],e[0])}function bt(t,e,r){return gt.b.sub(t,e,r),gt.b.normalize(t,t),t}var xt,wt,Ct,Et=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l()(this,t),this.complex=void 0,this.join=void 0,this.cap=void 0,this.miterLimit=void 0,this.thickness=void 0,this.normal=void 0,this.lastFlip=-1,this.miter=gt.b.fromValues(0,0),this.started=!1,this.dash=!1,this.totalDistance=0,this.join=e.join||"miter",this.cap=e.cap||"butt",this.miterLimit=e.miterLimit||10,this.thickness=e.thickness||1,this.dash=e.dash||!1,this.complex={positions:[],indices:[],normals:[],startIndex:0}}return p()(t,[{key:"extrude",value:function(t){var e=this.complex;if(t.length<=1)return e;this.lastFlip=-1,this.started=!1,this.normal=null,this.totalDistance=0;for(var r=t.length,n=e.startIndex,i=1;ithis.miterLimit&&(C=!0);C?(u.push(this.normal[0],this.normal[1],0),u.push(x[0],x[1],0),s.push(n[0],n[1],0,this.totalDistance,-this.thickness*w,0),s.push(n[0],n[1],0,this.totalDistance,this.thickness*w,0),a.push.apply(a,pt()(this.lastFlip!==-w?[e,e+2,e+3]:[e+2,e+1,e+3])),a.push(e+2,e+3,e+4),_t(mt,vt),gt.b.copy(this.normal,mt),u.push(this.normal[0],this.normal[1],0),s.push(n[0],n[1],0,this.totalDistance,-this.thickness*w,0),o+=3):(this.extrusions(s,u,n,x,b,this.totalDistance),a.push.apply(a,pt()(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),w=-1,gt.b.copy(this.normal,x),o+=2),this.lastFlip=w}else{if(_t(this.normal,yt),c){var E=gt.b.create(),I=gt.b.create();gt.b.sub(I,yt,this.normal),gt.b.add(E,yt,this.normal),u.push(I[0],I[1],0),u.push(E[0],E[1],0),s.push(n[0],n[1],0,this.totalDistance,this.thickness,0),s.push(n[0],n[1],0,this.totalDistance,this.thickness,0)}else this.extrusions(s,u,n,this.normal,this.thickness,this.totalDistance);a.push.apply(a,pt()(1===this.lastFlip?[e,e+2,e+3]:[e+2,e+1,e+3])),o+=2}return o}},{key:"extrusions",value:function(t,e,r,n,i,o){e.push(n[0],n[1],0),e.push(n[0],n[1],0),t.push(r[0],r[1],0,o,-i,0),t.push(r[0],r[1],0,o,i,0)}},{key:"lineSegmentDistance",value:function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}}]),t}(),It=r(160),Mt=r.n(It);function St(t){if(Mt()(t[0]))return t;if(Mt()(t[0][0]))throw new Error("当前数据不支持标注");if(Mt()(t[0][0][0])){var e=0,r=0,n=0;return t.forEach((function(t){t.forEach((function(t){e+=t[0],r+=t[1],n++}))})),[e/n,r/n,0]}throw new Error("当前数据不支持标注")}function Tt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t[0][0],n=t[0][t[0].length-1];r[0]===n[0]&&r[1]===n[1]&&(t[0]=t[0].slice(0,t[0].length-1));for(var i=t[0].length,o=ft.a.flatten(t),a=o.vertices,s=o.dimensions,u=[],c=[],l=[],h=0;h3&&void 0!==arguments[3]&&arguments[3],i=gt.c.create(),o=gt.c.create(),a=gt.c.create();n&&(t=Object(R.o)(t),e=Object(R.o)(e),r=Object(R.o)(r));var s=gt.c.fromValues.apply(gt.c,pt()(t)),u=gt.c.fromValues.apply(gt.c,pt()(e)),c=gt.c.fromValues.apply(gt.c,pt()(r));gt.c.sub(i,c,u),gt.c.sub(o,s,u),gt.c.cross(a,i,o);var l=gt.c.create();return gt.c.normalize(l,a),l}function Ot(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=2*Math.PI/t,n=[],i=0;i1&&void 0!==arguments[1]&&arguments[1];if(Ft&&Ft[t])return Ft[t];var r=Nt[t]?Nt[t]():Nt.cylinder(),n=Tt([r],e);return Ft[t]=n,n}(t.shape,!1);return{vertices:e.positions,indices:e.index,normals:e.normals,size:5}}function Ut(t){var e=St(t.coordinates);return{vertices:pt()(e),indices:[0],size:e.length}}function Gt(t){var e=t.coordinates,r=e;Array.isArray(r[0][0])||(r=[e]);var n=new Et({dash:!0,join:"bevel"});r.forEach((function(t){n.extrude(t)}));var i=n.complex;return{vertices:i.positions,indices:i.indices,normals:i.normals,size:6}}function Ht(t){var e=Tt(t.coordinates,!0);return{vertices:e.positions,indices:e.index,normals:e.normals,size:5}}function Vt(t){for(var e=t.coordinates,r=[],n=[],i=function(t){r.push(t,1,t,e[0][0],e[0][1],e[1][0],e[1][1],t,-1,t,e[0][0],e[0][1],e[1][0],e[1][1]),29!==t&&n.push.apply(n,pt()([0,1,2,1,3,2].map((function(e){return 2*t+e}))))},o=0;o<30;o++)i(o);return{vertices:r,indices:n,size:7}}function Qt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=v()(t);if(e){var i=v()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var qt=function(t){f()(r,t);var e=Qt(r);function r(){return l()(this,r),e.apply(this,arguments)}return p()(r,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,r=void 0===e?1:e,n=t.baseColor,i=void 0===n?"rgb(16,16,16)":n,o=t.brightColor,a=void 0===o?"rgb(255,176,38)":o,s=t.windowColor,u=void 0===s?"rgb(30,60,89)":s,c=t.time,l=void 0===c?0:c;return{u_opacity:r,u_baseColor:Object(R.r)(i),u_brightColor:Object(R.r)(a),u_windowColor:Object(R.r)(u),u_time:this.layer.getLayerAnimateTime()||l}}},{key:"initModels",value:function(){return this.startModelAnimate(),[this.layer.buildLayerModel({moduleName:"cityBuilding",vertexShader:'precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\n\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\nvarying vec4 v_Color;\n\n#pragma include "projection"\n#pragma include "light"\n#pragma include "picking"\n\nvoid main() {\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n v_texCoord = a_Uv;\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'uniform float u_opacity: 1.0;\nuniform vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];\nuniform float u_near : 0;\nuniform float u_far : 1;\nvarying vec4 v_Color;\nvarying vec2 v_texCoord;\nuniform float u_Zoom : 1;\nuniform float u_time;\n\n#pragma include "picking"\n\nvec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {\n float s = step(hot, n);\n vec3 color = mix(brightColor,vec3(0.9,0.9,1.0),n);\n\n return mix(darkColor, color, s);\n}\nfloat random (vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);\n}\n\nfloat LinearizeDepth()\n{\n float z = gl_FragCoord.z * 2.0 - 1.0;\n return (2.0 * u_near * u_far) / (u_far + u_near - z * (u_far - u_near));\n}\n\nvec3 fog(vec3 color, vec3 fogColor, float depth){\n float fogFactor=clamp(depth,0.0,1.0);\n vec3 output_color=mix(fogColor,color,fogFactor);\n return output_color;\n}\n\nfloat sdRect(vec2 p, vec2 sz) {\n vec2 d = abs(p) - sz;\n float outside = length(max(d, 0.));\n float inside = min(max(d.x, d.y), 0.);\n return outside + inside;\n}\n\nvoid main() {\n gl_FragColor = v_Color;\n vec3 baseColor = u_baseColor.xyz;\n vec3 brightColor = u_brightColor.xyz;\n vec3 windowColor = u_windowColor.xyz;\n float targetColId = 5.;\n float depth = 1.0 - LinearizeDepth() / u_far * u_Zoom;\n vec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);\n if(v_texCoord.x < 0.) { //顶部颜色\n vec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);\n gl_FragColor = vec4( foggedColor, v_Color.w);\n }else { // 侧面颜色\n vec2 st = v_texCoord;\n vec2 UvScale = v_texCoord;\n float tStep = min(0.08,max(0.05* (18.0-u_Zoom),0.02));\n float tStart = 0.25 * tStep;\n float tEnd = 0.75 * tStep;\n float u = mod(UvScale.x, tStep);\n float v = mod(UvScale.y, tStep);\n float ux = floor(UvScale.x/tStep);\n float uy = floor(UvScale.y/tStep);\n float n = random(vec2(ux,uy));\n float lightP = u_time;\n float head = 1.0- step(0.005,st.y);\n /*step3*/\n // 将窗户颜色和墙面颜色区别开来\n float sU = step(tStart, u) - step(tEnd, u);\n float sV = step(tStart, v) - step(tEnd, v);\n vec2 windowSize = vec2(abs(tEnd-tStart),abs(tEnd-tStart));\n float dist = sdRect(vec2(u,v), windowSize);\n float s = sU * sV;\n\n float curColId = floor(UvScale.x / tStep);\n float sCol = step(targetColId - 0.2, curColId) - step(targetColId + 0.2, curColId);\n\n float mLightP = mod(lightP, 2.);\n float sRow = step(mLightP - 0.2, st.y) - step(mLightP, st.y);\n if(ux == targetColId){\n n =0.;\n }\n float timeP = min(0.75, abs ( sin(u_time/3.0) ) );\n float hot = smoothstep(1.0,0.0,timeP);\n vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), s);\n //vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), 1.0);\n float sFinal = s * sCol * sRow;\n color += mix(baseColor, brightColor, sFinal*n);\n if (st.y<0.01){\n color = baseColor;\n }\n if(head ==1.0) { // 顶部亮线\n color = brightColor;\n }\n color = color * v_Color.rgb;\n\n vec3 foggedColor = fog(color,fogColor,depth);\n\n gl_FragColor = vec4(foggedColor,1.0);\n }\n gl_FragColor.a *= u_opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Ht})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"normal",type:u.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:u.gl.STATIC_DRAW,data:[],type:u.gl.FLOAT},size:3,update:function(t,e,r,n,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:u.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:u.gl.DYNAMIC_DRAW,data:[],type:u.gl.FLOAT},size:1,update:function(t,e,r,n){var i=t.size,o=void 0===i?10:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"uv",type:u.AttributeType.Attribute,descriptor:{name:"a_Uv",buffer:{usage:u.gl.DYNAMIC_DRAW,data:[],type:u.gl.FLOAT},size:2,update:function(t,e,r,n){t.size;return[r[3],r[4]]}}})}}]),r}(ut);function Wt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=v()(t);if(e){var i=v()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var Yt=function(t){f()(r,t);var e=Wt(r);function r(){var t;l()(this,r);for(var n=arguments.length,i=new Array(n),o=0;o (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n flag = 1.;\n }\n gl_FragColor.a *=flag;\n }\n\n if(u_aimate.x == Animate) {\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);\n alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Vt,depth:{enable:!1},blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:u.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:u.gl.DYNAMIC_DRAW,data:[],type:u.gl.FLOAT},size:1,update:function(t,e,r,n){var i=t.size,o=void 0===i?1:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:u.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:u.gl.STATIC_DRAW,data:[],type:u.gl.FLOAT},size:4,update:function(t,e,r,n){return[r[3],r[4],r[5],r[6]]}}})}}]),r}(ut);function Jt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=v()(t);if(e){var i=v()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var $t={solid:0,dash:1},te=function(t){f()(r,t);var e=Jt(r);function r(){return l()(this,r),e.apply(this,arguments)}return p()(r,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,r=t.lineType,n=void 0===r?"solid":r,i=t.dashArray,o=void 0===i?[10,5]:i;return 2===o.length&&o.push(0,0),{u_opacity:e||1,segmentNumber:30,u_line_type:$t[n]||0,u_dash_array:o}}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption;return{u_aimate:this.animateOption2Array(t),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"arc3Dline",vertexShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute vec4 a_Color;\nattribute float a_Size;\n\nuniform mat4 u_ModelMatrix;\nuniform float segmentNumber;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\nvarying vec4 v_color;\nvarying vec2 v_normal;\nvarying float v_distance_ratio;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.0));\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\n\nvoid main() {\n v_color = a_Color;\n vec2 source = project_position(vec4(a_Instance.rg, 0, 0)).xy;\n vec2 target = project_position(vec4(a_Instance.ba, 0, 0)).xy;\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n if(u_line_type == LineTypeDash) {\n v_distance_ratio = segmentIndex / segmentNumber;\n float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n }\n if(u_aimate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n vec3 curr = getPos(source, target, segmentRatio);\n vec3 next = getPos(source, target, nextSegmentRatio);\n vec2 offset = getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y);\n v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + project_pixel(offset), curr.z, 1.0));\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n\nuniform float u_opacity;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\nvarying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying float v_distance_ratio;\nvarying vec4 v_color;\n\nuniform float u_time;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n\n#pragma include "picking"\n\nvoid main() {\n gl_FragColor = v_color;\n // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));\n // float blur = smoothstep(1.0, u_blur, length(v_normal.xy));\n gl_FragColor.a *= u_opacity;\n if(u_line_type == LineTypeDash) {\n float flag = 0.;\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n flag = 1.;\n }\n gl_FragColor.a *=flag;\n }\n\n if(u_aimate.x == Animate) {\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);\n alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Vt,blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:u.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:u.gl.DYNAMIC_DRAW,data:[],type:u.gl.FLOAT},size:1,update:function(t,e,r,n){var i=t.size,o=void 0===i?1:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:u.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:u.gl.STATIC_DRAW,data:[],type:u.gl.FLOAT},size:4,update:function(t,e,r,n){return[r[3],r[4],r[5],r[6]]}}})}}]),r}(ut);function ee(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=v()(t);if(e){var i=v()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var re={solid:0,dash:1},ne=function(t){f()(r,t);var e=ee(r);function r(){return l()(this,r),e.apply(this,arguments)}return p()(r,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,r=t.lineType,n=void 0===r?"solid":r,i=t.dashArray,o=void 0===i?[10,5]:i;return 2===o.length&&o.push(0,0),{u_opacity:e||1,segmentNumber:30,u_line_type:re[n]||0,u_dash_array:o}}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption;return{u_aimate:this.animateOption2Array(t),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"arc2dline",vertexShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform float segmentNumber;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\nvarying vec4 v_color;\nvarying vec2 v_normal;\n\nvarying float v_distance_ratio;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n\n#pragma include "projection"\n#pragma include "project"\n#pragma include "picking"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return smoothstep(0.0, 1.0, index / (segmentNumber - 1.));\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size)/ 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) *\n sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\nvec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n if(abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n}\n\nvoid main() {\n v_color = a_Color;\n vec2 source = radians(a_Instance.rg);\n vec2 target = radians(a_Instance.ba);\n float angularDist = getAngularDist(source, target);\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n if(u_line_type == LineTypeDash) {\n v_distance_ratio = segmentIndex / segmentNumber;\n float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba);\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);\n }\n if(u_aimate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n v_distance_ratio = segmentIndex / segmentNumber;\n vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0));\n vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0));\n v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n setPickingColor(a_PickingColor);\n}\n\n',fragmentShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n\nuniform float u_opacity;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\nvarying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying float v_distance_ratio;\nvarying vec4 v_color;\n\nuniform float u_time;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n\n#pragma include "picking"\n\nvoid main() {\n gl_FragColor = v_color;\n // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));\n // float blur = smoothstep(1.0, u_blur, length(v_normal.xy));\n gl_FragColor.a *= u_opacity;\n if(u_line_type == LineTypeDash) {\n float flag = 0.;\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n flag = 1.;\n }\n gl_FragColor.a *=flag;\n }\n\n if(u_aimate.x == Animate) {\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);\n alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Vt,depth:{enable:!1},blend:this.getBlend()})]}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"size",type:u.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:u.gl.DYNAMIC_DRAW,data:[],type:u.gl.FLOAT},size:1,update:function(t,e,r,n){var i=t.size,o=void 0===i?1:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"instance",type:u.AttributeType.Attribute,descriptor:{name:"a_Instance",buffer:{usage:u.gl.STATIC_DRAW,data:[],type:u.gl.FLOAT},size:4,update:function(t,e,r,n){return[r[3],r[4],r[5],r[6]]}}})}}]),r}(ut);function ie(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=v()(t);if(e){var i=v()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var oe={solid:0,dash:1},ae={arc:Kt,arc3d:te,greatcircle:ne,line:function(t){f()(r,t);var e=ie(r);function r(){return l()(this,r),e.apply(this,arguments)}return p()(r,[{key:"getUninforms",value:function(){var t=this.layer.getLayerConfig(),e=t.opacity,r=t.lineType,n=void 0===r?"solid":r,i=t.dashArray,o=void 0===i?[10,5,0,0]:i;return 2===o.length&&o.push(0,0),{u_opacity:e||1,u_line_type:oe[n],u_dash_array:o}}},{key:"getAnimateUniforms",value:function(){var t=this.layer.getLayerConfig().animateOption;return{u_aimate:this.animateOption2Array(t),u_time:this.layer.getLayerAnimateTime()}}},{key:"initModels",value:function(){return this.buildModels()}},{key:"buildModels",value:function(){return[this.layer.buildLayerModel({moduleName:"line",vertexShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n\nattribute float a_Miter;\nattribute vec4 a_Color;\nattribute vec2 a_Size;\nattribute vec3 a_Normal;\nattribute vec3 a_Position;\n\n// dash line\nattribute float a_Total_Distance;\nattribute float a_Distance;\n\nuniform mat4 u_ModelMatrix;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5.,0, 0];\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n\n#pragma include "projection"\n#pragma include "picking"\n\nvarying vec4 v_color;\nvarying vec4 v_dash_array;\nvarying vec2 v_normal;\nvarying float v_distance_ratio;\nvarying float v_side;\n\n\nvoid main() {\n\n if(u_line_type == LineTypeDash) {\n v_distance_ratio = a_Distance / a_Total_Distance;\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;\n }\n if(u_aimate.x == Animate) {\n v_distance_ratio = a_Distance / a_Total_Distance;\n }\n v_normal = vec2(reverse_offset_normal(a_Normal) * sign(a_Miter));\n v_color = a_Color;\n vec3 size = a_Miter * setPickingSize(a_Size.x) * reverse_offset_normal(a_Normal);\n vec2 offset = project_pixel(size.xy);\n v_side = a_Miter * a_Size.x;\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n',fragmentShader:'#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\nuniform float u_blur : 0.99;\nuniform float u_line_type: 0.0;\nuniform float u_opacity : 1.0;\nvarying vec4 v_color;\nvarying vec2 v_normal;\n\n\n// dash\nuniform float u_dash_offset : 0.0;\nuniform float u_dash_ratio : 0.1;\nvarying float v_distance_ratio;\nvarying vec4 v_dash_array;\nvarying float v_side;\n\n\n#pragma include "picking"\n\nuniform float u_time;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n// [animate, duration, interval, trailLength],\nvoid main() {\n gl_FragColor = v_color;\n // anti-alias\n // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));\n gl_FragColor.a *= u_opacity;\n if(u_aimate.x == Animate) {\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);\n alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n // dash line\n if(u_line_type == LineTypeDash) {\n float flag = 0.;\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n flag = 1.;\n }\n gl_FragColor.a *=flag;\n // gl_FragColor.a *=(1.0- step(v_dash_array.x, mod(v_distance_ratio, dashLength)));\n }\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n',triangulation:Gt,primitive:u.gl.TRIANGLES,blend:this.getBlend(),depth:{enable:!1}})]}},{key:"registerBuiltinAttributes",value:function(){this.layer.getLayerConfig().lineType;this.styleAttributeService.registerStyleAttribute({name:"distance",type:u.AttributeType.Attribute,descriptor:{name:"a_Distance",buffer:{usage:u.gl.STATIC_DRAW,data:[],type:u.gl.FLOAT},size:1,update:function(t,e,r,n){return[r[3]]}}}),this.styleAttributeService.registerStyleAttribute({name:"total_distance",type:u.AttributeType.Attribute,descriptor:{name:"a_Total_Distance",buffer:{usage:u.gl.STATIC_DRAW,data:[],type:u.gl.FLOAT},size:1,update:function(t,e,r,n){return[r[5]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:u.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:u.gl.DYNAMIC_DRAW,data:[],type:u.gl.FLOAT},size:2,update:function(t,e,r,n){var i=t.size,o=void 0===i?1:i;return Array.isArray(o)?[o[0],o[1]]:[o,0]}}}),this.styleAttributeService.registerStyleAttribute({name:"normal",type:u.AttributeType.Attribute,descriptor:{name:"a_Normal",buffer:{usage:u.gl.STATIC_DRAW,data:[],type:u.gl.FLOAT},size:3,update:function(t,e,r,n,i){return i}}}),this.styleAttributeService.registerStyleAttribute({name:"miter",type:u.AttributeType.Attribute,descriptor:{name:"a_Miter",buffer:{usage:u.gl.STATIC_DRAW,data:[],type:u.gl.FLOAT},size:1,update:function(t,e,r,n){return[r[4]]}}})}}]),r}(ut)};function se(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=v()(t);if(e){var i=v()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var ue=function(t){f()(r,t);var e=se(r);function r(){var t;l()(this,r);for(var n=arguments.length,i=new Array(n),o=0;o=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function be(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rthis.width||n<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s0:a}},{key:"queryCell",value:function(t,e,r,n,i,o,a,s){var u=a.seenUids,c=this.boxCells[i];if(null!==c){var l,h=this.bboxes,p=_e(c);try{for(p.s();!(l=p.n()).done;){var d=l.value;if(!u.box[d]){u.box[d]=!0;var f=4*d;if(t<=h[f+2]&&e<=h[f+3]&&r>=h[f+0]&&n>=h[f+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[d],x1:h[f],y1:h[f+1],x2:h[f+2],y2:h[f+3]})}}}}catch(t){p.e(t)}finally{p.f()}}return!1}},{key:"forEachCell",value:function(t,e,r,n,i,o,a,s){for(var u=this.convertToXCellCoord(t),c=this.convertToYCellCoord(e),l=this.convertToXCellCoord(r),h=this.convertToYCellCoord(n),p=u;p<=l;p++)for(var d=c;d<=h;d++){var f=this.xCellCount*d+p;if(i.call(this,t,e,r,n,f,o,a,s))return}}},{key:"convertToXCellCoord",value:function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}},{key:"convertToYCellCoord",value:function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}}]),t}(),we=function(){function t(e,r){l()(this,t),this.width=void 0,this.height=void 0,this.grid=void 0,this.viewportPadding=100,this.screenRightBoundary=void 0,this.screenBottomBoundary=void 0,this.gridRightBoundary=void 0,this.gridBottomBoundary=void 0,this.width=e,this.height=r,this.viewportPadding=Math.max(e,r),this.grid=new xe(e+this.viewportPadding,r+this.viewportPadding,25),this.screenRightBoundary=e+this.viewportPadding,this.screenBottomBoundary=r+this.viewportPadding,this.gridRightBoundary=e+2*this.viewportPadding,this.gridBottomBoundary=r+2*this.viewportPadding}return p()(t,[{key:"placeCollisionBox",value:function(t){var e=t.x1+t.anchorPointX+this.viewportPadding,r=t.y1+t.anchorPointY+this.viewportPadding,n=t.x2+t.anchorPointX+this.viewportPadding,i=t.y2+t.anchorPointY+this.viewportPadding;return!this.isInsideGrid(e,r,n,i)||this.grid.hitTest(e,r,n,i)?{box:[]}:{box:[e,r,n,i]}}},{key:"insertCollisionBox",value:function(t,e){var r={featureIndex:e};this.grid.insert(r,t[0],t[1],t[2],t[3])}},{key:"project",value:function(t,e,r){var n=gt.d.fromValues(e,r,0,1),i=gt.d.create(),o=gt.a.fromValues.apply(gt.a,pt()(t));return gt.d.transformMat4(i,n,o),{x:(i[0]/i[3]+1)/2*this.width+this.viewportPadding,y:(-i[1]/i[3]+1)/2*this.height+this.viewportPadding}}},{key:"isInsideGrid",value:function(t,e,r,n){return r>=0&&t=0&&e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Ee(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Se(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1||!i)||e!==this.preTextStyle.textAllowOverlap)&&(this.reBuildModel(),!0)}},{key:"clearModels",value:function(){this.layer.off("remapping",this.buildModels)}},{key:"registerBuiltinAttributes",value:function(){this.styleAttributeService.registerStyleAttribute({name:"rotate",type:u.AttributeType.Attribute,descriptor:{name:"a_Rotate",buffer:{usage:u.gl.DYNAMIC_DRAW,data:[],type:u.gl.FLOAT},size:1,update:function(t,e,r,n){var i=t.rotate,o=void 0===i?0:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"textOffsets",type:u.AttributeType.Attribute,descriptor:{name:"a_textOffsets",buffer:{usage:u.gl.STATIC_DRAW,data:[],type:u.gl.FLOAT},size:2,update:function(t,e,r,n){return[r[5],r[6]]}}}),this.styleAttributeService.registerStyleAttribute({name:"size",type:u.AttributeType.Attribute,descriptor:{name:"a_Size",buffer:{usage:u.gl.DYNAMIC_DRAW,data:[],type:u.gl.FLOAT},size:1,update:function(t,e,r,n){var i=t.size,o=void 0===i?12:i;return Array.isArray(o)?[o[0]]:[o]}}}),this.styleAttributeService.registerStyleAttribute({name:"textUv",type:u.AttributeType.Attribute,descriptor:{name:"a_tex",buffer:{usage:u.gl.DYNAMIC_DRAW,data:[],type:u.gl.FLOAT},size:2,update:function(t,e,r,n){return[r[3],r[4]]}}})}},{key:"textExtent",value:function(){var t=this.mapService.getBounds();return Object(R.q)(t,.5)}},{key:"initTextFont",value:function(){var t=this.layer.getLayerConfig(),e=t.fontWeight,r=void 0===e?"400":e,n=t.fontFamily,i=void 0===n?"sans-serif":n,o=this.layer.getEncodedData(),a=[];o.forEach((function(t){var e,r=t.shape,n=void 0===r?"":r,i=Me(n=n.toString());try{for(i.s();!(e=i.n()).done;){var o=e.value;-1===a.indexOf(o)&&a.push(o)}}catch(t){i.e(t)}finally{i.f()}})),this.fontService.setFontOptions({characterSet:a,fontWeight:r,fontFamily:i})}},{key:"generateGlyphLayout",value:function(){var t=this,e=this.fontService.mapping,r=this.layer.getLayerConfig(),n=r.spacing,i=void 0===n?2:n,o=r.textAnchor,a=void 0===o?"center":o,s=r.textOffset,u=this.layer.getEncodedData();this.glyphInfo=u.map((function(r){var n=r.shape,o=void 0===n?"":n,u=r.coordinates,c=r.id,l=r.size,h=void 0===l?1:l,p=function(t,e,r,n,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[0,0],s=t.split("\n"),u=[],c={positionedGlyphs:u,top:a[1],bottom:a[1],left:a[0],right:a[0],lineCount:s.length,text:t};return Ie(c,e,s,r,n,i,o),!!u.length&&c}(o.toString(),e,h,a,"center",i,s),d=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0],n=arguments.length>2?arguments[2]:void 0,i=t.positionedGlyphs,o=void 0===i?[]:i,a=[],s=Ce(o);try{for(s.s();!(e=s.n()).done;){var u=e.value,c=u.metrics,l=4,h=c.advance*u.scale/2,p=n?[u.x+h,u.y]:[0,0],d=n?[0,0]:[u.x+h+r[0],u.y+r[1]],f=(0-l)*u.scale-h+d[0],g=(0-l)*u.scale+d[1],m=f+c.width*u.scale,y=g+c.height*u.scale,v={x:f,y:g},A={x:m,y:g},_={x:f,y:y},b={x:m,y:y};a.push({tl:v,tr:A,bl:_,br:b,tex:c,glyphOffset:p})}}catch(t){s.e(t)}finally{s.f()}return a}(p,s,!1);return r.shaping=p,r.glyphQuads=d,r.centroid=St(u),t.glyphInfoMap[c]={shaping:p,glyphQuads:d,centroid:St(u)},r}))}},{key:"filterGlyphs",value:function(){var t=this,e=this.layer.getLayerConfig(),r=e.padding,n=void 0===r?[4,4]:r,i=e.textAllowOverlap;if(!(void 0!==i&&i)){this.glyphInfoMap={},this.currentZoom=this.mapService.getZoom(),this.extent=this.textExtent();var o=this.rendererService.getViewportSize(),a=o.width,s=o.height,u=new we(a,s);this.glyphInfo.filter((function(e){var r=e.shaping,i=e.id,o=void 0===i?0:i,a=e.centroid,s=e.size/24,c=t.mapService.lngLatToContainer(a),l=u.placeCollisionBox({x1:r.left*s-n[0],x2:r.right*s+n[0],y1:r.top*s-n[1],y2:r.bottom*s+n[1],anchorPointX:c.x,anchorPointY:c.y}).box;return!(!l||!l.length)&&(u.insertCollisionBox(l,o),!0)})).forEach((function(e){t.glyphInfoMap[e.id]=e}))}}},{key:"initGlyph",value:function(){this.initTextFont(),this.generateGlyphLayout()}},{key:"updateTexture",value:function(){var t=this.rendererService.createTexture2D,e=this.fontService.canvas;this.textureHeight=e.height,this.texture&&this.texture.destroy(),this.texture=t({data:e,mag:u.gl.LINEAR,min:u.gl.LINEAR,width:e.width,height:e.height})}},{key:"reBuildModel",value:function(){this.filterGlyphs(),this.layer.models=[this.layer.buildLayerModel({moduleName:"pointText",vertexShader:Oe,fragmentShader:Pe,triangulation:Le.bind(this),depth:{enable:!1},blend:this.getBlend()})]}}]),r}(ut),icon:fe};function Re(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=v()(t);if(e){var i=v()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return m()(this,r)}}var De,Be,Ne,Fe,je,ze,Ue,Ge=function(t){f()(r,t);var e=Re(r);function r(){var t;l()(this,r);for(var n=arguments.length,i=new Array(n),o=0;o1&&s>o)&&(e.updateClusterData(Math.floor(u)),!0)}}]),t}())||Ve,Ye=r(272),Xe=r.n(Ye),Ze=r(91),Ke=r.n(Ze),Je=r(116),$e=r.n(Je),tr=r(45);function er(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function rr(){}function nr(t,e){var r=new rr;if(t instanceof rr)t.each((function(t,e){r.set(e,t)}));else if(Array.isArray(t)){var n,i=-1,o=t.length;if(null==e)for(;++i=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],a=n>0?t[n-1]:2*i-o,s=no&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,u.push({i:a,x:Er(r,n)})),o=Sr.lastIndex;return on&&(e=r,r=n,n=e),function(t){return Math.max(r,Math.min(n,t))}}function Nr(t,e,r){var n=t[0],i=t[1],o=e[0],a=e[1];return i2?Fr:Nr,i=o=null,h}function h(e){return isNaN(e=+e)?r:(i||(i=n(a.map(t),s,u)))(t(c(e)))}return h.invert=function(r){return c(e((o||(o=n(s,a.map(t),Er)))(r)))},h.domain=function(t){return arguments.length?(a=cr.call(t,Lr),c===Rr||(c=Br(a)),l()):a.slice()},h.range=function(t){return arguments.length?(s=lr.call(t),l()):s.slice()},h.rangeRound=function(t){return s=lr.call(t),u=Or,l()},h.clamp=function(t){return arguments.length?(c=t?Br(a):Rr,h):c!==Rr},h.interpolate=function(t){return arguments.length?(u=t,l()):u},h.unknown=function(t){return arguments.length?(r=t,h):r},function(r,n){return t=r,e=n,l()}}function Ur(t,e){return zr()(t,e)}var Gr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hr(t){if(!(e=Gr.exec(t)))throw new Error("invalid format: "+t);var e;return new Vr({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Vr(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}Hr.prototype=Vr.prototype,Vr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};function Qr(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}var qr,Wr,Yr,Xr,Zr=function(t){return(t=Qr(Math.abs(t)))?t[1]:NaN},Kr=function(t,e){var r=Qr(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")},Jr={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Kr(100*t,e)},r:Kr,s:function(t,e){var r=Qr(t,e);if(!r)return t+"";var n=r[0],i=r[1],o=i-(qr=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=n.length;return o===a?n:o>a?n+new Array(o-a+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Qr(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},$r=function(t){return t},tn=Array.prototype.map,en=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];Wr=function(t){var e,r,n=void 0===t.grouping||void 0===t.thousands?$r:(e=tn.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var i=t.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),o.push(t.substring(i-=s,i+s)),!((u+=s+1)>n));)s=e[a=(a+1)%e.length];return o.reverse().join(r)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?$r:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(tn.call(t.numerals,String)),u=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"-":t.minus+"",l=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=Hr(t)).fill,r=t.align,h=t.sign,p=t.symbol,d=t.zero,f=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):Jr[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===r)&&(d=!0,e="0",r="=");var A="$"===p?i:"#"===p&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",_="$"===p?o:/[%p]/.test(v)?u:"",b=Jr[v],x=/[defgprs%]/.test(v);function w(t){var i,o,u,p=A,w=_;if("c"===v)w=b(t)+w,t="";else{var C=(t=+t)<0||1/t<0;if(t=isNaN(t)?l:b(Math.abs(t),m),y&&(t=function(t){t:for(var e,r=t.length,n=1,i=-1;n0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),C&&0==+t&&"+"!==h&&(C=!1),p=(C?"("===h?h:c:"-"===h||"("===h?"":h)+p,w=("s"===v?en[8+qr/3]:"")+w+(C&&"("===h?")":""),x)for(i=-1,o=t.length;++i(u=t.charCodeAt(i))||u>57){w=(46===u?a+t.slice(i+1):t.slice(i))+w,t=t.slice(0,i);break}}g&&!d&&(t=n(t,1/0));var E=p.length+t.length+w.length,I=E>1)+p+t+w+I.slice(E);break;default:t=I+p+t+w}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),w.toString=function(){return t+""},w}return{format:h,formatPrefix:function(t,e){var r=h(((t=Hr(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor(Zr(e)/3))),i=Math.pow(10,-n),o=en[8+n/3];return function(t){return r(i*t)+o}}}}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),Yr=Wr.format,Xr=Wr.formatPrefix;var rn=function(t,e,r,n){var i,o=Object(tr.i)(t,e,r);switch((n=Hr(null==n?",f":n)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=n.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Zr(e)/3)))-Zr(Math.abs(t)))}(o,a))||(n.precision=i),Xr(n,a);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Zr(e)-Zr(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(n.precision=i-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(i=function(t){return Math.max(0,-Zr(Math.abs(t)))}(o))||(n.precision=i-2*("%"===n.type))}return Yr(n)};function nn(t){var e=t.domain;return t.ticks=function(t){var r=e();return Object(tr.j)(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,r){var n=e();return rn(n[0],n[n.length-1],null==t?10:t,r)},t.nice=function(r){null==r&&(r=10);var n,i=e(),o=0,a=i.length-1,s=i[o],u=i[a];return u0?(s=Math.floor(s/n)*n,u=Math.ceil(u/n)*n,n=Object(tr.h)(s,u,r)):n<0&&(s=Math.ceil(s*n)/n,u=Math.floor(u*n)/n,n=Object(tr.h)(s,u,r)),n>0?(i[o]=Math.floor(s/n)*n,i[a]=Math.ceil(u/n)*n,e(i)):n<0&&(i[o]=Math.ceil(s*n)/n,i[a]=Math.floor(u*n)/n,e(i)),t},t}var on=function(t,e){var r,n=0,i=(t=t.slice()).length-1,o=t[n],a=t[i];return a0){for(;pu)break;g.push(h)}}else for(;p=1;--l)if(!((h=c*l)u)break;g.push(h)}}else g=Object(tr.j)(p,d,Math.min(d-p,f)).map(r);return n?g.reverse():g},n.tickFormat=function(t,i){if(null==i&&(i=10===o?".0e":","),"function"!=typeof i&&(i=Yr(i)),t===1/0)return i;null==t&&(t=10);var a=Math.max(1,o*t/n.ticks().length);return function(t){var n=t/r(Math.round(e(t)));return n*o0))return s;do{s.push(a=new Date(+r)),e(r,o),t(r)}while(a=e)for(;t(e),!r(e);)e.setTime(e-1)}),(function(t,n){if(t>=t)if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}))},r&&(i.count=function(e,n){return vn.setTime(+e),An.setTime(+n),t(vn),t(An),Math.floor(r(vn,An))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(n?function(e){return n(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var bn=_n((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));bn.every=function(t){return isFinite(t=Math.floor(t))&&t>0?_n((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,r){e.setFullYear(e.getFullYear()+r*t)})):null};var xn=bn,wn=(bn.range,_n((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()}))),Cn=wn;wn.range;function En(t){return _n((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/6048e5}))}var In=En(0),Mn=En(1),Sn=En(2),Tn=En(3),Pn=En(4),On=En(5),Ln=En(6),kn=(In.range,Mn.range,Sn.range,Tn.range,Pn.range,On.range,Ln.range,_n((function(t){t.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5}),(function(t){return t.getDate()-1}))),Rn=kn,Dn=(kn.range,_n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())}),(function(t,e){t.setTime(+t+36e5*e)}),(function(t,e){return(e-t)/36e5}),(function(t){return t.getHours()}))),Bn=Dn,Nn=(Dn.range,_n((function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())}),(function(t,e){t.setTime(+t+6e4*e)}),(function(t,e){return(e-t)/6e4}),(function(t){return t.getMinutes()}))),Fn=Nn,jn=(Nn.range,_n((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+1e3*e)}),(function(t,e){return(e-t)/1e3}),(function(t){return t.getUTCSeconds()}))),zn=jn,Un=(jn.range,_n((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t})));Un.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?_n((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,r){e.setTime(+e+r*t)}),(function(e,r){return(r-e)/t})):Un:null};var Gn=Un;Un.range;function Hn(t){return _n((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/6048e5}))}var Vn=Hn(0),Qn=Hn(1),qn=Hn(2),Wn=Hn(3),Yn=Hn(4),Xn=Hn(5),Zn=Hn(6),Kn=(Vn.range,Qn.range,qn.range,Wn.range,Yn.range,Xn.range,Zn.range,_n((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/864e5}),(function(t){return t.getUTCDate()-1}))),Jn=Kn,$n=(Kn.range,_n((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()})));$n.every=function(t){return isFinite(t=Math.floor(t))&&t>0?_n((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,r){e.setUTCFullYear(e.getUTCFullYear()+r*t)})):null};var ti=$n;$n.range;function ei(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ri(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ni(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}var ii,oi,ai={"-":"",_:" ",0:"0"},si=/^\s*\d+/,ui=/^%/,ci=/[\\^$*+?|[\]().{}]/g;function li(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",o=i.length;return n+(o68?1900:2e3),r+n[0].length):-1}function bi(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function xi(t,e,r){var n=si.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function wi(t,e,r){var n=si.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Ci(t,e,r){var n=si.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ei(t,e,r){var n=si.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Ii(t,e,r){var n=si.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Mi(t,e,r){var n=si.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Si(t,e,r){var n=si.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Ti(t,e,r){var n=si.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Pi(t,e,r){var n=si.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Oi(t,e,r){var n=ui.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Li(t,e,r){var n=si.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function ki(t,e,r){var n=si.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Ri(t,e){return li(t.getDate(),e,2)}function Di(t,e){return li(t.getHours(),e,2)}function Bi(t,e){return li(t.getHours()%12||12,e,2)}function Ni(t,e){return li(1+Rn.count(xn(t),t),e,3)}function Fi(t,e){return li(t.getMilliseconds(),e,3)}function ji(t,e){return Fi(t,e)+"000"}function zi(t,e){return li(t.getMonth()+1,e,2)}function Ui(t,e){return li(t.getMinutes(),e,2)}function Gi(t,e){return li(t.getSeconds(),e,2)}function Hi(t){var e=t.getDay();return 0===e?7:e}function Vi(t,e){return li(In.count(xn(t)-1,t),e,2)}function Qi(t){var e=t.getDay();return e>=4||0===e?Pn(t):Pn.ceil(t)}function qi(t,e){return t=Qi(t),li(Pn.count(xn(t),t)+(4===xn(t).getDay()),e,2)}function Wi(t){return t.getDay()}function Yi(t,e){return li(Mn.count(xn(t)-1,t),e,2)}function Xi(t,e){return li(t.getFullYear()%100,e,2)}function Zi(t,e){return li((t=Qi(t)).getFullYear()%100,e,2)}function Ki(t,e){return li(t.getFullYear()%1e4,e,4)}function Ji(t,e){var r=t.getDay();return li((t=r>=4||0===r?Pn(t):Pn.ceil(t)).getFullYear()%1e4,e,4)}function $i(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+li(e/60|0,"0",2)+li(e%60,"0",2)}function to(t,e){return li(t.getUTCDate(),e,2)}function eo(t,e){return li(t.getUTCHours(),e,2)}function ro(t,e){return li(t.getUTCHours()%12||12,e,2)}function no(t,e){return li(1+Jn.count(ti(t),t),e,3)}function io(t,e){return li(t.getUTCMilliseconds(),e,3)}function oo(t,e){return io(t,e)+"000"}function ao(t,e){return li(t.getUTCMonth()+1,e,2)}function so(t,e){return li(t.getUTCMinutes(),e,2)}function uo(t,e){return li(t.getUTCSeconds(),e,2)}function co(t){var e=t.getUTCDay();return 0===e?7:e}function lo(t,e){return li(Vn.count(ti(t)-1,t),e,2)}function ho(t){var e=t.getUTCDay();return e>=4||0===e?Yn(t):Yn.ceil(t)}function po(t,e){return t=ho(t),li(Yn.count(ti(t),t)+(4===ti(t).getUTCDay()),e,2)}function fo(t){return t.getUTCDay()}function go(t,e){return li(Qn.count(ti(t)-1,t),e,2)}function mo(t,e){return li(t.getUTCFullYear()%100,e,2)}function yo(t,e){return li((t=ho(t)).getUTCFullYear()%100,e,2)}function vo(t,e){return li(t.getUTCFullYear()%1e4,e,4)}function Ao(t,e){var r=t.getUTCDay();return li((t=r>=4||0===r?Yn(t):Yn.ceil(t)).getUTCFullYear()%1e4,e,4)}function _o(){return"+0000"}function bo(){return"%"}function xo(t){return+t}function wo(t){return Math.floor(+t/1e3)}!function(t){ii=function(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,o=t.days,a=t.shortDays,s=t.months,u=t.shortMonths,c=pi(i),l=di(i),h=pi(o),p=di(o),d=pi(a),f=di(a),g=pi(s),m=di(s),y=pi(u),v=di(u),A={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Ri,e:Ri,f:ji,g:Zi,G:Ji,H:Di,I:Bi,j:Ni,L:Fi,m:zi,M:Ui,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:xo,s:wo,S:Gi,u:Hi,U:Vi,V:qi,w:Wi,W:Yi,x:null,X:null,y:Xi,Y:Ki,Z:$i,"%":bo},_={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return u[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:to,e:to,f:oo,g:yo,G:Ao,H:eo,I:ro,j:no,L:io,m:ao,M:so,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:xo,s:wo,S:uo,u:co,U:lo,V:po,w:fo,W:go,x:null,X:null,y:mo,Y:vo,Z:_o,"%":bo},b={a:function(t,e,r){var n=d.exec(e.slice(r));return n?(t.w=f[n[0].toLowerCase()],r+n[0].length):-1},A:function(t,e,r){var n=h.exec(e.slice(r));return n?(t.w=p[n[0].toLowerCase()],r+n[0].length):-1},b:function(t,e,r){var n=y.exec(e.slice(r));return n?(t.m=v[n[0].toLowerCase()],r+n[0].length):-1},B:function(t,e,r){var n=g.exec(e.slice(r));return n?(t.m=m[n[0].toLowerCase()],r+n[0].length):-1},c:function(t,r,n){return C(t,e,r,n)},d:Ci,e:Ci,f:Pi,g:_i,G:Ai,H:Ii,I:Ii,j:Ei,L:Ti,m:wi,M:Mi,p:function(t,e,r){var n=c.exec(e.slice(r));return n?(t.p=l[n[0].toLowerCase()],r+n[0].length):-1},q:xi,Q:Li,s:ki,S:Si,u:gi,U:mi,V:yi,w:fi,W:vi,x:function(t,e,n){return C(t,r,e,n)},X:function(t,e,r){return C(t,n,e,r)},y:_i,Y:Ai,Z:bi,"%":Oi};function x(t,e){return function(r){var n,i,o,a=[],s=-1,u=0,c=t.length;for(r instanceof Date||(r=new Date(+r));++s53)return null;"w"in o||(o.w=1),"Z"in o?(i=(n=ri(ni(o.y,0,1))).getUTCDay(),n=i>4||0===i?Qn.ceil(n):Qn(n),n=Jn.offset(n,7*(o.V-1)),o.y=n.getUTCFullYear(),o.m=n.getUTCMonth(),o.d=n.getUTCDate()+(o.w+6)%7):(i=(n=ei(ni(o.y,0,1))).getDay(),n=i>4||0===i?Mn.ceil(n):Mn(n),n=Rn.offset(n,7*(o.V-1)),o.y=n.getFullYear(),o.m=n.getMonth(),o.d=n.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?ri(ni(o.y,0,1)).getUTCDay():ei(ni(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,ri(o)):ei(o)}}function C(t,e,r,n){for(var i,o,a=0,s=e.length,u=r.length;a=u)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=b[i in ai?e.charAt(a++):i])||(n=o(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return A.x=x(r,A),A.X=x(n,A),A.c=x(e,A),_.x=x(r,_),_.X=x(n,_),_.c=x(e,_),{format:function(t){var e=x(t+="",A);return e.toString=function(){return t},e},parse:function(t){var e=w(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=x(t+="",_);return e.toString=function(){return t},e},utcParse:function(t){var e=w(t+="",!0);return e.toString=function(){return t},e}}}(t),oi=ii.format,ii.parse,ii.utcFormat,ii.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Co(t){return new Date(t)}function Eo(t){return t instanceof Date?+t:+new Date(+t)}function Io(t,e,r,n,i,o,a,s,u){var c=Ur(Rr,Rr),l=c.invert,h=c.domain,p=u(".%L"),d=u(":%S"),f=u("%I:%M"),g=u("%I %p"),m=u("%a %d"),y=u("%b %d"),v=u("%B"),A=u("%Y"),_=[[a,1,1e3],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,6e4],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,36e5],[i,3,108e5],[i,6,216e5],[i,12,432e5],[n,1,864e5],[n,2,1728e5],[r,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function b(s){return(a(s)0?i[e-1]:r[0],e=i?[o[i-1],n]:[o[e-1],o[e]]},s.unknown=function(t){return arguments.length?(e=t,s):s},s.thresholds=function(){return o.slice()},s.copy=function(){return t().domain([r,n]).range(a).unknown(e)},er.apply(nn(s),arguments)})),x()(Mo,u.ScaleTypes.THRESHOLD,(function t(){var e,r=[.5],n=[0,1],i=1;function o(t){return t<=t?n[Object(tr.b)(r,t,0,i)]:e}return o.domain=function(t){return arguments.length?(r=lr.call(t),i=Math.min(r.length,n.length-1),o):r.slice()},o.range=function(t){return arguments.length?(n=lr.call(t),i=Math.min(r.length,n.length-1),o):n.slice()},o.invertExtent=function(t){var e=n.indexOf(t);return[r[e-1],r[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(r).range(n).unknown(e)},er.apply(o,arguments)})),x()(Mo,u.ScaleTypes.CAT,pr),Mo),Wo=(So=Object(F.injectable)(),To=Object(F.inject)(u.TYPES.IGlobalConfigService),Po=Object(F.inject)(u.TYPES.ILogService),So((Lo=function(){function t(){l()(this,t),C()(this,"configService",ko,this),C()(this,"logger",Ro,this),this.scaleCache={},this.scaleOptions={}}return p()(t,[{key:"apply",value:function(t,e){var r=this,n=e.styleAttributeService;t.hooks.init.tap("FeatureScalePlugin",(function(){r.scaleOptions=t.getScaleOptions();var e=n.getLayerStyleAttributes(),i=t.getSource().data.dataArray;0!==i.length&&r.caculateScalesForAttributes(e||[],i)})),t.hooks.beforeRenderData.tap("FeatureScalePlugin",(function(){r.scaleOptions=t.getScaleOptions();var e=n.getLayerStyleAttributes(),i=t.getSource().data.dataArray;return r.caculateScalesForAttributes(e||[],i),t.layerModelNeedUpdate=!0,!0})),t.hooks.beforeRender.tap("FeatureScalePlugin",(function(){if(!t.layerModelNeedUpdate){r.scaleOptions=t.getScaleOptions();var e=n.getLayerStyleAttributes();if(e){var i=t.getSource().data.dataArray;if(0===i.length)return;var o=e.filter((function(t){return t.needRescale}));o.length&&(r.caculateScalesForAttributes(o,i),r.logger.debug("rescale finished"))}}}))}},{key:"isNumber",value:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},{key:"caculateScalesForAttributes",value:function(t,e){var r=this;this.scaleCache={},t.forEach((function(t){if(t.scale){var n=t.scale,i=t.name;n.names=r.parseFields(t.scale.field||[]);var o=[];n.names.forEach((function(n){o.push(r.getOrCreateScale(n,t,e))})),o.some((function(t){return t.type===u.StyleScaleType.VARIABLE}))?(n.type=u.StyleScaleType.VARIABLE,o.forEach((function(t){var e;if(!n.callback)if(n.values&&"text"!==n.values){var r;if("linear"===(null===(r=t.option)||void 0===r?void 0:r.type)&&n.values.length>2){var o=t.scale.ticks(n.values.length);"color"===i&&t.scale.domain(o)}t.scale.range(n.values)}else"cat"===(null===(e=t.option)||void 0===e?void 0:e.type)&&t.scale.range(t.option.domain)}))):(n.type=u.StyleScaleType.CONSTANT,n.defaultValues=o.map((function(t,e){return t.scale(n.names[e])}))),n.scalers=o.map((function(t){return{field:t.field,func:t.scale,option:t.option}})),t.needRescale=!1}}))}},{key:"getOrCreateScale",value:function(t,e,r){[t,e.name].join("_");var n,i=null===(n=e.scale)||void 0===n?void 0:n.values;return this.createScale(t,e.name,i,r)}},{key:"parseFields",value:function(t){return Array.isArray(t)?t:Ke()(t)?t.split("*"):[t]}},{key:"createScale",value:function(t,e,r,n){var i,o=this.scaleOptions[e]&&this.scaleOptions[e].field===t?this.scaleOptions[e]:this.scaleOptions[t],a={field:t,scale:void 0,type:u.StyleScaleType.VARIABLE,option:o};if(!n||!n.length)return o&&o.type?a.scale=this.createDefaultScale(o):(a.scale=pr([t]),a.type=u.StyleScaleType.CONSTANT),a;var s=null===(i=n.find((function(e){return!$e()(e[t])})))||void 0===i?void 0:i[t];if(this.isNumber(t)||$e()(s)&&!o)a.scale=pr([t]),a.type=u.StyleScaleType.CONSTANT;else{var c=o&&o.type||this.getDefaultType(s);"text"===r&&(c=u.ScaleTypes.CAT);var l=this.createDefaultScaleConfig(c,t,n);Object.assign(l,o),a.scale=this.createDefaultScale(l),a.option=l}return a}},{key:"getDefaultType",value:function(t){var e=u.ScaleTypes.LINEAR;return"string"==typeof t&&(e=Qo.test(t)?u.ScaleTypes.TIME:u.ScaleTypes.CAT),e}},{key:"createDefaultScaleConfig",value:function(t,e,r){var n={type:t},i=(null==r?void 0:r.map((function(t){return t[e]})))||[];return t!==u.ScaleTypes.CAT&&t!==u.ScaleTypes.QUANTILE?n.domain=Object(tr.d)(i):t===u.ScaleTypes.CAT?n.domain=Xe()(i):t===u.ScaleTypes.QUANTILE&&(n.domain=i),n}},{key:"createDefaultScale",value:function(t){var e=t.type,r=t.domain,n=qo[e]();return r&&n.domain(r),n}}]),t}(),ko=S()(Lo.prototype,"configService",[To],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ro=S()(Lo.prototype,"logger",[Po],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Oo=Lo))||Oo);function Yo(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Xo,Zo,Ko,Jo=(Fo=Object(F.injectable)(),jo=Object(F.inject)(u.TYPES.ICameraService),zo=Object(F.inject)(u.TYPES.IRendererService),Fo((Go=function(){function t(){l()(this,t),C()(this,"cameraService",Ho,this),C()(this,"rendererService",Vo,this)}return p()(t,[{key:"apply",value:function(t){t.hooks.beforeRender.tap("LayerAnimateStylePlugin",(function(){t.models.forEach((function(e){e.addUniforms(function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.texture(t)}},{key:"bind",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(t){var e=t.width,r=t.height;this.texture.resize(e,r),this.width=e,this.height=r}},{key:"destroy",value:function(){this.texture.destroy()}}]),t}(),st=Object(T.injectable)()(it=function(){function t(){var e=this;_()(this,t),this.gl=void 0,this.$container=void 0,this.canvas=void 0,this.width=void 0,this.height=void 0,this.isDirty=void 0,this.createModel=function(t){return new ot(e.gl,t)},this.createAttribute=function(t){return new L(e.gl,t)},this.createBuffer=function(t){return new W(e.gl,t)},this.createElements=function(t){return new Y(e.gl,t)},this.createTexture2D=function(t){return new at(e.gl,t)},this.createFramebuffer=function(t){return new X(e.gl,t)},this.useFramebuffer=function(t,r){e.gl({framebuffer:t?t.get():null})(r)},this.clear=function(t){var r=t.color,n=t.depth,i=t.stencil,o=t.framebuffer,a=void 0===o?null:o,s={color:r,depth:n,stencil:i};s.framebuffer=null===a?a:a.get(),e.gl.clear(s)},this.viewport=function(t){var r=t.x,n=t.y,i=t.width,o=t.height;e.gl._gl.viewport(r,n,i,o),e.width=i,e.height=o,e.gl._refresh()},this.readPixels=function(t){var r=t.framebuffer,n={x:t.x,y:t.y,width:t.width,height:t.height};return r&&(n.framebuffer=r.get()),e.gl.read(n)},this.getViewportSize=function(){return{width:e.gl._gl.drawingBufferWidth,height:e.gl._gl.drawingBufferHeight}},this.getContainer=function(){var t;return null===(t=e.canvas)||void 0===t?void 0:t.parentElement},this.getCanvas=function(){return e.canvas},this.getGLContext=function(){return e.gl._gl},this.destroy=function(){e.gl.destroy()}}var e;return x()(t,[{key:"init",value:(e=I()(S.a.mark((function t(e,r){var n=this;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.canvas=e,t.next=3,new Promise((function(t,e){O()({canvas:n.canvas,attributes:{alpha:!0,antialias:r.antialias,premultipliedAlpha:!0,preserveDrawingBuffer:r.preserveDrawingBuffer},extensions:["OES_element_index_uint","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["oes_texture_float_linear","OES_texture_float","EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(r,n){!r&&n||e(r),t(n)}})}));case 3:this.gl=t.sent;case 4:case"end":return t.stop()}}),t,this)}))),function(t,r){return e.apply(this,arguments)})},{key:"setBaseState",value:function(){this.gl({cull:{enable:!1,face:"back"},viewport:{x:0,y:0,height:this.width,width:this.height},blend:{enable:!1,equation:"add"},framebuffer:null}),this.gl._refresh()}},{key:"setCustomLayerDefaults",value:function(){var t=this.getGLContext();t.disable(t.CULL_FACE)}},{key:"setDirty",value:function(t){this.isDirty=t}},{key:"getDirty",value:function(){return this.isDirty}}]),t}())||it,ut=r(15);function ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function lt(t){for(var e=1;e180?-360:n[0]-i[0]>180?360:0;var o=function(t,e,r){var n=r=void 0===r?m.earthRadius:Number(r),i=t[1]*Math.PI/180,o=e[1]*Math.PI/180,a=o-i,s=Math.abs(e[0]-t[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=Math.abs(u)>1e-11?a/u:Math.cos(i);return Math.sqrt(a*a+c*c*s*s)*n}(n,i);return Object(m.convertLength)(o,"meters",r.units)};function _(t,e){return t[0]*e[0]+t[1]*e[1]}function b(t,e,r){return"planar"===r.method?A(t,e,r):Object(g.a)(t,e,r)}var x,w=function(t,e,r){if(void 0===r&&(r={}),r.method||(r.method="geodesic"),r.units||(r.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=Object(m.point)(t):"Point"===t.type?t=Object(m.feature)(t):Object(y.a)(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=Object(m.lineString)(e):"LineString"===e.type?e=Object(m.feature)(e):Object(y.a)(e,"LineString","line");var n=1/0,i=t.geometry.coordinates;return Object(v.segmentEach)(e,(function(t){var e=t.geometry.coordinates[0],o=t.geometry.coordinates[1],a=function(t,e,r,n){var i=[r[0]-e[0],r[1]-e[1]],o=_([t[0]-e[0],t[1]-e[1]],i);if(o<=0)return b(t,e,{method:n.method,units:"degrees"});var a=_(i,i);if(a<=o)return b(t,r,{method:n.method,units:"degrees"});var s=o/a,u=[e[0]+s*i[0],e[1]+s*i[1]];return b(t,u,{method:n.method,units:"degrees"})}(i,e,o,r);a2?-1:+n[0][0]}L.fireUpdate=function(){this.map.fire(u.g.events.UPDATE,{action:u.g.updateActions.CHANGE_COORDINATES,features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},L.fireActionable=function(t){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:t.selectedCoordPaths.length>0})},L.startDragging=function(t,e){var r=t.feature.properties._type_;if(this.map.dragPan.disable(),t.canDragMove=!0,t.dragMoveLocation=e.lngLat,"Rectangle"===r){if(t.editableInit){var n=e.featureTarget.properties;t.selectedCoordPaths=[n.coord_path]}if(!t.selectedCoordPaths[0])return;var i=+t.selectedCoordPaths[0].split(".")[1],o=i>=2?i-2:i+2;t.feature.onePoint=t.feature.coordinates[0][o]}},L.stopDragging=function(t){this.map.dragPan.enable();t.feature;t.dragMoving=!1,t.canDragMove=!1,t.dragMoveLocation=null},L.onVertex=function(t,e){this.startDragging(t,e);var r=e.featureTarget.properties,n=t.selectedCoordPaths.indexOf(r.coord_path);M(e)||-1!==n?M(e)&&-1===n&&t.selectedCoordPaths.push(r.coord_path):t.selectedCoordPaths=[r.coord_path];var i=this.pathsToCoordinates(t.featureId,t.selectedCoordPaths);this.setSelectedCoordinates(i)},L.onMidpoint=function(t,e){var r=t.feature.properties._type_;if(r!==P.RECTANGLE&&r!==P.TRIANGLE&&r!=P.SECTOR){this.startDragging(t,e);var n=e.featureTarget.properties;t.feature.addCoordinate(n.coord_path,n.lng,n.lat),this.fireUpdate(),t.selectedCoordPaths=[n.coord_path]}},L.pathsToCoordinates=function(t,e){return e.map((function(e){return{feature_id:t,coord_path:e}}))},L.onFeature=function(t,e){0===t.selectedCoordPaths.length?this.startDragging(t,e):this.stopDragging(t)},L.dragFeature=function(t,e,r){Object(l.a)(this.getSelected(),r),t.dragMoveLocation=e.lngLat;t.feature},L.dragVertex=function(t,e,r){for(var n=t.selectedCoordPaths.map((function(e){return t.feature.getCoordinate(e)})),i=n.map((function(t){return{type:u.g.geojsonTypes.FEATURE,properties:{},geometry:{type:u.g.geojsonTypes.POINT,coordinates:t}}})),o=Object(a.a)(i,r),s=0;s1&&(t.selectedCoordPaths[0]="0."+(t.feature.coordinates[0].length-1)),+t.selectedCoordPaths[0].split(".")[1]==t.feature.coordinates[0].length-1&&(h=!0);var p=f.a.sector.apply(this,l).geometry.coordinates[0].slice(0,-1);h&&(t.selectedCoordPaths[0]="0."+(p.length-1)),r.setCoordinates([p])}},L.clickNoTarget=function(t){this.changeMode(u.g.modes.SIMPLE_SELECT)},L.clickInactive=function(){this.changeMode(u.g.modes.SIMPLE_SELECT)},L.clickActiveFeature=function(t,e){if(t.feature&&"LineString"===t.feature.type){for(var r=new Map,n=0;n0?this[O[n]](t,e,r):(t.featureDraggable||void 0===t.featureDraggable)&&this.dragFeature(t,e,r),t.dragMoveLocation=e.lngLat}},L.onClick=function(t,e){return C(e)?this.clickNoTarget(t,e):c.a.isActiveFeature(e)?this.clickActiveFeature(t,e):I(e)?this.clickInactive(t,e):void this.stopDragging(t)},L.onKeyUp=function(t,e){if(t&&t.feature&&"LineString"===t.feature.type&&c.a.isDeleteKey(e)&&(+t.selectedCoordPaths>0||0==+t.selectedCoordPaths&&t.feature.coordinates.length>=1)&&(t.feature.coordinates.splice(t.selectedCoordPaths[0],1),t.selectedCoordPaths.pop(),1===t.feature.coordinates.length&&this.deleteFeature([t.featureId]),this.map.fire(u.g.events.DELETE_POINT,Object.assign(e,{features:[t.feature.toGeoJSON()]})),this.fireUpdate(),t.feature.changed()),t.feature&&"Polygon"===t.feature.type&&t.selectedCoordPaths[0]){var r=t.selectedCoordPaths[0].split(".");c.a.isDeleteKey(e)&&(+r[1]>0||0==+r[1]&&t.feature.coordinates[0].length>=1)&&(t.feature.coordinates[0].splice(r[1],1),t.selectedCoordPaths.pop(),2===t.feature.coordinates[0].length&&this.deleteFeature([t.featureId]),this.map.fire(u.g.events.DELETE_POINT,Object.assign(e,{features:[t.feature.toGeoJSON()]})),this.fireUpdate(),t.feature.changed())}},L.onTap=function(t,e){return C(e)?this.clickNoTarget(t,e):c.a.isActiveFeature(e)?this.clickActiveFeature(t,e):I(e)?this.clickInactive(t,e):void 0},L.onTouchEnd=L.onMouseUp=function(t){t&&(t.dragMoving&&this.fireUpdate(),this.stopDragging(t))};e.default=L},function(t,e,r){"use strict";r.r(e);var n=r(27),i=r(46),o=r(5),a=r(315),s=r.n(a);function u(t,e,r){for(var n=[],i=0;i<1;i+=.01){var o=s()(e,i),a=s()(r,i),u=t.map.unproject([o,a]);n.push([u.lng,u.lat])}return n}function c(t,e,r,n){var i=[],o=null;if(void 0===n){var a=t.map.unproject([e.x,e.y]);if(i[0]=[a.lng,a.lat],!(o=l(t,e,r)))return i;(i=i.concat(o)).push(i[0])}else{if(!(o=l(t,n,r)))return i;var s=t.map.project(o[0]),c=t.map.project(o[4]),h=[e.x,n.x,s.x],p=[e.y,n.y,s.y],d=[c.x,n.x,e.x],f=[c.y,n.y,e.y],g=u(t,h,p),m=u(t,d,f);i=i.concat(g).concat(o).concat(m)}return i}function l(t,e,r){var n=new Array(5);n[2]=[r.x,r.y];var i=Math.sqrt((e.x-r.x)*(e.x-r.x)+(e.y-r.y)*(e.y-r.y));if(0!==i){var o=-(r.x-e.x)/i,a=(r.y-e.y)/i,s=e.x+10,u=e.y+i-36,c=e.x+22,l=e.y+i-36,h=e.x-10,p=e.y+i-36,d=e.x-22,f=e.y+i-36;n[0]=[e.x+(s-e.x)*a-(u-e.y)*o,e.y+(s-e.x)*o+(u-e.y)*a],n[1]=[e.x+(c-e.x)*a-(l-e.y)*o,e.y+(c-e.x)*o+(l-e.y)*a],n[3]=[e.x+(d-e.x)*a-(f-e.y)*o,e.y+(d-e.x)*o+(f-e.y)*a],n[4]=[e.x+(h-e.x)*a-(p-e.y)*o,e.y+(h-e.x)*o+(p-e.y)*a];for(var g=0;g3)return r(e);var s=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];return r({type:o.g.geojsonTypes.FEATURE,properties:e.properties,geometry:{coordinates:s,type:o.g.geojsonTypes.LINE_STRING}})}}},h.onTrash=function(t){var e=t.bezierArrow;this.deleteFeature([e.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)};e.default=h},function(t,e,r){"use strict";r.d(e,"a",(function(){return d}));var n=r(3),i=r.n(n),o=r(4),a=r.n(o),s=r(472),u=r.n(s),c=r(473),l=r.n(c).a,h=r(243),p=r(52),d=function(){function t(e,r){i()(this,t),this.URL=void 0,this.connectOps=void 0,this.userConnected=void 0,this.waitingMap=void 0,this.subscribedMap=void 0,this.connector=void 0,this.URL=e,this.connectOps=r,this.userConnected=!1,this.waitingMap=Object.create(null),this.subscribedMap=Object.create(null),Object(h.a)(["_onnetworkchange","_onconnected","_onconnecterror"],this),this._addNetworkListeners()}return a()(t,[{key:"connect",value:function(){this.userConnected=!0,this._connect()}},{key:"disconnect",value:function(){this.userConnected=!1,Object(p.o)()&&this.connector&&this.connector.connected&&this.connector.disconnect()}},{key:"subscribe",value:function(t,e){this.waitingMap[t]||this.subscribedMap[t]||(Object(p.o)()&&this.connector&&this.connector.connected?this.subscribedMap[t]={destination:t,onmessage:e,subscription:this.connector.subscribe(t,e)}:this.waitingMap[t]={destination:t,onmessage:e})}},{key:"unsubscribe",value:function(t){this.subscribedMap[t]&&(this.subscribedMap[t].subscription&&this.subscribedMap[t].subscription.unsubscribe(),delete this.subscribedMap[t]),this.waitingMap[t]&&(this.waitingMap[t].subscription&&this.waitingMap[t].subscription.unsubscribe(),delete this.waitingMap[t])}},{key:"send",value:function(t,e){Object(p.o)()&&this.connector&&this.connector.connected&&this.connector.send(t,null,e)}},{key:"destroy",value:function(){this._removeNetworkListeners();var t=Object(p.u)(null);for(var e in Object(p.f)(t,this.waitingMap),Object(p.f)(t,this.subscribedMap),this.waitingMap=Object(p.u)(null),this.subscribedMap=Object(p.u)(null),t)t[e].subscription&&t[e].subscription.unsubscribe();this.connector&&this.connector.disconnect(),this.connector=null}},{key:"_connect",value:function(){if(Object(p.o)()&&(!this.connector||!this.connector.connected)){var t=new u.a(this.URL);this.connector=l.Stomp.over(t),this.connector.debug=!1,this.connector.connect(this.connectOps,this._onconnected,this._onconnecterror)}}},{key:"_addNetworkListeners",value:function(){window.addEventListener("online",this._onnetworkchange,!1),window.addEventListener("offline",this._onnetworkchange,!1)}},{key:"_removeNetworkListeners",value:function(){window.removeEventListener("online",this._onnetworkchange,!1),window.removeEventListener("offline",this._onnetworkchange,!1)}},{key:"_onnetworkchange",value:function(){Object(p.o)()&&this.userConnected&&this._connect()}},{key:"_onconnected",value:function(){for(var t in Object(p.f)(this.waitingMap,this.subscribedMap),this.subscribedMap=Object(p.u)(null),this.waitingMap){var e=this.waitingMap[t],r=e.destination,n=e.onmessage,i=e.subscription;i&&i.unsubscribe(),e.subscription=this.connector.subscribe(r,n)}Object(p.f)(this.subscribedMap,this.waitingMap),this.waitingMap=Object(p.u)(null)}},{key:"_onconnecterror",value:function(){Object(p.o)()&&this.userConnected&&this._connect()}}]),t}()},function(t,e,r){"use strict";r.d(e,"a",(function(){return d}));var n=r(23),i=r.n(n),o=r(115),a=r.n(o),s=r(1),u=r(9);function c(t,e,r){var n=s.a.getProps(r,"config"),i=t.sp,o=t.ep,a=t.mp,u=t.st,c=t.avoidArea,l=t.avoidLine;u="number"==typeof u?u:4,c="string"==typeof c?c:"",l="string"==typeof l?l:"";var h="?"+[["sPoint",i.toString()],["ePoint",o.toString()],["st",u],["wayPoints",a?a.map((function(t){return t.toString()})).join(";"):null],["avoidArea",c],["avoidLine",l],["source",3],["token",n.ACCESSTOKEN],["appKey",n.LBS_APP_KEY]].map((function(t){return t.join("=")})).join("&"),p=function(t,e){var r,n,i=s.a.getProps(e,"config");return"mine"===t.engineType?2===t.expectRticId?(r=i.CT_DRIVING_ROUTE_URL,n="&url="+i.MAP_SERVICE_URL.split("//")[1]):(r=i.DRIVING_ROUTE_URL,n=""):(r=i.CT_ROUTE_PLAN_URL,n=""),{URL:r,domain:n}}(e,r);return p.URL+h+p.domain}var l=2,h=52;function p(t,e,r){var n=t.coordinates,o=t.sp,s=t.ep,p=t.mp,d=t.st,f=t.avoidArea,g=t.avoidLine,m=a()(t,["coordinates","sp","ep","mp","st","avoidArea","avoidLine"]),y=function(t){if(t.length<2)return t;var e=[];return e=t.reduce((function(t,e){return 0!==e[0]&&0!==e[1]&&(null!==t.active&&t.active[0]===e[0]&&t.active[1]===e[1]||(t.coordinates.push(e),t.active=e)),t}),{coordinates:[],active:null}).coordinates,t.length>=2&&1===e.length&&(e=[t[0],t[1]]),e}(n||(Array.isArray(p)?[o].concat(i()(p),[s]):[o,s])),v=y.length;if(vh)return function(t,e){var r=requestAnimationFrame((function(){e(new Error(t),null)}));return{cancel:function(){cancelAnimationFrame(r)}}}("路径规划有效坐标数量范围为[".concat(l,", ").concat(h,"]区间"),e);var A=c({sp:o=y.shift(),ep:s=y.pop(),mp:p=y,st:d,avoidArea:f,avoidLine:g},m,r),_=u.a.xhr({noAuth:!0,type:"GET",url:A,headers:{Accept:"application/json"},success:function(t){e(null,{data:t.data||t.result,errcode:0,errmsg:null})},error:function(t){e(t,null)}},r);return{cancel:function(){_.abort()}}}var d=p},function(t,e,r){"use strict";r(47),r(318)},function(t,e,r){"use strict";r.r(e);var n=r(27),i=r(46),o=r(5);var a={},s={x:0,y:0};a.onSetup=function(){var t=this.newFeature({type:o.g.geojsonTypes.FEATURE,properties:{_type_:o.g.geojsonTypes.ARROW},geometry:{type:o.g.geojsonTypes.POLYGON,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),i.a.disable(this),this.updateUIClasses({mouse:o.g.cursors.ADD}),this.activateUIButton(o.g.types.ARROW),this.setActionableState({trash:!0}),{arrow:t,currentClickNum:0}},a.onMouseMove=function(t,e){var r=t,i=r.arrow,a=r.currentClickNum;if(1===a){var u=function(t,e,r){var n=[];n[0]=[e.x,e.y],n[3]=[r.x,r.y];var i=Math.sqrt((e.x-r.x)*(e.x-r.x)+(e.y-r.y)*(e.y-r.y));if(0!==i){var o=-(r.x-e.x)/i,a=(r.y-e.y)/i,s=e.x+10,u=e.y+i-36,c=e.x+22,l=e.y+i-36,h=e.x-10,p=e.y+i-36,d=e.x-22,f=e.y+i-36;n[1]=[e.x+(s-e.x)*a-(u-e.y)*o,e.y+(s-e.x)*o+(u-e.y)*a],n[2]=[e.x+(c-e.x)*a-(l-e.y)*o,e.y+(c-e.x)*o+(l-e.y)*a],n[4]=[e.x+(d-e.x)*a-(f-e.y)*o,e.y+(d-e.x)*o+(f-e.y)*a],n[5]=[e.x+(h-e.x)*a-(p-e.y)*o,e.y+(h-e.x)*o+(p-e.y)*a],n[6]=n[0];for(var g=0;g3)return r(e);var s=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];return r({type:o.g.geojsonTypes.FEATURE,properties:e.properties,geometry:{coordinates:s,type:o.g.geojsonTypes.LINE_STRING}})}}},a.onTrash=function(t){var e=t.arrow;this.deleteFeature([e.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)};e.default=a},function(t,e,r){"use strict";r.r(e);var n=r(27),i=r(46),o=r(5),a=r(200),s=r(32),u=r(202),c=function(t,e,r){r=r||e/2;for(var n=Math.floor(128),i=e/6250,o=r/6250,a=t[1]*Math.PI/180,c=t[0]*Math.PI/180,l=[],h=[],p=0;p0)return this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[a.id]});n.a.isVertex(e)&&this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[a.id]}),this.updateUIClasses({mouse:o.g.cursors.ADD}),a.center=[e.lngLat.lng,e.lngLat.lat];var u=c([e.lngLat.lng,e.lngLat.lat],0);a.setCoordinates(u),s=u.length,this.map.fire(o.g.events.CLICK,Object.assign(e,{features:[t.circle.toGeoJSON()],center:a.center,radius:a.radius})),t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===t.direction?t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat):t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat),t=Object.assign(t,{currentVertexPosition:s,circle:a})},onDrag:function(t,e){l.onMouseMove(t,e)},onMouseUp:function(t,e){this.map.dragPan.enable();var r=t.circle;if(t.currentVertexPosition>0)return this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[r.id]})},onKeyUp:function(t){var e=t.circle;n.a.isEscapeKey&&(this.deleteFeature(e.id,{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)),n.a.isEnterKey&&this.changeMode(o.g.modes.SIMPLE_SELECT,{featureIds:[e.id]})},onStop:function(t){var e=t.circle,r=t.currentVertexPosition,n=t.line;n&&(this.deleteFeature(n.id,{silent:!0}),delete t.line),this.updateUIClasses({mouse:o.g.cursors.NONE}),i.a.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.id)&&(e.removeCoordinate("0.".concat(r)),e.isValid()?this.map.fire(o.g.events.CREATE,{features:[e.toGeoJSON()],center:e.center,radius:e.radius}):(this.deleteFeature([e.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT,{},{silent:!0})))},toDisplayFeatures:function(t,e,r){var n=t.circle,i=e.properties.id===n.id;if(e.properties.active=i?o.g.activeStates.ACTIVE:o.g.activeStates.INACTIVE,!i)return r(e);if(0!==e.geometry.coordinates.length){var a=e.geometry.coordinates[0].length;if(!(a<3))return e.properties.meta=o.g.meta.FEATURE,a>3?r(e):void 0}},onTrash:function(t){var e=t.circle;this.deleteFeature([e.id],{silent:!0}),this.changeMode(o.g.modes.SIMPLE_SELECT)}};e.default=l},function(t,e,r){"use strict";r.r(e);var n=r(27),i=r(176),o=r.n(i);function a(t,e){var r=e.getBoundingClientRect();return new o.a(t.clientX-r.left-(e.clientLeft||0),t.clientY-r.top-(e.clientTop||0))}var s=r(159),u=r(132),c=r(46),l=r(155),h=r(5),p={onSetup:function(t){var e=this,r={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoveing:!1,canDragMove:!1,initiallySelectedFeatureIds:t.featureIds||[],editableInit:t.editableInit};return this.setSelected(r.initiallySelectedFeatureIds.filter((function(t){return void 0!==e.getFeature(t)}))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),r},fireUpdate:function(){this.map.fire(h.g.events.UPDATE,{action:h.g.updateActions.MOVE,features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(){var t=this,e=this.getSelected(),r=e.filter((function(e){return t.isInstanceOf("MultiFeature",e)})),n=!1;if(e.length>1){n=!0;var i=e[0].type.replace("Multi","");e.forEach((function(t){t.type.replace("Multi","")!==i&&(n=!1)}))}var o=r.length>0,a=e.length>0;this.setActionableState({combineFeatures:n,uncombineFeatures:o,trash:a})},getUniqueIds:function(t){return t.length?t.map((function(t){return t.properties.id})).filter((function(t){return void 0!==t})).reduce((function(t,e){return t.add(e),t}),new u.a).values():[]},stopExtendedInteractions:function(t){t.boxSelectElement&&(t.boxSelectElement.parentNode&&t.boxSelectElement.parentNode.removeChild(t.boxSelectElement),t.boxSelectElement=null),this.map.dragPan.enable(),t.boxSelecting=!1,t.canBoxSelect=!1,t.dragMoving=!1,t.canDragMove=!1},onStop:function(){c.a.enable(this)},onMouseUp:function(t,e){if(n.a.true(e))return this.stopExtendedInteractions(t)},onMouseMove:function(t,e){if(e.featureTarget)return n.a.isOfMetaType(h.g.meta.VERTEX)(e)&&this.changeMode(h.g.modes.DIRECT_SELECT,{featureId:e.featureTarget.properties.parent,coordPath:e.featureTarget.properties.coord_path,startPos:e.lngLat}),this.stopExtendedInteractions(t)},onMouseOut:function(t){if(t.dragMoving)return this.fireUpdate()}};p.onTap=p.onClick=function(t,e){return n.a.noTarget(e)?this.clickAnywhere(t,e):n.a.isOfMetaType(h.g.meta.VERTEX)(e)?this.clickOnVertex(t,e):n.a.isFeature(e)?this.clickOnFeature(t,e):void 0},p.clickAnywhere=function(t){var e=this,r=this.getSelectedIds();r.length&&(this.clearSelectedFeatures(),r.forEach((function(t){return e.doRender(t)}))),c.a.enable(this),this.stopExtendedInteractions(t)},p.clickOnVertex=function(t,e){this.changeMode(h.g.modes.DIRECT_SELECT,{featureId:e.featureTarget.properties.parent,coordPath:e.featureTarget.properties.coord_path,startPos:e.lngLat}),this.updateUIClasses({mouse:h.g.cursors.MOVE})},p.startOnActiveFeature=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),this.doRender(e.featureTarget.properties.id),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},p.clickOnFeature=function(t,e){var r=this;c.a.disable(this),this.stopExtendedInteractions(t);var i=n.a.isShiftDown(e),o=this.getSelectedIds(),a=e.featureTarget.properties.id,s=this.isSelected(a);if(this.getFeature(a)&&this.getFeature(a).type!==h.g.geojsonTypes.POINT)return this.changeMode(h.g.modes.DIRECT_SELECT,{featureId:a});s&&i?(this.deselect(a),this.updateUIClasses({mouse:h.g.cursors.POINTER}),1===o.length&&c.a.enable(this)):!s&&i?(this.select(a),this.updateUIClasses({mouse:h.g.cursors.MOVE})):s||i||(o.forEach((function(t){return r.doRender(t)})),this.setSelected(a),this.updateUIClasses({mouse:h.g.cursors.MOVE})),this.doRender(a)},p.onMouseDown=function(t,e){return n.a.isActiveFeature(e)?this.startOnActiveFeature(t,e):this.drawConfig.boxSelect&&n.a.isShiftMousedown(e)?this.startBoxSelect(t,e):void 0},p.startBoxSelect=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),t.boxSelectStartLocation=a(e.originalEvent,this.map.getContainer()),t.canBoxSelect=!0},p.onTouchStart=function(t,e){if(n.a.isActiveFeature(e))return this.startOnActiveFeature(t,e)},p.onDrag=function(t,e){return t.canDragMove?this.dragMove(t,e):this.drawConfig.boxSelect&&t.canBoxSelect?this.whileBoxSelect(t,e):void 0},p.whileBoxSelect=function(t,e){t.boxSelecting=!0,this.updateUIClasses({mouse:h.g.cursors.ADD}),t.boxSelectElement||(t.boxSelectElement=document.createElement("div"),t.boxSelectElement.classList.add(h.g.classes.BOX_SELECT),this.map.getContainer().appendChild(t.boxSelectElement));var r=a(e.originalEvent,this.map.getContainer()),n=Math.min(t.boxSelectStartLocation.x,r.x),i=Math.max(t.boxSelectStartLocation.x,r.x),o=Math.min(t.boxSelectStartLocation.y,r.y),s=Math.max(t.boxSelectStartLocation.y,r.y),u="translate(".concat(n,"px, ").concat(o,"px)");t.boxSelectElement.style.transform=u,t.boxSelectElement.style.WebkitTransform=u,t.boxSelectElement.style.width="".concat(i-n,"px"),t.boxSelectElement.style.height="".concat(s-o,"px")},p.dragMove=function(t,e){t.dragMoving=!0,e.originalEvent.stopPropagation();var r={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};Object(l.a)(this.getSelected(),r),t.dragMoveLocation=e.lngLat},p.onMouseUp=function(t,e){var r=this;if(t.dragMoving)this.fireUpdate();else if(t.boxSelecting){var n=[t.boxSelectStartLocation,a(e.originalEvent,this.map.getContainer())],i=this.featuresAt(null,n,"click"),o=this.getUniqueIds(i).filter((function(t){return!r.isSelected(t)}));o.length&&(this.select(o),o.forEach((function(t){return r.doRender(t)})),this.updateUIClasses({mouse:h.g.cursors.MOVE}))}this.stopExtendedInteractions(t)},p.toDisplayFeatures=function(t,e,r){e.properties.active=this.isSelected(e.properties.id)?h.g.activeStates.ACTIVE:h.g.activeStates.INACTIVE,r(e),this.fireActionable(),e.properties.active===h.g.activeStates.ACTIVE&&e.geometry.type!==h.g.geojsonTypes.POINT&&Object(s.a)(e).forEach(r)},p.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},p.onCombineFeatures=function(){var t=this.getSelected();if(!(0===t.length||t.length<2)){for(var e=[],r=[],n=t[0].type.replace("Multi",""),i=0;i1){var a=this.newFeature({type:h.g.geojsonTypes.FEATURE,properties:r[0].properties,geometry:{type:"Multi".concat(n),coordinates:e}});this.addFeature(a),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([a.id]),this.map.fire(h.g.events.COMBINE_FEATURES,{createdFeatures:[a.toGeoJSON()],deletedFeatures:r})}this.fireActionable()}},p.onUncombineFeatures=function(){var t=this,e=this.getSelected();if(0!==e.length){for(var r=[],n=[],i=function(i){var o=e[i];t.isInstanceOf("MultiFeature",o)&&(o.getFeatures().forEach((function(e){t.addFeature(e),e.properties=o.properties,r.push(e.toGeoJSON()),t.select([e.id])})),t.deleteFeature(o.id,{silent:!0}),n.push(o.toGeoJSON()))},o=0;o1&&this.map.fire(h.g.events.UNCOMBINE_FEATURES,{createdFeatures:r,deletedFeatures:n}),this.fireActionable()}};e.default=p},function(t,e){t.exports=function(t){throw new TypeError('"'+t+'" is read-only')},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){},function(t,e,r){var n;!function(i){"use strict";function o(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function a(t,e,r,n,i,a){return o((s=o(o(e,t),o(n,a)))<<(u=i)|s>>>32-u,r);var s,u}function s(t,e,r,n,i,o,s){return a(e&r|~e&n,t,e,i,o,s)}function u(t,e,r,n,i,o,s){return a(e&n|r&~n,t,e,i,o,s)}function c(t,e,r,n,i,o,s){return a(e^r^n,t,e,i,o,s)}function l(t,e,r,n,i,o,s){return a(r^(e|~n),t,e,i,o,s)}function h(t,e){var r,n,i,a,h;t[e>>5]|=128<>>9<<4)]=e;var p=1732584193,d=-271733879,f=-1732584194,g=271733878;for(r=0;r>5]>>>e%32&255);return r}function d(t){var e,r=[];for(r[(t.length>>2)-1]=void 0,e=0;e>5]|=(255&t.charCodeAt(e/8))<>>4&15)+"0123456789abcdef".charAt(15&e);return n}function g(t){return unescape(encodeURIComponent(t))}function m(t){return function(t){return p(h(d(t),8*t.length))}(g(t))}function y(t,e){return function(t,e){var r,n,i=d(t),o=[],a=[];for(o[15]=a[15]=void 0,i.length>16&&(i=h(i,8*t.length)),r=0;r<16;r+=1)o[r]=909522486^i[r],a[r]=1549556828^i[r];return n=h(o.concat(d(e)),512+8*e.length),p(h(a.concat(n),640))}(g(t),g(e))}function v(t,e,r){return e?r?y(e,t):f(y(e,t)):r?m(t):f(m(t))}void 0===(n=function(){return v}.call(e,r,e,t))||(t.exports=n)}()},function(t){t.exports=JSON.parse('{"event.track.create.fail":"创建事件轨迹失败","event.track.param.verification.fail":"事件轨迹参数校验失败","draw.start":"单击开始绘制","draw.drag":"按住鼠标拖动绘制","draw.release":"松开鼠标结束绘制","draw.double.end":"双击结束绘制","draw.click.end":"单击结束绘制","draw.km":"公里","geometryCircleLayer.meter":"米","draw.continue":"单击继续绘制"}')},function(t){t.exports=JSON.parse('{"event.track.create.fail":"failed to create event track","event.track.param.verification.fail":"event track parameter verification failed","draw.start":"click start drawing","draw.drag":"hold down and drag the mouse to draw","draw.release":"release the mouse to finish drawing","draw.double.end":"double click to finish drawing","draw.click.end":"click end to draw","draw.km":"km","geometryCircleLayer.meter":"m","draw.continue":"click continue drawing"}')},function(t,e,r){t.exports=r(576)},function(t,e,r){var n=r(347),i=r(349);t.exports=function(t,e){return t&&n(t,i(e))}},function(t,e,r){var n=r(221),i=r(22),o=r(60),a=r(161).default,s=o.featureEach,u=(o.coordEach,i.polygon,i.featureCollection);function c(t){var e=n(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),n.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})),n.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),n.prototype.remove.call(this,t,e)},e.clear=function(){return n.prototype.clear.call(this)},e.search=function(t){var e=n.prototype.search.call(this,this.toBBox(t));return u(e)},e.collides=function(t){return n.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=n.prototype.all.call(this);return u(t)},e.toJSON=function(){return n.prototype.toJSON.call(this)},e.fromJSON=function(t){return n.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=a(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=c,t.exports.default=c},function(t,e,r){"use strict";var n=r(588),i=r(589),o=r(590);const a=r(593).orient2d;function s(t,e,r){e=Math.max(0,void 0===e?2:e),r=r||0;var i=function(t){for(var e=t[0],r=t[0],n=t[0],i=t[0],a=0;an[0]&&(n=s),s[1]i[1]&&(i=s)}var u=[e,r,n,i],c=u.slice();for(a=0;a=2&&d(e[e.length-2],e[e.length-1],t[r])<=0;)e.pop();e.push(t[r])}for(var n=[],i=t.length-1;i>=0;i--){for(;n.length>=2&&d(n[n.length-2],n[n.length-1],t[i])<=0;)n.pop();n.push(t[i])}return n.pop(),e.pop(),e.concat(n)}(c)}(t),a=new n(16);a.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},a.compareMinX=function(t,e){return t[0]-e[0]},a.compareMinY=function(t,e){return t[1]-e[1]},a.load(t);for(var s,c=[],l=0;la||u.push({node:f,dist:g})}for(;u.length&&!u.peek().node.children;){var m=u.pop(),v=m.node,A=y(v,e,r),_=y(v,n,o);if(m.dist=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function p(t,e,r){for(var n,i,o,a,s=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),c=Math.max(t[0],e[0]),l=Math.max(t[1],e[1]),h=r.search({minX:s,minY:u,maxX:c,maxY:l}),p=0;p0!=d(n,i,a)>0&&d(o,a,n)>0!=d(o,a,i)>0)return!1;return!0}function d(t,e,r){return a(t[0],t[1],e[0],e[1],r[0],r[1])}function f(t){var e=t.p,r=t.next.p;return t.minX=Math.min(e[0],r[0]),t.minY=Math.min(e[1],r[1]),t.maxX=Math.max(e[0],r[0]),t.maxY=Math.max(e[1],r[1]),t}function g(t,e){var r={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function m(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function y(t,e,r){var n=e[0],i=e[1],o=r[0]-n,a=r[1]-i;if(0!==o||0!==a){var s=((t[0]-n)*o+(t[1]-i)*a)/(o*o+a*a);s>1?(n=r[0],i=r[1]):s>0&&(n+=o*s,i+=a*s)}return(o=t[0]-n)*o+(a=t[1]-i)*a}function v(t,e,r,n,i,o,a,s){var u,c,l,h,p=r-t,d=n-e,f=a-i,g=s-o,m=t-i,y=e-o,v=p*p+d*d,A=p*f+d*g,_=f*f+g*g,b=p*m+d*y,x=f*m+g*y,w=v*_-A*A,C=w,E=w;0===w?(c=0,C=1,h=x,E=_):(h=v*x-A*b,(c=A*x-_*b)<0?(c=0,h=x,E=_):c>C&&(c=C,h=x+A,E=_)),h<0?(h=0,-b<0?c=0:-b>v?c=C:(c=-b,C=v)):h>E&&(h=E,-b+A<0?c=0:-b+A>v?c=C:(c=-b+A,C=v));var I=(1-(l=0===h?0:h/E))*i+l*a-((1-(u=0===c?0:c/C))*t+u*r),M=(1-l)*o+l*s-((1-u)*e+u*n);return I*I+M*M}function A(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}t.exports=s,t.exports.default=s},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return K}));var n,i,o,a,s,u,c,l,h,p,d,f,g,m,y,v,A,_,b,x,w,C,E,I,M,S,T,P,O,L,k,R,D,B,N=r(3),F=r.n(N),j=r(4),z=r.n(j),U=r(6),G=r.n(U),H=r(9),V=r(1),Q=r(41),q=r(7),W=r(0),Y=r(145),X=r.n(Y),Z=r(121),K=(n=Object(q.a)({isPublic:{type:W.a.Boolean},serviceName:{required:!0,type:W.a.String},adcode:{type:W.a.String},polygon:{type:[W.a.ArrayPoint,W.a.Array],validator:function(t){var e;return Array.isArray(t[0][0][0])&&!Array.isArray(t[0][0][0][0])&&(e={type:"MultiPolygon",coordinates:t}),Array.isArray(t[0])&&!Array.isArray(t[0][0])&&(e={type:"Polygon",coordinates:[t]}),t=e,X.a.valid(e)}},mixTerms:{type:W.a.Array},icons:{type:W.a.Array},clustered:{type:W.a.Boolean},clusteredRadius:{type:W.a.Number},clusteredFilters:{typ:W.a.Array},ended:{required:!0,type:W.a.Function}}),i=Object(q.a)({serviceName:{type:W.a.String},serviceNames:{type:W.a.Array},includes:{type:W.a.Array},excludes:{type:W.a.Array},before:{type:W.a.String},clustered:{type:W.a.Boolean},enableGetInfo:{type:W.a.Boolean},dynamic:{type:W.a.Boolean},timer:{type:W.a.Number},clusteredRadius:{type:W.a.Number},icons:{required:!0,type:W.a.Array},minZoom:{type:W.a.Number},maxZoom:{type:W.a.Number},terms:{type:W.a.Array},isPublic:{type:W.a.Boolean},privateTerms:{type:W.a.Array},clusteredFilters:{type:W.a.Array},showText:{type:W.a.String},textSize:{type:W.a.Number},textOffset:{type:W.a.Array},iconOffset:{type:W.a.Array},circleRadius:{type:W.a.Number},circleColor:{type:W.a.String},circleBlur:{type:W.a.Number},circleOpacity:{type:W.a.Number},circleTranslate:{type:W.a.Array},circleStrokeWidth:{type:W.a.Number},circleStrokeColor:{type:W.a.String},circleStrokeOpacity:{type:W.a.Number},countTextSize:{type:W.a.Number},countTextLetterSpacing:{type:W.a.Number},countTextOffset:{type:W.a.Array},countTextOpacity:{type:W.a.Number},countTextColor:{type:W.a.String},countTextHaloWidth:{type:W.a.Number},countTextHaloColor:{type:W.a.String},countTextHaloBlur:{type:W.a.Number},ended:{type:W.a.Function}}),o=Object(q.a)({serviceName:{type:W.a.String},serviceNames:{type:W.a.Array},includes:{type:W.a.Array},excludes:{type:W.a.Array},before:{type:W.a.String},clustered:{type:W.a.Boolean},enableGetInfo:{type:W.a.Boolean},dynamic:{type:W.a.Boolean},timer:{type:W.a.Number},clusteredRadius:{type:W.a.Number},icons:{required:!0,type:W.a.Array},minZoom:{type:W.a.Number},maxZoom:{type:W.a.Number},terms:{type:W.a.Array},isPublic:{type:W.a.Boolean},privateTerms:{type:W.a.Array},clusteredFilters:{type:W.a.Array},showText:{type:W.a.String},textSize:{type:W.a.Number},textOffset:{type:W.a.Array},iconOffset:{type:W.a.Array},circleRadius:{type:W.a.Number},circleColor:{type:W.a.String},circleBlur:{type:W.a.Number},circleOpacity:{type:W.a.Number},circleTranslate:{type:W.a.Array},circleStrokeWidth:{type:W.a.Number},circleStrokeColor:{type:W.a.String},circleStrokeOpacity:{type:W.a.Number},countTextSize:{type:W.a.Number},countTextLetterSpacing:{type:W.a.Number},countTextOffset:{type:W.a.Array},countTextOpacity:{type:W.a.Number},countTextColor:{type:W.a.String},countTextHaloWidth:{type:W.a.Number},countTextHaloColor:{type:W.a.String},countTextHaloBlur:{type:W.a.Number},ended:{type:W.a.Function}}),a=Object(q.a)({layerId:{required:!0,type:W.a.String}}),s=Object(q.a)({layerId:{required:!0,type:W.a.String}}),u=Object(q.a)({layerId:{required:!0,type:W.a.String}}),c=Object(q.a)({layerId:{required:!0,type:W.a.String},event:{required:!0,type:W.a.String},clustered:{type:W.a.Boolean},handler:{type:W.a.Function},dragStart:{type:W.a.Function},dragMove:{type:W.a.Function},dragEnd:{type:W.a.Function}}),l=Object(q.a)({layerId:{required:!0,type:W.a.String},event:{required:!0,type:W.a.String},clustered:{type:W.a.Boolean}}),h=Object(q.a)({layerId:{required:!0,type:W.a.String},before:{required:!0,type:W.a.String}}),p=Object(q.a)({data:{type:W.a.GeoJSON,required:!0},before:{type:W.a.String},opacity:{type:W.a.Number},colorIsFromFeature:{type:W.a.Boolean},colorField:{type:W.a.String},color:{type:W.a.String},translate:{type:W.a.Array},patternIsFromFeature:{type:W.a.Boolean},patternField:{type:W.a.String},pattern:{type:W.a.String},heightIsFromFeature:{type:W.a.Boolean},heightField:{type:W.a.String},height:{type:W.a.Number},baseIsFromFeature:{type:W.a.Boolean},baseField:{type:W.a.String},base:{type:W.a.Number}}),d=Object(q.a)({maxCount:{type:W.a.Number},searchType:{type:W.a.Array},before:{type:W.a.String},ended:{type:W.a.Function}}),f=Object(q.a)({url:{required:!0,type:W.a.String},tileSize:{required:!0,type:W.a.Number},minZoom:{required:!0,type:W.a.Number},maxZoom:{required:!0,type:W.a.Number},rasterOpacity:{required:!0,type:W.a.Number}}),g=Object(q.a)({serviceName:{required:!0,type:W.a.String},clustered:{type:W.a.Boolean},maxCount:{type:W.a.Number},icons:{type:W.a.Array},clusteredFilters:{type:W.a.Array},before:{type:W.a.String},ended:{type:W.a.Function}}),m=Object(q.a)({layerId:{required:!0,type:W.a.String}}),y=Object(q.a)({layerId:{required:!0,type:W.a.String},mixTerms:{type:W.a.Array},icons:{type:W.a.Array}}),v=Object(q.a)({layerId:{required:!0,type:W.a.String}}),A=Object(q.a)({layerId:{required:!0,type:W.a.String}}),_=Object(q.a)({serviceName:{required:!0,type:W.a.String},levels:{required:!0,type:W.a.Array},clustered:{type:W.a.Boolean},showGeometry:{type:W.a.Boolean},showPointData:{type:W.a.Boolean},icons:{type:W.a.Array},clusteredFilters:{type:W.a.Array},ended:{type:W.a.Function}}),b=Object(q.a)({dataId:{required:!0,type:W.a.String|W.a.Number},initFloor:{type:W.a.String},filterOutPoi:{type:W.a.Array},spaceColorConfigBySubKinds:{type:W.a.Array},spaceColorConfigByKinds:{type:W.a.Array},outlineColorConfigBySubKinds:{type:W.a.Array},outlineColorConfigByKinds:{type:W.a.Array},callback:{type:W.a.Function}}),x=Object(q.a)({layerId:{required:!0,type:W.a.String},floor:{required:!0,type:W.a.String}}),w=Object(q.a)({layerId:{required:!0,type:W.a.String},filterOutPoi:{required:!0,type:W.a.Array}}),C=Object(q.a)({adminId:{required:!0,type:W.a.String|W.a.Number}}),E=Object(q.a)({serviceName:{type:W.a.String},includes:{type:W.a.Array},excludes:{type:W.a.Array},before:{type:W.a.String},icons:{required:!0,type:W.a.Array},terms:{type:W.a.Array},isPublic:{type:W.a.Boolean},ended:{type:W.a.Function}}),I=Object(q.a)({url:{required:!0,type:W.a.String},loaded:{required:!0,type:W.a.Function},lnglatParam:{type:W.a.String},version:{required:!0,type:W.a.String},typeName:{required:!0,type:W.a.String},featureTypes:{required:!0,type:W.a.Array},icons:{required:!0,type:W.a.Array},terms:{type:W.a.Array},ended:{type:W.a.Function}}),M=Object(q.a)({url:{required:!0,type:W.a.String},params:{type:W.a.Object},extent:{type:W.a.String},loaded:{required:!0,type:W.a.Function},clustered:{type:W.a.Boolean},icons:{required:!0,type:W.a.Array},requestType:{required:!0,type:W.a.String},clusteredFilters:{type:W.a.Array},ended:{type:W.a.Function}}),S=Object(q.a)({layerId:{required:!0,type:W.a.String},tokenKey:{required:!0,type:W.a.String},tokenValue:{required:!0,type:W.a.String}}),T=Object(q.a)({layerId:{required:!0,type:W.a.String}}),P=Object(q.a)({layerId:{required:!0,type:W.a.String},callback:{type:W.a.Function}}),O=Object(q.a)({serviceName:{required:!0,type:W.a.String},clustered:{type:W.a.Boolean},dynamic:{type:W.a.Boolean},timer:{type:W.a.Number},mixTerms:{type:W.a.Array},clusteredIcon:{type:W.a.String},clusteredMarkerTemplate:{type:W.a.String},singleMarkerTemplate:{type:W.a.Object},ended:{type:W.a.Function}}),L=Object(q.a)({url:{type:W.a.String,require:!0},coordinates:{type:W.a.Array,require:!0},ended:{type:W.a.Function}}),k=Object(q.a)({adminCode:{type:W.a.String|W.a.Number,require:!0},style:{type:W.a.Object},ended:{type:W.a.Function}}),R=Object(q.a)({layerId:{required:!0,type:W.a.String},callback:{type:W.a.Function}}),D=Object(q.a)({minzoom:{type:W.a.Number},maxzoom:{type:W.a.Number},style:{type:W.a.Object},ended:{type:W.a.Function}}),B=function(){function t(){F()(this,t)}return z()(t,[{key:"addTypicalLayer",value:function(t){var e=JSON.stringify(t);return e=JSON.parse(e),Z.a.info("addTypicalLayer 参数",e),t.isTypicalLayer=!0,new(V.a.getProps(t.mapContainerId,"modules").GeojsonLayer())(t,(function(e){t.res=e})).layerId}},{key:"addHeatMapLayer",value:function(t){return t.isHeatMap=!0,new(V.a.getProps(t.mapContainerId,"modules").HeatMapLayer())(t,(function(e){t.res=e})).layerId}},{key:"addCustomLayer",value:function(t){var e=JSON.stringify(t);e=JSON.parse(e),Z.a.info("addCustomLayer 参数",e);return new((0,V.a.getProps(t.mapContainerId,"modules").SpecificLayer)())(t,(function(e){t.res=e})).layerId}},{key:"addIndustryLayer",value:function(t){var e=JSON.stringify(t);e=JSON.parse(e),Z.a.info("addCustomLayer 参数",e);return new((0,V.a.getProps(t.mapContainerId,"modules").CustomSpecificLayer)())(t,(function(e){t.res=e})).layerId}},{key:"addMixedClusterLayer",value:function(t){var e=JSON.stringify(t);e=JSON.parse(e),Z.a.info("addMixedClusterLayer 参数",e);var r=V.a.getProps(t.mapContainerId,"modules");return new(("icon-cluster"===t.clusterMode?r.MixedClusterLayerNew:r.MixedClusterLayer)())(t,(function(e){t.res=e})).layerId}},{key:"addBasicDataCluster",value:function(t){var e=V.a.getProps(t.mapContainerId,"modules");if(1==t.dataType){var r=[];return t.poiFilters&&t.poiFilters.searchType&&r.push({value:t.poiFilters.searchType,column:"kindcode",termType:"in",type:"and"}),t.poiFilters&&t.poiFilters.keyword&&r.push({value:t.poiFilters.keyword,column:"name",termType:"like",type:"and"}),t.mixTerms=r,t.isPoiLayer=!0,t.icons=[],new(e.SpecificLayerMVT())(t,(function(e){t.res=e})).layerId}return new(e.BasicDataCluster())(t,(function(e){t.res=e})).layerId}},{key:"removeLayer",value:function(t){var e=V.a.getProps(t.mapContainerId,"layerCollect");e&&e.isExit(t.layerId)?e.get(t.layerId).removeLayer():H.a.setErrorMessage(Q.a.message.noExitLayer,t.mapContainerId)}},{key:"showLayer",value:function(t){var e=!1,r=V.a.getProps(t.mapContainerId,"layerCollect");r&&r.isExit(t.layerId)&&(r.get(t.layerId).show(),e=!0);var n=V.a.getProps(t.mapContainerId,"map");n.olLayerMap&&n.olLayerMap[t.layerId]&&(n.olLayerMap[t.layerId].setVisible(!0),e=!0),e||H.a.setErrorMessage(Q.a.message.noExitLayer,t.mapContainerId)}},{key:"hideLayer",value:function(t){var e=V.a.getProps(t.mapContainerId,"layerCollect");if(e){var r=e.get(t.layerId);r&&r.hide()}var n=V.a.getProps(t.mapContainerId,"map");n.olLayerMap&&n.olLayerMap[t.layerId]&&n.olLayerMap[t.layerId].setVisible(!1)}},{key:"addEventOnLayerObject",value:function(t){var e=V.a.getProps(t.mapContainerId,"layerCollect");e.get(t.layerId);e.get(t.layerId).addEvent(t.event,t.handler,t.layerId)}},{key:"removeEventOnLayerObject",value:function(t){var e=V.a.getProps(t.mapContainerId,"layerCollect");e&&e.isExit(t.layerId)?e.get(t.layerId).removeEvent(t.event):H.a.setErrorMessage(Q.a.message.noExitLayer,t.mapContainerId)}},{key:"moveLayer",value:function(t){var e=V.a.getProps(t.mapContainerId,"layerCollect");e&&e.isExit(t.layerId)?e.get(t.layerId).moveLayer(t.before):H.a.setErrorMessage(Q.a.message.noExitLayer,t.mapContainerId)}},{key:"add3DLayer",value:function(t){var e=new(V.a.getProps(t.mapContainerId,"modules").ExtrusionLayer())(t);t.res=e.layerId}},{key:"addPoiLayer",value:function(t){return new(V.a.getProps(t.mapContainerId,"modules").PoiLayer())(t,(function(e){t.res=e})).layerId}},{key:"addRasterLayer",value:function(t){return new(V.a.getProps(t.mapContainerId,"modules").RasterLayer())(t,(function(e){t.res=e})).layerId}},{key:"addStaticLayer",value:function(t){t.isStatic=!0;return new(V.a.getProps(t.mapContainerId,"modules").PoiLayer())(t,(function(e){t.res=e})).layerId}},{key:"reloadData",value:function(t){var e=V.a.getProps(t.mapContainerId,"layerCollect");e&&e.isExit(t.layerId)&&e.get(t.layerId).reloadData()}},{key:"updateLayer",value:function(t){var e=V.a.getProps(t.mapContainerId,"layerCollect");e&&e.isExit(t.layerId)&&e.get(t.layerId).updateLayer(t)}},{key:"updateFeature",value:function(t){var e=V.a.getProps(t.mapContainerId,"layerCollect");e&&e.isExit(t.layerId)&&e.get(t.layerId).updateFeature(t)}},{key:"addMonitorLayer",value:function(t){var e=V.a.getProps(t.mapContainerId,"layerCollect");e&&e.isExit(t.layerId)&&e.get(t.layerId).addMonitorLayer(t)}},{key:"addMultistageBufferLayer",value:function(t){return new(V.a.getProps(t.mapContainerId,"modules").MultistageBufferLayer())(t,(function(e){t.res=e})).layerId}},{key:"addIndoorLayer",value:function(t){return new(V.a.getProps(t.mapContainerId,"modules").IndoorLayer())(t).layerId}},{key:"switchIndoorLayer",value:function(t){V.a.getProps(t.mapContainerId,"layerCollect").get(t.layerId).switchFloor(t)}},{key:"setIndoorLayerFilter",value:function(t){V.a.getProps(t.mapContainerId,"layerCollect").get(t.layerId).setIndoorLayerFilter(t)}},{key:"addBasicDataLayer",value:function(t){return new(V.a.getProps(t.mapContainerId,"modules").BasicDataLayer())(t,(function(e){t.res=e})).layerId}},{key:"addEditableLayer",value:function(t){return new(0,V.a.getProps(t.mapContainerId,"modules").SpecificLayer)(t,(function(e){t.res=e})).layerId}},{key:"addWFSLayer",value:function(t){var e=JSON.stringify(t);e=JSON.parse(e),Z.a.info("addWFSLayer 参数",e);var r=V.a.getProps(t.mapContainerId,"modules");return new(r.WFSLayer())(t,(function(e){t.res=e})).layerId}},{key:"addRestfulLayer",value:function(t){var e=JSON.stringify(t);e=JSON.parse(e),Z.a.info("addRestfulLayer 参数",e);var r=V.a.getProps(t.mapContainerId,"modules");return new(r.RestfulLayer())(t,(function(e){t.res=e})).layerId}},{key:"updateToken",value:function(t){var e=JSON.stringify(t);e=JSON.parse(e),Z.a.info("updateToken 参数",e);var r=V.a.getProps(t.mapContainerId,"layerCollect");r&&r.isExit(t.layerId)&&r.get(t.layerId).updateToken(t)}},{key:"setLayerEditable",value:function(t){var e=JSON.stringify(t);e=JSON.parse(e),Z.a.info("setLayerEditable 参数",e);var r=V.a.getProps(t.mapContainerId,"layerCollect");r&&r.isExit(t.layerId)&&r.get(t.layerId).setLayerEditable(t)}},{key:"updateDeviceLnglat",value:function(t){var e=JSON.stringify(t);e=JSON.parse(e),Z.a.info("updateDeviceLnglat 参数",e);var r=V.a.getProps(t.mapContainerId,"layerCollect");r&&r.isExit(t.layerId)&&r.get(t.layerId).updateDeviceLnglat(t)}},{key:"addOverlayLayer",value:function(t){return new(V.a.getProps(t.mapContainerId,"modules").OverlayLayer())(t,(function(e){t.res=e})).layerId}},{key:"createLayerGroup",value:function(t){return new(V.a.getProps(t.mapContainerId,"modules").LayerGroup())(t,(function(e){t.res=e})).groupId}},{key:"addImageLayer",value:function(t){return new(V.a.getProps(t.mapContainerId,"modules").ImageLayer())(t,(function(e){t.res=e})).layerId}},{key:"addAdminDivisionLayer",value:function(t){return new(V.a.getProps(t.mapContainerId,"modules").AdminDivisionLayer())(t,(function(e){t.res=e})).layerId}},{key:"cancelLayerEdit",value:function(t){var e=JSON.stringify(t);e=JSON.parse(e),Z.a.info("cancelLayerEdit 参数",e);var r=V.a.getProps(t.mapContainerId,"layerCollect");r&&r.isExit(t.layerId)&&r.get(t.layerId).cancelLayerEdit()}},{key:"addRegionLabelLayer",value:function(t){return new(V.a.getProps(t.mapContainerId,"modules").RegionLabelLayer())(t,(function(e){t.res=e})).layerId}}]),t}(),G()(B.prototype,"addTypicalLayer",[n],Object.getOwnPropertyDescriptor(B.prototype,"addTypicalLayer"),B.prototype),G()(B.prototype,"addCustomLayer",[i],Object.getOwnPropertyDescriptor(B.prototype,"addCustomLayer"),B.prototype),G()(B.prototype,"addMixedClusterLayer",[o],Object.getOwnPropertyDescriptor(B.prototype,"addMixedClusterLayer"),B.prototype),G()(B.prototype,"removeLayer",[a],Object.getOwnPropertyDescriptor(B.prototype,"removeLayer"),B.prototype),G()(B.prototype,"showLayer",[s],Object.getOwnPropertyDescriptor(B.prototype,"showLayer"),B.prototype),G()(B.prototype,"hideLayer",[u],Object.getOwnPropertyDescriptor(B.prototype,"hideLayer"),B.prototype),G()(B.prototype,"addEventOnLayerObject",[c],Object.getOwnPropertyDescriptor(B.prototype,"addEventOnLayerObject"),B.prototype),G()(B.prototype,"removeEventOnLayerObject",[l],Object.getOwnPropertyDescriptor(B.prototype,"removeEventOnLayerObject"),B.prototype),G()(B.prototype,"moveLayer",[h],Object.getOwnPropertyDescriptor(B.prototype,"moveLayer"),B.prototype),G()(B.prototype,"add3DLayer",[p],Object.getOwnPropertyDescriptor(B.prototype,"add3DLayer"),B.prototype),G()(B.prototype,"addPoiLayer",[d],Object.getOwnPropertyDescriptor(B.prototype,"addPoiLayer"),B.prototype),G()(B.prototype,"addRasterLayer",[f],Object.getOwnPropertyDescriptor(B.prototype,"addRasterLayer"),B.prototype),G()(B.prototype,"addStaticLayer",[g],Object.getOwnPropertyDescriptor(B.prototype,"addStaticLayer"),B.prototype),G()(B.prototype,"reloadData",[m],Object.getOwnPropertyDescriptor(B.prototype,"reloadData"),B.prototype),G()(B.prototype,"updateLayer",[y],Object.getOwnPropertyDescriptor(B.prototype,"updateLayer"),B.prototype),G()(B.prototype,"updateFeature",[v],Object.getOwnPropertyDescriptor(B.prototype,"updateFeature"),B.prototype),G()(B.prototype,"addMonitorLayer",[A],Object.getOwnPropertyDescriptor(B.prototype,"addMonitorLayer"),B.prototype),G()(B.prototype,"addMultistageBufferLayer",[_],Object.getOwnPropertyDescriptor(B.prototype,"addMultistageBufferLayer"),B.prototype),G()(B.prototype,"addIndoorLayer",[b],Object.getOwnPropertyDescriptor(B.prototype,"addIndoorLayer"),B.prototype),G()(B.prototype,"switchIndoorLayer",[x],Object.getOwnPropertyDescriptor(B.prototype,"switchIndoorLayer"),B.prototype),G()(B.prototype,"setIndoorLayerFilter",[w],Object.getOwnPropertyDescriptor(B.prototype,"setIndoorLayerFilter"),B.prototype),G()(B.prototype,"addBasicDataLayer",[C],Object.getOwnPropertyDescriptor(B.prototype,"addBasicDataLayer"),B.prototype),G()(B.prototype,"addEditableLayer",[E],Object.getOwnPropertyDescriptor(B.prototype,"addEditableLayer"),B.prototype),G()(B.prototype,"addWFSLayer",[I],Object.getOwnPropertyDescriptor(B.prototype,"addWFSLayer"),B.prototype),G()(B.prototype,"addRestfulLayer",[M],Object.getOwnPropertyDescriptor(B.prototype,"addRestfulLayer"),B.prototype),G()(B.prototype,"updateToken",[S],Object.getOwnPropertyDescriptor(B.prototype,"updateToken"),B.prototype),G()(B.prototype,"setLayerEditable",[T],Object.getOwnPropertyDescriptor(B.prototype,"setLayerEditable"),B.prototype),G()(B.prototype,"updateDeviceLnglat",[P],Object.getOwnPropertyDescriptor(B.prototype,"updateDeviceLnglat"),B.prototype),G()(B.prototype,"addOverlayLayer",[O],Object.getOwnPropertyDescriptor(B.prototype,"addOverlayLayer"),B.prototype),G()(B.prototype,"addImageLayer",[L],Object.getOwnPropertyDescriptor(B.prototype,"addImageLayer"),B.prototype),G()(B.prototype,"addAdminDivisionLayer",[k],Object.getOwnPropertyDescriptor(B.prototype,"addAdminDivisionLayer"),B.prototype),G()(B.prototype,"cancelLayerEdit",[R],Object.getOwnPropertyDescriptor(B.prototype,"cancelLayerEdit"),B.prototype),G()(B.prototype,"addRegionLabelLayer",[D],Object.getOwnPropertyDescriptor(B.prototype,"addRegionLabelLayer"),B.prototype),B)}).call(this,r(597)(t))},function(t,e,r){var n=r(602),i=r(605),o=r(606),a={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},s=Object.keys(a);function u(t){for(var e=o(),r=n(t),i=0;is))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var l=-1,h=!0,p=2&r?new at:void 0;for(o.set(t,e),o.set(e,t);++l-1},it.prototype.set=function(t,e){var r=this.__data__,n=ct(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},ot.prototype.clear=function(){this.size=0,this.__data__={hash:new nt,map:new(Q||it),string:new nt}},ot.prototype.delete=function(t){var e=yt(this,t).delete(t);return this.size-=e?1:0,e},ot.prototype.get=function(t){return yt(this,t).get(t)},ot.prototype.has=function(t){return yt(this,t).has(t)},ot.prototype.set=function(t,e){var r=yt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},at.prototype.add=at.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},at.prototype.has=function(t){return this.__data__.has(t)},st.prototype.clear=function(){this.__data__=new it,this.size=0},st.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},st.prototype.get=function(t){return this.__data__.get(t)},st.prototype.has=function(t){return this.__data__.has(t)},st.prototype.set=function(t,e){var r=this.__data__;if(r instanceof it){var n=r.__data__;if(!Q||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ot(n)}return r.set(t,e),this.size=r.size,this};var At=U?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}function Tt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pt(t){return null!=t&&"object"==typeof t}var Ot=v?function(t){return function(e){return t(e)}}(v):function(t){return Pt(t)&&St(t.length)&&!!c[lt(t)]};function Lt(t){return null!=(e=t)&&St(e.length)&&!Mt(e)?ut(t):ft(t);var e}r.exports=function(t,e){return pt(t,e)}}).call(this,r(123),r(190)(t))},function(t,e,r){var n=r(607),i=r(609);t.exports.hint=function(t,e){var r,o=[];if("object"==typeof t)r=t;else{if("string"!=typeof t)return[{message:"Expected string or object as input",line:0}];try{r=n.parse(t)}catch(t){var a=t.message.match(/line (\d+)/);return[{line:parseInt(a[1],10)-1,message:t.message,error:t}]}}return o=o.concat(i.hint(r,e))}},function(t,e,r){var n=r(295),i=r(636);t.exports=function(t,e){var r=[];if(!t||!t.length)return r;var o=-1,a=[],s=t.length;for(e=n(e,3);++o>>0):4294967296*(e>>>0)+(t>>>0)}function s(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function u(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function A(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=y(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=A(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=y(this.buf,this.pos)+4294967296*y(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=y(this.buf,this.pos)+4294967296*A(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return a(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return a(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return a(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return a(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return a(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return a(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,r){var n="",i=e;for(;i239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=l}return n}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=o(this);for(t=t||[];this.pos127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&s(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),n.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),n.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&s(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,i.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,u,e)},writePackedSVarint:function(t,e){this.writeMessage(t,c,e)},writePackedBoolean:function(t,e){this.writeMessage(t,p,e)},writePackedFloat:function(t,e){this.writeMessage(t,l,e)},writePackedDouble:function(t,e){this.writeMessage(t,h,e)},writePackedFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,f,e)},writePackedFixed64:function(t,e){this.writeMessage(t,g,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},function(t,e,r){(function(e){t.exports=function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};e[a][0].call(c.exports,(function(t){var r=e[a][1][t];return i(r||t)}),c,c.exports,t,e,r,n)}return r[a].exports}for(var o=!1,a=0;ai;i++)n[i-1]=arguments[i];for(var o=0;o1?this._listeners[t]=r.slice(0,n).concat(r.slice(n+1)):delete this._listeners[t]):void 0}},r.prototype.dispatchEvent=function(){var t=arguments[0],e=t.type,r=1===arguments.length?[t]:Array.apply(null,arguments);if(this["on"+e]&&this["on"+e].apply(this,r),e in this._listeners)for(var n=this._listeners[e],i=0;i=3e3&&4999>=t}t("./shims");var o,a=t("url-parse"),s=t("inherits"),u=t("json3"),c=t("./utils/random"),l=t("./utils/escape"),h=t("./utils/url"),p=t("./utils/event"),d=t("./utils/transport"),f=t("./utils/object"),g=t("./utils/browser"),m=t("./utils/log"),y=t("./event/event"),v=t("./event/eventtarget"),A=t("./location"),_=t("./event/close"),b=t("./event/trans-message"),x=t("./info-receiver");s(n,v),n.prototype.close=function(t,e){if(t&&!i(t))throw new Error("InvalidAccessError: Invalid code");if(e&&e.length>123)throw new SyntaxError("reason argument has an invalid length");this.readyState!==n.CLOSING&&this.readyState!==n.CLOSED&&this._close(t||1e3,e||"Normal closure",!0)},n.prototype.send=function(t){if("string"!=typeof t&&(t=""+t),this.readyState===n.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===n.OPEN&&this._transport.send(l.quote(t))},n.version=t("./version"),n.CONNECTING=0,n.OPEN=1,n.CLOSING=2,n.CLOSED=3,n.prototype._receiveInfo=function(t,e){if(this._ir=null,t){this._rto=this.countRTO(e),this._transUrl=t.base_url?t.base_url:this.url,t=f.extend(t,this._urlInfo);var r=o.filterToEnabled(this._transportsWhitelist,t);this._transports=r.main,this._connect()}else this._close(1002,"Cannot connect to server")},n.prototype._connect=function(){for(var t=this._transports.shift();t;t=this._transports.shift()){if(t.needBody&&(!e.document.body||void 0!==e.document.readyState&&"complete"!==e.document.readyState&&"interactive"!==e.document.readyState))return this._transports.unshift(t),void p.attachEvent("load",this._connect.bind(this));var r=this._rto*t.roundTrips||5e3;this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),r);var n=h.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),i=this._transportOptions[t.transportName],o=new t(n,this._transUrl,i);return o.on("message",this._transportMessage.bind(this)),o.once("close",this._transportClose.bind(this)),o.transportName=t.transportName,void(this._transport=o)}this._close(2e3,"All transports failed",!1)},n.prototype._transportTimeout=function(){this.readyState===n.CONNECTING&&this._transportClose(2007,"Transport timed out")},n.prototype._transportMessage=function(t){var e,r=this,n=t.slice(0,1),i=t.slice(1);switch(n){case"o":return void this._open();case"h":return void this.dispatchEvent(new y("heartbeat"))}if(i)try{e=u.parse(i)}catch(t){}if(void 0!==e)switch(n){case"a":Array.isArray(e)&&e.forEach((function(t){r.dispatchEvent(new b(t))}));break;case"m":this.dispatchEvent(new b(e));break;case"c":Array.isArray(e)&&2===e.length&&this._close(e[0],e[1],!0)}},n.prototype._transportClose=function(t,e){return this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),i(t)||2e3===t||this.readyState!==n.CONNECTING?void this._close(t,e):void this._connect()},n.prototype._open=function(){this.readyState===n.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=n.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new y("open"))):this._close(1006,"Server lost session")},n.prototype._close=function(t,e,r){var i=!1;if(this._ir&&(i=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===n.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=n.CLOSING,setTimeout(function(){this.readyState=n.CLOSED,i&&this.dispatchEvent(new y("error"));var o=new _("close");o.wasClean=r||!1,o.code=t||1e3,o.reason=e,this.dispatchEvent(o),this.onmessage=this.onclose=this.onerror=null}.bind(this),0)},n.prototype.countRTO=function(t){return t>100?4*t:300+t},r.exports=function(e){return o=d(e),t("./iframe-bootstrap")(n,e),n}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./event/close":2,"./event/event":4,"./event/eventtarget":5,"./event/trans-message":6,"./iframe-bootstrap":8,"./info-receiver":12,"./location":13,"./shims":15,"./utils/browser":44,"./utils/escape":45,"./utils/event":46,"./utils/log":48,"./utils/object":49,"./utils/random":50,"./utils/transport":51,"./utils/url":52,"./version":53,debug:void 0,inherits:54,json3:55,"url-parse":56}],15:[function(){"use strict";function t(t){var e=+t;return e!=e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}function e(){}var r,n=Array.prototype,i=Object.prototype,o=Function.prototype,a=String.prototype,s=n.slice,u=i.toString,c=function(t){return"[object Function]"===i.toString.call(t)},l=function(t){return"[object String]"===u.call(t)},h=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}();r=h?function(t,e,r,n){!n&&e in t||Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:!0,value:r})}:function(t,e,r,n){!n&&e in t||(t[e]=r)};var p=function(t,e,n){for(var o in e)i.hasOwnProperty.call(e,o)&&r(t,o,e[o],n)},d=function(t){if(null==t)throw new TypeError("can't convert "+t+" to object");return Object(t)};p(o,{bind:function(t){var r=this;if(!c(r))throw new TypeError("Function.prototype.bind called on incompatible "+r);for(var n=s.call(arguments,1),i=function(){if(this instanceof l){var e=r.apply(this,n.concat(s.call(arguments)));return Object(e)===e?e:this}return r.apply(t,n.concat(s.call(arguments)))},o=Math.max(0,r.length-n.length),a=[],u=0;o>u;u++)a.push("$"+u);var l=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this, arguments); }")(i);return r.prototype&&(e.prototype=r.prototype,l.prototype=new e,e.prototype=null),l}}),p(Array,{isArray:function(t){return"[object Array]"===u.call(t)}});var f=Object("a"),g="a"!==f[0]||!(0 in f);p(n,{forEach:function(t){var e=d(this),r=g&&l(this)?this.split(""):e,n=arguments[1],i=-1,o=r.length>>>0;if(!c(t))throw new TypeError;for(;++i>>0;if(!n)return-1;var i=0;for(arguments.length>1&&(i=t(arguments[1])),i=i>=0?i:Math.max(0,n+i);n>i;i++)if(i in r&&r[i]===e)return i;return-1}},m);var y=a.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?function(){var t=void 0===/()??/.exec("")[1];a.split=function(e,r){var i=this;if(void 0===e&&0===r)return[];if("[object RegExp]"!==u.call(e))return y.call(this,e,r);var o,a,s,c,l=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),p=0;for(e=new RegExp(e.source,h+"g"),i+="",t||(o=new RegExp("^"+e.source+"$(?!\\s)",h)),r=void 0===r?-1>>>0:function(t){return t>>>0}(r);(a=e.exec(i))&&!((s=a.index+a[0].length)>p&&(l.push(i.slice(p,a.index)),!t&&a.length>1&&a[0].replace(o,(function(){for(var t=1;t1&&a.index=r));)e.lastIndex===a.index&&e.lastIndex++;return p===i.length?(c||!e.test(""))&&l.push(""):l.push(i.slice(p)),l.length>r?l.slice(0,r):l}}():"0".split(void 0,0).length&&(a.split=function(t,e){return void 0===t&&0===e?[]:y.call(this,t,e)});var v="\t\n\v\f\r 聽釟€釥庘€€鈥佲€傗€冣€勨€呪€嗏€団€堚€夆€娾€仧銆€\u2028\u2029锘�",A="["+v+"]",_=new RegExp("^"+A+A+"*"),b=new RegExp(A+A+"*$"),x=a.trim&&(v.trim()||!"鈥�".trim());p(a,{trim:function(){if(null==this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(_,"").replace(b,"")}},x);var w=a.substr,C="".substr&&"b"!=="0b".substr(-1);p(a,{substr:function(t,e){return w.call(this,0>t&&(t=this.length+t)<0?0:t,e)}},C)},{}],16:[function(t,e){"use strict";e.exports=[t("./transport/websocket"),t("./transport/xhr-streaming"),t("./transport/xdr-streaming"),t("./transport/eventsource"),t("./transport/lib/iframe-wrap")(t("./transport/eventsource")),t("./transport/htmlfile"),t("./transport/lib/iframe-wrap")(t("./transport/htmlfile")),t("./transport/xhr-polling"),t("./transport/xdr-polling"),t("./transport/lib/iframe-wrap")(t("./transport/xhr-polling")),t("./transport/jsonp-polling")]},{"./transport/eventsource":20,"./transport/htmlfile":21,"./transport/jsonp-polling":23,"./transport/lib/iframe-wrap":26,"./transport/websocket":38,"./transport/xdr-polling":39,"./transport/xdr-streaming":40,"./transport/xhr-polling":41,"./transport/xhr-streaming":42}],17:[function(t,r){(function(e){"use strict";function n(t,e,r,n){var o=this;i.call(this),setTimeout((function(){o._start(t,e,r,n)}),0)}var i=t("events").EventEmitter,o=t("inherits"),a=t("../../utils/event"),s=t("../../utils/url"),u=e.XMLHttpRequest;o(n,i),n.prototype._start=function(t,e,r,i){var o=this;try{this.xhr=new u}catch(t){}if(!this.xhr)return this.emit("finish",0,"no xhr support"),void this._cleanup();e=s.addQuery(e,"t="+ +new Date),this.unloadRef=a.unloadAdd((function(){o._cleanup(!0)}));try{this.xhr.open(t,e,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){o.emit("finish",0,""),o._cleanup(!1)})}catch(t){return this.emit("finish",0,""),void this._cleanup(!1)}if(i&&i.noCredentials||!n.supportsCORS||(this.xhr.withCredentials="true"),i&&i.headers)for(var c in i.headers)this.xhr.setRequestHeader(c,i.headers[c]);this.xhr.onreadystatechange=function(){if(o.xhr){var t,e,r=o.xhr;switch(r.readyState){case 3:try{e=r.status,t=r.responseText}catch(t){}1223===e&&(e=204),200===e&&t&&t.length>0&&o.emit("chunk",e,t);break;case 4:1223===(e=r.status)&&(e=204),(12005===e||12029===e)&&(e=0),o.emit("finish",e,r.responseText),o._cleanup(!1)}}};try{o.xhr.send(r)}catch(t){o.emit("finish",0,""),o._cleanup(!1)}},n.prototype._cleanup=function(t){if(this.xhr){if(this.removeAllListeners(),a.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),t)try{this.xhr.abort()}catch(t){}this.unloadRef=this.xhr=null}},n.prototype.close=function(){this._cleanup(!0)},n.enabled=!!u;var c=["Active"].concat("Object").join("X");!n.enabled&&c in e&&(u=function(){try{return new e[c]("Microsoft.XMLHTTP")}catch(t){return null}},n.enabled=!!new u);var l=!1;try{l="withCredentials"in new u}catch(t){}n.supportsCORS=l,r.exports=n}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/event":46,"../../utils/url":52,debug:void 0,events:3,inherits:54}],18:[function(t,r){(function(t){r.exports=t.EventSource}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(t,r){(function(t){"use strict";var e=t.WebSocket||t.MozWebSocket;e&&(r.exports=function(t){return new e(t)})}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],20:[function(t,e){"use strict";function r(t){if(!r.enabled())throw new Error("Transport created when disabled");i.call(this,t,"/eventsource",o,a)}var n=t("inherits"),i=t("./lib/ajax-based"),o=t("./receiver/eventsource"),a=t("./sender/xhr-cors"),s=t("eventsource");n(r,i),r.enabled=function(){return!!s},r.transportName="eventsource",r.roundTrips=2,e.exports=r},{"./lib/ajax-based":24,"./receiver/eventsource":29,"./sender/xhr-cors":35,eventsource:18,inherits:54}],21:[function(t,e){"use strict";function r(t){if(!i.enabled)throw new Error("Transport created when disabled");a.call(this,t,"/htmlfile",i,o)}var n=t("inherits"),i=t("./receiver/htmlfile"),o=t("./sender/xhr-local"),a=t("./lib/ajax-based");n(r,a),r.enabled=function(t){return i.enabled&&t.sameOrigin},r.transportName="htmlfile",r.roundTrips=2,e.exports=r},{"./lib/ajax-based":24,"./receiver/htmlfile":30,"./sender/xhr-local":37,inherits:54}],22:[function(t,e){"use strict";function r(t,e,n){if(!r.enabled())throw new Error("Transport created when disabled");o.call(this);var i=this;this.origin=s.getOrigin(n),this.baseUrl=n,this.transUrl=e,this.transport=t,this.windowId=l.string(8);var a=s.addPath(n,"/iframe.html")+"#"+this.windowId;this.iframeObj=u.createIframe(a,(function(t){i.emit("close",1006,"Unable to load an iframe ("+t+")"),i.close()})),this.onmessageCallback=this._message.bind(this),c.attachEvent("message",this.onmessageCallback)}var n=t("inherits"),i=t("json3"),o=t("events").EventEmitter,a=t("../version"),s=t("../utils/url"),u=t("../utils/iframe"),c=t("../utils/event"),l=t("../utils/random");n(r,o),r.prototype.close=function(){if(this.removeAllListeners(),this.iframeObj){c.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(t){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},r.prototype._message=function(t){if(s.isOriginEqual(t.origin,this.origin)){var e;try{e=i.parse(t.data)}catch(t){return}if(e.windowId===this.windowId)switch(e.type){case"s":this.iframeObj.loaded(),this.postMessage("s",i.stringify([a,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",e.data);break;case"c":var r;try{r=i.parse(e.data)}catch(t){return}this.emit("close",r[0],r[1]),this.close()}}},r.prototype.postMessage=function(t,e){this.iframeObj.post(i.stringify({windowId:this.windowId,type:t,data:e||""}),this.origin)},r.prototype.send=function(t){this.postMessage("m",t)},r.enabled=function(){return u.iframeEnabled},r.transportName="iframe",r.roundTrips=2,e.exports=r},{"../utils/event":46,"../utils/iframe":47,"../utils/random":50,"../utils/url":52,"../version":53,debug:void 0,events:3,inherits:54,json3:55}],23:[function(t,r){(function(e){"use strict";function n(t){if(!n.enabled())throw new Error("Transport created when disabled");o.call(this,t,"/jsonp",s,a)}var i=t("inherits"),o=t("./lib/sender-receiver"),a=t("./receiver/jsonp"),s=t("./sender/jsonp");i(n,o),n.enabled=function(){return!!e.document},n.transportName="jsonp-polling",n.roundTrips=1,n.needBody=!0,r.exports=n}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/sender-receiver":28,"./receiver/jsonp":31,"./sender/jsonp":33,inherits:54}],24:[function(t,e){"use strict";function r(t,e,r,n){o.call(this,t,e,function(t){return function(e,r,n){var o={};"string"==typeof r&&(o.headers={"Content-type":"text/plain"});var a=i.addPath(e,"/xhr_send"),s=new t("POST",a,r,o);return s.once("finish",(function(t){return s=null,200!==t&&204!==t?n(new Error("http status "+t)):void n()})),function(){s.close(),s=null;var t=new Error("Aborted");t.code=1e3,n(t)}}}(n),r,n)}var n=t("inherits"),i=t("../../utils/url"),o=t("./sender-receiver");n(r,o),e.exports=r},{"../../utils/url":52,"./sender-receiver":28,debug:void 0,inherits:54}],25:[function(t,e){"use strict";function r(t,e){i.call(this),this.sendBuffer=[],this.sender=e,this.url=t}var n=t("inherits"),i=t("events").EventEmitter;n(r,i),r.prototype.send=function(t){this.sendBuffer.push(t),this.sendStop||this.sendSchedule()},r.prototype.sendScheduleWait=function(){var t,e=this;this.sendStop=function(){e.sendStop=null,clearTimeout(t)},t=setTimeout((function(){e.sendStop=null,e.sendSchedule()}),25)},r.prototype.sendSchedule=function(){var t=this;if(this.sendBuffer.length>0){var e="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,e,(function(e){t.sendStop=null,e?(t.emit("close",e.code||1006,"Sending error: "+e),t._cleanup()):t.sendScheduleWait()})),this.sendBuffer=[]}},r.prototype._cleanup=function(){this.removeAllListeners()},r.prototype.stop=function(){this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},e.exports=r},{debug:void 0,events:3,inherits:54}],26:[function(t,r){(function(e){"use strict";var n=t("inherits"),i=t("../iframe"),o=t("../../utils/object");r.exports=function(t){function r(e,r){i.call(this,t.transportName,e,r)}return n(r,i),r.enabled=function(r,n){if(!e.document)return!1;var a=o.extend({},n);return a.sameOrigin=!0,t.enabled(a)&&i.enabled()},r.transportName="iframe-"+t.transportName,r.needBody=!0,r.roundTrips=i.roundTrips+t.roundTrips-1,r.facadeTransport=t,r}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/object":49,"../iframe":22,inherits:54}],27:[function(t,e){"use strict";function r(t,e,r){i.call(this),this.Receiver=t,this.receiveUrl=e,this.AjaxObject=r,this._scheduleReceiver()}var n=t("inherits"),i=t("events").EventEmitter;n(r,i),r.prototype._scheduleReceiver=function(){var t=this,e=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);e.on("message",(function(e){t.emit("message",e)})),e.once("close",(function(r,n){t.poll=e=null,t.pollIsClosing||("network"===n?t._scheduleReceiver():(t.emit("close",r||1006,n),t.removeAllListeners()))}))},r.prototype.abort=function(){this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},e.exports=r},{debug:void 0,events:3,inherits:54}],28:[function(t,e){"use strict";function r(t,e,r,n,s){var u=i.addPath(t,e),c=this;o.call(this,t,r),this.poll=new a(n,u,s),this.poll.on("message",(function(t){c.emit("message",t)})),this.poll.once("close",(function(t,e){c.poll=null,c.emit("close",t,e),c.close()}))}var n=t("inherits"),i=t("../../utils/url"),o=t("./buffered-sender"),a=t("./polling");n(r,o),r.prototype.close=function(){this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null),this.stop()},e.exports=r},{"../../utils/url":52,"./buffered-sender":25,"./polling":27,debug:void 0,inherits:54}],29:[function(t,e){"use strict";function r(t){i.call(this);var e=this,r=this.es=new o(t);r.onmessage=function(t){e.emit("message",decodeURI(t.data))},r.onerror=function(t){var n=2!==r.readyState?"network":"permanent";e._cleanup(),e._close(n)}}var n=t("inherits"),i=t("events").EventEmitter,o=t("eventsource");n(r,i),r.prototype.abort=function(){this._cleanup(),this._close("user")},r.prototype._cleanup=function(){var t=this.es;t&&(t.onmessage=t.onerror=null,t.close(),this.es=null)},r.prototype._close=function(t){var e=this;setTimeout((function(){e.emit("close",null,t),e.removeAllListeners()}),200)},e.exports=r},{debug:void 0,events:3,eventsource:18,inherits:54}],30:[function(t,r){(function(e){"use strict";function n(t){s.call(this);var r=this;o.polluteGlobalNamespace(),this.id="a"+u.string(6),t=a.addQuery(t,"c="+decodeURIComponent(o.WPrefix+"."+this.id));var i=n.htmlfileEnabled?o.createHtmlfile:o.createIframe;e[o.WPrefix][this.id]={start:function(){r.iframeObj.loaded()},message:function(t){r.emit("message",t)},stop:function(){r._cleanup(),r._close("network")}},this.iframeObj=i(t,(function(){r._cleanup(),r._close("permanent")}))}var i=t("inherits"),o=t("../../utils/iframe"),a=t("../../utils/url"),s=t("events").EventEmitter,u=t("../../utils/random");i(n,s),n.prototype.abort=function(){this._cleanup(),this._close("user")},n.prototype._cleanup=function(){this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete e[o.WPrefix][this.id]},n.prototype._close=function(t){this.emit("close",null,t),this.removeAllListeners()},n.htmlfileEnabled=!1;var c=["Active"].concat("Object").join("X");if(c in e)try{n.htmlfileEnabled=!!new e[c]("htmlfile")}catch(t){}n.enabled=n.htmlfileEnabled||o.iframeEnabled,r.exports=n}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,debug:void 0,events:3,inherits:54}],31:[function(t,r){(function(e){"use strict";function n(t){var r=this;c.call(this),i.polluteGlobalNamespace(),this.id="a"+o.string(6);var a=s.addQuery(t,"c="+encodeURIComponent(i.WPrefix+"."+this.id));e[i.WPrefix][this.id]=this._callback.bind(this),this._createScript(a),this.timeoutId=setTimeout((function(){r._abort(new Error("JSONP script loaded abnormally (timeout)"))}),n.timeout)}var i=t("../../utils/iframe"),o=t("../../utils/random"),a=t("../../utils/browser"),s=t("../../utils/url"),u=t("inherits"),c=t("events").EventEmitter;u(n,c),n.prototype.abort=function(){if(e[i.WPrefix][this.id]){var t=new Error("JSONP user aborted read");t.code=1e3,this._abort(t)}},n.timeout=35e3,n.scriptErrorTimeout=1e3,n.prototype._callback=function(t){this._cleanup(),this.aborting||(t&&this.emit("message",t),this.emit("close",null,"network"),this.removeAllListeners())},n.prototype._abort=function(t){this._cleanup(),this.aborting=!0,this.emit("close",t.code,t.message),this.removeAllListeners()},n.prototype._cleanup=function(){if(clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var t=this.script;t.parentNode.removeChild(t),t.onreadystatechange=t.onerror=t.onload=t.onclick=null,this.script=null}delete e[i.WPrefix][this.id]},n.prototype._scriptError=function(){var t=this;this.errorTimer||(this.errorTimer=setTimeout((function(){t.loadedOkay||t._abort(new Error("JSONP script loaded abnormally (onerror)"))}),n.scriptErrorTimeout))},n.prototype._createScript=function(t){var r,n=this,i=this.script=e.document.createElement("script");if(i.id="a"+o.string(8),i.src=t,i.type="text/javascript",i.charset="UTF-8",i.onerror=this._scriptError.bind(this),i.onload=function(){n._abort(new Error("JSONP script loaded abnormally (onload)"))},i.onreadystatechange=function(){if(/loaded|closed/.test(i.readyState)){if(i&&i.htmlFor&&i.onclick){n.loadedOkay=!0;try{i.onclick()}catch(t){}}i&&n._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},void 0===i.async&&e.document.attachEvent)if(a.isOpera())(r=this.script2=e.document.createElement("script")).text="try{var a = document.getElementById('"+i.id+"'); if(a)a.onerror();}catch(x){};",i.async=r.async=!1;else{try{i.htmlFor=i.id,i.event="onclick"}catch(t){}i.async=!0}void 0!==i.async&&(i.async=!0);var s=e.document.getElementsByTagName("head")[0];s.insertBefore(i,s.firstChild),r&&s.insertBefore(r,s.firstChild)},r.exports=n}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/browser":44,"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,debug:void 0,events:3,inherits:54}],32:[function(t,e){"use strict";function r(t,e){i.call(this);var r=this;this.bufferPosition=0,this.xo=new e("POST",t,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",(function(t,e){r._chunkHandler(t,e),r.xo=null;var n=200===t?"network":"permanent";r.emit("close",null,n),r._cleanup()}))}var n=t("inherits"),i=t("events").EventEmitter;n(r,i),r.prototype._chunkHandler=function(t,e){if(200===t&&e)for(var r=-1;;this.bufferPosition+=r+1){var n=e.slice(this.bufferPosition);if(-1===(r=n.indexOf("\n")))break;var i=n.slice(0,r);i&&this.emit("message",i)}},r.prototype._cleanup=function(){this.removeAllListeners()},r.prototype.abort=function(){this.xo&&(this.xo.close(),this.emit("close",null,"user"),this.xo=null),this._cleanup()},e.exports=r},{debug:void 0,events:3,inherits:54}],33:[function(t,r){(function(e){"use strict";function n(t){try{return e.document.createElement('