PageSourceSearch

https://app.planscape.org/137.b746a79d30bf049b.js

js planscape.org collected 2026-10-03 23:25:02 UTC 1,244,115 bytes, 4 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3621ba2d-842e-52e3-b50d-2dcdefe8562b")}catch(e){}}();
3(self.webpackChunkinterface=self.webpackChunkinterface||[]).push([[137],{4902:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{K:()=>ht,e:()=>se});const ht=[-126,31,-100,47],se={MAPLIBRE_MAP_INITIAL_ZOOM:9,MAPLIBRE_MAP_MIN_ZOOM:4,MAPLIBRE_MAP_MAX_ZOOM:17,MAPLIBRE_MAP_VECTOR_LAYER_OPACITY:.5,MAPLIBRE_MAP_DATA_LAYER_OPACITY:.75,MAPLIBRE_MAP_DATA_LAYER_TILESIZE:512,MAPLIBRE_DEFAULT_BOUNDS:ht,MAPLIBRE_BOUND_OPTIONS:{padding:{top:80,bottom:60,left:20,right:20}}}},3765:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{I:()=>ht});const ht={road:"mapbox://styles/mapbox/light-v10",terrain:"mapbox://styles/mapbox/outdoors-v11",satellite:"mapbox://styles/mapbox/satellite-v9"}},1880:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{W:()=>ci});var ht=Tt(653),se=Tt.n(ht),Z=Tt(6494),li=Tt(8559);let ci=(()=>{class Ut{constructor(){this.initialized=!1}initialize(){this.initialized||(this.addProtocols(),this.initialized=!0)}addProtocols(){se().addProtocol("cog",Z.cogProtocol)}static{this.\u0275fac=function(Qi){return new(Qi||Ut)}}static{this.\u0275prov=li.jDH({token:Ut,factory:Ut.\u0275fac})}}return Ut})()},4838:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{q:()=>at});var ht=Tt(5797),se=Tt(271),Z=Tt(3765),g=Tt(1567),li=Tt(5718),ci=Tt(4902),Ut=Tt(8559);let at=(()=>{class Ee{constructor(){this._baseMap$=new ht.t(li.x7),this.baseMap$=this._baseMap$.asObservable(),this.baseMapUrl$=this.baseMap$.pipe((0,se.T)(Vt=>Z.I[Vt])),this._dataLayersOpacity$=new ht.t(ci.e.MAPLIBRE_MAP_DATA_LAYER_OPACITY),this.dataLayersOpacity$=this._dataLayersOpacity$.asObservable(),this._mapExtent$=new ht.t(null),this.mapExtent$=this._mapExtent$.asObservable().pipe((0,g.p)(Vt=>!!Vt)),this._showProjectAreasLayer$=new ht.t(!0),this.showProjectAreasLayer$=this._showProjectAreasLayer$.asObservable(),this._standSelectionEnabled$=new ht.t(!1),this.standSelectionEnabled$=this._standSelectionEnabled$.asObservable(),this._cursor$=new ht.t(""),this.cursor$=this._cursor$.asObservable(),this._showMapControls$=new ht.t(!1),this.showMapControls$=this._showMapControls$.asObservable(),this._showTreatmentLegend$=new ht.t(!1),this.showTreatmentLegend$=this._showTreatmentLegend$.asObservable(),this.defaultStandsOpacity=.8,this._treatedStandsOpacity=new ht.t(this.defaultStandsOpacity),this.treatedStandsOpacity$=this._treatedStandsOpacity.asObservable(),this._opacity=new ht.t(ci.e.MAPLIBRE_MAP_VECTOR_LAYER_OPACITY),this.opacity$=this._opacity.asObservable(),this.defaultZoomLevel=7,this.zoomLevel$=new ht.t(this.defaultZoomLevel),this._mapInteractionMode$=new ht.t("view"),this.mapInteractionMode$=this._mapInteractionMode$.asObservable()}updateBaseMap(Vt){this._baseMap$.next(Vt)}updateMapCenter(Vt){this._mapExtent$.next(Vt)}updateShowProjectAreas(Vt){this._showProjectAreasLayer$.next(Vt)}setStandSelectionEnabled(Vt){this._standSelectionEnabled$.next(Vt),this.resetCursor()}isStandSelectionEnabled(){return this._standSelectionEnabled$.value}setCursor(Vt){this._cursor$.next(Vt)}resetCursor(){this._cursor$.next(this._standSelectionEnabled$.value?"crosshair":"")}setShowMapControls(Vt){this._showMapControls$.next(Vt)}setTreatmentLegendVisible(Vt){this._showTreatmentLegend$.next(Vt)}setTreatedStandsOpacity(Vt){this._treatedStandsOpacity.next(Vt)}setOpacity(Vt){this._opacity.next(Vt)}enterDrawingMode(){this._mapInteractionMode$.next("draw")}enterUploadMode(){this._mapInteractionMode$.next("upload")}enterViewMode(){this._mapInteractionMode$.next("view")}updateDataLayersOpacity(Vt){this._dataLayersOpacity$.next(Vt)}static{this.\u0275fac=function(Ii){return new(Ii||Ee)}}static{this.\u0275prov=Ut.jDH({token:Ee,factory:Ee.\u0275fac})}}return Ee})()},5143:(Gr,Vi,Tt)=>{"use strict";function Z(lt){const it=lt.match(/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/);if(!it)throw new Error("Unable to parse URL object");return{protocol:it[1],authority:it[2],path:it[3]||"/",params:it[4]?it[4].split("&"):[]}}function g(lt,Pe){const it=Z("https://api.mapbox.com");lt.protocol=it.protocol,lt.authority=it.authority,lt.params.push(`access_token=${Pe}`);const ri=lt.params.length?`?${lt.params.join("&")}`:"";return`${lt.protocol}://${lt.authority}${lt.path}${ri}`}function li(lt,Pe){const it=Z(lt);return it.path=`/styles/v1${it.path}`,g(it,Pe)}function ci(lt,Pe){const it=Z(lt);return it.path=`/fonts/v1${it.path}`,g(it,Pe)}function Ut(lt,Pe){const it=Z(lt);return it.path=`/v4/${it.authority}.json`,it.params.push("secure"),g(it,Pe)}function at(lt,Pe){const it=Z(lt);let ri=it.path.split("."),wi=ri[0];const Rt=ri[1];let Bt="";return wi.indexOf("@2x")&&(wi=wi.split("@2x")[0],Bt="@2x"),it.path=`/styles/v1${wi}/sprite${Bt}.${Rt}`,g(it,Pe)}Tt.d(Vi,{_t:()=>mt,zh:()=>fi,Fq:()=>je,Gx:()=>kt,UX:()=>mi,Me:()=>Qt,qf:()=>bi,FG:()=>
3ot});var Ee=Tt(5312),Qi=Tt(1723),Vt=Tt(1774),Ii=Tt(1573),$i=Tt(248);function mi(lt,Pe){const it=[lt.x,lt.y],ri=[Pe.x,Pe.y];return[[Math.min(it[0],ri[0]),Math.min(it[1],ri[1])],[Math.max(it[0],ri[0]),Math.max(it[1],ri[1])]]}function fi(lt,Pe,it){return function ht(lt){return 0===lt.indexOf("mapbox:")}(lt)&&Pe?function se(lt,Pe,it){return lt.indexOf("/styles/")>-1&&-1===lt.indexOf("/sprite")?{url:li(lt,it)}:lt.indexOf("/sprites/")>-1?{url:at(lt,it)}:lt.indexOf("/fonts/")>-1?{url:ci(lt,it)}:lt.indexOf("/v4/")>-1||"Source"===Pe?{url:Ut(lt,it)}:void 0}(lt,Pe,Ee.c.mapbox_key):function Wt(lt,Pe,it){return"Tile"===Pe&&lt.includes("planscape.org")?{url:lt,headers:{Authorization:it?"Bearer "+it:""}}:{url:lt}}(lt,Pe,it)}function Qt(lt){return(0,Qi.A)({type:"Feature",geometry:lt,properties:{}})}function bi(lt){return[lt.getWest(),lt.getSouth(),lt.getEast(),lt.getNorth()]}function _t(lt){return{center:lt.getCenter(),zoom:lt.getZoom(),bearing:lt.getBearing(),pitch:lt.getPitch()}}function ot(...lt){const Pe=_t(lt[0]);lt.slice(1).forEach(Rt=>{Rt.loaded()?Rt.jumpTo(Pe):Rt.once("load",()=>Rt.jumpTo(Pe))});const it=Rt=>
3{if(!Rt.originalEvent)return;const Bt=_t(Rt.target);lt.forEach(At=>{At!==Rt.target&&At.jumpTo(Bt)})},ri=Rt=>{Rt.originalEvent&&lt.forEach(Bt=>{Bt!==Rt.target&&Bt.fire("movestart",{broadcast:!0})})},wi=Rt=>{Rt.originalEvent&&lt.forEach(Bt=>{Bt!==Rt.target&&Bt.fire("moveend",{broadcast:!0})})};return lt.forEach(Rt=>{Rt.on("move",it),Rt.on("movestart",ri),Rt.on("moveend",wi)}),()=>{lt.forEach(Rt=>{Rt.off("move",it),Rt.off("movestart",ri),Rt.off("moveend",wi)})}}function It(lt){const Pe=Number(lt);return isNaN(Pe)?Vt.HH.OPACITY:Pe}function je(lt,Pe){return{"fill-color":lt||Vt.HH.COLOR,"fill-opacity":["case",["boolean",["feature-state","hover"],!1],.5,It(Pe)]}}function kt(lt){return{"line-color":lt||Vt.HH.COLOR,"line-width":["case",["boolean",["feature-state","hover"],!1],3,1]}}function mt(lt){const Pe=(0,$i.W)("4046.8564213562374");return(0,$i.W)((0,Ii.A)(lt)).div(Pe).toNumber()}},1714:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{r:()=>Vt});var ht=Tt(3691),se=Tt(7486),Z=Tt(316),g=Tt(9452),li=Tt(271),ci=Tt(8640),Ut=Tt(8559),at=Tt(5046);const Ee=Ii=>[Ii];function Qi(Ii,$i){if(1&Ii&&(Ut.qex(0),Ut.nrm(1,"mgl-vector-source",1)(2,"mgl-layer",2),Ut.bVm()),2&Ii){const mi=$i.ngIf,Wt=Ut.XpG();Ut.R7$(),Ut.Y8G("id",Wt.sourceName)("tiles",Ut.eq3(6,Ee,mi)),Ut.R7$(),Ut.Y8G("source",Wt.sourceName)("sourceLayer",Wt.sourceName)("paint",Wt.linePaint)("before",Wt.before)}}let Vt=(()=>{class Ii{constructor(mi){this.planState=mi,this.before="",this.lineColor=se.L1.blue,this.planId=null,this.sharedLinkUuid=null,this.linePaint={"line-color":this.lineColor,"line-width":2,"line-opacity":.8},this.sourceName=ci.t.planningArea.sources.planningArea}ngOnInit(){this.setTilesUrl()}ngOnChanges(mi){(mi.planId||mi.sharedLinkUuid)&&this.setTilesUrl()}setTilesUrl(){this.tilesUrl$=null===this.planId?this.sharedLinkUuid?(0,g.of)(`${ci.t.planningAreaByForSharedLink.tilesUrl}?uuid=${this.sharedLinkUuid}`):this.planState.currentPlanId$.pipe((0,li.T)(mi=>`${ci.t.planningArea.tilesUrl}?id=${mi}`)):(0,g.of)(`${ci.t.planningArea.tilesUrl}?id=${this.planId}`)}static{this.\u0275fac=function(Wt){return new(Wt||Ii)(Ut.rXU(at.j))}}static{this.\u0275cmp=Ut.VBU({type:Ii,selectors:[["app-planning-area-layer"]],inputs:{before:"before",lineColor:"lineColor",planId:"planId",sharedLinkUuid:"sharedLinkUuid"},standalone:!0,features:[Ut.OA$,Ut.aNF],decls:2,vars:3,consts:[[4,"ngIf"],[3,"id","tiles"],["id","planning-area-polygon","type","line",3,"source","sourceLayer","paint","before"]],template:function(Wt,fi){1&Wt&&(Ut.DNE(0,Qi,3,8,"ng-container",0),Ut.nI1(1,"async")),2&Wt&&Ut.Y8G("ngIf",Ut.bMT(1,1,fi.tilesUrl$))},dependencies:[Z.bT,Z.Jj,ht.VW,ht.WL],encapsulation:2})}}return Ii})()},6692:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{DR:()=>Ut,DY:()=>ci,Fc:()=>Wt,Gp:()=>at,PT:()=>$i,Un:()=>Ee,V:()=>g,V8:()=>Qi,jB:()=>Z,jM:()=>li,mp:()=>mi,qe:()=>fi,r9:()=>Vt});var ht=Tt(7885),se=Tt(5718);function Z(Qt){return Qt.reduce((bi,_t)=>{const ot=_t.category;return bi[ot]||(bi[ot]=[]),bi[ot].push(_t),bi},{})}function g(Qt){return!(!Qt||!Qt.capabilities?.includes("IMPACTS"))}function li(Qt,bi){return!!Qt?.capabilities?.includes(bi)}function ci(Qt,bi){const _t={},ot={};void 0!==Qt.treatment_goal&&(_t.treatment_goal=Qt.treatment_goal),void 0!==Qt.stand_size&&(ot.stand_size=Qt.stand_size),void 0!==Qt.excluded_areas&&Array.isArray(Qt.excluded_areas)&&(ot.excluded_areas=Array.from(Qt.excluded_areas)),void 0!==Qt.included_areas&&Array.isArray(Qt.included_areas)&&(ot.included_areas=Array.from(Qt.included_areas));const It={};void 0!==Qt.estimated_cost&&(It.estimated_cost=Qt.estimated_cost),void 0!==Qt.max_area&&(It.max_area=Qt.max_area),void 0!==Qt.max_project_count&&(It.max_project_count=Qt.max_project_count),void 0!==Qt.sub_units_fixed_target&&(It.sub_units_fixed_target=Qt.sub_units_fixed_target),void 0!==Qt.sub_units_target_value&&(It.sub_units_target_value=Qt.sub_units_target_value),Object.keys(It).length>0&&(ot.targets=It);const je=[],kt=bi.get("distance_to_roads");Qt.min_distance_from_road&&kt&&je.push({datalayer:kt,operator:"lte",value:String(Qt.min_distance_from_road)});const mt=bi.get("slope");return Qt.max_slope&&mt&&je.push({datalayer:mt,operator:"lt",value:String(Qt.max_slope)}),Qt.adv_constraints&&Qt.adv_constraints.map(lt=>{je.push({datalayer:lt.datalayer,operator:lt.operator,value:lt.value})}),je.length>0&&(ot.constraints=je),Qt.priority_objectives&&(ot.priority_objectives=Qt.priority_objectives),Qt.priorities&&(ot.priorities=Qt.priorities),Qt.cobenefits&&(ot.cobenefits=Qt.cobenefits),Qt.planning_approach&&
3(_t.planning_approach=Qt.planning_approach),Qt.sub_units_layer&&(ot.sub_units_layer=Qt.sub_units_layer),_t.configuration=ot,_t}function Ut(Qt,bi){let _t=Qt;"Copy of"!==_t.substring(0,7)&&(_t=`Copy of '${_t}'`);const ot=_t.lastIndexOf(" ");let It=_t.substring(0,ot);const je=_t.substring(ot);(0,ht.Et)(Number(je))||(It=_t);let kt=It,mt=2;for(;bi.includes(kt);)kt=`${It} ${mt++}`;return kt}function at(Qt){return"PENDING"===Qt.scenario_result?.status}function Ee(Qt){return"CUSTOM"===Qt}function Qi(Qt){return"PRIORITIZE_SUB_UNITS"===Qt}function Vt(Qt,bi){return Qi(Qt)&&!bi?"Top 10 Subunits":"Project Areas"}function $i(Qt,bi){const{type:_t}=Qt,ot=bi.configuration??{},It=Array.isArray(ot.priority_objectives)&&ot.priority_objectives.length>0||Array.isArray(ot.priorities)&&ot.priorities.length>0,je=null!=bi.treatment_goal;let kt=function Ii(Qt){return Object.entries(Qt).reduce((bi,[_t,ot])=>(Array.isArray(ot)?ot.length>0&&(bi[_t]=ot):null!==ot&&"object"==typeof ot?Object.keys(ot).length>0&&(bi[_t]=ot):null!=ot&&(bi[_t]=ot),bi),{})}(ot);return("PRESET"===_t&&!je||"CUSTOM"===_t&&!It)&&(kt=ot.stand_size?{stand_size:ot.stand_size}:{}),{...bi,configuration:kt}}function mi(Qt,bi){return Qt.length!==bi.length||Qt.some((ot,It)=>ot!==bi[It])}function Wt(Qt,bi){const _t=bi?bi.name:"Unknown Layer";if("btw"===Qt.operator&&Qt.value.includes(",")){const[ot,It]=Qt.value.split(",").map(Number);return`${_t}: ${Math.min(ot,It)}-${Math.max(ot,It)}`}return`${_t}: ${fi(Qt.operator)} ${Qt.value}`}function fi(Qt){const bi=se.cO.get(Qt);return bi?.symbol?bi.symbol:Qt}},8640:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{t:()=>se});var ht=Tt(5312);const se={projectAreaAggregate:{tilesUrl:ht.c.martin_server+"project_area_aggregate/{z}/{x}/{y}",sources:{projectAreaAggregate:"project_area_aggregate"}},standsByTxPlan:{tilesUrl:ht.c.martin_server+"stands_by_tx_plan/{z}/{x}/{y}",sources:{standsByTxPlan:"stands_by_tx_plan"}},standsByPlanningArea:{tilesUrl:ht.c.martin_server+"stands_by_planning_area/{z}/{x}/{y}",sources:{standsByPlanningArea:"stands_by_planning_area"}},subUnitsByScenario:{tilesUrl:ht.c.martin_server+"sub_units_by_scenario/{z}/{x}/{y}",sources:{geometry:"sub_units_by_scenario",label:"sub_units_by_scenario_label"}},projectAreasByScenario:{tilesUrl:ht.c.martin_server+"project_areas_by_scenario/{z}/{x}/{y}",sources:{geometry:"project_areas_by_scenario",label:"project_areas_by_scenario_label"}},projectAreasByForSharedLink:{tilesUrl:ht.c.martin_server+"project_areas_by_scenario_by_for_shared_link/{z}/{x}/{y}",sources:{geometry:"project_areas_by_scenario",label:"project_areas_by_scenario_label"}},standsByProjectAreas:{tilesUrl:ht.c.martin_server+"stands_by_project_areas/{z}/{x}/{y}",sources:{stands:"stands_by_project_areas",geometry:"stands_by_project_areas",label:"stands_by_project_areas_label"}},treatableStandsByProjectAreas:{tilesUrl:ht.c.martin_server+"treatable_stands_by_project_areas/{z}/{x}/{y}",sources:{stands:"treatable_stands_by_project_areas",geometry:"treatable_stands_by_project_areas",label:"treatable_stands_by_project_areas_label"}},standsByTxResult:{tilesUrl:ht.c.martin_server+"stands_by_tx_result/{z}/{x}/{y}",sources:{standsByTxResult:"stands_by_tx_result"}},planningArea:{tilesUrl:ht.c.martin_server+"planning_area_by_id/{z}/{x}/{y}",sources:{planningArea:"planning_area"}},planningAreaByForSharedLink:{tilesUrl:ht.c.martin_server+"planning_area_by_for_shared_link/{z}/{x}/{y}",sources:{planningArea:"planning_area"}},scenarioStands:{tilesUrl:ht.c.martin_server+"stands_by_planning_area/{z}/{x}/{y}",tilesWithIncludesUrl:ht.c.martin_server+"stands_by_scenario/{z}/{x}/{y}",sources:{stands:"stands_by_planning_area",standsWithIncludes:"stands_by_scenario"}}}},7486:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{BH:()=>at,CJ:()=>Ut,GL:()=>g,HE:()=>Z,HW:()=>li,L1:()=>se,dT:()=>Qi,gr:()=>ci,nt:()=>Vt,oq:()=>Ee});var ht=Tt(5075);const se={white:"#FFF",black:"#000",dark:"#4A4A4A",md_gray:"#767575",light:"#F6F6F680",blue:"#007dff",yellow:"#FFD54F",almost_white:"#F6F6F6",white_light_blue:"#E9F1FF",dark_magenta:"#A60958",darker_magenta:"#860747",dark_gray:"#646464",light_gray:"#909090",dar
3k_green:"#344F42",standard_blue:"#064BBA"},Z={"fill-color":["case",["boolean",["feature-state","selected"],!1],se.yellow,"transparent"],"fill-outline-color":["case",["boolean",["feature-state","selected"],!1],se.black,"transparent"],"fill-opacity":.3},g={"fill-color":se.yellow,"fill-opacity":1},li={"line-color":["case",["boolean",["feature-state","hover"],!1],se.yellow,"#00000000"],"line-width":4},ci={"line-color":se.dark,"line-width":4},Ut={"line-color":se.dark,"line-width":.5},at={"fill-color":"red","fill-opacity":.75},Ee={"text-color":se.black,"text-halo-color":se.white,"text-halo-width":2};function Qi(mi,Wt){return{"fill-color":$i(mi),"fill-opacity":Wt}}function Vt(mi,Wt){return mi.length<1?{}:{"fill-pattern":Ii(mi),"fill-opacity":Wt}}function Ii(mi){const Wt=["match",["get","id"]];return mi.forEach(fi=>{Wt.push(fi.id,ht.m9[fi.action])}),Wt.push("sequence1"),Wt}function $i(mi){const Wt=se.light;if(0===mi.length)return Wt;const fi=["match",["get","id"]];return mi.forEach(Qt=>{fi.push(Qt.id,ht.q3[Qt.action])}),fi.push(Wt),fi}},5718:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{Mb:()=>at,cO:()=>Ee,x7:()=>se,Z_:()=>Vt,CR:()=>Qi,wk:()=>ht,Pv:()=>Ut,JA:()=>ci,x_:()=>li});var ht=function(Ii){return Ii[Ii.SUCCESS=0]="SUCCESS",Ii[Ii.ERROR=1]="ERROR",Ii[Ii.ALERT=2]="ALERT",Ii}(ht||{});const se="road",li=new Set(["NO_AVAILABLE_RESULT","FORSYS_EMPTY_RESULT"]),ci=new Set(["TIME_OUT","GENERIC_PANIC","STAND_METRIC_FAILURE","UNKNOWN_ERROR","STAND_DATA_ERROR","PROJECT_DATA_ERROR","FORSYS_PREPARATION_ERROR","FORSYS_EXECUTION_ERROR","RESULT_PROCESSING_ERROR","PROJECT_AREA_UPDATE_ERROR"]),Ut={PRIORITIZE_SUB_UNITS:"Prioritize Sub-Units",OPTIMIZE_PROJECT_AREAS:"Optimize Project Areas"},at=[{value:"eq",label:"Equal to",symbol:"="},{value:"dne",label:"Does not equal",symbol:"!="},{value:"gt",label:"Greater than",symbol:">"},{value:"gte",label:"Greater than or equal to",symbol:"\u2265"},{value:"lt",label:"Less than",symbol:"<"},{value:"lte",label:"Less than or equal to",symbol:"\u2264"},{value:"btw",label:"Between"}],Ee=new Map(at.map(Ii=>[Ii.value,Ii])),Qi=[{value:"7_4",label:"Greater than (>) 7 ft to less than (<) 4 ft"},{value:"6_4",label:"Greater than (>) 6 ft to less than (<) 4 ft"},{value:"4_2",label:"Greater than (>) 4 ft to less than (<) 2 ft"}],Vt="7_4"},6494:function(Gr,Vi,Tt){var ht=Tt(5386).default;!function(se){"use strict";function Z(l){return(p,...h)=>li(l,p,h)}function g(l,p){return Z(Ee(l,p).get)}const{apply:li,getOwnPropertyDescriptor:Ee,getPrototypeOf:Qi,ownKeys:Ii}=Reflect,{iterator:Wt,toStringTag:Qt}=Symbol,_t=Object,{create:ot,defineProperty:It}=_t,mt=Array.prototype[Wt],lt=Z(mt),Pe=ArrayBuffer;g(Pe.prototype,"byteLength");const it=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:null;it&&g(it.prototype,"byteLength");const wi=Qi(Uint8Array).prototype;Z(wi.keys),Z(wi.values),Z(wi.entries),Z(wi.set),Z(wi.reverse),Z(wi.fill),Z(wi.copyWithin),Z(wi.sort),Z(wi.slice),Z(wi.subarray),g(wi,"buffer"),g(wi,"byteOffset"),g(wi,"length"),g(wi,Qt);const Rt=Uint8Array,Bt=Uint16Array,At=Uint32Array,et=Float32Array,Zt=Qi([][Wt]()),sr=Z(Zt.next),cr=Z(function*(){}().next),ir=Qi(Zt),hr=Z(DataView.prototype.getUint16),or=WeakMap,rr=or.prototype,jr=Z(rr.get),Dn=Z(rr.set),tn=new or,Yr=ot(null,{next:{value:function(){const l=jr(tn,this);return sr(l)}},[Wt]:{value:function(){return this}}}),An=new or,rn=ot(ir,{next:{value:function(){const l=jr(An,this);return cr(l)},writable:!0,configurable:!0}});for(const l of Ii(Zt))"next"!==l&&It(rn,l,Ee(Zt,l));const In=new Pe(4),da=new et(In),Ze=new At(In),br=new Bt(512),Or=new Rt(512);for(let l=0;l<256;++l){const p=l-127;p<-24?(br[l]=0,br[256|l]=32768,Or[l]=24,Or[256|l]=24):p<-14?(br[l]=1024>>-p-14,br[256|l]=1024>>-p-14|32768,Or[l]=-p-1,Or[256|l]=-p-1):p<=15?(br[l]=p+15<<10,br[256|l]=p+15<<10|32768,Or[l]=13,Or[256|l]=13):p<128?(br[l]=31744,br[256|l]=64512,Or[l]=24,Or[256|l]=24):(br[l]=31744,br[256|l]=64512,Or[l]=13,Or[256|l]=13)}const Li=new At(2048);for(let l=1;l<1024;++l){let p=l<<13,h=0;for(;!(8388608&p);)p<<=1,h-=8388608;p&=-8388609,h+=947912704,Li[l]=p|h}for(let l=1024;l<2048;++l)Li[l]=939524096+(l-1024<<13);const Xi=new At(64);for(let l=1;l<31;++l)Xi[l]=l<<23;Xi[31]=1199570944,Xi[32]=2147483648;for(let l=33;l<63;++l)Xi[l]=2147483648+(l-32<<23);Xi[63]=3347054592;const fa=new Bt(64);for(let l=1;l<64;++l)32!==l&&(fa[l]=1024);function bn(l,p,...h){return function(w){const B=w>>10;return Ze[0]=Li[fa[B]+(1023&w)]+Xi[B],da[0]}(hr(l,p,...function(w){if(w[Wt]===mt&&Zt.next===sr)return w;
3const B=ot(Yr);return Dn(tn,B,lt(w)),B}(h)))}function dn(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Wn={exports:{}};function nn(l,p,h){const w=h&&h.debug||!1;w&&console.log("[xml-utils] getting "+p+" in "+l);const B="object"==typeof l?l.outer:l,E=B.slice(0,B.indexOf(">")+1),R=['"',"'"];for(let D=0;D<R.length;D++){const H=R[D],F=p+"\\="+H+"([^"+H+"]*)"+H;w&&console.log("[xml-utils] pattern:",F);const V=new RegExp(F).exec(E);if(w&&console.log("[xml-utils] match:",V),V)return V[1]}}Wn.exports=nn,Wn.exports.default=nn;var We=dn(Wn.exports),gr={exports:{}},b={exports:{}},Y={exports:{}};function dt(l,p,h){const w=new RegExp(p).exec(l.slice(h));return w?h+w.index:-1}Y.exports=dt,Y.exports.default=dt;var zt=Y.exports,Ti={exports:{}};function wt(l,p,h){const w=new RegExp(p).exec(l.slice(h));return w?h+w.index+w[0].length-1:-1}Ti.exports=wt,Ti.exports.default=wt;var Ci=Ti.exports,Ai={exports:{}};function Rr(l,p){const h=new RegExp(p,"g"),w=l.match(h);return w?w.length:0}Ai.exports=Rr,Ai.exports.default=Rr;const vi=zt,wn=Ci,zn=Ai.exports;function Un(l,p,h){const w=h&&h.debug||!1,B=!(h&&!1===typeof h.nested),E=h&&h.startIndex||
30;w&&console.log("[xml-utils] starting findTagByName with",p," and ",h);const R=vi(l,`<${p}[ \n>/]`,E);if(w&&console.log("[xml-utils] start:",R),-1===R)return;const D=l.slice(R+p.length);let H=wn(D,"^[^<]*[ /]>",0);const F=-1!==H&&"/"===D[H-1];if(w&&console.log("[xml-utils] selfClosing:",F),!1===F)if(B){let N=0,ce=1,he=0;for(;-1!==(H=wn(D,"[ /]"+p+">",N));){const oe=D.substring(N,H+1);if(ce+=zn(oe,"<"+p+"[ \n\t>]"),he+=zn(oe,"</"+p+">"),he>=ce)break;N=H}}else H=wn(D,"[ /]"+p+">",0);const V=R+p.length+H+1;if(w&&console.log("[xml-utils] end:",V),-1===V)return;const le=l.slice(R,V);let ne;return ne=F?null:le.slice(le.indexOf(">")+1,le.lastIndexOf("<")),{inner:ne,outer:le,start:R,end:V}}b.exports=Un,b.exports.default=Un;const Gn=b.exports;function me(l,p,h){const w=[],B=h&&h.debug||!1,E=!h||"boolean"!=typeof h.nested||h.nested;let R,D=h&&h.startIndex||0;for(;R=Gn(l,p,{debug:B,startIndex:D});)D=E?R.start+1+p.length:R.end,w.push(R);return B&&console.log("findTagsByName found",w.length,"tags"),w}gr.exports=me,gr.exports.default=me;var O=dn(gr.exports);const G={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},W={};for(const l in G)G.hasOwnProperty(l)&&(W[G[l]]=parseInt(l,10));const fe=[W.BitsPerSample,W.ExtraSamples,W.SampleFormat,W.StripByteCounts,W.StripOffsets,W.StripRowCounts,W.TileByteCounts,W.TileOffsets,W.SubIFDs],Se={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ve={};for(const l in Se)Se.hasOwnProperty(l)&&(ve[Se[l]]=parseInt(l,10));const ur={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},mr=new Map;function C(l,p){Array.isArray(l)||(l=[l]),l.forEach(h=>mr.set(h,p))}function P(l){return z.apply(this,arguments)}function z(){return(z=ht(function*(l){const p=mr.get(l.Compression);if(!p)throw new Error(`Unknown compression method identifier: ${l.Compression}`);return new(yield p())(l)})).apply(this,arguments)}function U(l,p,h,w=1){return new(Object.getPrototypeOf(l).constructor)(p*h*w)}function K(l,p,h){return(1-h)*l+h*p}function xe(l,p,h){let w=0;for(let B=p;B<h;++B)w+=l[B];return w}function qe(l,p,h){switch(l){case 1:if(p<=8)return new Uint8Array(h);if(p<=16)return new Uint16Array(h);if(p<=32)return new Uint32Array(h);break;case 2:if(8===p)return new Int8Array(h);if(16===p)return new Int16Array(h);if(32===p)return new Int32Array(h);break;case 3:switch(p){case 16:case 32:return new Float32Array(h);case 64:return new Float64Array(h)}}throw Error("Unsupported data format/bitsPerSample")}C([void 0,1],()=>Promise.resolve().then(function(){return _s}).then(l=>l.default)),C(5,()=>Promise.resolve().then(function(){return na}).then(l=>l.default)),C(6,()=>{throw new Error("old style JPEG compression is not supported.")}),C(7,()=>Promise.resolve().then(function(){return pl}).then(l=>l.default)),C([8,32946],()=>Promise.resolve().then(function(){return Hh}).then(l=>l.default)),C(32773,()=>Promise.resolve().then(function(){return zc}).then(l=>l.default)),C(34887,()=>Promise.resolve().then(function(){return hc}).then(function(){var l=ht(function*(p){return yield p.zstd.init(),p});return function(p){return l.apply(this,arguments)}}()).then(l=>l.default)),C(50001,()=>Promise.resolve().then(function(){return ca}).then(l=>l.default));class Fe{constructor(p,h,w,B,E,R){this.fileDirectory=p,this.geoKeys=h,this.dataView=w,this.littleEndian=B,this.tiles=E?{}:null,this.isTiled=!p.StripOffsets;const D=p.PlanarConfiguration;if(this.planarConfiguration=void 0===D?1:D,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=R}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}
3getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(p){return this.isTiled||(p+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-p*this.getTileHeight()}getBytesPerPixel(){let p=0;for(let h=0;h<this.fileDirectory.BitsPerSample.length;++h)p+=this.getSampleByteSize(h);return p}getSampleByteSize(p){if(p>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${p} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[p]/8)}getReaderForSample(p){const w=this.fileDirectory.BitsPerSample[p];switch(this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[p]:1){case 1:if(w<=8)return DataView.prototype.getUint8;if(w<=16)return DataView.prototype.getUint16;if(w<=32)return DataView.prototype.getUint32;break;case 2:if(w<=8)return DataView.prototype.getInt8;if(w<=16)return DataView.prototype.getInt16;if(w<=32)return DataView.prototype.getInt32;break;case 3:switch(w){case 16:return function(B,E){return bn(this,B,E)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(p=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[p]:1}getBitsPerSample(p=0){return this.fileDirectory.BitsPerSample[p]}getArrayForSample(p,h){return qe(this.getSampleFormat(p),this.getBitsPerSample(p),h)}getTileOrStrip(p,h,w,B,E){var R=this;return ht(function*(){const D=Math.ceil(R.getWidth()/R.getTileWidth()),H=Math.ceil(R.getHeight()/R.getTileHeight());let F;const{tiles:V}=R;let le,ne;1===R.planarConfiguration?F=h*D+p:2===R.planarConfiguration&&(F=w*D*H+h*D+p),R.isTiled?(le=R.fileDirectory.TileOffsets[F],ne=R.fileDirectory.TileByteCounts[F]):(le=R.fileDirectory.StripOffsets[F],ne=R.fileDirectory.StripByteCounts[F]);const N=(yield R.source.fetch([{offset:le,length:ne}],E))[0];let ce;return null!==V&&V[F]?ce=V[F]:(ce=ht(function*(){let he=yield B.decode(R.fileDirectory,N);const oe=R.getSampleFormat(),Ue=R.getBitsPerSample();return ue=Ue,(1!==(ye=oe)&&2!==ye||!(ue<=32)||ue%8!=0)&&(3!==ye||16!==ue&&32!==ue&&64!==ue)&&(he=function(ye,ue,Te,De,J,ie,te){const Qe=new DataView(ye),ge=2===Te?1:De,Re=qe(ue,J,2===Te?te*ie:te*ie*De),Le=parseInt("1".repeat(J),2);if(1===ue){let Ge;Ge=1===Te?De*J:J;let He=ie*Ge;7&He&&(He=He+7&-8);for(let Xe=0;Xe<te;++Xe){const pt=Xe*He;for(let Ye=0;Ye<ie;++Ye){const Ct=pt+Ye*ge*J;for(let gt=0;gt<ge;++gt){const ut=Ct+gt*J,ct=(Xe*ie+Ye)*ge+gt,Xt=Math.floor(ut/8),qt=ut%8;if(qt+J<=8)Re[ct]=Qe.getUint8(Xt)>>8-J-qt&Le;else if(qt+J<=16)Re[ct]=Qe.getUint16(Xt)>>16-J-qt&Le;else if(qt+J<=24){const di=Qe.getUint16(Xt)<<8|Qe.getUint8(Xt+2);Re[ct]=di>>24-J-qt&Le}else Re[ct]=Qe.getUint32(Xt)>>32-J-qt&Le}}}}return Re.buffer}(he,oe,R.planarConfiguration,R.getSamplesPerPixel(),Ue,R.getTileWidth(),R.getBlockHeight(h))),he;var ye,ue})(),null!==V&&(V[F]=ce)),{x:p,y:h,sample:w,data:yield ce}})()}_readRaster(p,h,w,B,E,R,D,H,F){var V=this;return ht(function*(){const le=V.getTileWidth(),ne=V.getTileHeight(),N=V.getWidth(),ce=V.getHeight(),he=Math.max(Math.floor(p[0]/le),0),oe=Math.min(Math.ceil(p[2]/le),Math.ceil(N/le)),Ue=Math.max(Math.floor(p[1]/ne),0),ye=Math.min(Math.ceil(p[3]/ne),Math.ceil(ce/ne)),ue=p[2]-p[0];let Te=V.getBytesPerPixel();const De=[],J=[];for(let Qe=0;Qe<h.length;++Qe)De.push(1===V.planarConfiguration?xe(V.fileDirectory.BitsPerSample,0,h[Qe])/8:0),J.push(V.getReaderForSample(h[Qe]));const ie=[],{littleEndian:te}=V;for(let Qe=Ue;Qe<ye;++Qe)for(let ge=he;ge<oe;++ge){let Re;1===V.planarConfiguration&&(Re=V.getTileOrStrip(ge,Qe,0,E,F));for(let Le=0;Le<h.length;++Le){const Ge=Le,He=h[Le];2===V.planarConfiguration&&(Te=V.getSampleByteSize(He),Re=V.getTileOrStrip(ge,Qe,He,E,F));const Xe=Re.then(pt=>{const Ct=new DataView(pt.data),gt=V.getBlockHeight(pt.y),ut=pt.y*ne,ct=pt.x*le,qt=(pt.x+1)*le,di=J[Ge],Kt=Math.min(gt,gt-(ut+gt-p[3]),ce-ut),qi=Math.min(le,le-(qt-p[2]),N-ct);for(let Oi=Math.max(0,p[1]-ut);Oi<Kt;++Oi)for(let ui=Math.max(0,p[0]-ct);ui<qi;++ui){const ni=di.call(Ct,(Oi*le+ui)*Te+De[Ge],te);let Mr;B?(Mr=(Oi+ut-p[1])*ue*h.length+(ui+ct-p[0])*h.length+Ge,w[Mr]=ni):(Mr=(Oi+ut-p[1])*ue+ui+ct-p[0],w[Ge][Mr]=ni)}});ie.push(Xe)}}if(yield Promise.all(ie),R&&p[2]-p[0]!==R||D&&p[3]-p[1]!==D){let Qe;return Qe=B?function Ie(l,p,h,w,B,E,R="nearest"){switch(R.toLowerCase()){case"nearest":return function(D,H,F,V,le,ne){const N=H/V,ce=F/le,he=U(D,V,le,ne);for(let oe=0;oe<le;++oe){const Ue=Math.min(Math.round(ce*oe),F-1);for(let ye=0;ye<V;++ye){const ue=Math.min(Math.round(N*ye),H-1);for(let Te=0;Te<ne;++Te)he[oe*V*ne+ye*ne+Te]=D[Ue*H*ne+ue*ne+Te]}}return he}(l,p,h,w,B,E);case"bilinear":case"linear":return function(D,H,F,V,le,ne){const N=H/V,ce=F/le,he=U(D,V,le,ne);for(let oe=0;oe<le;++oe){const Ue=ce*oe,ye=Math.floor(Ue),ue=Math.min(Math.ceil(Ue),F-1);for(let Te=0;Te<V;++Te){const De=N*Te,J=De%1,ie=Math.floor(De),te=Math.min(Math.ceil(De),H-1);for(let Qe=0;Qe<ne;++Qe){const Le=D[ue*H*ne+ie*ne+Qe],Ge=D[ue*H*ne+te*ne+Qe],He=K(K(D[ye*H*ne+ie*ne+Qe],D[ye*H*ne+te*ne+Qe],J),K(Le,Ge,J),Ue%1);he[oe*V*ne+Te*ne+Qe]=He}}}return he}(l,p,h,w,B,E);default:throw new Error(`Unsupported resampling method: '${R}'`)}}(w,p[2]-p[0],p[3]-p[1],R,D,h.length,H):function $(l,p,h,w,B,E="nearest"){switch(E.toLowerCase()){case"nearest":return function(R,D,H,F,V){const le=D/F,ne=H/V;return R.map(N=>{const ce=U(N,F,V);for(let he=0;he<V;++he){const oe=Math.min(Math.round(ne*he),H-1);for(let Ue=0;Ue<F;++Ue){const ye=Math.min(Math.round(le*Ue),D-1);ce[he*F+Ue]=N[oe*D+ye]}}return ce})}(l,p,h,w,B);case"bilinear":case"linear":return function(R,D,H,F,V){const le=D/F,ne=H/V;return R.map(N=>{const ce=U(N,F,V);for(let he=0;he<V;++he){const oe=ne*he,Ue=Math.floor(oe),ye=Math.min(Math.ceil(oe),H-1);for(let ue=0;ue<F;++ue){const Te=le*ue,De=Te%1,J=Math.floor(Te),ie=Math.min(Math.ceil(Te),D-1),ge=N[ye*D+J],Re=N[ye*D+ie],Le=K(K(N[Ue*D+J],N[Ue*D+ie],De),K(ge,Re,De),oe%1);ce[he*F+ue]=Le}}return ce})}(l,p,h,w,B);default:throw new Error(`Unsupported resampling method: '${E}'`)}}(w,p[2]-p[0],p[3]-p[1],R,D,H),Qe.width=R,Qe.height=D,Qe}return w.width=R||p[2]-p[0],w.height=D||p[3]-p[1],w})()}readRasters({window:p,samples:h=[],interleave:w,pool:B=null,width:E,height:R,resampleMethod:D,fillValue:H,signal:F}={}){var V=this;return ht(function*(){const le=p||[0,0,V.getWidth(),V.getHeight()];if(le[0]>le[2]||le[1]>le[3])throw new Error("Invalid subsets");const ne=(le[2]-le[0])*(le[3]-le[1]),N=V.getSamplesPerPixel();if(h&&h.length){for(let oe=0;oe<h.length;++oe)if(h[oe]>=N)return Promise.reject(new RangeError(`Invalid sample index '${h[oe]}'.`))}else for(let oe=0;oe<N;++oe)h.push(oe);let ce;if(w)ce=qe(V.fileDirectory.SampleFormat?Math.max.apply(null,V.fileDirectory.SampleFormat):1,Math.max.apply(null,V.fileDirectory.BitsPerSample),ne*h.length),H&&ce.fill(H);else{ce=[];for(let oe=0;oe<h.length;++oe){const Ue=V.getArrayForSample(h[oe],ne);Array.isArray(H)&&oe<H.length?Ue.fill(H[oe]):H&&!Array.isArray(H)&&Ue.fill(H),ce.push(Ue)}}const he=B||(yield P(V.fileDirectory));return yield V._readRaster(le,h,ce,w,he,E,R,D,F)})()}readRGB({window:p,interleave:h=!0,pool:w=null,width:B,height:E,resampleMethod:R,enableAlp
3ha:D=!1,signal:H}={}){var F=this;return ht(function*(){const V=p||[0,0,F.getWidth(),F.getHeight()];if(V[0]>V[2]||V[1]>V[3])throw new Error("Invalid subsets");const le=F.fileDirectory.PhotometricInterpretation;if(2===le){let ye=[0,1,2];if(0!==F.fileDirectory.ExtraSamples&&D){ye=[];for(let ue=0;ue<F.fileDirectory.BitsPerSample.length;ue+=1)ye.push(ue)}return F.readRasters({window:p,interleave:h,samples:ye,pool:w,width:B,height:E,resampleMethod:R,signal:H})}let ne;switch(le){case 0:case 1:case 3:ne=[0];break;case 5:ne=[0,1,2,3];break;case 6:case 8:ne=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const N={window:V,interleave:!0,samples:ne,pool:w,width:B,height:E,resampleMethod:R,signal:H},{fileDirectory:ce}=F,he=yield F.readRasters(N),oe=2**F.fileDirectory.BitsPerSample[0];let Ue;switch(le){case 0:Ue=function(ye,ue){const{width:Te,height:De}=ye,J=new Uint8Array(Te*De*3);let ie;for(let te=0,Qe=0;te<ye.length;++te,Qe+=3)ie=256-ye[te]/ue*256,J[Qe]=ie,J[Qe+1]=ie,J[Qe+2]=ie;return J}(he,oe);break;case 1:Ue=function(ye,ue){const{width:Te,height:De}=ye,J=new Uint8Array(Te*De*3);let ie;for(let te=0,Qe=0;te<ye.length;++te,Qe+=3)ie=ye[te]/ue*256,J[Qe]=ie,J[Qe+1]=ie,J[Qe+2]=ie;return J}(he,oe);break;case 3:Ue=function(ye,ue){const{width:Te,height:De}=ye,J=new Uint8Array(Te*De*3),ie=ue.length/3,te=ue.length/3*2;for(let Qe=0,ge=0;Qe<ye.length;++Qe,ge+=3){const Re=ye[Qe];J[ge]=ue[Re]/65536*256,J[ge+1]=ue[Re+ie]/65536*256,J[ge+2]=ue[Re+te]/65536*256}return J}(he,ce.ColorMap);break;case 5:Ue=function(ye){const{width:ue,height:Te}=ye,De=new Uint8Array(ue*Te*3);for(let J=0,ie=0;J<ye.length;J+=4,ie+=3){const Qe=ye[J+1],ge=ye[J+2],Re=ye[J+3];De[ie]=(255-ye[J])/256*255*((255-Re)/256),De[ie+1]=(255-Qe)/256*255*((255-Re)/256),De[ie+2]=(255-ge)/256*255*((255-Re)/256)}return De}(he);break;case 6:Ue=function(ye){const{width:ue,height:Te}=ye,De=new Uint8ClampedArray(ue*Te*3);for(let J=0,ie=0;J<ye.length;J+=3,ie+=3){const te=ye[J],Qe=ye[J+1],ge=ye[J+2];De[ie]=te+1.402*(ge-128),De[ie+1]=te-.34414*(Qe-128)-.71414*(ge-128),De[ie+2]=te+1.772*(Qe-128)}return De}(he);break;case 8:Ue=function(ye){const{width:ue,height:Te}=ye,De=new Uint8Array(ue*Te*3);for(let J=0,ie=0;J<ye.length;J+=3,ie+=3){let te,Qe,ge,Re=(ye[J+0]+16)/116,Le=(ye[J+1]<<24>>24)/500+Re,Ge=Re-(ye[J+2]<<24>>24)/200;Le=.95047*(Le*Le*Le>.008856?Le*Le*Le:(Le-16/116)/7.787),Re=1*(Re*Re*Re>.008856?Re*Re*Re:(Re-16/116)/7.787),Ge=1.08883*(Ge*Ge*Ge>.008856?Ge*Ge*Ge:(Ge-16/116)/7.787),te=3.2406*Le+-1.5372*Re+-.4986*Ge,Qe=-.9689*Le+1.8758*Re+.0415*Ge,ge=.0557*Le+-.204*Re+1.057*Ge,te=te>.0031308?1.055*te**(1/2.4)-.055:12.92*te,Qe=Qe>.0031308?1.055*Qe**(1/2.4)-.055:12.92*Qe,ge=ge>.0031308?1.055*ge**(1/2.4)-.055:12.92*ge,De[ie]=255*Math.max(0,Math.min(1,te)),De[ie+1]=255*Math.max(0,Math.min(1,Qe)),De[ie+2]=255*Math.max(0,Math.min(1,ge))}return De}(he);break;default:throw new Error("Unsupported photometric interpretation.")}if(!h){const ye=new Uint8Array(Ue.length/3),ue=new Uint8Array(Ue.length/3),Te=new Uint8Array(Ue.length/3);for(let De=0,J=0;De<Ue.length;De+=3,++J)ye[J]=Ue[De],ue[J]=Ue[De+1],Te[J]=Ue[De+2];Ue=[ye,ue,Te]}return Ue.width=he.width,Ue.height=he.height,Ue})()}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const p=[];for(let h=0;h<this.fileDirectory.ModelTiepoint.length;h+=6)p.push({i:this.fileDirectory.ModelTiepoint[h],j:this.fileDirectory.ModelTiepoint[h+1],k:this.fileDirectory.ModelTiepoint[h+2],x:this.fileDirectory.ModelTiepoint[h+3],y:this.fileDirectory.ModelTiepoint[h+4],z:this.fileDirectory.ModelTiepoint[h+5]});return p}getGDALMetadata(p=null){const h={};if(!this.fileDirectory.GDAL_METADATA)return null;let B=O(this.fileDirectory.GDAL_METADATA,"Item");B=B.filter(null===p?E=>void 0===We(E,"sample"):E=>Number(We(E,"sample"))===p);for(let E=0;E<B.length;++E){const R=B[E];h[We(R,"name")]=R.inner}return h}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const p=this.fileDirectory.GDAL_NODATA;return Number(p.substring(0,p.length-1))}getOrigin(){const p=this.fileDirectory.ModelTiepoint,h=this.fileDirectory.ModelTransformation;if(p&&6===p.length)return[p[3],p[4],p[5]];if(h)return[h[3],h[7],h[11]];throw new Error("The image does not have an affine transformation.")}getResolution(p=null){const h=this.fileDirectory.ModelPixelScale,w=this.fileDirectory.ModelTransformation;if(h)return[h[0],-h[1],h[2]];if(w)return 0===w[1]&&0===w[4]?[w[0],-w[5],w[10]]:[Math.sqrt(w[0]*w[0]+w[4]*w[4]),-Math.sqrt(w[1]*w[1]+w[5]*w[5]),w[10]];if(p){const[B,E,R]=p.getResolution();return[B*p.getWidth()/this.getWidth(),E*p.getHeight()/this.getHeight(),R*p.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return 1===this.geoKeys.GTRasterTypeGeoKey}getBoundingBox(p=!1){const h=this.getHeight(),w=this.getWidth();if(this.fileDirectory.ModelTransformation&&!p){const[B,E,R,D,H,F,V,le]=this.fileDirectory.ModelTransformation,ne=[[0,0],[0,h],[w,0],[w,h]].map(([he,oe])=>[D+B*he+E*oe,le+H*he+F*oe]),N=ne.map(he=>he[0]),ce=ne.map(he=>he[1]);return[Math.min(...N),Math.min(...ce),Math.max(...N),Math.max(...ce)]}{const B=this.getOrigin(),E=this.getResolution(),R=B[0],D=B[1],H=R+E[0]*w,F=D+E[1]*h;return[Math.min(R,H),Math.min(D,F),Math.max(R,H),Math.max(D,F)]}}}class Ke{constructor(p){this._dataView=new DataView(p)}get buffer(){return this._dataView.buffer}
3getUint64(p,h){const w=this.getUint32(p,h),B=this.getUint32(p+4,h);let E;if(h){if(E=w+2**32*B,!Number.isSafeInteger(E))throw new Error(`${E} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return E}if(E=2**32*w+B,!Number.isSafeInteger(E))throw new Error(`${E} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return E}getInt64(p,h){let w=0;const B=(128&this._dataView.getUint8(p+(h?7:0)))>0;let E=!0;for(let R=0;R<8;R++){let D=this._dataView.getUint8(p+(h?R:7-R));B&&(E?0!==D&&(D=255&~(D-1),E=!1):D=255&~D),w+=D*256**R}return B&&(w=-w),w}getUint8(p,h){return this._dataView.getUint8(p,h)}getInt8(p,h){return this._dataView.getInt8(p,h)}getUint16(p,h){return this._dataView.getUint16(p,h)}getInt16(p,h){return this._dataView.getInt16(p,h)}getUint32(p,h){return this._dataView.getUint32(p,h)}getInt32(p,h){return this._dataView.getInt32(p,h)}getFloat16(p,h){return bn(this._dataView,p,h)}getFloat32(p,h){return this._dataView.getFloat32(p,h)}getFloat64(p,h){return this._dataView.getFloat64(p,h)}}class st{constructor(p,h,w,B){this._dataView=new DataView(p),this._sliceOffset=h,this._littleEndian=w,this._bigTiff=B}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(p,h){return this.sliceOffset<=p&&this.sliceTop>=p+h}readUint8(p){return this._dataView.getUint8(p-this._sliceOffset,this._littleEndian)}readInt8(p){return this._dataView.getInt8(p-this._sliceOffset,this._littleEndian)}readUint16(p){return this._dataView.getUint16(p-this._sliceOffset,this._littleEndian)}readInt16(p){return this._dataView.getInt16(p-this._sliceOffset,this._littleEndian)}readUint32(p){return this._dataView.getUint32(p-this._sliceOffset,this._littleEndian)}readInt32(p){return this._dataView.getInt32(p-this._sliceOffset,this._littleEndian)}readFloat32(p){return this._dataView.getFloat32(p-this._sliceOffset,this._littleEndian)}readFloat64(p){return this._dataView.getFloat64(p-this._sliceOffset,this._littleEndian)}readUint64(p){const h=this.readUint32(p),w=this.readUint32(p+4);let B;if(this._littleEndian){if(B=h+2**32*w,!Number.isSafeInteger(B))throw new Error(`${B} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return B}if(B=2**32*h+w,!Number.isSafeInteger(B))throw new Error(`${B} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return B}readInt64(p){let h=0;const w=(128&this._dataView.getUint8(p+(this._littleEndian?7:0)))>0;let B=!0;for(let E=0;E<8;E++){let R=this._dataView.getUint8(p+(this._littleEndian?E:7-E));w&&(B?0!==R&&(R=255&~(R-1),B=!1):R=255&~R),h+=R*256**E}return w&&(h=-h),h}readOffset(p){return this._bigTiff?this.readUint64(p):this.readUint32(p)}}const bt=typeof navigator<"u"&&navigator.hardwareConcurrency||2;class ei{constructor(p=bt,h){this.workers=null,this._awaitingDecoder=null,this.size=p,this.messageId=0,p&&(this._awaitingDecoder=h?Promise.resolve(h):new Promise(w=>{Promise.resolve().then(function(){return lh}).then(B=>{w(B.create)})}),this._awaitingDecoder.then(w=>{this._awaitingDecoder=null,this.workers=[];for(let B=0;B<p;B++)this.workers.push({worker:w(),idle:!0})}))}decode(p,h){var w=this;return ht(function*(){return w._awaitingDecoder&&(yield w._awaitingDecoder),0===w.size?P(p).then(B=>B.decode(p,h)):new Promise(B=>{const E=w.workers.find(H=>H.idle)||w.workers[Math.floor(Math.random()*w.size)];E.idle=!1;const R=w.messageId++,D=H=>{H.data.id===R&&(E.idle=!0,B(H.data.decoded),E.worker.removeEventListener("message",D))};E.worker.addEventListener("message",D),E.worker.postMessage({fileDirectory:p,buffer:h,id:R},[h])})})()}destroy(){this.workers&&(this.workers.forEach(p=>{p.worker.terminate()}),this.workers=null)}}function yi(l){if(void 0!==Object.fromEntries)return Object.fromEntries(l);const p={};for(const[h,w]of l)p[h.toLowerCase()]=w;return p}function xr(l){return yi(l.split("\r\n").map(p=>{const h=p.split(":").map(w=>w.trim());return h[0]=h[0].toLowerCase(),h}))}function ki(l){let p,h,w;return l&&([,p,h,w]=l.match(/bytes (\d+)-(\d+)\/(\d+)/),p=parseInt(p,10),h=parseInt(h,10),w=parseInt(w,10)),{start:p,end:h,total:w}}class Hr{fetch(p,h=void 0){var w=this;return ht(function*(){return Promise.all(p.map(B=>w.fetchSlice(B,h)))})()}fetchSlice(p){return ht(function*(){throw new Error(`fetching of slice ${p} not possible, not implemented`)})()}get fileSize(){return null}close(){return ht(function*(){})()}}class Ri extends Map{constructor(p={}){if(super(),!(p.maxSize&&p.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if("number"==typeof p.maxAge&&0===p.maxAge)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=p.maxSize,this.maxAge=p.maxAge||Number.POSITIVE_INFINITY,this.onEviction=p.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(p){if("function"==typeof this.onEviction)for(const[h,w]of p)this.onEviction(h,w.value)}_deleteIfExpired(p,h){return"number"==typeof h.expiry&&h.expiry<=Date.now()&&("function"==typeof this.onEviction&&this.onEviction(p,h.value),this.delete(p))}_getOrDeleteIfExpired(p,h){if(!1===this._deleteIfExpired(p,h))return h.value}
3_getItemValue(p,h){return h.expiry?this._getOrDeleteIfExpired(p,h):h.value}_peek(p,h){const w=h.get(p);return this._getItemValue(p,w)}_set(p,h){this.cache.set(p,h),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(p,h){this.oldCache.delete(p),this._set(p,h)}*_entriesAscending(){for(const p of this.oldCache){const[h,w]=p;this.cache.has(h)||!1===this._deleteIfExpired(h,w)&&(yield p)}for(const p of this.cache){const[h,w]=p;!1===this._deleteIfExpired(h,w)&&(yield p)}}get(p){if(this.cache.has(p)){const h=this.cache.get(p);return this._getItemValue(p,h)}if(this.oldCache.has(p)){const h=this.oldCache.get(p);if(!1===this._deleteIfExpired(p,h))return this._moveToRecent(p,h),h.value}}set(p,h,{maxAge:w=this.maxAge}={}){const B="number"==typeof w&&w!==Number.POSITIVE_INFINITY?Date.now()+w:void 0;return this.cache.has(p)?this.cache.set(p,{value:h,expiry:B}):this._set(p,{value:h,expiry:B}),this}has(p){return this.cache.has(p)?!this._deleteIfExpired(p,this.cache.get(p)):!!this.oldCache.has(p)&&!this._deleteIfExpired(p,this.oldCache.get(p))}peek(p){return this.cache.has(p)?this._peek(p,this.cache):this.oldCache.has(p)?this._peek(p,this.oldCache):void 0}delete(p){const h=this.cache.delete(p);return h&&this._size--,this.oldCache.delete(p)||h}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(p){if(!(p&&p>0))throw new TypeError("`maxSize` must be a number greater than 0");const h=[...this._entriesAscending()],w=h.length-p;w<0?(this.cache=new Map(h),this.oldCache=new Map,this._size=h.length):(w>0&&this._emitEvictions(h.slice(0,w)),this.oldCache=new Map(h.slice(w)),this.cache=new Map,this._size=0),this.maxSize=p}*keys(){for(const[p]of this)yield p}*values(){for(const[,p]of this)yield p}*[Symbol.iterator](){for(const p of this.cache){const[h,w]=p;!1===this._deleteIfExpired(h,w)&&(yield[h,w.value])}for(const p of this.oldCache){const[h,w]=p;this.cache.has(h)||!1===this._deleteIfExpired(h,w)&&(yield[h,w.value])}}*entriesDescending(){let p=[...this.cache];for(let h=p.length-1;h>=0;--h){const w=p[h],[B,E]=w;!1===this._deleteIfExpired(B,E)&&(yield[B,E.value])}p=[...this.oldCache];for(let h=p.length-1;h>=0;--h){const w=p[h],[B,E]=w;this.cache.has(B)||!1===this._deleteIfExpired(B,E)&&(yield[B,E.value])}}*entriesAscending(){for(const[p,h]of this._entriesAscending())yield[p,h.value]}get size(){if(!this._size)return this.oldCache.size;let p=0;for(const h of this.oldCache.keys())this.cache.has(h)||p++;return Math.min(this._size+p,this.maxSize)}entries(){return this.entriesAscending()}forEach(p,h=this){for(const[w,B]of this.entriesAscending())p.call(h,B,w,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}class Pi extends Error{constructor(p){super(p),Error.captureStackTrace&&Error.captureStackTrace(this,Pi),this.name="AbortError"}}class Ca extends Error{constructor(p,h){super(h),this.errors=p,this.message=h,this.name="AggregateError"}}const Sr=Ca;class es{constructor(p,h,w=null){this.offset=p,this.length=h,this.data=w}get top(){return this.offset+this.length}}class Zr{constructor(p,h,w){this.offset=p,this.length=h,this.blockIds=w}}class ts extends Hr{constructor(p,{blockSize:h=65536,cacheSize:w=100}={}){super(),this.source=p,this.blockSize=h,this.blockCache=new Ri({maxSize:w,onEviction:(B,E)=>{this.evictedBlocks.set(B,E)}}),this.evictedBlocks=new Map,this.blockRequests=new Map,this.blockIdsToFetch=new Set,this.abortedBlockIds=new Set}get fileSize(){return this.source.fileSize}fetch(p,h){var w=this;return ht(function*(){const B=[],E=[],R=[];w.evictedBlocks.clear();for(const{offset:N,length:ce}of p){let he=N+ce;const{fileSize:oe}=w;null!==oe&&(he=Math.min(he,oe));for(let Ue=Math.floor(N/w.blockSize)*w.blockSize;Ue<he;Ue+=w.blockSize){const ye=Math.floor(Ue/w.blockSize);w.blockCache.has(ye)||w.blockRequests.has(ye)||(w.blockIdsToFetch.add(ye),E.push(ye)),w.blockRequests.has(ye)&&B.push(w.blockRequests.get(ye)),R.push(ye)}}var N;yield(N=ht(function*(ce){return new Promise(he=>setTimeout(he,ce))}),function(ce){return N.apply(this,arguments)})(),w.fetchBlocks(h);const D=[];for(const N of E)w.blockRequests.has(N)&&D.push(w.blockRequests.get(N));yield Promise.allSettled(B),yield Promise.allSettled(D);const H=[],F=R.filter(N=>w.abortedBlockIds.has(N)||!w.blockCache.has(N));
3if(F.forEach(N=>w.blockIdsToFetch.add(N)),F.length>0&&h&&!h.aborted){w.fetchBlocks(null);for(const N of F){const ce=w.blockRequests.get(N);if(!ce)throw new Error(`Block ${N} is not in the block requests`);H.push(ce)}yield Promise.allSettled(H)}if(h&&h.aborted)throw new Pi("Request was aborted");const V=R.map(N=>w.blockCache.get(N)||w.evictedBlocks.get(N)),le=V.filter(N=>!N);if(le.length)throw new Sr(le,"Request failed");const ne=new Map(function(N,ce){const he=Array.isArray(N)?N:Array.from(N),oe=Array.isArray(ce)?ce:Array.from(ce);return he.map((Ue,ye)=>[Ue,oe[ye]])}(R,V));return w.readSliceData(p,ne)})()}fetchBlocks(p){var h=this;if(this.blockIdsToFetch.size>0){const w=this.groupBlocks(this.blockIdsToFetch),B=this.source.fetch(w,p);for(let E=0;E<w.length;++E){const R=w[E];for(const D of R.blockIds)this.blockRequests.set(D,ht(function*(){try{const H=(yield B)[E],F=D*h.blockSize,V=F-H.offset,le=Math.min(V+h.blockSize,H.data.byteLength),ne=H.data.slice(V,le),N=new es(F,ne.byteLength,ne,D);h.blockCache.set(D,N),h.abortedBlockIds.delete(D)}catch(H){if("AbortError"!==H.name)throw H;H.signal=p,h.blockCache.delete(D),h.abortedBlockIds.add(D)}finally{h.blockRequests.delete(D)}})())}this.blockIdsToFetch.clear()}}groupBlocks(p){const h=Array.from(p).sort((R,D)=>R-D);if(0===h.length)return[];let w=[],B=null;const E=[];for(const R of h)null===B||B+1===R?(w.push(R),B=R):(E.push(new Zr(w[0]*this.blockSize,w.length*this.blockSize,w)),w=[R],B=R);return E.push(new Zr(w[0]*this.blockSize,w.length*this.blockSize,w)),E}readSliceData(p,h){return p.map(w=>{let B=w.offset+w.length;null!==this.fileSize&&(B=Math.min(this.fileSize,B));const E=Math.floor(w.offset/this.blockSize),R=Math.floor(B/this.blockSize),D=new ArrayBuffer(w.length),H=new Uint8Array(D);for(let F=E;F<=R;++F){const V=h.get(F),le=V.offset-w.offset;let ne,N=0,ce=0;le<0?N=-le:le>0&&(ce=le),ne=V.top-B<0?V.length-N:B-V.offset-N;const he=new Uint8Array(V.data,N,ne);H.set(he,ce)}return D})}}class pa{get ok(){return this.status>=200&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(p){throw new Error("not implemented")}getData(){return ht(function*(){throw new Error("not implemented")})()}}class Dr{constructor(p){this.url=p}request({}={}){return ht(function*(){throw new Error("request is not implemented")})()}}class kn extends pa{constructor(p){super(),this.response=p}get status(){return this.response.status}getHeader(p){return this.response.headers.get(p)}getData(){var p=this;return ht(function*(){return p.response.arrayBuffer?yield p.response.arrayBuffer():(yield p.response.buffer()).buffer})()}}class Hi extends Dr{constructor(p,h){super(p),this.credentials=h}request({headers:p,signal:h}={}){var w=this;return ht(function*(){const B=yield fetch(w.url,{headers:p,credentials:w.credentials,signal:h});return new kn(B)})()}}class is extends pa{constructor(p,h){super(),this.xhr=p,this.data=h}get status(){return this.xhr.status}getHeader(p){return this.xhr.getResponseHeader(p)}getData(){var p=this;return ht(function*(){return p.data})()}}class Fr extends Dr{constructRequest(p,h){return new Promise((w,B)=>{const E=new XMLHttpRequest;E.open("GET",this.url),E.responseType="arraybuffer";for(const[R,D]of Object.entries(p))E.setRequestHeader(R,D);E.onload=()=>{w(new is(E,E.response))},E.onerror=B,E.onabort=()=>B(new Pi("Request aborted")),E.send(),h&&(h.aborted&&E.abort(),h.addEventListener("abort",()=>E.abort()))})}request({headers:p,signal:h}={}){var w=this;return ht(function*(){return yield w.constructRequest(p,h)})()}}var Zi={};class Ul extends pa{constructor(p,h){super(),this.response=p,this.dataPromise=h}get status(){return this.response.statusCode}getHeader(p){return this.response.headers[p]}getData(){var p=this;return ht(function*(){return yield p.dataPromise})()}}class Yo extends Dr{constructor(p){super(p),this.parsedUrl=Zi.parse(this.url),this.httpApi=Zi}constructRequest(p,h){return new Promise((w,B)=>{const E=this.httpApi.get({...this.parsedUrl,headers:p},R=>{const D=new Promise(H=>{const F=[];R.on("data",V=>{F.push(V)}),R.on("end",()=>{const V=Buffer.concat(F).buffer;H(V)}),R.on("error",B)});w(new Ul(R,D))});E.on("error",B),h&&(h.aborted&&E.destroy(new Pi("Request aborted")),h.addEventListener("abort",()=>E.destroy(new Pi("Request aborted"))))})}request({headers:p,signal:h}={}){var w=this;return ht(function*(){return yield w.constructRequest(p,h)})()}}class rs extends Hr{constructor(p,h,w,B){super(),this.client=p,this.headers=h,this.maxRanges=w,this.allowFullFile=B,this._fileSize=null}fetch(p,h){var w=this;return ht(function*(){return w.maxRanges>=p.length?w.fetchSlices(p,h):Promise.all(p.map(B=>w.fetchSlice(B,h)))})()}fetchSlices(p,h){var w=this;return ht(function*(){const B=yield w.client.request({headers:{...w.headers,Range:`bytes=${p.map(({offset:E,length:R})=>`${E}-${E+R}`).join(",")}`},signal:h});if(B.ok){if(206===B.status){const{type:E,params:R}=function(ne){const[N,...ce]=ne.split(";").map(he=>he.trim());return{type:N,params:yi(ce.map(he=>he.split("=")))}}(B.getHeader("content-type"));if("multipart/byteranges"===E){const ne=function(N,ce){let he=null;const oe=new TextDecoder("ascii"),Ue=[],ye=`--${ce}`,ue=`${ye}--`;for(let Te=0;Te<10;++Te)oe.decode(new Uint8Array(N,Te,ye.length))===ye&&(he=Te);if(null===he)throw new Error("Could not find initial boundary");for(;he<N.byteLength;){const Te=oe.decode(new Uint8Array(N,he,Math.min(ye.length+1024,N.byteLength-he)));if(0===Te.length||Te.startsWith(ue))break;if(!Te.startsWith(ye))throw new Error("Part does not start with boundary");const De=Te.substr(ye.length+2);
3if(0===De.length)break;const J=De.indexOf("\r\n\r\n"),ie=xr(De.substr(0,J)),{start:te,end:Qe,total:ge}=ki(ie["content-range"]),Re=he+ye.length+J+4,Le=parseInt(Qe,10)+1-parseInt(te,10);Ue.push({headers:ie,data:N.slice(Re,Re+Le),offset:te,length:Le,fileSize:ge}),he=Re+Le+4}return Ue}(yield B.getData(),R.boundary);return w._fileSize=ne[0].fileSize||null,ne}const D=yield B.getData(),{start:H,end:F,total:V}=ki(B.getHeader("content-range"));w._fileSize=V||null;const le=[{data:D,offset:H,length:F-H}];if(p.length>1){const ne=yield Promise.all(p.slice(1).map(N=>w.fetchSlice(N,h)));return le.concat(ne)}return le}{if(!w.allowFullFile)throw new Error("Server responded with full file");const E=yield B.getData();return w._fileSize=E.byteLength,[{data:E,offset:0,length:E.byteLength}]}}throw new Error("Error fetching data.")})()}fetchSlice(p,h){var w=this;return ht(function*(){const{offset:B,length:E}=p,R=yield w.client.request({headers:{...w.headers,Range:`bytes=${B}-${B+E}`},signal:h});if(R.ok){if(206===R.status){const D=yield R.getData(),{total:H}=ki(R.getHeader("content-range"));return w._fileSize=H||null,{data:D,offset:B,length:E}}{if(!w.allowFullFile)throw new Error("Server responded with full file");const D=yield R.getData();return w._fileSize=D.byteLength,{data:D,offset:0,length:D.byteLength}}}throw new Error("Error fetching data.")})()}get fileSize(){return this._fileSize}}function Ls(l,{blockSize:p,cacheSize:h}){return null===p?l:new ts(l,{blockSize:p,cacheSize:h})}function gc(l,p){let h=l.length-p,w=0;do{for(let B=p;B>0;B--)l[w+p]+=l[w],w++;h-=p}while(h>0)}function Zc(l,p,h){let w=0,B=l.length;const E=B/h;for(;B>p;){for(let D=p;D>0;--D)l[w+p]+=l[w],++w;B-=p}const R=l.slice();for(let D=0;D<E;++D)for(let H=0;H<h;++H)l[h*D+H]=R[(h-H-1)*E+D]}class Ga{decode(p,h){var w=this;return ht(function*(){const B=yield w.decodeBlock(h),E=p.Predictor||1;if(1!==E){const R=!p.StripOffsets;return function(D,H,F,V,le,ne){if(!H||1===H)return D;for(let he=0;he<le.length;++he){if(le[he]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(le[he]!==le[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const N=le[0]/8,ce=2===ne?1:le.length;for(let he=0;he<V&&!(he*ce*F*N>=D.byteLength);++he){let oe;if(2===H){switch(le[0]){case 8:oe=new Uint8Array(D,he*ce*F*N,ce*F*N);break;case 16:oe=new Uint16Array(D,he*ce*F*N,ce*F*N/2);break;case 32:oe=new Uint32Array(D,he*ce*F*N,ce*F*N/4);break;default:throw new Error(`Predictor 2 not allowed with ${le[0]} bits per sample.`)}gc(oe,ce)}else 3===H&&(oe=new Uint8Array(D,he*ce*F*N,ce*F*N),Zc(oe,ce,N))}return D}(B,E,R?p.TileWidth:p.ImageWidth,R?p.TileLength:p.RowsPerStrip||p.ImageLength,p.BitsPerSample,p.PlanarConfiguration)}return B})()}}function Gl(l){switch(l){case ve.BYTE:case ve.ASCII:case ve.SBYTE:case ve.UNDEFINED:return 1;case ve.SHORT:case ve.SSHORT:return 2;case ve.LONG:case ve.SLONG:case ve.FLOAT:case ve.IFD:return 4;case ve.RATIONAL:case ve.SRATIONAL:case ve.DOUBLE:case ve.LONG8:case ve.SLONG8:case ve.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${l}`)}}function On(l,p,h,w){let B=null,E=null;const R=Gl(p);switch(p){case ve.BYTE:case ve.ASCII:case ve.UNDEFINED:B=new Uint8Array(h),E=l.readUint8;break;case ve.SBYTE:B=new Int8Array(h),E=l.readInt8;break;case ve.SHORT:B=new Uint16Array(h),E=l.readUint16;break;case ve.SSHORT:B=new Int16Array(h),E=l.readInt16;break;case ve.LONG:case ve.IFD:B=new Uint32Array(h),E=l.readUint32;break;case ve.SLONG:B=new Int32Array(h),E=l.readInt32;break;case ve.LONG8:case ve.IFD8:B=new Array(h),E=l.readUint64;break;case ve.SLONG8:B=new Array(h),E=l.readInt64;break;case ve.RATIONAL:B=new Uint32Array(2*h),E=l.readUint32;break;case ve.SRATIONAL:B=new Int32Array(2*h),E=l.readInt32;break;case ve.FLOAT:B=new Float32Array(h),E=l.readFloat32;break;case ve.DOUBLE:B=new Float64Array(h),E=l.readFloat64;break;default:throw new RangeError(`Invalid field type: ${p}`)}if(p!==ve.RATIONAL&&p!==ve.SRATIONAL)for(let D=0;D<h;++D)B[D]=E.call(l,w+D*R);else for(let D=0;D<h;D+=2)B[D]=E.call(l,w+D*R),B[D+1]=E.call(l,w+(D*R+4));return p===ve.ASCII?new TextDecoder("utf-8").decode(B):B}class fo{constructor(p,h,w){this.fileDirectory=p,this.geoKeyDirectory=h,this.nextIFDByteOffset=w}}
3class Kr extends Error{constructor(p){super(`No image at index ${p}`),this.index=p}}class vn{readRasters(p={}){var h=this;return ht(function*(){const{window:w,width:B,height:E}=p;let{resX:R,resY:D,bbox:H}=p;const F=yield h.getImage();let V=F;const le=yield h.getImageCount(),ne=F.getBoundingBox();if(w&&H)throw new Error('Both "bbox" and "window" passed.');if(B||E){if(w){const[he,oe]=F.getOrigin(),[Ue,ye]=F.getResolution();H=[he+w[0]*Ue,oe+w[1]*ye,he+w[2]*Ue,oe+w[3]*ye]}const ce=H||ne;if(B){if(R)throw new Error("Both width and resX passed");R=(ce[2]-ce[0])/B}if(E){if(D)throw new Error("Both width and resY passed");D=(ce[3]-ce[1])/E}}if(R||D){const ce=[];for(let he=0;he<le;++he){const oe=yield h.getImage(he),{SubfileType:Ue,NewSubfileType:ye}=oe.fileDirectory;(0===he||2===Ue||1&ye)&&ce.push(oe)}ce.sort((he,oe)=>he.getWidth()-oe.getWidth());for(let he=0;he<ce.length;++he){const oe=ce[he],Ue=(ne[2]-ne[0])/oe.getWidth(),ye=(ne[3]-ne[1])/oe.getHeight();if(V=oe,R&&R>Ue||D&&D>ye)break}}let N=w;if(H){const[ce,he]=F.getOrigin(),[oe,Ue]=V.getResolution(F);N=[Math.round((H[0]-ce)/oe),Math.round((H[1]-he)/Ue),Math.round((H[2]-ce)/oe),Math.round((H[3]-he)/Ue)],N=[Math.min(N[0],N[2]),Math.min(N[1],N[3]),Math.max(N[0],N[2]),Math.max(N[1],N[3])]}return V.readRasters({...p,window:N})})()}}class Us extends vn{constructor(p,h,w,B,E={}){super(),this.source=p,this.littleEndian=h,this.bigTiff=w,this.firstIFDOffset=B,this.cache=E.cache||!1,this.ifdRequests=[],this.ghostValues=null}getSlice(p,h){var w=this;return ht(function*(){const B=w.bigTiff?4048:1024;return new st((yield w.source.fetch([{offset:p,length:void 0!==h?h:B}]))[0],p,w.littleEndian,w.bigTiff)})()}parseFileDirectoryAt(p){var h=this;return ht(function*(){const w=h.bigTiff?20:12,B=h.bigTiff?8:2;let E=yield h.getSlice(p);const R=h.bigTiff?E.readUint64(p):E.readUint16(p),D=R*w+(h.bigTiff?16:6);E.covers(p,D)||(E=yield h.getSlice(p,D));const H={};let F=p+(h.bigTiff?8:2);for(let ne=0;ne<R;F+=w,++ne){const N=E.readUint16(F),ce=E.readUint16(F+2),he=h.bigTiff?E.readUint64(F+4):E.readUint32(F+4);let oe,Ue;const ye=Gl(ce),ue=F+(h.bigTiff?12:8);if(ye*he<=(h.bigTiff?8:4))oe=On(E,ce,he,ue);else{const Te=E.readOffset(ue),De=Gl(ce)*he;oe=E.covers(Te,De)?On(E,ce,he,Te):On(yield h.getSlice(Te,De),ce,he,Te)}Ue=1===he&&-1===fe.indexOf(N)&&ce!==ve.RATIONAL&&ce!==ve.SRATIONAL?oe[0]:oe,H[G[N]]=Ue}const V=function(ne){const N=ne.GeoKeyDirectory;if(!N)return null;const ce={};for(let he=4;he<=4*N[3];he+=4){const oe=ur[N[he]],Ue=N[he+1]?G[N[he+1]]:null,ye=N[he+2],ue=N[he+3];let Te=null;if(Ue){if(Te=ne[Ue],null==Te)throw new Error(`Could not get value of geoKey '${oe}'.`);"string"==typeof Te?Te=Te.substring(ue,ue+ye-1):Te.subarray&&(Te=Te.subarray(ue,ue+ye),1===ye&&(Te=Te[0]))}else Te=ue;ce[oe]=Te}return ce}(H),le=E.readOffset(p+B+w*R);return new fo(H,V,le)})()}requestIFD(p){var h=this;return ht(function*(){if(h.ifdRequests[p])return h.ifdRequests[p];if(0===p)return h.ifdRequests[p]=h.parseFileDirectoryAt(h.firstIFDOffset),h.ifdRequests[p];if(!h.ifdRequests[p-1])try{h.ifdRequests[p-1]=h.requestIFD(p-1)}catch(w){throw w instanceof Kr?new Kr(p):w}return h.ifdRequests[p]=ht(function*(){const w=yield h.ifdRequests[p-1];if(0===w.nextIFDByteOffset)throw new Kr(p);return h.parseFileDirectoryAt(w.nextIFDByteOffset)})(),h.ifdRequests[p]})()}getImage(p=0){var h=this;return ht(function*(){const w=yield h.requestIFD(p);return new Fe(w.fileDirectory,w.geoKeyDirectory,h.dataView,h.littleEndian,h.cache,h.source)})()}getImageCount(){var p=this;return ht(function*(){let h=0,w=!0;for(;w;)try{yield p.requestIFD(h),++h}catch(B){if(!(B instanceof Kr))throw B;w=!1}return h})()}getGhostValues(){var p=this;return ht(function*(){const h=p.bigTiff?16:8;if(p.ghostValues)return p.ghostValues;let B=yield p.getSlice(h,130);if("GDAL_STRUCTURAL_METADATA_SIZE="===On(B,ve.ASCII,30,h)){const E=On(B,ve.ASCII,130,h).split("\n")[0],R=Number(E.split("=")[1].split(" ")[0])+E.length;R>130&&(B=yield p.getSlice(h,R));const D=On(B,ve.ASCII,R,h);p.ghostValues={},D.split("\n").filter(H=>H.length>0).map(H=>H.split("=")).forEach(([H,F])=>{p.ghostValues[H]=F})}return p.ghostValues})()}static fromSource(p,h,w){return ht(function*(){const B=(yield p.fetch([{offset:0,length:1024}],w))[0],E=new Ke(B),R=E.getUint16(0,0);let D;if(18761===R)D=!0;else{if(19789!==R)throw new TypeError("Invalid byte order value.");D=!1}const H=E.getUint16(2,D);let F;if(42===H)F=!1;else{if(43!==H)throw new TypeError("Invalid magic number.");if(F=!0,8!==E.getUint16(4,D))throw new Error("Unsupported offset byte-size.")}const V=F?E.getUint64(8,D):E.getUint32(4,D);return new Us(p,D,F,V,h)})()}close(){return"function"==typeof this.source.close&&this.source.close()}}
3var l,h,po={exports:{}};l=po,h=function(){var w={},B=Math.PI/180,E=180/Math.PI,R=6378137,D=20037508.342789244;function H(V){return Number(V)===V&&V%1!=0}function F(V){if(this.size=(V=V||{}).size||256,this.expansion=!0===V.antimeridian?2:1,!w[this.size]){var le=this.size,ne=w[this.size]={};ne.Bc=[],ne.Cc=[],ne.zc=[],ne.Ac=[];for(var N=0;N<30;N++)ne.Bc.push(le/360),ne.Cc.push(le/(2*Math.PI)),ne.zc.push(le/2),ne.Ac.push(le),le*=2}this.Bc=w[this.size].Bc,this.Cc=w[this.size].Cc,this.zc=w[this.size].zc,this.Ac=w[this.size].Ac}return F.prototype.px=function(V,le){if(H(le)){var ne=this.size*Math.pow(2,le),N=ne/2,ce=ne/360,he=ne/(2*Math.PI),oe=ne,Ue=Math.min(Math.max(Math.sin(B*V[1]),-.9999),.9999),ye=N+V[0]*ce,ue=N+.5*Math.log((1+Ue)/(1-Ue))*-he;return ye>oe*this.expansion&&(ye=oe*this.expansion),ue>oe&&(ue=oe),[ye,ue]}return N=this.zc[le],Ue=Math.min(Math.max(Math.sin(B*V[1]),-.9999),.9999),ye=Math.round(N+V[0]*this.Bc[le]),ue=Math.round(N+.5*Math.log((1+Ue)/(1-Ue))*-this.Cc[le]),ye>this.Ac[le]*this.expansion&&(ye=this.Ac[le]*this.expansion),ue>this.Ac[le]&&(ue=this.Ac[le]),[ye,ue]},F.prototype.ll=function(V,le){if(H(le)){var ne=this.size*Math.pow(2,le),ce=ne/(2*Math.PI),he=ne/2,oe=(V[1]-he)/-ce;return[(V[0]-he)/(ne/360),E*(2*Math.atan(Math.exp(oe))-.5*Math.PI)]}return oe=(V[1]-this.zc[le])/-this.Cc[le],[(V[0]-this.zc[le])/this.Bc[le],E*(2*Math.atan(Math.exp(oe))-.5*Math.PI)]},F.prototype.bbox=function(V,le,ne,N,ce){N&&(le=Math.pow(2,ne)-1-le);var oe=[(+V+1)*this.size,le*this.size],Ue=this.ll([V*this.size,(+le+1)*this.size],ne).concat(this.ll(oe,ne));return"900913"===ce?this.convert(Ue,"900913"):Ue},F.prototype.xyz=function(V,le,ne,N){"900913"===N&&(V=this.convert(V,"WGS84"));var he=[V[2],V[3]],oe=this.px([V[0],V[1]],le),Ue=this.px(he,le),ye=[Math.floor(oe[0]/this.size),Math.floor((Ue[0]-1)/this.size)],ue=[Math.floor(Ue[1]/this.size),Math.floor((oe[1]-1)/this.size)],Te={minX:Math.min.apply(Math,ye)<0?0:Math.min.apply(Math,ye),minY:Math.min.apply(Math,ue)<0?0:Math.min.apply(Math,ue),maxX:Math.max.apply(Math,ye),maxY:Math.max.apply(Math,ue)};if(ne){var De={minY:Math.pow(2,le)-1-Te.maxY,maxY:Math.pow(2,le)-1-Te.minY};Te.minY=De.minY,Te.maxY=De.maxY}return Te},F.prototype.convert=function(V,le){return"900913"===le?this.forward(V.slice(0,2)).concat(this.forward(V.slice(2,4))):this.inverse(V.slice(0,2)).concat(this.inverse(V.slice(2,4)))},F.prototype.forward=function(V){var le=[R*V[0]*B,R*Math.log(Math.tan(.25*Math.PI+.5*V[1]*B))];return le[0]>D&&(le[0]=D),le[0]<-D&&(le[0]=-D),le[1]>D&&(le[1]=D),le[1]<-D&&(le[1]=-D),le},F.prototype.inverse=function(V){return[V[0]*E/R,(.5*Math.PI-2*Math.atan(Math.exp(-V[1]/R)))*E]},F}(),l.exports=h;const ea=256,Gs=40075016.68557849,Ea=new(dn(po.exports))({size:ea,antimeridian:!0}),Kc=({x:l,y:p,z:h})=>Ea.bbox(l,p,h,!1,"900913"),Zo=36e5;let Ko;const mc=new Ri({maxSize:16,maxAge:Zo}),yc=new Ri({maxSize:16,maxAge:Zo}),Ol=new Ri({maxSize:1024,maxAge:Zo}),ns=l=>{void 0===Ko&&(Ko=new ei);const p=w=>{const B=mc.get(w);if(B)return B;{const E=(R=ht(function*(D,H={},F){return Us.fromSource(function zs(l,{forceXHR:p=!1,...h}={}){return"function"!=typeof fetch||p?typeof XMLHttpRequest<"u"?function(w,{headers:B={},maxRanges:E=0,allowFullFile:R=!1,...D}={}){const H=new Fr(w);return Ls(new rs(H,B,E,R),D)}(l,h):function(w,{headers:B={},maxRanges:E=0,allowFullFile:R=!1,...D}={}){const H=new Yo(w);return Ls(new rs(H,B,E,R),D)}(l,h):function(w,{headers:B={},credentials:E,maxRanges:R=0,allowFullFile:D=!1,...H}={}){const F=new Hi(w,E);return Ls(new rs(F,B,R,D),H)}(l,h)}(D,H),F)}),function(D){return R.apply(this,arguments)})(w);return mc.set(w,E),E}var R},h=function(){var w=ht(function*(){const B=yc.get(l);if(B)return B;{const R=yield p(l),D=yield R.getImage(),H=D.getGDALMetadata(0),F=D.fileDirectory,V=D.fileDirectory?.Artist,le=(([he,oe,Ue,ye])=>[...Ea.inverse([he,oe]),...Ea.inverse([Ue,ye])])(D.getBoundingBox()),ne=[],N=yield R.getImageCount();for(let he=0;he<N;he++){const oe=yield R.getImage(he),Ue=(E=oe.getResolution(D)[0],Math.log2(Gs/(ea*E)));ne.push({zoom:Ue,isOverview:!!(1&oe.fileDirectory.NewSubfileType),isMask:!!(4&oe.fileDirectory.NewSubfileType)})}const ce={offset:void 0!==H?.OFFSET?parseFloat(H.OFFSET):0,scale:void 0!==H?.SCALE?parseFloat(H.SCALE):1,noData:D.getGDALNoData()??void 0,photometricInterpretation:F?.PhotometricInterpretation,bitsPerSample:F?.BitsPerSample,colorMap:F?.ColorMap,artist:V,bbox:le,images:ne};return yc.set(l,ce),ce}var E});return function(){return w.apply(this,arguments)}}();return{getTilejson:(w=ht(function*(B){const{artist:E,images:R,bbox:D}=yield h(),H=R.map(F=>F.zoom);return{tilejson:"2.2.0",tiles:[B+"/{z}/{x}/{y}"],attribution:E,minzoom:Math.round(Math.min(...H)),maxzoom:Math.round(Math.max(...H)),bounds:D}}),function(E){return w.apply(this,arguments)}),getMetadata:h,getRawTile:function(){var w=ht(function*({z:B,x:E,y:R},D=256){const H=`${l}/${D}/${B}/${E}/${R}`,F=Ol.get(H);if(F)return F;{const V=yield p(l),{noData:le}=yield h(),ne=void 0===le||isNaN(le)?1/0:le,N=V.readRasters({bbox:Kc({x:E,y:R,z:B}),width:D,height:D,interleave:!0,resampleMethod:"nearest",pool:Ko,fillValue:ne});return Ol.set(H,N),N}});return function(E){return w.apply(this,arguments)}}()};var w};function Os(l,p){return null==l||null==p?NaN:l<p?-1:l>p?1:l>=p?0:NaN}function $o(l,p){return null==l||null==p?NaN:p<l?-1:p>l?1:p>=l?0:NaN}function Xo(l){let p,h,w;function B(E,R,D=0,H=E.length){if(D<H){if(0!==p(R,R))return H;do{const F=D+H>>>1;h(E[F],R)<0?D=F+1:H=F}while(D<H)}return D}return 2!==l.length?(p=Os,h=(E,R)=>Os(l(E),R),w=(E,R)=>l(E)-R):(p=l===Os||l===$o?l:Nl,h=l,w=l),{left:B,center:function(E,R,D=0,H=E.length){const F=B(E,R,D,H-1);return F>D&&w(E[F-1],R)>-w(E[F],R)?F-1:F},right:function(E,R,D=0,H=E.length){if(D<H){if(0!==p(R,R))return H;do{const F=D+H>>>1;h(E[F],R)<=0?D=F+1:H=F}while(D<H)}return D}}}function Nl(){return 0}const ta=Xo(Os).right;Xo(function(l){return null===l?NaN:+l});const $c=Math.sqrt(50),ql=Math.sqrt(10),as=Math.sqrt(2);function ia(l,p,h){const w=(p-l)/Math.max(0,h),B=Math.floor(Math.log10(w)),E=w/Math.pow(10,B),R=E>=$c?10:E>=ql?5:E>=as?2:1;let D,H,F;return B<0?(F=Math.pow(10,-B)/R,D=Math.round(l*F),H=Math.round(p*F),D/F<l&&++D,H/F>p&&--H,F=-F):(F=Math.pow(10,B)*R,D=Math.round(l/F),H=Math.round(p/F),D*F<l&&++D,H*F>p&&--H),H<D&&.5<=h&&h<2?ia(l,p,2*h):[D,H,F]}function Ki(l,p,h){return ia(l=+l,p=+p,h=+h)[2]}function go(l,p){switch(arguments.length){case 0:break;case 1:this.range(l);break;default:this.range(p).domain(l)}return this}function Vl(l,p,h){l.prototype=p.prototype=h,h.constructor=l}function ss(l,p){var h=Object.create(l.prototype);for(var w in p)h[w]=p[w];return h}function mo(){}var Wo=1/.7,os="\\s*([+-]?\\d+)\\s*",ls="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ra="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_c=/^#([0-9a-f]{3,8})$/,Ic=new RegExp(`^rgb\\(${os},${os},${os}\\)$`),bc=new RegExp(`^rgb\\(${ra},${ra},${ra}\\)$`),cs=new RegExp(`^rgba\\(${os},${os},${os},${ls}\\)$`),wc=new RegExp(`^rgba\\(${ra},${ra},${ra},${ls}\\)$`),Xc=new RegExp(`^hsl\\(${ls},${ra},${ra}\\)$`),vc=new RegExp(`^hsla\\(${ls},${ra},${ra},${ls}\\)$`),qs={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};function xc(){return this.rgb().formatHex()}function yo(){return this.rgb().formatRgb()}function _o(l){var p,h;return l=(l+"").trim().toLowerCase(),(p=_c.exec(l))?(h=p[1].length,p=parseInt(p[1],16),6===h?Bc(p):3===h?new fn(p>>8&15|p>>4&240,p>>4&15|240&p,(15&p)<<4|15&p,1):8===h?Io(p>>24&255,p>>16&255,p>>8&255,(255&p)/255):4===h?Io(p>>12&15|p>>8&240,p>>8&15|p>>4&240,p>>4&15|240&p,((15&p)<<4|15&p)/255):null):(p=Ic.exec(l))?new fn(p[1],p[2],p[3],1):(p=bc.exec(l))?new fn(255*p[1]/100,255*p[2]/100,255*p[3]/100,1):(p=cs.exec(l))?Io(p[1],p[2],p[3],p[4]):(p=wc.exec(l))?Io(255*p[1]/100,255*p[2]/100,255*p[3]/100,p[4]):(p=Xc.exec(l))?il(p[1],p[2]/100,p[3]/100,1):(p=vc.exec(l))?il(p[1],p[2]/100,p[3]/100,p[4]):qs.hasOwnProperty(l)?Bc(qs[l]):"transparent"===l?new fn(NaN,NaN,NaN,0):null}function Bc(l){return new fn(l>>16&255,l>>8&255,255&l,1)}function Io(l,p,h,w){return w<=0&&(l=p=h=NaN),new fn(l,p,h,w)}function el(l,p,h,w){return 1===arguments.length?((B=l)instanceof mo||(B=_o(B)),B?new fn((B=B.rgb()).r,B.g,B.b,B.opacity):new fn):new fn(l,p,h,w??1);var B}function fn(l,p,h,w){this.r=+l,this.g=+p,this.b=+h,this.opacity=+w}function tl(){return`#${Qa(this.r)}${Qa(this.g)}${Qa(this.b)}`}function Hl(){const l=hs(this.opacity);return`${1===l?"rgb(":"rgba("}${pn(this.r)}, ${pn(this.g)}, ${pn(this.b)}${1===l?")":`, ${l})`}`}function hs(l){return isNaN(l)?1:Math.max(0,Math.min(1,l))}function pn(l){return Math.max(0,Math.min(255,Math.round(l)||0))}function Qa(l){return((l=pn(l))<16?"0":"")+l.toString(16)}function il(l,p,h,w){return w<=0?l=p=h=NaN:h<=0||h>=1?l=p=NaN:p<=0&&(l=NaN),new xn(l,p,h,w)}function rl(l){if(l instanceof xn)return new xn(l.h,l.s,l.l,l.opacity);if(l instanceof mo||(l=_o(l)),!l)return new xn;if(l instanceof xn)return l;var p=(l=l.rgb()).r/255,h=l.g/255,w=l.b/255,B=Math.min(p,h,w),E=Math.max(p,h,w),R=NaN,D=E-B,H=(E+B)/2;return D?(R=p===E?(h-w)/D+6*(h<w):h===E?(w-p)/D+2:(p-h)/D+4,D/=H<.5?E+B:2-E-B,R*=60):D=H>0&&H<1?0:R,new xn(R,D,H,l.opacity)}function xn(l,p,h,w){this.h=+l,this.s=+p,this.l=+h,this.opacity=+w}function nl(l){return(l=(l||0)%360)<0?l+360:l}function ga(l){return Math.max(0,Math.min(1,l||0))}function bo(l,p,h){return 255*(l<60?p+(h-p)*l/60:l<180?h:l<240?p+(h-p)*(240-l)/60:p)}Vl(mo,_o,{copy(l){return Object.assign(new this.constructor,this,l)},displayable(){return this.rgb().displayable()},hex:xc,formatHex:xc,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return rl(this).formatHsl()},formatRgb:yo,toString:yo}),Vl(fn,el,ss(mo,{brighter(l){return l=null==l?Wo:Math.pow(Wo,l),new fn(this.r*l,this.g*l,this.b*l,this.opacity)},darker(l){return l=null==l?.7:Math.pow(.7,l),new fn(this.r*l,this.g*l,this.b*l,this.opacity)},rgb(){return this},clamp(){return new fn(pn(this.r),pn(this.g),pn(this.b),hs(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tl,formatHex:tl,formatHex8:function(){return`#${Qa(this.r)}${Qa(this.g)}${Qa(this.b)}${Qa(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Hl,toString:Hl})),Vl(xn,function(l,p,h,w){return 1===arguments.length?rl(l):new xn(l,p,h,w??1)},ss(mo,{brighter(l){return l=null==l?Wo:Math.pow(Wo,l),new xn(this.h,this.s,this.l*l,this.opacity)},darker(l){return l=null==l?.7:Math.pow(.7,l),new xn(this.h,this.s,this.l*l,this.opacity)},rgb(){var l=this.h%360+360*(this.h<0),p=isNaN(l)||isNaN(this.s)?0:this.s,h=this.l,w=h+(h<.5?h:1-h)*p,B=2*h-w;return new fn(bo(l>=240?l-240:l+120,B,w),bo(l,B,w),bo(l<120?l+240:l-120,B,w),this.opacity)},clamp(){return new xn(nl(this.h),ga(this.s),ga(this.l),hs(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const l=hs(this.opacity);return`${1===l?"hsl(":"hsla("}${nl(this.h)}, ${100*ga(this.s)}%, ${100*ga(this.l)}%${1===l?")":`, ${l})`}`}}));var Jl=l=>()=>l;function Cc(l,p){var h=p-l;return h?function(w,B){return function(E){return w+E*B}}(l,h):Jl(isNaN(l)?p:l)}var Fi=function l(p){var h=function Er(l){return 1==(l=+l)?Cc:function(p,h){return h-p?(w=p,B=h,E=l,w=Math.pow(w,E),B=Math.pow(B,E)-w,E=1/E,function(R){return Math.pow(w+R*B,E)}):Jl(isNaN(p)?h:p);var w,B,E}}(p);function w(B,E){var R=h((B=el(B)).r,(E=el(E)).r),D=h(B.g,E.g),H=h(B.b,E.b),F=Cc(B.opacity,E.opacity);return function(V){return B.r=R(V),B.g=D(V),B.b=H(V),B.opacity=F(V),B+""}}return w.gamma=l,w}(1);function al(l,p){p||(p=[]);var h,w=l?Math.min(p.length,l.length):0,B=p.slice();return function(E){for(h=0;h<w;++h)B[h]=l[h]*(1-E)+p[h]*E;return B}}function Ar(l,p){var h,w=p?p.length:0,B=l?Math.min(w,l.length):0,E=new Array(B),R=new Array(w);for(h=0;h<B;++h)E[h]=Oa(l[h],p[h]);for(;h<w;++h)R[h]=p[h];return function(D){for(h=0;h<B;++h)R[h]=E[h](D);return R}}function lr(l,p){var h=new Date;return l=+l,p=+p,function(w){return h.setTime(l*(1-w)+p*w),h}}function ma(l,p){return l=+l,p=+p,function(h){return l*(1-h)+p*h}}function wo(l,p){var h,w={},B={};for(h in null!==l&&"object"==typeof l||(l={}),null!==p&&"object"==typeof p||(p={}),p)h in l?w[h]=Oa(l[h],p[h]):B[h]=p[h];return function(E){for(h in w)B[h]=w[h](E);return B}}var us=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vo=new RegExp(us.source,"g");function As(l,p){var h,w,B,E=us.lastIndex=vo.lastIndex=0,R=-1,D=[],H=[];for(l+="",p+="";(h=us.exec(l))&&(w=vo.exec(p));)(B=w.index)>E&&(B=p.slice(E,B),D[R]?D[R]+=B:D[++R]=B),(h=h[0])===(w=w[0])?D[R]?D[R]+=w:D[++R]=w:(D[++R]=null,H.push({i:R,x:ma(h,w)})),E=vo.lastIndex;return E<p.length&&(B=p.slice(E),D[R]?D[R]+=B:D[++R]=B),D.length<2?H[0]?function(F){return function(V){return F(V)+""}}(H[0].x):function(F){return function(){return F}}(p):(p=H.length,function(F){for(var V,le=0;le<p;++le)D[(V=H[le]).i]=V.x(F);return D.join("")})}function Oa(l,p){var h,w,B=typeof p;return null==p||"boolean"===B?Jl(p):("number"===B?ma:"string"===B?(h=_o(p))?(p=h,Fi):As:p instanceof _o?Fi:p instanceof Date?lr:(w=p,!ArrayBuffer.isView(w)||w instanceof DataView?Array.isArray(p)?Ar:"function"!=typeof p.valueOf&&"function"!=typeof p.toString||isNaN(p)?wo:ma:al))(l,p)}function Nn(l,p){return l=+l,p=+p,function(h){return Math.round(l*(1-h)+p*h)}}function jl(l){return+l}var sl=[0,1];function Na(l){return l}function Sa(l,p){return(p-=l=+l)?function(w){return(w-l)/p}:(h=isNaN(p)?NaN:.5,function(){return h});var h}function xo(l,p,h){var w=l[0],B=l[1],E=p[0],R=p[1];return B<w?(w=Sa(B,w),E=h(R,E)):(w=Sa(w,B),E=h(E,R)),function(D){return E(w(D))}}function Bo(l,p,h){var w=Math.min(l.length,p.length)-1,B=new Array(w),E=new Array(w),R=-1;for(l[w]<l[0]&&(l=l.slice().reve
vendor: 16,283 bytes, line 3
3rse(),p=p.slice().reverse());++R<w;)B[R]=Sa(l[R],l[R+1]),E[R]=h(p[R],p[R+1]);return function(D){var H=ta(l,D,1,w)-1;return E[H](B[H](D))}}function qa(l,p){if((h=(l=p?l.toExponential(p-1):l.toExponential()).indexOf("e"))<0)return null;var h,w=l.slice(0,h);return[w.length>1?w[0]+w.slice(2):w,+l.slice(h+1)]}function Da(l){return(l=qa(Math.abs(l)))?l[1]:NaN}var ds,Hs=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Co(l){if(!(p=Hs.exec(l)))throw new Error("invalid format: "+l);var p;return new Eo({fill:p[1],align:p[2],sign:p[3],symbol:p[4],zero:p[5],width:p[6],comma:p[7],precision:p[8]&&p[8].slice(1),trim:p[9],type:p[10]})}function Eo(l){this.fill=void 0===l.fill?" ":l.fill+"",this.align=void 0===l.align?">":l.align+"",this.sign=void 0===l.sign?"-":l.sign+"",this.symbol=void 0===l.symbol?"":l.symbol+"",this.zero=!!l.zero,this.width=void 0===l.width?void 0:+l.width,this.comma=!!l.comma,this.precision=void 0===l.precision?void 0:+l.precision,this.trim=!!l.trim,this.type=void 0===l.type?"":l.type+""}function Yi(l,p){var h=qa(l,p);if(!h)return l+"";var w=h[0],B=h[1];return B<0?"0."+new Array(-B).join("0")+w:w.length>B+1?w.slice(0,B+1)+"."+w.slice(B+1):w+new Array(B-w.length+2).join("0")}Co.prototype=Eo.prototype,Eo.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};var Qo={"%":(l,p)=>(100*l).toFixed(p),b:l=>Math.round(l).toString(2),c:l=>l+"",d:function(l){return Math.abs(l=Math.round(l))>=1e21?l.toLocaleString("en").replace(/,/g,""):l.toString(10)},e:(l,p)=>l.toExponential(p),f:(l,p)=>l.toFixed(p),g:(l,p)=>l.toPrecision(p),o:l=>Math.round(l).toString(8),p:(l,p)=>Yi(100*l,p),r:Yi,s:function(l,p){var h=qa(l,p);if(!h)return l+"";var w=h[0],B=h[1],E=B-(ds=3*Math.max(-8,Math.min(8,Math.floor(B/3))))+1,R=w.length;return E===R?w:E>R?w+new Array(E-R+1).join("0"):E>0?w.slice(0,E)+"."+w.slice(E):"0."+new Array(1-E).join("0")+qa(l,Math.max(0,p+E-1))[0]},X:l=>Math.round(l).toString(16).toUpperCase(),x:l=>Math.round(l).toString(16)};function Ec(l){return l}var ol,fs,Yl,So=Array.prototype.map,Zl=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function cl(l){var p=l.domain;return l.ticks=function(h){var w=p();return function(B,E,R){if(!((R=+R)>0))return[];if((B=+B)==(E=+E))return[B];const D=E<B,[H,F,V]=D?ia(E,B,R):ia(B,E,R);if(!(F>=H))return[];const le=F-H+1,ne=new Array(le);if(D)if(V<0)for(let N=0;N<le;++N)ne[N]=(F-N)/-V;else for(let N=0;N<le;++N)ne[N]=(F-N)*V;else if(V<0)for(let N=0;N<le;++N)ne[N]=(H+N)/-V;else for(let N=0;N<le;++N)ne[N]=(H+N)*V;return ne}(w[0],w[w.length-1],h??10)},l.tickFormat=function(h,w){var B=p();return function ll(l,p,h,w){var B,D,E=function(D,H,F){F=+F;const V=(H=+H)<(D=+D),le=V?Ki(H,D,F):Ki(D,H,F);return(V?-1:1)*(le<0?1/-le:le)}(l,p,h);switch((w=Co(w??",f")).type){case"s":var R=Math.max(Math.abs(l),Math.abs(p));return null!=w.precision||isNaN((D=E,B=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Da(R)/3)))-Da(Math.abs(D)))))||(w.precision=B),Yl(w,R);case"":case"e":case"g":case"p":case"r":null!=w.precision||isNaN(B=function(D,H){return D=Math.abs(D),H=Math.abs(H)-D,Math.max(0,Da(H)-Da(D))+1}(E,Math.max(Math.abs(l),Math.abs(p))))||(w.precision=B-("e"===w.type));break;case"f":case"%":null!=w.precision||isNaN(B=function(D){return Math.max(0,-Da(Math.abs(D)))}(E))||(w.precision=B-2*("%"===w.type))}return fs(w)}(B[0],B[B.length-1],h??10,w)},l.nice=function(h){null==h&&(h=10);var w,B,E=p(),R=0,D=E.length-1,H=E[R],F=E[D],V=10;for(F<H&&(B=H,H=F,F=B,B=R,R=D,D=B);V-- >0;){if((B=Ki(H,F,h))===w)return E[R]=H,E[D]=F,p(E);if(B>0)H=Math.floor(H/B)*B,F=Math.ceil(F/B)*B;else{if(!(B<0))break;H=Math.ceil(H*B)/B,F=Math.floor(F*B)/B}w=B}return l},l}function ps(){var l=function Vs(){var l,p,h,w,B,E,R=sl,D=sl,H=Oa,F=Na;function V(){var ne,N,ce,he=Math.min(R.length,D.length);return F!==Na&&((ne=R[0])>(N=R[he-1])&&(ce=ne,ne=N,N=ce),F=function(oe){return Math.max(ne,Math.min(N,oe))}),w=he>2?Bo:xo,B=E=null,le}function le(ne){return null==ne||isNaN(ne=+ne)?h:(B||(B=w(R.map(l),D,H)))(l(F(ne)))}return le.invert=function(ne){return F(p((E||(E=w(D,R.map(l),ma)))(ne)))},le.domain=function(ne){return arguments.length?(R=Array.from(ne,jl),V()):R.slice()},le.range=function(ne){return arguments.length?(D=Array.from(ne),V()):D.slice()},le.rangeRound=function(ne){return D=Array.from(ne),H=Nn,V()},le.clamp=function(ne){return arguments.length?(F=!!ne||Na,V()):F!==Na},le.interpolate=function(ne){return arguments.length?(H=ne,V()):H},le.unknown=function(ne){return arguments.length?(h=ne,le):h},function(ne,N){return l=ne,p=N,V()}}()(Na,Na);return l.copy=function(){return p=l,ps().domain(p.domain()).range(p.range()).interpolate(p.interpolate()).clamp(p.clamp()).unknown(p.unknown());var p},go.apply(l,arguments),cl(l)}function gs(){var l,p=[.5],h=[0,1],w=1;function B(E){return null!=E&&E<=E?h[ta(p,E,0,w)]:l}return B.domain=function(E){return arguments.length?(p=Array.from(E),w=Math.min(p.length,h.length-1),B):p.slice()},B.range=function(E){return arguments.length?(h=Array.from(E),w=Math.min(p.length,h.length-1),B):h.slice()},B.invertExtent=function(E){var R=h.indexOf(E);return[p[R-1],p[R]]},B.unknown=function(E){return arguments.length?(l=E,B):l},B.copy=function(){return gs().domain(p).range(h).unknown(l)},go.apply(B,arguments)}ol=function Qc(l){var p,h,w=void 0===l.grouping||void 0===l.thousands?Ec:(p=So.call(l.grouping,Number),h=l.thousands+"",function(ne,N){for(var ce=ne.length,he=[],oe=0,Ue=p[0],ye=0;ce>0&&Ue>0&&(ye+Ue+1>N&&(Ue=Math.max(1,N-ye)),he.push(ne.substring(ce-=Ue,ce+Ue)),!((ye+=Ue+1)>N));)Ue=p[oe=(oe+1)%p.length];return he.reverse().join(h)}),B=void 0===l.currency?"":l.currency[0]+"",E=void 0===l.currency?"":l.currency[1]+"",R=void 0===l.decimal?".":l.decimal+"",D=void 0===l.numerals?Ec:function(ne){return function(N){return N.replace(/[0-9]/g,function(ce){return ne[+ce]})}}(So.call(l.numerals,String)),H=void 0===l.percent?"%":l.percent+"",F=void 0===l.minus?"\u2212":l.minus+"",V=void 0===l.nan?"NaN":l.nan+"";function le(ne){var N=(ne=Co(ne)).fill,ce=ne.align,he=ne.sign,oe=ne.symbol,Ue=ne.zero,ye=ne.width,ue=ne.comma,Te=ne.precision,De=ne.trim,J=ne.type;"n"===J?(ue=!0,J="g"):Qo[J]||(void 0===Te&&(Te=12),De=!0,J="g"),(Ue||"0"===N&&"="===ce)&&(Ue=!0,N="0",ce="=");var ie="$"===oe?B:"#"===oe&&/[boxX]/.test(J)?"0"+J.toLowerCase():"",te="$"===oe?E:/[%p]/.test(J)?H:"",Qe=Qo[J],ge=/[defgprs%]/.test(J);function Re(Le){var Ge,He,Xe,pt=ie,Ye=te;if("c"===J)Ye=Qe(Le)+Ye,Le="";else{var Ct=(Le=+Le)<0||1/Le<0;if(Le=isNaN(Le)?V:Qe(Math.abs(Le),Te),De&&(Le=function(ct){e:for(var Xt,qt=ct.length,di=1,Kt=-1;di<qt;++di)switch(ct[di]){case".":Kt=Xt=di;break;case"0":0===Kt&&(Kt=di),Xt=di;break;default:if(!+ct[di])break e;Kt>0&&(Kt=0)}return Kt>0?ct.slice(0,Kt)+ct.slice(Xt+1):ct}(Le)),Ct&&0==+Le&&"+"!==he&&(Ct=!1),pt=(Ct?"("===he?he:F:"-"===he||"("===he?"":he)+pt,Ye=("s"===J?Zl[8+ds/3]:"")+Ye+(Ct&&"("===he?")":""),ge)for(Ge=-1,He=Le.length;++Ge<He;)if(48>(Xe=Le.charCodeAt(Ge))||Xe>57){Ye=(46===Xe?R+Le.slice(Ge+1):Le.slice(Ge))+Ye,Le=Le.slice(0,Ge);break}}ue&&!Ue&&(Le=w(Le,1/0));var gt=pt.length+Le.length+Ye.length,ut=gt<ye?new Array(ye-gt+1).join(N):"";switch(ue&&Ue&&(Le=w(ut+Le,ut.length?ye-Ye.length:1/0),ut=""),ce){case"<":Le=pt+Le+Ye+ut;break;case"=":Le=pt+ut+Le+Ye;break;case"^":Le=ut.slice(0,gt=ut.length>>1)+pt+Le+Ye+ut.slice(gt);break;default:Le=ut+pt+Le+Ye}return D(Le)}return Te=void 0===Te?6:/[gprs]/.test(J)?Math.max(1,Math.min(21,Te)):Math.max(0,Math.min(20,Te)),Re.toString=function(){return ne+""},Re}return{format:le,formatPrefix:function(ne,N){var ce=le(((ne=Co(ne)).type="f",ne)),he=3*Math.max(-8,Math.min(8,Math.floor(Da(N)/3))),oe=Math.pow(10,-he),Ue=Zl[8+he/3];return function(ye){return ce(oe*ye)+Ue}}}}({thousands:",",grouping:[3],currency:["$",""]}),fs=ol.format,Yl=ol.formatPrefix;const ms={BrewerYlGn3:["#f7fcb9","#addd8e","#31a354"],BrewerYlGn4:["#ffffcc","#c2e699","#78c679","#238443"],BrewerYlGn5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],BrewerYlGn6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],BrewerYlGn7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],BrewerYlGn8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],BrewerYlGn9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],BrewerYlGnBu3:["#edf8b1","#7fcdbb","#2c7fb8"],BrewerYlGnBu4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],BrewerYlGnBu5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],BrewerYlGnBu6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],BrewerYlGnBu7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],BrewerYlGnBu8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],BrewerYlGnBu9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],BrewerGnBu3:["#e0f3db","#a8ddb5","#43a2ca"],BrewerGnBu4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],BrewerGnBu5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],BrewerGnBu6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],BrewerGnBu7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],BrewerGnBu8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],BrewerGnBu9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BrewerBuGn3:["#e5f5f9","#99d8c9","#2ca25f"],BrewerBuGn4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],BrewerBuGn5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],BrewerBuGn6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],BrewerBuGn7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],BrewerBuGn8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],BrewerBuGn9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],BrewerPuBuGn3:["#ece2f0","#a6bddb","#1c9099"],BrewerPuBuGn4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],BrewerPuBuGn5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],BrewerPuBuGn6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],BrewerPuBuGn7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],BrewerPuBuGn8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],BrewerPuBuGn9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],BrewerPuBu3:["#ece7f2","#a6bddb","#2b8cbe"],BrewerPuBu4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],BrewerPuBu5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],BrewerPuBu6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],BrewerPuBu7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],BrewerPuBu8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],BrewerPuBu9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BrewerBuPu3:["#e0ecf4","#9ebcda","#8856a7"],BrewerBuPu4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],BrewerBuPu5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],BrewerBuPu6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],BrewerBuPu7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],BrewerBuPu8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],BrewerBuPu9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],BrewerRdPu3:["#fde0dd","#fa9fb5","#c51b8a"],BrewerRdPu4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],BrewerRdPu5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],BrewerRdPu6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],BrewerRdPu7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],BrewerRdPu8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],BrewerRdPu9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],BrewerPuRd3:["#e7e1ef","#c994c7","#dd1c77"],BrewerPuRd4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],BrewerPuRd5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],BrewerPuRd6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],BrewerPuRd7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],BrewerPuRd8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],BrewerPuRd9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],BrewerOrRd3:["#fee8c8","#fdbb84","#e34a33"],BrewerOrRd4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],BrewerOrRd5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],BrewerOrRd6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],BrewerOrRd7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],BrewerOrRd8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],BrewerOrRd9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],BrewerYlOrRd3:["#ffeda0","#feb24c","#f03b20"],BrewerYlOrRd4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],BrewerYlOrRd5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],BrewerYlOrRd6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],BrewerYlOrRd7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],BrewerYlOrRd8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],BrewerYlOrRd9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],BrewerYlOrBr3:["#fff7bc","#fec44f","#d95f0e"],BrewerYlOrBr4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],BrewerYlOrBr5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],BrewerYlOrBr6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],BrewerYlOrBr7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],BrewerYlOrBr8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],BrewerYlOrBr9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],BrewerPurples3:["#efedf5","#bcbddc","#756bb1"],BrewerPurples4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],BrewerPurples5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],BrewerPurples6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],BrewerPurples7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],BrewerPurples8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],BrewerPurples9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],BrewerBlues3:["#deebf7","#9ecae1","#3182bd"],BrewerBlues4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],BrewerBlues5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],BrewerBlues6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],BrewerBlues7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],BrewerBlues8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],BrewerBlues9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],BrewerGreens3:["#e5f5e0","#a1d99b","#31a354"],BrewerGreens4:["#edf8e9","#bae4b3","#74c476","#238b45"],BrewerGreens5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],BrewerGreens6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],BrewerGreens7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],BrewerGreens8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],BrewerGreens9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],BrewerOranges3:["#fee6ce","#fdae6b","#e6550d"],BrewerOranges4:["#feedde","#fdbe85","#fd8d3c","#d94701"],BrewerOranges5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],BrewerOranges6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],BrewerOranges7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],BrewerOranges8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],BrewerOranges9
3:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BrewerReds3:["#fee0d2","#fc9272","#de2d26"],BrewerReds4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],BrewerReds5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],BrewerReds6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],BrewerReds7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],BrewerReds8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],BrewerReds9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],BrewerGreys3:["#f0f0f0","#bdbdbd","#636363"],BrewerGreys4:["#f7f7f7","#cccccc","#969696","#525252"],BrewerGreys5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],BrewerGreys6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],BrewerGreys7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],BrewerGreys8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],BrewerGreys9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],BrewerPuOr3:["#f1a340","#f7f7f7","#998ec3"],BrewerPuOr4:["#e66101","#fdb863","#b2abd2","#5e3c99"],BrewerPuOr5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],BrewerPuOr6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],BrewerPuOr7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],BrewerPuOr8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],BrewerPuOr9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],BrewerPuOr10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrewerPuOr11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrewerBrBG3:["#d8b365","#f5f5f5","#5ab4ac"],BrewerBrBG4:["#a6611a","#dfc27d","#80cdc1","#018571"],BrewerBrBG5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],BrewerBrBG6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],BrewerBrBG7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],BrewerBrBG8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],BrewerBrBG9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],BrewerBrBG10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],BrewerBrBG11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],BrewerPRGn3:["#af8dc3","#f7f7f7","#7fbf7b"],BrewerPRGn4:["#7b3294","#c2a5cf","#a6dba0","#008837"],BrewerPRGn5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],BrewerPRGn6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],BrewerPRGn7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],BrewerPRGn8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],BrewerPRGn9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],BrewerPRGn10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],BrewerPRGn11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],BrewerPiYG3:["#e9a3c9","#f7f7f7","#a1d76a"],BrewerPiYG4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],BrewerPiYG5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],BrewerPiYG6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],BrewerPiYG7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],BrewerPiYG8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],BrewerPiYG9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],BrewerPiYG10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],BrewerPiYG11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],BrewerRdBu3:["#ef8a62","#f7f7f7","#67a9cf"],BrewerRdBu4:["#ca0020","#f4a582","#92c5de","#0571b0"],BrewerRdBu5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],BrewerRdBu6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],BrewerRdBu7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],BrewerRdBu8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],BrewerRdBu9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],BrewerRdBu10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],BrewerRdBu11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],BrewerRdGy3:["#ef8a62","#ffffff","#999999"],BrewerRdGy4:["#ca0020","#f4a582","#bababa","#404040"],BrewerRdGy5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],BrewerRdGy6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],BrewerRdGy7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],BrewerRdGy8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],BrewerRdGy9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],BrewerRdGy10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],BrewerRdGy11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],BrewerRdYlBu3:["#fc8d59","#ffffbf","#91bfdb"],BrewerRdYlBu4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],BrewerRdYlBu5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],BrewerRdYlBu6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],BrewerRdYlBu7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],BrewerRdYlBu8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],BrewerRdYlBu9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],BrewerRdYlBu10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrewerRdYlBu11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrewerSpectral3:["#fc8d59","#ffffbf","#99d594"],BrewerSpectral4:["#d7191c","#fdae61","#abdda4","#2b83ba"],BrewerSpectral5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],BrewerSpectral6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],BrewerSpectral7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],BrewerSpectral8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],BrewerSpectral9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],BrewerSpectral10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],BrewerSpectral11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],BrewerRdYlGn3:["#fc8d59","#ffffbf","#91cf60"],BrewerRdYlGn4:["#d7191c","#fdae61","#a6d96a","#1a9641"],BrewerRdYlGn5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],BrewerRdYlGn6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],BrewerRdYlGn7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],BrewerRdYlGn8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],BrewerRdYlGn9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],BrewerRdYlGn10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],BrewerRdYlGn11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],BrewerAccent3:["#7fc97f","#beaed4","#fdc086"],BrewerAccent4:["#7fc97f","#beaed4","#fdc086","#ffff99"],BrewerAccent5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],BrewerAccent6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],BrewerAccent7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],BrewerAccent8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],BrewerDar
3k23:["#1b9e77","#d95f02","#7570b3"],BrewerDark24:["#1b9e77","#d95f02","#7570b3","#e7298a"],BrewerDark25:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],BrewerDark26:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],BrewerDark27:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],BrewerDark28:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],BrewerPaired3:["#a6cee3","#1f78b4","#b2df8a"],BrewerPaired4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],BrewerPaired5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],BrewerPaired6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],BrewerPaired7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],BrewerPaired8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],BrewerPaired9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],BrewerPaired10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],BrewerPaired11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],BrewerPaired12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],BrewerPastel13:["#fbb4ae","#b3cde3","#ccebc5"],BrewerPastel14:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],BrewerPastel15:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],BrewerPastel16:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],BrewerPastel17:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],BrewerPastel18:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],BrewerPastel19:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"],BrewerPastel23:["#b3e2cd","#fdcdac","#cbd5e8"],BrewerPastel24:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],BrewerPastel25:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],BrewerPastel26:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],BrewerPastel27:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],BrewerPastel28:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],BrewerSet13:["#e41a1c","#377eb8","#4daf4a"],BrewerSet14:["#e41a1c","#377eb8","#4daf4a","#984ea3"],BrewerSet15:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],BrewerSet16:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],BrewerSet17:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],BrewerSet18:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],BrewerSet19:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],BrewerSet23:["#66c2a5","#fc8d62","#8da0cb"],BrewerSet24:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],BrewerSet25:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],BrewerSet26:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],BrewerSet27:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],BrewerSet28:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],BrewerSet33:["#8dd3c7","#ffffb3","#bebada"],BrewerSet34:["#8dd3c7","#ffffb3","#bebada","#fb8072"],BrewerSet35:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],BrewerSet36:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],BrewerSet37:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],BrewerSet38:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],BrewerSet39:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],BrewerSet310:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],BrewerSet311:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],BrewerSet312:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],CartoBurg:["#ffc6c4","#f4a3a8","#e38191","#cc607d","#ad466c","#8b3058","#672044"],CartoBurgYl:["#fbe6c5","#f5ba98","#ee8a82","#dc7176","#c8586c","#9c3f5d","#70284a"],CartoRedOr:["#f6d2a9","#f5b78e","#f19c7c","#ea8171","#dd686c","#ca5268","#b13f64"],CartoOrYel:["#ecda9a","#efc47e","#f3ad6a","#f7945d","#f97b57","#f66356","#ee4d5
3a"],CartoPeach:["#fde0c5","#facba6","#f8b58b","#f59e72","#f2855d","#ef6a4c","#eb4a40"],CartoPinkYl:["#fef6b5","#ffdd9a","#ffc285","#ffa679","#fa8a76","#f16d7a","#e15383"],CartoMint:["#e4f1e1","#b4d9cc","#89c0b6","#63a6a0","#448c8a","#287274","#0d585f"],CartoBluGrn:["#c4e6c3","#96d2a4","#6dbc90","#4da284","#36877a","#266b6e","#1d4f60"],CartoDarkMint:["#d2fbd4","#a5dbc2","#7bbcb0","#559c9e","#3a7c89","#235d72","#123f5a"],CartoEmrld:["#d3f2a3","#97e196","#6cc08b","#4c9b82","#217a79","#105965","#074050"],CartoBluYl:["#f7feae","#b7e6a5","#7ccba2","#46aea0","#089099","#00718b","#045275"],CartoTeal:["#d1eeea","#a8dbd9","#85c4c9","#68abb8","#4f90a6","#3b738f","#2a5674"],CartoTealGrn:["#b0f2bc","#89e8ac","#67dba5","#4cc8a3","#38b2a3","#2c98a0","#257d98"],CartoPurp:["#f3e0f7","#e4c7f1","#d1afe8","#b998dd","#9f82ce","#826dba","#63589f"],CartoPurpOr:["#f9ddda","#f2b9c4","#e597b9","#ce78b3","#ad5fad","#834ba0","#573b88"],CartoSunset:["#f3e79b","#fac484","#f8a07e","#eb7f86","#ce6693","#a059a0","#5c53a5"],CartoMagenta:["#f3cbd3","#eaa9bd","#dd88ac","#ca699d","#b14d8e","#91357d","#6c2167"],CartoSunsetDark:["#fcde9c","#faa476","#f0746e","#e34f6f","#dc3977","#b9257a","#7c1d6f"],CartoBrwnYl:["#ede5cf","#e0c2a2","#d39c83","#c1766f","#a65461","#813753","#541f3f"],CartoArmyRose:["#798234","#a3ad62","#d0d3a2","#fdfbe4","#f0c6c3","#df91a3","#d46780"],CartoFall:["#3d5941","#778868","#b5b991","#f6edbd","#edbb8a","#de8a5a","#ca562c"],CartoGeyser:["#008080","#70a494","#b4c8a8","#f6edbd","#edbb8a","#de8a5a","#ca562c"],CartoTemps:["#009392","#39b185","#9ccb86","#e9e29c","#eeb479","#e88471","#cf597e"],CartoTealRose:["#009392","#72aaa1","#b1c7b3","#f1eac8","#e5b9ad","#d98994","#d0587e"],CartoTropic:["#009B9E","#42B7B9","#A7D3D4","#F1F1F1","#E4C1D9","#D691C1","#C75DAB"],CartoEarth:["#A16928","#bd925a","#d6bd8d","#edeac2","#b5c8b8","#79a7ac","#2887a1"]},hl=Object.keys(ms),Js=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Do=l=>{const p=Js.exec(l);if(null!==p)return[parseInt(p[1],16),parseInt(p[2],16),parseInt(p[3],16)];throw new Error(`Cannot parse hex color "${l}"`)},ko=({colorScheme:l,customColors:p,min:h,max:w,isReverse:B=!1,isContinuous:E=!1})=>{let R;if(l){if(!hl.includes(l))throw new Error(`"${l}" is not a supported color scheme`);R=ms[l]}else{if(!(p&&p.length>=2))throw new Error("You must provide a colorScheme or an array of at least 2 customColors");R=p}const H=R.map(Do),F=B?H.reverse():H;if(E)return ps((le=h,ne=w,N=F.length,Array.from({length:N},(ce,he)=>le+he*(ne-le)/(N-1))),F).clamp(!0);var le,ne,N;{const V=((le,ne,N)=>Array.from({length:N-1},(ce,he)=>le+(he+1)*(ne-le)/N))(h,w,F.length);return gs(V,F)}},ka=65536,ys=l=>l.length/ka;var ya;!function(l){l[l.WhiteIsZero=0]="WhiteIsZero",l[l.BlackIsZero=1]="BlackIsZero",l[l.RGB=2]="RGB",l[l.Palette=3]="Palette",l[l.TransparencyMask=4]="TransparencyMask",l[l.CMYK=5]="CMYK",l[l.YCbCr=6]="YCbCr",l[l.CIELab=8]="CIELab",l[l.ICCLab=9]="ICCLab"}(ya||(ya={}));const Al={};const an=function(){var l=ht(function*(p){const h=new RegExp(/cog:\/\/(.+)\/(\d+)\/(\d+)\/(\d+)/),w=p.match(h);if(!w)throw new Error(`Invalid COG protocol URL '${p}'`);const B=w[1].split("#"),E=B[0];B.shift();const R=B.join("#")??"",D=parseInt(w[2]),H=parseInt(w[3]),F=parseInt(w[4]),V=ns(E),le=yield V.getRawTile({z:D,x:H,y:F}),ne=yield V.getMetadata();let N;const ce=(l=>Al[l])(E);if(void 0!==ce)N=ce(le,ne);else if(R.startsWith("dem"))N=((he,{offset:oe,scale:Ue,noData:ye})=>{const Te=he.length/65536,De=new Uint8ClampedArray(262144);for(let J=0;J<65536;J++){const ie=oe+he[J*Te]*Ue,te=((ie==ye?0:ie)- -1e4)/.1;De[4*J]=Math.floor(te/256/256)%256,De[4*J+1]=Math.floor(te/256)%256,De[4*J+2]=te%256,De[4*J+3]=255}return De})(le,ne);else if(R.startsWith("color")){const he=R.split("color").pop()?.substring(1);if(!he)throw new Error("Color params are not defined");{const oe=he.match(/\[("#([0-9a-fA-F]{3,6})"(,(\s)?)?)+]/)?.[0];let Ue,ye,ue,Te="",De=[];oe?(De=JSON.parse(oe),[Ue,ye,ue]=he.replace(`${oe},`,"").split(",")):[Te,Ue,ye,ue]=he.split(",");const J=parseFloat(Ue),ie=parseFloat(ye),te=ue?.includes("-")||!1,Qe=ue?.includes("c")||!1;N=((ge,{offset:Re,scale:Le,noData:Ge,colorScale:He})=>{const pt=ge.length/65536,Ye=new Uint8ClampedArray(262144),Ct=ko(He);for(let gt=0;gt<65536;gt++){const ut=Re+ge[gt*pt]*Le;if(ut===Ge||isNaN(ut)||ut===1/0)Ye[4*gt]=0,Ye[4*gt+1]=0,Ye[4*gt+2]=0,Ye[4*gt+3]=0;else{const ct=Ct(ut);Ye[4*gt]=ct[0],Ye[4*gt+1]=ct[1],Ye[4*gt+2]=ct[2],Ye[4*gt+3]=255}}return Ye})(le,{...ne,colorScale:{colorScheme:Te,customColors:De,min:J,max:ie,isReverse:te,isContinuous:Qe}})}}else N=((l,{noData:p,photometricInterpretation:h,bitsPerSample:w,
3colorMap:B})=>{const E=w&&w[0]?2**w[0]:NaN,R=p??0;let D;switch(h){case ya.WhiteIsZero:D=function(H,F,V){const le=new Uint8ClampedArray(262144),ne=ys(H);let N;for(let ce=0;ce<ka;ce++)N=255-H[ce*ne]/F*255,le[4*ce]=N,le[4*ce+1]=N,le[4*ce+2]=N,le[4*ce+3]=H[ce*ne]===V?0:255;return le}(l,E,R);break;case ya.BlackIsZero:D=function(H,F,V){const le=new Uint8ClampedArray(262144),ne=ys(H);let N;for(let ce=0;ce<ka;ce++)N=H[ce*ne]/F*255,le[4*ce]=N,le[4*ce+1]=N,le[4*ce+2]=N,le[4*ce+3]=H[ce*ne]===V?0:255;return le}(l,E,R);break;case ya.RGB:D=function(H,F){const V=new Uint8ClampedArray(262144),le=ys(H);for(let ne=0;ne<ka;ne++)V[4*ne]=H[ne*le],V[4*ne+1]=H[ne*le+1],V[4*ne+2]=H[ne*le+2],V[4*ne+3]=H[ne*le]===F&&H[ne*le+1]===F&&H[ne*le+2]===F?0:255;return V}(l,R);break;case ya.Palette:if(!B)throw new Error("colorMap for paletted image not found.");D=function(H,F,V){const le=new Uint8ClampedArray(262144),ne=ys(H),N=F.length/3,ce=F.length/3*2;for(let he=0;he<ka;he++){const oe=H[he*ne];le[4*he]=F[oe]/65536*256,le[4*he+1]=F[oe+N]/65536*256,le[4*he+2]=F[oe+ce]/65536*256,le[4*he+3]=H[he*ne]===V?0:255}return le}(l,B,R);break;case ya.CMYK:D=function(H,F){const V=new Uint8ClampedArray(262144),le=ys(H);for(let ne=0;ne<H.length;ne++){const N=H[ne*le],ce=H[ne*le+1],he=H[ne*le+2],oe=H[ne*le+3];V[4*ne]=(255-N)/256*255*((255-oe)/256),V[4*ne+1]=(255-ce)/256*255*((255-oe)/256),V[4*ne+2]=(255-he)/256*255*((255-oe)/256),V[4*ne+3]=N===F&&ce===F&&he===F&&oe===F?0:255}return V}(l,R);break;case ya.YCbCr:D=function(H,F){const V=new Uint8ClampedArray(262144),le=ys(H);for(let ne=0;ne<ka;ne++){const N=H[ne*le],ce=H[ne*le+1],he=H[ne*le+2];V[4*ne]=N+1.402*(he-128),V[4*ne+1]=N-.34414*(ce-128)-.71414*(he-128),V[4*ne+2]=N+1.772*(ce-128),V[4*ne+3]=N===F&&ce==F&&he==F?0:255}return V}(l,R);break;case ya.CIELab:D=function(H,F){const V=new Uint8ClampedArray(ka),le=ys(H);for(let ne=0;ne<H.length;ne++){const N=H[ne*le],ce=H[ne*le+1]<<24>>24,he=H[ne*le+2]<<24>>24;let oe,Ue,ye,ue=(N+16)/116,Te=ce/500+ue,De=ue-he/200;Te=.95047*(Te*Te*Te>.008856?Te*Te*Te:(Te-16/116)/7.787),ue=1*(ue*ue*ue>.008856?ue*ue*ue:(ue-16/116)/7.787),De=1.08883*(De*De*De>.008856?De*De*De:(De-16/116)/7.787),oe=3.2406*Te+-1.5372*ue+-.4986*De,Ue=-.9689*Te+1.8758*ue+.0415*De,ye=.0557*Te+-.204*ue+1.057*De,oe=oe>.0031308?1.055*oe**(1/2.4)-.055:12.92*oe,Ue=Ue>.0031308?1.055*Ue**(1/2.4)-.055:12.92*Ue,ye=ye>.0031308?1.055*ye**(1/2.4)-.055:12.92*ye,V[4*ne]=255*Math.max(0,Math.min(1,oe)),V[4*ne+1]=255*Math.max(0,Math.min(1,Ue)),V[4*ne+2]=255*Math.max(0,Math.min(1,ye)),V[4*ne+3]=N===F&&ce==F&&he==F?0:255}return V}(l,R);break;default:throw new Error("Unsupported photometric interpretation.")}return D})(le,ne);return yield createImageBitmap(new ImageData(N,256,256))});return function(h){return l.apply(this,arguments)}}();var _s=Object.freeze({__proto__:null,default:class extends Ga{decodeBlock(l){return l}}});function fl(l,p){for(let h=p.length-1;h>=0;h--)l.push(p[h]);return l}var na=Object.freeze({__proto__:null,default:class extends Ga{decodeBlock(l){return function Qr(l){const p=new Uint16Array(4093),h=new Uint8Array(4093);for(let ce=0;ce<=257;ce++)p[ce]=4096,h[ce]=ce;let w=258,B=9,E=0;function R(){w=258,B=9}function D(ce){const he=function(oe,Ue,ye){const ue=Ue%8,Te=Math.floor(Ue/8),De=8-ue,J=Ue+ye-8*(Te+1);let ie=8*(Te+2)-(Ue+ye);const te=8*(Te+2)-Ue;if(ie=Math.max(0,ie),Te>=oe.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;let Qe=oe[Te]&2**(8-ue)-1;Qe<<=ye-De;let ge=Qe;if(Te+1<oe.length){let Re=oe[Te+1]>>>ie;Re<<=Math.max(0,ye-te),ge+=Re}return J>8&&Te+2<oe.length&&(ge+=oe[Te+2]>>>8*(Te+3)-(Ue+ye)),ge}(ce,E,B);return E+=B,he}function H(ce,he){return h[w]=he,p[w]=ce,w++,w-1}function F(ce){const he=[];for(let oe=ce;4096!==oe;oe=p[oe])he.push(h[oe]);return he}const V=[];R();const le=new Uint8Array(l);let ne,N=D(le);for(;257!==N;){if(256===N){for(R(),N=D(le);256===N;)N=D(le);if(257===N)break;if(N>256)throw new Error(`corrupted code at scanline ${N}`);fl(V,F(N)),ne=N}else if(N<w){const ce=F(N);fl(V,ce),H(ne,ce[ce.length-1]),ne=N}else{const ce=F(ne);if(!ce)throw new Error(`Bogus entry. Not in dictionary, ${ne} / ${w}, position: ${E}`);fl(V,ce),V.push(ce[ce.length-1]),H(ne,ce[ce.length-1]),ne=N}w+1>=2**B&&(12===B?ne=void 0:B++),N=D(le)}return new Uint8Array(V)}(l).buffer}}});const $r=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,5
37,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),Ta=5793;function Po(l,p){let h=0;const w=[];let B=16;for(;B>0&&!l[B-1];)--B;w.push({children:[],index:0});let E,R=w[0];for(let D=0;D<B;D++){for(let H=0;H<l[D];H++){for(R=w.pop(),R.children[R.index]=p[h];R.index>0;)R=w.pop();for(R.index++,w.push(R);w.length<=D;)w.push(E={children:[],index:0}),R.children[R.index]=E.children,R=E;h++}D+1<B&&(w.push(E={children:[],index:0}),R.children[R.index]=E.children,R=E)}return w[0].children}function Kl(l,p,h,w,B,E,R,D,H){const{mcusPerLine:F,progressive:V}=h,le=p;let ne=p,N=0,ce=0;function he(){if(ce>0)return ce--,N>>ce&1;if(N=l[ne++],255===N){const gt=l[ne++];if(gt)throw new Error(`unexpected marker: ${(N<<8|gt).toString(16)}`)}return ce=7,N>>>7}function oe(gt){let ut,ct=gt;for(;null!==(ut=he());){if(ct=ct[ut],"number"==typeof ct)return ct;if("object"!=typeof ct)throw new Error("invalid huffman sequence")}return null}function Ue(gt){let ut=gt,ct=0;for(;ut>0;){const Xt=he();if(null===Xt)return;ct=ct<<1|Xt,--ut}return ct}function ye(gt){const ut=Ue(gt);return ut>=1<<gt-1?ut:ut+(-1<<gt)+1}let Te,ue=0,De=0;function J(gt,ut,ct,Xt,qt){ut(gt,gt.blocks[(ct/F|0)*gt.v+Xt][ct%F*gt.h+qt])}const te=w.length;let Qe,ge,Re,Le,Ge,He;He=V?0===E?0===D?function(gt,ut){const ct=oe(gt.huffmanTableDC),Xt=0===ct?0:ye(ct)<<H;gt.pred+=Xt,ut[0]=gt.pred}:function(gt,ut){ut[0]|=he()<<H}:0===D?function(gt,ut){if(ue>0)return void ue--;let ct=E;const Xt=R;for(;ct<=Xt;){const qt=oe(gt.huffmanTableAC),di=15&qt,Kt=qt>>4;if(0===di){if(Kt<15){ue=Ue(Kt)+(1<<Kt)-1;break}ct+=16}else ct+=Kt,ut[$r[ct]]=ye(di)*(1<<H),ct++}}:function(gt,ut){let ct=E;const Xt=R;let qt=0;for(;ct<=Xt;){const di=$r[ct],Kt=ut[di]<0?-1:1;switch(De){case 0:{const qi=oe(gt.huffmanTableAC),Oi=15&qi;if(qt=qi>>4,0===Oi)qt<15?(ue=Ue(qt)+(1<<qt),De=4):(qt=16,De=1);else{if(1!==Oi)throw new Error("invalid ACn encoding");Te=ye(Oi),De=qt?2:3}continue}case 1:case 2:ut[di]?ut[di]+=(he()<<H)*Kt:(qt--,0===qt&&(De=2===De?3:0));break;case 3:ut[di]?ut[di]+=(he()<<H)*Kt:(ut[di]=Te<<H,De=0);break;case 4:ut[di]&&(ut[di]+=(he()<<H)*Kt)}ct++}4===De&&(ue--,0===ue&&(De=0))}:function(gt,ut){const ct=oe(gt.huffmanTableDC),Xt=0===ct?0:ye(ct);gt.pred+=Xt,ut[0]=gt.pred;let qt=1;for(;qt<64;){const di=oe(gt.huffmanTableAC),Kt=15&di,qi=di>>4;if(0===Kt){if(qi<15)break;qt+=16}else qt+=qi,ut[$r[qt]]=ye(Kt),qt++}};let Xe,pt,Ye=0;pt=1===te?w[0].blocksPerLine*w[0].blocksPerColumn:F*h.mcusPerColumn;const Ct=B||pt;for(;Ye<pt;){for(ge=0;ge<te;ge++)w[ge].pred=0;if(ue=0,1===te)for(Qe=w[0],Ge=0;Ge<Ct;Ge++)He(gt=Qe,gt.blocks[(ct=Ye)/gt.blocksPerLine|0][ct%gt.blocksPerLine]),Ye++;else for(Ge=0;Ge<Ct;Ge++){for(ge=0;ge<te;ge++){Qe=w[ge];const{h:gt,v:ut}=Qe;for(Re=0;Re<ut;Re++)for(Le=0;Le<gt;Le++)J(Qe,He,Ye,Re,Le)}if(Ye++,Ye===pt)break}if(ce=0,Xe=l[ne]<<8|l[ne+1],Xe<65280)throw new Error("marker was not found");if(!(Xe>=65488&&Xe<=65495))break;ne+=2}var gt,ct;return ne-le}function $l(l,p){const h=[],{blocksPerLine:w,blocksPerColumn:B}=p,E=w<<3,R=new Int32Array(64),D=new Uint8Array(64);function H(F,V,le){const ne=p.quantizationTable;let N,ce,he,oe,Ue,ye,ue,Te,De;const J=le;let ie;for(ie=0;ie<64;ie++)J[ie]=F[ie]*ne[ie];for(ie=0;ie<8;++ie){const te=8*ie;0!==J[1+te]||0!==J[2+te]||0!==J[3+te]||0!==J[4+te]||0!==J[5+te]||0!==J[6+te]||0!==J[7+te]?(N=Ta*J[0+te]+128>>8,ce=Ta*J[4+te]+128>>8,he=J[2+te],oe=J[6+te],Ue=2896*(J[1+te]-J[7+te])+128>>8,Te=2896*(J[1+te]+J[7+te])+128>>8,ye=J[3+te]<<4,ue=J[5+te]<<4,De=N-ce+1>>1,N=N+ce+1>>1,ce=De,De=3784*he+1567*oe+128>>8,he=1567*he-3784*oe+128>>8,oe=De,De=Ue-ue+1>>1,Ue=Ue+ue+1>>1,ue=De,De=Te+ye+1>>1,ye=Te-ye+1>>1,Te=De,De=N-oe+1>>1,N=N+oe+1>>1,oe=De,De=ce-he+1>>1,ce=ce+he+1>>1,he=De,De=2276*Ue+3406*Te+2048>>12,Ue=3406*Ue-2276*Te+2048>>12,Te=De,De=799*ye+4017*ue+2048>>12,ye=4017*ye-799*ue+2048>>12,ue=De,J[0+te]=N+Te,J[7+te]=N-Te,J[1+te]=ce+ue,J[6+te]=ce-ue,J[2+te]=he+ye,J[5+te]=he-ye,J[3+te]=oe+Ue,J[4+te]=oe-Ue):(De=Ta*J[0+te]+512>>10,J[0+te]=De,J[1+te]=De,J[2+te]=De,J[3+te]=De,J[4+te]=De,J[5+te]=De,J[6+te]=De,J[7+te]=De)}for(ie=0;ie<8;++ie){const te=ie;0!==J[8+te]||0!==J[16+te]||0!==J[24+te]||0!==J[32+te]||0!==J[40+te]||0!==J[48+te]||
30!==J[56+te]?(N=Ta*J[0+te]+2048>>12,ce=Ta*J[32+te]+2048>>12,he=J[16+te],oe=J[48+te],Ue=2896*(J[8+te]-J[56+te])+2048>>12,Te=2896*(J[8+te]+J[56+te])+2048>>12,ye=J[24+te],ue=J[40+te],De=N-ce+1>>1,N=N+ce+1>>1,ce=De,De=3784*he+1567*oe+2048>>12,he=1567*he-3784*oe+2048>>12,oe=De,De=Ue-ue+1>>1,Ue=Ue+ue+1>>1,ue=De,De=Te+ye+1>>1,ye=Te-ye+1>>1,Te=De,De=N-oe+1>>1,N=N+oe+1>>1,oe=De,De=ce-he+1>>1,ce=ce+he+1>>1,he=De,De=2276*Ue+3406*Te+2048>>12,Ue=3406*Ue-2276*Te+2048>>12,Te=De,De=799*ye+4017*ue+2048>>12,ye=4017*ye-799*ue+2048>>12,ue=De,J[0+te]=N+Te,J[56+te]=N-Te,J[8+te]=ce+ue,J[48+te]=ce-ue,J[16+te]=he+ye,J[40+te]=he-ye,J[24+te]=oe+Ue,J[32+te]=oe-Ue):(De=Ta*le[ie+0]+8192>>14,J[0+te]=De,J[8+te]=De,J[16+te]=De,J[24+te]=De,J[32+te]=De,J[40+te]=De,J[48+te]=De,J[56+te]=De)}for(ie=0;ie<64;++ie){const te=128+(J[ie]+8>>4);V[ie]=te<0?0:te>255?255:te}}for(let F=0;F<B;F++){const V=F<<3;for(let le=0;le<8;le++)h.push(new Uint8Array(E));for(let le=0;le<w;le++){H(p.blocks[F][le],D,R);let ne=0;const N=le<<3;for(let ce=0;ce<8;ce++){const he=h[V+ce];for(let oe=0;oe<8;oe++)he[N+oe]=D[ne++]}}}return h}class bs{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(p){let h=0;function w(){const D=p[h]<<8|p[h+1];return h+=2,D}function B(){const D=w(),H=p.subarray(h,h+D-2);return h+=H.length,H}function E(D){let H,F,V=0,le=0;for(F in D.components)D.components.hasOwnProperty(F)&&(H=D.components[F],V<H.h&&(V=H.h),le<H.v&&(le=H.v));const ne=Math.ceil(D.samplesPerLine/8/V),N=Math.ceil(D.scanLines/8/le);for(F in D.components)if(D.components.hasOwnProperty(F)){H=D.components[F];const ce=Math.ceil(Math.ceil(D.samplesPerLine/8)*H.h/V),he=Math.ceil(Math.ceil(D.scanLines/8)*H.v/le),oe=ne*H.h,Ue=N*H.v,ye=[];for(let ue=0;ue<Ue;ue++){const Te=[];for(let De=0;De<oe;De++)Te.push(new Int32Array(64));ye.push(Te)}H.blocksPerLine=ce,H.blocksPerColumn=he,H.blocks=ye}D.maxH=V,D.maxV=le,D.mcusPerLine=ne,D.mcusPerColumn=N}let R=w();if(65496!==R)throw new Error("SOI not found");for(R=w();65497!==R;){switch(R){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const D=B();65504===R&&74===D[0]&&70===D[1]&&73===D[2]&&70===D[3]&&0===D[4]&&(this.jfif={version:{major:D[5],minor:D[6]},densityUnits:D[7],xDensity:D[8]<<8|D[9],yDensity:D[10]<<8|D[11],thumbWidth:D[12],thumbHeight:D[13],thumbData:D.subarray(14,14+3*D[12]*D[13])}),65518===R&&65===D[0]&&100===D[1]&&111===D[2]&&98===D[3]&&101===D[4]&&0===D[5]&&(this.adobe={version:D[6],flags0:D[7]<<8|D[8],flags1:D[9]<<8|D[10],transformCode:D[11]});break}case 65499:{const D=w()+h-2;for(;h<D;){const H=p[h++],F=new Int32Array(64);if(H>>4){if(H>>4!=1)throw new Error("DQT: invalid table spec");for(let V=0;V<64;V++)F[$r[V]]=w()}else for(let V=0;V<64;V++)F[$r[V]]=p[h++];this.quantizationTables[15&H]=F}break}case 65472:case 65473:case 65474:{w();const D={extended:65473===R,progressive:65474===R,precision:p[h++],scanLines:w(),samplesPerLine:w(),components:{},componentsOrder:[]},H=p[h++];let F;for(let V=0;V<H;V++){F=p[h];const le=p[h+1]>>4,ne=15&p[h+1],N=p[h+2];D.componentsOrder.push(F),D.components[F]={h:le,v:ne,quantizationIdx:N},h+=3}E(D),this.frames.push(D);break}case 65476:{const D=w();for(let H=2;H<D;){const F=p[h++],V=new Uint8Array(16);let le=0;for(let N=0;N<16;N++,h++)V[N]=p[h],le+=V[N];const ne=new Uint8Array(le);for(let N=0;N<le;N++,h++)ne[N]=p[h];H+=17+le,F>>4?this.huffmanTablesAC[15&F]=Po(V,ne):this.huffmanTablesDC[15&F]=Po(V,ne)}break}case 65501:w(),this.resetInterval=w();break;case 65498:{w();const D=p[h++],H=[],F=this.frames[0];for(let ce=0;ce<D;ce++){const he=F.components[p[h++]],oe=p[h++];he.huffmanTableDC=this.huffmanTablesDC[oe>>4],he.huffmanTableAC=this.huffmanTablesAC[15&oe],H.push(he)}const V=p[h++],le=p[h++],ne=p[h++],N=Kl(p,h,F,H,this.resetInterval,V,le,ne>>4,15&ne);h+=N;break}case 65535:255!==p[h]&&h--;break;default:if(255===p[h-3]&&p[h-2]>=192&&p[h-2]<=254){h-=3;break}throw new Error(`unknown JPEG marker ${R.toString(16)}`)}R=w()}}getResult(){const{frames:p}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let V=0;V<this.frames.length;V++){const le=this.frames[V].components;for(const ne of Object.keys(le))le[ne].quantizationTable=this.quantizationTables[le[ne].quantizationIdx],delete le[ne].quantizationIdx}
3const h=p[0],{components:w,componentsOrder:B}=h,E=[],R=h.samplesPerLine,D=h.scanLines;for(let V=0;V<B.length;V++){const le=w[B[V]];E.push({lines:$l(0,le),scaleX:le.h/h.maxH,scaleY:le.v/h.maxV})}const H=new Uint8Array(R*D*E.length);let F=0;for(let V=0;V<D;++V)for(let le=0;le<R;++le)for(let ne=0;ne<E.length;++ne){const N=E[ne];H[F]=N.lines[0|V*N.scaleY][0|le*N.scaleX],++F}return H}}var pl=Object.freeze({__proto__:null,default:class extends Ga{constructor(l){super(),this.reader=new bs,l.JPEGTables&&this.reader.parse(l.JPEGTables)}decodeBlock(l){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(l)),this.reader.getResult().buffer}}});function _a(l){let p=l.length;for(;--p>=0;)l[p]=0}const $s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Pa=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Sc=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Mn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Jr=new Array(576);_a(Jr);const xs=new Array(60);_a(xs);const gn=new Array(512);_a(gn);const aa=new Array(256);_a(aa);const Xl=new Array(29);_a(Xl);const ml=new Array(30);function yl(l,p,h,w,B){this.static_tree=l,this.extra_bits=p,this.extra_base=h,this.elems=w,this.max_length=B,this.has_stree=l&&l.length}let Wl,_l,Bs;function Bn(l,p){this.dyn_tree=l,this.max_code=0,this.stat_desc=p}_a(ml);const Ht=l=>l<256?gn[l]:gn[256+(l>>>7)],Ha=(l,p)=>{l.pending_buf[l.pending++]=255&p,l.pending_buf[l.pending++]=p>>>8&255},sn=(l,p,h)=>{l.bi_valid>16-h?(l.bi_buf|=p<<l.bi_valid&65535,Ha(l,l.bi_buf),l.bi_buf=p>>16-l.bi_valid,l.bi_valid+=h-16):(l.bi_buf|=p<<l.bi_valid&65535,l.bi_valid+=h)},sa=(l,p,h)=>{sn(l,h[2*p],h[2*p+1])},Cs=(l,p)=>{let h=0;do{h|=1&l,l>>>=1,h<<=1}while(--p>0);return h>>>1},Es=(l,p,h)=>{const w=new Array(16);let B,E,R=0;for(B=1;B<=15;B++)R=R+h[B-1]<<1,w[B]=R;for(E=0;E<=p;E++){let D=l[2*E+1];0!==D&&(l[2*E]=Cs(w[D]++,D))}},Il=l=>{let p;for(p=0;p<286;p++)l.dyn_ltree[2*p]=0;for(p=0;p<30;p++)l.dyn_dtree[2*p]=0;for(p=0;p<19;p++)l.bl_tree[2*p]=0;l.dyn_ltree[512]=1,l.opt_len=l.static_len=0,l.sym_next=l.matches=0},Ni=l=>{l.bi_valid>8?Ha(l,l.bi_buf):l.bi_valid>0&&(l.pending_buf[l.pending++]=l.bi_buf),l.bi_buf=0,l.bi_valid=0},bl=(l,p,h,w)=>{const B=2*p,E=2*h;return l[B]<l[E]||l[B]===l[E]&&w[p]<=w[h]},ec=(l,p,h)=>{const w=l.heap[h];let B=h<<1;for(;B<=l.heap_len&&(B<l.heap_len&&bl(p,l.heap[B+1],l.heap[B],l.depth)&&B++,!bl(p,w,l.heap[B],l.depth));)l.heap[h]=l.heap[B],h=B,B<<=1;
vendor: 8,515 bytes, line 3
3l.heap[h]=w},wl=(l,p,h)=>{let w,B,E,R,D=0;if(0!==l.sym_next)do{w=255&l.pending_buf[l.sym_buf+D++],w+=(255&l.pending_buf[l.sym_buf+D++])<<8,B=l.pending_buf[l.sym_buf+D++],0===w?sa(l,B,p):(E=aa[B],sa(l,E+256+1,p),R=$s[E],0!==R&&(B-=Xl[E],sn(l,B,R)),w--,E=Ht(w),sa(l,E,h),R=Pa[E],0!==R&&(w-=ml[E],sn(l,w,R)))}while(D<l.sym_next);sa(l,256,p)},tc=(l,p)=>{const h=p.dyn_tree,w=p.stat_desc.static_tree,B=p.stat_desc.has_stree,E=p.stat_desc.elems;let R,D,H,F=-1;for(l.heap_len=0,l.heap_max=573,R=0;R<E;R++)0!==h[2*R]?(l.heap[++l.heap_len]=F=R,l.depth[R]=0):h[2*R+1]=0;for(;l.heap_len<2;)H=l.heap[++l.heap_len]=F<2?++F:0,h[2*H]=1,l.depth[H]=0,l.opt_len--,B&&(l.static_len-=w[2*H+1]);for(p.max_code=F,R=l.heap_len>>1;R>=1;R--)ec(l,h,R);H=E;do{R=l.heap[1],l.heap[1]=l.heap[l.heap_len--],ec(l,h,1),D=l.heap[1],l.heap[--l.heap_max]=R,l.heap[--l.heap_max]=D,h[2*H]=h[2*R]+h[2*D],l.depth[H]=(l.depth[R]>=l.depth[D]?l.depth[R]:l.depth[D])+1,h[2*R+1]=h[2*D+1]=H,l.heap[1]=H++,ec(l,h,1)}while(l.heap_len>=2);l.heap[--l.heap_max]=l.heap[1],((V,le)=>{const ne=le.dyn_tree,N=le.max_code,ce=le.stat_desc.static_tree,he=le.stat_desc.has_stree,oe=le.stat_desc.extra_bits,Ue=le.stat_desc.extra_base,ye=le.stat_desc.max_length;let ue,Te,De,J,ie,te,Qe=0;for(J=0;J<=15;J++)V.bl_count[J]=0;for(ne[2*V.heap[V.heap_max]+1]=0,ue=V.heap_max+1;ue<573;ue++)Te=V.heap[ue],J=ne[2*ne[2*Te+1]+1]+1,J>ye&&(J=ye,Qe++),ne[2*Te+1]=J,Te>N||(V.bl_count[J]++,ie=0,Te>=Ue&&(ie=oe[Te-Ue]),te=ne[2*Te],V.opt_len+=te*(J+ie),he&&(V.static_len+=te*(ce[2*Te+1]+ie)));if(0!==Qe){do{for(J=ye-1;0===V.bl_count[J];)J--;V.bl_count[J]--,V.bl_count[J+1]+=2,V.bl_count[ye]--,Qe-=2}while(Qe>0);for(J=ye;0!==J;J--)for(Te=V.bl_count[J];0!==Te;)De=V.heap[--ue],De>N||(ne[2*De+1]!==J&&(V.opt_len+=(J-ne[2*De+1])*ne[2*De],ne[2*De+1]=J),Te--)}})(l,p),Es(h,F,l.bl_count)},Qs=(l,p,h)=>{let w,B,E=-1,R=p[1],D=0,H=7,F=4;for(0===R&&(H=138,F=3),p[2*(h+1)+1]=65535,w=0;w<=h;w++)B=R,R=p[2*(w+1)+1],++D<H&&B===R||(D<F?l.bl_tree[2*B]+=D:0!==B?(B!==E&&l.bl_tree[2*B]++,l.bl_tree[32]++):D<=10?l.bl_tree[34]++:l.bl_tree[36]++,D=0,E=B,0===R?(H=138,F=3):B===R?(H=6,F=3):(H=7,F=4))},ic=(l,p,h)=>{let w,B,E=-1,R=p[1],D=0,H=7,F=4;for(0===R&&(H=138,F=3),w=0;w<=h;w++)if(B=R,R=p[2*(w+1)+1],!(++D<H&&B===R)){if(D<F)do{sa(l,B,l.bl_tree)}while(0!=--D);else 0!==B?(B!==E&&(sa(l,B,l.bl_tree),D--),sa(l,16,l.bl_tree),sn(l,D-3,2)):D<=10?(sa(l,17,l.bl_tree),sn(l,D-3,3)):(sa(l,18,l.bl_tree),sn(l,D-11,7));D=0,E=B,0===R?(H=138,F=3):B===R?(H=6,F=3):(H=7,F=4)}};let vl=!1;const rc=(l,p,h,w)=>{sn(l,0+(w?1:0),3),Ni(l),Ha(l,h),Ha(l,~h),h&&l.pending_buf.set(l.window.subarray(p,p+h),l.pending),l.pending+=h};var nc={_tr_init:l=>{vl||((()=>{let p,h,w,B,E;const R=new Array(16);for(w=0,B=0;B<28;B++)for(Xl[B]=w,p=0;p<1<<$s[B];p++)aa[w++]=B;for(aa[w-1]=B,E=0,B=0;B<16;B++)for(ml[B]=E,p=0;p<1<<Pa[B];p++)gn[E++]=B;for(E>>=7;B<30;B++)for(ml[B]=E<<7,p=0;p<1<<Pa[B]-7;p++)gn[256+E++]=B;for(h=0;h<=15;h++)R[h]=0;for(p=0;p<=143;)Jr[2*p+1]=8,p++,R[8]++;for(;p<=255;)Jr[2*p+1]=9,p++,R[9]++;for(;p<=279;)Jr[2*p+1]=7,p++,R[7]++;for(;p<=287;)Jr[2*p+1]=8,p++,R[8]++;for(Es(Jr,287,R),p=0;p<30;p++)xs[2*p+1]=5,xs[2*p]=Cs(p,5);Wl=new yl(Jr,$s,257,286,15),_l=new yl(xs,Pa,0,30,15),Bs=new yl(new Array(0),Sc,0,19,7)})(),vl=!0),l.l_desc=new Bn(l.dyn_ltree,Wl),l.d_desc=new Bn(l.dyn_dtree,_l),l.bl_desc=new Bn(l.bl_tree,Bs),l.bi_buf=0,l.bi_valid=0,Il(l)},_tr_stored_block:rc,_tr_flush_block:(l,p,h,w)=>{let B,E,R=0;l.level>0?(2===l.strm.data_type&&(l.strm.data_type=(D=>{let H,F=4093624447;for(H=0;H<=31;H++,F>>>=1)if(1&F&&0!==D.dyn_ltree[2*H])return 0;if(0!==D.dyn_ltree[18]||0!==D.dyn_ltree[20]||0!==D.dyn_ltree[26])return 1;for(H=32;H<256;H++)if(0!==D.dyn_ltree[2*H])return 1;return 0})(l)),tc(l,l.l_desc),tc(l,l.d_desc),R=(D=>{let H;for(Qs(D,D.dyn_ltree,D.l_desc.max_code),Qs(D,D.dyn_dtree,D.d_desc.max_code),tc(D,D.bl_desc),H=18;H>=3&&0===D.bl_tree[2*Mn[H]+1];H--);return D.opt_len+=3*(H+1)+5+5+4,H})(l),B=l.opt_len+3+7>>>3,E=l.static_len+3+7>>>3,E<=B&&(B=E)):B=E=h+5,h+4<=B&&-1!==p?rc(l,p,h,w):4===l.strategy||E===B?(sn(l,2+(w?1:0),3),wl(l,Jr,xs)):(sn(l,4+(w?1:0),3),((D,H,F,V)=>{let le;for(sn(D,H-257,5),sn(D,F-1,5),sn(D,V-4,4),le=0;le<V;le++)sn(D,D.bl_tree[2*Mn[le]+1],3);ic(D,D.dyn_ltree,H-1),ic(D,D.dyn_dtree,F-1)})(l,l.l_desc.max_code+1,l.d_desc.max_code+1,R+1),wl(l,l.dyn_ltree,l.dyn_dtree)),Il(l),w&&Ni(l)},_tr_tally:(l,p,h)=>(l.pending_buf[l.sym_buf+l.sym_next++]=p,l.pending_buf[l.sym_buf+l.sym_next++]=p>>8,l.pending_buf[l.sym_buf+l.sym_next++]=h,0===p?l.dyn_ltree[2*h]++:(l.matches++,p--,l.dyn_ltree[2*(aa[h]+256+1)]++,l.dyn_dtree[2*Ht(p)]++),l.sym_next===l.sym_end),_tr_align:l=>{var p;sn(l,2,3),sa(l,256,Jr),16===(p=l).bi_valid?(Ha(p,p.bi_buf),p.bi_buf=0,p.bi_valid=0):p.bi_valid>=8&&(p.pending_buf[p.pending++]=255&p.bi_buf,p.bi_buf>>=8,p.bi_valid-=8)}},Fo=(l,p,h,w)=>{let B=65535&l,E=l>>>16&65535,R=0;for(;0!==h;){R=h>2e3?2e3:h,h-=R;do{B=B+p[w++]|0,E=E+B|0}while(--R);B%=65521,E%=65521}return B|E<<16};const eh=new Uint32Array((()=>{let l,p=[];for(var h=0;h<256;h++){l=h;for(var w=0;w<8;w++)l=1&l?3988292384^l>>>1:l>>>1;p[h]=l}return p})());var nr=(l,p,h,w)=>{const B=eh,E=w+h;l^=-1;for(let R=w;R<E;R++)l=l>>>8^B[255&(l^p[R])];return~l},er={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ia={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:xl,_tr_stored_block:Xs,_tr_flush_block:Dc,_tr_tally:Vn,_tr_align:Lo}=nc,{Z_NO_FLUSH:Xr,Z_PARTIAL_FLUSH:zo,Z_FULL_FLUSH:$t,Z_FINISH:ti,Z_BLOCK:Uo,Z_OK:Lr,Z_STREAM_END:Bl,Z_STREAM_ERROR:A,Z_DATA_ERROR:e,Z_BUF_ERROR:n,Z_DEFAULT_COMPRESSION:s,Z_FILTERED:o,Z_HUFFMAN_ONLY:u,Z_RLE:y,Z_FIXED:I,Z_DEFAULT_STRATEGY:v,Z_UNKNOWN:S,Z_DEFLATED:T}=Ia,M=258,j=262,_e=(l,p)=>(l.msg=er[p],p),we=l=>2*l-(l>4?9:0),Ce=l=>{let p=l.length;for(;--p>=0;)l[p]=0},de=l=>{let p,h,w,B=l.w_size;p=l.hash_size,w=p;do{h=l.head[--w],l.head[w]=h>=B?h-B:0}while(--p);p=B,w=p;do{h=l.prev[--w],l.prev[w]=h>=B?h-B:0}while(--p)};let Me=(l,p,h)=>(p<<l.hash_shift^h)&l.hash_mask;const ze=l=>{const p=l.state;let h=p.pending;h>l.avail_out&&(h=l.avail_out),0!==h&&(l.output.set(p.pending_buf.subarray(p.pending_out,p.pending_out+h),l.next_out),l.next_out+=h,p.pending_out+=h,l.total_out+=h,l.avail_out-=h,p.pending-=h,0===p.pending&&(p.pending_out=0))},Ve=(l,p)=>{Dc(l,l.block_start>=0?l.block_start:-1,l.strstart-l.block_start,p),l.block_start=l.strstart,ze(l.strm)},tt=(l,p)=>{l.pending_buf[l.pending++]=p},xt=(l,p)=>{l.pending_buf[l.pending++]=p>>>8&255,l.pending_buf[l.pending++]=255&p},Pt=(l,p,h,w)=>{let B=l.avail_in;return B>w&&(B=w),0===B?0:(l.avail_in-=B,p.set(l.input.subarray(l.next_in,l.next_in+B),h),1===l.state.wrap?l.adler=Fo(l.adler,p,B,h):2===l.state.wrap&&(l.adler=nr(l.adler,p,B,h)),l.next_in+=B,l.total_in+=B,B)},Ot=(l,p)=>{let h,w,B=l.max_chain_length,E=l.strstart,R=l.prev_length,D=l.nice_match;const H=l.strstart>l.w_size-j?l.strstart-(l.w_size-j):0,F=l.window,V=l.w_mask,le=l.prev,ne=l.strstart+M;let N=F[E+R-1],ce=F[E+R];l.prev_length>=l.good_match&&(B>>=2),D>l.lookahead&&(D=l.lookahead);do{if(h=p,F[h+R]===ce&&F[h+R-1]===N&&F[h]===F[E]&&F[++h]===F[E+1]){E+=2,h++;do{}while(F[++E]===F[++h]&&F[++E]===F[++h]&&F[++E]===F[++h]&&F[++E]===F[++h]&&F[++E]===F[++h]&&F[++E]===F[++h]&&F[++E]===F[++h]&&F[++E]===F[++h]&&E<ne);if(w=M-(ne-E),E=ne-M,w>R){if(l.match_start=p,R=w,w>=D)break;N=F[E+R-1],ce=F[E+R]}}}while((p=le[p&V])>H&&0!=--B);return R<=l.lookahead?R:l.lookahead},St=l=>{const p=l.w_size;let h,w,B;do{if(w=l.window_size-l.lookahead-l.strstart,l.strstart>=p+(p-j)&&(l.window.set(l.window.subarray(p,p+p-w),0),l.match_start-=p,l.strstart-=p,l.block_start-=p,l.insert>l.strstart&&(l.insert=l.strstart),de(l),w+=p),0===l.strm.avail_in)break;if(h=Pt(l.strm,l.window,l.strstart+l.lookahead,w),l.lookahead+=h,l.lookahead+l.insert>=3)for(B=l.strstart-l.insert,l.ins_h=l.window[B],l.ins_h=Me(l,l.ins_h,l.window[B+1]);l.insert&&(l.ins_h=Me(l,l.ins_h,l.window[B+3-1]),l.prev[B&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=B,B++,l.insert--,!(l.lookahead+l.insert<3)););}while(l.lookahead<j&&0!==l.strm.avail_in)},Mt=(l,p)=>{let h,w,B,E=l.pending_buf_size-5>l.w_size?l.w_size:l.pending_buf_size-5,R=0,D=l.strm.avail_in;
vendor: 6,043 bytes, line 3
3do{if(h=65535,B=l.bi_valid+42>>3,l.strm.avail_out<B||(B=l.strm.avail_out-B,w=l.strstart-l.block_start,h>w+l.strm.avail_in&&(h=w+l.strm.avail_in),h>B&&(h=B),h<E&&(0===h&&p!==ti||p===Xr||h!==w+l.strm.avail_in)))break;R=p===ti&&h===w+l.strm.avail_in?1:0,Xs(l,0,0,R),l.pending_buf[l.pending-4]=h,l.pending_buf[l.pending-3]=h>>8,l.pending_buf[l.pending-2]=~h,l.pending_buf[l.pending-1]=~h>>8,ze(l.strm),w&&(w>h&&(w=h),l.strm.output.set(l.window.subarray(l.block_start,l.block_start+w),l.strm.next_out),l.strm.next_out+=w,l.strm.avail_out-=w,l.strm.total_out+=w,l.block_start+=w,h-=w),h&&(Pt(l.strm,l.strm.output,l.strm.next_out,h),l.strm.next_out+=h,l.strm.avail_out-=h,l.strm.total_out+=h)}while(0===R);return D-=l.strm.avail_in,D&&(D>=l.w_size?(l.matches=2,l.window.set(l.strm.input.subarray(l.strm.next_in-l.w_size,l.strm.next_in),0),l.strstart=l.w_size,l.insert=l.strstart):(l.window_size-l.strstart<=D&&(l.strstart-=l.w_size,l.window.set(l.window.subarray(l.w_size,l.w_size+l.strstart),0),l.matches<2&&l.matches++,l.insert>l.strstart&&(l.insert=l.strstart)),l.window.set(l.strm.input.subarray(l.strm.next_in-D,l.strm.next_in),l.strstart),l.strstart+=D,l.insert+=D>l.w_size-l.insert?l.w_size-l.insert:D),l.block_start=l.strstart),l.high_water<l.strstart&&(l.high_water=l.strstart),R?4:p!==Xr&&p!==ti&&0===l.strm.avail_in&&l.strstart===l.block_start?2:(B=l.window_size-l.strstart,l.strm.avail_in>B&&l.block_start>=l.w_size&&(l.block_start-=l.w_size,l.strstart-=l.w_size,l.window.set(l.window.subarray(l.w_size,l.w_size+l.strstart),0),l.matches<2&&l.matches++,B+=l.w_size,l.insert>l.strstart&&(l.insert=l.strstart)),B>l.strm.avail_in&&(B=l.strm.avail_in),B&&(Pt(l.strm,l.window,l.strstart,B),l.strstart+=B,l.insert+=B>l.w_size-l.insert?l.w_size-l.insert:B),l.high_water<l.strstart&&(l.high_water=l.strstart),B=l.bi_valid+42>>3,B=l.pending_buf_size-B>65535?65535:l.pending_buf_size-B,E=B>l.w_size?l.w_size:B,w=l.strstart-l.block_start,(w>=E||(w||p===ti)&&p!==Xr&&0===l.strm.avail_in&&w<=B)&&(h=w>B?B:w,R=p===ti&&0===l.strm.avail_in&&h===w?1:0,Xs(l,l.block_start,h,R),l.block_start+=h,ze(l.strm)),R?3:1)},jt=(l,p)=>{let h,w;for(;;){if(l.lookahead<j){if(St(l),l.lookahead<j&&p===Xr)return 1;if(0===l.lookahead)break}if(h=0,l.lookahead>=3&&(l.ins_h=Me(l,l.ins_h,l.window[l.strstart+3-1]),h=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),0!==h&&l.strstart-h<=l.w_size-j&&(l.match_length=Ot(l,h)),l.match_length>=3)if(w=Vn(l,l.strstart-l.match_start,l.match_length-3),l.lookahead-=l.match_length,l.match_length<=l.max_lazy_match&&l.lookahead>=3){l.match_length--;do{l.strstart++,l.ins_h=Me(l,l.ins_h,l.window[l.strstart+3-1]),h=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart}while(0!=--l.match_length);l.strstart++}else l.strstart+=l.match_length,l.match_length=0,l.ins_h=l.window[l.strstart],l.ins_h=Me(l,l.ins_h,l.window[l.strstart+1]);else w=Vn(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++;if(w&&(Ve(l,!1),0===l.strm.avail_out))return 1}return l.insert=l.strstart<2?l.strstart:2,p===ti?(Ve(l,!0),0===l.strm.avail_out?3:4):l.sym_next&&(Ve(l,!1),0===l.strm.avail_out)?1:2},pi=(l,p)=>{let h,w,B;for(;;){if(l.lookahead<j){if(St(l),l.lookahead<j&&p===Xr)return 1;if(0===l.lookahead)break}if(h=0,l.lookahead>=3&&(l.ins_h=Me(l,l.ins_h,l.window[l.strstart+3-1]),h=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),l.prev_length=l.match_length,l.prev_match=l.match_start,l.match_length=2,0!==h&&l.prev_length<l.max_lazy_match&&l.strstart-h<=l.w_size-j&&(l.match_length=Ot(l,h),l.match_length<=5&&(l.strategy===o||3===l.match_length&&l.strstart-l.match_start>4096)&&(l.match_length=2)),l.prev_length>=3&&l.match_length<=l.prev_length){B=l.strstart+l.lookahead-3,w=Vn(l,l.strstart-1-l.prev_match,l.prev_length-3),l.lookahead-=l.prev_length-1,l.prev_length-=2;do{++l.strstart<=B&&(l.ins_h=Me(l,l.ins_h,l.window[l.strstart+3-1]),h=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart)}while(0!=--l.prev_length);if(l.match_available=0,l.match_length=2,l.strstart++,w&&(Ve(l,!1),0===l.strm.avail_out))return 1}else if(l.match_available){if(w=Vn(l,0,l.window[l.strstart-1]),w&&Ve(l,!1),l.strstart++,l.lookahead--,0===l.strm.avail_out)return 1}else l.match_available=1,l.strstart++,l.lookahead--}return l.match_available&&(w=Vn(l,0,l.window[l.strstart-1]),l.match_available=0),l.insert=l.strstart<2?l.strstart:2,p===ti?(Ve(l,!0),0===l.strm.avail_out?3:4):l.sym_next&&(Ve(l,!1),0===l.strm.avail_out)?1:2};function Et(l,p,h,w,B){this.good_length=l,this.max_lazy=p,this.nice_length=h,this.max_chain=w,this.func=B}const Ft=[new Et(0,0,0,0,Mt),new Et(4,4,8,4,jt),new Et(4,5,16,8,jt),new Et(4,6,32,32,jt),new Et(4,4,16,16,pi),new Et(8,16,32,32,pi),new Et(8,16,128,128,pi),new Et(8,32,128,256,pi),new Et(32,128,258,1024,pi),new Et(32,258,258,4096,pi)];function _i(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=T,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Ce(this.dyn_ltree),Ce(this.dyn_dtree),Ce(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Ce(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Ce(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const ar=l=>{if(!l)return 1;const p=l.state;
vendor: 4,770 bytes, line 3
3return!p||p.strm!==l||42!==p.status&&57!==p.status&&69!==p.status&&73!==p.status&&91!==p.status&&103!==p.status&&113!==p.status&&666!==p.status?1:0},Mi=l=>{if(ar(l))return _e(l,A);l.total_in=l.total_out=0,l.data_type=S;const p=l.state;return p.pending=0,p.pending_out=0,p.wrap<0&&(p.wrap=-p.wrap),p.status=2===p.wrap?57:p.wrap?42:113,l.adler=2===p.wrap?0:1,p.last_flush=-2,xl(p),Lr},Gi=l=>{const p=Mi(l);var h;return p===Lr&&((h=l.state).window_size=2*h.w_size,Ce(h.head),h.max_lazy_match=Ft[h.level].max_lazy,h.good_match=Ft[h.level].good_length,h.nice_match=Ft[h.level].nice_length,h.max_chain_length=Ft[h.level].max_chain,h.strstart=0,h.block_start=0,h.lookahead=0,h.insert=0,h.match_length=h.prev_length=2,h.match_available=0,h.ins_h=0),p},dr=(l,p,h,w,B,E)=>{if(!l)return A;let R=1;if(p===s&&(p=6),w<0?(R=0,w=-w):w>15&&(R=2,w-=16),B<1||B>9||h!==T||w<8||w>15||p<0||p>9||E<0||E>I||8===w&&1!==R)return _e(l,A);8===w&&(w=9);const D=new _i;return l.state=D,D.strm=l,D.status=42,D.wrap=R,D.gzhead=null,D.w_bits=w,D.w_size=1<<D.w_bits,D.w_mask=D.w_size-1,D.hash_bits=B+7,D.hash_size=1<<D.hash_bits,D.hash_mask=D.hash_size-1,D.hash_shift=~~((D.hash_bits+3-1)/3),D.window=new Uint8Array(2*D.w_size),D.head=new Uint16Array(D.hash_size),D.prev=new Uint16Array(D.w_size),D.lit_bufsize=1<<B+6,D.pending_buf_size=4*D.lit_bufsize,D.pending_buf=new Uint8Array(D.pending_buf_size),D.sym_buf=D.lit_bufsize,D.sym_end=3*(D.lit_bufsize-1),D.level=p,D.strategy=E,D.method=h,Gi(l)};var mn_deflateInit2=dr,mn_deflateSetHeader=(l,p)=>ar(l)||2!==l.state.wrap?A:(l.state.gzhead=p,Lr),mn_deflate=(l,p)=>{if(ar(l)||p>Uo||p<0)return l?_e(l,A):A;const h=l.state;if(!l.output||0!==l.avail_in&&!l.input||666===h.status&&p!==ti)return _e(l,0===l.avail_out?n:A);const w=h.last_flush;if(h.last_flush=p,0!==h.pending){if(ze(l),0===l.avail_out)return h.last_flush=-1,Lr}else if(0===l.avail_in&&we(p)<=we(w)&&p!==ti)return _e(l,n);if(666===h.status&&0!==l.avail_in)return _e(l,n);if(42===h.status&&0===h.wrap&&(h.status=113),42===h.status){let B=T+(h.w_bits-8<<4)<<8,E=-1;if(E=h.strategy>=u||h.level<2?0:h.level<6?1:6===h.level?2:3,B|=E<<6,0!==h.strstart&&(B|=32),B+=31-B%31,xt(h,B),0!==h.strstart&&(xt(h,l.adler>>>16),xt(h,65535&l.adler)),l.adler=1,h.status=113,ze(l),0!==h.pending)return h.last_flush=-1,Lr}if(57===h.status)if(l.adler=0,tt(h,31),tt(h,139),tt(h,8),h.gzhead)tt(h,(h.gzhead.text?1:0)+(h.gzhead.hcrc?2:0)+(h.gzhead.extra?4:0)+(h.gzhead.name?8:0)+(h.gzhead.comment?16:0)),tt(h,255&h.gzhead.time),tt(h,h.gzhead.time>>8&255),tt(h,h.gzhead.time>>16&255),tt(h,h.gzhead.time>>24&255),tt(h,9===h.level?2:h.strategy>=u||h.level<2?4:0),tt(h,255&h.gzhead.os),h.gzhead.extra&&h.gzhead.extra.length&&(tt(h,255&h.gzhead.extra.length),tt(h,h.gzhead.extra.length>>8&255)),h.gzhead.hcrc&&(l.adler=nr(l.adler,h.pending_buf,h.pending,0)),h.gzindex=0,h.status=69;else if(tt(h,0),tt(h,0),tt(h,0),tt(h,0),tt(h,0),tt(h,9===h.level?2:h.strategy>=u||h.level<2?4:0),tt(h,3),h.status=113,ze(l),0!==h.pending)return h.last_flush=-1,Lr;if(69===h.status){if(h.gzhead.extra){let B=h.pending,E=(65535&h.gzhead.extra.length)-h.gzindex;for(;h.pending+E>h.pending_buf_size;){let D=h.pending_buf_size-h.pending;if(h.pending_buf.set(h.gzhead.extra.subarray(h.gzindex,h.gzindex+D),h.pending),h.pending=h.pending_buf_size,h.gzhead.hcrc&&h.pending>B&&(l.adler=nr(l.adler,h.pending_buf,h.pending-B,B)),h.gzindex+=D,ze(l),0!==h.pending)return h.last_flush=-1,Lr;B=0,E-=D}let R=new Uint8Array(h.gzhead.extra);h.pending_buf.set(R.subarray(h.gzindex,h.gzindex+E),h.pending),h.pending+=E,h.gzhead.hcrc&&h.pending>B&&(l.adler=nr(l.adler,h.pending_buf,h.pending-B,B)),h.gzindex=0}h.status=73}if(73===h.status){if(h.gzhead.name){let B,E=h.pending;do{if(h.pending===h.pending_buf_size){if(h.gzhead.hcrc&&h.pending>E&&(l.adler=nr(l.adler,h.pending_buf,h.pending-E,E)),ze(l),0!==h.pending)return h.last_flush=-1,Lr;E=0}B=h.gzindex<h.gzhead.name.length?255&h.gzhead.name.charCodeAt(h.gzindex++):0,tt(h,B)}while(0!==B);h.gzhead.hcrc&&h.pending>E&&(l.adler=nr(l.adler,h.pending_buf,h.pending-E,E)),h.gzindex=0}h.status=91}if(91===h.status){if(h.gzhead.comment){let B,E=h.pending;do{if(h.pending===h.pending_buf_size){if(h.gzhead.hcrc&&h.pending>E&&(l.adler=nr(l.adler,h.pending_buf,h.pending-E,E)),ze(l),0!==h.pending)return h.last_flush=-1,Lr;E=0}B=h.gzindex<h.gzhead.comment.length?255&h.gzhead.comment.charCodeAt(h.gzindex++):0,tt(h,B)}while(0!==B);h.gzhead.hcrc&&h.pending>E&&(l.adler=nr(l.adler,h.pending_buf,h.pending-E,E))}h.status=103}if(103===h.status){if(h.gzhead.hcrc){if(h.pending+2>h.pending_buf_size&&(ze(l),0!==h.pending))return h.last_flush=-1,Lr;tt(h,255&l.adler),tt(h,l.adler>>8&255),l.adler=0}if(h.status=113,ze(l),0!==h.pending)return h.last_flush=-1,Lr}if(0!==l.avail_in||0!==h.lookahead||p!==Xr&&666!==h.status){let B=0===
vendor: 4,495 bytes, line 3
3h.level?Mt(h,p):h.strategy===u?((E,R)=>{let D;for(;;){if(0===E.lookahead&&(St(E),0===E.lookahead)){if(R===Xr)return 1;break}if(E.match_length=0,D=Vn(E,0,E.window[E.strstart]),E.lookahead--,E.strstart++,D&&(Ve(E,!1),0===E.strm.avail_out))return 1}return E.insert=0,R===ti?(Ve(E,!0),0===E.strm.avail_out?3:4):E.sym_next&&(Ve(E,!1),0===E.strm.avail_out)?1:2})(h,p):h.strategy===y?((E,R)=>{let D,H,F,V;const le=E.window;for(;;){if(E.lookahead<=M){if(St(E),E.lookahead<=M&&R===Xr)return 1;if(0===E.lookahead)break}if(E.match_length=0,E.lookahead>=3&&E.strstart>0&&(F=E.strstart-1,H=le[F],H===le[++F]&&H===le[++F]&&H===le[++F])){V=E.strstart+M;do{}while(H===le[++F]&&H===le[++F]&&H===le[++F]&&H===le[++F]&&H===le[++F]&&H===le[++F]&&H===le[++F]&&H===le[++F]&&F<V);E.match_length=M-(V-F),E.match_length>E.lookahead&&(E.match_length=E.lookahead)}if(E.match_length>=3?(D=Vn(E,1,E.match_length-3),E.lookahead-=E.match_length,E.strstart+=E.match_length,E.match_length=0):(D=Vn(E,0,E.window[E.strstart]),E.lookahead--,E.strstart++),D&&(Ve(E,!1),0===E.strm.avail_out))return 1}return E.insert=0,R===ti?(Ve(E,!0),0===E.strm.avail_out?3:4):E.sym_next&&(Ve(E,!1),0===E.strm.avail_out)?1:2})(h,p):Ft[h.level].func(h,p);if(3!==B&&4!==B||(h.status=666),1===B||3===B)return 0===l.avail_out&&(h.last_flush=-1),Lr;if(2===B&&(p===zo?Lo(h):p!==Uo&&(Xs(h,0,0,!1),p===$t&&(Ce(h.head),0===h.lookahead&&(h.strstart=0,h.block_start=0,h.insert=0))),ze(l),0===l.avail_out))return h.last_flush=-1,Lr}return p!==ti?Lr:h.wrap<=0?Bl:(2===h.wrap?(tt(h,255&l.adler),tt(h,l.adler>>8&255),tt(h,l.adler>>16&255),tt(h,l.adler>>24&255),tt(h,255&l.total_in),tt(h,l.total_in>>8&255),tt(h,l.total_in>>16&255),tt(h,l.total_in>>24&255)):(xt(h,l.adler>>>16),xt(h,65535&l.adler)),ze(l),h.wrap>0&&(h.wrap=-h.wrap),0!==h.pending?Lr:Bl)},mn_deflateEnd=l=>{if(ar(l))return A;const p=l.state.status;return l.state=null,113===p?_e(l,e):Lr},mn_deflateSetDictionary=(l,p)=>{let h=p.length;if(ar(l))return A;const w=l.state,B=w.wrap;if(2===B||1===B&&42!==w.status||w.lookahead)return A;if(1===B&&(l.adler=Fo(l.adler,p,h,0)),w.wrap=0,h>=w.w_size){0===B&&(Ce(w.head),w.strstart=0,w.block_start=0,w.insert=0);let H=new Uint8Array(w.w_size);H.set(p.subarray(h-w.w_size,h),0),p=H,h=w.w_size}const E=l.avail_in,R=l.next_in,D=l.input;for(l.avail_in=h,l.next_in=0,l.input=p,St(w);w.lookahead>=3;){let H=w.strstart,F=w.lookahead-2;do{w.ins_h=Me(w,w.ins_h,w.window[H+3-1]),w.prev[H&w.w_mask]=w.head[w.ins_h],w.head[w.ins_h]=H,H++}while(--F);w.strstart=H,w.lookahead=2,St(w)}return w.strstart+=w.lookahead,w.block_start=w.strstart,w.insert=w.lookahead,w.lookahead=0,w.match_length=w.prev_length=2,w.match_available=0,l.next_in=R,l.input=D,l.avail_in=E,w.wrap=B,Lr};const yr=(l,p)=>Object.prototype.hasOwnProperty.call(l,p);var Wr={assign:function(l){const p=Array.prototype.slice.call(arguments,1);for(;p.length;){const h=p.shift();if(h){if("object"!=typeof h)throw new TypeError(h+"must be non-object");for(const w in h)yr(h,w)&&(l[w]=h[w])}}return l},flattenChunks:l=>{let p=0;for(let w=0,B=l.length;w<B;w++)p+=l[w].length;const h=new Uint8Array(p);for(let w=0,B=0,E=l.length;w<E;w++){let R=l[w];h.set(R,B),B+=R.length}return h}};let ln=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ln=!1}const zr=new Uint8Array(256);for(let l=0;l<256;l++)zr[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;zr[254]=zr[254]=1;var Nr={string2buf:l=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(l);let p,h,w,B,E,R=l.length,D=0;for(B=0;B<R;B++)h=l.charCodeAt(B),55296==(64512&h)&&B+1<R&&(w=l.charCodeAt(B+1),56320==(64512&w)&&(h=65536+(h-55296<<10)+(w-56320),B++)),D+=h<128?1:h<2048?2:h<65536?3:4;for(p=new Uint8Array(D),E=0,B=0;E<D;B++)h=l.charCodeAt(B),55296==(64512&h)&&B+1<R&&(w=l.charCodeAt(B+1),56320==(64512&w)&&(h=65536+(h-55296<<10)+(w-56320),B++)),h<128?p[E++]=h:h<2048?(p[E++]=192|h>>>6,p[E++]=128|63&h):h<65536?(p[E++]=224|h>>>12,p[E++]=128|h>>>6&63,p[E++]=128|63&h):(p[E++]=240|h>>>18,p[E++]=128|h>>>12&63,p[E++]=128|h>>>6&63,p[E++]=128|63&h);return p},buf2string:(l,p)=>{const h=p||l.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(l.subarray(0,p));let w,B;const E=new Array(2*h);for(B=0,w=0;w<h;){let R=l[w++];if(R<128){E[B++]=R;continue}let D=zr[R];if(D>4)E[B++]=65533,w+=D-1;else{for(R&=2===D?31:3===D?15:7;D>1&&w<h;)R=R<<6|63&l[w++],D--;D>1?E[B++]=65533:R<65536?E[B++]=R:(R-=65536,E[B++]=55296|R>>10&1023,E[B++]=56320|1023&R)}}return((R,D)=>
vendor: 5,647 bytes, line 3
3{if(D<65534&&R.subarray&&ln)return String.fromCharCode.apply(null,R.length===D?R:R.subarray(0,D));let H="";for(let F=0;F<D;F++)H+=String.fromCharCode(R[F]);return H})(E,B)},utf8border:(l,p)=>{(p=p||l.length)>l.length&&(p=l.length);let h=p-1;for(;h>=0&&128==(192&l[h]);)h--;return h<0||0===h?p:h+zr[l[h]]>p?h:p}},oa=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ss=Object.prototype.toString,{Z_NO_FLUSH:Cl,Z_SYNC_FLUSH:Ws,Z_FULL_FLUSH:Hn,Z_FINISH:El,Z_OK:eo,Z_STREAM_END:Jn,Z_DEFAULT_COMPRESSION:jn,Z_DEFAULT_STRATEGY:Ja,Z_DEFLATED:la}=Ia;function qr(l){this.options=Wr.assign({level:jn,method:la,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ja},l||{});let p=this.options;p.raw&&p.windowBits>0?p.windowBits=-p.windowBits:p.gzip&&p.windowBits>0&&p.windowBits<16&&(p.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new oa,this.strm.avail_out=0;let h=mn_deflateInit2(this.strm,p.level,p.method,p.windowBits,p.memLevel,p.strategy);if(h!==eo)throw new Error(er[h]);if(p.header&&mn_deflateSetHeader(this.strm,p.header),p.dictionary){let w;if(w="string"==typeof p.dictionary?Nr.string2buf(p.dictionary):"[object ArrayBuffer]"===Ss.call(p.dictionary)?new Uint8Array(p.dictionary):p.dictionary,h=mn_deflateSetDictionary(this.strm,w),h!==eo)throw new Error(er[h]);this._dict_set=!0}}qr.prototype.push=function(l,p){const h=this.strm,w=this.options.chunkSize;let B,E;if(this.ended)return!1;for(E=p===~~p?p:!0===p?El:Cl,h.input="string"==typeof l?Nr.string2buf(l):"[object ArrayBuffer]"===Ss.call(l)?new Uint8Array(l):l,h.next_in=0,h.avail_in=h.input.length;;)if(0===h.avail_out&&(h.output=new Uint8Array(w),h.next_out=0,h.avail_out=w),(E===Ws||E===Hn)&&h.avail_out<=6)this.onData(h.output.subarray(0,h.next_out)),h.avail_out=0;else{if(B=mn_deflate(h,E),B===Jn)return h.next_out>0&&this.onData(h.output.subarray(0,h.next_out)),B=mn_deflateEnd(this.strm),this.onEnd(B),this.ended=!0,B===eo;if(0!==h.avail_out){if(E>0&&h.next_out>0)this.onData(h.output.subarray(0,h.next_out)),h.avail_out=0;else if(0===h.avail_in)break}else this.onData(h.output)}return!0},qr.prototype.onData=function(l){this.chunks.push(l)},qr.prototype.onEnd=function(l){l===eo&&(this.result=Wr.flattenChunks(this.chunks)),this.chunks=[],this.err=l,this.msg=this.strm.msg};const Vr=16209;var Tn=function(l,p){let h,w,B,E,R,D,H,F,V,le,ne,N,ce,he,oe,Ue,ye,ue,Te,De,J,ie,te,Qe;const ge=l.state;h=l.next_in,te=l.input,w=h+(l.avail_in-5),B=l.next_out,Qe=l.output,E=B-(p-l.avail_out),R=B+(l.avail_out-257),D=ge.dmax,H=ge.wsize,F=ge.whave,V=ge.wnext,le=ge.window,ne=ge.hold,N=ge.bits,ce=ge.lencode,he=ge.distcode,oe=(1<<ge.lenbits)-1,Ue=(1<<ge.distbits)-1;e:do{N<15&&(ne+=te[h++]<<N,N+=8,ne+=te[h++]<<N,N+=8),ye=ce[ne&oe];t:for(;;){if(ue=ye>>>24,ne>>>=ue,N-=ue,ue=ye>>>16&255,0===ue)Qe[B++]=65535&ye;else{if(!(16&ue)){if(64&ue){if(32&ue){ge.mode=16191;break e}l.msg="invalid literal/length code",ge.mode=Vr;break e}ye=ce[(65535&ye)+(ne&(1<<ue)-1)];continue t}for(Te=65535&ye,ue&=15,ue&&(N<ue&&(ne+=te[h++]<<N,N+=8),Te+=ne&(1<<ue)-1,ne>>>=ue,N-=ue),N<15&&(ne+=te[h++]<<N,N+=8,ne+=te[h++]<<N,N+=8),ye=he[ne&Ue];;){if(ue=ye>>>24,ne>>>=ue,N-=ue,ue=ye>>>16&255,16&ue){if(De=65535&ye,ue&=15,N<ue&&(ne+=te[h++]<<N,N+=8,N<ue&&(ne+=te[h++]<<N,N+=8)),De+=ne&(1<<ue)-1,De>D){l.msg="invalid distance too far back",ge.mode=Vr;break e}if(ne>>>=ue,N-=ue,ue=B-E,De>ue){if(ue=De-ue,ue>F&&ge.sane){l.msg="invalid distance too far back",ge.mode=Vr;break e}if(J=0,ie=le,0===V){if(J+=H-ue,ue<Te){Te-=ue;do{Qe[B++]=le[J++]}while(--ue);J=B-De,ie=Qe}}else if(V<ue){if(J+=H+V-ue,ue-=V,ue<Te){Te-=ue;do{Qe[B++]=le[J++]}while(--ue);if(J=0,V<Te){ue=V,Te-=ue;do{Qe[B++]=le[J++]}while(--ue);J=B-De,ie=Qe}}}else if(J+=V-ue,ue<Te){Te-=ue;do{Qe[B++]=le[J++]}while(--ue);J=B-De,ie=Qe}for(;Te>2;)Qe[B++]=ie[J++],Qe[B++]=ie[J++],Qe[B++]=ie[J++],Te-=3;Te&&(Qe[B++]=ie[J++],Te>1&&(Qe[B++]=ie[J++]))}else{J=B-De;do{Qe[B++]=Qe[J++],Qe[B++]=Qe[J++],Qe[B++]=Qe[J++],Te-=3}while(Te>2);Te&&(Qe[B++]=Qe[J++],Te>1&&(Qe[B++]=Qe[J++]))}break}if(64&ue){l.msg="invalid distance code",ge.mode=Vr;break e}ye=he[(65535&ye)+(ne&(1<<ue)-1)]}}break}}while(h<w&&B<R);Te=N>>3,h-=Te,N-=Te<<3,ne&=(1<<N)-1,l.next_in=h,l.next_out=B,l.avail_in=h<w?w-h+5:5-(h-w),l.avail_out=B<R?R-B+257:257-(B-R),ge.hold=ne,ge.bits=N};const Ds=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),to=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),io=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),kc=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Go=(l,p,h,w,B,E,R,D)=>{const H=D.bits;let F,V,le,ne,N,ce,he=0,oe=0,Ue=0,ye=0,ue=0,Te=0,De=0,J=0,ie=0,te=0,Qe=null;const ge=new Uint16Array(16),Re=new Uint16Array(16);let Le,Ge,He,Xe=null;for(he=0;he<=15;he++)ge[he]=0;for(oe=0;oe<w;oe++)ge[p[h+oe]]++;for(ue=H,ye=15;ye>=1&&0===ge[ye];ye--);if(ue>ye&&(ue=ye),0===ye)return B[E++]=20971520,B[E++]=20971520,D.bits=1,0;for(Ue=1;Ue<ye&&0===ge[Ue];Ue++);for(ue<Ue&&(ue=Ue),J=1,he=1;he<=15;he++)if(J<<=1,J-=ge[he],J<0)return-1;if(J>0&&(0===l||1!==ye))return-1;for(Re[1]=0,he=1;he<15;he++)Re[he+1]=Re[he]+ge[he];for(oe=0;oe<w;oe++)0!==p[h+oe]&&(R[Re[p[h+oe]]++]=oe);if(0===l?(Qe=Xe=R,ce=20):1===l?(Qe=Ds,Xe=to,ce=257):(Qe=io,Xe=kc,ce=0),te=0,oe=0,he=Ue,N=E,Te=ue,De=0,le=-1,ie=1<<ue,ne=ie-1,1===l&&ie>852||2===l&&ie>
vendor: 2,450 bytes, line 3
3592)return 1;for(;;){Le=he-De,R[oe]+1<ce?(Ge=0,He=R[oe]):R[oe]>=ce?(Ge=Xe[R[oe]-ce],He=Qe[R[oe]-ce]):(Ge=96,He=0),F=1<<he-De,V=1<<Te,Ue=V;do{V-=F,B[N+(te>>De)+V]=Le<<24|Ge<<16|He}while(0!==V);for(F=1<<he-1;te&F;)F>>=1;if(0!==F?(te&=F-1,te+=F):te=0,oe++,0==--ge[he]){if(he===ye)break;he=p[h+R[oe]]}if(he>ue&&(te&ne)!==le){for(0===De&&(De=ue),N+=Ue,Te=he-De,J=1<<Te;Te+De<ye&&(J-=ge[Te+De],!(J<=0));)Te++,J<<=1;if(ie+=1<<Te,1===l&&ie>852||2===l&&ie>592)return 1;le=te&ne,B[le]=ue<<24|Te<<16|N-E}}return 0!==te&&(B[N+te]=he-De<<24|64<<16),D.bits=ue,0};const{Z_FINISH:ac,Z_BLOCK:ja,Z_TREES:Oo,Z_OK:ba,Z_STREAM_END:No,Z_NEED_DICT:Ql,Z_STREAM_ERROR:yn,Z_DATA_ERROR:ks,Z_MEM_ERROR:ro,Z_BUF_ERROR:Mc,Z_DEFLATED:th}=Ia,sc=16180,Tc=16190,Ra=16191,wa=16199,Yn=16200,Br=16209,ao=l=>(l>>>24&255)+(l>>>8&65280)+((65280&l)<<8)+((255&l)<<24);function Nh(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const so=l=>{if(!l)return 1;const p=l.state;return!p||p.strm!==l||p.mode<sc||p.mode>16211?1:0},kr=l=>{if(so(l))return yn;const p=l.state;return l.total_in=l.total_out=p.total=0,l.msg="",p.wrap&&(l.adler=1&p.wrap),p.mode=sc,p.last=0,p.havedict=0,p.flags=-1,p.dmax=32768,p.head=null,p.hold=0,p.bits=0,p.lencode=p.lendyn=new Int32Array(852),p.distcode=p.distdyn=new Int32Array(592),p.sane=1,p.back=-1,ba},Pc=l=>{if(so(l))return yn;const p=l.state;return p.wsize=0,p.whave=0,p.wnext=0,kr(l)},ih=(l,p)=>{let h;if(so(l))return yn;const w=l.state;return p<0?(h=0,p=-p):(h=5+(p>>4),p<48&&(p&=15)),p&&(p<8||p>15)?yn:(null!==w.window&&w.wbits!==p&&(w.window=null),w.wrap=h,w.wbits=p,Pc(l))},oo=(l,p)=>{if(!l)return yn;const h=new Nh;l.state=h,h.strm=l,h.window=null,h.mode=sc;const w=ih(l,p);return w!==ba&&(l.state=null),w};let Ms,Sl,Rc=!0;const _h=l=>{if(Rc){Ms=new Int32Array(512),Sl=new Int32Array(32);let p=0;for(;p<144;)l.lens[p++]=8;for(;p<256;)l.lens[p++]=9;for(;p<280;)l.lens[p++]=7;for(;p<288;)l.lens[p++]=8;for(Go(1,l.lens,0,288,Ms,0,l.work,{bits:9}),p=0;p<32;)l.lens[p++]=5;
vendor: 4,219 bytes, line 3
3Go(2,l.lens,0,32,Sl,0,l.work,{bits:5}),Rc=!1}l.lencode=Ms,l.lenbits=9,l.distcode=Sl,l.distbits=5},Ih=(l,p,h,w)=>{let B;const E=l.state;return null===E.window&&(E.wsize=1<<E.wbits,E.wnext=0,E.whave=0,E.window=new Uint8Array(E.wsize)),w>=E.wsize?(E.window.set(p.subarray(h-E.wsize,h),0),E.wnext=0,E.whave=E.wsize):(B=E.wsize-E.wnext,B>w&&(B=w),E.window.set(p.subarray(h-w,h-w+B),E.wnext),(w-=B)?(E.window.set(p.subarray(h-w,h),0),E.wnext=w,E.whave=E.wsize):(E.wnext+=B,E.wnext===E.wsize&&(E.wnext=0),E.whave<E.wsize&&(E.whave+=B))),0};var Ts={inflateReset:Pc,inflateReset2:ih,inflateResetKeep:kr,inflateInit:l=>oo(l,15),inflateInit2:oo,inflate:(l,p)=>{let h,w,B,E,R,D,H,F,V,le,ne,N,ce,he,oe,Ue,ye,ue,Te,De,J,ie,te=0;const Qe=new Uint8Array(4);let ge,Re;const Le=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(so(l)||!l.output||!l.input&&0!==l.avail_in)return yn;h=l.state,h.mode===Ra&&(h.mode=16192),R=l.next_out,B=l.output,H=l.avail_out,E=l.next_in,w=l.input,D=l.avail_in,F=h.hold,V=h.bits,le=D,ne=H,ie=ba;e:for(;;)switch(h.mode){case sc:if(0===h.wrap){h.mode=16192;break}for(;V<16;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}if(2&h.wrap&&35615===F){0===h.wbits&&(h.wbits=15),h.check=0,Qe[0]=255&F,Qe[1]=F>>>8&255,h.check=nr(h.check,Qe,2,0),F=0,V=0,h.mode=16181;break}if(h.head&&(h.head.done=!1),!(1&h.wrap)||(((255&F)<<8)+(F>>8))%31){l.msg="incorrect header check",h.mode=Br;break}if((15&F)!==th){l.msg="unknown compression method",h.mode=Br;break}if(F>>>=4,V-=4,J=8+(15&F),0===h.wbits&&(h.wbits=J),J>15||J>h.wbits){l.msg="invalid window size",h.mode=Br;break}h.dmax=1<<h.wbits,h.flags=0,l.adler=h.check=1,h.mode=512&F?16189:Ra,F=0,V=0;break;case 16181:for(;V<16;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}if(h.flags=F,(255&h.flags)!==th){l.msg="unknown compression method",h.mode=Br;break}if(57344&h.flags){l.msg="unknown header flags set",h.mode=Br;break}h.head&&(h.head.text=F>>8&1),512&h.flags&&4&h.wrap&&(Qe[0]=255&F,Qe[1]=F>>>8&255,h.check=nr(h.check,Qe,2,0)),F=0,V=0,h.mode=16182;case 16182:for(;V<32;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}h.head&&(h.head.time=F),512&h.flags&&4&h.wrap&&(Qe[0]=255&F,Qe[1]=F>>>8&255,Qe[2]=F>>>16&255,Qe[3]=F>>>24&255,h.check=nr(h.check,Qe,4,0)),F=0,V=0,h.mode=16183;case 16183:for(;V<16;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}h.head&&(h.head.xflags=255&F,h.head.os=F>>8),512&h.flags&&4&h.wrap&&(Qe[0]=255&F,Qe[1]=F>>>8&255,h.check=nr(h.check,Qe,2,0)),F=0,V=0,h.mode=16184;case 16184:if(1024&h.flags){for(;V<16;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}h.length=F,h.head&&(h.head.extra_len=F),512&h.flags&&4&h.wrap&&(Qe[0]=255&F,Qe[1]=F>>>8&255,h.check=nr(h.check,Qe,2,0)),F=0,V=0}else h.head&&(h.head.extra=null);h.mode=16185;case 16185:if(1024&h.flags&&(N=h.length,N>D&&(N=D),N&&(h.head&&(J=h.head.extra_len-h.length,h.head.extra||(h.head.extra=new Uint8Array(h.head.extra_len)),h.head.extra.set(w.subarray(E,E+N),J)),512&h.flags&&4&h.wrap&&(h.check=nr(h.check,w,N,E)),D-=N,E+=N,h.length-=N),h.length))break e;h.length=0,h.mode=16186;case 16186:if(2048&h.flags){if(0===D)break e;N=0;do{J=w[E+N++],h.head&&J&&h.length<65536&&(h.head.name+=String.fromCharCode(J))}while(J&&N<D);if(512&h.flags&&4&h.wrap&&(h.check=nr(h.check,w,N,E)),D-=N,E+=N,J)break e}else h.head&&(h.head.name=null);h.length=0,h.mode=16187;case 16187:if(4096&h.flags){if(0===D)break e;N=0;do{J=w[E+N++],h.head&&J&&h.length<65536&&(h.head.comment+=String.fromCharCode(J))}while(J&&N<D);if(512&h.flags&&4&h.wrap&&(h.check=nr(h.check,w,N,E)),D-=N,E+=N,J)break e}else h.head&&(h.head.comment=null);h.mode=16188;case 16188:if(512&h.flags){for(;V<16;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}if(4&h.wrap&&F!==(65535&h.check)){l.msg="header crc mismatch",h.mode=Br;break}F=0,V=0}h.head&&(h.head.hcrc=h.flags>>9&1,h.head.done=!0),l.adler=h.check=0,h.mode=Ra;break;case 16189:for(;V<32;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}l.adler=h.check=ao(F),F=0,V=0,h.mode=Tc;case Tc:if(0===h.havedict)return l.next_out=R,l.avail_out=H,l.next_in=E,l.avail_in=D,h.hold=F,h.bits=V,Ql;l.adler=h.check=1,h.mode=Ra;case Ra:if(p===ja||p===Oo)break e;case 16192:if(h.last){F>>>=7&V,V-=7&V,h.mode=16206;break}for(;V<3;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}switch(h.last=1&F,F>>>=1,V-=1,3&F){case 0:h.mode=16193;break;
vendor: 4,120 bytes, line 3
3case 1:if(_h(h),h.mode=wa,p===Oo){F>>>=2,V-=2;break e}break;case 2:h.mode=16196;break;case 3:l.msg="invalid block type",h.mode=Br}F>>>=2,V-=2;break;case 16193:for(F>>>=7&V,V-=7&V;V<32;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}if((65535&F)!=(F>>>16^65535)){l.msg="invalid stored block lengths",h.mode=Br;break}if(h.length=65535&F,F=0,V=0,h.mode=16194,p===Oo)break e;case 16194:h.mode=16195;case 16195:if(N=h.length,N){if(N>D&&(N=D),N>H&&(N=H),0===N)break e;B.set(w.subarray(E,E+N),R),D-=N,E+=N,H-=N,R+=N,h.length-=N;break}h.mode=Ra;break;case 16196:for(;V<14;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}if(h.nlen=257+(31&F),F>>>=5,V-=5,h.ndist=1+(31&F),F>>>=5,V-=5,h.ncode=4+(15&F),F>>>=4,V-=4,h.nlen>286||h.ndist>30){l.msg="too many length or distance symbols",h.mode=Br;break}h.have=0,h.mode=16197;case 16197:for(;h.have<h.ncode;){for(;V<3;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}h.lens[Le[h.have++]]=7&F,F>>>=3,V-=3}for(;h.have<19;)h.lens[Le[h.have++]]=0;if(h.lencode=h.lendyn,h.lenbits=7,ge={bits:h.lenbits},ie=Go(0,h.lens,0,19,h.lencode,0,h.work,ge),h.lenbits=ge.bits,ie){l.msg="invalid code lengths set",h.mode=Br;break}h.have=0,h.mode=16198;case 16198:for(;h.have<h.nlen+h.ndist;){for(;te=h.lencode[F&(1<<h.lenbits)-1],oe=te>>>24,Ue=te>>>16&255,ye=65535&te,!(oe<=V);){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}if(ye<16)F>>>=oe,V-=oe,h.lens[h.have++]=ye;else{if(16===ye){for(Re=oe+2;V<Re;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}if(F>>>=oe,V-=oe,0===h.have){l.msg="invalid bit length repeat",h.mode=Br;break}J=h.lens[h.have-1],N=3+(3&F),F>>>=2,V-=2}else if(17===ye){for(Re=oe+3;V<Re;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}F>>>=oe,V-=oe,J=0,N=3+(7&F),F>>>=3,V-=3}else{for(Re=oe+7;V<Re;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}F>>>=oe,V-=oe,J=0,N=11+(127&F),F>>>=7,V-=7}if(h.have+N>h.nlen+h.ndist){l.msg="invalid bit length repeat",h.mode=Br;break}for(;N--;)h.lens[h.have++]=J}}if(h.mode===Br)break;if(0===h.lens[256]){l.msg="invalid code -- missing end-of-block",h.mode=Br;break}if(h.lenbits=9,ge={bits:h.lenbits},ie=Go(1,h.lens,0,h.nlen,h.lencode,0,h.work,ge),h.lenbits=ge.bits,ie){l.msg="invalid literal/lengths set",h.mode=Br;break}if(h.distbits=6,h.distcode=h.distdyn,ge={bits:h.distbits},ie=Go(2,h.lens,h.nlen,h.ndist,h.distcode,0,h.work,ge),h.distbits=ge.bits,ie){l.msg="invalid distances set",h.mode=Br;break}if(h.mode=wa,p===Oo)break e;case wa:h.mode=Yn;case Yn:if(D>=6&&H>=258){l.next_out=R,l.avail_out=H,l.next_in=E,l.avail_in=D,h.hold=F,h.bits=V,Tn(l,ne),R=l.next_out,B=l.output,H=l.avail_out,E=l.next_in,w=l.input,D=l.avail_in,F=h.hold,V=h.bits,h.mode===Ra&&(h.back=-1);break}for(h.back=0;te=h.lencode[F&(1<<h.lenbits)-1],oe=te>>>24,Ue=te>>>16&255,ye=65535&te,!(oe<=V);){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}if(Ue&&!(240&Ue)){for(ue=oe,Te=Ue,De=ye;te=h.lencode[De+((F&(1<<ue+Te)-1)>>ue)],oe=te>>>24,Ue=te>>>16&255,ye=65535&te,!(ue+oe<=V);){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}F>>>=ue,V-=ue,h.back+=ue}if(F>>>=oe,V-=oe,h.back+=oe,h.length=ye,0===Ue){h.mode=16205;break}if(32&Ue){h.back=-1,h.mode=Ra;break}if(64&Ue){l.msg="invalid literal/length code",h.mode=Br;break}h.extra=15&Ue,h.mode=16201;case 16201:if(h.extra){for(Re=h.extra;V<Re;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}h.length+=F&(1<<h.extra)-1,F>>>=h.extra,V-=h.extra,h.back+=h.extra}h.was=h.length,h.mode=16202;case 16202:for(;te=h.distcode[F&(1<<h.distbits)-1],oe=te>>>24,Ue=te>>>16&255,ye=65535&te,!(oe<=V);){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}if(!(240&Ue)){for(ue=oe,Te=Ue,De=ye;te=h.distcode[De+((F&(1<<ue+Te)-1)>>ue)],oe=te>>>24,Ue=te>>>16&255,ye=65535&te,!(ue+oe<=V);){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}F>>>=ue,V-=ue,h.back+=ue}if(F>>>=oe,V-=oe,h.back+=oe,64&Ue){l.msg="invalid distance code",h.mode=Br;break}h.offset=ye,h.extra=15&Ue,h.mode=16203;case 16203:if(h.extra){for(Re=h.extra;V<Re;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}h.offset+=F&(1<<h.extra)-1,F>>>=h.extra,V-=h.extra,h.back+=h.extra}if(h.offset>h.dmax){l.msg="invalid distance too far back",h.mode=Br;break}h.mode=16204;case 16204:if(0===H)break e;if(N=ne-H,h.offset>N){if(N=h.offset-N,N>h.whave&&h.sane){l.msg="invalid distance too far back",h.mode=Br;break}N>
3h.wnext?(N-=h.wnext,ce=h.wsize-N):ce=h.wnext-N,N>h.length&&(N=h.length),he=h.window}else he=B,ce=R-h.offset,N=h.length;N>H&&(N=H),H-=N,h.length-=N;do{B[R++]=he[ce++]}while(--N);0===h.length&&(h.mode=Yn);break;case 16205:if(0===H)break e;B[R++]=h.length,H--,h.mode=Yn;break;case 16206:if(h.wrap){for(;V<32;){if(0===D)break e;D--,F|=w[E++]<<V,V+=8}if(ne-=H,l.total_out+=ne,h.total+=ne,4&h.wrap&&ne&&(l.adler=h.check=h.flags?nr(h.check,B,ne,R-ne):Fo(h.check,B,ne,R-ne)),ne=H,4&h.wrap&&(h.flags?F:ao(F))!==h.check){l.msg="incorrect data check",h.mode=Br;break}F=0,V=0}h.mode=16207;case 16207:if(h.wrap&&h.flags){for(;V<32;){if(0===D)break e;D--,F+=w[E++]<<V,V+=8}if(4&h.wrap&&F!==(4294967295&h.total)){l.msg="incorrect length check",h.mode=Br;break}F=0,V=0}h.mode=16208;case 16208:ie=No;break e;case Br:ie=ks;break e;case 16210:return ro;default:return yn}return l.next_out=R,l.avail_out=H,l.next_in=E,l.avail_in=D,h.hold=F,h.bits=V,(h.wsize||ne!==l.avail_out&&h.mode<Br&&(h.mode<16206||p!==ac))&&Ih(l,l.output,l.next_out,ne-l.avail_out),le-=l.avail_in,ne-=l.avail_out,l.total_in+=le,l.total_out+=ne,h.total+=ne,4&h.wrap&&ne&&(l.adler=h.check=h.flags?nr(h.check,B,ne,l.next_out-ne):Fo(h.check,B,ne,l.next_out-ne)),l.data_type=h.bits+(h.last?64:0)+(h.mode===Ra?128:0)+(h.mode===wa||16194===h.mode?256:0),(0===le&&0===ne||p===ac)&&ie===ba&&(ie=Mc),ie},inflateEnd:l=>{if(so(l))return yn;let p=l.state;return p.window&&(p.window=null),l.state=null,ba},inflateGetHeader:(l,p)=>{if(so(l))return yn;const h=l.state;return 2&h.wrap?(h.head=p,p.done=!1,ba):yn},inflateSetDictionary:(l,p)=>{const h=p.length;let w,B,E;return so(l)?yn:(w=l.state,0!==w.wrap&&w.mode!==Tc?yn:w.mode===Tc&&(B=1,B=Fo(B,p,h,0),B!==w.check)?ks:(E=Ih(l,p,h,h),E?(w.mode=16210,ro):(w.havedict=1,ba)))},inflateInfo:"pako inflate (from Nodeca project)"},rh=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const wh=Object.prototype.toString,{Z_NO_FLUSH:nh,Z_FINISH:vh,Z_OK:Dl,Z_STREAM_END:lo,Z_NEED_DICT:ah,Z_STREAM_ERROR:oc,Z_DATA_ERROR:lc,Z_MEM_ERROR:Fc}=Ia;function kl(l){this.options=Wr.assign({chunkSize:65536,windowBits:15,to:""},l||{});const p=this.options;p.raw&&p.windowBits>=0&&p.windowBits<16&&(p.windowBits=-p.windowBits,0===p.windowBits&&(p.windowBits=-15)),!(p.windowBits>=0&&p.windowBits<16)||l&&l.windowBits||(p.windowBits+=32),p.windowBits>15&&p.windowBits<48&&(15&p.windowBits||(p.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new oa,this.strm.avail_out=0;let h=Ts.inflateInit2(this.strm,p.windowBits);if(h!==Dl)throw new Error(er[h]);if(this.header=new rh,Ts.inflateGetHeader(this.strm,this.header),p.dictionary&&("string"==typeof p.dictionary?p.dictionary=Nr.string2buf(p.dictionary):"[object ArrayBuffer]"===wh.call(p.dictionary)&&(p.dictionary=new Uint8Array(p.dictionary)),p.raw&&(h=Ts.inflateSetDictionary(this.strm,p.dictionary),h!==Dl)))throw new Error(er[h])}function Lc(l,p){const h=new kl(p);if(h.push(l),h.err)throw h.msg||er[h.err];return h.result}kl.prototype.push=function(l,p){const h=this.strm,w=this.options.chunkSize,B=this.options.dictionary;let E,R,D;if(this.ended)return!1;for(R=p===~~p?p:!0===p?vh:nh,h.input="[object ArrayBuffer]"===wh.call(l)?new Uint8Array(l):l,h.next_in=0,h.avail_in=h.input.length;;){for(0===h.avail_out&&(h.output=new Uint8Array(w),h.next_out=0,h.avail_out=w),E=Ts.inflate(h,R),E===ah&&B&&(E=Ts.inflateSetDictionary(h,B),E===Dl?E=Ts.inflate(h,R):E===lc&&(E=ah));h.avail_in>0&&E===lo&&h.state.wrap>0&&0!==l[h.next_in];)Ts.inflateReset(h),E=Ts.inflate(h,R);switch(E){case oc:case lc:case ah:case Fc:return this.onEnd(E),this.ended=!0,!1}if(D=h.avail_out,h.next_out&&(0===h.avail_out||E===lo))if("string"===this.options.to){let H=Nr.utf8border(h.output,h.next_out),F=h.next_out-H,V=Nr.buf2string(h.output,H);h.next_out=F,h.avail_out=w-F,F&&h.output.set(h.output.subarray(H,H+F),0),this.onData(V)}else this.onData(h.output.length===h.next_out?h.output:h.output.subarray(0,h.next_out));if(E!==Dl||0!==D){if(E===lo)return E=Ts.inflateEnd(this.strm),this.onEnd(E),this.ended=!0,!0;if(0===h.avail_in)break}}return!0},kl.prototype.onData=function(l){this.chunks.push(l)},kl.prototype.onEnd=function(l){l===Dl&&(this.result="string"===this.options.to?this.chunks.join(""):Wr.flattenChunks(this.chunks)),this.chunks=[],this.err=l,this.msg=this.strm.msg};var qh={Inflate:kl,inflate:Lc,inflateRaw:function(l,p){return(p=p||{}).raw=!0,Lc(l,p)},ungzip:Lc,constants:Ia};const{inflate:Ml}=qh;var Tl=Ml,Hh=Object.freeze({__proto__:null,default:class extends Ga{decodeBlock(l){return Tl(new Uint8Array(l)).buffer}}}),zc=Object.freeze({__proto__:null,default:class extends Ga{decodeBlock(l){const p=new DataView(l),h=[];for(let w=0;w<l.byteLength;++w){let B=p.getInt8(w);if(B<0){const E=p.getUint8(w+1);B=-B;for(let R=0;R<=B;++R)h.push(E);w+=1}else{for(let E=0;E<=B;++E)h.push(p.getUint8(w+E+1));w+=B+1}}return new Uint8Array(h).buffer}}}),Bh={exports:{}};!function(l){!function(){var p,h,w,B,E,R,D,H,F=(p={defaultNoDataValue:-34027999387901484e22,decode:function(N,ce){var he=(ce=ce||{}).encodedMaskData||null===ce.encodedMaskData,oe=E(N,ce.inputOffset||0,he),Ue=null!==ce.noDataValue?ce.noDataValue:p.defaultNoDataValue,ye=h(oe,ce.pixelType||Float32Array,ce.encodedMaskData,Ue,ce.returnMask),ue={width:oe.width,height:oe.height,pixelData:ye.resultPixels,minValue:ye.minValue,maxValue:oe.pixels.maxValue,noDataValue:Ue};return ye.resultMask&&(ue.maskData=ye.resultMask),ce.returnEncodedMask&&oe.mask&&(ue.encodedMaskData=oe.mask.bitset?oe.mask.bitset:null),ce.returnFileInfo&&(ue.fileInfo=w(oe),ce.computeUsedBitDepths&&(ue.fileInfo.bitDepths=B(oe))),ue}},h=function(N,ce,he,oe,Ue){var ye,ue,Te,De=0,J=N.pixels.numBlocksX,ie=N.pixels.numBlocksY,te=Math.floor(N.width/J),Qe=Math.floor(N.height/ie),ge=2*N.maxZError,Re=Number.MAX_VALUE;he=he||(N.mask?N.mask.bitset:null),ue=new ce(N.width*N.height),Ue&&he&&(Te=new Uint8Array(N.width*N.height));for(var Le,Ge,He=new Float32Array(te*Qe),Xe=0;Xe<=ie;Xe++){var pt=Xe!==ie?Qe:N.height%ie;if(0!==pt)for(var Ye=0;Ye<=J;Ye++){var Ct=Ye!==J?te:N.width%J;if(0!==Ct){var gt,ut,ct,Xt,qt=Xe*N.width*Qe+Ye*te,di=N.width-Ct,Kt=N.pixels.blocks[De];
3if(Kt.encoding<2?(0===Kt.encoding?gt=Kt.rawData:(R(Kt.stuffedData,Kt.bitsPerPixel,Kt.numValidPixels,Kt.offset,ge,He,N.pixels.maxValue),gt=He),ut=0):ct=2===Kt.encoding?0:Kt.offset,he)for(Ge=0;Ge<pt;Ge++){for(7&qt&&(Xt=he[qt>>3],Xt<<=7&qt),Le=0;Le<Ct;Le++)7&qt||(Xt=he[qt>>3]),128&Xt?(Te&&(Te[qt]=1),Re=Re>(ye=Kt.encoding<2?gt[ut++]:ct)?ye:Re,ue[qt++]=ye):(Te&&(Te[qt]=0),ue[qt++]=oe),Xt<<=1;qt+=di}else if(Kt.encoding<2)for(Ge=0;Ge<pt;Ge++){for(Le=0;Le<Ct;Le++)Re=Re>(ye=gt[ut++])?ye:Re,ue[qt++]=ye;qt+=di}else for(Re=Re>ct?ct:Re,Ge=0;Ge<pt;Ge++){for(Le=0;Le<Ct;Le++)ue[qt++]=ct;qt+=di}if(1===Kt.encoding&&ut!==Kt.numValidPixels)throw"Block and Mask do not match";De++}}}return{resultPixels:ue,resultMask:Te,minValue:Re}},w=function(N){return{fileIdentifierString:N.fileIdentifierString,fileVersion:N.fileVersion,imageType:N.imageType,height:N.height,width:N.width,maxZError:N.maxZError,eofOffset:N.eofOffset,mask:N.mask?{numBlocksX:N.mask.numBlocksX,numBlocksY:N.mask.numBlocksY,numBytes:N.mask.numBytes,maxValue:N.mask.maxValue}:null,pixels:{numBlocksX:N.pixels.numBlocksX,numBlocksY:N.pixels.numBlocksY,numBytes:N.pixels.numBytes,maxValue:N.pixels.maxValue,noDataValue:N.noDataValue}}},B=function(N){for(var ce=N.pixels.numBlocksX*N.pixels.numBlocksY,he={},oe=0;oe<ce;oe++){var Ue=N.pixels.blocks[oe];0===Ue.encoding?he.float32=!0:1===Ue.encoding?he[Ue.bitsPerPixel]=!0:he[0]=!0}return Object.keys(he)},E=function(N,ce,he){var oe={},Ue=new Uint8Array(N,ce,10);if(oe.fileIdentifierString=String.fromCharCode.apply(null,Ue),"CntZImage"!==oe.fileIdentifierString.trim())throw"Unexpected file identifier string: "+oe.fileIdentifierString;ce+=10;var ye=new DataView(N,ce,24);if(oe.fileVersion=ye.getInt32(0,!0),oe.imageType=ye.getInt32(4,!0),oe.height=ye.getUint32(8,!0),oe.width=ye.getUint32(12,!0),oe.maxZError=ye.getFloat64(16,!0),ce+=24,!he)if(ye=new DataView(N,ce,16),oe.mask={},oe.mask.numBlocksY=ye.getUint32(0,!0),oe.mask.numBlocksX=ye.getUint32(4,!0),oe.mask.numBytes=ye.getUint32(8,!0),oe.mask.maxValue=ye.getFloat32(12,!0),ce+=16,oe.mask.numBytes>0){var ue=new Uint8Array(Math.ceil(oe.width*oe.height/8)),Te=(ye=new DataView(N,ce,oe.mask.numBytes)).getInt16(0,!0),De=2,J=0;do{if(Te>0)for(;Te--;)ue[J++]=ye.getUint8(De++);else{var ie=ye.getUint8(De++);for(Te=-Te;Te--;)ue[J++]=ie}Te=ye.getInt16(De,!0),De+=2}while(De<oe.mask.numBytes);if(-32768!==Te||J<ue.length)throw"Unexpected end of mask RLE encoding";oe.mask.bitset=ue,ce+=oe.mask.numBytes}else oe.mask.numBytes|oe.mask.numBlocksY|oe.mask.maxValue||(oe.mask.bitset=new Uint8Array(Math.ceil(oe.width*oe.height/8)));ye=new DataView(N,ce,16),oe.pixels={},oe.pixels.numBlocksY=ye.getUint32(0,!0),oe.pixels.numBlocksX=ye.getUint32(4,!0),oe.pixels.numBytes=ye.getUint32(8,!0),oe.pixels.maxValue=ye.getFloat32(12,!0),ce+=16;var te=oe.pixels.numBlocksX,Qe=oe.pixels.numBlocksY,ge=te+(oe.width%te>0?1:0),Re=Qe+(oe.height%Qe>0?1:0);oe.pixels.blocks=new Array(ge*Re);for(var Le=0,Ge=0;Ge<Re;Ge++)for(var He=0;He<ge;He++){var Xe=0;ye=new DataView(N,ce,Math.min(10,N.byteLength-ce));var Ye={};oe.pixels.blocks[Le++]=Ye;var Ct=ye.getUint8(0);if(Xe++,Ye.encoding=63&Ct,Ye.encoding>3)throw"Invalid block encoding ("+Ye.encoding+")";if(2!==Ye.encoding){if(0!==Ct&&2!==Ct){if(Ye.offsetType=Ct>>=6,2===Ct)Ye.offset=ye.getInt8(1),Xe++;else if(1===Ct)Ye.offset=ye.getInt16(1,!0),Xe+=2;else{if(0!==Ct)throw"Invalid block offset type";Ye.offset=ye.getFloat32(1,!0),Xe+=4}if(1===Ye.encoding)if(Ct=ye.getUint8(Xe),Xe++,Ye.bitsPerPixel=63&Ct,Ye.numValidPixelsType=Ct>>=6,2===Ct)Ye.numValidPixels=ye.getUint8(Xe),Xe++;else if(1===Ct)Ye.numValidPixels=ye.getUint16(Xe,!0),Xe+=2;else{if(0!==Ct)throw"Invalid valid pixel count type";Ye.numValidPixels=ye.getUint32(Xe,!0),Xe+=4}}var gt;if(ce+=Xe,3!==Ye.encoding)if(0===Ye.encoding){var ut=(oe.pixels.numBytes-1)/4;if(ut!==Math.floor(ut))throw"uncompressed block has invalid length";gt=new ArrayBuffer(4*ut),new Uint8Array(gt).set(new Uint8Array(N,ce,4*ut));var ct=new Float32Array(gt);Ye.rawData=ct,ce+=4*ut}else if(1===Ye.encoding){var Xt=Math.ceil(Ye.numValidPixels*Ye.bitsPerPixel/8),qt=Math.ceil(Xt/4);gt=new ArrayBuffer(4*qt),new Uint8Array(gt).set(new Uint8Array(N,ce,Xt)),Ye.stuffedData=new Uint32Array(gt),ce+=Xt}}else ce++}return oe.eofOffset=ce,oe},R=function(N,ce,he,oe,Ue,ye,ue){var Te,De,J,ie=(1<<ce)-1,te=0,Qe=0,ge=Math.ceil((ue-oe)/Ue),Re=4*N.length-Math.ceil(ce*he/8);for(N[N.length-1]<<=8*Re,Te=0;Te<he;Te++){if(0===Qe&&(J=N[te++],Qe=32),Qe>=ce)De=J>>>Qe-ce&ie,Qe-=ce;else{var Le=ce-Qe;De=(J&ie)<<Le&ie,De+=(J=N[te++])>>>(Qe=32-Le)}ye[Te]=De<ge?oe+De*Ue:ue}return ye},p),V=function(){var N=function(J,ie,te,Qe,ge,Re,Le,Ge){var He,Xe,pt,Ye,Ct,gt=(1<<te)-1,ut=0,ct=0,Xt=4*J.length-Math.ceil(te*Qe/8);if(J[J.length-1]<<=8*Xt,ge)for(He=0;He<Qe;He++)0===ct&&(pt=J[ut++],ct=32),ct>=te?(Xe=pt>>>ct-te&gt,ct-=te):(Xe=(pt&gt)<<(Ye=te-ct)&gt,Xe+=(pt=J[ut++])>>>(ct=32-Ye)),ie[He]=ge[Xe];else for(Ct=Math.ceil((Ge-Re)/Le),He=0;He<Qe;He++)0===ct&&(pt=J[ut++],ct=32),ct>=te?(Xe=pt>>>ct-te&gt,ct-=te):(Xe=(pt&gt)<<(Ye=te-ct)&gt,Xe+=(pt=J[ut++])>>>(ct=32-Ye)),ie[He]=Xe<Ct?Re+Xe*Le:Ge},he=function(J,ie,te,Qe,ge,Re,Le,Ge){var He,Xe,pt,Ye,Ct=(1<<te)-1,gt=0,ut=0,ct=0;
3if(ge)for(He=0;He<Qe;He++)0===ut&&(pt=J[gt++],ut=32,ct=0),ut>=te?(Xe=pt>>>ct&Ct,ut-=te,ct+=te):(Xe=pt>>>ct&Ct,ut=32-(Ye=te-ut),Xe|=((pt=J[gt++])&(1<<Ye)-1)<<te-Ye,ct=Ye),ie[He]=ge[Xe];else{var Xt=Math.ceil((Ge-Re)/Le);for(He=0;He<Qe;He++)0===ut&&(pt=J[gt++],ut=32,ct=0),ut>=te?(Xe=pt>>>ct&Ct,ut-=te,ct+=te):(Xe=pt>>>ct&Ct,ut=32-(Ye=te-ut),Xe|=((pt=J[gt++])&(1<<Ye)-1)<<te-Ye,ct=Ye),ie[He]=Xe<Xt?Re+Xe*Le:Ge}return ie},ue={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(J){for(var ie=65535,te=65535,Qe=J.length,ge=Math.floor(Qe/2),Re=0;ge;){var Le=ge>=359?359:ge;ge-=Le;do{ie+=J[Re++]<<8,te+=ie+=J[Re++]}while(--Le);ie=(65535&ie)+(ie>>>16),te=(65535&te)+(te>>>16)}return 1&Qe&&(te+=ie+=J[Re]<<8),((te=(65535&te)+(te>>>16))<<16|(ie=(65535&ie)+(ie>>>16)))>>>0},readHeaderInfo:function(J,ie){var te=ie.ptr,Qe=new Uint8Array(J,te,6),ge={};if(ge.fileIdentifierString=String.fromCharCode.apply(null,Qe),0!==ge.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+ge.fileIdentifierString;te+=6;var Le=new DataView(J,te,8),Ge=Le.getInt32(0,!0);if(ge.fileVersion=Ge,te+=4,Ge>=3&&(ge.checksum=Le.getUint32(4,!0),te+=4),Le=new DataView(J,te,12),ge.height=Le.getUint32(0,!0),ge.width=Le.getUint32(4,!0),te+=8,Ge>=4?(ge.numDims=Le.getUint32(8,!0),te+=4):ge.numDims=1,Le=new DataView(J,te,40),ge.numValidPixel=Le.getUint32(0,!0),ge.microBlockSize=Le.getInt32(4,!0),ge.blobSize=Le.getInt32(8,!0),ge.imageType=Le.getInt32(12,!0),ge.maxZError=Le.getFloat64(16,!0),ge.zMin=Le.getFloat64(24,!0),ge.zMax=Le.getFloat64(32,!0),te+=40,ie.headerInfo=ge,ie.ptr=te,Ge>=3&&this.computeChecksumFletcher32(new Uint8Array(J,te-(Ge>=4?52:48),ge.blobSize-14))!==ge.checksum)throw"Checksum failed.";return!0},checkMinMaxRanges:function(J,ie){var te=ie.headerInfo,Qe=this.getDataTypeArray(te.imageType),ge=te.numDims*this.getDataTypeSize(te.imageType),Re=this.readSubArray(J,ie.ptr,Qe,ge),Le=this.readSubArray(J,ie.ptr+ge,Qe,ge);ie.ptr+=2*ge;var Ge,He=!0;for(Ge=0;Ge<te.numDims;Ge++)if(Re[Ge]!==Le[Ge]){He=!1;break}return te.minValues=Re,te.maxValues=Le,He},readSubArray:function(J,ie,te,Qe){var ge;if(te===Uint8Array)ge=new Uint8Array(J,ie,Qe);else{var Re=new ArrayBuffer(Qe);new Uint8Array(Re).set(new Uint8Array(J,ie,Qe)),ge=new te(Re)}return ge},readMask:function(J,ie){var te,Qe,ge=ie.ptr,Re=ie.headerInfo,Le=Re.width*Re.height,Ge=Re.numValidPixel,He=new DataView(J,ge,4),Xe={};if(Xe.numBytes=He.getUint32(0,!0),ge+=4,(0===Ge||Le===Ge)&&0!==Xe.numBytes)throw"invalid mask";if(0===Ge)te=new Uint8Array(Math.ceil(Le/8)),Xe.bitset=te,Qe=new Uint8Array(Le),ie.pixels.resultMask=Qe,ge+=Xe.numBytes;else if(Xe.numBytes>0){te=new Uint8Array(Math.ceil(Le/8));var pt=(He=new DataView(J,ge,Xe.numBytes)).getInt16(0,!0),Ye=2,Ct=0,gt=0;do{if(pt>0)for(;pt--;)te[Ct++]=He.getUint8(Ye++);else for(gt=He.getUint8(Ye++),pt=-pt;pt--;)te[Ct++]=gt;pt=He.getInt16(Ye,!0),Ye+=2}while(Ye<Xe.numBytes);if(-32768!==pt||Ct<te.length)throw"Unexpected end of mask RLE encoding";Qe=new Uint8Array(Le);var ut=0,ct=0;for(ct=0;ct<Le;ct++)7&ct?(ut=te[ct>>3],ut<<=7&ct):ut=te[ct>>3],128&ut&&(Qe[ct]=1);ie.pixels.resultMask=Qe,Xe.bitset=te,ge+=Xe.numBytes}return ie.ptr=ge,ie.mask=Xe,!0},readDataOneSweep:function(J,ie,te,Qe){var ge,Re=ie.ptr,Le=ie.headerInfo,Ge=Le.numDims,He=Le.width*Le.height,pt=Le.numValidPixel*ue.getDataTypeSize(Le.imageType)*Ge,Ye=ie.pixels.resultMask;if(te===Uint8Array)ge=new Uint8Array(J,Re,pt);else{var Ct=new ArrayBuffer(pt);new Uint8Array(Ct).set(new Uint8Array(J,Re,pt)),ge=new te(Ct)}if(ge.length===He*Ge)ie.pixels.resultPixels=Qe?ue.swapDimensionOrder(ge,He,Ge,te,!0):ge;else{ie.pixels.resultPixels=new te(He*Ge);var gt=0,ut=0,ct=0,Xt=0;if(Ge>1){if(Qe){for(ut=0;ut<He;ut++)if(Ye[ut])for(Xt=ut,ct=0;ct<Ge;ct++,Xt+=He)ie.pixels.resultPixels[Xt]=ge[gt++]}else for(ut=0;ut<He;ut++)if(Ye[ut])for(Xt=ut*Ge,ct=0;ct<Ge;ct++)ie.pixels.resultPixels[Xt+ct]=ge[gt++]}else for(ut=0;ut<He;ut++)Ye[ut]&&(ie.pixels.resultPixels[ut]=ge[gt++])}return ie.ptr=Re+=pt,!0},readHuffmanTree:function(J,ie){var te=this.HUFFMAN_LUT_BITS_MAX,Qe=new DataView(J,ie.ptr,16);if(ie.ptr+=16,Qe.getInt32(0,!0)<2)throw"unsupported Huffman version";var ge=Qe.getInt32(4,!0),Re=Qe.getInt32(8,!0),Le=Qe.getInt32(12,!0);if(Re>=Le)return!1;var Ge=new Uint32Array(Le-Re);ue.decodeBits(J,ie,Ge);var He,Xe,pt,Ye,Ct=[];for(He=Re;He<Le;He++)Ct[Xe=He-(He<ge?0:ge)]={first:Ge[He-Re],second:null};var gt=J.byteLength-ie.ptr,ut=Math.ceil(gt/4),ct=new ArrayBuffer(4*ut);new Uint8Array(ct).set(new Uint8Array(J,ie.ptr,gt));var Xt,qt=new Uint32Array(ct),di=0,Kt=0;for(Xt=qt[0],He=Re;He<Le;He++)(Ye=Ct[Xe=He-(He<ge?0:ge)].first)>0&&(Ct[Xe].second=Xt<<di>>>32-Ye,32-di>=Ye?32===(di+=Ye)&&(di=0,Xt=qt[++Kt]):(Xt=qt[++Kt],Ct[Xe].second|=Xt>>>32-(di+=Ye-32)));var Oi,qi=0,ui=new Te;for(He=0;He<Ct.length;He++)void 0!==Ct[He]&&(qi=Math.max(qi,Ct[He].first));Oi=qi>=te?te:qi;var xi,ni,Mr,Cr,tr,Tr=[];for(He=Re;He<Le;He++)if((Ye=Ct[Xe=He-(He<ge?0:ge)].first)>0)if(xi=[Ye,Xe],Ye<=Oi)for(ni=Ct[Xe].second<<Oi-Ye,Mr=1<<Oi-Ye,pt=0;pt<Mr;pt++)Tr[ni|pt]=xi;else for(ni=Ct[Xe].second,tr=ui,Cr=Ye-1;Cr>=0;Cr--)ni>>>Cr&1?(tr.right||(tr.right=new Te),tr=tr.right):(tr.left||(tr.left=new Te),tr=tr.left),0!==Cr||tr.val||(tr.val=xi[1]);return{decodeLut:Tr,numBitsLUTQick:Oi,numBitsLUT:qi,tree:ui,stuffedData:qt,srcPtr:Kt,bitPos:di}},readHuffman:function(J,ie,te,Qe){var ge,Re,Le,Ge,He,Xe,pt,Ye,Ct,gt=ie.headerInfo.numDims,ut=ie.headerInfo.height,ct=ie.headerInfo.width,Xt=ct*ut,qt=this.readHuffmanTree(J,ie),di=qt.decodeLut,Kt=qt.tree,qi=qt.stuffedData,Oi=qt.srcPtr,ui=qt.bitPos,xi=qt.numBitsLUTQick,ni=qt.numBitsLUT,Mr=0===ie.headerInfo.imageType?128:0,Cr=ie.pixels.resultMask,tr=0;ui>0&&(Oi++,ui=0);var Tr,va=qi[Oi],Ps=1===ie.encodeMode,Vo=new te(Xt*gt),Si=Vo;if(gt<2||Ps){for(Tr=0;Tr<gt;Tr++)if(gt>1&&(Si=new te(Vo.buffer,Xt*Tr,Xt),tr=0),ie.headerInfo.numValidPixel===ct*ut)for(Ye=0,Xe=0;Xe<ut;Xe++)for(pt=0;pt<ct;pt++,Ye++){if(Re=0,He=Ge=va<<ui>>>32-xi,32-ui<xi&&(He=Ge|=qi[Oi+1]>>>64-ui-xi),di[He])Re=di[He][1],ui+=di[He][0];else for(He=Ge=va<<ui>>>32-ni,32-ui<ni&&(He=Ge|=qi[Oi+1]>>>64-ui-ni),ge=Kt,Ct=0;Ct<ni;Ct++)if(!(ge=Ge>>>ni-Ct-1&1?ge.right:ge.left).left&&!ge.right){Re=ge.val,ui=ui+Ct+1;break}ui>=32&&(ui-=32,va=qi[++Oi]),Le=Re-Mr,Ps?(Le+=pt>0?tr:Xe>0?Si[Ye-ct]:tr,Si[Ye]=Le&=255,tr=Le):Si[Ye]=Le}else for(Ye=0,Xe=0;Xe<ut;Xe++)for(pt=0;pt<ct;pt++,Ye++)if(Cr[Ye]){if(Re=0,He=Ge=va<<ui>>>32-xi,32-ui<xi&&(He=Ge|=qi[Oi+1]>>>64-ui-xi),di[He])Re=di[He][1],ui+=di[He][0];else for(He=Ge=va<<ui>>>32-ni,32-ui<ni&&(He=Ge|=qi[Oi+1]>>>64-ui-ni),ge=Kt,Ct=0;Ct<ni;Ct++)if(!(ge=Ge>>>ni-Ct-1&1?ge.right:ge.left).left&&!ge.right){Re=ge.val,ui=ui+Ct+1;break}ui>=32&&(ui-=32,va=qi[++Oi]),Le=Re-Mr,Ps?(Le+=pt>0&&Cr[Ye-1]?tr:Xe>0&&Cr[Ye-ct]?Si[Ye-ct]:tr,Si[Ye]=Le&=255,tr=Le):Si[Ye]=Le}}else for(Ye=0,Xe=0;Xe<ut;Xe++)for(pt=0;pt<ct;pt++)if(Ye=Xe*ct+pt,!Cr||Cr[Ye])for(Tr=0;Tr<gt;Tr++,Ye+=Xt){if(Re=0,He=Ge=va<<ui>>>32-xi,32-ui<xi&&(He=Ge|=qi[Oi+1]>>>64-ui-xi),di[He])Re=di[He][1],ui+=di[He][0];else for(He=Ge=va<<ui>>>32-ni,32-ui<ni&&(He=Ge|=qi[Oi+1]>>>64-ui-ni),ge=Kt,Ct=0;Ct<ni;Ct++)if(!(ge=Ge>>>ni-Ct-1&1?ge.right:ge.left).left&&!ge.right){Re=ge.val,ui=ui+Ct+1;break}ui>
3=32&&(ui-=32,va=qi[++Oi]),Si[Ye]=Le=Re-Mr}ie.ptr=ie.ptr+4*(Oi+1)+(ui>0?4:0),ie.pixels.resultPixels=Vo,gt>1&&!Qe&&(ie.pixels.resultPixels=ue.swapDimensionOrder(Vo,Xt,gt,te))},decodeBits:function(J,ie,te,Qe,ge){var Re=ie.headerInfo,Le=Re.fileVersion,Ge=0,Xe=new DataView(J,ie.ptr,J.byteLength-ie.ptr>=5?5:J.byteLength-ie.ptr),pt=Xe.getUint8(0);Ge++;var Ye=pt>>6,Ct=0===Ye?4:3-Ye,gt=(32&pt)>0,ut=31&pt,ct=0;if(1===Ct)ct=Xe.getUint8(Ge),Ge++;else if(2===Ct)ct=Xe.getUint16(Ge,!0),Ge+=2;else{if(4!==Ct)throw"Invalid valid pixel count type";ct=Xe.getUint32(Ge,!0),Ge+=4}var Xt,qt,di,Kt,qi,Oi,ui,xi,ni,Mr=2*Re.maxZError,Cr=Re.numDims>1?Re.maxValues[ge]:Re.zMax;if(gt){for(ie.counter.lut++,xi=Xe.getUint8(Ge),Ge++,Kt=Math.ceil((xi-1)*ut/8),qi=Math.ceil(Kt/4),qt=new ArrayBuffer(4*qi),di=new Uint8Array(qt),ie.ptr+=Ge,di.set(new Uint8Array(J,ie.ptr,Kt)),ui=new Uint32Array(qt),ie.ptr+=Kt,ni=0;xi-1>>>ni;)ni++;Kt=Math.ceil(ct*ni/8),qi=Math.ceil(Kt/4),qt=new ArrayBuffer(4*qi),(di=new Uint8Array(qt)).set(new Uint8Array(J,ie.ptr,Kt)),Xt=new Uint32Array(qt),ie.ptr+=Kt,Oi=Le>=3?function(J,ie,te,Qe,ge,Re){var Le,Ge=(1<<ie)-1,He=0,Xe=0,pt=0,Ye=0,Ct=0,gt=0,ut=[],ct=Math.ceil((Re-Qe)/ge);for(Xe=0;Xe<te;Xe++)0===Ye&&(Le=J[He++],Ye=32,gt=0),Ye>=ie?(Ct=Le>>>gt&Ge,Ye-=ie,gt+=ie):(Ct=Le>>>gt&Ge,Ye=32-(pt=ie-Ye),Ct|=((Le=J[He++])&(1<<pt)-1)<<ie-pt,gt=pt),ut[Xe]=Ct<ct?Qe+Ct*ge:Re;return ut.unshift(Qe),ut}(ui,ut,xi-1,Qe,Mr,Cr):function(J,ie,te,Qe,ge,Re){var Le,Ge=(1<<ie)-1,He=0,Xe=0,pt=0,Ye=0,Ct=0,gt=[],ut=4*J.length-Math.ceil(ie*te/8);J[J.length-1]<<=8*ut;var ct=Math.ceil((Re-Qe)/ge);for(Xe=0;Xe<te;Xe++)0===Ye&&(Le=J[He++],Ye=32),Ye>=ie?(Ct=Le>>>Ye-ie&Ge,Ye-=ie):(Ct=(Le&Ge)<<(pt=ie-Ye)&Ge,Ct+=(Le=J[He++])>>>(Ye=32-pt)),gt[Xe]=Ct<ct?Qe+Ct*ge:Re;return gt.unshift(Qe),gt}(ui,ut,xi-1,Qe,Mr,Cr),Le>=3?he(Xt,te,ni,ct,Oi):N(Xt,te,ni,ct,Oi)}else ie.counter.bitstuffer++,ni=ut,ie.ptr+=Ge,ni>0&&(Kt=Math.ceil(ct*ni/8),qi=Math.ceil(Kt/4),qt=new ArrayBuffer(4*qi),(di=new Uint8Array(qt)).set(new Uint8Array(J,ie.ptr,Kt)),Xt=new Uint32Array(qt),ie.ptr+=Kt,Le>=3?null==Qe?function(J,ie,te,Qe){var ge,Re,Le,Ge,He=(1<<te)-1,Xe=0,pt=0,Ye=0;for(ge=0;ge<Qe;ge++)0===pt&&(Le=J[Xe++],pt=32,Ye=0),pt>=te?(Re=Le>>>Ye&He,pt-=te,Ye+=te):(Re=Le>>>Ye&He,pt=32-(Ge=te-pt),Re|=((Le=J[Xe++])&(1<<Ge)-1)<<te-Ge,Ye=Ge),ie[ge]=Re}(Xt,te,ni,ct):he(Xt,te,ni,ct,!1,Qe,Mr,Cr):null==Qe?function(J,ie,te,Qe){var ge,Re,Le,Ge,He=(1<<te)-1,Xe=0,pt=0,Ye=4*J.length-Math.ceil(te*Qe/8);for(J[J.length-1]<<=8*Ye,ge=0;ge<Qe;ge++)0===pt&&(Le=J[Xe++],pt=32),pt>=te?(Re=Le>>>pt-te&He,pt-=te):(Re=(Le&He)<<(Ge=te-pt)&He,Re+=(Le=J[Xe++])>>>(pt=32-Ge)),ie[ge]=Re}(Xt,te,ni,ct):N(Xt,te,ni,ct,!1,Qe,Mr,Cr))},readTiles:function(J,ie,te,Qe){var ge=ie.headerInfo,Re=ge.width,Le=ge.height,Ge=Re*Le,He=ge.microBlockSize,Xe=ge.imageType,pt=ue.getDataTypeSize(Xe),Ye=Math.ceil(Re/He),Ct=Math.ceil(Le/He);ie.pixels.numBlocksY=Ct,ie.pixels.numBlocksX=Ye,ie.pixels.ptr=0;var gt,ut,ct,Xt,qt,di,Kt,qi,Oi,ui,xi=0,ni=0,Mr=0,Cr=0,tr=0,Tr=0,Ps=0,Vo=0,Si=0,ha=0,Ka=0,Qh=0,Oc=0,Rn=0,uc=new te(He*He),Jh=Le%He||He,Ac=Re%He||He,dc=ge.numDims,$a=ie.pixels.resultMask,xa=ie.pixels.resultPixels,Sh=ge.fileVersion>=5?14:15,ch=ge.zMax;for(Mr=0;Mr<Ct;Mr++)for(tr=Mr!==Ct-1?He:Jh,Cr=0;Cr<Ye;Cr++)for(Si=Mr*Re*He+Cr*He,ha=Re-(Tr=Cr!==Ye-1?He:Ac),qi=0;qi<dc;qi++){if(dc>1?(ui=xa,Si=Mr*Re*He+Cr*He,xa=new te(ie.pixels.resultPixels.buffer,Ge*qi*pt,Ge),ch=ge.maxValues[qi]):ui=null,ut={},Rn=0,Ps=(gt=new DataView(J,ie.ptr,Math.min(10,J.byteLength-ie.ptr))).getUint8(0),Rn++,Oi=ge.fileVersion>=5?4&Ps:0,Vo=Ps>>6&255,(Ps>>2&Sh)!=(Cr*He>>3&Sh)||Oi&&0===qi)throw"integrity issue";if((qt=3&Ps)>3)throw ie.ptr+=Rn,"Invalid block encoding ("+qt+")";if(2!==qt)if(0===qt){if(Oi)throw"integrity issue";if(ie.counter.uncompressed++,ie.ptr+=Rn,Ka=(Ka=tr*Tr*pt)<(Qh=J.byteLength-ie.ptr)?Ka:Qh,ct=new ArrayBuffer(Ka%pt==0?Ka:Ka+pt-Ka%pt),new Uint8Array(ct).set(new Uint8Array(J,ie.ptr,Ka)),Xt=new te(ct),Oc=0,$a)for(xi=0;xi<tr;xi++){for(ni=0;ni<Tr;ni++)$a[Si]&&(xa[Si]=Xt[Oc++]),Si++;Si+=ha}else for(xi=0;xi<tr;xi++){for(ni=0;ni<Tr;ni++)xa[Si++]=Xt[Oc++];Si+=ha}ie.ptr+=Oc*pt}else if(di=ue.getDataTypeUsed(Oi&&Xe<6?4:Xe,Vo),Kt=ue.getOnePixel(ut,Rn,di,gt),Rn+=ue.getDataTypeSize(di),3===qt)if(ie.ptr+=Rn,ie.counter.constantoffset++,$a)for(xi=0;xi<tr;xi++){for(ni=0;ni<Tr;ni++)$a[Si]&&(xa[Si]=Oi?Math.min(ch,ui[Si]+Kt):Kt),Si++;Si+=ha}else for(xi=0;xi<tr;xi++){for(ni=0;ni<Tr;ni++)xa[Si]=Oi?Math.min(ch,ui[Si]+Kt):Kt,Si++;Si+=ha}else if(ie.ptr+=Rn,ue.decodeBits(J,ie,uc,Kt,qi),Rn=0,Oi)if($a)for(xi=0;xi<tr;xi++){for(ni=0;ni<Tr;ni++)$a[Si]&&(xa[Si]=uc[Rn++]+ui[Si]),Si++;Si+=ha}else for(xi=0;xi<tr;xi++){for(ni=0;ni<Tr;ni++)xa[Si]=uc[Rn++]+ui[Si],Si++;Si+=ha}else if($a)for(xi=0;xi<tr;xi++){for(ni=0;ni<Tr;ni++)$a[Si]&&(xa[Si]=uc[Rn++]),Si++;Si+=ha}else for(xi=0;xi<tr;xi++){for(ni=0;ni<Tr;ni++)xa[Si++]=uc[Rn++];Si+=ha}else{if(Oi)if($a)for(xi=0;xi<tr;xi++)for(ni=0;ni<Tr;ni++)$a[Si]&&(xa[Si]=ui[Si]),Si++;else for(xi=0;xi<tr;xi++)for(ni=0;ni<Tr;ni++)xa[Si]=ui[Si],Si++;ie.counter.constant++,ie.ptr+=Rn}}dc>1&&!Qe&&(ie.pixels.resultPixels=ue.swapDimensionOrder(ie.pixels.resultPixels,Ge,dc,te))},formatFileInfo:function(J){return{fileIdentifierString:J.headerInfo.fileIdentifierString,fileVersion:J.headerInfo.fileVersion,imageType:J.headerInfo.imageType,height:J.headerInfo.height,width:J.headerInfo.width,numValidPixel:J.headerInfo.numValidPixel,microBlockSize:J.headerInfo.microBlockSize,blobSize:J.headerInfo.blobSize,maxZError:J.headerInfo.maxZError,pixelType:ue.getPixelType(J.headerInfo.imageType),eofOffset:J.eofOffset,mask:J.mask?{numBytes:J.mask.numBytes}:null,pixels:{numBlocksX:J.pixels.numBlocksX,numBlocksY:J.pixels.numBlocksY,maxValue:J.headerInfo.zMax,minValue:J.headerInfo.zMin,noDataValue:J.noDataValue}}},constructConstantSurface:function(J,ie){var te=J.headerInfo.zMax,Qe=J.headerInfo.zMin,ge=J.headerInfo.maxValues,Re=J.headerInfo.numDims,Le=J.headerInfo.height*J.headerInfo.width,Ge=0,He=0,Xe=0,pt=J.pixels.resultMask,Ye=J.pixels.resultPixels;if(pt)if(Re>1){if(ie)for(Ge=0;Ge<Re;Ge++)for(Xe=Ge*Le,te=ge[Ge],He=0;He<Le;He++)pt[He]&&(Ye[Xe+He]=te);else for(He=0;He<Le;He++)if(pt[He])for(Xe=He*Re,Ge=0;Ge<Re;Ge++)Ye[Xe+Re]=ge[Ge]}else for(He=0;He<Le;He++)pt[He]&&(Ye[He]=te);else if(Re>1&&Qe!==te)if(ie)for(Ge=0;Ge<Re;Ge++)for(Xe=Ge*Le,te=ge[Ge],He=0;He<Le;He++)Ye[Xe+He]=te;else for(He=0;He<Le;He++)for(Xe=He*Re,Ge=0;Ge<Re;Ge++)Ye[Xe+Ge]=ge[Ge];else for(He=0;He<Le*Re;He++)Ye[He]=te},getDataTypeArray:function(J){var ie;switch(J){case 0:ie=Int8Array;break;case 1:ie=Uint8Array;break;case 2:ie=Int16Array;break;case 3:ie=Uint16Array;break;case 4:ie=Int32Array;break;case 5:ie=Uint32Array;break;case 6:default:ie=Float32Array;break;case 7:ie=Float64Array}return ie},getPixelType:function(J){var ie;switch(J){case 0:ie="S8";break;case 1:ie="U8";break;case 2:ie="S16";break;case 3:ie="U16";break;case 4:ie="S32";break;case 5:ie="U32";break;case 6:default:ie="F32";break;case 7:ie="F64"}return ie},isValidPixelValue:function(J,ie){if(null==ie)return!1;var te;switch(J){case 0:te=ie>=-128&&ie<=127;break;case 1:te=ie>=0&&ie<=255;break;case 2:te=ie>=-32768&&ie<=32767;break;case 3:te=ie>=0&&ie<=65536;break;case 4:te=ie>=-2147483648&&ie<=2147483647;break;case 5:te=ie>=0&&ie<=4294967296;break;case 6:te=ie>=-34027999387901484e22&&ie<=34027999387901484e22;break;case 7:te=ie>=-17976931348623157e292&&ie<=17976931348623157e292;break;default:te=!1}return te},getDataTypeSize:function(J){var ie=0;switch(J){case 0:case 1:ie=1;break;case 2:case 3:ie=2;break;
3case 4:case 5:case 6:ie=4;break;case 7:ie=8;break;default:ie=J}return ie},getDataTypeUsed:function(J,ie){var te=J;switch(J){case 2:case 4:te=J-ie;break;case 3:case 5:te=J-2*ie;break;case 6:te=0===ie?J:1===ie?2:1;break;case 7:te=0===ie?J:J-2*ie+1;break;default:te=J}return te},getOnePixel:function(J,ie,te,Qe){var ge=0;switch(te){case 0:ge=Qe.getInt8(ie);break;case 1:ge=Qe.getUint8(ie);break;case 2:ge=Qe.getInt16(ie,!0);break;case 3:ge=Qe.getUint16(ie,!0);break;case 4:ge=Qe.getInt32(ie,!0);break;case 5:ge=Qe.getUInt32(ie,!0);break;case 6:ge=Qe.getFloat32(ie,!0);break;case 7:ge=Qe.getFloat64(ie,!0);break;default:throw"the decoder does not understand this pixel type"}return ge},swapDimensionOrder:function(J,ie,te,Qe,ge){var Re=0,Le=0,Ge=0,He=0,Xe=J;if(te>1)if(Xe=new Qe(ie*te),ge)for(Re=0;Re<ie;Re++)for(He=Re,Ge=0;Ge<te;Ge++,He+=ie)Xe[He]=J[Le++];else for(Re=0;Re<ie;Re++)for(He=Re,Ge=0;Ge<te;Ge++,He+=ie)Xe[Le++]=J[He];return Xe}},Te=function(J,ie,te){this.val=J,this.left=ie,this.right=te};return{decode:function(J,ie){var te=(ie=ie||{}).noDataValue,Qe=0,ge={};if(ge.ptr=ie.inputOffset||0,ge.pixels={},ue.readHeaderInfo(J,ge)){var Re=ge.headerInfo,Le=Re.fileVersion,Ge=ue.getDataTypeArray(Re.imageType);if(Le>5)throw"unsupported lerc version 2."+Le;ue.readMask(J,ge),Re.numValidPixel===Re.width*Re.height||ge.pixels.resultMask||(ge.pixels.resultMask=ie.maskData);var He=Re.width*Re.height;ge.pixels.resultPixels=new Ge(He*Re.numDims),ge.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var Xe,pt=!ie.returnPixelInterleavedDims;if(0!==Re.numValidPixel)if(Re.zMax===Re.zMin)ue.constructConstantSurface(ge,pt);else if(Le>=4&&ue.checkMinMaxRanges(J,ge))ue.constructConstantSurface(ge,pt);else{var Ye=new DataView(J,ge.ptr,2),Ct=Ye.getUint8(0);if(ge.ptr++,Ct)ue.readDataOneSweep(J,ge,Ge,pt);else if(Le>1&&Re.imageType<=1&&Math.abs(Re.maxZError-.5)<1e-5){var gt=Ye.getUint8(1);if(ge.ptr++,ge.encodeMode=gt,gt>2||Le<4&&gt>1)throw"Invalid Huffman flag "+gt;gt?ue.readHuffman(J,ge,Ge,pt):ue.readTiles(J,ge,Ge,pt)}else ue.readTiles(J,ge,Ge,pt)}ge.eofOffset=ge.ptr,ie.inputOffset?(Xe=ge.headerInfo.blobSize+ie.inputOffset-ge.ptr,Math.abs(Xe)>=1&&(ge.eofOffset=ie.inputOffset+ge.headerInfo.blobSize)):(Xe=ge.headerInfo.blobSize-ge.ptr,Math.abs(Xe)>=1&&(ge.eofOffset=ge.headerInfo.blobSize));var ut={width:Re.width,height:Re.height,pixelData:ge.pixels.resultPixels,minValue:Re.zMin,maxValue:Re.zMax,validPixelCount:Re.numValidPixel,dimCount:Re.numDims,dimStats:{minValues:Re.minValues,maxValues:Re.maxValues},maskData:ge.pixels.resultMask};if(ge.pixels.resultMask&&ue.isValidPixelValue(Re.imageType,te)){var ct=ge.pixels.resultMask;for(Qe=0;Qe<He;Qe++)ct[Qe]||(ut.pixelData[Qe]=te);ut.noDataValue=te}return ge.noDataValue=te,ie.returnFileInfo&&(ut.fileInfo=ue.formatFileInfo(ge)),ut}},getBandCount:function(J){for(var ie=0,te=0,Qe={ptr:0,pixels:{}};te<J.byteLength-58;)ue.readHeaderInfo(J,Qe),ie++,Qe.ptr=te+=Qe.headerInfo.blobSize;return ie}}}(),le=(D=new ArrayBuffer(4),H=new Uint8Array(D),new Uint32Array(D)[0]=1,1===H[0]),ne={decode:function(N,ce){if(!le)throw"Big endian system is not supported.";var he,oe,Ue=(ce=ce||{}).inputOffset||0,ye=new Uint8Array(N,Ue,10),ue=String.fromCharCode.apply(null,ye);if("CntZImage"===ue.trim())he=F,oe=1;else{if("Lerc2"!==ue.substring(0,5))throw"Unexpected file identifier string: "+ue;he=V,oe=2}for(var Te,De,J,ie,te,Qe,ge=0,Re=N.byteLength-10,Le=[],Ge={width:0,height:0,pixels:[],pixelType:ce.pixelType,mask:null,statistics:[]},He=0;Ue<Re;){var Xe=he.decode(N,{inputOffset:Ue,encodedMaskData:Te,maskData:J,returnMask:0===ge,returnEncodedMask:0===ge,returnFileInfo:!0,returnPixelInterleavedDims:ce.returnPixelInterleavedDims,pixelType:ce.pixelType||null,noDataValue:ce.noDataValue||null});Ue=Xe.fileInfo.eofOffset,J=Xe.maskData,0===ge&&(Te=Xe.encodedMaskData,Ge.width=Xe.width,Ge.height=Xe.height,Ge.dimCount=Xe.dimCount||1,Ge.pixelType=Xe.pixelType||Xe.fileInfo.pixelType,Ge.mask=J),oe>1&&(J&&Le.push(J),Xe.fileInfo.mask&&Xe.fileInfo.mask.numBytes>0&&He++),ge++,Ge.pixels.push(Xe.pixelData),Ge.statistics.push({minValue:Xe.minValue,maxValue:Xe.maxValue,noDataValue:Xe.noDataValue,dimStats:Xe.dimStats})}if(oe>1&&He>1){for(Qe=Ge.width*Ge.height,Ge.bandMasks=Le,(J=new Uint8Array(Qe)).set(Le[0]),ie=1;ie<Le.length;ie++)for(De=Le[ie],te=0;te<Qe;te++)J[te]=J[te]&De[te];Ge.maskData=J}return Ge}};l.exports?l.exports=ne:this.Lerc=ne}()}(Bh);
3var Ch=dn(Bh.exports);let Uc,Za,sh;const cc={env:{emscripten_notify_memory_growth:function(l){sh=new Uint8Array(Za.exports.memory.buffer)}}},oh
vendor: 38,980 bytes, line 3
3="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IAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQh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ASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigC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C0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdB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IAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY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wOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",
3Gc=new class{init(){return Uc||(Uc=typeof fetch<"u"?fetch("data:application/wasm;base64,"+oh).then(l=>l.arrayBuffer()).then(l=>WebAssembly.instantiate(l,cc)).then(this._init):WebAssembly.instantiate(Buffer.from(oh,"base64"),cc).then(this._init),Uc)}_init(l){Za=l.instance,cc.env.emscripten_notify_memory_growth(0)}decode(l,p=0){if(!Za)throw new Error("ZSTDDecoder: Await .init() before decoding.");const h=l.byteLength,w=Za.exports.malloc(h);sh.set(l,w),p=p||Number(Za.exports.ZSTD_findDecompressedSize(w,h));const B=Za.exports.malloc(p),E=Za.exports.ZSTD_decompress(B,p,w,h),R=sh.slice(B,B+E);return Za.exports.free(w),Za.exports.free(B),R}};var hc=Object.freeze({__proto__:null,default:class extends Ga{constructor(l){super(),this.planarConfiguration=void 0!==l.PlanarConfiguration?l.PlanarConfiguration:1,this.samplesPerPixel=void 0!==l.SamplesPerPixel?l.SamplesPerPixel:1,this.addCompression=l.LercParameters[1]}decodeBlock(l){switch(this.addCompression){case 0:break;case 1:l=Tl(new Uint8Array(l)).buffer;break;case 2:l=Gc.decode(new Uint8Array(l)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return Ch.decode(l,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}},zstd:Gc}),ca=Object.freeze({__proto__:null,default:class extends Ga{constructor(){if(super(),typeof createImageBitmap>"u")throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if(typeof document>"u"&&typeof OffscreenCanvas>"u")throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}decode(l,p){return ht(function*(){const h=new Blob([p]),w=yield createImageBitmap(h);let B;typeof document<"u"?(B=document.createElement("canvas"),B.width=w.width,B.height=w.height):B=new OffscreenCanvas(w.width,w.height);const E=B.getContext("2d");return E.drawImage(w,0,0),E.getImageData(0,0,w.width,w.height).data.buffer})()}}}),Eh=Worker,lh=Object.freeze({__proto__:null,create:function(){const l='function A(A,e,t,i,r,I,g){try{var n=A[I](g),a=n.value}catch(A){return void t(A)}n.done?e(a):Promise.resolve(a).then(i,r)}function e(e){return function(){var t=this,i=arguments;return new Promise((function(r,I){var g=e.apply(t,i);function n(e){A(g,r,I,n,a,"next",e)}function a(e){A(g,r,I,n,a,"throw",e)}n(void 0)}))}}function t(A){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},t(A)}var i={exports:{}};!function(A){var e=function(A){var e,i=Object.prototype,r=i.hasOwnProperty,I="function"==typeof Symbol?Symbol:{},g=I.iterator||"@@iterator",n=I.asyncIterator||"@@asyncIterator",a=I.toStringTag||"@@toStringTag";function o(A,e,t){return Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),A[e]}try{o({},"")}catch(A){o=function(A,e,t){return A[e]=t}}function B(A,e,t,i){var r=e&&e.prototype instanceof h?e:h,I=Object.create(r.prototype),g=new S(i||[]);return I._invoke=function(A,e,t){var i=Q;return function(r,I){if(i===s)throw new Error("Generator is already running");if(i===f){if("throw"===r)throw I;return R()}for(t.method=r,t.arg=I;;){var g=t.delegate;if(g){var n=m(g,t);if(n){if(n===c)continue;return n}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(i===Q)throw i=f,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);i=s;var a=C(A,e,t);if("normal"===a.type){if(i=t.done?f:E,a.arg===c)continue;return{value:a.arg,done:t.done}}"throw"===a.type&&(i=f,t.method="throw",t.arg=a.arg)}}}(A,t,g),I}function C(A,e,t){try{return{type:"normal",arg:A.call(e,t)}}catch(A){return{type:"throw",arg:A}}}A.wrap=B;var Q="suspendedStart",E="suspendedYield",s="executing",f="completed",c={};function h(){}function l(){}function u(){}var w={};o(w,g,(function(){return this}));var d=Object.getPrototypeOf,D=d&&d(d(v([])));D&&D!==i&&r.call(D,g)&&(w=D);var y=u.prototype=h.prototype=Object.create(w);function k(A){["next","throw","return"].forEach((function(e){o(A,e,(function(A){return this._invoke(e,A)}))}
3))}function p(A,e){function i(I,g,n,a){var o=C(A[I],A,g);if("throw"!==o.type){var B=o.arg,Q=B.value;return Q&&"object"===t(Q)&&r.call(Q,"__await")?e.resolve(Q.__await).then((function(A){i("next",A,n,a)}),(function(A){i("throw",A,n,a)})):e.resolve(Q).then((function(A){B.value=A,n(B)}),(function(A){return i("throw",A,n,a)}))}a(o.arg)}var I;this._invoke=function(A,t){function r(){return new e((function(e,r){i(A,t,e,r)}))}return I=I?I.then(r,r):r()}}function m(A,t){var i=A.iterator[t.method];if(i===e){if(t.delegate=null,"throw"===t.method){if(A.iterator.return&&
vendor: 4,875 bytes, line 3
3(t.method="return",t.arg=e,m(A,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a \'throw\' method")}return c}var r=C(i,A.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var I=r.arg;return I?I.done?(t[A.resultName]=I.value,t.next=A.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,c):I:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function G(A){var e={tryLoc:A[0]};1 in A&&(e.catchLoc=A[1]),2 in A&&(e.finallyLoc=A[2],e.afterLoc=A[3]),this.tryEntries.push(e)}function F(A){var e=A.completion||{};e.type="normal",delete e.arg,A.completion=e}function S(A){this.tryEntries=[{tryLoc:"root"}],A.forEach(G,this),this.reset(!0)}function v(A){if(A){var t=A[g];if(t)return t.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length)){var i=-1,I=function t(){for(;++i<A.length;)if(r.call(A,i))return t.value=A[i],t.done=!1,t;return t.value=e,t.done=!0,t};return I.next=I}}return{next:R}}function R(){return{value:e,done:!0}}return l.prototype=u,o(y,"constructor",u),o(u,"constructor",l),l.displayName=o(u,a,"GeneratorFunction"),A.isGeneratorFunction=function(A){var e="function"==typeof A&&A.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},A.mark=function(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,u):(A.__proto__=u,o(A,a,"GeneratorFunction")),A.prototype=Object.create(y),A},A.awrap=function(A){return{__await:A}},k(p.prototype),o(p.prototype,n,(function(){return this})),A.AsyncIterator=p,A.async=function(e,t,i,r,I){void 0===I&&(I=Promise);var g=new p(B(e,t,i,r),I);return A.isGeneratorFunction(t)?g:g.next().then((function(A){return A.done?A.value:g.next()}))},k(y),o(y,a,"Generator"),o(y,g,(function(){return this})),o(y,"toString",(function(){return"[object Generator]"})),A.keys=function(A){var e=[];for(var t in A)e.push(t);return e.reverse(),function t(){for(;e.length;){var i=e.pop();if(i in A)return t.value=i,t.done=!1,t}return t.done=!0,t}},A.values=v,S.prototype={constructor:S,reset:function(A){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(F),!A)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var A=this.tryEntries[0].completion;if("throw"===A.type)throw A.arg;return this.rval},dispatchException:function(A){if(this.done)throw A;var t=this;function i(i,r){return n.type="throw",n.arg=A,t.next=i,r&&(t.method="next",t.arg=e),!!r}for(var I=this.tryEntries.length-1;I>=0;--I){var g=this.tryEntries[I],n=g.completion;if("root"===g.tryLoc)return i("end");if(g.tryLoc<=this.prev){var a=r.call(g,"catchLoc"),o=r.call(g,"finallyLoc");if(a&&o){if(this.prev<g.catchLoc)return i(g.catchLoc,!0);if(this.prev<g.finallyLoc)return i(g.finallyLoc)}else if(a){if(this.prev<g.catchLoc)return i(g.catchLoc,!0)}else{if(!o)throw new Error("try statement without catch or finally");if(this.prev<g.finallyLoc)return i(g.finallyLoc)}}}},abrupt:function(A,e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var I=i;break}}I&&("break"===A||"continue"===A)&&I.tryLoc<=e&&e<=I.finallyLoc&&(I=null);var g=I?I.completion:{};return g.type=A,g.arg=e,I?(this.method="next",this.next=I.finallyLoc,c):this.complete(g)},complete:function(A,e){if("throw"===A.type)throw A.arg;return"break"===A.type||"continue"===A.type?this.next=A.arg:"return"===A.type?(this.rval=this.arg=A.arg,this.method="return",this.next="end"):"normal"===A.type&&e&&(this.next=e),c},finish:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.finallyLoc===A)return this.complete(t.completion,t.afterLoc),F(t),c}},catch:function(A){for(var e=this.tryEntries.length-1;e>=0;--e){var t=this.tryEntries[e];if(t.tryLoc===A){var i=t.completion;if("throw"===i.type){var r=i.arg;F(t)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(A,t,i){return this.delegate={iterator:v(A),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=e),c}},A}(A.exports);try{regeneratorRuntime=e}catch(A){"object"===("undefined"==typeof globalThis?"undefined":t(globalThis))?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(i);var r=i.exports,I=new Map;function g(A,e){Array.isArray(A)||(A=[A]),A.forEach((function(A){return I.set(A,e)}))}function n(A){return a.apply(this,arguments)}function a(){return(a=e(r.mark((function A(e){var t,i;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:if(t=I.get(e.Compression)){A.next=3;break}throw new Error("Unknown compression method identifier: ".concat(e.Compression));case 3:return A.next=5,t();case 5:return i=A.sent,A.abrupt("return",new i(e));
3case 7:case"end":return A.stop()}}),A)})))).apply(this,arguments)}g([void 0,1],(function(){return Promise.resolve().then((function(){return y})).then((function(A){return A.default}))})),g(5,(function(){return Promise.resolve().then((function(){return F})).then((function(A){return A.default}))})),g(6,(function(){throw new Error("old style JPEG compression is not supported.")})),g(7,(function(){return Promise.resolve().then((function(){return N})).then((function(A){return A.default}))})),g([8,32946],(function(){return Promise.resolve().then((function(){return OA})).then((function(A){return A.default}))})),g(32773,(function(){return Promise.resolve().then((function(){return _A})).then((function(A){return A.default}))})),g(34887,(function(){return Promise.resolve().then((function(){return le})).then(function(){var A=e(r.mark((function A(e){return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,e.zstd.init();case 2:return A.abrupt("return",e);case 3:case"end":return A.stop()}}),A)})));return function(e){return A.apply(this,arguments)}}()).then((function(A){return A.default}))})),g(50001,(function(){return Promise.resolve().then((function(){return de})).then((function(A){return A.default}))}));var o=globalThis;function B(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function C(A,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(A,i.key,i)}}function Q(A,e,t){return e&&C(A.prototype,e),t&&C(A,t),A}function E(A,e){return E=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A},E(A,e)}function s(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&E(A,e)}function f(A,e){if(e&&("object"===t(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return A}(A)}function c(A){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},c(A)}function h(A,e){var t=A.length-e,i=0;do{for(var r=e;r>0;r--)A[i+e]+=A[i],i++;t-=e}while(t>0)}function l(A,e,t){for(var i=0,r=A.length,I=r/t;r>e;){for(var g=e;g>0;--g)A[i+e]+=A[i],++i;r-=e}for(var n=A.slice(),a=0;a<I;++a)for(var o=0;o<t;++o)A[t*a+o]=n[(t-o-1)*I+a]}function u(A,e,t,i,r,I){if(!e||1===e)return A;for(var g=0;g<r.length;++g){if(r[g]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(r[g]!==r[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var n=r[0]/8,a=2===I?1:r.length,o=0;o<i&&!(o*a*t*n>=A.byteLength);++o){var B=void 0;if(2===e){switch(r[0]){case 8:B=new Uint8Array(A,o*a*t*n,a*t*n);break;case 16:B=new Uint16Array(A,o*a*t*n,a*t*n/2);break;case 32:B=new Uint32Array(A,o*a*t*n,a*t*n/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(r[0]," bits per sample."))}h(B,a)}else 3===e&&l(B=new Uint8Array(A,o*a*t*n,a*t*n),a,n)}return A}o.addEventListener("message",function(){var A=e(r.mark((function A(e){var t,i,I,g,a,B;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return t=e.data,i=t.id,I=t.fileDirectory,g=t.buffer,A.next=3,n(I);case 3:return a=A.sent,A.next=6,a.decode(I,g);case 6:B=A.sent,o.postMessage({decoded:B,id:i},[B]);case 8:case"end":return A.stop()}}),A)})));return function(e){return A.apply(this,arguments)}}());var w=function(){function A(){B(this,A)}var t;return Q(A,[{key:"decode",value:(t=e(r.mark((function A(e,t){var i,I,g,n,a;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,this.decodeBlock(t);case 2:if(i=A.sent,1===(I=e.Predictor||1)){A.next=9;break}return g=!e.StripOffsets,n=g?e.TileWidth:e.ImageWidth,a=g?e.TileLength:e.RowsPerStrip||e.ImageLength,A.abrupt("return",u(i,I,n,a,e.BitsPerSample,e.PlanarConfiguration));case 9:return A.abrupt("return",i);
3case 10:case"end":return A.stop()}}),A,this)}))),function(A,e){return t.apply(this,arguments)})}]),A}();function d(A){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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var D=function(A){s(t,w);var e=d(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return A}}]),t}(),y=Object.freeze({__proto__:null,default:D});function k(A){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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}function p(A,e){for(var t=e.length-1;t>=0;t--)A.push(e[t]);return A}function m(A){for(var e=new Uint16Array(4093),t=new Uint8Array(4093),i=0;i<=257;i++)e[i]=4096,t[i]=i;var r=258,I=9,g=0;function n(){r=258,I=9}function a(A){var e=function(A,e,t){var i=e%8,r=Math.floor(e/8),I=8-i,g=e+t-8*(r+1),n=8*(r+2)-(e+t),a=8*(r+2)-e;if(n=Math.max(0,n),r>=A.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;var o=A[r]&Math.pow(2,8-i)-1,B=o<<=t-I;if(r+1<A.length){var C=A[r+1]>>>n;B+=C<<=Math.max(0,t-a)}if(g>8&&r+2<A.length){var Q=8*(r+3)-(e+t);B+=A[r+2]>>>Q}return B}(A,g,I);return g+=I,e}function o(A,i){return t[r]=i,e[r]=A,++r-1}function B(A){for(var i=[],r=A;4096!==r;r=e[r])i.push(t[r]);return i}var C=[];n();for(var Q,E=new Uint8Array(A),s=a(E);257!==s;){if(256===s){for(n(),s=a(E);256===s;)s=a(E);if(257===s)break;if(s>256)throw new Error("corrupted code at scanline ".concat(s));p(C,B(s)),Q=s}else if(s<r){var f=B(s);p(C,f),o(Q,f[f.length-1]),Q=s}else{var c=B(Q);if(!c)throw new Error("Bogus entry. Not in dictionary, ".concat(Q," / ").concat(r,", position: ").concat(g));p(C,c),C.push(c[c.length-1]),o(Q,c[c.length-1]),Q=s}r+1>=Math.pow(2,I)&&(12===I?Q=void 0:I++),s=a(E)}return new Uint8Array(C)}var G=function(A){s(t,w);var e=k(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return m(A).buffer}}]),t}(),F=Object.freeze({__proto__:null,default:G});function S(A){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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var v=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function R(A,e){for(var t=0,i=[],r=16;r>0&&!A[r-1];)--r;i.push({children:[],index:0});for(var I,g=i[0],n=0;n<r;n++){for(var a=0;a<A[n];a++){for((g=i.pop()).children[g.index]=e[t];g.index>0;)g=i.pop();for(g.index++,i.push(g);i.length<=n;)i.push(I={children:[],index:0}),g.children[g.index]=I.children,g=I;t++}n+1<r&&(i.push(I={children:[],index:0}),g.children[g.index]=I.children,g=I)}return i[0].children}function U(A,e,i,r,I,g,n,a,o){var B=i.mcusPerLine,C=i.progressive,Q=e,E=e,s=0,f=0;function c(){if(f>0)return f--,s>>f&1;if(255===(s=A[E++])){var e=A[E++];if(e)throw new Error("unexpected marker: ".concat((s<<8|e).toString(16)))}return f=7,s>>>7}function h(A){for(var e,i=A;null!==(e=c());){if("number"==typeof(i=i[e]))return i;if("object"!==t(i))throw new Error("invalid huffman sequence")}return null}function l(A){for(var e=A,t=0;e>0;){var i=c();if(null===i)return;t=t<<1|i,--e}return t}function u(A){var e=l(A);return e>=1<<A-1?e:e+(-1<<A)+1}var w=0;var d,D=0;function y(A,e,t,i,r){var I=t%B,g=(t/B|0)*A.v+i,n=I*A.h+r;e(A,A.blocks[g][n])}function k(A,e,t){var i=t/A.blocksPerLine|0,r=t%A.blocksPerLine;e(A,A.blocks[i][r])}var p,m,G,F,S,R,U=r.length;R=C?0===g?0===a?function(A,e){var t=h(A.huffmanTableDC),i=0===t?0:u(t)<<o;A.pred+=i,e[0]=A.pred}:function(A,e){e[0]|=c()<<o}:0===a?function(A,e){if(w>0)w--;else for(var t=g,i=n;t<=i;){var r=h(A.huffmanTableAC),I=15&r,a=r>>4;if(0===I){if(a<15){w=l(a)+(1<<a)-1;break}t+=16}else e[v[t+=a]]=u(I)*(1<<o),t++}}:function(A,e){for(var t=g,i=n,r=0;t<=i;){var I=v[t],a=e[I]<0?-1:1;switch(D){case 0:var B=h(A.huffmanTableAC),C=15&B;if(r=B>>4,0===C)r<15?(w=l(r)+(1<<r),D=4):(r=16,D=1);else{if(1!==C)throw new Error("invalid ACn encoding");d=u(C),D=r?2:3}continue;case 1:case 2:e[I]?e[I]+=(c()<<o)*a:0==--r&&(D=2===D?3:0);break;
3case 3:e[I]?e[I]+=(c()<<o)*a:(e[I]=d<<o,D=0);break;case 4:e[I]&&(e[I]+=(c()<<o)*a)}t++}4===D&&0==--w&&(D=0)}:function(A,e){var t=h(A.huffmanTableDC),i=0===t?0:u(t);A.pred+=i,e[0]=A.pred;for(var r=1;r<64;){var I=h(A.huffmanTableAC),g=15&I,n=I>>4;if(0===g){if(n<15)break;r+=16}else e[v[r+=n]]=u(g),r++}};var L,b,M=0;b=1===U?r[0].blocksPerLine*r[0].blocksPerColumn:B*i.mcusPerColumn;for(var N=I||b;M<b;){for(m=0;m<U;m++)r[m].pred=0;if(w=0,1===U)for(p=r[0],S=0;S<N;S++)k(p,R,M),M++;else for(S=0;S<N;S++){for(m=0;m<U;m++){var x=p=r[m],J=x.h,q=x.v;for(G=0;G<q;G++)for(F=0;F<J;F++)y(p,R,M,G,F)}if(++M===b)break}if(f=0,(L=A[E]<<8|A[E+1])<65280)throw new Error("marker was not found");if(!(L>=65488&&L<=65495))break;E+=2}return E-Q}function L(A,e){var t=[],i=e.blocksPerLine,r=e.blocksPerColumn,I=i<<3,g=new Int32Array(64),n=new Uint8Array(64);function a(A,t,i){var r,I,g,n,a,o,B,C,Q,E,s=e.quantizationTable,f=i;for(E=0;E<64;E++)f[E]=A[E]*s[E];for(E=0;E<8;++E){var c=8*E;0!==f[1+c]||0!==f[2+c]||0!==f[3+c]||0!==f[4+c]||0!==f[5+c]||0!==f[6+c]||0!==f[7+c]?(r=5793*f[0+c]+128>>8,I=5793*f[4+c]+128>>8,g=f[2+c],n=f[6+c],a=2896*(f[1+c]-f[7+c])+128>>8,C=2896*(f[1+c]+f[7+c])+128>>8,o=f[3+c]<<4,Q=r-I+1>>1,r=r+I+1>>1,I=Q,Q=3784*g+1567*n+128>>8,g=1567*g-3784*n+128>>8,n=Q,Q=a-(B=f[5+c]<<4)+1>>1,a=a+B+1>>1,B=Q,Q=C+o+1>>1,o=C-o+1>>1,C=Q,Q=r-n+1>>1,r=r+n+1>>1,n=Q,Q=I-g+1>>1,I=I+g+1>>1,g=Q,Q=2276*a+3406*C+2048>>12,a=3406*a-2276*C+2048>>12,C=Q,Q=799*o+4017*B+2048>>12,o=4017*o-799*B+2048>>12,B=Q,f[0+c]=r+C,f[7+c]=r-C,f[1+c]=I+B,f[6+c]=I-B,f[2+c]=g+o,f[5+c]=g-o,f[3+c]=n+a,f[4+c]=n-a):(Q=5793*f[0+c]+512>>10,f[0+c]=Q,f[1+c]=Q,f[2+c]=Q,f[3+c]=Q,f[4+c]=Q,f[5+c]=Q,f[6+c]=Q,f[7+c]=Q)}for(E=0;E<8;++E){var h=E;0!==f[8+h]||0!==f[16+h]||0!==f[24+h]||0!==f[32+h]||0!==f[40+h]||0!==f[48+h]||0!==f[56+h]?(r=5793*f[0+h]+2048>>12,I=5793*f[32+h]+2048>>12,g=f[16+h],n=f[48+h],a=2896*(f[8+h]-f[56+h])+2048>>12,C=2896*(f[8+h]+f[56+h])+2048>>12,o=f[24+h],Q=r-I+1>>1,r=r+I+1>>1,I=Q,Q=3784*g+1567*n+2048>>12,g=1567*g-3784*n+2048>>12,n=Q,Q=a-(B=f[40+h])+1>>1,a=a+B+1>>1,B=Q,Q=C+o+1>>1,o=C-o+1>>1,C=Q,Q=r-n+1>>1,r=r+n+1>>1,n=Q,Q=I-g+1>>1,I=I+g+1>>1,g=Q,Q=2276*a+3406*C+2048>>12,a=3406*a-2276*C+2048>>12,C=Q,Q=799*o+4017*B+2048>>12,o=4017*o-799*B+2048>>12,B=Q,f[0+h]=r+C,f[56+h]=r-C,f[8+h]=I+B,f[48+h]=I-B,f[16+h]=g+o,f[40+h]=g-o,f[24+h]=n+a,f[32+h]=n-a):(Q=5793*i[E+0]+8192>>14,f[0+h]=Q,f[8+h]=Q,f[16+h]=Q,f[24+h]=Q,f[32+h]=Q,f[40+h]=Q,f[48+h]=Q,f[56+h]=Q)}for(E=0;E<64;++E){var l=128+(f[E]+8>>4);t[E]=l<0?0:l>255?255:l}}for(var o=0;o<r;o++){for(var B=o<<3,C=0;C<8;C++)t.push(new Uint8Array(I));for(var Q=0;Q<i;Q++){a(e.blocks[o][Q],n,g);for(var E=0,s=Q<<3,f=0;f<8;f++)for(var c=t[B+f],h=0;h<8;h++)c[s+h]=n[E++]}}return t}var b=function(){function A(){B(this,A),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return Q(A,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(A){var e=0;function t(){var t=A[e]<<8|A[e+1];return e+=2,t}function i(A){var e,t,i=0,r=0;for(t in A.components)A.components.hasOwnProperty(t)&&(i<(e=A.components[t]).h&&(i=e.h),r<e.v&&(r=e.v));var I=Math.ceil(A.samplesPerLine/8/i),g=Math.ceil(A.scanLines/8/r);for(t in A.components)if(A.components.hasOwnProperty(t)){e=A.components[t];for(var n=Math.ceil(Math.ceil(A.samplesPerLine/8)*e.h/i),a=Math.ceil(Math.ceil(A.scanLines/8)*e.v/r),o=I*e.h,B=g*e.v,C=[],Q=0;Q<B;Q++){for(var E=[],s=0;s<o;s++)E.push(new Int32Array(64));C.push(E)}e.blocksPerLine=n,e.blocksPerColumn=a,e.blocks=C}A.maxH=i,A.maxV=r,A.mcusPerLine=I,A.mcusPerColumn=g}var r,I,g=t();if(65496!==g)throw new Error("SOI not found");for(g=t();65497!==g;){switch(g){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var n=(r=void 0,I=void 0,r=t(),I=A.subarray(e,e+r-2),e+=I.length,I);65504===g&&74===n[0]&&70===n[1]&&73===n[2]&&70===n[3]&&0===n[4]&&(this.jfif={version:{major:n[5],minor:n[6]},densityUnits:n[7],xDensity:n[8]<<8|n[9],yDensity:n[10]<<8|n[11],thumbWidth:n[12],thumbHe
3ight:n[13],thumbData:n.subarray(14,14+3*n[12]*n[13])}),65518===g&&65===n[0]&&100===n[1]&&111===n[2]&&98===n[3]&&101===n[4]&&0===n[5]&&(this.adobe={version:n[6],flags0:n[7]<<8|n[8],flags1:n[9]<<8|n[10],transformCode:n[11]});break;case 65499:for(var a=t()+e-2;e<a;){var o=A[e++],B=new Int32Array(64);if(o>>4==0)for(var C=0;C<64;C++){B[v[C]]=A[e++]}else{if(o>>4!=1)throw new Error("DQT: invalid table spec");for(var Q=0;Q<64;Q++){B[v[Q]]=t()}}this.quantizationTables[15&o]=B}break;case 65472:case 65473:case 65474:t();for(var E={extended:65473===g,progressive:65474===g,precision:A[e++],scanLines:t(),samplesPerLine:t(),components:{},componentsOrder:[]},s=A[e++],f=void 0,c=0;c<s;c++){f=A[e];var h=A[e+1]>>4,l=15&A[e+1],u=A[e+2];E.componentsOrder.push(f),E.components[f]={h:h,v:l,quantizationIdx:u},e+=3}i(E),this.frames.push(E);break;case 65476:for(var w=t(),d=2;d<w;){for(var D=A[e++],y=new Uint8Array(16),k=0,p=0;p<16;p++,e++)y[p]=A[e],k+=y[p];for(var m=new Uint8Array(k),G=0;G<k;G++,e++)m[G]=A[e];d+=17+k,D>>4==0?this.huffmanTablesDC[15&D]=R(y,m):this.huffmanTablesAC[15&D]=R(y,m)}break;case 65501:t(),this.resetInterval=t();break;case 65498:t();for(var F=A[e++],S=[],L=this.frames[0],b=0;b<F;b++){var M=L.components[A[e++]],N=A[e++];M.huffmanTableDC=this.huffmanTablesDC[N>>4],M.huffmanTableAC=this.huffmanTablesAC[15&N],S.push(M)}var x=A[e++],J=A[e++],q=A[e++],Y=U(A,e,L,S,this.resetInterval,x,J,q>>4,15&q);e+=Y;break;case 65535:255!==A[e]&&e--;break;default:if(255===A[e-3]&&A[e-2]>=192&&A[e-2]<=254){e-=3;break}throw new Error("unknown JPEG marker ".concat(g.toString(16)))}g=t()}}},{key:"getResult",value:function(){var A=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var e=0;e<this.frames.length;e++)for(var t=this.frames[e].components,i=0,r=Object.keys(t);i<r.length;i++){var I=r[i];t[I].quantizationTable=this.quantizationTables[t[I].quantizationIdx],delete t[I].quantizationIdx}for(var g=A[0],n=g.components,a=g.componentsOrder,o=[],B=g.samplesPerLine,C=g.scanLines,Q=0;Q<a.length;Q++){var E=n[a[Q]];o.push({lines:L(0,E),scaleX:E.h/g.maxH,scaleY:E.v/g.maxV})}for(var s=new Uint8Array(B*C*o.length),f=0,c=0;c<C;++c)for(var h=0;h<B;++h)for(var l=0;l<o.length;++l){var u=o[l];s[f]=u.lines[0|c*u.scaleY][0|h*u.scaleX],++f}return s}}]),A}(),M=function(A){s(t,w);var e=S(t);function t(A){var i;return B(this,t),(i=e.call(this)).reader=new b,A.JPEGTables&&i.reader.parse(A.JPEGTables),i}return Q(t,[{key:"decodeBlock",value:function(A){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(A)),this.reader.getResult().buffer}}]),t}(),N=Object.freeze({__proto__:null,default:M});function x(A){for(var e=A.length;--e>=0;)A[e]=0}x(new Array(576)),x(new Array(60)),x(new Array(512)),x(new Array(256)),x(new Array(29)),x(new Array(30));var J=function(A,e,t,i){for(var r=65535&A|0,I=A>>>16&65535|0,g=0;0!==t;){t-=g=t>2e3?2e3:t;do{I=I+(r=r+e[i++]|0)|0}while(--g);r%=65521,I%=65521}return r|I<<16|0},q=new Uint32Array(function(){for(var A,e=[],t=0;t<256;t++){A=t;for(var i=0;i<8;i++)A=1&A?3988292384^A>>>1:A>>>1;e[t]=A}return e}()),Y=function(A,e,t,i){var r=q,I=i+t;A^=-1;for(var g=i;g<I;g++)A=A>>>8^r[255&(A^e[g])];return-1^A},K={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},H={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},O=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},P=function(A){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!==t(i))throw new TypeError(i+"must be non-object");for(var r in i)O(i,r)&&(A[r]=i[r])}}return A},T=function(A){for(var e=0,t=0,i=A.length;t<i;t++)e+=A[t].length;
vendor: 14,228 bytes, line 3
3for(var r=new Uint8Array(e),I=0,g=0,n=A.length;I<n;I++){var a=A[I];r.set(a,g),g+=a.length}return r},V=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(A){V=!1}for(var _=new Uint8Array(256),X=0;X<256;X++)_[X]=X>=252?6:X>=248?5:X>=240?4:X>=224?3:X>=192?2:1;_[254]=_[254]=1;var Z=function(A){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(A);var e,t,i,r,I,g=A.length,n=0;for(r=0;r<g;r++)55296==(64512&(t=A.charCodeAt(r)))&&r+1<g&&56320==(64512&(i=A.charCodeAt(r+1)))&&(t=65536+(t-55296<<10)+(i-56320),r++),n+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(n),I=0,r=0;I<n;r++)55296==(64512&(t=A.charCodeAt(r)))&&r+1<g&&56320==(64512&(i=A.charCodeAt(r+1)))&&(t=65536+(t-55296<<10)+(i-56320),r++),t<128?e[I++]=t:t<2048?(e[I++]=192|t>>>6,e[I++]=128|63&t):t<65536?(e[I++]=224|t>>>12,e[I++]=128|t>>>6&63,e[I++]=128|63&t):(e[I++]=240|t>>>18,e[I++]=128|t>>>12&63,e[I++]=128|t>>>6&63,e[I++]=128|63&t);return e},j=function(A,e){var t,i,r=e||A.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(A.subarray(0,e));var I=new Array(2*r);for(i=0,t=0;t<r;){var g=A[t++];if(g<128)I[i++]=g;else{var n=_[g];if(n>4)I[i++]=65533,t+=n-1;else{for(g&=2===n?31:3===n?15:7;n>1&&t<r;)g=g<<6|63&A[t++],n--;n>1?I[i++]=65533:g<65536?I[i++]=g:(g-=65536,I[i++]=55296|g>>10&1023,I[i++]=56320|1023&g)}}}return function(A,e){if(e<65534&&A.subarray&&V)return String.fromCharCode.apply(null,A.length===e?A:A.subarray(0,e));for(var t="",i=0;i<e;i++)t+=String.fromCharCode(A[i]);return t}(I,i)},W=function(A,e){(e=e||A.length)>A.length&&(e=A.length);for(var t=e-1;t>=0&&128==(192&A[t]);)t--;return t<0||0===t?e:t+_[A[t]]>e?t:e};var z=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},$=function(A,e){var t,i,r,I,g,n,a,o,B,C,Q,E,s,f,c,h,l,u,w,d,D,y,k,p,m=A.state;t=A.next_in,k=A.input,i=t+(A.avail_in-5),r=A.next_out,p=A.output,I=r-(e-A.avail_out),g=r+(A.avail_out-257),n=m.dmax,a=m.wsize,o=m.whave,B=m.wnext,C=m.window,Q=m.hold,E=m.bits,s=m.lencode,f=m.distcode,c=(1<<m.lenbits)-1,h=(1<<m.distbits)-1;A:do{E<15&&(Q+=k[t++]<<E,E+=8,Q+=k[t++]<<E,E+=8),l=s[Q&c];e:for(;;){if(Q>>>=u=l>>>24,E-=u,0===(u=l>>>16&255))p[r++]=65535&l;else{if(!(16&u)){if(0==(64&u)){l=s[(65535&l)+(Q&(1<<u)-1)];continue e}if(32&u){m.mode=12;break A}A.msg="invalid literal/length code",m.mode=30;break A}w=65535&l,(u&=15)&&(E<u&&(Q+=k[t++]<<E,E+=8),w+=Q&(1<<u)-1,Q>>>=u,E-=u),E<15&&(Q+=k[t++]<<E,E+=8,Q+=k[t++]<<E,E+=8),l=f[Q&h];t:for(;;){if(Q>>>=u=l>>>24,E-=u,!(16&(u=l>>>16&255))){if(0==(64&u)){l=f[(65535&l)+(Q&(1<<u)-1)];continue t}A.msg="invalid distance code",m.mode=30;break A}if(d=65535&l,E<(u&=15)&&(Q+=k[t++]<<E,(E+=8)<u&&(Q+=k[t++]<<E,E+=8)),(d+=Q&(1<<u)-1)>n){A.msg="invalid distance too far back",m.mode=30;break A}if(Q>>>=u,E-=u,d>(u=r-I)){if((u=d-u)>o&&m.sane){A.msg="invalid distance too far back",m.mode=30;break A}if(D=0,y=C,0===B){if(D+=a-u,u<w){w-=u;do{p[r++]=C[D++]}while(--u);D=r-d,y=p}}else if(B<u){if(D+=a+B-u,(u-=B)<w){w-=u;do{p[r++]=C[D++]}while(--u);if(D=0,B<w){w-=u=B;do{p[r++]=C[D++]}while(--u);D=r-d,y=p}}}else if(D+=B-u,u<w){w-=u;do{p[r++]=C[D++]}while(--u);D=r-d,y=p}for(;w>2;)p[r++]=y[D++],p[r++]=y[D++],p[r++]=y[D++],w-=3;w&&(p[r++]=y[D++],w>1&&(p[r++]=y[D++]))}else{D=r-d;do{p[r++]=p[D++],p[r++]=p[D++],p[r++]=p[D++],w-=3}while(w>2);w&&(p[r++]=p[D++],w>1&&(p[r++]=p[D++]))}break}}break}}while(t<i&&r<g);t-=w=E>>3,Q&=(1<<(E-=w<<3))-1,A.next_in=t,A.next_out=r,A.avail_in=t<i?i-t+5:5-(t-i),A.avail_out=r<g?g-r+257:257-(r-g),m.hold=Q,m.bits=E},AA=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),eA=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),tA=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),iA=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),rA=function(A,e,t,i,r,I,g,n){var a,o,B,C,Q,E,s,f,c,h=n.bits,l=0,u=0,w=0,d=0,D=0,y=0,k=0,p=0,m=0,G=0,F=null,S=0,v=new Uint16Array(16),R=new Uint16Array(16),U=null,L=0;for(l=0;l<=15;l++)v[l]=0;for(u=0;u<i;u++)v[e[t+u]]++;for(D=h,d=15;d>=1&&0===v[d];d--);if(D>d&&(D=d),0===d)return r[I++]=20971520,r[I++]=20971520,n.bits=1,0;for(w=1;w<d&&0===v[w];w++);for(D<w&&(D=w),p=1,l=1;l<=15;l++)if(p<<=1,(p-=v[l])<0)return-1;if(p>0&&(0===A||1!==d))return-1;for(R[1]=0,l=1;l<15;l++)R[l+1]=R[l]+v[l];for(u=0;u<i;u++)0!==e[t+u]&&(g[R[e[t+u]]++]=u);if(0===A?(F=U=g,E=19):1===A?(F=AA,S-=257,U=eA,L-=257,E=256):(F=tA,U=iA,E=-1),G=0,u=0,l=w,Q=I,y=D,k=0,B=-1,C=(m=1<<D)-1,1===A&&m>852||2===A&&m>592)return 1;for(;;){s=l-k,g[u]<E?(f=0,c=g[u]):g[u]>E?(f=U[L+g[u]],c=F[S+g[u]]):(f=96,c=0),a=1<<l-k,w=o=1<<y;do{r[Q+(G>>k)+(o-=a)]=s<<24|f<<16|c|0}while(0!==o);for(a=1<<l-1;G&a;)a>>=1;if(0!==a?(G&=a-1,G+=a):G=0,u++,0==--v[l]){if(l===d)break;l=e[t+g[u]]}if(l>D&&(G&C)!==B){for(0===k&&(k=D),Q+=w,p=1<<(y=l-k);y+k<d&&!((p-=v[y+k])<=0);)y++,p<<=1;if(m+=1<<y,1===A&&m>852||2===A&&m>592)return 1;r[B=G&C]=D<<24|y<<16|Q-I|0}}return 0!==G&&(r[Q+G]=l-k<<24|64<<16|0),n.bits=D,0},IA=H.Z_FINISH,gA=H.Z_BLOCK,nA=H.Z_TREES,aA=H.Z_OK,oA=H.Z_STREAM_END,BA=H.Z_NEED_DICT,CA=H.Z_STREAM_ERROR,QA=H.Z_DATA_ERROR,EA=H.Z_MEM_ERROR,sA=H.Z_BUF_ERROR,fA=H.Z_DEFLATED,cA=function(A){return(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24)};function hA(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var lA,uA,wA=function(A){if(!A||!A.state)return CA;var e=A.state;return A.total_in=A.total_out=e.total=0,A.msg="",e.wrap&&(A.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,aA},dA=function(A){if(!A||!A.state)return CA;var e=A.state;return e.wsize=0,e.whave=0,e.wnext=0,wA(A)},DA=function(A,e){var t;if(!A||!A.state)return CA;var i=A.state;return e<0?(t=0,e=-e):(t=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?CA:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,dA(A))},yA=function(A,e){if(!A)return CA;var t=new hA;A.state=t,t.window=null;var i=DA(A,e);return i!==aA&&(A.state=null),i},kA=!0,pA=function(A){if(kA){lA=new Int32Array(512),uA=new Int32Array(32);for(var e=0;e<144;)A.lens[e++]=8;for(;e<256;)A.lens[e++]=9;for(;e<280;)A.lens[e++]=7;for(;e<288;)A.lens[e++]=8;for(rA(1,A.lens,0,288,lA,0,A.work,{bits:9}),e=0;e<32;)A.lens[e++]=5;rA(2,A.lens,0,32,uA,0,A.work,{bits:5}),kA=!1}A.lencode=lA,A.lenbits=9,A.distcode=uA,A.distbits=5},mA=function(A,e,t,i){var r,I=A.state;return null===I.window&&(I.wsize=1<<I.wbits,I.wnext=0,I.whave=0,I.window=new Uint8Array(I.wsize)),i>=I.wsize?(I.window.set(e.subarray(t-I.wsize,t),0),I.wnext=0,I.whave=I.wsize):((r=I.wsize-I.wnext)>i&&(r=i),I.window.set(e.subarray(t-i,t-i+r),I.wnext),(i-=r)?(I.window.set(e.subarray(t-i,t),0),I.wnext=i,I.whave=I.wsize):(I.wnext+=r,I.wnext===I.wsize&&(I.wnext=0),I.whave<I.wsize&&(I.whave+=r))),0},GA={inflateReset:dA,inflateReset2:DA,inflateResetKeep:wA,inflateInit:function(A){return yA(A,15)},inflateInit2:yA,inflate:function(A,e){var t,i,r,I,g,n,a,o,B,C,Q,E,s,f,c,h,l,u,w,d,D,y,k,p,m=0,G=new Uint8Array(4),F=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!A||!A.state||!A.output||!A.input&&0!==A.avail_in)return CA;12===(t=A.state).mode&&(t.mode=13),g=A.next_out,r=A.output,a=A.avail_out,I=A.next_in,i=A.input,n=A.avail_in,o=t.hold,B=t.bits,C=n,Q=a,y=aA;A:for(;;)switch(t.mode){case 1:if(0===t.wrap){t.mode=13;break}for(;B<16;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(2&t.wrap&&35615===o){t.check=0,G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0),o=0,B=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&o)<<8)+(o>>8))%31){A.msg="incorrect header check",t.mode=30;break}if((15&o)!==fA){A.msg="unknown compression method",t.mode=30;break}if(B-=4,D=8+(15&(o>>>=4)),0===t.wbits)t.wbits=D;else if(D>t.wbits){A.msg="invalid window size",t.mode=30;break}t.dmax=1<<t.wbits,A.adler=t.check=1,t.mode=512&o?10:12,o=0,B=0;break;case 2:for(;B<16;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(t.flags=o,(255&t.flags)!==fA){A.msg="unknown compression method",t.mode=30;break}if(57344&t.flags){A.msg="unknown header flags set",t.mode=30;break}t.head&&(t.head.text=o>>8&1),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0,t.mode=3;case 3:for(;B<32;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.head&&(t.head.time=o),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,G[2]=o>>>16&255,G[3]=o>>>24&255,t.check=Y(t.check,G,4,0)),o=0,B=0,t.mode=4;case 4:for(;B<16;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.head&&(t.head.xflags=255&o,t.head.os=o>>8),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0,t.mode=5;case 5:if(1024&t.flags){for(;B<16;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.length=o,t.head&&(t.head.extra_len=o),512&t.flags&&(G[0]=255&o,G[1]=o>>>8&255,t.check=Y(t.check,G,2,0)),o=0,B=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&((E=t.length)>n&&(E=n),E&&(t.head&&(D=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(I,I+E),D)),512&t.flags&&(t.check=Y(t.check,i,E,I)),n-=E,I+=E,t.length-=E),t.length))break A;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(0===n)break A;E=0;do{D=i[I+E++],t.head&&D&&t.length<65536&&(t.head.name+=String.fromCharCode(D))}while(D&&E<n);if(512&t.flags&&(t.check=Y(t.check,i,E,I)),n-=E,I+=E,D)break A}else t.head&&(t.head.name=null);t.length=0,t.mode=8;case 8:if(4096&t.flags){if(0===n)break A;E=0;do{D=i[I+E++],t.head&&D&&t.length<65536&&(t.head.comment+=String.fromCharCode(D))}while(D&&E<n);if(512&t.flags&&(t.check=Y(t.check,i,E,I)),n-=E,I+=E,D)break A}else t.head&&(t.head.comment=null);t.mode=9;case 9:if(512&t.flags){for(;B<16;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(o!==(65535&t.check)){A.msg="header crc mismatch",t.mode=30;break}o=0,B=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),A.adler=t.check=0,t.mode=12;break;case 10:for(;B<32;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}A.adler=t.check=cA(o),o=0,B=0,t.mode=11;case 11:if(0===t.havedict)return A.next_out=g,A.avail_out=a,A.next_in=I,A.avail_in=n,t.hold=o,t.bits=B,BA;A.adler=t.check=1,t.mode=12;case 12:if(e===gA||e===nA)break A;case 13:if(t.last){o>>>=7&B,B-=7&B,t.mode=27;break}for(;B<3;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}switch(t.last=1&o,B-=1,3&(o>>>=1)){case 0:t.mode=14;break;case 1:if(pA(t),t.mode=20,e===nA){o>>>=2,B-=2;break A}break;case 2:t.mode=17;break;case 3:A.msg="invalid block type",t.mode=30}o>>>=2,B-=2;break;case 14:for(o>>>=7&B,B-=7&B;B<32;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if((65535&o)!=(o>>>16^65535)){A.msg="invalid stored block lengths",t.mode=30;break}if(t.length=65535&o,o=0,B=0,t.mode=15,e===nA)break A;case 15:t.mode=16;case 16:if(E=t.length){if(E>n&&(E=n),E>a&&(E=a),0===E)break A;r.set(i.subarray(I,I+E),g),n-=E,I+=E,a-=E,g+=E,t.length-=E;break}t.mode=12;break;case 17:for(;B<14;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(t.nlen=257+(31&o),o>>>=5,B-=5,t.ndist=1+(31&o),o>>>=5,B-=5,t.ncode=4+(15&o),o>>>=4,B-=4,t.nlen>286||t.ndist>30){A.msg="too many length or distance symbols",t.mode=30;break}t.have=0,t.mode=18;case 18:for(;t.have<t.ncode;){for(;B<3;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.lens[F[t.have++]]=7&o,o>>>=3,B-=3}for(;t.have<19;)t.lens[F[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,k={bits:t.lenbits},y=rA(0,t.lens,0,19,t.lencode,0,t.work,k),t.lenbits=k.bits,y){A.msg="invalid code lengths set",t.mode=30;break}t.have=0,t.mode=19;case 19:for(;t.have<t.nlen+t.ndist;){for(;h=(m=t.lencode[o&(1<<t.lenbits)-1])>>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(l<16)o>>>=c,B-=c,t.lens[t.have++]=l;else{if(16===l){for(p=c+2;B<p;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(o>>>=c,B-=c,0===t.have){A.msg="invalid bit length repeat",t.mode=30;break}D=t.lens[t.have-1],E=3+(3&o),o>>>=2,B-=2}else if(17===l){for(p=c+3;B<p;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}B-=c,D=0,E=3+(7&(o>>>=c)),o>>>=3,B-=3}else{for(p=c+7;B<p;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}B-=c,D=0,E=11+(127&(o>>>=c)),o>>>=7,B-=7}if(t.have+E>t.nlen+t.ndist){A.msg="invalid bit length repeat",t.mode=30;break}for(;E--;)t.lens[t.have++]=D}}if(30===t.mode)break;if(0===t.lens[256]){A.msg="invalid code -- missing end-of-block",t.mode=30;break}if(t.lenbits=9,k={bits:t.lenbits},y=rA(1,t.lens,0,t.nlen,t.lencode,0,t.work,k),t.lenbits=k.bits,y){A.msg="invalid literal/lengths set",t.mode=30;break}if(t.distbits=6,t.distcode=t.distdyn,k={bits:t.distbits},y=rA(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,k),t.distbits=k.bits,y){A.msg="invalid distances set",t.mode=30;break}if(t.mode=20,e===nA)break A;case 20:t.mode=21;case 21:if(n>=6&&a>=258){A.next_out=g,A.avail_out=a,A.next_in=I,A.avail_in=n,t.hold=o,t.bits=B,$(A,Q),g=A.next_out,r=A.output,a=A.avail_out,I=A.next_in,i=A.input,n=A.avail_in,o=t.hold,B=t.bits,12===t.mode&&(t.back=-1);break}for(t.back=0;h=(m=t.lencode[o&(1<<t.lenbits)-1])>>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(h&&0==(240&h)){for(u=c,w=h,d=l;h=(m=t.lencode[d+((o&(1<<u+w)-1)>>u)])>>>16&255,l=65535&m,!(u+(c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}o>>>=u,B-=u,t.back+=u}if(o>>>=c,B-=c,t.back+=c,t.length=l,0===h){t.mode=26;break}if(32&h){t.back=-1,t.mode=12;break}if(64&h){A.msg="invalid literal/length code",t.mode=30;break}t.extra=15&h,t.mode=22;case 22:if(t.extra){for(p=t.extra;B<p;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.length+=o&(1<<t.extra)-1,o>>>=t.extra,B-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;
3h=(m=t.distcode[o&(1<<t.distbits)-1])>>>16&255,l=65535&m,!((c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(0==(240&h)){for(u=c,w=h,d=l;h=(m=t.distcode[d+((o&(1<<u+w)-1)>>u)])>>>16&255,l=65535&m,!(u+(c=m>>>24)<=B);){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}o>>>=u,B-=u,t.back+=u}if(o>>>=c,B-=c,t.back+=c,64&h){A.msg="invalid distance code",t.mode=30;break}t.offset=l,t.extra=15&h,t.mode=24;case 24:if(t.extra){for(p=t.extra;B<p;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}t.offset+=o&(1<<t.extra)-1,o>>>=t.extra,B-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){A.msg="invalid distance too far back",t.mode=30;break}t.mode=25;case 25:if(0===a)break A;if(E=Q-a,t.offset>E){if((E=t.offset-E)>t.whave&&t.sane){A.msg="invalid distance too far back",t.mode=30;break}E>t.wnext?(E-=t.wnext,s=t.wsize-E):s=t.wnext-E,E>t.length&&(E=t.length),f=t.window}else f=r,s=g-t.offset,E=t.length;E>a&&(E=a),a-=E,t.length-=E;do{r[g++]=f[s++]}while(--E);0===t.length&&(t.mode=21);break;case 26:if(0===a)break A;r[g++]=t.length,a--,t.mode=21;break;case 27:if(t.wrap){for(;B<32;){if(0===n)break A;n--,o|=i[I++]<<B,B+=8}if(Q-=a,A.total_out+=Q,t.total+=Q,Q&&(A.adler=t.check=t.flags?Y(t.check,r,Q,g-Q):J(t.check,r,Q,g-Q)),Q=a,(t.flags?o:cA(o))!==t.check){A.msg="incorrect data check",t.mode=30;break}o=0,B=0}t.mode=28;case 28:if(t.wrap&&t.flags){for(;B<32;){if(0===n)break A;n--,o+=i[I++]<<B,B+=8}if(o!==(4294967295&t.total)){A.msg="incorrect length check",t.mode=30;break}o=0,B=0}t.mode=29;case 29:y=oA;break A;case 30:y=QA;break A;case 31:return EA;default:return CA}return A.next_out=g,A.avail_out=a,A.next_in=I,A.avail_in=n,t.hold=o,t.bits=B,(t.wsize||Q!==A.avail_out&&t.mode<30&&(t.mode<27||e!==IA))&&mA(A,A.output,A.next_out,Q-A.avail_out),C-=A.avail_in,Q-=A.avail_out,A.total_in+=C,A.total_out+=Q,t.total+=Q,t.wrap&&Q&&(A.adler=t.check=t.flags?Y(t.check,r,Q,A.next_out-Q):J(t.check,r,Q,A.next_out-Q)),A.data_type=t.bits+(t.last?64:0)+(12===t.mode?128:0)+(20===t.mode||15===t.mode?256:0),(0===C&&0===Q||e===IA)&&y===aA&&(y=sA),y},inflateEnd:function(A){if(!A||!A.state)return CA;var e=A.state;return e.window&&(e.window=null),A.state=null,aA},inflateGetHeader:function(A,e){if(!A||!A.state)return CA;var t=A.state;return 0==(2&t.wrap)?CA:(t.head=e,e.done=!1,aA)},inflateSetDictionary:function(A,e){var t,i=e.length;return A&&A.state?0!==(t=A.state).wrap&&11!==t.mode?CA:11===t.mode&&J(1,e,i,0)!==t.check?QA:mA(A,e,i,i)?(t.mode=31,EA):(t.havedict=1,aA):CA},inflateInfo:"pako inflate (from Nodeca project)"};var FA=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},SA=Object.prototype.toString,vA=H.Z_NO_FLUSH,RA=H.Z_FINISH,UA=H.Z_OK,LA=H.Z_STREAM_END,bA=H.Z_NEED_DICT,MA=H.Z_STREAM_ERROR,NA=H.Z_DATA_ERROR,xA=H.Z_MEM_ERROR;function JA(A){this.options=P({chunkSize:65536,windowBits:15,to:""},A||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||A&&A.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new z,this.strm.avail_out=0;var t=GA.inflateInit2(this.strm,e.windowBits);if(t!==UA)throw new Error(K[t]);if(this.header=new FA,GA.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Z(e.dictionary):"[object ArrayBuffer]"===SA.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=GA.inflateSetDictionary(this.strm,e.dictionary))!==UA))throw new Error(K[t])}function qA(A,e){var t=new JA(e);if(t.push(A),t.err)throw t.msg||K[t.err];return t.result}JA.prototype.push=function(A,e){var t,i,r,I=this.strm,g=this.options.chunkSize,n=this.options.dictionary;if(this.ended)return!1;for(i=e===~~e?e:!0===e?RA:vA,"[object ArrayBuffer]"===SA.call(A)?I.input=new Uint8Array(A):I.input=A,I.next_in=0,I.avail_in=I.input.length;;){for(0===I.avail_out&&(I.output=new Uint8Array(g),I.next_out=0,I.avail_out=g),(t=GA.inflate(I,i))===bA&&n&&((t=GA.inflateSetDictionary(I,n))===UA?t=GA.inflate(I,i):t===NA&&(t=bA));I.avail_in>0&&t===LA&&I.state.wrap>0&&0!==A[I.next_in];)GA.inflateReset(I),t=GA.inflate(I,i);switch(t){case MA:case NA:case bA:case xA:return this.onEnd(t),this.ended=!0,!1}if(r=I.avail_out,I.next_out&&(0===I.avail_out||t===LA))if("string"===this.options.to){var a=W(I.output,I.next_out),o=I.next_out-a,B=j(I.output,a);I.next_out=o,I.avail_out=g-o,o&&I.output.set(I.output.subarray(a,a+o),0),this.onData(B)}else this.onData(I.output.length===I.next_out?I.output:I.output.subarray(0,I.next_out));if(t!==UA||0!==r){if(t===LA)return t=GA.inflateEnd(this.strm),this.onEnd(t),this.ended=!0,!0;if(0===I.avail_in)break}}return!0},JA.prototype.onData=function(A){this.chunks.push(A)},JA.prototype.onEnd=function(A){A===UA&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=T(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var YA={Inflate:JA,inflate:qA,inflateRaw:function(A,e){return(e=e||{}).raw=!0,qA(A,e)},ungzip:qA,constants:H}.inflate;function KA(A){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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var HA=function(A){s(t,w);var e=KA(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){return YA(new Uint8Array(A)).buffer}}]),t}(),OA=Object.freeze({__proto__:null,default:HA});function PA(A){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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var TA,VA=function(A){s(t,w);var e=PA(t);function t(){return B(this,t),e.apply(this,arguments)}return Q(t,[{key:"decodeBlock",value:function(A){for(var e=new DataView(A),t=[],i=0;i<A.byteLength;++i){var r=e.getInt8(i);if(r<0){var I=e.getUint8(i+1);r=-r;for(var g=0;g<=r;++g)t.push(I);i+=1}else{for(var n=0;n<=r;++n)t.push(e.getUint8(i+n+1));i+=r+1}}return new Uint8Array(t).buffer}}]),t}(),_A=Object.freeze({__proto__:null,default:VA}),XA={exports:{}};TA=XA,\n/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License");
3 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 @preserve */\nfunction(){var A,e,t,i,r,I,g,n,a,o,B,C,Q,E,s,f,c=(A={defaultNoDataValue:-34027999387901484e22,decode:function(I,g){var n=(g=g||{}).encodedMaskData||null===g.encodedMaskData,a=r(I,g.inputOffset||0,n),o=null!==g.noDataValue?g.noDataValue:A.defaultNoDataValue,B=e(a,g.pixelType||Float32Array,g.encodedMaskData,o,g.returnMask),C={width:a.width,height:a.height,pixelData:B.resultPixels,minValue:B.minValue,maxValue:a.pixels.maxValue,noDataValue:o};return B.resultMask&&(C.maskData=B.resultMask),g.returnEncodedMask&&a.mask&&(C.encodedMaskData=a.mask.bitset?a.mask.bitset:null),g.returnFileInfo&&(C.fileInfo=t(a),g.computeUsedBitDepths&&(C.fileInfo.bitDepths=i(a))),C}},e=function(A,e,t,i,r){var g,n,a,o=0,B=A.pixels.numBlocksX,C=A.pixels.numBlocksY,Q=Math.floor(A.width/B),E=Math.floor(A.height/C),s=2*A.maxZError,f=Number.MAX_VALUE;t=t||(A.mask?A.mask.bitset:null),n=new e(A.width*A.height),r&&t&&(a=new Uint8Array(A.width*A.height));for(var c,h,l=new Float32Array(Q*E),u=0;u<=C;u++){var w=u!==C?E:A.height%C;if(0!==w)for(var d=0;d<=B;d++){var D=d!==B?Q:A.width%B;if(0!==D){var y,k,p,m,G=u*A.width*E+d*Q,F=A.width-D,S=A.pixels.blocks[o];if(S.encoding<2?(0===S.encoding?y=S.rawData:(I(S.stuffedData,S.bitsPerPixel,S.numValidPixels,S.offset,s,l,A.pixels.maxValue),y=l),k=0):p=2===S.encoding?0:S.offset,t)for(h=0;h<w;h++){for(7&G&&(m=t[G>>3],m<<=7&G),c=0;c<D;c++)7&G||(m=t[G>>3]),128&m?(a&&(a[G]=1),f=f>(g=S.encoding<2?y[k++]:p)?g:f,n[G++]=g):(a&&(a[G]=0),n[G++]=i),m<<=1;G+=F}else if(S.encoding<2)for(h=0;h<w;h++){for(c=0;c<D;c++)f=f>(g=y[k++])?g:f,n[G++]=g;G+=F}else for(f=f>p?p:f,h=0;h<w;h++){for(c=0;c<D;c++)n[G++]=p;G+=F}if(1===S.encoding&&k!==S.numValidPixels)throw"Block and Mask do not match";o++}}}return{resultPixels:n,resultMask:a,minValue:f}},t=function(A){return{fileIdentifierString:A.fileIdentifierString,fileVersion:A.fileVersion,imageType:A.imageType,height:A.height,width:A.width,maxZError:A.maxZError,eofOffset:A.eofOffset,mask:A.mask?{numBlocksX:A.mask.numBlocksX,numBlocksY:A.mask.numBlocksY,numBytes:A.mask.numBytes,maxValue:A.mask.maxValue}:null,pixels:{numBlocksX:A.pixels.numBlocksX,numBlocksY:A.pixels.numBlocksY,numBytes:A.pixels.numBytes,maxValue:A.pixels.maxValue,noDataValue:A.noDataValue}}},i=function(A){for(var e=A.pixels.numBlocksX*A.pixels.numBlocksY,t={},i=0;i<e;i++){var r=A.pixels.blocks[i];0===r.encoding?t.float32=!0:1===r.encoding?t[r.bitsPerPixel]=!0:t[0]=!0}return Object.keys(t)},r=function(A,e,t){var i={},r=new Uint8Array(A,e,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,r),"CntZImage"!==i.fileIdentifierString.trim())throw"Unexpected file identifier string: "+i.fileIdentifierString;e+=10;var I=new DataView(A,e,24);if(i.fileVersion=I.getInt32(0,!0),i.imageType=I.getInt32(4,!0),i.height=I.getUint32(8,!0),i.width=I.getUint32(12,!0),i.maxZError=I.getFloat64(16,!0),e+=24,!t)if(I=new DataView(A,e,16),i.mask={},i.mask.numBlocksY=I.getUint32(0,!0),i.mask.numBlocksX=I.getUint32(4,!0),i.mask.numBytes=I.getUint32(8,!0),i.mask.maxValue=I.getFloat32(12,!0),e+=16,i.mask.numBytes>0){var g=new Uint8Array(Math.ceil(i.width*i.height/8)),n=(I=new DataView(A,e,i.mask.numBytes)).getInt16(0,!0),a=2,o=0;do{if(n>0)for(;n--;)g[o++]=I.getUint8(a++);else{var B=I.getUint8(a++);for(n=-n;n--;)g[o++]=B}n=I.getInt16(a,!0),a+=2}while(a<i.mask.numBytes);if(-32768!==n||o<g.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=g,e+=i.mask.numBytes}else 0==(i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue)&&(i.mask.bitset=new Uint8Array(Math.ceil(i.width*i.height/8)));I=new DataView(A,e,16),i.pixels={},i.pixels.numBlocksY=I.getUint32(0,!0),i.pixels.numBlocksX=I.getUint32(4,!0),i.pixels.numBytes=I.getUint32(8,!0),i.pixels.maxValue=I.getFloat32(12,!0),e+=16;var C=i.pixels.numBlocksX,Q=i.pixels.numBlocksY,E=C+(i.width%C>0?1:0),s=Q+(i.height%Q>0?1:0);i.pixels.blocks=new Array(E*s);for(var f=0,c=0;c<s;c++)for(var h=0;h<E;h++){var l=0,u=A.byteLength-e;I=new DataView(A,e,Math.min(10,u));var w={};i.pixels.blocks[f++]=w;var d=I.getUint8(0);if(l++,w.encoding=63&d,w.encoding>3)throw"Invalid block encoding ("+w.encoding+")";if(2!==w.encoding){if(0!==d&&2!==d){if(d>>=6,w.offsetType=d,2===d)w.offset=I.getInt8(1),l++;else if(1===d)w.offset=I.getInt16(1,!0),l+=2;else{if(0!==d)throw"Invalid block offset type";w.offset=I.getFloat32(1,!0),l+=4}if(1===w.encoding)if(d=I.getUint8(l),l++,w.bitsPerPixel=63&d,d>>=6,w.numValidPixelsType=d,2===d)w.numValidPixels=I.getUint8(l),l++;else if(1===d)w.numValidPixels=I.getUint16(l,!0),l+=2;else{if(0!==d)throw"Invalid valid pixel count type";w.numValidPixels=I.getUint32(l,!0),l+=4}}var D;if(e+=l,3!==w.encoding)if(0===w.encoding){var y=(i.pixels.numBytes-1)/4;
3if(y!==Math.floor(y))throw"uncompressed block has invalid length";D=new ArrayBuffer(4*y),new Uint8Array(D).set(new Uint8Array(A,e,4*y));var k=new Float32Array(D);w.rawData=k,e+=4*y}else if(1===w.encoding){var p=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),m=Math.ceil(p/4);D=new ArrayBuffer(4*m),new Uint8Array(D).set(new Uint8Array(A,e,p)),w.stuffedData=new Uint32Array(D),e+=p}}else e++}return i.eofOffset=e,i},I=function(A,e,t,i,r,I,g){var n,a,o,B=(1<<e)-1,C=0,Q=0,E=Math.ceil((g-i)/r),s=4*A.length-Math.ceil(e*t/8);for(A[A.length-1]<<=8*s,n=0;n<t;n++){if(0===Q&&(o=A[C++],Q=32),Q>=e)a=o>>>Q-e&B,Q-=e;else{var f=e-Q;a=(o&B)<<f&B,a+=(o=A[C++])>>>(Q=32-f)}I[n]=a<E?i+a*r:g}return I},A),h=(g=function(A,e,t,i,r,I,g,n){var a,o,B,C,Q,E=(1<<t)-1,s=0,f=0,c=4*A.length-Math.ceil(t*i/8);if(A[A.length-1]<<=8*c,r)for(a=0;a<i;a++)0===f&&(B=A[s++],f=32),f>=t?(o=B>>>f-t&E,f-=t):(o=(B&E)<<(C=t-f)&E,o+=(B=A[s++])>>>(f=32-C)),e[a]=r[o];else for(Q=Math.ceil((n-I)/g),a=0;a<i;a++)0===f&&(B=A[s++],f=32),f>=t?(o=B>>>f-t&E,f-=t):(o=(B&E)<<(C=t-f)&E,o+=(B=A[s++])>>>(f=32-C)),e[a]=o<Q?I+o*g:n},n=function(A,e,t,i,r,I){var g,n=(1<<e)-1,a=0,o=0,B=0,C=0,Q=0,E=[],s=4*A.length-Math.ceil(e*t/8);A[A.length-1]<<=8*s;var f=Math.ceil((I-i)/r);for(o=0;o<t;o++)0===C&&(g=A[a++],C=32),C>=e?(Q=g>>>C-e&n,C-=e):(Q=(g&n)<<(B=e-C)&n,Q+=(g=A[a++])>>>(C=32-B)),E[o]=Q<f?i+Q*r:I;return E.unshift(i),E},a=function(A,e,t,i,r,I,g,n){var a,o,B,C,Q=(1<<t)-1,E=0,s=0,f=0;if(r)for(a=0;a<i;a++)0===s&&(B=A[E++],s=32,f=0),s>=t?(o=B>>>f&Q,s-=t,f+=t):(o=B>>>f&Q,s=32-(C=t-s),o|=((B=A[E++])&(1<<C)-1)<<t-C,f=C),e[a]=r[o];else{var c=Math.ceil((n-I)/g);for(a=0;a<i;a++)0===s&&(B=A[E++],s=32,f=0),s>=t?(o=B>>>f&Q,s-=t,f+=t):(o=B>>>f&Q,s=32-(C=t-s),o|=((B=A[E++])&(1<<C)-1)<<t-C,f=C),e[a]=o<c?I+o*g:n}return e},o=function(A,e,t,i,r,I){var g,n=(1<<e)-1,a=0,o=0,B=0,C=0,Q=0,E=0,s=[],f=Math.ceil((I-i)/r);for(o=0;o<t;o++)0===C&&(g=A[a++],C=32,E=0),C>=e?(Q=g>>>E&n,C-=e,E+=e):(Q=g>>>E&n,C=32-(B=e-C),Q|=((g=A[a++])&(1<<B)-1)<<e-B,E=B),s[o]=Q<f?i+Q*r:I;return s.unshift(i),s},B=function(A,e,t,i){var r,I,g,n,a=(1<<t)-1,o=0,B=0,C=4*A.length-Math.ceil(t*i/8);for(A[A.length-1]<<=8*C,r=0;r<i;r++)0===B&&(g=A[o++],B=32),B>=t?(I=g>>>B-t&a,B-=t):(I=(g&a)<<(n=t-B)&a,I+=(g=A[o++])>>>(B=32-n)),e[r]=I;return e},C=function(A,e,t,i){var r,I,g,n,a=(1<<t)-1,o=0,B=0,C=0;for(r=0;r<i;r++)0===B&&(g=A[o++],B=32,C=0),B>=t?(I=g>>>C&a,B-=t,C+=t):(I=g>>>C&a,B=32-(n=t-B),I|=((g=A[o++])&(1<<n)-1)<<t-n,C=n),e[r]=I;return e},Q={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(A){for(var e=65535,t=65535,i=A.length,r=Math.floor(i/2),I=0;r;){var g=r>=359?359:r;r-=g;do{e+=A[I++]<<8,t+=e+=A[I++]}while(--g);e=(65535&e)+(e>>>16),t=(65535&t)+(t>>>16)}return 1&i&&(t+=e+=A[I]<<8),((t=(65535&t)+(t>>>16))<<16|(e=(65535&e)+(e>>>16)))>>>0},readHeaderInfo:function(A,e){var t=e.ptr,i=new Uint8Array(A,t,6),r={};if(r.fileIdentifierString=String.fromCharCode.apply(null,i),0!==r.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+r.fileIdentifierString;t+=6;var I,g=new DataView(A,t,8),n=g.getInt32(0,!0);if(r.fileVersion=n,t+=4,n>=3&&(r.checksum=g.getUint32(4,!0),t+=4),g=new DataView(A,t,12),r.height=g.getUint32(0,!0),r.width=g.getUint32(4,!0),t+=8,n>=4?(r.numDims=g.getUint32(8,!0),t+=4):r.numDims=1,g=new DataView(A,t,40),r.numValidPixel=g.getUint32(0,!0),r.microBlockSize=g.getInt32(4,!0),r.blobSize=g.getInt32(8,!0),r.imageType=g.getInt32(12,!0),r.maxZError=g.getFloat64(16,!0),r.zMin=g.getFloat64(24,!0),r.zMax=g.getFloat64(32,!0),t+=40,e.headerInfo=r,e.ptr=t,n>=3&&(I=n>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(A,t-I,r.blobSize-14))!==r.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(A,e){var t=e.headerInfo,i=this.getDataTypeArray(t.imageType),r=t.numDims*this.getDataTypeSize(t.imageType),I=this.readSubArray(A,e.ptr,i,r),g=this.readSubArray(A,e.ptr+r,i,r);e.ptr+=2*r;var n,a=!0;for(n=0;n<t.numDims;n++)if(I[n]!==g[n]){a=!1;break}return t.minValues=I,t.maxValues=g,a},readSubArray:function(A,e,t,i){var r;if(t===Uint8Array)r=new Uint8Array(A,e,i);else{var I=new ArrayBuffer(i);new Uint8Array(I).set(new Uint8Array(A,e,i)),r=new t(I)}return r},readMask:function(A,e){var t,i,r=e.ptr,I=e.headerInfo,g=I.width*I.height,n=I.numValidPixel,a=new DataView(A,r,4),o={};if(o.numBytes=a.getUint32(0,!0),r+=4,(0===n||g===n)&&0!==o.numBytes)throw"invalid mask";if(0===n)t=new Uint8Array(Math.ceil(g/8)),o.bitset=t,i=new Uint8Array(g),e.pixels.resultMask=i,r+=o.numBytes;else if(o.numBytes>0){t=new Uint8Array(Math.ceil(g/8));var B=(a=new DataView(A,r,o.numBytes)).getInt16(0,!0),C=2,Q=0,E=0;do{if(B>0)for(;B--;)t[Q++]=a.getUint8(C++);else for(E=a.getUint8(C++),B=-B;B--;)t[Q++]=E;B=a.getInt16(C,!0),C+=2}while(C<o.numBytes);if(-32768!==B||Q<t.length)throw"Unexpected end of mask RLE encoding";i=new Uint8Array(g);var s=0,f=0;for(f=0;f<g;f++)7&f?(s=t[f>>3],s<<=7&f):s=t[f>>3],128&s&&(i[f]=1);e.pixels.resultMask=i,o.bitset=t,r+=o.numBytes}return e.ptr=r,e.mask=o,!0},readDataOneSweep:function(A,e,t,i){var r,I=e.ptr,g=e.headerInfo,n=g.numDims,a=g.width*g.height,o=g.imageType,B=g.numValidPixel*Q.getDataTypeSize(o)*n,C=e.pixels.resultMask;if(t===Uint8Array)r=new Uint8Array(A,I,B);
3else{var E=new ArrayBuffer(B);new Uint8Array(E).set(new Uint8Array(A,I,B)),r=new t(E)}if(r.length===a*n)e.pixels.resultPixels=i?Q.swapDimensionOrder(r,a,n,t,!0):r;else{e.pixels.resultPixels=new t(a*n);var s=0,f=0,c=0,h=0;if(n>1){if(i){for(f=0;f<a;f++)if(C[f])for(h=f,c=0;c<n;c++,h+=a)e.pixels.resultPixels[h]=r[s++]}else for(f=0;f<a;f++)if(C[f])for(h=f*n,c=0;c<n;c++)e.pixels.resultPixels[h+c]=r[s++]}else for(f=0;f<a;f++)C[f]&&(e.pixels.resultPixels[f]=r[s++])}return I+=B,e.ptr=I,!0},readHuffmanTree:function(A,e){var t=this.HUFFMAN_LUT_BITS_MAX,i=new DataView(A,e.ptr,16);if(e.ptr+=16,i.getInt32(0,!0)<2)throw"unsupported Huffman version";var r=i.getInt32(4,!0),I=i.getInt32(8,!0),g=i.getInt32(12,!0);if(I>=g)return!1;var n=new Uint32Array(g-I);Q.decodeBits(A,e,n);var a,o,B,C,s=[];for(a=I;a<g;a++)s[o=a-(a<r?0:r)]={first:n[a-I],second:null};var f=A.byteLength-e.ptr,c=Math.ceil(f/4),h=new ArrayBuffer(4*c);new Uint8Array(h).set(new Uint8Array(A,e.ptr,f));var l,u=new Uint32Array(h),w=0,d=0;for(l=u[0],a=I;a<g;a++)(C=s[o=a-(a<r?0:r)].first)>0&&(s[o].second=l<<w>>>32-C,32-w>=C?32===(w+=C)&&(w=0,l=u[++d]):(w+=C-32,l=u[++d],s[o].second|=l>>>32-w));var D=0,y=0,k=new E;for(a=0;a<s.length;a++)void 0!==s[a]&&(D=Math.max(D,s[a].first));y=D>=t?t:D;var p,m,G,F,S,v=[];for(a=I;a<g;a++)if((C=s[o=a-(a<r?0:r)].first)>0)if(p=[C,o],C<=y)for(m=s[o].second<<y-C,G=1<<y-C,B=0;B<G;B++)v[m|B]=p;else for(m=s[o].second,S=k,F=C-1;F>=0;F--)m>>>F&1?(S.right||(S.right=new E),S=S.right):(S.left||(S.left=new E),S=S.left),0!==F||S.val||(S.val=p[1]);return{decodeLut:v,numBitsLUTQick:y,numBitsLUT:D,tree:k,stuffedData:u,srcPtr:d,bitPos:w}},readHuffman:function(A,e,t,i){var r,I,g,n,a,o,B,C,E,s=e.headerInfo.numDims,f=e.headerInfo.height,c=e.headerInfo.width,h=c*f,l=this.readHuffmanTree(A,e),u=l.decodeLut,w=l.tree,d=l.stuffedData,D=l.srcPtr,y=l.bitPos,k=l.numBitsLUTQick,p=l.numBitsLUT,m=0===e.headerInfo.imageType?128:0,G=e.pixels.resultMask,F=0;y>0&&(D++,y=0);var S,v=d[D],R=1===e.encodeMode,U=new t(h*s),L=U;if(s<2||R){for(S=0;S<s;S++)if(s>1&&(L=new t(U.buffer,h*S,h),F=0),e.headerInfo.numValidPixel===c*f)for(C=0,o=0;o<f;o++)for(B=0;B<c;B++,C++){if(I=0,a=n=v<<y>>>32-k,32-y<k&&(a=n|=d[D+1]>>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<<y>>>32-p,32-y<p&&(a=n|=d[D+1]>>>64-y-p),r=w,E=0;E<p;E++)if(!(r=n>>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,R?(g+=B>0?F:o>0?L[C-c]:F,g&=255,L[C]=g,F=g):L[C]=g}else for(C=0,o=0;o<f;o++)for(B=0;B<c;B++,C++)if(G[C]){if(I=0,a=n=v<<y>>>32-k,32-y<k&&(a=n|=d[D+1]>>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<<y>>>32-p,32-y<p&&(a=n|=d[D+1]>>>64-y-p),r=w,E=0;E<p;E++)if(!(r=n>>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,R?(B>0&&G[C-1]?g+=F:o>0&&G[C-c]?g+=L[C-c]:g+=F,g&=255,L[C]=g,F=g):L[C]=g}}else for(C=0,o=0;o<f;o++)for(B=0;B<c;B++)if(C=o*c+B,!G||G[C])for(S=0;S<s;S++,C+=h){if(I=0,a=n=v<<y>>>32-k,32-y<k&&(a=n|=d[D+1]>>>64-y-k),u[a])I=u[a][1],y+=u[a][0];else for(a=n=v<<y>>>32-p,32-y<p&&(a=n|=d[D+1]>>>64-y-p),r=w,E=0;E<p;E++)if(!(r=n>>>p-E-1&1?r.right:r.left).left&&!r.right){I=r.val,y=y+E+1;break}y>=32&&(y-=32,v=d[++D]),g=I-m,L[C]=g}e.ptr=e.ptr+4*(D+1)+(y>0?4:0),e.pixels.resultPixels=U,s>1&&!i&&(e.pixels.resultPixels=Q.swapDimensionOrder(U,h,s,t))},decodeBits:function(A,e,t,i,r){var I=e.headerInfo,Q=I.fileVersion,E=0,s=A.byteLength-e.ptr>=5?5:A.byteLength-e.ptr,f=new DataView(A,e.ptr,s),c=f.getUint8(0);E++;var h=c>>6,l=0===h?4:3-h,u=(32&c)>0,w=31&c,d=0;if(1===l)d=f.getUint8(E),E++;else if(2===l)d=f.getUint16(E,!0),E+=2;else{if(4!==l)throw"Invalid valid pixel count type";d=f.getUint32(E,!0),E+=4}var D,y,k,p,m,G,F,S,v,R=2*I.maxZError,U=I.numDims>1?I.maxValues[r]:I.zMax;if(u){for(e.counter.lut++,S=f.getUint8(E),E++,p=Math.ceil((S-1)*w/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),k=new Uint8Array(y),e.ptr+=E,k.set(new Uint8Array(A,e.ptr,p)),F=new Uint32Array(y),e.ptr+=p,v=0;S-1>>>v;)v++;p=Math.ceil(d*v/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),(k=new Uint8Array(y)).set(new Uint8Array(A,e.ptr,p)),D=new Uint32Array(y),e.ptr+=p,G=Q>=3?o(F,w,S-1,i,R,U):n(F,w,S-1,i,R,U),Q>=3?a(D,t,v,d,G):g(D,t,v,d,G)}else e.counter.bitstuffer++,v=w,e.ptr+=E,v>0&&(p=Math.ceil(d*v/8),m=Math.ceil(p/4),y=new ArrayBuffer(4*m),(k=new Uint8Array(y)).set(new Uint8Array(A,e.ptr,p)),D=new Uint32Array(y),e.ptr+=p,Q>=3?null==i?C(D,t,v,d):a(D,t,v,d,!1,i,R,U):null==i?B(D,t,v,d):g(D,t,v,d,!1,i,R,U))},readTiles:function(A,e,t,i){var r=e.headerInfo,I=r.width,g=r.height,n=I*g,a=r.microBlockSize,o=r.imageType,B=Q.getDataTypeSize(o),C=Math.ceil(I/a),E=Math.ceil(g/a);
3e.pixels.numBlocksY=E,e.pixels.numBlocksX=C,e.pixels.ptr=0;var s,f,c,h,l,u,w,d,D,y,k=0,p=0,m=0,G=0,F=0,S=0,v=0,R=0,U=0,L=0,b=0,M=0,N=0,x=0,J=0,q=new t(a*a),Y=g%a||a,K=I%a||a,H=r.numDims,O=e.pixels.resultMask,P=e.pixels.resultPixels,T=r.fileVersion>=5?14:15,V=r.zMax;for(m=0;m<E;m++)for(F=m!==E-1?a:Y,G=0;G<C;G++)for(L=m*I*a+G*a,b=I-(S=G!==C-1?a:K),d=0;d<H;d++){if(H>1?(y=P,L=m*I*a+G*a,P=new t(e.pixels.resultPixels.buffer,n*d*B,n),V=r.maxValues[d]):y=null,v=A.byteLength-e.ptr,f={},J=0,R=(s=new DataView(A,e.ptr,Math.min(10,v))).getUint8(0),J++,D=r.fileVersion>=5?4&R:0,U=R>>6&255,(R>>2&T)!=(G*a>>3&T))throw"integrity issue";if(D&&0===d)throw"integrity issue";if((l=3&R)>3)throw e.ptr+=J,"Invalid block encoding ("+l+")";if(2!==l)if(0===l){if(D)throw"integrity issue";if(e.counter.uncompressed++,e.ptr+=J,M=(M=F*S*B)<(N=A.byteLength-e.ptr)?M:N,c=new ArrayBuffer(M%B==0?M:M+B-M%B),new Uint8Array(c).set(new Uint8Array(A,e.ptr,M)),h=new t(c),x=0,O)for(k=0;k<F;k++){for(p=0;p<S;p++)O[L]&&(P[L]=h[x++]),L++;L+=b}else for(k=0;k<F;k++){for(p=0;p<S;p++)P[L++]=h[x++];L+=b}e.ptr+=x*B}else if(u=Q.getDataTypeUsed(D&&o<6?4:o,U),w=Q.getOnePixel(f,J,u,s),J+=Q.getDataTypeSize(u),3===l)if(e.ptr+=J,e.counter.constantoffset++,O)for(k=0;k<F;k++){for(p=0;p<S;p++)O[L]&&(P[L]=D?Math.min(V,y[L]+w):w),L++;L+=b}else for(k=0;k<F;k++){for(p=0;p<S;p++)P[L]=D?Math.min(V,y[L]+w):w,L++;L+=b}else if(e.ptr+=J,Q.decodeBits(A,e,q,w,d),J=0,D)if(O)for(k=0;k<F;k++){for(p=0;p<S;p++)O[L]&&(P[L]=q[J++]+y[L]),L++;L+=b}else for(k=0;k<F;k++){for(p=0;p<S;p++)P[L]=q[J++]+y[L],L++;L+=b}else if(O)for(k=0;k<F;k++){for(p=0;p<S;p++)O[L]&&(P[L]=q[J++]),L++;L+=b}else for(k=0;k<F;k++){for(p=0;p<S;p++)P[L++]=q[J++];L+=b}else{if(D)if(O)for(k=0;k<F;k++)for(p=0;p<S;p++)O[L]&&(P[L]=y[L]),L++;else for(k=0;k<F;k++)for(p=0;p<S;p++)P[L]=y[L],L++;e.counter.constant++,e.ptr+=J}}H>1&&!i&&(e.pixels.resultPixels=Q.swapDimensionOrder(e.pixels.resultPixels,n,H,t))},formatFileInfo:function(A){return{fileIdentifierString:A.headerInfo.fileIdentifierString,fileVersion:A.headerInfo.fileVersion,imageType:A.headerInfo.imageType,height:A.headerInfo.height,width:A.headerInfo.width,numValidPixel:A.headerInfo.numValidPixel,microBlockSize:A.headerInfo.microBlockSize,blobSize:A.headerInfo.blobSize,maxZError:A.headerInfo.maxZError,pixelType:Q.getPixelType(A.headerInfo.imageType),eofOffset:A.eofOffset,mask:A.mask?{numBytes:A.mask.numBytes}:null,pixels:{numBlocksX:A.pixels.numBlocksX,numBlocksY:A.pixels.numBlocksY,maxValue:A.headerInfo.zMax,minValue:A.headerInfo.zMin,noDataValue:A.noDataValue}}},constructConstantSurface:function(A,e){var t=A.headerInfo.zMax,i=A.headerInfo.zMin,r=A.headerInfo.maxValues,I=A.headerInfo.numDims,g=A.headerInfo.height*A.headerInfo.width,n=0,a=0,o=0,B=A.pixels.resultMask,C=A.pixels.resultPixels;if(B)if(I>1){if(e)for(n=0;n<I;n++)for(o=n*g,t=r[n],a=0;a<g;a++)B[a]&&(C[o+a]=t);else for(a=0;a<g;a++)if(B[a])for(o=a*I,n=0;n<I;n++)C[o+I]=r[n]}else for(a=0;a<g;a++)B[a]&&(C[a]=t);else if(I>1&&i!==t)if(e)for(n=0;n<I;n++)for(o=n*g,t=r[n],a=0;a<g;a++)C[o+a]=t;else for(a=0;a<g;a++)for(o=a*I,n=0;n<I;n++)C[o+n]=r[n];else for(a=0;a<g*I;a++)C[a]=t},getDataTypeArray:function(A){var e;switch(A){case 0:e=Int8Array;break;case 1:e=Uint8Array;break;case 2:e=Int16Array;break;case 3:e=Uint16Array;break;case 4:e=Int32Array;break;case 5:e=Uint32Array;break;case 6:default:e=Float32Array;break;case 7:e=Float64Array}return e},getPixelType:function(A){var e;switch(A){case 0:e="S8";break;case 1:e="U8";break;case 2:e="S16";break;case 3:e="U16";break;case 4:e="S32";break;case 5:e="U32";break;case 6:default:e="F32";break;case 7:e="F64"}return e},isValidPixelValue:function(A,e){if(null==e)return!1;var t;switch(A){case 0:t=e>=-128&&e<=127;break;case 1:t=e>=0&&e<=255;break;case 2:t=e>=-32768&&e<=32767;break;case 3:t=e>=0&&e<=65536;break;case 4:t=e>=-2147483648&&e<=2147483647;break;case 5:t=e>=0&&e<=4294967296;break;case 6:t=e>=-34027999387901484e22&&e<=34027999387901484e22;break;case 7:t=e>=-17976931348623157e292&&e<=17976931348623157e292;break;default:t=!1}return t},getDataTypeSize:function(A){var e=0;switch(A){case 0:case 1:e=1;break;case 2:case 3:e=2;break;
3case 4:case 5:case 6:e=4;break;case 7:e=8;break;default:e=A}return e},getDataTypeUsed:function(A,e){var t=A;switch(A){case 2:case 4:t=A-e;break;case 3:case 5:t=A-2*e;break;case 6:t=0===e?A:1===e?2:1;break;case 7:t=0===e?A:A-2*e+1;break;default:t=A}return t},getOnePixel:function(A,e,t,i){var r=0;switch(t){case 0:r=i.getInt8(e);break;case 1:r=i.getUint8(e);break;case 2:r=i.getInt16(e,!0);break;case 3:r=i.getUint16(e,!0);break;case 4:r=i.getInt32(e,!0);break;case 5:r=i.getUInt32(e,!0);break;case 6:r=i.getFloat32(e,!0);break;case 7:r=i.getFloat64(e,!0);break;default:throw"the decoder does not understand this pixel type"}return r},swapDimensionOrder:function(A,e,t,i,r){var I=0,g=0,n=0,a=0,o=A;if(t>1)if(o=new i(e*t),r)for(I=0;I<e;I++)for(a=I,n=0;n<t;n++,a+=e)o[a]=A[g++];else for(I=0;I<e;I++)for(a=I,n=0;n<t;n++,a+=e)o[g++]=A[a];return o}},E=function(A,e,t){this.val=A,this.left=e,this.right=t},{decode:function(A,e){var t=(e=e||{}).noDataValue,i=0,r={};r.ptr=e.inputOffset||0,r.pixels={},Q.readHeaderInfo(A,r);var I=r.headerInfo,g=I.fileVersion,n=Q.getDataTypeArray(I.imageType);if(g>5)throw"unsupported lerc version 2."+g;Q.readMask(A,r),I.numValidPixel===I.width*I.height||r.pixels.resultMask||(r.pixels.resultMask=e.maskData);var a=I.width*I.height;r.pixels.resultPixels=new n(a*I.numDims),r.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var o,B=!e.returnPixelInterleavedDims;if(0!==I.numValidPixel)if(I.zMax===I.zMin)Q.constructConstantSurface(r,B);else if(g>=4&&Q.checkMinMaxRanges(A,r))Q.constructConstantSurface(r,B);else{var C=new DataView(A,r.ptr,2),E=C.getUint8(0);if(r.ptr++,E)Q.readDataOneSweep(A,r,n,B);else if(g>1&&I.imageType<=1&&Math.abs(I.maxZError-.5)<1e-5){var s=C.getUint8(1);if(r.ptr++,r.encodeMode=s,s>2||g<4&&s>1)throw"Invalid Huffman flag "+s;s?Q.readHuffman(A,r,n,B):Q.readTiles(A,r,n,B)}else Q.readTiles(A,r,n,B)}r.eofOffset=r.ptr,e.inputOffset?(o=r.headerInfo.blobSize+e.inputOffset-r.ptr,Math.abs(o)>=1&&(r.eofOffset=e.inputOffset+r.headerInfo.blobSize)):(o=r.headerInfo.blobSize-r.ptr,Math.abs(o)>=1&&(r.eofOffset=r.headerInfo.blobSize));var f={width:I.width,height:I.height,pixelData:r.pixels.resultPixels,minValue:I.zMin,maxValue:I.zMax,validPixelCount:I.numValidPixel,dimCount:I.numDims,dimStats:{minValues:I.minValues,maxValues:I.maxValues},maskData:r.pixels.resultMask};if(r.pixels.resultMask&&Q.isValidPixelValue(I.imageType,t)){var c=r.pixels.resultMask;for(i=0;i<a;i++)c[i]||(f.pixelData[i]=t);f.noDataValue=t}return r.noDataValue=t,e.returnFileInfo&&(f.fileInfo=Q.formatFileInfo(r)),f},getBandCount:function(A){for(var e=0,t=0,i={ptr:0,pixels:{}};t<A.byteLength-58;)Q.readHeaderInfo(A,i),t+=i.headerInfo.blobSize,e++,i.ptr=t;return e}}),l=(s=new ArrayBuffer(4),f=new Uint8Array(s),new Uint32Array(s)[0]=1,1===f[0]),u={decode:function(A,e){if(!l)throw"Big endian system is not supported.";var t,i,r=(e=e||{}).inputOffset||0,I=new Uint8Array(A,r,10),g=String.fromCharCode.apply(null,I);if("CntZImage"===g.trim())t=c,i=1;else{if("Lerc2"!==g.substring(0,5))throw"Unexpected file identifier string: "+g;t=h,i=2}for(var n,a,o,B,C,Q,E=0,s=A.byteLength-10,f=[],u={width:0,height:0,pixels:[],pixelType:e.pixelType,mask:null,statistics:[]},w=0;r<s;){var d=t.decode(A,{inputOffset:r,encodedMaskData:n,maskData:o,returnMask:0===E,returnEncodedMask:0===E,returnFileInfo:!0,returnPixelInterleavedDims:e.returnPixelInterleavedDims,pixelType:e.pixelType||null,noDataValue:e.noDataValue||null});r=d.fileInfo.eofOffset,o=d.maskData,0===E&&(n=d.encodedMaskData,u.width=d.width,u.height=d.height,u.dimCount=d.dimCount||1,u.pixelType=d.pixelType||d.fileInfo.pixelType,u.mask=o),i>1&&(o&&f.push(o),d.fileInfo.mask&&d.fileInfo.mask.numBytes>0&&w++),E++,u.pixels.push(d.pixelData),u.statistics.push({minValue:d.minValue,maxValue:d.maxValue,noDataValue:d.noDataValue,dimStats:d.dimStats})}if(i>1&&w>1){for(Q=u.width*u.height,u.bandMasks=f,(o=new Uint8Array(Q)).set(f[0]),B=1;B<f.length;B++)for(a=f[B],C=0;C<Q;C++)o[C]=o[C]&a[C];u.maskData=o}return u}};TA.exports?TA.exports=u:this.Lerc=u}();var ZA,jA,WA,zA=XA.exports,$A={env:{emscripten_notify_memory_growth:function(A){WA=new Uint8Array(jA.exports.memory.buffer)}}},Ae=function(){function A(){B(this,A)}return Q(A,[{key:"init",value:function(){return ZA||(ZA="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+ee).then((function(A){return A.arrayBuffer()})).then((function(A){return WebAssembly.instantiate(A,$A)})).then(this._init):WebAssembly.instantiate(Buffer.from(ee,"base64"),$A).then(this._init))}},{key:"_init",value:function(A){jA=A.instance,$A.env.emscripten_notify_memory_growth(0)}},{key:"decode",value:function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;
3if(!jA)throw new Error("ZSTDDecoder: Await .init() before decoding.");var t=A.byteLength,i=jA.exports.malloc(t);WA.set(A,i),e=e||Number(jA.exports.ZSTD_findDecompressedSize(i,t));var r=jA.exports.malloc(e),I=jA.exports.ZSTD_decompress(r,e,i,t),g=WA.slice(r,r+I);return jA.exports.free(i),jA.exports.free(r),g}}]),A}(),ee
vendor: 38,980 bytes, line 3
3="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IAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQh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ASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigC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C0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdB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IAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY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wOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEE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",
3te={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},ie={};for(var re in te)te.hasOwnProperty(re)&&(ie[te[re]]=parseInt(re,10));ie.BitsPerSample,ie.ExtraSamples,ie.SampleFormat,ie.StripByteCounts,ie.StripOffsets,ie.StripRowCounts,ie.TileByteCounts,ie.TileOffsets,ie.SubIFDs;var Ie={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},ge={};for(var ne in Ie)Ie.hasOwnProperty(ne)&&(ge[Ie[ne]]=parseInt(ne,10));var ae=1,oe=0,Be=1,Ce=2,Qe={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"},Ee={};for(var se in Qe)Qe.hasOwnProperty(se)&&(Ee[Qe[se]]=parseInt(se,10));function fe(A){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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var ce=new Ae,he=function(A){s(t,w);var e=fe(t);function t(A){var i;return B(this,t),(i=e.call(this)).planarConfiguration=void 0!==A.PlanarConfiguration?A.PlanarConfiguration:1,i.samplesPerPixel=void 0!==A.SamplesPerPixel?A.SamplesPerPixel:1,i.addCompression=A.LercParameters[ae],i}return Q(t,[{key:"decodeBlock",value:function(A){switch(this.addCompression){case oe:break;case Be:A=YA(new Uint8Array(A)).buffer;break;case Ce:A=ce.decode(new Uint8Array(A)).buffer;break;default:throw new Error("Unsupported LERC additional compression method identifier: ".concat(this.addCompression))}return zA.decode(A,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}}]),t}(),le=Object.freeze({__proto__:null,zstd:ce,default:he});function ue(A){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(A){return!1}}();return function(){var t,i=c(A);if(e){var r=c(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return f(this,t)}}var we=function(A){s(I,w);var t,i=ue(I);function I(){var A;if(B(this,I),A=i.call(this),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available");return A}return Q(I,[{key:"decode",value:(t=e(r.mark((function A(e,t){var i,I,g,n;return r.wrap((function(A){for(;;)switch(A.prev=A.next){case 0:return i=new Blob([t]),A.next=3,createImageBitmap(i);case 3:return I=A.sent,"undefined"!=typeof document?((g=document.createElement("canvas")).width=I.width,g.height=I.height):g=new OffscreenCanvas(I.width,I.height),(n=g.getContext("2d")).drawImage(I,0,0),A.abrupt("return",n.getImageData(0,0,I.width,I.height).data.buffer);
3case 8:case"end":return A.stop()}}),A)}))),function(A,e){return t.apply(this,arguments)})}]),I}(),de=Object.freeze({__proto__:null,default:we});';return new Eh(typeof Buffer<"u"?"data:application/javascript;base64,"+Buffer.from(l,"binary").toString("base64"):URL.createObjectURL(new Blob([l],{type:"application/javascript"})))}});se.cogProtocol=function(){var l=ht(function*(p){if("json"==p.type){const h=p.url.replace("cog://","").split("#")[0];return{data:yield ns(h).getTilejson(p.url)}}if("image"==p.type)return{data:yield an(p.url)};throw new Error(`Unsupported request type '${p.type}'`)});return function(p){return l.apply(this,arguments)}}(),se.colorScale=ko,se.colorSchemeNames=hl,se.locationValues=function(){var l=ht(function*(p,{latitude:h,longitude:w},B){const E=ns(p),{minzoom:R,maxzoom:D}=yield E.getTilejson(p),{noData:H,scale:F,offset:V}=yield E.getMetadata(),le=void 0===B?D:Math.max(R,Math.min(D,Math.round(B))),{tileIndex:ne,column:N,row:ce}=(({latitude:ye,longitude:ue,zoom:Te})=>{const[De,J]=Ea.forward([ue,ye]),ie=(De+Gs/2)/Gs*ea*2**Te,te=-(J-Gs/2)/Gs*ea*2**Te;return{tileIndex:{z:Te,x:Math.floor(ie/ea),y:Math.floor(te/ea)},row:Math.floor(te%ea),column:Math.floor(ie%ea)}})({latitude:h,longitude:w,zoom:le}),he=yield E.getRawTile(ne),oe=he.length/65536,Ue=256*ce+N;return Array.from(he.subarray(Ue*oe,Ue*oe+oe)).map(ye=>{const ue=V+ye*F;return ue===H||isNaN(ue)||ue===1/0?NaN:ue})});return function(p,h,w){return l.apply(this,arguments)}}(),se.setColorFunction=(l,p)=>{((l,p)=>{Al[l]=p})(l,(h=>(w,B)=>{const R=w.length/65536,D=new Uint8ClampedArray(262144);for(let H=0;H<65536;H++)h(w.subarray(H*R,H*R+R),D.subarray(4*H,4*H+4),B);return D})(p))}}(Vi)},653:function(Gr){Gr.exports=function(){"use strict";var Vi={},Tt={};function ht(Z,g,li){if(Tt[Z]=li,"index"===Z){var ci="var sharedModule = {}; ("+Tt.shared+")(sharedModule); ("+Tt.worker+")(sharedModule);",Ut={};return Tt.shared(Ut),Tt.index(Vi,Ut),typeof window<"u"&&Vi.setWorkerUrl(window.URL.createObjectURL(new Blob([ci],{type:"text/javascript"}))),Vi}}return ht("shared",0,function(Z){function g(i,t,r,a){return new(r||(r=Promise))(function(c,d){function f(x){try{_(a.next(x))}catch(Q){d(Q)}}function m(x){try{_(a.throw(x))}catch(Q){d(Q)}}function _(x){var Q;x.done?c(x.value):(Q=x.value,Q instanceof r?Q:new r(function(k){k(Q)})).then(f,m)}_((a=a.apply(i,t||[])).next())})}function li(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}"function"==typeof SuppressedError&&SuppressedError;var ci=Ut;function Ut(i,t){this.x=i,this.y=t}Ut.prototype={clone:function(){return new Ut(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,t){return this.clone()._rotateAround(i,t)},matMult:function(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var t=i.x-this.x,r=i.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,t){return Math.atan2(this.x*t-this.y*i,this.x*i+this.y*t)},_matMult:function(i){var t=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=t,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var t=Math.cos(i),r=Math.sin(i),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this}
3,_rotateAround:function(i,t){var r=Math.cos(i),a=Math.sin(i),c=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=c,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Ut.convert=function(i){return i instanceof Ut?i:Array.isArray(i)?new Ut(i[0],i[1]):i};var at=li(ci),Ee=Qi;function Qi(i,t,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=a}Qi.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(void 0===t&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var c=this.sampleCurveX(r)-i;if(Math.abs(c)<t)return r;var d=this.sampleCurveDerivativeX(r);if(Math.abs(d)<1e-6)break;r-=c/d}var f=0,m=1;for(r=i,a=0;a<20&&(c=this.sampleCurveX(r),!(Math.abs(c-i)<t));a++)i>c?f=r:m=r,r=.5*(m-f)+f;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var Vt=li(Ee);let Ii,$i;function mi(){return null==Ii&&(Ii=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),Ii}function Wt(){if(null==$i&&($i=!1,mi())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let a=0;a<25;a++){const c=4*a;t.fillStyle=`rgb(${c},${c+1},${c+2})`,t.fillRect(a%5,Math.floor(a/5),1,1)}const r=t.getImageData(0,0,5,5).data;for(let a=0;a<100;a++)if(a%4!=3&&r[a]!==a){$i=!0;break}}}return $i||!1}function fi(i,t,r,a){const c=new Vt(i,t,r,a);return d=>c.solve(d)}const Qt=fi(.25,.1,.25,1);function bi(i,t,r){return Math.min(r,Math.max(t,i))}function _t(i,t,r){const a=r-t,c=((i-t)%a+a)%a+t;return c===t?r:c}function ot(i,...t){for(const r of t)for(const a in r)i[a]=r[a];return i}let It=1;function je(i,t,r){const a={};for(const c in i)a[c]=t.call(this,i[c],c,i);return a}function kt(i,t,r){const a={};for(const c in i)t.call(this,i[c],c,i)&&(a[c]=i[c]);return a}function mt(i){return Array.isArray(i)?i.map(mt):"object"==typeof i&&i?je(i,mt):i}const lt={};function Pe(i){lt[i]||(typeof console<"u"&&console.warn(i),lt[i]=!0)}function it(i,t,r){return(r.y-i.y)*(t.x-i.x)>(t.y-i.y)*(r.x-i.x)}function ri(i){return typeof WorkerGlobalScope<"u"&&void 0!==i&&i instanceof WorkerGlobalScope}let wi=null;function Rt(i){return typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const Bt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function At(i,t,r,a,c){return g(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const d=new VideoFrame(i,{timestamp:0});try{const f=d?.format;if(!f||!f.startsWith("BGR")&&!f.startsWith("RGB"))throw new Error(`Unrecognized format ${f}`);const m=f.startsWith("BGR"),_=new Uint8ClampedArray(a*c*4);if(yield d.copyTo(_,function(x,Q,k,L,q){const X=4*Math.max(-Q,0),re=(Math.max(0,k)-k)*L*4+X,pe=4*L,be=Math.max(0,Q),Je=Math.max(0,k);return{rect:{x:be,y:Je,width:Math.min(x.width,Q+L)-be,height:Math.min(x.height,k+q)-Je},layout:[{offset:re,stride:pe}]}}(i,t,r,a,c)),m)for(let x=0;x<_.length;x+=4){const Q=_[x];_[x]=_[x+2],_[x+2]=Q}return _}finally{d.close()}})}let et,Zt;const sr="AbortError";function cr(){return new Error(sr)}const ir={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function hr(i){return ir.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))]}const or="global-dispatcher";class rr extends Error{constructor(t,r,a,c){super(`AJAXError: ${r} (${t}): ${a}`),this.status=t,this.statusText=r,this.url=a,this.body=c}}const jr=()=>ri(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,Dn=function(i,t){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){const a=hr(i.url);if(a)return a(i,t);if(ri(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,targetMapId:or},t)}if(!(/^file:/.test(r=i.url)||/^file:/.test(jr())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(a,c){return g(this,void 0,void 0,function*(){const d=new Request
3(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,cache:a.cache,referrer:jr(),signal:c.signal});"json"!==a.type||d.headers.has("Accept")||d.headers.set("Accept","application/json");const f=yield fetch(d);if(!f.ok){const x=yield f.blob();throw new rr(f.status,f.statusText,a.url,x)}let m;m="arrayBuffer"===a.type||"image"===a.type?f.arrayBuffer():"json"===a.type?f.json():f.text();const _=yield m;if(c.signal.aborted)throw cr();return{data:_,cacheControl:f.headers.get("Cache-Control"),expires:f.headers.get("Expires")}})}(i,t);if(ri(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:i,mustQueue:!0,targetMapId:or},t)}var r,a,c;return a=i,c=t,new Promise((d,f)=>{var m;const _=new XMLHttpRequest;_.open(a.method||"GET",a.url,!0),"arrayBuffer"!==a.type&&"image"!==a.type||(_.responseType="arraybuffer");for(const x in a.headers)_.setRequestHeader(x,a.headers[x]);"json"===a.type&&(_.responseType="text",!(null===(m=a.headers)||void 0===m)&&m.Accept||_.setRequestHeader("Accept","application/json")),_.withCredentials="include"===a.credentials,_.onerror=()=>{f(new Error(_.statusText))},_.onload=()=>{if(!c.signal.aborted)if((_.status>=200&&_.status<300||0===_.status)&&null!==_.response){let x=_.response;if("json"===a.type)try{x=JSON.parse(_.response)}catch(Q){return void f(Q)}d({data:x,cacheControl:_.getResponseHeader("Cache-Control"),expires:_.getResponseHeader("Expires")})}else{const x=new Blob([_.response],{type:_.getResponseHeader("Content-Type")});f(new rr(_.status,_.statusText,a.url,x))}},c.signal.addEventListener("abort",()=>{_.abort(),f(cr())}),_.send(a.body)})};function tn(i){if(!i||i.indexOf("://")<=0||0===i.indexOf("data:image/")||0===i.indexOf("blob:"))return!0;const t=new URL(i),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function Yr(i,t,r){r[i]&&-1!==r[i].indexOf(t)||(r[i]=r[i]||[],r[i].push(t))}function An(i,t,r){if(r&&r[i]){const a=r[i].indexOf(t);-1!==a&&r[i].splice(a,1)}}class rn{constructor(t,r={}){ot(this,r),this.type=t}}class In extends rn{constructor(t,r={}){super("error",ot({error:t},r))}}class da{on(t,r){return this._listeners=this._listeners||{},Yr(t,r,this._listeners),this}off(t,r){return An(t,r,this._listeners),An(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Yr(t,r,this._oneTimeListeners),this):new Promise(a=>this.once(t,a))}fire(t,r){"string"==typeof t&&(t=new rn(t,r||{}));const a=t.type;if(this.listens(a)){t.target=this;const c=this._listeners&&this._listeners[a]?this._listeners[a].slice():[];for(const m of c)m.call(this,t);const d=this._oneTimeListeners&&this._oneTimeListeners[a]?this._oneTimeListeners[a].slice():[];for(const m of d)An(a,m,this._oneTimeListeners),m.call(this,t);const f=this._eventedParent;f&&(ot(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),f.fire(t))}else t instanceof In&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}}var Ze={$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"},sky:{type:"sky"},projection:{type:"projection
vendor: 11,907 bytes, line 3
3"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,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",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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"}
vendor: 8,873 bytes, line 3
3,"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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":{}}},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}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},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"}
vendor: 9,830 bytes, line 3
3,"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"}}};const 
vendor: 12,291 bytes, line 3
3br=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Or(i,t){const r={};for(const a in i)"ref"!==a&&(r[a]=i[a]);return br.forEach(a=>{a in t&&(r[a]=t[a])}),r}function Li(i,t){if(Array.isArray(i)){if(!Array.isArray(t)||i.length!==t.length)return!1;for(let r=0;r<i.length;r++)if(!Li(i[r],t[r]))return!1;return!0}if("object"==typeof i&&null!==i&&null!==t){if("object"!=typeof t||Object.keys(i).length!==Object.keys(t).length)return!1;for(const r in i)if(!Li(i[r],t[r]))return!1;return!0}return i===t}function Xi(i,t){i.push(t)}function fa(i,t,r){Xi(r,{command:"addSource",args:[i,t[i]]})}function bn(i,t,r){Xi(t,{command:"removeSource",args:[i]}),r[i]=!0}function dn(i,t,r,a){bn(i,r,a),fa(i,t,r)}function Wn(i,t,r){let a;for(a in i[r])if(Object.prototype.hasOwnProperty.call(i[r],a)&&"data"!==a&&!Li(i[r][a],t[r][a]))return!1;for(a in t[r])if(Object.prototype.hasOwnProperty.call(t[r],a)&&"data"!==a&&!Li(i[r][a],t[r][a]))return!1;return!0}function nn(i,t,r,a,c,d){i=i||{},t=t||{};for(const f in i)Object.prototype.hasOwnProperty.call(i,f)&&(Li(i[f],t[f])||r.push({command:d,args:[a,f,t[f],c]}));for(const f in t)Object.prototype.hasOwnProperty.call(t,f)&&!Object.prototype.hasOwnProperty.call(i,f)&&(Li(i[f],t[f])||r.push({command:d,args:[a,f,t[f],c]}))}function We(i){return i.id}function gr(i,t){return i[t.id]=t,i}class b{constructor(t,r,a,c){this.message=(t?`${t}: `:"")+a,c&&(this.identifier=c),null!=r&&r.__line__&&(this.line=r.__line__)}}function Y(i,...t){for(const r of t)for(const a in r)i[a]=r[a];return i}class dt extends Error{constructor(t,r){super(r),this.message=r,this.key=t}}class zt{constructor(t,r=[]){this.parent=t,this.bindings={};for(const[a,c]of r)this.bindings[a]=c}concat(t){return new zt(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Ti={kind:"null"},wt={kind:"number"},Ci={kind:"string"},Ai={kind:"boolean"},Rr={kind:"color"},vr={kind:"object"},vi={kind:"value"},wn={kind:"collator"},zn={kind:"formatted"},Un={kind:"padding"},Gn={kind:"resolvedImage"},me={kind:"variableAnchorOffsetCollection"};function O(i,t){return{kind:"array",itemType:i,N:t}}function G(i){if("array"===i.kind){const t=G(i.itemType);return"number"==typeof i.N?`array<${t}, ${i.N}>`:"value"===i.itemType.kind?"array":`array<${t}>`}return i.kind}const W=[Ti,wt,Ci,Ai,Rr,zn,vr,O(vi),Un,Gn,me];function fe(i,t){if("error"===t.kind)return null;if("array"===i.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!fe(i.itemType,t.itemType))&&("number"!=typeof i.N||i.N===t.N))return null}else{if(i.kind===t.kind)return null;if("value"===i.kind)for(const r of W)if(!fe(r,t))return null}return`Expected ${G(i)} but found ${G(t)} instead.`}function Se(i,t){return t.some(r=>r.kind===i.kind)}function ve(i,t){return t.some(r=>"null"===r?null===i:"array"===r?Array.isArray(i):"object"===r?i&&!Array.isArray(i)&&"object"==typeof i:r===typeof i)}function Ne(i,t){return"array"===i.kind&&"array"===t.kind?i.itemType.kind===t.itemType.kind&&"number"==typeof i.N:i.kind===t.kind}const yt=4/29,$e=6/29,Dt=3*$e*$e,ii=$e*$e*$e,hi=Math.PI/180,Ji=180/Math.PI;function Ei(i){return(i%=360)<0&&(i+=360),i}function ji([i,t,r,a]){let c,d;const f=ur((.2225045*(i=zi(i))+.7168786*(t=zi(t))+.0606169*(r=zi(r)))/1);i===t&&t===r?c=d=f:(c=ur((.4360747*i+.3850649*t+.1430804*r)/.96422),d=ur((.0139322*i+.0971045*t+.7141733*r)/.82521));const m=116*f-16;return[m<0?0:m,500*(c-f),200*(f-d),a]}function zi(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function ur(i){return i>ii?Math.pow(i,1/3):i/Dt+yt}function mr([i,t,r,a]){let c=(i+16)/116,d=isNaN(t)?c:c+t/500,f=isNaN(r)?c:c-r/200;return c=1*P(c),d=.96422*P(d),f=.82521*P(f),[C(3.1338561*d-1.6168667*c-.4906146*f),C(-.9787684*d+1.9161415*c+.033454*f),C(.0719453*d-.2289914*c+1.4052427*f),a]}function C(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function P(i){return i>$e?i*i*i:Dt*(i-yt)}function z(i){return parseInt(i.padEnd(2,i),16)/255}function U(i,t){return K(t?i/100:i,0,1)}function K(i,t,r){return Math.min(Math.max(t,i),r)}function $(i){return!i.some(Number.isNaN)}const Ie={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class xe{constructor(t,r,a,c=1,d=!0){this.r=t,this.g=r,this.b=a,this.a=c,d||(this.r*=c,this.g*=c,this.b*=c,c||this.overwriteGetter("rgb",[t,r,a,c]))}static parse(t){if(t instanceof xe)return t;if("string"!=typeof t)return;const r=function(a){if("transparent"===(a=a.toLowerCase().trim()))return[0,0,0,0];const c=Ie[a];if(c){const[f,m,_]=c;return[f/255,m/255,_/255,1]}if(a.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(a)){const f=a.length<6?1:2;let m=1;return[z(a.slice(m,m+=f)),z(a.slice(m,m+=f)),z(a.slice(m,m+=f)),z(a.slice(m,m+f)||"ff")]}if(a.startsWith("rgb")){const f=a.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(f){const[m,_,x,Q,k,L,q,X,re,pe,be,Je]=f,ke=[Q||" ",q||" ",pe].join("");if("  "===ke||"  /"===ke||",,"===ke||",,,"===ke){const Oe=[x,L,re].join(""),nt="%%%"===Oe?100:""===Oe?255:0;if(nt){const vt=[K(+_/nt,0,1),K(+k/nt,0,1),K(+X/nt,0,1),be?U(+be,Je):1];if($(vt))return vt}}return}}const d=a.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){const[f,m,_,x,Q,k,L,q,X]=d,re=[_||" ",Q||" ",L].join("");if("  "===re||"  /"===re||",,"===re||",,,"===re){const pe=[+m,K(+x,0,100),K(+k,0,100),q?U(+q,X):1];if($(pe))return function([be,Je,ke,Oe]){function nt(vt){const Nt=(vt+be/30)%12,gi=Je*Math.min(ke,1-ke);return ke-gi*Math.max(-1,Math.min(Nt-3,9-Nt,1))}return be=Ei(be),Je/=100,ke/=100,[nt(0),nt(8),nt(4),Oe]}(pe)}}}(t);return r?new xe(...r,!1):void 0}get rgb(){const{r:t,g:r,b:a,a:c}=this,d=c||1/0;return this.overwriteGetter("rgb",[t/d,r/d,a/d,c])}get hcl(){return this.overwriteGetter("hcl",function(t){const[r,a,c,d]=ji(t),f=Math.sqrt(a*a+c*c);return[Math.round(1e4*f)?Ei(Math.atan2(c,a)*Ji):NaN,f,r,d]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ji(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){const[t,r,a,c]=this.rgb;return`rgba(${[t,r,a].map(d=>Math.round(255*d)).join(",")},${c})`}}xe.black=new xe(0,0,0,1),xe.white=new xe(1,1,1,1),xe.transparent=new xe(0,0,0,0),xe.red=new xe(1,0,0,1);class qe{constructor(t,r,a){this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=a,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Fe{constructor(t,r,a,c,d){this.text=t,this.image=r,this.scale=a,this.fontStack=c,this.textColor=d}}class Ke{constructor(t){this.sections=t}static fromString(t){return new Ke([new Fe(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof Ke?t:Ke.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}}class st{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof st)return t;if("number"==typeof t)return new st([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const r of t)if("number"!=typeof r)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new st(t)}}toString(){return JSON.stringify(this.values)}}const bt=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ei{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ei)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let r=0;r<t.length;r+=2){const a=t[r],c=t[r+1];if("string"!=typeof a||!bt.has(a)||!Array.isArray(c)||2!==c.length||"number"!=typeof c[0]||"number"!=typeof c[1])return}return new ei(t)}}toString(){return JSON.stringify(this.values)}}class Di{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Di({name:t,available:!1}):null}}function yi(i,t,r,a){return"number"==typeof i&&i>=0&&i<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===a||"number"==typeof a&&a>=0&&a<=1?null:`Invalid rgba value [${[i,t,r,a].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof a?[i,t,r,a]:[i,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function xr(i){if(null===i||"string"==typeof i||"boolean"==typeof i||"number"==typeof i||i instanceof xe||i instanceof qe||i instanceof Ke||i instanceof st||i instanceof ei||i instanceof Di)return!0;
vendor: 4,141 bytes, line 3
3if(Array.isArray(i)){for(const t of i)if(!xr(t))return!1;return!0}if("object"==typeof i){for(const t in i)if(!xr(i[t]))return!1;return!0}return!1}function ki(i){if(null===i)return Ti;if("string"==typeof i)return Ci;if("boolean"==typeof i)return Ai;if("number"==typeof i)return wt;if(i instanceof xe)return Rr;if(i instanceof qe)return wn;if(i instanceof Ke)return zn;if(i instanceof st)return Un;if(i instanceof ei)return me;if(i instanceof Di)return Gn;if(Array.isArray(i)){const t=i.length;let r;for(const a of i){const c=ki(a);if(r){if(r===c)continue;r=vi;break}r=c}return O(r||vi,t)}return vr}function Hr(i){const t=typeof i;return null===i?"":"string"===t||"number"===t||"boolean"===t?String(i):i instanceof xe||i instanceof Ke||i instanceof st||i instanceof ei||i instanceof Di?i.toString():JSON.stringify(i)}class Ri{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(2!==t.length)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!xr(t[1]))return r.error("invalid value");const a=t[1];let c=ki(a);const d=r.expectedType;return"array"!==c.kind||0!==c.N||!d||"array"!==d.kind||"number"==typeof d.N&&0!==d.N||(c=d),new Ri(c,a)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Pi{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const Ca={string:Ci,number:wt,boolean:Ai,object:vr};class Sr{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let a,c=1;const d=t[0];if("array"===d){let m,_;if(t.length>2){const x=t[1];if("string"!=typeof x||!(x in Ca)||"object"===x)return r.error('The item type argument of "array" must be one of string, number, boolean',1);m=Ca[x],c++}else m=vi;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);_=t[2],c++}a=O(m,_)}else{if(!Ca[d])throw new Error(`Types doesn't contain name = ${d}`);a=Ca[d]}const f=[];for(;c<t.length;c++){const m=r.parse(t[c],c,vi);if(!m)return null;f.push(m)}return new Sr(a,f)}evaluate(t){for(let r=0;r<this.args.length;r++){const a=this.args[r].evaluate(t);if(!fe(this.type,ki(a)))return a;if(r===this.args.length-1)throw new Pi(`Expected value to be of type ${G(this.type)}, but found ${G(ki(a))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const es={"to-boolean":Ai,"to-color":Rr,"to-number":wt,"to-string":Ci};class Zr{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const a=t[0];if(!es[a])throw new Error(`Can't parse ${a} as it is not part of the known types`);if(("to-boolean"===a||"to-string"===a)&&2!==t.length)return r.error("Expected one argument.");const c=es[a],d=[];for(let f=1;f<t.length;f++){const m=r.parse(t[f],f,vi);if(!m)return null;d.push(m)}return new Zr(c,d)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let r,a;for(const c of this.args){if(r=c.evaluate(t),a=null,r instanceof xe)return r;if("string"==typeof r){const d=t.parseColor(r);if(d)return d}else if(Array.isArray(r)&&(a=r.length<3||r.length>4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:yi(r[0],r[1],r[2],r[3]),!a))return new xe(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new Pi(a||`Could not parse color from value '${"string"==typeof r?r:JSON.stringify(r)}'`)}case"padding":{let r;for(const a of this.args){r=a.evaluate(t);const c=st.parse(r);if(c)return c}throw new Pi(`Could not parse padding from value '${"string"==typeof r?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(const a of this.args){r=a.evaluate(t);const c=ei.parse(r);if(c)return c}throw new Pi(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof r?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(const a of this.args){if(r=a.evaluate(t),null===r)return 0;const c=Number(r);
vendor: 17,899 bytes, line 3
3if(!isNaN(c))return c}throw new Pi(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Ke.fromString(Hr(this.args[0].evaluate(t)));case"resolvedImage":return Di.fromString(Hr(this.args[0].evaluate(t)));default:return Hr(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const ts=["Unknown","Point","LineString","Polygon"];class pa{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ts[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache[t];return r||(r=this._parseColorCache[t]=xe.parse(t)),r}}class Dr{constructor(t,r,a=[],c,d=new zt,f=[]){this.registry=t,this.path=a,this.key=a.map(m=>`[${m}]`).join(""),this.scope=d,this.errors=f,this.expectedType=c,this._isConstant=r}parse(t,r,a,c,d={}){return r?this.concat(r,a,c)._parse(t,d):this._parse(t,d)}_parse(t,r){function a(c,d,f){return"assert"===f?new Sr(d,[c]):"coerce"===f?new Zr(d,[c]):c}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", []].');const c=t[0];if("string"!=typeof c)return this.error(`Expression name must be a string, but found ${typeof c} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const d=this.registry[c];if(d){let f=d.parse(t,this);if(!f)return null;if(this.expectedType){const m=this.expectedType,_=f.type;if("string"!==m.kind&&"number"!==m.kind&&"boolean"!==m.kind&&"object"!==m.kind&&"array"!==m.kind||"value"!==_.kind)if("color"!==m.kind&&"formatted"!==m.kind&&"resolvedImage"!==m.kind||"value"!==_.kind&&"string"!==_.kind)if("padding"!==m.kind||"value"!==_.kind&&"number"!==_.kind&&"array"!==_.kind)if("variableAnchorOffsetCollection"!==m.kind||"value"!==_.kind&&"array"!==_.kind){if(this.checkSubtype(m,_))return null}else f=a(f,m,r.typeAnnotation||"coerce");else f=a(f,m,r.typeAnnotation||"coerce");else f=a(f,m,r.typeAnnotation||"coerce");else f=a(f,m,r.typeAnnotation||"assert")}if(!(f instanceof Ri)&&"resolvedImage"!==f.type.kind&&this._isConstant(f)){const m=new pa;try{f=new Ri(f.type,f.evaluate(m))}catch(_){return this.error(_.message),null}}return f}return this.error(`Unknown expression "${c}". 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.`)}concat(t,r,a){const c="number"==typeof t?this.path.concat(t):this.path,d=a?this.scope.concat(a):this.scope;return new Dr(this.registry,this._isConstant,c,r||null,d,this.errors)}error(t,...r){const a=`${this.key}${r.map(c=>`[${c}]`).join("")}`;this.errors.push(new dt(a,t))}checkSubtype(t,r){const a=fe(t,r);return a&&this.error(a),a}}class kn{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const a=[];for(let d=1;d<t.length-1;d+=2){const f=t[d];if("string"!=typeof f)return r.error(`Expected string, but found ${typeof f} instead.`,d);if(/[^a-zA-Z0-9_]/.test(f))return r.error("Variable names must contain only alphanumeric characters or '_'.",d);const m=r.parse(t[d+1],d+1);if(!m)return null;a.push([f,m])}const c=r.parse(t[t.length-1],t.length-1,r.expectedType,a);return c?new kn(a,c):null}outputDefined(){return this.result.outputDefined()}}class Hi{constructor(t,r){this.type=r.type,this.name=t,this.boundExpression=r}static parse(t,r){if(2!==t.length||"string"!=typeof t[1])return r.error("'var' expression requires exactly one string literal argument.");const a=t[1];return r.scope.has(a)?new Hi(a,r.scope.get(a)):r.error(`Unknown variable "${a}". Make sure "${a}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class is{constructor(t,r,a){this.type=t,this.index=r,this.input=a}static parse(t,r){if(3!==t.length)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,wt),c=r.parse(t[2],2,O(r.expectedType||vi));return a&&c?new is(c.type.itemType,a,c):null}evaluate(t){const r=this.index.evaluate(t),a=this.input.evaluate(t);if(r<0)throw new Pi(`Array index out of bounds: ${r} < 0.`);if(r>=a.length)throw new Pi(`Array index out of bounds: ${r} > ${a.length-1}.`);if(r!==Math.floor(r))throw new Pi(`Array index must be an integer, but found ${r} instead.`);return a[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Fr{constructor(t,r){this.type=Ai,this.needle=t,this.haystack=r}static parse(t,r){if(3!==t.length)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,vi),c=r.parse(t[2],2,vi);return a&&c?Se(a.type,[Ai,Ci,wt,Ti,vi])?new Fr(a,c):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${G(a.type)} instead`):null}evaluate(t){const r=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!a)return!1;if(!ve(r,["boolean","string","number","null"]))throw new Pi(`Expected first argument to be of type boolean, string, number or null, but found ${G(ki(r))} instead.`);if(!ve(a,["string","array"]))throw new Pi(`Expected second argument to be of type array or string, but found ${G(ki(a))} instead.`);return a.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Zi{constructor(t,r,a){this.type=wt,this.needle=t,this.haystack=r,this.fromIndex=a}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,vi),c=r.parse(t[2],2,vi);if(!a||!c)return null;if(!Se(a.type,[Ai,Ci,wt,Ti,vi]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${G(a.type)} instead`);if(4===t.length){const d=r.parse(t[3],3,wt);return d?new Zi(a,c,d):null}return new Zi(a,c)}evaluate(t){const r=this.needle.evaluate(t),a=this.haystack.evaluate(t);if(!ve(r,["boolean","string","number","null"]))throw new Pi(`Expected first argument to be of type boolean, string, number or null, but found ${G(ki(r))} instead.`);let c;if(this.fromIndex&&(c=this.fromIndex.evaluate(t)),ve(a,["string"])){const d=a.indexOf(r,c);return-1===d?-1:[...a.slice(0,d)].length}if(ve(a,["array"]))return a.indexOf(r,c);throw new Pi(`Expected second argument to be of type array or string, but found ${G(ki(a))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Ul{constructor(t,r,a,c,d,f){this.inputType=t,this.type=r,this.input=a,this.cases=c,this.outputs=d,this.otherwise=f}static parse(t,r){if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");let a,c;r.expectedType&&"value"!==r.expectedType.kind&&(c=r.expectedType);const d={},f=[];for(let x=2;x<t.length-1;x+=2){let Q=t[x];const k=t[x+1];Array.isArray(Q)||(Q=[Q]);const L=r.concat(x);if(0===Q.length)return L.error("Expected at least one branch label.");for(const X of Q){if("number"!=typeof X&&"string"!=typeof X)return L.error("Branch labels must be numbers or strings.");if("number"==typeof X&&Math.abs(X)>Number.MAX_SAFE_INTEGER)return L.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof X&&Math.floor(X)!==X)return L.error("Numeric branch labels must be integer values.");if(a){if(L.checkSubtype(a,ki(X)))return null}else a=ki(X);if(void 0!==d[String(X)])return L.error("Branch labels must be unique.");d[String(X)]=f.length}const q=r.parse(k,x,c);if(!q)return null;c=c||q.type,f.push(q)}const m=r.parse(t[1],1,vi);if(!m)return null;const _=r.parse(t[t.length-1],t.length-1,c);return _?"value"!==m.type.kind&&r.concat(1).checkSubtype(a,m.type)?null:new Ul(a,c,m,d,f,_):null}evaluate(t){const r=this.input.evaluate(t);return(ki(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class Yo{constructor(t,r,a){this.type=t,this.branches=r,this.otherwise=a}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let a;r.expectedType&&"value"!==r.expectedType.kind&&(a=r.expectedType);const c=[];for(let f=1;f<t.length-1;f+=2){const m=r.parse(t[f],f,Ai);if(!m)return null;const _=r.parse(t[f+1],f+1,a);if(!_)return null;c.push([m,_]),a=a||_.type}const d=r.parse(t[t.length-1],t.length-1,a);if(!d)return null;if(!a)throw new Error("Can't infer output type");return new Yo(a,c,d)}evaluate(t){for(const[r,a]of this.branches)if(r.evaluate(t))return a.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[r,a]of this.branches)t(r),t(a);t(this.otherwise)}outputDefined(){return this.branches.every(([t,r])=>r.outputDefined())&&this.otherwise.outputDefined()}}class rs{constructor(t,r,a,c){this.type=t,this.input=r,this.beginIndex=a,this.endIndex=c}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const a=r.parse(t[1],1,vi),c=r.parse(t[2],2,wt);if(!a||!c)return null;if(!Se(a.type,[O(vi),Ci,vi]))return r.error(`Expected first argument to be of type array or string, but found ${G(a.type)} instead`);if(4===t.length){const d=r.parse(t[3],3,wt);return d?new rs(a.type,a,c,d):null}return new rs(a.type,a,c)}evaluate(t){const r=this.input.evaluate(t),a=this.beginIndex.evaluate(t);let c;if(this.endIndex&&(c=this.endIndex.evaluate(t)),ve(r,["string"]))return[...r].slice(a,c).join("");if(ve(r,["array"]))return r.slice(a,c);throw new Pi(`Expected first argument to be of type array or string, but found ${G(ki(r))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Ls(i,t){const r=i.length-1;let a,c,d=0,f=r,m=0;for(;d<=f;)if(m=Math.floor((d+f)/2),a=i[m],c=i[m+1],a<=t){if(m===r||t<c)return m;d=m+1}else{if(!(a>t))throw new Pi("Input is not a number.");f=m-1}return 0}class zs{constructor(t,r,a){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(const[c,d]of a)this.labels.push(c),this.outputs.push(d)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");const a=r.parse(t[1],1,wt);if(!a)return null;const c=[];let d=null;r.expectedType&&"value"!==r.expectedType.kind&&(d=r.expectedType);for(let f=1;f<t.length;f+=2){const m=1===f?-1/0:t[f],_=t[f+1],x=f,Q=f+1;if("number"!=typeof m)return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(c.length&&c[c.length-1][0]>=m)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);const k=r.parse(_,Q,d);if(!k)return null;d=d||k.type,c.push([m,k])}return new zs(d,a,c)}evaluate(t){const r=this.labels,a=this.outputs;if(1===r.length)return a[0].evaluate(t);const c=this.input.evaluate(t);if(c<=r[0])return a[0].evaluate(t);const d=r.length;return c>=r[d-1]?a[d-1].evaluate(t):a[Ls(r,c)].evaluate(t)}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}var Zc=Ga;function Ga(i,t,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=t,this.p2x=r,this.p2y=a}Ga.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,t){if(void 0===t&&(t=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var c=this.sampleCurveX(r)-i;if(Math.abs(c)<t)return r;var d=this.sampleCurveDerivativeX(r);if(Math.abs(d)<1e-6)break;r-=c/d}var f=0,m=1;for(r=i,a=0;a<20&&(c=this.sampleCurveX(r),!(Math.abs(c-i)<t));a++)i>c?f=r:m=r,r=.5*(m-f)+f;return r},solve:function(i,t){return this.sampleCurveY(this.solveCurveX(i,t))}};var Gl=function gc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}(Zc);function On(i,t,r){return i+r*(t-i)}function fo(i,t,r){return i.map((a,c)=>On(a,t[c],r))}const Kr={number:On,color:function(i,t,r,a="rgb"){switch(a){case"rgb":{const[c,d,f,m]=fo(i.rgb,t.rgb,r);return new xe(c,d,f,m,!1)}case"hcl":{const[c,d,f,m]=i.hcl,[_,x,Q,k]=t.hcl;let L,q;if(isNaN(c)||isNaN(_))isNaN(c)?isNaN(_)?L=NaN:(L=_,1!==f&&0!==f||(q=x)):(L=c,1!==Q&&0!==Q||(q=d));else{let Je=_-c;_>c&&Je>180?Je-=360:_<c&&c-_>180&&(Je+=360),L=c+r*Je}const[X,re,pe,be]=function([Je,ke,Oe,nt]){return Je=isNaN(Je)?0:Je*hi,mr([Oe,Math.cos(Je)*ke,Math.sin(Je)*ke,nt])}([L,q??On(d,x,r),On(f,Q,r),On(m,k,r)]);return new xe(X,re,pe,be,!1)}case"lab":{const[c,d,f,m]=mr(fo(i.lab,t.lab,r));return new xe(c,d,f,m,!1)}}},array:fo,padding:function(i,t,r){return new st(fo(i.values,t.values,r))},variableAnchorOffsetCollection:function(i,t,r){const a=i.values,c=t.values;if(a.length!==c.length)throw new Pi(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${t.toString()}`);const d=[];for(let f=0;f<a.length;f+=2){if(a[f]!==c[f])throw new Pi(`Cannot interpolate values containing mismatched anchors. from[${f}]: ${a[f]}, to[${f}]: ${c[f]}`);d.push(a[f]);const[m,_]=a[f+1],[x,Q]=c[f+1];d.push([On(m,x,r),On(_,Q,r)])}return new ei(d)}};class vn{constructor(t,r,a,c,d){this.type=t,this.operator=r,this.interpolation=a,this.input=c,this.labels=[],this.outputs=[];for(const[f,m]of d)this.labels.push(f),this.outputs.push(m)}static interpolationFactor(t,r,a,c){let d=0;if("exponential"===t.name)d=Us(r,t.base,a,c);else if("linear"===t.name)d=Us(r,1,a,c);else if("cubic-bezier"===t.name){const f=t.controlPoints;d=new Gl(f[0],f[1],f[2],f[3]).solve(Us(r,1,a,c))}return d}static parse(t,r){let[a,c,d,...f]=t;if(!Array.isArray(c)||0===c.length)return r.error("Expected an interpolation type expression.",1);if("linear"===c[0])c={name:"linear"};else if("exponential"===c[0]){const x=c[1];if("number"!=typeof x)return r.error("Exponential interpolation requires a numeric base.",1,1);c={name:"exponential",base:x}}else{if("cubic-bezier"!==c[0])return r.error(`Unknown interpolation type ${String(c[0])}`,1,0);{const x=c.slice(1);if(4!==x.length||x.some(Q=>"number"!=typeof Q||Q<0||Q>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);c={name:"cubic-bezier",controlPoints:x}}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(d=r.parse(d,2,wt),!d)return null;const m=[];let _=null;"interpolate-hcl"===a||"interpolate-lab"===a?_=Rr:r.expectedType&&"value"!==r.expectedType.kind&&(_=r.expectedType);for(let x=0;x<f.length;x+=2){const Q=f[x],k=f[x+1],L=x+3,q=x+4;if("number"!=typeof Q)return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',L);if(m.length&&m[m.length-1][0]>=Q)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',L);const X=r.parse(k,q,_);if(!X)return null;_=_||X.type,m.push([Q,X])}return Ne(_,wt)||Ne(_,Rr)||Ne(_,Un)||Ne(_,me)||Ne(_,O(wt))?new vn(_,a,c,d,m):r.error(`Type ${G(_)} is not interpolatable.`)}evaluate(t){const r=this.labels,a=this.outputs;if(1===r.length)return a[0].evaluate(t);const c=this.input.evaluate(t);if(c<=r[0])return a[0].evaluate(t);const d=r.length;if(c>=r[d-1])return a[d-1].evaluate(t);const f=Ls(r,c),m=vn.interpolationFactor(this.interpolation,c,r[f],r[f+1]),_=a[f].evaluate(t),x=a[f+1].evaluate(t);switch(this.operator){case"interpolate":return Kr[this.type.kind](_,x,m);case"interpolate-hcl":return Kr.color(_,x,m,"hcl");case"interpolate-lab":return Kr.color(_,x,m,"lab")}}eachChild(t){t(this.input);for(const r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Us(i,t,r,a){const c=a-r,d=i-r;return 0===c?0:1===t?d/c:(Math.pow(t,d)-1)/(Math.pow(t,c)-1)}class po{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expectected at least one argument.");let a=null;const c=r.expectedType;c&&"value"!==c.kind&&(a=c);const d=[];for(const m of t.slice(1)){const _=r.parse(m,1+d.length,a,void 0,{typeAnnotation:"omit"});if(!_)return null;a=a||_.type,d.push(_)}if(!a)throw new Error("No output type");const f=c&&d.some(m=>fe(c,m.type));return new po(f?vi:a,d)}evaluate(t){let r,a=null,c=0;for(const d of this.args)if(c++,a=d.evaluate(t),a&&a instanceof Di&&!a.available&&(r||(r=a.name),a=null,c===this.args.length&&(a=r)),null!==a)break;return a}
vendor: 5,291 bytes, line 3
3eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function ea(i,t){return"=="===i||"!="===i?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Gs(i,t,r,a){return 0===a.compare(t,r)}function Ea(i,t,r){const a="=="!==i&&"!="!==i;return class CA{constructor(d,f,m){this.type=Ai,this.lhs=d,this.rhs=f,this.collator=m,this.hasUntypedArgument="value"===d.type.kind||"value"===f.type.kind}static parse(d,f){if(3!==d.length&&4!==d.length)return f.error("Expected two or three arguments.");const m=d[0];let _=f.parse(d[1],1,vi);if(!_)return null;if(!ea(m,_.type))return f.concat(1).error(`"${m}" comparisons are not supported for type '${G(_.type)}'.`);let x=f.parse(d[2],2,vi);if(!x)return null;if(!ea(m,x.type))return f.concat(2).error(`"${m}" comparisons are not supported for type '${G(x.type)}'.`);if(_.type.kind!==x.type.kind&&"value"!==_.type.kind&&"value"!==x.type.kind)return f.error(`Cannot compare types '${G(_.type)}' and '${G(x.type)}'.`);a&&("value"===_.type.kind&&"value"!==x.type.kind?_=new Sr(x.type,[_]):"value"!==_.type.kind&&"value"===x.type.kind&&(x=new Sr(_.type,[x])));let Q=null;if(4===d.length){if("string"!==_.type.kind&&"string"!==x.type.kind&&"value"!==_.type.kind&&"value"!==x.type.kind)return f.error("Cannot use collator to compare non-string types.");if(Q=f.parse(d[3],3,wn),!Q)return null}return new CA(_,x,Q)}evaluate(d){const f=this.lhs.evaluate(d),m=this.rhs.evaluate(d);if(a&&this.hasUntypedArgument){const _=ki(f),x=ki(m);if(_.kind!==x.kind||"string"!==_.kind&&"number"!==_.kind)throw new Pi(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${_.kind}, ${x.kind}) instead.`)}if(this.collator&&!a&&this.hasUntypedArgument){const _=ki(f),x=ki(m);if("string"!==_.kind||"string"!==x.kind)return t(d,f,m)}return this.collator?r(d,f,m,this.collator.evaluate(d)):t(d,f,m)}eachChild(d){d(this.lhs),d(this.rhs),this.collator&&d(this.collator)}outputDefined(){return!0}}}const Kc=Ea("==",function(i,t,r){return t===r},Gs),Zo=Ea("!=",function(i,t,r){return t!==r},function(i,t,r,a){return!Gs(0,t,r,a)}),Ko=Ea("<",function(i,t,r){return t<r},function(i,t,r,a){return a.compare(t,r)<0}),mc=Ea(">",function(i,t,r){return t>r},function(i,t,r,a){return a.compare(t,r)>0}),yc=Ea("<=",function(i,t,r){return t<=r},function(i,t,r,a){return a.compare(t,r)<=0}),Ol=Ea(">=",function(i,t,r){return t>=r},function(i,t,r,a){return a.compare(t,r)>=0});class ns{constructor(t,r,a){this.type=wn,this.locale=a,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(2!==t.length)return r.error("Expected one argument.");const a=t[1];if("object"!=typeof a||Array.isArray(a))return r.error("Collator options argument must be an object.");const c=r.parse(void 0!==a["case-sensitive"]&&a["case-sensitive"],1,Ai);if(!c)return null;const d=r.parse(void 0!==a["diacritic-sensitive"]&&a["diacritic-sensitive"],1,Ai);if(!d)return null;let f=null;return a.locale&&(f=r.parse(a.locale,1,Ci),!f)?null:new ns(c,d,f)}evaluate(t){return new qe(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Os{constructor(t,r,a,c,d){this.type=Ci,this.number=t,this.locale=r,this.currency=a,this.minFractionDigits=c,this.maxFractionDigits=d}static parse(t,r){if(3!==t.length)return r.error("Expected two arguments.");const a=r.parse(t[1],1,wt);if(!a)return null;const c=t[2];if("object"!=typeof c||Array.isArray(c))return r.error("NumberFormat options argument must be an object.");let d=null;if(c.locale&&(d=r.parse(c.locale,1,Ci),!d))return null;let f=null;if(c.currency&&(f=r.parse(c.currency,1,Ci),!f))return null;let m=null;if(c["min-fraction-digits"]&&(m=r.parse(c["min-fraction-digits"],1,wt),!m))return null;let _=null;return c["max-fraction-digits"]&&(_=r.parse(c["max-fraction-digits"],1,wt),!_)?null:new Os(a,d,f,m,_)}evaluate(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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class $o{constructor(t){this.type=zn,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");const a=t[1];if(!Array.isArray(a)&&"object"==typeof a)return r.error("First argument must be an image or text section.");const c=[];let d=!1;for(let f=1;f<=t.length-1;++f){const m=t[f];if(d&&"object"==typeof m&&!Array.isArray(m)){d=!1;let _=null;if(m["font-scale"]&&(_=r.parse(m["font-scale"],1,wt),!_))return null;let x=null;if(m["text-font"]&&(x=r.parse(m["text-font"],1,O(Ci)),!x))return null;let Q=null;if(m["text-color"]&&(Q=r.parse(m["text-color"],1,Rr),!Q))return null;
vendor: 15,124 bytes, line 3
3const k=c[c.length-1];k.scale=_,k.font=x,k.textColor=Q}else{const _=r.parse(t[f],1,vi);if(!_)return null;const x=_.type.kind;if("string"!==x&&"value"!==x&&"null"!==x&&"resolvedImage"!==x)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");d=!0,c.push({content:_,scale:null,font:null,textColor:null})}}return new $o(c)}evaluate(t){return new Ke(this.sections.map(r=>{const a=r.content.evaluate(t);return ki(a)===Gn?new Fe("",a,null,null,null):new Fe(Hr(a),null,r.scale?r.scale.evaluate(t):null,r.font?r.font.evaluate(t).join(","):null,r.textColor?r.textColor.evaluate(t):null)}))}eachChild(t){for(const r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}outputDefined(){return!1}}class Xo{constructor(t){this.type=Gn,this.input=t}static parse(t,r){if(2!==t.length)return r.error("Expected two arguments.");const a=r.parse(t[1],1,Ci);return a?new Xo(a):r.error("No image name provided.")}evaluate(t){const r=this.input.evaluate(t),a=Di.fromString(r);return a&&t.availableImages&&(a.available=t.availableImages.indexOf(r)>-1),a}eachChild(t){t(this.input)}outputDefined(){return!1}}class Nl{constructor(t){this.type=wt,this.input=t}static parse(t,r){if(2!==t.length)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);const a=r.parse(t[1],1);return a?"array"!==a.type.kind&&"string"!==a.type.kind&&"value"!==a.type.kind?r.error(`Expected argument of type string or array, but found ${G(a.type)} instead.`):new Nl(a):null}evaluate(t){const r=this.input.evaluate(t);if("string"==typeof r)return[...r].length;if(Array.isArray(r))return r.length;throw new Pi(`Expected value to be of type string or array, but found ${G(ki(r))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const ta=8192;function $c(i,t){const r=(180+i[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,c=Math.pow(2,t.z);return[Math.round(r*c*ta),Math.round(a*c*ta)]}function ql(i,t){const r=Math.pow(2,t.z);return[(c=(i[0]/ta+t.x)/r,360*c-180),(a=(i[1]/ta+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,c}function as(i,t){i[0]=Math.min(i[0],t[0]),i[1]=Math.min(i[1],t[1]),i[2]=Math.max(i[2],t[0]),i[3]=Math.max(i[3],t[1])}function ia(i,t){return!(i[0]<=t[0]||i[2]>=t[2]||i[1]<=t[1]||i[3]>=t[3])}function Ki(i,t,r){const a=i[0]-t[0],c=i[1]-t[1],d=i[0]-r[0],f=i[1]-r[1];return a*f-d*c==0&&a*d<=0&&c*f<=0}function go(i,t,r,a){return(c=[a[0]-r[0],a[1]-r[1]])[0]*(d=[t[0]-i[0],t[1]-i[1]])[1]-c[1]*d[0]!=0&&!(!os(i,t,r,a)||!os(r,a,i,t));var c,d}function Vl(i,t,r){for(const a of r)for(let c=0;c<a.length-1;++c)if(go(i,t,a[c],a[c+1]))return!0;return!1}function ss(i,t,r=!1){let a=!1;for(const m of t)for(let _=0;_<m.length-1;_++){if(Ki(i,m[_],m[_+1]))return r;(d=m[_])[1]>(c=i)[1]!=(f=m[_+1])[1]>c[1]&&c[0]<(f[0]-d[0])*(c[1]-d[1])/(f[1]-d[1])+d[0]&&(a=!a)}var c,d,f;return a}function mo(i,t){for(const r of t)if(ss(i,r))return!0;return!1}function Ns(i,t){for(const r of i)if(!ss(r,t))return!1;for(let r=0;r<i.length-1;++r)if(Vl(i[r],i[r+1],t))return!1;return!0}function Wo(i,t){for(const r of t)if(Ns(i,r))return!0;return!1}function os(i,t,r,a){const c=a[0]-r[0],d=a[1]-r[1],f=(i[0]-r[0])*d-c*(i[1]-r[1]),m=(t[0]-r[0])*d-c*(t[1]-r[1]);return f>0&&m<0||f<0&&m>0}function ls(i,t,r){const a=[];for(let c=0;c<i.length;c++){const d=[];for(let f=0;f<i[c].length;f++){const m=$c(i[c][f],r);as(t,m),d.push(m)}a.push(d)}return a}function ra(i,t,r){const a=[];for(let c=0;c<i.length;c++){const d=ls(i[c],t,r);a.push(d)}return a}function _c(i,t,r,a){if(i[0]<r[0]||i[0]>r[2]){const c=.5*a;let d=i[0]-r[0]>c?-a:r[0]-i[0]>c?a:0;0===d&&(d=i[0]-r[2]>c?-a:r[2]-i[0]>c?a:0),i[0]+=d}as(t,i)}function Ic(i,t,r,a){const c=Math.pow(2,a.z)*ta,d=[a.x*ta,a.y*ta],f=[];for(const m of i)for(const _ of m){const x=[_.x+d[0],_.y+d[1]];_c(x,t,r,c),f.push(x)}return f}function bc(i,t,r,a){const c=Math.pow(2,a.z)*ta,d=[a.x*ta,a.y*ta],f=[];for(const _ of i){const x=[];for(const Q of _){const k=[Q.x+d[0],Q.y+d[1]];as(t,k),x.push(k)}f.push(x)}if(t[2]-t[0]<=c/2){(m=t)[0]=m[1]=1/0,m[2]=m[3]=-1/0;for(const _ of f)for(const x of _)_c(x,t,r,c)}var m;return f}class cs{constructor(t,r){this.type=Ai,this.geojson=t,this.geometries=r}static parse(t,r){if(2!==t.length)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(xr(t[1])){const a=t[1];if("FeatureCollection"===a.type){const c=[];for(const d of a.features){const{type:f,coordinates:m}=d.geometry;"Polygon"===f&&c.push(m),"MultiPolygon"===f&&c.push(...m)}if(c.length)return new cs(a,{type:"MultiPolygon",coordinates:c})}else if("Feature"===a.type){const c=a.geometry.type;if("Polygon"===c||"MultiPolygon"===c)return new cs(a,a.geometry)}else if("Polygon"===a.type||"MultiPolygon"===a.type)return new cs(a,a)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(r,a){const c=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],f=r.canonicalID();if("Polygon"===a.type){const m=ls(a.coordinates,d,f),_=Ic(r.geometry(),c,d,f);if(!ia(c,d))return!1;for(const x of _)if(!ss(x,m))return!1}if("MultiPolygon"===a.type){const m=ra(a.coordinates,d,f),_=Ic(r.geometry(),c,d,f);if(!ia(c,d))return!1;for(const x of _)if(!mo(x,m))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(r,a){const c=[1/0,1/0,-1/0,-1/0],d=[1/0,1/0,-1/0,-1/0],f=r.canonicalID();if("Polygon"===a.type){const m=ls(a.coordinates,d,f),_=bc(r.geometry(),c,d,f);if(!ia(c,d))return!1;for(const x of _)if(!Ns(x,m))return!1}if("MultiPolygon"===a.type){const m=ra(a.coordinates,d,f),_=bc(r.geometry(),c,d,f);if(!ia(c,d))return!1;for(const x of _)if(!Wo(x,m))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let wc=class{constructor(i=[],t=((r,a)=>r<a?-1:r>a?1:0)){if(this.data=i,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(i){this.data.push(i),this._up(this.length++)}pop(){if(0===this.length)return;const i=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),i}peek(){return this.data[0]}_up(i){const{data:t,compare:r}=this,a=t[i];for(;i>0;){const c=i-1>>1,d=t[c];if(r(a,d)>=0)break;t[i]=d,i=c}t[i]=a}_down(i){const{data:t,compare:r}=this,a=this.length>>1,c=t[i];for(;i<a;){let d=1+(i<<1);const f=d+1;if(f<this.length&&r(t[f],t[d])<0&&(d=f),r(t[d],c)>=0)break;t[i]=t[d],i=d}t[i]=c}};function Xc(i,t,r,a,c){vc(i,t,r,a||i.length-1,c||xc)}function vc(i,t,r,a,c){for(;a>r;){if(a-r>600){var d=a-r+1,f=t-r+1,m=Math.log(d),_=.5*Math.exp(2*m/3),x=.5*Math.sqrt(m*_*(d-_)/d)*(f-d/2<0?-1:1);vc(i,t,Math.max(r,Math.floor(t-f*_/d+x)),Math.min(a,Math.floor(t+(d-f)*_/d+x)),c)}var Q=i[t],k=r,L=a;for(qs(i,r,t),c(i[a],Q)>0&&qs(i,r,a);k<L;){for(qs(i,k,L),k++,L--;c(i[k],Q)<0;)k++;for(;c(i[L],Q)>0;)L--}0===c(i[r],Q)?qs(i,r,L):qs(i,++L,a),L<=t&&(r=L+1),t<=L&&(a=L-1)}}function qs(i,t,r){var a=i[t];i[t]=i[r],i[r]=a}function xc(i,t){return i<t?-1:i>t?1:0}function yo(i,t){if(i.length<=1)return[i];const r=[];let a,c;for(const d of i){const f=Bc(d);0!==f&&(d.area=Math.abs(f),void 0===c&&(c=f<0),c===f<0?(a&&r.push(a),a=[d]):a.push(d))}if(a&&r.push(a),t>1)for(let d=0;d<r.length;d++)r[d].length<=t||(Xc(r[d],t,1,r[d].length-1,_o),r[d]=r[d].slice(0,t));return r}function _o(i,t){return t.area-i.area}function Bc(i){let t=0;for(let r,a,c=0,d=i.length,f=d-1;c<d;f=c++)r=i[c],a=i[f],t+=(a.x-r.x)*(r.y+a.y);return t}const Io=1/298.257223563,el=Io*(2-Io),fn=Math.PI/180;class tl{constructor(t){const r=6378.137*fn*1e3,a=Math.cos(t*fn),c=1/(1-el*(1-a*a)),d=Math.sqrt(c);this.kx=r*d*a,this.ky=r*d*c*(1-el)}distance(t,r){const a=this.wrap(t[0]-r[0])*this.kx,c=(t[1]-r[1])*this.ky;return Math.sqrt(a*a+c*c)}pointOnLine(t,r){let a,c,d,f,m=1/0;for(let _=0;_<t.length-1;_++){let x=t[_][0],Q=t[_][1],k=this.wrap(t[_+1][0]-x)*this.kx,L=(t[_+1][1]-Q)*this.ky,q=0;0===k&&0===L||(q=(this.wrap(r[0]-x)*this.kx*k+(r[1]-Q)*this.ky*L)/(k*k+L*L),q>1?(x=t[_+1][0],Q=t[_+1][1]):q>0&&(x+=k/this.kx*q,Q+=L/this.ky*q)),k=this.wrap(r[0]-x)*this.kx,L=(r[1]-Q)*this.ky;const X=k*k+L*L;X<m&&(m=X,a=x,c=Q,d=_,f=q)}return{point:[a,c],index:d,t:Math.max(0,Math.min(1,f))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Hl(i,t){return t[0]-i[0]}function hs(i){return i[1]-i[0]+1}function pn(i,t){return i[1]>=i[0]&&i[1]<t}function Qa(i,t){if(i[0]>i[1])return[null,null];const r=hs(i);if(t){if(2===r)return[i,null];const c=Math.floor(r/2);return[[i[0],i[0]+c],[i[0]+c,i[1]]]}if(1===r)return[i,null];const a=Math.floor(r/2)-1;return[[i[0],i[0]+a],[i[0]+a+1,i[1]]]}function il(i,t){if(!pn(t,i.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let a=t[0];a<=t[1];++a)as(r,i[a]);return r}function rl(i){const t=[1/0,1/0,-1/0,-1/0];for(const r of i)for(const a of r)as(t,a);return t}function xn(i){return i[0]!==-1/0&&i[1]!==-1/0&&i[2]!==1/0&&i[3]!==1/0}function nl(i,t,r){if(!xn(i)||!xn(t))return NaN;let a=0,c=0;return i[2]<t[0]&&(a=t[0]-i[2]),i[0]>t[2]&&(a=i[0]-t[2]),i[1]>t[3]&&(c=i[1]-t[3]),i[3]<t[1]&&(c=t[1]-i[3]),r.distance([0,0],[a,c])}function ga(i,t,r){const a=r.pointOnLine(t,i);return r.distance(i,a.point)}function bo(i,t,r,a,c){const d=Math.min(ga(i,[r,a],c),ga(t,[r,a],c)),f=Math.min(ga(r,[i,t],c),ga(a,[i,t],c));return Math.min(d,f)}function Jl(i,t,r,a,c){if(!pn(t,i.length)||!pn(a,r.length))return 1/0;let d=1/0;for(let f=t[0];f<t[1];++f){const m=i[f],_=i[f+1];for(let x=a[0];x<a[1];++x){const Q=r[x],k=r[x+1];if(go(m,_,Q,k))return 0;d=Math.min(d,bo(m,_,Q,k,c))}}return d}function Er(i,t,r,a,c){if(!pn(t,i.length)||!pn(a,r.length))return NaN;let d=1/0;for(let f=t[0];f<=t[1];++f)for(let m=a[0];m<=a[1];++m)if(d=Math.min(d,c.distance(i[f],r[m])),0===d)return d;return d}function Cc(i,t,r){if(ss(i,t,!0))return 0;let a=1/0;for(const c of t){const d=c[0],f=c[c.length-1];if(d!==f&&(a=Math.min(a,ga(i,[f,d],r)),0===a))return a;const m=r.pointOnLine(c,i);if(a=Math.min(a,r.distance(i,m.point)),0===a)return a}return a}function Fi(i,t,r,a){if(!pn(t,i.length))return NaN;for(let d=t[0];d<=t[1];++d)if(ss(i[d],r,!0))return 0;let c=1/0;for(let d=t[0];d<t[1];++d){const f=i[d],m=i[d+1];for(const _ of r)for(let x=0,Q=_.length,k=Q-1;x<Q;k=x++){const L=_[k],q=_[x];if(go(f,m,L,q))return 0;c=Math.min(c,bo(f,m,L,q,a))}}return c}function al(i,t){for(const r of i)for(const a of r)if(ss(a,t,!0))return!0;return!1}function Ar(i,t,r,a=1/0){const c=rl(i),d=rl(t);if(a!==1/0&&nl(c,d,r)>=a)return a;if(ia(c,d)){if(al(i,t))return 0}else if(al(t,i))return 0;let f=1/0;for(const m of i)for(let _=0,x=m.length,Q=x-1;_<x;Q=_++){const k=m[Q],L=m[_];for(const q of t)for(let X=0,re=q.length,pe=re-1;X<re;pe=X++){const be=q[pe],Je=q[X];if(go(k,L,be,Je))return 0;f=Math.min(f,bo(k,L,be,Je,r))}}return f}function lr(i,t,r,a,c,d){if(!d)return;const f=nl(il(a,d),c,r);f<t&&i.push([f,d,[0,0]])}function ma(i,t,r,a,c,d,f){if(!d||!f)return;const m=nl(il(a,d),il(c,f),r);m<t&&i.push([m,d,f])}function wo(i,t,r,a,c=1/0){let d=Math.min(a.distance(i[0],r[0][0]),c);if(0===d)return d;const f=new wc([[0,[0,i.length-1],[0,0]]],Hl),m=rl(r);for(;f.length>0;){const _=f.pop();if(_[0]>=d)continue;const x=_[1],Q=t?50:100;if(hs(x)<=Q){if(!pn(x,i.length))return NaN;if(t){const k=Fi(i,x,r,a);if(isNaN(k)||0===k)return k;d=Math.min(d,k)}else for(let k=x[0];k<=x[1];++k){const L=Cc(i[k],r,a);if(d=Math.min(d,L),0===d)return 0}}else{const k=Qa(x,t);lr(f,d,a,i,m,k[0]),lr(f,d,a,i,m,k[1])}}return d}function us(i,t,r,a,c,d=1/0){let f=Math.min(d,c.distance(i[0],r[0]));if(0===f)return f;const m=new wc([[0,[0,i.length-1],[0,r.length-1]]],Hl);for(;m.length>0;){const _=m.pop();if(_[0]>=f)continue;const x=_[1],Q=_[2],k=t?50:100,L=a?50:100;if(hs(x)<=k&&hs(Q)<=L){if(!pn(x,i.length)&&pn(Q,r.length))return NaN;let q;if(t&&a)q=Jl(i,x,r,Q,c),f=Math.min(f,q);else if(t&&!a){const X=i.slice(x[0],x[1]+1);for(let re=Q[0];re<=Q[1];++re)if(q=ga(r[re],X,c),f=Math.min(f,q),0===f)return f}else if(!t&&a){const X=r.slice(Q[0],Q[1]+1);for(let re=x[0];re<=x[1];++re)if(q=ga(i[re],X,c),f=Math.min(f,q),0===f)return f}else q=Er(i,x,r,Q,c),f=Math.min(f,q)}else{const q=Qa(x,t),X=Qa(Q,a);ma(m,f,c,i,r,q[0],X[0]),ma(m,f,c,i,r,q[0],X[1]),ma(m,f,c,i,r,q[1],X[0]),ma(m,f,c,i,r,q[1],X[1])}}return f}function vo(i){return"MultiPolygon"===i.type?i.coordinates.map(t=>({type:"Polygon",coordinates:t})):"MultiLineString"===i.type?i.coordinates.map(t=>({type:"LineString",coordinates:t})):"MultiPoint"===i.type?i.coordinates.map(t=>({type:"Point",coordinates:t})):[i]}class As{constructor(t,r){this.type=wt,this.geojson=t,this.geometries=r}static parse(t,r){if(2!==t.length)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(xr(t[1])){const a=t[1];if("FeatureCollection"===a.type)return new As(a,a.features.map(c=>vo(c.geometry)).flat());if("Feature"===a.type)return new As(a,vo(a.geometry));if("type"in a&&"coordinates"in a)return new As(a,vo(a))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(r,a){const c=r.geometry(),d=c.flat().map(_=>ql([_.x,_.y],r.canonical));if(0===c.length)return NaN;const f=new tl(d[0][1]);let m=1/0;for(const _ of a){switch(_.type){case"Point":m=Math.min(m,us(d,!1,[_.coordinates],!1,f,m));break;case"LineString":m=Math.min(m,us(d,!1,_.coordinates,!0,f,m));break;case"Polygon":m=Math.min(m,wo(d,!1,_.coordinates,f,m))}if(0===m)return m}return m}(t,this.geometries);if("LineString"===t.geometryType())return function(r,a){const c=r.geometry(),d=c.flat().map(_=>ql([_.x,_.y],r.canonical));if(0===c.length)return NaN;const f=new tl(d[0][1]);let m=1/0;for(const _ of a){switch(_.type){case"Point":m=Math.min(m,us(d,!0,[_.coordinates],!1,f,m));break;case"LineString":m=Math.min(m,us(d,!0,_.coordinates,!0,f,m));break;case"Polygon":m=Math.min(m,wo(d,!0,_.coordinates,f,m))}if(0===m)return m}return m}(t,this.geometries);if("Polygon"===t.geometryType())return function(r,a){const c=r.geometry();if(0===c.length||0===c[0].length)return NaN;const d=yo(c,0).map(_=>_.map(x=>x.map(Q=>ql([Q.x,Q.y],r.canonical)))),f=new tl(d[0][0][0][1]);let m=1/0;for(const _ of a)for(const x of d){switch(_.type){case"Point":m=Math.min(m,wo([_.coordinates],!1,x,f,m));break;case"LineString":m=Math.min(m,wo(_.coordinates,!0,x,f,m));break;case"Polygon":m=Math.min(m,Ar(x,_.coordinates,f,m))}if(0===m)return m}return m}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Oa={"==":Kc,"!=":Zo,">":mc,"<":Ko,">=":Ol,"<=":yc,array:Sr,at:is,boolean:Sr,case:Yo,coalesce:po,collator:ns,format:$o,image:Xo,in:Fr,"index-of":Zi,interpolate:vn,"interpolate-hcl":vn,"interpolate-lab":vn,length:Nl,let:kn,literal:Ri,match:Ul,number:Sr,"number-format":Os,object:Sr,slice:rs,step:zs,string:Sr,"to-boolean":Zr,"to-color":Zr,"to-number":Zr,"to-string":Zr,var:Hi,within:cs,distance:As};class Nn{constructor(t,r,a,c){this.name=t,this.type=r,this._evaluate=a,this.args=c}evaluate(t){return this._evaluate(t,this.args)}
3eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){const a=t[0],c=Nn.definitions[a];if(!c)return r.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0);const d=Array.isArray(c)?c[0]:c.type,f=Array.isArray(c)?[[c[1],c[2]]]:c.overloads,m=f.filter(([x])=>!Array.isArray(x)||x.length===t.length-1);let _=null;for(const[x,Q]of m){_=new Dr(r.registry,xo,r.path,null,r.scope);const k=[];let L=!1;for(let q=1;q<t.length;q++){const X=t[q],re=Array.isArray(x)?x[q-1]:x.type,pe=_.parse(X,1+k.length,re);if(!pe){L=!0;break}k.push(pe)}if(!L)if(Array.isArray(x)&&x.length!==k.length)_.error(`Expected ${x.length} arguments, but found ${k.length} instead.`);else{for(let q=0;q<k.length;q++){const X=Array.isArray(x)?x[q]:x.type,re=k[q];_.concat(q+1).checkSubtype(X,re.type)}if(0===_.errors.length)return new Nn(a,d,Q,k)}}if(1===m.length)r.errors.push(..._.errors);else{const x=(m.length?m:f).map(([k])=>{return L=k,Array.isArray(L)?`(${L.map(G).join(", ")})`:`(${G(L.type)}...)`;var L}).join(" | "),Q=[];for(let k=1;k<t.length;k++){const L=r.parse(t[k],1+Q.length);if(!L)return null;Q.push(G(L.type))}r.error(`Expected arguments of type ${x}, but found (${Q.join(", ")}) instead.`)}return null}static register(t,r){Nn.definitions=r;for(const a in r)t[a]=Nn}}function jl(i,[t,r,a,c]){t=t.evaluate(i),r=r.evaluate(i),a=a.evaluate(i);const d=c?c.evaluate(i):1,f=yi(t,r,a,d);if(f)throw new Pi(f);return new xe(t/255,r/255,a/255,d,!1)}function sl(i,t){return i in t}function Na(i,t){const r=t[i];return void 0===r?null:r}function Sa(i){return{type:i}}function xo(i){if(i instanceof Hi)return xo(i.boundExpression);if(i instanceof Nn&&"error"===i.name||i instanceof ns||i instanceof cs||i instanceof As)return!1;const t=i instanceof Zr||i instanceof Sr;let r=!0;return i.eachChild(a=>{r=t?r&&xo(a):r&&a instanceof Ri}),!!r&&Bo(i)&&qa(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Bo(i){if(i instanceof Nn&&("get"===i.name&&1===i.args.length||"feature-state"===i.name||"has"===i.name&&1===i.args.length||"properties"===i.name||"geometry-type"===i.name||"id"===i.name||/^filter-/.test(i.name))||i instanceof cs||i instanceof As)return!1;let t=!0;return i.eachChild(r=>{t&&!Bo(r)&&(t=!1)}),t}function Vs(i){if(i instanceof Nn&&"feature-state"===i.name)return!1;let t=!0;return i.eachChild(r=>{t&&!Vs(r)&&(t=!1)}),t}function qa(i,t){if(i instanceof Nn&&t.indexOf(i.name)>=0)return!1;let r=!0;return i.eachChild(a=>{r&&!qa(a,t)&&(r=!1)}),r}function Da(i){return{result:"success",value:i}}function ds(i){return{result:"error",value:i}}function Hs(i){return"data-driven"===i["property-type"]||"cross-faded-data-driven"===i["property-type"]}function Co(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Eo(i){return!!i.expression&&i.expression.interpolated}function Yi(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":null===i?"null":typeof i}function Qo(i){return"object"==typeof i&&null!==i&&!Array.isArray(i)}function Ec(i){return i}function ol(i,t){const r="color"===t.type,a=i.stops&&"object"==typeof i.stops[0][0],c=a||!(a||void 0!==i.property),d=i.type||(Eo(t)?"exponential":"interval");if(r||"padding"===t.type){const Q=r?xe.parse:st.parse;(i=Y({},i)).stops&&(i.stops=i.stops.map(k=>[k[0],Q(k[1])])),i.default=Q(i.default?i.default:t.default)}if(i.colorSpace&&"rgb"!==(f=i.colorSpace)&&"hcl"!==f&&"lab"!==f)throw new Error(`Unknown color space: "${i.colorSpace}"`);var f;let m,_,x;if("exponential"===d)m=Zl;else if("interval"===d)m=So;else if("categorical"===d){m=Yl,_=Object.create(null);for(const Q of i.stops)_[Q[0]]=Q[1];x=typeof i.stops[0][0]}else{if("identity"!==d)throw new Error(`Unknown function type "${d}"`);m=Qc}if(a){const Q={},k=[];for(let X=0;X<i.stops.length;X++){const re=i.stops[X],pe=re[0].zoom;void 0===Q[pe]&&(Q[pe]={zoom:pe,type:i.type,property:i.property,default:i.default,stops:[]},k.push(pe)),Q[pe].stops.push([re[0].value,re[1]])}const L=[];
vendor: 10,659 bytes, line 3
3for(const X of k)L.push([Q[X].zoom,ol(Q[X],t)]);const q={name:"linear"};return{kind:"composite",interpolationType:q,interpolationFactor:vn.interpolationFactor.bind(void 0,q),zoomStops:L.map(X=>X[0]),evaluate:({zoom:X},re)=>Zl({stops:L,base:i.base},t,X).evaluate(X,re)}}if(c){const Q="exponential"===d?{name:"exponential",base:void 0!==i.base?i.base:1}:null;return{kind:"camera",interpolationType:Q,interpolationFactor:vn.interpolationFactor.bind(void 0,Q),zoomStops:i.stops.map(k=>k[0]),evaluate:({zoom:k})=>m(i,t,k,_,x)}}return{kind:"source",evaluate(Q,k){const L=k&&k.properties?k.properties[i.property]:void 0;return void 0===L?fs(i.default,t.default):m(i,t,L,_,x)}}}function fs(i,t,r){return void 0!==i?i:void 0!==t?t:void 0!==r?r:void 0}function Yl(i,t,r,a,c){return fs(typeof r===c?a[r]:void 0,i.default,t.default)}function So(i,t,r){if("number"!==Yi(r))return fs(i.default,t.default);const a=i.stops.length;if(1===a||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[a-1][0])return i.stops[a-1][1];const c=Ls(i.stops.map(d=>d[0]),r);return i.stops[c][1]}function Zl(i,t,r){const a=void 0!==i.base?i.base:1;if("number"!==Yi(r))return fs(i.default,t.default);const c=i.stops.length;if(1===c||r<=i.stops[0][0])return i.stops[0][1];if(r>=i.stops[c-1][0])return i.stops[c-1][1];const d=Ls(i.stops.map(Q=>Q[0]),r),f=function(Q,k,L,q){const X=q-L,re=Q-L;return 0===X?0:1===k?re/X:(Math.pow(k,re)-1)/(Math.pow(k,X)-1)}(r,a,i.stops[d][0],i.stops[d+1][0]),m=i.stops[d][1],_=i.stops[d+1][1],x=Kr[t.type]||Ec;return"function"==typeof m.evaluate?{evaluate(...Q){const k=m.evaluate.apply(void 0,Q),L=_.evaluate.apply(void 0,Q);if(void 0!==k&&void 0!==L)return x(k,L,f,i.colorSpace)}}:x(m,_,f,i.colorSpace)}function Qc(i,t,r){switch(t.type){case"color":r=xe.parse(r);break;case"formatted":r=Ke.fromString(r.toString());break;case"resolvedImage":r=Di.fromString(r.toString());break;case"padding":r=st.parse(r);break;default:Yi(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return fs(r,i.default,t.default)}Nn.register(Oa,{error:[{kind:"error"},[Ci],(i,[t])=>{throw new Pi(t.evaluate(i))}],typeof:[Ci,[vi],(i,[t])=>G(ki(t.evaluate(i)))],"to-rgba":[O(wt,4),[Rr],(i,[t])=>{const[r,a,c,d]=t.evaluate(i).rgb;return[255*r,255*a,255*c,d]}],rgb:[Rr,[wt,wt,wt],jl],rgba:[Rr,[wt,wt,wt,wt],jl],has:{type:Ai,overloads:[[[Ci],(i,[t])=>sl(t.evaluate(i),i.properties())],[[Ci,vr],(i,[t,r])=>sl(t.evaluate(i),r.evaluate(i))]]},get:{type:vi,overloads:[[[Ci],(i,[t])=>Na(t.evaluate(i),i.properties())],[[Ci,vr],(i,[t,r])=>Na(t.evaluate(i),r.evaluate(i))]]},"feature-state":[vi,[Ci],(i,[t])=>Na(t.evaluate(i),i.featureState||{})],properties:[vr,[],i=>i.properties()],"geometry-type":[Ci,[],i=>i.geometryType()],id:[vi,[],i=>i.id()],zoom:[wt,[],i=>i.globals.zoom],"heatmap-density":[wt,[],i=>i.globals.heatmapDensity||0],"line-progress":[wt,[],i=>i.globals.lineProgress||0],accumulated:[vi,[],i=>void 0===i.globals.accumulated?null:i.globals.accumulated],"+":[wt,Sa(wt),(i,t)=>{let r=0;for(const a of t)r+=a.evaluate(i);return r}],"*":[wt,Sa(wt),(i,t)=>{let r=1;for(const a of t)r*=a.evaluate(i);return r}],"-":{type:wt,overloads:[[[wt,wt],(i,[t,r])=>t.evaluate(i)-r.evaluate(i)],[[wt],(i,[t])=>-t.evaluate(i)]]},"/":[wt,[wt,wt],(i,[t,r])=>t.evaluate(i)/r.evaluate(i)],"%":[wt,[wt,wt],(i,[t,r])=>t.evaluate(i)%r.evaluate(i)],ln2:[wt,[],()=>Math.LN2],pi:[wt,[],()=>Math.PI],e:[wt,[],()=>Math.E],"^":[wt,[wt,wt],(i,[t,r])=>Math.pow(t.evaluate(i),r.evaluate(i))],sqrt:[wt,[wt],(i,[t])=>Math.sqrt(t.evaluate(i))],log10:[wt,[wt],(i,[t])=>Math.log(t.evaluate(i))/Math.LN10],ln:[wt,[wt],(i,[t])=>Math.log(t.evaluate(i))],log2:[wt,[wt],(i,[t])=>Math.log(t.evaluate(i))/Math.LN2],sin:[wt,[wt],(i,[t])=>Math.sin(t.evaluate(i))],cos:[wt,[wt],(i,[t])=>Math.cos(t.evaluate(i))],tan:[wt,[wt],(i,[t])=>Math.tan(t.evaluate(i))],asin:[wt,[wt],(i,[t])=>Math.asin(t.evaluate(i))],acos:[wt,[wt],(i,[t])=>Math.acos(t.evaluate(i))],atan:[wt,[wt],(i,[t])=>Math.atan(t.evaluate(i))],min:[wt,Sa(wt),(i,t)=>Math.min(...t.map(r=>r.evaluate(i)))],max:[wt,Sa(wt),(i,t)=>Math.max(...t.map(r=>r.evaluate(i)))],abs:[wt,[wt],(i,[t])=>Math.abs(t.evaluate(i))],round:[wt,[wt],(i,[t])=>{const r=t.evaluate(i);return r<0?-Math.round(-r):Math.round(r)}],floor:[wt,[wt],(i,[t])=>Math.floor(t.evaluate(i))],ceil:[wt,[wt],(i,[t])=>Math.ceil(t.evaluate(i))],"filter-==":[Ai,[Ci,vi],(i,[t,r])=>i.properties()[t.value]===r.value],"filter-id-==":[Ai,[vi],(i,[t])=>i.id()===t.value],"filter-type-==":[Ai,[Ci],(i,[t])=>i.geometryType()===t.value],"filter-<":[Ai,[Ci,vi],(i,[t,r])=>{const a=i.properties()[t.value],c=r.value;return typeof a==typeof c&&a<c}],"filter-id-<":[Ai,[vi],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r<a}],"filter->":[Ai,[Ci,vi],(i,[t,r])=>{const a=i.properties()[t.value],c=r.value;return typeof a==typeof c&&a>c}],"filter-id->":[Ai,[vi],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r>a}],"filter-<=":[Ai,[Ci,vi],(i,[t,r])=>{const a=i.properties()[t.value],c=r.value;return typeof a==typeof c&&a<=c}],"filter-id-<=":[Ai,[vi],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r<=a}],"filter->=":[Ai,[Ci,vi],(i,[t,r])=>{const a=i.properties()[t.value],c=r.value;return typeof a==typeof c&&a>=c}],"filter-id->=":[Ai,[vi],(i,[t])=>{const r=i.id(),a=t.value;return typeof r==typeof a&&r>=a}],"filter-has":[Ai,[vi],(i,[t])=>t.value in i.properties()],"filter-has-id":[Ai,[],i=>null!==i.id()&&void 0!==i.id()],"filter-type-in":[Ai,[O(Ci)],(i,[t])=>t.value.indexOf(i.geometryType())>=0],"filter-id-in":[Ai,[O(vi)],(i,[t])=>t.value.indexOf(i.id())>=0],"filter-in-small":[Ai,[Ci,O(vi)],(i,[t,r])=>r.value.indexOf(i.properties()[t.value])>=0],"filter-in-large":[Ai,[Ci,O(vi)],(i,[t,r])=>function(a,c,d,f){for(;d<=f;){const m=d+f>>1;if(c[m]===a)return!0;c[m]>a?f=m-1:d=m+1}return!1}(i.properties()[t.value],r.value,0,r.value.length-1)],all:{type:Ai,overloads:[[[Ai,Ai],(i,[t,r])=>t.evaluate(i)&&r.evaluate(i)],[Sa(Ai),(i,t)=>{for(const r of t)if(!r.evaluate(i))return!1;return!0}]]},any:{type:Ai,overloads:[[[Ai,Ai],(i,[t,r])=>t.evaluate(i)||r.evaluate(i)],[Sa(Ai),(i,t)=>{for(const r of t)if(r.evaluate(i))return!0;return!1}]]},"!":[Ai,[Ai],(i,[t])=>!t.evaluate(i)],"is-supported-script":[Ai,[Ci],(i,[t])=>{const r=i.globals&&i.globals.isSupportedScript;return!r||r(t.evaluate(i))}],upcase:[Ci,[Ci],(i,[t])=>t.evaluate(i).toUpperCase()],downcase:[Ci,[Ci],(i,[t])=>t.evaluate(i).toLowerCase()],concat:[Ci,Sa(vi),(i,t)=>t.map(r=>Hr(r.evaluate(i))).join("")],"resolved-locale":[Ci,[wn],(i,[t])=>t.evaluate(i).resolvedLocale()]});class ll{constructor(t,r){var a;this.expression=t,this._warningHistory={},this._evaluator=new pa,this._defaultValue=r?"color"===(a=r).type&&Qo(a.default)?new xe(0,0,0,0):"color"===a.type?xe.parse(a.default)||null:"padding"===a.type?st.parse(a.default)||null:"variableAnchorOffsetCollection"===a.type?ei.parse(a.default)||null:void 0===a.default?null:a.default:null,this._enumValues=r&&"enum"===r.type?r.values:null}evaluateWithoutErrorHandling(t,r,a,c,d,f){return this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=a,this._evaluator.canonical=c,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=f,this.expression.evaluate(this._evaluator)}evaluate(t,r,a,c,d,f){this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=a||null,this._evaluator.canonical=c,this._evaluator.availableImages=d||null,this._evaluator.formattedSection=f||null;try{const m=this.expression.evaluate(this._evaluator);if(null==m||"number"==typeof m&&m!=m)return this._defaultValue;if(this._enumValues&&!(m in this._enumValues))throw new Pi(`Expected value to be one of ${Object.keys(this._enumValues).map(_=>JSON.stringify(_)).join(", ")}, but found ${JSON.stringify(m)} instead.`);return m}catch(m){return this._warningHistory[m.message]||(this._warningHistory[m.message]=!0,typeof console<"u"&&console.warn(m.message)),this._defaultValue}}}function cl(i){return Array.isArray(i)&&i.length>0&&"string"==typeof i[0]&&i[0]in Oa}function ps(i,t){const r=new Dr(Oa,xo,[],t?function(c){const d={color:Rr,string:Ci,number:wt,enum:Ci,boolean:Ai,formatted:zn,padding:Un,resolvedImage:Gn,variableAnchorOffsetCollection:me};return"array"===c.type?O(d[c.value]||vi,c.length):d[c.type]}(t):void 0),a=r.parse(i,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return a?Da(new ll(a,t)):ds(r.errors)}class gs{constructor(t,r){this.kind=t,this._styleExpression=r,this.isStateDependent="constant"!==t&&!Vs(r.expression)}evaluateWithoutErrorHandling(t,r,a,c,d,f){return this._styleExpression.evaluateWithoutErrorHandling(t,r,a,c,d,f)}evaluate(t,r,a,c,d,f){return this._styleExpression.evaluate(t,r,a,c,d,f)}}class ms{constructor(t,r,a,c){this.kind=t,this.zoomStops=a,this._styleExpression=r,this.isStateDependent="camera"!==t&&!Vs(r.expression),this.interpolationType=c}evaluateWithoutErrorHandling(t,r,a,c,d,f){return this._styleExpression.evaluateWithoutErrorHandling(t,r,a,c,d,f)}evaluate(t,r,a,c,d,f){return this._styleExpression.evaluate(t,r,a,c,d,f)}interpolationFactor(t,r,a){return this.interpolationType?vn.interpolationFactor(this.interpolationType,t,r,a):0}}function hl(i,t){const r=ps(i,t);if("error"===r.result)return r;const a=r.value.expression,c=Bo(a);if(!c&&!Hs(t))return ds([new dt("","data expressions not supported")]);const d=qa(a,["zoom"]);if(!d&&!Co(t))return ds([new dt("","zoom expressions not supported")]);const f=Do(a);return f||d?f instanceof dt?ds([f]):f instanceof vn&&!Eo(t)?ds([new dt("",'"interpolate" expressions cannot be used with this property')]):Da(f?new ms(c?"camera":"composite",r.value,f.labels,f instanceof vn?f.interpolation:void 0):new gs(c?"constant":"source",r.value)):ds([new dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Js{constructor(t,r){this._parameters=t,this._specification=r,Y(this,ol(this._parameters,this._specification))}static deserialize(t){return new Js(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Do(i){let t=null;if(i instanceof kn)t=Do(i.result);else if(i instanceof po){for(const r of i.args)if(t=Do(r),t)break}else(i instanceof zs||i instanceof vn)&&i.input instanceof Nn&&"zoom"===i.input.name&&(t=i);return t instanceof dt||i.eachChild(r=>{const a=Do(r);a instanceof dt?t=a:!t&&a?t=new dt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&a&&t!==a&&(t=new dt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function ko(i){if(!0===i||!1===i)return!0;
vendor: 16,821 bytes, line 3
3if(!Array.isArray(i)||0===i.length)return!1;switch(i[0]){case"has":return i.length>=2&&"$id"!==i[1]&&"$type"!==i[1];case"in":return i.length>=3&&("string"!=typeof i[1]||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==i.length||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const t of i.slice(1))if(!ko(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const js={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ka(i){if(null==i)return{filter:()=>!0,needGeometry:!1};ko(i)||(i=ul(i));const t=ps(i,js);if("error"===t.result)throw new Error(t.value.map(r=>`${r.key}: ${r.message}`).join(", "));return{filter:(r,a,c)=>t.value.evaluate(r,a,{},c),needGeometry:ya(i)}}function ys(i,t){return i<t?-1:i>t?1:0}function ya(i){if(!Array.isArray(i))return!1;if("within"===i[0]||"distance"===i[0])return!0;for(let t=1;t<i.length;t++)if(ya(i[t]))return!0;return!1}function ul(i){if(!i)return!0;const t=i[0];return i.length<=1?"any"!==t:"=="===t?Al(i[1],i[2],"=="):"!="===t?an(Al(i[1],i[2],"==")):"<"===t||">"===t||"<="===t||">="===t?Al(i[1],i[2],t):"any"===t?(r=i.slice(1),["any"].concat(r.map(ul))):"all"===t?["all"].concat(i.slice(1).map(ul)):"none"===t?["all"].concat(i.slice(1).map(ul).map(an)):"in"===t?Mo(i[1],i.slice(2)):"!in"===t?an(Mo(i[1],i.slice(2))):"has"===t?To(i[1]):"!has"!==t||an(To(i[1]));var r}function Al(i,t,r){switch(i){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,i,t]}}function Mo(i,t){if(0===t.length)return!1;switch(i){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",i,["literal",t.sort(ys)]]:["filter-in-small",i,["literal",t]]}}function To(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function an(i){return["!",i]}function _s(i){const t=typeof i;if("number"===t||"boolean"===t||"string"===t||null==i)return JSON.stringify(i);if(Array.isArray(i)){let c="[";for(const d of i)c+=`${_s(d)},`;return`${c}]`}const r=Object.keys(i).sort();let a="{";for(let c=0;c<r.length;c++)a+=`${JSON.stringify(r[c])}:${_s(i[r[c]])},`;return`${a}}`}function dl(i){let t="";for(const r of br)t+=`/${_s(i[r])}`;return t}function fl(i){const t=i.value;return t?[new b(i.key,t,"constants have been deprecated as of v8")]:[]}function Qr(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function na(i){if(Array.isArray(i))return i.map(na);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const t={};for(const r in i)t[r]=na(i[r]);return t}return Qr(i)}function $r(i){const t=i.key,r=i.value,a=i.valueSpec||{},c=i.objectElementValidators||{},d=i.style,f=i.styleSpec,m=i.validateSpec;let _=[];const x=Yi(r);if("object"!==x)return[new b(t,r,`object expected, ${x} found`)];for(const Q in r){const k=Q.split(".")[0],L=a[k]||a["*"];let q;if(c[k])q=c[k];else if(a[k])q=m;else if(c["*"])q=c["*"];else{if(!a["*"]){_.push(new b(t,r[Q],`unknown property "${Q}"`));continue}q=m}_=_.concat(q({key:(t&&`${t}.`)+Q,value:r[Q],valueSpec:L,style:d,styleSpec:f,object:r,objectKey:Q,validateSpec:m},r))}for(const Q in a)c[Q]||a[Q].required&&void 0===a[Q].default&&void 0===r[Q]&&_.push(new b(t,r,`missing required property "${Q}"`));return _}function Va(i){const t=i.value,r=i.valueSpec,a=i.style,c=i.styleSpec,d=i.key,f=i.arrayElementValidator||i.validateSpec;if("array"!==Yi(t))return[new b(d,t,`array expected, ${Yi(t)} found`)];if(r.length&&t.length!==r.length)return[new b(d,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new b(d,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let m={type:r.value,values:r.values};c.$version<7&&(m.function=r.function),"object"===Yi(r.value)&&(m=r.value);let _=[];for(let x=0;x<t.length;x++)_=_.concat(f({array:t,arrayIndex:x,value:t[x],valueSpec:m,validateSpec:i.validateSpec,style:a,styleSpec:c,key:`${d}[${x}]`}));return _}function Ys(i){const t=i.key,r=i.value,a=i.valueSpec;let c=Yi(r);return"number"===c&&r!=r&&(c="NaN"),"number"!==c?[new b(t,r,`number expected, ${c} found`)]:"minimum"in a&&r<a.minimum?[new b(t,r,`${r} is less than the minimum value ${a.minimum}`)]:"maximum"in a&&r>a.maximum?[new b(t,r,`${r} is greater than the maximum value ${a.maximum}`)]:[]}function Is(i){const t=i.valueSpec,r=Qr(i.value.type);let a,c,d,f={};const m="categorical"!==r&&void 0===i.value.property,_=!m,x="array"===Yi(i.value.stops)&&"array"===Yi(i.value.stops[0])&&"object"===Yi(i.value.stops[0][0]),Q=$r({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(q){if("identity"===r)return[new b(q.key,q.value,'identity function may not have a "stops" property')];let X=[];const re=q.value;return X=X.concat(Va({key:q.key,value:re,valueSpec:q.valueSpec,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec,arrayElementValidator:k})),"array"===Yi(re)&&0===re.length&&X.push(new b(q.key,re,"array must have at least one stop")),X},default:function(q){return q.validateSpec({key:q.key,value:q.value,valueSpec:t,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec})}}});return"identity"===r&&m&&Q.push(new b(i.key,i.value,'missing required property "property"')),"identity"===r||i.value.stops||Q.push(new b(i.key,i.value,'missing required property "stops"')),"exponential"===r&&i.valueSpec.expression&&!Eo(i.valueSpec)&&Q.push(new b(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(_&&!Hs(i.valueSpec)?Q.push(new b(i.key,i.value,"property functions not supported")):m&&!Co(i.valueSpec)&&Q.push(new b(i.key,i.value,"zoom functions not supported"))),"categorical"!==r&&!x||void 0!==i.value.property||Q.push(new b(i.key,i.value,'"property" property is required')),Q;function k(q){let X=[];const re=q.value,pe=q.key;if("array"!==Yi(re))return[new b(pe,re,`array expected, ${Yi(re)} found`)];if(2!==re.length)return[new b(pe,re,`array length 2 expected, length ${re.length} found`)];if(x){if("object"!==Yi(re[0]))return[new b(pe,re,`object expected, ${Yi(re[0])} found`)];if(void 0===re[0].zoom)return[new b(pe,re,"object stop key must have zoom")];if(void 0===re[0].value)return[new b(pe,re,"object stop key must have value")];if(d&&d>Qr(re[0].zoom))return[new b(pe,re[0].zoom,"stop zoom values must appear in ascending order")];Qr(re[0].zoom)!==d&&(d=Qr(re[0].zoom),c=void 0,f={}),X=X.concat($r({key:`${pe}[0]`,value:re[0],valueSpec:{zoom:{}},validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec,objectElementValidators:{zoom:Ys,value:L}}))}else X=X.concat(L({key:`${pe}[0]`,value:re[0],valueSpec:{},validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec},re));return cl(na(re[1]))?X.concat([new b(`${pe}[1]`,re[1],"expressions are not allowed in function stops.")]):X.concat(q.validateSpec({key:`${pe}[1]`,value:re[1],valueSpec:t,validateSpec:q.validateSpec,style:q.style,styleSpec:q.styleSpec}))}function L(q,X){const re=Yi(q.value),pe=Qr(q.value),be=null!==q.value?q.value:X;if(a){if(re!==a)return[new b(q.key,be,`${re} stop domain type must match previous stop domain type ${a}`)]}else a=re;if("number"!==re&&"string"!==re&&"boolean"!==re)return[new b(q.key,be,"stop domain value must be a number, string, or boolean")];if("number"!==re&&"categorical"!==r){let Je=`number expected, ${re} found`;return Hs(t)&&void 0===r&&(Je+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new b(q.key,be,Je)]}return"categorical"!==r||"number"!==re||isFinite(pe)&&Math.floor(pe)===pe?"categorical"!==r&&"number"===re&&void 0!==c&&pe<c?[new b(q.key,be,"stop domain values must appear in ascending order")]:(c=pe,"categorical"===r&&pe in f?[new b(q.key,be,"stop domain values must be unique")]:(f[pe]=!0,[])):[new b(q.key,be,`integer expected, found ${pe}`)]}}function Ma(i){const t=("property"===i.expressionContext?hl:ps)(na(i.value),i.valueSpec);if("error"===t.result)return t.value.map(a=>new b(`${i.key}${a.key}`,i.value,a.message));const r=t.value.expression||t.value._styleExpression.expression;if("property"===i.expressionContext&&"text-font"===i.propertyKey&&!r.outputDefined())return[new b(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===i.expressionContext&&"layout"===i.propertyType&&!Vs(r))return[new b(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===i.expressionContext&&!Vs(r))return[new b(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&0===i.expressionContext.indexOf("cluster")){if(!qa(r,["zoom","feature-state"]))return[new b(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===i.expressionContext&&!Bo(r))return[new b(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function qn(i){const t=i.key,r=i.value,a=i.valueSpec,c=[];return Array.isArray(a.values)?-1===a.values.indexOf(Qr(r))&&c.push(new b(t,r,`expected one of [${a.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(a.values).indexOf(Qr(r))&&c.push(new b(t,r,`expected one of [${Object.keys(a.values).join(", ")}], ${JSON.stringify(r)} found`)),c}function Zs(i){return ko(na(i.value))?Ma(Y({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ta(i)}function Ta(i){const t=i.value,r=i.key;if("array"!==Yi(t))return[new b(r,t,`array expected, ${Yi(t)} found`)];const a=i.styleSpec;let c,d=[];if(t.length<1)return[new b(r,t,"filter array must have at least 1 element")];switch(d=d.concat(qn({key:`${r}[0]`,value:t[0],valueSpec:a.filter_operator,style:i.style,styleSpec:i.styleSpec})),Qr(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Qr(t[1])&&d.push(new b(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&d.push(new b(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(c=Yi(t[1]),"string"!==c&&d.push(new b(`${r}[1]`,t[1],`string expected, ${c} found`)));for(let f=2;f<t.length;f++)c=Yi(t[f]),"$type"===Qr(t[1])?d=d.concat(qn({key:`${r}[${f}]`,value:t[f],valueSpec:a.geometry_type,style:i.style,styleSpec:i.styleSpec})):"string"!==c&&"number"!==c&&"boolean"!==c&&d.push(new b(`${r}[${f}]`,t[f],`string, number, or boolean expected, ${c} found`));break;case"any":case"all":case"none":for(let f=1;f<t.length;f++)d=d.concat(Ta({key:`${r}[${f}]`,value:t[f],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":c=Yi(t[1]),2!==t.length?d.push(new b(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):"string"!==c&&d.push(new b(`${r}[1]`,t[1],`string expected, ${c} found`))}return d}function Ks(i,t){const r=i.key,a=i.validateSpec,c=i.style,d=i.styleSpec,f=i.value,m=i.objectKey,_=d[`${t}_${i.layerType}`];if(!_)return[];const x=m.match(/^(.*)-transition$/);if("paint"===t&&x&&_[x[1]]&&_[x[1]].transition)return a({key:r,value:f,valueSpec:d.transition,style:c,styleSpec:d});const Q=i.valueSpec||_[m];if(!Q)return[new b(r,f,`unknown property "${m}"`)];let k;if("string"===Yi(f)&&Hs(Q)&&!Q.tokens&&(k=/^{([^}]+)}$/.exec(f)))return[new b(r,f,`"${m}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(k[1])} }\`.`)];const L=[];return"symbol"===i.layerType&&("text-field"===m&&c&&!c.glyphs&&L.push(new b(r,f,'use of "text-field" requires a style "glyphs" property')),"text-font"===m&&Qo(na(f))&&"identity"===Qr(f.type)&&L.push(new b(r,f,'"text-font" does not support identity functions'))),L.concat(a({key:i.key,value:f,valueSpec:Q,style:c,styleSpec:d,expressionContext:"property",propertyType:t,propertyKey:m}))}function Po(i){return Ks(i,"paint")}function Kl(i){return Ks(i,"layout")}function $l(i){let t=[];const r=i.value,a=i.key,c=i.style,d=i.styleSpec;r.type||r.ref||t.push(new b(a,r,'either "type" or "ref" is required'));let f=Qr(r.type);const m=Qr(r.ref);if(r.id){const _=Qr(r.id);for(let x=0;x<i.arrayIndex;x++){const Q=c.layers[x];Qr(Q.id)===_&&t.push(new b(a,r.id,`duplicate layer id "${r.id}", previously used at line ${Q.id.__line__}`))}}if("ref"in r){let _;["type","source","source-layer","filter","layout"].forEach(x=>{x in r&&t.push(new b(a,r[x],`"${x}" is prohibited for ref layers`))}),c.layers.forEach(x=>{Qr(x.id)===m&&(_=x)}),_?_.ref?t.push(new b(a,r.ref,"ref cannot reference another ref layer")):f=Qr(_.type):t.push(new b(a,r.ref,`ref layer "${m}" not found`))}else if("background"!==f)if(r.source){const _=c.sources&&c.sources[r.source],x=_&&Qr(_.type);_?"vector"===x&&"raster"===f?t.push(new b(a,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==x&&"hillshade"===f?t.push(new b(a,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===x&&"raster"!==f?t.push(new b(a,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==x||r["source-layer"]?"raster-dem"===x&&"hillshade"!==f?t.push(new b(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==f||!r.paint||!r.paint["line-gradient"]||"geojson"===x&&_.lineMetrics||t.push(new b(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new b(a,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new b(a,r.source,`source "${r.source}" not found`))}else t.push(new b(a,r,'missing required property "source"'));return t=t.concat($r({key:a,value:r,valueSpec:d.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${a}.type`,value:r.type,valueSpec:d.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:Zs,layout:_=>$r({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>Kl(Y({layerType:f},x))}}),paint:_=>$r({layer:r,key:_.key,value:_.value,style:_.style,styleSpec:_.styleSpec,validateSpec:_.validateSpec,objectElementValidators:{"*":x=>Po(Y({layerType:f},x))}})}})),t}function bs(i){const t=i.value,r=i.key,a=Yi(t);return"string"!==a?[new b(r,t,`string expected, ${a} found`)]:[]}const pl={promoteId:function({key:i,value:t}){if("string"===Yi(t))return bs({key:i,value:t});{const r=[];for(const a in t)r.push(...bs({key:`${i}.${a}`,value:t[a]}));return r}}};function _a(i){const t=i.value,r=i.key,a=i.styleSpec,c=i.style,d=i.validateSpec;if(!t.type)return[new b(r,t,'"type" is required')];const f=Qr(t.type);let m;switch(f){case"vector":case"raster":return m=$r({key:r,value:t,valueSpec:a[`source_${f.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:pl,validateSpec:d}),m;case"raster-dem":return m=function(_){var x;const Q=null!==(x=_.sourceName)&&void 0!==x?x:"",k=_.value,L=_.styleSpec,q=L.source_raster_dem,X=_.style;let re=[];const pe=Yi(k);if(void 0===k)return re;if("object"!==pe)return re.push(new b("source_raster_dem",k,`object expected, ${pe} found`)),re;const be="custom"===Qr(k.encoding),Je=["redFactor","greenFactor","blueFactor","baseShift"],ke=_.value.encoding?`"${_.value.encoding}"`:"Default";for(const Oe in k)!be&&Je.includes(Oe)?re.push(new b(Oe,k[Oe],`In "${Q}": "${Oe}" is only valid when "encoding" is set to "custom". ${ke} encoding found`)):q[Oe]?re=re.concat(_.validateSpec({key:Oe,value:k[Oe],valueSpec:q[Oe],validateSpec:_.validateSpec,style:X,styleSpec:L})):re.push(new b(Oe,k[Oe],`unknown property "${Oe}"`));return re}({sourceName:r,value:t,style:i.style,styleSpec:a,validateSpec:d}),m;case"geojson":if(m=$r({key:r,value:t,valueSpec:a.source_geojson,style:c,styleSpec:a,validateSpec:d,objectElementValidators:pl}),t.cluster)for(const _ in t.clusterProperties){const[x,Q]=t.clusterProperties[_],k="string"==typeof x?[x,["accumulated"],["get",_]]:x;m.push(...Ma({key:`${r}.${_}.map`,value:Q,validateSpec:d,expressionContext:"cluster-map"})),m.push(...Ma({key:`${r}.${_}.reduce`,value:k,validateSpec:d,expressionContext:"cluster-reduce"}))}return m;case"video":return $r({key:r,value:t,valueSpec:a.source_video,style:c,validateSpec:d,styleSpec:a});case"image":return $r({key:r,value:t,valueSpec:a.source_image,style:c,validateSpec:d,styleSpec:a});case"canvas":return[new b(r,null,"Please use runtime APIs to add canvas sources, rather than 
3including them in stylesheets.","source.canvas")];default:return qn({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:c,validateSpec:d,styleSpec:a})}}function Ro(i){const t=i.value,r=i.styleSpec,a=r.light,c=i.style;let d=[];const f=Yi(t);if(void 0===t)return d;if("object"!==f)return d=d.concat([new b("light",t,`object expected, ${f} found`)]),d;for(const m in t){const _=m.match(/^(.*)-transition$/);d=d.concat(_&&a[_[1]]&&a[_[1]].transition?i.validateSpec({key:m,value:t[m],valueSpec:r.transition,validateSpec:i.validateSpec,style:c,styleSpec:r}):a[m]?i.validateSpec({key:m,value:t[m],valueSpec:a[m],validateSpec:i.validateSpec,style:c,styleSpec:r}):[new b(m,t[m],`unknown property "${m}"`)])}return d}function gl(i){const t=i.value,r=i.styleSpec,a=r.sky,c=i.style,d=Yi(t);if(void 0===t)return[];if("object"!==d)return[new b("sky",t,`object expected, ${d} found`)];let f=[];for(const m in t)f=f.concat(a[m]?i.validateSpec({key:m,value:t[m],valueSpec:a[m],style:c,styleSpec:r}):[new b(m,t[m],`unknown property "${m}"`)]);return f}function ws(i){const t=i.value,r=i.styleSpec,a=r.terrain,c=i.style;let d=[];const f=Yi(t);if(void 0===t)return d;if("object"!==f)return d=d.concat([new b("terrain",t,`object expected, ${f} found`)]),d;for(const m in t)d=d.concat(a[m]?i.validateSpec({key:m,value:t[m],valueSpec:a[m],validateSpec:i.validateSpec,style:c,styleSpec:r}):[new b(m,t[m],`unknown property "${m}"`)]);return d}function vs(i){let t=[];const r=i.value,a=i.key;if(Array.isArray(r)){const c=[],d=[];for(const f in r)r[f].id&&c.includes(r[f].id)&&t.push(new b(a,r,`all the sprites' ids must be unique, but ${r[f].id} is duplicated`)),c.push(r[f].id),r[f].url&&d.includes(r[f].url)&&t.push(new b(a,r,`all the sprites' URLs must be unique, but ${r[f].url} is duplicated`)),d.push(r[f].url),t=t.concat($r({key:`${a}[${f}]`,value:r[f],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return t}return bs({key:a,value:r})}const $s={"*":()=>[],array:Va,boolean:function(i){const t=i.value,r=i.key,a=Yi(t);return"boolean"!==a?[new b(r,t,`boolean expected, ${a} found`)]:[]},number:Ys,color:function(i){const t=i.key,r=i.value,a=Yi(r);return"string"!==a?[new b(t,r,`color expected, ${a} found`)]:xe.parse(String(r))?[]:[new b(t,r,`color expected, "${r}" found`)]},constants:fl,enum:qn,filter:Zs,function:Is,layer:$l,object:$r,source:_a,light:Ro,sky:gl,terrain:ws,projection:function(i){const t=i.value,r=i.styleSpec,a=r.projection,c=i.style,d=Yi(t);if(void 0===t)return[];if("object"!==d)return[new b("projection",t,`object expected, ${d} found`)];let f=[];for(const m in t)f=f.concat(a[m]?i.validateSpec({key:m,value:t[m],valueSpec:a[m],style:c,styleSpec:r}):[new b(m,t[m],`unknown property "${m}"`)]);return f},string:bs,formatted:function(i){return 0===bs(i).length?[]:Ma(i)},resolvedImage:function(i){return 0===bs(i).length?[]:Ma(i)},padding:function(i){const t=i.key,r=i.value;if("array"===Yi(r)){if(r.length<1||r.length>4)return[new b(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const a={type:"number"};let c=[];for(let d=0;d<r.length;d++)c=c.concat(i.validateSpec({key:`${t}[${d}]`,value:r[d],validateSpec:i.validateSpec,valueSpec:a}));return c}return Ys({key:t,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(i){const t=i.key,r=i.value,a=Yi(r),c=i.styleSpec;if("array"!==a||r.length<1||r.length%2!=0)return[new b(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let d=[];for(let f=0;f<r.length;f+=2)d=d.concat(qn({key:`${t}[${f}]`,value:r[f],valueSpec:c.layout_symbol["text-anchor"]})),d=d.concat(Va({key:`${t}[${f+1}]`,value:r[f+1],valueSpec:{length:2,value:"number"},validateSpec:i.validateSpec,style:i.style,styleSpec:c}));return d},sprite:vs};function Pa(i){const t=i.value,r=i.valueSpec,a=i.styleSpec;return i.validateSpec=Pa,r.expression&&Qo(Qr(t))?Is(i):r.expression&&cl(na(t))?Ma(i):r.type&&$s[r.type]?$s[r.type](i):$r(Y({},i,{valueSpec:r.type?a[r.type]:r}))}function Sc(i){const t=i.value,r=i.key,a=bs(i);return a.length||(-1===t.indexOf("{fontstack}")&&a.push(new b(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&a.push(new b(r,t,'"glyphs" url must include a "{range}" token'))),a}function Mn(i,t=Ze){let r=[];return r=r.concat(Pa({key:"",value:i,valueSpec:t.$root,styleSpec:t,style:i,validateSpec:Pa,objectElementValidators:{glyphs:Sc,"*":()=>[]}})),i.constants&&(r=r.concat(fl({key:"constants",value:i.constants,style:i,styleSpec:t,validateSpec:Pa}))),xs(r)}function Jr(i){return function(t){return i({...t,validateSpec:Pa})}}function xs(i){return[].concat(i).sort((t,r)=>t.line-r.line)}function gn(i){return function(...t){return xs(i.apply(this,t))}}Mn.source=gn(Jr(_a)),Mn.sprite=gn(Jr(vs)),Mn.glyphs=gn(Jr(Sc)),Mn.light=gn(Jr(Ro)),Mn.sky=gn(Jr(gl)),Mn.terrain=gn(Jr(ws)),Mn.layer=gn(Jr($l)),Mn.filter=gn(Jr(Zs)),Mn.paintProperty=gn(Jr(Po)),Mn.layoutProperty=gn(Jr(Kl));const aa=Mn,Xl=aa.light,ml=aa.sky,yl=aa.paintProperty,Wl=aa.layoutProperty;function _l(i,t){let r=!1;if(t&&t.length)for(const a of t)i.fire(new In(new Error(a.message))),r=!0;return r}class Bs{constructor(t,r,a){const c=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const f=new Int32Array(this.arrayBuffer);t=f[0],this.d=(r=f[1])+2*(a=f[2]);for(let _=0;_<this.d*this.d;_++){const x=f[3+_],Q=f[3+_+1];c.push(x===Q?null:f.subarray(x,Q))}const m=f[3+c.length+1];this.keys=f.subarray(f[3+c.length],m),this.bboxes=f.subarray(m),this.insert=this._insertReadonly}else{this.d=r+2*a;for(let f=0;f<this.d*this.d;f++)c.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=t,this.padding=a,this.scale=r/t,this.uid=0;const d=a/r*t;this.min=-d,this.max=t+d}
vendor: 6,069 bytes, line 3
3insert(t,r,a,c,d){this._forEachCell(r,a,c,d,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(c),this.bboxes.push(d)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,r,a,c,d,f){this.cells[d].push(f)}query(t,r,a,c,d){const f=this.min,m=this.max;if(t<=f&&r<=f&&m<=a&&m<=c&&!d)return Array.prototype.slice.call(this.keys);{const _=[];return this._forEachCell(t,r,a,c,this._queryCell,_,{},d),_}}_queryCell(t,r,a,c,d,f,m,_){const x=this.cells[d];if(null!==x){const Q=this.keys,k=this.bboxes;for(let L=0;L<x.length;L++){const q=x[L];if(void 0===m[q]){const X=4*q;(_?_(k[X+0],k[X+1],k[X+2],k[X+3]):t<=k[X+2]&&r<=k[X+3]&&a>=k[X+0]&&c>=k[X+1])?(m[q]=!0,f.push(Q[q])):m[q]=!1}}}}_forEachCell(t,r,a,c,d,f,m,_){const x=this._convertToCellCoord(t),Q=this._convertToCellCoord(r),k=this._convertToCellCoord(a),L=this._convertToCellCoord(c);for(let q=x;q<=k;q++)for(let X=Q;X<=L;X++){const re=this.d*X+q;if((!_||_(this._convertFromCellCoord(q),this._convertFromCellCoord(X),this._convertFromCellCoord(q+1),this._convertFromCellCoord(X+1)))&&d.call(this,t,r,a,c,re,f,m,_))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,r=3+this.cells.length+1+1;let a=0;for(let f=0;f<this.cells.length;f++)a+=this.cells[f].length;const c=new Int32Array(r+a+this.keys.length+this.bboxes.length);c[0]=this.extent,c[1]=this.n,c[2]=this.padding;let d=r;for(let f=0;f<t.length;f++){const m=t[f];c[3+f]=d,c.set(m,d),d+=m.length}return c[3+t.length]=d,c.set(this.keys,d),d+=this.keys.length,c[3+t.length+1]=d,c.set(this.bboxes,d),d+=this.bboxes.length,c.buffer}static serialize(t,r){const a=t.toArrayBuffer();return r&&r.push(a),{buffer:a}}static deserialize(t){return new Bs(t.buffer)}}const Bn={};function Ht(i,t,r={}){if(Bn[i])throw new Error(`${i} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:i,writeable:!1}),Bn[i]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}Ht("Object",Object),Ht("TransferableGridIndex",Bs),Ht("Color",xe),Ht("Error",Error),Ht("AJAXError",rr),Ht("ResolvedImage",Di),Ht("StylePropertyFunction",Js),Ht("StyleExpression",ll,{omit:["_evaluator"]}),Ht("ZoomDependentExpression",ms),Ht("ZoomConstantExpression",gs),Ht("CompoundExpression",Nn,{omit:["_evaluate"]});for(const i in Oa)Oa[i]._classRegistryKey||Ht(`Expression_${i}`,Oa[i]);function Ha(i){return i&&typeof ArrayBuffer<"u"&&(i instanceof ArrayBuffer||i.constructor&&"ArrayBuffer"===i.constructor.name)}function sn(i){return i.$name||i.constructor._classRegistryKey}function sa(i){return!function(t){if(null===t||"object"!=typeof t)return!1;const r=sn(t);return!(!r||"Object"===r)}(i)&&(null==i||"boolean"==typeof i||"number"==typeof i||"string"==typeof i||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||i instanceof Error||Ha(i)||Rt(i)||ArrayBuffer.isView(i)||i instanceof ImageData)}function Cs(i,t){if(sa(i))return(Ha(i)||Rt(i))&&t&&t.push(i),ArrayBuffer.isView(i)&&t&&t.push(i.buffer),i instanceof ImageData&&t&&t.push(i.data.buffer),i;if(Array.isArray(i)){const d=[];for(const f of i)d.push(Cs(f,t));return d}if("object"!=typeof i)throw new Error("can't serialize object of type "+typeof i);const r=sn(i);if(!r)throw new Error(`can't serialize object of unregistered class ${i.constructor.name}`);if(!Bn[r])throw new Error(`${r} is not registered.`);const{klass:a}=Bn[r],c=a.serialize?a.serialize(i,t):{};if(a.serialize){if(t&&c===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const d in i){if(!i.hasOwnProperty(d)||Bn[r].omit.indexOf(d)>=0)continue;const f=i[d];c[d]=Bn[r].shallow.indexOf(d)>=0?f:Cs(f,t)}i instanceof Error&&(c.message=i.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(c.$name=r),c}function Es(i){if(sa(i))return i;if(Array.isArray(i))return i.map(Es);if("object"!=typeof i)throw new Error("can't deserialize object of type "+typeof i);const t=sn(i)||"Object";if(!Bn[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:r}=Bn[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(i);const a=Object.create(r.prototype);for(const c of Object.keys(i)){if("$name"===c)continue;const d=i[c];a[c]=Bn[t].shallow.indexOf(c)>=0?d:Es(d)}return a}class Il{constructor(){this.first=!0}update(t,r){const a=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=a,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=a,!0):(this.lastFloorZoom>a?(this.lastIntegerZoom=a+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<a&&(this.lastIntegerZoom=a,this.lastIntegerZoomTime=r),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=a,!0))}}const Ni={"Latin-1 Supplement":i=>i>=128&&i<=255,"Hangul Jamo":i=>i>=4352&&i<=4607,Khmer:i=>i>=6016&&i<=6143,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Katakana:i=>i>=12448&&i<=12543,Kanbun:i=>i>=12688&&i<=12703,"CJK Strokes":i=>i>=12736&&i<=12783,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"Private Use Area":i=>i>=57344&&i<=63743,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>
3=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function bl(i){for(const t of i)if(vl(t.charCodeAt(0)))return!0;return!1}function ec(i){for(const t of i)if(!Qs(t.charCodeAt(0)))return!1;return!0}function wl(i){const t=i.map(r=>{try{return new RegExp(`\\p{sc=${r}}`,"u").source}catch{return null}}).filter(r=>r);return new RegExp(t.join("|"),"u")}const tc=wl(["Arab","Dupl","Mong","Ougr","Syrc"]);function Qs(i){return!tc.test(String.fromCodePoint(i))}const ic=wl(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function vl(i){return!(746!==i&&747!==i&&(i<4352||!(Ni["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Ni["CJK Compatibility"](i)||Ni["CJK Strokes"](i)||!(!Ni["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||12336===i)||Ni["Enclosed CJK Letters and Months"](i)||Ni["Ideographic Description Characters"](i)||Ni.Kanbun(i)||Ni.Katakana(i)&&12540!==i||!(!Ni["Halfwidth and Fullwidth Forms"](i)||65288===i||65289===i||65293===i||i>=65306&&i<=65310||65339===i||65341===i||65343===i||i>=65371&&i<=65503||65507===i||i>=65512&&i<=65519)||!(!Ni["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Ni["Vertical Forms"](i)||Ni["Yijing Hexagram Symbols"](i)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(i))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(i))||ic.test(String.fromCodePoint(i)))))}function rc(i){return!(vl(i)||(t=i,Ni["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Ni["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)||Ni["Letterlike Symbols"](t)||Ni["Number Forms"](t)||Ni["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)||Ni["Control Pictures"](t)&&9251!==t||Ni["Optical Character Recognition"](t)||Ni["Enclosed Alphanumerics"](t)||Ni["Geometric Shapes"](t)||Ni["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Ni["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Ni["CJK Symbols and Punctuation"](t)||Ni.Katakana(t)||Ni["Private Use Area"](t)||Ni["CJK Compatibility Forms"](t)||Ni["Small Form Variants"](t)||Ni["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t));var t}const Wc=wl(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function nc(i){return Wc.test(String.fromCodePoint(i))}function Fo(i,t){return!(!t&&nc(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Ni.Khmer(i))}function eh(i){for(const t of i)if(nc(t.charCodeAt(0)))return!0;return!1}const nr=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(i){this.pluginStatus=i.pluginStatus,this.pluginURL=i.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(i){this.applyArabicShaping=i.applyArabicShaping,this.processBidirectionalText=i.processBidirectionalText,this.processStyledBidirectionalText=i.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class er{constructor(t,r){this.zoom=t,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Il,this.transition={})}isSupportedScript(t){return function(r,a){for(const c of r)if(!Fo(c.charCodeAt(0),a))return!1;return!0}(t,"loaded"===nr.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}
vendor: 96,228 bytes, line 3
3getCrossfadeParameters(){const t=this.zoom,r=t-Math.floor(t),a=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*a}:{fromScale:.5,toScale:1,t:1-(1-a)*r}}}class Ia{constructor(t,r){this.property=t,this.value=r,this.expression=function(a,c){if(Qo(a))return new Js(a,c);if(cl(a)){const d=hl(a,c);if("error"===d.result)throw new Error(d.value.map(f=>`${f.key}: ${f.message}`).join(", "));return d.value}{let d=a;return"color"===c.type&&"string"==typeof a?d=xe.parse(a):"padding"!==c.type||"number"!=typeof a&&!Array.isArray(a)?"variableAnchorOffsetCollection"===c.type&&Array.isArray(a)&&(d=ei.parse(a)):d=st.parse(a),{kind:"constant",evaluate:()=>d}}}(void 0===r?t.specification.default:r,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,r,a){return this.property.possiblyEvaluate(this,t,r,a)}}class xl{constructor(t){this.property=t,this.value=new Ia(t,void 0)}transitioned(t,r){return new Dc(this.property,this.value,r,ot({},t.transition,this.transition),t.now)}untransitioned(){return new Dc(this.property,this.value,null,{},0)}}class Xs{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return mt(this._values[t].value.value)}setValue(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new xl(this._values[t].property)),this._values[t].value=new Ia(this._values[t].property,null===r?void 0:mt(r))}getTransition(t){return mt(this._values[t].transition)}setTransition(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new xl(this._values[t].property)),this._values[t].transition=mt(r)||void 0}serialize(){const t={};for(const r of Object.keys(this._values)){const a=this.getValue(r);void 0!==a&&(t[r]=a);const c=this.getTransition(r);void 0!==c&&(t[`${r}-transition`]=c)}return t}transitioned(t,r){const a=new Vn(this._properties);for(const c of Object.keys(this._values))a._values[c]=this._values[c].transitioned(t,r._values[c]);return a}untransitioned(){const t=new Vn(this._properties);for(const r of Object.keys(this._values))t._values[r]=this._values[r].untransitioned();return t}}class Dc{constructor(t,r,a,c,d){this.property=t,this.value=r,this.begin=d+c.delay||0,this.end=this.begin+c.duration||0,t.specification.transition&&(c.delay||c.duration)&&(this.prior=a)}possiblyEvaluate(t,r,a){const c=t.now||0,d=this.value.possiblyEvaluate(t,r,a),f=this.prior;if(f){if(c>this.end)return this.prior=null,d;if(this.value.isDataDriven())return this.prior=null,d;if(c<this.begin)return f.possiblyEvaluate(t,r,a);{const m=(c-this.begin)/(this.end-this.begin);return this.property.interpolate(f.possiblyEvaluate(t,r,a),d,function(_){if(_<=0)return 0;if(_>=1)return 1;const x=_*_,Q=x*_;return 4*(_<.5?Q:3*(_-x)+Q-.75)}(m))}}return d}}class Vn{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,r,a){const c=new zo(this._properties);for(const d of Object.keys(this._values))c._values[d]=this._values[d].possiblyEvaluate(t,r,a);return c}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class Lo{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return void 0!==this._values[t].value}getValue(t){return mt(this._values[t].value)}setValue(t,r){this._values[t]=new Ia(this._values[t].property,null===r?void 0:mt(r))}serialize(){const t={};for(const r of Object.keys(this._values)){const a=this.getValue(r);void 0!==a&&(t[r]=a)}return t}possiblyEvaluate(t,r,a){const c=new zo(this._properties);for(const d of Object.keys(this._values))c._values[d]=this._values[d].possiblyEvaluate(t,r,a);return c}}class Xr{constructor(t,r,a){this.property=t,this.value=r,this.parameters=a}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,r,a,c){return this.property.evaluate(this.value,this.parameters,t,r,a,c)}}class zo{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class $t{constructor(t){this.specification=t}possiblyEvaluate(t,r){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(r)}interpolate(t,r,a){const c=Kr[this.specification.type];return c?c(t,r,a):t}}class ti{constructor(t,r){this.specification=t,this.overrides=r}possiblyEvaluate(t,r,a,c){return new Xr(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(r,null,{},a,c)}:t.expression,r)}interpolate(t,r,a){if("constant"!==t.value.kind||"constant"!==r.value.kind)return t;if(void 0===t.value.value||void 0===r.value.value)return new Xr(this,{kind:"constant",value:void 0},t.parameters);const c=Kr[this.specification.type];if(c){const d=c(t.value.value,r.value.value,a);return new Xr(this,{kind:"constant",value:d},t.parameters)}return t}evaluate(t,r,a,c,d,f){return"constant"===t.kind?t.value:t.evaluate(r,a,c,d,f)}}class Uo extends ti{possiblyEvaluate(t,r,a,c){if(void 0===t.value)return new Xr(this,{kind:"constant",value:void 0},r);if("constant"===t.expression.kind){const d=t.expression.evaluate(r,null,{},a,c),f="resolvedImage"===t.property.specification.type&&"string"!=typeof d?d.name:d,m=this._calculate(f,f,f,r);return new Xr(this,{kind:"constant",value:m},r)}if("camera"===t.expression.kind){const d=this._calculate(t.expression.evaluate({zoom:r.zoom-1}),t.expression.evaluate({zoom:r.zoom}),t.expression.evaluate({zoom:r.zoom+1}),r);return new Xr(this,{kind:"constant",value:d},r)}return new Xr(this,t.expression,r)}evaluate(t,r,a,c,d,f){if("source"===t.kind){const m=t.evaluate(r,a,c,d,f);return this._calculate(m,m,m,r)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(r.zoom)-1},a,c),t.evaluate({zoom:Math.floor(r.zoom)},a,c),t.evaluate({zoom:Math.floor(r.zoom)+1},a,c),r):t.value}_calculate(t,r,a,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:a,to:r}}interpolate(t){return t}}class Lr{constructor(t){this.specification=t}possiblyEvaluate(t,r,a,c){if(void 0!==t.value){if("constant"===t.expression.kind){const d=t.expression.evaluate(r,null,{},a,c);return this._calculate(d,d,d,r)}return this._calculate(t.expression.evaluate(new er(Math.floor(r.zoom-1),r)),t.expression.evaluate(new er(Math.floor(r.zoom),r)),t.expression.evaluate(new er(Math.floor(r.zoom+1),r)),r)}}_calculate(t,r,a,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:a,to:r}}interpolate(t){return t}}class Bl{constructor(t){this.specification=t}possiblyEvaluate(t,r,a,c){return!!t.expression.evaluate(r,null,{},a,c)}interpolate(){return!1}}class A{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const r in t){const a=t[r];a.specification.overridable&&this.overridableProperties.push(r);const c=this.defaultPropertyValues[r]=new Ia(a,void 0),d=this.defaultTransitionablePropertyValues[r]=new xl(a);this.defaultTransitioningPropertyValues[r]=d.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=c.possiblyEvaluate({})}}}Ht("DataDrivenProperty",ti),Ht("DataConstantProperty",$t),Ht("CrossFadedDataDrivenProperty",Uo),Ht("CrossFadedProperty",Lr),Ht("ColorRampProperty",Bl);const e="-transition";class n extends da{constructor(t,r){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new Lo(r.layout)),r.paint)){this._transitionablePaint=new Xs(r.paint);for(const a in t.paint)this.setPaintProperty(a,t.paint[a],{validate:!1});for(const a in t.layout)this.setLayoutProperty(a,t.layout[a],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new zo(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,r,a={}){null!=r&&this._validate(Wl,`layers.${this.id}.layout.${t}`,t,r,a)||("visibility"!==t?this._unevaluatedLayout.setValue(t,r):this.visibility=r)}getPaintProperty(t){return t.endsWith(e)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,r,a={}){if(null!=r&&this._validate(yl,`layers.${this.id}.paint.${t}`,t,r,a))return!1;if(t.endsWith(e))return this._transitionablePaint.setTransition(t.slice(0,-11),r||void 0),!1;{const c=this._transitionablePaint._values[t],d="cross-faded-data-driven"===c.property.specification["property-type"],f=c.value.isDataDriven(),m=c.value;this._transitionablePaint.setValue(t,r),this._handleSpecialPaintPropertyUpdate(t);const _=this._transitionablePaint._values[t].value;return _.isDataDriven()||f||d||this._handleOverridablePaintPropertyUpdate(t,m,_)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,r,a){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,r){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,r)}serialize(){const 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),kt(t,(r,a)=>!(void 0===r||"layout"===a&&!Object.keys(r).length||"paint"===a&&!Object.keys(r).length))}_validate(t,r,a,c,d={}){return(!d||!1!==d.validate)&&_l(this,t.call(aa,{key:r,layerType:this.type,objectKey:a,value:c,styleSpec:Ze,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const r=this.paint.get(t);if(r instanceof Xr&&Hs(r.property.specification)&&("source"===r.value.kind||"composite"===r.value.kind)&&r.value.isStateDependent)return!0}return!1}}const s={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class o{constructor(t,r){this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class u{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,r){return t._trim(),r&&(t.isTransferred=!0,r.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const r=Object.create(this.prototype);return r.arrayBuffer=t.arrayBuffer,r.length=t.length,r.capacity=t.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function y(i,t=1){let r=0,a=0;return{members:i.map(c=>{const d=s[c.type].BYTES_PER_ELEMENT,f=r=I(r,Math.max(t,d)),m=c.components||1;return a=Math.max(a,d),r+=d*m,{name:c.name,type:c.type,components:m,offset:f}}),size:I(r,Math.max(a,t)),alignment:t}}function I(i,t){return Math.ceil(i/t)*t}class v extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r){const a=this.length;return this.resize(a+1),this.emplace(a,t,r)}emplace(t,r,a){const c=2*t;return this.int16[c+0]=r,this.int16[c+1]=a,t}}v.prototype.bytesPerElement=4,Ht("StructArrayLayout2i4",v);class S extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,t,r,a)}emplace(t,r,a,c){const d=3*t;return this.int16[d+0]=r,this.int16[d+1]=a,this.int16[d+2]=c,t}}S.prototype.bytesPerElement=6,Ht("StructArrayLayout3i6",S);class T extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,c){const d=this.length;return this.resize(d+1),this.emplace(d,t,r,a,c)}emplace(t,r,a,c,d){const f=4*t;return this.int16[f+0]=r,this.int16[f+1]=a,this.int16[f+2]=c,this.int16[f+3]=d,t}}T.prototype.bytesPerElement=8,Ht("StructArrayLayout4i8",T);class M extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,c,d,f){const m=this.length;return this.resize(m+1),this.emplace(m,t,r,a,c,d,f)}emplace(t,r,a,c,d,f,m){const _=6*t;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=c,this.int16[_+3]=d,this.int16[_+4]=f,this.int16[_+5]=m,t}}M.prototype.bytesPerElement=12,Ht("StructArrayLayout2i4i12",M);class j extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,c,d,f){const m=this.length;return this.resize(m+1),this.emplace(m,t,r,a,c,d,f)}emplace(t,r,a,c,d,f,m){const _=4*t,x=8*t;return this.int16[_+0]=r,this.int16[_+1]=a,this.uint8[x+4]=c,this.uint8[x+5]=d,this.uint8[x+6]=f,this.uint8[x+7]=m,t}}j.prototype.bytesPerElement=8,Ht("StructArrayLayout2i4ub8",j);class ee extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r){const a=this.length;return this.resize(a+1),this.emplace(a,t,r)}emplace(t,r,a){const c=2*t;return this.float32[c+0]=r,this.float32[c+1]=a,t}}ee.prototype.bytesPerElement=8,Ht("StructArrayLayout2f8",ee);class ae extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a,c,d,f,m,_,x,Q){const k=this.length;return this.resize(k+1),this.emplace(k,t,r,a,c,d,f,m,_,x,Q)}emplace(t,r,a,c,d,f,m,_,x,Q,k){const L=10*t;return this.uint16[L+0]=r,this.uint16[L+1]=a,this.uint16[L+2]=c,this.uint16[L+3]=d,this.uint16[L+4]=f,this.uint16[L+5]=m,this.uint16[L+6]=_,this.uint16[L+7]=x,this.uint16[L+8]=Q,this.uint16[L+9]=k,t}}ae.prototype.bytesPerElement=20,Ht("StructArrayLayout10ui20",ae);class Ae extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a,c,d,f,m,_,x,Q,k,L){const q=this.length;return this.resize(q+1),this.emplace(q,t,r,a,c,d,f,m,_,x,Q,k,L)}emplace(t,r,a,c,d,f,m,_,x,Q,k,L,q){const X=12*t;return this.int16[X+0]=r,this.int16[X+1]=a,this.int16[X+2]=c,this.int16[X+3]=d,this.uint16[X+4]=f,this.uint16[X+5]=m,this.uint16[X+6]=_,this.uint16[X+7]=x,this.int16[X+8]=Q,this.int16[X+9]=k,this.int16[X+10]=L,this.int16[X+11]=q,t}}Ae.prototype.bytesPerElement=24,Ht("StructArrayLayout4i4ui4i24",Ae);class _e extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,t,r,a)}emplace(t,r,a,c){const d=3*t;return this.float32[d+0]=r,this.float32[d+1]=a,this.float32[d+2]=c,t}}_e.prototype.bytesPerElement=12,Ht("StructArrayLayout3f12",_e);class we extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint32[1*t+0]=r,t}}we.prototype.bytesPerElement=4,Ht("StructArrayLayout1ul4",we);class Ce extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a,c,d,f,m,_,x){const Q=this.length;return this.resize(Q+1),this.emplace(Q,t,r,a,c,d,f,m,_,x)}emplace(t,r,a,c,d,f,m,_,x,Q){const k=10*t,L=5*t;return this.int16[k+0]=r,this.int16[k+1]=a,this.int16[k+2]=c,this.int16[k+3]=d,this.int16[k+4]=f,this.int16[k+5]=m,this.uint32[L+3]=_,this.uint16[k+8]=x,this.uint16[k+9]=Q,t}}Ce.prototype.bytesPerElement=20,Ht("StructArrayLayout6i1ul2ui20",Ce);class de extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,c,d,f){const m=this.length;return this.resize(m+1),this.emplace(m,t,r,a,c,d,f)}emplace(t,r,a,c,d,f,m){const _=6*t;return this.int16[_+0]=r,this.int16[_+1]=a,this.int16[_+2]=c,this.int16[_+3]=d,this.int16[_+4]=f,this.int16[_+5]=m,t}}de.prototype.bytesPerElement=12,Ht("StructArrayLayout2i2i2i12",de);class Me extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,c,d){const f=this.length;return this.resize(f+1),this.emplace(f,t,r,a,c,d)}emplace(t,r,a,c,d,f){const m=4*t,_=8*t;return this.float32[m+0]=r,this.float32[m+1]=a,this.float32[m+2]=c,this.int16[_+6]=d,this.int16[_+7]=f,t}}Me.prototype.bytesPerElement=16,Ht("StructArrayLayout2f1f2i16",Me);class ze extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,r,a,c,d,f){const m=this.length;return this.resize(m+1),this.emplace(m,t,r,a,c,d,f)}emplace(t,r,a,c,d,f,m){const _=16*t,x=4*t,Q=8*t;return this.uint8[_+0]=r,this.uint8[_+1]=a,this.float32[x+1]=c,this.float32[x+2]=d,this.int16[Q+6]=f,this.int16[Q+7]=m,t}}ze.prototype.bytesPerElement=16,Ht("StructArrayLayout2ub2f2i16",ze);class Ve extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,t,r,a)}emplace(t,r,a,c){const d=3*t;return this.uint16[d+0]=r,this.uint16[d+1]=a,this.uint16[d+2]=c,t}}Ve.prototype.bytesPerElement=6,Ht("StructArrayLayout3ui6",Ve);class tt extends u{_refreshViews(){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)}emplaceBack(t,r,a,c,d,f,m,_,x,Q,k,L,q,X,re,pe,be){const Je=this.length;return this.resize(Je+1),this.emplace(Je,t,r,a,c,d,f,m,_,x,Q,k,L,q,X,re,pe,be)}emplace(t,r,a,c,d,f,m,_,x,Q,k,L,q,X,re,pe,be,Je){const ke=24*t,Oe=12*t,nt=48*t;return this.int16[ke+0]=r,this.int16[ke+1]=a,this.uint16[ke+2]=c,this.uint16[ke+3]=d,this.uint32[Oe+2]=f,this.uint32[Oe+3]=m,this.uint32[Oe+4]=_,this.uint16[ke+10]=x,this.uint16[ke+11]=Q,this.uint16[ke+12]=k,this.float32[Oe+7]=L,this.float32[Oe+8]=q,this.uint8[nt+36]=X,this.uint8[nt+37]=re,this.uint8[nt+38]=pe,this.uint32[Oe+10]=be,this.int16[ke+22]=Je,t}}tt.prototype.bytesPerElement=48,Ht("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",tt);class xt extends u{_refreshViews(){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)}emplaceBack(t,r,a,c,d,f,m,_,x,Q,k,L,q,X,re,pe,be,Je,ke,Oe,nt,vt,Nt,gi,Gt,Lt,si,Yt){const Jt=this.length;return this.resize(Jt+1),this.emplace(Jt,t,r,a,c,d,f,m,_,x,Q,k,L,q,X,re,pe,be,Je,ke,Oe,nt,vt,Nt,gi,Gt,Lt,si,Yt)}emplace(t,r,a,c,d,f,m,_,x,Q,k,L,q,X,re,pe,be,Je,ke,Oe,nt,vt,Nt,gi,Gt,Lt,si,Yt,Jt){const ft=32*t,oi=16*t;return this.int16[ft+0]=r,this.int16[ft+1]=a,this.int16[ft+2]=c,this.int16[ft+3]=d,this.int16[ft+4]=f,this.int16[ft+5]=m,this.int16[ft+6]=_,this.int16[ft+7]=x,this.uint16[ft+8]=Q,this.uint16[ft+9]=k,this.uint16[ft+10]=L,this.uint16[ft+11]=q,this.uint16[ft+12]=X,this.uint16[ft+13]=re,this.uint16[ft+14]=pe,this.uint16[ft+15]=be,this.uint16[ft+16]=Je,this.uint16[ft+17]=ke,this.uint16[ft+18]=Oe,this.uint16[ft+19]=nt,this.uint16[ft+20]=vt,this.uint16[ft+21]=Nt,this.uint16[ft+22]=gi,this.uint32[oi+12]=Gt,this.float32[oi+13]=Lt,this.float32[oi+14]=si,this.uint16[ft+30]=Yt,this.uint16[ft+31]=Jt,t}}xt.prototype.bytesPerElement=64,Ht("StructArrayLayout8i15ui1ul2f2ui64",xt);class Pt extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.float32[1*t+0]=r,t}}Pt.prototype.bytesPerElement=4,Ht("StructArrayLayout1f4",Pt);class Ot extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,t,r,a)}emplace(t,r,a,c){const d=3*t;return this.uint16[6*t+0]=r,this.float32[d+1]=a,this.float32[d+2]=c,t}}Ot.prototype.bytesPerElement=12,Ht("StructArrayLayout1ui2f12",Ot);class St extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r,a){const c=this.length;return this.resize(c+1),this.emplace(c,t,r,a)}emplace(t,r,a,c){const d=4*t;return this.uint32[2*t+0]=r,this.uint16[d+2]=a,this.uint16[d+3]=c,t}}St.prototype.bytesPerElement=8,Ht("StructArrayLayout1ul2ui8",St);class Mt extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,r){const a=this.length;return this.resize(a+1),this.emplace(a,t,r)}emplace(t,r,a){const c=2*t;return this.uint16[c+0]=r,this.uint16[c+1]=a,t}}Mt.prototype.bytesPerElement=4,Ht("StructArrayLayout2ui4",Mt);class jt extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const r=this.length;return this.resize(r+1),this.emplace(r,t)}emplace(t,r){return this.uint16[1*t+0]=r,t}}jt.prototype.bytesPerElement=2,Ht("StructArrayLayout1ui2",jt);class pi extends u{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,r,a,c){const d=this.length;return this.resize(d+1),this.emplace(d,t,r,a,c)}emplace(t,r,a,c,d){const f=4*t;return this.float32[f+0]=r,this.float32[f+1]=a,this.float32[f+2]=c,this.float32[f+3]=d,t}}pi.prototype.bytesPerElement=16,Ht("StructArrayLayout4f16",pi);class Et extends o{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new at(this.anchorPointX,this.anchorPointY)}}Et.prototype.size=20;class Ft extends Ce{get(t){return new Et(this,t)}}Ht("CollisionBoxArray",Ft);class _i extends o{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}_i.prototype.size=48;class ar extends tt{get(t){return new _i(this,t)}}Ht("PlacedSymbolArray",ar);class Mi extends o{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Mi.prototype.size=64;class Gi extends xt{get(t){return new Mi(this,t)}}Ht("SymbolInstanceArray",Gi);class dr extends Pt{getoffsetX(t){return this.float32[1*t+0]}}Ht("GlyphOffsetArray",dr);class on extends S{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Ht("SymbolLineVertexArray",on);class mn extends o{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}mn.prototype.size=12;class yr extends Ot{get(t){return new mn(this,t)}}Ht("TextAnchorOffsetArray",yr);class Wr extends o{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Wr.prototype.size=8;class ln extends St{get(t){return new Wr(this,t)}}Ht("FeatureIndexArray",ln);class zr extends v{}class Nr extends v{}class oa extends v{}class Ss extends M{}class Cl extends j{}class Ws extends ee{}class Hn extends ae{}class El extends Ae{}class eo extends _e{}class Jn extends we{}class jn extends de{}class Ja extends ze{}class la extends Ve{}class qr extends Mt{}const Vr=y([{name:"a_pos",components:2,type:"Int16"}],4),{members:Tn}=Vr;class Ui{constructor(t=[]){this.segments=t}prepareSegment(t,r,a,c){let d=this.segments[this.segments.length-1];return t>Ui.MAX_VERTEX_ARRAY_LENGTH&&Pe(`Max vertices per segment is ${Ui.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!d||d.vertexLength+t>Ui.MAX_VERTEX_ARRAY_LENGTH||d.sortKey!==c)&&(d={vertexOffset:r.length,primitiveOffset:a.length,vertexLength:0,primitiveLength:0},void 0!==c&&(d.sortKey=c),this.segments.push(d)),d}get(){return this.segments}destroy(){for(const t of this.segments)for(const r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,a,c){return new Ui([{vertexOffset:t,primitiveOffset:r,vertexLength:a,primitiveLength:c,vaos:{},sortKey:0}])}}function Ds(i,t){return 256*(i=bi(Math.floor(i),0,255))+bi(Math.floor(t),0,255)}Ui.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ht("SegmentVector",Ui);const to=y([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var io={exports:{}},ja=function(i,t){var r,a,c,d,f,m,_,x;for(a=i.length-(r=3&i.length),c=t,f=3432918353,m=461845907,x=0;x<a;)_=255&i.charCodeAt(x)|(255&i.charCodeAt(++x))<<8|(255&i.charCodeAt(++x))<<16|(255&i.charCodeAt(++x))<<24,++x,c=27492+(65535&(d=5*(65535&(c=(c^=_=(65535&(_=(_=(65535&_)*f+(((_>>>16)*f&65535)<<16)&4294967295)<<15|_>>>17))*m+(((_>>>16)*m&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(d>>>16)&65535)<<16);switch(_=0,r){case 3:_^=(255&i.charCodeAt(x+2))<<16;case 2:_^=(255&i.charCodeAt(x+1))<<8;case 1:c^=_=(65535&(_=(_=(65535&(_^=255&i.charCodeAt(x)))*f+(((_>>>16)*f&65535)<<16)&4294967295)<<15|_>>>17))*m+(((_>>>16)*m&65535)<<16)&4294967295}return c^=i.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0},Oo=function(i,t){for(var r,a=i.length,c=t^a,d=0;a>=4;)r=1540483477*(65535&(r=255&i.charCodeAt(d)|(255&i.charCodeAt(++d))<<8|(255&i.charCodeAt(++d))<<16|(255&i.charCodeAt(++d))<<24))+((1540483477*(r>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),a-=4,++d;switch(a){case 3:c^=(255&i.charCodeAt(d+2))<<16;case 2:c^=(255&i.charCodeAt(d+1))<<8;case 1:c=1540483477*(65535&(c^=255&i.charCodeAt(d)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0};io.exports=ja,io.exports.murmur3=ja,io.exports.murmur2=Oo;var ba=li(io.exports);class No{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,a,c){this.ids.push(Ql(t)),this.positions.push(r,a,c)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const r=Ql(t);let a=0,c=this.ids.length-1;for(;a<c;){const f=a+c>>1;this.ids[f]>=r?c=f:a=f+1}const d=[];for(;this.ids[a]===r;)d.push({index:this.positions[3*a],start:this.positions[3*a+1],end:this.positions[3*a+2]}),a++;return d}static serialize(t,r){const a=new Float64Array(t.ids),c=new Uint32Array(t.positions);return yn(a,c,0,a.length-1),r&&r.push(a.buffer,c.buffer),{ids:a,positions:c}}static deserialize(t){const r=new No;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}}function Ql(i){const t=+i;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:ba(String(i))}function yn(i,t,r,a){for(;r<a;){const c=i[r+a>>1];let d=r-1,f=a+1;for(;;){do{d++}while(i[d]<c);do{f--}while(i[f]>c);if(d>=f)break;ks(i,d,f),ks(t,3*d,3*f),ks(t,3*d+1,3*f+1),ks(t,3*d+2,3*f+2)}f-r<a-f?(yn(i,t,r,f),r=f+1):(yn(i,t,f+1,a),a=f)}}function ks(i,t,r){const a=i[t];i[t]=i[r],i[r]=a}Ht("FeaturePositionMap",No);class ro{constructor(t,r){this.gl=t.gl,this.location=r}}class Mc extends ro{constructor(t,r){super(t,r),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class th extends ro{constructor(t,r){super(t,r),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class sc extends ro{constructor(t,r){super(t,r),this.current=xe.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const Tc=new Float32Array(16);function Ra(i){return[Ds(255*i.r,255*i.g),Ds(255*i.b,255*i.a)]}class qo{constructor(t,r,a){this.value=t,this.uniformNames=r.map(c=>`u_${c}`),this.type=a}setUniform(t,r,a){t.set(a.constantOr(this.value))}getBinding(t,r,a){return"color"===this.type?new sc(t,r):new Mc(t,r)}}class no{constructor(t,r){this.uniformNames=r.map(a=>`u_${a}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=t.tlbr}setUniform(t,r,a,c){const d="u_pattern_to"===c?this.patternTo:"u_pattern_from"===c?this.patternFrom:"u_pixel_ratio_to"===c?this.pixelRatioTo:"u_pixel_ratio_from"===c?this.pixelRatioFrom:null;d&&t.set(d)}getBinding(t,r,a){return"u_pattern"===a.substr(0,9)?new th(t,r):new Mc(t,r)}}class wa{constructor(t,r,a,c){this.expression=t,this.type=a,this.maxValue=0,this.paintVertexAttributes=r.map(d=>({name:`a_${d}`,type:"Float32",components:"color"===a?2:1,offset:0})),this.paintVertexArray=new c}populatePaintArray(t,r,a,c,d){const f=this.paintVertexArray.length,m=this.expression.evaluate(new er(0),r,{},c,[],d);this.paintVertexArray.resize(t),this._setPaintValue(f,t,m)}updatePaintArray(t,r,a,c){const d=this.expression.evaluate({zoom:0},a,c);this._setPaintValue(t,r,d)}_setPaintValue(t,r,a){if("color"===this.type){const c=Ra(a);for(let d=t;d<r;d++)this.paintVertexArray.emplace(d,c[0],c[1])}else{for(let c=t;c<r;c++)this.paintVertexArray.emplace(c,a);this.maxValue=Math.max(this.maxValue,Math.abs(a))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Yn{constructor(t,r,a,c,d,f){this.expression=t,this.uniformNames=r.map(m=>`u_${m}_t`),this.type=a,this.useIntegerZoom=c,this.zoom=d,this.maxValue=0,this.paintVertexAttributes=r.map(m=>({name:`a_${m}`,type:"Float32",components:"color"===a?4:2,offset:0})),this.paintVertexArray=new f}populatePaintArray(t,r,a,c,d){const f=this.expression.evaluate(new er(this.zoom),r,{},c,[],d),m=this.expression.evaluate(new er(this.zoom+1),r,{},c,[],d),_=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(_,t,f,m)}updatePaintArray(t,r,a,c){const d=this.expression.evaluate({zoom:this.zoom},a,c),f=this.expression.evaluate({zoom:this.zoom+1},a,c);this._setPaintValue(t,r,d,f)}_setPaintValue(t,r,a,c){if("color"===this.type){const d=Ra(a),f=Ra(c);for(let m=t;m<r;m++)this.paintVertexArray.emplace(m,d[0],d[1],f[0],f[1])}else{for(let d=t;d<r;d++)this.paintVertexArray.emplace(d,a,c);this.maxValue=Math.max(this.maxValue,Math.abs(a),Math.abs(c))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,r){const a=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,c=bi(this.expression.interpolationFactor(a,this.zoom,this.zoom+1),0,1);t.set(c)}getBinding(t,r,a){return new Mc(t,r)}}class Ya{constructor(t,r,a,c,d,f){this.expression=t,this.type=r,this.useIntegerZoom=a,this.zoom=c,this.layerId=f,this.zoomInPaintVertexArray=new d,this.zoomOutPaintVertexArray=new d}populatePaintArray(t,r,a){const c=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(c,t,r.patterns&&r.patterns[this.layerId],a)}updatePaintArray(t,r,a,c,d){this._setPaintValues(t,r,a.patterns&&a.patterns[this.layerId],d)}_setPaintValues(t,r,a,c){if(!c||!a)return;const{min:d,mid:f,max:m}=a,_=c[d],x=c[f],Q=c[m];if(_&&x&&Q)for(let k=t;k<r;k++)this.zoomInPaintVertexArray.emplace(k,x.tl[0],x.tl[1],x.br[0],x.br[1],_.tl[0],_.tl[1],_.br[0],_.br[1],x.pixelRatio,_.pixelRatio),this.zoomOutPaintVertexArray.emplace(k,x.tl[0],x.tl[1],x.br[0],x.br[1],Q.tl[0],Q.tl[1],Q.br[0],Q.br[1],x.pixelRatio,Q.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,to.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,to.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Br{constructor(t,r,a){this.binders={},this._buffers=[];const c=[];for(const d in t.paint._values){if(!a(d))continue;const f=t.paint.get(d);if(!(f instanceof Xr&&Hs(f.property.specification)))continue;const m=Nh(d,t.type),_=f.value,x=f.property.specification.type,Q=f.property.useIntegerZoom,k=f.property.specification["property-type"],L="cross-faded"===k||"cross-faded-data-driven"===k;if("constant"===_.kind)this.binders[d]=L?new no(_.value,m):new qo(_.value,m,x),c.push(`/u_${d}`);else if("source"===_.kind||L){const q=so(d,x,"source");this.binders[d]=L?new Ya(_,x,Q,r,q,t.id):new wa(_,m,x,q),c.push(`/a_${d}`)}else{const q=so(d,x,"composite");this.binders[d]=new Yn(_,m,x,Q,r,q),c.push(`/z_${d}`)}}this.cacheKey=c.sort().join("")}getMaxValue(t){const r=this.binders[t];return r instanceof wa||r instanceof Yn?r.maxValue:0}populatePaintArrays(t,r,a,c,d){for(const f in this.binders){const m=this.binders[f];(m instanceof wa||m instanceof Yn||m instanceof Ya)&&m.populatePaintArray(t,r,a,c,d)}}setConstantPatternPositions(t,r){for(const a in this.binders){const c=this.binders[a];c instanceof no&&c.setConstantPatternPositions(t,r)}}updatePaintArrays(t,r,a,c,d){let f=!1;for(const m in t){const _=r.getPositions(m);for(const x of _){const Q=a.feature(x.index);for(const k in this.binders){const L=this.binders[k];if((L instanceof wa||L instanceof Yn||L instanceof Ya)&&!0===L.expression.isStateDependent){const q=c.paint.get(k);L.expression=q.value,L.updatePaintArray(x.start,x.end,Q,t[m],d),f=!0}}}}return f}defines(){const t=[];for(const r in this.binders){const a=this.binders[r];(a instanceof qo||a instanceof no)&&t.push(...a.uniformNames.map(c=>`#define HAS_UNIFORM_${c}`))}return t}getBinderAttributes(){const t=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof wa||a instanceof Yn)for(let c=0;c<a.paintVertexAttributes.length;c++)t.push(a.paintVertexAttributes[c].name);else if(a instanceof Ya)for(let c=0;c<to.members.length;c++)t.push(to.members[c].name)}return t}getBinderUniforms(){const t=[];for(const r in this.binders){const a=this.binders[r];if(a instanceof qo||a instanceof no||a instanceof Yn)for(const c of a.uniformNames)t.push(c)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,r){const a=[];for(const c in this.binders){const d=this.binders[c];if(d instanceof qo||d instanceof no||d instanceof Yn)for(const f of d.uniformNames)if(r[f]){const m=d.getBinding(t,r[f],f);a.push({name:f,property:c,binding:m})}}return a}setUniforms(t,r,a,c){for(const{name:d,property:f,binding:m}of r)this.binders[f].setUniform(m,c,a.get(f),d)}updatePaintBuffers(t){this._buffers=[];for(const r in this.binders){const a=this.binders[r];if(t&&a instanceof Ya){const c=2===t.fromScale?a.zoomInPaintVertexBuffer:a.zoomOutPaintVertexBuffer;c&&this._buffers.push(c)}else(a instanceof wa||a instanceof Yn)&&a.paintVertexBuffer&&this._buffers.push(a.paintVertexBuffer)}}upload(t){for(const r in this.binders){const a=this.binders[r];(a instanceof wa||a instanceof Yn||a instanceof Ya)&&a.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const r=this.binders[t];(r instanceof wa||r instanceof Yn||r instanceof Ya)&&r.destroy()}}}class ao{constructor(t,r,a=(()=>!0)){this.programConfigurations={};for(const c of t)this.programConfigurations[c.id]=new Br(c,r,a);this.needsUpload=!1,this._featureMap=new No,this._bufferOffset=0}populatePaintArrays(t,r,a,c,d,f){for(const m in this.programConfigurations)this.programConfigurations[m].populatePaintArrays(t,r,c,d,f);void 0!==r.id&&this._featureMap.add(r.id,a,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,r,a,c){for(const d of a)this.needsUpload=this.programConfigurations[d.id].updatePaintArrays(t,this._featureMap,r,d,c)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const r in this.programConfigurations)this.programConfigurations[r].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Nh(i,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${t}-`,"").replace(/-/g,"_")]}function so(i,t,r){const c={"line-pattern":{source:Hn,composite:Hn},"fill-pattern":{source:Hn,composite:Hn},"fill-extrusion-pattern":{source:Hn,composite:Hn}}[i];return c&&c[r]||{color:{source:ee,composite:pi},number:{source:Pt,composite:ee}}[t][r]}Ht("ConstantBinder",qo),Ht("CrossFadedConstantBinder",no),Ht("SourceExpressionBinder",wa),Ht("CrossFadedCompositeBinder",Ya),Ht("CompositeExpressionBinder",Yn),Ht("ProgramConfiguration",Br,{omit:["_buffers"]}),Ht("ProgramConfigurationSet",ao);const kr=8192,Pc=Math.pow(2,14)-1,ih=-Pc-1;function oo(i){const t=kr/i.extent,r=i.loadGeometry();for(let a=0;a<r.length;a++){const c=r[a];for(let d=0;d<c.length;d++){const f=c[d],m=Math.round(f.x*t),_=Math.round(f.y*t);f.x=bi(m,ih,Pc),f.y=bi(_,ih,Pc),(m<f.x||m>f.x+1||_<f.y||_>f.y+1)&&Pe("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Ms(i,t){return{type:i.type,id:i.id,properties:i.properties,geometry:t?oo(i):[]}}function Sl(i,t,r,a,c){i.emplaceBack(2*t+(a+1)/2,2*r+(c+1)/2)}class Rc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Nr,this.indexArray=new la,this.segments=new Ui,this.programConfigurations=new ao(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){const c=this.layers[0],d=[];let f=null,m=!1;"circle"===c.type&&(f=c.layout.get("circle-sort-key"),m=!f.isConstant());for(const{feature:_,id:x,index:Q,sourceLayerIndex:k}of t){const L=this.layers[0]._featureFilter.needGeometry,q=Ms(_,L);if(!this.layers[0]._featureFilter.filter(new er(this.zoom),q,a))continue;const X=m?f.evaluate(q,{},a):void 0,re={id:x,properties:_.properties,type:_.type,sourceLayerIndex:k,index:Q,geometry:L?q.geometry:oo(_),patterns:{},sortKey:X};d.push(re)}m&&d.sort((_,x)=>_.sortKey-x.sortKey);for(const _ of d){const{geometry:x,index:Q,sourceLayerIndex:k}=_,L=t[Q].feature;this.addFeature(_,x,Q,a),r.featureIndex.insert(L,x,Q,k,this.index)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Tn),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,r,a,c){for(const d of r)for(const f of d){const m=f.x,_=f.y;if(m<0||m>=kr||_<0||_>=kr)continue;const x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),Q=x.vertexLength;Sl(this.layoutVertexArray,m,_,-1,-1),Sl(this.layoutVertexArray,m,_,1,-1),Sl(this.layoutVertexArray,m,_,1,1),Sl(this.layoutVertexArray,m,_,-1,1),this.indexArray.emplaceBack(Q,Q+1,Q+2),this.indexArray.emplaceBack(Q,Q+3,Q+2),x.vertexLength+=4,x.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,{},c)}}function _h(i,t){for(let r=0;r<i.length;r++)if(lo(t,i[r]))return!0;for(let r=0;r<t.length;r++)if(lo(i,t[r]))return!0;return!!rh(i,t)}function Ih(i,t,r){return!!lo(i,t)||!!nh(t,i,r)}function bh(i,t){if(1===i.length)return Dl(t,i[0]);for(let r=0;r<t.length;r++){const a=t[r];for(let c=0;c<a.length;c++)if(lo(i,a[c]))return!0}for(let r=0;r<i.length;r++)if(Dl(t,i[r]))return!0;for(let r=0;r<t.length;r++)if(rh(i,t[r]))return!0;return!1}function Ts(i,t,r){if(i.length>1){if(rh(i,t))return!0;for(let a=0;a<t.length;a++)if(nh(t[a],i,r))return!0}for(let a=0;a<i.length;a++)if(nh(i[a],t,r))return!0;return!1}function rh(i,t){if(0===i.length||0===t.length)return!1;for(let r=0;r<i.length-1;r++){const a=i[r],c=i[r+1];for(let d=0;d<t.length-1;d++)if(wh(a,c,t[d],t[d+1]))return!0}return!1}function wh(i,t,r,a){return it(i,r,a)!==it(t,r,a)&&it(i,t,r)!==it(i,t,a)}function nh(i,t,r){const a=r*r;if(1===t.length)return i.distSqr(t[0])<a;for(let c=1;c<t.length;c++)if(vh(i,t[c-1],t[c])<a)return!0;return!1}function vh(i,t,r){const a=t.distSqr(r);if(0===a)return i.distSqr(t);const c=((i.x-t.x)*(r.x-t.x)+(i.y-t.y)*(r.y-t.y))/a;return i.distSqr(c<0?t:c>1?r:r.sub(t)._mult(c)._add(t))}function Dl(i,t){let r,a,c,d=!1;for(let f=0;f<i.length;f++){r=i[f];for(let m=0,_=r.length-1;m<r.length;_=m++)a=r[m],c=r[_],a.y>t.y!=c.y>t.y&&t.x<(c.x-a.x)*(t.y-a.y)/(c.y-a.y)+a.x&&(d=!d)}return d}function lo(i,t){let r=!1;for(let a=0,c=i.length-1;a<i.length;c=a++){const d=i[a],f=i[c];d.y>t.y!=f.y>t.y&&t.x<(f.x-d.x)*(t.y-d.y)/(f.y-d.y)+d.x&&(r=!r)}return r}function ah(i,t,r){const a=r[0],c=r[2];if(i.x<a.x&&t.x<a.x||i.x>c.x&&t.x>c.x||i.y<a.y&&t.y<a.y||i.y>c.y&&t.y>c.y)return!1;const d=it(i,t,r[0]);return d!==it(i,t,r[1])||d!==it(i,t,r[2])||d!==it(i,t,r[3])}function oc(i,t,r){const a=t.paint.get(i).value;return"constant"===a.kind?a.value:r.programConfigurations.get(t.id).getMaxValue(i)}function lc(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Fc(i,t,r,a,c){if(!t[0]&&!t[1])return i;const d=at.convert(t)._mult(c);"viewport"===r&&d._rotate(-a);const f=[];for(let m=0;m<i.length;m++)f.push(i[m].sub(d));return f}let kl,Lc;Ht("CircleBucket",Rc,{omit:["layers"]});var qh={get paint(){return Lc=Lc||new A({"circle-radius":new ti(Ze.paint_circle["circle-radius"]),"circle-color":new ti(Ze.paint_circle["circle-color"]),"circle-blur":new ti(Ze.paint_circle["circle-blur"]),"circle-opacity":new ti(Ze.paint_circle["circle-opacity"]),"circle-translate":new $t(Ze.paint_circle["circle-translate"]),"circle-translate-anchor":new $t(Ze.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new $t(Ze.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new $t(Ze.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ti(Ze.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ti(Ze.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ti(Ze.paint_circle["circle-stroke-opacity"])})},get layout(){return kl=kl||new A({"circle-sort-key":new ti(Ze.layout_circle["circle-sort-key"])})}},Pn=1e-6,Ml=typeof Float32Array<"u"?Float32Array:Array;function xh(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Vh(i,t,r){var a=t[0],c=t[1],d=t[2],f=t[3],m=t[4],_=t[5],x=t[6],Q=t[7],k=t[8],L=t[9],q=t[10],X=t[11],re=t[12],pe=t[13],be=t[14],Je=t[15],ke=r[0],Oe=r[1],nt=r[2],vt=r[3];return i[0]=ke*a+Oe*m+nt*k+vt*re,i[1]=ke*c+Oe*_+nt*L+vt*pe,i[2]=ke*d+Oe*x+nt*q+vt*be,i[3]=ke*f+Oe*Q+nt*X+vt*Je,i[4]=(ke=r[4])*a+(Oe=r[5])*m+(nt=r[6])*k+(vt=r[7])*re,i[5]=ke*c+Oe*_+nt*L+vt*pe,i[6]=ke*d+Oe*x+nt*q+vt*be,i[7]=ke*f+Oe*Q+nt*X+vt*Je,i[8]=(ke=r[8])*a+(Oe=r[9])*m+(nt=r[10])*k+(vt=r[11])*re,i[9]=ke*c+Oe*_+nt*L+vt*pe,i[10]=ke*d+Oe*x+nt*q+vt*be,i[11]=ke*f+Oe*Q+nt*X+vt*Je,i[12]=(ke=r[12])*a+(Oe=r[13])*m+(nt=r[14])*k+(vt=r[15])*re,i[13]=ke*c+Oe*_+nt*L+vt*pe,i[14]=ke*d+Oe*x+nt*q+vt*be,i[15]=ke*f+Oe*Q+nt*X+vt*Je,i}Math.hypot||(Math.hypot=function(){for(var i=0,t=arguments.length;t--;)i+=arguments[t]*arguments[t];return Math.sqrt(i)});var Tl,Hh=Vh;function zc(i,t,r){var a=t[0],c=t[1],d=t[2],f=t[3];return i[0]=r[0]*a+r[4]*c+r[8]*d+r[12]*f,i[1]=r[1]*a+r[5]*c+r[9]*d+r[13]*f,i[2]=r[2]*a+r[6]*c+r[10]*d+r[14]*f,i[3]=r[3]*a+r[7]*c+r[11]*d+r[15]*f,i}Tl=new Ml(4),Ml!=Float32Array&&(Tl[0]=0,Tl[1]=0,Tl[2]=0,Tl[3]=0);class Bh extends n{constructor(t){super(t,qh)}createBucket(t){return new Rc(t)}queryRadius(t){const r=t;return oc("circle-radius",this,r)+oc("circle-stroke-width",this,r)+lc(this.paint.get("circle-translate"))}queryIntersectsFeature(t,r,a,c,d,f,m,_){const x=Fc(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),f.angle,m),Q=this.paint.get("circle-radius").evaluate(r,a)+this.paint.get("circle-stroke-width").evaluate(r,a),k="map"===this.paint.get("circle-pitch-alignment"),L=k?x:(re=_,x.map(pe=>Ch(pe,re))),q=k?Q*m:Q;var re;for(const X of c)for(const re of X){const pe=k?re:Ch(re,_);let be=q;const Je=zc([],[re.x,re.y,0,1],_);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?be*=Je[3]/f.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(be*=f.cameraToCenterDistance/Je[3]),Ih(L,pe,be))return!0}return!1}}function Ch(i,t){const r=zc([],[i.x,i.y,0,1],t);return new at(r[0]/r[3],r[1]/r[3])}class Uc extends Rc{}let Za;Ht("HeatmapBucket",Uc,{omit:["layers"]});var sh={get paint(){return Za=Za||new A({"heatmap-radius":new ti(Ze.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ti(Ze.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new $t(Ze.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Bl(Ze.paint_heatmap["heatmap-color"]),"heatmap-opacity":new $t(Ze.paint_heatmap["heatmap-opacity"])})}};function cc(i,{width:t,height:r},a,c){if(c){if(c instanceof Uint8ClampedArray)c=new Uint8Array(c.buffer);else if(c.length!==t*r*a)throw new RangeError(`mismatched image size. expected: ${c.length} but got: ${t*r*a}`)}else c=new Uint8Array(t*r*a);return i.width=t,i.height=r,i.data=c,i}function oh(i,{width:t,height:r},a){if(t===i.width&&r===i.height)return;const c=cc({},{width:t,height:r},a);Gc(i,c,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,t),height:Math.min(i.height,r)},a),i.width=t,i.height=r,i.data=c.data}function Gc(i,t,r,a,c,d){if(0===c.width||0===c.height)return t;if(c.width>i.width||c.height>i.height||r.x>i.width-c.width||r.y>i.height-c.height)throw new RangeError("out of range source coordinates for image copy");if(c.width>t.width||c.height>t.height||a.x>t.width-c.width||a.y>t.height-c.height)throw new RangeError("out of range destination coordinates for image copy");const f=i.data,m=t.data;if(f===m)throw new Error("srcData equals dstData, so image is already copied");for(let _=0;_<c.height;_++){const x=((r.y+_)*i.width+r.x)*d,Q=((a.y+_)*t.width+a.x)*d;for(let k=0;k<c.width*d;k++)m[Q+k]=f[x+k]}return t}class hc{constructor(t,r){cc(this,t,1,r)}resize(t){oh(this,t,1)}clone(){return new hc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,a,c,d){Gc(t,r,a,c,d,1)}}class ca{constructor(t,r){cc(this,t,4,r)}resize(t){oh(this,t,4)}replace(t,r){r?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new ca({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,a,c,d){Gc(t,r,a,c,d,4)}}function Eh(i){const t={},r=i.resolution||256,a=i.clips?i.clips.length:1,c=i.image||new ca({width:r,height:a});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const d=(f,m,_)=>{t[i.evaluationKey]=_;const x=i.expression.evaluate(t);c.data[f+m+0]=Math.floor(255*x.r/x.a),c.data[f+m+1]=Math.floor(255*x.g/x.a),c.data[f+m+2]=Math.floor(255*x.b/x.a),c.data[f+m+3]=Math.floor(255*x.a)};if(i.clips)for(let f=0,m=0;f<a;++f,m+=4*r)for(let _=0,x=0;_<r;_++,x+=4){const Q=_/(r-1),{start:k,end:L}=i.clips[f];d(m,x,k*(1-Q)+L*Q)}else for(let f=0,m=0;f<r;f++,m+=4)d(0,m,f/(r-1));return c}Ht("AlphaImage",hc),Ht("RGBAImage",ca);const lh="big-fb";class l extends n{createBucket(t){return new Uc(t)}constructor(t){super(t,sh),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Eh({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(lh)&&this.heatmapFbos.delete(lh)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}let p;var h={get paint(){return p=p||new A({"hillshade-illumination-direction":new $t(Ze.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new $t(Ze.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new $t(Ze.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new $t(Ze.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new $t(Ze.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new $t(Ze.paint_hillshade["hillshade-accent-color"])})}};class w extends n{constructor(t){super(t,h)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}const B=y([{name:"a_pos",components:2,type:"Int16"}],4),{members:E}=B;function R(i,t,r=2){const a=t&&t.length,c=a?t[0]*r:i.length;let d=D(i,0,c,r,!0);const f=[];if(!d||d.next===d.prev)return f;let m,_,x;if(a&&(d=function(Q,k,L,q){const X=[];for(let re=0,pe=k.length;re<pe;re++){const be=D(Q,k[re]*q,re<pe-1?k[re+1]*q:Q.length,q,!1);be===be.next&&(be.steiner=!0),X.push(ye(be))}X.sort(ce);for(let re=0;re<X.length;re++)L=he(X[re],L);return L}(i,t,d,r)),i.length>80*r){m=1/0,_=1/0;let Q=-1/0,k=-1/0;for(let L=r;L<c;L+=r){const q=i[L],X=i[L+1];q<m&&(m=q),X<_&&(_=X),q>Q&&(Q=q),X>k&&(k=X)}x=Math.max(Q-m,k-_),x=0!==x?32767/x:0}return F(d,f,r,m,_,x,0),f}function D(i,t,r,a,c){let d;if(c===function(f,m,_,x){let Q=0;for(let k=m,L=_-x;k<_;k+=x)Q+=(f[L]-f[k])*(f[k+1]+f[L+1]),L=k;return Q}(i,t,r,a)>0)for(let f=t;f<r;f+=a)d=Le(f/a|0,i[f],i[f+1],d);else for(let f=r-a;f>=t;f-=a)d=Le(f/a|0,i[f],i[f+1],d);return d&&J(d,d.next)&&(Ge(d),d=d.next),d}function H(i,t){if(!i)return i;t||(t=i);let r,a=i;do{if(r=!1,a.steiner||!J(a,a.next)&&0!==De(a.prev,a,a.next))a=a.next;else{if(Ge(a),a=t=a.prev,a===a.next)break;r=!0}}while(r||a!==t);return t}function F(i,t,r,a,c,d,f){if(!i)return;!f&&d&&function(_,x,Q,k){let L=_;do{0===L.z&&(L.z=Ue(L.x,L.y,x,Q,k)),L.prevZ=L.prev,L.nextZ=L.next,L=L.next}while(L!==_);L.prevZ.nextZ=null,L.prevZ=null,function(q){let X,re=1;do{let pe,be=q;q=null;let Je=null;for(X=0;be;){X++;let ke=be,Oe=0;for(let vt=0;vt<re&&(Oe++,ke=ke.nextZ,ke);vt++);let nt=re;for(;Oe>0||nt>0&&ke;)0!==Oe&&(0===nt||!ke||be.z<=ke.z)?(pe=be,be=be.nextZ,Oe--):(pe=ke,ke=ke.nextZ,nt--),Je?Je.nextZ=pe:q=pe,pe.prevZ=Je,Je=pe;be=ke}Je.nextZ=null,re*=2}while(X>1)}(L)}(i,a,c,d);let m=i;for(;i.prev!==i.next;){const _=i.prev,x=i.next;if(d?le(i,a,c,d):V(i))t.push(_.i,i.i,x.i),Ge(i),i=x.next,m=x.next;else if((i=x)===m){f?1===f?F(i=ne(H(i),t),t,r,a,c,d,2):2===f&&N(i,t,r,a,c,d):F(H(i),t,r,a,c,d,1);break}}}function V(i){const t=i.prev,r=i,a=i.next;if(De(t,r,a)>=0)return!1;const c=t.x,d=r.x,f=a.x,m=t.y,_=r.y,x=a.y,Q=c<d?c<f?c:f:d<f?d:f,k=m<_?m<x?m:x:_<x?_:x,L=c>d?c>f?c:f:d>f?d:f,q=m>_?m>x?m:x:_>x?_:x;let X=a.next;for(;X!==t;){if(X.x>=Q&&X.x<=L&&X.y>=k&&X.y<=q&&ue(c,m,d,_,f,x,X.x,X.y)&&De(X.prev,X,X.next)>=0)return!1;X=X.next}return!0}function le(i,t,r,a){const c=i.prev,d=i,f=i.next;if(De(c,d,f)>=0)return!1;const m=c.x,_=d.x,x=f.x,Q=c.y,k=d.y,L=f.y,q=m<_?m<x?m:x:_<x?_:x,X=Q<k?Q<L?Q:L:k<L?k:L,re=m>_?m>x?m:x:_>x?_:x,pe=Q>k?Q>L?Q:L:k>L?k:L,be=Ue(q,X,t,r,a),Je=Ue(re,pe,t,r,a);let ke=i.prevZ,Oe=i.nextZ;for(;ke&&ke.z>=be&&Oe&&Oe.z<=Je;){if(ke.x>=q&&ke.x<=re&&ke.y>=X&&ke.y<=pe&&ke!==c&&ke!==f&&ue(m,Q,_,k,x,L,ke.x,ke.y)&&De(ke.prev,ke,ke.next)>=0||(ke=ke.prevZ,Oe.x>=q&&Oe.x<=re&&Oe.y>=X&&Oe.y<=pe&&Oe!==c&&Oe!==f&&ue(m,Q,_,k,x,L,Oe.x,Oe.y)&&De(Oe.prev,Oe,Oe.next)>=0))return!1;Oe=Oe.nextZ}for(;ke&&ke.z>=be;){if(ke.x>=q&&ke.x<=re&&ke.y>=X&&ke.y<=pe&&ke!==c&&ke!==f&&ue(m,Q,_,k,x,L,ke.x,ke.y)&&De(ke.prev,ke,ke.next)>=0)return!1;ke=ke.prevZ}for(;Oe&&Oe.z<=Je;){if(Oe.x>=q&&Oe.x<=re&&Oe.y>=X&&Oe.y<=pe&&Oe!==c&&Oe!==f&&ue(m,Q,_,k,x,L,Oe.x,Oe.y)&&De(Oe.prev,Oe,Oe.next)>=0)return!1;Oe=Oe.nextZ}return!0}function ne(i,t){let r=i;do{const a=r.prev,c=r.next.next;!J(a,c)&&ie(a,r,r.next,c)&&ge(a,c)&&ge(c,a)&&(t.push(a.i,r.i,c.i),Ge(r),Ge(r.next),r=i=c),r=r.next}while(r!==i);return H(r)}function N(i,t,r,a,c,d){let f=i;do{let m=f.next.next;for(;m!==f.prev;){if(f.i!==m.i&&Te(f,m)){let _=Re(f,m);return f=H(f,f.next),_=H(_,_.next),F(f,t,r,a,c,d,0),void F(_,t,r,a,c,d,0)}m=m.next}f=f.next}while(f!==i)}function ce(i,t){return i.x-t.x}function he(i,t){const r=function(c,d){let f=d;const m=c.x,_=c.y;let x,Q=-1/0;do{if(_<=f.y&&_>=f.next.y&&f.next.y!==f.y){const re=f.x+(_-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(re<=m&&re>Q&&(Q=re,x=f.x<f.next.x?f:f.next,re===m))return x}f=f.next}while(f!==d);if(!x)return null;const k=x,L=x.x,q=x.y;let X=1/0;f=x;do{if(m>=f.x&&f.x>=L&&m!==f.x&&ue(_<q?m:Q,_,L,q,_<q?Q:m,_,f.x,f.y)){const re=Math.abs(_-f.y)/(m-f.x);ge(f,c)&&(re<X||re===X&&(f.x>x.x||f.x===x.x&&oe(x,f)))&&(x=f,X=re)}f=f.next}while(f!==k);return x}(i,t);if(!r)return t;const a=Re(r,i);return H(a,a.next),H(r,r.next)}function oe(i,t){return De(i.prev,i,t.prev)<0&&De(t.next,i,i.next)<0}function Ue(i,t,r,a,c){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-r)*c|0)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-a)*c|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ye(i){let t=i,r=i;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==i);return r}function ue(i,t,r,a,c,d,f,m){return(c-f)*(t-m)>=(i-f)*(d-m)&&(i-f)*(a-m)>=(r-f)*(t-m)&&(r-f)*(d-m)>=(c-f)*(a-m)}function Te(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!function(r,a){let c=r;do{if(c.i!==r.i&&c.next.i!==r.i&&c.i!==a.i&&c.next.i!==a.i&&ie(c,c.next,r,a))return!0;c=c.next}while(c!==r);return!1}(i,t)&&(ge(i,t)&&ge(t,i)&&function(r,a){let c=r,d=!1;const f=(r.x+a.x)/2,m=(r.y+a.y)/2;do{c.y>m!=c.next.y>m&&c.next.y!==c.y&&f<(c.next.x-c.x)*(m-c.y)/(c.next.y-c.y)+c.x&&(d=!d),c=c.next}while(c!==r);return d}(i,t)&&(De(i.prev,i,t.prev)||De(i,t.prev,t))||J(i,t)&&De(i.prev,i,i.next)>0&&De(t.prev,t,t.next)>0)}function De(i,t,r){return(t.y-i.y)*(r.x-t.x)-(t.x-i.x)*(r.y-t.y)}function J(i,t){return i.x===t.x&&i.y===t.y}function ie(i,t,r,a){const c=Qe(De(i,t,r)),d=Qe(De(i,t,a)),f=Qe(De(r,a,i)),m=Qe(De(r,a,t));return c!==d&&f!==m||!(0!==c||!te(i,r,t))||!(0!==d||!te(i,a,t))||!(0!==f||!te(r,i,a))||!(0!==m||!te(r,t,a))}function te(i,t,r){return t.x<=Math.max(i.x,r.x)&&t.x>=Math.min(i.x,r.x)&&t.y<=Math.max(i.y,r.y)&&t.y>=Math.min(i.y,r.y)}function Qe(i){return i>0?1:i<0?-1:0}function ge(i,t){return De(i.prev,i,i.next)<0?De(i,t,i.next)>=0&&De(i,i.prev,t)>=0:De(i,t,i.prev)<0||De(i,i.next,t)<0}function Re(i,t){const r=He(i.i,i.x,i.y),a=He(t.i,t.x,t.y),c=i.next,d=t.prev;return i.next=t,t.prev=i,r.next=c,c.prev=r,a.next=r,r.prev=a,d.next=a,a.prev=d,a}function Le(i,t,r,a){const c=He(i,t,r);return a?(c.next=a.next,c.prev=a,a.next.prev=c,a.next=c):(c.prev=c,c.next=c),c}function Ge(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function He(i,t,r){return{i,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Xe(i,t,r){const a=r.patternDependencies;let c=!1;for(const d of t){const f=d.paint.get(`${i}-pattern`);f.isConstant()||(c=!0);const m=f.constantOr(null);m&&(c=!0,a[m.to]=!0,a[m.from]=!0)}return c}function pt(i,t,r,a,c){const d=c.patternDependencies;for(const f of t){const m=f.paint.get(`${i}-pattern`).value;if("constant"!==m.kind){let _=m.evaluate({zoom:a-1},r,{},c.availableImages),x=m.evaluate({zoom:a},r,{},c.availableImages),Q=m.evaluate({zoom:a+1},r,{},c.availableImages);_=_&&_.name?_.name:_,x=x&&x.name?x.name:x,Q=Q&&Q.name?Q.name:Q,d[_]=!0,d[x]=!0,d[Q]=!0,r.patterns[f.id]={min:_,mid:x,max:Q}}}return r}class Ye{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new oa,this.indexArray=new la,this.indexArray2=new qr,this.programConfigurations=new ao(t.layers,t.zoom),this.segments=new Ui,this.segments2=new Ui,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){this.hasPattern=Xe("fill",this.layers,r);const c=this.layers[0].layout.get("fill-sort-key"),d=!c.isConstant(),f=[];for(const{feature:m,id:_,index:x,sourceLayerIndex:Q}of t){const k=this.layers[0]._featureFilter.needGeometry,L=Ms(m,k);if(!this.layers[0]._featureFilter.filter(new er(this.zoom),L,a))continue;const q=d?c.evaluate(L,{},a,r.availableImages):void 0,X={id:_,properties:m.properties,type:m.type,sourceLayerIndex:Q,index:x,geometry:k?L.geometry:oo(m),patterns:{},sortKey:q};f.push(X)}d&&f.sort((m,_)=>m.sortKey-_.sortKey);for(const m of f){const{geometry:_,index:x,sourceLayerIndex:Q}=m;if(this.hasPattern){const k=pt("fill",this.layers,m,this.zoom,r);this.patternFeatures.push(k)}else this.addFeature(m,_,x,a,{});r.featureIndex.insert(t[x].feature,_,x,Q,this.index)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}addFeatures(t,r,a){for(const c of this.patternFeatures)this.addFeature(c,c.geometry,c.index,r,a)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,E),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,r,a,c,d){for(const f of yo(r,500)){let m=0;for(const q of f)m+=q.length;const _=this.segments.prepareSegment(m,this.layoutVertexArray,this.indexArray),x=_.vertexLength,Q=[],k=[];for(const q of f){if(0===q.length)continue;q!==f[0]&&k.push(Q.length/2);const X=this.segments2.prepareSegment(q.length,this.layoutVertexArray,this.indexArray2),re=X.vertexLength;this.layoutVertexArray.emplaceBack(q[0].x,q[0].y),this.indexArray2.emplaceBack(re+q.length-1,re),Q.push(q[0].x),Q.push(q[0].y);for(let pe=1;pe<q.length;pe++)this.layoutVertexArray.emplaceBack(q[pe].x,q[pe].y),this.indexArray2.emplaceBack(re+pe-1,re+pe),Q.push(q[pe].x),Q.push(q[pe].y);X.vertexLength+=q.length,X.primitiveLength+=q.length}const L=R(Q,k);for(let q=0;q<L.length;q+=3)this.indexArray.emplaceBack(x+L[q],x+L[q+1],x+L[q+2]);_.vertexLength+=m,_.primitiveLength+=L.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,d,c)}}let Ct,gt;Ht("FillBucket",Ye,{omit:["layers","patternFeatures"]});var ut={get paint(){return gt=gt||new A({"fill-antialias":new $t(Ze.paint_fill["fill-antialias"]),"fill-opacity":new ti(Ze.paint_fill["fill-opacity"]),"fill-color":new ti(Ze.paint_fill["fill-color"]),"fill-outline-color":new ti(Ze.paint_fill["fill-outline-color"]),"fill-translate":new $t(Ze.paint_fill["fill-translate"]),"fill-translate-anchor":new $t(Ze.paint_fill["fill-translate-anchor"]),"fill-pattern":new Uo(Ze.paint_fill["fill-pattern"])})},get layout(){return Ct=Ct||new A({"fill-sort-key":new ti(Ze.layout_fill["fill-sort-key"])})}};class ct extends n{constructor(t){super(t,ut)}recalculate(t,r){super.recalculate(t,r);const a=this.paint._values["fill-outline-color"];"constant"===a.value.kind&&void 0===a.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Ye(t)}queryRadius(){return lc(this.paint.get("fill-translate"))}queryIntersectsFeature(t,r,a,c,d,f,m){return bh(Fc(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),f.angle,m),c)}isTileClipped(){return!0}}const Xt=y([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),qt=y([{name:"a_centroid",components:2,type:"Int16"}],4),{members:di}=Xt;var Kt={},qi=ci,Oi=ui;function ui(i,t,r,a,c){this.properties={},this.extent=r,this.type=0,this._pbf=i,this._geometry=-1,this._keys=a,this._values=c,i.readFields(xi,this,t)}function xi(i,t,r){1==i?t.id=r.readVarint():2==i?function(a,c){for(var d=a.readVarint()+a.pos;a.pos<d;){var f=c._keys[a.readVarint()],m=c._values[a.readVarint()];c.properties[f]=m}}(r,t):3==i?t.type=r.readVarint():4==i&&(t._geometry=r.pos)}function ni(i){for(var t,r,a=0,c=0,d=i.length,f=d-1;c<d;f=c++)a+=((r=i[f]).x-(t=i[c]).x)*(t.y+r.y);return a}ui.types=["Unknown","Point","LineString","Polygon"],ui.prototype.loadGeometry=function(){var i=this._pbf;i.pos=this._geometry;for(var t,r=i.readVarint()+i.pos,a=1,c=0,d=0,f=0,m=[];i.pos<r;){if(c<=0){var _=i.readVarint();a=7&_,c=_>>3}if(c--,1===a||2===a)d+=i.readSVarint(),f+=i.readSVarint(),1===a&&(t&&m.push(t),t=[]),t.push(new qi(d,f));else{if(7!==a)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&m.push(t),m},ui.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var t=i.readVarint()+i.pos,r=1,a=0,c=0,d=0,f=1/0,m=-1/0,_=1/0,x=-1/0;i.pos<t;){if(a<=0){var Q=i.readVarint();r=7&Q,a=Q>>3}if(a--,1===r||2===r)(c+=i.readSVarint())<f&&(f=c),c>m&&(m=c),(d+=i.readSVarint())<_&&(_=d),d>x&&(x=d);else if(7!==r)throw new Error("unknown command "+r)}return[f,_,m,x]},ui.prototype.toGeoJSON=function(i,t,r){var a,c,d=this.extent*Math.pow(2,r),f=this.extent*i,m=this.extent*t,_=this.loadGeometry(),x=ui.types[this.type];function Q(q){for(var X=0;X<q.length;X++){var re=q[X];q[X]=[360*(re.x+f)/d-180,360/Math.PI*Math.atan(Math.exp((180-360*(re.y+m)/d)*Math.PI/180))-90]}}switch(this.type){case 1:var k=[];for(a=0;a<_.length;a++)k[a]=_[a][0];Q(_=k);break;case 2:for(a=0;a<_.length;a++)Q(_[a]);break;case 3:for(_=function(q){var X=q.length;if(X<=1)return[q];for(var re,pe,be=[],Je=0;Je<X;Je++){var ke=ni(q[Je]);0!==ke&&(void 0===pe&&(pe=ke<0),pe===ke<0?(re&&be.push(re),re=[q[Je]]):re.push(q[Je]))}return re&&be.push(re),be}(_),a=0;a<_.length;a++)for(c=0;c<_[a].length;c++)Q(_[a][c])}1===_.length?_=_[0]:x="Multi"+x;var L={type:"Feature",geometry:{type:x,coordinates:_},properties:this.properties};return"id"in this&&(L.id=this.id),L};var Mr=Oi,Cr=tr;function tr(i,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],i.readFields(Tr,this,t),this.length=this._features.length}function Tr(i,t,r){15===i?t.version=r.readVarint():1===i?t.name=r.readString():5===i?t.extent=r.readVarint():2===i?t._features.push(r.pos):3===i?t._keys.push(r.readString()):4===i&&t._values.push(function(a){for(var c=null,d=a.readVarint()+a.pos;a.pos<d;){var f=a.readVarint()>>3;c=1===f?a.readString():2===f?a.readFloat():3===f?a.readDouble():4===f?a.readVarint64():5===f?a.readVarint():6===f?a.readSVarint():7===f?a.readBoolean():null}return c}(r))}tr.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var t=this._pbf.readVarint()+this._pbf.pos;return new Mr(this._pbf,t,this.extent,this._keys,this._values)};var va=Cr;function Ps(i,t,r){if(3===i){var a=new va(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}Kt.VectorTile=function(i,t){this.layers=i.readFields(Ps,{},t)},Kt.VectorTileFeature=Oi,Kt.VectorTileLayer=Cr;const Vo=Kt.VectorTileFeature.types,Si=Math.pow(2,13);function ha(i,t,r,a,c,d,f,m){i.emplaceBack(t,r,2*Math.floor(a*Si)+f,c*Si*2,d*Si*2,Math.round(m))}class Ka{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ss,this.centroidVertexArray=new zr,this.indexArray=new la,this.programConfigurations=new ao(t.layers,t.zoom),this.segments=new Ui,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){this.features=[],this.hasPattern=Xe("fill-extrusion",this.layers,r);for(const{feature:c,id:d,index:f,sourceLayerIndex:m}of t){const _=this.layers[0]._featureFilter.needGeometry,x=Ms(c,_);if(!this.layers[0]._featureFilter.filter(new er(this.zoom),x,a))continue;const Q={id:d,sourceLayerIndex:m,index:f,geometry:_?x.geometry:oo(c),properties:c.properties,type:c.type,patterns:{}};this.hasPattern?this.features.push(pt("fill-extrusion",this.layers,Q,this.zoom,r)):this.addFeature(Q,Q.geometry,f,a,{}),r.featureIndex.insert(c,Q.geometry,f,m,this.index,!0)}}addFeatures(t,r,a){for(const c of this.features){const{geometry:d}=c;this.addFeature(c,d,c.index,r,a)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,di),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,qt.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,r,a,c,d){for(const f of yo(r,500)){const m={x:0,y:0,vertexCount:0};let _=0;for(const X of f)_+=X.length;let x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const X of f){if(0===X.length||((i=X).every(t=>t.x<0)||i.every(t=>t.x>kr)||i.every(t=>t.y<0)||i.every(t=>t.y>kr)))continue;let re=0;for(let pe=0;pe<X.length;pe++){const be=X[pe];if(pe>=1){const Je=X[pe-1];if(!Qh(be,Je)){x.vertexLength+4>Ui.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ke=be.sub(Je)._perp()._unit(),Oe=Je.dist(be);re+Oe>32768&&(re=0),ha(this.layoutVertexArray,be.x,be.y,ke.x,ke.y,0,0,re),ha(this.layoutVertexArray,be.x,be.y,ke.x,ke.y,0,1,re),m.x+=2*be.x,m.y+=2*be.y,m.vertexCount+=2,re+=Oe,ha(this.layoutVertexArray,Je.x,Je.y,ke.x,ke.y,0,0,re),ha(this.layoutVertexArray,Je.x,Je.y,ke.x,ke.y,0,1,re),m.x+=2*Je.x,m.y+=2*Je.y,m.vertexCount+=2;const nt=x.vertexLength;this.indexArray.emplaceBack(nt,nt+2,nt+1),this.indexArray.emplaceBack(nt+1,nt+2,nt+3),x.vertexLength+=4,x.primitiveLength+=2}}}}if(x.vertexLength+_>Ui.MAX_VERTEX_ARRAY_LENGTH&&(x=this.segments.prepareSegment(_,this.layoutVertexArray,this.indexArray)),"Polygon"!==Vo[t.type])continue;const Q=[],k=[],L=x.vertexLength;for(const X of f)if(0!==X.length){X!==f[0]&&k.push(Q.length/2);for(let re=0;re<X.length;re++){const pe=X[re];ha(this.layoutVertexArray,pe.x,pe.y,0,0,1,1,0),m.x+=pe.x,m.y+=pe.y,m.vertexCount+=1,Q.push(pe.x),Q.push(pe.y)}}const q=R(Q,k);for(let X=0;X<q.length;X+=3)this.indexArray.emplaceBack(L+q[X],L+q[X+2],L+q[X+1]);x.primitiveLength+=q.length/3,x.vertexLength+=_;for(let X=0;X<m.vertexCount;X++){const re=Math.floor(m.x/m.vertexCount),pe=Math.floor(m.y/m.vertexCount);this.centroidVertexArray.emplaceBack(re,pe)}}var i;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,d,c)}}function Qh(i,t){return i.x===t.x&&(i.x<0||i.x>kr)||i.y===t.y&&(i.y<0||i.y>kr)}let Rn;Ht("FillExtrusionBucket",Ka,{omit:["layers","features"]});var uc={get paint(){return Rn=Rn||new A({"fill-extrusion-opacity":new $t(Ze["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ti(Ze["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new $t(Ze["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new $t(Ze["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Uo(Ze["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ti(Ze["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ti(Ze["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new $t(Ze["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Jh extends n{constructor(t){super(t,uc)}createBucket(t){return new Ka(t)}queryRadius(){return lc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,r,a,c,d,f,m,_){const x=Fc(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),f.angle,m),Q=this.paint.get("fill-extrusion-height").evaluate(r,a),k=this.paint.get("fill-extrusion-base").evaluate(r,a),L=function(X,re,pe,be){const Je=[];for(const ke of X){const Oe=[ke.x,ke.y,0,1];zc(Oe,Oe,re),Je.push(new at(Oe[0]/Oe[3],Oe[1]/Oe[3]))}return Je}(x,_),q=function(X,re,pe,be){const Je=[],ke=[],Oe=be[8]*re,nt=be[9]*re,vt=be[10]*re,Nt=be[11]*re,gi=be[8]*pe,Gt=be[9]*pe,Lt=be[10]*pe,si=be[11]*pe;for(const Yt of X){const Jt=[],ft=[];for(const oi of Yt){const ai=oi.x,Bi=oi.y,_r=be[0]*ai+be[4]*Bi+be[12],pr=be[1]*ai+be[5]*Bi+be[13],cn=be[2]*ai+be[6]*Bi+be[14],Xa=be[3]*ai+be[7]*Bi+be[15],En=cn+vt,hn=Xa+Nt,Zn=_r+gi,Kn=pr+Gt,$n=cn+Lt,Ur=Xa+si,un=new at((_r+Oe)/hn,(pr+nt)/hn);un.z=En/hn,Jt.push(un);const Fn=new at(Zn/Ur,Kn/Ur);Fn.z=$n/Ur,ft.push(Fn)}Je.push(Jt),ke.push(ft)}return[Je,ke]}(c,k,Q,_);return function(X,re,pe){let be=1/0;bh(pe,re)&&(be=dc(pe,re[0]));for(let Je=0;Je<re.length;Je++){const ke=re[Je],Oe=X[Je];for(let nt=0;nt<ke.length-1;nt++){const vt=ke[nt],Nt=[vt,ke[nt+1],Oe[nt+1],Oe[nt],vt];_h(pe,Nt)&&(be=Math.min(be,dc(pe,Nt)))}}return be!==1/0&&be}(q[0],q[1],L)}}function Ac(i,t){return i.x*t.x+i.y*t.y}function dc(i,t){if(1===i.length){let r=0;const a=t[r++];let c;for(;!c||a.equals(c);)if(c=t[r++],!c)return 1/0;for(;r<t.length;r++){const d=t[r],f=i[0],m=c.sub(a),_=d.sub(a),x=f.sub(a),Q=Ac(m,m),k=Ac(m,_),L=Ac(_,_),q=Ac(x,m),X=Ac(x,_),re=Q*L-k*k,pe=(L*q-k*X)/re,be=(Q*X-k*q)/re,Je=a.z*(1-pe-be)+c.z*pe+d.z*be;if(isFinite(Je))return Je}return 1/0}{let r=1/0;for(const a of t)r=Math.min(r,a.z);return r}}const $a=y([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:xa}=$a,Sh=y([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:ch}=Sh,EA=Kt.VectorTileFeature.types,QA=Math.cos(Math.PI/180*37.5),_u=Math.pow(2,14)/.5;class jh{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Cl,this.layoutVertexArray2=new Ws,this.indexArray=new la,this.programConfigurations=new ao(t.layers,t.zoom),this.segments=new Ui,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,a){this.hasPattern=Xe("line",this.layers,r);const c=this.layers[0].layout.get("line-sort-key"),d=!c.isConstant(),f=[];for(const{feature:m,id:_,index:x,sourceLayerIndex:Q}of t){const k=this.layers[0]._featureFilter.needGeometry,L=Ms(m,k);if(!this.layers[0]._featureFilter.filter(new er(this.zoom),L,a))continue;const q=d?c.evaluate(L,{},a):void 0,X={id:_,properties:m.properties,type:m.type,sourceLayerIndex:Q,index:x,geometry:k?L.geometry:oo(m),patterns:{},sortKey:q};f.push(X)}d&&f.sort((m,_)=>m.sortKey-_.sortKey);for(const m of f){const{geometry:_,index:x,sourceLayerIndex:Q}=m;if(this.hasPattern){const k=pt("line",this.layers,m,this.zoom,r);this.patternFeatures.push(k)}else this.addFeature(m,_,x,a,{});r.featureIndex.insert(t[x].feature,_,x,Q,this.index)}}update(t,r,a){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,a)}addFeatures(t,r,a){for(const c of this.patternFeatures)this.addFeature(c,c.geometry,c.index,r,a)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,ch)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,xa),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,r,a,c,d){const f=this.layers[0].layout,m=f.get("line-join").evaluate(t,{}),_=f.get("line-cap"),x=f.get("line-miter-limit"),Q=f.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const k of r)this.addLine(k,t,m,_,x,Q);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,a,d,c)}addLine(t,r,a,c,d,f){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let be=0;be<t.length-1;be++)this.totalDistance+=t[be].dist(t[be+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const m="Polygon"===EA[r.type];let _=t.length;for(;_>=2&&t[_-1].equals(t[_-2]);)_--;let x=0;for(;x<_-1&&t[x].equals(t[x+1]);)x++;if(_<(m?3:2))return;"bevel"===a&&(d=1.05);const Q=this.overscaling<=16?15*kr/(512*this.overscaling):0,k=this.segments.prepareSegment(10*_,this.layoutVertexArray,this.indexArray);let L,q,X,re,pe;this.e1=this.e2=-1,m&&(L=t[_-2],pe=t[x].sub(L)._unit()._perp());for(let be=x;be<_;be++){if(X=be===_-1?m?t[x+1]:void 0:t[be+1],X&&t[be].equals(X))continue;pe&&(re=pe),L&&(q=L),L=t[be],pe=X?X.sub(L)._unit()._perp():re,re=re||pe;let Je=re.add(pe);0===Je.x&&0===Je.y||Je._unit();const ke=re.x*pe.x+re.y*pe.y,Oe=Je.x*pe.x+Je.y*pe.y,nt=0!==Oe?1/Oe:1/0,vt=2*Math.sqrt(2-2*Oe),Nt=Oe<QA&&q&&X,gi=re.x*pe.y-re.y*pe.x>0;if(Nt&&be>x){const si=L.dist(q);if(si>2*Q){const Yt=L.sub(L.sub(q)._mult(Q/si)._round());this.updateDistance(q,Yt),this.addCurrentVertex(Yt,re,0,0,k),q=Yt}}const Gt=q&&X;let Lt=Gt?a:m?"butt":c;if(Gt&&"round"===Lt&&(nt<f?Lt="miter":nt<=2&&(Lt="fakeround")),"miter"===Lt&&nt>d&&(Lt="bevel"),"bevel"===Lt&&(nt>2&&(Lt="flipbevel"),nt<d&&(Lt="miter")),q&&this.updateDistance(q,L),"miter"===Lt)Je._mult(nt),this.addCurrentVertex(L,Je,0,0,k);else if("flipbevel"===Lt){if(nt>100)Je=pe.mult(-1);else{const si=nt*re.add(pe).mag()/re.sub(pe).mag();Je._perp()._mult(si*(gi?-1:1))}this.addCurrentVertex(L,Je,0,0,k),this.addCurrentVertex(L,Je.mult(-1),0,0,k)}else if("bevel"===Lt||"fakeround"===Lt){const si=-Math.sqrt(nt*nt-1),Yt=gi?si:0,Jt=gi?0:si;if(q&&this.addCurrentVertex(L,re,Yt,Jt,k),"fakeround"===Lt){const ft=Math.round(180*vt/Math.PI/20);for(let oi=1;oi<ft;oi++){let ai=oi/ft;if(.5!==ai){const _r=ai-.5;ai+=ai*_r*(ai-1)*((1.0904+ke*(ke*(3.55645-1.43519*ke)-3.2452))*_r*_r+(.848013+ke*(.215638*ke-1.06021)))}const Bi=pe.sub(re)._mult(ai)._add(re)._unit()._mult(gi?-1:1);this.addHalfVertex(L,Bi.x,Bi.y,!1,gi,0,k)}}X&&this.addCurrentVertex(L,pe,-Yt,-Jt,k)}else if("butt"===Lt)this.addCurrentVertex(L,Je,0,0,k);else if("square"===Lt){const si=q?1:-1;this.addCurrentVertex(L,Je,si,si,k)}else"round"===Lt&&(q&&(this.addCurrentVertex(L,re,0,0,k),this.addCurrentVertex(L,re,1,1,k,!0)),X&&(this.addCurrentVertex(L,pe,-1,-1,k,!0),this.addCurrentVertex(L,pe,0,0,k)));if(Nt&&be<_-1){const si=L.dist(X);if(si>2*Q){const Yt=L.add(X.sub(L)._mult(Q/si)._round());this.updateDistance(L,Yt),this.addCurrentVertex(Yt,pe,0,0,k),L=Yt}}}}addCurrentVertex(t,r,a,c,d,f=!1){const m=r.y*c-r.x,_=-r.y-r.x*c;this.addHalfVertex(t,r.x+r.y*a,r.y-r.x*a,f,!1,a,d),this.addHalfVertex(t,m,_,f,!0,-c,d),this.distance>_u/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,r,a,c,d,f))}addHalfVertex({x:t,y:r},a,c,d,f,m,_){const x=.5*(this.lineClips?this.scaledDistance*(_u-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(d?1:0),(r<<1)+(f?1:0),Math.round(63*a)+128,Math.round(63*c)+128,1+(0===m?0:m<0?-1:1)|(63&x)<<2,x>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const Q=_.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Q),_.primitiveLength++),f?this.e2=Q:this.e1=Q}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,r){this.distance+=t.dist(r),this.updateScaledDistance()}}let Iu,bu;Ht("LineBucket",jh,{omit:["layers","patternFeatures"]});var wu={get paint(){return bu=bu||new A({"line-opacity":new ti(Ze.paint_line["line-opacity"]),"line-color":new ti(Ze.paint_line["line-color"]),"line-translate":new $t(Ze.paint_line["line-translate"]),"line-translate-anchor":new $t(Ze.paint_line["line-translate-anchor"]),"line-width":new ti(Ze.paint_line["line-width"]),"line-gap-width":new ti(Ze.paint_line["line-gap-width"]),"line-offset":new ti(Ze.paint_line["line-offset"]),"line-blur":new ti(Ze.paint_line["line-blur"]),"line-dasharray":new Lr(Ze.paint_line["line-dasharray"]),"line-pattern":new Uo(Ze.paint_line["line-pattern"]),"line-gradient":new Bl(Ze.paint_line["line-gradient"])})},get layout(){return Iu=Iu||new A({"line-cap":new $t(Ze.layout_line["line-cap"]),"line-join":new ti(Ze.layout_line["line-join"]),"line-miter-limit":new $t(Ze.layout_line["line-miter-limit"]),"line-round-limit":new $t(Ze.layout_line["line-round-limit"]),"line-sort-key":new ti(Ze.layout_line["line-sort-key"])})}};class SA extends ti{possiblyEvaluate(t,r){return r=new er(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(t,r)}evaluate(t,r,a,c){return r=ot({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(t,r,a,c)}}let Dh;class DA extends n{constructor(t){super(t,wu),this.gradientVersion=0,Dh||(Dh=new SA(wu.paint.properties["line-width"].specification),Dh.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const r=this.gradientExpression();this.stepInterpolant=!(void 0===r._styleExpression)&&r._styleExpression.expression instanceof zs,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,r){super.recalculate(t,r),this.paint._values["line-floorwidth"]=Dh.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new jh(t)}queryRadius(t){const r=t,a=vu(oc("line-width",this,r),oc("line-gap-width",this,r)),c=oc("line-offset",this,r);return a/2+Math.abs(c)+lc(this.paint.get("line-translate"))}queryIntersectsFeature(t,r,a,c,d,f,m){const _=Fc(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),f.angle,m),x=m/2*vu(this.paint.get("line-width").evaluate(r,a),this.paint.get("line-gap-width").evaluate(r,a)),Q=this.paint.get("line-offset").evaluate(r,a);return Q&&(c=function(k,L){const q=[];for(let X=0;X<k.length;X++){const re=k[X],pe=[];for(let be=0;be<re.length;be++){const Je=re[be-1],ke=re[be],Oe=re[be+1],nt=0===be?new at(0,0):ke.sub(Je)._unit()._perp(),vt=be===re.length-1?new at(0,0):Oe.sub(ke)._unit()._perp(),Nt=nt._add(vt)._unit(),gi=Nt.x*vt.x+Nt.y*vt.y;0!==gi&&Nt._mult(1/gi),pe.push(Nt._mult(L)._add(ke))}q.push(pe)}return q}(c,Q*m)),function(k,L,q){for(let X=0;X<L.length;X++){const re=L[X];if(k.length>=3)for(let pe=0;pe<re.length;pe++)if(lo(k,re[pe]))return!0;if(Ts(k,re,q))return!0}return!1}(_,c,x)}isTileClipped(){return!0}}function vu(i,t){return t>0?t+2*i:i}const kA=y([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),MA=y([{name:"a_projected_pos",components:3,type:"Float32"}],4);y([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const TA=y([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);y([{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"}]);const xu=y([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),PA=y([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function RA(i,t,r){return i.sections.forEach(a=>{a.text=function(c,d,f){const m=d.layout.get("text-transform").evaluate(f,{});return"uppercase"===m?c=c.toLocaleUpperCase():"lowercase"===m&&(c=c.toLocaleLowerCase()),nr.applyArabicShaping&&(c=nr.applyArabicShaping(c)),c}(a.text,t,r)}),i}y([{name:"triangle",components:3,type:"Uint16"}]),y([{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"}]),y([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),y([{type:"Float32",name:"offsetX"}]),y([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),y([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const hh={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var en=24,Bu=fr,Cu=function(i,t,r,a,c){var d,f,m=8*c-a-1,_=(1<<m)-1,x=_>>1,Q=-7,k=r?c-1:0,L=r?-1:1,q=i[t+k];for(k+=L,d=q&(1<<-Q)-1,q>>=-Q,Q+=m;Q>0;d=256*d+i[t+k],k+=L,Q-=8);for(f=d&(1<<-Q)-1,d>>=-Q,Q+=a;Q>0;f=256*f+i[t+k],k+=L,Q-=8);if(0===d)d=1-x;else{if(d===_)return f?NaN:1/0*(q?-1:1);f+=Math.pow(2,a),d-=x}return(q?-1:1)*f*Math.pow(2,d-a)},Eu=function(i,t,r,a,c,d){var f,m,_,x=8*d-c-1,Q=(1<<x)-1,k=Q>>1,L=23===c?Math.pow(2,-24)-Math.pow(2,-77):0,q=a?0:d-1,X=a?1:-1,re=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,f=Q):(f=Math.floor(Math.log(t)/Math.LN2),t*(_=Math.pow(2,-f))<1&&(f--,_*=2),(t+=f+k>=1?L/_:L*Math.pow(2,1-k))*_>=2&&(f++,_/=2),f+k>=Q?(m=0,f=Q):f+k>=1?(m=(t*_-1)*Math.pow(2,c),f+=k):(m=t*Math.pow(2,k-1)*Math.pow(2,c),f=0));c>=8;i[r+q]=255&m,q+=X,m/=256,c-=8);for(f=f<<c|m,x+=c;x>0;i[r+q]=255&f,q+=X,f/=256,x-=8);i[r+q-X]|=128*re};function fr(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}fr.Varint=0,fr.Fixed64=1,fr.Bytes=2,fr.Fixed32=5;var Yh=4294967296,Qu=1/Yh,Su=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Ho(i){return i.type===fr.Bytes?i.readVarint()+i.pos:i.pos+1}function Du(i,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var c=r.pos-1;c>=i;c--)r.buf[c+a]=r.buf[c]}function FA(i,t){for(var r=0;r<i.length;r++)t.writeVarint(i[r])}function LA(i,t){for(var r=0;r<i.length;r++)t.writeSVarint(i[r])}function zA(i,t){for(var r=0;r<i.length;r++)t.writeFloat(i[r])}function UA(i,t){for(var r=0;r<i.length;r++)t.writeDouble(i[r])}function GA(i,t){for(var r=0;r<i.length;r++)t.writeBoolean(i[r])}function OA(i,t){for(var r=0;r<i.length;r++)t.writeFixed32(i[r])}function NA(i,t){for(var r=0;r<i.length;r++)t.writeSFixed32(i[r])}function qA(i,t){for(var r=0;r<i.length;r++)t.writeFixed64(i[r])}function VA(i,t){for(var r=0;r<i.length;r++)t.writeSFixed64(i[r])}function kh(i,t){return(i[t]|i[t+1]<<8|i[t+2]<<16)+16777216*i[t+3]}function qc(i,t,r){i[r]=t,i[r+1]=t>>>8,i[r+2]=t>>>16,i[r+3]=t>>>24}function ku(i,t){return(i[t]|i[t+1]<<8|i[t+2]<<16)+(i[t+3]<<24)}fr.prototype={destroy:function(){this.buf=null},readFields:function(i,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),c=a>>3,d=this.pos;this.type=7&a,i(c,t,this),this.pos===d&&this.skip(a)}return t},readMessage:function(i,t){return this.readFields(i,t,this.readVarint()+this.pos)},readFixed32:function(){var i=kh(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=ku(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=kh(this.buf,this.pos)+kh(this.buf,this.pos+4)*Yh;return this.pos+=8,i},readSFixed64:function(){var i=kh(this.buf,this.pos)+ku(this.buf,this.pos+4)*Yh;return this.pos+=8,i},readFloat:function(){var i=Cu(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Cu(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:function(c,d,f){var m,_,x=f.buf;if(m=(112&(_=x[f.pos++]))>>4,_<128||(m|=(127&(_=x[f.pos++]))<<3,_<128)||(m|=(127&(_=x[f.pos++]))<<10,_<128)||(m|=(127&(_=x[f.pos++]))<<17,_<128)||(m|=(127&(_=x[f.pos++]))<<24,_<128)||(m|=(1&(_=x[f.pos++]))<<31,_<128))return function Nc(i,t,r){return r?4294967296*t+(i>>>0):4294967296*(t>>>0)+(i>>>0)}(c,m,d);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=a[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,t=this.pos;return this.pos=i,i-t>=12&&Su?Su.decode(this.buf.subarray(t,i)):function(r,a,c){for(var d="",f=a;f<c;){var m,_,x,Q=r[f],k=null,L=Q>239?4:Q>223?3:Q>191?2:1;if(f+L>c)break;1===L?Q<128&&(k=Q):2===L?128==(192&(m=r[f+1]))&&(k=(31&Q)<<6|63&m)<=127&&(k=null):3===L?(_=r[f+2],128==(192&(m=r[f+1]))&&128==(192&_)&&((k=(15&Q)<<12|(63&m)<<6|63&_)<=2047||k>=55296&&k<=57343)&&(k=null)):4===L&&(_=r[f+2],x=r[f+3],128==(192&(m=r[f+1]))&&128==(192&_)&&128==(192&x)&&((k=(15&Q)<<18|(63&m)<<12|(63&_)<<6|63&x)<=65535||k>=1114112)&&(k=null)),null===k?(k=65533,L=1):k>65535&&(k-=65536,d+=String.fromCharCode(k>>>10&1023|55296),k=56320|1023&k),d+=String.fromCharCode(k),f+=L}return d}(this.buf,t,i)},readBytes:function(){var i=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,i);return this.pos=i,t},readPackedVarint:function(i,t){if(this.type!==fr.Bytes)return i.push(this.readVarint(t));var r=Ho(this);for(i=i||[];this.pos<r;)i.push(this.readVarint(t));return i},readPackedSVarint:function(i){if(this.type!==fr.Bytes)return i.push(this.readSVarint());var t=Ho(this);for(i=i||[];this.pos<t;)i.push(this.readSVarint());return i}
vendor: 5,286 bytes, line 3
3,readPackedBoolean:function(i){if(this.type!==fr.Bytes)return i.push(this.readBoolean());var t=Ho(this);for(i=i||[];this.pos<t;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==fr.Bytes)return i.push(this.readFloat());var t=Ho(this);for(i=i||[];this.pos<t;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==fr.Bytes)return i.push(this.readDouble());var t=Ho(this);for(i=i||[];this.pos<t;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==fr.Bytes)return i.push(this.readFixed32());var t=Ho(this);for(i=i||[];this.pos<t;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==fr.Bytes)return i.push(this.readSFixed32());var t=Ho(this);for(i=i||[];this.pos<t;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==fr.Bytes)return i.push(this.readFixed64());var t=Ho(this);for(i=i||[];this.pos<t;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==fr.Bytes)return i.push(this.readSFixed64());var t=Ho(this);for(i=i||[];this.pos<t;)i.push(this.readSFixed64());return i},skip:function(i){var t=7&i;if(t===fr.Varint)for(;this.buf[this.pos++]>127;);else if(t===fr.Bytes)this.pos=this.readVarint()+this.pos;else if(t===fr.Fixed32)this.pos+=4;else{if(t!==fr.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(i,t){this.writeVarint(i<<3|t)},realloc:function(i){for(var t=this.length||16;t<this.pos+i;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(i){this.realloc(4),qc(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),qc(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),qc(this.buf,-1&i,this.pos),qc(this.buf,Math.floor(i*Qu),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),qc(this.buf,-1&i,this.pos),qc(this.buf,Math.floor(i*Qu),this.pos+4),this.pos+=8},writeVarint:function(i){(i=+i||0)>268435455||i<0?function(t,r){var a,c,d,m;if(t>=0?(a=t%4294967296|0,c=t/4294967296|0):(c=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,c=c+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),d=a,(m=r).buf[m.pos++]=127&d|128,d>>>=7,m.buf[m.pos++]=127&d|128,d>>>=7,m.buf[m.pos++]=127&d|128,d>>>=7,m.buf[m.pos++]=127&d|128,m.buf[m.pos]=127&(d>>>=7),function(d,f){var m=(7&d)<<4;f.buf[f.pos++]|=m|((d>>>=3)?128:0),d&&(f.buf[f.pos++]=127&d|((d>>>=7)?128:0),d&&(f.buf[f.pos++]=127&d|((d>>>=7)?128:0),d&&(f.buf[f.pos++]=127&d|((d>>>=7)?128:0),d&&(f.buf[f.pos++]=127&d|((d>>>=7)?128:0),d&&(f.buf[f.pos++]=127&d)))))}(c,r)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var t=this.pos;this.pos=function(a,c,d){for(var f,m,_=0;_<c.length;_++){if((f=c.charCodeAt(_))>55295&&f<57344){if(!m){f>56319||_+1===c.length?(a[d++]=239,a[d++]=191,a[d++]=189):m=f;continue}if(f<56320){a[d++]=239,a[d++]=191,a[d++]=189,m=f;continue}f=m-55296<<10|f-56320|65536,m=null}else m&&(a[d++]=239,a[d++]=191,a[d++]=189,m=null);f<128?a[d++]=f:(f<2048?a[d++]=f>>6|192:(f<65536?a[d++]=f>>12|224:(a[d++]=f>>18|240,a[d++]=f>>12&63|128),a[d++]=f>>6&63|128),a[d++]=63&f|128)}return d}(this.buf,i,this.pos);var r=this.pos-t;r>=128&&Du(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(i){this.realloc(4),Eu(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Eu(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var t=i.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=i[r]},writeRawMessage:function(i,t){this.pos++;var r=this.pos;i(t,this);var a=this.pos-r;a>=128&&Du(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(i,t,r){this.writeTag(i,fr.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(i,t){t.length&&this.writeMessage(i,FA,t)},writePackedSVarint:function(i,t){t.length&&this.writeMessage(i,LA,t)},writePackedBoolean:function(i,t){t.length&&this.writeMessage(i,GA,t)},writePackedFloat:function(i,t){t.length&&this.writeMessage(i,zA,t)},writePackedDouble:function(i,t){t.length&&this.writeMessage(i,UA,t)},writePackedFixed32:function(i,t){t.length&&this.writeMessage(i,OA,t)},writePackedSFixed32:function(i,t){t.length&&this.writeMessage(i,NA,t)},writePackedFixed64:function(i,t){t.length&&this.writeMessage(i,qA,t)},writePackedSFixed64:function(i,t){t.length&&this.writeMessage(i,VA,t)},writeBytesField:function(i,t){this.writeTag(i,fr.Bytes),this.writeBytes(t)},writeFixed32Field:function(i,t){this.writeTag(i,fr.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(i,t){this.writeTag(i,fr.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(i,t){this.writeTag(i,fr.Fixed64),this.writeFixed64
vendor: 89,451 bytes, line 3
3(t)},writeSFixed64Field:function(i,t){this.writeTag(i,fr.Fixed64),this.writeSFixed64(t)},writeVarintField:function(i,t){this.writeTag(i,fr.Varint),this.writeVarint(t)},writeSVarintField:function(i,t){this.writeTag(i,fr.Varint),this.writeSVarint(t)},writeStringField:function(i,t){this.writeTag(i,fr.Bytes),this.writeString(t)},writeFloatField:function(i,t){this.writeTag(i,fr.Fixed32),this.writeFloat(t)},writeDoubleField:function(i,t){this.writeTag(i,fr.Fixed64),this.writeDouble(t)},writeBooleanField:function(i,t){this.writeVarintField(i,!!t)}};var Zh=li(Bu);const Kh=3;function HA(i,t,r){1===i&&r.readMessage(JA,t)}function JA(i,t,r){if(3===i){const{id:a,bitmap:c,width:d,height:f,left:m,top:_,advance:x}=r.readMessage(jA,{});t.push({id:a,bitmap:new hc({width:d+2*Kh,height:f+2*Kh},c),metrics:{width:d,height:f,left:m,top:_,advance:x}})}}function jA(i,t,r){1===i?t.id=r.readVarint():2===i?t.bitmap=r.readBytes():3===i?t.width=r.readVarint():4===i?t.height=r.readVarint():5===i?t.left=r.readSVarint():6===i?t.top=r.readSVarint():7===i&&(t.advance=r.readVarint())}const Mu=Kh;function Tu(i){let t=0,r=0;for(const f of i)t+=f.w*f.h,r=Math.max(r,f.w);i.sort((f,m)=>m.h-f.h);const a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let c=0,d=0;for(const f of i)for(let m=a.length-1;m>=0;m--){const _=a[m];if(!(f.w>_.w||f.h>_.h)){if(f.x=_.x,f.y=_.y,d=Math.max(d,f.y+f.h),c=Math.max(c,f.x+f.w),f.w===_.w&&f.h===_.h){const x=a.pop();m<a.length&&(a[m]=x)}else f.h===_.h?(_.x+=f.w,_.w-=f.w):f.w===_.w?(_.y+=f.h,_.h-=f.h):(a.push({x:_.x+f.w,y:_.y,w:_.w-f.w,h:f.h}),_.y+=f.h,_.h-=f.h);break}}return{w:c,h:d,fill:t/(c*d)||0}}const ua=1;class $h{constructor(t,{pixelRatio:r,version:a,stretchX:c,stretchY:d,content:f,textFitWidth:m,textFitHeight:_}){this.paddedRect=t,this.pixelRatio=r,this.stretchX=c,this.stretchY=d,this.content=f,this.version=a,this.textFitWidth=m,this.textFitHeight=_}get tl(){return[this.paddedRect.x+ua,this.paddedRect.y+ua]}get br(){return[this.paddedRect.x+this.paddedRect.w-ua,this.paddedRect.y+this.paddedRect.h-ua]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*ua)/this.pixelRatio,(this.paddedRect.h-2*ua)/this.pixelRatio]}}class Pu{constructor(t,r){const a={},c={};this.haveRenderCallbacks=[];const d=[];this.addImages(t,a,d),this.addImages(r,c,d);const{w:f,h:m}=Tu(d),_=new ca({width:f||1,height:m||1});for(const x in t){const Q=t[x],k=a[x].paddedRect;ca.copy(Q.data,_,{x:0,y:0},{x:k.x+ua,y:k.y+ua},Q.data)}for(const x in r){const Q=r[x],k=c[x].paddedRect,L=k.x+ua,q=k.y+ua,X=Q.data.width,re=Q.data.height;ca.copy(Q.data,_,{x:0,y:0},{x:L,y:q},Q.data),ca.copy(Q.data,_,{x:0,y:re-1},{x:L,y:q-1},{width:X,height:1}),ca.copy(Q.data,_,{x:0,y:0},{x:L,y:q+re},{width:X,height:1}),ca.copy(Q.data,_,{x:X-1,y:0},{x:L-1,y:q},{width:1,height:re}),ca.copy(Q.data,_,{x:0,y:0},{x:L+X,y:q},{width:1,height:re})}this.image=_,this.iconPositions=a,this.patternPositions=c}addImages(t,r,a){for(const c in t){const d=t[c],f={x:0,y:0,w:d.data.width+2*ua,h:d.data.height+2*ua};a.push(f),r[c]=new $h(f,d),d.hasRenderCallback&&this.haveRenderCallbacks.push(c)}}patchUpdatedImages(t,r){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const a in t.updatedImages)this.patchUpdatedImage(this.iconPositions[a],t.getImage(a),r),this.patchUpdatedImage(this.patternPositions[a],t.getImage(a),r)}patchUpdatedImage(t,r,a){if(!t||!r||t.version===r.version)return;t.version=r.version;const[c,d]=t.tl;a.update(r.data,void 0,{x:c,y:d})}}var Pl;Ht("ImagePosition",$h),Ht("ImageAtlas",Pu),Z.ah=void 0,(Pl=Z.ah||(Z.ah={}))[Pl.none=0]="none",Pl[Pl.horizontal=1]="horizontal",Pl[Pl.vertical=2]="vertical",Pl[Pl.horizontalOnly=3]="horizontalOnly";const uh=-17;class Ah{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,r){const a=new Ah;return a.scale=t||1,a.fontStack=r,a}static forImage(t){const r=new Ah;return r.imageName=t,r}}class Vc{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,r){const a=new Vc;for(let c=0;c<t.sections.length;c++){const d=t.sections[c];d.image?a.addImageSection(d):a.addTextSection(d,r)}return a}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let r="";for(let a=0;a<t.length;a++){const c=t.charCodeAt(a+1)||null,d=t.charCodeAt(a-1)||null;r+=c&&rc(c)&&!hh[t[a+1]]||d&&rc(d)&&!hh[t[a-1]]||!hh[t[a]]?t[a]:hh[t[a]]}return r}(this.text)}trim(){let t=0;for(let a=0;a<this.text.length&&Th[this.text.charCodeAt(a)];a++)t++;let r=this.text.length;for(let a=this.text.length-1;a>=0&&a>=t&&Th[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)}substring(t,r){const a=new Vc;return a.text=this.text.substring(t,r),a.sectionIndex=this.sectionIndex.slice(t,r),a.sections=this.sections,a}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,r)=>Math.max(t,this.sections[r].scale),0)}addTextSection(t,r){this.text+=t.text,this.sections.push(Ah.forText(t.scale,t.fontStack||r));const a=this.sections.length-1;for(let c=0;c<t.text.length;++c)this.sectionIndex.push(a)}addImageSection(t){const r=t.image?t.image.name:"";if(0===r.length)return void Pe("Can't add FormattedSection with an empty image.");const a=this.getNextImageSectionCharCode();a?(this.text+=String.fromCharCode(a),this.sections.push(Ah.forImage(r)),this.sectionIndex.push(this.sections.length-1)):Pe("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Mh(i,t,r,a,c,d,f,m,_,x,Q,k,L,q,X){const re=Vc.fromFeature(i,c);let pe;k===Z.ah.vertical&&re.verticalizePunctuation();const{processBidirectionalText:be,processStyledBidirectionalText:Je}=nr;if(be&&1===re.sections.length){pe=[];const nt=be(re.toString(),Xh(re,x,d,t,a,q));for(const vt of nt){const Nt=new Vc;Nt.text=vt,Nt.sections=re.sections;for(let gi=0;gi<vt.length;gi++)Nt.sectionIndex.push(0);pe.push(Nt)}}else if(Je){pe=[];const nt=Je(re.text,re.sectionIndex,Xh(re,x,d,t,a,q));for(const vt of nt){const Nt=new Vc;Nt.text=vt[0],Nt.sectionIndex=vt[1],Nt.sections=re.sections,pe.push(Nt)}}else pe=function(nt,vt){const Nt=[],gi=nt.text;let Gt=0;for(const Lt of vt)Nt.push(nt.substring(Gt,Lt)),Gt=Lt;return Gt<gi.length&&Nt.push(nt.substring(Gt,gi.length)),Nt}(re,Xh(re,x,d,t,a,q));const ke=[],Oe={positionedLines:ke,text:re.toString(),top:Q[1],bottom:Q[1],left:Q[0],right:Q[0],writingMode:k,iconsInText:!1,verticalizable:!1};return function(nt,vt,Nt,gi,Gt,Lt,si,Yt,Jt,ft,oi,ai){let Bi=0,_r=uh,pr=0,cn=0;const Xa="right"===Yt?1:"left"===Yt?0:.5;let En=0;for(const Ur of Gt){Ur.trim();const un=Ur.getMaxScale(),Fn=(un-1)*en,Qn={positionedGlyphs:[],lineOffset:0};nt.positionedLines[En]=Qn;const Xn=Qn.positionedGlyphs;let Sn=0;if(!Ur.length()){_r+=Lt,++En;continue}for(let Aa=0;Aa<Ur.length();Aa++){const Wi=Ur.getSection(Aa),Ir=Ur.getSectionIndex(Aa),wr=Ur.getCharCode(Aa);let Ba=0,Pr=null,Yc=null,ho=null,uo=en;const Wa=!(Jt===Z.ah.horizontal||!oi&&!vl(wr)||oi&&(Th[wr]||(hn=wr,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(hn)))));if(Wi.imageName){const za=gi[Wi.imageName];if(!za)continue;ho=Wi.imageName,nt.iconsInText=nt.iconsInText||!0,Yc=za.paddedRect;const _n=za.displaySize;Wi.scale=Wi.scale*en/ai,Pr={width:_n[0],height:_n[1],left:ua,top:-Mu,advance:Wa?_n[1]:_n[0]},Ba=Fn+(en-_n[1]*Wi.scale),uo=Pr.advance;const Jo=Wa?_n[0]*Wi.scale-en*un:_n[1]*Wi.scale-en*un;Jo>0&&Jo>Sn&&(Sn=Jo)}else{const za=Nt[Wi.fontStack],_n=za&&za[wr];if(_n&&_n.rect)Yc=_n.rect,Pr=_n.metrics;else{const Jo=vt[Wi.fontStack],yh=Jo&&Jo[wr];if(!yh)continue;Pr=yh.metrics}Ba=(un-Wi.scale)*en}Wa?(nt.verticalizable=!0,Xn.push({glyph:wr,imageName:ho,x:Bi,y:_r+Ba,vertical:Wa,scale:Wi.scale,fontStack:Wi.fontStack,sectionIndex:Ir,metrics:Pr,rect:Yc}),Bi+=uo*Wi.scale+ft):(Xn.push({glyph:wr,imageName:ho,x:Bi,y:_r+Ba,vertical:Wa,scale:Wi.scale,fontStack:Wi.fontStack,sectionIndex:Ir,metrics:Pr,rect:Yc}),Bi+=Pr.advance*Wi.scale+ft)}0!==Xn.length&&(pr=Math.max(Bi-ft,pr),$A(Xn,0,Xn.length-1,Xa,Sn)),Bi=0;const La=Lt*un+Sn;Qn.lineOffset=Math.max(Sn,Fn),_r+=La,cn=Math.max(La,cn),++En}var hn;const Zn=_r-uh,{horizontalAlign:Kn,verticalAlign:$n}=Wh(si);(function(Ur,un,Fn,Qn,Xn,Sn,La,Aa,Wi){const Ir=(un-Fn)*Xn;let wr=0;wr=Sn!==La?-Aa*Qn-uh:(-Qn*Wi+.5)*La;for(const Ba of Ur)for(const Pr of Ba.positionedGlyphs)Pr.x+=Ir,Pr.y+=wr})(nt.positionedLines,Xa,Kn,$n,pr,cn,Lt,Zn,Gt.length),nt.top+=-$n*Zn,nt.bottom=nt.top+Zn,nt.left+=-Kn*pr,nt.right=nt.left+pr}(Oe,t,r,a,pe,f,m,_,k,x,L,X),!function(nt){for(const vt of nt)if(0!==vt.positionedGlyphs.length)return!1;return!0}(ke)&&Oe}const Th={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},YA={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},ZA={40:!0};function Ru(i,t,r,a,c,d){if(t.imageName){const f=a[t.imageName];return f?f.displaySize[0]*t.scale*en/d+c:0}{const f=r[t.fontStack],m=f&&f[i];return m?m.metrics.advance*t.scale+c:0}}function Fu(i,t,r,a){const c=Math.pow(i-t,2);return a?i<t?c/2:2*c:c+Math.abs(r)*r}function KA(i,t,r){let a=0;return 10===i&&(a-=1e4),r&&(a+=150),40!==i&&65288!==i||(a+=50),41!==t&&65289!==t||(a+=50),a}function Lu(i,t,r,a,c,d){let f=null,m=Fu(t,r,c,d);for(const _ of a){const x=Fu(t-_.x,r,c,d)+_.badness;x<=m&&(f=_,m=x)}return{index:i,x:t,priorBreak:f,badness:m}}function zu(i){return i?zu(i.priorBreak).concat(i.index):[]}function Xh(i,t,r,a,c,d){if(!i)return[];const f=[],m=function(k,L,q,X,re,pe){let be=0;for(let Je=0;Je<k.length();Je++){const ke=k.getSection(Je);be+=Ru(k.getCharCode(Je),ke,X,re,L,pe)}return be/Math.max(1,Math.ceil(be/q))}(i,t,r,a,c,d),_=i.text.indexOf("\u200b")>=0;let x=0;for(let k=0;k<i.length();k++){const L=i.getSection(k),q=i.getCharCode(k);if(Th[q]||(x+=Ru(q,L,a,c,t,d)),k<i.length()-1){const X=!((Q=q)<11904)&&(!!Ni["CJK Compatibility Forms"](Q)||!!Ni["CJK Compatibility"](Q)||!!Ni["CJK Strokes"](Q)||!!Ni["CJK Symbols and Punctuation"](Q)||!!Ni["Enclosed CJK Letters and Months"](Q)||!!Ni["Halfwidth and Fullwidth Forms"](Q)||!!Ni["Ideographic Description Characters"](Q)||!!Ni["Vertical Forms"](Q)||ic.test(String.fromCodePoint(Q)));(YA[q]||X||L.imageName||k!==i.length()-2&&ZA[i.getCharCode(k+1)])&&f.push(Lu(k+1,x,m,f,KA(q,i.getCharCode(k+1),X&&_),!1))}}var Q;return zu(Lu(i.length(),x,m,f,0,!0))}function Wh(i){let t=.5,r=.5;switch(i){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function $A(i,t,r,a,c){if(!a&&!c)return;const d=i[r],f=(i[r].x+d.metrics.advance*d.scale)*a;for(let m=t;m<=r;m++)i[m].x-=f,i[m].y+=c}function XA(i,t,r){const{horizontalAlign:a,verticalAlign:c}=Wh(r),d=t[0]-i.displaySize[0]*a,f=t[1]-i.displaySize[1]*c;return{image:i,top:f,bottom:f+i.displaySize[1],left:d,right:d+i.displaySize[0]}}function Uu(i){var t,r;let a=i.left,c=i.top,d=i.right-a,f=i.bottom-c;const m=null!==(t=i.image.textFitWidth)&&void 0!==t?t:"stretchOrShrink",_=null!==(r=i.image.textFitHeight)&&void 0!==r?r:"stretchOrShrink",x=(i.image.content[2]-i.image.content[0])/(i.image.content[3]-i.image.content[1]);if("proportional"===_){if("stretchOnly"===m&&d/f<x||"proportional"===m){const Q=Math.ceil(f*x);a*=Q/d,d=Q}}else if("proportional"===m&&"stretchOnly"===_&&0!==x&&d/f>x){const Q=Math.ceil(d/x);c*=Q/f,f=Q}return{x1:a,y1:c,x2:a+d,y2:c+f}}function Gu(i,t,r,a,c,d){const f=i.image;let m;if(f.content){const pe=f.content,be=f.pixelRatio||1;m=[pe[0]/be,pe[1]/be,f.displaySize[0]-pe[2]/be,f.displaySize[1]-pe[3]/be]}const _=t.left*d,x=t.right*d;let Q,k,L,q;"width"===r||"both"===r?(q=c[0]+_-a[3],k=c[0]+x+a[1]):(q=c[0]+(_+x-f.displaySize[0])/2,k=q+f.displaySize[0]);const X=t.top*d,re=t.bottom*d;return"height"===r||"both"===r?(Q=c[1]+X-a[0],L=c[1]+re+a[2]):(Q=c[1]+(X+re-f.displaySize[1])/2,L=Q+f.displaySize[1]),{image:f,top:Q,right:k,bottom:L,left:q,collisionPadding:m}}const dh=255,co=128,Rl=dh*co;function Ou(i,t){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new er(i+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:a,interpolationType:c}=r;let d=0;for(;d<a.length&&a[d]<=i;)d++;d=Math.max(0,d-1);let f=d;for(;f<a.length&&a[f]<i+1;)f++;f=Math.min(a.length-1,f);const m=a[d],_=a[f];return"composite"===r.kind?{kind:"composite",minZoom:m,maxZoom:_,interpolationType:c}:{kind:"camera",minZoom:m,maxZoom:_,minSize:r.evaluate(new er(m)),maxSize:r.evaluate(new er(_)),interpolationType:c}}}function eu(i,t,r){let a="never";const c=i.get(t);return c?a=c:i.get(r)&&(a="always"),a}const WA=Kt.VectorTileFeature.types,ed=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ph(i,t,r,a,c,d,f,m,_,x,Q,k,L){const q=m?Math.min(Rl,Math.round(m[0])):0,X=m?Math.min(Rl,Math.round(m[1])):0;i.emplaceBack(t,r,Math.round(32*a),Math.round(32*c),d,f,(q<<1)+(_?1:0),X,16*x,16*Q,256*k,256*L)}function tu(i,t,r){i.emplaceBack(t.x,t.y,r),i.emplaceBack(t.x,t.y,r),i.emplaceBack(t.x,t.y,r),i.emplaceBack(t.x,t.y,r)}function td(i){for(const t of i.sections)if(eh(t.text))return!0;return!1}class iu{constructor(t){this.layoutVertexArray=new El,this.indexArray=new la,this.programConfigurations=t,this.segments=new Ui,this.dynamicLayoutVertexArray=new eo,this.opacityVertexArray=new Jn,this.hasVisibleVertices=!1,this.placedSymbolArray=new ar}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,r,a,c){this.isEmpty()||(a&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,kA.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,MA.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,ed,!0),this.opacityVertexBuffer.itemSize=1),(a||c)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Ht("SymbolBuffers",iu);class ru{constructor(t,r,a){this.layoutVertexArray=new t,this.layoutAttributes=r,this.indexArray=new a,this.segments=new Ui,this.collisionVertexArray=new Ja}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,TA.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Ht("CollisionBuffers",ru);class Hc{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(f=>f.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=xh([]),this.placementViewportMatrix=xh([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ou(this.zoom,r["text-size"]),this.iconSizeData=Ou(this.zoom,r["icon-size"]);const a=this.layers[0].layout,c=a.get("symbol-sort-key"),d=a.get("symbol-z-order");this.canOverlap="never"!==eu(a,"text-overlap","text-allow-overlap")||"never"!==eu(a,"icon-overlap","icon-allow-overlap")||a.get("text-ignore-placement")||a.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==d&&!c.isConstant(),this.sortFeaturesByY=("viewport-y"===d||"auto"===d&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===a.get("symbol-placement")&&(this.writingModes=a.get("text-writing-mode").map(f=>Z.ah[f])),this.stateDependentLayerIds=this.layers.filter(f=>f.isStateDependent()).map(f=>f.id),this.sourceID=t.sourceID}createArrays(){this.text=new iu(new ao(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new iu(new ao(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new dr,this.lineVertexArray=new on,this.symbolInstances=new Gi,this.textAnchorOffsets=new yr}calculateGlyphDependencies(t,r,a,c,d){for(let f=0;f<t.length;f++)if(r[t.charCodeAt(f)]=!0,(a||c)&&d){const m=hh[t.charAt(f)];m&&(r[m.charCodeAt(0)]=!0)}}populate(t,r,a){const c=this.layers[0],d=c.layout,f=d.get("text-font"),m=d.get("text-field"),_=d.get("icon-image"),x=("constant"!==m.value.kind||m.value.value instanceof Ke&&!m.value.value.isEmpty()||m.value.value.toString().length>0)&&("constant"!==f.value.kind||f.value.value.length>0),Q="constant"!==_.value.kind||!!_.value.value||Object.keys(_.parameters).length>0,k=d.get("symbol-sort-key");if(this.features=[],!x&&!Q)return;const L=r.iconDependencies,q=r.glyphDependencies,X=r.availableImages,re=new er(this.zoom);for(const{feature:pe,id:be,index:Je,sourceLayerIndex:ke}of t){const Oe=c._featureFilter.needGeometry,nt=Ms(pe,Oe);if(!c._featureFilter.filter(re,nt,a))continue;let vt,Nt;if(Oe||(nt.geometry=oo(pe)),x){const Gt=c.getValueAndResolveTokens("text-field",nt,a,X),Lt=Ke.factory(Gt),si=this.hasRTLText=this.hasRTLText||td(Lt);(!si||"unavailable"===nr.getRTLTextPluginStatus()||si&&nr.isParsed())&&(vt=RA(Lt,c,nt))}if(Q){const Gt=c.getValueAndResolveTokens("icon-image",nt,a,X);Nt=Gt instanceof Di?Gt:Di.fromString(Gt)}if(!vt&&!Nt)continue;const gi=this.sortFeaturesByKey?k.evaluate(nt,{},a):void 0;if(this.features.push({id:be,text:vt,icon:Nt,index:Je,sourceLayerIndex:ke,geometry:nt.geometry,properties:pe.properties,type:WA[pe.type],sortKey:gi}),Nt&&(L[Nt.name]=!0),vt){const Gt=f.evaluate(nt,{},a).join(","),Lt="viewport"!==d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Z.ah.vertical)>=0;for(const si of vt.sections)if(si.image)L[si.image.name]=!0;else{const Yt=bl(vt.toString()),Jt=si.fontStack||Gt,ft=q[Jt]=q[Jt]||{};this.calculateGlyphDependencies(si.text,ft,Lt,this.allowVerticalPlacement,Yt)}}}"line"===d.get("symbol-placement")&&(this.features=function(pe){const be={},Je={},ke=[];let Oe=0;function nt(Gt){ke.push(pe[Gt]),Oe++}function vt(Gt,Lt,si){const Yt=Je[Gt];return delete Je[Gt],Je[Lt]=Yt,ke[Yt].geometry[0].pop(),ke[Yt].geometry[0]=ke[Yt].geometry[0].concat(si[0]),Yt}function Nt(Gt,Lt,si){const Yt=be[Lt];return delete be[Lt],be[Gt]=Yt,ke[Yt].geometry[0].shift(),ke[Yt].geometry[0]=si[0].concat(ke[Yt].geometry[0]),Yt}function gi(Gt,Lt,si){const Yt=si?Lt[0][Lt[0].length-1]:Lt[0][0];return`${Gt}:${Yt.x}:${Yt.y}`}for(let Gt=0;Gt<pe.length;Gt++){const Lt=pe[Gt],si=Lt.geometry,Yt=Lt.text?Lt.text.toString():null;if(!Yt){nt(Gt);continue}const Jt=gi(Yt,si),ft=gi(Yt,si,!0);if(Jt in Je&&ft in be&&Je[Jt]!==be[ft]){const oi=Nt(Jt,ft,si),ai=vt(Jt,ft,ke[oi].geometry);delete be[Jt],delete Je[ft],Je[gi(Yt,ke[ai].geometry,!0)]=ai,ke[oi].geometry=null}else Jt in Je?vt(Jt,ft,si):ft in be?Nt(Jt,ft,si):(nt(Gt),be[Jt]=Oe-1,Je[ft]=Oe-1)}return ke.filter(Gt=>Gt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((pe,be)=>pe.sortKey-be.sortKey)}update(t,r,a){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,r,this.layers,a),this.icon.programConfigurations.updatePaintArrays(t,r,this.layers,a))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,r){const a=this.lineVertexArray.length;if(void 0!==t.segment){let c=t.dist(r[t.segment+1]),d=t.dist(r[t.segment]);const f={};for(let m=t.segment+1;m<r.length;m++)f[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:c},m<r.length-1&&(c+=r[m+1].dist(r[m]));for(let m=t.segment||0;m>=0;m--)f[m]={x:r[m].x,y:r[m].y,tileUnitDistanceFromAnchor:d},m>0&&(d+=r[m-1].dist(r[m]));for(let m=0;m<r.length;m++){const _=f[m];this.lineVertexArray.emplaceBack(_.x,_.y,_.tileUnitDistanceFromAnchor)}}return{lineStartIndex:a,lineLength:this.lineVertexArray.length-a}}addSymbols(t,r,a,c,d,f,m,_,x,Q,k,L){const q=t.indexArray,X=t.layoutVertexArray,re=t.segments.prepareSegment(4*r.length,X,q,this.canOverlap?f.sortKey:void 0),pe=this.glyphOffsetArray.length,be=re.vertexLength,Je=this.allowVerticalPlacement&&m===Z.ah.vertical?Math.PI/2:0,ke=f.text&&f.text.sections;for(let Oe=0;Oe<r.length;Oe++){const{tl:nt,tr:vt,bl:Nt,br:gi,tex:Gt,pixelOffsetTL:Lt,pixelOffsetBR:si,minFontScaleX:Yt,minFontScaleY:Jt,glyphOffset:ft,isSDF:oi,sectionIndex:ai}=r[Oe],Bi=re.vertexLength,_r=ft[1];Ph(X,_.x,_.y,nt.x,_r+nt.y,Gt.x,Gt.y,a,oi,Lt.x,Lt.y,Yt,Jt),Ph(X,_.x,_.y,vt.x,_r+vt.y,Gt.x+Gt.w,Gt.y,a,oi,si.x,Lt.y,Yt,Jt),Ph(X,_.x,_.y,Nt.x,_r+Nt.y,Gt.x,Gt.y+Gt.h,a,oi,Lt.x,si.y,Yt,Jt),Ph(X,_.x,_.y,gi.x,_r+gi.y,Gt.x+Gt.w,Gt.y+Gt.h,a,oi,si.x,si.y,Yt,Jt),tu(t.dynamicLayoutVertexArray,_,Je),q.emplaceBack(Bi,Bi+1,Bi+2),q.emplaceBack(Bi+1,Bi+2,Bi+3),re.vertexLength+=4,re.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(ft[0]),Oe!==r.length-1&&ai===r[Oe+1].sectionIndex||t.programConfigurations.populatePaintArrays(X.length,f,f.index,{},L,ke&&ke[ai])}t.placedSymbolArray.emplaceBack(_.x,_.y,pe,this.glyphOffsetArray.length-pe,be,x,Q,_.segment,a?a[0]:0,a?a[1]:0,c[0],c[1],m,0,!1,0,k)}_addCollisionDebugVertex(t,r,a,c,d,f){return r.emplaceBack(0,0),t.emplaceBack(a.x,a.y,c,d,Math.round(f.x),Math.round(f.y))}addCollisionDebugVertices(t,r,a,c,d,f,m){const _=d.segments.prepareSegment(4,d.layoutVertexArray,d.indexArray),x=_.vertexLength,Q=d.layoutVertexArray,k=d.collisionVertexArray,L=m.anchorX,q=m.anchorY;this._addCollisionDebugVertex(Q,k,f,L,q,new at(t,r)),this._addCollisionDebugVertex(Q,k,f,L,q,new at(a,r)),this._addCollisionDebugVertex(Q,k,f,L,q,new at(a,c)),this._addCollisionDebugVertex(Q,k,f,L,q,new at(t,c)),_.vertexLength+=4;const X=d.indexArray;X.emplaceBack(x,x+1),X.emplaceBack(x+1,x+2),X.emplaceBack(x+2,x+3),X.emplaceBack(x+3,x),_.primitiveLength+=4}addDebugCollisionBoxes(t,r,a,c){for(let d=t;d<r;d++){const f=this.collisionBoxArray.get(d);this.addCollisionDebugVertices(f.x1,f.y1,f.x2,f.y2,c?this.textCollisionBox:this.iconCollisionBox,f.anchorPoint,a)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ru(jn,xu.members,qr),this.iconCollisionBox=new ru(jn,xu.members,qr);for(let t=0;t<this.symbolInstances.length;t++){const r=this.symbolInstances.get(t);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(t,r,a,c,d,f,m,_,x){const Q={};for(let k=r;k<a;k++){const L=t.get(k);Q.textBox={x1:L.x1,y1:L.y1,x2:L.x2,y2:L.y2,anchorPointX:L.anchorPointX,anchorPointY:L.anchorPointY},Q.textFeatureIndex=L.featureIndex;break}for(let k=c;k<d;k++){const L=t.get(k);Q.verticalTextBox={x1:L.x1,y1:L.y1,x2:L.x2,y2:L.y2,anchorPointX:L.anchorPointX,anchorPointY:L.anchorPointY},Q.verticalTextFeatureIndex=L.featureIndex;break}for(let k=f;k<m;k++){const L=t.get(k);Q.iconBox={x1:L.x1,y1:L.y1,x2:L.x2,y2:L.y2,anchorPointX:L.anchorPointX,anchorPointY:L.anchorPointY},Q.iconFeatureIndex=L.featureIndex;break}for(let k=_;k<x;k++){const L=t.get(k);Q.verticalIconBox={x1:L.x1,y1:L.y1,x2:L.x2,y2:L.y2,anchorPointX:L.anchorPointX,anchorPointY:L.anchorPointY},Q.verticalIconFeatureIndex=L.featureIndex;break}return Q}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){const a=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,a.textBoxStartIndex,a.textBoxEndIndex,a.verticalTextBoxStartIndex,a.verticalTextBoxEndIndex,a.iconBoxStartIndex,a.iconBoxEndIndex,a.verticalIconBoxStartIndex,a.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,r){const a=t.placedSymbolArray.get(r),c=a.vertexStartIndex+4*a.numGlyphs;for(let d=a.vertexStartIndex;d<c;d+=4)t.indexArray.emplaceBack(d,d+1,d+2),t.indexArray.emplaceBack(d+1,d+2,d+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const r=Math.sin(t),a=Math.cos(t),c=[],d=[],f=[];for(let m=0;m<this.symbolInstances.length;++m){f.push(m);const _=this.symbolInstances.get(m);c.push(0|Math.round(r*_.anchorX+a*_.anchorY)),d.push(_.featureIndex)}return f.sort((m,_)=>c[m]-c[_]||d[_]-d[m]),f}addToSortKeyRanges(t,r){const a=this.sortKeyRanges[this.sortKeyRanges.length-1];a&&a.sortKey===r?a.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||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(const r of this.symbolInstanceIndexes){const a=this.symbolInstances.get(r);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((c,d,f)=>{c>=0&&f.indexOf(c)===d&&this.addIndicesForPlacedSymbol(this.text,c)}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Nu,qu;Ht("SymbolBucket",Hc,{omit:["layers","collisionBoxArray","features","compareText"]}),Hc.MAX_GLYPHS=65535,Hc.addDynamicAttributes=tu;var nu={get paint(){return qu=qu||new A({"icon-opacity":new ti(Ze.paint_symbol["icon-opacity"]),"icon-color":new ti(Ze.paint_symbol["icon-color"]),"icon-halo-color":new ti(Ze.paint_symbol["icon-halo-color"]),"icon-halo-width":new ti(Ze.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ti(Ze.paint_symbol["icon-halo-blur"]),"icon-translate":new $t(Ze.paint_symbol["icon-translate"]),"icon-translate-anchor":new $t(Ze.paint_symbol["icon-translate-anchor"]),"text-opacity":new ti(Ze.paint_symbol["text-opacity"]),"text-color":new ti(Ze.paint_symbol["text-color"],{runtimeType:Rr,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new ti(Ze.paint_symbol["text-halo-color"]),"text-halo-width":new ti(Ze.paint_symbol["text-halo-width"]),"text-halo-blur":new ti(Ze.paint_symbol["text-halo-blur"]),"text-translate":new $t(Ze.paint_symbol["text-translate"]),"text-translate-anchor":new $t(Ze.paint_symbol["text-translate-anchor"])})},get layout(){return Nu=Nu||new A({"symbol-placement":new $t(Ze.layout_symbol["symbol-placement"]),"symbol-spacing":new $t(Ze.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new $t(Ze.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ti(Ze.layout_symbol["symbol-sort-key"]),"symbol-z-order":new $t(Ze.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new $t(Ze.layout_symbol["icon-allow-overlap"]),"icon-overlap":new $t(Ze.layout_symbol["icon-overlap"]),"icon-ignore-placement":new $t(Ze.layout_symbol["icon-ignore-placement"]),"icon-optional":new $t(Ze.layout_symbol["icon-optional"]),"icon-rotation-alignment":new $t(Ze.layout_symbol["icon-rotation-alignment"]),"icon-size":new ti(Ze.layout_symbol["icon-size"]),"icon-text-fit":new $t(Ze.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new $t(Ze.layout_symbol["icon-text-fit-padding"]),"icon-image":new ti(Ze.layout_symbol["icon-image"]),"icon-rotate":new ti(Ze.layout_symbol["icon-rotate"]),"icon-padding":new ti(Ze.layout_symbol["icon-padding"]),"icon-keep-upright":new $t(Ze.layout_symbol["icon-keep-upright"]),"icon-offset":new ti(Ze.layout_symbol["icon-offset"]),"icon-anchor":new ti(Ze.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new $t(Ze.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new $t(Ze.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new $t(Ze.layout_symbol["text-rotation-alignment"]),"text-field":new ti(Ze.layout_symbol["text-field"]),"text-font":new ti(Ze.layout_symbol["text-font"]),"text-size":new ti(Ze.layout_symbol["text-size"]),"text-max-width":new ti(Ze.layout_symbol["text-max-width"]),"text-line-height":new $t(Ze.layout_symbol["text-line-height"]),"text-letter-spacing":new ti(Ze.layout_symbol["text-letter-spacing"]),"text-justify":new ti(Ze.layout_symbol["text-justify"]),"text-radial-offset":new ti(Ze.layout_symbol["text-radial-offset"]),"text-variable-anchor":new $t(Ze.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new ti(Ze.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new ti(Ze.layout_symbol["text-anchor"]),"text-max-angle":new $t(Ze.layout_symbol["text-max-angle"]),"text-writing-mode":new $t(Ze.layout_symbol["text-writing-mode"]),"text-rotate":new ti(Ze.layout_symbol["text-rotate"]),"text-padding":new $t(Ze.layout_symbol["text-padding"]),"text-keep-upright":new $t(Ze.layout_symbol["text-keep-upright"]),"text-transform":new ti(Ze.layout_symbol["text-transform"]),"text-offset":new ti(Ze.layout_symbol["text-offset"]),"text-allow-overlap":new $t(Ze.layout_symbol["text-allow-overlap"]),"text-overlap":new $t(Ze.layout_symbol["text-overlap"]),"text-ignore-placement":new $t(Ze.layout_symbol["text-ignore-placement"]),"text-optional":new $t(Ze.layout_symbol["text-optional"])})}};class Vu{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:Ti,this.defaultValue=t}evaluate(t){if(t.formattedSection){const r=this.defaultValue.property.overrides;if(r&&r.hasOverride(t.formattedSection))return r.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ht("FormatSectionOverride",Vu,{omit:["defaultValue"]});class Rh extends n{constructor(t){super(t,nu)}recalculate(t,r){if(super.recalculate(t,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"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"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")){const a=this.layout.get("text-writing-mode");if(a){const c=[];for(const d of a)c.indexOf(d)<0&&c.push(d);this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,r,a,c){const d=this.layout.get(t).evaluate(r,{},a,c),f=this._unevaluatedLayout._values[t];return f.isDataDriven()||cl(f.value)||!d?d:(m=r.properties,d.replace(/{([^{}]+)}/g,(x,Q)=>m&&Q in m?String(m[Q]):""));var m}createBucket(t){return new Hc(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of nu.paint.overridableProperties){if(!Rh.hasPaintOverride(this.layout,t))continue;const r=this.paint.get(t),a=new Vu(r),c=new ll(a,r.property.specification);let d=null;d="constant"===r.value.kind||"source"===r.value.kind?new gs("source",c):new ms("composite",c,r.value.zoomStops),this.paint._values[t]=new Xr(r.property,d,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,a){return!(!this.layout||r.isDataDriven()||a.isDataDriven())&&Rh.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,r){const a=t.get("text-field"),c=nu.paint.properties[r];let d=!1;const f=m=>{for(const _ of m)if(c.overrides&&c.overrides.hasOverride(_))return void(d=!0)};if("constant"===a.value.kind&&a.value.value instanceof Ke)f(a.value.value.sections);else if("source"===a.value.kind){const m=x=>{d||(x instanceof Ri&&ki(x.value)===zn?f(x.value.sections):x instanceof $o?f(x.sections):x.eachChild(m))},_=a.value;_._styleExpression&&m(_._styleExpression.expression)}return d}}let Hu;var id={get paint(){return Hu=Hu||new A({"background-color":new $t(Ze.paint_background["background-color"]),"background-pattern":new Lr(Ze.paint_background["background-pattern"]),"background-opacity":new $t(Ze.paint_background["background-opacity"])})}};class rd extends n{constructor(t){super(t,id)}}let Ju;var nd={get paint(){return Ju=Ju||new A({"raster-opacity":new $t(Ze.paint_raster["raster-opacity"]),"raster-hue-rotate":new $t(Ze.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new $t(Ze.paint_raster["raster-brightness-min"]),"raster-brightness-max":new $t(Ze.paint_raster["raster-brightness-max"]),"raster-saturation":new $t(Ze.paint_raster["raster-saturation"]),"raster-contrast":new $t(Ze.paint_raster["raster-contrast"]),"raster-resampling":new $t(Ze.paint_raster["raster-resampling"]),"raster-fade-duration":new $t(Ze.paint_raster["raster-fade-duration"])})}};class ad extends n{constructor(t){super(t,nd)}}class sd extends n{constructor(t){super(t,{}),this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class od{constructor(t){this._methodToThrottle=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const au=6371008.8;class Fl{constructor(t,r){if(isNaN(t)||isNaN(r))throw new Error(`Invalid LngLat object: (${t}, ${r})`);if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Fl(_t(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const r=Math.PI/180,a=this.lat*r,c=t.lat*r,d=Math.sin(a)*Math.sin(c)+Math.cos(a)*Math.cos(c)*Math.cos((t.lng-this.lng)*r);return au*Math.acos(Math.min(d,1))}static convert(t){if(t instanceof Fl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Fl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Fl(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: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const ju=2*Math.PI*au;function Yu(i){return ju*Math.cos(i*Math.PI/180)}function Zu(i){return(180+i)/360}function Ku(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function $u(i,t){return i/Yu(t)}function su(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class fh{constructor(t,r,a=0){this.x=+t,this.y=+r,this.z=+a}static fromLngLat(t,r=0){const a=Fl.convert(t);return new fh(Zu(a.lng),Ku(a.lat),$u(r,a.lat))}toLngLat(){return new Fl(360*this.x-180,su(this.y))}toAltitude(){return this.z*Yu(su(this.y))}meterInMercatorCoordinateUnits(){return 1/ju*(t=su(this.y),1/Math.cos(t*Math.PI/180));var t}}function Xu(i,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[i*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}class ou{constructor(t,r,a){if(d=r,f=a,(c=t)<0||c>25||f<0||f>=Math.pow(2,c)||d<0||d>=Math.pow(2,c))throw new Error(`x=${r}, y=${a}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);var c,d,f;this.z=t,this.x=r,this.y=a,this.key=ph(0,t,t,r,a)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,r,a){const c=(f=this.y,m=this.z,_=Xu(256*(d=this.x),256*(f=Math.pow(2,m)-f-1),m),x=Xu(256*(d+1),256*(f+1),m),_[0]+","+_[1]+","+x[0]+","+x[1]);var d,f,m,_,x;const Q=function(k,L,q){let X,re="";for(let pe=k;pe>0;pe--)X=1<<pe-1,re+=(L&X?1:0)+(q&X?2:0);return re}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===a?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,Q).replace(/{bbox-epsg-3857}/g,c)}isChildOf(t){const r=this.z-t.z;return r>0&&t.x===this.x>>r&&t.y===this.y>>r}getTilePoint(t){const r=Math.pow(2,this.z);return new at((t.x*r-this.x)*kr,(t.y*r-this.y)*kr)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Wu{constructor(t,r){this.wrap=t,this.canonical=r,this.key=ph(t,r.z,r.z,r.x,r.y)}}class Fa{constructor(t,r,a,c,d){if(t<a)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${a}`);this.overscaledZ=t,this.wrap=r,this.canonical=new ou(a,+c,+d),this.key=ph(r,t,a,c,d)}clone(){return new Fa(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-t;return t>this.canonical.z?new Fa(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fa(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(t,r){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const a=this.canonical.z-t;return t>this.canonical.z?ph(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):ph(this.wrap*+r,t,t,this.canonical.x>>a,this.canonical.y>>a)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const r=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new Fa(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const r=this.canonical.z+1,a=2*this.canonical.x,c=2*this.canonical.y;return[new Fa(r,this.wrap,r,a,c),new Fa(r,this.wrap,r,a+1,c),new Fa(r,this.wrap,r,a,c+1),new Fa(r,this.wrap,r,a+1,c+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new Fa(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new Fa(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Wu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new fh(t.x-this.wrap,t.y))}}function ph(i,t,r,a,c){(i*=2)<0&&(i=-1*i-1);const d=1<<r;return(d*d*i+d*c+a).toString(36)+r.toString(36)+t.toString(36)}Ht("CanonicalTileID",ou),Ht("OverscaledTileID",Fa,{omit:["posMatrix"]});class eA{constructor(t,r,a,c=1,d=1,f=1,m=0){if(this.uid=t,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(a&&!["mapbox","terrarium","custom"].includes(a))return void Pe(`"${a}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;const _=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),a){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=c,this.greenFactor=d,this.blueFactor=f,this.baseShift=m;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let x=0;x<_;x++)this.data[this._idx(-1,x)]=this.data[this._idx(0,x)],this.data[this._idx(_,x)]=this.data[this._idx(_-1,x)],this.data[this._idx(x,-1)]=this.data[this._idx(x,0)],this.data[this._idx(x,_)]=this.data[this._idx(x,_-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(_,-1)]=this.data[this._idx(_-1,0)],this.data[this._idx(-1,_)]=this.data[this._idx(0,_-1)],this.data[this._idx(_,_)]=this.data[this._idx(_-1,_-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let x=0;x<_;x++)for(let Q=0;Q<_;Q++){const k=this.get(x,Q);k>this.max&&(this.max=k),k<this.min&&(this.min=k)}}get(t,r){const a=new Uint8Array(this.data.buffer),c=4*this._idx(t,r);return this.unpack(a[c],a[c+1],a[c+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,r){if(t<-1||t>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(t+1)}unpack(t,r,a){return t*this.redFactor+r*this.greenFactor+a*this.blueFactor-this.baseShift}getPixels(){return new ca({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,r,a){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let c=r*this.dim,d=r*this.dim+this.dim,f=a*this.dim,m=a*this.dim+this.dim;switch(r){case-1:c=d-1;break;case 1:d=c+1}switch(a){case-1:f=m-1;break;case 1:m=f+1}const _=-r*this.dim,x=-a*this.dim;for(let Q=f;Q<m;Q++)for(let k=c;k<d;k++)this.data[this._idx(k,Q)]=t.data[this._idx(k+_,Q+x)]}}Ht("DEMData",eA);class tA{constructor(t){this._stringToNumber={},this._numberToString=[];for(let r=0;r<t.length;r++){const a=t[r];this._stringToNumber[a]=r,this._numberToString[r]=a}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class iA{constructor(t,r,a,c,d){this.type="Feature",this._vectorTileFeature=t,t._z=r,t._x=a,t._y=c,this.properties=t.properties,this.id=d}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const r in this)"_geometry"!==r&&"_vectorTileFeature"!==r&&(t[r]=this[r]);return t}}class rA{constructor(t,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Bs(kr,16,0),this.grid3D=new Bs(kr,16,0),this.featureIndexArray=new ln,this.promoteId=r}insert(t,r,a,c,d,f){const m=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(a,c,d);const _=f?this.grid3D:this.grid;for(let x=0;x<r.length;x++){const Q=r[x],k=[1/0,1/0,-1/0,-1/0];for(let L=0;L<Q.length;L++){const q=Q[L];k[0]=Math.min(k[0],q.x),k[1]=Math.min(k[1],q.y),k[2]=Math.max(k[2],q.x),k[3]=Math.max(k[3],q.y)}k[0]<kr&&k[1]<kr&&k[2]>=0&&k[3]>=0&&_.insert(m,k[0],k[1],k[2],k[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Kt.VectorTile(new Zh(this.rawTileData)).layers,this.sourceLayerCoder=new tA(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,r,a,c){this.loadVTLayers();const d=t.params||{},f=kr/t.tileSize/t.scale,m=ka(d.filter),_=t.queryGeometry,x=t.queryPadding*f,Q=aA(_),k=this.grid.query(Q.minX-x,Q.minY-x,Q.maxX+x,Q.maxY+x),L=aA(t.cameraQueryGeometry),q=this.grid3D.query(L.minX-x,L.minY-x,L.maxX+x,L.maxY+x,(pe,be,Je,ke)=>function(Oe,nt,vt,Nt,gi){for(const Lt of Oe)if(nt<=Lt.x&&vt<=Lt.y&&Nt>=Lt.x&&gi>=Lt.y)return!0;const Gt=[new at(nt,vt),new at(nt,gi),new at(Nt,gi),new at(Nt,vt)];if(Oe.length>2)for(const Lt of Gt)if(lo(Oe,Lt))return!0;for(let Lt=0;Lt<Oe.length-1;Lt++)if(ah(Oe[Lt],Oe[Lt+1],Gt))return!0;return!1}(t.cameraQueryGeometry,pe-x,be-x,Je+x,ke+x));for(const pe of q)k.push(pe);k.sort(ld);const X={};let re;for(let pe=0;pe<k.length;pe++){const be=k[pe];if(be===re)continue;re=be;const Je=this.featureIndexArray.get(be);let ke=null;this.loadMatchingFeature(X,Je.bucketIndex,Je.sourceLayerIndex,Je.featureIndex,m,d.layers,d.availableImages,r,a,c,(Oe,nt,vt)=>(ke||(ke=oo(Oe)),nt.queryIntersectsFeature(_,Oe,vt,ke,this.z,t.transform,f,t.pixelPosMatrix)))}return X}loadMatchingFeature(t,r,a,c,d,f,m,_,x,Q,k){const L=this.bucketLayerIDs[r];if(f&&!function(pe,be){for(let Je=0;Je<pe.length;Je++)if(be.indexOf(pe[Je])>=0)return!0;return!1}(f,L))return;const q=this.sourceLayerCoder.decode(a),X=this.vtLayers[q].feature(c);if(d.needGeometry){const pe=Ms(X,!0);if(!d.filter(new er(this.tileID.overscaledZ),pe,this.tileID.canonical))return}else if(!d.filter(new er(this.tileID.overscaledZ),X))return;const re=this.getId(X,q);for(let pe=0;pe<L.length;pe++){const be=L[pe];if(f&&f.indexOf(be)<0)continue;const Je=_[be];if(!Je)continue;let ke={};re&&Q&&(ke=Q.getState(Je.sourceLayer||"_geojsonTileLayer",re));const Oe=ot({},x[be]);Oe.paint=nA(Oe.paint,Je.paint,X,ke,m),Oe.layout=nA(Oe.layout,Je.layout,X,ke,m);const nt=!k||k(X,Je,ke);if(!nt)continue;const vt=new iA(X,this.z,this.x,this.y,re);vt.layer=Oe;let Nt=t[be];void 0===Nt&&(Nt=t[be]=[]),Nt.push({featureIndex:c,feature:vt,intersectionZ:nt})}}lookupSymbolFeatures(t,r,a,c,d,f,m,_){const x={};this.loadVTLayers();const Q=ka(d);for(const k of t)this.loadMatchingFeature(x,a,c,k,Q,f,m,_,r);return x}hasLayer(t){for(const r of this.bucketLayerIDs)for(const a of r)if(t===a)return!0;return!1}getId(t,r){let a=t.id;return this.promoteId&&(a=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[r]],"boolean"==typeof a&&(a=Number(a))),a}}function nA(i,t,r,a,c){return je(i,(d,f)=>{const m=t instanceof zo?t.get(f):null;return m&&m.evaluate?m.evaluate(r,a,c):m})}function aA(i){let t=1/0,r=1/0,a=-1/0,c=-1/0;for(const d of i)t=Math.min(t,d.x),r=Math.min(r,d.y),a=Math.max(a,d.x),c=Math.max(c,d.y);return{minX:t,minY:r,maxX:a,maxY:c}}function ld(i,t){return t-i}function sA(i,t,r,a,c){const d=[];for(let f=0;f<i.length;f++){const m=i[f];let _;for(let x=0;x<m.length-1;x++){let Q=m[x],k=m[x+1];Q.x<t&&k.x<t||(Q.x<t?Q=new at(t,Q.y+(t-Q.x)/(k.x-Q.x)*(k.y-Q.y))._round():k.x<t&&(k=new at(t,Q.y+(t-Q.x)/(k.x-Q.x)*(k.y-Q.y))._round()),Q.y<r&&k.y<r||(Q.y<r?Q=new at(Q.x+(r-Q.y)/(k.y-Q.y)*(k.x-Q.x),r)._round():k.y<r&&(k=new at(Q.x+(r-Q.y)/(k.y-Q.y)*(k.x-Q.x),r)._round()),Q.x>=a&&k.x>=a||(Q.x>=a?Q=new at(a,Q.y+(a-Q.x)/(k.x-Q.x)*(k.y-Q.y))._round():k.x>=a&&(k=new at(a,Q.y+(a-Q.x)/(k.x-Q.x)*(k.y-Q.y))._round()),Q.y>=c&&k.y>=c||(Q.y>=c?Q=new at(Q.x+(c-Q.y)/(k.y-Q.y)*(k.x-Q.x),c)._round():k.y>=c&&(k=new at(Q.x+(c-Q.y)/(k.y-Q.y)*(k.x-Q.x),c)._round()),_&&Q.equals(_[_.length-1])||(_=[Q],d.push(_)),_.push(k)))))}}return d}Ht("FeatureIndex",rA,{omit:["rawTileData","sourceLayerCoder"]});class Ll extends at{constructor(t,r,a,c){super(t,r),this.angle=a,void 0!==c&&(this.segment=c)}clone(){return new Ll(this.x,this.y,this.angle,this.segment)}}function oA(i,t,r,a,c){if(void 0===t.segment||0===r)return!0;let d=t,f=t.segment+1,m=0;for(;m>-r/2;){if(f--,f<0)return!1;m-=i[f].dist(d),d=i[f]}m+=i[f].dist(i[f+1]),f++;const _=[];let x=0;for(;m<r/2;){const Q=i[f],k=i[f+1];if(!k)return!1;let L=i[f-1].angleTo(Q)-Q.angleTo(k);for(L=Math.abs((L+3*Math.PI)%(2*Math.PI)-Math.PI),_.push({distance:m,angleDelta:L}),x+=L;m-_[0].distance>a;)x-=_.shift().angleDelta;if(x>c)return!1;f++,m+=Q.dist(k)}return!0}function lA(i){let t=0;for(let r=0;r<i.length-1;r++)t+=i[r].dist(i[r+1]);return t}function cA(i,t,r){return i?.6*t*r:0}function hA(i,t){return Math.max(i?i.right-i.left:0,t?t.right-t.left:0)}function cd(i,t,r,a,c,d){const f=cA(r,c,d),m=hA(r,a)*d;let _=0;const x=lA(i)/2;for(let Q=0;Q<i.length-1;Q++){const k=i[Q],L=i[Q+1],q=k.dist(L);if(_+q>x){const X=(x-_)/q,re=Kr.number(k.x,L.x,X),pe=Kr.number(k.y,L.y,X),be=new Ll(re,pe,L.angleTo(k),Q);return be._round(),!f||oA(i,be,m,f,t)?be:void 0}_+=q}}function hd(i,t,r,a,c,d,f,m,_){const x=cA(a,d,f),Q=hA(a,c),k=Q*f,L=0===i[0].x||i[0].x===_||0===i[0].y||i[0].y===_;return t-k<t/4&&(t=k+t/4),uA(i,L?t/2*m%t:(Q/2+2*d)*f*m%t,t,x,r,k,L,!1,_)}function uA(i,t,r,a,c,d,f,m,_){const x=d/2,Q=lA(i);let k=0,L=t-r,q=[];for(let X=0;X<i.length-1;X++){const re=i[X],pe=i[X+1],be=re.dist(pe),Je=pe.angleTo(re);for(;L+r<k+be;){L+=r;const ke=(L-k)/be,Oe=Kr.number(re.x,pe.x,ke),nt=Kr.number(re.y,pe.y,ke);if(Oe>=0&&Oe<_&&nt>=0&&nt<_&&L-x>=0&&L+x<=Q){const vt=new Ll(Oe,nt,Je,X);vt._round(),a&&!oA(i,vt,d,a,c)||q.push(vt)}}k+=be}return m||q.length||f||(q=uA(i,k/2,r,a,c,d,f,!0,_)),q}Ht("Anchor",Ll);const Jc=ua;function AA(i,t,r,a){const c=[],d=i.image,f=d.pixelRatio,m=d.paddedRect.w-2*Jc,_=d.paddedRect.h-2*Jc;let x={x1:i.left,y1:i.top,x2:i.right,y2:i.bottom};const Q=d.stretchX||[[0,m]],k=d.stretchY||[[0,_]],L=(ft,oi)=>ft+oi[1]-oi[0],q=Q.reduce(L,0),X=k.reduce(L,0),re=m-q,pe=_-X;let be=0,Je=q,ke=0,Oe=X,nt=0,vt=re,Nt=0,gi=pe;if(d.content&&a){const ft=d.content,oi=ft[2]-ft[0],ai=ft[3]-ft[1];(d.textFitWidth||d.textFitHeight)&&(x=Uu(i)),be=Fh(Q,0,ft[0]),ke=Fh(k,0,ft[1]),Je=Fh(Q,ft[0],ft[2]),Oe=Fh(k,ft[1],ft[3]),nt=ft[0]-be,Nt=ft[1]-ke,vt=oi-Je,gi=ai-Oe}const Gt=x.x1,Lt=x.y1,si=x.x2-Gt,Yt=x.y2-Lt,Jt=(ft,oi,ai,Bi)=>{const _r=Lh(ft.stretch-be,Je,si,Gt),pr=zh(ft.fixed-nt,vt,ft.stretch,q),cn=Lh(oi.stretch-ke,Oe,Yt,Lt),Xa=zh(oi.fixed-Nt,gi,oi.stretch,X),En=Lh(ai.stretch-be,Je,si,Gt),hn=zh(ai.fixed-nt,vt,ai.stretch,q),Zn=Lh(Bi.stretch-ke,Oe,Yt,Lt),Kn=zh(Bi.fixed-Nt,gi,Bi.stretch,X),$n=new at(_r,cn),Ur=new at(En,cn),un=new at(En,Zn),Fn=new at(_r,Zn),Qn=new at(pr/f,Xa/f),Xn=new at(hn/f,Kn/f),Sn=t*Math.PI/180;if(Sn){const Wi=Math.sin(Sn),Ir=Math.cos(Sn),wr=[Ir,-Wi,Wi,Ir];$n._matMult(wr),Ur._matMult(wr),Fn._matMult(wr),un._matMult(wr)}const La=ft.stretch+ft.fixed,Aa=oi.stretch+oi.fixed;return{tl:$n,tr:Ur,bl:Fn,br:un,tex:{x:d.paddedRect.x+Jc+La,y:d.paddedRect.y+Jc+Aa,w:ai.stretch+ai.fixed-La,h:Bi.stretch+Bi.fixed-Aa},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Qn,pixelOffsetBR:Xn,minFontScaleX:vt/f/si,minFontScaleY:gi/f/Yt,isSDF:r}};if(a&&(d.stretchX||d.stretchY)){const ft=dA(Q,re,q),oi=dA(k,pe,X);for(let ai=0;ai<ft.length-1;ai++){const Bi=ft[ai],_r=ft[ai+1];for(let pr=0;pr<oi.length-1;pr++)c.push(Jt(Bi,oi[pr],_r,oi[pr+1]))}}else c.push(Jt({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:m+1},{fixed:0,stretch:_+1}));return c}function Fh(i,t,r){let a=0;for(const c of i)a+=Math.max(t,Math.min(r,c[1]))-Math.max(t,Math.min(r,c[0]));return a}function dA(i,t,r){const a=[{fixed:-Jc,stretch:0}];for(const[c,d]of i){const f=a[a.length-1];a.push({fixed:c-f.stretch,stretch:f.stretch}),a.push({fixed:c-f.stretch,stretch:f.stretch+(d-c)})}return a.push({fixed:t+Jc,stretch:r}),a}function Lh(i,t,r,a){return i/t*r+a}function zh(i,t,r,a){return i-t*r/a}class Uh{constructor(t,r,a,c,d,f,m,_,x,Q){var k;if(this.boxStartIndex=t.length,x){let L=f.top,q=f.bottom;const X=f.collisionPadding;X&&(L-=X[1],q+=X[3]);let re=q-L;re>0&&(re=Math.max(10,re),this.circleDiameter=re)}else{const L=null!==(k=f.image)&&void 0!==k&&k.content&&(f.image.textFitWidth||f.image.textFitHeight)?Uu(f):{x1:f.left,y1:f.top,x2:f.right,y2:f.bottom};L.y1=L.y1*m-_[0],L.y2=L.y2*m+_[2],L.x1=L.x1*m-_[3],L.x2=L.x2*m+_[1];const q=f.collisionPadding;if(q&&(L.x1-=q[0]*m,L.y1-=q[1]*m,L.x2+=q[2]*m,L.y2+=q[3]*m),Q){const X=new at(L.x1,L.y1),re=new at(L.x2,L.y1),pe=new at(L.x1,L.y2),be=new at(L.x2,L.y2),Je=Q*Math.PI/180;X._rotate(Je),re._rotate(Je),pe._rotate(Je),be._rotate(Je),L.x1=Math.min(X.x,re.x,pe.x,be.x),L.x2=Math.max(X.x,re.x,pe.x,be.x),L.y1=Math.min(X.y,re.y,pe.y,be.y),L.y2=Math.max(X.y,re.y,pe.y,be.y)}t.emplaceBack(r.x,r.y,L.x1,L.y1,L.x2,L.y2,a,c,d)}this.boxEndIndex=t.length}}class ud{constructor(t=[],r=((a,c)=>a<c?-1:a>c?1:0)){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let a=(this.length>>1)-1;a>=0;a--)this._down(a)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:r,compare:a}=this,c=r[t];for(;t>0;){const d=t-1>>1,f=r[d];if(a(c,f)>=0)break;r[t]=f,t=d}r[t]=c}_down(t){const{data:r,compare:a}=this,c=this.length>>1,d=r[t];for(;t<c;){let f=1+(t<<1);const m=f+1;if(m<this.length&&a(r[m],r[f])<0&&(f=m),a(r[f],d)>=0)break;r[t]=r[f],t=f}r[t]=d}}function Ad(i,t=1,r=!1){let a=1/0,c=1/0,d=-1/0,f=-1/0;const m=i[0];for(let q=0;q<m.length;q++){const X=m[q];(!q||X.x<a)&&(a=X.x),(!q||X.y<c)&&(c=X.y),(!q||X.x>d)&&(d=X.x),(!q||X.y>f)&&(f=X.y)}const _=Math.min(d-a,f-c);let x=_/2;const Q=new ud([],dd);if(0===_)return new at(a,c);for(let q=a;q<d;q+=_)for(let X=c;X<f;X+=_)Q.push(new jc(q+x,X+x,x,i));let k=function(q){let X=0,re=0,pe=0;const be=q[0];for(let Je=0,ke=be.length,Oe=ke-1;Je<ke;Oe=Je++){const nt=be[Je],vt=be[Oe],Nt=nt.x*vt.y-vt.x*nt.y;re+=(nt.x+vt.x)*Nt,pe+=(nt.y+vt.y)*Nt,X+=3*Nt}return new jc(re/X,pe/X,0,q)}(i),L=Q.length;for(;Q.length;){const q=Q.pop();(q.d>k.d||!k.d)&&(k=q,r&&console.log("found best %d after %d probes",Math.round(1e4*q.d)/1e4,L)),q.max-k.d<=t||(x=q.h/2,Q.push(new jc(q.p.x-x,q.p.y-x,x,i)),Q.push(new jc(q.p.x+x,q.p.y-x,x,i)),Q.push(new jc(q.p.x-x,q.p.y+x,x,i)),Q.push(new jc(q.p.x+x,q.p.y+x,x,i)),L+=4)}return r&&(console.log(`num probes: ${L}`),console.log(`best distance: ${k.d}`)),k.p}function dd(i,t){return t.max-i.max}function jc(i,t,r,a){this.p=new at(i,t),this.h=r,this.d=function(c,d){let f=!1,m=1/0;for(let _=0;_<d.length;_++){const x=d[_];for(let Q=0,k=x.length,L=k-1;Q<k;L=Q++){const q=x[Q],X=x[L];q.y>c.y!=X.y>c.y&&c.x<(X.x-q.x)*(c.y-q.y)/(X.y-q.y)+q.x&&(f=!f),m=Math.min(m,vh(c,q,X))}}return(f?1:-1)*Math.sqrt(m)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}var Cn;Z.aq=void 0,(Cn=Z.aq||(Z.aq={}))[Cn.center=1]="center",Cn[Cn.left=2]="left",Cn[Cn.right=3]="right",Cn[Cn.top=4]="top",Cn[Cn.bottom=5]="bottom",Cn[Cn["top-left"]=6]="top-left",Cn[Cn["top-right"]=7]="top-right",Cn[Cn["bottom-left"]=8]="bottom-left",Cn[Cn["bottom-right"]=9]="bottom-right";const zl=7,lu=Number.POSITIVE_INFINITY;function fA(i,t){return t[1]!==lu?function(r,a,c){let d=0,f=0;switch(a=Math.abs(a),c=Math.abs(c),r){case"top-right":case"top-left":case"top":f=c-zl;break;case"bottom-right":case"bottom-left":case"bottom":f=-c+zl}switch(r){case"top-right":case"bottom-right":case"right":d=-a;break;case"top-left":case"bottom-left":case"left":d=a}return[d,f]}(i,t[0],t[1]):function(r,a){let c=0,d=0;a<0&&(a=0);const f=a/Math.SQRT2;switch(r){case"top-right":case"top-left":d=f-zl;break;case"bottom-right":case"bottom-left":d=-f+zl;break;case"bottom":d=-a+zl;break;case"top":d=a-zl}switch(r){case"top-right":case"bottom-right":c=-f;break;case"top-left":case"bottom-left":c=f;break;case"left":c=a;break;case"right":c=-a}return[c,d]}(i,t[0])}function pA(i,t,r){var a;const c=i.layout,d=null===(a=c.get("text-variable-anchor-offset"))||void 0===a?void 0:a.evaluate(t,{},r);if(d){const m=d.values,_=[];for(let x=0;x<m.length;x+=2){const Q=_[x]=m[x],k=m[x+1].map(L=>L*en);Q.startsWith("top")?k[1]-=zl:Q.startsWith("bottom")&&(k[1]+=zl),_[x+1]=k}return new ei(_)}const f=c.get("text-variable-anchor");if(f){let m;m=void 0!==i._unevaluatedLayout.getValue("text-radial-offset")?[c.get("text-radial-offset").evaluate(t,{},r)*en,lu]:c.get("text-offset").evaluate(t,{},r).map(x=>x*en);const _=[];for(const x of f)_.push(x,fA(x,m));return new ei(_)}return null}function cu(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function fd(i,t,r,a,c,d,f,m,_,x,Q){let k=d.textMaxSize.evaluate(t,{});void 0===k&&(k=f);const L=i.layers[0].layout,q=L.get("icon-offset").evaluate(t,{},Q),X=mA(r.horizontal),re=f/24,pe=i.tilePixelRatio*re,be=i.tilePixelRatio*k/24,Je=i.tilePixelRatio*m,ke=i.tilePixelRatio*L.get("symbol-spacing"),Oe=L.get("text-padding")*i.tilePixelRatio,nt=function(ft,oi,ai,Bi=1){const _r=ft.get("icon-padding").evaluate(oi,{},ai),pr=_r&&_r.values;return[pr[0]*Bi,pr[1]*Bi,pr[2]*Bi,pr[3]*Bi]}(L,t,Q,i.tilePixelRatio),vt=L.get("text-max-angle")/180*Math.PI,Nt="viewport"!==L.get("text-rotation-alignment")&&"point"!==L.get("symbol-placement"),gi="map"===L.get("icon-rotation-alignment")&&"point"!==L.get("symbol-placement"),Gt=L.get("symbol-placement"),Lt=ke/2,si=L.get("icon-text-fit");let Yt;a&&"none"!==si&&(i.allowVerticalPlacement&&r.vertical&&(Yt=Gu(a,r.vertical,si,L.get("icon-text-fit-padding"),q,re)),X&&(a=Gu(a,X,si,L.get("icon-text-fit-padding"),q,re)));const Jt=(ft,oi)=>{oi.x<0||oi.x>=kr||oi.y<0||oi.y>=kr||function(ai,Bi,_r,pr,cn,Xa,En,hn,Zn,Kn,$n,Ur,un,Fn,Qn,Xn,Sn,La,Aa,Wi,Ir,wr,Ba,Pr,Yc){const ho=ai.addToLineVertexArray(Bi,_r);let uo,Wa,za,_n,Jo=0,yh=0,bA=0,wA=0,mu=-1,yu=-1;const jo={};let vA=ba("");if(ai.allowVerticalPlacement&&pr.vertical){const Ln=hn.layout.get("text-rotate").evaluate(Ir,{},Pr)+90;za=new Uh(Zn,Bi,Kn,$n,Ur,pr.vertical,un,Fn,Qn,Ln),En&&(_n=new Uh(Zn,Bi,Kn,$n,Ur,En,Sn,La,Qn,Ln))}if(cn){const Ln=hn.layout.get("icon-rotate").evaluate(Ir,{}),Ua="none"!==hn.layout.get("icon-text-fit"),fc=AA(cn,Ln,Ba,Ua),Fs=En?AA(En,Ln,Ba,Ua):void 0;Wa=new Uh(Zn,Bi,Kn,$n,Ur,cn,Sn,La,!1,Ln),Jo=4*fc.length;const pc=ai.iconSizeData;let Ao=null;"source"===pc.kind?(Ao=[co*hn.layout.get("icon-size").evaluate(Ir,{})],Ao[0]>Rl&&Pe(`${ai.layerIds[0]}: Value for "icon-size" is >= ${dh}. Reduce your "icon-size".`)):"composite"===pc.kind&&(Ao=[co*wr.compositeIconSizes[0].evaluate(Ir,{},Pr),co*wr.compositeIconSizes[1].evaluate(Ir,{},Pr)],(Ao[0]>Rl||Ao[1]>Rl)&&Pe(`${ai.layerIds[0]}: Value for "icon-size" is >= ${dh}. Reduce your "icon-size".`)),ai.addSymbols(ai.icon,fc,Ao,Wi,Aa,Ir,Z.ah.none,Bi,ho.lineStartIndex,ho.lineLength,-1,Pr),mu=ai.icon.placedSymbolArray.length-1,Fs&&(yh=4*Fs.length,ai.addSymbols(ai.icon,Fs,Ao,Wi,Aa,Ir,Z.ah.vertical,Bi,ho.lineStartIndex,ho.lineLength,-1,Pr),yu=ai.icon.placedSymbolArray.length-1)}const xA=Object.keys(pr.horizontal);for(const Ln of xA){const Ua=pr.horizontal[Ln];if(!uo){vA=ba(Ua.text);const Fs=hn.layout.get("text-rotate").evaluate(Ir,{},Pr);uo=new Uh(Zn,Bi,Kn,$n,Ur,Ua,un,Fn,Qn,Fs)}const fc=1===Ua.positionedLines.length;if(bA+=gA(ai,Bi,Ua,Xa,hn,Qn,Ir,Xn,ho,pr.vertical?Z.ah.horizontal:Z.ah.horizontalOnly,fc?xA:[Ln],jo,mu,wr,Pr),fc)break}pr.vertical&&(wA+=gA(ai,Bi,pr.vertical,Xa,hn,Qn,Ir,Xn,ho,Z.ah.vertical,["vertical"],jo,yu,wr,Pr));const md=uo?uo.boxStartIndex:ai.collisionBoxArray.length,yd=uo?uo.boxEndIndex:ai.collisionBoxArray.length,_d=za?za.boxStartIndex:ai.collisionBoxArray.length,Id=za?za.boxEndIndex:ai.collisionBoxArray.length,bd=Wa?Wa.boxStartIndex:ai.collisionBoxArray.length,wd=Wa?Wa.boxEndIndex:ai.collisionBoxArray.length,vd=_n?_n.boxStartIndex:ai.collisionBoxArray.length,xd=_n?_n.boxEndIndex:ai.collisionBoxArray.length;let Rs=-1;const Oh=(Ln,Ua)=>Ln&&Ln.circleDiameter?Math.max(Ln.circleDiameter,Ua):Ua;Rs=Oh(uo,Rs),Rs=Oh(za,Rs),Rs=Oh(Wa,Rs),Rs=Oh(_n,Rs);const BA=Rs>-1?1:0;BA&&(Rs*=Yc/en),ai.glyphOffsetArray.length>=Hc.MAX_GLYPHS&&Pe("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==Ir.sortKey&&ai.addToSortKeyRanges(ai.symbolInstances.length,Ir.sortKey);const Bd=pA(hn,Ir,Pr),[Cd,Ed]=function(Ln,Ua){const fc=Ln.length,Fs=Ua?.values;if(Fs?.length>0)for(let pc=0;pc<Fs.length;pc+=2){const Ao=Fs[pc+1];Ln.emplaceBack(Z.aq[Fs[pc]],Ao[0],Ao[1])}return[fc,Ln.length]}(ai.textAnchorOffsets,Bd);ai.symbolInstances.emplaceBack(Bi.x,Bi.y,jo.right>=0?jo.right:-1,jo.center>=0?jo.center:-1,jo.left>=0?jo.left:-1,jo.vertical||-1,mu,yu,vA,md,yd,_d,Id,bd,wd,vd,xd,Kn,bA,wA,Jo,yh,BA,0,un,Rs,Cd,Ed)}(i,oi,ft,r,a,c,Yt,i.layers[0],i.collisionBoxArray,t.index,t.sourceLayerIndex,i.index,pe,[Oe,Oe,Oe,Oe],Nt,_,Je,nt,gi,q,t,d,x,Q,f)};if("line"===Gt)for(const ft of sA(t.geometry,0,0,kr,kr)){const oi=hd(ft,ke,vt,r.vertical||X,a,24,be,i.overscaling,kr);for(const ai of oi)X&&pd(i,X.text,Lt,ai)||Jt(ft,ai)}else if("line-center"===Gt){for(const ft of t.geometry)if(ft.length>1){const oi=cd(ft,vt,r.vertical||X,a,24,be);oi&&Jt(ft,oi)}}else if("Polygon"===t.type)for(const ft of yo(t.geometry,0)){const oi=Ad(ft,16);Jt(ft[0],new Ll(oi.x,oi.y,0))}else if("LineString"===t.type)for(const ft of t.geometry)Jt(ft,new Ll(ft[0].x,ft[0].y,0));else if("Point"===t.type)for(const ft of t.geometry)for(const oi of ft)Jt([oi],new Ll(oi.x,oi.y,0))}function gA(i,t,r,a,c,d,f,m,_,x,Q,k,L,q,X){const re=function(Je,ke,Oe,nt,vt,Nt,gi,Gt){const Lt=nt.layout.get("text-rotate").evaluate(Nt,{})*Math.PI/180,si=[];for(const Yt of ke.positionedLines)for(const Jt of Yt.positionedGlyphs){if(!Jt.rect)continue;const ft=Jt.rect||{};let oi=Mu+1,ai=!0,Bi=1,_r=0;const pr=(vt||Gt)&&Jt.vertical,cn=Jt.metrics.advance*Jt.scale/2;if(Gt&&ke.verticalizable&&(_r=Yt.lineOffset/2-(Jt.imageName?-(en-Jt.metrics.width*Jt.scale)/2:(Jt.scale-1)*en)),Jt.imageName){const Wi=gi[Jt.imageName];ai=Wi.sdf,Bi=Wi.pixelRatio,oi=ua/Bi}const Xa=vt?[Jt.x+cn,Jt.y]:[0,0];let En=vt?[0,0]:[Jt.x+cn+Oe[0],Jt.y+Oe[1]-_r],hn=[0,0];pr&&(hn=En,En=[0,0]);const Zn=Jt.metrics.isDoubleResolution?2:1,Kn=(Jt.metrics.left-oi)*Jt.scale-cn+En[0],$n=(-Jt.metrics.top-oi)*Jt.scale+En[1],Ur=Kn+ft.w/Zn*Jt.scale/Bi,un=$n+ft.h/Zn*Jt.scale/Bi,Fn=new at(Kn,$n),Qn=new at(Ur,$n),Xn=new at(Kn,un),Sn=new at(Ur,un);if(pr){const Wi=new at(-cn,cn-uh),Ir=-Math.PI/2,wr=en/2-cn,Ba=new at(5-uh-wr,-(Jt.imageName?wr:0)),Pr=new at(...hn);Fn._rotateAround(Ir,Wi)._add(Ba)._add(Pr),Qn._rotateAround(Ir,Wi)._add(Ba)._add(Pr),Xn._rotateAround(Ir,Wi)._add(Ba)._add(Pr),Sn._rotateAround(Ir,Wi)._add(Ba)._add(Pr)}if(Lt){const Wi=Math.sin(Lt),Ir=Math.cos(Lt),wr=[Ir,-Wi,Wi,Ir];Fn._matMult(wr),Qn._matMult(wr),Xn._matMult(wr),Sn._matMult(wr)}const La=new at(0,0),Aa=new at(0,0);si.push({tl:Fn,tr:Qn,bl:Xn,br:Sn,tex:ft,writingMode:ke.writingMode,glyphOffset:Xa,sectionIndex:Jt.sectionIndex,isSDF:ai,pixelOffsetTL:La,pixelOffsetBR:Aa,minFontScaleX:0,minFontScaleY:0})}return si}(0,r,m,c,d,f,a,i.allowVerticalPlacement),pe=i.textSizeData;let be=null;"source"===pe.kind?(be=[co*c.layout.get("text-size").evaluate(f,{})],be[0]>Rl&&Pe(`${i.layerIds[0]}: Value for "text-size" is >= ${dh}. Reduce your "text-size".`)):"composite"===pe.kind&&(be=[co*q.compositeTextSizes[0].evaluate(f,{},X),co*q.compositeTextSizes[1].evaluate(f,{},X)],(be[0]>Rl||be[1]>Rl)&&Pe(`${i.layerIds[0]}: Value for "text-size" is >= ${dh}. Reduce your "text-size".`)),i.addSymbols(i.text,re,be,m,d,f,x,t,_.lineStartIndex,_.lineLength,L,X);for(const Je of Q)k[Je]=i.text.placedSymbolArray.length-1;return 4*re.length}function mA(i){for(const t in i)return i[t];return null}function pd(i,t,r,a){const c=i.compareText;if(t in c){const d=c[t];for(let f=d.length-1;f>=0;f--)if(a.dist(d[f])<r)return!0}else c[t]=[];return c[t].push(a),!1}const yA=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class hu{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[r,a]=new Uint8Array(t,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");const c=a>>4;if(1!==c)throw new Error(`Got v${c} data when expected v1.`);const d=yA[15&a];if(!d)throw new Error("Unrecognized array type.");const[f]=new Uint16Array(t,2,1),[m]=new Uint32Array(t,4,1);return new hu(m,f,d,t)}constructor(t,r=64,a=Float64Array,c){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=a,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const d=yA.indexOf(this.ArrayType),f=2*t*this.ArrayType.BYTES_PER_ELEMENT,m=t*this.IndexArrayType.BYTES_PER_ELEMENT,_=(8-m%8)%8;if(d<0)throw new Error(`Unexpected typed array class: ${a}.`);c&&c instanceof ArrayBuffer?(this.data=c,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+m+_,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+f+m+_),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+m+_,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+d]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){const a=this._pos>>1;return this.ids[a]=a,this.coords[this._pos++]=t,this.coords[this._pos++]=r,a}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return uu(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,a,c){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:d,coords:f,nodeSize:m}=this,_=[0,d.length-1,0],x=[];for(;_.length;){const Q=_.pop()||0,k=_.pop()||0,L=_.pop()||0;if(k-L<=m){for(let pe=L;pe<=k;pe++){const be=f[2*pe],Je=f[2*pe+1];be>=t&&be<=a&&Je>=r&&Je<=c&&x.push(d[pe])}continue}const q=L+k>>1,X=f[2*q],re=f[2*q+1];X>=t&&X<=a&&re>=r&&re<=c&&x.push(d[q]),(0===Q?t<=X:r<=re)&&(_.push(L),_.push(q-1),_.push(1-Q)),(0===Q?a>=X:c>=re)&&(_.push(q+1),_.push(k),_.push(1-Q))}return x}within(t,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:c,coords:d,nodeSize:f}=this,m=[0,c.length-1,0],_=[],x=a*a;for(;m.length;){const Q=m.pop()||0,k=m.pop()||0,L=m.pop()||0;if(k-L<=f){for(let pe=L;pe<=k;pe++)IA(d[2*pe],d[2*pe+1],t,r)<=x&&_.push(c[pe]);continue}const q=L+k>>1,X=d[2*q],re=d[2*q+1];IA(X,re,t,r)<=x&&_.push(c[q]),(0===Q?t-a<=X:r-a<=re)&&(m.push(L),m.push(q-1),m.push(1-Q)),(0===Q?t+a>=X:r+a>=re)&&(m.push(q+1),m.push(k),m.push(1-Q))}return _}}function uu(i,t,r,a,c,d){if(c-a<=r)return;const f=a+c>>1;_A(i,t,f,a,c,d),uu(i,t,r,a,f-1,1-d),uu(i,t,r,f+1,c,1-d)}function _A(i,t,r,a,c,d){for(;c>a;){if(c-a>600){const x=c-a+1,Q=r-a+1,k=Math.log(x),L=.5*Math.exp(2*k/3),q=.5*Math.sqrt(k*L*(x-L)/x)*(Q-x/2<0?-1:1);_A(i,t,r,Math.max(a,Math.floor(r-Q*L/x+q)),Math.min(c,Math.floor(r+(x-Q)*L/x+q)),d)}const f=t[2*r+d];let m=a,_=c;for(gh(i,t,a,r),t[2*c+d]>f&&gh(i,t,a,c);m<_;){for(gh(i,t,m,_),m++,_--;t[2*m+d]<f;)m++;for(;t[2*_+d]>f;)_--}t[2*a+d]===f?gh(i,t,a,_):(_++,gh(i,t,_,c)),_<=r&&(a=_+1),r<=_&&(c=_-1)}}function gh(i,t,r,a){Au(i,r,a),Au(t,2*r,2*a),Au(t,2*r+1,2*a+1)}function Au(i,t,r){const a=i[t];i[t]=i[r],i[r]=a}function IA(i,t,r,a){const c=i-r,d=t-a;return c*c+d*d}var du;Z.bg=void 0,(du=Z.bg||(Z.bg={})).create="create",du.load="load",du.fullLoad="fullLoad";let Gh=null,mh=[];const fu=1e3/60,pu="loadTime",gu="fullLoadTime",gd={mark(i){performance.mark(i)},frame(i){const t=i;null!=Gh&&mh.push(t-Gh),Gh=t},clearMetrics(){Gh=null,mh=[],performance.clearMeasures(pu),performance.clearMeasures(gu);for(const i in Z.bg)performance.clearMarks(Z.bg[i])},getPerformanceMetrics(){performance.measure(pu,Z.bg.create,Z.bg.load),performance.measure(gu,Z.bg.create,Z.bg.fullLoad);const i=performance.getEntriesByName(pu)[0].duration,t=performance.getEntriesByName(gu)[0].duration,r=mh.length,a=1/(mh.reduce((d,f)=>d+f,0)/r/1e3),c=mh.filter(d=>d>fu).reduce((d,f)=>d+(f-fu)/fu,0);return{loadTime:i,fullLoadTime:t,fps:a,percentDroppedFrames:c/(r+c)*100,totalFrames:r}}};Z.$=class extends T{},Z.A=Ml,Z.B=ml,Z.C=function(i){if(null==wi){const t=i.navigator?i.navigator.userAgent:null;wi=!!i.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return wi},Z.D=$t,Z.E=da,Z.F=class{constructor(i,t){var r,c;this.target=i,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new od(()=>this.process()),this.subscription=(c=r=>this.receive(r),(r=this.target).addEventListener("message",c,!1),{unsubscribe:()=>{r.removeEventListener("message",c,!1)}}),this.globalScope=ri(self)?i:window}registerMessageHandler(i,t){this.messageHandlers[i]=t}sendAsync(i,t){return new Promise((r,a)=>{const c=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[c]={resolve:r,reject:a},t&&t.signal.addEventListener("abort",()=>{delete this.resolveRejects[c];const m={id:c,type:"<cancel>",origin:location.origin,targetMapId:i.targetMapId,sourceMapId:this.mapId};this.target.postMessage(m)},{once:!0});const d=[],f=Object.assign(Object.assign({},i),{id:c,sourceMapId:this.mapId,origin:location.origin,data:Cs(i.data,d)});this.target.postMessage(f,{transfer:d})})}receive(i){const t=i.data,r=t.id;if(!("file://"!==t.origin&&"file://"!==location.origin&&"resource://android"!==t.origin&&"resource://android"!==location.origin&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if("<cancel>"===t.type){delete this.tasks[r];const a=this.abortControllers[r];return delete this.abortControllers[r],void(a&&a.abort())}if(ri(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(0===this.taskQueue.length)return;const i=this.taskQueue.shift(),t=this.tasks[i];delete this.tasks[i],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(i,t)}processTask(i,t){return g(this,void 0,void 0,function*(){if("<response>"===t.type){const c=this.resolveRejects[i];return delete this.resolveRejects[i],c?void(t.error?c.reject(Es(t.error)):c.resolve(Es(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(i,new Error(`Could not find a registered handler for ${t.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const r=Es(t.data),a=new AbortController;this.abortControllers[i]=a;try{const c=yield this.messageHandlers[t.type](t.sourceMapId,r,a);this.completeTask(i,null,c)}catch(c){this.completeTask(i,c)}})}completeTask(i,t,r){const a=[];delete this.abortControllers[i];const c={id:i,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?Cs(t):null,data:Cs(r,a)};this.target.postMessage(c,{transfer:a})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},Z.G=or,Z.H=function(){var i=new Ml(16);return Ml!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},Z.I=$h,Z.J=function(i,t,r){var a,c,d,f,m,_,x,Q,k,L,q,X,re=r[0],pe=r[1],be=r[2];return t===i?(i[12]=t[0]*re+t[4]*pe+t[8]*be+t[12],i[13]=t[1]*re+t[5]*pe+t[9]*be+t[13],i[14]=t[2]*re+t[6]*pe+t[10]*be+t[14],i[15]=t[3]*re+t[7]*pe+t[11]*be+t[15]):(c=t[1],d=t[2],f=t[3],m=t[4],_=t[5],x=t[6],Q=t[7],k=t[8],L=t[9],q=t[10],X=t[11],i[0]=a=t[0],i[1]=c,i[2]=d,i[3]=f,i[4]=m,i[5]=_,i[6]=x,i[7]=Q,i[8]=k,i[9]=L,i[10]=q,i[11]=X,i[12]=a*re+m*pe+k*be+t[12],i[13]=c*re+_*pe+L*be+t[13],i[14]=d*re+x*pe+q*be+t[14],i[15]=f*re+Q*pe+X*be+t[15]),i},Z.K=function(i,t,r){var a=r[0],c=r[1],d=r[2];return i[0]=t[0]*a,i[1]=t[1]*a,i[2]=t[2]*a,i[3]=t[3]*a,i[4]=t[4]*c,i[5]=t[5]*c,i[6]=t[6]*c,i[7]=t[7]*c,i[8]=t[8]*d,i[9]=t[9]*d,i[10]=t[10]*d,i[11]=t[11]*d,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i},Z.L=Vh,Z.M=function(i,t){const r={};for(let a=0;a<t.length;a++){const c=t[a];c in i&&(r[c]=i[c])}return r},Z.N=Fl,Z.O=Zu,Z.P=at,Z.Q=Ku,Z.R=ca,Z.S=Fa,Z.T=Xs,Z.U=mi,Z.V=Wt,Z.W=At,Z.X=kr,Z.Y=y,Z.Z=fh,Z._=g,Z.a=ir,Z.a$=function(i,t){var r=i[0],a=i[1],c=i[2],d=i[3],f=i[4],m=i[5],_=i[6],x=i[7],Q=i[8],k=i[9],L=i[10],q=i[11],X=i[12],re=i[13],pe=i[14],be=i[15],Je=t[0],ke=t[1],Oe=t[2],nt=t[3],vt=t[4],Nt=t[5],gi=t[6],Gt=t[7],Lt=t[8],si=t[9],Yt=t[10],Jt=t[11],ft=t[12],oi=t[13],ai=t[14],Bi=t[15];return Math.abs(r-Je)<=Pn*Math.max(1,Math.abs(r),Math.abs(Je))&&Math.abs(a-ke)<=Pn*Math.max(1,Math.abs(a),Math.abs(ke))&&Math.abs(c-Oe)<=Pn*Math.max(1,Math.abs(c),Math.abs(Oe))&&Math.abs(d-nt)<=Pn*Math.max(1,Math.abs(d),Math.abs(nt))&&Math.abs(f-vt)<=Pn*Math.max(1,Math.abs(f),Math.abs(vt))&&Math.abs(m-Nt)<=Pn*Math.max(1,Math.abs(m),Math.abs(Nt))&&Math.abs(_-gi)<=Pn*Math.max(1,Math.abs(_),Math.abs(gi))&&Math.abs(x-Gt)<=Pn*Math.max(1,Math.abs(x),Math.abs(Gt))&&Math.abs(Q-Lt)<=Pn*Math.max(1,Math.abs(Q),Math.abs(Lt))&&Math.abs(k-si)<=Pn*Math.max(1,Math.abs(k),Math.abs(si))&&Math.abs(L-Yt)<=Pn*Math.max(1,Math.abs(L),Math.abs(Yt))&&Math.abs(q-Jt)<=Pn*Math.max(1,Math.abs(q),Math.abs(Jt))&&Math.abs(X-ft)<=Pn*Math.max(1,Math.abs(X),Math.abs(ft))&&Math.abs(re-oi)<=Pn*Math.max(1,Math.abs(re),Math.abs(oi))&&Math.abs(pe-ai)<=Pn*Math.max(1,Math.abs(pe),Math.abs(ai))&&Math.abs(be-Bi)<=Pn*Math.max(1,Math.abs(be),Math.abs(Bi))},Z.a0=Ui,Z.a1=ou,Z.a2=b,Z.a3=i=>{const t=window.document.createElement("video");return t.muted=!0,new Promise(r=>{t.onloadstart=()=>{r(t)};for(const a of i){const c=window.document.createElement("source");tn(a)||(t.crossOrigin="Anonymous"),c.src=a,t.appendChild(c)}})},Z.a4=function(){return It++},Z.a5=Ft,Z.a6=Hc,Z.a7=ka,Z.a8=Ms,Z.a9=iA,Z.aA=function(i){if("custom"===i.type)return new sd(i);switch(i.type){case"background":return new rd(i);case"circle":return new Bh(i);case"fill":return new ct(i);case"fill-extrusion":return new Jh(i);case"heatmap":return new l(i);case"hillshade":return new w(i);case"line":return new DA(i);case"raster":return new ad(i);case"symbol":return new Rh(i)}},Z.aB=mt,Z.aC=function(i,t){if(!i)return[{command:"setStyle",args:[t]}];let r=[];try{if(!Li(i.version,t.version))return[{command:"setStyle",args:[t]}];Li(i.center,t.center)||r.push({command:"setCenter",args:[t.center]}),Li(i.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),Li(i.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),Li(i.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),Li(i.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),Li(i.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),Li(i.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),Li(i.light,t.light)||r.push({command:"setLight",args:[t.light]}),Li(i.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),Li(i.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),Li(i.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});const a={},c=[];!function(f,m,_,x){let Q;for(Q in m=m||{},f=f||{})Object.prototype.hasOwnProperty.call(f,Q)&&(Object.prototype.hasOwnProperty.call(m,Q)||bn(Q,_,x));for(Q in m)Object.prototype.hasOwnProperty.call(m,Q)&&(Object.prototype.hasOwnProperty.call(f,Q)?Li(f[Q],m[Q])||("geojson"===f[Q].type&&"geojson"===m[Q].type&&Wn(f,m,Q)?Xi(_,{command:"setGeoJSONSourceData",args:[Q,m[Q].data]}):dn(Q,m,_,x)):fa(Q,m,_))}(i.sources,t.sources,c,a);const d=[];i.layers&&i.layers.forEach(f=>{"source"in f&&a[f.source]?r.push({command:"removeLayer",args:[f.id]}):d.push(f)}),r=r.concat(c),function(f,m,_){m=m||[];const x=(f=f||[]).map(We),Q=m.map(We),k=f.reduce(gr,{}),L=m.reduce(gr,{}),q=x.slice(),X=Object.create(null);let re,pe,be,Je,ke;for(let Oe=0,nt=0;Oe<x.length;Oe++)re=x[Oe],Object.prototype.hasOwnProperty.call(L,re)?nt++:(Xi(_,{command:"removeLayer",args:[re]}),q.splice(q.indexOf(re,nt),1));for(let Oe=0,nt=0;Oe<Q.length;Oe++)re=Q[Q.length-1-Oe],q[q.length-1-Oe]!==re&&(Object.prototype.hasOwnProperty.call(k,re)?(Xi(_,{command:"removeLayer",args:[re]}),q.splice(q.lastIndexOf(re,q.length-nt),1)):nt++,Je=q[q.length-Oe],Xi(_,{command:"addLayer",args:[L[re],Je]}),q.splice(q.length-Oe,0,re),X[re]=!0);for(let Oe=0;Oe<Q.length;Oe++)if(re=Q[Oe],pe=k[re],be=L[re],!X[re]&&!Li(pe,be))if(Li(pe.source,be.source)&&Li(pe["source-layer"],be["source-layer"])&&Li(pe.type,be.type)){for(ke in nn(pe.layout,be.layout,_,re,null,"setLayoutProperty"),nn(pe.paint,be.paint,_,re,null,"setPaintProperty"),Li(pe.filter,be.filter)||Xi(_,{command:"setFilter",args:[re,be.filter]}),Li(pe.minzoom,be.minzoom)&&Li(pe.maxzoom,be.maxzoom)||Xi(_,{command:"setLayerZoomRange",args:[re,be.minzoom,be.maxzoom]}),pe)Object.prototype.hasOwnProperty.call(pe,ke)&&"layout"!==ke&&"paint"!==ke&&"filter"!==ke&&"metadata"!==ke&&"minzoom"!==ke&&"maxzoom"!==ke&&(0===ke.indexOf("paint.")?nn(pe[ke],be[ke],_,re,ke.slice(6),"setPaintProperty"):Li(pe[ke],be[ke])||Xi(_,{command:"setLayerProperty",args:[re,ke,be[ke]]}));for(ke in be)Object.prototype.hasOwnProperty.call(be,ke)&&!Object.prototype.hasOwnProperty.call(pe,ke)&&"layout"!==ke&&"paint"!==ke&&"filter"!==ke&&"metadata"!==ke&&"minzoom"!==ke&&"maxzoom"!==ke&&(0===ke.indexOf("paint.")?nn(pe[ke],be[ke],_,re,ke.slice(6),"setPaintProperty"):Li(pe[ke],be[ke])||Xi(_,{command:"setLayerProperty",args:[re,ke,be[ke]]}))}else Xi(_,{command:"removeLayer",args:[re]}),Je=q[q.lastIndexOf(re)+1],Xi(_,{command:"addLayer",args:[be,Je]})}(d,t.layers,r)}catch(a){console.warn("Unable to compute style diff:",a),r=[{command:"setStyle",args:[t]}]}return r},Z.aD=function(i){const t=[],r=i.id;return void 0===r&&t.push({message:`layers.${r}: missing required property "id"`}),void 0===i.render&&t.push({message:`layers.${r}: missing required method "render"`}),i.renderingMode&&"2d"!==i.renderingMode&&"3d"!==i.renderingMode&&t.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),t},Z.aE=function i(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let a=0;a<t.length;a++)if(!i(t[a],r[a]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==r){if("object"!=typeof r||Object.keys(t).length!==Object.keys(r).length)return!1;for(const a in t)if(!i(t[a],r[a]))return!1;return!0}return t===r},Z.aF=je,Z.aG=kt,Z.aH=class extends ro{constructor(i,t){super(i,t),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},Z.aI=Mc,Z.aJ=class extends ro{constructor(i,t){super(i,t),this.current=Tc}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let t=1;t<16;t++)if(i[t]!==this.current[t]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},Z.aK=th,Z.aL=sc,Z.aM=xe,Z.aN=class extends ro{constructor(i,t){super(i,t),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},Z.aO=class extends ro{constructor(i,t){super(i,t),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},Z.aP=function(i,t,r,a,c,d,f){var m=1/(t-r),_=1/(a-c),x=1/(d-f);return i[0]=-2*m,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*_,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*x,i[11]=0,i[12]=(t+r)*m,i[13]=(c+a)*_,i[14]=(f+d)*x,i[15]=1,i},Z.aQ=Hh,Z.aR=class extends Me{},Z.aS=PA,Z.aT=class extends Ve{},Z.aU=lh,Z.aV=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))},Z.aW=Eh,Z.aX=zr,Z.aY=la,Z.aZ=class extends jt{},Z.a_=function(i,t){return i[0]===t[0]&&i[1]===t[1]&&i[2]===t[2]&&i[3]===t[3]&&i[4]===t[4]&&i[5]===t[5]&&i[6]===t[6]&&i[7]===t[7]&&i[8]===t[8]&&i[9]===t[9]&&i[10]===t[10]&&i[11]===t[11]&&i[12]===t[12]&&i[13]===t[13]&&i[14]===t[14]&&i[15]===t[15]},Z.aa=function(i){const t={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(r,a,c,d)=>{const f=c||d;return t[a]=!f||f.toLowerCase(),""}),t["max-age"]){const r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t},Z.ab=function(i,t){const r=[];for(const a in i)a in t||r.push(a);return r},Z.ac=bi,Z.ad=function(i,t,r){var a=Math.sin(r),c=Math.cos(r),d=t[0],f=t[1],m=t[2],_=t[3],x=t[4],Q=t[5],k=t[6],L=t[7];return t!==i&&(i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[0]=d*c+x*a,i[1]=f*c+Q*a,i[2]=m*c+k*a,i[3]=_*c+L*a,i[4]=x*c-d*a,i[5]=Q*c-f*a,i[6]=k*c-m*a,i[7]=L*c-_*a,i},Z.ae=function(i){var t=new Ml(16);return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15],t},Z.af=zc,Z.ag=function(i,t){let r=0,a=0;if("constant"===i.kind)a=i.layoutSize;else if("source"!==i.kind){const{interpolationType:c,minZoom:d,maxZoom:f}=i,m=c?bi(vn.interpolationFactor(c,t,d,f),0,1):0;"camera"===i.kind?a=Kr.number(i.minSize,i.maxSize,m):r=m}return{uSizeT:r,uSize:a}},Z.ai=function(i,{uSize:t,uSizeT:r},{lowerSize:a,upperSize:c}){return"source"===i.kind?a/co:"composite"===i.kind?Kr.number(a/co,c/co,r):t},Z.aj=tu,Z.ak=function(i,t,r,a){const c=t.y-i.y,d=t.x-i.x,f=a.y-r.y,m=a.x-r.x,_=f*d-m*c;if(0===_)return null;const x=(m*(i.y-r.y)-f*(i.x-r.x))/_;return new at(i.x+x*d,i.y+x*c)},Z.al=sA,Z.am=_h,Z.an=xh,Z.ao=function(i){let t=1/0,r=1/0,a=-1/0,c=-1/0;for(const d of i)t=Math.min(t,d.x),r=Math.min(r,d.y),a=Math.max(a,d.x),c=Math.max(c,d.y);return[t,r,a,c]},Z.ap=en,Z.ar=eu,Z.as=function(i,t){var r=t[0],a=t[1],c=t[2],d=t[3],f=t[4],m=t[5],_=t[6],x=t[7],Q=t[8],k=t[9],L=t[10],q=t[11],X=t[12],re=t[13],pe=t[14],be=t[15],Je=r*m-a*f,ke=r*_-c*f,Oe=r*x-d*f,nt=a*_-c*m,vt=a*x-d*m,Nt=c*x-d*_,gi=Q*re-k*X,Gt=Q*pe-L*X,Lt=Q*be-q*X,si=k*pe-L*re,Yt=k*be-q*re,Jt=L*be-q*pe,ft=Je*Jt-ke*Yt+Oe*si+nt*Lt-vt*Gt+Nt*gi;return ft?(i[0]=(m*Jt-_*Yt+x*si)*(ft=1/ft),i[1]=(c*Yt-a*Jt-d*si)*ft,i[2]=(re*Nt-pe*vt+be*nt)*ft,i[3]=(L*vt-k*Nt-q*nt)*ft,i[4]=(_*Lt-f*Jt-x*Gt)*ft,i[5]=(r*Jt-c*Lt+d*Gt)*ft,i[6]=(pe*Oe-X*Nt-be*ke)*ft,i[7]=(Q*Nt-L*Oe+q*ke)*ft,i[8]=(f*Yt-m*Lt+x*gi)*ft,i[9]=(a*Lt-r*Yt-d*gi)*ft,i[10]=(X*vt-re*Oe+be*Je)*ft,i[11]=(k*Oe-Q*vt-q*Je)*ft,i[12]=(m*Gt-f*si-_*gi)*ft,i[13]=(r*si-a*Gt+c*gi)*ft,i[14]=(re*ke-X*nt-pe*Je)*ft,i[15]=(Q*nt-k*ke+L*Je)*ft,i):null},Z.at=cu,Z.au=Wh,Z.av=hu,Z.aw=function(){const i={},t=Ze.$version;for(const r in Ze.$root){const a=Ze.$root[r];if(a.required){let c=null;c="version"===r?t:"array"===a.type?[]:{},null!=c&&(i[r]=c)}}return i},Z.ax=Il,Z.ay=jr,Z.az=function(i){i=i.slice();const t=Object.create(null);for(let r=0;r<i.length;r++)t[i[r].id]=i[r];for(let r=0;r<i.length;r++)"ref"in i[r]&&(i[r]=Or(i[r],t[i[r].ref]));return i},Z.b=Rt,Z.b0=function(i,t){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i},Z.b1=function(i,t,r){return i[0]=t[0]*r[0],i[1]=t[1]*r[1],i[2]=t[2]*r[2],i[3]=t[3]*r[3],i},Z.b2=function(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]*t[3]},Z.b3=_t,Z.b4=Wu,Z.b5=$u,Z.b6=function(i,t,r,a,c){var d,f=1/Math.tan(t/2);return i[0]=f/r,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=f,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,null!=c&&c!==1/0?(i[10]=(c+a)*(d=1/(a-c)),i[14]=2*c*a*d):(i[10]=-1,i[14]=-2*a),i},Z.b7=function(i,t,r){var a=Math.sin(r),c=Math.cos(r),d=t[4],f=t[5],m=t[6],_=t[7],x=t[8],Q=t[9],k=t[10],L=t[11];return t!==i&&(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15]),i[4]=d*c+x*a,i[5]=f*c+Q*a,i[6]=m*c+k*a,i[7]=_*c+L*a,i[8]=x*c-d*a,i[9]=Q*c-f*a,i[10]=k*c-m*a,i[11]=L*c-_*a,i},Z.b8=fi,Z.b9=Qt,Z.bA=Bu,Z.bB=function(i){return i.message===sr},Z.bC=ps,Z.bD=nr,Z.ba=function(i){return i*Math.PI/180},Z.bb=function(i,t){const{x:r,y:a}=fh.fromLngLat(t);return!(i<0||i>25||a<0||a>=1||r<0||r>=1)},Z.bc=function(i,t){return i[0]=t[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},Z.bd=class extends S{},Z.be=au,Z.bf=gd,Z.bh=rr,Z.bi=function(i,t){ir.REGISTERED_PROTOCOLS[i]=t},Z.bj=function(i){delete ir.REGISTERED_PROTOCOLS[i]},Z.bk=function(i,t){const r={};for(let c=0;c<i.length;c++){const d=t&&t[i[c].id]||dl(i[c]);t&&(t[i[c].id]=d);let f=r[d];f||(f=r[d]=[]),f.push(i[c])}const a=[];for(const c in r)a.push(r[c]);return a},Z.bl=Ht,Z.bm=tA,Z.bn=rA,Z.bo=Pu,Z.bp=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=kr/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const t=i.bucket.layers[0],r=t.layout,a=t._unevaluatedLayout._values,c={layoutIconSize:a["icon-size"].possiblyEvaluate(new er(i.bucket.zoom+1),i.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new er(i.bucket.zoom+1),i.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new er(18))};if("composite"===i.bucket.textSizeData.kind){const{minZoom:x,maxZoom:Q}=i.bucket.textSizeData;c.compositeTextSizes=[a["text-size"].possiblyEvaluate(new er(x),i.canonical),a["text-size"].possiblyEvaluate(new er(Q),i.canonical)]}if("composite"===i.bucket.iconSizeData.kind){const{minZoom:x,maxZoom:Q}=i.bucket.iconSizeData;c.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new er(x),i.canonical),a["icon-size"].possiblyEvaluate(new er(Q),i.canonical)]}const d=r.get("text-line-height")*en,f="viewport"!==r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),m=r.get("text-keep-upright"),_=r.get("text-size");for(const x of i.bucket.features){const Q=r.get("text-font").evaluate(x,{},i.canonical).join(","),k=_.evaluate(x,{},i.canonical),L=c.layoutTextSize.evaluate(x,{},i.canonical),q=c.layoutIconSize.evaluate(x,{},i.canonical),X={horizontal:{},vertical:void 0},re=x.text;let pe,be=[0,0];if(re){const Oe=re.toString(),nt=r.get("text-letter-spacing").evaluate(x,{},i.canonical)*en,vt=ec(Oe)?nt:0,Nt=r.get("text-anchor").evaluate(x,{},i.canonical),gi=pA(t,x,i.canonical);if(!gi){const Yt=r.get("text-radial-offset").evaluate(x,{},i.canonical);be=Yt?fA(Nt,[Yt*en,lu]):r.get("text-offset").evaluate(x,{},i.canonical).map(Jt=>Jt*en)}let Gt=f?"center":r.get("text-justify").evaluate(x,{},i.canonical);const Lt="point"===r.get("symbol-placement")?r.get("text-max-width").evaluate(x,{},i.canonical)*en:1/0,si=()=>{i.bucket.allowVerticalPlacement&&bl(Oe)&&(X.vertical=Mh(re,i.glyphMap,i.glyphPositions,i.imagePositions,Q,Lt,d,Nt,"left",vt,be,Z.ah.vertical,!0,L,k))};if(!f&&gi){const Yt=new Set;if("auto"===Gt)for(let ft=0;ft<gi.values.length;ft+=2)Yt.add(cu(gi.values[ft]));else Yt.add(Gt);let Jt=!1;for(const ft of Yt)if(!X.horizontal[ft])if(Jt)X.horizontal[ft]=X.horizontal[0];else{const oi=Mh(re,i.glyphMap,i.glyphPositions,i.imagePositions,Q,Lt,d,"center",ft,vt,be,Z.ah.horizontal,!1,L,k);oi&&(X.horizontal[ft]=oi,Jt=1===oi.positionedLines.length)}si()}else{"auto"===Gt&&(Gt=cu(Nt));const Yt=Mh(re,i.glyphMap,i.glyphPositions,i.imagePositions,Q,Lt,d,Nt,Gt,vt,be,Z.ah.horizontal,!1,L,k);Yt&&(X.horizontal[Gt]=Yt),si(),bl(Oe)&&f&&m&&(X.vertical=Mh(re,i.glyphMap,i.glyphPositions,i.imagePositions,Q,Lt,d,Nt,Gt,vt,be,Z.ah.vertical,!1,L,k))}}let Je=!1;if(x.icon&&x.icon.name){const Oe=i.imageMap[x.icon.name];Oe&&(pe=XA(i.imagePositions[x.icon.name],r.get("icon-offset").evaluate(x,{},i.canonical),r.get("icon-anchor").evaluate(x,{},i.canonical)),Je=!!Oe.sdf,void 0===i.bucket.sdfIcons?i.bucket.sdfIcons=Je:i.bucket.sdfIcons!==Je&&Pe("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Oe.pixelRatio!==i.bucket.pixelRatio||0!==r.get("icon-rotate").constantOr(1))&&(i.bucket.iconsNeedLinear=!0))}const ke=mA(X.horizontal)||X.vertical;i.bucket.iconsInText=!!ke&&ke.iconsInText,(ke||pe)&&fd(i.bucket,x,X,pe,i.imageMap,c,L,q,be,Je,i.canonical)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},Z.bq=jh,Z.br=Ye,Z.bs=Ka,Z.bt=Kt,Z.bu=Zh,Z.bv=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return 0===i.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},Z.bw=function(i,t,r,a,c){return g(this,void 0,void 0,function*(){if(Wt())try{return yield At(i,t,r,a,c)}catch{}return function(d,f,m,_,x){const Q=d.width,k=d.height;et&&Zt||(et=new OffscreenCanvas(Q,k),Zt=et.getContext("2d",{willReadFrequently:!0}
3)),et.width=Q,et.height=k,Zt.drawImage(d,0,0,Q,k);const L=Zt.getImageData(f,m,_,x);return Zt.clearRect(0,0,Q,k),L.data}(i,t,r,a,c)})},Z.bx=eA,Z.by=li,Z.bz=ci,Z.c=cr,Z.d=i=>g(void 0,void 0,void 0,function*(){if(0===i.byteLength)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(i)],{type:"image/png"});try{return createImageBitmap(t)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),Z.e=ot,Z.f=i=>new Promise((t,r)=>{const a=new Image;a.onload=()=>{t(a),URL.revokeObjectURL(a.src),a.onload=null,window.requestAnimationFrame(()=>{a.src=Bt})},a.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const c=new Blob([new Uint8Array(i)],{type:"image/png"});a.src=i.byteLength?URL.createObjectURL(c):Bt}),Z.g=hr,Z.h=(i,t)=>Dn(ot(i,{type:"json"}),t),Z.i=ri,Z.j=In,Z.k=rn,Z.l=(i,t)=>Dn(ot(i,{type:"arrayBuffer"}),t),Z.m=Dn,Z.n=function(i){return new Zh(i).readFields(HA,[])},Z.o=hc,Z.p=Tu,Z.q=A,Z.r=Xl,Z.s=tn,Z.t=_l,Z.u=aa,Z.v=Ze,Z.w=Pe,Z.x=function([i,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:i*Math.cos(t)*Math.sin(r),y:i*Math.sin(t)*Math.sin(r),z:i*Math.cos(r)}},Z.y=Kr,Z.z=er}),ht("worker",0,function(Z){class g{constructor(O){this.keyCache={},O&&this.replace(O)}replace(O){this._layerConfigs={},this._layers={},this.update(O,[])}update(O,G){for(const fe of O){this._layerConfigs[fe.id]=fe;const Se=this._layers[fe.id]=Z.aA(fe);Se._featureFilter=Z.a7(Se.filter),this.keyCache[fe.id]&&delete this.keyCache[fe.id]}for(const fe of G)delete this.keyCache[fe],delete this._layerConfigs[fe],delete this._layers[fe];this.familiesBySource={};const W=Z.bk(Object.values(this._layerConfigs),this.keyCache);for(const fe of W){const Se=fe.map($e=>this._layers[$e.id]),ve=Se[0];if("none"===ve.visibility)continue;const Ne=ve.source||"";let Be=this.familiesBySource[Ne];Be||(Be=this.familiesBySource[Ne]={});const rt=ve.sourceLayer||"_geojsonTileLayer";let yt=Be[rt];yt||(yt=Be[rt]=[]),yt.push(Se)}}}class li{constructor(O){const G={},W=[];for(const Ne in O){const Be=O[Ne],rt=G[Ne]={};for(const yt in Be){const $e=Be[+yt];if(!$e||0===$e.bitmap.width||0===$e.bitmap.height)continue;const Dt={x:0,y:0,w:$e.bitmap.width+2,h:$e.bitmap.height+2};W.push(Dt),rt[yt]={rect:Dt,metrics:$e.metrics}}}const{w:fe,h:Se}=Z.p(W),ve=new Z.o({width:fe||1,height:Se||1});for(const Ne in O){const Be=O[Ne];for(const rt in Be){const yt=Be[+rt];if(!yt||0===yt.bitmap.width||0===yt.bitmap.height)continue;const $e=G[Ne][rt].rect;Z.o.copy(yt.bitmap,ve,{x:0,y:0},{x:$e.x+1,y:$e.y+1},yt.bitmap)}}this.image=ve,this.positions=G}}Z.bl("GlyphAtlas",li);class ci{constructor(O){this.tileID=new Z.S(O.tileID.overscaledZ,O.tileID.wrap,O.tileID.canonical.z,O.tileID.canonical.x,O.tileID.canonical.y),this.uid=O.uid,this.zoom=O.zoom,this.pixelRatio=O.pixelRatio,this.tileSize=O.tileSize,this.source=O.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=O.showCollisionBoxes,this.collectResourceTiming=!!O.collectResourceTiming,this.returnDependencies=!!O.returnDependencies,this.promoteId=O.promoteId,this.inFlightDependencies=[]}parse(O,G,W,fe){return Z._(this,void 0,void 0,function*(){this.status="parsing",this.data=O,this.collisionBoxArray=new Z.a5;const Se=new Z.bm(Object.keys(O.layers).sort()),ve=new Z.bn(this.tileID,this.promoteId);ve.bucketLayerIDs=[];const Ne={},Be={featureIndex:ve,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:W},rt=G.familiesBySource[this.source];for(const C in rt){const P=O.layers[C];if(!P)continue;1===P.version&&Z.w(`Vector tile source "${this.source}" layer "${C}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const z=Se.encode(C),U=[];for(let K=0;K<P.length;K++){const $=P.feature(K),Ie=ve.getId($,C);U.push({feature:$,id:Ie,index:K,sourceLayerIndex:z})}for(const K of rt[C]){const $=K[0];$.source!==this.source&&Z.w(`layer.source = ${$.source} does not equal this.source = ${this.source}`),$.minzoom&&this.zoom<Math.floor($.minzoom)||$.maxzoom&&this.zoom>=$.maxzoom||"none"!==$.visibility&&(Ut(K,this.zoom,W),(Ne[$.id]=$.createBucket({index:ve.bucketLayerIDs.length,layers:K,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:z,sourceID:this.source})).populate(U,Be,this.tileID.canonical),ve.bucketLayerIDs.push(K.map(Ie=>Ie.id)))}}const yt=Z.aF(Be.glyphDependencies,C=>Object.keys(C).map(Number));
3this.inFlightDependencies.forEach(C=>C?.abort()),this.inFlightDependencies=[];let $e=Promise.resolve({});if(Object.keys(yt).length){const C=new AbortController;this.inFlightDependencies.push(C),$e=fe.sendAsync({type:"GG",data:{stacks:yt,source:this.source,tileID:this.tileID,type:"glyphs"}},C)}const Dt=Object.keys(Be.iconDependencies);let ii=Promise.resolve({});if(Dt.length){const C=new AbortController;this.inFlightDependencies.push(C),ii=fe.sendAsync({type:"GI",data:{icons:Dt,source:this.source,tileID:this.tileID,type:"icons"}},C)}const hi=Object.keys(Be.patternDependencies);let Ji=Promise.resolve({});if(hi.length){const C=new AbortController;this.inFlightDependencies.push(C),Ji=fe.sendAsync({type:"GI",data:{icons:hi,source:this.source,tileID:this.tileID,type:"patterns"}},C)}const[Ei,ji,zi]=yield Promise.all([$e,ii,Ji]),ur=new li(Ei),mr=new Z.bo(ji,zi);for(const C in Ne){const P=Ne[C];P instanceof Z.a6?(Ut(P.layers,this.zoom,W),Z.bp({bucket:P,glyphMap:Ei,glyphPositions:ur.positions,imageMap:ji,imagePositions:mr.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):P.hasPattern&&(P instanceof Z.bq||P instanceof Z.br||P instanceof Z.bs)&&(Ut(P.layers,this.zoom,W),P.addFeatures(Be,this.tileID.canonical,mr.patternPositions))}return this.status="done",{buckets:Object.values(Ne).filter(C=>!C.isEmpty()),featureIndex:ve,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ur.image,imageAtlas:mr,glyphMap:this.returnDependencies?Ei:null,iconMap:this.returnDependencies?ji:null,glyphPositions:this.returnDependencies?ur.positions:null}})}}function Ut(me,O,G){const W=new Z.z(O);for(const fe of me)fe.recalculate(W,G)}class at{constructor(O,G,W){this.actor=O,this.layerIndex=G,this.availableImages=W,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(O,G){return Z._(this,void 0,void 0,function*(){const W=yield Z.l(O.request,G);try{return{vectorTile:new Z.bt.VectorTile(new Z.bu(W.data)),rawData:W.data,cacheControl:W.cacheControl,expires:W.expires}}catch(fe){const Se=new Uint8Array(W.data);let ve=`Unable to parse the tile at ${O.request.url}, `;throw ve+=31===Se[0]&&139===Se[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${fe.message}`,new Error(ve)}})}loadTile(O){return Z._(this,void 0,void 0,function*(){const G=O.uid,W=!!(O&&O.request&&O.request.collectResourceTiming)&&new Z.bv(O.request),fe=new ci(O);this.loading[G]=fe;const Se=new AbortController;fe.abort=Se;try{const ve=yield this.loadVectorTile(O,Se);if(delete this.loading[G],!ve)return null;const Ne=ve.rawData,Be={};ve.expires&&(Be.expires=ve.expires),ve.cacheControl&&(Be.cacheControl=ve.cacheControl);const rt={};if(W){const $e=W.finish();$e&&(rt.resourceTiming=JSON.parse(JSON.stringify($e)))}fe.vectorTile=ve.vectorTile;const yt=fe.parse(ve.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[G]=fe,this.fetching[G]={rawTileData:Ne,cacheControl:Be,resourceTiming:rt};try{const $e=yield yt;return Z.e({rawTileData:Ne.slice(0)},$e,Be,rt)}finally{delete this.fetching[G]}}catch(ve){throw delete this.loading[G],fe.status="done",this.loaded[G]=fe,ve}})}reloadTile(O){return Z._(this,void 0,void 0,function*(){const G=O.uid;if(!this.loaded||!this.loaded[G])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const W=this.loaded[G];if(W.showCollisionBoxes=O.showCollisionBoxes,"parsing"===W.status){const fe=yield W.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor);let Se;if(this.fetching[G]){const{rawTileData:ve,cacheControl:Ne,resourceTiming:Be}=this.fetching[G];delete this.fetching[G],Se=Z.e({rawTileData:ve.slice(0)},fe,Ne,Be)}else Se=fe;return Se}if("done"===W.status&&W.vectorTile)return W.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(O){return Z._(this,void 0,void 0,function*(){const G=this.loading,W=O.uid;G&&G[W]&&G[W].abort&&(G[W].abort.abort(),delete G[W])})}removeTile(O){return Z._(this,void 0,void 0,function*(){this.loaded&&this.loaded[O.uid]&&delete this.loaded[O.uid]})}}class Ee{constructor(){this.loaded={}}loadTile(O){return Z._(this,void 0,void 0,function*(){const{uid:G,encoding:W,rawImageData:fe,redFactor:Se,greenFactor:ve,blueFactor:Ne,baseShift:Be}
vendor: 22,309 bytes, line 3
3=O,rt=fe.width+2,yt=fe.height+2,$e=Z.b(fe)?new Z.R({width:rt,height:yt},yield Z.bw(fe,-1,-1,rt,yt)):fe,Dt=new Z.bx(G,$e,W,Se,ve,Ne,Be);return this.loaded=this.loaded||{},this.loaded[G]=Dt,Dt})}removeTile(O){const G=this.loaded,W=O.uid;G&&G[W]&&delete G[W]}}function Qi(me,O){if(0!==me.length){Vt(me[0],O);for(var G=1;G<me.length;G++)Vt(me[G],!O)}}function Vt(me,O){for(var G=0,W=0,fe=0,Se=me.length,ve=Se-1;fe<Se;ve=fe++){var Ne=(me[fe][0]-me[ve][0])*(me[ve][1]+me[fe][1]),Be=G+Ne;W+=Math.abs(G)>=Math.abs(Ne)?G-Be+Ne:Ne-Be+G,G=Be}G+W>=0!=!!O&&me.reverse()}var Ii=Z.by(function me(O,G){var W,fe=O&&O.type;if("FeatureCollection"===fe)for(W=0;W<O.features.length;W++)me(O.features[W],G);else if("GeometryCollection"===fe)for(W=0;W<O.geometries.length;W++)me(O.geometries[W],G);else if("Feature"===fe)me(O.geometry,G);else if("Polygon"===fe)Qi(O.coordinates,G);else if("MultiPolygon"===fe)for(W=0;W<O.coordinates.length;W++)Qi(O.coordinates[W],G);return O});const $i=Z.bt.VectorTileFeature.prototype.toGeoJSON;var mi={exports:{}},Wt=Z.bz,fi=Z.bt.VectorTileFeature,Qt=bi;function bi(me,O){this.options=O||{},this.features=me,this.length=me.length}function _t(me,O){this.id="number"==typeof me.id?me.id:void 0,this.type=me.type,this.rawGeometry=1===me.type?[me.geometry]:me.geometry,this.properties=me.tags,this.extent=O||4096}bi.prototype.feature=function(me){return new _t(this.features[me],this.options.extent)},_t.prototype.loadGeometry=function(){var me=this.rawGeometry;this.geometry=[];for(var O=0;O<me.length;O++){for(var G=me[O],W=[],fe=0;fe<G.length;fe++)W.push(new Wt(G[fe][0],G[fe][1]));this.geometry.push(W)}return this.geometry},_t.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var me=this.geometry,O=1/0,G=-1/0,W=1/0,fe=-1/0,Se=0;Se<me.length;Se++)for(var ve=me[Se],Ne=0;Ne<ve.length;Ne++){var Be=ve[Ne];O=Math.min(O,Be.x),G=Math.max(G,Be.x),W=Math.min(W,Be.y),fe=Math.max(fe,Be.y)}return[O,W,G,fe]},_t.prototype.toGeoJSON=fi.prototype.toGeoJSON;var ot=Z.bA,It=Qt;function je(me){var O=new ot;return function(G,W){for(var fe in G.layers)W.writeMessage(3,kt,G.layers[fe])}(me,O),O.finish()}function kt(me,O){var G;O.writeVarintField(15,me.version||1),O.writeStringField(1,me.name||""),O.writeVarintField(5,me.extent||4096);var W={keys:[],values:[],keycache:{},valuecache:{}};for(G=0;G<me.length;G++)W.feature=me.feature(G),O.writeMessage(2,mt,W);var fe=W.keys;for(G=0;G<fe.length;G++)O.writeStringField(3,fe[G]);var Se=W.values;for(G=0;G<Se.length;G++)O.writeMessage(4,wi,Se[G])}function mt(me,O){var G=me.feature;void 0!==G.id&&O.writeVarintField(1,G.id),O.writeMessage(2,lt,me),O.writeVarintField(3,G.type),O.writeMessage(4,ri,G)}function lt(me,O){var G=me.feature,W=me.keys,fe=me.values,Se=me.keycache,ve=me.valuecache;for(var Ne in G.properties){var Be=G.properties[Ne],rt=Se[Ne];if(null!==Be){void 0===rt&&(W.push(Ne),Se[Ne]=rt=W.length-1),O.writeVarint(rt);var yt=typeof Be;"string"!==yt&&"boolean"!==yt&&"number"!==yt&&(Be=JSON.stringify(Be));var $e=yt+":"+Be,Dt=ve[$e];void 0===Dt&&(fe.push(Be),ve[$e]=Dt=fe.length-1),O.writeVarint(Dt)}}}function Pe(me,O){return(O<<3)+(7&me)}function it(me){return me<<1^me>>31}function ri(me,O){for(var G=me.loadGeometry(),W=me.type,fe=0,Se=0,ve=G.length,Ne=0;Ne<ve;Ne++){var Be=G[Ne],rt=1;1===W&&(rt=Be.length),O.writeVarint(Pe(1,rt));for(var yt=3===W?Be.length-1:Be.length,$e=0;$e<yt;$e++){1===$e&&1!==W&&O.writeVarint(Pe(2,yt-1));var Dt=Be[$e].x-fe,ii=Be[$e].y-Se;O.writeVarint(it(Dt)),O.writeVarint(it(ii)),fe+=Dt,Se+=ii}3===W&&O.writeVarint(Pe(7,1))}}function wi(me,O){var G=typeof me;"string"===G?O.writeStringField(1,me):"boolean"===G?O.writeBooleanField(7,me):"number"===G&&(me%1!=0?O.writeDoubleField(3,me):me<0?O.writeSVarintField(6,me):O.writeVarintField(5,me))}mi.exports=je,mi.exports.fromVectorTileJs=je,mi.exports.fromGeojsonVt=function(me,O){O=O||{};var G={};for(var W in me)G[W]=new It(me[W].features,O),G[W].name=W,G[W].version=O.version,G[W].extent=O.extent;return je({layers:G})},mi.exports.GeoJSONWrapper=It;var Rt=Z.by(mi.exports);const Bt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:me=>me},At=Math.fround||(et=new Float32Array(1),me=>(et[0]=+me,et[0]));var et;const Zt=3,sr=5,cr=6;class ir{constructor(O){this.options=Object.assign(Object.create(Bt),O),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(O){const{log:G,minZoom:W,maxZoom:fe}=this.options;G&&console.time("total time");const Se=`prepare ${O.length} points`;G&&console.time(Se),this.points=O;const ve=[];for(let Be=0;Be<O.length;Be++){const rt=O[Be];if(!rt.geometry)continue;const[yt,$e]=rt.geometry.coordinates,Dt=At(rr(yt)),ii=At(jr($e));ve.push(Dt,ii,1/0,Be,-1,1),this.options.reduce&&ve.push(0)}let Ne=this.trees[fe+1]=this._createTree(ve);G&&console.timeEnd(Se);for(let Be=fe;Be>=W;Be--){const rt=+Date.now();Ne=this.trees[Be]=this._createTree(this._cluster(Ne,Be)),G&&console.log("z%d: %d clusters in %dms",Be,Ne.numItems,+Date.now()-rt)}return G&&console.timeEnd("total time"),this}getClusters(O,G){let W=((O[0]+180)%360+360)%360-180;const fe=Math.max(-90,Math.min(90,O[1]));let Se=180===O[2]?180:((O[2]+180)%360+360)%360-180;const ve=Math.max(-90,Math.min(90,O[3]));if(O[2]-O[0]>=360)W=-180,Se=180;else if(W>Se){const $e=this.getClusters([W,fe,180,ve],G),Dt=this.getClusters([-180,fe,Se,ve],G);return $e.concat(Dt)}const Ne=this.trees[this._limitZoom(G)],Be=Ne.range(rr(W),jr(ve),rr(Se),jr(fe)),rt=Ne.data,yt=[];for(const $e of Be){const Dt=this.stride*$e;yt.push(rt[Dt+sr]>1?hr(rt,Dt,this.clusterProps):this.points[rt[Dt+Zt]])}return yt}getChildren(O){const G=this._getOriginId(O),W=this._getOriginZoom(O),fe="No cluster with the specified id.",Se=this.trees[W];if(!Se)throw new Error(fe);const ve=Se.data;if(G*this.stride>=ve.length)throw new Error(fe);const Ne=this.options.radius/(this.options.extent*Math.pow(2,W-1)),Be=Se.within(ve[G*this.stride],ve[G*this.stride+1],Ne),rt=[];for(const yt of Be){const $e=yt*this.stride;ve[$e+4]===O&&rt.push(ve[$e+sr]>1?hr(ve,$e,this.clusterProps):this.points[ve[$e+Zt]])}if(0===rt.length)throw new Error(fe);return rt}getLeaves(O,G,W){const fe=[];return this._appendLeaves(fe,O,G=G||10,W=W||0,0),fe}getTile(O,G,W){const fe=this.trees[this._limitZoom(O)],Se=Math.pow(2,O),{extent:ve,radius:Ne}=this.options,Be=Ne/ve,rt=(W-Be)/Se,yt=(W+1+Be)/Se,$e={features:[]};return this._addTileFeatures(fe.range((G-Be)/Se,rt,(G+1+Be)/Se,yt),fe.data,G,W,Se,$e),0===G&&this._addTileFeatures(fe.range(1-Be/Se,rt,1,yt),fe.data,Se,W,Se,$e),G===Se-1&&this._addTileFeatures(fe.range(0,rt,Be/Se,yt),fe.data,-1,W,Se,$e),$e.features.length?$e:null}getClusterExpansionZoom(O){let G=this._getOriginZoom(O)-1;for(;G<=this.options.maxZoom;){const W=this.getChildren(O);if(G++,1!==W.length)break;O=W[0].properties.cluster_id}return G}_appendLeaves(O,G,W,fe,Se){const ve=this.getChildren(G);for(const Ne of ve){const Be=Ne.properties;if(Be&&Be.cluster?Se+Be.point_count<=fe?Se+=Be.point_count:Se=this._appendLeaves(O,Be.cluster_id,W,fe,Se):Se<fe?Se++:O.push(Ne),O.length===W)break}return Se}_createTree(O){const G=new Z.av(O.length/this.stride|0,this.options.nodeSize,Float32Array);for(let W=0;W<O.length;W+=this.stride)G.add(O[W],O[W+1]);return G.finish(),G.data=O,G}_addTileFeatures(O,G,W,fe,Se,ve){for(const Ne of O){const Be=Ne*this.stride,rt=G[Be+sr]>1;let yt,$e,Dt;if(rt)yt=or(G,Be,this.clusterProps),$e=G[Be],Dt=G[Be+1];else{const Ji=this.points[G[Be+Zt]];yt=Ji.properties;const[Ei,ji]=Ji.geometry.coordinates;$e=rr(Ei),Dt=jr(ji)}const ii={type:1,geometry:[[Math.round(this.options.extent*($e*Se-W)),Math.round(this.options.extent*(Dt*Se-fe))]],tags:yt};let hi;hi=rt||this.options.generateId?G[Be+Zt]:this.points[G[Be+Zt]].id,void 0!==hi&&(ii.id=hi),ve.features.push(ii)}}_limitZoom(O){return Math.max(this.options.minZoom,Math.min(Math.floor(+O),this.options.maxZoom+1))}_cluster(O,G){const{radius:W,extent:fe,reduce:Se,minPoints:ve}=this.options,Ne=W/(fe*Math.pow(2,G)),Be=O.data,rt=[],yt=this.stride;for(let $e=0;$e<Be.length;$e+=yt){if(Be[$e+2]<=G)continue;Be[$e+2]=G;const Dt=Be[$e],ii=Be[$e+1],hi=O.within(Be[$e],Be[$e+1],Ne),Ji=Be[$e+sr];let Ei=Ji;for(const ji of hi){const zi=ji*yt;Be[zi+2]>G&&(Ei+=Be[zi+sr])}if(Ei>Ji&&Ei>=ve){let ji,zi=Dt*Ji,ur=ii*Ji,mr=-1;const C=($e/yt<<5)+(G+1)+this.points.length;for(const P of hi){const z=P*yt;if(Be[z+2]<=G)continue;Be[z+2]=G;const U=Be[z+sr];zi+=Be[z]*U,ur+=Be[z+1]*U,Be[z+4]=C,Se&&(ji||(ji=this._map(Be,$e,!0),mr=this.clusterProps.length,this.clusterProps.push(ji)),Se(ji,this._map(Be,z)))}Be[$e+4]=C,rt.push(zi/Ei,ur/Ei,1/0,C,-1,Ei),Se&&rt.push(mr)}else{for(let ji=0;ji<yt;ji++)rt.push(Be[$e+ji]);if(Ei>1)for(const ji of hi){const zi=ji*yt;if(!(Be[zi+2]<=G)){Be[zi+2]=G;for(let ur=0;ur<yt;ur++)rt.push(Be[zi+ur])}}}}return rt}_getOriginId(O){return O-this.points.length>>5}_getOriginZoom(O){return(O-this.points.length)%32}_map(O,G,W){if(O[G+sr]>1){const ve=this.clusterProps[O[G+cr]];return W?Object.assign({},ve):ve}const fe=this.points[O[G+Zt]].properties,Se=this.options.map(fe);return W&&Se===fe?Object.assign({},Se):Se}}function hr(me,O,G){return{type:"Feature",id:me[O+Zt],properties:or(me,O,G),geometry:{type:"Point",coordinates:[(W=me[O],360*(W-.5)),Dn(me[O+1])]}};var W}function or(me,O,G){const W=me[O+sr],fe=W>=1e4?`${Math.round(W/1e3)}k`:W>=1e3?Math.round(W/100)/10+"k":W,Se=me[O+cr],ve=-1===Se?{}:Object.assign({},G[Se]);return Object.assign(ve,{cluster:!0,cluster_id:me[O+Zt],point_count:W,point_count_abbreviated:fe})}function rr(me){return me/360+.5}function jr(me){const O=Math.sin(me*Math.PI/180),G=.5-.25*Math.log((1+O)/(1-O))/Math.PI;return G<0?0:G>1?1:G}function Dn(me){const O=(180-360*me)*Math.PI/180;return 360*Math.atan(Math.exp(O))/Math.PI-90}function tn(me,O,G,W){let fe=W;const Se=O+(G-O>>1);let ve,Ne=G-O;const Be=me[O],rt=me[O+1],yt=me[G],$e=me[G+1];for(let Dt=O+3;Dt<G;Dt+=3){const ii=Yr(me[Dt],me[Dt+1],Be,rt,yt,$e);if(ii>fe)ve=Dt,fe=ii;else if(ii===fe){const hi=Math.abs(Dt-Se);hi<Ne&&(ve=Dt,Ne=hi)}}fe>W&&(ve-O>3&&tn(me,O,ve,W),me[ve+2]=fe,G-ve>3&&tn(me,ve,G,W))}function Yr(me,O,G,W,fe,Se){let ve=fe-G,Ne=Se-W;if(0!==ve||0!==Ne){const Be=((me-G)*ve+(O-W)*Ne)/(ve*ve+Ne*Ne);Be>1?(G=fe,W=Se):Be>0&&(G+=ve*Be,W+=Ne*Be)}return ve=me-G,Ne=O-W,ve*ve+Ne*Ne}function An(me,O,G,W){const fe={id:me??null,type:O,geometry:G,tags:W,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===O||"MultiPoint"===O||"LineString"===O)rn(fe,G);else if("Polygon"===O)rn(fe,G[0]);else if("MultiLineString"===O)for(const Se of G)rn(fe,Se);else if("MultiPolygon"===O)for(const Se of G)rn(fe,Se[0]);return fe}function rn(me,O){for(let G=0;G<O.length;G+=3)me.minX=Math.min(me.minX,O[G]),me.minY=Math.min(me.minY,O[G+1]),me.maxX=Math.max(me.maxX,O[G]),me.maxY=Math.max(me.maxY,O[G+1])}function In(me,O,G,W){if(!O.geometry)return;const fe=O.geometry.coordinates;if(fe&&0===fe.length)return;const Se=O.geometry.type,ve=Math.pow(G.tolerance/((1<<G.maxZoom)*G.extent),2);let Ne=[],Be=O.id;if(G.promoteId?Be=O.properties[G.promoteId]:G.generateId&&(Be=W||0),"Point"===Se)da(fe,Ne);else if("MultiPoint"===Se)for(const rt of fe)da(rt,Ne);else if("LineString"===Se)Ze(fe,Ne,ve,!1);else if("MultiLineString"===Se){if(G.lineMetrics){for(const rt of fe)Ne=[],Ze(rt,Ne,ve,!1),me.push(An(Be,"LineString",Ne,O.properties));return}br(fe,Ne,ve,!1)}else if("Polygon"===Se)br(fe,Ne,ve,!0);else{if("MultiPolygon"!==Se){if("GeometryCollection"===Se){for(const rt of O.geometry.geometries)In(me,{id:Be,geometry:rt,properties:O.properties},G,W);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const rt of fe){const yt=[];br(rt,yt,ve,!0),Ne.push(yt)}}me.push(An(Be,Se,Ne,O.properties))}function da(me,O){O.push(Or(me[0]),Li(me[1]),0)}function Ze(me,O,G,W){let fe,Se,ve=0;for(let Be=0;Be<me.length;Be++){const rt=Or(me[Be][0]),yt=Li(me[Be][1]);O.push(rt,yt,0),Be>0&&(ve+=W?(fe*yt-rt*Se)/2:Math.sqrt(Math.pow(rt-fe,2)+Math.pow(yt-Se,2))),fe=rt,Se=yt}const Ne=O.length-3;O[2]=1,tn(O,0,Ne,G),O[Ne+2]=1,O.size=Math.abs(ve),O.start=0,O.end=O.size}function br(me,O,G,W){for(let fe=0;fe<me.length;fe++){const Se=[];Ze(me[fe],Se,G,W),O.push(Se)}}function Or(me){return me/360+.5}function Li(me){const O=Math.sin(me*Math.PI/180),G=.5-.25*Math.log((1+O)/(1-O))/Math.PI;return G<0?0:G>1?1:G}function Xi(me,O,G,W,fe,Se,ve,Ne){if(W/=O,Se>=(G/=O)&&ve<W)return me;if(ve<G||Se>=W)return null;const Be=[];for(const rt of me){const yt=rt.geometry;let $e=rt.type;const Dt=0===fe?rt.minX:rt.minY,ii=0===fe?rt.maxX:rt.maxY;if(Dt>=G&&ii<W){Be.push(rt);continue}if(ii<G||Dt>=W)continue;let hi=[];if("Point"===$e||"MultiPoint"===$e)fa(yt,hi,G,W,fe);else if("LineString"===$e)bn(yt,hi,G,W,fe,!1,Ne.lineMetrics);else if("MultiLineString"===$e)Wn(yt,hi,G,W,fe,!1);else if("Polygon"===$e)Wn(yt,hi,G,W,fe,!0);else if("MultiPolygon"===$e)for(const Ji of yt){const Ei=[];Wn(Ji,Ei,G,W,fe,!0),Ei.length&&hi.push(Ei)}if(hi.length){if(Ne.lineMetrics&&"LineString"===$e){for(const Ji of hi)Be.push(An(rt.id,$e,Ji,rt.tags));continue}"LineString"!==$e&&"MultiLineString"!==$e||(1===hi.length?($e="LineString",hi=hi[0]):$e="MultiLineString"),"Point"!==$e&&"MultiPoint"!==$e||($e=3===hi.length?"Point":"MultiPoint"),Be.push(An(rt.id,$e,hi,rt.tags))}}return Be.length?Be:null}function fa(me,O,G,W,fe){for(let Se=0;Se<me.length;Se+=3){const ve=me[Se+fe];ve>=G&&ve<=W&&nn(O,me[Se],me[Se+1],me[Se+2])}}function bn(me,O,G,W,fe,Se,ve){let Ne=dn(me);const Be=0===fe?We:gr;let rt,yt,$e=me.start;for(let Ei=0;Ei<me.length-3;Ei+=3){const ji=me[Ei],zi=me[Ei+1],ur=me[Ei+2],mr=me[Ei+3],C=me[Ei+4],P=0===fe?ji:zi,z=0===fe?mr:C;let U=!1;ve&&(rt=Math.sqrt(Math.pow(ji-mr,2)+Math.pow(zi-C,2))),P<G?z>G&&(yt=Be(Ne,ji,zi,mr,C,G),ve&&(Ne.start=$e+rt*yt)):P>W?z<W&&(yt=Be(Ne,ji,zi,mr,C,W),ve&&(Ne.start=$e+rt*yt)):nn(Ne,ji,zi,ur),z<G&&P>=G&&(yt=Be(Ne,ji,zi,mr,C,G),U=!0),z>W&&P<=W&&(yt=Be(Ne,ji,zi,mr,C,W),U=!0),!Se&&U&&(ve&&(Ne.end=$e+rt*yt),O.push(Ne),Ne=dn(me)),ve&&($e+=rt)}let Dt=me.length-3;const ii=me[Dt],hi=me[Dt+1],Ji=0===fe?ii:hi;Ji>=G&&Ji<=W&&nn(Ne,ii,hi,me[Dt+2]),Dt=Ne.length-3,Se&&Dt>=3&&(Ne[Dt]!==Ne[0]||Ne[Dt+1]!==Ne[1])&&nn(Ne,Ne[0],Ne[1],Ne[2]),Ne.length&&O.push(Ne)}function dn(me){const O=[];return O.size=me.size,O.start=me.start,O.end=me.end,O}function Wn(me,O,G,W,fe,Se){for(const ve of me)bn(ve,O,G,W,fe,Se,!1)}function nn(me,O,G,W){me.push(O,G,W)}function We(me,O,G,W,fe,Se){const ve=(Se-O)/(W-O);return nn(me,Se,G+(fe-G)*ve,1),ve}function gr(me,O,G,W,fe,Se){const ve=(Se-G)/(fe-G);return nn(me,O+(W-O)*ve,Se,1),ve}function b(me,O){const G=[];for(let W=0;W<me.length;W++){const fe=me[W],Se=fe.type;let ve;if("Point"===Se||"MultiPoint"===Se||"LineString"===Se)ve=Y(fe.geometry,O);else if("MultiLineString"===Se||"Polygon"===Se){ve=[];for(const Ne of fe.geometry)ve.push(Y(Ne,O))}else if("MultiPolygon"===Se){ve=[];for(const Ne of fe.geometry){const Be=[];for(const rt of Ne)Be.push(Y(rt,O));ve.push(Be)}}G.push(An(fe.id,Se,ve,fe.tags))}return G}function Y(me,O){const G=[];G.size=me.size,void 0!==me.start&&(G.start=me.start,G.end=me.end);for(let W=0;W<me.length;W+=3)G.push(me[W]+O,me[W+1],me[W+2]);return G}function dt(me,O){if(me.transformed)return me;const G=1<<me.z,W=me.x,fe=me.y;for(const Se of me.features){const ve=Se.geometry,Ne=Se.type;if(Se.geometry=[],1===Ne)for(let Be=0;Be<ve.length;Be+=2)Se.geometry.push(zt(ve[Be],ve[Be+1],O,G,W,fe));else for(let Be=0;Be<ve.length;Be++){const rt=[];for(let yt=0;yt<ve[Be].length;yt+=2)rt.push(zt(ve[Be][yt],ve[Be][yt+1],O,G,W,fe));Se.geometry.push(rt)}}return me.transformed=!0,me}function zt(me,O,G,W,fe,Se){return[Math.round(G*(me*W-fe)),Math.round(G*(O*W-Se))]}function Ti(me,O,G,W,fe){const Se=O===fe.maxZoom?0:fe.tolerance/((1<<O)*fe.extent),ve={features:[],numPoints:0,numSimplified:0,numFeatures:me.length,source:null,x:G,y:W,z:O,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const Ne of me)wt(ve,Ne,Se,fe);return ve}function wt(me,O,G,W){const fe=O.geometry,Se=O.type,ve=[];if(me.minX=Math.min(me.minX,O.minX),me.minY=Math.min(me.minY,O.minY),me.maxX=Math.max(me.maxX,O.maxX),me.maxY=Math.max(me.maxY,O.maxY),"Point"===Se||"MultiPoint"===Se)for(let Ne=0;Ne<fe.length;Ne+=3)ve.push(fe[Ne],fe[Ne+1]),me.numPoints++,me.numSimplified++;else if("LineString"===Se)Ci(ve,fe,me,G,!1,!1);else if("MultiLineString"===Se||"Polygon"===Se)for(let Ne=0;Ne<fe.length;Ne++)Ci(ve,fe[Ne],me,G,"Polygon"===Se,0===Ne);else if("MultiPolygon"===Se)for(let Ne=0;Ne<fe.length;Ne++){const Be=fe[Ne];for(let rt=0;rt<Be.length;rt++)Ci(ve,Be[rt],me,G,!0,0===rt)}if(ve.length){let Ne=O.tags||null;if("LineString"===Se&&W.lineMetrics){Ne={};for(const rt in O.tags)Ne[rt]=O.tags[rt];Ne.mapbox_clip_start=fe.start/fe.size,Ne.mapbox_clip_end=fe.end/fe.size}const Be={geometry:ve,type:"Polygon"===Se||"MultiPolygon"===Se?3:"LineString"===Se||"MultiLineString"===Se?2:1,tags:Ne};null!==O.id&&(Be.id=O.id),me.features.push(Be)}}function Ci(me,O,G,W,fe,Se){const ve=W*W;if(W>0&&O.size<(fe?ve:W))return void(G.numPoints+=O.length/3);const Ne=[];for(let Be=0;Be<O.length;Be+=3)(0===W||O[Be+2]>ve)&&(G.numSimplified++,Ne.push(O[Be],O[Be+1])),G.numPoints++;fe&&function(Be,rt){let yt=0;for(let $e=0,Dt=Be.length,ii=Dt-2;$e<Dt;ii=$e,$e+=2)yt+=(Be[$e]-Be[ii])*(Be[$e+1]+Be[ii+1]);if(yt>0===rt)for(let $e=0,Dt=Be.length;$e<Dt/2;$e+=2){const ii=Be[$e],hi=Be[$e+1];Be[$e]=Be[Dt-2-$e],Be[$e+1]=Be[Dt-1-$e],Be[Dt-2-$e]=ii,Be[Dt-1-$e]=hi}}(Ne,Se),me.push(Ne)}const Ai={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class Rr{constructor(O,G){const W=(G=this.options=function(Se,ve){for(const Ne in ve)Se[Ne]=ve[Ne];return Se}(Object.create(Ai),G)).debug;if(W&&console.time("preprocess data"),G.maxZoom<0||G.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(G.promoteId&&G.generateId)throw new Error("promoteId and generateId cannot be used together.");let fe=function(Se,ve){const Ne=[];if("FeatureCollection"===Se.type)for(let Be=0;Be<Se.features.length;Be++)In(Ne,Se.features[Be],ve,Be);else In(Ne,"Feature"===Se.type?Se:{geometry:Se},ve);return Ne}(O,G);this.tiles={},this.tileCoords=[],W&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",G.indexMaxZoom,G.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),fe=function(Se,ve){const Ne=ve.buffer/ve.extent;let Be=Se;const rt=Xi(Se,1,-1-Ne,Ne,0,-1,2,ve),yt=Xi(Se,1,1-Ne,2+Ne,0,-1,2,ve);return(rt||yt)&&(Be=Xi(Se,1,-Ne,1+Ne,0,-1,2,ve)||[],rt&&(Be=b(rt,1).concat(Be)),yt&&(Be=Be.concat(b(yt,-1)))),Be}(fe,G),fe.length&&this.splitTile(fe,0,0,0),W&&(fe.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(O,G,W,fe,Se,ve,Ne){const Be=[O,G,W,fe],rt=this.options,yt=rt.debug;for(;Be.length;){fe=Be.pop(),W=Be.pop(),G=Be.pop(),O=Be.pop();const $e=1<<G,Dt=vr(G,W,fe);let ii=this.tiles[Dt];if(!ii&&(yt>1&&console.time("creation"),ii=this.tiles[Dt]=Ti(O,G,W,fe,rt),this.tileCoords.push({z:G,x:W,y:fe}),yt)){yt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",G,W,fe,ii.numFeatures,ii.numPoints,ii.numSimplified),console.timeEnd("creation"));const U=`z${G}`;this.stats[U]=(this.stats[U]||0)+1,this.total++}if(ii.source=O,null==Se){if(G===rt.indexMaxZoom||ii.numPoints<=rt.indexMaxPoints)continue}else{if(G===rt.maxZoom||G===Se)continue;if(null!=Se){const U=Se-G;if(W!==ve>>U||fe!==Ne>>U)continue}}if(ii.source=null,0===O.length)continue;yt>1&&console.time("clipping");const hi=.5*rt.buffer/rt.extent,Ji=.5-hi,Ei=.5+hi,ji=1+hi;let zi=null,ur=null,mr=null,C=null,P=Xi(O,$e,W-hi,W+Ei,0,ii.minX,ii.maxX,rt),z=Xi(O,$e,W+Ji,W+ji,0,ii.minX,ii.maxX,rt);O=null,P&&(zi=Xi(P,$e,fe-hi,fe+Ei,1,ii.minY,ii.maxY,rt),ur=Xi(P,$e,fe+Ji,fe+ji,1,ii.minY,ii.maxY,rt),P=null),z&&(mr=Xi(z,$e,fe-hi,fe+Ei,1,ii.minY,ii.maxY,rt),C=Xi(z,$e,fe+Ji,fe+ji,1,ii.minY,ii.maxY,rt),z=null),yt>1&&console.timeEnd("clipping"),Be.push(zi||[],G+1,2*W,2*fe),Be.push(ur||[],G+1,2*W,2*fe+1),Be.push(mr||[],G+1,2*W+1,2*fe),Be.push(C||[],G+1,2*W+1,2*fe+1)}}getTile(O,G,W){O=+O,G=+G,W=+W;const fe=this.options,{extent:Se,debug:ve}=fe;if(O<0||O>24)return null;const Ne=1<<O,Be=vr(O,G=G+Ne&Ne-1,W);if(this.tiles[Be])return dt(this.tiles[Be],Se);ve>1&&console.log("drilling down to z%d-%d-%d",O,G,W);let rt,yt=O,$e=G,Dt=W;for(;!rt&&yt>0;)yt--,$e>>=1,Dt>>=1,rt=this.tiles[vr(yt,$e,Dt)];return rt&&rt.source?(ve>1&&(console.log("found parent tile z%d-%d-%d",yt,$e,Dt),console.time("drilling down")),this.splitTile(rt.source,yt,$e,Dt,O,G,W),ve>1&&console.timeEnd("drilling down"),this.tiles[Be]?dt(this.tiles[Be],Se):null):null}}function vr(me,O,G){return 32*((1<<me)*G+O)+me}function vi(me,O){return O?me.properties[O]:me.id}function wn(me,O){if(null==me)return!0;if("Feature"===me.type)return null!=vi(me,O);if("FeatureCollection"===me.type){const G=new Set;for(const W of me.features){const fe=vi(W,O);if(null==fe||G.has(fe))return!1;G.add(fe)}return!0}return!1}function zn(me,O){const G=new Map;if(null!=me)if("Feature"===me.type)G.set(vi(me,O),me);else for(const W of me.features)G.set(vi(W,O),W);return G}class Un extends at{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(O,G){return Z._(this,void 0,void 0,function*(){const W=O.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const fe=this._geoJSONIndex.getTile(W.z,W.x,W.y);if(!fe)return null;const Se=new class{constructor(Ne){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=Z.X,this.length=Ne.length,this._features=Ne}feature(Ne){return new class{constructor(Be){this._feature=Be,this.extent=Z.X,this.type=Be.type,this.properties=Be.tags,"id"in Be&&!isNaN(Be.id)&&(this.id=parseInt(Be.id,10))}loadGeometry(){if(1===this._feature.type){const Be=[];for(const rt of this._feature.geometry)Be.push([new Z.P(rt[0],rt[1])]);return Be}{const Be=[];for(const rt of this._feature.geometry){const yt=[];for(const $e of rt)yt.push(new Z.P($e[0],$e[1]));Be.push(yt)}return Be}}toGeoJSON(Be,rt,yt){return $i.call(this,Be,rt,yt)}}(this._features[Ne])}}(fe.features);let ve=Rt(Se);return 0===ve.byteOffset&&ve.byteLength===ve.buffer.byteLength||(ve=new Uint8Array(ve)),{vectorTile:Se,rawData:ve.buffer}})}loadData(O){return Z._(this,void 0,void 0,function*(){var G;
3null===(G=this._pendingRequest)||void 0===G||G.abort();const W=!!(O&&O.request&&O.request.collectResourceTiming)&&new Z.bv(O.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(O,this._pendingRequest),this._geoJSONIndex=O.cluster?new ir(function({superclusterOptions:ve,clusterProperties:Ne}){if(!Ne||!ve)return ve;const Be={},rt={},yt={accumulated:null,zoom:0},$e={properties:null},Dt=Object.keys(Ne);for(const ii of Dt){const[hi,Ji]=Ne[ii],Ei=Z.bC(Ji),ji=Z.bC("string"==typeof hi?[hi,["accumulated"],["get",ii]]:hi);Be[ii]=Ei.value,rt[ii]=ji.value}return ve.map=ii=>{$e.properties=ii;const hi={};for(const Ji of Dt)hi[Ji]=Be[Ji].evaluate(yt,$e);return hi},ve.reduce=(ii,hi)=>{$e.properties=hi;for(const Ji of Dt)yt.accumulated=ii[Ji],ii[Ji]=rt[Ji].evaluate(yt,$e)},ve}(O)).load((yield this._pendingData).features):(fe=yield this._pendingData,new Rr(fe,O.geojsonVtOptions)),this.loaded={};const Se={};if(W){const ve=W.finish();ve&&(Se.resourceTiming={},Se.resourceTiming[O.source]=JSON.parse(JSON.stringify(ve)))}return Se}catch(Se){if(delete this._pendingRequest,Z.bB(Se))return{abandoned:!0};throw Se}var fe})}getData(){return Z._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(O){const G=this.loaded;return G&&G[O.uid]?super.reloadTile(O):this.loadTile(O)}loadAndProcessGeoJSON(O,G){return Z._(this,void 0,void 0,function*(){let W=yield this.loadGeoJSON(O,G);if(delete this._pendingRequest,"object"!=typeof W)throw new Error(`Input data given to '${O.source}' is not a valid GeoJSON object.`);if(Ii(W,!0),O.filter){const fe=Z.bC(O.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===fe.result)throw new Error(fe.value.map(ve=>`${ve.key}: ${ve.message}`).join(", "));W={type:"FeatureCollection",features:W.features.filter(ve=>fe.value.evaluate({zoom:0},ve))}}return W})}loadGeoJSON(O,G){return Z._(this,void 0,void 0,function*(){const{promoteId:W}=O;if(O.request){const fe=yield Z.h(O.request,G);return this._dataUpdateable=wn(fe.data,W)?zn(fe.data,W):void 0,fe.data}if("string"==typeof O.data)try{const fe=JSON.parse(O.data);return this._dataUpdateable=wn(fe,W)?zn(fe,W):void 0,fe}catch{throw new Error(`Input data given to '${O.source}' is not a valid GeoJSON object.`)}if(!O.dataDiff)throw new Error(`Input data given to '${O.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${O.source}`);return function(fe,Se,ve){var Ne,Be,rt,yt;if(Se.removeAll&&fe.clear(),Se.remove)for(const $e of Se.remove)fe.delete($e);if(Se.add)for(const $e of Se.add){const Dt=vi($e,ve);null!=Dt&&fe.set(Dt,$e)}if(Se.update)for(const $e of Se.update){let Dt=fe.get($e.id);if(null==Dt)continue;const ii=!$e.removeAllProperties&&((null===(Ne=$e.removeProperties)||void 0===Ne?void 0:Ne.length)>0||(null===(Be=$e.addOrUpdateProperties)||void 0===Be?void 0:Be.length)>0);if(($e.newGeometry||$e.removeAllProperties||ii)&&(Dt=Object.assign({},Dt),fe.set($e.id,Dt),ii&&(Dt.properties=Object.assign({},Dt.properties))),$e.newGeometry&&(Dt.geometry=$e.newGeometry),$e.removeAllProperties)Dt.properties={};else if((null===(rt=$e.removeProperties)||void 0===rt?void 0:rt.length)>0)for(const hi of $e.removeProperties)Object.prototype.hasOwnProperty.call(Dt.properties,hi)&&delete Dt.properties[hi];if((null===(yt=$e.addOrUpdateProperties)||void 0===yt?void 0:yt.length)>0)for(const{key:hi,value:Ji}of $e.addOrUpdateProperties)Dt.properties[hi]=Ji}}(this._dataUpdateable,O.dataDiff,W),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(O){return Z._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(O){return this._geoJSONIndex.getClusterExpansionZoom(O.clusterId)}getClusterChildren(O){return this._geoJSONIndex.getChildren(O.clusterId)}getClusterLeaves(O){return this._geoJSONIndex.getLeaves(O.clusterId,O.limit,O.offset)}}class Gn{constructor(O){this.self=O,this.actor=new Z.F(O),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={}
3,this.self.registerWorkerSource=(G,W)=>{if(this.externalWorkerSourceTypes[G])throw new Error(`Worker source with name "${G}" already registered.`);this.externalWorkerSourceTypes[G]=W},this.self.addProtocol=Z.bi,this.self.removeProtocol=Z.bj,this.self.registerRTLTextPlugin=G=>{if(Z.bD.isParsed())throw new Error("RTL text plugin already registered.");Z.bD.setMethods(G)},this.actor.registerMessageHandler("LDT",(G,W)=>this._getDEMWorkerSource(G,W.source).loadTile(W)),this.actor.registerMessageHandler("RDT",(G,W)=>Z._(this,void 0,void 0,function*(){this._getDEMWorkerSource(G,W.source).removeTile(W)})),this.actor.registerMessageHandler("GCEZ",(G,W)=>Z._(this,void 0,void 0,function*(){return this._getWorkerSource(G,W.type,W.source).getClusterExpansionZoom(W)})),this.actor.registerMessageHandler("GCC",(G,W)=>Z._(this,void 0,void 0,function*(){return this._getWorkerSource(G,W.type,W.source).getClusterChildren(W)})),this.actor.registerMessageHandler("GCL",(G,W)=>Z._(this,void 0,void 0,function*(){return this._getWorkerSource(G,W.type,W.source).getClusterLeaves(W)})),this.actor.registerMessageHandler("LD",(G,W)=>this._getWorkerSource(G,W.type,W.source).loadData(W)),this.actor.registerMessageHandler("GD",(G,W)=>this._getWorkerSource(G,W.type,W.source).getData()),this.actor.registerMessageHandler("LT",(G,W)=>this._getWorkerSource(G,W.type,W.source).loadTile(W)),this.actor.registerMessageHandler("RT",(G,W)=>this._getWorkerSource(G,W.type,W.source).reloadTile(W)),this.actor.registerMessageHandler("AT",(G,W)=>this._getWorkerSource(G,W.type,W.source).abortTile(W)),this.actor.registerMessageHandler("RMT",(G,W)=>this._getWorkerSource(G,W.type,W.source).removeTile(W)),this.actor.registerMessageHandler("RS",(G,W)=>Z._(this,void 0,void 0,function*(){if(!this.workerSources[G]||!this.workerSources[G][W.type]||!this.workerSources[G][W.type][W.source])return;const fe=this.workerSources[G][W.type][W.source];delete this.workerSources[G][W.type][W.source],void 0!==fe.removeSource&&fe.removeSource(W)})),this.actor.registerMessageHandler("RM",G=>Z._(this,void 0,void 0,function*(){delete this.layerIndexes[G],delete this.availableImages[G],delete this.workerSources[G],delete this.demWorkerSources[G]})),this.actor.registerMessageHandler("SR",(G,W)=>Z._(this,void 0,void 0,function*(){this.referrer=W})),this.actor.registerMessageHandler("SRPS",(G,W)=>this._syncRTLPluginState(G,W)),this.actor.registerMessageHandler("IS",(G,W)=>Z._(this,void 0,void 0,function*(){this.self.importScripts(W)})),this.actor.registerMessageHandler("SI",(G,W)=>this._setImages(G,W)),this.actor.registerMessageHandler("UL",(G,W)=>Z._(this,void 0,void 0,function*(){this._getLayerIndex(G).update(W.layers,W.removedIds)})),this.actor.registerMessageHandler("SL",(G,W)=>Z._(this,void 0,void 0,function*(){this._getLayerIndex(G).replace(W)}))}_setImages(O,G){return Z._(this,void 0,void 0,function*(){this.availableImages[O]=G;for(const W in this.workerSources[O]){const fe=this.workerSources[O][W];for(const Se in fe)fe[Se].availableImages=G}})}_syncRTLPluginState(O,G){return Z._(this,void 0,void 0,function*(){if(Z.bD.isParsed())return Z.bD.getState();if("loading"!==G.pluginStatus)return Z.bD.setState(G),G;const W=G.pluginURL;if(this.self.importScripts(W),Z.bD.isParsed()){const fe={pluginStatus:"loaded",pluginURL:W};return Z.bD.setState(fe),fe}throw Z.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${W}`)})}_getAvailableImages(O){let G=this.availableImages[O];return G||(G=[]),G}_getLayerIndex(O){let G=this.layerIndexes[O];return G||(G=this.layerIndexes[O]=new g),G}_getWorkerSource(O,G,W){if(this.workerSources[O]||(this.workerSources[O]={}),this.workerSources[O][G]||(this.workerSources[O][G]={}),!this.workerSources[O][G][W]){const fe={sendAsync:(Se,ve)=>(Se.targetMapId=O,this.actor.sendAsync(Se,ve))};switch(G){case"vector":this.workerSources[O][G][W]=new at(fe,this._getLayerIndex(O),this._getAvailableImages(O));break;case"geojson":this.workerSources[O][G][W]=new Un(fe,this._getLayerIndex(O),this._getAvailableImages(O));break;default:this.workerSources[O][G][W]=new this.externalWorkerSourceTypes[G](fe,this._getLayerIndex(O),this._getAvailableImages(O))}}return this.workerSources[O][G][W]}_getDEMWorkerSource(O,G){return this.demWorkerSources[O]||(this.demWorkerSources[O]={}),this.demWorkerSources[O][G]||(this.demWorkerSources[O][G]=new Ee),this.demWorkerSources[O][G]}}return Z.i(self)&&(self.worker=new Gn(self)),Gn}),ht("index",0,function(Z,g){let ci,Ut;const at={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:A=>
3new Promise((e,n)=>{const s=requestAnimationFrame(e);A.signal.addEventListener("abort",()=>{cancelAnimationFrame(s),n(g.c())})}),getImageData(A,e=0){return this.getImageCanvasContext(A).getImageData(-e,-e,A.width+2*e,A.height+2*e)},getImageCanvasContext(A){const e=window.document.createElement("canvas"),n=e.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return e.width=A.width,e.height=A.height,n.drawImage(A,0,0,A.width,A.height),n},resolveURL:A=>(ci||(ci=document.createElement("a")),ci.href=A,ci.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==Ut&&(Ut=matchMedia("(prefers-reduced-motion: reduce)")),Ut.matches)}};class Ee{static testProp(e){if(!Ee.docStyle)return e[0];for(let n=0;n<e.length;n++)if(e[n]in Ee.docStyle)return e[n];return e[0]}static create(e,n,s){const o=window.document.createElement(e);return void 0!==n&&(o.className=n),s&&s.appendChild(o),o}static createNS(e,n){return window.document.createElementNS(e,n)}static disableDrag(){Ee.docStyle&&Ee.selectProp&&(Ee.userSelect=Ee.docStyle[Ee.selectProp],Ee.docStyle[Ee.selectProp]="none")}static enableDrag(){Ee.docStyle&&Ee.selectProp&&(Ee.docStyle[Ee.selectProp]=Ee.userSelect)}static setTransform(e,n){e.style[Ee.transformProp]=n}static addEventListener(e,n,s,o={}){e.addEventListener(n,s,"passive"in o?o:o.capture)}static removeEventListener(e,n,s,o={}){e.removeEventListener(n,s,"passive"in o?o:o.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",Ee.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",Ee.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",Ee.suppressClickInternal,!0)},0)}static getScale(e){const n=e.getBoundingClientRect();return{x:n.width/e.offsetWidth||1,y:n.height/e.offsetHeight||1,boundingClientRect:n}}static getPoint(e,n,s){const o=n.boundingClientRect;return new g.P((s.clientX-o.left)/n.x-e.clientLeft,(s.clientY-o.top)/n.y-e.clientTop)}static mousePos(e,n){const s=Ee.getScale(e);return Ee.getPoint(e,s,n)}static touchPos(e,n){const s=[],o=Ee.getScale(e);for(let u=0;u<n.length;u++)s.push(Ee.getPoint(e,o,n[u]));return s}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}}Ee.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,Ee.selectProp=Ee.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),Ee.transformProp=Ee.testProp(["transform","WebkitTransform"]);const Qi={supported:!1,testSupport:function(A){!$i&&Ii&&(mi?Wt(A):Vt=A)}};let Vt,Ii,$i=!1,mi=!1;function Wt(A){const e=A.createTexture();A.bindTexture(A.TEXTURE_2D,e);try{if(A.texImage2D(A.TEXTURE_2D,0,A.RGBA,A.RGBA,A.UNSIGNED_BYTE,Ii),A.isContextLost())return;Qi.supported=!0}
vendor: 25,999 bytes, line 3
3catch{}A.deleteTexture(e),$i=!0}var fi;typeof document<"u"&&(Ii=document.createElement("img"),Ii.onload=()=>{Vt&&Wt(Vt),Vt=null,mi=!0},Ii.onerror=()=>{$i=!0,Vt=null},Ii.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(A){let e,n,s,o;A.resetRequestQueue=()=>{e=[],n=0,s=0,o={}},A.addThrottleControl=v=>{const S=s++;return o[S]=v,S},A.removeThrottleControl=v=>{delete o[v],y()},A.getImage=(v,S,T=!0)=>new Promise((M,j)=>{Qi.supported&&(v.headers||(v.headers={}),v.headers.accept="image/webp,*/*"),g.e(v,{type:"image"}),e.push({abortController:S,requestParameters:v,supportImageRefresh:T,state:"queued",onError:ee=>{j(ee)},onSuccess:ee=>{M(ee)}}),y()});const u=v=>g._(this,void 0,void 0,function*(){v.state="running";const{requestParameters:S,supportImageRefresh:T,onError:M,onSuccess:j,abortController:ee}=v,ae=!1===T&&!g.i(self)&&!g.g(S.url)&&(!S.headers||Object.keys(S.headers).reduce((we,Ce)=>we&&"accept"===Ce,!0));n++;const Ae=ae?I(S,ee):g.m(S,ee);try{const we=yield Ae;delete v.abortController,v.state="completed",we.data instanceof HTMLImageElement||g.b(we.data)?j(we):we.data&&j({data:yield(_e=we.data,"function"==typeof createImageBitmap?g.d(_e):g.f(_e)),cacheControl:we.cacheControl,expires:we.expires})}catch(we){delete v.abortController,M(we)}finally{n--,y()}var _e}),y=()=>{const v=(()=>{for(const S of Object.keys(o))if(o[S]())return!0;return!1})()?g.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:g.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let S=n;S<v&&e.length>0;S++){const T=e.shift();T.abortController.signal.aborted?S--:u(T)}},I=(v,S)=>new Promise((T,M)=>{const j=new Image,ee=v.url,ae=v.credentials;ae&&"include"===ae?j.crossOrigin="use-credentials":(ae&&"same-origin"===ae||!g.s(ee))&&(j.crossOrigin="anonymous"),S.signal.addEventListener("abort",()=>{j.src="",M(g.c())}),j.fetchPriority="high",j.onload=()=>{j.onerror=j.onload=null,T({data:j})},j.onerror=()=>{j.onerror=j.onload=null,S.signal.aborted||M(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},j.src=ee})}(fi||(fi={})),fi.resetRequestQueue();class Qt{constructor(e){this._transformRequestFn=e}transformRequest(e,n){return this._transformRequestFn&&this._transformRequestFn(e,n)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function bi(A){var e=new g.A(3);return e[0]=A[0],e[1]=A[1],e[2]=A[2],e}var _t,ot=function(A,e,n){return A[0]=e[0]-n[0],A[1]=e[1]-n[1],A[2]=e[2]-n[2],A};_t=new g.A(3),g.A!=Float32Array&&(_t[0]=0,_t[1]=0,_t[2]=0);var A,It=function(A){var e=A[0],n=A[1];return e*e+n*n};function je(A){const e=[];if("string"==typeof A)e.push({id:"default",url:A});else if(A&&A.length>0){const n=[];for(const{id:s,url:o}of A){const u=`${s}${o}`;-1===n.indexOf(u)&&(n.push(u),e.push({id:s,url:o}))}}return e}function kt(A,e,n){const s=A.split("?");return s[0]+=`${e}${n}`,s.join("?")}A=new g.A(2),g.A!=Float32Array&&(A[0]=0,A[1]=0);class mt{constructor(e,n,s,o){this.context=e,this.format=s,this.texture=e.gl.createTexture(),this.update(n,o)}update(e,n,s){const{width:o,height:u}=e,y=!(this.size&&this.size[0]===o&&this.size[1]===u||s),{context:I}=this,{gl:v}=I;if(this.useMipmap=!(!n||!n.useMipmap),v.bindTexture(v.TEXTURE_2D,this.texture),I.pixelStoreUnpackFlipY.set(!1),I.pixelStoreUnpack.set(1),I.pixelStoreUnpackPremultiplyAlpha.set(this.format===v.RGBA&&(!n||!1!==n.premultiply)),y)this.size=[o,u],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||g.b(e)?v.texImage2D(v.TEXTURE_2D,0,this.format,this.format,v.UNSIGNED_BYTE,e):v.texImage2D(v.TEXTURE_2D,0,this.format,o,u,0,this.format,v.UNSIGNED_BYTE,e.data);else{const{x:S,y:T}=s||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||g.b(e)?v.texSubImage2D(v.TEXTURE_2D,0,S,T,v.RGBA,v.UNSIGNED_BYTE,e):v.texSubImage2D(v.TEXTURE_2D,0,S,T,o,u,v.RGBA,v.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&v.generateMipmap(v.TEXTURE_2D)}bind(e,n,s){const{context:o}=this,{gl:u}=o;u.bindTexture(u.TEXTURE_2D,this.texture),s!==u.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(s=u.LINEAR),e!==this.filter&&(u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,e),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,s||e),this.filter=e),n!==this.wrap&&(u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,n),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function lt(A){const{userImage:e}=A;return!!(e&&e.render&&e.render())&&(A.data.replace(new Uint8Array(e.data.buffer)),!0)}class Pe extends g.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new g.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:n,promiseResolve:s}of this.requestors)s(this._getImagesForIds(n));this.requestors=[]}}getImage(e){const n=this.images[e];if(n&&!n.data&&n.spriteData){const s=n.spriteData;n.data=new g.R({width:s.width,height:s.height},s.context.getImageData(s.x,s.y,s.width,s.height).data),n.spriteData=null}return n}addImage(e,n){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,n)&&(this.images[e]=n)}_validate(e,n){let s=!0;const o=n.data||n.spriteData;return this._validateStretch(n.stretchX,o&&o.width)||(this.fire(new g.j(new Error(`Image "${e}" has invalid "stretchX" value`))),s=!1),this._validateStretch(n.stretchY,o&&o.height)||(this.fire(new g.j(new Error(`Image "${e}" has invalid "stretchY" value`))),s=!1),this._validateContent(n.content,n)||(this.fire(new g.j(new Error(`Image "${e}" has invalid "content" value`))),s=!1),s}_validateStretch(e,n){if(!e)return!0;let s=0;for(const o of e){if(o[0]<s||o[1]<o[0]||n<o[1])return!1;s=o[1]}return!0}_validateContent(e,n){if(!e)return!0;if(4!==e.length)return!1;const s=n.spriteData,o=s&&s.width||n.data.width,u=s&&s.height||n.data.height;return!(e[0]<0||o<e[0]||e[1]<0||u<e[1]||e[2]<0||o<e[2]||e[3]<0||u<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,n,s=!0){const o=this.getImage(e);if(s&&(o.data.width!==n.data.width||o.data.height!==n.data.height))throw new Error(`size mismatch between old image (${o.data.width}x${o.data.height}) and new image (${n.data.width}x${n.data.height}).`);n.version=o.version+1,this.images[e]=n,this.updatedImages[e]=!0}removeImage(e){const n=this.images[e];delete this.images[e],delete this.patterns[e],n.userImage&&n.userImage.onRemove&&n.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise((n,s)=>{let o=!0;if(!this.isLoaded())for(const u of e)this.images[u]||(o=!1);this.isLoaded()||o?n(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:n})})}_getImagesForIds(e){const n={};for(const s of e){let o=this.getImage(s);o||(this.fire(new g.k("styleimagemissing",{id:s})),o=this.getImage(s)),o?n[s]={data:o.data.clone(),pixelRatio:o.pixelRatio,sdf:o.sdf,version:o.version,stretchX:o.stretchX,stretchY:o.stretchY,content:o.content,textFitWidth:o.textFitWidth,textFitHeight:o.textFitHeight,hasRenderCallback:!(!o.userImage||!o.userImage.render)}:g.w(`Image "${s}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return n}getPixelSize(){const{width:e,height:n}=this.atlasImage;return{width:e,height:n}}getPattern(e){const n=this.patterns[e],s=this.getImage(e);if(!s)return null;if(n&&n.position.version===s.version)return n.position;if(n)n.position.version=s.version;else{const o={w:s.data.width+2,h:s.data.height+2,x:0,y:0},u=new g.I(o,s);this.patterns[e]={bin:o,position:u}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const n=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new mt(e,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const u in this.patterns)e.push(this.patterns[u].bin);const{w:n,h:s}=g.p(e),o=this.atlasImage;o.resize({width:n||1,height:s||1});for(const u in this.patterns){const{bin:y}=this.patterns[u],I=y.x+1,v=y.y+1,S=this.getImage(u).data,T=S.width,M=S.height;g.R.copy(S,o,{x:0,y:0},{x:I,y:v},{width:T,height:M}),g.R.copy(S,o,{x:0,y:M-1},{x:I,y:v-1},{width:T,height:1}),g.R.copy(S,o,{x:0,y:0},{x:I,y:v+M},{width:T,height:1}),g.R.copy(S,o,{x:T-1,y:0},{x:I-1,y:v},{width:1,height:M}),g.R.copy(S,o,{x:0,y:0},{x:I+T,y:v},{width:1,height:M})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const n of e){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;const s=this.getImage(n);s||g.w(`Image with ID: "${n}" was not found`),lt(s)&&this.updateImage(n,s)}}}const it=1e20;function ri(A,e,n,s,o,u,y,I,v){for(let S=e;S<e+s;S++)wi(A,n*u+S,u,o,y,I,v);for(let S=n;S<n+o;S++)wi(A,S*u+e,1,s,y,I,v)}function wi(A,e,n,s,o,u,y){u[0]=0,y[0]=-it,y[1]=it,o[0]=A[e];for(let I=1,v=0,S=0;I<s;I++){o[I]=A[e+I*n];const T=I*I;do{const M=u[v];S=(o[I]-o[M]+T-M*M)/(I-M)/2}while(S<=y[v]&&--v>-1);v++,u[v]=I,y[v]=S,y[v+1]=it}for(let I=0,v=0;I<s;I++){for(;y[v+1]<I;)v++;const S=u[v],T=I-S;A[e+I*n]=o[S]+T*T}}class Rt{constructor(e,n){this.requestManager=e,this.localIdeographFontFamily=n,this.entries={}}setURL(e){this.url=e}getGlyphs(e){return g._(this,void 0,void 0,function*(){const n=[];for(const u in e)for(const y of e[u])n.push(this._getAndCacheGlyphsPromise(u,y));const s=yield Promise.all(n),o={};for(const{stack:u,id:y,glyph:I}of s)o[u]||(o[u]={}),o[u][y]=I&&{id:I.id,bitmap:I.bitmap.clone(),metrics:I.metrics};return o})}_getAndCacheGlyphsPromise(e,n){return g._(this,void 0,void 0,function*(){let s=this.entries[e];s||(s=this.entries[e]={glyphs:{},requests:{},ranges:{}});let o=s.glyphs[n];if(void 0!==o)return{stack:e,id:n,glyph:o};if(o=this._tinySDF(s,e,n),o)return s.glyphs[n]=o,{stack:e,id:n,glyph:o};const u=Math.floor(n/256);if(256*u>65535)throw new Error("glyphs > 65535 not supported");if(s.ranges[u])return{stack:e,id:n,glyph:o};if(!this.url)throw new Error("glyphsUrl is not set");if(!s.requests[u]){const I=Rt.loadGlyphRange(e,u,this.url,this.requestManager);s.requests[u]=I}const y=yield s.requests[u];for(const I in y)this._doesCharSupportLocalGlyph(+I)||(s.glyphs[+I]=y[+I]);return s.ranges[u]=!0,{stack:e,id:n,glyph:y[n]||null}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))}_tinySDF(e,n,s){const o=this.localIdeographFontFamily;if(!o||!this._doesCharSupportLocalGlyph(s))return;let u=e.tinySDF;if(!u){let I="400";/bold/i.test(n)?I="900":/medium/i.test(n)?I="500":/light/i.test(n)&&(I="200"),u=e.tinySDF=new Rt.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:o,fontWeight:I})}const y=u.draw(String.fromCharCode(s));return{id:s,bitmap:new g.o({width:y.width||60,height:y.height||60},y.data),metrics:{width:y.glyphWidth/2||24,height:y.glyphHeight/2||24,left:y.glyphLeft/2+.5||0,top:y.glyphTop/2-27.5||-8,advance:y.glyphAdvance/2||24,isDoubleResolution:!0}}}}Rt.loadGlyphRange=function(A,e,n,s){return g._(this,void 0,void 0,function*(){const o=256*e,u=o+255,y=s.transformRequest(n.replace("{fontstack}",A).replace("{range}",`${o}-${u}`),"Glyphs"),I=yield g.l(y,new AbortController);if(!I||!I.data)throw new Error(`Could not load glyph range. range: ${e}, ${o}-${u}`);const v={};for(const S of g.n(I.data))v[S.id]=S;return v})},Rt.TinySDF=class{constructor({fontSize:A=24,buffer:e=3,radius:n=8,cutoff:s=.25,fontFamily:o="sans-serif",fontWeight:u="normal",fontStyle:y="normal"}={}){this.buffer=e,this.cutoff=s,this.radius=n;const I=this.size=A+4*e,v=this._createCanvas(I),S=this.ctx=v.getContext("2d",{willReadFrequently:!0});S.font=`${y} ${u} ${A}px ${o}`,S.textBaseline="alphabetic",S.textAlign="left",S.fillStyle="black",this.gridOuter=new Float64Array(I*I),this.gridInner=new Float64Array(I*I),this.f=new Float64Array(I),this.z=new Float64Array(I+1),this.v=new Uint16Array(I)}_createCanvas(A){const e=document.createElement("canvas");return e.width=e.height=A,e}draw(A){const{width:e,actualBoundingBoxAscent:n,actualBoundingBoxDescent:s,actualBoundingBoxLeft:o,actualBoundingBoxRight:u}=this.ctx.measureText(A),y=Math.ceil(n),I=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(u-o))),v=Math.min(this.size-this.buffer,y+Math.ceil(s)),S=I+2*this.buffer,T=v+2*this.buffer,M=Math.max(S*T,0),j=new Uint8ClampedArray(M),ee={data:j,width:S,height:T,glyphWidth:I,glyphHeight:v,glyphTop:y,glyphLeft:0,glyphAdvance:e};if(0===I||0===v)return ee;const{ctx:ae,buffer:Ae,gridInner:_e,gridOuter:we}=this;ae.clearRect(Ae,Ae,I,v),ae.fillText(A,Ae,Ae+y);const Ce=ae.getImageData(Ae,Ae,I,v);we.fill(it,0,M),_e.fill(0,0,M);for(let de=0;de<v;de++)for(let Me=0;Me<I;Me++){const ze=Ce.data[4*(de*I+Me)+3]/255;if(0===ze)continue;const Ve=(de+Ae)*S+Me+Ae;if(1===ze)we[Ve]=0,_e[Ve]=it;else{const tt=.5-ze;we[Ve]=tt>0?tt*tt:0,_e[Ve]=tt<0?tt*tt:0}}ri(we,0,0,S,T,S,this.f,this.v,this.z),ri(_e,Ae,Ae,I,v,S,this.f,this.v,this.z);for(let de=0;de<M;de++){const Me=Math.sqrt(we[de])-Math.sqrt(_e[de]);j[de]=Math.round(255-255*(Me/this.radius+this.cutoff))}return ee}};class Bt{constructor(){this.specification=g.v.light.position}possiblyEvaluate(e,n){return g.x(e.expression.evaluate(n))}interpolate(e,n,s){return{x:g.y.number(e.x,n.x,s),y:g.y.number(e.y,n.y,s),z:g.y.number(e.z,n.z,s)}}}let At;class et extends g.E{constructor(e){super(),At=At||new g.q({anchor:new g.D(g.v.light.anchor),position:new Bt,color:new g.D(g.v.light.color),intensity:new g.D(g.v.light.intensity)}),this._transitionable=new g.T(At),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,n={}){if(!this._validate(g.r,e,n))for(const s in e){const o=e[s];s.endsWith("-transition")?this._transitionable.setTransition(s.slice(0,-11),o):this._transitionable.setValue(s,o)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,n,s){return(!s||!1!==s.validate)&&g.t(this,e.call(g.u,{value:n,style:{glyphs:!0,sprite:!0},styleSpec:g.v}))}}const Zt=new g.q({"sky-color":new g.D(g.v.sky["sky-color"]),"horizon-color":new g.D(g.v.sky["horizon-color"]),"fog-color":new g.D(g.v.sky["fog-color"]),"fog-ground-blend":new g.D(g.v.sky["fog-ground-blend"]),"horizon-fog-blend":new g.D(g.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new g.D(g.v.sky["sky-horizon-blend"]),"atmosphere-blend":new g.D(g.v.sky["atmosphere-blend"])});class sr extends g.E{constructor(e){super(),this._transitionable=new g.T(Zt),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new g.z(0))}setSky(e,n={}){if(!this._validate(g.B,e,n)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const s in e){const o=e[s];s.endsWith("-transition")?this._transitionable.setTransition(s.slice(0,-11),o):this._transitionable.setValue(s,o)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,n,s={}){return!1!==s?.validate&&g.t(this,e.call(g.u,g.e({value:n,style:{glyphs:!0,sprite:!0},styleSpec:g.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class cr{constructor(e,n){this.width=e,this.height=n,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,n){const s=e.join(",")+String(n);return this.dashEntry[s]||(this.dashEntry[s]=this.addDash(e,n)),this.dashEntry[s]}getDashRanges(e,n,s){const o=[];let u=e.length%2==1?-e[e.length-1]*s:0,y=e[0]*s,I=!0;o.push({left:u,right:y,isDash:I,zeroLength:0===e[0]});let v=e[0];for(let S=1;S<e.length;S++){I=!I;const T=e[S];u=v*s,v+=T,y=v*s,o.push({left:u,right:y,isDash:I,zeroLength:0===T})}return o}addRoundDash(e,n,s){const o=n/2;for(let u=-s;u<=s;u++){const y=this.width*(this.nextRow+s+u);let I=0,v=e[I];for(let S=0;S<this.width;S++){S/v.right>1&&(v=e[++I]);const T=Math.abs(S-v.left),M=Math.abs(S-v.right),j=Math.min(T,M);let ee;const ae=u/s*(o+1);if(v.isDash){const Ae=o-Math.abs(ae);ee=Math.sqrt(j*j+Ae*Ae)}else ee=o-Math.sqrt(j*j+ae*ae);this.data[y+S]=Math.max(0,Math.min(255,ee+128))}}}addRegularDash(e){for(let I=e.length-1;I>=0;--I){const v=e[I],S=e[I+1];v.zeroLength?e.splice(I,1):S&&S.isDash===v.isDash&&(S.left=v.left,e.splice(I,1))}const n=e[0],s=e[e.length-1];n.isDash===s.isDash&&(n.left=s.left-this.width,s.right=n.right+this.width);const o=this.width*this.nextRow;let u=0,y=e[u];for(let I=0;I<this.width;I++){I/y.right>1&&(y=e[++u]);const v=Math.abs(I-y.left),S=Math.abs(I-y.right),T=Math.min(v,S);this.data[o+I]=Math.max(0,Math.min(255,(y.isDash?T:-T)+128))}}addDash(e,n){const s=n?7:0,o=2*s+1;if(this.nextRow+o>this.height)return g.w("LineAtlas out of space"),null;let u=0;for(let I=0;I<e.length;I++)u+=e[I];if(0!==u){const I=this.width/u,v=this.getDashRanges(e,this.width,I);n?this.addRoundDash(v,I,s):this.addRegularDash(v)}const y={y:(this.nextRow+s+.5)/this.height,height:2*s/this.height,width:u};return this.nextRow+=o,this.dirty=!0,y}bind(e){const n=e.gl;this.texture?(n.bindTexture(n.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,n.texSubImage2D(n.TEXTURE_2D,0,0,0,this.width,this.height,n.ALPHA,n.UNSIGNED_BYTE,this.data))):(this.texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,this.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,this.width,this.height,0,n.ALPHA,n.UNSIGNED_BYTE,this.data))}}const ir="maplibre_preloaded_worker_pool";class hr{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<hr.workerCount;)this.workers.push(new Worker(g.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach(n=>{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[ir]}numActive(){return Object.keys(this.active).length}}const or=Math.floor(at.hardwareConcurrency/2);let rr,jr;function Dn(){return rr||(rr=new hr),rr}hr.workerCount=g.C(globalThis)?Math.max(Math.min(or,3),1):1;class tn{constructor(e,n){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=n;const s=this.workerPool.acquire(n);for(let o=0;o<s.length;o++){const u=new g.F(s[o],n);u.name=`Worker ${o}`,this.actors.push(u)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,n){const s=[];for(const o of this.actors)s.push(o.sendAsync({type:e,data:n}));return Promise.all(s)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach(n=>{n.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,n){for(const s of this.actors)s.registerMessageHandler(e,n)}}function Yr(){return jr||(jr=new tn(Dn(),g.G),jr.registerMessageHandler("GR",(A,e,n)=>g.m(e,n))),jr}function An(A,e){const n=g.H();return g.J(n,n,[1,1,0]),g.K(n,n,[.5*A.width,.5*A.height,1]),g.L(n,n,A.calculatePosMatrix(e.toUnwrapped()))}function rn(A,e,n,s,o,u){const y=function(M,j,ee){if(M)for(const ae of M){const Ae=j[ae];if(Ae&&Ae.source===ee&&"fill-extrusion"===Ae.type)return!0}else for(const ae in j){const Ae=j[ae];if(Ae.source===ee&&"fill-extrusion"===Ae.type)return!0}return!1}(o&&o.layers,e,A.id),I=u.maxPitchScaleFactor(),v=A.tilesIn(s,I,y);v.sort(In);const S=[];for(const M of v)S.push({wrappedTileID:M.tileID.wrapped().key,queryResults:M.tile.queryRenderedFeatures(e,n,A._state,M.queryGeometry,M.cameraQueryGeometry,M.scale,o,u,I,An(A.transform,M.tileID))});const T=function(M){const j={},ee={};for(const ae of M){const Ae=ae.queryResults,_e=ae.wrappedTileID,we=ee[_e]=ee[_e]||{};for(const Ce in Ae){const de=Ae[Ce],Me=we[Ce]=we[Ce]||{},ze=j[Ce]=j[Ce]||[];for(const Ve of de)Me[Ve.featureIndex]||(Me[Ve.featureIndex]=!0,ze.push(Ve))}}return j}(S);for(const M in T)T[M].forEach(j=>{const ee=j.feature,ae=A.getFeatureState(ee.layer["source-layer"],ee.id);ee.source=ee.layer.source,ee.layer["source-layer"]&&(ee.sourceLayer=ee.layer["source-layer"]),ee.state=ae});return T}function In(A,e){const n=A.tileID,s=e.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}function da(A,e,n){return g._(this,void 0,void 0,function*(){let s=A;if(A.url?s=(yield g.h(e.transformRequest(A.url,"Source"),n)).data:yield at.frameAsync(n),!s)return null;const o=g.M(g.e(s,A),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in s&&s.vector_layers&&(o.vectorLayerIds=s.vector_layers.map(u=>u.id)),o})}class Ze{constructor(e,n){e&&(n?this.setSouthWest(e).setNorthEast(n):Array.isArray(e)&&(4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof g.N?new g.N(e.lng,e.lat):g.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof g.N?new g.N(e.lng,e.lat):g.N.convert(e),this}extend(e){const n=this._sw,s=this._ne;let o,u;if(e instanceof g.N)o=e,u=e;else{if(!(e instanceof Ze))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(Ze.convert(e)):this.extend(g.N.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(g.N.convert(e)):this;if(o=e._sw,u=e._ne,!o||!u)return this}return n||s?(n.lng=Math.min(o.lng,n.lng),n.lat=Math.min(o.lat,n.lat),s.lng=Math.max(u.lng,s.lng),s.lat=Math.max(u.lat,s.lat)):(this._sw=new g.N(o.lng,o.lat),this._ne=new g.N(u.lng,u.lat)),this}getCenter(){return new g.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new g.N(this.getWest(),this.getNorth())}getSouthEast(){return new g.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:n,lat:s}=g.N.convert(e);let o=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=s&&s<=this._ne.lat&&o}static convert(e){return e instanceof Ze?e:e&&new Ze(e)}static fromLngLat(e,n=0){const s=360*n/40075017,o=s/Math.cos(Math.PI/180*e.lat);return new Ze(new g.N(e.lng-o,e.lat-s),new g.N(e.lng+o,e.lat+s))}adjustAntiMeridian(){const e=new g.N(this._sw.lng,this._sw.lat),n=new g.N(this._ne.lng,this._ne.lat);return new Ze(e,e.lng>n.lng?new g.N(n.lng+360,n.lat):n)}}class br{constructor(e,n,s){this.bounds=Ze.convert(this.validateBounds(e)),this.minzoom=n||0,this.maxzoom=s||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const n=Math.pow(2,e.z),s=Math.floor(g.O(this.bounds.getWest())*n),o=Math.floor(g.Q(this.bounds.getNorth())*n),u=Math.ceil(g.O(this.bounds.getEast())*n),y=Math.ceil(g.Q(this.bounds.getSouth())*n);return e.x>=s&&e.x<u&&e.y>=o&&e.y<y}}class Or extends g.E{constructor(e,n,s,o){if(super(),this.id=e,this.dispatcher=s,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,g.e(this,g.M(n,["url","scheme","tileSize","promoteId"])),this._options=g.e({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}load(){return g._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new g.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield da(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(g.e(this,e),e.bounds&&(this.tileBounds=new br(e.bounds,this.minzoom,this.maxzoom)),this.fire(new g.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new g.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new g.j(e))}})}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return g.e({},this._options)}loadTile(e){return g._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s={request:this.map._requestManager.transformRequest(n,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.t
3ype,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};s.request.collectResourceTiming=this._collectResourceTiming;let o="RT";if(e.actor&&"expired"!==e.state){if("loading"===e.state)return new Promise((u,y)=>{e.reloadPromise={resolve:u,reject:y}})}else e.actor=this.dispatcher.getActor(),o="LT";e.abortController=new AbortController;try{const u=yield e.actor.sendAsync({type:o,data:s},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,u)}catch(u){if(delete e.abortController,e.aborted)return;if(u&&404!==u.status)throw u;this._afterTileLoadWorkerResponse(e,null)}})}_afterTileLoadWorkerResponse(e,n){if(n&&n.resourceTiming&&(e.resourceTiming=n.resourceTiming),n&&this.map._refreshExpiredTiles&&e.setExpiryData(n),e.loadVectorData(n,this.map.painter),e.reloadPromise){const s=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(s.resolve).catch(s.reject)}}abortTile(e){return g._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.t
3ype,source:this.id}}))})}unloadTile(e){return g._(this,void 0,void 0,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Li extends g.E{constructor(e,n,s,o){super(),this.id=e,this.dispatcher=s,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=g.e({type:"raster"},n),g.e(this,g.M(n,["url","scheme","tileSize"]))}load(){return g._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new g.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield da(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(g.e(this,e),e.bounds&&(this.tileBounds=new br(e.bounds,this.minzoom,this.maxzoom)),this.fire(new g.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new g.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new g.j(e))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return g.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return g._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const s=yield fi.getImage(this.map._requestManager.transformRequest(n,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(s&&s.data){this.map._refreshExpiredTiles&&s.cacheControl&&s.expires&&e.setExpiryData({cacheControl:s.cacheControl,expires:s.expires});const o=this.map.painter.context,u=o.gl,y=s.data;e.texture=this.map.painter.getTileTexture(y.width),e.texture?e.texture.update(y,{useMipmap:!0}):(e.texture=new mt(o,y,u.RGBA,{useMipmap:!0}),e.texture.bind(u.LINEAR,u.CLAMP_TO_EDGE,u.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(s){if(delete e.abortController,e.aborted)e.state="unloaded";else if(s)throw e.state="errored",s}})}abortTile(e){return g._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return g._(this,void 0,void 0,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}}class Xi extends Li{constructor(e,n,s,o){super(e,n,s,o),this.type="raster-dem",this.maxzoom=22,this._options=g.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(e){return g._(this,void 0,void 0,function*(){const n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),s=this.map._requestManager.transformRequest(n,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const o=yield fi.getImage(s,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(o&&o.data){const u=o.data;this.map._refreshExpiredTiles&&o.cacheControl&&o.expires&&e.setExpiryData({cacheControl:o.cacheControl,expires:o.expires});const y=g.b(u)&&g.U()?u:yield this.readImageNow(u),I={type:this.type,uid:e.uid,source:this.id,rawImageData:y,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||"expired"===e.state){e.actor=this.dispatcher.getActor();const v=yield e.actor.sendAsync({type:"LDT",data:I});e.dem=v,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(o){if(delete e.abortController,e.aborted)e.state="unloaded";else if(o)throw e.state="errored",o}})}readImageNow(e){return g._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&g.V()){const n=e.width+2,s=e.height+2;try{return new g.R({width:n,height:s},yield g.W(e,-1,-1,n,s))}catch{}}return at.getImageData(e,1)})}_getNeighboringTiles(e){const n=e.canonical,s=Math.pow(2,n.z),o=(n.x-1+s)%s,u=0===n.x?e.wrap-1:e.wrap,y=(n.x+1+s)%s,I=n.x+1===s?e.wrap+1:e.wrap,v={};
vendor: 5,175 bytes, line 3
3return v[new g.S(e.overscaledZ,u,n.z,o,n.y).key]={backfilled:!1},v[new g.S(e.overscaledZ,I,n.z,y,n.y).key]={backfilled:!1},n.y>0&&(v[new g.S(e.overscaledZ,u,n.z,o,n.y-1).key]={backfilled:!1},v[new g.S(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},v[new g.S(e.overscaledZ,I,n.z,y,n.y-1).key]={backfilled:!1}),n.y+1<s&&(v[new g.S(e.overscaledZ,u,n.z,o,n.y+1).key]={backfilled:!1},v[new g.S(e.overscaledZ,e.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},v[new g.S(e.overscaledZ,I,n.z,y,n.y+1).key]={backfilled:!1}),v}unloadTile(e){return g._(this,void 0,void 0,function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&(yield e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}}))})}}class fa extends g.E{constructor(e,n,s,o){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=s.getActor(),this.setEventedParent(o),this._data=n.data,this._options=g.e({},n),this._collectResourceTiming=n.collectResourceTiming,void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;const u=g.X/this.tileSize;void 0!==n.clusterMaxZoom&&this.maxzoom<=n.clusterMaxZoom&&g.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${n.clusterMaxZoom}".`),this.workerOptions=g.e({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*u,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*u,extent:g.X,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:g.X,radius:(n.clusterRadius||50)*u,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}load(){return g._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}getData(){return g._(this,void 0,void 0,function*(){const e=g.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})})}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(void 0!==e.clusterRadius&&(this.workerOptions.superclusterOptions.radius=e.clusterRadius),void 0!==e.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=e.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,n,s){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:n,offset:s}})}_updateWorkerData(e){return g._(this,void 0,void 0,function*(){const n=g.e({type:this.type},this.workerOptions);e?n.dataDiff=e:"string"==typeof this._data?(n.request=this.map._requestManager.transformRequest(at.resolveURL(this._data),"Source"),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new g.k("dataloading",{dataType:"source"}));try{const s=yield this.actor.sendAsync({type:"LD",data:n});if(this._pendingLoads--,this._removed||s.abandoned)return void this.fire(new g.k("dataabort",{dataType:"source"}));let o=null;s.resourceTiming&&s.resourceTiming[this.id]&&(o=s.resourceTiming[this.id].slice(0));const u={dataType:"source"};this._collectResourceTiming&&o&&o.length>0&&g.e(u,{resourceTiming:o}),this.fire(new g.k("data",Object.assign(Object.assign({},u),{sourceDataType:"metadata"}))),this.fire(new g.k("data",Object.assign(Object.assign({},u),{sourceDataType:"content"})))}catch(s){if(this._pendingLoads--,this._removed)return void this.fire(new g.k("dataabort",{dataType:"source"}));this.fire(new g.j(s))}})}loaded(){return 0===this._pendingLoads}loadTile(e){return g._(this,void 0,void 0,function*(){const n=e.actor?"RT":"LT";e.actor=this.actor;const s={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;const o=yield this.actor.sendAsync({type:n,data:s},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(o,this.map.painter,"RT"===n)})}abortTile(e){return g._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return g._(this,void 0,void 0,function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.t
3ype,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return g.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var bn=g.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class dn extends g.E{constructor(e,n,s,o){super(),this.id=e,this.dispatcher=s,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=n}load(e){return g._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new g.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const n=yield fi.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,n&&n.data&&(this.image=n.data,e&&(this.coordinates=e),this._finishLoading())}catch(n){this._request=null,this._loaded=!0,this.fire(new g.j(n))}})}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new g.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const n=e.map(g.Z.fromLngLat);this.tileID=function(o){let u=1/0,y=1/0,I=-1/0,v=-1/0;for(const j of o)u=Math.min(u,j.x),y=Math.min(y,j.y),I=Math.max(I,j.x),v=Math.max(v,j.y);const S=Math.max(I-u,v-y),T=Math.max(0,Math.floor(-Math.log(S)/Math.LN2)),M=Math.pow(2,T);return new g.a1(T,Math.floor((u+I)/2*M),Math.floor((y+v)/2*M))}(n),this.minzoom=this.maxzoom=this.tileID.z;const s=n.map(o=>this.tileID.getTilePoint(o)._round());return this._boundsArray=new g.$,this._boundsArray.emplaceBack(s[0].x,s[0].y,0,0),this._boundsArray.emplaceBack(s[1].x,s[1].y,g.X,0),this._boundsArray.emplaceBack(s[3].x,s[3].y,0,g.X),this._boundsArray.emplaceBack(s[2].x,s[2].y,g.X,g.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new g.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const e=this.map.painter.context,n=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,bn.members)),this.boundsSegments||(this.boundsSegments=g.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new mt(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let s=!1;for(const o in this.tiles){const u=this.tiles[o];"loaded"!==u.state&&(u.state="loaded",u.texture=this.texture,s=!0)}s&&this.fire(new g.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return g._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Wn extends dn{constructor(e,n,s,o){super(e,n,s,o),this.roundZoom=!0,this.type="video",this.options=n}load(){return g._(this,void 0,void 0,function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const n of e.urls)this.urls.push(this.map._requestManager.transformRequest(n,"Source").url);try{const n=yield g.a3(this.urls);if(this._loaded=!0,!n)return;this.video=n,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(n){this.fire(new g.j(n))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const n=this.video.seekable;e<n.start(0)||e>n.end(0)?this.fire(new g.j(new g.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}
3onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const e=this.map.painter.context,n=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,bn.members)),this.boundsSegments||(this.boundsSegments=g.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new mt(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let s=!1;for(const o in this.tiles){const u=this.tiles[o];"loaded"!==u.state&&(u.state="loaded",u.texture=this.texture,s=!0)}s&&this.fire(new g.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class nn extends dn{constructor(e,n,s,o){super(e,n,s,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some(u=>!Array.isArray(u)||2!==u.length||u.some(y=>"number"!=typeof y))||this.fire(new g.j(new g.a2(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new g.j(new g.a2(`sources.${e}`,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new g.j(new g.a2(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof HTMLCanvasElement||this.fire(new g.j(new g.a2(`sources.${e}`,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 g.j(new g.a2(`sources.${e}`,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}load(){return g._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new g.j(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())})}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let 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)return;const n=this.map.painter.context,s=n.gl;this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,bn.members)),this.boundsSegments||(this.boundsSegments=g.a0.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new mt(n,this.canvas,s.RGBA,{premultiply:!0});let o=!1;for(const u in this.tiles){const y=this.tiles[u];"loaded"!==y.state&&(y.state="loaded",y.texture=this.texture,o=!0)}o&&this.fire(new g.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const We={},gr=A=>{switch(A){case"geojson":return fa;case"image":return dn;case"raster":return Li;case"raster-dem":return Xi;case"vector":return Or;case"video":return Wn;case"canvas":return nn}return We[A]},b="RTLPluginLoaded";class Y extends g.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Yr()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(n=>{throw this.status="error",n})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return g._(this,arguments,void 0,function*(n,s=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=at.resolveURL(n),!this.url)throw new Error(`requested url ${n}
3 is invalid`);if("unavailable"===this.status){if(!s)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()})}_requestImport(){return g._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new g.k(b))})}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let dt=null;function zt(){return dt||(dt=new Y),dt}class Ti{constructor(e,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=g.a4(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){const n=e+this.timeAdded;n<this.fadeEndTime||(this.fadeEndTime=n)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,n,s){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(o,u){const y={};if(!u)return y;for(const I of o){const v=I.layerIds.map(S=>u.getLayer(S)).filter(Boolean);if(0!==v.length){I.layers=v,I.stateDependentLayerIds&&(I.stateDependentLayers=I.stateDependentLayerIds.map(S=>v.filter(T=>T.id===S)[0]));for(const S of v)y[S.id]=I}}return y}(e.buckets,n.style),this.hasSymbolBuckets=!1;for(const o in this.buckets){const u=this.buckets[o];if(u instanceof g.a6){if(this.hasSymbolBuckets=!0,!s)break;u.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const o in this.buckets){const u=this.buckets[o];if(u instanceof g.a6&&u.hasRTLText){this.hasRTLText=!0,zt().lazyLoad();break}}this.queryPadding=0;for(const o in this.buckets){const u=this.buckets[o];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(o).queryRadius(u))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new g.a5}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const s in this.buckets){const o=this.buckets[s];o.uploadPending()&&o.upload(e)}const n=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new mt(e,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new mt(e,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,n,s,o,u,y,I,v,S,T){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:o,cameraQueryGeometry:u,scale:y,tileSize:this.tileSize,pixelPosMatrix:T,transform:v,params:I,queryPadding:this.queryPadding*S},e,n,s):{}}querySourceFeatures(e,n){const s=this.latestFeatureIndex;if(!s||!s.rawTileData)return;const o=s.loadVTLayers(),u=n&&n.sourceLayer?n.sourceLayer:"",y=o._geojsonTileLayer||o[u];if(!y)return;const I=g.a7(n&&n.filter),{z:v,x:S,y:T}=this.tileID.canonical,M={z:v,x:S,y:T};for(let j=0;j<y.length;j++){const ee=y.feature(j);if(I.needGeometry){const _e=g.a8(ee,!0);if(!I.filter(new g.z(this.tileID.overscaledZ),_e,this.tileID.canonical))continue}else if(!I.filter(new g.z(this.tileID.overscaledZ),ee))continue;const ae=s.getId(ee,u),Ae=new g.a9(ee,v,S,T,ae);Ae.tile=M,e.push(Ae)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const n=this.expirationTime;
vendor: 89,648 bytes, line 3
3if(e.cacheControl){const s=g.aa(e.cacheControl);s["max-age"]&&(this.expirationTime=Date.now()+1e3*s["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const s=Date.now();let o=!1;if(this.expirationTime>s)o=!1;else if(n)if(this.expirationTime<n)o=!0;else{const u=this.expirationTime-n;u?this.expirationTime=s+Math.max(u,3e4):o=!0}else o=!0;o?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(e,n){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(e).length)return;const s=this.latestFeatureIndex.loadVTLayers();for(const o in this.buckets){if(!n.style.hasLayer(o))continue;const u=this.buckets[o],y=u.layers[0].sourceLayer||"_geojsonTileLayer",I=s[y],v=e[y];if(!I||!v||0===Object.keys(v).length)continue;u.update(v,I,this.imageAtlas&&this.imageAtlas.patternPositions||{});const S=n&&n.style&&n.style.getLayer(o);S&&(this.queryPadding=Math.max(this.queryPadding,S.queryRadius(u)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<at.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=at.now()+e}setDependencies(e,n){const s={};for(const o of n)s[o]=!0;this.dependencies[e]=s}hasDependency(e,n){for(const s of e){const o=this.dependencies[s];if(o)for(const u of n)if(o[u])return!0}return!1}}class wt{constructor(e,n){this.max=e,this.onRemove=n,this.reset()}reset(){for(const e in this.data)for(const n of this.data[e])n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value);return this.data={},this.order=[],this}add(e,n,s){const o=e.wrapped().key;void 0===this.data[o]&&(this.data[o]=[]);const u={value:n,timeout:void 0};if(void 0!==s&&(u.timeout=setTimeout(()=>{this.remove(e,u)},s)),this.data[o].push(u),this.order.push(o),this.order.length>this.max){const y=this._getAndRemoveByKey(this.order[0]);y&&this.onRemove(y)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const n=this.data[e].shift();return n.timeout&&clearTimeout(n.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),n.value}getByKey(e){const n=this.data[e];return n?n[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,n){if(!this.has(e))return this;const s=e.wrapped().key,o=void 0===n?0:this.data[s].indexOf(n),u=this.data[s][o];return this.data[s].splice(o,1),u.timeout&&clearTimeout(u.timeout),0===this.data[s].length&&delete this.data[s],this.onRemove(u.value),this.order.splice(this.order.indexOf(s),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(e){const n=[];for(const s in this.data)for(const o of this.data[s])e(o.value)||n.push(o);for(const s of n)this.remove(s.value.tileID,s)}}class Ci{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,n,s){const o=String(n);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][o]=this.stateChanges[e][o]||{},g.e(this.stateChanges[e][o],s),null===this.deletedStates[e]){this.deletedStates[e]={};for(const u in this.state[e])u!==o&&(this.deletedStates[e][u]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][o]){this.deletedStates[e][o]={};for(const u in this.state[e][o])s[u]||(this.deletedStates[e][o][u]=null)}else for(const u in s)this.deletedStates[e]&&this.deletedStates[e][o]&&null===this.deletedStates[e][o][u]&&delete this.deletedStates[e][o][u]}removeFeatureState(e,n,s){if(null===this.deletedStates[e])return;const o=String(n);if(this.deletedStates[e]=this.deletedStates[e]||{},s&&void 0!==n)null!==this.deletedStates[e][o]&&(this.deletedStates[e][o]=this.deletedStates[e][o]||{},this.deletedStates[e][o][s]=null);else if(void 0!==n)if(this.stateChanges[e]&&this.stateChanges[e][o])for(s in this.deletedStates[e][o]={},this.stateChanges[e][o])this.deletedStates[e][o][s]=null;else this.deletedStates[e][o]=null;else this.deletedStates[e]=null}getState(e,n){const s=String(n),o=g.e({},(this.state[e]||{})[s],(this.stateChanges[e]||{})[s]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){const u=this.deletedStates[e][n];if(null===u)return{};for(const y in u)delete o[y]}return o}initializeTileState(e,n){e.setFeatureState(this.state,n)}coalesceChanges(e,n){const s={};for(const o in this.stateChanges){this.state[o]=this.state[o]||{};const u={};for(const y in this.stateChanges[o])this.state[o][y]||(this.state[o][y]={}),g.e(this.state[o][y],this.stateChanges[o][y]),u[y]=this.state[o][y];s[o]=u}for(const o in this.deletedStates){this.state[o]=this.state[o]||{};const u={};if(null===this.deletedStates[o])for(const y in this.state[o])u[y]={},this.state[o][y]={};else for(const y in this.deletedStates[o]){if(null===this.deletedStates[o][y])this.state[o][y]={};else for(const I of Object.keys(this.deletedStates[o][y]))delete this.state[o][y][I];u[y]=this.state[o][y]}s[o]=s[o]||{},g.e(s[o],u)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(s).length)for(const o in e)e[o].setFeatureState(s,n)}}class Ai extends g.E{constructor(e,n,s){super(),this.id=e,this.dispatcher=s,this.on("data",o=>this._dataHandler(o)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((o,u,y,I)=>{const v=new(gr(u.type))(o,u,y,I);if(v.id!==o)throw new Error(`Expected Source id to be ${o} instead of ${v.id}`);return v})(e,n,s,this),this._tiles={},this._cache=new wt(0,o=>this._unloadTile(o)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ci,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const n=this._tiles[e];if("loaded"!==n.state&&"errored"!==n.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,n,s){return g._(this,void 0,void 0,function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,n,s)}catch(o){e.state="errored",404!==o.status?this._source.fire(new g.j(o,{tile:e})):this.update(this.transform,this.terrain)}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new g.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const n in this._tiles){const s=this._tiles[n];s.upload(e),s.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(Rr).map(e=>e.key)}getRenderableIds(e){const n=[];for(const s in this._tiles)this._isIdRenderable(s,e)&&n.push(this._tiles[s]);return e?n.sort((s,o)=>{const u=s.tileID,y=o.tileID,I=new g.P(u.canonical.x,u.canonical.y)._rotate(this.transform.angle),v=new g.P(y.canonical.x,y.canonical.y)._rotate(this.transform.angle);return u.overscaledZ-y.overscaledZ||v.y-I.y||v.x-I.x}).map(s=>s.tileID.key):n.map(s=>s.tileID).sort(Rr).map(s=>s.key)}hasRenderableParent(e){const n=this.findLoadedParent(e,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(e,n){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(n||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")}}_reloadTile(e,n){return g._(this,void 0,void 0,function*(){const s=this._tiles[e];s&&("loading"!==s.state&&(s.state=n),yield this._loadTile(s,e,n))})}_tileLoaded(e,n,s){e.timeAdded=at.now(),"expired"===s&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new g.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const n=this.getRenderableIds();for(let o=0;o<n.length;o++){const u=n[o];if(e.neighboringTiles&&e.neighboringTiles[u]){const y=this.getTileByID(u);s(e,y),s(y,e)}}function s(o,u){o.needsHillshadePrepare=!0,o.needsTerrainPrepare=!0;let y=u.tileID.canonical.x-o.tileID.canonical.x;const I=u.tileID.canonical.y-o.tileID.canonical.y,v=Math.pow(2,o.tileID.canonical.z),S=u.tileID.key;0===y&&0===I||Math.abs(I)>1||(Math.abs(y)>1&&(1===Math.abs(y+v)?y+=v:1===Math.abs(y-v)&&(y-=v)),u.dem&&o.dem&&(o.dem.backfillBorder(u.dem,y,I),o.neighboringTiles&&o.neighboringTiles[S]&&(o.neighboringTiles[S].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,n,s,o){for(const u in this._tiles){let y=this._tiles[u];if(o[u]||!y.hasData()||y.tileID.overscaledZ<=n||y.tileID.overscaledZ>s)continue;let I=y.tileID;for(;y&&y.tileID.overscaledZ>n+1;){const S=y.tileID.scaledTo(y.tileID.overscaledZ-1);y=this._tiles[S.key],y&&y.hasData()&&(I=S)}let v=I;for(;v.overscaledZ>n;)if(v=v.scaledTo(v.overscaledZ-1),e[v.key]){o[I.key]=I;break}}}findLoadedParent(e,n){if(e.key in this._loadedParentTiles){const s=this._loadedParentTiles[e.key];return s&&s.tileID.overscaledZ>=n?s:null}for(let s=e.overscaledZ-1;s>=n;s--){const o=e.scaledTo(s),u=this._getLoadedTile(o);if(u)return u}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){const n=this._tiles[e.key];return n&&n.hasData()?n:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const n=Math.ceil(e.width/this._source.tileSize)+1,s=Math.ceil(e.height/this._source.tileSize)+1,o=Math.floor(n*s*(null===this._maxTileCacheZoomLevels?g.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),u="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(u)}handleWrapJump(e){const n=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,n){const s={};for(const o in this._tiles){const u=this._tiles[o];u.tileID=u.tileID.unwrapTo(u.tileID.wrap+n),s[u.tileID.key]=u}this._tiles=s;for(const o in this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(const o in this._tiles)this._setTileReloadTimer(o,this._tiles[o])}}_updateCoveredAndRetainedTiles(e,n,s,o,u,y){const I={},v={},S=Object.keys(e),T=at.now();for(const M of S){const j=e[M],ee=this._tiles[M];if(!ee||0!==ee.fadeEndTime&&ee.fadeEndTime<=T)continue;const ae=this.findLoadedParent(j,n),Ae=this.findLoadedSibling(j),_e=ae||Ae||null;_e&&(this._addTile(_e.tileID),I[_e.tileID.key]=_e.tileID),v[M]=j}this._retainLoadedChildren(v,o,s,e);for(const M in I)e[M]||(this._coveredTiles[M]=!0,e[M]=I[M]);if(y){const M={},j={};for(const ee of u)this._tiles[ee.key].hasData()?M[ee.key]=ee:j[ee.key]=ee;for(const ee in j){const ae=j[ee].children(this._source.maxzoom);this._tiles[ae[0].key]&&this._tiles[ae[1].key]&&this._tiles[ae[2].key]&&this._tiles[ae[3].key]&&(M[ae[0].key]=e[ae[0].key]=ae[0],M[ae[1].key]=e[ae[1].key]=ae[1],M[ae[2].key]=e[ae[2].key]=ae[2],M[ae[3].key]=e[ae[3].key]=ae[3],delete j[ee])}for(const ee in j){const ae=j[ee],Ae=this.findLoadedParent(ae,this._source.minzoom),_e=this.findLoadedSibling(ae),we=Ae||_e||null;if(we){M[we.tileID.key]=e[we.tileID.key]=we.tileID;for(const Ce in M)M[Ce].isChildOf(we.tileID)&&delete M[Ce]}}for(const ee in this._tiles)M[ee]||(this._coveredTiles[ee]=!0)}}update(e,n){if(!this._sourceLoaded||this._paused)return;let s;this.transform=e,this.terrain=n,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?s=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(T=>new g.S(T.canonical.z,T.wrap,T.canonical.z,T.canonical.x,T.canonical.y)):(s=e.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n}),this._source.hasTile&&(s=s.filter(T=>this._source.hasTile(T)))):s=[];const o=e.coveringZoomLevel(this._source),u=Math.max(o-Ai.maxOverzooming,this._source.minzoom),y=Math.max(o+Ai.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const T={};for(const M of s)if(M.canonical.z>this._source.minzoom){const j=M.scaledTo(M.canonical.z-1);T[j.key]=j;const ee=M.scaledTo(Math.max(this._source.minzoom,Math.min(M.canonical.z,5)));T[ee.key]=ee}s=s.concat(Object.values(T))}const I=0===s.length&&!this._updated&&this._didEmitContent;this._updated=!0,I&&this.fire(new g.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const v=this._updateRetainedTiles(s,o);vr(this._source.type)&&this._updateCoveredAndRetainedTiles(v,u,y,o,s,n);for(const T in v)this._tiles[T].clearFadeHold();const S=g.ab(this._tiles,v);for(const T of S){const M=this._tiles[T];M.hasSymbolBuckets&&!M.holdingForFade()?M.setHoldDuration(this.map._fadeDuration):M.hasSymbolBuckets&&!M.symbolFadeFinished()||this._removeTile(T)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,n){var s;const o={},u={},y=Math.max(n-Ai.maxOverzooming,this._source.minzoom),I=Math.max(n+Ai.maxUnderzooming,this._source.minzoom),v={};for(const S of e){const T=this._addTile(S);o[S.key]=S,T.hasData()||n<this._source.maxzoom&&(v[S.key]=S)}this._retainLoadedChildren(v,n,I,o);for(const S of e){let T=this._tiles[S.key];if(T.hasData())continue;if(n+1>this._source.maxzoom){const j=S.children(this._source.maxzoom)[0],ee=this.getTile(j);if(ee&&ee.hasData()){o[j.key]=j;continue}}else{const j=S.children(this._source.maxzoom);if(o[j[0].key]&&o[j[1].key]&&o[j[2].key]&&o[j[3].key])continue}let M=T.wasRequested();for(let j=S.overscaledZ-1;j>=y;--j){const ee=S.scaledTo(j);if(u[ee.key])break;if(u[ee.key]=!0,T=this.getTile(ee),!T&&M&&(T=this._addTile(ee)),T){const ae=T.hasData();if((ae||!(null!==(s=this.map)&&void 0!==s&&s.cancelPendingTileRequestsWhileZooming)||M)&&(o[ee.key]=ee),M=T.wasRequested(),ae)break}}}return o}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const n=[];let s,o=this._tiles[e].tileID;for(;o.overscaledZ>0;){if(o.key in this._loadedParentTiles){s=this._loadedParentTiles[o.key];break}n.push(o.key);const u=o.scaledTo(o.overscaledZ-1);if(s=this._getLoadedTile(u),s)break;o=u}for(const u of n)this._loadedParentTiles[u]=s}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const e in this._tiles){const n=this._tiles[e].tileID,s=this._getLoadedTile(n);this._loadedSiblingTiles[n.key]=s}}_addTile(e){let n=this._tiles[e.key];if(n)return n;n=this._cache.getAndRemove(e),n&&(this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,n)));const s=n;return n||(n=new Ti(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,e.key,n.state)),n.uses++,this._tiles[e.key]=n,s||this._source.fire(new g.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(e,n){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const s=n.getExpiryTimeout();s&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},s))}_removeTile(e){const n=this._tiles[e];n&&(n.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),n.uses>0||(n.hasData()&&"reloading"!==n.state?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}_dataHandler(e){const n=e.sourceDataType;"source"===e.dataType&&"metadata"===n&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===n&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,n,s){const o=[],u=this.transform;if(!u)return o;const y=s?u.getCameraQueryGeometry(e):e,I=e.map(ae=>u.pointCoordinate(ae,this.terrain)),v=y.map(ae=>u.pointCoordinate(ae,this.terrain)),S=this.getIds();let T=1/0,M=1/0,j=-1/0,ee=-1/0;for(const ae of v)T=Math.min(T,ae.x),M=Math.min(M,ae.y),j=Math.max(j,ae.x),ee=Math.max(ee,ae.y);for(let ae=0;ae<S.length;ae++){const Ae=this._tiles[S[ae]];if(Ae.holdingForFade())continue;const _e=Ae.tileID,we=Math.pow(2,u.zoom-Ae.tileID.overscaledZ),Ce=n*Ae.queryPadding*g.X/Ae.tileSize/we,de=[_e.getTilePoint(new g.Z(T,M)),_e.getTilePoint(new g.Z(j,ee))];if(de[0].x-Ce<g.X&&de[0].y-Ce<g.X&&de[1].x+Ce>=0&&de[1].y+Ce>=0){const Me=I.map(Ve=>_e.getTilePoint(Ve)),ze=v.map(Ve=>_e.getTilePoint(Ve));o.push({tile:Ae,tileID:_e,queryGeometry:Me,cameraQueryGeometry:ze,scale:we})}}return o}getVisibleCoordinates(e){const n=this.getRenderableIds(e).map(s=>this._tiles[s].tileID);for(const s of n)s.posMatrix=this.transform.calculatePosMatrix(s.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(vr(this._source.type)){const e=at.now();for(const n in this._tiles)if(this._tiles[n].fadeEndTime>=e)return!0}return!1}setFeatureState(e,n,s){this._state.updateState(e=e||"_geojsonTileLayer",n,s)}removeFeatureState(e,n,s){this._state.removeFeatureState(e=e||"_geojsonTileLayer",n,s)}getFeatureState(e,n){return this._state.getState(e=e||"_geojsonTileLayer",n)}setDependencies(e,n,s){const o=this._tiles[e];o&&o.setDependencies(n,s)}reloadTilesForDependencies(e,n){for(const s in this._tiles)this._tiles[s].hasDependency(e,n)&&this._reloadTile(s,"reloading");this._cache.filter(s=>!s.hasDependency(e,n))}}function Rr(A,e){const n=Math.abs(2*A.wrap)-+(A.wrap<0),s=Math.abs(2*e.wrap)-+(e.wrap<0);return A.overscaledZ-e.overscaledZ||s-n||e.canonical.y-A.canonical.y||e.canonical.x-A.canonical.x}function vr(A){return"raster"===A||"image"===A||"video"===A}Ai.maxOverzooming=10,Ai.maxUnderzooming=3;class vi{constructor(e,n){this.reset(e,n)}reset(e,n){this.points=e||[],this._distances=[0];for(let s=1;s<this.points.length;s++)this._distances[s]=this._distances[s-1]+this.points[s].dist(this.points[s-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(n||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(1===this.points.length)return this.points[0];e=g.ac(e,0,1);let n=1,s=this._distances[n];const o=e*this.paddedLength+this.padding;for(;s<o&&n<this._distances.length;)s=this._distances[++n];const u=n-1,y=this._distances[u],I=s-y,v=I>0?(o-y)/I:0;return this.points[u].mult(1-v).add(this.points[n].mult(v))}}function wn(A,e){let n=!0;return"always"===A||"never"!==A&&"never"!==e||(n=!1),n}class zn{constructor(e,n,s){const o=this.boxCells=[],u=this.circleCells=[];this.xCellCount=Math.ceil(e/s),this.yCellCount=Math.ceil(n/s);for(let y=0;y<this.xCellCount*this.yCellCount;y++)o.push([]),u.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=n,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/n,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,n,s,o,u){this._forEachCell(n,s,o,u,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(o),this.bboxes.push(u)}insertCircle(e,n,s,o){this._forEachCell(n-o,s-o,n+o,s+o,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(n),this.circles.push(s),this.circles.push(o)}_insertBoxCell(e,n,s,o,u,y){this.boxCells[u].push(y)}_insertCircleCell(e,n,s,o,u,y){this.circleCells[u].push(y)}_query(e,n,s,o,u,y,I){if(s<0||e>this.width||o<0||n>this.height)return[];const v=[];if(e<=0&&n<=0&&this.width<=s&&this.height<=o){if(u)return[{key:null,x1:e,y1:n,x2:s,y2:o}];for(let S=0;S<this.boxKeys.length;S++)v.push({key:this.boxKeys[S],x1:this.bboxes[4*S],y1:this.bboxes[4*S+1],x2:this.bboxes[4*S+2],y2:this.bboxes[4*S+3]});for(let S=0;S<this.circleKeys.length;S++){const T=this.circles[3*S],M=this.circles[3*S+1],j=this.circles[3*S+2];v.push({key:this.circleKeys[S],x1:T-j,y1:M-j,x2:T+j,y2:M+j})}}else this._forEachCell(e,n,s,o,this._queryCell,v,{hitTest:u,overlapMode:y,seenUids:{box:{},circle:{}}},I);return v}query(e,n,s,o){return this._query(e,n,s,o,!1,null)}hitTest(e,n,s,o,u,y){return this._query(e,n,s,o,!0,u,y).length>0}hitTestCircle(e,n,s,o,u){const y=e-s,I=e+s,v=n-s,S=n+s;if(I<0||y>this.width||S<0||v>this.height)return!1;const T=[];return this._forEachCell(y,v,I,S,this._queryCellCircle,T,{hitTest:!0,overlapMode:o,circle:{x:e,y:n,radius:s},seenUids:{box:{},circle:{}}},u),T.length>0}_queryCell(e,n,s,o,u,y,I,v){const{seenUids:S,hitTest:T,overlapMode:M}=I,j=this.boxCells[u];if(null!==j){const ae=this.bboxes;for(const Ae of j)if(!S.box[Ae]){S.box[Ae]=!0;const _e=4*Ae,we=this.boxKeys[Ae];if(e<=ae[_e+2]&&n<=ae[_e+3]&&s>=ae[_e+0]&&o>=ae[_e+1]&&(!v||v(we))&&(!T||!wn(M,we.overlapMode))&&(y.push({key:we,x1:ae[_e],y1:ae[_e+1],x2:ae[_e+2],y2:ae[_e+3]}),T))return!0}}const ee=this.circleCells[u];if(null!==ee){const ae=this.circles;for(const Ae of ee)if(!S.circle[Ae]){S.circle[Ae]=!0;const _e=3*Ae,we=this.circleKeys[Ae];if(this._circleAndRectCollide(ae[_e],ae[_e+1],ae[_e+2],e,n,s,o)&&(!v||v(we))&&(!T||!wn(M,we.overlapMode))){const Ce=ae[_e],de=ae[_e+1],Me=ae[_e+2];if(y.push({key:we,x1:Ce-Me,y1:de-Me,x2:Ce+Me,y2:de+Me}),T)return!0}}}return!1}_queryCellCircle(e,n,s,o,u,y,I,v){const{circle:S,seenUids:T,overlapMode:M}=I,j=this.boxCells[u];if(null!==j){const ae=this.bboxes;for(const Ae of j)if(!T.box[Ae]){T.box[Ae]=!0;const _e=4*Ae,we=this.boxKeys[Ae];if(this._circleAndRectCollide(S.x,S.y,S.radius,ae[_e+0],ae[_e+1],ae[_e+2],ae[_e+3])&&(!v||v(we))&&!wn(M,we.overlapMode))return y.push(!0),!0}}const ee=this.circleCells[u];if(null!==ee){const ae=this.circles;for(const Ae of ee)if(!T.circle[Ae]){T.circle[Ae]=!0;const _e=3*Ae,we=this.circleKeys[Ae];if(this._circlesCollide(ae[_e],ae[_e+1],ae[_e+2],S.x,S.y,S.radius)&&(!v||v(we))&&!wn(M,we.overlapMode))return y.push(!0),!0}}}_forEachCell(e,n,s,o,u,y,I,v){const S=this._convertToXCellCoord(e),T=this._convertToYCellCoord(n),M=this._convertToXCellCoord(s),j=this._convertToYCellCoord(o);for(let ee=S;ee<=M;ee++)for(let ae=T;ae<=j;ae++)if(u.call(this,e,n,s,o,this.xCellCount*ae+ee,y,I,v))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,n,s,o,u,y){const I=o-e,v=u-n,S=s+y;return S*S>I*I+v*v}_circleAndRectCollide(e,n,s,o,u,y,I){const v=(y-o)/2,S=Math.abs(e-(o+v));if(S>v+s)return!1;const T=(I-u)/2,M=Math.abs(n-(u+T));if(M>T+s)return!1;if(S<=v||M<=T)return!0;const j=S-v,ee=M-T;return j*j+ee*ee<=s*s}}function Un(A,e,n,s,o){const u=g.H();return e?(g.K(u,u,[1/o,1/o,1]),n||g.ad(u,u,s.angle)):g.L(u,s.labelPlaneMatrix,A),u}function Gn(A,e,n,s,o){if(e){const u=g.ae(A);return g.K(u,u,[o,o,1]),n||g.ad(u,u,-s.angle),u}return s.glCoordMatrix}function me(A,e,n,s){let o;s?(o=[A,e,s(A,e),1],g.af(o,o,n)):(o=[A,e,0,1],Ji(o,o,n));const u=o[3];return{point:new g.P(o[0]/u,o[1]/u),signedDistanceFromCamera:u,isOccluded:!1}}function O(A,e){return.5+A/e*.5}function G(A,e){return A.x>=-e[0]&&A.x<=e[0]&&A.y>=-e[1]&&A.y<=e[1]}function W(A,e,n,s,o,u,y,I,v,S,T,M,j,ee,ae){const Ae=s?A.textSizeData:A.iconSizeData,_e=g.ag(Ae,n.transform.zoom),we=[256/n.width*2+1,256/n.height*2+1],Ce=s?A.text.dynamicLayoutVertexArray:A.icon.dynamicLayoutVertexArray;Ce.clear();const de=A.lineVertexArray,Me=s?A.text.placedSymbolArray:A.icon.placedSymbolArray,ze=n.transform.width/n.transform.height;let Ve=!1;for(let tt=0;tt<Me.length;tt++){const xt=Me.get(tt);if(xt.hidden||xt.writingMode===g.ah.vertical&&!Ve){hi(xt.numGlyphs,Ce);continue}Ve=!1;const Pt=me(xt.anchorX,xt.anchorY,e,ae);if(!G(Pt.point,we)){hi(xt.numGlyphs,Ce);continue}const Ot=O(n.transform.cameraToCenterDistance,Pt.signedDistanceFromCamera),St=g.ai(Ae,_e,xt),Mt=y?St/Ot:St*Ot,jt={getElevation:ae,labelPlaneMatrix:o,lineVertexArray:de,pitchWithMap:y,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:S,tileAnchorPoint:new g.P(xt.anchorX,xt.anchorY),unwrappedTileID:T,width:M,height:j,translation:ee},pi=ve(jt,xt,Mt,!1,I,e,u,A.glyphOffsetArray,Ce,ze,v);Ve=pi.useVertical,(pi.notEnoughRoom||Ve||pi.needsFlipping&&ve(jt,xt,Mt,!0,I,e,u,A.glyphOffsetArray,Ce,ze,v).notEnoughRoom)&&hi(xt.numGlyphs,Ce)}s?A.text.dynamicLayoutVertexBuffer.updateData(Ce):A.icon.dynamicLayoutVertexBuffer.updateData(Ce)}function fe(A,e,n,s,o,u,y,I){const v=u.glyphStartIndex+u.numGlyphs,S=u.lineStartIndex,T=u.lineStartIndex+u.lineLength,M=e.getoffsetX(u.glyphStartIndex),j=e.getoffsetX(v-1),ee=Dt(A*M,n,s,o,u.segment,S,T,I,y);if(!ee)return null;const ae=Dt(A*j,n,s,o,u.segment,S,T,I,y);return ae?I.projectionCache.anyProjectionOccluded?null:{first:ee,last:ae}:null}function Se(A,e,n,s){return A===g.ah.horizontal&&Math.abs(n.y-e.y)>Math.abs(n.x-e.x)*s?{useVertical:!0}:(A===g.ah.vertical?e.y<n.y:e.x>n.x)?{needsFlipping:!0}:null}function ve(A,e,n,s,o,u,y,I,v,S,T){const M=n/24,j=e.lineOffsetX*M,ee=e.lineOffsetY*M;let ae;if(e.numGlyphs>1){const Ae=e.glyphStartIndex+e.numGlyphs,_e=e.lineStartIndex,we=e.lineStartIndex+e.lineLength,Ce=fe(M,I,j,ee,s,e,T,A);if(!Ce)return{notEnoughRoom:!0};const de=me(Ce.first.point.x,Ce.first.point.y,y,A.getElevation).point,Me=me(Ce.last.point.x,Ce.last.point.y,y,A.getElevation).point;if(o&&!s){const ze=Se(e.writingMode,de,Me,S);if(ze)return ze}ae=[Ce.first];for(let ze=e.glyphStartIndex+1;ze<Ae-1;ze++)ae.push(Dt(M*I.getoffsetX(ze),j,ee,s,e.segment,_e,we,A,T));ae.push(Ce.last)}else{if(o&&!s){const _e=me(A.tileAnchorPoint.x,A.tileAnchorPoint.y,u,A.getElevation).point,we=e.lineStartIndex+e.segment+1,Ce=new g.P(A.lineVertexArray.getx(we),A.lineVertexArray.gety(we)),de=me(Ce.x,Ce.y,u,A.getElevation),Me=de.signedDistanceFromCamera>0?de.point:Ne(A.tileAnchorPoint,Ce,_e,1,u,A),ze=Se(e.writingMode,_e,Me,S);if(ze)return ze}const Ae=Dt(M*I.getoffsetX(e.glyphStartIndex),j,ee,s,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,A,T);if(!Ae||A.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};ae=[Ae]}for(const Ae of ae)g.aj(v,Ae.point,Ae.angle);return{}}function Ne(A,e,n,s,o,u){const y=A.add(A.sub(e)._unit()),I=void 0!==o?me(y.x,y.y,o,u.getElevation).point:rt(y.x,y.y,u).point,v=n.sub(I);return n.add(v._mult(s/v.mag()))}function Be(A,e,n){const s=e.projectionCache;if(s.projections[A])return s.projections[A];const o=new g.P(e.lineVertexArray.getx(A),e.lineVertexArray.gety(A)),u=rt(o.x,o.y,e);if(u.signedDistanceFromCamera>0)return s.projections[A]=u.point,s.anyProjectionOccluded=s.anyProjectionOccluded||u.isOccluded,u.point;const y=A-n.direction;return Ne(0===n.distanceFromAnchor?e.tileAnchorPoint:new g.P(e.lineVertexArray.getx(y),e.lineVertexArray.gety(y)),o,n.previousVertex,n.absOffsetX-n.distanceFromAnchor+1,void 0,e)}function rt(A,e,n){const s=A+n.translation[0],o=e+n.translation[1];let u;return!n.pitchWithMap&&n.projection.useSpecialProjectionForSymbols?(u=n.projection.projectTileCoordinates(s,o,n.unwrappedTileID,n.getElevation),u.point.x=(.5*u.point.x+.5)*n.width,u.point.y=(.5*-u.point.y+.5)*n.height):(u=me(s,o,n.labelPlaneMatrix,n.getElevation),u.isOccluded=!1),u}function yt(A,e,n){return A._unit()._perp()._mult(e*n)}function $e(A,e,n,s,o,u,y,I,v){if(I.projectionCache.offsets[A])return I.projectionCache.offsets[A];const S=n.add(e);if(A+v.direction<s||A+v.direction>=o)return I.projectionCache.offsets[A]=S,S;const T=Be(A+v.direction,I,v),M=yt(T.sub(n),y,v.direction),j=n.add(M),ee=T.add(M);return I.projectionCache.offsets[A]=g.ak(u,S,j,ee)||S,I.projectionCache.offsets[A]}function Dt(A,e,n,s,o,u,y,I,v){const S=s?A-e:A+e;let T=S>0?1:-1,M=0;s&&(T*=-1,M=Math.PI),T<0&&(M+=Math.PI);let j,ee=T>0?u+o:u+o+1;I.projectionCache.cachedAnchorPoint?j=I.projectionCache.cachedAnchorPoint:(j=rt(I.tileAnchorPoint.x,I.tileAnchorPoint.y,I).point,I.projectionCache.cachedAnchorPoint=j);let ae,Ae,_e=j,we=j,Ce=0,de=0;const Me=Math.abs(S),ze=[];let Ve;for(;Ce+de<=Me;){if(ee+=T,ee<u||ee>=y)return null;Ce+=de,we=_e,Ae=ae;const Pt={absOffsetX:Me,direction:T,distanceFromAnchor:Ce,previousVertex:we};if(_e=Be(ee,I,Pt),0===n)ze.push(we),Ve=_e.sub(we);else{let Ot;const St=_e.sub(we);Ot=0===St.mag()?yt(Be(ee+T,I,Pt).sub(_e),n,T):yt(St,n,T),Ae||(Ae=we.add(Ot)),ae=$e(ee,Ot,_e,u,y,Ae,n,I,Pt),ze.push(Ae),Ve=ae.sub(Ae)}de=Ve.mag()}const tt=Ve._mult((Me-Ce)/de)._add(Ae||we),xt=M+Math.atan2(_e.y-we.y,_e.x-we.x);return ze.push(tt),{point:tt,angle:v?xt:0,path:ze}}const ii=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function hi(A,e){for(let n=0;n<A;n++){const s=e.length;e.resize(s+4),e.float32.set(ii,3*s)}}function Ji(A,e,n){const s=e[0],o=e[1];return A[0]=n[0]*s+n[4]*o+n[12],A[1]=n[1]*s+n[5]*o+n[13],A[3]=n[3]*s+n[7]*o+n[15],A}const Ei=100;class ji{constructor(e,n,s=new zn(e.width+200,e.height+200,25),o=new zn(e.width+200,e.height+200,25)){this.transform=e,this.mapProjection=n,this.grid=s,this.ignoredGrid=o,this.pitchFactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Ei,this.screenBottomBoundary=e.height+Ei,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,n,s,o,u,y,I,v,S,T,M){const j=e.anchorPointX+v[0],ee=e.anchorPointY+v[1],ae=this.projectAndGetPerspectiveRatio(o,j,ee,u,T),Ae=s*ae.perspectiveRatio;let _e;if(y||I)_e=this._projectCollisionBox(e,Ae,o,u,y,I,v,ae,T,M);else{const ze=ae.point.x+(M?M.x*Ae:0),Ve=ae.point.y+(M?M.y*Ae:0);_e={allPointsOccluded:!1,box:[ze+e.x1*Ae,Ve+e.y1*Ae,ze+e.x2*Ae,Ve+e.y2*Ae]}}const[we,Ce,de,Me]=_e.box;return this.mapProjection.useSpecialProjectionForSymbols&&(y?_e.allPointsOccluded:this.mapProjection.isOccluded(j,ee,u))||ae.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(we,Ce,de,Me)||"always"!==n&&this.grid.hitTest(we,Ce,de,Me,n,S)?{box:[we,Ce,de,Me],placeable:!1,offscreen:!1}:{box:[we,Ce,de,Me],placeable:!0,offscreen:this.isOffscreen(we,Ce,de,Me)}}placeCollisionCircles(e,n,s,o,u,y,I,v,S,T,M,j,ee,ae,Ae,_e){const we=[],Ce=new g.P(n.anchorX,n.anchorY),de=this.getPerspectiveRatio(y,Ce.x,Ce.y,I,_e),Me=(M?u/de:u*de)/g.ap,ze={getElevation:_e,labelPlaneMatrix:v,lineVertexArray:s,pitchWithMap:M,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:Ce,unwrappedTileID:I,width:this.transform.width,height:this.transform.height,translation:Ae},Ve=fe(Me,o,n.lineOffsetX*Me,n.lineOffsetY*Me,!1,n,!1,ze);let tt=!1,xt=!1,Pt=!0;if(Ve){const Ot=.5*ee*de+ae,St=new g.P(-100,-100),Mt=new g.P(this.screenRightBoundary,this.screenBottomBoundary),jt=new vi,pi=Ve.first,Et=Ve.last;let Ft=[];for(let Mi=pi.path.length-1;Mi>=1;Mi--)Ft.push(pi.path[Mi]);for(let Mi=1;Mi<Et.path.length;Mi++)Ft.push(Et.path[Mi]);const _i=2.5*Ot;if(S){const Mi=this.projectPathToScreenSpace(Ft,ze,S);Ft=Mi.some(Gi=>Gi.signedDistanceFromCamera<=0)?[]:Mi.map(Gi=>Gi.point)}let ar=[];if(Ft.length>0){const Mi=Ft[0].clone(),Gi=Ft[0].clone();for(let dr=1;dr<Ft.length;dr++)Mi.x=Math.min(Mi.x,Ft[dr].x),Mi.y=Math.min(Mi.y,Ft[dr].y),Gi.x=Math.max(Gi.x,Ft[dr].x),Gi.y=Math.max(Gi.y,Ft[dr].y);ar=Mi.x>=St.x&&Gi.x<=Mt.x&&Mi.y>=St.y&&Gi.y<=Mt.y?[Ft]:Gi.x<St.x||Mi.x>Mt.x||Gi.y<St.y||Mi.y>Mt.y?[]:g.al([Ft],St.x,St.y,Mt.x,Mt.y)}for(const Mi of ar){jt.reset(Mi,.25*Ot);let Gi=0;Gi=jt.length<=.5*Ot?1:Math.ceil(jt.paddedLength/_i)+1;for(let dr=0;dr<Gi;dr++){const on=dr/Math.max(Gi-1,1),mn=jt.lerp(on),yr=mn.x+Ei,Wr=mn.y+Ei;we.push(yr,Wr,Ot,0);const ln=yr-Ot,zr=Wr-Ot,Nr=yr+Ot,oa=Wr+Ot;if(Pt=Pt&&this.isOffscreen(ln,zr,Nr,oa),xt=xt||this.isInsideGrid(ln,zr,Nr,oa),"always"!==e&&this.grid.hitTestCircle(yr,Wr,Ot,e,j)&&(tt=!0,!T))return{circles:[],offscreen:!1,collisionDetected:tt}}}}return{circles:!T&&tt||!xt||de<this.perspectiveRatioCutoff?[]:we,offscreen:Pt,collisionDetected:tt}}projectPathToScreenSpace(e,n,s){return e.map(o=>me(o.x,o.y,s,n.getElevation))}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const n=[];let s=1/0,o=1/0,u=-1/0,y=-1/0;for(const T of e){const M=new g.P(T.x+Ei,T.y+Ei);s=Math.min(s,M.x),o=Math.min(o,M.y),u=Math.max(u,M.x),y=Math.max(y,M.y),n.push(M)}const I=this.grid.query(s,o,u,y).concat(this.ignoredGrid.query(s,o,u,y)),v={},S={};for(const T of I){const M=T.key;if(void 0===v[M.bucketInstanceId]&&(v[M.bucketInstanceId]={}),v[M.bucketInstanceId][M.featureIndex])continue;const j=[new g.P(T.x1,T.y1),new g.P(T.x2,T.y1),new g.P(T.x2,T.y2),new g.P(T.x1,T.y2)];g.am(n,j)&&(v[M.bucketInstanceId][M.featureIndex]=!0,void 0===S[M.bucketInstanceId]&&(S[M.bucketInstanceId]=[]),S[M.bucketInstanceId].push(M.featureIndex))}return S}insertCollisionBox(e,n,s,o,u,y){(s?this.ignoredGrid:this.grid).insert({bucketInstanceId:o,featureIndex:u,collisionGroupID:y,overlapMode:n},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,n,s,o,u,y){const I=s?this.ignoredGrid:this.grid,v={bucketInstanceId:o,featureIndex:u,collisionGroupID:y,overlapMode:n};for(let S=0;S<e.length;S+=4)I.insertCircle(v,e[S],e[S+1],e[S+2])}projectAndGetPerspectiveRatio(e,n,s,o,u){let y;u?(y=[n,s,u(n,s),1],g.af(y,y,e)):(y=[n,s,0,1],Ji(y,y,e));const I=y[3];return{point:new g.P((y[0]/I+1)/2*this.transform.width+Ei,(-y[1]/I+1)/2*this.transform.height+Ei),perspectiveRatio:.5+this.transform.cameraToCenterDistance/I*.5,isOccluded:!1,signedDistanceFromCamera:I}}getPerspectiveRatio(e,n,s,o,u){const y=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(n,s,o,u):me(n,s,e,u);return.5+this.transform.cameraToCenterDistance/y.signedDistanceFromCamera*.5}isOffscreen(e,n,s,o){return s<Ei||e>=this.screenRightBoundary||o<Ei||n>this.screenBottomBoundary}isInsideGrid(e,n,s,o){return s>=0&&e<this.gridRightBoundary&&o>=0&&n<this.gridBottomBoundary}getViewportMatrix(){const e=g.an([]);return g.J(e,e,[-100,-100,0]),e}_projectCollisionBox(e,n,s,o,u,y,I,v,S,T){let M=new g.P(1,0),j=new g.P(0,1);const ee=new g.P(e.anchorPointX+I[0],e.anchorPointY+I[1]);if(y&&!u){const Pt=this.projectAndGetPerspectiveRatio(s,ee.x+1,ee.y,o,S).point.sub(v.point).unit(),Ot=Math.atan(Pt.y/Pt.x)+(Pt.x<0?Math.PI:0),St=Math.sin(Ot),Mt=Math.cos(Ot);M=new g.P(Mt,St),j=new g.P(-St,Mt)}else if(!y&&u){const Pt=-this.transform.angle,Ot=Math.sin(Pt),St=Math.cos(Pt);M=new g.P(St,Ot),j=new g.P(-Ot,St)}let ae=v.point,Ae=n;if(u){ae=ee;const Pt=this.transform.zoom-Math.floor(this.transform.zoom);Ae=Math.pow(2,-Pt),Ae*=this.mapProjection.getPitchedTextCorrection(this.transform,ee,o),T||(Ae*=g.ac(.5+v.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}T&&(ae=ae.add(M.mult(T.x*Ae)).add(j.mult(T.y*Ae)));const _e=e.x1*Ae,we=e.x2*Ae,Ce=(_e+we)/2,de=e.y1*Ae,Me=e.y2*Ae,ze=(de+Me)/2,Ve=[{offsetX:_e,offsetY:de},{offsetX:Ce,offsetY:de},{offsetX:we,offsetY:de},{offsetX:we,offsetY:ze},{offsetX:we,offsetY:Me},{offsetX:Ce,offsetY:Me},{offsetX:_e,offsetY:Me},{offsetX:_e,offsetY:ze}];let tt=[];for(const{offsetX:Pt,offsetY:Ot}of Ve)tt.push(new g.P(ae.x+M.x*Pt+j.x*Ot,ae.y+M.y*Pt+j.y*Ot));let xt=!1;if(u){const Pt=tt.map(Ot=>this.projectAndGetPerspectiveRatio(s,Ot.x,Ot.y,o,S));xt=Pt.some(Ot=>!Ot.isOccluded),tt=Pt.map(Ot=>Ot.point)}else xt=!0;return{box:g.ao(tt),allPointsOccluded:!xt}}}function zi(A,e,n){return e*(g.X/(A.tileSize*Math.pow(2,n-A.tileID.overscaledZ)))}class ur{constructor(e,n,s,o){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?n:-n))):o&&s?1:0,this.placed=s}isHidden(){return 0===this.opacity&&!this.placed}}class mr{constructor(e,n,s,o,u){this.text=new ur(e?e.text:null,n,s,u),this.icon=new ur(e?e.icon:null,n,o,u)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class C{constructor(e,n,s){this.text=e,this.icon=n,this.skipFade=s}}class P{constructor(){this.invProjMatrix=g.H(),this.viewportMatrix=g.H(),this.circles=[]}}class z{constructor(e,n,s,o,u){this.bucketInstanceId=e,this.featureIndex=n,this.sourceLayerIndex=s,this.bucketIndex=o,this.tileID=u}}class U{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const n=++this.maxGroupID;this.collisionGroups[e]={ID:n,predicate:s=>s.collisionGroupID===n}}return this.collisionGroups[e]}}function K(A,e,n,s,o){const{horizontalAlign:u,verticalAlign:y}=g.au(A);return new g.P(-(u-.5)*e+s[0]*o,-(y-.5)*n+s[1]*o)}class ${constructor(e,n,s,o,u,y){this.transform=e.clone(),this.terrain=s,this.collisionIndex=new ji(this.transform,n),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new U(u),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=y,y&&(y.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const n=this.terrain;return n?(s,o)=>n.getElevation(e,s,o):null}getBucketParts(e,n,s,o){const u=s.getBucket(n),y=s.latestFeatureIndex;if(!u||!y||n.id!==u.layerIds[0])return;const I=s.collisionBoxArray,v=u.layers[0].layout,S=u.layers[0].paint,T=Math.pow(2,this.transform.zoom-s.tileID.overscaledZ),M=s.tileSize/g.X,j=s.tileID.toUnwrapped(),ee=this.transform.calculatePosMatrix(j),ae="map"===v.get("text-pitch-alignment"),Ae="map"===v.get("text-rotation-alignment"),_e=zi(s,1,this.transform.zoom),we=this.collisionIndex.mapProjection.translatePosition(this.transform,s,S.get("text-translate"),S.get("text-translate-anchor")),Ce=this.collisionIndex.mapProjection.translatePosition(this.transform,s,S.get("icon-translate"),S.get("icon-translate-anchor")),de=Un(ee,ae,Ae,this.transform,_e);let Me=null;if(ae){const Ve=Gn(ee,ae,Ae,this.transform,_e);Me=g.L([],this.transform.labelPlaneMatrix,Ve)}this.retainedQueryData[u.bucketInstanceId]=new z(u.bucketInstanceId,y,u.sourceLayerIndex,u.index,s.tileID);const ze={bucket:u,layout:v,translationText:we,translationIcon:Ce,posMatrix:ee,unwrappedTileID:j,textLabelPlaneMatrix:de,labelToScreenMatrix:Me,scale:T,textPixelRatio:M,holdingForFade:s.holdingForFade(),collisionBoxArray:I,partiallyEvaluatedTextSize:g.ag(u.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(u.sourceID)};if(o)for(const Ve of u.sortKeyRanges){const{sortKey:tt,symbolInstanceStart:xt,symbolInstanceEnd:Pt}=Ve;e.push({sortKey:tt,symbolInstanceStart:xt,symbolInstanceEnd:Pt,parameters:ze})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:u.symbolInstances.length,parameters:ze})}attemptAnchorPlacement(e,n,s,o,u,y,I,v,S,T,M,j,ee,ae,Ae,_e,we,Ce,de){const Me=g.aq[e.textAnchor],ze=[e.textOffset0,e.textOffset1],Ve=K(Me,s,o,ze,u),tt=this.collisionIndex.placeCollisionBox(n,j,v,S,T,I,y,_e,M.predicate,de,Ve);if((!Ce||this.collisionIndex.placeCollisionBox(Ce,j,v,S,T,I,y,we,M.predicate,de,Ve).placeable)&&tt.placeable){let xt;if(this.prevPlacement&&this.prevPlacement.variableOffsets[ee.crossTileID]&&this.prevPlacement.placements[ee.crossTileID]&&this.prevPlacement.placements[ee.crossTileID].text&&(xt=this.prevPlacement.variableOffsets[ee.crossTileID].anchor),0===ee.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[ee.crossTileID]={textOffset:ze,width:s,height:o,anchor:Me,textBoxScale:u,prevAnchor:xt},this.markUsedJustification(ae,Me,ee,Ae),ae.allowVerticalPlacement&&(this.markUsedOrientation(ae,Ae,ee),this.placedOrientations[ee.crossTileID]=Ae),{shift:Ve,placedGlyphBoxes:tt}}}placeLayerBucketPart(e,n,s){const{bucket:o,layout:u,translationText:y,translationIcon:I,posMatrix:v,unwrappedTileID:S,textLabelPlaneMatrix:T,labelToScreenMatrix:M,textPixelRatio:j,holdingForFade:ee,collisionBoxArray:ae,partiallyEvaluatedTextSize:Ae,collisionGroup:_e}=e.parameters,we=u.get("text-optional"),Ce=u.get("icon-optional"),de=g.ar(u,"text-overlap","text-allow-overlap"),Me="always"===de,ze=g.ar(u,"icon-overlap","icon-allow-overlap"),Ve="always"===ze,tt="map"===u.get("text-rotation-alignment"),xt="map"===u.get("text-pitch-alignment"),Pt="none"!==u.get("icon-text-fit"),Ot="viewport-y"===u.get("symbol-z-order"),St=Me&&(Ve||!o.hasIconData()||Ce),Mt=Ve&&(Me||!o.hasTextData()||we);!o.collisionArrays&&ae&&o.deserializeCollisionBoxes(ae);const jt=this._getTerrainElevationFunc(this.retainedQueryData[o.bucketInstanceId].tileID),pi=(Et,Ft,_i)=>{var ar,Mi;if(n[Et.crossTileID])return;if(ee)return void(this.placements[Et.crossTileID]=new C(!1,!1,!1));let Gi=!1,dr=!1,on=!0,mn=null,yr={box:null,placeable:!1,offscreen:null},Wr={box:null,placeable:!1,offscreen:null},ln=null,zr=null,Nr=null,oa=0,Ss=0,Cl=0;Ft.textFeatureIndex?oa=Ft.textFeatureIndex:Et.useRuntimeCollisionCircles&&(oa=Et.featureIndex),Ft.verticalTextFeatureIndex&&(Ss=Ft.verticalTextFeatureIndex);const Ws=Ft.textBox;if(Ws){const Jn=qr=>{let Vr=g.ah.horizontal;if(o.allowVerticalPlacement&&!qr&&this.prevPlacement){const Tn=this.prevPlacement.placedOrientations[Et.crossTileID];Tn&&(this.placedOrientations[Et.crossTileID]=Tn,Vr=Tn,this.markUsedOrientation(o,Vr,Et))}return Vr},jn=(qr,Vr)=>{if(o.allowVerticalPlacement&&Et.numVerticalGlyphVertices>0&&Ft.verticalTextBox){for(const Tn of o.writingModes)if(Tn===g.ah.vertical?(yr=Vr(),Wr=yr):yr=qr(),yr&&yr.placeable)break}else yr=qr()},Ja=Et.textAnchorOffsetStartIndex,la=Et.textAnchorOffsetEndIndex;if(la===Ja){const qr=(Vr,Tn)=>{const Ui=this.collisionIndex.placeCollisionBox(Vr,de,j,v,S,xt,tt,y,_e.predicate,jt);return Ui&&Ui.placeable&&(this.markUsedOrientation(o,Tn,Et),this.placedOrientations[Et.crossTileID]=Tn),Ui};jn(()=>qr(Ws,g.ah.horizontal),()=>{const Vr=Ft.verticalTextBox;return o.allowVerticalPlacement&&Et.numVerticalGlyphVertices>0&&Vr?qr(Vr,g.ah.vertical):{box:null,offscreen:null}}),Jn(yr&&yr.placeable)}else{let qr=g.aq[null===(Mi=null===(ar=this.prevPlacement)||void 0===ar?void 0:ar.variableOffsets[Et.crossTileID])||void 0===Mi?void 0:Mi.anchor];const Vr=(Ui,Ds,to)=>{const io=Ui.x2-Ui.x1,kc=Ui.y2-Ui.y1,Go=Et.textBoxScale,ac=Pt&&"never"===ze?Ds:null;let ja=null,Oo="never"===de?1:2,ba="never";qr&&Oo++;for(let No=0;No<Oo;No++){for(let Ql=Ja;Ql<la;Ql++){const yn=o.textAnchorOffsets.get(Ql);if(qr&&yn.textAnchor!==qr)continue;const ks=this.attemptAnchorPlacement(yn,Ui,io,kc,Go,tt,xt,j,v,S,_e,ba,Et,o,to,y,I,ac,jt);if(ks&&(ja=ks.placedGlyphBoxes,ja&&ja.placeable))return Gi=!0,mn=ks.shift,ja}qr?qr=null:ba=de}return s&&!ja&&(ja={box:this.collisionIndex.placeCollisionBox(Ws,"always",j,v,S,xt,tt,y,_e.predicate,jt,new g.P(0,0)).box,offscreen:!1,placeable:!1}),ja};jn(()=>Vr(Ws,Ft.iconBox,g.ah.horizontal),()=>{const Ui=Ft.verticalTextBox;return o.allowVerticalPlacement&&(!yr||!yr.placeable)&&Et.numVerticalGlyphVertices>0&&Ui?Vr(Ui,Ft.verticalIconBox,g.ah.vertical):{box:null,occluded:!0,offscreen:null}}),yr&&(Gi=yr.placeable,on=yr.offscreen);const Tn=Jn(yr&&yr.placeable);if(!Gi&&this.prevPlacement){const Ui=this.prevPlacement.variableOffsets[Et.crossTileID];Ui&&(this.variableOffsets[Et.crossTileID]=Ui,this.markUsedJustification(o,Ui.anchor,Et,Tn))}}}if(ln=yr,Gi=ln&&ln.placeable,on=ln&&ln.offscreen,Et.useRuntimeCollisionCircles){const Jn=o.text.placedSymbolArray.get(Et.centerJustifiedTextSymbolIndex),jn=g.ai(o.textSizeData,Ae,Jn),Ja=u.get("text-padding");zr=this.collisionIndex.placeCollisionCircles(de,Jn,o.lineVertexArray,o.glyphOffsetArray,jn,v,S,T,M,s,xt,_e.predicate,Et.collisionCircleDiameter,Ja,y,jt),zr.circles.length&&zr.collisionDetected&&!s&&g.w("Collisions detected, but collision boxes are not shown"),Gi=Me||zr.circles.length>0&&!zr.collisionDetected,on=on&&zr.offscreen}if(Ft.iconFeatureIndex&&(Cl=Ft.iconFeatureIndex),Ft.iconBox){const Jn=jn=>this.collisionIndex.placeCollisionBox(jn,ze,j,v,S,xt,tt,I,_e.predicate,jt,Pt&&mn?mn:void 0);Wr&&Wr.placeable&&Ft.verticalIconBox?(Nr=Jn(Ft.verticalIconBox),dr=Nr.placeable):(Nr=Jn(Ft.iconBox),dr=Nr.placeable),on=on&&Nr.offscreen}const Hn=we||0===Et.numHorizontalGlyphVertices&&0===Et.numVerticalGlyphVertices,El=Ce||0===Et.numIconVertices;Hn||El?El?Hn||(dr=dr&&Gi):Gi=dr&&Gi:dr=Gi=dr&&Gi;const eo=dr&&Nr.placeable;if(Gi&&ln.placeable&&this.collisionIndex.insertCollisionBox(ln.box,de,u.get("text-ignore-placement"),o.bucketInstanceId,Wr&&Wr.placeable&&Ss?Ss:oa,_e.ID),eo&&this.collisionIndex.insertCollisionBox(Nr.box,ze,u.get("icon-ignore-placement"),o.bucketInstanceId,Cl,_e.ID),zr&&Gi&&this.collisionIndex.insertCollisionCircles(zr.circles,de,u.get("text-ignore-placement"),o.bucketInstanceId,oa,_e.ID),s&&this.storeCollisionData(o.bucketInstanceId,_i,Ft,ln,Nr,zr),0===Et.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===o.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Et.crossTileID]=new C(Gi||St,dr||Mt,on||o.justReloaded),n[Et.crossTileID]=!0};if(Ot){if(0!==e.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const Et=o.getSortedSymbolIndexes(this.transform.angle);for(let Ft=Et.length-1;Ft>=0;--Ft){const _i=Et[Ft];pi(o.symbolInstances.get(_i),o.collisionArrays[_i],_i)}}else for(let Et=e.symbolInstanceStart;Et<e.symbolInstanceEnd;Et++)pi(o.symbolInstances.get(Et),o.collisionArrays[Et],Et);if(s&&o.bucketInstanceId in this.collisionCircleArrays){const Et=this.collisionCircleArrays[o.bucketInstanceId];g.as(Et.invProjMatrix,v),Et.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1}storeCollisionData(e,n,s,o,u,y){if(s.textBox||s.iconBox){let I,v;this.collisionBoxArrays.has(e)?I=this.collisionBoxArrays.get(e):(I=new Map,this.collisionBoxArrays.set(e,I)),I.has(n)?v=I.get(n):(v={text:null,icon:null},I.set(n,v)),s.textBox&&(v.text=o.box),s.iconBox&&(v.icon=u.box)}if(y){let I=this.collisionCircleArrays[e];void 0===I&&(I=this.collisionCircleArrays[e]=new P);for(let v=0;v<y.circles.length;v+=4)I.circles.push(y.circles[v+0]),I.circles.push(y.circles[v+1]),I.circles.push(y.circles[v+2]),I.circles.push(y.collisionDetected?1:0)}}markUsedJustification(e,n,s,o){let u;u=o===g.ah.vertical?s.verticalPlacedTextSymbolIndex:{left:s.leftJustifiedTextSymbolIndex,center:s.centerJustifiedTextSymbolIndex,right:s.rightJustifiedTextSymbolIndex}[g.at(n)];const y=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex,s.verticalPlacedTextSymbolIndex];for(const I of y)I>=0&&(e.text.placedSymbolArray.get(I).crossTileID=u>=0&&I!==u?0:s.crossTileID)}markUsedOrientation(e,n,s){const o=n===g.ah.horizontal||n===g.ah.horizontalOnly?n:0,u=n===g.ah.vertical?n:0,y=[s.leftJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.rightJustifiedTextSymbolIndex];for(const I of y)e.text.placedSymbolArray.get(I).placedOrientation=o;s.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(s.verticalPlacedTextSymbolIndex).placedOrientation=u)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const n=this.prevPlacement;let s=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;const o=n?n.symbolFadeChange(e):1,u=n?n.opacities:{},y=n?n.variableOffsets:{},I=n?n.placedOrientations:{};for(const v in this.placements){const S=this.placements[v],T=u[v];T?(this.opacities[v]=new mr(T,o,S.text,S.icon),s=s||S.text!==T.text.placed||S.icon!==T.icon.placed):(this.opacities[v]=new mr(null,o,S.text,S.icon,S.skipFade),s=s||S.text||S.icon)}for(const v in u){const S=u[v];if(!this.opacities[v]){const T=new mr(S,o,!1,!1);T.isHidden()||(this.opacities[v]=T,s=s||S.text.placed||S.icon.placed)}}for(const v in y)this.variableOffsets[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.variableOffsets[v]=y[v]);for(const v in I)this.placedOrientations[v]||!this.opacities[v]||this.opacities[v].isHidden()||(this.placedOrientations[v]=I[v]);if(n&&void 0===n.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");s?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:e)}updateLayerOpacities(e,n){const s={};for(const o of n){const u=o.getBucket(e);u&&o.latestFeatureIndex&&e.id===u.layerIds[0]&&this.updateBucketOpacities(u,o.tileID,s,o.collisionBoxArray)}}updateBucketOpacities(e,n,s,o){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const u=e.layers[0],y=u.layout,I=new mr(null,0,!1,!1,!0),v=y.get("text-allow-overlap"),S=y.get("icon-allow-overlap"),T=u._unevaluatedLayout.hasValue("text-variable-anchor")||u._unevaluatedLayout.hasValue("text-variable-anchor-offset"),M="map"===y.get("text-rotation-alignment"),j="map"===y.get("text-pitch-alignment"),ee="none"!==y.get("icon-text-fit"),ae=new mr(null,0,v&&(S||!e.hasIconData()||y.get("icon-optional")),S&&(v||!e.hasTextData()||y.get("text-optional")),!0);!e.collisionArrays&&o&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(o);const Ae=(we,Ce,de)=>{for(let Me=0;Me<Ce/4;Me++)we.opacityVertexArray.emplaceBack(de);we.hasVisibleVertices=we.hasVisibleVertices||de!==yi},_e=this.collisionBoxArrays.get(e.bucketInstanceId);for(let we=0;we<e.symbolInstances.length;we++){const Ce=e.symbolInstances.get(we),{numHorizontalGlyphVertices:de,numVerticalGlyphVertices:Me,crossTileID:ze}=Ce;let Ve=this.opacities[ze];s[ze]?Ve=I:Ve||(Ve=ae,this.opacities[ze]=Ve),s[ze]=!0;const tt=Ce.numIconVertices>0,xt=this.placedOrientations[Ce.crossTileID],Pt=xt===g.ah.vertical,Ot=xt===g.ah.horizontal||xt===g.ah.horizontalOnly;if(de>0||Me>0){const Mt=Di(Ve.text);Ae(e.text,de,Pt?yi:Mt),Ae(e.text,Me,Ot?yi:Mt);const jt=Ve.text.isHidden();[Ce.rightJustifiedTextSymbolIndex,Ce.centerJustifiedTextSymbolIndex,Ce.leftJustifiedTextSymbolIndex].forEach(Ft=>{Ft>=0&&(e.text.placedSymbolArray.get(Ft).hidden=jt||Pt?1:0)}),Ce.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(Ce.verticalPlacedTextSymbolIndex).hidden=jt||Ot?1:0);const pi=this.variableOffsets[Ce.crossTileID];pi&&this.markUsedJustification(e,pi.anchor,Ce,xt);const Et=this.placedOrientations[Ce.crossTileID];Et&&(this.markUsedJustification(e,"left",Ce,Et),this.markUsedOrientation(e,Et,Ce))}if(tt){const Mt=Di(Ve.icon),jt=!(ee&&Ce.verticalPlacedIconSymbolIndex&&Pt);Ce.placedIconSymbolIndex>=0&&(Ae(e.icon,Ce.numIconVertices,jt?Mt:yi),e.icon.placedSymbolArray.get(Ce.placedIconSymbolIndex).hidden=Ve.icon.isHidden()),Ce.verticalPlacedIconSymbolIndex>=0&&(Ae(e.icon,Ce.numVerticalIconVertices,jt?yi:Mt),e.icon.placedSymbolArray.get(Ce.verticalPlacedIconSymbolIndex).hidden=Ve.icon.isHidden())}const St=_e&&_e.has(we)?_e.get(we):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const Mt=e.collisionArrays[we];if(Mt){let jt=new g.P(0,0);if(Mt.textBox||Mt.verticalTextBox){let pi=!0;if(T){const Et=this.variableOffsets[ze];Et?(jt=K(Et.anchor,Et.width,Et.height,Et.textOffset,Et.textBoxScale),M&&jt._rotate(j?this.transform.angle:-this.transform.angle)):pi=!1}if(Mt.textBox||Mt.verticalTextBox){let Et;Mt.textBox&&(Et=Pt),Mt.verticalTextBox&&(Et=Ot),Ie(e.textCollisionBox.collisionVertexArray,Ve.text.placed,!pi||Et,St.text,jt.x,jt.y)}}if(Mt.iconBox||Mt.verticalIconBox){const pi=!(Ot||!Mt.verticalIconBox);let Et;Mt.iconBox&&(Et=pi),Mt.verticalIconBox&&(Et=!pi),Ie(e.iconCollisionBox.collisionVertexArray,Ve.icon.placed,Et,St.icon,ee?jt.x:0,ee?jt.y:0)}}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){const we=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=we.invProjMatrix,e.placementViewportMatrix=we.viewportMatrix,e.collisionCircleArray=we.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,n){const s=this.zoomAtLastRecencyCheck===n?1-this.zoomAdjustment(n):1;return this.zoomAtLastRecencyCheck=n,this.commitTime+this.fadeDuration*s>e}setStale(){this.stale=!0}}function Ie(A,e,n,s,o,u){s&&0!==s.length||(s=[0,0,0,0]);const y=s[0]-Ei,I=s[1]-Ei,v=s[2]-Ei,S=s[3]-Ei;A.emplaceBack(e?1:0,n?1:0,o||0,u||0,y,I),A.emplaceBack(e?1:0,n?1:0,o||0,u||0,v,I),A.emplaceBack(e?1:0,n?1:0,o||0,u||0,v,S),A.emplaceBack(e?1:0,n?1:0,o||0,u||0,y,S)}const xe=Math.pow(2,25),qe=Math.pow(2,24),Fe=Math.pow(2,17),Ke=Math.pow(2,16),st=Math.pow(2,9),bt=Math.pow(2,8),ei=Math.pow(2,1);function Di(A){if(0===A.opacity&&!A.placed)return 0;if(1===A.opacity&&A.placed)return 4294967295;const e=A.placed?1:0,n=Math.floor(127*A.opacity);return n*xe+e*qe+n*Fe+e*Ke+n*st+e*bt+n*ei+e}const yi=0;function xr(){return{isOccluded:(A,e,n)=>!1,getPitchedTextCorrection:(A,e,n)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(A,e,n,s){throw new Error("Not implemented.")},translatePosition:(A,e,n,s)=>function(o,u,y,I,v=!1){if(!y[0]&&!y[1])return[0,0];const S=v?"map"===I?o.angle:0:"viewport"===I?-o.angle:0;if(S){const T=Math.sin(S),M=Math.cos(S);y=[y[0]*M-y[1]*T,y[0]*T+y[1]*M]}return[v?y[0]:zi(u,y[0],o.zoom),v?y[1]:zi(u,y[1],o.zoom)]}(A,e,n,s),getCircleRadiusCorrection:A=>1}}class ki{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,n,s,o,u){const y=this._bucketParts;for(;this._currentTileIndex<e.length;)if(n.getBucketParts(y,o,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,u())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,y.sort((I,v)=>I.sortKey-v.sortKey));this._currentPartIndex<y.length;)if(n.placeLayerBucketPart(y[this._currentPartIndex],this._seenCrossTileIDs,s),this._currentPartIndex++,u())return!0;return!1}}class Hr{constructor(e,n,s,o,u,y,I,v){this.placement=new $(e,xr(),n,y,I,v),this._currentPlacementIndex=s.length-1,this._forceFullPlacement=o,this._showCollisionBoxes=u,this._done=!1}isDone(){return this._done}continuePlacement(e,n,s){const o=at.now(),u=()=>!this._forceFullPlacement&&at.now()-o>2;for(;this._currentPlacementIndex>=0;){const y=n[e[this._currentPlacementIndex]],I=this.placement.collisionIndex.transform.zoom;if("symbol"===y.type&&(!y.minzoom||y.minzoom<=I)&&(!y.maxzoom||y.maxzoom>I)){if(this._inProgressLayer||(this._inProgressLayer=new ki(y)),this._inProgressLayer.continuePlacement(s[y.source],this.placement,this._showCollisionBoxes,y,u))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const Ri=512/g.X/2;class Pi{constructor(e,n,s){this.tileID=e,this.bucketInstanceId=s,this._symbolsByKey={};const o=new Map;for(let u=0;u<n.length;u++){const y=n.get(u),I=y.key,v=o.get(I);v?v.push(y):o.set(I,[y])}for(const[u,y]of o){const I={positions:y.map(v=>({x:Math.floor(v.anchorX*Ri),y:Math.floor(v.anchorY*Ri)})),crossTileIDs:y.map(v=>v.crossTileID)};if(I.positions.length>128){const v=new g.av(I.positions.length,16,Uint16Array);for(const{x:S,y:T}of I.positions)v.add(S,T);v.finish(),delete I.positions,I.index=v}this._symbolsByKey[u]=I}}getScaledCoordinates(e,n){const{x:s,y:o,z:u}=this.tileID.canonical,{x:y,y:I,z:v}=n.canonical,S=Ri/Math.pow(2,v-u),T=(I*g.X+e.anchorY)*S,M=o*g.X*Ri;return{x:Math.floor((y*g.X+e.anchorX)*S-s*g.X*Ri),y:Math.floor(T-M)}}findMatches(e,n,s){const o=this.tileID.canonical.z<n.canonical.z?1:Math.pow(2,this.tileID.canonical.z-n.canonical.z);for(let u=0;u<e.length;u++){const y=e.get(u);if(y.crossTileID)continue;const I=this._symbolsByKey[y.key];if(!I)continue;const v=this.getScaledCoordinates(y,n);if(I.index){const S=I.index.range(v.x-o,v.y-o,v.x+o,v.y+o).sort();for(const T of S){const M=I.crossTileIDs[T];if(!s[M]){s[M]=!0,y.crossTileID=M;break}}}else if(I.positions)for(let S=0;S<I.positions.length;S++){const T=I.positions[S],M=I.crossTileIDs[S];if(Math.abs(T.x-v.x)<=o&&Math.abs(T.y-v.y)<=o&&!s[M]){s[M]=!0,y.crossTileID=M;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:e})=>e)}}class Ca{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Sr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const n=Math.round((e-this.lng)/360);if(0!==n)for(const s in this.indexes){const o=this.indexes[s],u={};for(const y in o){const I=o[y];I.tileID=I.tileID.unwrapTo(I.tileID.wrap+n),u[I.tileID.key]=I}this.indexes[s]=u}this.lng=e}addBucket(e,n,s){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let u=0;u<n.symbolInstances.length;u++)n.symbolInstances.get(u).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const o=this.usedCrossTileIDs[e.overscaledZ];for(const u in this.indexes){const y=this.indexes[u];if(Number(u)>e.overscaledZ)for(const I in y){const v=y[I];v.tileID.isChildOf(e)&&v.findMatches(n.symbolInstances,e,o)}else{const I=y[e.scaledTo(Number(u)).key];I&&I.findMatches(n.symbolInstances,e,o)}}for(let u=0;u<n.symbolInstances.length;u++){const y=n.symbolInstances.get(u);y.crossTileID||(y.crossTileID=s.generate(),o[y.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Pi(e,n.symbolInstances,n.bucketInstanceId),!0}removeBucketCrossTileIDs(e,n){for(const s of n.getCrossTileIDsLists())for(const o of s)delete this.usedCrossTileIDs[e][o]}removeStaleBuckets(e){let n=!1;for(const s in this.indexes){const o=this.indexes[s];for(const u in o)e[o[u].bucketInstanceId]||(this.removeBucketCrossTileIDs(s,o[u]),delete o[u],n=!0)}return n}}class es{constructor(){this.layerIndexes={},this.crossTileIDs=new Ca,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,n,s){let o=this.layerIndexes[e.id];void 0===o&&(o=this.layerIndexes[e.id]=new Sr);let u=!1;const y={};o.handleWrapJump(s);for(const I of n){const v=I.getBucket(e);v&&e.id===v.layerIds[0]&&(v.bucketInstanceId||(v.bucketInstanceId=++this.maxBucketInstanceId),o.addBucket(I.tileID,v,this.crossTileIDs)&&(u=!0),y[v.bucketInstanceId]=!0)}return o.removeStaleBuckets(y)&&(u=!0),u}pruneUnusedLayers(e){const n={};e.forEach(s=>{n[s]=!0});for(const s in this.layerIndexes)n[s]||delete this.layerIndexes[s]}}const Zr=(A,e)=>g.t(A,e&&e.filter(n=>"source.canvas"!==n.identifier)),ts=g.aw();class pa extends g.E{constructor(e,n={}){super(),this._rtlPluginLoaded=()=>{for(const s in this.sourceCaches){const o=this.sourceCaches[s].getSource().type;"vector"!==o&&"geojson"!==o||this.sourceCaches[s].reload()}},this.map=e,this.dispatcher=new tn(Dn(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(s,o)=>this.getGlyphs(s,o)),this.dispatcher.registerMessageHandler("GI",(s,o)=>this.getImages(s,o)),this.imageManager=new Pe,this.imageManager.setEventedParent(this),this.glyphManager=new Rt(e._requestManager,n.localIdeographFontFamily),this.lineAtlas=new cr(256,512),this.crossTileSymbolIndex=new es,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new g.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",g.ay()),zt().on(b,this._rtlPluginLoaded),this.on("data",s=>{if("source"!==s.dataType||"metadata"!==s.sourceDataType)return;const o=this.sourceCaches[s.sourceId];if(!o)return;const u=o.getSource();if(u&&u.vectorLayerIds)for(const y in this._layers){const I=this._layers[y];I.source===u.id&&this._validateLayer(I)}})}loadURL(e,n={},s){this.fire(new g.k("dataloading",{dataType:"style"})),n.validate="boolean"!=typeof n.validate||n.validate;const o=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const u=this._loadStyleRequest;g.h(o,this._loadStyleRequest).then(y=>{this._loadStyleRequest=null,this._load(y.data,n,s)}).catch(y=>{this._loadStyleRequest=null,y&&!u.signal.aborted&&this.fire(new g.j(y))})}loadJSON(e,n={},s){this.fire(new g.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,at.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,n.validate=!1!==n.validate,this._load(e,n,s)}).catch(()=>{})}loadEmpty(){this.fire(new g.k("dataloading",{dataType:"style"})),this._load(ts,{validate:!1})}_load(e,n,s){var o;const u=n.transformStyle?n.transformStyle(s,e):e;if(!n.validate||!Zr(this,g.u(u))){this._loaded=!0,this.stylesheet=u;for(const y in u.sources)this.addSource(y,u.sources[y],{validate:!1});u.sprite?this._loadSprite(u.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(u.glyphs),this._createLayers(),this.light=new et(this.stylesheet.light),this.sky=new sr(this.stylesheet.sky),this.map.setTerrain(null!==(o=this.stylesheet.terrain)&&void 0!==o?o:null),this.fire(new g.k("data",{dataType:"style"})),this.fire(new g.k("style.load"))}}_createLayers(){const e=g.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map(n=>n.id),this._layers={},this._serializedLayers=null;for(const n of e){const s=g.aA(n);s.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=s}}_loadSprite(e,n=!1,s=void 0){let o;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(u,y,I,v){return g._(this,void 0,void 0,function*(){const S=je(u),T=I>1?"@2x":"",M={},j={};for(const{id:ee,url:ae}of S){const Ae=y.transformRequest(kt(ae,T,".json"),"SpriteJSON");M[ee]=g.h(Ae,v);const _e=y.transformRequest(kt(ae,T,".png"),"SpriteImage");j[ee]=fi.getImage(_e,v)}return yield Promise.all([...Object.values(M),...Object.values(j)]),function(ee,ae){return g._(this,void 0,void 0,function*(){const Ae={};for(const _e in ee){Ae[_e]={};const we=at.getImageCanvasContext((yield ae[_e]).data),Ce=(yield ee[_e]).data;for(const de in Ce){const{width:Me,height:ze,x:Ve,y:tt,sdf:xt,pixelRatio:Pt,stretchX:Ot,stretchY:St,content:Mt,textFitWidth:jt,textFitHeight:pi}=Ce[de];Ae[_e][de]={data:null,pixelRatio:Pt,sdf:xt,stretchX:Ot,stretchY:St,content:Mt,textFitWidth:jt,textFitHeight:pi,spriteData:{width:Me,height:ze,x:Ve,y:tt,context:we}}}}return Ae})}(M,j)})}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(u=>{if(this._spriteRequest=null,u)for(const y in u){this._spritesImagesIds[y]=[];const I=this._spritesImagesIds[y]?this._spritesImagesIds[y].filter(v=>!(v in u)):[];for(const v of I)this.imageManager.removeImage(v),this._changedImages[v]=!0;for(const v in u[y]){const S="default"===y?v:`${y}:${v}`;this._spritesImagesIds[y].push(S),S in this.imageManager.images?this.imageManager.updateImage(S,u[y][v],!1):this.imageManager.addImage(S,u[y][v]),n&&(this._changedImages[S]=!0)}}}).catch(u=>{this._spriteRequest=null,o=u,this.fire(new g.j(o))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new g.k("data",{dataType:"style"})),s&&s(o)})}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new g.k("data",{dataType:"style"}))}_validateLayer(e){const n=this.sourceCaches[e.source];if(!n)return;const s=e.sourceLayer;if(!s)return;const o=n.getSource();("geojson"===o.type||o.vectorLayerIds&&-1===o.vectorLayerIds.indexOf(s))&&this.fire(new g.j(new Error(`Source layer "${s}" does not exist on source "${o.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,n=!1){const s=this._serializedAllLayers();if(!e||0===e.length)return Object.values(n?g.aB(s):s);const o=[];for(const u of e)if(s[u]){const y=n?g.aB(s[u]):s[u];o.push(y)}return o}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const n=Object.keys(this._layers);for(const s of n){const o=this._layers[s];"custom"!==o.type&&(e[s]=o.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const n=this._changed;if(n){const o=Object.keys(this._updatedLayers),u=Object.keys(this._removedLayers);(o.length||u.length)&&this._updateWorkerLayers(o,u);for(const y in this._updatedSources){const I=this._updatedSources[y];if("reload"===I)this._reloadSource(y);else{if("clear"!==I)throw new Error(`Invalid action ${I}`);this._clearSource(y)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const y in this._updatedPaintProps)this._layers[y].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const s={};for(const o in this.sourceCaches){const u=this.sourceCaches[o];s[o]=u.used,u.used=!1}for(const o of this._order){const u=this._layers[o];u.recalculate(e,this._availableImages),!u.isHidden(e.zoom)&&u.source&&(this.sourceCaches[u.source].used=!0)}for(const o in s){const u=this.sourceCaches[o];!!s[o]!=!!u.used&&u.fire(new g.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:o}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,n&&this.fire(new g.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,n){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,n={}){var s;this._checkLoaded();const o=this.serialize();if(e=n.transformStyle?n.transformStyle(o,e):e,(null===(s=n.validate)||void 0===s||s)&&Zr(this,g.u(e)))return!1;(e=g.aB(e)).layers=g.az(e.layers);const u=g.aC(o,e),y=this._getOperationsToPerform(u);if(y.unimplemented.length>0)throw new Error(`Unimplemented: ${y.unimplemented.join(", ")}.`);if(0===y.operations.length)return!1;for(const I of y.operations)I();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const n=[],s=[];for(const o of e)switch(o.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":n.push(()=>this.addLayer.apply(this,o.args));break;case"removeLayer":n.push(()=>this.removeLayer.apply(this,o.args));break;case"setPaintProperty":n.push(()=>this.setPaintProperty.apply(this,o.args));break;case"setLayoutProperty":n.push(()=>this.setLayoutProperty.apply(this,o.args));break;case"setFilter":n.push(()=>this.setFilter.apply(this,o.args));break;case"addSource":n.push(()=>this.addSource.apply(this,o.args));break;case"removeSource":n.push(()=>this.removeSource.apply(this,o.args));break;case"setLayerZoomRange":n.push(()=>this.setLayerZoomRange.apply(this,o.args));break;case"setLight":n.push(()=>this.setLight.apply(this,o.args));break;case"setGeoJSONSourceData":n.push(()=>this.setGeoJSONSourceData.apply(this,o.args));break;case"setGlyphs":n.push(()=>this.setGlyphs.apply(this,o.args));break;case"setSprite":n.push(()=>this.setSprite.apply(this,o.args));break;case"setSky":n.push(()=>this.setSky.apply(this,o.args));break;case"setTerrain":n.push(()=>this.map.setTerrain.apply(this,o.args));break;case"setTransition":n.push(()=>{});break;default:s.push(o.command)}return{operations:n,unimplemented:s}}addImage(e,n){if(this.getImage(e))return this.fire(new g.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,n),this._afterImageUpdated(e)}updateImage(e,n){this.imageManager.updateImage(e,n)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new g.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new g.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,n,s={}){if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error(`Source "${e}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(g.u.source,`sources.${e}`,n,null,s))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const o=this.sourceCaches[e]=new Ai(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,()=>({isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:e})),o.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(const s in this._layers)if(this._layers[s].source===e)return this.fire(new g.j(new Error(`Source "${e}" cannot be removed while layer "${s}" is using it.`)));const n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new g.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,n){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error(`There is no source with this ID=${e}`);const s=this.sourceCaches[e].getSource();if("geojson"!==s.type)throw new Error(`geojsonSource.type is ${s.type}, which is !== 'geojson`);s.setData(n),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,n,s={}){this._checkLoaded();const o=e.id;if(this.getLayer(o))return void this.fire(new g.j(new Error(`Layer "${o}" already exists on this map.`)));let u;if("custom"===e.type){if(Zr(this,g.aD(e)))return;u=g.aA(e)}else{if("source"in e&&"object"==typeof e.source&&(this.addSource(o,e.source),e=g.aB(e),e=g.e(e,{source:o})),this._validate(g.u.layer,`layers.${o}`,e,{arrayIndex:-1},s))return;u=g.aA(e),this._validateLayer(u),u.setEventedParent(this,{layer:{id:o}})}const y=n?this._order.indexOf(n):this._order.length;if(n&&-1===y)this.fire(new g.j(new Error(`Cannot add layer "${o}" before non-existing layer "${n}".`)));else{if(this._order.splice(y,0,o),this._layerOrderChanged=!0,this._layers[o]=u,this._removedLayers[o]&&u.source&&"custom"!==u.type){const I=this._removedLayers[o];delete this._removedLayers[o],I.type!==u.type?this._updatedSources[u.source]="clear":(this._updatedSources[u.source]="reload",this.sourceCaches[u.source].pause())}this._updateLayer(u),u.onAdd&&u.onAdd(this.map)}}moveLayer(e,n){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new g.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===n)return;const s=this._order.indexOf(e);this._order.splice(s,1);const o=n?this._order.indexOf(n):this._order.length;n&&-1===o?this.fire(new g.j(new Error(`Cannot move layer "${e}" before non-existing layer "${n}".`))):(this._order.splice(o,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const n=this._layers[e];if(!n)return void this.fire(new g.j(new Error(`Cannot remove non-existing layer "${e}".`)));n.setEventedParent(null);const s=this._order.indexOf(e);this._order.splice(s,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,n,s){this._checkLoaded();const o=this.getLayer(e);o?o.minzoom===n&&o.maxzoom===s||(null!=n&&(o.minzoom=n),null!=s&&(o.maxzoom=s),this._updateLayer(o)):this.fire(new g.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,n,s={}){this._checkLoaded();const o=this.getLayer(e);if(o){if(!g.aE(o.filter,n))return null==n?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(g.u.filter,`layers.${o.id}.filter`,n,null,s)||(o.filter=g.aB(n),this._updateLayer(o)))}else this.fire(new g.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return g.aB(this.getLayer(e).filter)}setLayoutProperty(e,n,s,o={}){this._checkLoaded();const u=this.getLayer(e);u?g.aE(u.getLayoutProperty(n),s)||(u.setLayoutProperty(n,s,o),this._updateLayer(u)):this.fire(new g.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,n){const s=this.getLayer(e);if(s)return s.getLayoutProperty(n);this.fire(new g.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,n,s,o={}){this._checkLoaded();const u=this.getLayer(e);u?g.aE(u.getPaintProperty(n),s)||(u.setPaintProperty(n,s,o)&&this._updateLayer(u),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new g.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,n){return this.getLayer(e).getPaintProperty(n)}setFeatureState(e,n){this._checkLoaded();const s=e.source,o=e.sourceLayer,u=this.sourceCaches[s];if(void 0===u)return void this.fire(new g.j(new Error(`The source '${s}' does not exist in the map's style.`)));const y=u.getSource().type;"geojson"===y&&o?this.fire(new g.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==y||o?(void 0===e.id&&this.fire(new g.j(new Error("The feature id parameter must be provided."))),u.setFeatureState(o,e.id,n)):this.fire(new g.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,n){this._checkLoaded();const s=e.source,o=this.sourceCaches[s];if(void 0===o)return void this.fire(new g.j(new Error(`The source '${s}' does not exist in the map's style.`)));const u=o.getSource().type,y="vector"===u?e.sourceLayer:void 0;"vector"!==u||y?n&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new g.j(new Error("A feature id is required to remove its specific state property."))):o.removeFeatureState(y,e.id,n):this.fire(new g.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const n=e.source,s=e.sourceLayer,o=this.sourceCaches[n];if(void 0!==o)return"vector"!==o.getSource().type||s?(void 0===e.id&&this.fire(new g.j(new Error("The feature id parameter must be provided."))),o.getFeatureState(s,e.id)):void this.fire(new g.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new g.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return g.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=g.aF(this.sourceCaches,u=>u.serialize()),n=this._serializeByIds(this._order,!0),s=this.map.getTerrain()||void 0,o=this.stylesheet;return g.aG({version:o.version,name:o.name,metadata:o.metadata,light:o.light,sky:o.sky,center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,sprite:o.sprite,glyphs:o.glyphs,transition:o.transition,sources:e,layers:n,terrain:s},u=>void 0!==u)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const n=y=>"fill-extrusion"===this._layers[y].type,s={},o=[];for(let y=this._order.length-1;y>=0;y--){const I=this._order[y];if(n(I)){s[I]=y;for(const v of e){const S=v[I];if(S)for(const T of S)o.push(T)}}}o.sort((y,I)=>I.intersectionZ-y.intersectionZ);const u=[];for(let y=this._order.length-1;y>=0;y--){const I=this._order[y];if(n(I))for(let v=o.length-1;v>=0;v--){const S=o[v].feature;if(s[S.layer.id]<y)break;u.push(S),o.pop()}else for(const v of e){const S=v[I];if(S)for(const T of S)u.push(T.feature)}}return u}queryRenderedFeatures(e,n,s){n&&n.filter&&this._validate(g.u.filter,"queryRenderedFeatures.filter",n.filter,null,n);const o={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new g.j(new Error("parameters.layers must be an Array."))),[];for(const I of n.layers){const v=this._layers[I];if(!v)return this.fire(new g.j(new Error(`The layer '${I}' does not exist in the map's style and cannot be queried for features.`))),[];o[v.source]=!0}}const u=[];n.availableImages=this._availableImages;const y=this._serializedAllLayers();for(const I in this.sourceCaches)n.layers&&!o[I]||u.push(rn(this.sourceCaches[I],this._layers,y,e,n,s));return this.placement&&u.push(function(I,v,S,T,M,j,ee){const ae={},Ae=j.queryRenderedSymbols(T),_e=[];for(const we of Object.keys(Ae).map(Number))_e.push(ee[we]);_e.sort(In);for(const we of _e){const Ce=we.featureIndex.lookupSymbolFeatures(Ae[we.bucketInstanceId],v,we.bucketIndex,we.sourceLayerIndex,M.filter,M.layers,M.availableImages,I);for(const de in Ce){const Me=ae[de]=ae[de]||[],ze=Ce[de];ze.sort((Ve,tt)=>{const xt=we.featureSortOrder;if(xt){const Pt=xt.indexOf(Ve.featureIndex);return xt.indexOf(tt.featureIndex)-Pt}return tt.featureIndex-Ve.featureIndex});for(const Ve of ze)Me.push(Ve)}}for(const we in ae)ae[we].forEach(Ce=>{const de=Ce.feature,Me=S[I[we].source].getFeatureState(de.layer["source-layer"],de.id);de.source=de.layer.source,de.layer["source-layer"]&&(de.sourceLayer=de.layer["source-layer"]),de.state=Me});return ae}(this._layers,y,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)}querySourceFeatures(e,n){n&&n.filter&&this._validate(g.u.filter,"querySourceFeatures.filter",n.filter,null,n);const s=this.sourceCaches[e];return s?function(o,u){const y=o.getRenderableIds().map(S=>o.getTileByID(S)),I=[],v={};for(let S=0;S<y.length;S++){const T=y[S],M=T.tileID.canonical.key;v[M]||(v[M]=!0,T.querySourceFeatures(I,u))}return I}(s,n):[]}getLight(){return this.light.getLight()}setLight(e,n={}){this._checkLoaded();const s=this.light.getLight();let o=!1;for(const y in e)if(!g.aE(e[y],s[y])){o=!0;break}if(!o)return;const u={now:at.now(),transition:g.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,n),this.light.updateTransitions(u)}getSky(){var e;return null===(e=this.stylesheet)||void 0===e?void 0:e.sky}setSky(e,n={}){const s=this.getSky();let o=!1;if(!e&&!s)return;if(e&&!s)o=!0;else if(!e&&s)o=!0;else for(const y in e)if(!g.aE(e[y],s[y])){o=!0;break}if(!o)return;const u={now:at.now(),transition:g.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,n),this.sky.updateTransitions(u)}_validate(e,n,s,o,u={}){return(!u||!1!==u.validate)&&Zr(this,e.call(g.u,g.e({key:n,style:this.serialize(),value:s,styleSpec:g.v},o)))}_remove(e=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),zt().off(b,this._rtlPluginLoaded);for(const n in this._layers)this._layers[n].setEventedParent(null);for(const n in this.sourceCaches){const s=this.sourceCaches[n];s.setEventedParent(null),s.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const n in this.sourceCaches)this.sourceCaches[n].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,n,s,o,u=!1){let y=!1,I=!1;const v={};for(const S of this._order){const T=this._layers[S];if("symbol"!==T.type)continue;if(!v[T.source]){const j=this.sourceCaches[T.source];v[T.source]=j.getRenderableIds(!0).map(ee=>j.getTileByID(ee)).sort((ee,ae)=>ae.tileID.overscaledZ-ee.tileID.overscaledZ||(ee.tileID.isLessThan(ae.tileID)?-1:1))}const M=this.crossTileSymbolIndex.addLayer(T,v[T.source],e.center.lng);y=y||M}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((u=u||this._layerOrderChanged||0===s)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(at.now(),e.zoom))&&(this.pauseablePlacement=new Hr(e,this.map.terrain,this._order,u,n,s,o,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,v),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(at.now()),I=!0),y&&this.pauseablePlacement.placement.setStale()),I||y)for(const S of this._order){const T=this._layers[S];"symbol"===T.type&&this.placement.updateLayerOpacities(T,v[T.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(at.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,n){return g._(this,void 0,void 0,function*(){const s=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();const o=this.sourceCaches[n.source];return o&&o.setDependencies(n.tileID.key,n.type,n.icons),s})}getGlyphs(e,n){return g._(this,void 0,void 0,function*(){const s=yield this.glyphManager.getGlyphs(n.stacks),o=this.sourceCaches[n.source];return o&&o.setDependencies(n.tileID.key,n.type,[""]),s})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,n={}){this._checkLoaded(),e&&this._validate(g.u.glyphs,"glyphs",e,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,n,s={},o){this._checkLoaded();const u=[{id:e,url:n}],y=[...je(this.stylesheet.sprite),...u];this._validate(g.u.sprite,"sprite",y,null,s)||(this.stylesheet.sprite=y,this._loadSprite(u,!0,o))}removeSprite(e){this._checkLoaded();const n=je(this.stylesheet.sprite);if(n.find(s=>s.id===e)){if(this._spritesImagesIds[e])for(const s of this._spritesImagesIds[e])this.imageManager.removeImage(s),this._changedImages[s]=!0;n.splice(n.findIndex(s=>s.id===e),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new g.k("data",{dataType:"style"}))}else this.fire(new g.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return je(this.stylesheet.sprite)}setSprite(e,n={},s){this._checkLoaded(),e&&this._validate(g.u.sprite,"sprite",e,null,n)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,s):(this._unloadSprite(),s&&s(null)))}}var Dr=g.Y([{name:"a_pos",type:"Int16",components:2}]);const kn={prelude:Hi("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:Hi("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Hi("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;
3uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:Hi("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:Hi("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Hi("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}"),heatmapTexture:Hi("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:Hi("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 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_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Hi("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);}"),debug:Hi("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,get_elevation(a_pos),1);}"),fill:Hi("#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);}"),fillOutline:Hi("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;}"),fillOutlinePattern:Hi("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;}"),fillPattern:Hi("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);}"),fillExtrusion:Hi("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;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying 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;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*
30.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;}"),fillExtrusionPattern:Hi("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;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying 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;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}"),hillshadePrepare:Hi("#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;}"),hillshade:Hi("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;
3\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;}"),line:Hi("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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:Hi("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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:Hi("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:Hi("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
3uniform 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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_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);}"),raster:Hi("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;}"),symbolIcon:Hi("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}","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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:Hi("#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 inner_edge=(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);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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 bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:Hi("#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;
3gl_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}","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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,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);}"),terrain:Hi("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
3float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Hi("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:Hi("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:Hi("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function Hi(A,e){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=e.match(/attribute ([\w]+) ([\w]+)/g),o=A.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),u=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=u?u.concat(o):o,I={};return{fragmentSource:A=A.replace(n,(v,S,T,M,j)=>(I[j]=!0,"define"===S?`\n#ifndef HAS_UNIFORM_u_${j}\nvarying ${T} ${M} ${j};\n#else\nuniform ${T} ${M} u_${j};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${j}\n    ${T} ${M} ${j} = u_${j};\n#endif\n`)),vertexSource:e=e.replace(n,(v,S,T,M,j)=>{const ee="float"===M?"vec2":"vec4",ae=j.match(/color/)?"color":ee;return I[j]?"define"===S?`\n#ifndef HAS_UNIFORM_u_${j}\nuniform lowp float u_${j}_t;\nattribute ${T} ${ee} a_${j};\nvarying ${T} ${M} ${j};\n#else\nuniform ${T} ${M} u_${j};\n#endif\n`:"vec4"===ae?`\n#ifndef HAS_UNIFORM_u_${j}\n    ${j} = a_${j};\n#else\n    ${T} ${M} ${j} = u_${j};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${j}\n    ${j} = unpack_mix_${ae}(a_${j}, u_${j}_t);\n#else\n    ${T} ${M} ${j} = u_${j};\n#endif\n`:"define"===S?`\n#ifndef HAS_UNIFORM_u_${j}\nuniform lowp float u_${j}_t;\nattribute ${T} ${ee} a_${j};\n#else\nuniform ${T} ${M} u_${j};\n#endif\n`:"vec4"===ae?`\n#ifndef HAS_UNIFORM_u_${j}\n    ${T} ${M} ${j} = a_${j};\n#else\n    ${T} ${M} ${j} = u_${j};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${j}\n    ${T} ${M} ${j} = unpack_mix_${ae}(a_${j}, u_${j}_t);\n#else\n    ${T} ${M} ${j} = u_${j};\n#endif\n`}),staticAttributes:s,staticUniforms:y}}class is{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,n,s,o,u,y,I,v,S){this.context=e;let T=this.boundPaintVertexBuffers.length!==o.length;for(let M=0;!T&&M<o.length;M++)this.boundPaintVertexBuffers[M]!==o[M]&&(T=!0);!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==s||T||this.boundIndexBuffer!==u||this.boundVertexOffset!==y||this.boundDynamicVertexBuffer!==I||this.boundDynamicVertexBuffer2!==v||this.boundDynamicVertexBuffer3!==S?this.freshBind(n,s,o,u,y,I,v,S):(e.bindVertexArray.set(this.vao),I&&I.bind(),u&&u.dynamicDraw&&u.bind(),v&&v.bind(),S&&S.bind())}freshBind(e,n,s,o,u,y,I,v){const S=e.numAttributes,T=this.context,M=T.gl;this.vao&&this.destroy(),this.vao=T.createVertexArray(),T.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=s,this.boundIndexBuffer=o,this.boundVertexOffset=u,this.boundDynamicVertexBuffer=y,this.boundDynamicVertexBuffer2=I,this.boundDynamicVertexBuffer3=v,n.enableAttributes(M,e);for(const j of s)j.enableAttributes(M,e);y&&y.enableAttributes(M,e),I&&I.enableAttributes(M,e),v&&v.enableAttributes(M,e),n.bind(),n.setVertexAttribPointers(M,e,u);for(const j of s)j.bind(),j.setVertexAttribPointers(M,e,u);y&&(y.bind(),y.setVertexAttribPointers(M,e,u)),o&&o.bind(),I&&(I.bind(),I.setVertexAttribPointers(M,e,u)),v&&(v.bind(),v.setVertexAttribPointers(M,e,u)),T.currentNumAttributes=S}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const Fr=(A,e,n,s,o)=>({u_matrix:A,u_texture:0,u_ele_delta:e,u_fog_matrix:n,u_fog_color:s?s.properties.get("fog-color"):g.aM.white,u_fog_ground_blend:s?s.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:s?s.calculateFogBlendOpacity(o):0,u_horizon_color:s?s.properties.get("horizon-color"):g.aM.white,u_horizon_fog_blend:s?s.properties.get("horizon-fog-blend"):1});function Zi(A){const e=[];for(let n=0;n<A.length;n++){if(null===A[n])continue;const s=A[n].split(" ");e.push(s.pop())}return e}class Ul{constructor(e,n,s,o,u,y){const I=e.gl;this.program=I.createProgram();const v=Zi(n.staticAttributes),S=s?s.getBinderAttributes():[],T=v.concat(S),M=kn.prelude.staticUniforms?Zi(kn.prelude.staticUniforms):[],j=n.staticUniforms?Zi(n.staticUniforms):[],ee=s?s.getBinderUniforms():[],ae=M.concat(j).concat(ee),Ae=[];for(const Ve of ae)Ae.indexOf(Ve)<0&&Ae.push(Ve);const _e=s?s.defines():[];u&&_e.push("#define OVERDRAW_INSPECTOR;"),y&&_e.push("#define TERRAIN3D;");const we=_e.concat(kn.prelude.fragmentSource,n.fragmentSource).join("\n"),Ce=_e.concat(kn.prelude.vertexSource,n.vertexSource).join("\n"),de=I.createShader(I.FRAGMENT_SHADER);if(I.isContextLost())return void(this.failedToCreate=!0);if(I.shaderSource(de,we),I.compileShader(de),!I.getShaderParameter(de,I.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${I.getShaderInfoLog(de)}`);I.attachShader(this.program,de);const Me=I.createShader(I.VERTEX_SHADER);if(I.isContextLost())return void(this.failedToCreate=!0);if(I.shaderSource(Me,Ce),I.compileShader(Me),!I.getShaderParameter(
vendor: 7,293 bytes, line 3
3Me,I.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${I.getShaderInfoLog(Me)}`);I.attachShader(this.program,Me),this.attributes={};const ze={};this.numAttributes=T.length;for(let Ve=0;Ve<this.numAttributes;Ve++)T[Ve]&&(I.bindAttribLocation(this.program,Ve,T[Ve]),this.attributes[T[Ve]]=Ve);if(I.linkProgram(this.program),!I.getProgramParameter(this.program,I.LINK_STATUS))throw new Error(`Program failed to link: ${I.getProgramInfoLog(this.program)}`);I.deleteShader(Me),I.deleteShader(de);for(let Ve=0;Ve<Ae.length;Ve++){const tt=Ae[Ve];if(tt&&!ze[tt]){const xt=I.getUniformLocation(this.program,tt);xt&&(ze[tt]=xt)}}var Ve,tt;this.fixedUniforms=o(e,ze),this.terrainUniforms={u_depth:new g.aH(Ve=e,(tt=ze).u_depth),u_terrain:new g.aH(Ve,tt.u_terrain),u_terrain_dim:new g.aI(Ve,tt.u_terrain_dim),u_terrain_matrix:new g.aJ(Ve,tt.u_terrain_matrix),u_terrain_unpack:new g.aK(Ve,tt.u_terrain_unpack),u_terrain_exaggeration:new g.aI(Ve,tt.u_terrain_exaggeration)},this.binderUniforms=s?s.getUniforms(e,ze):[]}draw(e,n,s,o,u,y,I,v,S,T,M,j,ee,ae,Ae,_e,we,Ce){const de=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(s),e.setStencilMode(o),e.setColorMode(u),e.setCullFace(y),v){e.activeTexture.set(de.TEXTURE2),de.bindTexture(de.TEXTURE_2D,v.depthTexture),e.activeTexture.set(de.TEXTURE3),de.bindTexture(de.TEXTURE_2D,v.texture);for(const ze in this.terrainUniforms)this.terrainUniforms[ze].set(v[ze])}for(const ze in this.fixedUniforms)this.fixedUniforms[ze].set(I[ze]);Ae&&Ae.setUniforms(e,this.binderUniforms,ee,{zoom:ae});let Me=0;switch(n){case de.LINES:Me=2;break;case de.TRIANGLES:Me=3;break;case de.LINE_STRIP:Me=1}for(const ze of j.get()){const Ve=ze.vaos||(ze.vaos={});(Ve[S]||(Ve[S]=new is)).bind(e,this,T,Ae?Ae.getPaintVertexBuffers():[],M,ze.vertexOffset,_e,we,Ce),de.drawElements(n,ze.primitiveLength*Me,de.UNSIGNED_SHORT,ze.primitiveOffset*Me*2)}}}function Yo(A,e,n){const s=1/zi(n,1,e.transform.tileZoom),o=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,e.transform.tileZoom)/o,y=u*(n.tileID.canonical.x+n.tileID.wrap*o),I=u*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,A.fromScale,A.toScale],u_fade:A.t,u_pixel_coord_upper:[y>>16,I>>16],u_pixel_coord_lower:[65535&y,65535&I]}}const rs=(A,e,n,s)=>{const o=e.style.light,u=o.properties.get("position"),y=[u.x,u.y,u.z],I=(S=new g.A(9),g.A!=Float32Array&&(S[1]=0,S[2]=0,S[3]=0,S[5]=0,S[6]=0,S[7]=0),S[0]=1,S[4]=1,S[8]=1,S);var S;"viewport"===o.properties.get("anchor")&&function(S,T){var M=Math.sin(T),j=Math.cos(T);S[0]=j,S[1]=M,S[2]=0,S[3]=-M,S[4]=j,S[5]=0,S[6]=0,S[7]=0,S[8]=1}(I,-e.transform.angle),function(S,T,M){var j=T[0],ee=T[1],ae=T[2];S[0]=j*M[0]+ee*M[3]+ae*M[6],S[1]=j*M[1]+ee*M[4]+ae*M[7],S[2]=j*M[2]+ee*M[5]+ae*M[8]}(y,y,I);const v=o.properties.get("color");return{u_matrix:A,u_lightpos:y,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[v.r,v.g,v.b],u_vertical_gradient:+n,u_opacity:s}},Ls=(A,e,n,s,o,u,y)=>g.e(rs(A,e,n,s),Yo(u,e,y),{u_height_factor:-Math.pow(2,o.overscaledZ)/y.tileSize/8}),zs=A=>({u_matrix:A}),gc=(A,e,n,s)=>g.e(zs(A),Yo(n,e,s)),Zc=(A,e)=>({u_matrix:A,u_world:e}),Ga=(A,e,n,s,o)=>g.e(gc(A,e,n,s),{u_world:o}),Gl=(A,e,n,s)=>{const o=A.transform;let u,y;if("map"===s.paint.get("circle-pitch-alignment")){const I=zi(n,1,o.zoom);u=!0,y=[I,I]}else u=!1,y=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+("map"===s.paint.get("circle-pitch-scale")),u_matrix:A.translatePosMatrix(e.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+u,u_device_pixel_ratio:A.pixelRatio,u_extrude_scale:y}},On=(A,e,n)=>({u_matrix:A,u_inv_matrix:e,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}),fo=(A,e,n=1)=>({u_matrix:A,u_color:e,u_overlay:0,u_overlay_scale:n}),Kr=A=>({u_matrix:A}),vn=(A,e,n,s)=>({u_matrix:A,u_extrude_scale:zi(e,1,n),u_intensity:s}),Us=(A,e,n,s)=>{const o=g.H();g.aP(o,0,A.width,A.height,0,0,1);const u=A.context.gl;return{u_matrix:o,u_world:[u.drawingBufferWidth,u.drawingBufferHeight],u_image:n,u_color_ramp:s,u_opacity:e.paint.get("heatmap-opacity")}};function po(A,e){const n=Math.pow(2,e.canonical.z),s=e.canonical.y;return[new g.Z(0,s/n).toLngLat().lat,new g.Z(0,(s+1)/n).toLngLat().lat]}const ea=(A,e,n,s)=>{const o=A.transform;return{u_matrix:Ko(A,e,n,s),u_ratio:1/zi(e,1,o.zoom),u_device_pixel_ratio:A.pixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Gs=(A,e,n,s,o)=>g.e(ea(A,e,n,o),{u_image:0,u_image_height:s}),Ea=(A,e,n,s,o)=>{const u=A.transform,y=Zo(e,u);return{u_matrix:Ko(A,e,n,o),u_texsize:e.imageAtlasTexture.size,u_ratio:1/zi(e,1,u.zoom),u_device_pixel_ratio:A.pixelRatio,u_image:0,u_scale:[y,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]]}},Kc=(A,e,n,s,o,u)=>{const y=A.lineAtlas,I=Zo(e,A.transform),v="round"===n.layout.get("line-cap"),S=y.getDash(s.from,v),T=y.getDash(s.to,v),M=S.width*o.fromScale,j=T.width*o.toScale;return g.e(ea(A,e,n,u),{u_patternscale_a:[I/M,-S.height/2],u_patternscale_b:[I/j,-T.height/2],u_sdfgamma:y.width/(256*Math.min(M,j)*A.pixelRatio)/2,u_image:0,u_tex_y_a:S.y,u_tex_y_b:T.y,u_mix:o.t})};function Zo(A,e){return 1/zi(A,1,e.tileZoom)}function Ko(A,e,n,s){return A.translatePosMatrix(s?s.posMatrix:e.tileID.posMatrix,e,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}const mc=(A,e,n,s,o)=>{return{u_matrix:A,u_tl_parent:e,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(y=o.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(u=o.paint.get("raster-contrast"),u>0?1/(1-u):1+u),u_spin_weights:yc(o.paint.get("raster-hue-rotate"))};var u,y};function yc(A){A*=Math.PI/180;const e=Math.sin(A),n=Math.cos(A);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}const Ol=(A,e,n,s,o,u,y,I,v,S,T,M,j,ee)=>{const ae=y.transform;return{u_is_size_zoom_constant:+("constant"===A||"source"===A),u_is_size_feature_constant:+("constant"===A||"camera"===A),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:ae.cameraToCenterDistance,u_pitch:ae.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:ae.width/ae.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_matrix:I,u_label_plane_matrix:v,u_coord_matrix:S,u_is_text:+M,u_pitch_with_map:+s,u_is_along_line:o,u_is_variable_anchor:u,u_texsize:j,u_texture:0,u_translation:T,u_pitched_scale:ee}},ns=(A,e,n,s,o,u,y,I,v,S,T,M,j,ee,ae)=>{const Ae=y.transform;return g.e(Ol(A,e,n,s,o,u,y,I,v,S,T,M,j,ae),{u_gamma_scale:s?Math.cos(Ae._pitch)*Ae.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:+ee})},Os=(A,e,n,s,o,u,y,I,v,S,T,M,j,ee)=>g.e(ns(A,e,n,s,o,u,y,I,v,S,T,!0,M,!0,ee),{u_texsize_icon:j,u_texture_icon:1}),$o=(A,e,n)=>({u_matrix:A,u_opacity:e,u_color:n}),Xo=(A,e,n,s,o,u)=>g.e(function(y,I,v,S){const T=v.imageManager.getPattern(y.from.toString()),M=v.imageManager.getPattern(y.to.toString()),{width:j,height:ee}=v.imageManager.getPixelSize(),ae=Math.pow(2,S.tileID.overscaledZ
vendor: 5,999 bytes, line 3
3),Ae=S.tileSize*Math.pow(2,v.transform.tileZoom)/ae,_e=Ae*(S.tileID.canonical.x+S.tileID.wrap*ae),we=Ae*S.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:T.tl,u_pattern_br_a:T.br,u_pattern_tl_b:M.tl,u_pattern_br_b:M.br,u_texsize:[j,ee],u_mix:I.t,u_pattern_size_a:T.displaySize,u_pattern_size_b:M.displaySize,u_scale_a:I.fromScale,u_scale_b:I.toScale,u_tile_units_to_pixels:1/zi(S,1,v.transform.tileZoom),u_pixel_coord_upper:[_e>>16,we>>16],u_pixel_coord_lower:[65535&_e,65535&we]}}(s,u,n,o),{u_matrix:A,u_opacity:e}),Nl={fillExtrusion:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_lightpos:new g.aN(A,e.u_lightpos),u_lightintensity:new g.aI(A,e.u_lightintensity),u_lightcolor:new g.aN(A,e.u_lightcolor),u_vertical_gradient:new g.aI(A,e.u_vertical_gradient),u_opacity:new g.aI(A,e.u_opacity)}),fillExtrusionPattern:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_lightpos:new g.aN(A,e.u_lightpos),u_lightintensity:new g.aI(A,e.u_lightintensity),u_lightcolor:new g.aN(A,e.u_lightcolor),u_vertical_gradient:new g.aI(A,e.u_vertical_gradient),u_height_factor:new g.aI(A,e.u_height_factor),u_image:new g.aH(A,e.u_image),u_texsize:new g.aO(A,e.u_texsize),u_pixel_coord_upper:new g.aO(A,e.u_pixel_coord_upper),u_pixel_coord_lower:new g.aO(A,e.u_pixel_coord_lower),u_scale:new g.aN(A,e.u_scale),u_fade:new g.aI(A,e.u_fade),u_opacity:new g.aI(A,e.u_opacity)}),fill:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix)}),fillPattern:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_image:new g.aH(A,e.u_image),u_texsize:new g.aO(A,e.u_texsize),u_pixel_coord_upper:new g.aO(A,e.u_pixel_coord_upper),u_pixel_coord_lower:new g.aO(A,e.u_pixel_coord_lower),u_scale:new g.aN(A,e.u_scale),u_fade:new g.aI(A,e.u_fade)}),fillOutline:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_world:new g.aO(A,e.u_world)}),fillOutlinePattern:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_world:new g.aO(A,e.u_world),u_image:new g.aH(A,e.u_image),u_texsize:new g.aO(A,e.u_texsize),u_pixel_coord_upper:new g.aO(A,e.u_pixel_coord_upper),u_pixel_coord_lower:new g.aO(A,e.u_pixel_coord_lower),u_scale:new g.aN(A,e.u_scale),u_fade:new g.aI(A,e.u_fade)}),circle:(A,e)=>({u_camera_to_center_distance:new g.aI(A,e.u_camera_to_center_distance),u_scale_with_map:new g.aH(A,e.u_scale_with_map),u_pitch_with_map:new g.aH(A,e.u_pitch_with_map),u_extrude_scale:new g.aO(A,e.u_extrude_scale),u_device_pixel_ratio:new g.aI(A,e.u_device_pixel_ratio),u_matrix:new g.aJ(A,e.u_matrix)}),collisionBox:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_pixel_extrude_scale:new g.aO(A,e.u_pixel_extrude_scale)}),collisionCircle:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_inv_matrix:new g.aJ(A,e.u_inv_matrix),u_camera_to_center_distance:new g.aI(A,e.u_camera_to_center_distance),u_viewport_size:new g.aO(A,e.u_viewport_size)}),debug:(A,e)=>({u_color:new g.aL(A,e.u_color),u_matrix:new g.aJ(A,e.u_matrix),u_overlay:new g.aH(A,e.u_overlay),u_overlay_scale:new g.aI(A,e.u_overlay_scale)}),clippingMask:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix)}),heatmap:(A,e)=>({u_extrude_scale:new g.aI(A,e.u_extrude_scale),u_intensity:new g.aI(A,e.u_intensity),u_matrix:new g.aJ(A,e.u_matrix)}),heatmapTexture:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_world:new g.aO(A,e.u_world),u_image:new g.aH(A,e.u_image),u_color_ramp:new g.aH(A,e.u_color_ramp),u_opacity:new g.aI(A,e.u_opacity)}),hillshade:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_image:new g.aH(A,e.u_image),u_latrange:new g.aO(A,e.u_latrange),u_light:new g.aO(A,e.u_light),u_shadow:new g.aL(A,e.u_shadow),u_highlight:new g.aL(A,e.u_highlight),u_accent:new g.aL(A,e.u_accent)}),hillshadePrepare:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_image:new g.aH(A,e.u_image),u_dimension:new g.aO(A,e.u_dimension),u_zoom:new g.aI(A,e.u_zoom),u_unpack:new g.aK(A,e.u_unpack)}),line:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_ratio:new g.aI(A,e.u_ratio),u_device_pixel_ratio:new g.aI(A,e.u_device_pixel_ratio),u_units_to_pixels:new g.aO(A,e.u_units_to_pixels)}),lineGradient:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_ratio:new g.aI(A,e.u_ratio),u_device_pixel_ratio:new g.aI(A,e.u_device_pixel_ratio),u_units_to_pixels:new g.aO(A,e.u_units_to_pixels),u_image:new g.aH(A,e.u_image),u_image_height:new g.aI(A,e.u_image_height)}),linePattern:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_texsize:new g.aO(A,e.u_texsize),u_ratio:new g.aI(A,e.u_ratio),u_device_pixel_ratio:new g.aI(A,e.u_device_pixel_ratio),u_image:new g.aH(A,e.u_image),u_units_to_pixels:new g.aO(A,e.u_units_to_pixels),u_scale:new g.aN(A,e.u_scale),u_fade:new g.aI(A,e.u_fade)}),lineSDF:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_ratio:new g.aI(A,e.u_ratio),u_device_pixel_ratio:new g.aI(A,e.u_device_pixel_ratio),u_units_to_pixels:new g.aO(A,e.u_units_to_pixels),u_patternscale_a:new g.aO(A,e.u_patternscale_a),u_patternscale_b:new g.aO(A,e.u_patternscale_b),u_sdfgamma:new g.aI(A,e.u_sdfgamma),u_image:new g.aH(A,e.u_image),u_tex_y_a:new g.aI(A,e.u_tex_y_a),u_tex_y_b:new g.aI(A,e.u_tex_y_b),u_mix:new g.aI(A,e.u_mix)}),raster:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_tl_parent:new g.aO(A,e.u_tl_parent),u_scale_parent:new g.aI(A,e.u_scale_parent),u_buffer_scale:new g.aI(A,e.u_buffer_scale),u_fade_t:new g.aI(A,e.u_fade_t),u_opacity:new g.aI(A,e.u_opacity),u_image0:new g.aH(A,e.u_image0),u_image1:new g.aH(A,e.u_image1),u_brightness_low:new g.aI(A,e.u_brightness_low),u_brightness_high:new g.aI(A,e.u_brightness_high),u_saturation_factor:new g.aI(A,e.u_saturation_factor),u_contrast_factor:new g.aI(A,e.u_contrast_factor),u_spin_weights:new g.aN(A,e.u_spin_weights)}),symbolIcon:(A,e)=>({u_is_size_zoom_constant:new g.aH(A,e.u_is_size_zoom_constant),u_is_size_feature_constant:new g.aH(A,e.u_is_size_feature_constant),u_size_t:new g.aI(A,e.u_size_t),u_size:new g.aI(A,e.u_size),u_camera_to_center_distance:new g.aI(A,e.u_camera_to_center_distance),u_pitch:new g.aI(A,e.u_pitch),u_rotate_symbol:new g.aH(A,e.u_rotate_symbol),u_aspect_ratio:new g.aI(A,e.u_aspect_ratio),u_fade_change:new g.aI(A,e.u_fade_change),u_matrix:new g.aJ(A,e.u_matrix),u_label_plane_matrix:new g.aJ(A,e.u_label_plane_matrix
vendor: 5,703 bytes, line 3
3),u_coord_matrix:new g.aJ(A,e.u_coord_matrix),u_is_text:new g.aH(A,e.u_is_text),u_pitch_with_map:new g.aH(A,e.u_pitch_with_map),u_is_along_line:new g.aH(A,e.u_is_along_line),u_is_variable_anchor:new g.aH(A,e.u_is_variable_anchor),u_texsize:new g.aO(A,e.u_texsize),u_texture:new g.aH(A,e.u_texture),u_translation:new g.aO(A,e.u_translation),u_pitched_scale:new g.aI(A,e.u_pitched_scale)}),symbolSDF:(A,e)=>({u_is_size_zoom_constant:new g.aH(A,e.u_is_size_zoom_constant),u_is_size_feature_constant:new g.aH(A,e.u_is_size_feature_constant),u_size_t:new g.aI(A,e.u_size_t),u_size:new g.aI(A,e.u_size),u_camera_to_center_distance:new g.aI(A,e.u_camera_to_center_distance),u_pitch:new g.aI(A,e.u_pitch),u_rotate_symbol:new g.aH(A,e.u_rotate_symbol),u_aspect_ratio:new g.aI(A,e.u_aspect_ratio),u_fade_change:new g.aI(A,e.u_fade_change),u_matrix:new g.aJ(A,e.u_matrix),u_label_plane_matrix:new g.aJ(A,e.u_label_plane_matrix),u_coord_matrix:new g.aJ(A,e.u_coord_matrix),u_is_text:new g.aH(A,e.u_is_text),u_pitch_with_map:new g.aH(A,e.u_pitch_with_map),u_is_along_line:new g.aH(A,e.u_is_along_line),u_is_variable_anchor:new g.aH(A,e.u_is_variable_anchor),u_texsize:new g.aO(A,e.u_texsize),u_texture:new g.aH(A,e.u_texture),u_gamma_scale:new g.aI(A,e.u_gamma_scale),u_device_pixel_ratio:new g.aI(A,e.u_device_pixel_ratio),u_is_halo:new g.aH(A,e.u_is_halo),u_translation:new g.aO(A,e.u_translation),u_pitched_scale:new g.aI(A,e.u_pitched_scale)}),symbolTextAndIcon:(A,e)=>({u_is_size_zoom_constant:new g.aH(A,e.u_is_size_zoom_constant),u_is_size_feature_constant:new g.aH(A,e.u_is_size_feature_constant),u_size_t:new g.aI(A,e.u_size_t),u_size:new g.aI(A,e.u_size),u_camera_to_center_distance:new g.aI(A,e.u_camera_to_center_distance),u_pitch:new g.aI(A,e.u_pitch),u_rotate_symbol:new g.aH(A,e.u_rotate_symbol),u_aspect_ratio:new g.aI(A,e.u_aspect_ratio),u_fade_change:new g.aI(A,e.u_fade_change),u_matrix:new g.aJ(A,e.u_matrix),u_label_plane_matrix:new g.aJ(A,e.u_label_plane_matrix),u_coord_matrix:new g.aJ(A,e.u_coord_matrix),u_is_text:new g.aH(A,e.u_is_text),u_pitch_with_map:new g.aH(A,e.u_pitch_with_map),u_is_along_line:new g.aH(A,e.u_is_along_line),u_is_variable_anchor:new g.aH(A,e.u_is_variable_anchor),u_texsize:new g.aO(A,e.u_texsize),u_texsize_icon:new g.aO(A,e.u_texsize_icon),u_texture:new g.aH(A,e.u_texture),u_texture_icon:new g.aH(A,e.u_texture_icon),u_gamma_scale:new g.aI(A,e.u_gamma_scale),u_device_pixel_ratio:new g.aI(A,e.u_device_pixel_ratio),u_is_halo:new g.aH(A,e.u_is_halo),u_translation:new g.aO(A,e.u_translation),u_pitched_scale:new g.aI(A,e.u_pitched_scale)}),background:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_opacity:new g.aI(A,e.u_opacity),u_color:new g.aL(A,e.u_color)}),backgroundPattern:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_opacity:new g.aI(A,e.u_opacity),u_image:new g.aH(A,e.u_image),u_pattern_tl_a:new g.aO(A,e.u_pattern_tl_a),u_pattern_br_a:new g.aO(A,e.u_pattern_br_a),u_pattern_tl_b:new g.aO(A,e.u_pattern_tl_b),u_pattern_br_b:new g.aO(A,e.u_pattern_br_b),u_texsize:new g.aO(A,e.u_texsize),u_mix:new g.aI(A,e.u_mix),u_pattern_size_a:new g.aO(A,e.u_pattern_size_a),u_pattern_size_b:new g.aO(A,e.u_pattern_size_b),u_scale_a:new g.aI(A,e.u_scale_a),u_scale_b:new g.aI(A,e.u_scale_b),u_pixel_coord_upper:new g.aO(A,e.u_pixel_coord_upper),u_pixel_coord_lower:new g.aO(A,e.u_pixel_coord_lower),u_tile_units_to_pixels:new g.aI(A,e.u_tile_units_to_pixels)}),terrain:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_texture:new g.aH(A,e.u_texture),u_ele_delta:new g.aI(A,e.u_ele_delta),u_fog_matrix:new g.aJ(A,e.u_fog_matrix),u_fog_color:new g.aL(A,e.u_fog_color),u_fog_ground_blend:new g.aI(A,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new g.aI(A,e.u_fog_ground_blend_opacity),u_horizon_color:new g.aL(A,e.u_horizon_color),u_horizon_fog_blend:new g.aI(A,e.u_horizon_fog_blend)}),terrainDepth:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_ele_delta:new g.aI(A,e.u_ele_delta)}),terrainCoords:(A,e)=>({u_matrix:new g.aJ(A,e.u_matrix),u_texture:new g.aH(A,e.u_texture),u_terrain_coords_id:new g.aI(A,e.u_terrain_coords_id),u_ele_delta:new g.aI(A,e.u_ele_delta)}),sky:(A,e)=>({u_sky_color:new g.aL(A,e.u_sky_color),u_horizon_color:new g.aL(A,e.u_horizon_color),u_horizon:new g.aI(A,e.u_horizon),u_sky_horizon_blend:new g.aI(A,e.u_sky_horizon_blend)})};class ta{constructor(e,n,s){this.context=e;const o=e.gl;this.buffer=o.createBuffer(),this.dynamicDraw=!!s,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),o.bufferData(o.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const $c={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class ql{constructor(e,n,s,o){this.length=n.length,this.attributes=s,this.itemSize=n.bytesPerElement,this.dynamicDraw=o,this.context=e;const u=e.gl;this.buffer=u.createBuffer(),e.bindVertexBuffer.set(this.buffer),u.bufferData(u.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?u.DYNAMIC_DRAW:u.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,e.arrayBuffer)}
vendor: 36,395 bytes, line 3
3enableAttributes(e,n){for(let s=0;s<this.attributes.length;s++){const o=n.attributes[this.attributes[s].name];void 0!==o&&e.enableVertexAttribArray(o)}}setVertexAttribPointers(e,n,s){for(let o=0;o<this.attributes.length;o++){const u=this.attributes[o],y=n.attributes[u.name];void 0!==y&&e.vertexAttribPointer(y,u.components,e[$c[u.type]],!1,this.itemSize,u.offset+this.itemSize*(s||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const as=new WeakMap;function ia(A){var e;if(as.has(A))return as.get(A);{const n=null===(e=A.getParameter(A.VERSION))||void 0===e?void 0:e.startsWith("WebGL 2.0");return as.set(A,n),n}}class Ki{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class go extends Ki{getDefault(){return g.aM.transparent}set(e){const n=this.current;(e.r!==n.r||e.g!==n.g||e.b!==n.b||e.a!==n.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Vl extends Ki{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class ss extends Ki{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class mo extends Ki{getDefault(){return[!0,!0,!0,!0]}set(e){const n=this.current;(e[0]!==n[0]||e[1]!==n[1]||e[2]!==n[2]||e[3]!==n[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Ns extends Ki{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class Wo extends Ki{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class os extends Ki{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const n=this.current;(e.func!==n.func||e.ref!==n.ref||e.mask!==n.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class ls extends Ki{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const n=this.current;(e[0]!==n[0]||e[1]!==n[1]||e[2]!==n[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class ra extends Ki{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;e?n.enable(n.STENCIL_TEST):n.disable(n.STENCIL_TEST),this.current=e,this.dirty=!1}}class _c extends Ki{getDefault(){return[0,1]}set(e){const n=this.current;(e[0]!==n[0]||e[1]!==n[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class Ic extends Ki{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;e?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),this.current=e,this.dirty=!1}}class bc extends Ki{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class cs extends Ki{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;e?n.enable(n.BLEND):n.disable(n.BLEND),this.current=e,this.dirty=!1}}class wc extends Ki{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const n=this.current;(e[0]!==n[0]||e[1]!==n[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class Xc extends Ki{getDefault(){return g.aM.transparent}set(e){const n=this.current;(e.r!==n.r||e.g!==n.g||e.b!==n.b||e.a!==n.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class vc extends Ki{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class qs extends Ki{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;e?n.enable(n.CULL_FACE):n.disable(n.CULL_FACE),this.current=e,this.dirty=!1}}class xc extends Ki{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class yo extends Ki{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class _o extends Ki{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class Bc extends Ki{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class Io extends Ki{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const n=this.current;(e[0]!==n[0]||e[1]!==n[1]||e[2]!==n[2]||e[3]!==n[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class el extends Ki{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class fn extends Ki{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.bindRenderbuffer(n.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class tl extends Ki{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.bindTexture(n.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class Hl extends Ki{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.bindBuffer(n.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class hs extends Ki{getDefault(){return null}set(e){const n=this.gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class pn extends Ki{getDefault(){return null}set(e){var n;if(e===this.current&&!this.dirty)return;const s=this.gl;ia(s)?s.bindVertexArray(e):null===(n=s.getExtension("OES_vertex_array_object"))||void 0===n||n.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Qa extends Ki{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class il extends Ki{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class rl extends Ki{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const n=this.gl;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class xn extends Ki{constructor(e,n){super(e),this.context=e,this.parent=n}getDefault(){return null}}class nl extends xn{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class ga extends xn{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class bo extends xn{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Jl{constructor(e,n,s,o,u){this.context=e,this.width=n,this.height=s;const y=e.gl,I=this.framebuffer=y.createFramebuffer();if(this.colorAttachment=new nl(e,I),o)this.depthAttachment=u?new bo(e,I):new ga(e,I);else if(u)throw new Error("Stencil cannot be set without depth");if(y.checkFramebufferStatus(y.FRAMEBUFFER)!==y.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const e=this.context.gl,n=this.colorAttachment.get();if(n&&e.deleteTexture(n),this.depthAttachment){const s=this.depthAttachment.get();s&&e.deleteRenderbuffer(s)}e.deleteFramebuffer(this.framebuffer)}}class Er{constructor(e,n,s){this.blendFunction=e,this.blendColor=n,this.mask=s}}Er.Replace=[1,0],Er.disabled=new Er(Er.Replace,g.aM.transparent,[!1,!1,!1,!1]),Er.unblended=new Er(Er.Replace,g.aM.transparent,[!0,!0,!0,!0]),Er.alphaBlended=new Er([1,771],g.aM.transparent,[!0,!0,!0,!0]);class Cc{constructor(e){var n,s;if(this.gl=e,this.clearColor=new go(this),this.clearDepth=new Vl(this),this.clearStencil=new ss(this),this.colorMask=new mo(this),this.depthMask=new Ns(this),this.stencilMask=new Wo(this),this.stencilFunc=new os(this),this.stencilOp=new ls(this),this.stencilTest=new ra(this),this.depthRange=new _c(this),this.depthTest=new Ic(this),this.depthFunc=new bc(this),this.blend=new cs(this),this.blendFunc=new wc(this),this.blendColor=new Xc(this),this.blendEquation=new vc(this),this.cullFace=new qs(this),this.cullFaceSide=new xc(this),this.frontFace=new yo(this),this.program=new _o(this),this.activeTexture=new Bc(this),this.viewport=new Io(this),this.bindFramebuffer=new el(this),this.bindRenderbuffer=new fn(this),this.bindTexture=new tl(this),this.bindVertexBuffer=new Hl(this),this.bindElementBuffer=new hs(this),this.bindVertexArray=new pn(this),this.pixelStoreUnpack=new Qa(this),this.pixelStoreUnpackPremultiplyAlpha=new il(this),this.pixelStoreUnpackFlipY=new rl(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),ia(e)){this.HALF_FLOAT=e.HALF_FLOAT;const o=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(n=e.RGBA16F)&&void 0!==n?n:o?.RGBA16F_EXT,this.RGB16F=null!==(s=e.RGB16F)&&void 0!==s?s:o?.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const o=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=o?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,n){return new ta(this,e,n)}createVertexBuffer(e,n,s){return new ql(this,e,n,s)}createRenderbuffer(e,n,s){const o=this.gl,u=o.createRenderbuffer();return this.bindRenderbuffer.set(u),o.renderbufferStorage(o.RENDERBUFFER,e,n,s),this.bindRenderbuffer.set(null),u}createFramebuffer(e,n,s,o){return new Jl(this,e,n,s,o)}clear({color:e,depth:n,stencil:s}){const o=this.gl;let u=0;e&&(u|=o.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==n&&(u|=o.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),void 0!==s&&(u|=o.STENCIL_BUFFER_BIT,this.clearStencil.set(s),this.stencilMask.set(255)),o.clear(u)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){g.aE(e.blendFunction,Er.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return ia(this.gl)?this.gl.createVertexArray():null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var n;return ia(this.gl)?this.gl.deleteVertexArray(e):null===(n=this.gl.getExtension("OES_vertex_array_object"))||void 0===n?void 0:n.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}class Fi{constructor(e,n,s){this.func=e,this.mask=n,this.range=s}}Fi.ReadOnly=!1,Fi.ReadWrite=!0,Fi.disabled=new Fi(519,Fi.ReadOnly,[0,1]);class Ar{constructor(e,n,s,o,u,y){this.test=e,this.ref=n,this.mask=s,this.fail=o,this.depthFail=u,this.pass=y}}Ar.disabled=new Ar({func:519,mask:0},0,0,7680,7680,7680);class lr{constructor(e,n,s){this.enable=e,this.mode=n,this.frontFace=s}}let ma;function wo(A,e,n,s,o){const u=A.context,y=u.gl,I=A.useProgram("collisionBox"),v=[];let S=0,T=0;for(let we=0;we<s.length;we++){const Ce=s[we],de=e.getTile(Ce).getBucket(n);if(!de)continue;const Me=o?de.textCollisionBox:de.iconCollisionBox,ze=de.collisionCircleArray;if(ze.length>0){const Ve=g.H();g.aQ(Ve,de.placementInvProjMatrix,A.transform.glCoordMatrix),g.aQ(Ve,Ve,de.placementViewportMatrix),v.push({circleArray:ze,circleOffset:T,transform:Ce.posMatrix,invTransform:Ve,coord:Ce}),S+=ze.length/4,T=S}Me&&I.draw(u,y.LINES,Fi.disabled,Ar.disabled,A.colorModeForRenderPass(),lr.disabled,{u_matrix:Ce.posMatrix,u_pixel_extrude_scale:[1/(M=A.transform).width,1/M.height]},A.style.map.terrain&&A.style.map.terrain.getTerrainData(Ce),n.id,Me.layoutVertexBuffer,Me.indexBuffer,Me.segments,null,A.transform.zoom,null,null,Me.collisionVertexBuffer)}var M;if(!o||!v.length)return;const j=A.useProgram("collisionCircle"),ee=new g.aR;ee.resize(4*S),ee._trim();let ae=0;for(const we of v)for(let Ce=0;Ce<we.circleArray.length/4;Ce++){const de=4*Ce,Me=we.circleArray[de+0],ze=we.circleArray[de+1],Ve=we.circleArray[de+2],tt=we.circleArray[de+3];ee.emplace(ae++,Me,ze,Ve,tt,0),ee.emplace(ae++,Me,ze,Ve,tt,1),ee.emplace(ae++,Me,ze,Ve,tt,2),ee.emplace(ae++,Me,ze,Ve,tt,3)}(!ma||ma.length<2*S)&&(ma=function(we){const Ce=2*we,de=new g.aT;de.resize(Ce),de._trim();for(let Me=0;Me<Ce;Me++){const ze=6*Me;de.uint16[ze+0]=4*Me+0,de.uint16[ze+1]=4*Me+1,de.uint16[ze+2]=4*Me+2,de.uint16[ze+3]=4*Me+2,de.uint16[ze+4]=4*Me+3,de.uint16[ze+5]=4*Me+0}return de}(S));const Ae=u.createIndexBuffer(ma,!0),_e=u.createVertexBuffer(ee,g.aS.members,!0);for(const we of v){const Ce=On(we.transform,we.invTransform,A.transform);j.draw(u,y.TRIANGLES,Fi.disabled,Ar.disabled,A.colorModeForRenderPass(),lr.disabled,Ce,A.style.map.terrain&&A.style.map.terrain.getTerrainData(we.coord),n.id,_e,Ae,g.a0.simpleSegment(0,2*we.circleOffset,we.circleArray.length,we.circleArray.length/2),null,A.transform.zoom,null,null,null)}_e.destroy(),Ae.destroy()}lr.disabled=new lr(!1,1029,2305),lr.backCCW=new lr(!0,1029,2305);const us=g.an(new Float32Array(16));function vo(A,e,n,s,o,u){const{horizontalAlign:y,verticalAlign:I}=g.au(A);return new g.P((-(y-.5)*e/o+s[0])*u,(-(I-.5)*n/o+s[1])*u)}function As(A,e,n,s,o,u){const y=e.tileAnchorPoint.add(new g.P(e.translation[0],e.translation[1]));if(e.pitchWithMap){let I=s.mult(u);n||(I=I.rotate(-o));const v=y.add(I);return me(v.x,v.y,e.labelPlaneMatrix,e.getElevation).point}if(n){const I=rt(e.tileAnchorPoint.x+1,e.tileAnchorPoint.y,e).point.sub(A),v=Math.atan(I.y/I.x)+(I.x<0?Math.PI:0);return A.add(s.rotate(v))}return A.add(s)}function Oa(A,e,n,s,o,u,y,I,v,S,T,M,j,ee){const ae=A.text.placedSymbolArray,Ae=A.text.dynamicLayoutVertexArray,_e=A.icon.dynamicLayoutVertexArray,we={};Ae.clear();for(let Ce=0;Ce<ae.length;Ce++){const de=ae.get(Ce),Me=de.hidden||!de.crossTileID||A.allowVerticalPlacement&&!de.placedOrientation?null:s[de.crossTileID];if(Me){const ze=new g.P(de.anchorX,de.anchorY),Ve={getElevation:ee,width:o.width,height:o.height,labelPlaneMatrix:u,lineVertexArray:null,pitchWithMap:n,projection:T,projectionCache:null,tileAnchorPoint:ze,translation:M,unwrappedTileID:j},tt=n?me(ze.x,ze.y,y,ee):rt(ze.x,ze.y,Ve),xt=O(o.cameraToCenterDistance,tt.signedDistanceFromCamera);let Pt=g.ai(A.textSizeData,v,de)*xt/g.ap;n&&(Pt*=A.tilePixelRatio/I);const{width:Ot,height:St,anchor:Mt,textOffset:jt,textBoxScale:pi}=Me,Et=vo(Mt,Ot,St,jt,pi,Pt),Ft=T.getPitchedTextCorrection(o,ze.add(new g.P(M[0],M[1])),j),_i=As(tt.point,Ve,e,Et,o.angle,Ft),ar=A.allowVerticalPlacement&&de.placedOrientation===g.ah.vertical?Math.PI/2:0;for(let Mi=0;Mi<de.numGlyphs;Mi++)g.aj(Ae,_i,ar);S&&de.associatedIconIndex>=0&&(we[de.associatedIconIndex]={shiftedAnchor:_i,angle:ar})}else hi(de.numGlyphs,Ae)}if(S){_e.clear();const Ce=A.icon.placedSymbolArray;for(let de=0;de<Ce.length;de++){const Me=Ce.get(de);if(Me.hidden)hi(Me.numGlyphs,_e);else{const ze=we[de];if(ze)for(let Ve=0;Ve<Me.numGlyphs;Ve++)g.aj(_e,ze.shiftedAnchor,ze.angle);else hi(Me.numGlyphs,_e)}}A.icon.dynamicLayoutVertexBuffer.updateData(_e)}A.text.dynamicLayoutVertexBuffer.updateData(Ae)}function Nn(A,e,n){return n.iconsInText&&e?"symbolTextAndIcon":A?"symbolSDF":"symbolIcon"}function jl(A,e,n,s,o,u,y,I,v,S,T,M){const j=A.context,ee=j.gl,ae=A.transform,Ae=xr(),_e="map"===I,we="map"===v,Ce="viewport"!==I&&"point"!==n.layout.get("symbol-placement"),de=_e&&!we&&!Ce,Me=!we&&Ce,ze=!n.layout.get("symbol-sort-key").isConstant();let Ve=!1;const tt=A.depthModeForSublayer(0,Fi.ReadOnly),xt=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Pt=[],Ot=Ae.getCircleRadiusCorrection(ae);for(const St of s){const Mt=e.getTile(St),jt=Mt.getBucket(n);if(!jt)continue;const pi=o?jt.text:jt.icon;if(!pi||!pi.segments.get().length||!pi.hasVisibleVertices)continue;const Et=pi.programConfigurations.get(n.id),Ft=o||jt.sdfIcons,_i=o?jt.textSizeData:jt.iconSizeData,ar=we||0!==ae.pitch,Mi=A.useProgram(Nn(Ft,o,jt),Et),Gi=g.ag(_i,ae.zoom),dr=A.style.map.terrain&&A.style.map.terrain.getTerrainData(St);let on,mn,yr,Wr,ln=[0,0],zr=null;if(o)mn=Mt.glyphAtlasTexture,yr=ee.LINEAR,on=Mt.glyphAtlasTexture.size,jt.iconsInText&&(ln=Mt.imageAtlasTexture.size,zr=Mt.imageAtlasTexture,Wr=ar||A.options.rotating||A.options.zooming||"composite"===_i.kind||"camera"===_i.kind?ee.LINEAR:ee.NEAREST);else{const Ui=1!==n.layout.get("icon-size").constantOr(0)||jt.iconsNeedLinear;mn=Mt.imageAtlasTexture,yr=Ft||A.options.rotating||A.options.zooming||Ui||ar?ee.LINEAR:ee.NEAREST,on=Mt.imageAtlasTexture.size}const Nr=zi(Mt,1,A.transform.zoom),oa=Me?St.posMatrix:us,Ss=Un(oa,we,_e,A.transform,Nr),Cl=Gn(oa,we,_e,A.transform,Nr),Ws=Gn(St.posMatrix,we,_e,A.transform,Nr),Hn=Ae.translatePosition(A.transform,Mt,u,y),El=xt&&jt.hasTextData(),eo="none"!==n.layout.get("icon-text-fit")&&El&&jt.hasIconData();if(Ce){const Ui=A.style.map.terrain?(to,io)=>A.style.map.terrain.getElevation(St,to,io):null,Ds="map"===n.layout.get("text-rotation-alignment");W(jt,St.posMatrix,A,o,Ss,Ws,we,S,Ds,Ae,St.toUnwrapped(),ae.width,ae.height,Hn,Ui)}const Jn=St.posMatrix,jn=o&&xt||eo,Ja=Ce||jn?us:Ss,la=Cl,qr=Ft&&0!==n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let Vr;Vr=Ft?jt.iconsInText?Os(_i.kind,Gi,de,we,Ce,jn,A,Jn,Ja,la,Hn,on,ln,Ot):ns(_i.kind,Gi,de,we,Ce,jn,A,Jn,Ja,la,Hn,o,on,!0,Ot):Ol(_i.kind,Gi,de,we,Ce,jn,A,Jn,Ja,la,Hn,o,on,Ot);const Tn={program:Mi,buffers:pi,uniformValues:Vr,atlasTexture:mn,atlasTextureIcon:zr,atlasInterpolation:yr,atlasInterpolationIcon:Wr,isSDF:Ft,hasHalo:qr};if(ze&&jt.canOverlap){Ve=!0;const Ui=pi.segments.get();for(const Ds of Ui)Pt.push({segments:new g.a0([Ds]),sortKey:Ds.sortKey,state:Tn,terrainData:dr})}else Pt.push({segments:pi.segments,sortKey:0,state:Tn,terrainData:dr})}Ve&&Pt.sort((St,Mt)=>St.sortKey-Mt.sortKey);for(const St of Pt){const Mt=St.state;if(j.activeTexture.set(ee.TEXTURE0),Mt.atlasTexture.bind(Mt.atlasInterpolation,ee.CLAMP_TO_EDGE),Mt.atlasTextureIcon&&(j.activeTexture.set(ee.TEXTURE1),Mt.atlasTextureIcon&&Mt.atlasTextureIcon.bind(Mt.atlasInterpolationIcon,ee.CLAMP_TO_EDGE)),Mt.isSDF){const jt=Mt.uniformValues;Mt.hasHalo&&(jt.u_is_halo=1,sl(Mt.buffers,St.segments,n,A,Mt.program,tt,T,M,jt,St.terrainData)),jt.u_is_halo=0}sl(Mt.buffers,St.segments,n,A,Mt.program,tt,T,M,Mt.uniformValues,St.terrainData)}}function sl(A,e,n,s,o,u,y,I,v,S){const T=s.context;o.draw(T,T.gl.TRIANGLES,u,y,I,lr.disabled,v,S,n.id,A.layoutVertexBuffer,A.indexBuffer,e,n.paint,s.transform.zoom,A.programConfigurations.get(n.id),A.dynamicLayoutVertexBuffer,A.opacityVertexBuffer)}function Na(A,e,n,s){const o=A.context,u=o.gl,y=Ar.disabled,I=new Er([u.ONE,u.ONE],g.aM.transparent,[!0,!0,!0,!0]),v=e.getBucket(n);if(!v)return;const S=s.key;let T=n.heatmapFbos.get(S);T||(T=xo(o,e.tileSize,e.tileSize),n.heatmapFbos.set(S,T)),o.bindFramebuffer.set(T.framebuffer),o.viewport.set([0,0,e.tileSize,e.tileSize]),o.clear({color:g.aM.transparent});const M=v.programConfigurations.get(n.id),j=A.useProgram("heatmap",M),ee=A.style.map.terrain.getTerrainData(s);j.draw(o,u.TRIANGLES,Fi.disabled,y,I,lr.disabled,vn(s.posMatrix,e,A.transform.zoom,n.paint.get("heatmap-intensity")),ee,n.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,n.paint,A.transform.zoom,M)}function Sa(A,e,n){const s=A.context,o=s.gl;s.setColorMode(A.colorModeForRenderPass());const u=Bo(s,e),y=n.key,I=e.heatmapFbos.get(y);I&&(s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,I.colorAttachment.get()),s.activeTexture.set(o.TEXTURE1),u.bind(o.LINEAR,o.CLAMP_TO_EDGE),A.useProgram("heatmapTexture").draw(s,o.TRIANGLES,Fi.disabled,Ar.disabled,A.colorModeForRenderPass(),lr.disabled,Us(A,e,0,1),null,e.id,A.rasterBoundsBuffer,A.quadTriangleIndexBuffer,A.rasterBoundsSegments,e.paint,A.transform.zoom),I.destroy(),e.heatmapFbos.delete(y))}function xo(A,e,n){var s,o;const u=A.gl,y=u.createTexture();u.bindTexture(u.TEXTURE_2D,y),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.LINEAR);const I=null!==(s=A.HALF_FLOAT)&&void 0!==s?s:u.UNSIGNED_BYTE,v=null!==(o=A.RGBA16F)&&void 0!==o?o:u.RGBA;u.texImage2D(u.TEXTURE_2D,0,v,e,n,0,u.RGBA,I,null);const S=A.createFramebuffer(e,n,!1,!1);return S.colorAttachment.set(y),S}function Bo(A,e){return e.colorRampTexture||(e.colorRampTexture=new mt(A,e.colorRamp,A.gl.RGBA)),e.colorRampTexture}function Vs(A,e,n,s,o){if(!n||!s||!s.imageAtlas)return;const u=s.imageAtlas.patternPositions;let y=u[n.to.toString()],I=u[n.from.toString()];if(!y&&I&&(y=I),!I&&y&&(I=y),!y||!I){const v=o.getPaintProperty(e);y=u[v],I=u[v]}y&&I&&A.setConstantPatternPositions(y,I)}function qa(A,e,n,s,o,u,y){const I=A.context.gl,v="fill-pattern",S=n.paint.get(v),T=S&&S.constantOr(1),M=n.getCrossfadeParameters();let j,ee,ae,Ae,_e;y?(ee=T&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",j=I.LINES):(ee=T?"fillPattern":"fill",j=I.TRIANGLES);const we=S.constantOr(null);for(const Ce of s){const de=e.getTile(Ce);if(T&&!de.patternsLoaded())continue;const Me=de.getBucket(n);if(!Me)continue;const ze=Me.programConfigurations.get(n.id),Ve=A.useProgram(ee,ze),tt=A.style.map.terrain&&A.style.map.terrain.getTerrainData(Ce);T&&(A.context.activeTexture.set(I.TEXTURE0),de.imageAtlasTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),ze.updatePaintBuffers(M)),Vs(ze,v,we,de,n);const xt=tt?Ce:null,Pt=A.translatePosMatrix(xt?xt.posMatrix:Ce.posMatrix,de,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(y){Ae=Me.indexBuffer2,_e=Me.segments2;const Ot=[I.drawingBufferWidth,I.drawingBufferHeight];ae="fillOutlinePattern"===ee&&T?Ga(Pt,A,M,de,Ot):Zc(Pt,Ot)}else Ae=Me.indexBuffer,_e=Me.segments,ae=T?gc(Pt,A,M,de):zs(Pt);Ve.draw(A.context,j,o,A.stencilModeForClipping(Ce),u,lr.disabled,ae,tt,n.id,Me.layoutVertexBuffer,Ae,_e,n.paint,A.transform.zoom,ze)}}function Da(A,e,n,s,o,u,y){const I=A.context,v=I.gl,S="fill-extrusion-pattern",T=n.paint.get(S),M=T.constantOr(1),j=n.getCrossfadeParameters(),ee=n.paint.get("fill-extrusion-opacity"),ae=T.constantOr(null);for(const Ae of s){const _e=e.getTile(Ae),we=_e.getBucket(n);if(!we)continue;const Ce=A.style.map.terrain&&A.style.map.terrain.getTerrainData(Ae),de=we.programConfigurations.get(n.id),Me=A.useProgram(M?"fillExtrusionPattern":"fillExtrusion",de);M&&(A.context.activeTexture.set(v.TEXTURE0),_e.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),de.updatePaintBuffers(j)),Vs(de,S,ae,_e,n);const ze=A.translatePosMatrix(Ae.posMatrix,_e,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),Ve=n.paint.get("fill-extrusion-vertical-gradient"),tt=M?Ls(ze,A,Ve,ee,Ae,j,_e):rs(ze,A,Ve,ee);Me.draw(I,I.gl.TRIANGLES,o,u,y,lr.backCCW,tt,Ce,n.id,we.layoutVertexBuffer,we.indexBuffer,we.segments,n.paint,A.transform.zoom,de,A.style.map.terrain&&we.centroidVertexBuffer)}}function ds(A,e,n,s,o,u,y){const I=A.context,v=I.gl,S=n.fbo;if(!S)return;const T=A.useProgram("hillshade"),M=A.style.map.terrain&&A.style.map.terrain.getTerrainData(e);I.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,S.colorAttachment.get()),T.draw(I,v.TRIANGLES,o,u,y,lr.disabled,((j,ee,ae,Ae)=>{const _e=ae.paint.get("hillshade-shadow-color"),we=ae.paint.get("hillshade-highlight-color"),Ce=ae.paint.get("hillshade-accent-color");let de=ae.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===ae.paint.get("hillshade-illumination-anchor")&&(de-=j.transform.angle);const Me=!j.options.moving;return{u_matrix:Ae?Ae.posMatrix:j.transform.calculatePosMatrix(ee.tileID.toUnwrapped(),Me),u_image:0,u_latrange:po(0,ee.tileID),u_light:[ae.paint.get("hillshade-exaggeration"),de],u_shadow:_e,u_highlight:we,u_accent:Ce}})(A,n,s,M?e:null),M,s.id,A.rasterBoundsBuffer,A.quadTriangleIndexBuffer,A.rasterBoundsSegments)}function Hs(A,e,n,s,o,u){const y=A.context,I=y.gl,v=e.dem;if(v&&v.data){const S=v.dim,T=v.stride,M=v.getPixels();if(y.activeTexture.set(I.TEXTURE1),y.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||A.getTileTexture(T),e.demTexture){const ee=e.demTexture;ee.update(M,{premultiply:!1}),ee.bind(I.NEAREST,I.CLAMP_TO_EDGE)}else e.demTexture=new mt(y,M,I.RGBA,{premultiply:!1}),e.demTexture.bind(I.NEAREST,I.CLAMP_TO_EDGE);y.activeTexture.set(I.TEXTURE0);let j=e.fbo;if(!j){const ee=new mt(y,{width:S,height:S,data:null},I.RGBA);ee.bind(I.LINEAR,I.CLAMP_TO_EDGE),j=e.fbo=y.createFramebuffer(S,S,!0,!1),j.colorAttachment.set(ee.texture)}y.bindFramebuffer.set(j.framebuffer),y.viewport.set([0,0,S,S]),A.useProgram("hillshadePrepare").draw(y,I.TRIANGLES,s,o,u,lr.disabled,((ee,ae)=>{const Ae=ae.stride,_e=g.H();return g.aP(_e,0,g.X,-g.X,0,0,1),g.J(_e,_e,[0,-g.X,0]),{u_matrix:_e,u_image:1,u_dimension:[Ae,Ae],u_zoom:ee.overscaledZ,u_unpack:ae.getUnpackVector()}})(e.tileID,v),null,n.id,A.rasterBoundsBuffer,A.quadTriangleIndexBuffer,A.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function Co(A,e,n,s,o,u){const y=s.paint.get("raster-fade-duration");if(!u&&y>0){const I=at.now(),v=(I-A.timeAdded)/y,S=e?(I-e.timeAdded)/y:-1,T=n.getSource(),M=o.coveringZoomLevel({tileSize:T.tileSize,roundZoom:T.roundZoom}),j=!e||Math.abs(e.tileID.overscaledZ-M)>Math.abs(A.tileID.overscaledZ-M),ee=j&&A.refreshedUponExpiration?1:g.ac(j?v:1-S,0,1);return A.refreshedUponExpiration&&v>=1&&(A.refreshedUponExpiration=!1),e?{opacity:1,mix:1-ee}:{opacity:ee,mix:0}}return{opacity:1,mix:0}}const Eo=new g.aM(1,0,0,1),Yi=new g.aM(0,1,0,1),Qo=new g.aM(0,0,1,1),Ec=new g.aM(1,0,1,1),ol=new g.aM(0,1,1,1);function fs(A,e,n,s){So(A,0,e+n/2,A.transform.width,n,s)}function Yl(A,e,n,s){So(A,e-n/2,0,n,A.transform.height,s)}function So(A,e,n,s,o,u){const y=A.context,I=y.gl;I.enable(I.SCISSOR_TEST),I.scissor(e*A.pixelRatio,n*A.pixelRatio,s*A.pixelRatio,o*A.pixelRatio),y.clear({color:u}),I.disable(I.SCISSOR_TEST)}function Zl(A,e,n){const s=A.context,o=s.gl,u=n.posMatrix,y=A.useProgram("debug"),I=Fi.disabled,v=Ar.disabled,S=A.colorModeForRenderPass(),T="$debug",M=A.style.map.terrain&&A.style.map.terrain.getTerrainData(n);s.activeTexture.set(o.TEXTURE0);const j=e.getTileByID(n.key).latestRawTileData,ee=Math.floor((j&&j.byteLength||0)/1024),ae=e.getTile(n).tileSize,Ae=512/Math.min(ae,512)*(n.overscaledZ/A.transform.zoom)*.5;let _e=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(_e+=` => ${n.overscaledZ}`),function(we,Ce){we.initDebugOverlayCanvas();const de=we.debugOverlayCanvas,Me=we.context.gl,ze=we.debugOverlayCanvas.getContext("2d");ze.clearRect(0,0,de.width,de.height),ze.shadowColor="white",ze.shadowBlur=2,ze.lineWidth=1.5,ze.strokeStyle="white",ze.textBaseline="top",ze.font="bold 36px Open Sans, sans-serif",ze.fillText(Ce,5,5),ze.strokeText(Ce,5,5),we.debugOverlayTexture.update(de),we.debugOverlayTexture.bind(Me.LINEAR,Me.CLAMP_TO_EDGE)}(A,`${_e} ${ee}kB`),y.draw(s,o.TRIANGLES,I,v,Er.alphaBlended,lr.disabled,fo(u,g.aM.transparent,Ae),null,T,A.debugBuffer,A.quadTriangleIndexBuffer,A.debugSegments),y.draw(s,o.LINE_STRIP,I,v,S,lr.disabled,fo(u,g.aM.red),M,T,A.debugBuffer,A.tileBorderIndexBuffer,A.debugSegments)}function Qc(A,e,n){const s=A.context,o=s.gl,u=A.colorModeForRenderPass(),y=new Fi(o.LEQUAL,Fi.ReadWrite,A.depthRangeFor3D),I=A.useProgram("terrain"),v=e.getTerrainMesh();s.bindFramebuffer.set(null),s.viewport.set([0,0,A.width,A.height]);for(const S of n){const T=A.renderToTexture.getTexture(S),M=e.getTerrainData(S.tileID);s.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,T.texture);const j=A.transform.calculatePosMatrix(S.tileID.toUnwrapped()),ee=e.getMeshFrameDelta(A.transform.zoom),ae=A.transform.calculateFogMatrix(S.tileID.toUnwrapped()),Ae=Fr(j,ee,ae,A.style.sky,A.transform.pitch);I.draw(s,o.TRIANGLES,y,Ar.disabled,u,lr.backCCW,Ae,M,"terrain",v.vertexBuffer,v.indexBuffer,v.segments)}}class ll{constructor(e,n,s){this.vertexBuffer=e,this.indexBuffer=n,this.segments=s}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class cl{constructor(e,n){this.context=new Cc(e),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:g.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Ai.maxUnderzooming+Ai.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new es}resize(e,n,s){if(this.width=Math.floor(e*s),this.height=Math.floor(n*s),this.pixelRatio=s,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const o of this.style._order)this.style._layers[o].resize()}setup(){const e=this.context,n=new g.aX;n.emplaceBack(0,0),n.emplaceBack(g.X,0),n.emplaceBack(0,g.X),n.emplaceBack(g.X,g.X),this.tileExtentBuffer=e.createVertexBuffer(n,Dr.members),this.tileExtentSegments=g.a0.simpleSegment(0,0,4,2);const s=new g.aX;s.emplaceBack(0,0),s.emplaceBack(g.X,0),s.emplaceBack(0,g.X),s.emplaceBack(g.X,g.X),this.debugBuffer=e.createVertexBuffer(s,Dr.members),this.debugSegments=g.a0.simpleSegment(0,0,4,5);const o=new g.$;o.emplaceBack(0,0,0,0),o.emplaceBack(g.X,0,g.X,0),o.emplaceBack(0,g.X,0,g.X),o.emplaceBack(g.X,g.X,g.X,g.X),this.rasterBoundsBuffer=e.createVertexBuffer(o,bn.members),this.rasterBoundsSegments=g.a0.simpleSegment(0,0,4,2);const u=new g.aX;u.emplaceBack(0,0),u.emplaceBack(1,0),u.emplaceBack(0,1),u.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(u,Dr.members),this.viewportSegments=g.a0.simpleSegment(0,0,4,2);const y=new g.aZ;y.emplaceBack(0),y.emplaceBack(1),y.emplaceBack(3),y.emplaceBack(2),y.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(y);const I=new g.aY;I.emplaceBack(0,1,2),I.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(I);const v=this.context.gl;this.stencilClearMode=new Ar({func:v.ALWAYS,mask:0},0,255,v.ZERO,v.ZERO,v.ZERO)}clearStencil(){const e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const s=g.H();g.aP(s,0,this.width,this.height,0,0,1),g.K(s,s,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,Fi.disabled,this.stencilClearMode,Er.disabled,lr.disabled,Kr(s),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,n){if(this.currentStencilSource===e.source||!e.isTileClipped()||!n||!n.length)return;this.currentStencilSource=e.source;const s=this.context,o=s.gl;this.nextStencilID+n.length>256&&this.clearStencil(),s.setColorMode(Er.disabled),s.setDepthMode(Fi.disabled);const u=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const y of n){const I=this._tileClippingMaskIDs[y.key]=this.nextStencilID++,v=this.style.map.terrain&&this.style.map.terrain.getTerrainData(y);u.draw(s,o.TRIANGLES,Fi.disabled,new Ar({func:o.ALWAYS,mask:0},I,255,o.KEEP,o.KEEP,o.REPLACE),Er.disabled,lr.disabled,Kr(y.posMatrix),v,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,n=this.context.gl;return new Ar({func:n.NOTEQUAL,mask:255},e,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(e){const n=this.context.gl;return new Ar({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(e){const n=this.context.gl,s=e.sort((y,I)=>I.overscaledZ-y.overscaledZ),o=s[s.length-1].overscaledZ,u=s[0].overscaledZ-o+1;if(u>1){this.currentStencilSource=void 0,this.nextStencilID+u>256&&this.clearStencil();const y={};for(let I=0;I<u;I++)y[I+o]=new Ar({func:n.GEQUAL,mask:255},I+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=u,[y,s]}return[{[o]:Ar.disabled},s]}colorModeForRenderPass(){const e=this.context.gl;return this._showOverdrawInspector?new Er([e.CONSTANT_COLOR,e.ONE],new g.aM(.125,.125,.125,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Er.unblended:Er.alphaBlended}depthModeForSublayer(e,n,s){if(!this.opaquePassEnabledForLayer())return Fi.disabled;const o=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Fi(s||this.context.gl.LEQUAL,n,[o,o])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,n){this.style=e,this.options=n,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(at.now()),this.imageManager.beginFrame();const s=this.style._order,o=this.style.sourceCaches,u={},y={},I={};for(const v in o){const S=o[v];S.used&&S.prepare(this.context),u[v]=S.getVisibleCoordinates(),y[v]=u[v].slice().reverse(),I[v]=S.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let v=0;v<s.length;v++)if(this.style._layers[s[v]].is3D()){this.opaquePassCutoff=v;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const v of s){const S=this.style._layers[v];if(!S.hasOffscreenPass()||S.isHidden(this.transform.zoom))continue;const T=y[S.source];("custom"===S.type||T.length)&&this.renderLayer(this,o[S.source],S,T)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?g.aM.black:g.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(v,S){const T=v.context,M=T.gl,j=(Ce=v.style.map.transform,de=v.pixelRatio,{u_sky_color:(we=S).properties.get("sky-color"),u_horizon_color:we.properties.get("horizon-color"),u_horizon:(Ce.he
3ight/2+Ce.getHorizon())*de,u_sky_horizon_blend:we.properties.get("sky-horizon-blend")*Ce.height/2*de}),ee=new Fi(M.LEQUAL,Fi.ReadWrite,[0,1]),ae=Ar.disabled,Ae=v.colorModeForRenderPass(),_e=v.useProgram("sky");var we,Ce,de;if(!S.mesh){const we=new g.aX;we.emplaceBack(-1,-1),we.emplaceBack(1,-1),we.emplaceBack(1,1),we.emplaceBack(-1,1);const Ce=new g.aY;Ce.emplaceBack(0,1,2),Ce.emplaceBack(0,2,3),S.mesh=new ll(T.createVertexBuffer(we,Dr.members),T.createIndexBuffer(Ce),g.a0.simpleSegment(0,0,we.length,Ce.length))}_e.draw(T,M.TRIANGLES,ee,ae,Ae,lr.disabled,j,void 0,"sky",S.mesh.vertexBuffer,S.mesh.indexBuffer,S.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){const v=this.style._layers[s[this.currentLayer]],S=o[v.source],T=u[v.source];this._renderTileClippingMasks(v,T),this.renderLayer(this,S,v,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){const v=this.style._layers[s[this.currentLayer]],S=o[v.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(v))continue;const T=("symbol"===v.type?I:y)[v.source];this._renderTileClippingMasks(v,u[v.source]),this.renderLayer(this,S,v,T)}if(this.options.showTileBoundaries){const v=function(S,T){let M=null;const j=Object.values(S._layers).flatMap(_e=>_e.source&&!_e.isHidden(T)?[S.sourceCaches[_e.source]]:[]),ee=j.filter(_e=>"vector"===_e.getSource().type),ae=j.filter(_e=>"vector"!==_e.getSource().type),Ae=_e=>{(!M||M.getSource().maxzoom<_e.getSource().maxzoom)&&(M=_e)};return ee.forEach(_e=>Ae(_e)),M||ae.forEach(_e=>Ae(_e)),M}(this.style,this.transform.zoom);v&&function(S,T,M){for(let j=0;j<M.length;j++)Zl(S,T,M[j])}(this,v,v.getVisibleCoordinates())}this.options.showPadding&&function(v){const S=v.transform.padding;fs(v,v.transform.height-(S.top||0),3,Eo),fs(v,S.bottom||0,3,Yi),Yl(v,S.left||0,3,Qo),Yl(v,v.transform.width-(S.right||0),3,Ec);const T=v.transform.centerPoint;var M,j,ee,ae;So(M=v,(j=T.x)-1,(ee=v.transform.height-T.y)-10,2,20,ae=ol),So(M,j-10,ee-1,20,2,ae)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;const n=this.terrainFacilitator.matrix,s=this.transform.modelViewProjectionMatrix;let o=this.terrainFacilitator.dirty;o||(o=e?!g.a_(n,s):!g.a$(n,s)),o||(o=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),o&&(g.b0(n,s),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(u,y){const I=u.context,v=I.gl,S=Er.unblended,T=new Fi(v.LEQUAL,Fi.ReadWrite,[0,1]),M=y.getTerrainMesh(),j=y.sourceCache.getRenderableTiles(),ee=u.useProgram("terrainDepth");I.bindFramebuffer.set(y.getFramebuffer("depth").framebuffer),I.viewport.set([0,0,u.width/devicePixelRatio,u.height/devicePixelRatio]),I.clear({color:g.aM.transparent,depth:1});for(const ae of j){const Ae=y.getTerrainData(ae.tileID),_e={u_matrix:u.transform.calculatePosMatrix(ae.tileID.toUnwrapped()),u_ele_delta:y.getMeshFrameDelta(u.transform.zoom)};ee.draw(I,v.TRIANGLES,T,Ar.disabled,S,lr.backCCW,_e,Ae,"terrain",M.vertexBuffer,M.indexBuffer,M.segments)}I.bindFramebuffer.set(null),I.viewport.set([0,0,u.width,u.height])}(this,this.style.map.terrain),function(u,y){const I=u.context,v=I.gl,S=Er.unblended,T=new Fi(v.LEQUAL,Fi.ReadWrite,[0,1]),M=y.getTerrainMesh(),j=y.getCoordsTexture(),ee=y.sourceCache.getRenderableTiles(),ae=u.useProgram("terrainCoords");I.bindFramebuffer.set(y.getFramebuffer("coords").framebuffer),I.viewport.set([0,0,u.width/devicePixelRatio,u.height/devicePixelRatio]),I.clear({color:g.aM.transparent,depth:1}),y.coordsIndex=[];for(const Ae of ee){const _e=y.getTerrainData(Ae.tileID);I.activeTexture.set(v.TEXTURE0),v.bindTexture(v.TEXTURE_2D,j.texture);const we={u_matrix:u.transform.calculatePosMatrix(Ae.tileID.toUnwrapped()),u_terrain_coords_id:(255-y.coordsIndex.length)/255,u_texture:0,u_ele_delta:y.getMeshFrameDelta(u.transform.zoom)};ae.draw(I,v.TRIANGLES,T,Ar.disabled,S,lr.backCCW,we,_e,"terrain",M.vertexBuffer,M.indexBuffer,M.segments),y.c
vendor: 11,725 bytes, line 3
3oordsIndex.push(Ae.tileID.key)}I.bindFramebuffer.set(null),I.viewport.set([0,0,u.width,u.height])}(this,this.style.map.terrain))}renderLayer(e,n,s,o){if(!s.isHidden(this.transform.zoom)&&("background"===s.type||"custom"===s.type||(o||[]).length))switch(this.id=s.id,s.type){case"symbol":!function(u,y,I,v,S){if("translucent"!==u.renderPass)return;const T=Ar.disabled,M=u.colorModeForRenderPass();(I._unevaluatedLayout.hasValue("text-variable-anchor")||I._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(j,ee,ae,Ae,_e,we,Ce,de,Me){const ze=ee.transform,Ve=xr(),tt="map"===_e,xt="map"===we;for(const Pt of j){const Ot=Ae.getTile(Pt),St=Ot.getBucket(ae);if(!St||!St.text||!St.text.segments.get().length)continue;const Mt=g.ag(St.textSizeData,ze.zoom),jt=zi(Ot,1,ee.transform.zoom),pi=Un(Pt.posMatrix,xt,tt,ee.transform,jt),Et="none"!==ae.layout.get("icon-text-fit")&&St.hasIconData();if(Mt){const Ft=Math.pow(2,ze.zoom-Ot.tileID.overscaledZ),_i=ee.style.map.terrain?(Mi,Gi)=>ee.style.map.terrain.getElevation(Pt,Mi,Gi):null,ar=Ve.translatePosition(ze,Ot,Ce,de);Oa(St,tt,xt,Me,ze,pi,Pt.posMatrix,Ft,Mt,Et,Ve,ar,Pt.toUnwrapped(),_i)}}}(v,u,I,y,I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),S),0!==I.paint.get("icon-opacity").constantOr(1)&&jl(u,y,I,v,!1,I.paint.get("icon-translate"),I.paint.get("icon-translate-anchor"),I.layout.get("icon-rotation-alignment"),I.layout.get("icon-pitch-alignment"),I.layout.get("icon-keep-upright"),T,M),0!==I.paint.get("text-opacity").constantOr(1)&&jl(u,y,I,v,!0,I.paint.get("text-translate"),I.paint.get("text-translate-anchor"),I.layout.get("text-rotation-alignment"),I.layout.get("text-pitch-alignment"),I.layout.get("text-keep-upright"),T,M),y.map.showCollisionBoxes&&(wo(u,y,I,v,!0),wo(u,y,I,v,!1))}(e,n,s,o,this.style.placement.variableOffsets);break;case"circle":!function(u,y,I,v){if("translucent"!==u.renderPass)return;const S=I.paint.get("circle-opacity"),T=I.paint.get("circle-stroke-width"),M=I.paint.get("circle-stroke-opacity"),j=!I.layout.get("circle-sort-key").isConstant();if(0===S.constantOr(1)&&(0===T.constantOr(1)||0===M.constantOr(1)))return;const ee=u.context,ae=ee.gl,Ae=u.depthModeForSublayer(0,Fi.ReadOnly),_e=Ar.disabled,we=u.colorModeForRenderPass(),Ce=[];for(let de=0;de<v.length;de++){const Me=v[de],ze=y.getTile(Me),Ve=ze.getBucket(I);if(!Ve)continue;const tt=Ve.programConfigurations.get(I.id),xt=u.useProgram("circle",tt),Pt=Ve.layoutVertexBuffer,Ot=Ve.indexBuffer,St=u.style.map.terrain&&u.style.map.terrain.getTerrainData(Me),Mt={programConfiguration:tt,program:xt,layoutVertexBuffer:Pt,indexBuffer:Ot,uniformValues:Gl(u,Me,ze,I),terrainData:St};if(j){const jt=Ve.segments.get();for(const pi of jt)Ce.push({segments:new g.a0([pi]),sortKey:pi.sortKey,state:Mt})}else Ce.push({segments:Ve.segments,sortKey:0,state:Mt})}j&&Ce.sort((de,Me)=>de.sortKey-Me.sortKey);for(const de of Ce){const{programConfiguration:Me,program:ze,layoutVertexBuffer:Ve,indexBuffer:tt,uniformValues:xt,terrainData:Pt}=de.state;ze.draw(ee,ae.TRIANGLES,Ae,_e,we,lr.disabled,xt,Pt,I.id,Ve,tt,de.segments,I.paint,u.transform.zoom,Me)}}(e,n,s,o);break;case"heatmap":!function(u,y,I,v){if(0===I.paint.get("heatmap-opacity"))return;const S=u.context;if(u.style.map.terrain){for(const T of v){const M=y.getTile(T);y.hasRenderableParent(T)||("offscreen"===u.renderPass?Na(u,M,I,T):"translucent"===u.renderPass&&Sa(u,I,T))}S.viewport.set([0,0,u.width,u.height])}else"offscreen"===u.renderPass?function(T,M,j,ee){const ae=T.context,Ae=ae.gl,_e=Ar.disabled,we=new Er([Ae.ONE,Ae.ONE],g.aM.transparent,[!0,!0,!0,!0]);(function(Ce,de,Me){const ze=Ce.gl;Ce.activeTexture.set(ze.TEXTURE1),Ce.viewport.set([0,0,de.width/4,de.height/4]);let Ve=Me.heatmapFbos.get(g.aU);Ve?(ze.bindTexture(ze.TEXTURE_2D,Ve.colorAttachment.get()),Ce.bindFramebuffer.set(Ve.framebuffer)):(Ve=xo(Ce,de.width/4,de.height/4),Me.heatmapFbos.set(g.aU,Ve))})(ae,T,j),ae.clear({color:g.aM.transparent});for(let Ce=0;Ce<ee.length;Ce++){const de=ee[Ce];if(M.hasRenderableParent(de))continue;const Me=M.getTile(de),ze=Me.getBucket(j);if(!ze)continue;const Ve=ze.programConfigurations.get(j.id),tt=T.useProgram("heatmap",Ve),{zoom:xt}=T.transform;tt.draw(ae,Ae.TRIANGLES,Fi.disabled,_e,we,lr.disabled,vn(de.posMatrix,Me,xt,j.paint.get("heatmap-intensity")),null,j.id,ze.layoutVertexBuffer,ze.indexBuffer,ze.segments,j.paint,T.transform.zoom,Ve)}ae.viewport.set([0,0,T.width,T.height])}(u,y,I,v):"translucent"===u.renderPass&&function(T,M){const j=T.context,ee=j.gl;j.setColorMode(T.colorModeForRenderPass());const ae=M.heatmapFbos.get(g.aU);ae&&(j.activeTexture.set(ee.TEXTURE0),ee.bindTexture(ee.TEXTURE_2D,ae.colorAttachment.get()),j.activeTexture.set(ee.TEXTURE1),Bo(j,M).bind(ee.LINEAR,ee.CLAMP_TO_EDGE),T.useProgram("heatmapTexture").draw(j,ee.TRIANGLES,Fi.disabled,Ar.disabled,T.colorModeForRenderPass(),lr.disabled,Us(T,M,0,1),null,M.id,T.viewportBuffer,T.quadTriangleIndexBuffer,T.viewportSegments,M.paint,T.transform.zoom))}(u,I)}(e,n,s,o);break;case"line":!function(u,y,I,v){if("translucent"!==u.renderPass)return;const S=I.paint.get("line-opacity"),T=I.paint.get("line-width");if(0===S.constantOr(1)||0===T.constantOr(1))return;const M=u.depthModeForSublayer(0,Fi.ReadOnly),j=u.colorModeForRenderPass(),ee=I.paint.get("line-dasharray"),ae=I.paint.get("line-pattern"),Ae=ae.constantOr(1),_e=I.paint.get("line-gradient"),we=I.getCrossfadeParameters(),Ce=Ae?"linePattern":ee?"lineSDF":_e?"lineGradient":"line",de=u.context,Me=de.gl;let ze=!0;for(const Ve of v){const tt=y.getTile(Ve);if(Ae&&!tt.patternsLoaded())continue;const xt=tt.getBucket(I);if(!xt)continue;const Pt=xt.programConfigurations.get(I.id),Ot=u.context.program.get(),St=u.useProgram(Ce,Pt),Mt=ze||St.program!==Ot,jt=u.style.map.terrain&&u.style.map.terrain.getTerrainData(Ve),pi=ae.constantOr(null);if(pi&&tt.imageAtlas){const _i=tt.imageAtlas,ar=_i.patternPositions[pi.to.toString()],Mi=_i.patternPositions[pi.from.toString()];ar&&Mi&&Pt.setConstantPatternPositions(ar,Mi)}const Et=jt?Ve:null,Ft=Ae?Ea(u,tt,I,we,Et):ee?Kc(u,tt,I,ee,we,Et):_e?Gs(u,tt,I,xt.lineClipsArray.length,Et):ea(u,tt,I,Et);if(Ae)de.activeTexture.set(Me.TEXTURE0),tt.imageAtlasTexture.bind(Me.LINEAR,Me.CLAMP_TO_EDGE),Pt.updatePaintBuffers(we);else if(ee&&(Mt||u.lineAtlas.dirty))de.activeTexture.set(Me.TEXTURE0),u.lineAtlas.bind(de);else if(_e){const _i=xt.gradients[I.id];let ar=_i.texture;if(I.gradientVersion!==_i.version){let Mi=256;if(I.stepInterpolant){const Gi=y.getSource().maxzoom,dr=Ve.canonical.z===Gi?Math.ceil(1<<u.transform.maxZoom-Ve.canonical.z):1;Mi=g.ac(g.aV(xt.maxLineLength/g.X*1024*dr),256,de.maxTextureSize)}_i.gradient=g.aW({expression:I.gradientExpression(),evaluationKey:"lineProgress",resolution:Mi,image:_i.gradient||void 0,clips:xt.lineClipsArray}),_i.texture?_i.texture.update(_i.gradient):_i.texture=new mt(de,_i.gradient,Me.RGBA),_i.version=I.gradientVersion,ar=_i.texture}de.activeTexture.set(Me.TEXTURE0),ar.bind(I.stepInterpolant?Me.NEAREST:Me.LINEAR,Me.CLAMP_TO_EDGE)}St.draw(de,Me.TRIANGLES,M,u.stencilModeForClipping(Ve),j,lr.disabled,Ft,jt,I.id,xt.layoutVertexBuffer,xt.indexBuffer,xt.segments,I.paint,u.transform.zoom,Pt,xt.layoutVertexBuffer2),ze=!1}}(e,n,s,o);break;case"fill":!function(u,y,I,v){const S=I.paint.get("fill-color"),T=I.paint.get("fill-opacity");if(0===T.constantOr(1))return;const M=u.colorModeForRenderPass(),j=I.paint.get("fill-pattern"),ee=u.opaquePassEnabledForLayer()&&!j.constantOr(1)&&1===S.constantOr(g.aM.transparent).a&&1===T.constantOr(0)?"opaque":"translucent";if(u.renderPass===ee){const ae=u.depthModeForSublayer(1,"opaque"===u.renderPass?Fi.ReadWrite:Fi.ReadOnly);qa(u,y,I,v,ae,M,!1)}if("translucent"===u.renderPass&&I.paint.get("fill-antialias")){const ae=u.depthModeForSublayer(I.getPaintProperty("fill-outline-color")?2:0,Fi.ReadOnly);qa(u,y,I,v,ae,M,!0)}}(e,n,s,o);break;case"fill-extrusion":!function(u,y,I,v){const S=I.paint.get("fill-extrusion-opacity");if(0!==S&&"translucent"===u.renderPass){const T=new Fi(u.context.gl.LEQUAL,Fi.ReadWrite,u.depthRangeFor3D);if(1!==S||I.paint.get("fill-extrusion-pattern").constantOr(1))Da(u,y,I,v,T,Ar.disabled,Er.disabled),Da(u,y,I,v,T,u.stencilModeFor3D(),u.colorModeForRenderPass());else{const M=u.colorModeForRenderPass();Da(u,y,I,v,T,Ar.disabled,M)}}}(e,n,s,o);break;case"hillshade":!function(u,y,I,v){if("offscreen"!==u.renderPass&&"translucent"!==u.renderPass)return;const S=u.context,T=u.depthModeForSublayer(0,Fi.ReadOnly),M=u.colorModeForRenderPass(),[j,ee]="translucent"===u.renderPass?u.stencilConfigForOverlap(v):[{},v];for(const ae of ee){const Ae=y.getTile(ae);void 0!==Ae.needsHillshadePrepare&&Ae.needsHillshadePrepare&&"offscreen"===u.renderPass?Hs(u,Ae,I,T,Ar.disabled,M):"translucent"===u.renderPass&&ds(u,ae,Ae,I,T,j[ae.overscaledZ],M)}S.viewport.set([0,0,u.width,u.height])}(e,n,s,o);break;case"raster":!function(u,y,I,v){if("translucent"!==u.renderPass||0===I.paint.get("raster-opacity")||!v.length)return;const S=u.context,T=S.gl,M=y.getSource(),j=u.useProgram("raster"),ee=u.colorModeForRenderPass(),[ae,Ae]=M instanceof dn?[{},v]:u.stencilConfigForOverlap(v),_e=Ae[Ae.length-1].overscaledZ,we=!u.options.moving;for(const Ce of Ae){const de=u.depthModeForSublayer(Ce.overscaledZ-_e,1===I.paint.get("raster-opacity")?Fi.ReadWrite:Fi.ReadOnly,T.LESS),Me=y.getTile(Ce);Me.registerFadeDuration(I.paint.get("raster-fade-duration"));const ze=y.findLoadedParent(Ce,0),Ve=y.findLoadedSibling(Ce),tt=Co(Me,ze||Ve||null,y,I,u.transform,u.style.map.terrain);let xt,Pt;const Ot="nearest"===I.paint.get("raster-resampling")?T.NEAREST:T.LINEAR;S.activeTexture.set(T.TEXTURE0),Me.texture.bind(Ot,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST),S.activeTexture.set(T.TEXTURE1),ze?(ze.texture.bind(Ot,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST),xt=Math.pow(2,ze.tileID.overscaledZ-Me.tileID.overscaledZ),Pt=[Me.tileID.canonical.x*xt%1,Me.tileID.canonical.y*xt%1]):Me.texture.bind(Ot,T.CLAMP_TO_EDGE,T.LINEAR_MIPMAP_NEAREST),Me.texture.useMipmap&&S.extTextureFilterAnisotropic&&u.transform.pitch>20&&T.texParameterf(T.TEXTURE_2D,S.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,S.extTextureFilterAnisotropicMax);const St=u.style.map.terrain&&u.style.map.terrain.getTerrainData(Ce),Mt=St?Ce:null,jt=Mt?Mt.posMatrix:u.transform.calculatePosMatrix(Ce.toUnwrapped(),we),pi=mc(jt,Pt||[0,0],xt||1,tt,I);M instanceof dn?j.draw(S,T.TRIANGLES,de,Ar.disabled,ee,lr.disabled,pi,St,I.id,M.boundsBuffer,u.quadTriangleIndexBuffer,M.boundsSegments):j.draw(S,T.TRIANGLES,de,ae[Ce.overscaledZ],ee,lr.disabled,pi,St,I.id,u.rasterBoundsBuffer,u.quadTriangleIndexBuffer,u.rasterBoundsSegments)}}(e,n,s,o);break;case"background":!function(u,y,I,v){const S=I.paint.get("background-color"),T=I.paint.get("background-opacity");if(0===T)return;const M=u.context,j=M.gl,ee=u.transform,ae=ee.tileSize,Ae=I.paint.get("background-pattern");if(u.isPatternMissing(Ae))return;const _e=!Ae&&1===S.a&&1===T&&u.opaquePassEnabledForLayer()?"opaque":"translucent";if(u.renderPass!==_e)return;const we=Ar.disabled,Ce=u.depthModeForSublayer(0,"opaque"===_e?Fi.ReadWrite:Fi.ReadOnly),de=u.colorModeForRenderPass(),Me=u.useProgram(Ae?"backgroundPattern":"background"),ze=v||ee.coveringTiles({tileSize:ae,terrain:u.style.map.terrain});Ae&&(M.activeTexture.set(j.TEXTURE0),u.imageManager.bind(u.context));const Ve=I.getCrossfadeParameters();for(const tt of ze){const xt=v?tt.posMatrix:u.transform.calculatePosMatrix(tt.toUnwrapped()),Pt=Ae?Xo(xt,T,u,Ae,{tileID:tt,tileSize:ae},Ve):$o(xt,T,S),Ot=u.style.map.terrain&&u.style.map.terrain.getTerrainData(tt);Me.draw(M,j.TRIANGLES,Ce,we,de,lr.disabled,Pt,Ot,I.id,u.tileExtentBuffer,u.quadTriangleIndexBuffer,u.tileExtentSegments)}}(e,0,s,o);break;
3case"custom":!function(u,y,I){const v=u.context,S=I.implementation;if("offscreen"===u.renderPass){const T=S.prerender;T&&(u.setCustomLayerDefaults(),v.setColorMode(u.colorModeForRenderPass()),T.call(S,v.gl,u.transform.customLayerMatrix()),v.setDirty(),u.setBaseState())}else if("translucent"===u.renderPass){u.setCustomLayerDefaults(),v.setColorMode(u.colorModeForRenderPass()),v.setStencilMode(Ar.disabled);const T="3d"===S.renderingMode?new Fi(u.context.gl.LEQUAL,Fi.ReadWrite,u.depthRangeFor3D):u.depthModeForSublayer(0,Fi.ReadOnly);v.setDepthMode(T),S.render(v.gl,u.transform.customLayerMatrix(),{farZ:u.transform.farZ,nearZ:u.transform.nearZ,fov:u.transform._fov,modelViewProjectionMatrix:u.transform.modelViewProjectionMatrix,projectionMatrix:u.transform.projectionMatrix}),v.setDirty(),u.setBaseState(),v.bindFramebuffer.set(null)}}(e,0,s)}}translatePosMatrix(e,n,s,o,u){if(!s[0]&&!s[1])return e;const y=u?"map"===o?this.transform.angle:0:"viewport"===o?-this.transform.angle:0;if(y){const S=Math.sin(y),T=Math.cos(y);s=[s[0]*T-s[1]*S,s[0]*S+s[1]*T]}const I=[u?s[0]:zi(n,s[0],this.transform.zoom),u?s[1]:zi(n,s[1],this.transform.zoom),0],v=new Float32Array(16);return g.J(v,e,I),v}saveTileTexture(e){const n=this._tileTextures[e.size[0]];n?n.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const n=this._tileTextures[e];return n&&n.length>0?n.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const n=this.imageManager.getPattern(e.from.toString()),s=this.imageManager.getPattern(e.to.toString());return!n||!s}useProgram(e,n){this.cache=this.cache||{};const s=e+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[s]||(this.cache[s]=new Ul(this.context,kn[e],n,Nl[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[s]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new mt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:n}=this.context.gl;return this.width!==e||this.height!==n}}class ps{constructor(e,n){this.points=e,this.planes=n}static fromInvProjectionMatrix(e,n,s){const o=Math.pow(2,s),u=[[-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(I=>{const v=1/(I=g.af([],I,e))[3]/n*o;return g.b1(I,I,[v,v,1/I[3],v])}),y=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(I=>{const v=function(j,ee){var ae=ee[0],Ae=ee[1],_e=ee[2],we=ae*ae+Ae*Ae+_e*_e;return we>0&&(we=1/Math.sqrt(we)),j[0]=ee[0]*we,j[1]=ee[1]*we,j[2]=ee[2]*we,j}([],(j=[],ee=ot([],u[I[0]],u[I[1]]),ae=ot([],u[I[2]],u[I[1]]),Ae=ee[0],Ce=ae[0],j[0]=(_e=ee[1])*(Me=ae[2])-(we=ee[2])*(de=ae[1]),j[1]=we*Ce-Ae*Me,j[2]=Ae*de-_e*Ce,j)),S=-((T=v)[0]*(M=u[I[1]])[0]+T[1]*M[1]+T[2]*M[2]);var j,ee,ae,Ae,_e,we,Ce,de,Me,T,M;return v.concat(S)});return new ps(u,y)}}class gs{constructor(e,n){var s,o,u;this.min=e,this.max=n,this.center=function(s,o,u){return s[0]=.5*o[0],s[1]=.5*o[1],s[2]=.5*o[2],s}([],((s=[])[0]=(o=this.min)[0]+(u=this.max)[0],s[1]=o[1]+u[1],s[2]=o[2]+u[2],s))}quadrant(e){const n=[e%2==0,e<2],s=bi(this.min),o=bi(this.max);for(let u=0;u<n.length;u++)s[u]=n[u]?this.min[u]:this.center[u],o[u]=n[u]?this.center[u]:this.max[u];return o[2]=this.max[2],new gs(s,o)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersects(e){const n=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],
vendor: 71,744 bytes, line 3
31],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let s=!0;for(let o=0;o<e.planes.length;o++){const u=e.planes[o];let y=0;for(let I=0;I<n.length;I++)g.b2(u,n[I])>=0&&y++;if(0===y)return 0;y!==n.length&&(s=!1)}if(s)return 2;for(let o=0;o<3;o++){let u=Number.MAX_VALUE,y=-Number.MAX_VALUE;for(let I=0;I<e.points.length;I++){const v=e.points[I][o]-this.min[o];u=Math.min(u,v),y=Math.max(y,v)}if(y<0||u>this.max[o]-this.min[o])return 0}return 1}}class ms{constructor(e=0,n=0,s=0,o=0){if(isNaN(e)||e<0||isNaN(n)||n<0||isNaN(s)||s<0||isNaN(o)||o<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=n,this.left=s,this.right=o}interpolate(e,n,s){return null!=n.top&&null!=e.top&&(this.top=g.y.number(e.top,n.top,s)),null!=n.bottom&&null!=e.bottom&&(this.bottom=g.y.number(e.bottom,n.bottom,s)),null!=n.left&&null!=e.left&&(this.left=g.y.number(e.left,n.left,s)),null!=n.right&&null!=e.right&&(this.right=g.y.number(e.right,n.right,s)),this}getCenter(e,n){const s=g.ac((this.left+e-this.right)/2,0,e),o=g.ac((this.top+n-this.bottom)/2,0,n);return new g.P(s,o)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new ms(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const hl=85.051129;class Js{constructor(e,n,s,o,u){this.tileSize=512,this._renderWorldCopies=void 0===u||!!u,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=s??0,this._maxPitch=o??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new g.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ms,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const e=new Js(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.lngRange=e.lngRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new g.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const n=-g.b3(e,-180,180)*Math.PI/180;var s;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=(s=new g.A(4),g.A!=Float32Array&&(s[1]=0,s[2]=0),s[0]=1,s[3]=1,s),function(s,o,u){var y=o[0],I=o[1],v=o[2],S=o[3],T=Math.sin(u),M=Math.cos(u);s[0]=y*M+v*T,s[1]=I*M+S*T,s[2]=y*-T+v*M,s[3]=I*-T+S*M}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const n=g.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const n=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,n,s){this._unmodified=!1,this._edgeInsets.interpolate(e,n,s),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const n=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(e){const n=[new g.b4(0,e)];if(this._renderWorldCopies){const s=this.pointCoordinate(new g.P(0,0)),o=this.pointCoordinate(new g.P(this.width,0)),u=this.pointCoordinate(new g.P(this.width,this.height)),y=this.pointCoordinate(new g.P(0,this.height)),I=Math.floor(Math.min(s.x,o.x,u.x,y.x)),v=Math.floor(Math.max(s.x,o.x,u.x,y.x)),S=1;for(let T=I-S;T<=v+S;T++)0!==T&&n.push(new g.b4(T,e))}return n}coveringTiles(e){var n,s;let o=this.coveringZoomLevel(e);const u=o;if(void 0!==e.minzoom&&o<e.minzoom)return[];void 0!==e.maxzoom&&o>e.maxzoom&&(o=e.maxzoom);const y=this.pointCoordinate(this.getCameraPoint()),I=g.Z.fromLngLat(this.center),v=Math.pow(2,o),S=[v*y.x,v*y.y,0],T=[v*I.x,v*I.y,0],M=ps.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,o);let j=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(j=o);const ee=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,ae=de=>({aabb:new gs([de*v,0,0],[(de+1)*v,v,0]),zoom:0,x:0,y:0,wrap:de,fullyVisible:!1}),Ae=[],_e=[],we=o,Ce=e.reparseOverscaled?u:o;if(this._renderWorldCopies)for(let de=1;de<=3;de++)Ae.push(ae(-de)),Ae.push(ae(de));for(Ae.push(ae(0));Ae.length>0;){const de=Ae.pop(),Me=de.x,ze=de.y;let Ve=de.fullyVisible;if(!Ve){const St=de.aabb.intersects(M);if(0===St)continue;Ve=2===St}const tt=e.terrain?S:T,xt=de.aabb.distanceX(tt),Pt=de.aabb.distanceY(tt),Ot=Math.max(Math.abs(xt),Math.abs(Pt));if(de.zoom===we||Ot>ee+(1<<we-de.zoom)-2&&de.zoom>=j){const St=we-de.zoom,Mt=S[0]-.5-(Me<<St),jt=S[1]-.5-(ze<<St);_e.push({tileID:new g.S(de.zoom===we?Ce:de.zoom,de.wrap,de.zoom,Me,ze),distanceSq:It([T[0]-.5-Me,T[1]-.5-ze]),tileDistanceToCamera:Math.sqrt(Mt*Mt+jt*jt)})}else for(let St=0;St<4;St++){const Mt=(Me<<1)+St%2,jt=(ze<<1)+(St>>1),pi=de.zoom+1;let Et=de.aabb.quadrant(St);if(e.terrain){const Ft=new g.S(pi,de.wrap,pi,Mt,jt),_i=e.terrain.getMinMaxElevation(Ft),ar=null!==(n=_i.minElevation)&&void 0!==n?n:this.elevation,Mi=null!==(s=_i.maxElevation)&&void 0!==s?s:this.elevation;Et=new gs([Et.min[0],Et.min[1],ar],[Et.max[0],Et.max[1],Mi])}Ae.push({aabb:Et,zoom:pi,x:Mt,y:jt,wrap:de.wrap,fullyVisible:Ve})}}return _e.sort((de,Me)=>de.distanceSq-Me.distanceSq).map(de=>de.tileID)}resize(e,n){this.width=e,this.height=n,this.pixelsToGLUnits=[2/e,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const n=g.ac(e.lat,-85.051129,hl);return new g.P(g.O(e.lng)*this.worldSize,g.Q(n)*this.worldSize)}unproject(e){return new g.Z(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(e){const n=this.elevation,s=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,o=this.pointLocation(this.centerPoint,e),u=e.getElevationForLngLatZoom(o,this.tileZoom);if(!(this.elevation-u))return;const y=s+n-u,I=Math.cos(this._pitch)*this.cameraToCenterDistance/y/g.b5(1,o.lat),v=this.scaleZoom(I/this.tileSize);this._elevation=u,this._center=o,this.zoom=v}setLocationAtPoint(e,n){const s=this.pointCoordinate(n),o=this.pointCoordinate(this.centerPoint),u=this.locationCoordinate(e),y=new g.Z(u.x-(s.x-o.x),u.y-(s.y-o.y));this.center=this.coordinateLocation(y),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,n){return n?this.coordinatePoint(this.locationCoordinate(e),n.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,n){return this.coordinateLocation(this.pointCoordinate(e,n))}locationCoordinate(e){return g.Z.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,n){if(n){const j=n.pointCoordinate(e);if(null!=j)return j}const s=[e.x,e.y,0,1],o=[e.x,e.y,1,1];g.af(s,s,this.pixelMatrixInverse),g.af(o,o,this.pixelMatrixInverse);const u=s[3],y=o[3],I=s[1]/u,v=o[1]/y,S=s[2]/u,T=o[2]/y,M=S===T?0:(0-S)/(T-S);return new g.Z(g.y.number(s[0]/u,o[0]/y,M)/this.worldSize,g.y.number(I,v,M)/this.worldSize)}coordinatePoint(e,n=0,s=this.pixelMatrix){const o=[e.x*this.worldSize,e.y*this.worldSize,n,1];return g.af(o,o,s),new g.P(o[0]/o[3],o[1]/o[3])}getBounds(){const e=Math.max(0,this.height/2-this.getHorizon());return(new Ze).extend(this.pointLocation(new g.P(0,e))).extend(this.pointLocation(new g.P(this.width,e))).extend(this.pointLocation(new g.P(this.width,this.height))).extend(this.pointLocation(new g.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new Ze([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,hl])}calculateTileMatrix(e){const n=e.canonical,s=this.worldSize/this.zoomScale(n.z),o=n.x+Math.pow(2,n.z)*e.wrap,u=g.an(new Float64Array(16));return g.J(u,u,[o*s,n.y*s,0]),g.K(u,u,[s/g.X,s/g.X,1]),u}calculatePosMatrix(e,n=!1){const s=e.key,o=n?this._alignedPosMatrixCache:this._posMatrixCache;if(o[s])return o[s];const u=this.calculateTileMatrix(e);return g.L(u,n?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,u),o[s]=new Float32Array(u),o[s]}calculateFogMatrix(e){const n=e.key,s=this._fogMatrixCache;if(s[n])return s[n];const o=this.calculateTileMatrix(e);return g.L(o,this.fogMatrix,o),s[n]=new Float32Array(o),s[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,n){n=g.ac(+n,this.minZoom,this.maxZoom);const s={center:new g.N(e.lng,e.lat),zoom:n};let o=this.lngRange;if(!this._renderWorldCopies&&null===o){const de=179.9999999999;o=[-de,de]}const u=this.tileSize*this.zoomScale(s.zoom);let y=0,I=u,v=0,S=u,T=0,M=0;const{x:j,y:ee}=this.size;if(this.latRange){const de=this.latRange;y=g.Q(de[1])*u,I=g.Q(de[0])*u,I-y<ee&&(T=ee/(I-y))}o&&(v=g.b3(g.O(o[0])*u,0,u),S=g.b3(g.O(o[1])*u,0,u),S<v&&(S+=u),S-v<j&&(M=j/(S-v)));const{x:ae,y:Ae}=this.project.call({worldSize:u},e);let _e,we;const Ce=Math.max(M||0,T||0);if(Ce){const de=new g.P(M?(S+v)/2:ae,T?(I+y)/2:Ae);return s.center=this.unproject.call({worldSize:u},de).wrap(),s.zoom+=this.scaleZoom(Ce),s}if(this.latRange){const de=ee/2;Ae-de<y&&(we=y+de),Ae+de>I&&(we=I-de)}if(o){const de=(v+S)/2;let Me=ae;this._renderWorldCopies&&(Me=g.b3(ae,de-u/2,de+u/2));const ze=j/2;Me-ze<v&&(_e=v+ze),Me+ze>S&&(_e=S-ze)}if(void 0!==_e||void 0!==we){const de=new g.P(_e??ae,we??Ae);s.center=this.unproject.call({worldSize:u},de).wrap()}return s}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:n,zoom:s}=this.getConstrained(this.center,this.zoom);this.center=n,this.zoom=s,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,n=this.point.x,s=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=g.b5(1,this.center.lat)*this.worldSize;let o=g.an(new Float64Array(16));g.K(o,o,[this.width/2,-this.height/2,1]),g.J(o,o,[1,-1,0]),this.labelPlaneMatrix=o,o=g.an(new Float64Array(16)),g.K(o,o,[1,-1,1]),g.J(o,o,[-1,-1,0]),g.K(o,o,[2/this.width,2/this.height,1]),this.glCoordMatrix=o;const u=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),y=Math.min(this.elevation,this.minElevationForCurrentTile),I=u-y*this._pixelPerMeter/Math.cos(this._pitch),v=y<0?I:u,S=Math.PI/2+this._pitch,T=this._fov*(.5+e.y/this.height),M=Math.sin(T)*v/Math.sin(g.ac(Math.PI-S-T,.01,Math.PI-.01)),j=this.getHorizon(),ee=2*Math.atan(j/this.cameraToCenterDistance)*(.5+e.y/(2*j)),ae=Math.sin(ee)*v/Math.sin(g.ac(Math.PI-S-ee,.01,Math.PI-.01)),Ae=Math.min(M,ae);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Ae+v),this.nearZ=this.height/50,o=new Float64Array(16),g.b6(o,this._fov,this.width/this.height,this.nearZ,this.farZ),o[8]=2*-e.x/this.width,o[9]=2*e.y/this.height,this.projectionMatrix=g.ae(o),g.K(o,o,[1,-1,1]),g.J(o,o,[0,0,-this.cameraToCenterDistance]),g.b7(o,o,this._pitch),g.ad(o,o,this.angle),g.J(o,o,[-n,-s,0]),this.mercatorMatrix=g.K([],o,[this.worldSize,this.worldSize,this.worldSize]),g.K(o,o,[1,1,this._pixelPerMeter]),this.pixelMatrix=g.L(new Float64Array(16),this.labelPlaneMatrix,o),g.J(o,o,[0,0,-this.elevation]),this.modelViewProjectionMatrix=o,this.invModelViewProjectionMatrix=g.as([],o),this.fogMatrix=new Float64Array(16),g.b6(this.fogMatrix,this._fov,this.width/this.height,u,this.farZ),this.fogMatrix[8]=2*-e.x/this.width,this.fogMatrix[9]=2*e.y/this.height,g.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),g.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),g.b7(this.fogMatrix,this.fogMatrix,this._pitch),g.ad(this.fogMatrix,this.fogMatrix,this.angle),g.J(this.fogMatrix,this.fogMatrix,[-n,-s,0]),g.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),g.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=g.L(new Float64Array(16),this.labelPlaneMatrix,o);const _e=this.width%2/2,we=this.height%2/2,Ce=Math.cos(this.angle),de=Math.sin(this.angle),Me=n-Math.round(n)+Ce*_e+de*we,ze=s-Math.round(s)+Ce*we+de*_e,Ve=new Float64Array(o);if(g.J(Ve,Ve,[Me>.5?Me-1:Me,ze>.5?ze-1:ze,0]),this.alignedModelViewProjectionMatrix=Ve,o=g.as(new Float64Array(16),this.pixelMatrix),!o)throw new Error("failed to invert matrix");this.pixelMatrixInverse=o,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new g.P(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return g.af(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new g.P(0,e))}getCameraQueryGeometry(e){const n=this.getCameraPoint();if(1===e.length)return[e[0],n];{let s=n.x,o=n.y,u=n.x,y=n.y;for(const I of e)s=Math.min(s,I.x),o=Math.min(o,I.y),u=Math.max(u,I.x),y=Math.max(y,I.y);return[new g.P(s,o),new g.P(u,o),new g.P(u,y),new g.P(s,y),new g.P(s,o)]}}lngLatToCameraDepth(e,n){const s=this.locationCoordinate(e),o=[s.x*this.worldSize,s.y*this.worldSize,n,1];return g.af(o,o,this.modelViewProjectionMatrix),o[2]/o[3]}}function Do(A,e){let n,s=!1,o=null,u=null;const y=()=>{o=null,s&&(A.apply(u,n),o=setTimeout(y,e),s=!1)};return(...I)=>(s=!0,u=this,n=I,o||y(),o)}class ko{constructor(e){this._getCurrentHash=()=>{const n=window.location.hash.replace("#","");if(this._hashName){let s;return n.split("&").map(o=>o.split("=")).forEach(o=>{o[0]===this._hashName&&(s=o)}),(s&&s[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{const n=this._getCurrentHash();if(n.length>=3&&!n.some(s=>isNaN(s))){const s=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:s,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const n=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,n)},this._removeHash=()=>{const n=this._getCurrentHash();if(0===n.length)return;const s=n.join("/");let o=s;o.split("&").length>0&&(o=o.split("&")[0]),this._hashName&&(o=`${this._hashName}=${s}`);let u=window.location.hash.replace(o,"");u.startsWith("#&")?u=u.slice(0,1)+u.slice(2):"#"===u&&(u="");let y=window.location.href.replace(/(#.+)?$/,u);y=y.replace("&&","&"),window.history.replaceState(window.history.state,null,y)},this._updateHash=Do(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const n=this._map.getCenter(),s=Math.round(100*this._map.getZoom())/100,o=Math.ceil((s*Math.LN2+Math.log(512/360/.5))/Math.LN10),u=Math.pow(10,o),y=Math.round(n.lng*u)/u,I=Math.round(n.lat*u)/u,v=this._map.getBearing(),S=this._map.getPitch();let T="";if(T+=e?`/${y}/${I}/${s}`:`${s}/${I}/${y}`,(v||S)&&(T+="/"+Math.round(10*v)/10),S&&(T+=`/${Math.round(S)}`),this._hashName){const M=this._hashName;let j=!1;const ee=window.location.hash.slice(1).split("&").map(ae=>{const Ae=ae.split("=")[0];return Ae===M?(j=!0,`${Ae}=${T}`):ae}).filter(ae=>ae);return j||ee.push(`${M}=${T}`),`#${ee.join("&")}`}return`#${T}`}}const js={linearity:.3,easing:g.b8(0,0,.3,1)},ka=g.e({deceleration:2500,maxSpeed:1400},js),ys=g.e({deceleration:20,maxSpeed:1400},js),ya=g.e({deceleration:1e3,maxSpeed:360},js),ul=g.e({deceleration:1e3,maxSpeed:90},js);class Al{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:at.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,n=at.now();for(;e.length>0&&n-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new g.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:u}of this._inertiaBuffer)n.zoom+=u.zoomDelta||0,n.bearing+=u.bearingDelta||0,n.pitch+=u.pitchDelta||0,u.panDelta&&n.pan._add(u.panDelta),u.around&&(n.around=u.around),u.pinchAround&&(n.pinchAround=u.pinchAround);const s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,o={};if(n.pan.mag()){const u=To(n.pan.mag(),s,g.e({},ka,e||{}));o.offset=n.pan.mult(u.amount/n.pan.mag()),o.center=this._map.transform.center,Mo(o,u)}if(n.zoom){const u=To(n.zoom,s,ys);o.zoom=this._map.transform.zoom+u.amount,Mo(o,u)}if(n.bearing){const u=To(n.bearing,s,ya);o.bearing=this._map.transform.bearing+g.ac(u.amount,-179,179),Mo(o,u)}if(n.pitch){const u=To(n.pitch,s,ul);o.pitch=this._map.transform.pitch+u.amount,Mo(o,u)}if(o.zoom||o.bearing){const u=void 0===n.pinchAround?n.around:n.pinchAround;o.around=u?this._map.unproject(u):this._map.getCenter()}return this.clear(),g.e(o,{noMoveStart:!0})}}function Mo(A,e){(!A.duration||A.duration<e.duration)&&(A.duration=e.duration,A.easing=e.easing)}function To(A,e,n){const{maxSpeed:s,linearity:o,deceleration:u}=n,y=g.ac(A*o/(e/1e3),-s,s),I=Math.abs(y)/(u*o);return{easing:n.easing,duration:1e3*I,amount:y*(I/2)}}class an extends g.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,s,o={}){const u=Ee.mousePos(n.getCanvas(),s),y=n.unproject(u);super(e,g.e({point:u,lngLat:y,originalEvent:s},o)),this._defaultPrevented=!1,this.target=n}}class _s extends g.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,s){const o="touchend"===e?s.changedTouches:s.touches,u=Ee.touchPos(n.getCanvasContainer(),o),y=u.map(v=>n.unproject(v)),I=u.reduce((v,S,T,M)=>v.add(S.div(M.length)),new g.P(0,0));super(e,{points:u,point:I,lngLats:y,lngLat:n.unproject(I),originalEvent:s}),this._defaultPrevented=!1}}class dl extends g.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,s){super(e,{originalEvent:s}),this._defaultPrevented=!1}}class fl{constructor(e,n){this._map=e,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new dl(e.type,this._map,e))}mousedown(e,n){return this._mousedownPos=n,this._firePreventable(new an(e.type,this._map,e))}mouseup(e){this._map.fire(new an(e.type,this._map,e))}click(e,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new an(e.type,this._map,e))}dblclick(e){return this._firePreventable(new an(e.type,this._map,e))}mouseover(e){this._map.fire(new an(e.type,this._map,e))}mouseout(e){this._map.fire(new an(e.type,this._map,e))}touchstart(e){return this._firePreventable(new _s(e.type,this._map,e))}touchmove(e){this._map.fire(new _s(e.type,this._map,e))}touchend(e){this._map.fire(new _s(e.type,this._map,e))}touchcancel(e){this._map.fire(new _s(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Qr{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new an(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new an("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new an(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class na{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(g.P.convert(e),this._map.terrain)}}class $r{constructor(e,n){this._map=e,this._tr=new na(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,n){this.isEnabled()&&e.shiftKey&&0===e.button&&(Ee.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(e,n){if(!this._active)return;const s=n;if(this._lastPos.equals(s)||!this._box&&s.dist(this._startPos)<this._clickTolerance)return;const o=this._startPos;this._lastPos=s,this._box||(this._box=Ee.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const u=Math.min(o.x,s.x),y=Math.max(o.x,s.x),I=Math.min(o.y,s.y),v=Math.max(o.y,s.y);Ee.setTransform(this._box,`translate(${u}px,${I}px)`),this._box.style.width=y-u+"px",this._box.style.height=v-I+"px"}mouseupWindow(e,n){if(!this._active||0!==e.button)return;const s=this._startPos,o=n;if(this.reset(),Ee.suppressClick(),s.x!==o.x||s.y!==o.y)return this._map.fire(new g.k("boxzoomend",{originalEvent:e})),{cameraAnimation:u=>u.fitScreenCoordinates(s,o,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(Ee.remove(this._box),this._box=null),Ee.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,n){return this._map.fire(new g.k(e,{originalEvent:n}))}}function Va(A,e){if(A.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${A.length}, points ${e.length}`);const n={};for(let s=0;s<A.length;s++)n[A[s].identifier]=e[s];return n}class Ys{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,n,s){(this.centroid||s.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),s.length===this.numTouches&&(this.centroid=function(o){const u=new g.P(0,0);for(const y of o)u._add(y);return u.div(o.length)}(n),this.touches=Va(s,n)))}touchmove(e,n,s){if(this.aborted||!this.centroid)return;const o=Va(s,n);for(const u in this.touches){const y=o[u];(!y||y.dist(this.touches[u])>30)&&(this.aborted=!0)}}touchend(e,n,s){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===s.length){const o=!this.aborted&&this.centroid;if(this.reset(),o)return o}}}class Is{constructor(e){this.singleTap=new Ys(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,n,s){this.singleTap.touchstart(e,n,s)}touchmove(e,n,s){this.singleTap.touchmove(e,n,s)}touchend(e,n,s){const o=this.singleTap.touchend(e,n,s);if(o){const u=e.timeStamp-this.lastTime<500,y=!this.lastTap||this.lastTap.dist(o)<30;if(u&&y||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=o,this.count===this.numTaps)return this.reset(),o}}}class Ma{constructor(e){this._tr=new na(e),this._zoomIn=new Is({numTouches:1,numTaps:2}),this._zoomOut=new Is({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,n,s){this._zoomIn.touchstart(e,n,s),this._zoomOut.touchstart(e,n,s)}touchmove(e,n,s){this._zoomIn.touchmove(e,n,s),this._zoomOut.touchmove(e,n,s)}touchend(e,n,s){const o=this._zoomIn.touchend(e,n,s),u=this._zoomOut.touchend(e,n,s),y=this._tr;return o?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:y.zoom+1,around:y.unproject(o)},{originalEvent:e})}):u?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:y.zoom-1,around:y.unproject(u)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class qn{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const n=this._moveFunction(...e);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(e,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,n){if(!this.isEnabled())return;const s=this._lastPoint;if(!s)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const o=n.length?n[0]:n;return!this._moved&&o.dist(s)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=o,this._move(s,o))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&Ee.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Zs={0:1,2:2};class Ta{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const n=Ee.mouseButton(e);this._eventButton=n}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(n,s){const o=Zs[s];return void 0===n.buttons||(n.buttons&o)!==o}(e,this._eventButton)}isValidEndEvent(e){return Ee.mouseButton(e)===this._eventButton}}class Ks{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return 1===e.targetTouches.length}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}const Po=A=>{A.mousedown=A.dragStart,A.mousemoveWindow=A.dragMove,A.mouseup=A.dragEnd,A.contextmenu=e=>{e.preventDefault()}},Kl=({enable:A,clickTolerance:e,bearingDegreesPerPixelMoved:n=.8})=>{const s=new Ta({checkCorrectEvent:o=>0===Ee.mouseButton(o)&&o.ctrlKey||2===Ee.mouseButton(o)});return new qn({clickTolerance:e,move:(o,u)=>({bearingDelta:(u.x-o.x)*n}),moveStateManager:s,enable:A,assignEvents:Po})},$l=({enable:A,clickTolerance:e,pitchDegreesPerPixelMoved:n=-.5})=>{const s=new Ta({checkCorrectEvent:o=>0===Ee.mouseButton(o)&&o.ctrlKey||2===Ee.mouseButton(o)});return new qn({clickTolerance:e,move:(o,u)=>({pitchDelta:(u.y-o.y)*n}),moveStateManager:s,enable:A,assignEvents:Po})};class bs{constructor(e,n){this._clickTolerance=e.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new g.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,n,s){return this._calculateTransform(e,n,s)}touchmove(e,n,s){if(this._active){if(!this._shouldBePrevented(s.length))return e.preventDefault(),this._calculateTransform(e,n,s);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,n,s){this._calculateTransform(e,n,s),this._active&&this._shouldBePrevented(s.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,n,s){s.length>0&&(this._active=!0);const o=Va(s,n),u=new g.P(0,0),y=new g.P(0,0);let I=0;for(const S in o){const T=o[S],M=this._touches[S];M&&(u._add(T),y._add(T.sub(M)),I++,o[S]=T)}if(this._touches=o,this._shouldBePrevented(I)||!y.mag())return;const v=y.div(I);return this._sum._add(v),this._sum.mag()<this._clickTolerance?void 0:{around:u.div(I),panDelta:v}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class pl{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,n,s){this._firstTwoTouches||s.length<2||(this._firstTwoTouches=[s[0].identifier,s[1].identifier],this._start([n[0],n[1]]))}touchmove(e,n,s){if(!this._firstTwoTouches)return;e.preventDefault();const[o,u]=this._firstTwoTouches,y=_a(s,n,o),I=_a(s,n,u);if(!y||!I)return;const v=this._aroundCenter?null:y.add(I).div(2);return this._move([y,I],v,e)}touchend(e,n,s){if(!this._firstTwoTouches)return;const[o,u]=this._firstTwoTouches,y=_a(s,n,o),I=_a(s,n,u);y&&I||(this._active&&Ee.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function _a(A,e,n){for(let s=0;s<A.length;s++)if(A[s].identifier===n)return e[s]}function Ro(A,e){return Math.log(A/e)/Math.LN2}class gl extends pl{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,n){const s=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Ro(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ro(this._distance,s),pinchAround:n}}}function ws(A,e){return 180*A.angleWith(e)/Math.PI}class vs extends pl{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,n,s){const o=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ws(this._vector,o),pinchAround:n}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const n=25/(Math.PI*this._minDiameter)*360,s=ws(e,this._startVector);return Math.abs(s)<n}}function $s(A){return Math.abs(A.y)>Math.abs(A.x)}class Pa extends pl{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,n,s){super.touchstart(e,n,s),this._currentTouchCount=s.length}_start(e){this._lastPoints=e,$s(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,n,s){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const o=e[0].sub(this._lastPoints[0]),u=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(o,u,s.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(o.y+u.y)/2*-.5}):void 0}gestureBeginsVertically(e,n,s){if(void 0!==this._valid)return this._valid;const o=e.mag()>=2,u=n.mag()>=2;if(!o&&!u)return;if(!o||!u)return void 0===this._firstMove&&(this._firstMove=s),s-this._firstMove<100&&void 0;const y=e.y>0==n.y>0;return $s(e)&&$s(n)&&y}}const Sc={panStep:100,bearingStep:15,pitchStep:10};class Mn{constructor(e){this._tr=new na(e);const n=Sc;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let n=0,s=0,o=0,u=0,y=0;switch(e.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:e.shiftKey?s=-1:(e.preventDefault(),u=-1);break;case 39:e.shiftKey?s=1:(e.preventDefault(),u=1);break;case 38:e.shiftKey?o=1:(e.preventDefault(),y=-1);break;case 40:e.shiftKey?o=-1:(e.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(s=0,o=0),{cameraAnimation:I=>{const v=this._tr;I.easeTo({duration:300,easeId:"keyboardHandler",easing:Jr,zoom:n?Math.round(v.zoom)+n*(e.shiftKey?2:1):v.zoom,bearing:v.bearing+s*this._bearingStep,pitch:v.pitch+o*this._pitchStep,offset:[-u*this._panStep,-y*this._panStep],center:v.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Jr(A){return A*(2-A)}const xs=4.000244140625;class gn{constructor(e,n){this._onTimeout=s=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(s)},this._map=e,this._tr=new na(e),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let n=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const s=at.now(),o=s-(this._lastWheelEventTime||0);this._lastWheelEventTime=s,0!==n&&n%xs==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),e.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=e,this._delta-=n,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const n=Ee.mousePos(this._map.getCanvas(),e),s=this._tr;this._around=n.y>s.transform.height/2-s.transform.getHorizon()?g.N.convert(this._aroundCenter?s.center:s.unproject(n)):g.N.convert(s.center),this._aroundPoint=s.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(0!==this._delta){const v="wheel"===this._type&&Math.abs(this._delta)>xs?this._wheelZoomRate:this._defaultZoomRate;let S=2/(1+Math.exp(-Math.abs(this._delta*v)));this._delta<0&&0!==S&&(S=1/S);const T="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(T*S))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const n="number"==typeof this._targetZoom?this._targetZoom:e.zoom,s=this._startZoom,o=this._easing;let u,y=!1;const I=at.now()-this._lastWheelEventTime;if("wheel"===this._type&&s&&o&&I){const v=Math.min(I/200,1),S=o(v);u=g.y.number(s,n,S),v<1?this._frameId||(this._frameId=!0):y=!0}else u=n,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!y,zoomDelta:u-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let n=g.b9;if(this._prevEase){const s=this._prevEase,o=(at.now()-s.start)/s.duration,u=s.easing(o+.01)-s.easing(o),y=.27/Math.sqrt(u*u+1e-4)*.01,I=Math.sqrt(.0729-y*y);n=g.b8(y,I,.25,1)}return this._prevEase={start:at.now(),duration:e,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class aa{constructor(e,n){this._clickZoom=e,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Xl{constructor(e){this._tr=new na(e),this.reset()}reset(){this._active=!1}dblclick(e,n){return e.preventDefault(),{cameraAnimation:s=>{s.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ml{constructor(){this._tap=new Is({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,n,s){if(!this._swipePoint)if(this._tapTime){const o=n[0],u=e.timeStamp-this._tapTime<500,y=this._tapPoint.dist(o)<30;u&&y?s.length>0&&(this._swipePoint=o,this._swipeTouch=s[0].identifier):this.reset()}else this._tap.touchstart(e,n,s)}touchmove(e,n,s){if(this._tapTime){if(this._swipePoint){if(s[0].identifier!==this._swipeTouch)return;const o=n[0],u=o.y-this._swipePoint.y;return this._swipePoint=o,e.preventDefault(),this._active=!0,{zoomDelta:u/128}}}else this._tap.touchmove(e,n,s)}touchend(e,n,s){if(this._tapTime)this._swipePoint&&0===s.length&&this.reset();else{const o=this._tap.touchend(e,n,s);o&&(this._tapTime=e.timeStamp,this._tapPoint=o)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class yl{constructor(e,n,s){this._el=e,this._mousePan=n,this._touchPan=s}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Wl{constructor(e,n,s){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=n,this._mousePitch=s}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class _l{constructor(e,n,s,o){this._el=e,this._touchZoom=n,this._touchRotate=s,this._tapDragZoom=o,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Bs{constructor(e,n){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=Ee.create("div","maplibregl-cooperative-gesture-screen",e);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const s=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),o=document.createElement("div");o.className="maplibregl-desktop-message",o.textContent=n,this._container.appendChild(o);const u=document.createElement("div");u.className="maplibregl-mobile-message",u.textContent=s,this._container.appendChild(u),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(Ee.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,n){this._enabled&&(this._map.fire(new g.k("cooperativegestureprevented",{gestureType:e,originalEvent:n})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Bn=A=>A.zoom||A.drag||A.pitch||A.rotate;class Ht extends g.k{}function Ha(A){return A.panDelta&&A.panDelta.mag()||A.zoomDelta||A.bearingDelta||A.pitchDelta}class sn{constructor(e,n){this.handleWindowEvent=o=>{this.handleEvent(o,`${o.type}Window`)},this.handleEvent=(o,u)=>{if("blur"===o.type)return void this.stop(!0);this._updatingCamera=!0;const y="renderFrame"===o.type?void 0:o,I={needsRenderFrame:!1},v={},S={},T=o.touches,M=T?this._getMapTouches(T):void 0,j=M?Ee.touchPos(this._map.getCanvas(),M):Ee.mousePos(this._map.getCanvas(),o);for(const{handlerName:Ae,handler:_e,allowed:we}of this._handlers){if(!_e.isEnabled())continue;let Ce;this._blockedByActive(S,we,Ae)?_e.reset():_e[u||o.type]&&(Ce=_e[u||o.type](o,j,M),this.mergeHandlerResult(I,v,Ce,Ae,y),Ce&&Ce.needsRenderFrame&&this._triggerRenderFrame()),(Ce||_e.isActive())&&(S[Ae]=_e)}const ee={};for(const Ae in this._previousActiveHandlers)S[Ae]||(ee[Ae]=y);this._previousActiveHandlers=S,(Object.keys(ee).length||Ha(I))&&(this._changes.push([I,v,ee]),this._triggerRenderFrame()),(Object.keys(S).length||Ha(I))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ae}=I;ae&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ae(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Al(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);const s=this._el;this._listeners=[[s,"touchstart",{passive:!0}],[s,"touchmove",{passive:!1}],[s,"touchend",void 0],[s,"touchcancel",void 0],[s,"mousedown",void 0],[s,"mousemove",void 0],[s,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[s,"mouseover",void 0],[s,"mouseout",void 0],[s,"dblclick",void 0],[s,"click",void 0],[s,"keydown",{capture:!1}],[s,"keyup",void 0],[s,"wheel",{passive:!1}],[s,"contextmenu",void 0],[window,"blur",void 0]];for(const[o,u,y]of this._listeners)Ee.addEventListener(o,u,o===document?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(const[e,n,s]of this._listeners)Ee.removeEventListener(e,n,e===document?this.handleWindowEvent:this.handleEvent,s)}_addDefaultHandlers(e){const n=this._map,s=n.getCanvasContainer();this._add("mapEvent",new fl(n,e));const o=n.boxZoom=new $r(n,e);this._add("boxZoom",o),e.interactive&&e.boxZoom&&o.enable();const u=n.cooperativeGestures=new Bs(n,e.cooperativeGestures);this._add("cooperativeGestures",u),e.cooperativeGestures&&u.enable();const y=new Ma(n),I=new Xl(n);n.doubleClickZoom=new aa(I,y),this._add("tapZoom",y),this._add("clickZoom",I),e.interactive&&e.doubleClickZoom&&n.doubleClickZoom.enable();const v=new ml;this._add("tapDragZoom",v);const S=n.touchPitch=new Pa(n);this._add("touchPitch",S),e.interactive&&e.touchPitch&&n.touchPitch.enable(e.touchPitch);const T=Kl(e),M=$l(e);n.dragRotate=new Wl(e,T,M),this._add("mouseRotate",T,["mousePitch"]),this._add("mousePitch",M,["mouseRotate"]),e.interactive&&e.dragRotate&&n.dragRotate.enable();const j=(({enable:Ce,clickTolerance:de})=>{const Me=new Ta({checkCorrectEvent:ze=>0===Ee.mouseButton(ze)&&!ze.ctrlKey});return new qn({clickTolerance:de,move:(ze,Ve)=>({around:Ve,panDelta:Ve.sub(ze)}),activateOnStart:!0,moveStateManager:Me,enable:Ce,assignEvents:Po})})(e),ee=new bs(e,n);n.dragPan=new yl(s,j,ee),this._add("mousePan",j),this._add("touchPan",ee,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&n.dragPan.enable(e.dragPan);const ae=new vs,Ae=new gl;n.touchZoomRotate=new _l(s,Ae,ae,v),this._add("touchRotate",ae,["touchPan","touchZoom"]),this._add("touchZoom",Ae,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&n.touchZoomRotate.enable(e.touchZoomRotate);const _e=n.scrollZoom=new gn(n,()=>this._triggerRenderFrame());this._add("scrollZoom",_e,["mousePan"]),e.interactive&&e.scrollZoom&&n.scrollZoom.enable(e.scrollZoom);const we=n.keyboard=new Mn(n);this._add("keyboard",we),e.interactive&&e.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new Qr(n))}_add(e,n,s){this._handlers.push({handlerName:e,handler:n,allowed:s}),this._handlersById[e]=n}stop(e){if(!this._updatingCamera){for(const{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Bn(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,n,s){for(const o in e)if(o!==s&&(!n||n.indexOf(o)<0))return!0;return!1}_getMapTouches(e){const n=[];for(const s of e)this._el.contains(s.target)&&n.push(s);return n}mergeHandlerResult(e,n,s,o,u){if(!s)return;g.e(e,s);const y={handlerName:o,originalEvent:s.originalEvent||u};void 0!==s.zoomDelta&&(n.zoom=y),void 0!==s.panDelta&&(n.drag=y),void 0!==s.pitchDelta&&(n.pitch=y),void 0!==s.bearingDelta&&(n.rotate=y)}_applyChanges(){const e={},n={},s={};for(const[o,u,y]of this._changes)o.panDelta&&(e.panDelta=(e.panDelta||new g.P(0,0))._add(o.panDelta)),o.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+o.zoomDelta),o.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+o.bearingDelta),o.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+o.pitchDelta),void 0!==o.around&&(e.around=o.around),void 0!==o.pinchAround&&(e.pinchAround=o.pinchAround),o.noInertia&&(e.noInertia=o.noInertia),g.e(n,u),g.e(s,y);this._updateMapTransform(e,n,s),this._changes=[]}_updateMapTransform(e,n,s){const o=this._map,u=o._getTransformForUpdate(),y=o.terrain;if(!(Ha(e)||y&&this._terrainMovement))return this._fireEvents(n,s,!0);let{panDelta:I,zoomDelta:v,bearingDelta:S,pitchDelta:T,around:M,pinchAround:j}=e;void 0!==j&&(M=j),o._stop(!0),M=M||o.transform.centerPoint;const ee=u.pointLocation(I?M.sub(I):M);S&&(u.bearing+=S),T&&(u.pitch+=T),v&&(u.zoom+=v),y?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?u.center=u.pointLocation(u.centerPoint.sub(I)):u.setLocationAtPoint(ee,M):(this._terrainMovement=!0,this._map._elevationFreeze=!0,u.setLocationAtPoint(ee,M)):u.setLocationAtPoint(ee,M),o._applyUpdatedTransform(u),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(n,s,!0)}_fireEvents(e,n,s){const o=Bn(this._eventsInProgress),u=Bn(e),y={};for(const M in e){const{originalEvent:j}=e[M];this._eventsInProgress[M]||(y[`${M}start`]=j),this._eventsInProgress[M]=e[M]}!o&&u&&this._fireEvent("movestart",u.originalEvent);for(const M in y)this._fireEvent(M,y[M]);u&&this._fireEvent("move",u.originalEvent);for(const M in e){const{originalEvent:j}=e[M];this._fireEvent(M,j)}const I={};let v;for(const M in this._eventsInProgress){const{handlerName:j,originalEvent:ee}=this._eventsInProgress[M];this._handlersById[j].isActive()||(delete this._eventsInProgress[M],v=n[j]||ee,I[`${M}end`]=v)}for(const M in I)this._fireEvent(M,I[M]);const S=Bn(this._eventsInProgress),T=(o||u)&&!S;if(T&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const M=this._map._getTransformForUpdate();M.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(M)}if(s&&T){this._updatingCamera=!0;const M=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),j=ee=>0!==ee&&-this._bearingSnap<ee&&ee<this._bearingSnap;!M||!M.essential&&at.prefersReducedMotion?(this._map.fire(new g.k("moveend",{originalEvent:v})),j(this._map.getBearing())&&this._map.resetNorth()):(j(M.bearing||this._map.getBearing())&&(M.bearing=0),M.freezeElevation=!0,this._map.easeTo(M,{originalEvent:v})),this._updatingCamera=!1}}_fireEvent(e,n){this._map.fire(new g.k(e,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new Ht("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class sa extends g.E{constructor(e,n){super(),this._renderFrameCallback=()=>{const s=Math.min((at.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(s)),s<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new g.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,n){return this.jumpTo({center:e},n)}panBy(e,n,s){return e=g.P.convert(e).mult(-1),this.panTo(this.transform.center,g.e({offset:e},n),s)}panTo(e,n,s){return this.easeTo(g.e({center:e},n),s)}getZoom(){return this.transform.zoom}setZoom(e,n){return this.jumpTo({zoom:e},n),this}zoomTo(e,n,s){return this.easeTo(g.e({zoom:e},n),s)}zoomIn(e,n){return this.zoomTo(this.getZoom()+1,e,n),this}zoomOut(e,n){return this.zoomTo(this.getZoom()-1,e,n),this}getBearing(){return this.transform.bearing}setBearing(e,n){return this.jumpTo({bearing:e},n),this}getPadding(){return this.transform.padding}setPadding(e,n){return this.jumpTo({padding:e},n),this}rotateTo(e,n,s){return this.easeTo(g.e({bearing:e},n),s)}resetNorth(e,n){return this.rotateTo(0,g.e({duration:1e3},e),n),this}resetNorthPitch(e,n){return this.easeTo(g.e({bearing:0,pitch:0,duration:1e3},e),n),this}snapToNorth(e,n){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,n):this}getPitch(){return this.transform.pitch}setPitch(e,n){return this.jumpTo({pitch:e},n),this}cameraForBounds(e,n){e=Ze.convert(e).adjustAntiMeridian();const s=n&&n.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),s,n)}_cameraForBoxAndBearing(e,n,s,o){const u={top:0,bottom:0,right:0,left:0};if("number"==typeof(o=g.e({padding:u,offset:[0,0],maxZoom:this.transform.maxZoom},o)).padding){const St=o.padding;o.padding={top:St,bottom:St,right:St,left:St}}o.padding=g.e(u,o.padding);const y=this.transform,I=y.padding,v=new Ze(e,n),S=y.project(v.getNorthWest()),T=y.project(v.getNorthEast()),M=y.project(v.getSouthEast()),j=y.project(v.getSouthWest()),ee=g.ba(-s),ae=S.rotate(ee),Ae=T.rotate(ee),_e=M.rotate(ee),we=j.rotate(ee),Ce=new g.P(Math.max(ae.x,Ae.x,we.x,_e.x),Math.max(ae.y,Ae.y,we.y,_e.y)),de=new g.P(Math.min(ae.x,Ae.x,we.x,_e.x),Math.min(ae.y,Ae.y,we.y,_e.y)),Me=Ce.sub(de),ze=(y.width-(I.left+I.right+o.padding.left+o.padding.right))/Me.x,Ve=(y.height-(I.top+I.bottom+o.padding.top+o.padding.bottom))/Me.y;if(Ve<0||ze<0)return void g.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const tt=Math.min(y.scaleZoom(y.scale*Math.min(ze,Ve)),o.maxZoom),xt=g.P.convert(o.offset),Pt=new g.P((o.padding.left-o.padding.right)/2,(o.padding.top-o.padding.bottom)/2).rotate(g.ba(s)),Ot=xt.add(Pt).mult(y.scale/y.zoomScale(tt));return{center:y.unproject(S.add(M).div(2).sub(Ot)),zoom:tt,bearing:s}}fitBounds(e,n,s){return this._fitInternal(this.cameraForBounds(e,n),n,s)}fitScreenCoordinates(e,n,s,o,u){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(g.P.convert(e)),this.transform.pointLocation(g.P.convert(n)),s,o),o,u)}_fitInternal(e,n,s){return e?(delete(n=g.e(e,n)).padding,n.linear?this.easeTo(n,s):this.flyTo(n,s)):this}jumpTo(e,n){this.stop();const s=this._getTransformForUpdate();let o=!1,u=!1,y=!1;return"zoom"in e&&s.zoom!==+e.zoom&&(o=!0,s.zoom=+e.zoom),void 0!==e.center&&(s.center=g.N.convert(e.center)),"bearing"in e&&s.bearing!==+e.bearing&&(u=!0,s.bearing=+e.bearing),"pitch"in e&&s.pitch!==+e.pitch&&(y=!0,s.pitch=+e.pitch),null==e.padding||s.isPaddingEqual(e.padding)||(s.padding=e.padding),this._applyUpdatedTransform(s),this.fire(new g.k("movestart",n)).fire(new g.k("move",n)),o&&this.fire(new g.k("zoomstart",n)).fire(new g.k("zoom",n)).fire(new g.k("zoomend",n)),u&&this.fire(new g.k("rotatestart",n)).fire(new g.k("rotate",n)).fire(new g.k("rotateend",n)),y&&this.fire(new g.k("pitchstart",n)).fire(new g.k("pitch",n)).fire(new g.k("pitchend",n)),this.fire(new g.k("moveend",n))}calculateCameraOptionsFromTo(e,n,s,o=0){const u=g.Z.fromLngLat(e,n),y=g.Z.fromLngLat(s,o),I=y.x-u.x,v=y.y-u.y,S=y.z-u.z,T=Math.hypot(I,v,S);if(0===T)throw new Error("Can't calculate camera options with same From and To");const M=Math.hypot(I,v),j=this.transform.scaleZoom(this.transform.cameraToCenterDistance/T/this.transform.tileSize),ee=180*Math.atan2(I,-v)/Math.PI;let ae=180*Math.acos(M/T)/Math.PI;return ae=S<0?90-ae:90+ae,{center:y.toLngLat(),zoom:j,pitch:ae,bearing:ee}}easeTo(e,n){var s;this._stop(!1,e.easeId),(!1===(e=g.e({offset:[0,0],duration:500,easing:g.b9},e)).animate||!e.essential&&at.prefersReducedMotion)&&(e.duration=0);const o=this._getTransformForUpdate(),u=o.zoom,y=o.bearing,I=o.pitch,v=o.padding,S="bearing"in e?this._normalizeBearing(e.bearing,y):y,T="pitch"in e?+e.pitch:I,M="padding"in e?e.padding:o.padding,j=g.P.convert(e.offset);let ee=o.centerPoint.add(j);const ae=o.pointLocation(ee),{center:Ae,zoom:_e}=o.getConstrained(g.N.convert(e.center||ae),null!==(s=e.zoom)&&void 0!==s?s:u);this._normalizeCenter(Ae,o);const we=o.project(ae),Ce=o.project(Ae).sub(we),de=o.zoomScale(_e-u);let Me,ze;e.around&&(Me=g.N.convert(e.around),ze=o.locationPoint(Me));const Ve={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||_e!==u,this._rotating=this._rotating||y!==S,this._pitching=this._pitching||T!==I,this._padding=!o.isPaddingEqual(M),this._easeId=e.easeId,this._prepareEase(n,e.noMoveStart,Ve),this.terrain&&this._prepareElevation(Ae),this._ease(tt=>{if(this._zooming&&(o.zoom=g.y.number(u,_e,tt)),this._rotating&&(o.bearing=g.y.number(y,S,tt)),this._pitching&&(o.pitch=g.y.number(I,T,tt)),this._padding&&(o.interpolatePadding(v,M,tt),ee=o.centerPoint.add(j)),this.terrain&&!e.freezeElevation&&this._updateElevation(tt),Me)o.setLocationAtPoint(Me,ze);else{const xt=o.zoomScale(o.zoom-u),Pt=_e>u?Math.min(2,de):Math.max(.5,de),Ot=Math.pow(Pt,1-tt),St=o.unproject(we.add(Ce.mult(tt*Ot)).mult(xt));o.setLocationAtPoint(o.renderWorldCopies?St.wrap():St,ee)}this._applyUpdatedTransform(o),this._fireMoveEvents(n)},tt=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n,tt)},e),this}_prepareEase(e,n,s={}){this._moving=!0,n||s.moving||this.fire(new g.k("movestart",e)),this._zooming&&!s.zooming&&this.fire(new g.k("zoomstart",e)),this._rotating&&!s.rotating&&this.fire(new g.k("rotatestart",e)),this._pitching&&!s.pitching&&this.fire(new g.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&n!==this._elevationTarget){const s=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(s-(n-(s*e+this._elevationStart))/(1-e)),this._elevationTarget=n}this.transform.elevation=g.y.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){const n=e.getCameraPosition(),s=this.terrain.getElevationForLngLatZoom(n.lngLat,e.zoom);if(n.altitude<s){const o=this.calculateCameraOptionsFromTo(n.lngLat,s,e.center,e.elevation);return{pitch:o.pitch,zoom:o.zoom}}return{}}_applyUpdatedTransform(e){const n=[];if(this.terrain&&n.push(o=>this._elevateCameraIfInsideTerrain(o)),this.transformCameraUpdate&&n.push(o=>this.transformCameraUpdate(o)),!n.length)return;const s=e.clone();for(const o of n){const u=s.clone(),{center:y,zoom:I,pitch:v,bearing:S,elevation:T}=o(u);y&&(u.center=y),void 0!==I&&(u.zoom=I),void 0!==v&&(u.pitch=v),void 0!==S&&(u.bearing=S),void 0!==T&&(u.elevation=T),s.apply(u)}this.transform.apply(s)}_fireMoveEvents(e){this.fire(new g.k("move",e)),this._zooming&&this.fire(new g.k("zoom",e)),this._rotating&&this.fire(new g.k("rotate",e)),this._pitching&&this.fire(new g.k("pitch",e))}_afterEase(e,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;const s=this._zooming,o=this._rotating,u=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,s&&this.fire(new g.k("zoomend",e)),o&&this.fire(new g.k("rotateend",e)),u&&this.fire(new g.k("pitchend",e)),this.fire(new g.k("moveend",e))}flyTo(e,n){var s;if(!e.essential&&at.prefersReducedMotion){const Ft=g.M(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ft,n)}this.stop(),e=g.e({offset:[0,0],speed:1.2,curve:1.42,easing:g.b9},e);const o=this._getTransformForUpdate(),u=o.zoom,y=o.bearing,I=o.pitch,v=o.padding,S="bearing"in e?this._normalizeBearing(e.bearing,y):y,T="pitch"in e?+e.pitch:I,M="padding"in e?e.padding:o.padding,j=g.P.convert(e.offset);let ee=o.centerPoint.add(j);const ae=o.pointLocation(ee),{center:Ae,zoom:_e}=o.getConstrained(g.N.convert(e.center||ae),null!==(s=e.zoom)&&void 0!==s?s:u);this._normalizeCenter(Ae,o);const we=o.zoomScale(_e-u),Ce=o.project(ae),de=o.project(Ae).sub(Ce);let Me=e.curve;const ze=Math.max(o.width,o.height),Ve=ze/we,tt=de.mag();if("minZoom"in e){const Ft=g.ac(Math.min(e.minZoom,u,_e),o.minZoom,o.maxZoom),_i=ze/o.zoomScale(Ft-u);Me=Math.sqrt(_i/tt*2)}const xt=Me*Me;function Pt(Ft){const _i=(Ve*Ve-ze*ze+(Ft?-1:1)*xt*xt*tt*tt)/(2*(Ft?Ve:ze)*xt*tt);return Math.log(Math.sqrt(_i*_i+1)-_i)}function Ot(Ft){return(Math.exp(Ft)-Math.exp(-Ft))/2}function St(Ft){return(Math.exp(Ft)+Math.exp(-Ft))/2}const Mt=Pt(!1);let jt=function(Ft){return St(Mt)/St(Mt+Me*Ft)},pi=function(Ft){return ze*((St(Mt)*(Ot(_i=Mt+Me*Ft)/St(_i))-Ot(Mt))/xt)/tt;var _i},Et=(Pt(!0)-Mt)/Me;if(Math.abs(tt)<1e-6||!isFinite(Et)){if(Math.abs(ze-Ve)<1e-6)return this.easeTo(e,n);const Ft=Ve<ze?-1:1;Et=Math.abs(Math.log(Ve/ze))/Me,pi=()=>0,jt=_i=>Math.exp(Ft*Me*_i)}return e.duration="duration"in e?+e.duration:1e3*Et/("screenSpeed"in e?+e.screenSpeed/Me:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=y!==S,this._pitching=T!==I,this._padding=!o.isPaddingEqual(M),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(Ae),this._ease(Ft=>{const _i=Ft*Et,ar=1/jt(_i);o.zoom=1===Ft?_e:u+o.scaleZoom(ar),this._rotating&&(o.bearing=g.y.number(y,S,Ft)),this._pitching&&(o.pitch=g.y.number(I,T,Ft)),this._padding&&(o.interpolatePadding(v,M,Ft),ee=o.centerPoint.add(j)),this.terrain&&!e.freezeElevation&&this._updateElevation(Ft);const Mi=1===Ft?Ae:o.unproject(Ce.add(de.mult(pi(_i))).mult(ar));o.setLocationAtPoint(o.renderWorldCopies?Mi.wrap():Mi,ee),this._applyUpdatedTransform(o),this._fireMoveEvents(n)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,n){var s;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const o=this._onEaseEnd;delete this._onEaseEnd,o.call(this,n)}return e||null===(s=this.handlers)||void 0===s||s.stop(!1),this}_ease(e,n,s){!1===s.animate||0===s.duration?(e(1),n()):(this._easeStart=at.now(),this._easeOptions=s,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,n){e=g.b3(e,-180,180);const s=Math.abs(e-n);return Math.abs(e-360-n)<s&&(e-=360),Math.abs(e+360-n)<s&&(e+=360),e}_normalizeCenter(e,n){if(!n.renderWorldCopies||n.lngRange)return;const s=e.lng-n.center.lng;e.lng+=s>180?-360:s<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(g.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}const Cs={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Es{constructor(e=Cs){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=n=>{!n||"metadata"!==n.sourceDataType&&"visibility"!==n.sourceDataType&&"style"!==n.dataType&&"terrain"!==n.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=Ee.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=Ee.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=Ee.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){Ee.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,n){const s=this._map._getUIString(`AttributionControl.${n}`);e.title=s,e.setAttribute("aria-label",s)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(o=>"string"!=typeof o?"":o)):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}const n=this._map.style.sourceCaches;for(const o in n){const u=n[o];if(u.used||u.usedForTerrain){const y=u.getSource();y.attribution&&e.indexOf(y.attribution)<0&&e.push(y.attribution)}}e=e.filter(o=>String(o).trim()),e.sort((o,u)=>o.length-u.length),e=e.filter((o,u)=>{for(let y=u+1;y<e.length;y++)if(e[y].indexOf(o)>=0)return!1;return!0});const s=e.join(" | ");s!==this._attribHTML&&(this._attribHTML=s,e.length?(this._innerContainer.innerHTML=s,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Il{constructor(e={}){this._updateCompact=()=>{const n=this._container.children;if(n.length){const s=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&s.classList.add("maplibregl-compact"):s.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=Ee.create("div","maplibregl-ctrl");const n=Ee.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){Ee.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ni{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const n=++this._id;return this._queue.push({callback:e,id:n,cancelled:!1}),n}remove(e){const n=this._currentlyRunning,s=n?this._queue.concat(n):this._queue;for(const o of s)if(o.id===e)return void(o.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const n=this._currentlyRunning=this._queue;this._queue=[];for(const s of n)if(!s.cancelled&&(s.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var bl=g.Y([{name:"a_pos3d",type:"Int16",components:3}]);class ec extends g.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,n){this.sourceCache.update(e,n),this._renderableTilesKeys=[];const s={};for(const o of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))s[o.key]=!0,this._renderableTilesKeys.push(o.key),this._tiles[o.key]||(o.posMatrix=new Float64Array(16),g.aP(o.posMatrix,0,g.X,0,g.X,0,1),this._tiles[o.key]=new Ti(o,this.tileSize));for(const o in this._tiles)s[o]||delete this._tiles[o]}freeRtt(e){for(const n in this._tiles){const s=this._tiles[n];(!e||s.tileID.equals(e)||s.tileID.isChildOf(e)||e.isChildOf(s.tileID))&&(s.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){const n={};for(const s of this._renderableTilesKeys){const o=this._tiles[s].tileID;if(o.canonical.equals(e.canonical)){const u=e.clone();u.posMatrix=new Float64Array(16),g.aP(u.posMatrix,0,g.X,0,g.X,0,1),n[s]=u}else if(o.canonical.isChildOf(e.canonical)){const u=e.clone();u.posMatrix=new Float64Array(16);const y=o.canonical.z-e.canonical.z,I=o.canonical.x-(o.canonical.x>>y<<y),v=o.canonical.y-(o.canonical.y>>y<<y),S=g.X>>y;g.aP(u.posMatrix,0,S,0,S,0,1),g.J(u.posMatrix,u.posMatrix,[-I*S,-v*S,0]),n[s]=u}else if(e.canonical.isChildOf(o.canonical)){const u=e.clone();u.posMatrix=new Float64Array(16);const y=e.canonical.z-o.canonical.z,I=e.canonical.x-(e.canonical.x>>y<<y),v=e.canonical.y-(e.canonical.y>>y<<y),S=g.X>>y;g.aP(u.posMatrix,0,g.X,0,g.X,0,1),g.J(u.posMatrix,u.posMatrix,[I*S,v*S,0]),g.K(u.posMatrix,u.posMatrix,[1/2**y,1/2**y,0]),n[s]=u}}return n}getSourceTile(e,n){const s=this.sourceCache._source;let o=e.overscaledZ-this.deltaZoom;if(o>s.maxzoom&&(o=s.maxzoom),o<s.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(o).key);let u=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!u||!u.dem)&&n)for(;o>=s.minzoom&&(!u||!u.dem);)u=this.sourceCache.getTileByID(e.scaledTo(o--).key);return u}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=e)}}class wl{constructor(e,n,s){this.painter=e,this.sourceCache=new ec(n),this.options=s,this.exaggeration="number"==typeof s.exaggeration?s.exaggeration:1,this.qual
vendor: 4,094 bytes, line 3
3ityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,n,s,o=g.X){var u;if(!(n>=0&&n<o&&s>=0&&s<o))return 0;const y=this.getTerrainData(e),I=null===(u=y.tile)||void 0===u?void 0:u.dem;if(!I)return 0;const v=((ae=[])[0]=(_e=y.u_terrain_matrix)[0]*(we=(Ae=[n/o*g.X,s/o*g.X])[0])+_e[4]*(Ce=Ae[1])+_e[12],ae[1]=_e[1]*we+_e[5]*Ce+_e[13],ae),S=[v[0]*I.dim,v[1]*I.dim],T=Math.floor(S[0]),M=Math.floor(S[1]),j=S[0]-T,ee=S[1]-M;var ae,Ae,_e,we,Ce;return I.get(T,M)*(1-j)*(1-ee)+I.get(T+1,M)*j*(1-ee)+I.get(T,M+1)*(1-j)*ee+I.get(T+1,M+1)*j*ee}getElevationForLngLatZoom(e,n){if(!g.bb(n,e.wrap()))return 0;const{tileID:s,mercatorX:o,mercatorY:u}=this._getOverscaledTileIDFromLngLatZoom(e,n);return this.getElevation(s,o%g.X,u%g.X,g.X)}getElevation(e,n,s,o=g.X){return this.getDEMElevation(e,n,s,o)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const o=this.painter.context,u=new g.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new mt(o,u,o.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new mt(o,new g.R({width:1,height:1}),o.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(o.gl.NEAREST,o.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=g.an([])}const n=this.sourceCache.getSourceTile(e,!0);if(n&&n.dem&&(!n.demTexture||n.needsTerrainPrepare)){const o=this.painter.context;n.demTexture=this.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new mt(o,n.dem.getPixels(),o.gl.RGBA,{premultiply:!1}),n.demTexture.bind(o.gl.NEAREST,o.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}const s=n&&n+n.tileID.key+e.key;if(s&&!this._demMatrixCache[s]){const o=this.sourceCache.sourceCache._source.maxzoom;let u=e.canonical.z-n.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=o?u=e.canonical.z-o:g.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const y=e.canonical.x-(e.canonical.x>>u<<u),I=e.canonical.y-(e.canonical.y>>u<<u),v=g.bc(new Float64Array(16),[1/(g.X<<u),1/(g.X<<u),0]);g.J(v,v,[y*g.X,I*g.X,0]),this._demMatrixCache[e.key]={matrix:v,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:n&&n.dem&&n.dem.dim||1,u_terrain_matrix:s?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:n&&n.dem&&n.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(n&&n.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}getFramebuffer(e){const n=this.painter,s=n.width/devicePixelRatio,o=n.height/devicePixelRatio;return!this._fbo||this._fbo.width===s&&this._fbo.height===o||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new mt(n.context,{width:s,height:o,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new mt(n.context,{width:s,height:o,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=n.context.createFramebuffer(s,o,!0,!1),this._fbo.depthAttachment.set(n.context.createRenderbuffer(n.context.gl.DEPTH_COMPONENT16,s,o))),this._fbo.colorAttachment.set("coords"===e?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const n=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let u=0,y=0;u<this._coordsTextureSize;u++)for(let I=0;I<this._coordsTextureSize;I++,y+=4)n[y+0]=255&I,n[y+1]=255&u,n[y+2]=I>>8<<4|u>>8,n[y+3]=0;const s=new g.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),o=new mt(e,s,e.gl.RGBA,{premultiply:!1});return o.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=o,o}
vendor: 21,671 bytes, line 3
3pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const n=new Uint8Array(4),s=this.painter.context,o=s.gl,u=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),y=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),I=Math.round(this.painter.height/devicePixelRatio);s.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),o.readPixels(u,I-y-1,1,1,o.RGBA,o.UNSIGNED_BYTE,n),s.bindFramebuffer.set(null);const v=n[0]+(n[2]>>4<<8),S=n[1]+((15&n[2])<<8),T=this.coordsIndex[255-n[3]],M=T&&this.sourceCache.getTileByID(T);if(!M)return null;const j=this._coordsTextureSize,ee=(1<<M.tileID.canonical.z)*j;return new g.Z((M.tileID.canonical.x*j+v)/ee+M.tileID.wrap,(M.tileID.canonical.y*j+S)/ee,this.getElevation(M.tileID,v,S,j))}depthAtPoint(e){const n=new Uint8Array(4),s=this.painter.context,o=s.gl;return s.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),o.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,o.RGBA,o.UNSIGNED_BYTE,n),s.bindFramebuffer.set(null),(n[0]/16777216+n[1]/65536+n[2]/256+n[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const e=this.painter.context,n=new g.bd,s=new g.aY,o=this.meshSize,u=g.X/o,y=o*o;for(let M=0;M<=o;M++)for(let j=0;j<=o;j++)n.emplaceBack(j*u,M*u,0);for(let M=0;M<y;M+=o+1)for(let j=0;j<o;j++)s.emplaceBack(j+M,o+j+M+1,o+j+M+2),s.emplaceBack(j+M,o+j+M+2,j+M+1);const I=n.length,v=I+2*(o+1);for(const M of[0,1])for(let j=0;j<=o;j++)for(const ee of[0,1])n.emplaceBack(j*u,M*g.X,ee);for(let M=0;M<2*o;M+=2)s.emplaceBack(v+M,v+M+1,v+M+3),s.emplaceBack(v+M,v+M+3,v+M+2),s.emplaceBack(I+M,I+M+3,I+M+1),s.emplaceBack(I+M,I+M+2,I+M+3);const S=n.length,T=S+2*(o+1);for(const M of[0,1])for(let j=0;j<=o;j++)for(const ee of[0,1])n.emplaceBack(M*g.X,j*u,ee);for(let M=0;M<2*o;M+=2)s.emplaceBack(S+M,S+M+1,S+M+3),s.emplaceBack(S+M,S+M+3,S+M+2),s.emplaceBack(T+M,T+M+3,T+M+1),s.emplaceBack(T+M,T+M+2,T+M+3);return this._mesh=new ll(e.createVertexBuffer(n,bl.members),e.createIndexBuffer(s),g.a0.simpleSegment(0,0,n.length,s.length)),this._mesh}getMeshFrameDelta(e){return 2*Math.PI*g.be/Math.pow(2,e)/5}getMinTileElevationForLngLatZoom(e,n){var s;const{tileID:o}=this._getOverscaledTileIDFromLngLatZoom(e,n);return null!==(s=this.getMinMaxElevation(o).minElevation)&&void 0!==s?s:0}getMinMaxElevation(e){const n=this.getTerrainData(e).tile,s={minElevation:null,maxElevation:null};return n&&n.dem&&(s.minElevation=n.dem.min*this.exaggeration,s.maxElevation=n.dem.max*this.exaggeration),s}_getOverscaledTileIDFromLngLatZoom(e,n){const s=g.Z.fromLngLat(e.wrap()),o=(1<<n)*g.X,u=s.x*o,y=s.y*o,I=Math.floor(u/g.X),v=Math.floor(y/g.X);return{tileID:new g.S(n,0,n,I,v),mercatorX:u,mercatorY:y}}}class tc{constructor(e,n,s){this._context=e,this._size=n,this._tileSize=s,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const n=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),s=new mt(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return s.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),n.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),n.colorAttachment.set(s.texture),{id:e,fbo:n,texture:s,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(n=>e.id!==n),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(e=>!e.inUse)}}const Qs={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ic{constructor(e,n){this.painter=e,this.terrain=n,this.pool=new tc(e.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(s=>!e._layers[s].isHidden(n)),this._coordsDescendingInv={};for(const s in e.sourceCaches){this._coordsDescendingInv[s]={};const o=e.sourceCaches[s].getVisibleCoordinates();for(const u of o){const y=this.terrain.sourceCache.getTerrainCoords(u);for(const I in y)this._coordsDescendingInv[s][I]||(this._coordsDescendingInv[s][I]=[]),this._coordsDescendingInv[s][I].push(y[I])}}this._coordsDescendingInvStr={};for(const s of e._order){const o=e._layers[s],u=o.source;if(Qs[o.type]&&!this._coordsDescendingInvStr[u]){this._coordsDescendingInvStr[u]={};for(const y in this._coordsDescendingInv[u])this._coordsDescendingInvStr[u][y]=this._coordsDescendingInv[u][y].map(I=>I.key).sort().join()}}for(const s of this._renderableTiles)for(const o in this._coordsDescendingInvStr){const u=this._coordsDescendingInvStr[o][s.tileID.key];u&&u!==s.rttCoords[o]&&(s.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;const n=e.type,s=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Qs[n]&&(this._prevType&&Qs[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(e.id),!o))return!0;if(Qs[this._prevType]||Qs[n]&&o){this._prevType=n;const u=this._stacks.length-1,y=this._stacks[u]||[];for(const I of this._renderableTiles){if(this.pool.isFull()&&(Qc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(I),I.rtt[u]){const S=this.pool.getObjectForId(I.rtt[u].id);if(S.stamp===I.rtt[u].stamp){this.pool.useObject(S);continue}}const v=this.pool.getOrCreateFreeObject();this.pool.useObject(v),this.pool.stampObject(v),I.rtt[u]={id:v.id,stamp:v.stamp},s.context.bindFramebuffer.set(v.fbo.framebuffer),s.context.clear({color:g.aM.transparent,stencil:0}),s.currentStencilSource=void 0;for(let S=0;S<y.length;S++){const T=s.style._layers[y[S]],M=T.source?this._coordsDescendingInv[T.source][I.tileID.key]:[I.tileID];s.context.viewport.set([0,0,v.fbo.width,v.fbo.height]),s._renderTileClippingMasks(T,M),s.renderLayer(s,s.style.sourceCaches[T.source],T,M),T.source&&(I.rttCoords[T.source]=this._coordsDescendingInvStr[T.source][I.tileID.key])}}return Qc(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Qs[n]}return!1}}const vl={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Wc={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Cs,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:g.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},nc=A=>{A.touchstart=A.dragStart,A.touchmoveWindow=A.dragMove,A.touchend=A.dragEnd},Fo={showCompass:!0,showZoom:!0,visualizePitch:!1};class eh{constructor(e,n,s=!1){this.mousedown=y=>{this.startMouse(g.e({},y,{ctrlKey:!0,preventDefault:()=>y.preventDefault()}),Ee.mousePos(this.element,y)),Ee.addEventListener(window,"mousemove",this.mousemove),Ee.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=y=>{this.moveMouse(y,Ee.mousePos(this.element,y))},this.mouseup=y=>{this.mouseRotate.dragEnd(y),this.mousePitch&&this.mousePitch.dragEnd(y),this.offTemp()},this.touchstart=y=>{1!==y.targetTouches.length?this.reset():(this._startPos=this._lastPos=Ee.touchPos(this.element,y.targetTouches)[0],this.startTouch(y,this._startPos),Ee.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),Ee.addEventListener(window,"touchend",this.touchend))},this.touchmove=y=>{1!==y.targetTouches.length?this.reset():(this._lastPos=Ee.touchPos(this.element,y.targetTouches)[0],this.moveTouch(y,this._lastPos))},this.touchend=y=>{0===y.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const o=e.dragRotate._mouseRotate.getClickTolerance(),u=e.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=Kl({clickTolerance:o,enable:!0}),this.touchRotate=(({enable:y,clickTolerance:I,bearingDegreesPerPixelMoved:v=.8})=>{const S=new Ks;return new qn({clickTolerance:I,move:(T,M)=>({bearingDelta:(M.x-T.x)*v}),moveStateManager:S,enable:y,assignEvents:nc})})({clickTolerance:o,enable:!0}),this.map=e,s&&(this.mousePitch=$l({clickTolerance:u,enable:!0}),this.touchPitch=(({enable:y,clickTolerance:I,pitchDegreesPerPixelMoved:v=-.5})=>{const S=new Ks;return new qn({clickTolerance:I,move:(T,M)=>({pitchDelta:(M.y-T.y)*v}),moveStateManager:S,enable:y,assignEvents:nc})})({clickTolerance:u,enable:!0})),Ee.addEventListener(n,"mousedown",this.mousedown),Ee.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),Ee.addEventListener(n,"touchcancel",this.reset)}startMouse(e,n){this.mouseRotate.dragStart(e,n),this.mousePitch&&this.mousePitch.dragStart(e,n),Ee.disableDrag()}startTouch(e,n){this.touchRotate.dragStart(e,n),this.touchPitch&&this.touchPitch.dragStart(e,n),Ee.disableDrag()}moveMouse(e,n){const s=this.map,{bearingDelta:o}=this.mouseRotate.dragMove(e,n)||{};if(o&&s.setBearing(s.getBearing()+o),this.mousePitch){const{pitchDelta:u}=this.mousePitch.dragMove(e,n)||{};u&&s.setPitch(s.getPitch()+u)}}moveTouch(e,n){const s=this.map,{bearingDelta:o}=this.touchRotate.dragMove(e,n)||{};if(o&&s.setBearing(s.getBearing()+o),this.touchPitch){const{pitchDelta:u}=this.touchPitch.dragMove(e,n)||{};u&&s.setPitch(s.getPitch()+u)}}off(){const e=this.element;Ee.removeEventListener(e,"mousedown",this.mousedown),Ee.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),Ee.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Ee.removeEventListener(window,"touchend",this.touchend),Ee.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){Ee.enableDrag(),Ee.removeEventListener(window,"mousemove",this.mousemove),Ee.removeEventListener(window,"mouseup",this.mouseup),Ee.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),Ee.removeEventListener(window,"touchend",this.touchend)}}let nr;function er(A,e,n){const s=new g.N(A.lng,A.lat);if(A=new g.N(A.lng,A.lat),e){const o=new g.N(A.lng-360,A.lat),u=new g.N(A.lng+360,A.lat),y=n.locationPoint(A).distSqr(e);n.locationPoint(o).distSqr(e)<y?A=o:n.locationPoint(u).distSqr(e)<y&&(A=u)}for(;Math.abs(A.lng-n.center.lng)>180;){const o=n.locationPoint(A);if(o.x>=0&&o.y>=0&&o.x<=n.width&&o.y<=n.height)break;A.lng>n.center.lng?A.lng-=360:A.lng+=360}return A.lng!==s.lng&&n.locationPoint(A).y>n.height/2-n.getHorizon()?A:s}const Ia={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 xl(A,e,n){const s=A.classList;for(const o in Ia)s.remove(`maplibregl-${n}-anchor-${o}`);s.add(`maplibregl-${n}-anchor-${e}`)}class Xs extends g.E{constructor(e){if(super(),this._onKeyPress=n=>{const s=n.code,o=n.charCode||n.keyCode;"Space"!==s&&"Enter"!==s&&32!==o&&13!==o||this.togglePopup()},this._onMapClick=n=>{const s=n.originalEvent.target,o=this._element;this._popup&&(s===o||o.contains(s))&&this.togglePopup()},this._update=n=>{var s;if(!this._map)return;const o=this._map.loaded()&&!this._map.isMoving();("terrain"===n?.type||"render"===n?.type&&!o)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?er(this._lngLat,this._flatPos,this._map.transform):null===(s=this._lngLat)||void 0===s?void 0:s.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let u="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?u=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(u=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let y="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?y="rotateX(0deg)":"map"===this._pitchAlignment&&(y=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||n&&"moveend"!==n.type||(this._pos=this._pos.round()),Ee.setTransform(this._element,`${Ia[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${y} ${u}`),at.frameAsync(new AbortController).then(()=>{this._updateOpacity(n&&"moveend"===n.type)}).catch(()=>{})},this._onMove=n=>{if(!this._isDragging){const s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.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 g.k("dragstart"))),this.fire(new g.k("drag")))},this._onUp=()=>{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 g.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.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))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(e?.opacity,e?.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=g.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=Ee.create("div");const n=Ee.createNS("http://www.w3.org/2000/svg","svg"),s=41,o=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${s}px`),n.setAttributeNS(null,"width",`${o}px`),n.setAttributeNS(null,"viewBox",`0 0 ${o} ${s}`);const u=Ee.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"stroke","none"),u.setAttributeNS(null,"stroke-width","1"),u.setAttributeNS(null,"fill","none"),u.setAttributeNS(null,"fill-rule","evenodd");const y=Ee.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");const I=Ee.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"transform","translate(3.0, 29.0)"),I.setAttributeNS(null,"fill","#000000");const v=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const we of v){const Ce=Ee.createNS("http://www.w3.org/2000/svg","ellipse");Ce.setAttributeNS(null,"opacity","0.04"),Ce.setAttributeNS(null,"cx","10.5"),Ce.setAttributeNS(null,"cy","5.80029008"),Ce.setAttributeNS(null,"rx",we.rx),Ce.setAttributeNS(null,"ry",we.ry),I.appendChild(Ce)}const S=Ee.createNS("http://www.w3.org/2000/svg","g");S.setAttributeNS(null,"fill",this._color);const T=Ee.createNS("http://www.w3.org/2000/svg","path");T.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),S.appendChild(T);const M=Ee.createNS("http://www.w3.org/2000/svg","g");M.setAttributeNS(null,"opacity","0.25"),M.setAttributeNS(null,"fill","#000000");const j=Ee.createNS("http://www.w3.org/2000/svg","path");j.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),M.appendChild(j);const ee=Ee.createNS("http://www.w3.org/2000/svg","g");ee.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ee.setAttributeNS(null,"fill","#FFFFFF");const ae=Ee.createNS("http://www.w3.org/2000/svg","g");ae.setAttributeNS(null,"transform","translate(8.0, 8.0)");const Ae=Ee.createNS("http://www.w3.org/2000/svg","circle");Ae.setAttributeNS(null,"fill","#000000"),Ae.setAttributeNS(null,"opacity","0.25"),Ae.setAttributeNS(null,"cx","5.5"),Ae.setAttributeNS(null,"cy","5.5"),Ae.setAttributeNS(null,"r","5.4999962");const _e=Ee.createNS("http://www.w3.org/2000/svg","circle");_e.setAttributeNS(null,"fill","#FFFFFF"),_e.setAttributeNS(null,"cx","5.5"),_e.setAttributeNS(null,"cy","5.5"),_e.setAttributeNS(null,"r","5.4999962"),ae.appendChild(Ae),ae.appendChild(_e),y.appendChild(I),y.appendChild(S),y.appendChild(M),y.appendChild(ee),y.appendChild(ae),n.appendChild(y),n.setAttributeNS(null,"height",s*this._scale+"px"),n.setAttributeNS(null,"width",o*this._scale+"px"),this._element.appendChild(n),this._offset=g.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),xl(this._element,this._anchor,"marker"),e&&e.className)for(const n of e.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),Ee.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=g.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const o=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
30,-38.1],"bottom-left":[o,-1*(24.6+o)],"bottom-right":[-o,-1*(24.6+o)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var n,s;if(null===(n=this._map)||void 0===n||!n.terrain)return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const o=this._map,u=o.terrain.depthAtPoint(this._pos),y=o.terrain.getElevationForLngLatZoom(this._lngLat,o.transform.tileZoom);if(o.transform.lngLatToCameraDepth(this._lngLat,y)-u<.006)return void(this._element.style.opacity=this._opacity);const I=-this._offset.y/o.transform._pixelPerMeter,v=Math.sin(o.getPitch()*Math.PI/180)*I,S=o.terrain.depthAtPoint(new g.P(this._pos.x,this._pos.y-this._offset.y)),T=o.transform.lngLatToCameraDepth(this._lngLat,y+v)-S>.006;!(null===(s=this._popup)||void 0===s)&&s.isOpen()&&T&&this._popup.remove(),this._element.style.opacity=T?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=g.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(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}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,n){return void 0===e&&void 0===n&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==e&&(this._opacity=e),void 0!==n&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}const Dc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Vn=0,Lo=!1;const Xr={maxWidth:100,unit:"metric"};function zo(A,e,n){const s=n&&n.maxWidth||100,o=A._container.clientHeight/2,u=A.unproject([0,o]),y=A.unproject([s,o]),I=u.distanceTo(y);if(n&&"imperial"===n.unit){const v=3.2808*I;v>5280?$t(e,s,v/5280,A._getUIString("ScaleControl.Miles")):$t(e,s,v,A._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?$t(e,s,I/1852,A._getUIString("ScaleControl.NauticalMiles")):I>=1e3?$t(e,s,I/1e3,A._getUIString("ScaleControl.Kilometers")):$t(e,s,I,A._getUIString("ScaleControl.Meters"))}function $t(A,e,n,s){const o=function(u){const y=Math.pow(10,`${Math.floor(u)}`.length-1);let I=u/y;return I=I>=10?10:I>=5?5:I>=3?3:I>=2?2:I>=1?1:function(v){const S=Math.pow(10,Math.ceil(-Math.log(v)/Math.LN10));return Math.round(v*S)/S}(I),y*I}(n);A.style.width=e*(o/n)+"px",A.innerHTML=`${o}&nbsp;${s}`}const ti={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Uo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Lr(A){if(A){if("number"==typeof A){const e=Math.round(Math.abs(A)/Math.SQRT2);return{center:new g.P(0,0),top:new g.P(0,A),"top-left":new g.P(e,e),"top-right":new g.P(-e,e),bottom:new g.P(0,-A),"bottom-left":new g.P(e,-e),"bottom-right":new g.P(-e,-e),left:new g.P(A,0),right:new g.P(-A,0)}}if(A instanceof g.P||Array.isArray(A)){const e=g.P.convert(A);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:g.P.convert(A.center||[0,0]),top:g.P.convert(A.top||[0,0]),"top-left":g.P.convert(A["top-left"]||[0,0]),"top-right":g.P.convert(A["top-right"]||[0,0]),bottom:g.P.convert(A.bottom||[0,0]),"bottom-left":g.P.convert(A["bottom-left"]||[0,0]),"bottom-right":g.P.convert(A["bottom-right"]||[0,0]),left:g.P.convert(A.left||[0,0]),right:g.P.convert(A.right||[0,0])}}return Lr(new g.P(0,0))}Z.AJAXError=g.bh,Z.Evented=g.E,Z.LngLat=g.N,Z.MercatorCoordinate=g.Z,Z.Point=g.P,Z.addProtocol=g.bi,Z.config=g.a,Z.removeProtocol=g.bj,Z.AttributionControl
vendor: 7,646 bytes, line 3
3=Es,Z.BoxZoomHandler=$r,Z.CanvasSource=nn,Z.CooperativeGesturesHandler=Bs,Z.DoubleClickZoomHandler=aa,Z.DragPanHandler=yl,Z.DragRotateHandler=Wl,Z.EdgeInsets=ms,Z.FullscreenControl=class extends g.E{constructor(A={}){super(),this._onFullscreenChange=()=>{var e;let n=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null!==(e=n?.shadowRoot)&&void 0!==e&&e.fullscreenElement;)n=n.shadowRoot.fullscreenElement;n===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,A&&A.container&&(A.container instanceof HTMLElement?this._container=A.container:g.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(A){return this._map=A,this._container||(this._container=this._map.getContainer()),this._controlContainer=Ee.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){Ee.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const A=this._fullscreenButton=Ee.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);Ee.create("span","maplibregl-ctrl-icon",A).setAttribute("aria-hidden","true"),A.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const A=this._getTitle();this._fullscreenButton.setAttribute("aria-label",A),this._fullscreenButton.title=A}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new g.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new g.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},Z.GeoJSONSource=fa,Z.GeolocateControl=class extends g.E{constructor(A){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new g.k("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("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}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("maplibregl-user-location-dot-stale"),this.fire(new g.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{const n=new g.N(e.coords.longitude,e.coords.latitude),s=e.coords.accuracy,o=this._map.getBearing(),u=g.e({bearing:o},this.options.fitBoundsOptions),y=Ze.fromLngLat(n,s);this._map.fitBounds(y,u,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const n=new g.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Lo)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new g.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=Ee.create("button","maplibregl-ctrl-geolocate",this._container),Ee.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(!1===e){g.w("Geolocation support is not available so the GeolocateControl will be disabled.");const n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{const n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
3se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Ee.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Xs({element:this._dotElement}),this._circleElement=Ee.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Xs({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",n=>{n.geolocateSource||"ACTIVE_LOCK"!==this._watchState||n.originalEvent&&"resize"===n.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new g.k("trackuserlocationend")),this.fire(new g.k("userlocationlostfocus")))})}},this.options=g.e({},Dc,A)}onAdd(A){return this._map=A,this._container=Ee.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return g._(this,arguments,void 0,function*(e=!1){if(void 0!==nr&&!e)return nr;if(void 0===window.navigator.permissions)return nr=!!window.navigator.geolocation,nr;try{nr="denied"!==(yield window.navigator.permissions.query({name:"geolocation"})).state}catch{nr=!!window.navigator.geolocation}return nr})}().then(e=>this._finishSetupUI(e)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),Ee.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Vn=0,Lo=!1}_isOutOfMapMaxBounds(A){const e=this._map.getMaxBounds(),n=A.coords;return e&&(n.longitude<e.getWest()||n.longitude>e.getEast()||n.latitude<e.getSouth()||n.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const A=this._map.getBounds(),e=A.getSouthEast(),n=A.getNorthEast(),s=e.distanceTo(n),o=Math.ceil(this._accuracy/(s/this._map._container.clientHeight)*2);this._circleElement.style.width=`${o}px`,this._circleElement.style.height=`${o}px`}trigger(){if(!this._setup)return g.w("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 g.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Vn--,Lo=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new g.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new g.k("trackuserlocationstart")),this.fire(new g.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let A;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Vn++,Vn>1?(A={maximumAge:6e5,timeout:0},Lo=!0):(A=this.options.positionOptions,Lo=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,A)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
3se"),this.options.showUserLocation&&this._updateMarker(null)}},Z.Hash=ko,Z.ImageSource=dn,Z.KeyboardHandler=Mn,Z.LngLatBounds=Ze,Z.LogoControl=Il,Z.Map=class extends sa{constructor(A){g.bf.mark(g.bg.create);const e=Object.assign(Object.assign({},Wc),A);if(null!=e.minZoom&&null!=e.maxZoom&&e.minZoom>e.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>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Js(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),{bearingSnap:e.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ni,this._controls=[],this._mapId=g.a4(),this._contextLost=n=>{n.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new g.k("webglcontextlost",{originalEvent:n}))},this._contextRestored=n=>{this._setupPainter(),this.resize(),this._update(),this.fire(new g.k("webglcontextrestored",{originalEvent:n}))},this._onMapScroll=n=>{if(n.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._maxTileCacheZoomLevels=e.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===e.preserveDrawingBuffer,this._antialias=!0===e.antialias,this._trackResize=!0===e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=!0===e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=!0===e.crossSourceCollisions,this._collectResourceTiming=!0===e.collectResourceTiming,this._locale=Object.assign(Object.assign({},vl),e.locale),this._clickTolerance=e.clickTolerance,this._overridePixelRatio=e.pixelRatio,this._maxCanvasSize=e.maxCanvasSize,this.transformCameraUpdate=e.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===e.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=fi.addThrottleControl(()=>this.isMoving()),this._requestManager=new Qt(e.transformRequest),"string"==typeof e.container){if(this._container=document.getElementById(e.container),!this._container)throw new Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let n=!1;const s=Do(o=>{this._trackResize&&!this._removed&&(this.resize(o),this.redraw())},50);this._resizeObserver=new ResizeObserver(o=>{n?s(o):n=!0}),this._resizeObserver.observe(this._container)}this.handlers=new sn(this,e),this._hash=e.hash&&new ko("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,g.e({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,this._validateStyle=e.validateStyle,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Es("boolean"==typeof e.attributionControl?void 0:e.attributionControl)),e.maplibreLogo&&this.addControl(new Il,e.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",n=>{this._update("style"===n.dataType),this.fire(new g.k(`${n.dataType}data`,n))}),this.on("dataloading",n=>{this.fire(new g.k(`${n.dataType}dataloading`,n))}),this.on("dataabort",n=>{this.fire(new g.k("sourcedataabort",n))})}_getMapId(){return this._mapId}addControl(A,e){if(void 0===e&&(e=A.getDefaultPosition?A.getDefaultPosition():"top-right"),!A||!A.onAdd)return this.fire(new g.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=A.onAdd(this);this._controls.push(A);const s=this._controlPositions[e];return-1!==e.indexOf("bottom")?s.insertBefore(n,s.firstChild):s.appendChild(n),this}
vendor: 14,799 bytes, line 3
3removeControl(A){if(!A||!A.onRemove)return this.fire(new g.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(A);return e>-1&&this._controls.splice(e,1),A.onRemove(this),this}hasControl(A){return this._controls.indexOf(A)>-1}calculateCameraOptionsFromTo(A,e,n,s){return null==s&&this.terrain&&(s=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(A,e,n,s)}resize(A){var e;const n=this._containerDimensions(),s=n[0],o=n[1],u=this._getClampedPixelRatio(s,o);if(this._resizeCanvas(s,o,u),this.painter.resize(s,o,u),this.painter.overLimit()){const I=this.painter.context.gl;this._maxCanvasSize=[I.drawingBufferWidth,I.drawingBufferHeight];const v=this._getClampedPixelRatio(s,o);this._resizeCanvas(s,o,v),this.painter.resize(s,o,v)}this.transform.resize(s,o),null===(e=this._requestedCameraState)||void 0===e||e.resize(s,o);const y=!this._moving;return y&&(this.stop(),this.fire(new g.k("movestart",A)).fire(new g.k("move",A))),this.fire(new g.k("resize",A)),y&&this.fire(new g.k("moveend",A)),this}_getClampedPixelRatio(A,e){const{0:n,1:s}=this._maxCanvasSize,o=this.getPixelRatio(),u=A*o,y=e*o;return Math.min(u>n?n/u:1,y>s?s/y:1)*o}getPixelRatio(){var A;return null!==(A=this._overridePixelRatio)&&void 0!==A?A:devicePixelRatio}setPixelRatio(A){this._overridePixelRatio=A,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(A){return this.transform.setMaxBounds(Ze.convert(A)),this._update()}setMinZoom(A){if((A=A??-2)>=-2&&A<=this.transform.maxZoom)return this.transform.minZoom=A,this._update(),this.getZoom()<A&&this.setZoom(A),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(A){if((A=A??22)>=this.transform.minZoom)return this.transform.maxZoom=A,this._update(),this.getZoom()>A&&this.setZoom(A),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(A){if((A=A??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(A>=0&&A<=this.transform.maxPitch)return this.transform.minPitch=A,this._update(),this.getPitch()<A&&this.setPitch(A),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(A){if((A=A??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(A>=this.transform.minPitch)return this.transform.maxPitch=A,this._update(),this.getPitch()>A&&this.setPitch(A),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(A){return this.transform.renderWorldCopies=A,this._update()}project(A){return this.transform.locationPoint(g.N.convert(A),this.style&&this.terrain)}unproject(A){return this.transform.pointLocation(g.P.convert(A),this.terrain)}isMoving(){var A;return this._moving||(null===(A=this.handlers)||void 0===A?void 0:A.isMoving())}isZooming(){var A;return this._zooming||(null===(A=this.handlers)||void 0===A?void 0:A.isZooming())}isRotating(){var A;return this._rotating||(null===(A=this.handlers)||void 0===A?void 0:A.isRotating())}_createDelegatedListener(A,e,n){if("mouseenter"===A||"mouseover"===A){let s=!1;return{layers:e,listener:n,delegates:{mousemove:u=>{const y=e.filter(v=>this.getLayer(v)),I=0!==y.length?this.queryRenderedFeatures(u.point,{layers:y}):[];I.length?s||(s=!0,n.call(this,new an(A,this,u.originalEvent,{features:I}))):s=!1},mouseout:()=>{s=!1}}}}if("mouseleave"===A||"mouseout"===A){let s=!1;return{layers:e,listener:n,delegates:{mousemove:y=>{const I=e.filter(v=>this.getLayer(v));(0!==I.length?this.queryRenderedFeatures(y.point,{layers:I}):[]).length?s=!0:s&&(s=!1,n.call(this,new an(A,this,y.originalEvent)))},mouseout:y=>{s&&(s=!1,n.call(this,new an(A,this,y.originalEvent)))}}}}{const s=o=>{const u=e.filter(I=>this.getLayer(I)),y=0!==u.length?this.queryRenderedFeatures(o.point,{layers:u}):[];y.length&&(o.features=y,n.call(this,o),delete o.features)};return{layers:e,listener:n,delegates:{[A]:s}}}}_saveDelegatedListener(A,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[A]=this._delegatedListeners[A]||[],this._delegatedListeners[A].push(e)}_removeDelegatedListener(A,e,n){if(!this._delegatedListeners||!this._delegatedListeners[A])return;const s=this._delegatedListeners[A];for(let o=0;o<s.length;o++){const u=s[o];if(u.listener===n&&u.layers.length===e.length&&u.layers.every(y=>e.includes(y))){for(const y in u.delegates)this.off(y,u.delegates[y]);return void s.splice(o,1)}}}on(A,e,n){if(void 0===n)return super.on(A,e);const s=this._createDelegatedListener(A,"string"==typeof e?[e]:e,n);this._saveDelegatedListener(A,s);for(const o in s.delegates)this.on(o,s.delegates[o]);return this}once(A,e,n){if(void 0===n)return super.once(A,e);const s="string"==typeof e?[e]:e,o=this._createDelegatedListener(A,s,n);for(const u in o.delegates){const y=o.delegates[u];o.delegates[u]=(...I)=>{this._removeDelegatedListener(A,s,n),y(...I)}}this._saveDelegatedListener(A,o);for(const u in o.delegates)this.once(u,o.delegates[u]);return this}off(A,e,n){return void 0===n?super.off(A,e):(this._removeDelegatedListener(A,"string"==typeof e?[e]:e,n),this)}queryRenderedFeatures(A,e){if(!this.style)return[];let n;const s=A instanceof g.P||Array.isArray(A),o=s?A:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(s?{}:A)||{},o instanceof g.P||"number"==typeof o[0])n=[g.P.convert(o)];else{const u=g.P.convert(o[0]),y=g.P.convert(o[1]);n=[u,new g.P(y.x,u.y),y,new g.P(u.x,y.y),u]}return this.style.queryRenderedFeatures(n,e,this.transform)}querySourceFeatures(A,e){return this.style.querySourceFeatures(A,e)}setStyle(A,e){return!1!==(e=g.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&A?(this._diffStyle(A,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(A,e))}setTransformRequest(A){return this._requestManager.setTransformRequest(A),this}_getUIString(A){const e=this._locale[A];if(null==e)throw new Error(`Missing UI string '${A}'`);return e}_updateStyle(A,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(A,e));const n=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!A)),A?(this.style=new pa(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof A?this.style.loadURL(A,e,n):this.style.loadJSON(A,e,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new pa(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(A,e){if("string"==typeof A){const n=this._requestManager.transformRequest(A,"Style");g.h(n,new AbortController).then(s=>{this._updateDiff(s.data,e)}).catch(s=>{s&&this.fire(new g.j(s))})}else"object"==typeof A&&this._updateDiff(A,e)}_updateDiff(A,e){try{this.style.setState(A,e)&&this._update(!0)}catch(n){g.w(`Unable to perform style diff: ${n.message||n.error||n}.  Rebuilding the style from scratch.`),this._updateStyle(A,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():g.w("There is no style added to the map.")}addSource(A,e){return this._lazyInitEmptyStyle(),this.style.addSource(A,e),this._update(!0)}isSourceLoaded(A){const e=this.style&&this.style.sourceCaches[A];if(void 0!==e)return e.loaded();this.fire(new g.j(new Error(`There is no source with ID '${A}'`)))}setTerrain(A){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),A){const e=this.style.sourceCaches[A.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${A.source}`);null===this.terrain&&e.reload();for(const n in this.style._layers){const s=this.style._layers[n];"hillshade"===s.type&&s.source===A.source&&g.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new wl(this.painter,e,A),this.painter.renderToTexture=new ic(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=n=>{"style"===n.dataType?this.terrain.sourceCache.freeRtt():"source"===n.dataType&&n.tile&&(n.sourceId!==A.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new g.k("terrain",{terrain:A})),this}getTerrain(){var A,e;return null!==(e=null===(A=this.terrain)||void 0===A?void 0:A.options)&&void 0!==e?e:null}areTilesLoaded(){const A=this.style&&this.style.sourceCaches;for(const e in A){const n=A[e]._tiles;for(const s in n){const o=n[s];if("loaded"!==o.state&&"errored"!==o.state)return!1}}return!0}removeSource(A){return this.style.removeSource(A),this._update(!0)}getSource(A){return this.style.getSource(A)}addImage(A,e,n={}){const{pixelRatio:s=1,sdf:o=!1,stretchX:u,stretchY:y,content:I,textFitWidth:v,textFitHeight:S}=n;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||g.b(e))){if(void 0===e.width||void 0===e.height)return this.fire(new g.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:T,height:M,data:j}=e,ee=e;return this.style.addImage(A,{data:new g.R({width:T,height:M},new Uint8Array(j)),pixelRatio:s,stretchX:u,stretchY:y,content:I,textFitWidth:v,textFitHeight:S,sdf:o,version:0,userImage:ee}),ee.onAdd&&ee.onAdd(this,A),this}}{const{width:T,height:M,data:j}=at.getImageData(e);this.style.addImage(A,{data:new g.R({width:T,height:M},j),pixelRatio:s,stretchX:u,stretchY:y,content:I,textFitWidth:v,textFitHeight:S,sdf:o,version:0})}}updateImage(A,e){const n=this.style.getImage(A);if(!n)return this.fire(new g.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const s=e instanceof HTMLImageElement||g.b(e)?at.getImageData(e):e,{width:o,height:u,data:y}=s;if(void 0===o||void 0===u)return this.fire(new g.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==n.data.width||u!==n.data.height)return this.fire(new g.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const I=!(e instanceof HTMLImageElement||g.b(e));return n.data.replace(y,I),this.style.updateImage(A,n),this}getImage(A){return this.style.getImage(A)}hasImage(A){return A?!!this.style.getImage(A):(this.fire(new g.j(new Error("Missing required image id"))),!1)}removeImage(A){this.style.removeImage(A)}loadImage(A){return fi.getImage(this._requestManager.transformRequest(A,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(A,e){return this._lazyInitEmptyStyle(),this.style.addLayer(A,e),this._update(!0)}moveLayer(A,e){return this.style.moveLayer(A,e),this._update(!0)}removeLayer(A){return this.style.removeLayer(A),this._update(!0)}getLayer(A){return this.style.getLayer(A)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(A,e,n){return this.style.setLayerZoomRange(A,e,n),this._update(!0)}setFilter(A,e,n={}){return this.style.setFilter(A,e,n),this._update(!0)}getFilter(A){return this.style.getFilter(A)}setPaintProperty(A,e,n,s={}){return this.style.setPaintProperty(A,e,n,s),this._update(!0)}getPaintProperty(A,e){return this.style.getPaintProperty(A,e)}setLayoutProperty(A,e,n,s={}){return this.style.setLayoutProperty(A,e,n,s),this._update(!0)}getLayoutProperty(A,e){return this.style.getLayoutProperty(A,e)}setGlyphs(A,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(A,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(A,e,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(A,e,n,s=>{s||this._update(!0)}),this}removeSprite(A){return this._lazyInitEmptyStyle(),this.style.removeSprite(A),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(A,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(A,e,n=>{n||this._update(!0)}),this}setLight(A,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(A,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(A){return this._lazyInitEmptyStyle(),this.style.setSky(A),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(A,e){return this.style.setFeatureState(A,e),this._update()}removeFeatureState(A,e){return this.style.removeFeatureState(A,e),this._update()}getFeatureState(A){return this.style.getFeatureState(A)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let A=0,e=0;return this._container&&(A=this._container.clientWidth||400,e=this._container.clientHeight||300),[A,e]}_setupContainer(){const A=this._container;A.classList.add("maplibregl-map");const e=this._canvasContainer=Ee.create("div","maplibregl-canvas-container",A);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=Ee.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","regi
3on");const n=this._containerDimensions(),s=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],s);const o=this._controlContainer=Ee.create("div","maplibregl-control-container",A),u=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(y=>{u[y]=Ee.create("div",`maplibregl-ctrl-${y} `,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(A,e,n){this._canvas.width=Math.floor(n*A),this._canvas.height=Math.floor(n*e),this._canvas.style.width=`${A}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const A={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",s=>{e={requestedAttributes:A},s&&(e.statusMessage=s.statusMessage,e.type=s.type)},{once:!0});const n=this._canvas.getContext("webgl2",A)||this._canvas.getContext("webgl",A);if(!n){const s="Failed to initialize WebGL";throw e?(e.message=s,new Error(JSON.stringify(e))):new Error(s)}this.painter=new cl(n,this.transform),Qi.testSupport(n)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(A){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||A,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(A){return this._update(),this._renderTaskQueue.add(A)}_cancelRenderFrame(A){this._renderTaskQueue.remove(A)}_render(A){const e=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(A),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const o=this.transform.zoom,u=at.now();this.style.zoomHistory.update(o,u);const y=new g.z(o,{now:u,fadeDuration:e,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),I=y.crossFadingFactor();1===I&&I===this._crossFadingFactor||(n=!0,this._crossFadingFactor=I),this.style.update(y)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,e,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:e,showPadding:this.showPadding}),this.fire(new g.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,g.bf.mark(g.bg.load),this.fire(new g.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new g.k("idle")),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,g.bf.mark(g.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var A;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),fi.removeThrottleControl(this._imageQueueHandle),null===(A=this._resizeObserver)||void 0===A||A.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e?.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),Ee.remove(this._canvasContainer),Ee.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),g.bf.clearMetrics(),this._removed=!0,this.fire(new g.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,at.frameAsync(this._frameRequest).then(A=>{g.bf.frame(A),this._frameRequest=null,this._render(A)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(A){this._showTileBoundaries!==A&&(this._showTileBoundaries=A,this._update())}get showPadding(){return!!this._showPadding}set showPadding(A){this._showPadding!==A&&(this._showPadding=A,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(A){this._showCollisionBoxes!==A&&(this._showCollisionBoxes=A,A?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(A){this._showOverdrawInspector!==A&&(this._showOverdrawInspector=A,this._update())}get repaint(){return!!this._repaint}set repaint(A){this._repaint!==A&&(this._repaint=A,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(A){this._vertices=A,this._update()}get version(){return"4.7.1"}getCameraTargetElevation(){return this.transform.elevation}},Z.MapMouseEvent=an,Z.MapTouchEvent=_s,Z.MapWheelEvent=dl,Z.Marker=Xs,Z.NavigationControl
vendor: 8,288 bytes, line 3
3=class{constructor(A){this._updateZoomButtons=()=>{const e=this._map.getZoom(),n=e===this._map.getMaxZoom(),s=e===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=s,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",s.toString())},this._rotateCompassArrow=()=>{const e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,n)=>{const s=this._map._getUIString(`NavigationControl.${n}`);e.title=s,e.setAttribute("aria-label",s)},this.options=g.e({},Fo,A),this._container=Ee.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),Ee.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),Ee.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=Ee.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(A){return this._map=A,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new eh(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){Ee.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(A,e){const n=Ee.create("button",A,this._container);return n.type="button",n.addEventListener("click",e),n}},Z.Popup=class extends g.E{constructor(A){super(),this.remove=()=>(this._content&&Ee.remove(this._content),this._container&&(Ee.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new g.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var n;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=Ee.create("div","maplibregl-popup",this._map.getContainer()),this._tip=Ee.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const I of this.options.className.split(" "))this._container.classList.add(I);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?er(this._lngLat,this._flatPos,this._map.transform):null===(n=this._lngLat)||void 0===n?void 0:n.wrap(),this._trackPointer&&!e)return;const s=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let o=this.options.anchor;const u=Lr(this.options.offset);if(!o){const I=this._container.offsetWidth,v=this._container.offsetHeight;let S;S=s.y+u.bottom.y<v?["top"]:s.y>this._map.transform.height-v?["bottom"]:[],s.x<I/2?S.push("left"):s.x>this._map.transform.width-I/2&&S.push("right"),o=0===S.length?"bottom":S.join("-")}let y=s.add(u[o]);this.options.subpixelPositioning||(y=y.round()),Ee.setTransform(this._container,`${Ia[o]} translate(${y.x}px,${y.y}px)`),xl(this._container,o,"popup")},this._onClose=()=>{this.remove()},this.options=g.e(Object.create(ti),A)}addTo(A){return this._map&&this.remove(),this._map=A,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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new g.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(A){return this._lngLat=g.N.convert(A),this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(A){return this.setDOMContent(document.createTextNode(A))}setHTML(A){const e=document.createDocumentFragment(),n=document.createElement("body");let s;for(n.innerHTML=A;s=n.firstChild,s;)e.appendChild(s);return this.setDOMContent(e)}getMaxWidth(){var A;return null===(A=this._container)||void 0===A?void 0:A.style.maxWidth}setMaxWidth(A){return this.options.maxWidth=A,this._update(),this}setDOMContent(A){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=Ee.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(A),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(A){return this._container&&this._container.classList.add(A),this}removeClassName(A){return this._container&&this._container.classList.remove(A),this}setOffset(A){return this.options.offset=A,this._update(),this}toggleClassName(A){if(this._container)return this._container.classList.toggle(A)}setSubpixelPositioning(A){this.options.subpixelPositioning=A}_createCloseButton(){this.options.closeButton&&(this._closeButton=Ee.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const A=this._container.querySelector(Uo);A&&A.focus()}},Z.RasterDEMTileSource=Xi,Z.RasterTileSource=Li,Z.ScaleControl=class{constructor(A){this._onMove=()=>{zo(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,zo(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({}
3,Xr),A)}getDefaultPosition(){return"bottom-left"}onAdd(A){return this._map=A,this._container=Ee.create("div","maplibregl-ctrl maplibregl-ctrl-scale",A.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){Ee.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},Z.ScrollZoomHandler=gn,Z.Style=pa,Z.TerrainControl=class{constructor(A){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=A}onAdd(A){return this._map=A,this._container=Ee.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Ee.create("button","maplibregl-ctrl-terrain",this._container),Ee.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){Ee.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},Z.TwoFingersTouchPitchHandler=Pa,Z.TwoFingersTouchRotateHandler=vs,Z.TwoFingersTouchZoomHandler=gl,Z.TwoFingersTouchZoomRotateHandler=_l,Z.VectorTileSource=Or,Z.VideoSource=Wn,Z.addSourceType=(A,e)=>g._(void 0,void 0,void 0,function*(){if(gr(A))throw new Error(`A source type called "${A}" already exists.`);We[A]=e}),Z.clearPrewarmedResources=function(){const A=rr;A&&(A.isPreloaded()&&1===A.numActive()?(A.release(ir),rr=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()"))},Z.getMaxParallelImageRequests=function(){return g.a.MAX_PARALLEL_IMAGE_REQUESTS},Z.getRTLTextPluginStatus=function(){return zt().getRTLTextPluginStatus()},Z.getVersion=function(){return"4.7.1"},Z.getWorkerCount=function(){return hr.workerCount},Z.getWorkerUrl=function(){return g.a.WORKER_URL},Z.importScriptInWorkers=function(A){return Yr().broadcast("IS",A)},Z.prewarm=function(){Dn().acquire(ir)},Z.setMaxParallelImageRequests=function(A){g.a.MAX_PARALLEL_IMAGE_REQUESTS=A},Z.setRTLTextPlugin=function(A,e){return zt().setRTLTextPlugin(A,e)},Z.setWorkerCount=function(A){hr.workerCount=A},Z.setWorkerUrl=function(A){g.a.WORKER_URL=A}}),Vi}()},5386:Gr=>{function Vi(ht,se,Z,g,li,ci,Ut){try{var at=ht[ci](Ut),Ee=at.value}catch(Qi){return void Z(Qi)}at.done?se(Ee):Promise.resolve(Ee).then(g,li)}Gr.exports=function Tt(ht){return function(){var se=this,Z=arguments;return new Promise(function(g,li){var ci=ht.apply(se,Z);function Ut(Ee){Vi(ci,g,li,Ut,at,"next",Ee)}function at(Ee){Vi(ci,g,li,Ut,at,"throw",Ee)}Ut(void 0)})}}
3,Gr.exports.__esModule=!0,Gr.exports.default=Gr.exports},3691:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{XH:()=>At,cH:()=>rr,UL:()=>or,hw:()=>Dn,VW:()=>tn,iY:()=>Yr,uk:()=>Rt,yG:()=>br,WL:()=>bn});var ht=Tt(9204),se=Tt(8559),Z=Tt(653),g=Tt(4205);class li extends g.B{constructor(){super(...arguments),this._value=null,this._hasValue=!1,this._isComplete=!1}_checkFinalizedStatuses(gr){const{hasError:b,_hasValue:Y,_value:dt,thrownError:zt,isStopped:Ti,_isComplete:wt}=this;b?gr.error(zt):(Ti||wt)&&(Y&&gr.next(dt),gr.complete())}next(gr){this.isStopped||(this._value=gr,this._hasValue=!0)}complete(){const{_hasValue:gr,_value:b,_isComplete:Y}=this;Y||(this._isComplete=!0,gr&&super.next(b),super.complete())}}var ci=Tt(7092),Ut=Tt(8537),at=Tt(6196),Qi=(Tt(3617),Tt(2435)),Vt=Tt(1567),Ii=Tt(2575),mi=(Tt(8764),Tt(6647)),Qt=(Tt(3900),Tt(4334),Tt(3037)),bi=Tt(271);Tt(316);const ot=["content"],It=["*"],je=["container"];let Rt=(()=>{class We{constructor(b){this.zone=b,this.mapCreated=new li,this.mapLoaded=new li,this.markersToRemove=[],this.popupsToRemove=[],this.imageIdsToRemove=[],this.subscription=new ci.yU,this.mapCreated$=this.mapCreated.asObservable(),this.mapLoaded$=this.mapLoaded.asObservable()}setup(b){this.zone.onStable.pipe((0,Qi.$)()).subscribe(()=>{this.createMap(b.mapOptions),this.hookEvents(b.mapEvents),this.mapEvents=b.mapEvents,this.mapCreated.next(void 0),this.mapCreated.complete(),b.mapOptions.terrain&&this.mapInstance.on("load",()=>{this.updateTerrain(b.mapOptions.terrain)})})}destroyMap(){this.mapInstance&&(this.subscription.unsubscribe(),this.mapInstance.remove())}updateMinZoom(b){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMinZoom(b)})}updateMaxZoom(b){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMaxZoom(b)})}updateMinPitch(b){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMinPitch(b)})}updateMaxPitch(b){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMaxPitch(b)})}updateRenderWorldCopies(b){return this.zone.runOutsideAngular(()=>{this.mapInstance.setRenderWorldCopies(b)})}updateScrollZoom(b){return this.zone.runOutsideAngular(()=>{b?this.mapInstance.scrollZoom.enable():this.mapInstance.scrollZoom.disable()})}updateDragRotate(b){return this.zone.runOutsideAngular(()=>{b?this.mapInstance.dragRotate.enable():this.mapInstance.dragRotate.disable()})}updateTouchPitch(b){return this.zone.runOutsideAngular(()=>{b?this.mapInstance.touchPitch.enable():this.mapInstance.touchPitch.disable()})}updateTouchZoomRotate(b){return this.zone.runOutsideAngular(()=>{b?this.mapInstance.touchZoomRotate.enable():this.mapInstance.touchZoomRotate.disable()})}updateDoubleClickZoom(b){return this.zone.runOutsideAngular(()=>{b?this.mapInstance.doubleClickZoom.enable():this.mapInstance.doubleClickZoom.disable()})}updateKeyboard(b){return this.zone.runOutsideAngular(()=>{b?this.mapInstance.keyboard.enable():this.mapInstance.keyboard.disable()})}updateDragPan(b){return this.zone.runOutsideAngular(()=>{b?this.mapInstance.dragPan.enable():this.mapInstance.dragPan.disable()})}updateBoxZoom(b){return this.zone.runOutsideAngular(()=>{b?this.mapInstance.boxZoom.enable():this.mapInstance.boxZoom.disable()})}updateStyle(b){return this.zone.runOutsideAngular(()=>{this.mapInstance.setStyle(b)})}updateMaxBounds(b){return this.zone.runOutsideAngular(()=>{this.mapInstance.setMaxBounds(b)})}updateTerrain(b){return this.zone.runOutsideAngular(()=>{this.mapInstance.setTerrain(b)})}getTerrain(){return this.zone.runOutsideAngular(()=>this.mapInstance.getTerrain())}changeCanvasCursor(b){this.mapInstance.getCanvasContainer().style.cursor=b}queryRenderedFeatures(b,Y){return this.mapInstance.queryRenderedFeatures(b,Y)}panTo(b,Y){return this.zone.runOutsideAngular(()=>{this.mapInstance.panTo(b,Y)})}move(b,Y,dt,zt,Ti,wt){return this.zone.runOutsideAngular(()=>{this.mapInstance[b]({...Y,zoom:dt??this.mapInstance.getZoom(),center:zt??this.mapInstance.getCenter(),bearing:Ti??this.mapInstance.getBearing(),pitch:wt??this.mapInstance.getPitch()})})}addLayer(b,Y,dt){this.zone.runOutsideAngular(()=>
3{Object.keys(b.layerOptions).forEach(zt=>{void 0===b.layerOptions[zt]&&delete b.layerOptions[zt]}),this.mapInstance.addLayer(b.layerOptions,dt),Y&&(b.layerEvents.layerClick.observers.length&&this.mapInstance.on("click",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerClick.emit(zt)})}),b.layerEvents.layerDblClick.observers.length&&this.mapInstance.on("dblclick",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerDblClick.emit(zt)})}),b.layerEvents.layerMouseDown.observers.length&&this.mapInstance.on("mousedown",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerMouseDown.emit(zt)})}),b.layerEvents.layerMouseUp.observers.length&&this.mapInstance.on("mouseup",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerMouseUp.emit(zt)})}),b.layerEvents.layerMouseEnter.observers.length&&this.mapInstance.on("mouseenter",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerMouseEnter.emit(zt)})}),b.layerEvents.layerMouseLeave.observers.length&&this.mapInstance.on("mouseleave",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerMouseLeave.emit(zt)})}),b.layerEvents.layerMouseMove.observers.length&&this.mapInstance.on("mousemove",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerMouseMove.emit(zt)})}),b.layerEvents.layerMouseOver.observers.length&&this.mapInstance.on("mouseover",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerMouseOver.emit(zt)})}),b.layerEvents.layerMouseOut.observers.length&&this.mapInstance.on("mouseout",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerMouseOut.emit(zt)})}),b.layerEvents.layerContextMenu.observers.length&&this.mapInstance.on("contextmenu",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerContextMenu.emit(zt)})}),b.layerEvents.layerTouchStart.observers.length&&this.mapInstance.on("touchstart",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerTouchStart.emit(zt)})}),b.layerEvents.layerTouchEnd.observers.length&&this.mapInstance.on("touchend",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerTouchEnd.emit(zt)})}),b.layerEvents.layerTouchCancel.observers.length&&this.mapInstance.on("touchcancel",b.layerOptions.id,zt=>{this.zone.run(()=>{b.layerEvents.layerTouchCancel.emit(zt)})}))})}removeLayer(b){this.zone.runOutsideAngular(()=>{null!=this.mapInstance.getLayer(b)&&this.mapInstance.removeLayer(b)})}addMarker(b){const Y={offset:b.markersOptions.offset,anchor:b.markersOptions.anchor,color:b.markersOptions.color,draggable:!!b.markersOptions.draggable,rotationAlignment:b.markersOptions.rotationAlignment,rotation:b.markersOptions.rotation,pitchAlignment:b.markersOptions.pitchAlignment,clickTolerance:b.markersOptions.clickTolerance};b.markersOptions.element.childNodes.length>0&&(Y.element=b.markersOptions.element);const dt=new Z.Marker(Y);return b.markersEvents.markerDragStart.observers.length&&dt.on("dragstart",Ti=>{if(Ti){const{target:wt}=Ti;this.zone.run(()=>{b.markersEvents.markerDragStart.emit(wt)})}}),b.markersEvents.markerDrag.observers.length&&dt.on("drag",Ti=>
3{if(Ti){const{target:wt}=Ti;this.zone.run(()=>{b.markersEvents.markerDrag.emit(wt)})}}),b.markersEvents.markerDragEnd.observers.length&&dt.on("dragend",Ti=>{if(Ti){const{target:wt}=Ti;this.zone.run(()=>{b.markersEvents.markerDragEnd.emit(wt)})}}),dt.setLngLat(b.markersOptions.feature?b.markersOptions.feature.geometry.coordinates:b.markersOptions.lngLat),this.zone.runOutsideAngular(()=>(dt.addTo(this.mapInstance),dt))}removeMarker(b){this.markersToRemove.push(b)}createPopup(b,Y){return this.zone.runOutsideAngular(()=>{Object.keys(b.popupOptions).forEach(zt=>void 0===b.popupOptions[zt]&&delete b.popupOptions[zt]);const dt=new Z.Popup(b.popupOptions);return dt.setDOMContent(Y),b.popupEvents.popupClose.observers.length&&dt.on("close",()=>{this.zone.run(()=>{b.popupEvents.popupClose.emit()})}),b.popupEvents.popupOpen.observers.length&&dt.on("open",()=>{this.zone.run(()=>{b.popupEvents.popupOpen.emit()})}),dt})}addPopupToMap(b,Y,dt=!1){return this.zone.runOutsideAngular(()=>{dt&&b._listeners&&delete b._listeners.open,b.setLngLat(Y),b.addTo(this.mapInstance)})}addPopupToMarker(b,Y){return this.zone.runOutsideAngular(()=>{b.setPopup(Y)})}removePopupFromMap(b,Y=!1){Y&&b._listeners&&delete b._listeners.close,this.popupsToRemove.push(b)}removePopupFromMarker(b){return this.zone.runOutsideAngular(()=>{b.setPopup(void 0)})}addControl(b,Y){return this.zone.runOutsideAngular(()=>{this.mapInstance.addControl(b,Y)})}removeControl(b){return this.zone.runOutsideAngular(()=>{this.mapInstance.removeControl(b)})}loadAndAddImage(b,Y,dt){var zt=this;return(0,ht.A)(function*(){return zt.zone.runOutsideAngular((0,ht.A)(function*(){const Ti=yield zt.mapInstance.loadImage(Y);zt.addImage(b,Ti.data,dt)}))})()}addImage(b,Y,dt){return this.zone.runOutsideAngular(()=>{this.mapInstance.addImage(b,Y,dt)})}removeImage(b){this.imageIdsToRemove.push(b)}addSource(b,Y){return this.zone.runOutsideAngular(()=>{Object.keys(Y).forEach(dt=>void 0===Y[dt]&&delete Y[dt]),this.mapInstance.addSource(b,Y)})}getSource(b){return this.mapInstance.getSource(b)}removeSource(b){this.zone.runOutsideAngular(()=>{this.findLayersBySourceId(b).forEach(Y=>this.mapInstance.removeLayer(Y.id)),this.mapInstance.removeSource(b)})}setAllLayerPaintProperty(b,Y){return this.zone.runOutsideAngular(()=>{Object.keys(Y).forEach(dt=>{this.mapInstance.setPaintProperty(b,dt,Y[dt])})})}setAllLayerLayoutProperty(b,Y){return this.zone.runOutsideAngular(()=>{Object.keys(Y).forEach(dt=>{this.mapInstance.setLayoutProperty(b,dt,Y[dt])})})}setLayerFilter(b,Y){return this.zone.runOutsideAngular(()=>{this.mapInstance.setFilter(b,Y)})}setLayerBefore(b,Y){return this.zone.runOutsideAngular(()=>{this.mapInstance.moveLayer(b,Y)})}setLayerZoomRange(b,Y,dt){return this.zone.runOutsideAngular(()=>{this.mapInstance.setLayerZoomRange(b,Y||0,dt||20)})}fitBounds(b,Y){return this.zone.runOutsideAngular(()=>{this.mapInstance.fitBounds(b,Y)})}fitScreenCoordinates(b,Y,dt){return this.zone.runOutsideAngular(()=>{this.mapInstance.fitScreenCoordinates(b[0],b[1],Y,dt)})}applyChanges(){this.zone.runOutsideAngular(()=>{this.removeMarkers(),this.removePopups(),this.removeImages()})}createMap(b){se.SKi.assertNotInAngularZone(),Object.keys(b).forEach(dt=>{void 0===b[dt]&&delete b[dt]}),this.mapInstance=new Z.Map(b),window&&/msie\s|trident\/|edge\//i.test(window.navigator.userAgent)&&this.mapInstance.setStyle(b.style),this.subscription.add(this.zone.onMicrotaskEmpty.subscribe(()=>this.applyChanges()))}removeMarkers(){for(const b of this.markersToRemove)b.remove();this.markersToRemove=[]}removePopups(){for(const b of this.popupsToRemove)b.remove();this.popupsToRemove=[]}removeImages(){for(const b of this.imageIdsToRemove)this.mapInstance.removeImage(b);this.imageIdsToRemove=[]}findLayersBySourceId(b){const Y=this.mapInstance.getStyle().layers;return null==Y?[]:Y.filter(dt=>"source"in dt&&dt.source===b)}hookEvents(b){this.mapInstance.on("load",Y=>{this.mapLoaded.next(void 0),this.mapLoaded.complete(),this.zone.run(()=>{b.mapLoad.emit(Y.target)})}),b.mapResize.observers.length&&this.mapInstance.on("resize",Y=>this.zone.run(()=>{b.mapResize.emit(Y)})),b.mapRemove.observers.length&&this.mapInstance.on("remove",Y=>this.zone.run(()=>{b.mapRemove.emit(Y)}
3)),b.mapMouseDown.observers.length&&this.mapInstance.on("mousedown",Y=>this.zone.run(()=>{b.mapMouseDown.emit(Y)})),b.mapMouseUp.observers.length&&this.mapInstance.on("mouseup",Y=>this.zone.run(()=>{b.mapMouseUp.emit(Y)})),b.mapMouseMove.observers.length&&this.mapInstance.on("mousemove",Y=>this.zone.run(()=>{b.mapMouseMove.emit(Y)})),b.mapClick.observers.length&&this.mapInstance.on("click",Y=>this.zone.run(()=>{b.mapClick.emit(Y)})),b.mapDblClick.observers.length&&this.mapInstance.on("dblclick",Y=>this.zone.run(()=>{b.mapDblClick.emit(Y)})),b.mapMouseOver.observers.length&&this.mapInstance.on("mouseover",Y=>this.zone.run(()=>{b.mapMouseOver.emit(Y)})),b.mapMouseOut.observers.length&&this.mapInstance.on("mouseout",Y=>this.zone.run(()=>{b.mapMouseOut.emit(Y)})),b.mapContextMenu.observers.length&&this.mapInstance.on("contextmenu",Y=>this.zone.run(()=>{b.mapContextMenu.emit(Y)})),b.mapTouchStart.observers.length&&this.mapInstance.on("touchstart",Y=>this.zone.run(()=>{b.mapTouchStart.emit(Y)})),b.mapTouchEnd.observers.length&&this.mapInstance.on("touchend",Y=>this.zone.run(()=>{b.mapTouchEnd.emit(Y)})),b.mapTouchMove.observers.length&&this.mapInstance.on("touchmove",Y=>this.zone.run(()=>{b.mapTouchMove.emit(Y)})),b.mapTouchCancel.observers.length&&this.mapInstance.on("touchcancel",Y=>this.zone.run(()=>{b.mapTouchCancel.emit(Y)})),b.mapWheel.observers.length&&this.mapInstance.on("wheel",Y=>this.zone.run(()=>{b.mapWheel.emit(Y)})),b.moveStart.observers.length&&this.mapInstance.on("movestart",Y=>this.zone.run(()=>b.moveStart.emit(Y))),b.move.observers.length&&this.mapInstance.on("move",Y=>this.zone.run(()=>b.move.emit(Y))),b.moveEnd.observers.length&&this.mapInstance.on("moveend",Y=>this.zone.run(()=>b.moveEnd.emit(Y))),b.mapDragStart.observers.length&&this.mapInstance.on("dragstart",Y=>this.zone.run(()=>{b.mapDragStart.emit(Y)})),b.mapDrag.observers.length&&this.mapInstance.on("drag",Y=>this.zone.run(()=>{b.mapDrag.emit(Y)})),b.mapDragEnd.observers.length&&this.mapInstance.on("dragend",Y=>this.zone.run(()=>{b.mapDragEnd.emit(Y)})),b.zoomStart.observers.length&&this.mapInstance.on("zoomstart",Y=>this.zone.run(()=>b.zoomStart.emit(Y))),b.zoomEvt.observers.length&&this.mapInstance.on("zoom",Y=>this.zone.run(()=>b.zoomEvt.emit(Y))),b.zoomEnd.observers.length&&this.mapInstance.on("zoomend",Y=>this.zone.run(()=>b.zoomEnd.emit(Y))),b.rotateStart.observers.length&&this.mapInstance.on("rotatestart",Y=>this.zone.run(()=>b.rotateStart.emit(Y))),b.rotate.observers.length&&this.mapInstance.on("rotate",Y=>this.zone.run(()=>b.rotate.emit(Y))),b.rotateEnd.observers.length&&this.mapInstance.on("rotateend",Y=>this.zone.run(()=>b.rotateEnd.emit(Y))),b.pitchStart.observers.length&&this.mapInstance.on("pitchstart",Y=>this.zone.run(()=>b.pitchStart.emit(Y))),b.pitchEvt.observers.length&&this.mapInstance.on("pitch",Y=>this.zone.run(()=>b.pitchEvt.emit(Y))),b.pitchEnd.observers.length&&this.mapInstance.on("pitchend",Y=>this.zone.run(()=>b.pitchEnd.emit(Y))),b.boxZoomStart.observers.length&&this.mapInstance.on("boxzoomstart",Y=>this.zone.run(()=>b.boxZoomStart.emit(Y))),b.boxZoomEnd.observers.length&&this.mapInstance.on("boxzoomend",Y=>this.zone.run(()=>b.boxZoomEnd.emit(Y))),b.boxZoomCancel.observers.length&&this.mapInstance.on("boxzoomcancel",Y=>this.zone.run(()=>b.boxZoomCancel.emit(Y))),b.webGlContextLost.observers.length&&this.mapInstance.on("webglcontextlost",Y=>this.zone.run(()=>b.webGlContextLost.emit(Y))),b.webGlContextRestored.observers.length&&this.mapInstance.on("webglcontextrestored",Y=>this.zone.run(()=>b.webGlContextRestored.emit(Y))),b.render.observers.length&&this.mapInstance.on("render",Y=>this.zone.run(()=>b.render.emit(Y))),b.mapError.observers.length&&this.mapInstance.on("error",Y=>this.zone.run(()=>{b.mapError.emit(Y)})),b.data.observers.length&&this.mapInstance.on("data",Y=>this.zone.run(()=>b.data.emit(Y))),b.styleData.observers.length&&this.mapInstance.on("styledata",Y=>this.zone.run(()=>b.styleData.emit(Y))),b.sourceData.observers.length&&this.mapInstance.on("sourcedata",Y=>this.zone.run(()=>b.sourceData.emit(Y))),b.dataLoading.observers.length&&this.mapInstance.on("dataloading",Y=>this.zone.run(()=>b.dataLoading.emit(Y))),b.styleDataLoading.observers.length&&this.mapInstance.on("styledataloading",Y=>this.zone.run(()=>b.styleDataLoading.emit(Y))),b.sourceDataLoading.observers.length&&this.mapInstance.on("sourcedataloading",Y=>this.zone.run(()=>b.sourceDataLoading.emit(Y))),b.styleImageMissing.observers.length&&this.mapInstance.on("styleimagemissing",Y=>this.zone.run(()=>b.styleImageMissing.emit(Y))),b.idle.observers.length&&this.mapInstance.on("idle",Y=>this.zone.run(()=>b.idle.emit(Y)))}static{this.\u0275fac=function(Y){return new(Y||We)(se.KVO(se.SKi))}}static{this.\u0275prov=se.jDH({token:We,factory:We.\u0275fac})}}return We})();class Bt{constructor(gr){this.container=gr}onAdd(){return this.container}onRemove(){return this.container.parentNode.removeChild(this.container)}getDefaultPosition(){return"top-right"}}let At=(()=>{class We{constructor(b){this.mapService=b,(0,se.mal)(()=>{this.content.nativeElement.childNodes.length&&(this.control=new Bt(this.content.nativeElement),this.mapService.mapCreated$.subscribe(()=>{this.mapService.addControl(this.control,this.position)}))})}ngOnDestroy(){this.mapService?.mapInstance?.hasControl(this.control)&&this.mapService.removeControl(this.control)}static{this.\u0275fac=function(Y){return new(Y||We)(se.rXU(Rt))}}static{this.\u0275cmp=se.VBU({type:We,selectors:[["mgl-control"]],viewQuery:function(Y,dt){if(1&Y&&se.GBs(ot,7),2&Y){let zt;se.mGM(zt=se.lsd())&&(dt.content=zt.first)}},inputs:{position:"position"},standalone:!0,features:[se.aNF],ngContentSelectors:It,decls:3,vars:0,consts:[["content",""],[1,"maplibregl-ctrl"]],template:function(Y,dt){1&Y&&(se.NAR(),se.j41(0,"div",1,0),se.SdG(2),se.k0s())},encapsulation:2,changeDetection:0})}}return We})(),or=(()=>{class We{constructor(b,Y){this.mapService=b,this.zone=Y,this.type="geojson",this.updateFeatureData=new g.B,this.sub=new ci.yU,this.sourceAdded=!1,this.featureIdCounter=0}ngOnInit(){this.data||(this.data={type:"FeatureCollection",features:[]});const b=this.mapService.mapLoaded$.subscribe(()=>{this.init();const Y=(0,Ut.R)(this.mapService.mapInstance,"styledata").pipe((0,Vt.p)(()=>
3!this.mapService.mapInstance.getSource(this.id))).subscribe(()=>{this.init()});this.sub.add(Y)});this.sub.add(b)}ngOnChanges(b){if(this.sourceAdded&&((b.maxzoom&&!b.maxzoom.isFirstChange()||b.attribution&&!b.attribution.isFirstChange()||b.buffer&&!b.buffer.isFirstChange()||b.tolerance&&!b.tolerance.isFirstChange()||b.cluster&&!b.cluster.isFirstChange()||b.clusterRadius&&!b.clusterRadius.isFirstChange()||b.clusterMaxZoom&&!b.clusterMaxZoom.isFirstChange()||b.clusterMinPoints&&!b.clusterMinPoints.isFirstChange()||b.clusterProperties&&!b.clusterProperties.isFirstChange()||b.lineMetrics&&!b.lineMetrics.isFirstChange()||b.generateId&&!b.generateId.isFirstChange()||b.promoteId&&!b.promoteId.isFirstChange()||b.filter&&!b.filter.isFirstChange())&&(this.ngOnDestroy(),this.ngOnInit()),b.data&&!b.data.isFirstChange())){const Y=this.mapService.getSource(this.id);if(void 0===Y)return;Y.setData(this.data)}}ngOnDestroy(){this.sub.unsubscribe(),this.sourceAdded&&(this.mapService.removeSource(this.id),this.sourceAdded=!1)}getClusterExpansionZoom(b){var Y=this;return(0,ht.A)(function*(){const dt=Y.mapService.getSource(Y.id);return Y.zone.run((0,ht.A)(function*(){return dt.getClusterExpansionZoom(b)}))})()}getClusterChildren(b){var Y=this;return(0,ht.A)(function*(){const dt=Y.mapService.getSource(Y.id);return Y.zone.run((0,ht.A)(function*(){return dt.getClusterChildren(b)}))})()}getClusterLeaves(b,Y,dt){var zt=this;return(0,ht.A)(function*(){const Ti=zt.mapService.getSource(zt.id);return zt.zone.run((0,ht.A)(function*(){return Ti.getClusterLeaves(b,Y,dt)}))})()}_addFeature(b){this.data.features.push(b),this.updateFeatureData.next(void 0)}_removeFeature(b){const Y=this.data,dt=Y.features.indexOf(b);dt>-1&&Y.features.splice(dt,1),this.updateFeatureData.next(void 0)}_getNewFeatureId(){return++this.featureIdCounter}init(){this.mapService.addSource(this.id,{type:"geojson",data:this.data,maxzoom:this.maxzoom,attribution:this.attribution,buffer:this.buffer,tolerance:this.tolerance,cluster:this.cluster,clusterRadius:this.clusterRadius,clusterMaxZoom:this.clusterMaxZoom,clusterMinPoints:this.clusterMinPoints,clusterProperties:this.clusterProperties,lineMetrics:this.lineMetrics,generateId:this.generateId,promoteId:this.promoteId,filter:this.filter});const Y=this.updateFeatureData.pipe((0,Ii.B)(0)).subscribe(()=>{const dt=this.mapService.getSource(this.id);void 0!==dt&&dt.setData(this.data)});this.sub.add(Y),this.sourceAdded=!0}static{this.\u0275fac=function(Y){return new(Y||We)(se.rXU(Rt),se.rXU(se.SKi))}}static{this.\u0275cmp=se.VBU({type:We,selectors:[["mgl-geojson-source"]],inputs:{id:"id",data:"data",maxzoom:"maxzoom",attribution:"attribution",buffer:"buffer",tolerance:"tolerance",cluster:"cluster",clusterRadius:"clusterRadius",clusterMaxZoom:"clusterMaxZoom",clusterMinPoints:"clusterMinPoints",clusterProperties:"clusterProperties",lineMetrics:"lineMetrics",generateId:"generateId",promoteId:"promoteId",filter:"filter"},standalone:!0,features:[se.OA$,se.aNF],decls:0,vars:0,template:function(Y,dt){},encapsulation:2,changeDetection:0})}}return We})(),rr=(()=>{class We{constructor(b){this.geoJSONSourceComponent=b,this.type="Feature"}ngOnInit(){this.id||(this.id=this.geoJSONSourceComponent._getNewFeatureId()),this.feature={type:this.type,geometry:this.geometry,properties:this.properties?this.properties:{}},this.feature.id=this.id,this.geoJSONSourceComponent._addFeature(this.feature)}ngOnDestroy(){this.geoJSONSourceComponent._removeFeature(this.feature)}updateCoordinates(b){this.feature.geometry.coordinates=b,this.geoJSONSourceComponent.updateFeatureData.next(void 0)}static{this.\u0275fac=function(Y){return new(Y||We)(se.rXU((0,se.Rfq)(()=>or)))}}static{this.\u0275cmp=se.VBU({type:We,selectors:[["mgl-feature"]],inputs:{id:"id",geometry:"geometry",properties:"properties"},standalone:!0,features:[se.aNF],decls:0,vars:0,template:function(Y,dt){},encapsulation:2,changeDetection:0})}}return We})(),Dn=(()=>{class We{constructor(b,Y){this.mapService=b,this.zone=Y,this.imageError=new se.bkB,this.imageLoaded=new se.bkB,this.isAdded=!1,this.isAdding=!1}ngOnInit(){this.sub=this.mapService.mapLoaded$.pipe((0,mi.n)(()=>(0,Ut.R)(this.mapService.mapInstance,"styledata").pipe((0,Qt.Z)(void 0),(0,Vt.p)(()=>
3!this.isAdding&&!this.mapService.mapInstance.hasImage(this.id))))).subscribe(()=>this.init())}ngOnChanges(b){(b.data&&!b.data.isFirstChange()||b.options&&!b.options.isFirstChange()||b.url&&!b.url.isFirstChange())&&(this.ngOnDestroy(),this.ngOnInit())}ngOnDestroy(){this.isAdded&&this.mapService.removeImage(this.id),this.sub&&this.sub.unsubscribe()}init(){var b=this;return(0,ht.A)(function*(){if(b.isAdding=!0,b.data)b.mapService.addImage(b.id,b.data,b.options),b.isAdded=!0,b.isAdding=!1;else if(b.url)try{yield b.mapService.loadAndAddImage(b.id,b.url,b.options),b.isAdded=!0,b.isAdding=!1,b.zone.run(()=>{b.imageLoaded.emit()})}catch(Y){b.zone.run(()=>{b.imageError.emit(Y)})}})()}static{this.\u0275fac=function(Y){return new(Y||We)(se.rXU(Rt),se.rXU(se.SKi))}}static{this.\u0275cmp=se.VBU({type:We,selectors:[["mgl-image"]],inputs:{id:"id",data:"data",options:"options",url:"url"},outputs:{imageError:"imageError",imageLoaded:"imageLoaded"},standalone:!0,features:[se.OA$,se.aNF],decls:0,vars:0,template:function(Y,dt){},encapsulation:2})}}return We})(),tn=(()=>{class We{constructor(b){this.mapService=b,this.layerClick=new se.bkB,this.layerDblClick=new se.bkB,this.layerMouseDown=new se.bkB,this.layerMouseUp=new se.bkB,this.layerMouseEnter=new se.bkB,this.layerMouseLeave=new se.bkB,this.layerMouseMove=new se.bkB,this.layerMouseOver=new se.bkB,this.layerMouseOut=new se.bkB,this.layerContextMenu=new se.bkB,this.layerTouchStart=new se.bkB,this.layerTouchEnd=new se.bkB,this.layerTouchCancel=new se.bkB,this.layerAdded=!1}ngOnInit(){this.sub=this.mapService.mapLoaded$.pipe((0,mi.n)(()=>(0,Ut.R)(this.mapService.mapInstance,"styledata").pipe((0,bi.T)(()=>!1),(0,Vt.p)(()=>!this.mapService.mapInstance.getLayer(this.id)),(0,Qt.Z)(!0)))).subscribe(b=>this.init(b))}ngOnChanges(b){this.layerAdded&&(b.paint&&!b.paint.isFirstChange()&&this.mapService.setAllLayerPaintProperty(this.id,b.paint.currentValue),b.layout&&!b.layout.isFirstChange()&&this.mapService.setAllLayerLayoutProperty(this.id,b.layout.currentValue),b.filter&&!b.filter.isFirstChange()&&this.mapService.setLayerFilter(this.id,b.filter.currentValue),b.before&&!b.before.isFirstChange()&&this.mapService.setLayerBefore(this.id,b.before.currentValue),(b.minzoom&&!b.minzoom.isFirstChange()||b.maxzoom&&!b.maxzoom.isFirstChange())&&this.mapService.setLayerZoomRange(this.id,this.minzoom,this.maxzoom))}ngOnDestroy(){this.layerAdded&&(this.mapService.removeLayer(this.id),void 0!==this.sourceIdAdded&&this.mapService.getSource(this.sourceIdAdded)&&this.mapService.removeSource(this.sourceIdAdded)),this.sub&&this.sub.unsubscribe()}
3init(b){const Y={layerOptions:{id:this.id,type:this.type,source:this.source,metadata:this.metadata,"source-layer":this.sourceLayer,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this.layout,paint:this.paint},layerEvents:{layerClick:this.layerClick,layerDblClick:this.layerDblClick,layerMouseDown:this.layerMouseDown,layerMouseUp:this.layerMouseUp,layerMouseEnter:this.layerMouseEnter,layerMouseLeave:this.layerMouseLeave,layerMouseMove:this.layerMouseMove,layerMouseOver:this.layerMouseOver,layerMouseOut:this.layerMouseOut,layerContextMenu:this.layerContextMenu,layerTouchStart:this.layerTouchStart,layerTouchEnd:this.layerTouchEnd,layerTouchCancel:this.layerTouchCancel}};this.removeSource&&"string"!=typeof this.source&&void 0===this.mapService.getSource(this.id)&&(this.sourceIdAdded=this.id),this.mapService.addLayer(Y,b,this.before),void 0!==this.sourceIdAdded&&void 0===this.mapService.getSource(this.sourceIdAdded)&&(this.sourceIdAdded=void 0),this.layerAdded=!0}static{this.\u0275fac=function(Y){return new(Y||We)(se.rXU(Rt))}}static{this.\u0275cmp=se.VBU({type:We,selectors:[["mgl-layer"]],inputs:{id:"id",source:"source",type:"type",metadata:"metadata",sourceLayer:"sourceLayer",removeSource:"removeSource",filter:"filter",layout:"layout",paint:"paint",before:"before",minzoom:"minzoom",maxzoom:"maxzoom"},outputs:{layerClick:"layerClick",layerDblClick:"layerDblClick",layerMouseDown:"layerMouseDown",layerMouseUp:"layerMouseUp",layerMouseEnter:"layerMouseEnter",layerMouseLeave:"layerMouseLeave",layerMouseMove:"layerMouseMove",layerMouseOver:"layerMouseOver",layerMouseOut:"layerMouseOut",layerContextMenu:"layerContextMenu",layerTouchStart:"layerTouchStart",layerTouchEnd:"layerTouchEnd",layerTouchCancel:"layerTouchCancel"},standalone:!0,features:[se.OA$,se.aNF],decls:0,vars:0,template:function(Y,dt){},encapsulation:2})}}return We})(),Yr=(()=>{class We{get mapInstance(){return this.mapService.mapInstance}constructor(b,Y){this.mapService=b,this.elementRef=Y,this.movingMethod="flyTo",this.mapResize=new se.bkB,this.mapRemove=new se.bkB,this.mapMouseDown=new se.bkB,this.mapMouseUp=new se.bkB,this.mapMouseMove=new se.bkB,this.mapClick=new se.bkB,this.mapDblClick=new se.bkB,this.mapMouseOver=new se.bkB,this.mapMouseOut=new se.bkB,this.mapContextMenu=new se.bkB,this.mapTouchStart=new se.bkB,this.mapTouchEnd=new se.bkB,this.mapTouchMove=new se.bkB,this.mapTouchCancel=new se.bkB,this.mapWheel=new se.bkB,this.moveStart=new se.bkB,this.move=new se.bkB,this.moveEnd=new se.bkB,this.mapDragStart=new se.bkB,this.mapDrag=new se.bkB,this.mapDragEnd=new se.bkB,this.zoomStart=new se.bkB,this.zoomEvt=new se.bkB,this.zoomEnd=new se.bkB,this.rotateStart=new se.bkB,this.rotate=new se.bkB,this.rotateEnd=new se.bkB,this.pitchStart=new se.bkB,this.pitchEvt=new se.bkB,this.pitchEnd=new se.bkB,this.boxZoomStart=new se.bkB,this.boxZoomEnd=new se.bkB,this.boxZoomCancel=new se.bkB,this.webGlContextLost=new se.bkB,this.webGlContextRestored=new se.bkB,this.mapLoad=new se.bkB,this.idle=new se.bkB,this.render=new se.bkB,this.mapError=ne
3w se.bkB,this.data=new se.bkB,this.styleData=new se.bkB,this.sourceData=new se.bkB,this.dataLoading=new se.bkB,this.styleDataLoading=new se.bkB,this.sourceDataLoading=new se.bkB,this.styleImageMissing=new se.bkB,this.subscriptions=[],(0,se.mal)(()=>{if(this.preserveDrawingBuffer){const dt=this.elementRef.nativeElement;dt.setAttribute("data-cy","map"),this.subscriptions.push(this.mapLoad.subscribe(()=>{dt.setAttribute("data-loaded","true")})),this.subscriptions.push(this.idle.subscribe(()=>{dt.setAttribute("data-idle","true")})),this.subscriptions.push(this.render.subscribe(()=>{dt.removeAttribute("data-idle")}))}this.mapService.setup({mapOptions:{collectResourceTiming:this.collectResourceTiming,container:this.mapContainer.nativeElement,crossSourceCollisions:this.crossSourceCollisions,fadeDuration:this.fadeDuration,minZoom:this.minZoom,maxZoom:this.maxZoom,minPitch:this.minPitch,maxPitch:this.maxPitch,style:this.style,hash:this.hash,interactive:this.interactive,bearingSnap:this.bearingSnap,pitchWithRotate:this.pitchWithRotate,clickTolerance:this.clickTolerance,attributionControl:this.attributionControl,logoPosition:this.logoPosition,failIfMajorPerformanceCaveat:this.failIfMajorPerformanceCaveat,preserveDrawingBuffer:this.preserveDrawingBuffer,refreshExpiredTiles:this.refreshExpiredTiles,maxBounds:this.maxBounds,scrollZoom:this.scrollZoom,boxZoom:this.boxZoom,dragRotate:this.dragRotate,dragPan:this.dragPan,keyboard:this.keyboard,doubleClickZoom:this.doubleClickZoom,touchPitch:this.touchPitch,touchZoomRotate:this.touchZoomRotate,trackResize:this.trackResize,center:this.center,zoom:this.zoom,bearing:this.bearing,pitch:this.pitch,renderWorldCopies:this.renderWorldCopies,maxTileCacheSize:this.maxTileCacheSize,localIdeographFontFamily:this.localIdeographFontFamily,transformRequest:this.transformRequest,bounds:this.bounds?this.bounds:this.fitBounds,fitBoundsOptions:this.fitBoundsOptions,antialias:this.antialias,locale:this.locale,cooperativeGestures:this.cooperativeGestures,terrain:this.terrain},mapEvents:this}),this.cursorStyle&&this.mapService.changeCanvasCursor(this.cursorStyle)})}ngOnDestroy(){this.mapService.destroyMap();for(const b of this.subscriptions)b.unsubscribe()}ngOnChanges(b){var Y=this;return(0,ht.A)(function*(){yield(0,at._)(Y.mapService.mapCreated$),b.cursorStyle&&!b.cursorStyle.isFirstChange()&&Y.mapService.changeCanvasCursor(b.cursorStyle.currentValue),b.minZoom&&!b.minZoom.isFirstChange()&&Y.mapService.updateMinZoom(b.minZoom.currentValue),b.maxZoom&&!b.maxZoom.isFirstChange()&&Y.mapService.updateMaxZoom(b.maxZoom.currentValue),b.minPitch&&!b.minPitch.isFirstChange()&&Y.mapService.updateMinPitch(b.minPitch.currentValue),b.maxPitch&&!b.maxPitch.isFirstChange()&&Y.mapService.updateMaxPitch(b.maxPitch.currentValue),b.renderWorldCopies&&!b.renderWorldCopies.isFirstChange()&&Y.mapService.updateRenderWorldCopies(b.renderWorldCopies.currentValue),b.scrollZoom&&!b.scrollZoom.isFirstChange()&&Y.mapService.updateScrollZoom(b.scrollZoom.currentValue),b.dragRotate&&!b.dragRotate.isFirstChange()&&Y.mapService.updateDragRotate(b.dragRotate.currentValue),b.touchPitch&&!b.touchPitch.isFirstChange()&&Y.mapService.updateTouchPitch(b.touchPitch.currentValue),b.touchZoomRotate&&!b.touchZoomRotate.isFirstChange()&&Y.mapService.updateTouchZoomRotate(b.touchZoomRotate.currentValue),b.doubleClickZoom&&!b.doubleClickZoom.isFirstChange()&&Y.mapService.updateDoubleClickZoom(b.doubleClickZoom.currentValue),b.keyboard&&!b.keyboard.isFirstChange()&&Y.mapService.updateKeyboard(b.keyboard.currentValue),b.dragPan&&!b.dragPan.isFirstChange()&&Y.mapService.updateDragPan(b.dragPan.currentValue),b.boxZoom&&!b.boxZoom.isFirstChange()&&Y.mapService.updateBoxZoom(b.boxZoom.currentValue),b.style&&!b.style.isFirstChange()&&Y.mapService.updateStyle(b.style.currentValue),b.maxBounds&&!b.maxBounds.isFirstChange()&&Y.mapService.updateMaxBounds(b.maxBounds.currentValue),b.fitBounds&&b.fitBounds.currentValue&&!b.fitBounds.isFirstChange()&&Y.mapService.fitBounds(b.fitBounds.currentValue,Y.fitBoundsOptions),b.fitScreenCoordinates&&b.fitScreenCoordinates.currentValue&&((Y.center||Y.zoom||Y.pitch||Y.fitBounds)&&b.fitScreenCoordinates.isFirstChange()&&console.warn("[ngx-maplibre-gl] center / zoom / pitch / fitBounds inputs are being overridden by fitScreenCoordinates input"),Y.mapService.fitScreenCoordinates(b.fitScreenCoordinates.currentValue,Y.bearing?Y.bearing[0]:0,Y.movingOptions)),!Y.centerWithPanTo||!b.center||b.center.isFirstChange()||b.zoom||b.bearing||b.pitch?(b.center&&!b.center.isFirstChange()||b.zoom&&!b.zoom.isFirstChange()||b.bearing&&!b.bearing.isFirstChange()&&!b.fitScreenCoordinates||b.pitch&&
3!b.pitch.isFirstChange())&&Y.mapService.move(Y.movingMethod,Y.movingOptions,b.zoom&&Y.zoom?Y.zoom[0]:void 0,b.center?Y.center:void 0,b.bearing&&Y.bearing?Y.bearing[0]:void 0,b.pitch&&Y.pitch?Y.pitch[0]:void 0):Y.mapService.panTo(Y.center,Y.panToOptions),b.terrain&&!b.terrain.isFirstChange()&&Y.mapService.updateTerrain(b.terrain.currentValue)})()}static{this.\u0275fac=function(Y){return new(Y||We)(se.rXU(Rt),se.rXU(se.aKT))}}static{this.\u0275cmp=se.VBU({type:We,selectors:[["mgl-map"]],viewQuery:function(Y,dt){if(1&Y&&se.GBs(je,7),2&Y){let zt;se.mGM(zt=se.lsd())&&(dt.mapContainer=zt.first)}},inputs:{collectResourceTiming:"collectResourceTiming",crossSourceCollisions:"crossSourceCollisions",customMapboxApiUrl:"customMapboxApiUrl",fadeDuration:"fadeDuration",hash:"hash",refreshExpiredTiles:"refreshExpiredTiles",failIfMajorPerformanceCaveat:"failIfMajorPerformanceCaveat",bearingSnap:"bearingSnap",interactive:"interactive",pitchWithRotate:"pitchWithRotate",clickTolerance:"clickTolerance",attributionControl:"attributionControl",logoPosition:"logoPosition",maxTileCacheSize:"maxTileCacheSize",localIdeographFontFamily:"localIdeographFontFamily",preserveDrawingBuffer:"preserveDrawingBuffer",trackResize:"trackResize",transformRequest:"transformRequest",bounds:"bounds",antialias:"antialias",locale:"locale",cooperativeGestures:"cooperativeGestures",minZoom:"minZoom",maxZoom:"maxZoom",minPitch:"minPitch",maxPitch:"maxPitch",scrollZoom:"scrollZoom",dragRotate:"dragRotate",touchPitch:"touchPitch",touchZoomRotate:"touchZoomRotate",doubleClickZoom:"doubleClickZoom",keyboard:"keyboard",dragPan:"dragPan",boxZoom:"boxZoom",style:"style",center:"center",maxBounds:"maxBounds",zoom:"zoom",bearing:"bearing",pitch:"pitch",fitBoundsOptions:"fitBoundsOptions",renderWorldCopies:"renderWorldCopies",terrain:"terrain",movingMethod:"movingMethod",movingOptions:"movingOptions",fitBounds:"fitBounds",fitScreenCoordinates:"fitScreenCoordinates",centerWithPanTo:"centerWithPanTo",panToOptions:"panToOptions",cursorStyle:"cursorStyle"},outputs:{mapResize:"mapResize",mapRemove:"mapRemove",mapMouseDown:"mapMouseDown",mapMouseUp:"mapMouseUp",mapMouseMove:"mapMouseMove",mapClick:"mapClick",mapDblClick:"mapDblClick",mapMouseOver:"mapMouseOver",mapMouseOut:"mapMouseOut",mapContextMenu:"mapContextMenu",mapTouchStart:"mapTouchStart",mapTouchEnd:"mapTouchEnd",mapTouchMove:"mapTouchMove",mapTouchCancel:"mapTouchCancel",mapWheel:"mapWheel",moveStart:"moveStart",move:"move",moveEnd:"moveEnd",mapDragStart:"mapDragStart",mapDrag:"mapDrag",mapDragEnd:"mapDragEnd",zoomStart:"zoomStart",zoomEvt:"zoomEvt",zoomEnd:"zoomEnd",rotateStart:"rotateStart",rotate:"rotate",rotateEnd:"rotateEnd",pitchStart:"pitchStart",pitchEvt:"pitchEvt",pitchEnd:"pitchEnd",boxZoomStart:"boxZoomStart",boxZoomEnd:"boxZoomEnd",boxZoomCancel:"boxZoomCancel",webGlContextLost:"webGlContextLost",webGlContextRestored:"webGlContextRestored",mapLoad:"mapLoad",idle:"idle",render:"render",mapError:"mapError",data:"data",styleData:"styleData",sourceData:"sourceData",dataLoading:"dataLoading",styleDataLoading:"styleDataLoading",sourceDataLoading:"sourceDataLoading",styleImageMissing:"styleImageMissing"},standalone:!0,features:[se.Jv_([Rt]),se.OA$,se.aNF],decls:2,vars:0,consts:[["container",""]],template:function(Y,dt){1&Y&&se.nrm(0,"div",null,0)},styles:["[_nghost-%COMP%]{display:block}div[_ngcontent-%COMP%]{height:100%;width:100%}"],changeDetection:0})}}return We})(),br=(()=>{class We{constructor(b){this.mapService=b,this.popupClose=new se.bkB,this.popupOpen=new se.bkB,(0,se.mal)(()=>{this.popupInstance=this.createPopup(),this.addPopup(this.popupInstance)})}ngOnInit(){if(this.lngLat&&this.marker||this.feature&&this.lngLat||this.feature&&this.marker)throw new Error("marker, lngLat, feature input are mutually exclusive")}ngOnChanges(b){if(b.feature&&!b.feature.isFirstChange()){const Y=b.lngLat?this.lngLat:this.feature.geometry.coordinates;this.mapService.removePopupFromMap(this.popupInstance,!0);const dt=this.createPopup();this.mapService.addPopupToMap(dt,Y,this.popupInstance.isOpen()),this.popupInstance=dt}if(b.lngLat&&!b.lngLat.isFirstChange()&&this.popupInstance.setLngLat(this.lngLat),b.marker&&!b.marker.isFirstChange()){const Y=b.marker.previousValue;Y.markerInstance&&this.mapService.removePopupFromMarker(Y.markerInstance),this.marker&&this.marker.markerInstance&&this.popupInstance&&this.mapService.addPopupToMarker(this.marker.markerInstance,this.popupInstance)}b.offset&&!b.offset.isFirstChange()&&this.popupInstance&&this.popupInstance.setOffset(this.offset)}ngOnDestroy(){this.popupInstance&&(this.lngLat||this.feature?this.mapService.removePopupFromMap(this.popupInstance):this.marker&&this.marker.markerInstance&&this.mapService.removePopupFromMarker(this.marker.markerInstance)),this.popupInstance=void 0}createPopup(){return this.mapService.createPopup({popupOptions:{closeButton:this.closeButton,closeOnClick:this.closeOnClick,closeOnMove:this.closeOnMove,focusAfterOpen:this.focusAfterOpen,anchor:this.anchor,offset:this.offset,className:this.className,maxWidth:this.maxWidth},popupEvents:{popupOpen:this.popupOpen,popupClose:this.popupClose}},this.content.nativeElement)}addPopup(b){this.mapService.mapCreated$.subscribe(()=>{if(this.lngLat||this.feature)this.mapService.addPopupToMap(b,this.lngLat?this.lngLat:this.feature.geometry.coordinates);else{if(!this.marker||!this.marker.markerInstance)throw new Error("mgl-popup need either lngLat/marker/feature to be set");this.mapService.addPopupToMarker(this.marker.markerInstance,b)}})}static{this.\u0275fac=function(Y){return new(Y||We)(se.rXU(Rt))}}static{this.\u0275cmp=se.VBU({type:We,selectors:[["mgl-popup"]],viewQuery:function(Y,dt){if(1&Y&&se.GBs(ot,7),2&Y){let zt;se.mGM(zt=se.lsd())&&(dt.content=zt.first)}},inputs:{closeButton:"closeButton",closeOnClick:"closeOnClick",closeOnMove:"closeOnMove",focusAfterOpen:"focusAfterOpen",anchor:"anchor",className:"className",maxWidth:"maxWidth",feature:"feature",lngLat:"lngLat",marker:"marker",offset:"offset"},outputs:{popupClose:"popupClose",popupOpen:"popupOpen"},standalone:!0,features:[se.OA$,se.aNF],ngContentSelectors:It,decls:3,vars:0,consts:[["content",""],["data-cy","mgl-popup"]],template:function(Y,dt){1&Y&&(se.NAR(),se.j41(0,"div",1,0),se.SdG(2),se.k0s())},encapsulation:2,changeDetection:0})}}return We})(),bn=(()=>{class We{constructor(b){this.mapService=b,this.type="vector",this.sourceAdded=!1,this.sub=new ci.yU}ngOnInit(){const b=this.mapService.mapLoaded$.subscribe(()=>{this.init();const Y=(0,Ut.R)(this.mapService.mapInstance,"styledata").pipe((0,Vt.p)(()=>
3!this.mapService.mapInstance.getSource(this.id))).subscribe(()=>{this.init()});this.sub.add(Y)});this.sub.add(b)}ngOnChanges(b){if(this.sourceAdded)if(b.bounds&&!b.bounds.isFirstChange()||b.scheme&&!b.scheme.isFirstChange()||b.minzoom&&!b.minzoom.isFirstChange()||b.maxzoom&&!b.maxzoom.isFirstChange()||b.attribution&&!b.attribution.isFirstChange()||b.promoteId&&!b.promoteId.isFirstChange())this.ngOnDestroy(),this.ngOnInit();else if(b.url&&!b.url.isFirstChange()||b.tiles&&!b.tiles.isFirstChange()){const Y=this.mapService.getSource(this.id);if(void 0===Y)return;b.url&&this.url&&Y.setUrl(this.url),b.tiles&&this.tiles&&Y.setTiles(this.tiles)}}ngOnDestroy(){this.sub.unsubscribe(),this.sourceAdded&&(this.mapService.removeSource(this.id),this.sourceAdded=!1)}init(){this.mapService.addSource(this.id,{type:this.type,url:this.url,tiles:this.tiles,bounds:this.bounds,scheme:this.scheme,minzoom:this.minzoom,maxzoom:this.maxzoom,attribution:this.attribution,promoteId:this.promoteId}),this.sourceAdded=!0}static{this.\u0275fac=function(Y){return new(Y||We)(se.rXU(Rt))}}static{this.\u0275cmp=se.VBU({type:We,selectors:[["mgl-vector-source"]],inputs:{id:"id",url:"url",tiles:"tiles",bounds:"bounds",scheme:"scheme",minzoom:"minzoom",maxzoom:"maxzoom",attribution:"attribution",promoteId:"promoteId"},standalone:!0,features:[se.OA$,se.aNF],decls:0,vars:0,template:function(Y,dt){},encapsulation:2,changeDetection:0})}}return We})()},1573:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{A:()=>Z});var ht=Tt(3597),se=6378137;function Z(at){return(0,ht.jE)(at,function(Ee,Qi){return Ee+function g(at){var Qi,Ee=0;switch(at.type){case"Polygon":return li(at.coordinates);case"MultiPolygon":for(Qi=0;Qi<at.coordinates.length;Qi++)Ee+=li(at.coordinates[Qi]);return Ee;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(Qi)},0)}function li(at){var Ee=0;if(at&&at.length>0){Ee+=Math.abs(ci(at[0]));for(var Qi=1;Qi<at.length;Qi++)Ee-=Math.abs(ci(at[Qi]))}return Ee}function ci(at){var Ee,Qi,Ii,$i,mi,Wt,fi=0,Qt=at.length;if(Qt>2){for(Wt=0;Wt<Qt;Wt++)Wt===Qt-2?(Ii=Qt-2,$i=Qt-1,mi=0):Wt===Qt-1?(Ii=Qt-1,$i=0,mi=1):(Ii=Wt,$i=Wt+1,mi=Wt+2),Ee=at[Ii],Qi=at[$i],fi+=(Ut(at[mi][0])-Ut(Ee[0]))*Math.sin(Ut(Qi[1]));fi=fi*se*se/2}return fi}function Ut(at){return at*Math.PI/180}},1723:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{A:()=>Z});var ht=Tt(3597);function se(g){var li=[1/0,1/0,-1/0,-1/0];return(0,ht.Fh)(g,function(ci){li[0]>ci[0]&&(li[0]=ci[0]),li[1]>ci[1]&&(li[1]=ci[1]),li[2]<ci[0]&&(li[2]=ci[0]),li[3]<ci[1]&&(li[3]=ci[1])}),li}se.default=se;const Z=se},7885:(Gr,Vi,Tt)=>{"use strict";function li(Bt,At,et){void 0===et&&(et={});var Zt={type:"Feature"};return(0===et.id||et.id)&&(Zt.id=et.id),et.bbox&&(Zt.bbox=et.bbox),Zt.properties=At||{},Zt.geometry=Bt,Zt}function it(Bt){return!isNaN(Bt)&&null!==Bt&&!Array.isArray(Bt)}Tt.d(Vi,{Et:()=>it,N4:()=>li})},3597:(Gr,Vi,Tt)=>{"use strict";function se(_t,ot,It){if(null!==_t)for(var je,kt,mt,lt,Pe,it,ri,Bt,wi=0,Rt=0,At=_t.type,et="FeatureCollection"===At,Zt="Feature"===At,sr=et?_t.features.length:1,cr=0;cr<sr;cr++){Pe=(Bt=!!(ri=et?_t.features[cr].geometry:Zt?_t.geometry:_t)&&"GeometryCollection"===ri.type)?ri.geometries.length:1;for(var ir=0;ir<Pe;ir++){var hr=0,or=0;if(null!==(lt=Bt?ri.geometries[ir]:ri)){it=lt.coordinates;var rr=lt.type;switch(wi=!It||"Polygon"!==rr&&"MultiPolygon"!==rr?0:1,rr){case null:break;case"Point":if(!1===ot(it,Rt,cr,hr,or))return!1;Rt++,hr++;break;case"LineString":case"MultiPoint":for(je=0;je<it.length;je++){if(!1===ot(it[je],Rt,cr,hr,or))return!1;Rt++,"MultiPoint"===rr&&hr++}"LineString"===rr&&hr++;break;case"Polygon":case"MultiLineString":for(je=0;je<it.length;je++){for(kt=0;kt<it[je].length-wi;kt++){if(!1===ot(it[je][kt],Rt,cr,hr,or))return!1;Rt++}"MultiLineString"===rr&&hr++,"Polygon"===rr&&or++}"Polygon"===rr&&hr++;break;case"MultiPolygon":for(je=0;je<it.length;je++){for(or=0,kt=0;kt<it[je].length;kt++){for(mt=0;mt<it[je][kt].length-wi;mt++){if(!1===ot(it[je][kt][mt],Rt,cr,hr,or))return!1;Rt++}or++}hr++}break;case"GeometryCollection":for(je=0;je<lt.geometries.length;je++)if(!1===se(lt.geometries[je],ot,It))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Qi(_t,ot,It){var je=It;return function Ee(_t,ot){var It,je,kt,mt,lt,Pe,it,ri,wi,Rt,Bt=0,At="FeatureCollection"===_t.type,et="Feature"===_t.type,Zt=At?_t.features.length:1;for(It=0;It<Zt;It++){for(ri=At?_t.features[It].properties:et?_t.properties:{},wi=At?_t.features[It].bbox:et?_t.bbox:void 0,Rt=At?_t.features[It].id:et?_t.id:void 0,lt=(it=!!(Pe=At?_t.features[It].geometry:et?_t.geometry:_t)&&"GeometryCollection"===Pe.type)?Pe.geometries.length:1,kt=0;kt<lt;kt++)if(null!==(mt=it?Pe.geometries[kt]:Pe))switch(mt.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===ot(mt,Bt,ri,wi,Rt))return!1;break;case"GeometryCollection":for(je=0;je<mt.geometries.length;je++)if(!1===ot(mt.geometries[je],Bt,ri,wi,Rt))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===ot(null,Bt,ri,wi,Rt))return!1;Bt++}}(_t,function(kt,mt,lt,Pe,it){je=0===mt&&void 0===It?kt:ot(je,kt,mt,lt,Pe,it)}),je}Tt.d(Vi,{Fh:()=>se,jE:()=>Qi}),Tt(7885)},248:(Gr,Vi,Tt)=>{"use strict";Tt.d(Vi,{A:()=>mr,W:()=>ur});var Ut,at,ht=9e15,se=1e9,Z="0123456789abcdef",g="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",li="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823
3066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",ci={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ht,maxE:ht,crypto:!1},Ee=!0,Qi="[DecimalError] ",Vt=Qi+"Invalid argument: ",Ii=Qi+"Precision limit exceeded",$i=Qi+"crypto unavailable",mi="[object Decimal]",Wt=Math.floor,fi=Math.pow,Qt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,bi=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,_t=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ot=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,It=1e7,je=7,mt=g.length-1,lt=li.length-1,Pe={toStringTag:mi};function it(C){var P,z,U,K=C.length-1,$="",Ie=C[0];if(K>0){for($+=Ie,P=1;P<K;P++)(z=je-(U=C[P]+"").length)&&($+=or(z)),$+=U;(z=je-(U=(Ie=C[P])+"").length)&&($+=or(z))}else if(0===Ie)return"0";for(;Ie%10==0;)Ie/=10;return $+Ie}function ri(C,P,z){if(C!==~~C||C<P||C>z)throw Error(Vt+C)}function wi(C,P,z,U){var K,$,Ie,xe;for($=C[0];$>=10;$/=10)--P;return--P<0?(P+=je,K=0):(K=Math.ceil((P+1)/je),P%=je),$=fi(10,je-P),xe=C[K]%$|0,null==U?P<3?(0==P?xe=xe/100|0:1==P&&(xe=xe/10|0),Ie=z<4&&99999==xe||z>3&&49999==xe||5e4==xe||0==xe):Ie=(z<4&&xe+1==$||z>3&&xe+1==$/2)&&(C[K+1]/$/100|0)==fi(10,P-2)-1||(xe==$/2||0==xe)&&!(C[K+1]/$/100|0):P<4?(0==P?xe=xe/1e3|0:1==P?xe=xe/100|0:2==P&&(xe=xe/10|0),Ie=(U||z<4)&&9999==xe||!U&&z>3&&4999==xe):Ie=((U||z<4)&&xe+1==$||!U&&z>3&&xe+1==$/2)&&(C[K+1]/$/1e3|0)==fi(10,P-3)-1,Ie}function Rt(C,P,z){for(var U,$,K=[0],Ie=0,xe=C.length;Ie<xe;){for($=K.length;$--;)K[$]*=P;for(K[0]+=Z.indexOf(C.charAt(Ie++)),U=0;U<K.length;U++)K[U]>z-1&&(void 0===K[U+1]&&(K[U+1]=0),K[U+1]+=K[U]/z|0,K[U]%=z)}return K.reverse()}Pe.absoluteValue=Pe.abs=function(){var C=new this.constructor(this);return C.s<0&&(C.s=1),et(C)},Pe.ceil=function(){return et(new this.constructor(this),this.e+1,2)},Pe.clampedTo=Pe.clamp=function(C,P){var U=this,K=U.constructor;if(C=new K(C),P=new K(P),!C.s||!P.s)return new K(NaN);if(C.gt(P))throw Error(Vt+P);return U.cmp(C)<0?C:U.cmp(P)>0?P:new K(U)},Pe.comparedTo=Pe.cmp=function(C){var P,z,U,K,$=this,Ie=$.d,xe=(C=new $.constructor(C)).d,qe=$.s,Fe=C.s;if(!Ie||!xe)return qe&&Fe?qe!==Fe?qe:Ie===xe?0:!Ie^qe<0?1:-1:NaN;if(!Ie[0]||!xe[0])return Ie[0]?qe:xe[0]?-Fe:0;if(qe!==Fe)return qe;if($.e!==C.e)return $.e>C.e^qe<0?1:-1;for(P=0,z=(U=Ie.length)<(K=xe.length)?U:K;P<z;++P)if(Ie[P]!==xe[P])return Ie[P]>xe[P]^qe<0?1:-1;return U===K?0:U>K^qe<0?1:-1},Pe.cosine=Pe.cos=function(){var C,P,z=this,U=z.constructor;return z.d?z.d[0]?(P=U.rounding,U.precision=(C=U.precision)+Math.max(z.e,z.sd())+je,U.rounding=1,z=function Bt(C,P){var z,U,K;if(P.isZero())return P;(U=P.d.length)<32?K=(1/br(4,z=Math.ceil(U/3))).toString():(z=16,K="2.3283064365386962890625e-10"),C.precision+=z,P=Ze(C,1,P.times(K),new C(1));for(var $=z;$--;){var Ie=P.times(P);P=Ie.times(Ie).minus(Ie).times(8).plus(1)}return C.precision-=z,P}(U,Or(U,z)),U.precision=C,U.rounding=P,et(2==at||3==at?z.neg():z,C,P,!0)):new U(1):new U(NaN)},Pe.cubeRoot=Pe.cbrt=function(){var C,P,z,U,K,$,Ie,xe,qe,Fe,Ke=this,st=Ke.constructor;if(!Ke.isFinite()||Ke.isZero())return new st(Ke);for(Ee=!1,($=Ke.s*fi(Ke.s*Ke,1/3))&&Math.abs($)!=1/0?U=new st($.toString()):(z=it(Ke.d),($=((C=Ke.e)-z.length+1)%3)&&(z+=1==$||-2==$?"0":"00"),$=fi(z,1/3),C=Wt((C+1)/3)-(C%3==(C<0?-1:2)),(U=new st(z=$==1/0?"5e"+C:(z=$.toExponential()).slice(0,z.indexOf("e")+1)+C)).s=Ke.s),Ie=(C=st.precision)+3;;)if(Fe=(qe=(xe=U).times(xe).times(xe)).plus(Ke),U=At(Fe.plus(Ke).times(xe),Fe.plus(qe),Ie+2,1),it(xe.d).slice(0,Ie)===(z=it(U.d)).slice(0,Ie)){if("9999"!=(z=z.slice(Ie-3,Ie+1))&&(K||"4999"!=z)){(!+z||!+z.slice(1)&&"5"==z.charAt(0))&&(et(U,C+1,1),P=!U.times(U).times(U).eq(Ke));break}if(!K&&(et(xe,C+1,0),xe.times(xe).times(xe).eq(Ke))){U=xe;break}Ie+=4,K=1}return Ee=!0,et(U,C,st.rounding,P)},Pe.decimalPlaces=Pe.dp=function(){var C,P=this.d,z=NaN;if(P){if(z=((C=P.length-1)-Wt(this.e/je))*je,C=P[C])for(;C%10==0;C/=10)z--;z<0&&(z=0)}return z}
vendor: 14,982 bytes, line 3
3,Pe.dividedBy=Pe.div=function(C){return At(this,new this.constructor(C))},Pe.dividedToIntegerBy=Pe.divToInt=function(C){var z=this.constructor;return et(At(this,new z(C),0,1,1),z.precision,z.rounding)},Pe.equals=Pe.eq=function(C){return 0===this.cmp(C)},Pe.floor=function(){return et(new this.constructor(this),this.e+1,3)},Pe.greaterThan=Pe.gt=function(C){return this.cmp(C)>0},Pe.greaterThanOrEqualTo=Pe.gte=function(C){var P=this.cmp(C);return 1==P||0===P},Pe.hyperbolicCosine=Pe.cosh=function(){var C,P,z,U,K,$=this,Ie=$.constructor,xe=new Ie(1);if(!$.isFinite())return new Ie($.s?1/0:NaN);if($.isZero())return xe;U=Ie.rounding,Ie.precision=(z=Ie.precision)+Math.max($.e,$.sd())+4,Ie.rounding=1,(K=$.d.length)<32?P=(1/br(4,C=Math.ceil(K/3))).toString():(C=16,P="2.3283064365386962890625e-10"),$=Ze(Ie,1,$.times(P),new Ie(1),!0);for(var qe,Fe=C,Ke=new Ie(8);Fe--;)qe=$.times($),$=xe.minus(qe.times(Ke.minus(qe.times(Ke))));return et($,Ie.precision=z,Ie.rounding=U,!0)},Pe.hyperbolicSine=Pe.sinh=function(){var C,P,z,U,K=this,$=K.constructor;if(!K.isFinite()||K.isZero())return new $(K);if(z=$.rounding,$.precision=(P=$.precision)+Math.max(K.e,K.sd())+4,$.rounding=1,(U=K.d.length)<3)K=Ze($,2,K,K,!0);else{C=1.4*Math.sqrt(U),K=Ze($,2,K=K.times(1/br(5,C=C>16?16:0|C)),K,!0);for(var Ie,xe=new $(5),qe=new $(16),Fe=new $(20);C--;)Ie=K.times(K),K=K.times(xe.plus(Ie.times(qe.times(Ie).plus(Fe))))}return $.precision=P,$.rounding=z,et(K,P,z,!0)},Pe.hyperbolicTangent=Pe.tanh=function(){var C,P,z=this,U=z.constructor;return z.isFinite()?z.isZero()?new U(z):(P=U.rounding,U.precision=(C=U.precision)+7,U.rounding=1,At(z.sinh(),z.cosh(),U.precision=C,U.rounding=P)):new U(z.s)},Pe.inverseCosine=Pe.acos=function(){var C=this,P=C.constructor,z=C.abs().cmp(1),U=P.precision,K=P.rounding;return-1!==z?0===z?C.isNeg()?ir(P,U,K):new P(0):new P(NaN):C.isZero()?ir(P,U+4,K).times(.5):(P.precision=U+6,P.rounding=1,C=new P(1).minus(C).div(C.plus(1)).sqrt().atan(),P.precision=U,P.rounding=K,C.times(2))},Pe.inverseHyperbolicCosine=Pe.acosh=function(){var C,P,z=this,U=z.constructor;return z.lte(1)?new U(z.eq(1)?0:NaN):z.isFinite()?(P=U.rounding,U.precision=(C=U.precision)+Math.max(Math.abs(z.e),z.sd())+4,U.rounding=1,Ee=!1,z=z.times(z).minus(1).sqrt().plus(z),Ee=!0,U.precision=C,U.rounding=P,z.ln()):new U(z)},Pe.inverseHyperbolicSine=Pe.asinh=function(){var C,P,z=this,U=z.constructor;return!z.isFinite()||z.isZero()?new U(z):(P=U.rounding,U.precision=(C=U.precision)+2*Math.max(Math.abs(z.e),z.sd())+6,U.rounding=1,Ee=!1,z=z.times(z).plus(1).sqrt().plus(z),Ee=!0,U.precision=C,U.rounding=P,z.ln())},Pe.inverseHyperbolicTangent=Pe.atanh=function(){var C,P,z,U,K=this,$=K.constructor;return K.isFinite()?K.e>=0?new $(K.abs().eq(1)?K.s/0:K.isZero()?K:NaN):(C=$.precision,P=$.rounding,U=K.sd(),Math.max(U,C)<2*-K.e-1?et(new $(K),C,P,!0):($.precision=z=U-K.e,K=At(K.plus(1),new $(1).minus(K),z+C,1),$.precision=C+4,$.rounding=1,K=K.ln(),$.precision=C,$.rounding=P,K.times(.5))):new $(NaN)},Pe.inverseSine=Pe.asin=function(){var C,P,z,U,K=this,$=K.constructor;return K.isZero()?new $(K):(P=K.abs().cmp(1),z=$.precision,U=$.rounding,-1!==P?0===P?((C=ir($,z+4,U).times(.5)).s=K.s,C):new $(NaN):($.precision=z+6,$.rounding=1,K=K.div(new $(1).minus(K.times(K)).sqrt().plus(1)).atan(),$.precision=z,$.rounding=U,K.times(2)))},Pe.inverseTangent=Pe.atan=function(){var C,P,z,U,K,$,Ie,xe,qe,Fe=this,Ke=Fe.constructor,st=Ke.precision,bt=Ke.rounding;if(Fe.isFinite()){if(Fe.isZero())return new Ke(Fe);if(Fe.abs().eq(1)&&st+4<=lt)return(Ie=ir(Ke,st+4,bt).times(.25)).s=Fe.s,Ie}else{if(!Fe.s)return new Ke(NaN);if(st+4<=lt)return(Ie=ir(Ke,st+4,bt).times(.5)).s=Fe.s,Ie}for(Ke.precision=xe=st+10,Ke.rounding=1,C=z=Math.min(28,xe/je+2|0);C;--C)Fe=Fe.div(Fe.times(Fe).plus(1).sqrt().plus(1));for(Ee=!1,P=Math.ceil(xe/je),U=1,qe=Fe.times(Fe),Ie=new Ke(Fe),K=Fe;-1!==C;)if(K=K.times(qe),$=Ie.minus(K.div(U+=2)),K=K.times(qe),void 0!==(Ie=$.plus(K.div(U+=2))).d[P])for(C=P;Ie.d[C]===$.d[C]&&C--;);return z&&(Ie=Ie.times(2<<z-1)),Ee=!0,et(Ie,Ke.precision=st,Ke.rounding=bt,!0)},Pe.isFinite=function(){return!!this.d},Pe.isInteger=Pe.isInt=function(){return!!this.d&&Wt(this.e/je)>this.d.length-2},Pe.isNaN=function(){return!this.s},Pe.isNegative=Pe.isNeg=function(){return this.s<0},Pe.isPositive=Pe.isPos=function(){return this.s>0},Pe.isZero=function(){return!!this.d&&0===this.d[0]},Pe.lessThan=Pe.lt=function(C){return this.cmp(C)<0},Pe.lessThanOrEqualTo=Pe.lte=function(C){return this.cmp(C)<1},Pe.logarithm=Pe.log=function(C){var P,z,U,K,$,Ie,xe,qe,Fe=this,Ke=Fe.constructor,st=Ke.precision,bt=Ke.rounding;if(null==C)C=new Ke(10),P=!0;else{if(z=(C=new Ke(C)).d,C.s<0||!z||!z[0]||C.eq(1))return new Ke(NaN);P=C.eq(10)}if(z=Fe.d,Fe.s<0||!z||!z[0]||Fe.eq(1))return new Ke(z&&!z[0]?-1/0:1!=Fe.s?NaN:z?0:1/0);if(P)if(z.length>1)$=!0;else{for(K=z[0];K%10==0;)K/=10;$=1!==K}if(Ee=!1,Ie=Yr(Fe,xe=st+5),U=P?cr(Ke,xe+10):Yr(C,xe),wi((qe=At(Ie,U,xe,1)).d,K=st,bt))do{if(Ie=Yr(Fe,xe+=10),U=P?cr(Ke,xe+10):Yr(C,xe),qe=At(Ie,U,xe,1),!$){+it(qe.d).slice(K+1,K+15)+1==1e14&&(qe=et(qe,st+1,0));break}}while(wi(qe.d,K+=10,bt));return Ee=!0,et(qe,st,bt)},Pe.minus=Pe.sub=function(C){var P,z,U,K,$,Ie,xe,qe,Fe,Ke,st,bt,ei=this,Di=ei.constructor;if(C=new Di(C),!ei.d||!C.d)return ei.s&&C.s?ei.d?C.s=-C.s:C=new Di(C.d||ei.s!==C.s?ei:NaN):C=new Di(NaN),C;if(ei.s!=C.s)return C.s=-C.s,ei.plus(C);if(bt=C.d,xe=Di.precision,qe=Di.rounding,!(Fe=ei.d)[0]||!bt[0]){if(bt[0])C.s=-C.s;else{if(!Fe[0])return new Di(3===qe?-0:0);C=new Di(ei)}return Ee?et(C,xe,qe):C}if(z=Wt(C.e/je),Ke=Wt(ei.e/je),Fe=Fe.slice(),$=Ke-z){for((st=$<0)?(P=Fe,$=-$,Ie=bt.length):(P=bt,z=Ke,Ie=Fe.length),$>(U=Math.max(Math.ceil(xe/je),Ie)+2)&&($=U,P.length=1),P.reverse(),U=$;U--;)P.push(0);P.reverse()}else{for((st=(U=Fe.length)<(Ie=bt.length))&&(Ie=U),U=0;U<Ie;U++)if(Fe[U]!=bt[U]){st=Fe[U]<bt[U];break}$=0}for(st&&(P=Fe,Fe=bt,bt=P,C.s=-C.s),U=bt.length-(Ie=Fe.length);U>0;--U)Fe[Ie++]=0;for(U=bt.length;U>$;){if(Fe[--U]<bt[U]){for(K=U;K&&0===Fe[--K];)Fe[K]=It-1;--Fe[K],Fe[U]+=It}Fe[U]-=bt[U]}for(;0===Fe[--Ie];)Fe.pop();for(;0===Fe[0];Fe.shift())--z;return Fe[0]?(C.d=Fe,C.e=sr(Fe,z),Ee?et(C,xe,qe):C):new Di(3===qe?-0:0)},Pe.modulo=Pe.mod=function(C){var P,z=this,U=z.constructor;return C=new U(C),!z.d||!C.s||C.d&&!C.d[0]?new U(NaN):!C.d||z.d&&!z.d[0]?et(new U(z),U.precision,U.rounding):(Ee=!1,9==U.modulo?(P=At(z,C.abs(),0,3,1)).s*=C.s:P=At(z,C,0,U.modulo,1),P=P.times(C),Ee=!0,z.minus(P))},Pe.naturalExponential=Pe.exp=function(){return tn(this)},Pe.naturalLogarithm=Pe.ln=function(){return Yr(this)},Pe.negated=Pe.neg=function(){var C=new this.constructor(this);return C.s=-C.s,et(C)},Pe.plus=Pe.add=function(C){var P,z,U,K,$,Ie,xe,qe,Fe,Ke,st=this,bt=st.constructor;if(C=new bt(C),!st.d||!C.d)return st.s&&C.s?st.d||(C=new bt(C.d||st.s===C.s?st:NaN)):C=new bt(NaN),C;if(st.s!=C.s)return C.s=-C.s,st.minus(C);if(Ke=C.d,xe=bt.precision,qe=bt.rounding,!(Fe=st.d)[0]||!Ke[0])return Ke[0]||(C=new bt(st)),Ee?et(C,xe,qe):C;if($=Wt(st.e/je),U=Wt(C.e/je),Fe=Fe.slice(),K=$-U){for(K<0?(z=Fe,K=-K,Ie=Ke.length):(z=Ke,U=$,Ie=Fe.length),K>(Ie=($=Math.ceil(xe/je))>Ie?$+1:Ie+1)&&(K=Ie,z.length=1),z.reverse();K--;)z.push(0);z.reverse()}for((Ie=Fe.length)-(K=Ke.length)<0&&(K=Ie,z=Ke,Ke=Fe,Fe=z),P=0;K;)P=(Fe[--K]=Fe[K]+Ke[K]+P)/It|0,Fe[K]%=It;for(P&&(Fe.unshift(P),++U),Ie=Fe.length;0==Fe[--Ie];)Fe.pop();return C.d=Fe,C.e=sr(Fe,U),Ee?et(C,xe,qe):C},Pe.precision=Pe.sd=function(C){var P,z=this;if(void 0!==C&&C!==!!C&&1!==C&&0!==C)throw Error(Vt+C);return z.d?(P=hr(z.d),C&&z.e+1>P&&(P=z.e+1)):P=NaN,P},Pe.round=function(){var C=this,P=C.constructor;return et(new P(C),C.e+1,P.rounding)},Pe.sine=Pe.sin=function(){var C,P,z=this,U=z.constructor;return z.isFinite()?z.isZero()?new U(z):(P=U.rounding,U.precision=(C=U.precision)+Math.max(z.e,z.sd())+je,U.rounding=1,z=function da(C,P){var z,U=P.d.length;if(U<3)return P.isZero()?P:Ze(C,2,P,P);z=1.4*Math.sqrt(U),P=Ze(C,2,P=P.times(1/br(5,z=z>16?16:0|z)),P);for(var K,$=new C(5),Ie=new C(16),xe=new C(20);z--;)K=P.times(P),P=P.times($.plus(K.times(Ie.times(K).minus(xe))));return P}(U,Or(U,z)),U.precision=C,U.rounding=P,et(at>2?z.neg():z,C,P,!0)):new U(NaN)},Pe.squareRoot=Pe.sqrt=function(){var C,P,z,U,K,$,Ie=this,xe=Ie.d,qe=Ie.e,Fe=Ie.s,Ke=Ie.constructor;if(1!==Fe||!xe||!xe[0])return new Ke(!Fe||Fe<0&&(!xe||xe[0])?NaN:xe?Ie:1/0);for(Ee=!1,0==(Fe=Math.sqrt(+Ie))||Fe==1/0?(((P=it(xe)).length+qe)%2==0&&(P+="0"),Fe=Math.sqrt(P),qe=Wt((qe+1)/2)-(qe<0||qe%2),U=new Ke(P=Fe==1/0?"5e"+qe:(P=Fe.toExponential()).slice(0,P.indexOf("e")+1)+qe)):U=new Ke(Fe.toString()),z=(qe=Ke.precision)+3;;)if(U=($=U).plus(At(Ie,$,z+2,1)).times(.5),it($.d).slice(0,z)===(P=it(U.d)).slice(0,z)){if("9999"!=(P=P.slice(z-3,z+1))&&(K||"4999"!=P)){(!+P||!+P.slice(1)&&"5"==P.charAt(0))&&(et(U,qe+1,1),C=!U.times(U).eq(Ie));break}if(!K&&(et($,qe+1,0),$.times($).eq(Ie))){U=$;break}z+=4,K=1}return Ee=!0,et(U,qe,Ke.rounding,C)},Pe.tangent=Pe.tan=function(){var C,P,z=this,U=z.constructor;return z.isFinite()?z.isZero()?new U(z):(P=U.rounding,U.precision=(C=U.precision)+10,U.rounding=1,(z=z.sin()).s=1,z=At(z,new U(1).minus(z.times(z)).sqrt(),C+10,0),U.precision=C,U.rounding=P,et(2==at||4==at?z.neg():z,C,P,!0)):new U(NaN)},Pe.times=Pe.mul=function(C){var P,z,U,K,$,Ie,xe,qe,Fe,st=this.constructor,bt=this.d,ei=(C=new st(C)).d;if(C.s*=this.s,!(bt&&bt[0]&&ei&&ei[0]))return new st(!C.s||bt&&!bt[0]&&!ei||ei&&!ei[0]&&!bt?NaN:bt&&ei?0*C.s:C.s/0);for(z=Wt(this.e/je)+Wt(C.e/je),(qe=bt.length)<(Fe=ei.length)&&($=bt,bt=ei,ei=$,Ie=qe,qe=Fe,Fe=Ie),$=[],U=Ie=qe+Fe;U--;)$.push(0);for(U=Fe;--U>=0;){for(P=0,K=qe+U;K>U;)xe=$[K]+ei[U]*bt[K-U-1]+P,$[K--]=xe%It|0,P=xe/It|0;$[K]=($[K]+P)%It|0}for(;!$[--Ie];)$.pop();return P?++z:$.shift(),C.d=$,C.e=sr($,z),Ee?et(C,st.precision,st.rounding):C},Pe.toBinary=function(C,P){return Li(this,2,C,P)},Pe.toDecimalPlaces=Pe.toDP=function(C,P){var z=this,U=z.constructor;return z=new U(z),void 0===C?z:(ri(C,0,se),void 0===P?P=U.rounding:ri(P,0,8),et(z,C+z.e+1,P))},Pe.toExponential=function(C,P){var z,U=this,K=U.constructor;return void 0===C?z=Zt(U,!0):(ri(C,0,se),void 0===P?P=K.rounding:ri(P,0,8),z=Zt(U=et(new K(U),C+1,P),!0,C+1)),U.isNeg()&&!U.isZero()?"-"+z:z},Pe.toFixed=function(C,P){var z,U,K=this,$=K.constructor;return void 0===C?z=Zt(K):(ri(C,0,se),void 0===P?P=$.rounding:ri(P,0,8),z=Zt(U=et(new $(K),C+K.e+1,P),!1,C+U.e+1)),K.isNeg()&&!K.isZero()?"-"+z:z},Pe.toFraction=function(C){var P,z,U,K,$,Ie,xe,qe,Fe,Ke,st,bt,ei=this,Di=ei.d,yi=ei.constructor;if(!Di)return new yi(ei);if(Fe=z=new yi(1),U=qe=new yi(0),$=(P=new yi(U)).e=hr(Di)-ei.e-1,P.d[0]=fi(10,(Ie=$%je)<0?je+Ie:Ie),null==C)C=$>0?P:Fe;else{if(!(xe=new yi(C)).isInt()||xe.lt(Fe))throw Error(Vt+xe);C=xe.gt(P)?$>0?P:Fe:xe}for(Ee=!1,xe=new yi(it(Di)),Ke=yi.precision,yi.precision=$=Di.length*je*2;st=At(xe,P,0,1,1),1!=(K=z.plus(st.times(U))).cmp(C);)z=U,U=K,Fe=qe.plus(st.times(K=Fe)),qe=K,P=xe.minus(st.times(K=P)),xe=K;return K=At(C.minus(z),U,0,1,1),qe=qe.plus(K.times(Fe)),z=z.plus(K.times(U)),qe.s=Fe.s=ei.s,bt=At(Fe,U,$,1).minus(ei).abs().cmp(At(qe,z,$,1).minus(ei).abs())<1?[Fe,U]:[qe,z],yi.precision=Ke,Ee=!0,bt},Pe.toHexadecimal=Pe.toHex=function(C,P){return Li(this,16,C,P)},Pe.toNearest=function(C,P){var z=this,U=z.constructor;if(z=new U(z),null==C){if(!z.d)return z;C=new U(1),P=U.rounding}else{if(C=new U(C),void 0===P?P=U.rounding:ri(P,0,8),!z.d)return C.s?z:C;if(!C.d)return C.s&&(C.s=z.s),C}return C.d[0]?(Ee=!1,z=At(z,C,0,P,1).times(C),Ee=!0,et(z)):(C.s=z.s,z=C),z},Pe.toNumber=function(){return+this},Pe.toOctal=function(C,P){return Li(this,8,C,P)},Pe.toPower=Pe.pow=function(C){var P,z,U,K,$,Ie,xe=this,qe=xe.constructor,Fe=+(C=new qe(C));if(!(xe.d&&C.d&&xe.d[0]&&C.d[0]))return new qe(fi(+xe,Fe));if((xe=new qe(xe)).eq(1))return xe;if(U=qe.precision,$=qe.rounding,C.eq(1))return et(xe,U,$);if((P=Wt(C.e/je))>=C.d.length-1&&(z=Fe<0?-Fe:Fe)<=9007199254740991)return K=rr(qe,xe,z,U),C.s<0?new qe(1).div(K):et(K,U,$);if((Ie=xe.s)<0){if(P<C.d.length-1)return new qe(NaN);if(1&C.d[P]||(Ie=1),0==xe.e&&1==xe.d[0]&&1==xe.d.length)return xe.s=Ie,xe}return(P=0!=(z=fi(+xe,Fe))&&isFinite(z)?new qe(z+"").e:Wt(Fe*(Math.log("0."+it(xe.d))/Math.LN10+xe.e+1)))>qe.maxE+1||P<qe.minE-1?new qe(P>0?Ie/0:0):(Ee=!1,qe.rounding=xe.s=1,z=Math.min(12,(P+"").length),(K=tn(C.times(Yr(xe,U+z)),U)).d&&wi((K=et(K,U+5,1)).d,U,$)&&+it((K=et(tn(C.times(Yr(xe,(P=U+10)+z)),P),P+5,1)).d).slice(U+1,U+15)+1==1e14&&(K=et(K,U+1,0)),K.s=Ie,Ee=!0,qe.rounding=$,et(K,U,$))},Pe.toPrecision=function(C,P){var z,U=this,K=U.constructor;return void 0===C?z=Zt(U,U.e<=K.toExpNeg||U.e>=K.toExpPos):(ri(C,1,se),void 0===P?P=K.rounding:ri(P,0,8),z=Zt(U=et(new K(U),C,P),C<=U.e||U.e<=K.toExpNeg,C)),U.isNeg()&&!U.isZero()?"-"+z:z},Pe.toSignificantDigits=Pe.toSD=function(C,P){var U=this.constructor;return void 0===C?(C=U.precision,P=U.rounding):(ri(C,1,se),void 0===P?P=U.rounding:ri(P,0,8)),et(new U(this),C,P)},Pe.toString=function(){var C=this,P=C.constructor,z=Zt(C,C.e<=P.toExpNeg||C.e>=P.toExpPos);return C.isNeg()&&!C.isZero()?"-"+z:z},Pe.truncated=Pe.trunc=function(){return et(new this.constructor(this),this.e+1,1)},Pe.valueOf=Pe.toJSON=function(){var C=this,P=C.constructor,z=Zt(C,C.e<=P.toExpNeg||C.e>=P.toExpPos);return C.isNeg()?"-"+z:z};var At=function(){function C(U,K,$){var Ie,xe=0,qe=U.length;for(U=U.slice();qe--;)U[qe]=(Ie=U[qe]*K+xe)%$|0,xe=Ie/$|0;return xe&&U.unshift(xe),U}function P(U,K,$,Ie){var xe,qe;if($!=Ie)qe=$>Ie?1:-1;else for(xe=qe=0;xe<$;xe++)if(U[xe]!=K[xe]){qe=U[xe]>K[xe]?1:-1;break}return qe}function z(U,K,$,Ie){for(var xe=0;$--;)U[$]-=xe,U[$]=(xe=U[$]<K[$]?1:0)*Ie+U[$]-K[$];for(;!U[0]&&U.length>1;)U.shift()}return function(U,K,$,Ie,xe,qe){var Fe,Ke,st,bt,ei,Di,yi,xr,ki,Hr,Ri,Pi,Ca,Sr,es,Zr,ts,pa,Dr,kn,Hi=U.constructor,is=U.s==K.s?1:-1,Fr=U.d,Zi=K.d;if(!(Fr&&Fr[0]&&Zi&&Zi[0]))return new Hi(U.s&&K.s&&(Fr?!Zi||Fr[0]!=Zi[0]:Zi)?Fr&&0==Fr[0]||!Zi?0*is:is/0:NaN);for(qe?(ei=1,Ke=U.e-K.e):(qe=It,Ke=Wt(U.e/(ei=je))-Wt(K.e/ei)),Dr=Zi.length,ts=Fr.length,Hr=(ki=new Hi(is)).d=[],st=0;Zi[st]==(Fr[st]||0);st++);if(Zi[st]>(Fr[st]||0)&&Ke--,null==$?(Sr=$=Hi.precision,Ie=Hi.rounding):Sr=xe?$+(U.e-K.e)+1:$,Sr<0)Hr.push(1),Di=!0;else{if(Sr=Sr/ei+2|0,st=0,1==Dr){for(bt=0,Zi=Zi[0],Sr++;(st<ts||bt)&&Sr--;st++)Hr[st]=(es=bt*qe+(Fr[st]||0))/Zi|0,bt=es%Zi|0;Di=bt||st<ts}else{for((bt=qe/(Zi[0]+1)|0)>1&&(Zi=C(Zi,bt,qe),Fr=C(Fr,bt,qe),Dr=Zi.length,ts=Fr.length),Zr=Dr,Pi=(Ri=Fr.slice(0,Dr)).length;Pi<Dr;)Ri[Pi++]=0;(kn=Zi.slice()).unshift(0),pa=Zi[0],Zi[1]>=qe/2&&++pa;do{bt=0,(Fe=P(Zi,Ri,Dr,Pi))<0?(Ca=Ri[0],Dr!=Pi&&(Ca=Ca*qe+(Ri[1]||0)),(bt=Ca/pa|0)>1?(bt>=qe&&(bt=qe-1),1==(Fe=P(yi=C(Zi,bt,qe),Ri,xr=yi.length,Pi=Ri.length))&&(bt--,z(yi,Dr<xr?kn:Zi,xr,qe))):(0==bt&&(Fe=bt=1),yi=Zi.slice()),(xr=yi.length)<Pi&&yi.unshift(0),z(Ri,yi,Pi,qe),-1==Fe&&(Fe=P(Zi,Ri,Dr,Pi=Ri.length))<1&&(bt++,z(Ri,Dr<Pi?kn:Zi,Pi,qe)),Pi=Ri.length):0===Fe&&(bt++,Ri=[0]),Hr[st++]=bt,Fe&&Ri[0]?Ri[Pi++]=Fr[Zr]||0:(Ri=[Fr[Zr]],Pi=1)}while((Zr++<ts||void 0!==Ri[0])&&Sr--);Di=void 0!==Ri[0]}Hr[0]||Hr.shift()}if(1==ei)ki.e=Ke,Ut=Di;else{for(st=1,bt=Hr[0];bt>=10;
vendor: 4,559 bytes, line 3
3bt/=10)st++;ki.e=st+Ke*ei-1,et(ki,xe?$+ki.e+1:$,Ie,Di)}return ki}}();function et(C,P,z,U){var K,$,Ie,xe,qe,Fe,Ke,st,bt,ei=C.constructor;e:if(null!=P){if(!(st=C.d))return C;for(K=1,xe=st[0];xe>=10;xe/=10)K++;if(($=P-K)<0)$+=je,qe=(Ke=st[bt=0])/fi(10,K-(Ie=P)-1)%10|0;else if((bt=Math.ceil(($+1)/je))>=(xe=st.length)){if(!U)break e;for(;xe++<=bt;)st.push(0);Ke=qe=0,K=1,Ie=($%=je)-je+1}else{for(Ke=xe=st[bt],K=1;xe>=10;xe/=10)K++;qe=(Ie=($%=je)-je+K)<0?0:Ke/fi(10,K-Ie-1)%10|0}if(U=U||P<0||void 0!==st[bt+1]||(Ie<0?Ke:Ke%fi(10,K-Ie-1)),Fe=z<4?(qe||U)&&(0==z||z==(C.s<0?3:2)):qe>5||5==qe&&(4==z||U||6==z&&($>0?Ie>0?Ke/fi(10,K-Ie):0:st[bt-1])%10&1||z==(C.s<0?8:7)),P<1||!st[0])return st.length=0,Fe?(st[0]=fi(10,(je-(P-=C.e+1)%je)%je),C.e=-P||0):st[0]=C.e=0,C;if(0==$?(st.length=bt,xe=1,bt--):(st.length=bt+1,xe=fi(10,je-$),st[bt]=Ie>0?(Ke/fi(10,K-Ie)%fi(10,Ie)|0)*xe:0),Fe)for(;;){if(0==bt){for($=1,Ie=st[0];Ie>=10;Ie/=10)$++;for(Ie=st[0]+=xe,xe=1;Ie>=10;Ie/=10)xe++;$!=xe&&(C.e++,st[0]==It&&(st[0]=1));break}if(st[bt]+=xe,st[bt]!=It)break;st[bt--]=0,xe=1}for($=st.length;0===st[--$];)st.pop()}return Ee&&(C.e>ei.maxE?(C.d=null,C.e=NaN):C.e<ei.minE&&(C.e=0,C.d=[0])),C}function Zt(C,P,z){if(!C.isFinite())return An(C);var U,K=C.e,$=it(C.d),Ie=$.length;return P?(z&&(U=z-Ie)>0?$=$.charAt(0)+"."+$.slice(1)+or(U):Ie>1&&($=$.charAt(0)+"."+$.slice(1)),$=$+(C.e<0?"e":"e+")+C.e):K<0?($="0."+or(-K-1)+$,z&&(U=z-Ie)>0&&($+=or(U))):K>=Ie?($+=or(K+1-Ie),z&&(U=z-K-1)>0&&($=$+"."+or(U))):((U=K+1)<Ie&&($=$.slice(0,U)+"."+$.slice(U)),z&&(U=z-Ie)>0&&(K+1===Ie&&($+="."),$+=or(U))),$}function sr(C,P){var z=C[0];for(P*=je;z>=10;z/=10)P++;return P}function cr(C,P,z){if(P>mt)throw Ee=!0,z&&(C.precision=z),Error(Ii);return et(new C(g),P,1,!0)}function ir(C,P,z){if(P>lt)throw Error(Ii);return et(new C(li),P,z,!0)}function hr(C){var P=C.length-1,z=P*je+1;if(P=C[P]){for(;P%10==0;P/=10)z--;for(P=C[0];P>=10;P/=10)z++}return z}function or(C){for(var P="";C--;)P+="0";return P}function rr(C,P,z,U){var K,$=new C(1),Ie=Math.ceil(U/je+4);for(Ee=!1;;){if(z%2&&Xi(($=$.times(P)).d,Ie)&&(K=!0),0===(z=Wt(z/2))){z=$.d.length-1,K&&0===$.d[z]&&++$.d[z];break}Xi((P=P.times(P)).d,Ie)}return Ee=!0,$}function jr(C){return 1&C.d[C.d.length-1]}function Dn(C,P,z){for(var U,K,$=new C(P[0]),Ie=0;++Ie<P.length;){if(!(K=new C(P[Ie])).s){$=K;break}((U=$.cmp(K))===z||0===U&&$.s===z)&&($=K)}return $}function tn(C,P){var z,U,K,$,Ie,xe,qe,Fe=0,Ke=0,st=0,bt=C.constructor,ei=bt.rounding,Di=bt.precision;if(!C.d||!C.d[0]||C.e>17)return new bt(C.d?C.d[0]?C.s<0?0:1/0:1:C.s?C.s<0?0:C:NaN);for(null==P?(Ee=!1,qe=Di):qe=P,xe=new bt(.03125);C.e>-2;)C=C.times(xe),st+=5;for(qe+=U=Math.log(fi(2,st))/Math.LN10*2+5|0,z=$=Ie=new bt(1),bt.precision=qe;;){if($=et($.times(C),qe,1),z=z.times(++Ke),it((xe=Ie.plus(At($,z,qe,1))).d).slice(0,qe)===it(Ie.d).slice(0,qe)){for(K=st;K--;)Ie=et(Ie.times(Ie),qe,1);if(null!=P)return bt.precision=Di,Ie;if(!(Fe<3&&wi(Ie.d,qe-U,ei,Fe)))return et(Ie,bt.precision=Di,ei,Ee=!0);bt.precision=qe+=10,z=$=xe=new bt(1),Ke=0,Fe++}Ie=xe}}function Yr(C,P){var z,U,K,$,Ie,xe,qe,Fe,Ke,st,bt,ei=1,yi=C,xr=yi.d,ki=yi.constructor,Hr=ki.rounding,Ri=ki.precision;if(yi.s<0||!xr||!xr[0]||!yi.e&&1==xr[0]&&1==xr.length)return new ki(xr&&!xr[0]?-1/0:1!=yi.s?NaN:xr?0:yi);if(null==P?(Ee=!1,Ke=Ri):Ke=P,ki.precision=Ke+=10,U=(z=it(xr)).charAt(0),!(Math.abs($=yi.e)<15e14))return Fe=cr(ki,Ke+2,Ri).times($+""),yi=Yr(new ki(U+"."+z.slice(1)),Ke-10).plus(Fe),ki.precision=Ri,null==P?et(yi,Ri,Hr,Ee=!0):yi;for(;U<7&&1!=U||1==U&&z.charAt(1)>3;)U=(z=it((yi=yi.times(C)).d)).charAt(0),ei++;for($=yi.e,U>1?(yi=new ki("0."+z),$++):yi=new ki(U+"."+z.slice(1)),st=yi,qe=Ie=yi=At(yi.minus(1),yi.plus(1),Ke,1),bt=et(yi.times(yi),Ke,1),K=3;;){if(Ie=et(Ie.times(bt),Ke,1),it((Fe=qe.plus(At(Ie,new ki(K),Ke,1))).d).slice(0,Ke)===it(qe.d).slice(0,Ke)){if(qe=qe.times(2),0!==$&&(qe=qe.plus(cr(ki,Ke+2,Ri).times($+""))),qe=At(qe,new ki(ei),Ke,1),null!=P)return ki.precision=Ri,qe;if(!wi(qe.d,Ke-10,Hr,xe))return et(qe,ki.precision=Ri,Hr,Ee=!0);ki.precision=Ke+=10,Fe=Ie=yi=At(st.minus(1),st.plus(1),Ke,1),bt=et(yi.times(yi),Ke,1),K=xe=1}qe=Fe,K+=2}}function An(C){return String(C.s*C.s/0)}function rn(C,P){var z,U,K;for((z=P.indexOf("."))>-1&&(P=P.replace(".","")),(U=P.search(/e/i))>0?(z<0&&(z=U),z+=+P.slice(U+1),P=P.substring(0,U)):z<0&&(z=P.length),U=0;48===P.charCodeAt(U);U++);for(K=P.length;48===P.charCodeAt(K-1);--K);if(P=P.slice(U,K)){if(K-=U,C.e=z=z-U-1,C.d=[],U=(z+1)%je,z<0&&(U+=je),U<K){for(U&&C.d.push(+P.slice(0,U)),K-=je;U<K;)C.d.push(+P.slice(U,U+=je));P=P.slice(U),U=je-P.length}else U-=K;for(;
vendor: 8,319 bytes, lines 3-4
3U--;)P+="0";C.d.push(+P),Ee&&(C.e>C.constructor.maxE?(C.d=null,C.e=NaN):C.e<C.constructor.minE&&(C.e=0,C.d=[0]))}else C.e=0,C.d=[0];return C}function Ze(C,P,z,U,K){var $,Ie,xe,qe,Ke=C.precision,st=Math.ceil(Ke/je);for(Ee=!1,qe=z.times(z),xe=new C(U);;){if(Ie=At(xe.times(qe),new C(P++*P++),Ke,1),xe=K?U.plus(Ie):U.minus(Ie),U=At(Ie.times(qe),new C(P++*P++),Ke,1),void 0!==(Ie=xe.plus(U)).d[st]){for($=st;Ie.d[$]===xe.d[$]&&$--;);if(-1==$)break}$=xe,xe=U,U=Ie,Ie=$}return Ee=!0,Ie.d.length=st+1,Ie}function br(C,P){for(var z=C;--P;)z*=C;return z}function Or(C,P){var z,U=P.s<0,K=ir(C,C.precision,1),$=K.times(.5);if((P=P.abs()).lte($))return at=U?4:1,P;if((z=P.divToInt(K)).isZero())at=U?3:2;else{if((P=P.minus(z.times(K))).lte($))return at=jr(z)?U?2:3:U?4:1,P;at=jr(z)?U?1:4:U?3:2}return P.minus(K).abs()}function Li(C,P,z,U){var K,$,Ie,xe,qe,Fe,Ke,st,bt,ei=C.constructor,Di=void 0!==z;if(Di?(ri(z,1,se),void 0===U?U=ei.rounding:ri(U,0,8)):(z=ei.precision,U=ei.rounding),C.isFinite()){for(Di?(K=2,16==P?z=4*z-3:8==P&&(z=3*z-2)):K=P,(Ie=(Ke=Zt(C)).indexOf("."))>=0&&(Ke=Ke.replace(".",""),(bt=new ei(1)).e=Ke.length-Ie,bt.d=Rt(Zt(bt),10,K),bt.e=bt.d.length),$=qe=(st=Rt(Ke,10,K)).length;0==st[--qe];)st.pop();if(st[0]){if(Ie<0?$--:((C=new ei(C)).d=st,C.e=$,st=(C=At(C,bt,z,U,0,K)).d,$=C.e,Fe=Ut),Ie=st[z],xe=K/2,Fe=Fe||void 0!==st[z+1],Fe=U<4?(void 0!==Ie||Fe)&&(0===U||U===(C.s<0?3:2)):Ie>xe||Ie===xe&&(4===U||Fe||6===U&&1&st[z-1]||U===(C.s<0?8:7)),st.length=z,Fe)for(;++st[--z]>K-1;)st[z]=0,z||(++$,st.unshift(1));for(qe=st.length;!st[qe-1];--qe);for(Ie=0,Ke="";Ie<qe;Ie++)Ke+=Z.charAt(st[Ie]);if(Di){if(qe>1)if(16==P||8==P){for(Ie=16==P?4:3,--qe;qe%Ie;qe++)Ke+="0";for(qe=(st=Rt(Ke,K,P)).length;!st[qe-1];--qe);for(Ie=1,Ke="1.";Ie<qe;Ie++)Ke+=Z.charAt(st[Ie])}else Ke=Ke.charAt(0)+"."+Ke.slice(1);Ke=Ke+($<0?"p":"p+")+$}else if($<0){for(;++$;)Ke="0"+Ke;Ke="0."+Ke}else if(++$>qe)for($-=qe;$--;)Ke+="0";else $<qe&&(Ke=Ke.slice(0,$)+"."+Ke.slice($))}else Ke=Di?"0p+0":"0";Ke=(16==P?"0x":2==P?"0b":8==P?"0o":"")+Ke}else Ke=An(C);return C.s<0?"-"+Ke:Ke}function Xi(C,P){if(C.length>P)return C.length=P,!0}function fa(C){return new this(C).abs()}function bn(C){return new this(C).acos()}function dn(C){return new this(C).acosh()}function Wn(C,P){return new this(C).plus(P)}function nn(C){return new this(C).asin()}function We(C){return new this(C).asinh()}function gr(C){return new this(C).atan()}function b(C){return new this(C).atanh()}function Y(C,P){C=new this(C),P=new this(P);var z,U=this.precision,K=this.rounding,$=U+4;return C.s&&P.s?C.d||P.d?!P.d||C.isZero()?(z=P.s<0?ir(this,U,K):new this(0)).s=C.s:!C.d||P.isZero()?(z=ir(this,$,1).times(.5)).s=C.s:P.s<0?(this.precision=$,this.rounding=1,z=this.atan(At(C,P,$,1)),P=ir(this,$,1),this.precision=U,this.rounding=K,z=C.s<0?z.minus(P):z.plus(P)):z=this.atan(At(C,P,$,1)):(z=ir(this,$,1).times(P.s>0?.25:.75)).s=C.s:z=new this(NaN),z}function dt(C){return new this(C).cbrt()}function zt(C){return et(C=new this(C),C.e+1,2)}function Ti(C,P,z){return new this(C).clamp(P,z)}function wt(C){if(!C||"object"!=typeof C)throw Error(Qi+"Object expected");var P,z,U,K=!0===C.defaults,$=["precision",1,se,"rounding",0,8,"toExpNeg",-ht,0,"toExpPos",0,ht,"maxE",0,ht,"minE",-ht,0,"modulo",0,9];for(P=0;P<$.length;P+=3)if(z=$[P],K&&(this[z]=ci[z]),void 0!==(U=C[z])){if(!(Wt(U)===U&&U>=$[P+1]&&U<=$[P+2]))throw Error(Vt+z+": "+U);this[z]=U}if(z="crypto",K&&(this[z]=ci[z]),void 0!==(U=C[z])){if(!0!==U&&!1!==U&&0!==U&&1!==U)throw Error(Vt+z+": "+U);if(U){if(!(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes)))throw Error($i);this[z]=!0}else this[z]=!1}return this}function Ci(C){return new this(C).cos()}function Ai(C){return new this(C).cosh()}function vr(C,P){return new this(C).div(P)}function vi(C){return new this(C).exp()}function wn(C){return et(C=new this(C),C.e+1,3)}function zn(){var C,P,z=new this(0);for(Ee=!1,C=0;C<arguments.length;)if((P=new this(arguments[C++])).d)z.d&&(z=z.plus(P.times(P)));else{if(P.s)return Ee=!0,new this(1/0);z=P}return Ee=!0,z.sqrt()}function Un(C){return C instanceof ur||C&&C.toStringTag===mi||!1}function Gn(C){return new this(C).ln()}function me(C,P){return new this(C).log(P)}function O(C){return new this(C).log(2)}function G(C){return new this(C).log(10)}function W(){return Dn(this,arguments,-1)}function fe(){return Dn(this,arguments,1)}function Se(C,P){return new this(C).mod(P)}function ve(C,P){return new this(C).mul(P)}function Ne(C,P){return new this(C).pow(P)}function Be(C){var P,z,U,K,$=0,Ie=new this(1),xe=[];if(void 0===C?C=this.precision:ri(C,1,se),U=Math.ceil(C/je),this.crypto)if(crypto.getRandomValues)for(P=crypto.getRandomValues(new Uint32Array(U));$<U;)(K=P[$])>=429e7?P[$]=crypto.getRandomValues(new Uint32Array(1))[0]:xe[$++]=K%1e7;else{if(!crypto.randomBytes)throw Error($i);for(P=crypto.randomBytes(U*=4);$<U;)(K=P[$]+(P[$+1]<<8)+(P[$+2]<<16)+((127&P[$+3])<<24))>=214e7?crypto.randomBytes(4).copy(P,$):(xe.push(K%1e7),$+=4);$=U/4}else for(;$<U;)xe[$++]=1e7*Math.random()|0;for(U=xe[--$],C%=je,U&&C&&(K=fi(10,je-C),xe[$]=(U/K|0)*K);0===xe[$];$--)xe.pop();if($<0)z=0,xe=[0];else{for(z=-1;0===xe[0];z-=je)xe.shift();for(U=1,K=xe[0];K>=10;K/=10)U++;U<je&&(z-=je-U)}return Ie.e=z,Ie.d=xe,Ie}function rt(C){return et(C=new this(C),C.e+1,this.rounding)}function yt(C){return(C=new this(C)).d?C.d[0]?C.s:0*C.s:C.s||NaN}function $e(C){return new this(C).sin()}function Dt(C){return new this(C).sinh()}function ii(C){return new this(C).sqrt()}function hi(C,P){return new this(C).sub(P)}function Ji(){var C=0,P=arguments,z=new this(P[C]);for(Ee=!1;z.s&&++C<P.length;)z=z.plus(P[C]);return Ee=!0,et(z,this.precision,this.rounding)}function Ei(C){return new this(C).tan()}function ji(C){return new this(C).tanh()}function zi(C){return et(C=new this(C),C.e+1,1)}Pe[Symbol.for("nodejs.util.inspect.custom")]=Pe.toString,Pe[Symbol.toStringTag]="Decimal";var ur=Pe.constructor=function Rr(C){var P,z,U;function K($){var Ie,xe,qe,Fe=this;if(!(Fe instanceof K))return new K($);if(Fe.constructor=K,Un($))return Fe.s=$.s,void(Ee?!$.d||$.e>K.maxE?(Fe.e=NaN,Fe.d=null):$.e<K.minE?(Fe.e=0,Fe.d=[0]):(Fe.e=$.e,Fe.d=$.d.slice()):(Fe.e=$.e,Fe.d=$.d?$.d.slice():$.d));if("number"==(qe=typeof $)){if(0===$)return Fe.s=1/$<0?-1:1,Fe.e=0,void(Fe.d=[0]);if($<0?($=-$,Fe.s=-1):Fe.s=1,$===~~$&&$<1e7){for(Ie=0,xe=$;xe>=10;xe/=10)Ie++;return void(Ee?Ie>K.maxE?(Fe.e=NaN,Fe.d=null):Ie<K.minE?(Fe.e=0,Fe.d=[0]):(Fe.e=Ie,Fe.d=[$]):(Fe.e=Ie,Fe.d=[$]))}return 0*$!=0?($||(Fe.s=NaN),Fe.e=NaN,void(Fe.d=null)):rn(Fe,$.toString())}if("string"===qe)return 45===(xe=$.charCodeAt(0))?($=$.slice(1),Fe.s=-1):(43===xe&&($=$.slice(1)),Fe.s=1),ot.test($)?rn(Fe,$):function In(C,P){var z,U,K,$,Ie,xe,qe,Fe,Ke;if(P.indexOf("_")>-1){if(P=P.replace(/(\d)_(?=\d)/g,"$1"),ot.test(P))return rn(C,P)}else if("Infinity"===P||"NaN"===P)return+P||(C.s=NaN),C.e=NaN,C.d=null,C;if(bi.test(P))z=16,P=P.toLowerCase();else if(Qt.test(P))z=2;else{if(!_t.test(P))throw Error(Vt+P);z=8}for(($=P.search(/p/i))>0?(qe=+P.slice($+1),P=P.substring(2,$)):P=P.slice(2),$=P.indexOf("."),U=C.constructor,(Ie=$>=0)&&($=(xe=(P=P.replace(".","")).length)-$,K=rr(U,new U(z),$,2*$)),$=Ke=(Fe=Rt(P,z,It)).length-1;0===Fe[$];--$)Fe.pop();return $<0?new U(0*C.s):(C.e=sr(Fe,Ke),C.d=Fe,Ee=!1,Ie&&(C=At(C,K,4*xe)),qe&&(C=C.times(Math.abs(qe)<54?fi(2,qe):ur.pow(2,qe))),Ee=!0,C)}(Fe,$);if("bigint"===qe)return $<0?($=-$,Fe.s=-1):Fe.s=1,rn(Fe,$.toString());throw Error(Vt+$)}if(K.prototype=Pe,K.ROUND_UP=0,K.ROUND_DOWN=1,K.ROUND_CEIL=2,K.ROUND_FLOOR=3,K.ROUND_HALF_UP=4,K.ROUND_HALF_DOWN=5,K.ROUND_HALF_EVEN=6,K.ROUND_HALF_CEIL=7,K.ROUND_HALF_FLOOR=8,K.EUCLID=9,K.config=K.set=wt,K.clone=Rr,K.isDecimal=Un,K.abs=fa,K.acos=bn,K.acosh=dn,K.add=Wn,K.asin=nn,K.asinh=We,K.atan=gr,K.atanh=b,K.atan2=Y,K.cbrt=dt,K.ceil=zt,K.clamp=Ti,K.cos=Ci,K.cosh=Ai,K.div=vr,K.exp=vi,K.floor=wn,K.hypot=zn,K.ln=Gn,K.log=me,K.log10=G,K.log2=O,K.max=W,K.min=fe,K.mod=Se,K.mul=ve,K.pow=Ne,K.random=Be,K.round=rt,K.sign=yt,K.sin=$e,K.sinh=Dt,K.sqrt=ii,K.sub=hi,K.sum=Ji,K.tan=Ei,K.tanh=ji,K.trunc=zi,void 0===C&&(C={}),C&&!0!==C.defaults)for(U=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],P=0;P<U.length;)C.hasOwnProperty(z=U[P++])||(C[z]=this[z]);return K.config(C),K}(ci);g=new ur(g),li=new ur(li);const mr=ur}}]);
4//# debugId=3621ba2d-842e-52e3-b50d-2dcdefe8562b

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.