@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
1 lines • 70.4 kB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5013],{4264(t,e,r){r.d(e,{lf:()=>St,L:()=>Nt,A4:()=>Rt,aR:()=>Ut,tU:()=>Mt,V1:()=>Ot,uU:()=>Bt});var i=r(19419),a=r(5408),n=r(13195),s=r(89518),o=r(68572),l=r(63907),u=r(85079),c=r(74038);class h{constructor(t){this._precisionFactors={},this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._geometryLayout||this._buildMaterialInfo(),this._stride}getAttributeLocations(){return this._geometryLayout||this._buildMaterialInfo(),this._locations}getPrecisionFactors(){return this._precisionFactors||this._buildMaterialInfo(),this._precisionFactors}get geometryLayout(){return this._geometryLayout||this._buildMaterialInfo(),this._geometryLayout}getEncodingInfos(){return this._propertyEncodingInfo||this._buildMaterialInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildMaterialInfo(),this._uniforms}getUsedAttributes(){return this._usedAttributes||this._buildMaterialInfo(),this._usedAttributes}encodeAttributes(t,e,r,i){const a=this.propertyInfos,n=this.getEncodingInfos(),s=[],o=s.length,l=Math.ceil(this._ddStrideInBytes/4);for(let t=0;t<l;t++)s.push(0);let u=0,c=null;for(const l of Object.keys(n)){const h=n[l],{type:p,precisionFactor:y,isLayout:f}=a[l];c===p&&32!==u||(u=0,c=p);const m=f?r.getLayoutProperty(l):r.getPaintProperty(l),g=m.interpolator?.getInterpolationRange(e);let d=0;for(const r of h){const{offset:a}=r,n=o+Math.floor(a/4),l=i??m.getValue(g?g[d]:e,t),c=y||1;switch(p){case 0:case 1:s[n]|=this._encodeByte(l*c,0)<<u,u+=8;break;case 2:case 3:s[n]|=this._encodeShort(l*c,0)<<u,u+=16;break;case 4:case 5:{const t=this._encodeByte(l*c,0),e=this._encodeByte(l*c,8);s[n]|=t<<u,s[n]|=e<<u,u+=16}break;case 6:case 7:s[n]|=this._encodeShort(l*c,0),s[n]|=this._encodeShort(l*c,16);break;case 8:case 9:s[n]|=this._encodeByte(l*c,0),s[n]|=this._encodeByte(l*c,8),s[n]|=this._encodeByte(l*c,16),s[n]|=this._encodeByte(l*c,24);break;case 10:s[n]=this._encodeColor(l);break;case 11:case 12:this._encodePattern(n,s,l);break;default:throw new Error("Unsupported encoding type")}d++}}return s}getAtributeState(t){let e=0;const r=3+2*t;return e|=this._bit(r),e|=this._bit(r+1)<<1,e}static{this._encodingInfo={0:{dataType:l.pe.BYTE,bytesPerElement:1,count:1,normalized:!1},1:{dataType:l.pe.UNSIGNED_BYTE,bytesPerElement:1,count:1,normalized:!1},2:{dataType:l.pe.SHORT,bytesPerElement:2,count:1,normalized:!1},3:{dataType:l.pe.UNSIGNED_SHORT,bytesPerElement:2,count:1,normalized:!1},4:{dataType:l.pe.BYTE,bytesPerElement:1,count:2,normalized:!1},5:{dataType:l.pe.UNSIGNED_BYTE,bytesPerElement:1,count:2,normalized:!1},6:{dataType:l.pe.SHORT,bytesPerElement:2,count:2,normalized:!1},7:{dataType:l.pe.UNSIGNED_SHORT,bytesPerElement:2,count:2,normalized:!1},8:{dataType:l.pe.BYTE,bytesPerElement:1,count:4,normalized:!1},9:{dataType:l.pe.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!1},10:{dataType:l.pe.UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!0},11:{dataType:l.pe.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1},12:{dataType:l.pe.UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1}}}_getLayoutElementsForPropertyState(t,e,r){const i=r[t],a=i.name,{count:n,dataType:s,normalized:o}=h._encodingInfo[i.type],{attribueIdx:l,precisionFactor:u}=i,c=u||1,p=[{location:l[0],name:a,propertyName:t,count:n,type:s,normalized:o,precisionFactor:c}];if(this._precisionFactors[a]=c,2===e){const e=`${a}To`;p.push({location:l[1],name:e,propertyName:t,count:n,type:s,normalized:o,precisionFactor:c}),this._precisionFactors[e]=c}return p}_buildMaterialInfo(){const t=[];this._propertyEncodingInfo={};const e={},r=this.properties,i=this.propertyInfos;let a=-1;for(const n of r){a++;const r=i[n].name;e[r]=!1,e[`${r}To`]=!1;const s=this.getAtributeState(a);if(0===s||3===s)continue;const o=this._getLayoutElementsForPropertyState(n,s,i);t.push(...o)}for(const r of t)e[r.name]=!0;const n=function(t){const e=(0,o.H)(t),r=[];let i=0;for(const t of e)r.push({...t,offset:i}),i+=p(t.type)*t.count;return r}(t);this._buildLayout(n),this._buildShaderUniforms(),this._usedAttributes=e}_buildLayout(t){this.opacityLayout?this._locations=(0,u._u)([this.baseGeometryLayout,this.opacityLayout]):this._locations=(0,u.Xk)(this.baseGeometryLayout);const e=this.baseGeometryLayout;let r=e[0].stride;const i=[];let a=0;for(const e of t)a+=p(e.type)*e.count;r=y(r+a);for(const t of e)i.push(new c._(t.name,t.count,t.type,t.offset,r,t.normalized));let n=0;for(const a of t)i.push(new c._(a.name,a.count,a.type,e[0].stride+n,r,a.normalized)),void 0===this._propertyEncodingInfo[a.propertyName]&&(this._propertyEncodingInfo[a.propertyName]=[]),this._propertyEncodingInfo[a.propertyName].push({offset:n}),n+=p(a.type)*a.count;this._ddStrideInBytes=n,this._geometryLayout=i;const s=this._locations;for(const e of t)s.set(e.name,e.location);this._stride=r}_buildShaderUniforms(){const t=[],e=this.properties,r=this.propertyInfos;let i=-1;for(const a of e){i++;const{name:e,type:n,isLayout:s}=r[a];switch(this.getAtributeState(i)){case 0:t.push({name:e,getValue:(t,e,r,i)=>{const o=s?t.getLayoutValue(a,e):t.getPaintValue(a,e);switch(n){case 11:{const r=t.getDashKey(o,t.getLayoutValue("line-cap",e)),a=i.getMosaicItemPosition(r,!1);if(null==a)return null;const{tl:n,br:s}=a;return[n[0],s[1],s[0],n[1]]}case 12:{const t=i.getMosaicItemPosition(o,!a.includes("line-"));if(null==t)return null;const{tl:e,br:r}=t;return[e[0],r[1],r[0],e[1]]}case 10:{const t=o[3];return[t*o[0],t*o[1],t*o[2],t]}default:return o}}});break;case 2:{const r=`${e}Mix`;t.push({name:r,getValue:(t,e,r,i)=>(s?t.getLayoutProperty(a):t.getPaintProperty(a)).interpolator.interpolationUniformValue(r,e)})}}}this._uniforms=t}_bit(t){return(this._key&1<<t)>>t}_encodeColor(t){const e=255*t[3];return(0,s.Ss)(t[0]*e,t[1]*e,t[2]*e,e)}_encodePattern(t,e,r){if(!r?.rect)return;const i=r.rect,a=r.width,n=r.height;e[t]=this._encodeShort(i.x+2,0),e[t]|=this._encodeShort(i.y+2+n,16),e[t+1]=this._encodeShort(i.x+2+a,0),e[t+1]|=this._encodeShort(i.y+2,16)}_encodeByte(t,e){return(255&t)<<e}_encodeShort(t,e){return(65535&t)<<e}}const p=t=>{switch(t){case l.pe.FLOAT:case l.pe.INT:case l.pe.UNSIGNED_INT:return 4;case l.pe.SHORT:case l.pe.UNSIGNED_SHORT:case l.pe.HALF_FLOAT:return 2;case l.pe.BYTE:case l.pe.UNSIGNED_BYTE:return 1}},y=t=>t+3&-4;class f extends h{static{this.ATTRIBUTES=["background-color","background-pattern"]}static{this.GEOMETRY_LAYOUT=[new c._("position",2,l.pe.SHORT,0,4)]}static{this.ATTRIBUTES_INFO={"background-color":{name:"background-color",type:0,attribueIdx:[0,1],isLayout:!1},"background-pattern":{name:"background-pattern",type:0,attribueIdx:[1,2],isLayout:!1,isOptional:!0}}}constructor(t){super(t),this.baseGeometryLayout=f.GEOMETRY_LAYOUT,this.properties=f.ATTRIBUTES,this.propertyInfos=f.ATTRIBUTES_INFO}}class m extends h{static{this.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"]}static{this.GEOMETRY_LAYOUT=[new c._("position",2,l.pe.SHORT,0,4)]}static{this.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:1,attribueIdx:[1,8]},"circle-color":{name:"color",type:10,attribueIdx:[2,9]},"circle-opacity":{name:"opacity",type:1,attribueIdx:[3,10],precisionFactor:100},"circle-stroke-width":{name:"strokeWidth",type:1,attribueIdx:[4,11],precisionFactor:4},"circle-stroke-color":{name:"strokeColor",type:10,attribueIdx:[5,12]},"circle-stroke-opacity":{name:"strokeOpacity",type:1,attribueIdx:[6,13],precisionFactor:100},"circle-blur":{name:"blur",type:1,attribueIdx:[7,14],precisionFactor:32}}}constructor(t){super(t),this.baseGeometryLayout=m.GEOMETRY_LAYOUT,this.properties=m.ATTRIBUTES,this.propertyInfos=m.ATTRIBUTES_INFO}}class g extends h{static{this.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"]}static{this.GEOMETRY_LAYOUT=[new c._("position",2,l.pe.SHORT,0,4)]}static{this.ATTRIBUTES_INFO={"fill-color":{name:"color",type:10,attribueIdx:[1,4]},"fill-opacity":{name:"opacity",type:1,precisionFactor:100,attribueIdx:[2,5]},"fill-pattern":{name:"tlbr",type:12,isOptional:!0,attribueIdx:[3,3]}}}constructor(t){super(t),this.baseGeometryLayout=g.GEOMETRY_LAYOUT,this.properties=g.ATTRIBUTES,this.propertyInfos=g.ATTRIBUTES_INFO}}class d extends h{static{this.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"]}static{this.ATTRIBUTES_FILL=["fill-color","fill-opacity"]}static{this.GEOMETRY_LAYOUT=[new c._("position",2,l.pe.SHORT,0,8),new c._("offset",2,l.pe.BYTE,4,8),new c._("normal",2,l.pe.BYTE,6,8)]}static{this.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:10,attribueIdx:[3,5]},"fill-opacity":{name:"opacity",type:1,precisionFactor:100,attribueIdx:[4,6]}}}static{this.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:10,attribueIdx:[3,5]},"fill-opacity":{name:"opacity",type:1,precisionFactor:100,attribueIdx:[4,6]}}}constructor(t,e){super(t),this.baseGeometryLayout=d.GEOMETRY_LAYOUT,this.properties=e?d.ATTRIBUTES_FILL:d.ATTRIBUTES_OUTLINE,this.propertyInfos=e?d.ATTRIBUTES_INFO_FILL:d.ATTRIBUTES_INFO_OUTLINE}}class b extends h{static{this.ATTRIBUTES=["line-color","line-width","line-opacity","line-blur","line-offset","line-pattern","line-dasharray"]}static{this.GEOMETRY_LAYOUT=[new c._("position",2,l.pe.SHORT,0,16),new c._("extrudeOffset",4,l.pe.BYTE,4,16),new c._("directionNormal",4,l.pe.BYTE,8,16),new c._("accumulatedDistance",2,l.pe.UNSIGNED_SHORT,12,16)]}static{this.ATTRIBUTES_INFO={"line-color":{name:"color",type:10,attribueIdx:[4,10]},"line-width":{name:"width",type:1,attribueIdx:[5,11],precisionFactor:2},"line-opacity":{name:"opacity",type:1,attribueIdx:[6,12],precisionFactor:100},"line-blur":{name:"blur",type:1,attribueIdx:[7,13],precisionFactor:4},"line-offset":{name:"offset",type:0,attribueIdx:[8,14],precisionFactor:2},"line-pattern":{name:"tlbr",type:12,attribueIdx:[9,9],isOptional:!0},"line-dasharray":{name:"tlbr",type:11,attribueIdx:[9,9],isOptional:!0}}}constructor(t){super(t),this.baseGeometryLayout=b.GEOMETRY_LAYOUT,this.properties=b.ATTRIBUTES,this.propertyInfos=b.ATTRIBUTES_INFO}}const _=[new c._("positionAndOffset",4,l.pe.SHORT,0,16),new c._("iconInfo",4,l.pe.UNSIGNED_SHORT,8,16)],w=[new c._("opacityInfo",1,l.pe.UNSIGNED_BYTE,0,1)];class v extends h{static{this.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"]}static{this.ATTRIBUTES_INFO={"icon-color":{name:"color",type:10,attribueIdx:[2,8]},"icon-opacity":{name:"opacity",type:1,precisionFactor:100,attribueIdx:[3,9]},"icon-halo-color":{name:"haloColor",type:10,attribueIdx:[4,10]},"icon-halo-width":{name:"haloWidth",type:1,precisionFactor:4,attribueIdx:[5,11]},"icon-halo-blur":{name:"haloBlur",type:1,precisionFactor:4,attribueIdx:[6,12]},"icon-size":{name:"size",type:1,precisionFactor:32,isLayout:!0,attribueIdx:[7,13]}}}constructor(t){super(t),this.baseGeometryLayout=_,this.opacityLayout=w,this.properties=v.ATTRIBUTES,this.propertyInfos=v.ATTRIBUTES_INFO}}class x extends h{static{this.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"]}static{this.ATTRIBUTES_INFO={"text-color":{name:"color",type:10,attribueIdx:[4,10]},"text-opacity":{name:"opacity",type:1,precisionFactor:100,attribueIdx:[3,9]},"text-halo-color":{name:"haloColor",type:10,attribueIdx:[5,11]},"text-halo-width":{name:"haloWidth",type:1,precisionFactor:4,attribueIdx:[6,12]},"text-halo-blur":{name:"haloBlur",type:1,precisionFactor:4,attribueIdx:[7,13]},"text-size":{name:"size",type:1,isLayout:!0,attribueIdx:[2,8]}}}constructor(t){super(t),this.baseGeometryLayout=_,this.opacityLayout=w,this.properties=x.ATTRIBUTES,this.propertyInfos=x.ATTRIBUTES_INFO}}var T=r(68197),E=r(85334);function P(t,e,r,i){const a=3*t,n=3*(r-t)-a,s=1-a-n,o=3*e,l=3*(i-e)-o,u=1-o-l;function c(t){return((s*t+n)*t+a)*t}function h(t){return(3*s*t+2*n)*t+a}return function(t,e=1e-6){return function(t){return((u*t+l)*t+o)*t}(function(t,e){let r,i,a,n,s,o;for(a=t,o=0;o<8;o++){if(n=c(a)-t,Math.abs(n)<e)return a;if(s=h(a),Math.abs(s)<1e-6)break;a-=n/s}if(r=0,i=1,a=t,a<r)return r;if(a>i)return i;for(;r<i;){if(n=c(a),Math.abs(n-t)<e)return a;t>n?r=a:i=a,a=.5*(i-r)+r}return a}(t,e))}}const I={};I.ease=P(.25,.1,.25,1),I.linear=P(0,0,1,1),I.easeIn=I["ease-in"]=P(.42,0,1,1),I.easeOut=I["ease-out"]=P(0,0,.58,1),I.easeInOut=I["ease-in-out"]=P(.42,0,.58,1);const D={kind:"null"},L={kind:"number"},A={kind:"string"},k={kind:"boolean"},S={kind:"color"},R={kind:"object"},M={kind:"value"};function O(t,e){return{kind:"array",itemType:t,n:e}}const N=[D,L,A,k,S,R,O(M)];function U(t){if("array"===t.kind){const e=U(t.itemType);return"number"==typeof t.n?`array<${e}, ${t.n}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}function B(t){if(null===t)return D;if("string"==typeof t)return A;if("boolean"==typeof t)return k;if("number"==typeof t)return L;if(t instanceof T.A)return S;if(Array.isArray(t)){let e;for(const r of t){const t=B(r);if(e){if(e!==t){e=M;break}}else e=t}return O(e||M,t.length)}return"object"==typeof t?R:M}function z(t,e){if("array"===e.kind)return"array"===t.kind&&(0===t.n&&"value"===t.itemType.kind||z(t.itemType,e.itemType))&&("number"!=typeof e.n||e.n===t.n);if("value"===e.kind)for(const e of N)if(z(t,e))return!0;return e.kind===t.kind}function V(t){if(null===t)return"";const e=typeof t;return"string"===e?t:"number"===e||"boolean"===e?String(t):t instanceof T.A?t.toString():JSON.stringify(t)}class F{constructor(t){this._parent=t,this._vars={}}add(t,e){this._vars[t]=e}get(t){return this._vars[t]?this._vars[t]:this._parent?this._parent.get(t):null}}class G{constructor(){this.type=M}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new G}evaluate(t,e){return t?.id}}class ${constructor(){this.type=A}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new $}evaluate(t,e){if(!t)return null;switch(t.type){case 1:return"Point";case 2:return"LineString";case 3:return"Polygon";default:return null}}}class C{constructor(){this.type=R}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new C}evaluate(t,e){return t?.values}}class Y{constructor(){this.type=L}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new Y}evaluate(t,e){return e}}class H{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=k}static parse(t,e,r){if(3!==t.length&&4!==t.length)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(4===t.length)throw new Error(`"${t[0]}" collator not supported`);return new H(Tt(t[1],e),Tt(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class j{constructor(t){this._arg=t,this.type=k}static parse(t,e){if(2!==t.length)throw new Error('"!" expects 1 argument');return new j(Tt(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class W{constructor(t){this._args=t,this.type=k}static parse(t,e){const r=[];for(let i=1;i<t.length;i++)r.push(Tt(t[i],e));return new W(r)}evaluate(t,e){for(const r of this._args)if(!r.evaluate(t,e))return!1;return!0}}class q{constructor(t){this._args=t,this.type=k}static parse(t,e){const r=[];for(let i=1;i<t.length;i++)r.push(Tt(t[i],e));return new q(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!0;return!1}}class K{constructor(t){this._args=t,this.type=k}static parse(t,e){const r=[];for(let i=1;i<t.length;i++)r.push(Tt(t[i],e));return new K(r)}evaluate(t,e){for(const r of this._args)if(r.evaluate(t,e))return!1;return!0}}class Z{constructor(t,e,r){this.type=t,this._args=e,this._fallback=r}static parse(t,e,r){if(t.length<4)throw new Error('"case" expects at least 3 arguments');if(t.length%2==1)throw new Error('"case" expects an odd number of arguments');let i;const a=[];for(let n=1;n<t.length-1;n+=2){const s=Tt(t[n],e),o=Tt(t[n+1],e,r);i||(i=o.type),a.push({condition:s,output:o})}const n=Tt(t[t.length-1],e,r);return i||(i=n.type),new Z(i,a,n)}evaluate(t,e){for(const r of this._args)if(r.condition.evaluate(t,e))return r.output.evaluate(t,e);return this._fallback.evaluate(t,e)}}class J{constructor(t,e){this.type=t,this._args=e}static parse(t,e){if(t.length<2)throw new Error('"coalesce" expects at least 1 argument');let r;const i=[];for(let a=1;a<t.length;a++){const n=Tt(t[a],e);r||(r=n.type),i.push(n)}return new J(r,i)}evaluate(t,e){for(const r of this._args){const i=r.evaluate(t,e);if(null!==i)return i}return null}}class X{constructor(t,e,r,i,a){this.type=t,this._input=e,this._labels=r,this._outputs=i,this._fallback=a}static parse(t,e){if(t.length<3)throw new Error('"match" expects at least 3 arguments');if(t.length%2==0)throw new Error('"case" expects an even number of arguments');let r;const i=Tt(t[1],e),a=[],n={};let s;for(let i=2;i<t.length-1;i+=2){let o=t[i];Array.isArray(o)||(o=[o]);for(const t of o){const e=typeof t;if("string"!==e&&"number"!==e)throw new Error('"match" requires string or number literal as labels');if(s){if(e!==s)throw new Error('"match" requires labels to have the same type')}else s=e;n[t]=a.length}const l=Tt(t[i+1],e);r||(r=l.type),a.push(l)}return new X(r,i,n,a,Tt(t[t.length-1],e))}evaluate(t,e){const r=this._input.evaluate(t,e);return(this._outputs[this._labels[r]]||this._fallback).evaluate(t,e)}}class Q{constructor(t,e,r,i,a){this._operator=t,this.type=e,this.interpolation=r,this.input=i,this._stops=a}static parse(t,e,r){const i=t[0];if(t.length<5)throw new Error(`"${i}" expects at least 4 arguments`);const a=t[1];if(!Array.isArray(a)||0===a.length)throw new Error(`"${a}" is not a valid interpolation`);switch(a[0]){case"linear":if(1!==a.length)throw new Error("Linear interpolation cannot have parameters");break;case"exponential":if(2!==a.length||"number"!=typeof a[1])throw new Error("Exponential interpolation requires one numeric argument");break;case"cubic-bezier":if(5!==a.length)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");for(let t=1;t<5;t++){const e=a[t];if("number"!=typeof e||e<0||e>1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${a[0]}"`)}if(t.length%2!=1)throw new Error(`"${i}" expects an even number of arguments`);const n=Tt(t[2],e,L);let s;"interpolate-hcl"===i||"interpolate-lab"===i?s=S:r&&"value"!==r.kind&&(s=r);const o=[];for(let r=3;r<t.length;r+=2){const a=t[r];if("number"!=typeof a)throw new Error(`"${i}" requires stop inputs as literal numbers`);if(o.length&&o[o.length-1][0]>=a)throw new Error(`"${i}" requires strictly ascending stop inputs`);const n=Tt(t[r+1],e,s);s||(s=n.type),o.push([a,n])}if(s&&s!==S&&s!==L&&("array"!==s.kind||s.itemType!==L))throw new Error(`"${i}" cannot interpolate type ${U(s)}`);return new Q(i,s,a,n,o)}evaluate(t,e){const r=this._stops;if(1===r.length)return r[0][1].evaluate(t,e);const i=this.input.evaluate(t,e);if(i<=r[0][0])return r[0][1].evaluate(t,e);if(i>=r[r.length-1][0])return r[r.length-1][1].evaluate(t,e);let a=0;for(;++a<r.length&&!(i<r[a][0]););const s=r[a-1][0],o=r[a][0],l=Q.interpolationRatio(this.interpolation,i,s,o),u=r[a-1][1].evaluate(t,e),c=r[a][1].evaluate(t,e);if("interpolate"===this._operator){if("array"===this.type.kind&&Array.isArray(u)&&Array.isArray(c))return u.map((t,e)=>(0,n.GW)(t,c[e],l));if("color"===this.type.kind&&u instanceof T.A&&c instanceof T.A){const t=new T.A(u),e=new T.A(c);return new T.A([(0,n.GW)(t.r,e.r,l),(0,n.GW)(t.g,e.g,l),(0,n.GW)(t.b,e.b,l),(0,n.GW)(t.a,e.a,l)])}if("number"===this.type.kind&&"number"==typeof u&&"number"==typeof c)return(0,n.GW)(u,c,l);throw new Error(`"${this._operator}" cannot interpolate type ${U(this.type)}`)}if("interpolate-hcl"===this._operator){const t=(0,E.RH)(u),e=(0,E.RH)(c),r=e.h-t.h,i=(0,E.$)({h:t.h+l*(r>180||r<-180?r-360*Math.round(r/360):r),c:(0,n.GW)(t.c,e.c,l),l:(0,n.GW)(t.l,e.l,l)});return new T.A({a:(0,n.GW)(u.a,c.a,l),...i})}if("interpolate-lab"===this._operator){const t=(0,E.ZD)(u),e=(0,E.ZD)(c),r=(0,E.$)({l:(0,n.GW)(t.l,e.l,l),a:(0,n.GW)(t.a,e.a,l),b:(0,n.GW)(t.b,e.b,l)});return new T.A({a:(0,n.GW)(u.a,c.a,l),...r})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(1===r.length)return 0;if(t>=r[r.length-1][0])return 0;let i=0;for(;++i<r.length&&!(t<r[i][0]););const a=r[i-1][0],n=r[i][0];return Q.interpolationRatio(this.interpolation,e,a,n)}getInterpolationRange(t){const e=this._stops;if(1===e.length){const t=e[0][0];return[t,t]}const r=e[e.length-1][0];if(t>=r)return[r,r];let i=0;for(;++i<e.length&&!(t<e[i][0]););return[e[i-1][0],e[i][0]]}static interpolationRatio(t,e,r,i){let a=0;return"linear"===t[0]?a=Q._exponentialInterpolationRatio(e,1,r,i):"exponential"===t[0]?a=Q._exponentialInterpolationRatio(e,t[1],r,i):"cubic-bezier"===t[0]&&(a=P(t[1],t[2],t[3],t[4])(Q._exponentialInterpolationRatio(e,1,r,i),1e-5)),a<0?a=0:a>1&&(a=1),a}static _exponentialInterpolationRatio(t,e,r,i){const a=i-r;if(0===a)return 0;const n=t-r;return 1===e?n/a:(e**n-1)/(e**a-1)}}class tt{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=Tt(t[1],e,L);let i;const a=[];a.push([-1/0,Tt(t[2],e)]);for(let r=3;r<t.length;r+=2){const n=t[r];if("number"!=typeof n)throw new Error('"step" requires stop inputs as literal numbers');if(a.length&&a[a.length-1][0]>=n)throw new Error('"step" requires strictly ascending stop inputs');const s=Tt(t[r+1],e);i||(i=s.type),a.push([n,s])}return new tt(i,r,a)}evaluate(t,e){const r=this._stops;if(1===r.length)return r[0][1].evaluate(t,e);const i=this._input.evaluate(t,e);let a=0;for(;++a<r.length&&!(i<r[a][0]););return this._stops[a-1][1].evaluate(t,e)}}class et{constructor(t,e){this.type=t,this._output=e}static parse(t,e,r){if(t.length<4)throw new Error('"let" expects at least 3 arguments');if(t.length%2==1)throw new Error('"let" expects an odd number of arguments');const i=new F(e);for(let r=1;r<t.length-1;r+=2){const a=t[r];if("string"!=typeof a)throw new Error(`"let" requires a string to define variable names - found ${a}`);i.add(a,Tt(t[r+1],e))}const a=Tt(t[t.length-1],i,r);return new et(a.type,a)}evaluate(t,e){return this._output.evaluate(t,e)}}class rt{constructor(t,e){this.type=t,this.output=e}static parse(t,e,r){if(2!==t.length||"string"!=typeof t[1])throw new Error('"var" requires just one literal string argument');const i=e.get(t[1]);if(!i)throw new Error(`${t[1]} must be defined before being used in a "var" expression`);return new rt(r||M,i)}evaluate(t,e){return this.output.evaluate(t,e)}}class it{constructor(t,e,r){this.type=t,this._index=e,this._array=r}static parse(t,e){if(3!==t.length)throw new Error('"at" expects 2 arguments');const r=Tt(t[1],e,L),i=Tt(t[2],e);return new it(i.type.itemType,r,i)}evaluate(t,e){const r=this._index.evaluate(t,e),i=this._array.evaluate(t,e);if(r<0||r>=i.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return i[r]}}class at{constructor(t){this._args=t,this.type=M}static parse(t,e){const r=t.slice(1).map(t=>Array.isArray(t)?Tt(t,e):t);return new at(r)}evaluate(t,e){let r;return this._args&&(r=this._args.map(r=>r&&r.evaluate?r.evaluate(t,e):r)),!r||r.length<2&&r.length%2==1?"":(t=>Array.from({length:t.length/2},(e,r)=>(t=>t)(t[2*r],t[2*r+1])))(r).join()}}class nt{constructor(t,e){this._key=t,this._obj=e,this.type=M}static parse(t,e){let r,i;switch(t.length){case 2:return r=Tt(t[1],e),new nt(r);case 3:return r=Tt(t[1],e),i=Tt(t[2],e),new nt(r,i);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?this._obj.evaluate(t,e)[r]:t?.values[r]}}class st{constructor(t,e){this._key=t,this._obj=e,this.type=k}static parse(t,e){let r,i;switch(t.length){case 2:return r=Tt(t[1],e),new st(r);case 3:return r=Tt(t[1],e),i=Tt(t[2],e),new st(r,i);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?r in this._obj.evaluate(t,e):!!t?.values[r]}}class ot{constructor(t,e){this._key=t,this._vals=e,this.type=k}static parse(t,e){if(3!==t.length)throw new Error('"in" expects 2 arguments');return new ot(Tt(t[1],e),Tt(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}}class lt{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=L}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=Tt(t[1],e),i=Tt(t[2],e);if(4===t.length){const a=Tt(t[3],e,L);return new lt(r,i,a)}return new lt(r,i)}evaluate(t,e){const r=this._item.evaluate(t,e),i=this._array.evaluate(t,e);if(this._from){const a=this._from.evaluate(t,e);if(a!==Math.floor(a))throw new Error('"index-of" index must be an integer');return i.indexOf(r,a)}return i.indexOf(r)}}class ut{constructor(t){this._arg=t,this.type=L}static parse(t,e){if(2!==t.length)throw new Error('"length" expects 2 arguments');const r=Tt(t[1],e);return new ut(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if("string"==typeof r)return r.length;if(Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class ct{constructor(t,e,r,i){this.type=t,this._array=e,this._from=r,this._to=i}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=Tt(t[1],e),i=Tt(t[2],e,L);if(i.type!==L)throw new Error('"slice" index must return a number');if(4===t.length){const a=Tt(t[3],e,L);if(a.type!==L)throw new Error('"slice" index must return a number');return new ct(r.type,r,i,a)}return new ct(r.type,r,i)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&"string"!=typeof r)throw new Error('"slice" input must be an array or a string');const i=this._from.evaluate(t,e);if(i<0||i>=r.length)throw new Error('"slice" index out of bounds');if(i!==Math.floor(i))throw new Error('"slice" index must be an integer');if(this._to){const a=this._to.evaluate(t,e);if(a<0||a>=r.length)throw new Error('"slice" index out of bounds');if(a!==Math.floor(a))throw new Error('"slice" index must be an integer');return r.slice(i,a)}return r.slice(i)}}class ht{constructor(){this.type=k}static parse(t){if(1!==t.length)throw new Error('"has-id" expects no arguments');return new ht}evaluate(t,e){return void 0!==t?.id}}class pt{constructor(t,e){this._args=t,this._calculate=e,this.type=L}static parse(t,e,r){const i=t.slice(1).map(t=>Tt(t,e));return new pt(i,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map(r=>r.evaluate(t,e))),this._calculate(r)}}class yt{constructor(t,e){this._args=t,this._calculate=e,this.type=L}static{this.ops={abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log(t[0])/Math.LN10,log2:t=>Math.log(t[0])/Math.LN2,max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])}}static parse(t,e){const r=t.slice(1).map(t=>Tt(t,e));return new yt(r,yt.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map(r=>r.evaluate(t,e))),this._calculate(r)}}class ft{constructor(t){this._args=t,this.type=A}static parse(t,e){return new ft(t.slice(1).map(t=>Tt(t,e)))}evaluate(t,e){return this._args.map(r=>r.evaluate(t,e)).join("")}}class mt{constructor(t,e){this._arg=t,this._calculate=e,this.type=A}static{this.ops={downcase:t=>t.toLowerCase(),upcase:t=>t.toUpperCase()}}static parse(t,e){if(2!==t.length)throw new Error(`${t[0]} expects 1 argument`);const r=Tt(t[1],e);return new mt(r,mt.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}class gt{constructor(t){this._args=t,this.type=S}static parse(t,e){if(4!==t.length)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map(t=>Tt(t,e));return new gt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),i=this._validate(this._args[1].evaluate(t,e)),a=this._validate(this._args[2].evaluate(t,e));return new T.A({r,g:i,b:a})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class dt{constructor(t){this._args=t,this.type=S}static parse(t,e){if(5!==t.length)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map(t=>Tt(t,e));return new dt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),i=this._validate(this._args[1].evaluate(t,e)),a=this._validate(this._args[2].evaluate(t,e)),n=this._validateAlpha(this._args[3].evaluate(t,e));return new T.A({r,g:i,b:a,a:n})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if("number"!=typeof t||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class bt{constructor(t){this._color=t,this.type=O(L,4)}static parse(t,e){if(2!==t.length)throw new Error('"to-rgba" expects 1 argument');const r=Tt(t[1],e);return new bt(r)}evaluate(t,e){return new T.A(this._color.evaluate(t,e)).toRgba()}}class _t{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let i,a=1;if("array"===r){if(t.length>2){switch(t[1]){case"string":i=A;break;case"number":i=L;break;case"boolean":i=k;break;default:throw new Error('"array" type argument must be string, number or boolean')}a++}else i=M;let e;if(t.length>3){if(e=t[2],null!==e&&("number"!=typeof e||e<0||e!==Math.floor(e)))throw new Error('"array" length argument must be a positive integer literal');a++}i=O(i,e)}else switch(r){case"string":i=A;break;case"number":i=L;break;case"boolean":i=k;break;case"object":i=R}const n=[];for(;a<t.length;a++){const r=Tt(t[a],e);n.push(r)}return new _t(i,n)}evaluate(t,e){let r;for(const i of this._args){const a=i.evaluate(t,e);if(r=B(a),z(r,this.type))return a}throw new Error(`Expected ${U(this.type)} but got ${U(r)}`)}}class wt{static{this.types={"to-boolean":k,"to-color":S,"to-number":L,"to-string":A}}constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0],i=wt.types[r];if(i===k||i===A){if(2!==t.length)throw new Error(`${r} expects one argument`)}else if(t.length<2)throw new Error(`${r} expects at least one argument`);const a=[];for(let r=1;r<t.length;r++){const i=Tt(t[r],e);a.push(i)}return new wt(i,a)}evaluate(t,e){if(this.type===k)return Boolean(this._args[0].evaluate(t,e));if(this.type===A)return V(this._args[0].evaluate(t,e));if(this.type===L){for(const r of this._args){const i=Number(r.evaluate(t,e));if(!isNaN(i))return i}return null}if(this.type===S){for(const r of this._args)try{const i=wt.toColor(r.evaluate(t,e));if(i instanceof T.A)return i}catch{}return null}}static toBoolean(t){return Boolean(t)}static toString(t){return V(t)}static toNumber(t){const e=Number(t);if(isNaN(e))throw new Error(`"${t}" is not a number`);return e}static toColor(t){if(t instanceof T.A)return t;if("string"==typeof t){const e=T.A.fromString(t);if(e)return e;throw new Error(`"${t}" is not a color`)}if(Array.isArray(t))return T.A.fromArray(t);throw new Error(`"${t}" is not a color`)}}class vt{constructor(t){this._val=t,this.type=B(t)}static parse(t){if(2!==t.length)throw new Error('"literal" expects 1 argument');return new vt(t[1])}evaluate(t,e){return this._val}}class xt{constructor(t){this._arg=t,this.type=A}static parse(t,e){if(2!==t.length)throw new Error('"typeof" expects 1 argument');return new xt(Tt(t[1],e))}evaluate(t,e){return U(B(this._arg.evaluate(t,e)))}}function Tt(t,e,r){const i=typeof t;if("string"===i||"boolean"===i||"number"===i||null===t){if(r)switch(r.kind){case"string":"string"!==i&&(t=wt.toString(t));break;case"number":"number"!==i&&(t=wt.toNumber(t));break;case"color":t=wt.toColor(t)}t=["literal",t]}if(!Array.isArray(t)||0===t.length)throw new Error("Expression must be a non empty array");const a=t[0];if("string"!=typeof a)throw new Error("First element of expression must be a string");const n=Et[a];if(void 0===n)throw new Error(`Invalid expression operator "${a}"`);if(!n)throw new Error(`Unimplemented expression operator "${a}"`);return n.parse(t,e,r)}const Et={array:_t,boolean:_t,collator:null,format:at,image:null,literal:vt,number:_t,"number-format":null,object:_t,string:_t,"to-boolean":wt,"to-color":wt,"to-number":wt,"to-string":wt,typeof:xt,accumulated:null,"feature-state":null,"geometry-type":$,id:G,"line-progress":null,properties:C,at:it,get:nt,has:st,in:ot,"index-of":lt,length:ut,slice:ct,"!":j,"!=":class extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t!==e)}},"<":class extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t<e)}},"<=":class extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t<=e)}},"==":class extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t===e)}},">":class extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t>e)}},">=":class extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t>=e)}},all:W,any:q,case:Z,coalesce:J,match:X,within:null,interpolate:Q,"interpolate-hcl":Q,"interpolate-lab":Q,step:tt,let:et,var:rt,concat:ft,downcase:mt,"is-supported-script":null,"resolved-locale":null,upcase:mt,rgb:gt,rgba:dt,"to-rgba":bt,"-":class extends pt{static parse(t,e){switch(t.length){case 2:return pt.parse(t,e,t=>-t[0]);case 3:return pt.parse(t,e,t=>t[0]-t[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}},"*":class extends pt{static parse(t,e){return pt.parse(t,e,t=>{let e=1;for(const r of t)e*=r;return e})}},"/":class extends pt{static parse(t,e){if(3===t.length)return pt.parse(t,e,t=>t[0]/t[1]);throw new Error('"/" expects 2 arguments')}},"%":class extends pt{static parse(t,e){if(3===t.length)return pt.parse(t,e,t=>t[0]%t[1]);throw new Error('"%" expects 2 arguments')}},"^":class extends pt{static parse(t,e){if(3===t.length)return pt.parse(t,e,t=>t[0]**t[1]);throw new Error('"^" expects 1 or 2 arguments')}},"+":class extends pt{static parse(t,e){return pt.parse(t,e,t=>{let e=0;for(const r of t)e+=r;return e})}},abs:yt,acos:yt,asin:yt,atan:yt,ceil:yt,cos:yt,e:yt,floor:yt,ln:yt,ln2:yt,log10:yt,log2:yt,max:yt,min:yt,pi:yt,round:yt,sin:yt,sqrt:yt,tan:yt,zoom:Y,"heatmap-density":null,"has-id":ht,none:K};class Pt{constructor(t){this._expression=t}filter(t,e){if(!this._expression)return!0;try{return this._expression.evaluate(t,e)}catch(t){return console.log(t.message),!0}}static createFilter(t){if(!t)return null;this.isLegacyFilter(t)&&(t=this.convertLegacyFilter(t));try{const e=Tt(t,null,k);return new Pt(e)}catch(t){return console.log(t.message),null}}static isLegacyFilter(t){if(!Array.isArray(t))return!0;if(0===t.length)return!0;switch(t[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return 3===t.length&&"string"==typeof t[1]&&!Array.isArray(t[2]);case"in":return t.length>=3&&"string"==typeof t[1]&&!Array.isArray(t[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(let e=1;e<t.length;e++)if(this.isLegacyFilter(t[e]))return!0;return!1;case"has":return 2===t.length&&("$id"===t[1]||"$type"===t[1]);default:return!1}}static convertLegacyFilter(t){if(!Array.isArray(t)||0===t.length)return!0;const e=t[0];if(1===t.length)return"any"!==e;switch(e){case"==":return Pt.convertComparison("==",t[1],t[2]);case"!=":return Pt.negate(Pt.convertComparison("==",t[1],t[2]));case">":case"<":case">=":case"<=":return Pt.convertComparison(e,t[1],t[2]);case"in":return Pt.convertIn(t[1],t.slice(2));case"!in":return Pt.negate(Pt.convertIn(t[1],t.slice(2)));case"any":case"all":case"none":return Pt.convertCombining(e,t.slice(1));case"has":return Pt.convertHas(t[1]);case"!has":return Pt.negate(Pt.convertHas(t[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(t,e,r){switch(e){case"$type":return[t,["geometry-type"],r];case"$id":return[t,["id"],r];default:return[t,["get",e],r]}}static convertIn(t,e){switch(t){case"$type":return["in",["geometry-type"],["literal",e]];case"$id":return["in",["id"],["literal",e]];default:return["in",["get",t],["literal",e]]}}static convertHas(t){switch(t){case"$type":return!0;case"$id":return["has-id"];default:return["has",t]}}static convertCombining(t,e){return[t].concat(e.map(this.convertLegacyFilter))}static negate(t){return["!",t]}}class It{static{this.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:0}}}static{this.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:0}}}static{this.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:0},"line-cap":{type:"enum",values:["butt","round","square"],default:0},"line-join":{type:"enum",values:["bevel","round","miter"],default:2},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}}}static{this.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:0},"symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:0},"symbol-sort-key":{type:"number",default:-1},"symbol-spacing":{type:"number",minimum:1,default:250},"icon-allow-overlap":{type:"boolean",default:!1},"icon-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:0},"icon-ignore-placement":{type:"boolean",default:!1},"icon-image":{type:"string"},"icon-keep-upright":{type:"boolean",default:!1},"icon-offset":{type:"array",value:"number",length:2,default:[0,0]},"icon-optional":{type:"boolean",default:!1},"icon-padding":{type:"number",minimum:0,default:2},"icon-rotate":{type:"number",default:0},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:2},"icon-size":{type:"number",minimum:0,default:1},"text-allow-overlap":{type:"boolean",default:!1},"text-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:0},"text-field":{type:"string"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"]},"text-ignore-placement":{type:"boolean",default:!1},"text-justify":{type:"enum",values:["auto","left","center","right"],default:2},"text-keep-upright":{type:"boolean",default:!0},"text-letter-spacing":{type:"number",default:0},"text-line-height":{type:"number",default:1.2},"text-max-angle":{type:"number",minimum:0,default:45},"text-max-width":{type:"number",minimum:0,default:10},"text-offset":{type:"array",value:"number",length:2,default:[0,0]},"text-optional":{type:"boolean",default:!1},"text-padding":{type:"number",minimum:0,default:2},"text-rotate":{type:"number",default:0},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:2},"text-size":{type:"number",minimum:0,default:16},"text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:0},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[0]}}}static{this.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:0}}}static{this.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}}}static{this.fillPaintDefinition={"fill-antialias":{type:"boolean",default:!0},"fill-color":{type:"color",default:[0,0,0,1]},"fill-opacity":{type:"number",minimum:0,maximum:1,default:1},"fill-outline-color":{type:"color",default:[0,0,0,0]},"fill-pattern":{type:"string"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],default:0}}}static{this.linePaintDefinition={"line-blur":{type:"number",minimum:0,default:0},"line-color":{type:"color",default:[0,0,0,1]},"line-dasharray":{type:"array",value:"number",default:[]},"line-gap-width":{type:"number",minimum:0,default:0},"line-offset":{type:"number",default:0},"line-opacity":{type:"number",minimum:0,maximum:1,default:1},"line-pattern":{type:"string"},"line-translate":{type:"array",value:"number",length:2,default:[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],default:0},"line-width":{type:"number",minimum:0,default:1}}}static{this.symbolPaintDefinition={"icon-color":{type:"color",default:[0,0,0,1]},"icon-halo-blur":{type:"number",minimum:0,default:0},"icon-halo-color":{type:"color",default:[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,default:0},"icon-opacity":{type:"number",minimum:0,maximum:1,default:1},"icon-translate":{type:"array",value:"number",length:2,default:[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],default:0},"text-color":{type:"color",default:[0,0,0,1]},"text-halo-blur":{type:"number",minimum:0,default:0},"text-halo-color":{type:"color",default:[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,default:0},"text-opacity":{type:"number",minimum:0,maximum:1,default:1},"text-translate":{type:"array",value:"number",length:2,default:[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],default:0}}}static{this.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,default:1},"raster-hue-rotate":{type:"number",default:0},"raster-brightness-min":{type:"number",minimum:0,maximum:1,default:0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,default:1},"raster-saturation":{type:"number",minimum:-1,maximum:1,default:0},"raster-contrast":{type:"number",minimum:-1,maximum:1,default:0},"raster-fade-duration":{type:"number",minimum:0,default:300}}}static{this.circlePaintDefinition={"circle-blur":{type:"number",minimum:0,default:0},"circle-color":{type:"color",default:[0,0,0,1]},"circle-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-radius":{type:"number",minimum:0,default:5},"circle-stroke-color":{type:"color",default:[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-stroke-width":{type:"number",minimum:0,default:0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],default:0}}}}var Dt=r(40876);class Lt{constructor(t,e){let r;switch(this.isDataDriven=!1,this.interpolator=null,t.type){case"number":case"color":r=!0;break;case"array":r="number"===t.value;break;default:r=!1}if((null==e||""===e&&"color"===t.type)&&(e=t.default),Array.isArray(e)&&e.length>0&&Et[e[0]]){const r={number:L,color:S,string:A,boolean:k,enum:A};try{const i=Tt(e,null,"array"===t.type?O(r[t.value]||M,t.length):r[t.type]);this.getValue=this._buildExpression(i,t),this.isDataDriven=!0,i instanceof Q&&i.input instanceof Y&&(this.interpolator=i)}catch(e){console.log(e.message),this.getValue=this._buildSimple(t.default)}return}r&&"interval"===e.type&&(r=!1);const i=e?.stops&&e.stops.length>0;if(i)for(const r of e.stops)r[1]=this._validate(r[1],t);if(this.isDataDriven=!!e&&!!e.property,this.isDataDriven)if(void 0!==e.default&&(e.default=this._validate(e.default,t)),i)switch(e.type){case"identity":this.getValue=this._buildIdentity(e,t);break;case"categorical":this.getValue=this._buildCategorical(e,t);break;default:this.getValue=r?this._buildInterpolate(e,t):this._buildInterval(e,t)}else this.getValue=this._buildIdentity(e,t);else i?this.getValue=r?this._buildZoomInterpolate(e):this._buildZoomInterval(e):(e=this._validate(e,t),this.getValue=this._buildSimple(e))}_validate(t,e){if("number"===e.type){if(null!=e.minimum&&t<e.minimum)return e.minimum;if(null!=e.maximum&&t>e.maximum)return e.maximum}else"color"===e.type?t=Lt._parseColor(t):"enum"===e.type?"string"==typeof t&&(t=e.values.indexOf(t)):"array"===e.type&&"enum"===e.value?t=t.map(t=>"string"==typeof t?e.values.indexOf(t):t):"string"===e.type&&(t=V(t));return t}_buildSimple(t){return()=>t}_buildExpression(t,e){return(r,i)=>{try{const a=t.evaluate(i,r);return void 0===a?e.default:this._validate(a,e)}catch(t){return console.log(t.message),e.default}}}_buildIdentity(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),void 0!==a&&(a=this._validate(a,e)),null!=a?a:void 0!==t.default?t.default:e.default}}_buildCategorical(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),a=this._categorical(a,t.stops),void 0!==a?a:void 0!==t.default?t.default:e.default}}_buildInterval(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),"number"==typeof a?this._interval(a,t.stops):void 0!==t.default?t.default:e.default}}_buildInterpolate(t,e){return(r,i)=>{let a;return i&&(a=i.values[t.property]),"number"==typeof a?this._interpolate(a,t.stops,t.base||1):void 0!==t.default?t.default:e.default}}_buildZoomInterpolate(t){return e=>this._interpolate(e,t.stops,t.base||1)}_buildZoomInterval(t){return e=>this._interval(e,t.stops)}_categorical(t,e){const r=e.length;for(let i=0;i<r;i++)if(e[i][0]===t)return e[i][1]}_interval(t,e){const r=e.length;let i=0;for(let a=0;a<r&&e[a][0]<=t;a++)i=a;return e[i][1]}_interpolate(t,e,r){let i,a;const s=e.length;for(let r=0;r<s;r++){const n=e[r];if(!(n[0]<=t)){a=n;break}i=n}if(i&&a){const e=a[0]-i[0],s=t-i[0],o=1===r?s/e:(r**s-1)/(r**e-1);if(Array.isArray(i[1])){const t=i[1],e=a[1],r=[];for(let i=0;i<t.length;i++)r.push((0,n.GW)(t[i],e[i],o));return r}return(0,n.GW)(i[1],a[1],o)}return i?i[1]:a?a[1]:void 0}static _isEmpty(t){for(const e in t)if(t.hasOwnProperty(e))return!1;return!0}static _parseColor(t){return Array.isArray(t)?t:"string"==typeof t?(0,Dt.Vm)(t)??void 0:t instanceof T.A&&!this._isEmpty(t)?t.toUnitRGBA():void 0}}var At=r(76213);class kt{constructor(t,e,r,i){switch(this.type=t,this.typeName=e.type,this.id=e.id,this.source=e.source,this.sourceLayer=e["source-layer"],this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,this.filter=e.filter,this.layout=e.layout,this.paint=e.paint,this.z=r,this.uid=i,t){case 0:this._layoutDefinition=It.backgroundLayoutDefinition,this._paintDefinition=It.backgroundPaintDefinition;break;case 1:this._layoutDefinition=It.fillLayoutDefinition,this._paintDefinition=It.fillPaintDefinition;break;case 2:this._layoutDefinition=It.lineLayoutDefinition,this._paintDefinition=It.linePaintDefinition;break;case 3:this._layoutDefinition=It.symbolLayoutDefinition,this._paintDefinition=It.symbolPaintDefinition;break;case 4:this._layoutDefinition=It.circleLayoutDefinition,this._paintDefinition=It.circlePaintDefinition}this._layoutProperties=this._parseLayout(this.layout),this._paintProperties=this._parsePaint(this.paint)}getFeatureFilter(){return void 0!==this._featureFilter?this._featureFilter:this._featureFilter=Pt.createFilter(this.filter)}getLayoutProperty(t){return this._layoutProperties[t]}getPaintProperty(t){return this._paintProperties[t]}getLayoutValue(t,e,r){let i;const a=this._layoutProperties[t];return a&&(i=a.getValue(e,r)),void 0===i&&(i=this._layoutDefinition[t].default),i}getPaintValue(t,e,r){let i;const a=this._paintProperties[t];return a&&(i=a.getValue(e,r)),void 0===i&&(i=this._paintDefinition[t].default),i}isPainterDataDriven(){const t=this._paintProperties;if(t)for(const e in t)if(t[e].isDataDriven)return!0;return!1}isIntersectingFeature(t,e,r,i,a,n,s){return!1}getFeatureInflatedBounds(t,e,r,i){return null}_parseLayout(t){const e={};for(const r in t){const i=this._layoutDefinition[r];i&&(e[r]=new Lt(i,t[r]))}return e}_parsePaint(t){const e={};for(const r in t){const i=this._paintDefinition[r];i&&(e[r]=new Lt(i,t[r]))}return e}computeAttributesKey(t,e,r,i){let a=0,n=0;for(const t of e){let e=3;if(t&&t!==i){const i=r[t],{isLayout:a,isOptional:n}=i,s=a?this.getLayoutProperty(t):this.getPaintProperty(t);e=s?.interpolator?2:s?.isDataDriven?1:n&&!s?3:0}n|=e<<a,a+=2}return n<<3|t}}class St extends kt{constructor(t,e,r,i){super(t,e,r,i),this.backgroundMaterial=new f(this.computeAttributesKey(0,f.ATTRIBUTES,f.ATTRIBUTES_INFO))}}class Rt extends kt{constructor(t,e,r,i){super(t,e,r,i);const a=this.getPaintProperty("fill-color"),n=this.getPaintProperty("fill-opacity"),s=this.getPaintProperty("fill-pattern");this.hasDataDrivenColor=a?.isDataDriven,this.hasDataDrivenOpacity=n?.isDataDriven,this.hasDataDrivenFill=this.hasDataDrivenColor||this.hasDataDrivenOpacity||s?.isDataDriven;const o=this.getPaintProperty("fill-outline-color");this.outlineUsesFillColor=!o,this.hasDataDrivenOutlineColor=o?.isDataDriven,this.hasDataDrivenOutline=o?o.isDataDriven:!!a&&a.isDataDriven,this.hasDataDrivenOutline=(o?this.hasDataDrivenOutlineColor:this.hasDataDrivenColor)||this.hasDataDrivenOpacity,this.fillMaterial=new g(this.computeAttributesKey(1,g.ATTRIBUTES,g.ATTRIBUTES_INFO)),this.outlineMaterial=new d(this.computeAttributesKey(2,this.outlineUsesFillColor?d.ATTRIBUTES_FILL:d.ATTRIBUTES_OUTLINE,this.outlineUsesFillColor?d.ATTRIBUTES_INFO_FILL:d.ATTRIBUTES_INFO_OUTLINE),this.outlineUsesFillColor)}getFeatureInflatedBounds(t,e,r,i){const a=zt(t);if(!a)return null;const n=this.getPaintValue("fill-translate",e,t),s=i*Math.max(n[0],n[1]);return a[0]-=s,a[2]-=s,a[1]+=s,a[3]+=s,a}isIntersectingFeature(t,e,r,i,s,o,l){const u=i.getGeometry();if(!u)return!1;const c=a.ih/l.normalizationRatio;t=t/l.normalizationRatio+l.normalizationOffsetX,e=e/l.normalizationRatio+l.normalizationOffsetY;const h=(0,n.yM)(this.getPaintValue("fill-translate",s,i),this.getPaintValue("fill-translate-anchor",s,i),o,a.ih);return t-=c*h.x,e-=c*h.y,!!(0,n.s3)(t,e,u)||(0,n.ru)(t,e,u,r)}}class Mt extends kt{constructor(t,e,r,i){super(t,e,r,i);const a=this.getPaintProperty("line-pattern");if(this.lineMaterial=new b(this.computeAttributesKey(3,b.ATTRIBUTES,b.ATTRIBUTES_INFO,a?"line-dasharray":"")),this.hasDataDrivenLine=this.getPaintProperty("line-blur")?.isDataDriven||this.getPaintProperty("line-color")?.isDataDriven||this.getPaintProper