geoproject-app/public/site/plugins/map-editor/index.js

612 lines
804 KiB
JavaScript
Raw Normal View History

(function(){"use strict";function od(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var Oo={exports:{}},ld=Oo.exports,vu;function cd(){return vu||(vu=1,(function(p,w){(function(E,L){p.exports=L()})(ld,(function(){var E,L,F;function Q(l,le){if(!E)E=le;else if(!L)L=le;else{var W="var sharedChunk = {}; ("+E+")(sharedChunk); ("+L+")(sharedChunk);",Se={};E(Se),F=le(Se),typeof window<"u"&&(F.workerUrl=window.URL.createObjectURL(new Blob([W],{type:"text/javascript"})))}}Q(["exports"],(function(l){function le(i,e,r,a){return new(r||(r=Promise))((function(o,d){function f(v){try{y(a.next(v))}catch(S){d(S)}}function m(v){try{y(a.throw(v))}catch(S){d(S)}}function y(v){var S;v.done?o(v.value):(S=v.value,S instanceof r?S:new r((function(A){A(S)}))).then(f,m)}y((a=a.apply(i,e||[])).next())}))}function W(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Se=de;function de(i,e){this.x=i,this.y=e}de.prototype={clone:function(){return new de(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,e){return this.clone()._rotateAround(i,e)},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 e=i.x-this.x,r=i.y-this.y;return e*e+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,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,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 e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,e){var r=Math.cos(i),a=Math.sin(i),o=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},de.convert=function(i){return i instanceof de?i:Array.isArray(i)?new de(i[0],i[1]):i};var ge=W(Se),be=je;function je(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=a}je.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,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)<e)return r;var d=this.sampleCurveDerivativeX(r);if(Math.abs(d)<1e-6)break;r-=o/d}var f=0,m=1;for(r=i,a=0;a<20&&(o=this.sampleCurveX(r),!(Math.abs(o-i)<e));a++)i>o?f=r:m=r,r=.5*(m-f)+f;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Je=W(be);let it,Xe;function tt(){return it==null&&(it=typeof
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(A[1])} }\`.`)];const k=[];return i.layerType==="symbol"&&(m==="text-field"&&o&&!o.glyphs&&k.push(new Ae(r,f,'use of "text-field" requires a style "glyphs" property')),m==="text-font"&&Rt(wn(f))&&Ut(f.type)==="identity"&&k.push(new Ae(r,f,'"text-font" does not support identity functions'))),k.concat(a({key:i.key,value:f,valueSpec:S,style:o,styleSpec:d,expressionContext:"property",propertyType:e,propertyKey:m}))}function dl(i){return pl(i,"paint")}function fl(i){return pl(i,"layout")}function ml(i){let e=[];const r=i.value,a=i.key,o=i.style,d=i.styleSpec;r.type||r.ref||e.push(new Ae(a,r,'either "type" or "ref" is required'));let f=Ut(r.type);const m=Ut(r.ref);if(r.id){const y=Ut(r.id);for(let v=0;v<i.arrayIndex;v++){const S=o.layers[v];Ut(S.id)===y&&e.push(new Ae(a,r.id,`duplicate layer id "${r.id}", previously used at line ${S.id.__line__}`))}}if("ref"in r){let y;["type","source","source-layer","filter","layout"].forEach((v=>{v in r&&e.push(new Ae(a,r[v],`"${v}" is prohibited for ref layers`))})),o.layers.forEach((v=>{Ut(v.id)===m&&(y=v)})),y?y.ref?e.push(new Ae(a,r.ref,"ref cannot reference another ref layer")):f=Ut(y.type):e.push(new Ae(a,r.ref,`ref layer "${m}" not found`))}else if(f!=="background")if(r.source){const y=o.sources&&o.sources[r.source],v=y&&Ut(y.type);y?v==="vector"&&f==="raster"?e.push(new Ae(a,r.source,`layer "${r.id}" requires a raster source`)):v!=="raster-dem"&&f==="hillshade"?e.push(new Ae(a,r.source,`layer "${r.id}" requires a raster-dem source`)):v==="raster"&&f!=="raster"?e.push(new Ae(a,r.source,`layer "${r.id}" requires a vector source`)):v!=="vector"||r["source-layer"]?v==="raster-dem"&&f!=="hillshade"?e.push(new Ae(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):f!=="line"||!r.paint||!r.paint["line-gradient"]||v==="geojson"&&y.lineMetrics||e.push(new Ae(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Ae(a,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new Ae(a,r.source,`source "${r.source}" not found`))}else e.push(new Ae(a,r,'missing required property "source"'));return e=e.concat(zi({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:Xn,layout:y=>zi({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":v=>fl(vr({layerType:f},v))}}),paint:y=>zi({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":v=>dl(vr({layerType:f},v))}})}})),e}function wr(i){const e=i.value,r=i.key,a=xt(e);return a!=="string"?[new Ae(r,e,`string expected, ${a} found`)]:[]}const ba={promoteId:function({key:i,value:e}){if(xt(e)==="string")return wr({key:i,value:e});{const r=[];for(const a in e)r.push(...wr({key:`${i}.${a}`,value:e[a]}));return r}}};function Gi(i){const e=i.value,r=i.key,a=i.styleSpec,o=i.style,d=i.validateSpec;if(!e.type)return[new Ae(r,e,'"type" is required')];const f=Ut(e.type);let m;switch(f){case"vector":case"raster":return m=zi({key:r,value:e,valueSpec:a[`source_${f.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:ba,validateSpec:d}),m;case"raster-dem":return m=(function(y){var v;const S=(v=y.sourceName)!==null&&v!==void 0?v:"",A=y.value,k=y.styleSpec,z=k.source_raster_dem,D=y.style;let O=[];const q=xt(A);if(A===void 0)return O;if(q!=="object")return O.push(new Ae("source_raster_dem",A,`object expected, ${q} found`)),O;const H=Ut(A.encoding)==="custom",re=["redFactor","greenFactor","blueFactor","baseShift"],Y=y.value.encoding?`"${y.value.encoding}"`:"Default";for(const ae in A)!H&&re.includes(ae)?O.push(new Ae(ae,A[ae],`In "${S}": "${ae}" is only valid when "encoding" is se
precision mediump float;
#else
#if !defined(lowp)
#define lowp
#endif
#if !defined(mediump)
#define mediump
#endif
#if !defined(highp)
#define highp
#endif
#endif
`,`#ifdef GL_ES
precision highp float;
#else
#if !defined(lowp)
#define lowp
#endif
#if !defined(mediump)
#define mediump
#endif
#if !defined(highp)
#define highp
#endif
#endif
vec2 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
);}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;}
#ifdef TERRAIN3D
uniform 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;
#endif
const 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) {
#ifdef TERRAIN3D
highp 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));
#else
return 1.0;
#endif
}float calculate_visibility(vec4 pos) {
#ifdef TERRAIN3D
vec3 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;
#else
return 1.0;
#endif
}float ele(vec2 pos) {
#ifdef TERRAIN3D
vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
#else
return 0.0;
#endif
}float get_elevation(vec2 pos) {
#ifdef TERRAIN3D
vec2 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;
#else
return 0.0;
#endif
}`),background:yt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:yt(`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;uniform 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;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"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:yt(`varying vec3 v_data;varying float v_visibility;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`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;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main(void) {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 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;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:yt("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:yt(`uniform highp float u_intensity;varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#define GAUSS_COEF 0.3989422804014327
void main() {
#pragma mapbox: initialize highp float weight
float 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);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`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;
#pragma mapbox: define highp float weight
#pragma mapbox: define mediump float radius
const highp float ZERO=1.0/255.0/16.0;
#define GAUSS_COEF 0.3989422804014327
void main(void) {
#pragma mapbox: initialize highp float weight
#pragma mapbox: initialize mediump float radius
vec2 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,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:yt(`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;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(0.0);
#endif
}`,"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:yt("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_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:yt("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:yt("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:yt(`#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_FragColor=color*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:yt(`varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:yt(`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;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
vec2 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;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`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;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 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:yt(`#ifdef GL_ES
precision highp float;
#endif
uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
vec2 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;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`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;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 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:yt(`varying vec4 v_color;void main() {gl_FragColor=v_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`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;
#ifdef TERRAIN3D
attribute vec2 a_centroid;
#endif
varying vec4 v_color;
#pragma mapbox: define highp float base
#pragma mapbox: define highp float height
#pragma mapbox: define highp vec4 color
void main() {
#pragma mapbox: initialize highp float base
#pragma mapbox: initialize highp float height
#pragma mapbox: initialize highp vec4 color
vec3 normal=a_normal_ed.xyz;
#ifdef TERRAIN3D
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
#else
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
#endif
base=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*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:yt(`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;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 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;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`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;
#ifdef TERRAIN3D
attribute vec2 a_centroid;
#endif
varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 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;
#ifdef TERRAIN3D
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
#else
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
#endif
base=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
? a_pos
: 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:yt(`#ifdef GL_ES
precision highp float;
#endif
uniform 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);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"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:yt(`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;
#define PI 3.141592653589793
void 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;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"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:yt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
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);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
attribute 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;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float 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;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_width2=vec2(outset,inset);}`),lineGradient:yt(`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;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
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);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
attribute 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;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float 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;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_width2=vec2(outset,inset);}`),linePattern:yt(`#ifdef GL_ES
precision highp float;
#endif
uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
vec2 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;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
#define LINE_DISTANCE_SCALE 2.0
attribute 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;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
float 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;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:yt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
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 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);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
#define LINE_DISTANCE_SCALE 2.0
attribute 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;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
float 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;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:yt(`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);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"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:yt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
vec2 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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:yt(`#define SDF_PX 8.0
uniform 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;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float 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);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;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:yt(`#define SDF_PX 8.0
#define SDF 1.0
#define ICON 0.0
uniform 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;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
return;}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);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;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:yt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",jn),terrainDepth:yt("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);}",jn),terrainCoords:yt("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);}",jn)};function yt(u,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=t.match(/attribute ([\w]+) ([\w]+)/g),c=u.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),h=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),g=h?h.concat(c):c,_={};return{fragmentSource:u=u.replace(n,((x,b,T,I,P)=>(_[P]=!0,b==="define"?`
#ifndef HAS_UNIFORM_u_${P}
varying ${T} ${I} ${P};
#else
uniform ${T} ${I} u_${P};
#endif
`:`
#ifdef HAS_UNIFORM_u_${P}
${T} ${I} ${P} = u_${P};
#endif
`))),vertexSource:t=t.replace(n,((x,b,T,I,P)=>{const V=I==="float"?"vec2":"vec4",N=P.match(/color/)?"color":V;return _[P]?b==="define"?`
#ifndef HAS_UNIFORM_u_${P}
uniform lowp float u_${P}_t;
attribute ${T} ${V} a_${P};
varying ${T} ${I} ${P};
#else
uniform ${T} ${I} u_${P};
#endif
`:N==="vec4"?`
#ifndef HAS_UNIFORM_u_${P}
${P} = a_${P};
#else
${T} ${I} ${P} = u_${P};
#endif
`:`
#ifndef HAS_UNIFORM_u_${P}
${P} = unpack_mix_${N}(a_${P}, u_${P}_t);
#else
${T} ${I} ${P} = u_${P};
#endif
`:b==="define"?`
#ifndef HAS_UNIFORM_u_${P}
uniform lowp float u_${P}_t;
attribute ${T} ${V} a_${P};
#else
uniform ${T} ${I} u_${P};
#endif
`:N==="vec4"?`
#ifndef HAS_UNIFORM_u_${P}
${T} ${I} ${P} = a_${P};
#else
${T} ${I} ${P} = u_${P};
#endif
`:`
#ifndef HAS_UNIFORM_u_${P}
${T} ${I} ${P} = unpack_mix_${N}(a_${P}, u_${P}_t);
#else
${T} ${I} ${P} = u_${P};
#endif
`})),staticAttributes:s,staticUniforms:g}}class yn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,s,c,h,g,_,x,b){this.context=t;let T=this.boundPaintVertexBuffers.length!==c.length;for(let I=0;!T&&I<c.length;I++)this.boundPaintVertexBuffers[I]!==c[I]&&(T=!0);!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==s||T||this.boundIndexBuffer!==h||this.boundVertexOffset!==g||this.boundDynamicVertexBuffer!==_||this.boundDynamicVertexBuffer2!==x||this.boundDynamicVertexBuffer3!==b?this.freshBind(n,s,c,h,g,_,x,b):(t.bindVertexArray.set(this.vao),_&&_.bind(),h&&h.dynamicDraw&&h.bind(),x&&x.bind(),b&&b.bind())}freshBind(t,n,s,c,h,g,_,x){const b=t.numAttributes,T=this.context,I=T.gl;this.vao&&this.destroy(),this.vao=T.createVertexArray(),T.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=s,this.boundIndexBuffer=c,this.boundVertexOffset=h,this.boundDynamicVertexBuffer=g,this.boundDynamicVertexBuffer2=_,this.boundDynamicVertexBuffer3=x,n.enableAttributes(I,t);for(const P of s)P.enableAttributes(I,t);g&&g.enableAttributes(I,t),_&&_.enableAttributes(I,t),x&&x.enableAttributes(I,t),n.bind(),n.setVertexAttribPointers(I,t,h);for(const P of s)P.bind(),P.setVertexAttribPointers(I,t,h);g&&(g.bind(),g.setVertexAttribPointers(I,t,h)),c&&c.bind(),_&&(_.bind(),_.setVertexAttribPointers(I,t,h)),x&&(x.bind(),x.setVertexAttribPointers(I,t,h)),T.currentNumAttributes=b}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function Vt(u){const t=[];for(let n=0;n<u.length;n++){if(u[n]===null)continue;const s=u[n].split(" ");t.push(s.pop())}return t}class $a{constructor(t,n,s,c,h,g){const _=t.gl;this.program=_.createProgram();const x=Vt(n.staticAttributes),b=s?s.getBinderAttributes():[],T=x.concat(b),I=Ft.prelude.staticUniforms?Vt(Ft.prelude.staticUniforms):[],P=n.staticUniforms?Vt(n.staticUniforms):[],V=s?s.getBinderUniforms():[],N=I.concat(P).concat(V),$=[];for(const ue of N)$.indexOf(ue)<0&&$.push(ue);const B=s?s.defines():[];h&&B.push("#define OVERDRAW_INSPECTOR;"),g&&B.push("#define TERRAIN3D;");const ee=B.concat(Ft.prelude.fragmentSource,n.fragmentSource).join(`
`),se=B.concat(Ft.prelude.vertexSource,n.vertexSource).join(`
`),G=_.createShader(_.FRAGMENT_SHADER);if(_.isContextLost())return void(this.failedToCreate=!0);if(_.shaderSource(G,ee),_.compileShader(G),!_.getShaderParameter(G,_.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${_.getShaderInfoLog(G)}`);_.attachShader(this.program,G);const te=_.createShader(_.VERTEX_SHADER);if(_.isContextLost())return void(this.failedToCreate=!0);if(_.shaderSource(te,se),_.compileShader(te),!_.getShaderParameter(te,_.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${_.getShaderInfoLog(te)}`);_.attachShader(this.program,te),this.attributes={};const ce={};this.numAttributes=T.length;for(let ue=0;ue<this.numAttributes;ue++)T[ue]&&(_.bindAttribLocation(this.program,ue,T[ue]),this.attributes[T[ue]]=ue);if(_.linkProgram(this.program),!_.getProgramParameter(this.program,_.LINK_STATUS))throw new Error(`Program failed to link: ${_.getProgramInfoLog(this.program)}`);_.deleteShader(te),_.deleteShader(G);for(let ue=0;ue<$.length;ue++){const me=$[ue];if(me&&!ce[me]){const ve=_.getUniformLocation(this.program,me);ve&&(ce[me]=ve)}}this.fixedUniforms=c(t,ce),this.terrainUniforms=((ue,me)=>({u_depth:new l.aL(ue,me.u_depth),u_terrain:new l.aL(ue,me.u_terrain),u_terrain_dim:new l.aM(ue,me.u_terrain_dim),u_terrain_matrix:new l.aN(ue,me.u_terrain_matrix),u_terrain_unpack:new l.aO(ue,me.u_terrain_unpack),u_terrain_exaggeration:new l.aM(ue,me.u_terrain_exaggeration)}))(t,ce),this.binderUniforms=s?s.getUniforms(t,ce):[]}draw(t,n,s,c,h,g,_,x,b,T,I,P,V,N,$,B,ee,se){const G=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(s),t.setStencilMode(c),t.setColorMode(h),t.setCullFace(g),x){t.activeTexture.set(G.TEXTURE2),G.bindTexture(G.TEXTURE_2D,x.depthTexture),t.activeTexture.set(G.TEXTURE3),G.bindTexture(G.TEXTURE_2D,x.texture);for(const ce in this.terrainUniforms)this.terrainUniforms[ce].set(x[ce])}for(const ce in this.fixedUniforms)this.fixedUniforms[ce].set(_[ce]);$&&$.setUniforms(t,this.binderUniforms,V,{zoom:N});let te=0;switch(n){case G.LINES:te=2;break;case G.TRIANGLES:te=3;break;case G.LINE_STRIP:te=1}for(const ce of P.get()){const ue=ce.vaos||(ce.vaos={});(ue[b]||(ue[b]=new yn)).bind(t,this,T,$?$.getPaintVertexBuffers():[],I,ce.vertexOffset,B,ee,se),G.drawElements(n,ce.primitiveLength*te,G.UNSIGNED_SHORT,ce.primitiveOffset*te*2)}}}function sr(u,t,n){const s=1/J(n,1,t.transform.tileZoom),c=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,t.transform.tileZoom)/c,g=h*(n.tileID.canonical.x+n.tileID.wrap*c),_=h*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,u.fromScale,u.toScale],u_fade:u.t,u_pixel_coord_upper:[g>>16,_>>16],u_pixel_coord_lower:[65535&g,65535&_]}}const zs=(u,t,n,s)=>{const c=t.style.light,h=c.properties.get("position"),g=[h.x,h.y,h.z],_=(function(){var b=new l.A(9);return l.A!=Float32Array&&(b[1]=0,b[2]=0,b[3]=0,b[5]=0,b[6]=0,b[7]=0),b[0]=1,b[4]=1,b[8]=1,b})();c.properties.get("anchor")==="viewport"&&(function(b,T){var I=Math.sin(T),P=Math.cos(T);b[0]=P,b[1]=I,b[2]=0,b[3]=-I,b[4]=P,b[5]=0,b[6]=0,b[7]=0,b[8]=1})(_,-t.transform.angle),(function(b,T,I){var P=T[0],V=T[1],N=T[2];b[0]=P*I[0]+V*I[3]+N*I[6],b[1]=P*I[1]+V*I[4]+N*I[7],b[2]=P*I[2]+V*I[5]+N*I[8]})(g,g,_);const x=c.properties.get("color");return{u_matrix:u,u_lightpos:g,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[x.r,x.g,x.b],u_vertical_gradient:+n,u_opacity:s}},Jr=(u,t,n,s,c,h,g)=>l.e(zs(u,t,n,s),sr(h,t,g),{u_height_factor:-Math.pow(2,c.overscaledZ)/g.tileSize/8}),Ho=u=>({u_matrix:u}),Ds=(u,t,n,s)=>l.e(Ho(u),sr(n,t,s)),ja=(u,t)=>({u_matrix:u,u_world:t}),qa=(u,t,n,s,c)=>l.e(Ds(u,t,n,s),{u_world:c}),Qr=(u,t,n,s)=>{const c=u.transform;let h,g;if(s.paint.get("circle-pitch-alignment")==="map"){const _=J(n,1,c.zoom);h=!0,g=[_,_]}else h=!1,g=c.pixelsToGLUnits;return{u_camera_to_center_distance:c.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:u.translatePosMatrix(t.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+h,u_device_pixel_ratio:u
<div class="maplibregl-desktop-message">${u}</div>
<div class="maplibregl-mobile-message">${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}</div>
`,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){W.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(u,t,n){this._canvas.width=Math.floor(n*u),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${u}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const u={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",(s=>{t={requestedAttributes:u},s&&(t.statusMessage=s.statusMessage,t.type=s.type)}),{once:!0});const n=this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u);if(!n){const s="Failed to initialize WebGL";throw t?(t.message=s,new Error(JSON.stringify(t))):new Error(s)}this.painter=new wn(n,this.transform),Se.testSupport(n)}_onCooperativeGesture(u,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout((()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")}),100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(u){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||u,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(u){return this._update(),this._renderTaskQueue.add(u)}_cancelRenderFrame(u){this._renderTaskQueue.remove(u)}_render(u){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const c=this.transform.zoom,h=l.h.now();this.style.zoomHistory.update(c,h);const g=new l.a8(c,{now:h,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),_=g.crossFadingFactor();_===1&&_===this._crossFadingFactor||(n=!0,this._crossFadingFactor=_),this.style.update(g)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=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._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new l.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,l.bg.mark(l.bh.load),this.fire(new l.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 l.k("idle")),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,l.bg.mark(l.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),
`+p.mark.snippet),L+" "+E):L}function As(p,w){Error.call(this),this.name="YAMLException",this.reason=p,this.mark=w,this.message=Su(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}As.prototype=Object.create(Error.prototype),As.prototype.constructor=As,As.prototype.toString=function(w){return this.name+": "+Su(this,w)};var Vi=As;function Ql(p,w,E,L,F){var Q="",K="",l=Math.floor(F/2)-1;return L-w>l&&(Q=" ... ",w=L-l+Q.length),E-L>l&&(K=" ...",E=L+l-K.length),{str:Q+p.slice(w,E).replace(/\t/g,"→")+K,pos:L-w+Q.length}}function ec(p,w){return oi.repeat(" ",w-p.length)+p}function Vd(p,w){if(w=Object.create(w||null),!p.buffer)return null;w.maxLength||(w.maxLength=79),typeof w.indent!="number"&&(w.indent=1),typeof w.linesBefore!="number"&&(w.linesBefore=3),typeof w.linesAfter!="number"&&(w.linesAfter=2);for(var E=/\r?\n|\r|\0/g,L=[0],F=[],Q,K=-1;Q=E.exec(p.buffer);)F.push(Q.index),L.push(Q.index+Q[0].length),p.position<=Q.index&&K<0&&(K=L.length-2);K<0&&(K=L.length-1);var l="",le,W,Se=Math.min(p.line+w.linesAfter,F.length).toString().length,de=w.maxLength-(w.indent+Se+3);for(le=1;le<=w.linesBefore&&!(K-le<0);le++)W=Ql(p.buffer,L[K-le],F[K-le],p.position-(L[K]-L[K-le]),de),l=oi.repeat(" ",w.indent)+ec((p.line-le+1).toString(),Se)+" | "+W.str+`
`+l;for(W=Ql(p.buffer,L[K],F[K],p.position,de),l+=oi.repeat(" ",w.indent)+ec((p.line+1).toString(),Se)+" | "+W.str+`
`,l+=oi.repeat("-",w.indent+Se+3+W.pos)+`^
`,le=1;le<=w.linesAfter&&!(K+le>=F.length);le++)W=Ql(p.buffer,L[K+le],F[K+le],p.position-(L[K]-L[K+le]),de),l+=oi.repeat(" ",w.indent)+ec((p.line+le+1).toString(),Se)+" | "+W.str+`
`;return l.replace(/\n$/,"")}var Ud=Vd,$d=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],jd=["scalar","sequence","mapping"];function qd(p){var w={};return p!==null&&Object.keys(p).forEach(function(E){p[E].forEach(function(L){w[String(L)]=E})}),w}function Zd(p,w){if(w=w||{},Object.keys(w).forEach(function(E){if($d.indexOf(E)===-1)throw new Vi('Unknown option "'+E+'" is met in definition of "'+p+'" YAML type.')}),this.options=w,this.tag=p,this.kind=w.kind||null,this.resolve=w.resolve||function(){return!0},this.construct=w.construct||function(E){return E},this.instanceOf=w.instanceOf||null,this.predicate=w.predicate||null,this.represent=w.represent||null,this.representName=w.representName||null,this.defaultStyle=w.defaultStyle||null,this.multi=w.multi||!1,this.styleAliases=qd(w.styleAliases||null),jd.indexOf(this.kind)===-1)throw new Vi('Unknown kind "'+this.kind+'" is specified for "'+p+'" YAML type.')}var xi=Zd;function Tu(p,w){var E=[];return p[w].forEach(function(L){var F=E.length;E.forEach(function(Q,K){Q.tag===L.tag&&Q.kind===L.kind&&Q.multi===L.multi&&(F=K)}),E[F]=L}),E}function Gd(){var p={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},w,E;function L(F){F.multi?(p.multi[F.kind].push(F),p.multi.fallback.push(F)):p[F.kind][F.tag]=p.fallback[F.tag]=F}for(w=0,E=arguments.length;w<E;w+=1)arguments[w].forEach(L);return p}function tc(p){return this.extend(p)}tc.prototype.extend=function(w){var E=[],L=[];if(w instanceof xi)L.push(w);else if(Array.isArray(w))L=L.concat(w);else if(w&&(Array.isArray(w.implicit)||Array.isArray(w.explicit)))w.implicit&&(E=E.concat(w.implicit)),w.explicit&&(L=L.concat(w.explicit));else throw new Vi("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");E.forEach(function(Q){if(!(Q instanceof xi))throw new Vi("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(Q.loadKind&&Q.loadKind!=="scalar")throw new Vi("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(Q.multi)throw new Vi("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),L.forEach(function(Q){if(!(Q instanceof xi))throw new Vi("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var F=Object.create(tc.prototype);return F.implicit=(this.implicit||[]).concat(E),F.explicit=(this.explicit||[]).concat(L),F.compiledImplicit=Tu(F,"implicit"),F.compiledExplicit=Tu(F,"explicit"),F.compiledTypeMap=Gd(F.compiledImplicit,F.compiledExplicit),F};var Iu=tc,Au=new xi("tag:yaml.org,2002:str",{kind:"scalar",construct:function(p){return p!==null?p:""}}),Cu=new xi("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(p){return p!==null?p:[]}}),ku=new xi("tag:yaml.org,2002:map",{kind:"mapping",construct:function(p){return p!==null?p:{}}}),Eu=new Iu({explicit:[Au,Cu,ku]});function Hd(p){if(p===null)return!0;var w=p.length;return w===1&&p==="~"||w===4&&(p==="null"||p==="Null"||p==="NULL")}function Wd(){return null}function Xd(p){return p===null}var Mu=new xi("tag:yaml.org,2002:null",{kind:"scalar",resolve:Hd,construct:Wd,predicate:Xd,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Kd(p){if(p===null)return!1;var w=p.length;return w===4&&(p==="true"||p==="True"||p==="TRUE")||w===5&&(p==="false"||p==="False"||p==="FALSE")}function Yd(p){return p==="true"||p==="True"||p==="TRUE"}function Jd(p){return Object.prototype.toString.call(p)==="[object Boolean]"}var Pu=new xi("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Kd,construct:Yd,predicate:Jd,represent:{lowercase:function(p){return p?"true":"false"},uppercase:function(p){return p?"TRUE":"FALSE"},camelcase:function(p){return p?"True":"False"}},defaultStyle:"lowercase"});functio
\r`;function gf(p){if(p===null)return!1;var w,E,L=0,F=p.length,Q=ic;for(E=0;E<F;E++)if(w=Q.indexOf(p.charAt(E)),!(w>64)){if(w<0)return!1;L+=6}return L%8===0}function _f(p){var w,E,L=p.replace(/[\r\n=]/g,""),F=L.length,Q=ic,K=0,l=[];for(w=0;w<F;w++)w%4===0&&w&&(l.push(K>>16&255),l.push(K>>8&255),l.push(K&255)),K=K<<6|Q.indexOf(L.charAt(w));return E=F%4*6,E===0?(l.push(K>>16&255),l.push(K>>8&255),l.push(K&255)):E===18?(l.push(K>>10&255),l.push(K>>2&255)):E===12&&l.push(K>>4&255),new Uint8Array(l)}function yf(p){var w="",E=0,L,F,Q=p.length,K=ic;for(L=0;L<Q;L++)L%3===0&&L&&(w+=K[E>>18&63],w+=K[E>>12&63],w+=K[E>>6&63],w+=K[E&63]),E=(E<<8)+p[L];return F=Q%3,F===0?(w+=K[E>>18&63],w+=K[E>>12&63],w+=K[E>>6&63],w+=K[E&63]):F===2?(w+=K[E>>10&63],w+=K[E>>4&63],w+=K[E<<2&63],w+=K[64]):F===1&&(w+=K[E>>2&63],w+=K[E<<4&63],w+=K[64],w+=K[64]),w}function xf(p){return Object.prototype.toString.call(p)==="[object Uint8Array]"}var Vu=new xi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:gf,construct:_f,predicate:xf,represent:yf}),vf=Object.prototype.hasOwnProperty,bf=Object.prototype.toString;function wf(p){if(p===null)return!0;var w=[],E,L,F,Q,K,l=p;for(E=0,L=l.length;E<L;E+=1){if(F=l[E],K=!1,bf.call(F)!=="[object Object]")return!1;for(Q in F)if(vf.call(F,Q))if(!K)K=!0;else return!1;if(!K)return!1;if(w.indexOf(Q)===-1)w.push(Q);else return!1}return!0}function Sf(p){return p!==null?p:[]}var Uu=new xi("tag:yaml.org,2002:omap",{kind:"sequence",resolve:wf,construct:Sf}),Tf=Object.prototype.toString;function If(p){if(p===null)return!0;var w,E,L,F,Q,K=p;for(Q=new Array(K.length),w=0,E=K.length;w<E;w+=1){if(L=K[w],Tf.call(L)!=="[object Object]"||(F=Object.keys(L),F.length!==1))return!1;Q[w]=[F[0],L[F[0]]]}return!0}function Af(p){if(p===null)return[];var w,E,L,F,Q,K=p;for(Q=new Array(K.length),w=0,E=K.length;w<E;w+=1)L=K[w],F=Object.keys(L),Q[w]=[F[0],L[F[0]]];return Q}var $u=new xi("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:If,construct:Af}),Cf=Object.prototype.hasOwnProperty;function kf(p){if(p===null)return!0;var w,E=p;for(w in E)if(Cf.call(E,w)&&E[w]!==null)return!1;return!0}function Ef(p){return p!==null?p:{}}var ju=new xi("tag:yaml.org,2002:set",{kind:"mapping",resolve:kf,construct:Ef}),rc=Fu.extend({implicit:[Ou,Nu],explicit:[Vu,Uu,$u,ju]}),Ln=Object.prototype.hasOwnProperty,Vo=1,qu=2,Zu=3,Uo=4,nc=1,Mf=2,Gu=3,Pf=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,zf=/[\x85\u2028\u2029]/,Df=/[,\[\]\{\}]/,Hu=/^(?:!|!!|![a-z\-]+!)$/i,Wu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Xu(p){return Object.prototype.toString.call(p)}function qr(p){return p===10||p===13}function oa(p){return p===9||p===32}function Qi(p){return p===9||p===32||p===10||p===13}function Da(p){return p===44||p===91||p===93||p===123||p===125}function Lf(p){var w;return 48<=p&&p<=57?p-48:(w=p|32,97<=w&&w<=102?w-97+10:-1)}function Ff(p){return p===120?2:p===117?4:p===85?8:0}function Rf(p){return 48<=p&&p<=57?p-48:-1}function Ku(p){return p===48?"\0":p===97?"\x07":p===98?"\b":p===116||p===9?" ":p===110?`
`:p===118?"\v":p===102?"\f":p===114?"\r":p===101?"\x1B":p===32?" ":p===34?'"':p===47?"/":p===92?"\\":p===78?"…":p===95?" ":p===76?"\u2028":p===80?"\u2029":""}function Bf(p){return p<=65535?String.fromCharCode(p):String.fromCharCode((p-65536>>10)+55296,(p-65536&1023)+56320)}function Yu(p,w,E){w==="__proto__"?Object.defineProperty(p,w,{configurable:!0,enumerable:!0,writable:!0,value:E}):p[w]=E}for(var Ju=new Array(256),Qu=new Array(256),La=0;La<256;La++)Ju[La]=Ku(La)?1:0,Qu[La]=Ku(La);function Of(p,w){this.input=p,this.filename=w.filename||null,this.schema=w.schema||rc,this.onWarning=w.onWarning||null,this.legacy=w.legacy||!1,this.json=w.json||!1,this.listener=w.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=p.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function eh(p,w){var E={name:p.filename,buffer:p.input.slice(0,-1),position:p.position,line:p.line,column:p.position-p.lineStart};return E.snippet=Ud(E),new Vi(w,E)}function Ke(p,w){throw eh(p,w)}function $o(p,w){p.onWarning&&p.onWarning.call(null,eh(p,w))}var th={YAML:function(w,E,L){var F,Q,K;w.version!==null&&Ke(w,"duplication of %YAML directive"),L.length!==1&&Ke(w,"YAML directive accepts exactly one argument"),F=/^([0-9]+)\.([0-9]+)$/.exec(L[0]),F===null&&Ke(w,"ill-formed argument of the YAML directive"),Q=parseInt(F[1],10),K=parseInt(F[2],10),Q!==1&&Ke(w,"unacceptable YAML version of the document"),w.version=L[0],w.checkLineBreaks=K<2,K!==1&&K!==2&&$o(w,"unsupported YAML version of the document")},TAG:function(w,E,L){var F,Q;L.length!==2&&Ke(w,"TAG directive accepts exactly two arguments"),F=L[0],Q=L[1],Hu.test(F)||Ke(w,"ill-formed tag handle (first argument) of the TAG directive"),Ln.call(w.tagMap,F)&&Ke(w,'there is a previously declared suffix for "'+F+'" tag handle'),Wu.test(Q)||Ke(w,"ill-formed tag prefix (second argument) of the TAG directive");try{Q=decodeURIComponent(Q)}catch{Ke(w,"tag prefix is malformed: "+Q)}w.tagMap[F]=Q}};function Fn(p,w,E,L){var F,Q,K,l;if(w<E){if(l=p.input.slice(w,E),L)for(F=0,Q=l.length;F<Q;F+=1)K=l.charCodeAt(F),K===9||32<=K&&K<=1114111||Ke(p,"expected valid JSON character");else Pf.test(l)&&Ke(p,"the stream contains non-printable characters");p.result+=l}}function ih(p,w,E,L){var F,Q,K,l;for(oi.isObject(E)||Ke(p,"cannot merge mappings; the provided source object is unacceptable"),F=Object.keys(E),K=0,l=F.length;K<l;K+=1)Q=F[K],Ln.call(w,Q)||(Yu(w,Q,E[Q]),L[Q]=!0)}function Fa(p,w,E,L,F,Q,K,l,le){var W,Se;if(Array.isArray(F))for(F=Array.prototype.slice.call(F),W=0,Se=F.length;W<Se;W+=1)Array.isArray(F[W])&&Ke(p,"nested arrays are not supported inside keys"),typeof F=="object"&&Xu(F[W])==="[object Object]"&&(F[W]="[object Object]");if(typeof F=="object"&&Xu(F)==="[object Object]"&&(F="[object Object]"),F=String(F),w===null&&(w={}),L==="tag:yaml.org,2002:merge")if(Array.isArray(Q))for(W=0,Se=Q.length;W<Se;W+=1)ih(p,w,Q[W],E);else ih(p,w,Q,E);else!p.json&&!Ln.call(E,F)&&Ln.call(w,F)&&(p.line=K||p.line,p.lineStart=l||p.lineStart,p.position=le||p.position,Ke(p,"duplicated mapping key")),Yu(w,F,Q),delete E[F];return w}function ac(p){var w;w=p.input.charCodeAt(p.position),w===10?p.position++:w===13?(p.position++,p.input.charCodeAt(p.position)===10&&p.position++):Ke(p,"a line break is expected"),p.line+=1,p.lineStart=p.position,p.firstTabInLine=-1}function si(p,w,E){for(var L=0,F=p.input.charCodeAt(p.position);F!==0;){for(;oa(F);)F===9&&p.firstTabInLine===-1&&(p.firstTabInLine=p.position),F=p.input.charCodeAt(++p.position);if(w&&F===35)do F=p.input.charCodeAt(++p.position);while(F!==10&&F!==13&&F!==0);if(qr(F))for(ac(p),F=p.input.charCodeAt(p.position),L++,p.lineIndent=0;F===32;)p.lineIndent++,F=p.input.charCodeAt(++p.position);else break}return E!==-1&&L!==0&&p.lineIndent<E&&$o(p,"deficient indentation"),L}function jo(p){var w=p.position,E;return E=p.input.charCodeAt(w),!!((E===45||E===46)&&E===p.input.charCodeAt(w+1)&&E===p.input.charCodeAt(w+2)&&(w+=3,E=p.input.charCodeAt(w),E===0||Qi(E)))}function sc(p,w
`,w-1))}function Nf(p,w,E){var L,F,Q,K,l,le,W,Se,de=p.kind,ge=p.result,be;if(be=p.input.charCodeAt(p.position),Qi(be)||Da(be)||be===35||be===38||be===42||be===33||be===124||be===62||be===39||be===34||be===37||be===64||be===96||(be===63||be===45)&&(F=p.input.charCodeAt(p.position+1),Qi(F)||E&&Da(F)))return!1;for(p.kind="scalar",p.result="",Q=K=p.position,l=!1;be!==0;){if(be===58){if(F=p.input.charCodeAt(p.position+1),Qi(F)||E&&Da(F))break}else if(be===35){if(L=p.input.charCodeAt(p.position-1),Qi(L))break}else{if(p.position===p.lineStart&&jo(p)||E&&Da(be))break;if(qr(be))if(le=p.line,W=p.lineStart,Se=p.lineIndent,si(p,!1,-1),p.lineIndent>=w){l=!0,be=p.input.charCodeAt(p.position);continue}else{p.position=K,p.line=le,p.lineStart=W,p.lineIndent=Se;break}}l&&(Fn(p,Q,K,!1),sc(p,p.line-le),Q=K=p.position,l=!1),oa(be)||(K=p.position+1),be=p.input.charCodeAt(++p.position)}return Fn(p,Q,K,!1),p.result?!0:(p.kind=de,p.result=ge,!1)}function Vf(p,w){var E,L,F;if(E=p.input.charCodeAt(p.position),E!==39)return!1;for(p.kind="scalar",p.result="",p.position++,L=F=p.position;(E=p.input.charCodeAt(p.position))!==0;)if(E===39)if(Fn(p,L,p.position,!0),E=p.input.charCodeAt(++p.position),E===39)L=p.position,p.position++,F=p.position;else return!0;else qr(E)?(Fn(p,L,F,!0),sc(p,si(p,!1,w)),L=F=p.position):p.position===p.lineStart&&jo(p)?Ke(p,"unexpected end of the document within a single quoted scalar"):(p.position++,F=p.position);Ke(p,"unexpected end of the stream within a single quoted scalar")}function Uf(p,w){var E,L,F,Q,K,l;if(l=p.input.charCodeAt(p.position),l!==34)return!1;for(p.kind="scalar",p.result="",p.position++,E=L=p.position;(l=p.input.charCodeAt(p.position))!==0;){if(l===34)return Fn(p,E,p.position,!0),p.position++,!0;if(l===92){if(Fn(p,E,p.position,!0),l=p.input.charCodeAt(++p.position),qr(l))si(p,!1,w);else if(l<256&&Ju[l])p.result+=Qu[l],p.position++;else if((K=Ff(l))>0){for(F=K,Q=0;F>0;F--)l=p.input.charCodeAt(++p.position),(K=Lf(l))>=0?Q=(Q<<4)+K:Ke(p,"expected hexadecimal character");p.result+=Bf(Q),p.position++}else Ke(p,"unknown escape sequence");E=L=p.position}else qr(l)?(Fn(p,E,L,!0),sc(p,si(p,!1,w)),E=L=p.position):p.position===p.lineStart&&jo(p)?Ke(p,"unexpected end of the document within a double quoted scalar"):(p.position++,L=p.position)}Ke(p,"unexpected end of the stream within a double quoted scalar")}function $f(p,w){var E=!0,L,F,Q,K=p.tag,l,le=p.anchor,W,Se,de,ge,be,je=Object.create(null),Je,it,Xe,tt;if(tt=p.input.charCodeAt(p.position),tt===91)Se=93,be=!1,l=[];else if(tt===123)Se=125,be=!0,l={};else return!1;for(p.anchor!==null&&(p.anchorMap[p.anchor]=l),tt=p.input.charCodeAt(++p.position);tt!==0;){if(si(p,!0,w),tt=p.input.charCodeAt(p.position),tt===Se)return p.position++,p.tag=K,p.anchor=le,p.kind=be?"mapping":"sequence",p.result=l,!0;E?tt===44&&Ke(p,"expected the node content, but found ','"):Ke(p,"missed comma between flow collection entries"),it=Je=Xe=null,de=ge=!1,tt===63&&(W=p.input.charCodeAt(p.position+1),Qi(W)&&(de=ge=!0,p.position++,si(p,!0,w))),L=p.line,F=p.lineStart,Q=p.position,Ra(p,w,Vo,!1,!0),it=p.tag,Je=p.result,si(p,!0,w),tt=p.input.charCodeAt(p.position),(ge||p.line===L)&&tt===58&&(de=!0,tt=p.input.charCodeAt(++p.position),si(p,!0,w),Ra(p,w,Vo,!1,!0),Xe=p.result),be?Fa(p,l,je,it,Je,Xe,L,F,Q):de?l.push(Fa(p,null,je,it,Je,Xe,L,F,Q)):l.push(Je),si(p,!0,w),tt=p.input.charCodeAt(p.position),tt===44?(E=!0,tt=p.input.charCodeAt(++p.position)):E=!1}Ke(p,"unexpected end of the stream within a flow collection")}function jf(p,w){var E,L,F=nc,Q=!1,K=!1,l=w,le=0,W=!1,Se,de;if(de=p.input.charCodeAt(p.position),de===124)L=!1;else if(de===62)L=!0;else return!1;for(p.kind="scalar",p.result="";de!==0;)if(de=p.input.charCodeAt(++p.position),de===43||de===45)nc===F?F=de===43?Gu:Mf:Ke(p,"repeat of a chomping mode identifier");else if((Se=Rf(de))>=0)Se===0?Ke(p,"bad explicit indentation width of a block scalar; it cannot be less than one"):K?Ke(p,"repeat of an indentation width identifier"):(l=w+Se-1,K=!0);else break;if(oa(de)){do de=p.input.charCodeAt(++p.position);while(oa(de));if(de===35)do de=p.input.charCod
`,Q?1+le:le):F===nc&&Q&&(p.result+=`
`);break}for(L?oa(de)?(W=!0,p.result+=oi.repeat(`
`,Q?1+le:le)):W?(W=!1,p.result+=oi.repeat(`
`,le+1)):le===0?Q&&(p.result+=" "):p.result+=oi.repeat(`
`,le):p.result+=oi.repeat(`
`,Q?1+le:le),Q=!0,K=!0,le=0,E=p.position;!qr(de)&&de!==0;)de=p.input.charCodeAt(++p.position);Fn(p,E,p.position,!1)}return!0}function rh(p,w){var E,L=p.tag,F=p.anchor,Q=[],K,l=!1,le;if(p.firstTabInLine!==-1)return!1;for(p.anchor!==null&&(p.anchorMap[p.anchor]=Q),le=p.input.charCodeAt(p.position);le!==0&&(p.firstTabInLine!==-1&&(p.position=p.firstTabInLine,Ke(p,"tab characters must not be used in indentation")),!(le!==45||(K=p.input.charCodeAt(p.position+1),!Qi(K))));){if(l=!0,p.position++,si(p,!0,-1)&&p.lineIndent<=w){Q.push(null),le=p.input.charCodeAt(p.position);continue}if(E=p.line,Ra(p,w,Zu,!1,!0),Q.push(p.result),si(p,!0,-1),le=p.input.charCodeAt(p.position),(p.line===E||p.lineIndent>w)&&le!==0)Ke(p,"bad indentation of a sequence entry");else if(p.lineIndent<w)break}return l?(p.tag=L,p.anchor=F,p.kind="sequence",p.result=Q,!0):!1}function qf(p,w,E){var L,F,Q,K,l,le,W=p.tag,Se=p.anchor,de={},ge=Object.create(null),be=null,je=null,Je=null,it=!1,Xe=!1,tt;if(p.firstTabInLine!==-1)return!1;for(p.anchor!==null&&(p.anchorMap[p.anchor]=de),tt=p.input.charCodeAt(p.position);tt!==0;){if(!it&&p.firstTabInLine!==-1&&(p.position=p.firstTabInLine,Ke(p,"tab characters must not be used in indentation")),L=p.input.charCodeAt(p.position+1),Q=p.line,(tt===63||tt===58)&&Qi(L))tt===63?(it&&(Fa(p,de,ge,be,je,null,K,l,le),be=je=Je=null),Xe=!0,it=!0,F=!0):it?(it=!1,F=!0):Ke(p,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),p.position+=1,tt=L;else{if(K=p.line,l=p.lineStart,le=p.position,!Ra(p,E,qu,!1,!0))break;if(p.line===Q){for(tt=p.input.charCodeAt(p.position);oa(tt);)tt=p.input.charCodeAt(++p.position);if(tt===58)tt=p.input.charCodeAt(++p.position),Qi(tt)||Ke(p,"a whitespace character is expected after the key-value separator within a block mapping"),it&&(Fa(p,de,ge,be,je,null,K,l,le),be=je=Je=null),Xe=!0,it=!1,F=!1,be=p.tag,je=p.result;else if(Xe)Ke(p,"can not read an implicit mapping pair; a colon is missed");else return p.tag=W,p.anchor=Se,!0}else if(Xe)Ke(p,"can not read a block mapping entry; a multiline key may not be an implicit key");else return p.tag=W,p.anchor=Se,!0}if((p.line===Q||p.lineIndent>w)&&(it&&(K=p.line,l=p.lineStart,le=p.position),Ra(p,w,Uo,!0,F)&&(it?je=p.result:Je=p.result),it||(Fa(p,de,ge,be,je,Je,K,l,le),be=je=Je=null),si(p,!0,-1),tt=p.input.charCodeAt(p.position)),(p.line===Q||p.lineIndent>w)&&tt!==0)Ke(p,"bad indentation of a mapping entry");else if(p.lineIndent<w)break}return it&&Fa(p,de,ge,be,je,null,K,l,le),Xe&&(p.tag=W,p.anchor=Se,p.kind="mapping",p.result=de),Xe}function Zf(p){var w,E=!1,L=!1,F,Q,K;if(K=p.input.charCodeAt(p.position),K!==33)return!1;if(p.tag!==null&&Ke(p,"duplication of a tag property"),K=p.input.charCodeAt(++p.position),K===60?(E=!0,K=p.input.charCodeAt(++p.position)):K===33?(L=!0,F="!!",K=p.input.charCodeAt(++p.position)):F="!",w=p.position,E){do K=p.input.charCodeAt(++p.position);while(K!==0&&K!==62);p.position<p.length?(Q=p.input.slice(w,p.position),K=p.input.charCodeAt(++p.position)):Ke(p,"unexpected end of the stream within a verbatim tag")}else{for(;K!==0&&!Qi(K);)K===33&&(L?Ke(p,"tag suffix cannot contain exclamation marks"):(F=p.input.slice(w-1,p.position+1),Hu.test(F)||Ke(p,"named tag handle cannot contain such characters"),L=!0,w=p.position+1)),K=p.input.charCodeAt(++p.position);Q=p.input.slice(w,p.position),Df.test(Q)&&Ke(p,"tag suffix cannot contain flow indicator characters")}Q&&!Wu.test(Q)&&Ke(p,"tag name cannot contain such characters: "+Q);try{Q=decodeURIComponent(Q)}catch{Ke(p,"tag name is malformed: "+Q)}return E?p.tag=Q:Ln.call(p.tagMap,F)?p.tag=p.tagMap[F]+Q:F==="!"?p.tag="!"+Q:F==="!!"?p.tag="tag:yaml.org,2002:"+Q:Ke(p,'undeclared tag handle "'+F+'"'),!0}function Gf(p){var w,E;if(E=p.input.charCodeAt(p.position),E!==38)return!1;for(p.anchor!==null&&Ke(p,"duplication of an anchor property"),E=p.input.charCodeAt(++p.position),w=p.position;E!==0&&!Qi(E)&&!Da(E);)E=p.input.charCodeAt(++p.position);return p.position===w&&Ke(p,"name of an anchor node must contain at least one character"),p.anchor=p.input.slice(w,p.positi
`),p.charCodeAt(0)===65279&&(p=p.slice(1)));var E=new Of(p,w),L=p.indexOf("\0");for(L!==-1&&(E.position=L,Ke(E,"null byte is not allowed in input")),E.input+="\0";E.input.charCodeAt(E.position)===32;)E.lineIndent+=1,E.position+=1;for(;E.position<E.length-1;)Wf(E);return E.documents}function Xf(p,w,E){w!==null&&typeof w=="object"&&typeof E>"u"&&(E=w,w=null);var L=nh(p,E);if(typeof w!="function")return L;for(var F=0,Q=L.length;F<Q;F+=1)w(L[F])}function Kf(p,w){var E=nh(p,w);if(E.length!==0){if(E.length===1)return E[0];throw new Vi("expected a single document in the stream, but found more")}}var Yf=Xf,Jf=Kf,ah={loadAll:Yf,load:Jf},sh=Object.prototype.toString,oh=Object.prototype.hasOwnProperty,oc=65279,Qf=9,Cs=10,em=13,tm=32,im=33,rm=34,lc=35,nm=37,am=38,sm=39,om=42,lh=44,lm=45,qo=58,cm=61,um=62,hm=63,pm=64,ch=91,uh=93,dm=96,hh=123,fm=124,ph=125,Ei={};Ei[0]="\\0",Ei[7]="\\a",Ei[8]="\\b",Ei[9]="\\t",Ei[10]="\\n",Ei[11]="\\v",Ei[12]="\\f",Ei[13]="\\r",Ei[27]="\\e",Ei[34]='\\"',Ei[92]="\\\\",Ei[133]="\\N",Ei[160]="\\_",Ei[8232]="\\L",Ei[8233]="\\P";var mm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],gm=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function _m(p,w){var E,L,F,Q,K,l,le;if(w===null)return{};for(E={},L=Object.keys(w),F=0,Q=L.length;F<Q;F+=1)K=L[F],l=String(w[K]),K.slice(0,2)==="!!"&&(K="tag:yaml.org,2002:"+K.slice(2)),le=p.compiledTypeMap.fallback[K],le&&oh.call(le.styleAliases,l)&&(l=le.styleAliases[l]),E[K]=l;return E}function ym(p){var w,E,L;if(w=p.toString(16).toUpperCase(),p<=255)E="x",L=2;else if(p<=65535)E="u",L=4;else if(p<=4294967295)E="U",L=8;else throw new Vi("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+E+oi.repeat("0",L-w.length)+w}var xm=1,ks=2;function vm(p){this.schema=p.schema||rc,this.indent=Math.max(1,p.indent||2),this.noArrayIndent=p.noArrayIndent||!1,this.skipInvalid=p.skipInvalid||!1,this.flowLevel=oi.isNothing(p.flowLevel)?-1:p.flowLevel,this.styleMap=_m(this.schema,p.styles||null),this.sortKeys=p.sortKeys||!1,this.lineWidth=p.lineWidth||80,this.noRefs=p.noRefs||!1,this.noCompatMode=p.noCompatMode||!1,this.condenseFlow=p.condenseFlow||!1,this.quotingType=p.quotingType==='"'?ks:xm,this.forceQuotes=p.forceQuotes||!1,this.replacer=typeof p.replacer=="function"?p.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function dh(p,w){for(var E=oi.repeat(" ",w),L=0,F=-1,Q="",K,l=p.length;L<l;)F=p.indexOf(`
`,L),F===-1?(K=p.slice(L),L=l):(K=p.slice(L,F+1),L=F+1),K.length&&K!==`
`&&(Q+=E),Q+=K;return Q}function cc(p,w){return`
`+oi.repeat(" ",p.indent*w)}function bm(p,w){var E,L,F;for(E=0,L=p.implicitTypes.length;E<L;E+=1)if(F=p.implicitTypes[E],F.resolve(w))return!0;return!1}function Zo(p){return p===tm||p===Qf}function Es(p){return 32<=p&&p<=126||161<=p&&p<=55295&&p!==8232&&p!==8233||57344<=p&&p<=65533&&p!==oc||65536<=p&&p<=1114111}function fh(p){return Es(p)&&p!==oc&&p!==em&&p!==Cs}function mh(p,w,E){var L=fh(p),F=L&&!Zo(p);return(E?L:L&&p!==lh&&p!==ch&&p!==uh&&p!==hh&&p!==ph)&&p!==lc&&!(w===qo&&!F)||fh(w)&&!Zo(w)&&p===lc||w===qo&&F}function wm(p){return Es(p)&&p!==oc&&!Zo(p)&&p!==lm&&p!==hm&&p!==qo&&p!==lh&&p!==ch&&p!==uh&&p!==hh&&p!==ph&&p!==lc&&p!==am&&p!==om&&p!==im&&p!==fm&&p!==cm&&p!==um&&p!==sm&&p!==rm&&p!==nm&&p!==pm&&p!==dm}function Sm(p){return!Zo(p)&&p!==qo}function Ms(p,w){var E=p.charCodeAt(w),L;return E>=55296&&E<=56319&&w+1<p.length&&(L=p.charCodeAt(w+1),L>=56320&&L<=57343)?(E-55296)*1024+L-56320+65536:E}function gh(p){var w=/^\n* /;return w.test(p)}var _h=1,uc=2,yh=3,xh=4,Ba=5;function Tm(p,w,E,L,F,Q,K,l){var le,W=0,Se=null,de=!1,ge=!1,be=L!==-1,je=-1,Je=wm(Ms(p,0))&&Sm(Ms(p,p.length-1));if(w||K)for(le=0;le<p.length;W>=65536?le+=2:le++){if(W=Ms(p,le),!Es(W))return Ba;Je=Je&&mh(W,Se,l),Se=W}else{for(le=0;le<p.length;W>=65536?le+=2:le++){if(W=Ms(p,le),W===Cs)de=!0,be&&(ge=ge||le-je-1>L&&p[je+1]!==" ",je=le);else if(!Es(W))return Ba;Je=Je&&mh(W,Se,l),Se=W}ge=ge||be&&le-je-1>L&&p[je+1]!==" "}return!de&&!ge?Je&&!K&&!F(p)?_h:Q===ks?Ba:uc:E>9&&gh(p)?Ba:K?Q===ks?Ba:uc:ge?xh:yh}function Im(p,w,E,L,F){p.dump=(function(){if(w.length===0)return p.quotingType===ks?'""':"''";if(!p.noCompatMode&&(mm.indexOf(w)!==-1||gm.test(w)))return p.quotingType===ks?'"'+w+'"':"'"+w+"'";var Q=p.indent*Math.max(1,E),K=p.lineWidth===-1?-1:Math.max(Math.min(p.lineWidth,40),p.lineWidth-Q),l=L||p.flowLevel>-1&&E>=p.flowLevel;function le(W){return bm(p,W)}switch(Tm(w,l,p.indent,K,le,p.quotingType,p.forceQuotes&&!L,F)){case _h:return w;case uc:return"'"+w.replace(/'/g,"''")+"'";case yh:return"|"+vh(w,p.indent)+bh(dh(w,Q));case xh:return">"+vh(w,p.indent)+bh(dh(Am(w,K),Q));case Ba:return'"'+Cm(w)+'"';default:throw new Vi("impossible error: invalid scalar style")}})()}function vh(p,w){var E=gh(p)?String(w):"",L=p[p.length-1]===`
`,F=L&&(p[p.length-2]===`
`||p===`
`),Q=F?"+":L?"":"-";return E+Q+`
`}function bh(p){return p[p.length-1]===`
`?p.slice(0,-1):p}function Am(p,w){for(var E=/(\n+)([^\n]*)/g,L=(function(){var W=p.indexOf(`
`);return W=W!==-1?W:p.length,E.lastIndex=W,wh(p.slice(0,W),w)})(),F=p[0]===`
`||p[0]===" ",Q,K;K=E.exec(p);){var l=K[1],le=K[2];Q=le[0]===" ",L+=l+(!F&&!Q&&le!==""?`
`:"")+wh(le,w),F=Q}return L}function wh(p,w){if(p===""||p[0]===" ")return p;for(var E=/ [^ ]/g,L,F=0,Q,K=0,l=0,le="";L=E.exec(p);)l=L.index,l-F>w&&(Q=K>F?K:l,le+=`
`+p.slice(F,Q),F=Q+1),K=l;return le+=`
`,p.length-F>w&&K>F?le+=p.slice(F,K)+`
`+p.slice(K+1):le+=p.slice(F),le.slice(1)}function Cm(p){for(var w="",E=0,L,F=0;F<p.length;E>=65536?F+=2:F++)E=Ms(p,F),L=Ei[E],!L&&Es(E)?(w+=p[F],E>=65536&&(w+=p[F+1])):w+=L||ym(E);return w}function km(p,w,E){var L="",F=p.tag,Q,K,l;for(Q=0,K=E.length;Q<K;Q+=1)l=E[Q],p.replacer&&(l=p.replacer.call(E,String(Q),l)),(cn(p,w,l,!1,!1)||typeof l>"u"&&cn(p,w,null,!1,!1))&&(L!==""&&(L+=","+(p.condenseFlow?"":" ")),L+=p.dump);p.tag=F,p.dump="["+L+"]"}function Sh(p,w,E,L){var F="",Q=p.tag,K,l,le;for(K=0,l=E.length;K<l;K+=1)le=E[K],p.replacer&&(le=p.replacer.call(E,String(K),le)),(cn(p,w+1,le,!0,!0,!1,!0)||typeof le>"u"&&cn(p,w+1,null,!0,!0,!1,!0))&&((!L||F!=="")&&(F+=cc(p,w)),p.dump&&Cs===p.dump.charCodeAt(0)?F+="-":F+="- ",F+=p.dump);p.tag=Q,p.dump=F||"[]"}function Em(p,w,E){var L="",F=p.tag,Q=Object.keys(E),K,l,le,W,Se;for(K=0,l=Q.length;K<l;K+=1)Se="",L!==""&&(Se+=", "),p.condenseFlow&&(Se+='"'),le=Q[K],W=E[le],p.replacer&&(W=p.replacer.call(E,le,W)),cn(p,w,le,!1,!1)&&(p.dump.length>1024&&(Se+="? "),Se+=p.dump+(p.condenseFlow?'"':"")+":"+(p.condenseFlow?"":" "),cn(p,w,W,!1,!1)&&(Se+=p.dump,L+=Se));p.tag=F,p.dump="{"+L+"}"}function Mm(p,w,E,L){var F="",Q=p.tag,K=Object.keys(E),l,le,W,Se,de,ge;if(p.sortKeys===!0)K.sort();else if(typeof p.sortKeys=="function")K.sort(p.sortKeys);else if(p.sortKeys)throw new Vi("sortKeys must be a boolean or a function");for(l=0,le=K.length;l<le;l+=1)ge="",(!L||F!=="")&&(ge+=cc(p,w)),W=K[l],Se=E[W],p.replacer&&(Se=p.replacer.call(E,W,Se)),cn(p,w+1,W,!0,!0,!0)&&(de=p.tag!==null&&p.tag!=="?"||p.dump&&p.dump.length>1024,de&&(p.dump&&Cs===p.dump.charCodeAt(0)?ge+="?":ge+="? "),ge+=p.dump,de&&(ge+=cc(p,w)),cn(p,w+1,Se,!0,de)&&(p.dump&&Cs===p.dump.charCodeAt(0)?ge+=":":ge+=": ",ge+=p.dump,F+=ge));p.tag=Q,p.dump=F||"{}"}function Th(p,w,E){var L,F,Q,K,l,le;for(F=E?p.explicitTypes:p.implicitTypes,Q=0,K=F.length;Q<K;Q+=1)if(l=F[Q],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof w=="object"&&w instanceof l.instanceOf)&&(!l.predicate||l.predicate(w))){if(E?l.multi&&l.representName?p.tag=l.representName(w):p.tag=l.tag:p.tag="?",l.represent){if(le=p.styleMap[l.tag]||l.defaultStyle,sh.call(l.represent)==="[object Function]")L=l.represent(w,le);else if(oh.call(l.represent,le))L=l.represent[le](w,le);else throw new Vi("!<"+l.tag+'> tag resolver accepts not "'+le+'" style');p.dump=L}return!0}return!1}function cn(p,w,E,L,F,Q,K){p.tag=null,p.dump=E,Th(p,E,!1)||Th(p,E,!0);var l=sh.call(p.dump),le=L,W;L&&(L=p.flowLevel<0||p.flowLevel>w);var Se=l==="[object Object]"||l==="[object Array]",de,ge;if(Se&&(de=p.duplicates.indexOf(E),ge=de!==-1),(p.tag!==null&&p.tag!=="?"||ge||p.indent!==2&&w>0)&&(F=!1),ge&&p.usedDuplicates[de])p.dump="*ref_"+de;else{if(Se&&ge&&!p.usedDuplicates[de]&&(p.usedDuplicates[de]=!0),l==="[object Object]")L&&Object.keys(p.dump).length!==0?(Mm(p,w,p.dump,F),ge&&(p.dump="&ref_"+de+p.dump)):(Em(p,w,p.dump),ge&&(p.dump="&ref_"+de+" "+p.dump));else if(l==="[object Array]")L&&p.dump.length!==0?(p.noArrayIndent&&!K&&w>0?Sh(p,w-1,p.dump,F):Sh(p,w,p.dump,F),ge&&(p.dump="&ref_"+de+p.dump)):(km(p,w,p.dump),ge&&(p.dump="&ref_"+de+" "+p.dump));else if(l==="[object String]")p.tag!=="?"&&Im(p,p.dump,w,Q,le);else{if(l==="[object Undefined]")return!1;if(p.skipInvalid)return!1;throw new Vi("unacceptable kind of an object to dump "+l)}p.tag!==null&&p.tag!=="?"&&(W=encodeURI(p.tag[0]==="!"?p.tag.slice(1):p.tag).replace(/!/g,"%21"),p.tag[0]==="!"?W="!"+W:W.slice(0,18)==="tag:yaml.org,2002:"?W="!!"+W.slice(18):W="!<"+W+">",p.dump=W+" "+p.dump)}return!0}function Pm(p,w){var E=[],L=[],F,Q;for(hc(p,E,L),F=0,Q=L.length;F<Q;F+=1)w.duplicates.push(E[L[F]]);w.usedDuplicates=new Array(Q)}function hc(p,w,E){var L,F,Q;if(p!==null&&typeof p=="object")if(F=w.indexOf(p),F!==-1)E.indexOf(F)===-1&&E.push(F);else if(w.push(p),Array.isArray(p))for(F=0,Q=p.length;F<Q;F+=1)hc(p[F],w,E);else for(L=Object.keys(p),F=0,Q=L.length;F<Q;F+=1)hc(p[L[F]],w,E)}function zm(p,w){w=w||{};var E=new vm(w);E.noRefs||Pm(p,E);var L=p;return E.replacer&&(L=E.replacer.call({"":L},"",L)),cn(E,0,L,!0,!0)?E.dump+`
`:""}var Dm=zm,Lm={dump:Dm};function pc(p,w){return function(){throw new Error("Function yaml."+p+" is removed in js-yaml 4. Use yaml."+w+" instead, which is now safe by default.")}}var Fm=xi,Rm=Iu,Bm=Eu,Om=Lu,Nm=Fu,Vm=rc,Um=ah.load,$m=ah.loadAll,jm=Lm.dump,qm=Vi,Zm={binary:Vu,float:Du,map:ku,null:Mu,pairs:$u,set:ju,timestamp:Ou,bool:Pu,int:zu,merge:Nu,omap:Uu,seq:Cu,str:Au},Gm=pc("safeLoad","load"),Hm=pc("safeLoadAll","loadAll"),Wm=pc("safeDump","dump"),Ih={Type:Fm,Schema:Rm,FAILSAFE_SCHEMA:Bm,JSON_SCHEMA:Om,CORE_SCHEMA:Nm,DEFAULT_SCHEMA:Vm,load:Um,loadAll:$m,dump:jm,YAMLException:qm,types:Zm,safeLoad:Gm,safeLoadAll:Hm,safeDump:Wm};function Xm(p={}){const{defaultCenter:w={lat:43.836699,lon:4.360054},defaultZoom:E=13,onSave:L=()=>{}}=p,F=Vue.ref({...w}),Q=Vue.ref(E),K=Vue.ref(null);Vue.onBeforeUnmount(()=>{K.value&&clearTimeout(K.value)});function l(Se){if(!Se||Se.trim()==="")return null;try{const de=Ih.load(Se);if(de)return de.center&&(F.value={lat:de.center.lat,lon:de.center.lon}),de.zoom!==void 0&&(Q.value=de.zoom),de}catch(de){return console.error("Error loading map data:",de),null}return null}function le(){const Se={background:{type:"osm"},center:{lat:F.value.lat,lon:F.value.lon},zoom:Q.value},de=Ih.dump(Se,{indent:2,lineWidth:-1,noRefs:!0});return L(de),de}function W(Se=300){K.value&&clearTimeout(K.value),K.value=setTimeout(()=>{le()},Se)}return{center:F,zoom:Q,loadMapData:l,saveMapData:le,debouncedSave:W}}const Km={components:{MapPreview:md,MarkerList:Cd},props:{value:String,name:String,label:String,help:String,disabled:Boolean,defaultCenter:{type:Array,default:()=>[43.836699,4.360054]},defaultZoom:{type:Number,default:13},maxMarkers:{type:Number,default:50},mode:{type:String,default:"multi",validator:p=>["multi","single"].includes(p)},latitude:{type:[Number,String],default:null},longitude:{type:[Number,String],default:null}},setup(p,{emit:w}){const E=Vue.ref(!1),L=Vue.ref(null),F=Vue.ref(null),Q=Vue.computed(()=>{var rt;if(p.mode==="single")return null;const Ve=window.location.pathname.match(/\/panel\/pages\/(.+)/);if(Ve)return Ve[1].replace(/\+/g,"/");const st=(rt=p.name)==null?void 0:rt.match(/pages\/([^/]+)/);return st?st[1].replace(/\+/g,"/"):(console.warn("Could not extract page ID, using default"),"map/carte")}),K=p.mode==="multi"?kd(Q.value):{markers:Vue.ref([]),loading:Vue.ref(!1),error:Vue.ref(null)},{center:l,zoom:le,loadMapData:W,debouncedSave:Se}=Xm({defaultCenter:{lat:p.defaultCenter[0],lon:p.defaultCenter[1]},defaultZoom:p.defaultZoom,onSave:Ve=>w("input",Ve)}),de=Vue.computed(()=>{if(p.mode==="single"){const Ve=be.value,st=je.value;return!isNaN(Ve)&&!isNaN(st)&&Ve!==null&&st!==null&&Ve!==0&&st!==0?[{id:"single-marker",position:{lat:Ve,lon:st},title:"Current position"}]:[]}return K.markers.value}),ge=Vue.computed(()=>p.mode==="single"?!1:de.value.length<p.maxMarkers),be=Vue.ref(null),je=Vue.ref(null);function Je(){const Ve=document.querySelector(".k-form");if(!Ve)return{lat:null,lon:null};const st=Ve.querySelector('input[name*="latitude"]'),rt=Ve.querySelector('input[name*="longitude"]');return{lat:st?parseFloat(st.value):null,lon:rt?parseFloat(rt.value):null}}Vue.onMounted(async()=>{if(p.mode==="multi")try{await K.fetchMarkers()}catch(Ve){console.error("Failed to load markers:",Ve)}else if(p.mode==="single"){const Ve=Je();be.value=Ve.lat,je.value=Ve.lon,!isNaN(Ve.lat)&&!isNaN(Ve.lon)&&Ve.lat!==0&&Ve.lon!==0&&(l.value={lat:Ve.lat,lon:Ve.lon});const st=document.querySelector(".k-form");st&&st.addEventListener("input",rt=>{if(rt.target.name&&(rt.target.name.includes("latitude")||rt.target.name.includes("longitude"))){const Ui=Je();be.value=Ui.lat,je.value=Ui.lon}})}p.value&&p.mode==="multi"&&W(p.value),await Vue.nextTick(),E.value=!0}),Vue.watch([l,le],()=>{p.mode==="multi"&&Se()},{deep:!0}),Vue.watch(()=>[be.value,je.value],([Ve,st])=>{p.mode==="single"&&!isNaN(Ve)&&!isNaN(st)&&Ve!==null&&st!==null&&Ve!==0&&st!==0&&L.value&&L.value.centerOnPosition&&L.value.centerOnPosition(Ve,st)});function it(){return L.value&&L.value.getCurrentCenter?L.value.getCurrentCenter():{lat:l.value.lat,lon:l.value.lon}}as