PageSourceSearch

https://topotijdreis.nl/static/js/52.7dbdf2be.chunk.js

js topotijdreis.nl collected 2026-10-02 06:44:50 UTC 486,828 bytes, 2 lines download raw bytes

1(this.webpackJsonptopotijdreis=this.webpackJsonptopotijdreis||[]).push([[52,30],{535:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(11),r=n(3),a=n(2),o=function(){function e(){Object(r.a)(this,e),this.name=this.constructor.name||"UnnamedBrush"}return Object(a.a)(e,[{key:"prepareState",value:function(e,t,n){}},{key:"draw",value:function(e,t,n){}},{key:"drawMany",value:function(e,t,n){var r,a=Object(i.a)(t);try{for(a.s();!(r=a.n()).done;){var o=r.value;this.draw(e,o,n)}}catch(s){a.e(s)}finally{a.f()}}}]),e}()},540:function(e,t,n){"use strict";n.d(t,"a",(function(){return O})),n.d(t,"b",(function(){return x})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return _})),n.d(t,"f",(function(){return g})),n.d(t,"g",(function(){return m})),n.d(t,"h",(function(){return p})),n.d(t,"i",(function(){return y})),n.d(t,"j",(function(){return b}));var i=n(3),r=n(2),a=n(11),o=n(18),s=n(51),l=n(554);function u(e){var t,n=Object(o.a)(e);return(t=n)&&(Object(s.g)(t)?v(t.rings):Object(s.h)(t)?v(t.paths):Object(s.e)(t)&&f(t.points)),n}function c(e){if(e)for(var t=e.length-1;t>0;--t)e[t][0]-=e[t-1][0],e[t][1]-=e[t-1][1]}function h(e){if(e){var t,n=Object(a.a)(e);try{for(n.s();!(t=n.n()).done;){c(t.value)}}catch(i){n.e(i)}finally{n.f()}}}function f(e){if(e)for(var t=e.length,n=1;n<t;++n)e[n][0]+=e[n-1][0],e[n][1]+=e[n-1][1]}function v(e){if(e){var t,n=Object(a.a)(e);try{for(n.s();!(t=n.n()).done;){f(t.value)}}catch(i){n.e(i)}finally{n.f()}}}function d(e){e&&(Object(s.g)(e)?h(e.rings):Object(s.h)(e)?h(e.paths):Object(s.e)(e)&&c(e.points))}function p(e){if(e){var t,n=Object(a.a)(e);try{for(n.s();!(t=n.n()).done;){y(t.value)}}catch(i){n.e(i)}finally{n.f()}}}function y(e){e&&e.reverse()}function _(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function m(e){return!(!e||0===e.length)&&e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]}function g(e){return e[4]}function b(e,t){e[4]=t}var x=function(){function e(t,n,r,a){Object(i.a)(this,e),this.acceptPolygon=n,this.acceptPolyline=r,this.geomUnitsPerPoint=a,this.pathCount=-1,this.pathIndex=-1,this.iteratePath=!1,t&&(Object(s.g)(t)?n&&(this.multiPath=t.rings,this.isClosed=!0):Object(s.h)(t)?r&&(this.multiPath=t.paths,this.isClosed=!1):Object(s.d)(t)&&n&&(this.multiPath=w(t).rings,this.isClosed=!0),this.multiPath&&(this.pathCount=this.multiPath.length)),this.internalPlacement=new l.a}return Object(r.a)(e,[{key:"next",value:function(){if(!this.multiPath)return null;for(;this.iteratePath||this.pathIndex<this.pathCount-1;){this.iteratePath||this.pathIndex++;var e=this.processPath(this.multiPath[this.pathIndex]);if(e)return e}return this.pathCount=-1,this.pathIndex=-1,this.multiPath=null,null}}]),e}(),O=function(){function e(t,n,r,a){Object(i.a)(this,e),this.inputGeometries=t,this.acceptPolygon=n,this.acceptPolyline=r,this.geomUnitsPerPoint=a,this.pathCount=-1,this.pathIndex=-1,this.iteratePath=!1}return Object(r.a)(e,[{key:"next",value:function(){for(;;){if(!this.multiPath){for(var e=this.inputGeometries.next();e;){if(Object(s.g)(e)?this.acceptPolygon&&(this.multiPath=e.rings,this.isClosed=!0):Object(s.h)(e)?this.acceptPolyline&&(this.multiPath=e.paths,this.isClosed=!1):Object(s.d)(e)&&this.acceptPolygon&&(this.multiPath=w(e).rings,this.isClosed=!0),this.multiPath){this.pathCount=this.multiPath.length,this.pathIndex=-1;break}e=this.inputGeometries.next()}if(!this.multiPath)return null}for(;this.iteratePath||this.pathIndex<this.pathCount-1;){this.iteratePath||this.pathIndex++;var t=this.processPath(this.multiPath[this.pathIndex]);if(t)return t}this.pathCount=-1,this.pathIndex=-1,this.multiPath=null}}}]),e}();function w(e){return{rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}}},547:function(e,t,n){"use strict";function i(){return new Float32Array(4)}function r(e,t,n,i){var r=new Float32Array(4);return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function a(){return i()}function o(){return r(1,1,1,1)}function s(){return r(1,0,0,0)}function l(){return r(0,1,0,0)}function u(){return r(0,0,1,0)}function c(){return r(0,0,0,1)}n.d(t,"a",(function(){return r}));var h=a(),f=o(),v=s(),d=l(),p=u(),y=c();Object.freeze({__proto__:null,create:i,clone:function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},fromValues:r,createView:function(e,t){return new Float32Array(e,t,4)},zeros:a,ones:o,unitX:s,unitY:l,unitZ:u,unitW:c,ZEROS:h,ONES:f,UNIT_X:v,UNIT_Y:d,UNIT_Z:p,UNIT_W:y})},548:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return r}));var i=n(583);function r(e){var t="";for(var n in e){var i=e[n];if("boolean"==typeof i)i&&(t+="#define ".concat(n,"\n"));else if("number"==typeof i)t+="#define ".concat(n," ").concat(i.toFixed(),"\n");else if("object"==typeof i){var r=i.options,a=0;for(var o in r)t+="#define ".concat(r[o]," ").concat((a++).toFixed(),"\n");t+="#define ".concat(n," ").concat(r[i.value],"\n")}}return t}function a(e,t,n,r){n=n||{},r=r||"";var a="function"==typeof t.shaders?t.shaders(n):t.shaders;return new i.a(e,r+a.vertexShader,r+a.fragmentShader,t.attributes)}},550:function(e,t,n){"use strict";var i,r;function a(e){switch(e){case"left":return i.Left;case"right":return i.Right;case"center":case"justify":return i.Center}}function o(e){switch(e){case"top":return r.Top;case"middle":return r.Center;case"baseline":return r.Baseline;case"bottom":return r.Bottom}}function s(e){switch(e){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[i.Right,r.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter"
1:case"esriServerLinePlacementAboveAlong":return[i.Center,r.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[i.Left,r.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[i.Right,r.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[i.Center,r.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[i.Left,r.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[i.Right,r.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[i.Center,r.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[i.Left,r.Top];default:return console.debug("Found invalid placement type ".concat(e)),[i.Center,r.Center]}}function l(e){switch(e){case i.Right:return-1;case i.Center:return 0;case i.Left:return 1;default:return console.debug("Found invalid horizontal alignment ".concat(e)),0}}function u(e){switch(e){case r.Top:return 1;case r.Center:return 0;case r.Bottom:case r.Baseline:return-1;default:return console.debug("Found invalid vertical alignment ".concat(e)),0}}function c(e){switch(e){case"left":return i.Left;case"right":return i.Right;case"center":case"justify":return i.Center}}n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return a})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return o})),n.d(t,"h",(function(){return u})),function(e){e[e.Left=-1]="Left",e[e.Center=0]="Center",e[e.Right=1]="Right"}(i||(i={})),function(e){e[e.Top=1]="Top",e[e.Center=0]="Center",e[e.Bottom=-1]="Bottom",e[e.Baseline=2]="Baseline"}(r||(r={}))},552:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(558),r={shaders:{vertexShader:Object(i.a)("background/background.vert"),fragmentShader:Object(i.a)("background/background.frag")},attributes:new Map([["a_pos",0]])}},553:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return s}));Number.POSITIVE_INFINITY;var i=Math.PI,r=128/i,a=1/Math.LN2;function o(e,t){return(e%=t)>=0?e:e+t}function s(e){return o(e*r,256)}function l(e){return o(.7111111111111111*e,256)}function u(e){return Math.log(e)*a}function c(e,t,n){return e>=t&&e<=n||e>=n&&e<=t}},554:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(3),r=n(2),a=function(){function e(){Object(i.a)(this,e),this.setIdentity()}return Object(r.a)(e,[{key:"getAngle",value:function(){return(null==this.rz||0===this.rz&&1!==this.rz_c&&0!==this.rz_s)&&(this.rz=M
1ath.atan2(this.rz_s,this.rz_c)),this.rz}},{key:"setIdentity",value:function(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rz_c=1,this.rz_s=0}},{key:"setTranslate",value:function(e,t){this.tx=e,this.ty=t}},{key:"setTranslateZ",value:function(e){this.tz=e}},{key:"setRotateCS",value:function(e,t){this.rz=void 0,this.rz_c=e,this.rz_s=t}},{key:"setRotate",value:function(e){this.rz=e,this.rz_c=void 0,this.rz_s=void 0}},{key:"setRotateY",value:function(e){this.ry=e}},{key:"setScale",value:function(e){this.s=e}},{key:"setMeasure",value:function(e){this.m=e}}]),e}()},555:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=new(n(620).a);function r(e){return i.hasBidiChar(e)?(t="rtl"===i.checkContextual(e)?"IDNNN":"ICNNN",[i.bidiTransform(e,t,"VLYSN"),!0]):[e,!1];var t}},556:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(3),r=n(2),a=n(538),o=n(537),s=function(){function e(t,n){Object(i.a)(this,e),this.rctx=t,this._vertexBuffer=a.a.createVertex(t,35044,new Uint16Array(n)),this._vao=new o.a(t,new Map([["a_position",0]]),{geometry:[{name:"a_position",count:2,type:5122,offset:0,stride:4,normalized:!1}]},{geometry:this._vertexBuffer}),this._count=n.length/2}return Object(r.a)(e,[{key:"bind",value:function(){this._vao.bind()}},{key:"unbind",value:function(){this._vao.unbind()}},{key:"dispose",value:function(){this._vao.dispose(!1),this._vertexBuffer.dispose()}},{key:"draw",value:function(){this.rctx.bindVAO(this._vao),this.rctx.drawArrays(5,0,this._count)}}]),e}()},558:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n(538),n(541),n(12),n(543),n(542),n(544);var i=n(577),r=(n(539),n(537),{background:{"background.frag":"uniform lowp vec4 u_color;\nvoid main() {\ngl_FragColor = u_color;\n}","background.vert":"attribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform mediump vec2 u_coord_range;\nuniform mediump float u_depth;\nvoid main() {\nvec3 v_pos = u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0);\ngl_Position = vec4(v_pos.xy, 0.0, 1.0);\n}"},bitBlit:{"bitBlit.frag":"uniform lowp sampler2D u_tex;\nuniform lowp float u_opacity;\nvarying mediump vec2 v_uv;\nvoid main() {\nlowp vec4 color = texture2D(u_tex, v_uv);\ngl_FragColor = color *  u_opacity;\n}","bitBlit.vert":"attribute vec2 a_pos;\nattribute vec2 a_tex;\nvarying mediump vec2 v_uv;\nvoid main(void) {\ngl_Position = vec4(a_pos, 0.0, 1.0);\nv_uv = a_tex;\n}"},blend:{"blend.frag":"precision mediump float;\nuniform sampler2D u_layerTexture;\nuniform lowp float u_opacity;\nuniform lowp float u_inFadeOpacity;\n#ifndef NORMAL\nuniform sampler2D u_backbufferTexture;\n#endif\nvarying mediump vec2 v_uv;\nfloat rgb2v(in vec3 c) {\nreturn max(c.x, max(c.y, c.z));\n}\nvec3 rgb2hsv(in vec3 c) {\nvec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\nvec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\nfloat d = q.x - min(q.w, q.y);\nfloat e = 1.0e-10;\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);\n}\nvec3 hsv2rgb(in vec3 c) {\nvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\nreturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\nvec3 tint(in vec3 Cb, in vec3 Cs) {\nfloat vIn = rgb2v(Cb);\nvec3 hsvTint = rgb2hsv(Cs);\nvec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);\nreturn hsv2rgb(hsvOut);\n}\nfloat overlay(in float Cb, in float Cs) {\nreturn (1.0 - step(0.5, Cs)) * (1.0 - 2.0 * (1.0 - Cs ) * (1.0 - Cb)) + step(0.5, Cs) * (2.0 * Cs * Cb);\n}\nfloat colorDodge(in float Cb, in float Cs) {\nreturn (Cb == 0.0) ? 0.0 : (Cs == 1.0) ? 1.0 : min(1.0, Cb / (1.0 - Cs));\n}\nfloat colorBurn(in float Cb, in float Cs) {\nreturn (Cb == 1.0) ? 1.0 : (Cs == 0.0) ? 0.0 : 1.0 - min(1.0, (1.0 - Cb) / Cs);\n}\nfloat hardLight(in float Cb, in float Cs) {\nreturn (1.0 - step(0.5, Cs)) * (2.0 * Cs * Cb) + step(0.5, Cs) * (1.0 - 2.0 * (1.0 - Cs) * (1.0 - Cb));\n}\nfloat reflectBlend(in float Cb, in float Cs) {\nreturn (Cs == 1.0) ? Cs : min(Cb * Cb / (1.0 - Cs), 1.0);\n}
1\nfloat softLight(in float Cb, in float Cs) {\nif (Cs <= 0.5) {\nreturn Cb - (1.0 - 2.0 * Cs) * Cb * (1.0 - Cb);\n}\nif (Cb <= 0.25) {\nreturn Cb + (2.0 * Cs - 1.0) * Cb * ((16.0 * Cb - 12.0) * Cb + 3.0);\n}\nreturn Cb + (2.0 * Cs - 1.0) * (sqrt(Cb) - Cb);\n}\nfloat vividLight(in float Cb, in float Cs) {\nreturn (1.0 - step(0.5, Cs)) * colorBurn(Cb, 2.0 * Cs) + step(0.5, Cs) * colorDodge(Cb, (2.0 * (Cs - 0.5)));\n}\nfloat minv3(in vec3 c) {\nreturn min(min(c.r, c.g), c.b);\n}\nfloat maxv3(in vec3 c) {\nreturn max(max(c.r, c.g), c.b);\n}\nfloat lumv3(in vec3 c) {\nreturn dot(c, vec3(0.3, 0.59, 0.11));\n}\nfloat satv3(vec3 c) {\nreturn maxv3(c) - minv3(c);\n}\nvec3 clipColor(vec3 color) {\nfloat lum = lumv3(color);\nfloat mincol = minv3(color);\nfloat maxcol = maxv3(color);\nif (mincol < 0.0) {\ncolor = lum + ((color - lum) * lum) / (lum - mincol);\n}\nif (maxcol > 1.0) {\ncolor = lum + ((color - lum) * (1.0 - lum)) / (maxcol - lum);\n}\nreturn color;\n}\nvec3 setLum(vec3 cbase, vec3 clum) {\nfloat lbase = lumv3(cbase);\nfloat llum = lumv3(clum);\nfloat ldiff = llum - lbase;\nvec3 color = cbase + vec3(ldiff);\nreturn clipColor(color);\n}\nvec3 setLumSat(vec3 cbase, vec3 csat, vec3 clum)\n{\nfloat minbase = minv3(cbase);\nfloat sbase = satv3(cbase);\nfloat ssat = satv3(csat);\nvec3 color;\nif (sbase > 0.0) {\ncolor = (cbase - minbase) * ssat / sbase;\n} else {\ncolor = vec3(0.0);\n}\nreturn setLum(color, clum);\n}\nvoid main() {\nvec4 src = texture2D(u_layerTexture, v_uv);\n#ifdef NORMAL\ngl_FragColor = src *  u_opacity;\n#else\nvec4 dst = texture2D(u_backbufferTexture, v_uv);\nvec3 Cs = src.a == 0.0 ? src.rgb : vec3(src.rgb / src.a);\nvec3 Cb = dst.a == 0.0 ? dst.rgb : vec3(dst.rgb / dst.a);\nfloat as = u_opacity * src.a;\nfloat ab = dst.a;\n#ifdef DESTINATION_OVER\ngl_FragColor = vec4(as * Cs * (1.0 - ab) + ab * Cb, as + ab - as * ab);\n#endif\n#ifdef SOURCE_IN\nvec4 color = vec4(as * Cs * ab, as * ab);\nvec4 fadeColor = (1.0 - u_opacity) * u_inFadeOpacity * vec4(ab * Cb, ab);\ngl_FragColor = color + fadeColor;\n#endif\n#ifdef DESTINATION_IN\nvec4 color = vec4(ab * Cb * as, ab * as);\nvec4 fadeColor = (1.0 - u_opacity) * u_inFadeOpacity * vec4(ab * Cb, ab);\ngl_FragColor = color + fadeColor;\n#endif\n#ifdef SOURCE_OUT\ngl_FragColor = vec4(as * Cs * (1.0 - ab), as * (1.0 - ab));\n#endif\n#ifdef DESTINATION_OUT\ngl_FragColor = vec4(ab * Cb * (1.0 - as), ab * (1.0 - as));\n#endif\n#ifdef SOURCE_ATOP\ngl_FragColor = vec4(as * Cs * ab + ab * Cb * (1.0 - as), ab);\n#endif\n#ifdef DESTINATION_ATOP\ngl_FragColor = vec4(as * Cs * (1.0 - ab) + ab * Cb * as, as);\n#endif\n#ifdef XOR\ngl_FragColor = vec4(as * Cs * (1.0 - ab) + ab * Cb * (1.0 - as),\nas * (1.0 - ab) + ab * (1.0 - as));\n#endif\n#ifdef MULTIPLY\ngl_FragColor = vec4(as * Cs * ab * Cb + (1.0 - ab) * as * Cs + (1.0 - as) * ab * Cb,\nas + ab * (1.0 - as));\n#endif\n#ifdef SCREEN\ngl_FragColor = vec4((Cs + Cb - Cs * Cb) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef OVERLAY\nvec3 f = vec3(overlay(Cb.r, Cs.r), overlay(Cb.g, Cs.g), overlay(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef DARKEN\ngl_FragColor = vec4(min(Cs, Cb) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef LIGHTER\ngl_FragColor = vec4(as * Cs + ab * Cb, as + ab);\n#endif\n#ifdef LIGHTEN\ngl_FragColor = vec4(max(Cs, Cb) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef COLOR_DODGE\nvec3 f = vec3(colorDodge(Cb.r, Cs.r), colorDodge(Cb.g, Cs.g), colorDodge(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef COLOR_BURN\nvec3 f = vec3(colorBurn(Cb.r, Cs.r), colorBurn(Cb.g, Cs.g), colorBurn(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef HARD_LIGHT\nvec3 f = vec3(hardLight(Cb.r, Cs.r), hardLight(Cb.g, Cs.g), hardLight(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef SOFT_LIGHT\nvec3 f = vec3(softLight(Cb.r, Cs.r), softLight(Cb.g, Cs.g), softLight(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef DIFFERENCE\ngl_FragColor = vec4(abs(Cb - Cs) * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef EXCLUSION\nvec3 f = Cs + Cb - 2.0 * Cs * Cb;\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef INVERT\ngl_FragColor = vec4((1.0 - Cb) * as * ab + Cb * ab * (1.0 - as), ab);\n#endif\n#ifdef VIVID_LIGHT\nvec3 f = vec3(vividLight(Cb.r, Cs.r),\nvividLight(Cb.g, Cs.g),\nvividLight(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef HUE\nvec3 f = setLumSat(Cs,Cb,Cb);\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef SATURATION\nvec3 f = setLumSat(Cb,Cs,Cb);\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef COLOR\nvec3 f = setLum(Cs,Cb);\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef LUMINOSITY\nvec3 f = setLum(Cb,Cs);\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef PLUS\ngl_FragColor = clamp(vec4(src.r + Cb.r, src.g + Cb.g, src.b + Cb.b, as + ab), 0.0, 1.0);\n#endif\n#ifdef MINUS\ngl_FragColor = vec4(clamp(vec3(Cb.r - src.r, Cb.g - src.g, Cb.b - src.b), 0.0, 1.0), ab * as);\n#endif\n#ifdef AVERAGE\nvec3 f = (Cb + Cs) / 2.0;\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#ifdef REFLECT\nvec3 f = vec3(reflectBlend(Cb.r, Cs.r),\nreflectBlend(Cb.g, Cs.g),\nreflectBlend(Cb.b, Cs.b));\ngl_FragColor = vec4(f * as * ab + Cs * as * (1.0 - ab) + Cb * ab *(1.0 - as),\nas + ab * (1.0 - as));\n#endif\n#endif\n}","blend.vert":"attribute vec2 a_position;\nvarying mediump vec2 v_uv;\nvoid main(void) {\ngl_Position = vec4(a_position , 0.0, 1.0);\nv_uv = (a_position + 1.0) / 2.0;\n}"},filtering:{"bicubic.glsl":"vec4 computeWeights(float v) {\nfloat b = 1.0 / 6.0;\nfloat v2 = v * v;\nfloat v3 = v2 * v;\nfloat w0 = b * (-v3 + 3.0 * v2 - 3.0 * v + 1.0);\nfloat w1 = b * (3.0 * v3  - 6.0 * v2 + 4.0);\nfloat w2 = b * (-3.0 * v3 + 3.0 * v2 + 3.0 * v + 1.0);\nfloat w3 = b * v3;\nreturn vec4(w0, w1, w2, w3);\n}\nvec4 bicubicOffsetsAndWeights(float v) {\nvec4 w = computeWeights(v);\nfloat g0 = w.x + w.y;\nfloat g1 = w.z + w.w;\nfloat h0 = 1.0 - (w.y / g0) + v;\nfloat h1 = 1.0 + (w.w / g1) - v;\nreturn vec4(h0, h1, g0, g1);\n}\nvec4 sampleBicubicBSpline(sampler2D sampler, vec2 coords, vec2 texSize) {\nvec2 eX = vec2(1.0 / texSize.x, 0.0
1);\nvec2 eY = vec2(0.0, 1.0 / texSize.y);\nvec2 texel = coords * texSize - 0.5;\nvec3 hgX = bicubicOffsetsAndWeights(fract(texel).x).xyz;\nvec3 hgY = bicubicOffsetsAndWeights(fract(texel).y).xyz;\nvec2 coords10 = coords + hgX.x * eX;\nvec2 coords00 = coords - hgX.y * eX;\nvec2 coords11 = coords10 + hgY.x * eY;\nvec2 coords01 = coords00 + hgY.x * eY;\ncoords10 = coords10 - hgY.y * eY;\ncoords00 = coords00 - hgY.y * eY;\nvec4 color00 = texture2D(sampler, coords00);\nvec4 color10 = texture2D(sampler, coords10);\nvec4 color01 = texture2D(sampler, coords01);\nvec4 color11 = texture2D(sampler, coords11);\ncolor00 = mix(color00, color01, hgY.z);\ncolor10 = mix(color10, color11, hgY.z);\ncolor00 = mix(color00, color10, hgX.z);\nreturn color00;\n}","bilinear.glsl":"vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) {\nvec2 texelStart = floor(coords * texSize);\nvec2 coord0 = texelStart / texSize;\nvec2 coord1 = (texelStart +  vec2(1.0, 0.0)) / texSize;\nvec2 coord2 = (texelStart +  vec2(0.0, 1.0)) / texSize;\nvec2 coord3 = (texelStart +  vec2(1.0, 1.0)) / texSize;\nvec4 color0 = texture2D(sampler, coord0);\nvec4 color1 = texture2D(sampler, coord1);\nvec4 color2 = texture2D(sampler, coord2);\nvec4 color3 = texture2D(sampler, coord3);\nvec2 blend = fract(coords * texSize);\nvec4 color01 = mix(color0, color1, blend.x);\nvec4 color23 = mix(color2, color3, blend.x);\nvec4 color = mix(color01, color23, blend.y);\n#ifdef NNEDGE\nfloat alpha = floor(color0.a * color1.a * color2.a * color3.a + 0.5);\ncolor = color * alpha + (1.0 - alpha) * texture2D(sampler, coords);\n#endif\nreturn color;\n}","epx.glsl":"vec4 sampleEPX(sampler2D sampler, float size, vec2 coords, vec2 texSize) {\nvec2 invSize = 1.0 / texSize;\nvec2 texel = coords * texSize;\nvec2 texel_i = floor(texel);\nvec2 texel_frac = fract(texel);\nvec4 colorP = texture2D(sampler, texel_i * invSize);\nvec4 colorP1 = vec4(colorP);\nvec4 colorP2 = vec4(colorP);\nvec4 colorP3 = vec4(colorP);\nvec4 colorP4 = vec4(colorP);\nvec4 colorA = texture2D(sampler, (texel_i - vec2(0.0, 1.0)) * invSize);\nvec4 colorB = texture2D(sampler, (texel_i + vec2(1.0, 0.0)) * invSize);\nvec4 colorC = texture2D(sampler, (texel_i - vec2(1.0, 0.0)) * invSize);\nvec4 colorD = texture2D(sampler, (texel_i + vec2(0.0, 1.0)) * invSize);\nif (colorC == colorA && colorC != colorD && colorA != colorB) {\ncolorP1 = colorA;\n}\nif (colorA == colorB && colorA != colorC && colorB != colorD) {\ncolorP2 = colorB;\n}\nif (colorD == colorC && colorD != colorB && colorC != colorA) {\ncolorP3 = colorC;\n}\nif (colorB == colorD && colorB != colorA && colorD != colorC) {\ncolorP4 = colorD;\n}\nvec4 colorP12 = mix(colorP1, colorP2, texel_frac.x);\nvec4 colorP34 = mix(colorP1, colorP2, texel_frac.x);\nreturn mix(colorP12, colorP34, texel_frac.y);\n}"},fx:{integrate:{"integrate.frag":"precision mediump float;\nuniform lowp sampler2D u_sourceTexture;\nuniform lowp sampler2D u_maskTexture;\nuniform mediump float u_zoomLevel;\nuniform highp float u_timeDelta;\nuniform highp float u_animationTime;\nvarying highp vec2 v_texcoord;\n#include <materials/utils.glsl>\nvoid main()\n{\n#ifdef DELTA\nvec4 texel = texture2D(u_sourceTexture, v_texcoord);\nvec4 data0 = texture2D(u_maskTexture, v_texcoord);\nfloat flags = data0.r * 255.0;\nfloat groupMinZoom = data0.g * 255.0;\nfloat isVisible = getFilterBit(flags, 0);\nfloat wouldClip = step(groupMinZoom, u_zoomLevel);\nfloat direction = wouldClip * 1.0 + (1.0 - wouldClip) * -1.0;\nfloat dt = u_timeDelta / max(u_animationTime, 0.0001);\nvec4 nextState = vec4(texel + direction * dt);\ngl_FragColor =  vec4(nextState);\n#elif defined(UPDATE)\nvec4 texel = texture2D(u_sourceTexture, v_texcoord);\ngl_FragColor = texel;\n#endif\n}","integrate.vert":"precision mediump float;\nattribute vec2 a_pos;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_pos;\ngl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);\n}"}},highlight:{"blur.frag":"varying mediump vec2 v_texcoord;\nuniform mediump vec4 u_direction;\nuniform mediump mat4 u_channelSelector;\nuniform mediump float u_sigma;\nuniform sampler2D u_texture;\nmediump float gauss1(mediump vec2 dir) {\nreturn exp(-dot(dir, dir) / (2.0 * u_sigma * u_sigma));\n}\nmediump vec4 selectChannel(mediump vec4 sample) {\nreturn u_channelSelector * sample;\n}\nvoid accumGauss1(mediump float i, inout mediump float tot, inout mediump float weight) {\nmediump float w = gauss1(i * u_direction.xy);\ntot += selectChannel(texture2D(u_texture, v_texcoord + i * u_direction.zw))[3] * w;\nweight += w;\n}\nvoid main(void) {\nmediump float tot = 0.0;\nmediump float weight = 0.0;\naccumGauss1(-5.0, tot, weight);\naccumGauss1(-4.0, tot, weight);\naccumGauss1(-3.0, tot, weight);\naccumGauss1(-2.0, tot, weight);\naccumGauss1(-1.0, tot, weight);\naccumGauss1(0.0, tot, weight);\naccumGauss1(1.0, tot, weight);\naccumGauss1(2.0, tot, weight);\naccumGauss1(3.0, tot, weight);\naccumGauss1(4.0, tot, weight);\naccumGauss1(5.0, tot, weight);\ngl_FragColor = vec4(0.0, 0.0, 0.0, tot / weight);\n}","highlight.frag":"varying mediump vec2 v_texcoord;\nuniform sampler2D u_texture;\nuniform mediump float u_sigma;\nuniform sampler2D u_shade;\nuniform mediump vec2 u_minMaxDistance;\nmediump float estimateDistance() {\nmediump float y = texture2D(u_texture, v_texcoord)[3];\nconst mediump float y0 = 0.5;\nmediump float m0 = 1.0 / (sqrt(2.0 * 3.1415) * u_sigma);\nmediump float d = (y - y0) / m0;\nreturn d;\n}\nmediump vec4 shade(mediump float d) {\nmediump float mappedDistance = (d - u_minMaxDistance.x) / (u_minMaxDistance.y - u_minMaxDistance.x);\nmappedDistance = clamp(mappedDistance, 0.0, 1.0);\nreturn texture2D(u_shade, vec2(mappedDistance, 0.5));\n}\nvoid main(void) {\nmediump float d = estimateDistance();
1\ngl_FragColor = shade(d);\n}","textured.vert":"attribute mediump vec2 a_position;\nattribute mediump vec2 a_texcoord;\nvarying mediump vec2 v_texcoord;\nvoid main(void) {\ngl_Position = vec4(a_position, 0.0, 1.0);\nv_texcoord = a_texcoord;\n}"},magnifier:{"magnifier.frag":"uniform lowp vec4 u_background;\nuniform mediump sampler2D u_readbackTexture;\nuniform mediump sampler2D u_maskTexture;\nuniform mediump sampler2D u_overlayTexture;\nuniform bool u_maskEnabled;\nuniform bool u_overlayEnabled;\nvarying mediump vec2 v_texCoord;\nconst lowp float barrelFactor = 1.1;\nlowp vec2 barrel(lowp vec2 uv) {\nlowp vec2 uvn = uv * 2.0 - 1.0;\nif (uvn.x == 0.0 && uvn.y == 0.0) {\nreturn vec2(0.5, 0.5);\n}\nlowp float theta = atan(uvn.y, uvn.x);\nlowp float r = pow(length(uvn), barrelFactor);\nreturn r * vec2(cos(theta), sin(theta)) * 0.5 + 0.5;\n}\nvoid main(void)\n{\nlowp vec4 color = texture2D(u_readbackTexture, barrel(v_texCoord));\ncolor = (color + (1.0 - color.a) * u_background);\nlowp float mask = u_maskEnabled ? texture2D(u_maskTexture, v_texCoord).a : 1.0;\ncolor *= mask;\nlowp vec4 overlayColor = u_overlayEnabled ? texture2D(u_overlayTexture, v_texCoord) : vec4(0);\ngl_FragColor = overlayColor + (1.0 - overlayColor.a) * color;\n}","magnifier.vert":"precision mediump float;\nattribute mediump vec2 a_pos;\nuniform mediump vec4 u_drawPos;\nvarying mediump vec2 v_texCoord;\nvoid main(void)\n{\nv_texCoord = a_pos;\ngl_Position = vec4(u_drawPos.xy + vec2(a_pos - 0.5) * u_drawPos.zw, 0.0, 1.0);\n}"},materials:{"attributeData.glsl":"uniform highp sampler2D u_attributeData0;\nuniform highp sampler2D u_attributeData1;\nuniform highp sampler2D u_attributeData2;\nuniform highp sampler2D u_attributeData3;\nuniform highp int u_attributeTextureSize;\nhighp vec2 getAttributeDataCoords(in highp vec3 id) {\nhighp vec3  texel = unpackDisplayIdTexel(id);\nhighp float size = float(u_attributeTextureSize);\nhighp float u32 = float(int(texel.r) + int(texel.g) * 256 + int(texel.b) * 256 * 256);\nhighp float col = mod(u32, size);\nhighp float row = (u32 - col) / size;\nhighp float u = col / size;\nhighp float v = row / size;\nreturn vec2(u, v);\n}\nhighp vec4 getAttributeData0(in highp vec3 id) {\nvec2 coords = getAttributeDataCoords(id);\nreturn texture2D(u_attributeData0, coords);\n}\nhighp vec4 getAttributeData1(in highp vec3 id) {\nhighp vec2 coords = getAttributeDataCoords(id);\nreturn texture2D(u_attributeData1, coords);\n}\nhighp vec4 getAttributeData2(in highp vec3 id) {\nhighp vec2 coords = getAttributeDataCoords(id);\nreturn texture2D(u_attributeData2, coords);\n}\nhighp vec4 getAttributeData3(in highp vec3 id) {\nhighp vec2 coords = getAttributeDataCoords(id);\nreturn texture2D(u_attributeData3, coords);\n}\nfloat u88VVToFloat(in vec2 v) {\nbool isMagic = v.x == 255.0 && v.y == 255.0;\nif (isMagic) {\nreturn NAN_MAGIC_NUMBER;\n}\nreturn (v.x + v.y * float(0x100)) - 32768.0;\n}","constants.glsl":"const float C_DEG_TO_RAD = 3.14159265359 / 180.0;\nconst float C_256_TO_RAD = 3.14159265359 / 128.0;\nconst float SIGNED_BYTE_TO_UNSIGNED = 128.0;\nconst float POSITION_PRECISION = 1.0 / 8.0;\nconst float FILL_POSITION_PRECISION = 1.0 / 1.0;\nconst float SOFT_EDGE_RATIO = 1.0;\nconst float THIN_LINE_WIDTH_FACTOR = 1.1;\nconst float THIN_LINE_HALF_WIDTH = 1.0;\nconst float EXTRUDE_SCALE_PLACEMENT_PADDING = 1.0 / 4.0;\nconst float OFFSET_PRECISION = 1.0 / 8.0;\nconst float OUTLINE_SCALE = 1.0 / 5.0;\nconst float SDF_FONT_SIZE = 24.0;\nconst float MAX_SDF_DISTANCE = 8.0;\nconst float PLACEMENT_PADDING = 8.0;\nconst float EPSILON = 0.0000001;\nconst int MAX_FILTER_COUNT = 2;\nconst int ATTR_VV_SIZE = 0;\nconst int ATTR_VV_COLOR = 1;\nconst int ATTR_VV_OPACITY = 2;\nconst int ATTR_VV_ROTATION = 3;\nconst highp float NAN_MAGIC_NUMBER = 1e-30;\nconst int BITSET_GENERIC_LOCK_COLOR = 1;\nconst int BITSET_MARKER_ALIGNMENT_MAP = 0;\nconst int BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE = 2;\nconst int BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY = 3;\nconst int BITSET_TYPE_FILL_OUTLINE = 0;\nconst int BITSET_LINE_SCALE_DASH = 2;",fill:{"common.glsl":"#ifdef PATTERN\nuniform mediump vec2 u_mosaicSize;\n#endif\n#ifdef DOT_DENSITY\nuniform lowp vec4 u_isActive[ 2 ];\nuniform highp float u_dotValue;\nuniform highp float u_tileDotsOverArea;\nuniform highp float u_dotTextureDotCount;\nuniform mediump float u_tileZoomFactor;
1\n#endif\nvarying highp vec3 v_id;\nvarying lowp vec4 v_color;\nvarying lowp float v_opacity;\nvarying mediump vec4 v_aux1;\n#ifdef PATTERN\nvarying mediump vec2 v_tileTextureCoord;\n#endif\n#ifdef OUTLINED_FILL\nvarying lowp float v_isOutline;\n#endif\n#ifdef DOT_DENSITY\nvarying highp vec2 v_dotTextureCoords;\nvarying highp vec4 v_dotThresholds[ 2 ];\n#endif","fill.frag":"precision highp float;\n#include <materials/constants.glsl>\n#include <materials/utils.glsl>\n#include <materials/fill/common.glsl>\n#ifdef PATTERN\nuniform lowp sampler2D u_texture;\n#endif\n#ifdef DOT_DENSITY\nuniform mediump mat4 u_dotColors[ 2 ];\nuniform sampler2D u_dotTextures[ 2 ];\nuniform vec4 u_dotBackgroundColor;\n#endif\n#ifdef OUTLINED_FILL\n#include <materials/shared/line/common.glsl>\n#include <materials/shared/line/line.frag>\nlowp vec4 drawLine() {\nfloat v_lineWidth = v_aux1.x;\nvec2  v_normal    = v_aux1.yz;\nLineData inputs = LineData(\nv_color,\nv_normal,\nv_lineWidth,\nv_opacity,\nv_id\n);\nreturn shadeLine(inputs);\n}\n#endif\nlowp vec4 drawFill() {\nlowp vec4 out_color = vec4(0.);\n#ifdef ID\nout_color = vec4(v_id, 0.0);\n#elif defined(PATTERN)\nmediump vec4 v_tlbr = v_aux1;\nmediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0);\nmediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord);\nlowp vec4 color = texture2D(u_texture, samplePos);\nout_color = v_opacity * v_color * color;\n#elif defined(DOT_DENSITY) && !defined(HIGHLIGHT)\nvec4 textureThresholds0 = texture2D(u_dotTextures[0], v_dotTextureCoords);\nvec4 textureThresholds1 = texture2D(u_dotTextures[1], v_dotTextureCoords);\nvec4 difference0 = v_dotThresholds[0] - textureThresholds0;\nvec4 difference1 = v_dotThresholds[1] - textureThresholds1;\n#ifdef DD_DOT_BLENDING\nvec4 isPositive0 = step(0.0, difference0);\nvec4 isPositive1 = step(0.0, difference1);\nfloat weightSum = dot(isPositive0, difference0) + dot(isPositive1, difference1);\nfloat lessThanEqZero = step(weightSum, 0.0);\nfloat greaterThanZero = 1.0 - lessThanEqZero ;\nfloat divisor = (weightSum + lessThanEqZero);\nvec4 weights0 = difference0 * isPositive0 / divisor;\nvec4 weights1 = difference1 * isPositive1 / divisor;\nvec4 dotColor = u_dotColors[0] * weights0 + u_dotColors[1] * weights1;\nvec4 preEffectColor = greaterThanZero * dotColor + lessThanEqZero * u_dotBackgroundColor;\n#else\nfloat diffMax = max(max4(difference0), max4(difference1));\nfloat lessThanZero = step(diffMax, 0.0);\nfloat greaterOrEqZero = 1.0 - lessThanZero;\nvec4 isMax0 = step(diffMax, difference0);\nvec4 isMax1 = step(diffMax, difference1);\nvec4 dotColor = u_dotColors[0] * isMax0 + u_dotColors[1] * isMax1;\nvec4 preEffectColor = greaterOrEqZero * dotColor + lessThanZero * u_dotBackgroundColor;\n#endif\nout_color = preEffectColor;\n#else\nout_color = v_opacity * v_color;\n#endif\n#ifdef HIGHLIGHT\nout_color.a = 1.0;\n#endif\nreturn out_color;\n}\nvoid main() {\n#ifdef OUTLINED_FILL\nif (v_isOutline > 0.5) {\ngl_FragColor = drawLine();\n} else {\ngl_FragColor = drawFill();\n}\n#else\ngl_FragColor = drawFill();\n#endif\n}","fill.vert":"#define PACKED_LINE\nprecision highp float;\nattribute float a_bitset;\n#ifdef DOT_DENSITY\nattribute float a_inverseArea;\nvec4 a_color = vec4(0.0, 0.0, 0.0, 1.0);\nvec2 a_zoomRange = vec2(0.0, 10000.0);\n#else\nattribute vec4 a_color;\nattribute vec4 a_aux2;\nattribute vec4 a_aux3;\n#ifndef SIMPLE\nattribute vec4 a_aux1;\nattribute vec2 a_zoomRange;\n#else\nvec2 a_zoomRange = vec2(0.0, 10000.0);\n#endif\n#endif\nuniform vec2 u_tileOffset;\n#include <materials/vcommon.glsl>\n#include <materials/fill/common.glsl>\n#ifdef DOT_DENSITY\nvec4 dotThreshold(vec4 featureAttrOverFeatureArea, float dotValue, float tileDotsOverArea) {\nreturn featureAttrOverFeatureArea * (1.0 / dotValue)  * (1.0 / tileDotsOverArea);\n}\n#endif\n#ifdef OUTLINED_FILL\n#include <materials/shared/line/common.glsl>\n#include <materials/shared/line/line.vert>\nvoid drawLine(out lowp vec4 out_color, out highp vec3 out_pos) {\nLineData outputs = buildLine(\nout_pos,\na_id,\na_pos,\na_color,\n(a_aux3.xy - 128.) / 16.,\n(a_aux3.zw - 128.) / 16.,\n0.,\na_aux2.z / 16.,\na_bitset,\nvec4(0.),\nvec2(0.),\na_aux2.w / 16.\n);\nv_id      = outputs.id;\nv_color   = outputs.color;\nv_opacity = outputs.opacity;
1\nv_aux1    = vec4(outputs.lineHalfWidth, outputs.normal, 0.);\nout_color = outputs.color;\n}\n#endif\nvoid drawFill(out lowp vec4 out_color, out highp vec3 out_pos) {\nfloat a_bitSet = a_bitset;\nv_color   = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR);\nv_opacity = getOpacity();\nv_id      = norm(a_id);\nout_color = v_color;\nout_pos   = u_dvsMat3 * vec3(a_pos * FILL_POSITION_PRECISION, 1.);\n#ifdef PATTERN\nvec4  a_tlbr   = a_aux1;\nfloat a_width  = a_aux2.x;\nfloat a_height = a_aux2.y;\nvec2  a_offset = a_aux2.zw;\nvec2  a_scale  = a_aux3.xy;\nfloat a_angle  = a_aux3.z;\nvec2 scale = (1.0 / SIGNED_BYTE_TO_UNSIGNED) * a_scale;\nfloat width = u_pixelRatio * u_zoomFactor * a_width * scale.x;\nfloat height = u_pixelRatio * u_zoomFactor * a_height * scale.y;\nfloat angle = C_256_TO_RAD * a_angle;\nfloat sinA = sin(angle);\nfloat cosA = cos(angle);\nmat3 patternMatrix = mat3(cosA / width, sinA / height, 0,\n-sinA / width, cosA / height, 0,\n0,            0,             1);\nvec2 tileOffset = vec2(u_tileOffset.x * cosA - u_tileOffset.y * sinA, u_tileOffset.x * sinA + u_tileOffset.y * cosA);\ntileOffset = mod(tileOffset, vec2(a_aux2.x, a_aux2.y));\nvec2 symbolOffset = (a_offset - tileOffset - SIGNED_BYTE_TO_UNSIGNED) / vec2(width, height);\nv_tileTextureCoord = (patternMatrix * vec3(a_pos * FILL_POSITION_PRECISION, 1.0)).xy - symbolOffset;\nv_aux1 = a_tlbr / u_mosaicSize.xyxy;\n#elif defined(DOT_DENSITY)\nvec4 ddAttributeData0 = getAttributeData2(a_id) * u_isActive[0] * a_inverseArea;\nvec4 ddAttributeData1 = getAttributeData3(a_id) * u_isActive[1] * a_inverseArea;\nfloat size = u_tileZoomFactor * 512.0 * 1.0 / u_pixelRatio;\nv_dotThresholds[0] = dotThreshold(ddAttributeData0, u_dotValue, u_tileDotsOverArea);\nv_dotThresholds[1] = dotThreshold(ddAttributeData1, u_dotValue, u_tileDotsOverArea);\nv_dotTextureCoords = (a_pos * FILL_POSITION_PRECISION + 0.5) / size;\n#endif\n}\nvoid main()\n{\nINIT;\nlowp vec4 color = vec4(0.);\nhighp vec3 pos  = vec3(0.);\n#ifdef OUTLINED_FILL\nv_isOutline = getBit(a_bitset, BITSET_TYPE_FILL_OUTLINE);\nif (v_isOutline > 0.5) {\ndrawLine(color, pos);\n} else {\ndrawFill(color, pos);\n}\n#else\ndrawFill(color, pos);\n#endif\ngl_Position = vec4(clip(color, pos, getFilterFlags(), a_zoomRange), 1.0);\n}"},icon:{"common.glsl":"uniform lowp vec2 u_mosaicSize;\nvarying lowp vec4 v_color;\nvarying highp vec3 v_id;\nvarying highp vec4 v_sizeTex;\nvarying mediump vec3 v_pos;\nvarying highp float v_filters;\nvarying lowp float v_opacity;\n#ifdef SDF\nvarying lowp vec4 v_outlineColor;\nvarying mediump float v_outlineWidth;\nvarying mediump float v_distRatio;\nvarying mediump float v_overridingOutlineColor;\nvarying mediump float v_isThin;\n#endif","icon.frag":"precision mediump float;\n#include <materials/constants.glsl>\n#include <materials/utils.glsl>\n#include <util/encoding.glsl>\n#include <materials/constants.glsl>\n#include <materials/icon/common.glsl>\nuniform lowp sampler2D u_texture;\nvoid main()\n{\nvec2 v_size = v_sizeTex.xy;\nvec2 v_tex  = v_sizeTex.zw;\n#ifdef SDF\nlowp vec4 fillPixelColor = v_color;\nfloat d = 0.5 - rgba2float(texture2D(u_texture, v_tex));\nfloat size = max(v_size.x, v_size.y);\nfloat dist = d * size * SOFT_EDGE_RATIO * v_distRatio;\nfillPixelColor *= clamp(0.5 - dist, 0.0, 1.0);\nfloat outlineWidth = v_outlineWidth;\n#ifdef HIGHLIGHT\noutlineWidth = max(outlineWidth, 4.0 * v_isThin);\n#endif\nif (outlineWidth > 0.25) {\nlowp vec4 outlinePixelColor = v_overridingOutlineColor * v_color + (1.0 - v_overridingOutlineColor) * v_outlineColor;\nfloat clampedOutlineSize = min(outlineWidth, size);\noutlinePixelColor *= clamp(0.5 - abs(dist) + clampedOutlineSize * 0.5, 0.0, 1.0);\ngl_FragColor = v_opacity * ((1.0 - outlinePixelColor.a) * fillPixelColor + outlinePixelColor);\n}\nelse {\ngl_FragColor = v_opacity * fillPixelColor;\n}\n#else\nlowp vec4 texColor = texture2D(u_texture, v_tex);\ngl_FragColor = v_opacity * texColor * v_color;\n#endif\n#ifdef HIGHLIGHT\ngl_FragColor.a = step(1.0 / 255.0, gl_FragColor.a);\n#endif\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = vec4(v_id, 0.0);\n#endif\n}","icon.vert":"precision highp float;\nattribute vec4 a_color;\nattribute vec4 a_outlineColor;\nattribute vec4 a_sizeAndOutlineWidth;\nattribute vec2 a_vertexOffset;\nattribute vec2 a_texCoords;\nattribute vec2 a_bitSetAndDistRatio;\nattribute vec2 a_zoomRange;\n#include <materials/vcommon.glsl>\n#include <materials/icon/common.glsl>\nvec2 getMarkerSize(inout vec2 offset, inout vec2 baseSize, inout float outlineSize, in float referenceSize, in float bitSet) {\n#ifdef VV_SIZE\nfloat r = getSize(baseSize.y) / referenceSize;\nbaseSize.xy *= r;\noffset.xy *= r;\nfloat scaleSymbolProportionally = getBit(bitSet, BITSET_MARKER_SCALE_SYMBOLS_PROPORTIONALLY);\noutlineSize *= scaleSymbolProportionally * (r - 1.0) + 1.0;\n#endif\nreturn baseSize;\n}\nvec3 getOffset(in vec2 in_offset, float a_bitSet) {\nfloat isMapAligned = getBit(a_bitSet, BITSET_MARKER_ALIGNMENT_MAP);\nvec3  offset       = getRotation() * vec3(in_offset, 0.0);\nreturn getMatrix(isMapAligned) * offset;\n}\nvoid main()\n{\nINIT;\nvec2  a_size   = a_sizeAndOutlineWidth.xy * a_sizeAndOutlineWidth.xy / 128.0;\nvec2  a_offset = a_vertexOffset / 16.0;
1\nfloat a_outlineSize = a_sizeAndOutlineWidth.z * a_sizeAndOutlineWidth.z / 128.0;\nfloat a_bitSet = a_bitSetAndDistRatio.x;\nvec2 v_size = getMarkerSize(a_offset, a_size, a_outlineSize, a_sizeAndOutlineWidth.w * a_sizeAndOutlineWidth.w / 128.0, a_bitSet);\nvec2 v_tex      = a_texCoords / u_mosaicSize;\nv_color    = getColor(a_color, a_bitSet, BITSET_GENERIC_LOCK_COLOR);\nv_opacity  = getOpacity();\nv_id       = norm(a_id);\nv_filters  = getFilterFlags();\nv_pos      = u_dvsMat3 * vec3(a_pos * POSITION_PRECISION, 1.0) + getOffset(a_offset, a_bitSet);\nv_sizeTex  = vec4(v_size.xy, v_tex.xy);\n#ifdef SDF\nv_isThin   = getBit(a_bitSet, BITSET_MARKER_OUTLINE_ALLOW_COLOR_OVERRIDE);\n#ifdef VV_COLOR\nv_overridingOutlineColor = v_isThin;\n#else\nv_overridingOutlineColor = 0.0;\n#endif\nv_outlineWidth = min(a_outlineSize, max(max(v_size.x, v_size.y) - 0.99, 0.0));\nv_outlineColor = a_outlineColor;\nv_distRatio = a_bitSetAndDistRatio.y / 126.0;\n#endif\ngl_Position = vec4(clip(v_color, v_pos, v_filters, a_zoomRange), 1.0);\n}"},label:{"common.glsl":"uniform mediump float u_zoomLevel;\nuniform mediump float u_mapRotation;\nuniform mediump float u_mapAligned;\nuniform mediump vec2 u_mosaicSize;\nvarying mediump float v_antialiasingWidth;\nvarying mediump float v_edgeDistanceOffset;\nvarying mediump vec2 v_tex;\nvarying mediump vec4 v_color;\nvarying lowp vec4 v_animation;","label.frag":"#include <materials/text/text.frag>","label.vert":"precision highp float;\n#include <materials/vcommon.glsl>\n#include <materials/text/common.glsl>\nattribute vec4 a_color;\nattribute vec4 a_haloColor;\nattribute vec4 a_texAndSize;\nattribute vec4 a_refSymbolAndPlacementOffset;\nattribute vec4 a_glyphData;\nattribute vec2 a_vertexOffset;\nattribute vec2 a_texCoords;\nuniform float u_isHalo;\nuniform float u_mapRotation;\nuniform float u_mapAligned;\nfloat getZ(in float minZoom, in float maxZoom, in float angle) {\nfloat glyphAngle = angle * 360.0 / 254.0;\nfloat mapAngle = u_mapRotation * 360.0 / 254.0;\nfloat diffAngle = min(360.0 - abs(mapAngle - glyphAngle), abs(mapAngle - glyphAngle));\nfloat z = 0.0;\nz += u_mapAligned * (2.0 * (1.0 - step(minZoom, u_currentZoom)));\nz += u_mapAligned * 2.0 * step(90.0, diffAngle);\nz += 2.0 * (1.0 - step(u_currentZoom, maxZoom));\nreturn z;\n}\nvoid main()\n{\nINIT;\nfloat groupMinZoom    = getMinZoom();\nfloat glyphMinZoom    = a_glyphData.x;\nfloat glyphMaxZoom    = a_glyphData.y;\nfloat glyphAngle      = a_glyphData.z;\nfloat a_minZoom          = max(groupMinZoom, glyphMinZoom);\nfloat a_placementPadding = a_refSymbolAndPlacementOffset.x * EXTRUDE_SCALE_PLACEMENT_PADDING;\nvec2  a_placementDir     = unpack_u8_nf32(a_refSymbolAndPlacementOffset.zw);\nfloat a_refSymbolSize    = a_refSymbolAndPlacementOffset.y;\nfloat fontSize           = a_texAndSize.z;\nfloat haloSize           = a_texAndSize.w * OUTLINE_SCALE;\nvec2  vertexOffset = a_vertexOffset * OFFSET_PRECISION;\nvec3  pos          = vec3(a_pos * POSITION_PRECISION, 1.0);\nfloat z            = getZ(a_minZoom, glyphMaxZoom, glyphAngle);\nfloat fontScale    = fontSize / SDF_FONT_SIZE;\nfloat halfSize     = getSize(a_refSymbolSize) / 2.0;\nfloat animation    = pow(getAnimationState(), vec4(2.0)).r;\nv_color     = animation * ((1.0 - u_isHalo) * a_color + (u_isHalo * a_haloColor));\nv_opacity   = 1.0;\nv_tex       = a_texCoords / u_mosaicSize;\nv_edgeDistanceOffset = u_isHalo * haloSize / fontScale / MAX_SDF_DISTANCE;\nv_antialiasingWidth  = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio;\nvec2 placementOffset = a_placementDir * (halfSize + a_placementPadding);\nvec3 glyphOffset     = u_displayMat3 * vec3(vertexOffset + placementOffset, 0.0);\nvec3 v_pos           = vec3((u_dvsMat3 * pos + glyphOffset).xy, z);\ngl_Position = vec4(applyFilterLabels(v_color, v_pos, getFilterFlags()), 1.0);\n#ifdef DEBUG\nv_color = vec4(a_color.rgb, z == 0.0 ? 1.0 : 0.645);\n#endif\n}"},line:{"common.glsl":"varying lowp vec4 v_color;\nvarying highp vec3 v_id;\nvarying mediump vec2 v_normal;\nvarying mediump float v_lineHalfWidth;\nvarying lowp float v_opacity;\n#ifdef PATTERN\nvarying mediump vec4 v_tlbr;\nvarying mediump vec2 v_patternSize;\n#endif\n#if defined(PATTERN) || defined(SDF)\nvarying highp float v_accumulatedDistance;\n#endif\n#ifdef SDF\nvarying mediump float v_lineWidthRatio;\n#endif","line.frag":"precision lowp float;\n#include <util/encoding.glsl>\n#include <materials/constants.glsl>\n#include <materials/line/common.glsl>\n#include <materials/shared/line/common.glsl>\n#include <materials/shared/line/line.frag>\nvoid main()\n{\nLineData inputs = LineData(\nv_color,\nv_normal,\nv_lineHalfWidth,\nv_opacity,\n#ifndef OUTLINED_FILL\n#ifdef PATTERN\nv_tlbr,\nv_patternSize,\n#endif\n#ifdef SDF\nv_lineWidthRatio,\n#endif\n#if defined(PATTERN) || defined(SDF)\nv_accumulatedDistance,\n#endif\n#endif\nv_id\n);\ngl_FragColor = shadeLine(inputs);\n}","line.vert":"precision highp float;\nattribute vec4 a_color;\nattribute vec4 a_offsetAndNormal;\nattribute vec2 a_accumulatedDistanceAndHalfWidth;\nattribute vec4 a_tlbr;\nattribute vec4 a_segmentDirection;\nattribute vec2 a_aux;\nattribute vec2 a_zoomRange;\n#include <materials/vcommon.glsl>\n#include <materials/line/common.glsl>\n#include <materials/shared/line/common.glsl>\n#include <materials/shared/line/line.vert>\nvoid main()\n{\nINIT;\nhighp vec3 pos = vec3(0.);\nLineData outputs = buildLine(\npos,\na_id,\na_pos,\na_color,\na_offsetAndNormal.xy / 16.,\na_offsetAndNormal.zw / 16.,\na_accumulatedDistanceAndHalfWidth.x,\na_accumulatedDistanceAndHalfWidth.y / 16.,\na_segmentDirection.w,\na_tlbr,\na_segmentDirection.xy / 16.,\na_aux.x / 16.\n);\nv_id              = outputs.id;\nv_color           = outputs.color;\nv_normal          = outputs.normal;\nv_lineHalfWidth   = outputs.lineHalfWidth;\nv_opacity         = outputs.opacity;\n#ifndef OUTLINED_FILL\n#ifdef PATTERN\nv_tlbr          = outputs.tlbr;\nv_patternSize   = outputs.patternSize;\n#endif\n#ifdef SDF\nv_lineWidthRatio = outputs.lineWidthRatio;\n#endif\n#if defined(PATTERN) || defined(SDF)\nv_accumulatedDistance = outputs.accumulatedDistance;\n#endif\n#endif\ngl_Position = vec4(clip(outputs.color, pos, getFilterFlags(), a_zoomRange), 1.0);\n}"},shared:{line:{"common.glsl":"#if !defined(OUTLINED_FILL) && defined(PATTERN)\nuniform mediump vec2 u_mosaicSize;\n#endif\nstruct LineData {\nlowp vec4 color;\nmediump vec2 normal;\nmediump float lineHalfWidth;
1\nlowp float opacity;\n#ifndef OUTLINED_FILL\n#ifdef PATTERN\nmediump vec4 tlbr;\nmediump vec2 patternSize;\n#endif\n#ifdef SDF\nmediump float lineWidthRatio;\n#endif\n#if defined(PATTERN) || defined(SDF)\nhighp float accumulatedDistance;\n#endif\n#endif\nhighp vec3 id;\n};","line.frag":"uniform lowp float u_blur;\n#if !defined(OUTLINED_FILL) && !defined(HIGHLIGHT)\n#if defined(PATTERN) || defined(SDF)\nuniform sampler2D u_texture;\nuniform highp float u_pixelRatio;\n#endif\n#endif\n#if defined(SDF) && !defined(HIGHLIGHT) && !defined(OUTLINED_FILL)\nlowp vec4 getLineColor(LineData line) {\nmediump float adjustedPatternWidth = line.patternSize.x * 2.0 * line.lineWidthRatio;\nmediump float relativeTexX = fract(u_pixelRatio * line.accumulatedDistance / adjustedPatternWidth);\nmediump float relativeTexY = 0.5 + 0.25 * line.normal.y;\nmediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexX, relativeTexY));\nmediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5;\nfloat dist = d * line.lineHalfWidth;\nreturn line.opacity * clamp(0.5 - dist, 0.0, 1.0) * line.color;\n}\n#elif defined(PATTERN) && !defined(HIGHLIGHT) && !defined(OUTLINED_FILL)\nlowp vec4 getLineColor(LineData line) {\nmediump float lineHalfWidth = line.lineHalfWidth;\nmediump float adjustedPatternWidth = line.patternSize.x * 2.0 * lineHalfWidth / line.patternSize.y;\nmediump float relativeTexX = fract(u_pixelRatio * line.accumulatedDistance / adjustedPatternWidth);\nmediump float relativeTexY = 0.5 + 0.5 * line.normal.y;\nmediump vec2 texCoord = mix(line.tlbr.xy, line.tlbr.zw, vec2(relativeTexY, relativeTexX));\nlowp vec4 color = texture2D(u_texture, texCoord);\nreturn line.opacity * line.color * color;\n}\n#else\nlowp vec4 getLineColor(LineData line) {\nreturn line.opacity * line.color;\n}\n#endif\nvec4 shadeLine(LineData line)\n{\nmediump float thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(line.lineHalfWidth, THIN_LINE_HALF_WIDTH), 1.0);\nmediump float fragDist = length(line.normal) * line.lineHalfWidth;\nlowp float alpha = clamp(thinLineFactor * (line.lineHalfWidth - fragDist) / (u_blur + thinLineFactor - 1.0), 0.0, 1.0);\nlowp vec4 out_color = getLineColor(line) * alpha;\n#ifdef HIGHLIGHT\nout_color.a = step(1.0 / 255.0, out_color.a);\n#endif\n#ifdef ID\nif (out_color.a < 1.0 / 255.0) {\ndiscard;\n}\nout_color = vec4(line.id, 0.0);\n#endif\nreturn out_color;\n}","line.vert":"float getBaseLineHalfWidth(in float lineHalfWidth, in float referenceHalfWidth) {\n#ifdef VV_SIZE\nfloat lineWidth = 2.0 * lineHalfWidth;\nreturn 0.5 * (lineHalfWidth / referenceHalfWidth) * getSize(lineWidth);\n#else\nreturn lineHalfWidth;\n#endif\n}\nfloat getLineHalfWidth(in float baseWidth, in float aa) {\nfloat halfWidth = max(baseWidth + aa, 0.45) + 0.1 * aa;\n#ifdef HIGHLIGHT\nhalfWidth = max(halfWidth, 2.0);\n#endif\nreturn halfWidth;\n}\nvec2 getDist(in vec2 offset, in float halfWidth) {\nfloat thinLineFactor = max(THIN_LINE_WIDTH_FACTOR * step(halfWidth, THIN_LINE_HALF_WIDTH), 1.0);\nreturn thinLineFactor * halfWidth * offset;\n}\nLineData buildLine(\nout vec3 out_pos,\nin vec3 in_id,\nin vec2 in_pos,\nin vec4 in_color,\nin vec2 in_offset,\nin vec2 in_normal,\nin float in_accumulatedDist,\nin float in_lineHalfWidth,\nin float in_bitSet,\nin vec4 in_tlbr,\nin vec2 in_segmentDirection,\nin float in_referenceHalfWidth\n)\n{\nfloat aa        = 0.5 * u_antialiasing;\nfloat baseWidth = getBaseLineHalfWidth(in_lineHalfWidth, in_referenceHalfWidth);\nfloat halfWidth = getLineHalfWidth(baseWidth, aa);\nfloat z         = 2.0 * step(baseWidth, 0.0);\nvec2  dist      = getDist(in_offset, halfWidth);\nvec3  offset    = u_displayViewMat3 * vec3(dist, 0.0);\nvec3  pos       = u_dvsMat3 * vec3(in_pos * POSITION_PRECISION, 1.0) + offset;\n#ifdef OUTLINED_FILL\nvec4  color     = in_color;\nfloat opacity   = 1.0;\n#else\nvec4  color     = getColor(in_color, in_bitSet, 0);\nfloat opacity   = getOpacity();\n#ifdef SDF\nconst float SDF_PATTERN_HALF_WIDTH = 15.5;\nfloat scaleDash = getBit(in_bitSet, BITSET_LINE_SCALE_DASH);\nfloat lineWidthRatio = (scaleDash * max(halfWidth - 0.55 * u_antialiasing, 0.25) + (1.0 - scaleDash)) / SDF_PATTERN_HALF_WIDTH;\n#endif\n#endif\nout_pos = vec3(pos.xy, z);\nreturn LineData(\ncolor,\nin_normal,\nhalfWidth,\nopacity,\n#ifndef OUTLINED_FILL\n#ifdef PATTERN\nin_tlbr / u_mosaicSize.xyxy,\nvec2(in_tlbr.z - in_tlbr.x, in_tlbr.w - in_tlbr.y),\n#endif\n#ifdef SDF\nlineWidthRatio,\n#endif\n#if defined(PATTERN) || defined(SDF)\nin_accumulatedDist * u_zoomFactor + dot(in_segmentDirection, dist),\n#endif\n#endif\nnorm(in_id)\n);\n}"}},text:{"common.glsl":"uniform highp vec2 u_mosaicSize;\nvarying highp vec3 v_id;\nvarying mediump vec3 v_pos;\nvarying lowp float v_opacity;\nvarying lowp vec4 v_color;\nvarying highp vec2 v_tex;\nvarying mediump float v_antialiasingWidth;\nvarying mediump float v_edgeDistanceOffset;\nvarying lowp float v_transparency;","text.frag":"precision mediump float;\n#include <materials/text/common.glsl>\nuniform lowp sampler2D u_texture;\nvoid main()\n{\nfloat SDF_CUTOFF = (2.0 / 8.0);\nfloat SDF_BASE_EDGE_DIST = 1.0 - SDF_CUTOFF;\nlowp float dist = texture2D(u_texture, v_tex).a;\nmediump float edge = SDF_BASE_EDGE_DIST - v_edgeDistanceOffset;\n#ifdef HIGHLIGHT\nedge /= 2.0;\n#endif\nlowp float aa = v_antialiasingWidth;
1\nlowp float alpha = smoothstep(edge - aa, edge + aa, dist);\ngl_FragColor = alpha * v_color * v_opacity;\n#ifdef ID\nif (gl_FragColor.a < 1.0 / 255.0) {\ndiscard;\n}\ngl_FragColor = vec4(v_id, 0.0);\n#endif\n}","text.vert":"precision highp float;\n#include <materials/utils.glsl>\n#include <materials/vcommon.glsl>\n#include <materials/text/common.glsl>\nattribute vec4 a_color;\nattribute vec4 a_haloColor;\nattribute vec4 a_texFontSize;\nattribute vec4 a_aux;\nattribute vec2 a_zoomRange;\nattribute vec2 a_vertexOffset;\nattribute vec2 a_texCoords;\nuniform float u_isHalo;\nfloat getTextSize(inout vec2 offset, inout float baseSize, in float referenceSize) {\n#ifdef VV_SIZE\nfloat r = getSize(baseSize) / referenceSize;\nbaseSize *= r;\noffset.xy *= r;\nreturn baseSize;\n#endif\nreturn baseSize;\n}\nvoid main()\n{\nINIT;\nfloat a_referenceSize = a_aux.z * a_aux.z / 256.0;\nfloat a_bitSet        = a_aux.w;\nfloat a_fontSize      = a_texFontSize.z;\nvec2  a_offset        = a_vertexOffset * OFFSET_PRECISION;\nvec3  in_pos        = vec3(a_pos * POSITION_PRECISION, 1.0);\nfloat fontSize      = getTextSize(a_offset, a_fontSize, a_referenceSize);\nfloat fontScale     = fontSize / SDF_FONT_SIZE;\nvec3  offset        = getRotation() * vec3(a_offset, 0.0);\nmat3  extrudeMatrix = getBit(a_bitSet, 0) == 1.0 ? u_displayViewMat3 : u_displayMat3;\nv_color   = u_isHalo * a_haloColor + (1.0 - u_isHalo) * getColor(a_color, a_bitSet, 1);\nv_opacity = getOpacity();\nv_id      = norm(a_id);\nv_tex     = a_texCoords / u_mosaicSize;\nv_pos     = u_dvsMat3 * in_pos + extrudeMatrix * offset;\nv_edgeDistanceOffset = u_isHalo * OUTLINE_SCALE * a_texFontSize.w / fontScale / MAX_SDF_DISTANCE;\nv_antialiasingWidth  = 0.105 * SDF_FONT_SIZE / fontSize / u_pixelRatio;\ngl_Position =  vec4(clip(v_color, v_pos, getFilterFlags(), a_zoomRange), 1.0);\n}"},"utils.glsl":"float rshift(in float u32, in int amount) {\nreturn floor(u32 / pow(2.0, float(amount)));\n}\nfloat getBit(in float bitset, in int bitIndex) {\nfloat offset = pow(2.0, float(bitIndex));\nreturn mod(floor(bitset / offset), 2.0);\n}\nfloat getFilterBit(in float bitset, in int bitIndex) {\nreturn getBit(bitset, bitIndex + 1);\n}\nfloat getHighlightBit(in float bitset) {\nreturn getBit(bitset, 0);\n}\nhighp vec3 unpackDisplayIdTexel(in highp vec3 bitset) {\nfloat isAggregate = getBit(bitset.b, 7);\nreturn (1.0 - isAggregate) * bitset + isAggregate * (vec3(bitset.rgb) - vec3(0.0, 0.0, float(0x80)));\n}\nvec4 unpack(in float u32) {\nfloat r = mod(rshift(u32, 0), 255.0);\nfloat g = mod(rshift(u32, 8), 255.0);\nfloat b = mod(rshift(u32, 16), 255.0);\nfloat a = mod(rshift(u32, 24), 255.0);\nreturn vec4(r, g, b, a);\n}\nvec3 norm(in vec3 v) {\nreturn v /= 255.0;\n}\nvec4 norm(in vec4 v) {\nreturn v /= 255.0;\n}\nfloat max4(vec4 target) {\nreturn max(max(max(target.x, target.y), target.z), target.w);\n}\nvec2 unpack_u8_nf32(vec2 bytes) {\nreturn (bytes - 127.0) / 127.0;\n}","vcommon.glsl":"#include <materials/constants.glsl>\n#include <materials/utils.glsl>\n#include <materials/attributeData.glsl>\n#include <materials/vv.glsl>\nattribute vec2 a_pos;\nattribute highp vec3 a_id;\nuniform highp mat3 u_dvsMat3;\nuniform highp mat3 u_displayMat3;\nuniform highp mat3 u_displayViewMat3;\nuniform highp float u_pixelRatio;\nuniform mediump float u_zoomFactor;\nuniform mediump float u_antialiasing;\nuniform mediump float u_currentZoom;\nvec4 VV_ADATA = vec4(0.0);\nvoid loadVisualVariableData(inout vec4 target) {\n#ifdef OES_TEXTURE_FLOAT\ntarget.rgba = getAttributeData2(a_id);\n#else\nvec4 data0 = getAttributeData2(a_id);\nvec4 data1 = getAttributeData3(a_id);\ntarget.r = u88VVToFloat(data0.rg * 255.0);\ntarget.g = u88VVToFloat(data0.ba * 255.0);\ntarget.b = u88VVToFloat(data1.rg * 255.0);\ntarget.a = u88VVToFloat(data1.ba * 255.0);\n#endif\n}\n#ifdef VV\n#define INIT loadVisualVariableData(VV_ADATA)\n#else\n#define INIT\n#endif\nvec4 getColor(in vec4 a_color, in float a_bitSet, int index) {\n#ifdef VV_COLOR\nfloat isColorLocked   = getBit(a_bitSet, index);\nreturn getVVColor(VV_ADATA[ATTR_VV_COLOR], a_color, isColorLocked);\n#else\nreturn a_color;\n#endif\n}\nfloat getOpacity() {\n#ifdef VV_OPACITY\nreturn getVVOpacity(VV_ADATA[ATTR_VV_OPACITY]);\n#else\nreturn 1.0;\n#endif\n}\nfloat getSize(in float in_size) {\n#ifdef VV_SIZE\nreturn getVVSize(in_size, VV_ADATA[ATTR_VV_SIZE]);\n#else\nreturn in_size;\n#endif\n}
1\nmat3 getRotation() {\n#ifdef VV_ROTATION\nreturn getVVRotationMat3(mod(VV_ADATA[ATTR_VV_ROTATION], 360.0));\n#else\nreturn mat3(1.0);\n#endif\n}\nfloat getFilterFlags() {\n#ifdef IGNORES_SAMPLER_PRECISION\nreturn ceil(getAttributeData0(a_id).x * 255.0);\n#else\nreturn getAttributeData0(a_id).x * 255.0;\n#endif\n}\nvec4 getAnimationState() {\nreturn getAttributeData1(a_id);\n}\nfloat getMinZoom() {\nvec4 data0 = getAttributeData0(a_id) * 255.0;\nreturn data0.g;\n}\nmat3 getMatrix(float isMapAligned) {\nreturn isMapAligned * u_displayViewMat3 + (1.0 - isMapAligned) * u_displayMat3;\n}\nvec3 clip(inout vec4 color, inout vec3 pos, in float filterFlags, in vec2 minMaxZoom) {\npos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 0));\n#ifdef INSIDE\npos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 1));\n#elif defined(OUTSIDE)\npos.z += 2.0 * getFilterBit(filterFlags, 1);\n#elif defined(HIGHLIGHT)\n#if !defined(HIGHLIGHT_ALL)\npos.z += 2.0 * (1.0 - getHighlightBit(filterFlags));\n#endif\n#endif\npos.z += 2.0 * (step(minMaxZoom.y, u_currentZoom) + (1.0 - step(minMaxZoom.x, u_currentZoom)));\nreturn pos;\n}\nvec3 applyFilterLabels(inout vec4 color, inout vec3 pos, in float filterFlags) {\npos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 0));\n#ifndef OUTSIDE_LABELS_VISIBLE\npos.z += 2.0 * (1.0 - getFilterBit(filterFlags, 1));\n#endif\nreturn pos;\n}","vv.glsl":"#if defined(VV_SIZE_MIN_MAX_VALUE) || defined(VV_SIZE_SCALE_STOPS) || defined(VV_SIZE_FIELD_STOPS) || defined(VV_SIZE_UNIT_VALUE)\n#define VV_SIZE\n#endif\n#if defined(VV_COLOR) || defined(VV_SIZE) || defined(VV_OPACITY) || defined(VV_ROTATION)\n#define VV\n#endif\n#ifdef VV_COLOR\nuniform highp float u_vvColorValues[8];\nuniform vec4 u_vvColors[8];\n#endif\n#ifdef VV_SIZE_MIN_MAX_VALUE\nuniform highp vec4 u_vvSizeMinMaxValue;\n#endif\n#ifdef VV_SIZE_SCALE_STOPS\nuniform highp float u_vvSizeScaleStopsValue;\n#endif\n#ifdef VV_SIZE_FIELD_STOPS\nuniform highp float u_vvSizeFieldStopsValues[6];\nuniform float u_vvSizeFieldStopsSizes[6];\n#endif\n#ifdef VV_SIZE_UNIT_VALUE\nuniform highp float u_vvSizeUnitValueWorldToPixelsRatio;\n#endif\n#ifdef VV_OPACITY\nuniform highp float u_vvOpacityValues[8];\nuniform float u_vvOpacities[8];\n#endif\n#ifdef VV_ROTATION\nuniform lowp float u_vvRotationType;\n#endif\nbool isNan(float val) {\nreturn (val == NAN_MAGIC_NUMBER);\n}\n#ifdef VV_SIZE_MIN_MAX_VALUE\nfloat getVVMinMaxSize(float sizeValue, float fallback) {\nif (isNan(sizeValue)) {\nreturn fallback;\n}\nfloat interpolationRatio = (sizeValue  - u_vvSizeMinMaxValue.x) / (u_vvSizeMinMaxValue.y - u_vvSizeMinMaxValue.x);\ninterpolationRatio = clamp(interpolationRatio, 0.0, 1.0);\nreturn u_vvSizeMinMaxValue.z + interpolationRatio * (u_vvSizeMinMaxValue.w - u_vvSizeMinMaxValue.z);\n}\n#endif\n#ifdef VV_SIZE_FIELD_STOPS\nconst int VV_SIZE_N = 6;\nfloat getVVStopsSize(float sizeValue, float fallback) {\nif (isNan(sizeValue)) {\nreturn fallback;\n}\nif (sizeValue <= u_vvSizeFieldStopsValues[0]) {\nreturn u_vvSizeFieldStopsSizes[0];\n}\nfor (int i = 1; i < VV_SIZE_N; ++i) {\nif (u_vvSizeFieldStopsValues[i] >= sizeValue) {\nfloat f = (sizeValue - u_vvSizeFieldStopsValues[i-1]) / (u_vvSizeFieldStopsValues[i] - u_vvSizeFieldStopsValues[i-1]);\nreturn mix(u_vvSizeFieldStopsSizes[i-1], u_vvSizeFieldStopsSizes[i], f);\n}\n}\nreturn u_vvSizeFieldStopsSizes[VV_SIZE_N - 1];\n}\n#endif\n#ifdef VV_SIZE_UNIT_VALUE\nfloat getVVUnitValue(float sizeValue, float fallback) {\nif (isNan(sizeValue)) {\nreturn fallback;\n}\nreturn u_vvSizeUnitValueWorldToPixelsRatio * sizeValue;\n}\n#endif\n#ifdef VV_OPACITY\nconst int VV_OPACITY_N = 8;\nfloat getVVOpacity(float opacityValue) {\nif (isNan(opacityValue)) {\nreturn 1.0;\n}\nif (opacityValue <= u_vvOpacityValues[0]) {\nreturn u_vvOpacities[0];\n}\nfor (int i = 1; i < VV_OPACITY_N; ++i) {\nif (u_vvOpacityValues[i] >= opacityValue) {\nfloat f = (opacityValue - u_vvOpacityValues[i-1]) / (u_vvOpacityValues[i] - u_vvOpacityValues[i-1]);\nreturn mix(u_vvOpacities[i-1], u_vvOpacities[i], f);\n}\n}\nreturn u_vvOpacities[VV_OPACITY_N - 1];\n}\n#endif\n#ifdef VV_ROTATION\nmat4 getVVRotation(float rotationValue) {\nif (isNan(rotationValue)) {\nreturn mat4(1, 0, 0, 0,\n0, 1, 0, 0,\n0, 0, 1, 0,\n0, 0, 0, 1);\n}\nfloat rotation = rotationValue;\nif (u_vvRotationType == 1.0) {\nrotation = 90.0 - rotation;\n}\nfloat angle = C_DEG_TO_RAD * rotation;\nfloat sinA = sin(angle);
1\nfloat cosA = cos(angle);\nreturn mat4(cosA, sinA, 0, 0,\n-sinA,  cosA, 0, 0,\n0,     0, 1, 0,\n0,     0, 0, 1);\n}\nmat3 getVVRotationMat3(float rotationValue) {\nif (isNan(rotationValue)) {\nreturn mat3(1, 0, 0,\n0, 1, 0,\n0, 0, 1);\n}\nfloat rotation = rotationValue;\nif (u_vvRotationType == 1.0) {\nrotation = 90.0 - rotation;\n}\nfloat angle = C_DEG_TO_RAD * -rotation;\nfloat sinA = sin(angle);\nfloat cosA = cos(angle);\nreturn mat3(cosA, -sinA, 0,\nsinA, cosA, 0,\n0,    0,    1);\n}\n#endif\n#ifdef VV_COLOR\nconst int VV_COLOR_N = 8;\nvec4 getVVColor(float colorValue, vec4 fallback, float isColorLocked) {\nif (isNan(colorValue) || isColorLocked == 1.0) {\nreturn fallback;\n}\nif (colorValue <= u_vvColorValues[0]) {\nreturn u_vvColors[0];\n}\nfor (int i = 1; i < VV_COLOR_N; ++i) {\nif (u_vvColorValues[i] >= colorValue) {\nfloat f = (colorValue - u_vvColorValues[i-1]) / (u_vvColorValues[i] - u_vvColorValues[i-1]);\nreturn mix(u_vvColors[i-1], u_vvColors[i], f);\n}\n}\nreturn u_vvColors[VV_COLOR_N - 1];\n}\n#endif\nfloat getVVSize(in float size, in float vvSize)  {\n#ifdef VV_SIZE_MIN_MAX_VALUE\nreturn getVVMinMaxSize(vvSize, size);\n#elif defined(VV_SIZE_SCALE_STOPS)\nreturn u_vvSizeScaleStopsValue;\n#elif defined(VV_SIZE_FIELD_STOPS)\nfloat outSize = getVVStopsSize(vvSize, size);\nreturn isNan(outSize) ? size : outSize;\n#elif defined(VV_SIZE_UNIT_VALUE)\nreturn getVVUnitValue(vvSize, size);\n#else\nreturn size;\n#endif\n}"},"post-processing":{blit:{"blit.frag":"precision mediump float;\nuniform sampler2D u_texture;\nvarying vec2 v_uv;\nvoid main() {\ngl_FragColor = texture2D(u_texture, v_uv);\n}"},bloom:{composite:{"composite.frag":"precision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_blurTexture1;\nuniform sampler2D u_blurTexture2;\nuniform sampler2D u_blurTexture3;\nuniform sampler2D u_blurTexture4;\nuniform sampler2D u_blurTexture5;\nuniform float u_bloomStrength;\nuniform float u_bloomRadius;\nuniform float u_bloomFactors[NUMMIPS];\nuniform vec3 u_bloomTintColors[NUMMIPS];\nfloat lerpBloomFactor(const in float factor) {\nfloat mirrorFactor = 1.2 - factor;\nreturn mix(factor, mirrorFactor, u_bloomRadius);\n}\nvoid main() {\ngl_FragColor = u_bloomStrength * (\nlerpBloomFactor(u_bloomFactors[0]) * vec4(u_bloomTintColors[0], 1.0) * texture2D(u_blurTexture1, v_uv) +\nlerpBloomFactor(u_bloomFactors[1]) * vec4(u_bloomTintColors[1], 1.0) * texture2D(u_blurTexture2, v_uv) +\nlerpBloomFactor(u_bloomFactors[2]) * vec4(u_bloomTintColors[2], 1.0) * texture2D(u_blurTexture3, v_uv) +\nlerpBloomFactor(u_bloomFactors[3]) * vec4(u_bloomTintColors[3], 1.0) * texture2D(u_blurTexture4, v_uv) +\nlerpBloomFactor(u_bloomFactors[4]) * vec4(u_bloomTintColors[4], 1.0) * texture2D(u_blurTexture5, v_uv)\n);\n}"},gaussianBlur:{"gaussianBlur.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform vec2 u_texSize;\nuniform vec2 u_direction;\nvarying vec2 v_uv;\n#define KERNEL_RADIUS RADIUS\n#define SIGMA RADIUS\nfloat gaussianPdf(in float x, in float sigma) {\nreturn 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma;\n}\nvoid main() {\nvec2 invSize = 1.0 / u_texSize;\nfloat fSigma = float(SIGMA);\nfloat weightSum = gaussianPdf(0.0, fSigma);\nvec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum;\nfor (int i = 1; i < KERNEL_RADIUS; i ++) {\nfloat x = float(i);\nfloat w = gaussianPdf(x, fSigma);\nvec2 uvOffset = u_direction * invSize * x;\nvec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset);\nvec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset);\npixelColorSum += (sample1 + sample2) * w;\nweightSum += 2.0 * w;\n}\ngl_FragColor = pixelColorSum /weightSum;\n}"},luminosityHighPass:{"luminosityHighPass.frag":"precision mediump float;\nuniform sampler2D u_texture;\nuniform vec3 u_defaultColor;\nuniform float u_defaultOpacity;\nuniform float u_luminosityThreshold;\nuniform float u_smoothWidth;\nvarying vec2 v_uv;\nvoid main() {\nvec4 texel = texture2D(u_texture, v_uv);\nvec3 luma = vec3(0.299, 0.587, 0.114);\nfloat v = dot(texel.xyz, luma);\nvec4 outputColor = vec4(u_defaultColor.rgb, u_defaultOpacity);\nfloat alpha = smoothstep(u_luminosityThreshold, u_luminosityThreshold + u_smoothWidth, v);\ngl_FragColor = mix(outputColor, texel, alpha);\n}"}},blur:{gaussianBlur:{"gaussianBlur.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform vec2 u_texSize;\nuniform vec2 u_direction;\nuniform float u_sigma;\nvarying vec2 v_uv;\n#define KERNEL_RADIUS RADIUS\nfloat gaussianPdf(in float x, in float sigma) {\nreturn 0.39894 * exp(-0.5 * x * x / ( sigma * sigma)) / sigma;\n}\nvoid main() {\nvec2 invSize = 1.0 / u_texSize;\nfloat fSigma = u_sigma;\nfloat weightSum = gaussianPdf(0.0, fSigma);
1\nvec4 pixelColorSum = texture2D(u_colorTexture, v_uv) * weightSum;\nfor (int i = 1; i < KERNEL_RADIUS; i ++) {\nfloat x = float(i);\nfloat w = gaussianPdf(x, fSigma);\nvec2 uvOffset = u_direction * invSize * x;\nvec4 sample1 = texture2D(u_colorTexture, v_uv + uvOffset);\nvec4 sample2 = texture2D(u_colorTexture, v_uv - uvOffset);\npixelColorSum += (sample1 + sample2) * w;\nweightSum += 2.0 * w;\n}\ngl_FragColor = pixelColorSum /weightSum;\n}"},"radial-blur":{"radial-blur.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nvarying vec2 v_uv;\nconst float sampleDist = 1.0;\nconst float sampleStrength = 2.2;\nvoid main(void) {\nfloat samples[10];\nsamples[0] = -0.08;\nsamples[1] = -0.05;\nsamples[2] = -0.03;\nsamples[3] = -0.02;\nsamples[4] = -0.01;\nsamples[5] =  0.01;\nsamples[6] =  0.02;\nsamples[7] =  0.03;\nsamples[8] =  0.05;\nsamples[9] =  0.08;\nvec2 dir = 0.5 - v_uv;\nfloat dist = sqrt(dir.x * dir.x + dir.y * dir.y);\ndir = dir / dist;\nvec4 color = texture2D(u_colorTexture,v_uv);\nvec4 sum = color;\nfor (int i = 0; i < 10; i++) {\nsum += texture2D(u_colorTexture, v_uv + dir * samples[i] * sampleDist);\n}\nsum *= 1.0 / 11.0;\nfloat t = dist * sampleStrength;\nt = clamp(t, 0.0, 1.0);\ngl_FragColor = mix(color, sum, t);\n}"}},dra:{"dra.frag":"precision mediump float;\nuniform sampler2D u_minColor;\nuniform sampler2D u_maxColor;\nuniform sampler2D u_texture;\nvarying vec2 v_uv;\nvoid main() {\nvec4 minColor = texture2D(u_minColor, vec2(0.5));\nvec4 maxColor = texture2D(u_maxColor, vec2(0.5));\nvec4 color = texture2D(u_texture, v_uv);\nvec3 minColorUnpremultiply = minColor.rgb / minColor.a;\nvec3 maxColorUnpremultiply = maxColor.rgb / maxColor.a;\nvec3 colorUnpremultiply = color.rgb / color.a;\nvec3 range = maxColorUnpremultiply - minColorUnpremultiply;\ngl_FragColor = vec4(color.a * (colorUnpremultiply - minColorUnpremultiply) / range, color.a);\n}","min-max":{"min-max.frag":"#extension GL_EXT_draw_buffers : require\nprecision mediump float;\n#define CELL_SIZE 2\nuniform sampler2D u_minTexture;\nuniform sampler2D u_maxTexture;\nuniform vec2 u_srcResolution;\nuniform vec2 u_dstResolution;\nvarying vec2 v_uv;\nvoid main() {\nvec2 srcPixel = floor(gl_FragCoord.xy) * float(CELL_SIZE);\nvec2 onePixel = vec2(1.0) / u_srcResolution;\nvec2 uv = (srcPixel + 0.5) / u_srcResolution;\nvec4 minColor = vec4(1.0);\nvec4 maxColor = vec4(0.0);\nfor (int y = 0; y < CELL_SIZE; ++y) {\nfor (int x = 0; x < CELL_SIZE; ++x) {\nvec2 offset = uv + vec2(x, y) * onePixel;\nminColor = min(minColor, texture2D(u_minTexture, offset));\nmaxColor = max(maxColor, texture2D(u_maxTexture, offset));\n}\n}\ngl_FragData[0] = minColor;\ngl_FragData[1] = maxColor;\n}"}},"drop-shadow":{composite:{"composite.frag":"precision mediump float;\nuniform sampler2D u_layerFBOTexture;\nuniform sampler2D u_blurTexture;\nuniform vec4 u_shadowColor;\nvarying vec2 v_uv;\nvoid main() {\nvec4 layerColor = texture2D(u_layerFBOTexture, v_uv);\nvec4 blurColor = texture2D(u_blurTexture, v_uv);\ngl_FragColor = ((1.0 - layerColor.a) * blurColor.a * u_shadowColor + layerColor);\n}"},"drop-shadow.vert":"precision mediump float;\nattribute vec2 a_position;\nuniform highp mat3 u_displayViewMat3;\nuniform highp vec2 u_offset;\nvarying vec2 v_uv;\nvoid main() {\nvec3 offset = u_displayViewMat3 * vec3(u_offset, 0.0);\ngl_Position = vec4(a_position, 0.0, 1.0) + vec4(offset, 0.0);\nv_uv = (a_position + 1.0) / 2.0;\n}"},"edge-detect":{"frei-chen":{"frei-chen.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform vec2 u_texSize;\nvarying vec2 v_uv;\nvec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y);\nmat3 G[9];\nconst mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );\nconst mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );\nconst mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );\nconst mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );\nconst mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );\nconst mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );\nconst mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );\nconst mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );\nconst mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );\nvoid main() {\nG[0] = g0,\nG[1] = g1,\nG[2] = g2,\nG[3] = g3,\nG[4] = g4,\nG[5] = g5,\nG[6] = g6,\nG[7] = g7,\nG[8] = g8;\nmat3 I;\nfloat cnv[9];\nvec3 sample;\nfor (float i = 0.0; i < 3.0;
1 i++) {\nfor (float j = 0.0; j < 3.0; j++) {\nsample = texture2D(u_colorTexture, v_uv + texel * vec2(i - 1.0,j - 1.0)).rgb;\nI[int(i)][int(j)] = length(sample);\n}\n}\nfor (int i = 0; i < 9; i++) {\nfloat dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\ncnv[i] = dp3 * dp3;\n}\nfloat M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);\nfloat S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);\ngl_FragColor = vec4(vec3(sqrt(M / S)), texture2D(u_colorTexture, v_uv).a);\n}"},sobel:{"sobel.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nvarying vec2 v_uv;\nuniform vec2 u_texSize;\nvec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y);\nmat3 G[2];\nconst mat3 g0 = mat3( 1.0, 2.0, 1.0, 0.0, 0.0, 0.0, -1.0, -2.0, -1.0 );\nconst mat3 g1 = mat3( 1.0, 0.0, -1.0, 2.0, 0.0, -2.0, 1.0, 0.0, -1.0 );\nvoid main() {\nmat3 I;\nfloat cnv[2];\nvec3 sample;\nG[0] = g0;\nG[1] = g1;\nfor (float i = 0.0; i < 3.0; i++) {\nfor (float j = 0.0; j < 3.0; j++) {\nsample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb;\nI[int(i)][int(j)] = length(sample);\n}\n}\nfor (int i = 0; i < 2;
1 i++) {\nfloat dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\ncnv[i] = dp3 * dp3;\n}\ngl_FragColor = vec4(vec3(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1])), texture2D(u_colorTexture, v_uv).a);\n}"}},"edge-enhance":{"edge-enhance.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nvarying vec2 v_uv;\nuniform vec2 u_texSize;\nvec2 texel = vec2(1.0 / u_texSize.x, 1.0 / u_texSize.y);\nmat3 G[2];\nconst mat3 g0 = mat3( 1.0, 0.0, -1.0, 1.0, 0.0, -1.0, 1.0, 0.0, -1.0 );\nconst mat3 g1 = mat3( 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, -1.0, -1.0, -1.0 );\nvoid main() {\nmat3 I;\nfloat cnv[2];\nvec3 sample;\nG[0] = g0;\nG[1] = g1;\nfor (float i = 0.0; i < 3.0; i++) {\nfor (float j = 0.0; j < 3.0; j++) {\nsample = texture2D( u_colorTexture, v_uv + texel * vec2(i-1.0,j-1.0) ).rgb;\nI[int(i)][int(j)] = length(sample);\n}\n}\nfor (int i = 0; i < 2; i++) {\nfloat dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);\ncnv[i] = dp3 * dp3;\n}\nvec4 color = texture2D(u_colorTexture, v_uv);\ngl_FragColor = vec4(0.5 * sqrt(cnv[0] * cnv[0] + cnv[1] * cnv[1]) * color);\n}"},filterEffect:{"filterEffect.frag":"precision mediump float;\nuniform sampler2D u_colorTexture;\nuniform mat4 u_coefficients;\nvarying vec2 v_uv;\nvoid main() {\nvec4 color = texture2D(u_colorTexture, v_uv);\nvec4 rgbw = u_coefficients * vec4(color.a > 0.0 ? color.rgb / color.a : vec3(0.0), 1.0);\nfloat a = color.a;\ngl_FragColor = vec4(a * rgbw.rgb, a);\n}"},pp:{"pp.vert":"precision mediump float;\nattribute vec2 a_position;\nvarying vec2 v_uv;\nvoid main() {\ngl_Position = vec4(a_position, 0.0, 1.0);\nv_uv = (a_position + 1.0) / 2.0;\n}"}},raster:{bitmap:{"bitmap.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\nuniform sampler2D u_texture;\nuniform highp vec2 u_coordScale;\nuniform lowp float u_opacity;\n#include <filtering/bicubic.glsl>\nvoid main() {\n#ifdef BICUBIC\nvec4 color = sampleBicubicBSpline(u_texture, v_texcoord, u_coordScale);\n#else\nvec4 color = texture2D(u_texture, v_texcoord);\n#endif\nfloat alpha = u_opacity * color.a;\ngl_FragColor = vec4(alpha * color.rgb, alpha);\n}","bitmap.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_pos;\ngl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}"},common:{"common.glsl":"uniform sampler2D u_image;\nuniform int u_bandCount;\nuniform bool u_isFloatTexture;\nuniform bool u_flipY;\nuniform float u_opacity;\nuniform int u_resampling;\nuniform vec2 u_srcImageSize;\n#ifdef APPLY_PROJECTION\n#include <raster/common/projection.glsl>\n#endif\n#ifdef BICUBIC\n#include <filtering/bicubic.glsl>\n#endif\n#ifdef BILINEAR\n#include <filtering/bilinear.glsl>\n#endif\nvec2 getPixelLocation(vec2 coords) {\nvec2 targetLocation = u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords;\n#ifdef APPLY_PROJECTION\ntargetLocation = projectPixelLocation(targetLocation);\n#endif\nreturn targetLocation;\n}\nbool isOutside(vec2 coords){\nif (coords.t>1.00001 ||coords.t<-0.00001 || coords.s>1.00001 ||coords.s<-0.00001) {\nreturn true;\n} else {\nreturn false;\n}\n}\nvec4 getPixel(vec2 pixelLocation) {\n#ifdef BICUBIC\nvec4 color = sampleBicubicBSpline(u_image, pixelLocation, u_srcImageSize);\n#elif defined(BILINEAR)\nvec4 color = sampleBilinear(u_image, pixelLocation, u_srcImageSize);\n#else\nvec4 color = texture2D(u_image, pixelLocation);\n#endif\nreturn color;\n}","contrastBrightness.glsl":"uniform float u_contrastOffset;\nuniform float u_brightnessOffset;\nvec4 adjustContrastBrightness(vec4 currentPixel, bool isFloat) {\nvec4 pixelValue = isFloat ? currentPixel * 255.0 : currentPixel;\nfloat maxI = 255.0;\nfloat mid = 128.0;\nfloat c = u_contrastOffset;\nfloat b = u_brightnessOffset;\nvec4 v;\nif (c > 0.0 && c < 100.0) {\nv = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) / (2.0 * (100.0 - c)) + mid;\n} else if (c <= 0.0 && c > -100.0) {\nv = (200.0 * pixelValue - 100.0 * maxI + 2.0 * maxI * b) * (100.0 + c) / 20000.0 + mid;\n} else if (c == 100.0) {\nv = (200.0 * pixelValue - 100.0 * maxI + (maxI + 1.0) * (100.0 - c) + 2.0 * maxI * b);\nv = (sign(v) + 1.0) / 2.0;\n} else if (c == -100.0) {\nv = vec4(mid, mid, mid, currentPixel.a);\n}\nreturn vec4(v.r / 255.0, v.g / 255.0, v.b / 255.0, currentPixel.a);\n}","projection.glsl":"uniform sampler2D u_transformGrid;\nuniform vec2 u_transformSpacing;\nuniform vec2 u_transformGridSize;\nuniform vec2 u_targetImageSize;\nvec2 projectPixelLocation(vec2 coords) {\nvec2 index_image = floor(coords * u_targetImageSize);\nvec2 oneTransformPixel = vec2(0.25 / u_transformGridSize.s, 1.0 / u_transformGridSize.t);\nvec2 index_transform = floor(index_image / u_transformSpacing) / u_transformGridSize;\nvec2 pos = fract((index_image + vec2(0.5, 0.5)) / u_transformSpacing);\nvec2 srcLocation;\nvec2 transform_location = index_transform + oneTransformPixel * 0.5;\nif (pos.s <= pos.t) {\nvec4 ll_abc = texture2D(u_transformGrid, vec2(transform_location.s, transform_location.t));\nvec4 ll_def = texture2D(u_transformGrid, vec2(transform_location.s + oneTransformPixel.s, transform_location.t));
1\nsrcLocation.s = dot(ll_abc.rgb, vec3(pos, 1.0));\nsrcLocation.t = dot(ll_def.rgb, vec3(pos, 1.0));\n} else {\nvec4 ur_abc = texture2D(u_transformGrid, vec2(transform_location.s + 2.0 * oneTransformPixel.s, transform_location.t));\nvec4 ur_def = texture2D(u_transformGrid, vec2(transform_location.s + 3.0 * oneTransformPixel.s, transform_location.t));\nsrcLocation.s = dot(ur_abc.rgb, vec3(pos, 1.0));\nsrcLocation.t = dot(ur_def.rgb, vec3(pos, 1.0));\n}\nreturn srcLocation;\n}"},flow:{"flow.frag":"precision highp float;\nvarying float v_side;\nvarying float v_time;\nvarying float v_totalTime;\nvarying float v_timeSeed;\nuniform float u_time;\nuniform float u_fadeDuration;\nuniform float u_lineSpeed;\nuniform vec4 u_lineColor;\nuniform float u_lineHalfWidth;\nvoid main(void) {\nvec4 color = u_lineColor;\nfloat edgeWidth = min(2.0 * u_lineHalfWidth - 1.0, 1.0);\nfloat edgeStart = (u_lineHalfWidth - edgeWidth) / u_lineHalfWidth;\nif (edgeStart < 0.95) {\nfloat s = step(edgeStart, abs(v_side));\ncolor.a *= (1.0 - s) + s * (1.0 - (abs(v_side) - edgeStart) / (1.0 - edgeStart));\n}\nfloat t = mod(v_timeSeed * (v_totalTime + u_fadeDuration) + u_time * u_lineSpeed, v_totalTime + u_fadeDuration) - v_time;\ncolor.a *= step(0.0, t) * exp(-2.3 * t / u_fadeDuration);\ncolor.rgb *= color.a;\ngl_FragColor = color;\n}","flow.vert":"precision highp float;\nattribute vec3 a_positionAndSide;\nattribute vec3 a_timeInfo;\nattribute vec2 a_extrude;\nuniform mat3 u_dvsMat3;\nuniform mat3 u_displayViewMat3;\nuniform float u_lineHalfWidth;\nvarying float v_side;\nvarying float v_time;\nvarying float v_totalTime;\nvarying float v_timeSeed;\nvoid main(void) {\nvec2 position = a_positionAndSide.xy;\nfloat side = a_positionAndSide.z;\nvec2 xy = (u_dvsMat3 * vec3(position, 1.0) + u_displayViewMat3 * vec3(a_extrude * u_lineHalfWidth, 0.0)).xy;\ngl_Position = vec4(xy, 0.0, 1.0);\nv_side = side;\nv_time = a_timeInfo.x;\nv_totalTime = a_timeInfo.y;\nv_timeSeed = a_timeInfo.z;\n}"},hillshade:{"hillshade.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\n#include <raster/common/common.glsl>\nuniform int u_hillshadeType;\nuniform float u_sinZcosAs[6];\nuniform float u_sinZsinAs[6];\nuniform float u_cosZs[6];\nuniform float u_weights[6];\nuniform vec2 u_factor;\nuniform float u_minValue;\nuniform float u_maxValue;\n#include <raster/lut/colorize.glsl>\nfloat getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){\nif (a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0) {\nreturn 0.0;\n}\nelse {\nreturn e;\n}\n}\nvec3 rgb2hsv(vec3 c) {\nvec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);\nvec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);\nfloat d = q.x - min(q.w, q.y);\nfloat e = 1.0e-10;\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);\n}\nvec3 hsv2rgb(vec3 c) {\nvec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\nreturn c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);\n}\nvec4 overlay(float val, float minValue, float maxValue, float hillshade) {\nval = clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0);\nvec4 rgb = colorize(vec4(val, val, val, 1.0), 255.0);\nvec3 hsv = rgb2hsv(rgb.xyz);\nhsv.z = hillshade;\nreturn vec4(hsv2rgb(hsv), 1.0) * rgb.a;\n}\nvoid main() {\nvec2 pixelLocation = getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec4 currentPixel = getPixel(pixelLocation);\nif (currentPixel.a == 0.0) {\ngl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec2 axy = vec2(-1.0, -1.0);\nvec2 bxy = vec2(0.0, -1.0);\nvec2 cxy = vec2(1.0, -1.0);\nvec2 dxy = vec2(-1.0, 0.0);\nvec2 fxy = vec2(1.0, 0.0);\nvec2 gxy = vec2(-1.0, 1.0);\nvec2 hxy = vec2(0.0, 1.0);\nvec2 ixy = vec2(1.0, 1.0);\nvec2 onePixel = 1.0 / u_srcImageSize;\nif (pixelLocation.s < onePixel.s) {\naxy[0] = 1.0;\ndxy[0] = 1.0;\ngxy[0] = 1.0;\n}\nif (pixelLocation.t < onePixel.t) {\naxy[1] = 1.0;\nbxy[1] = 1.0;\ncxy[1] = 1.0;\n}\nif (pixelLocation.s > 1.0 - onePixel.s) {\ncxy[0] = -1.0;\nfxy[0] = -1.0;\nixy[0] = -1.0;\n}\nif (pixelLocation.t >
1 1.0 - onePixel.t) {\ngxy[1] = -1.0;\nhxy[1] = -1.0;\nixy[1] = -1.0;\n}\nvec4 va = texture2D(u_image, pixelLocation + onePixel * axy);\nvec4 vb = texture2D(u_image, pixelLocation + onePixel * bxy);\nvec4 vc = texture2D(u_image, pixelLocation + onePixel * cxy);\nvec4 vd = texture2D(u_image, pixelLocation + onePixel * dxy);\nvec4 ve = texture2D(u_image, pixelLocation);\nvec4 vf = texture2D(u_image, pixelLocation + onePixel * fxy);\nvec4 vg = texture2D(u_image, pixelLocation + onePixel * gxy);\nvec4 vh = texture2D(u_image, pixelLocation + onePixel * hxy);\nvec4 vi = texture2D(u_image, pixelLocation + onePixel * ixy);\nfloat dzx = (vc + 2.0 * vf + vi - va - 2.0 * vd - vg).r * u_factor.s;\nfloat dzy = (vg + 2.0 * vh + vi - va - 2.0 * vb - vc).r * u_factor.t;\nfloat dzd = sqrt(1.0 + dzx * dzx + dzy * dzy);\nfloat hillshade = 0.0;\nif (u_hillshadeType == 0){\nfloat cosDelta = u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx;\nfloat z = (u_cosZs[0] + cosDelta) / dzd;\nif (z < 0.0)  z = 0.0;\nhillshade = z;\n} else {\nfor (int k = 0; k < 6; k++) {\nfloat cosDelta = u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx;\nfloat z = (u_cosZs[k] + cosDelta) / dzd;\nif (z < 0.0) z = 0.0;\nhillshade = hillshade + z * u_weights[k];\nif (k == 5) break;\n}\n}\nfloat alpha = getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a);\n#ifdef APPLY_COLORMAP\ngl_FragColor = overlay(ve.r, u_minValue, u_maxValue, hillshade) * alpha * u_opacity;\n#else\ngl_FragColor = vec4(hillshade, hillshade, hillshade, 1.0) * alpha * u_opacity;\n#endif\n}","hillshade.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_pos;\ngl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}"},lut:{"colorize.glsl":"uniform sampler2D u_colormap;\nuniform float u_colormapOffset;\nuniform float u_colormapMaxIndex;\nvec4 colorize(vec4 currentPixel, float scaleFactor) {\nfloat clrIndex = clamp(currentPixel.r * scaleFactor - u_colormapOffset, 0.0, u_colormapMaxIndex);\nvec2 clrPosition = vec2((clrIndex + 0.5) / (u_colormapMaxIndex + 1.0), 0.0);\nvec4 color = texture2D(u_colormap, clrPosition);\nvec4 result = vec4(color.rgb, color.a * currentPixel.a);\nreturn result;\n}","lut.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\n#include <raster/common/common.glsl>\n#include <raster/lut/colorize.glsl>\nvoid main() {\nvec2 pixelLocation = getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec4 currentPixel = getPixel(pixelLocation);\nvec4 result = colorize(currentPixel, 1.0);\ngl_FragColor = vec4(result.xyz, 1.0) * result.a * u_opacity;\n}","lut.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform highp float u_scale;\nuniform highp vec2 u_offset;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_pos * u_scale + u_offset;\ngl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}"},magdir:{"magdir.frag":"precision mediump float;\nvarying vec4 v_color;\nuniform lowp float u_opacity;\nvoid main() {\ngl_FragColor = v_color * u_opacity;\n}","magdir.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_vv;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform vec2 u_symbolSize;\nuniform vec2 u_symbolPercentRange;\nuniform vec2 u_dataRange;\nuniform float u_rotation;\nuniform vec4 u_colors[12];\nvarying vec4 v_color;\nvoid main()\n{\nfloat angle = a_offset.y + u_rotation;\n#ifndef ROTATION_GEOGRAPHIC\nangle = 3.14159265359 * 2.0 - angle - 3.14159265359 / 2.0;\n#endif\nvec2 offset = vec2(cos(angle), sin(angle)) * a_offset.x;\n#ifdef DATA_RANGE\nfloat valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0);\nfloat sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x);\nfloat sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y);\n#else\nfloat sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0;\n#endif\nvec2 pos = a_pos + offset * sizePercentage * u_symbolSize;\nv_color = u_colors[int(a_vv.x)];\ngl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0);\n}"},reproject:{"reproject.frag":"precision mediump float;\nvarying vec2 v_texcoord;\n#include <raster/common/common.glsl>\nvoid main() {\nvec2 pixelLocation = getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\nreturn;\n}\nvec4 currentPixel = getPixel(pixelLocation);\ngl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity;\n}","reproject.vert":"precision mediump float;\nattribute vec2 a_position;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_position;\ngl_Position = vec4(2.0 * (a_position - 0.5), 0.0, 1.0);\n}"},scalar:{"scalar.frag":"precision mediump float;\nuniform lowp float u_opacity;\nvarying vec2 v_pos;\nconst vec4 outlineColor = vec4(0.2, 0.2, 0.2, 1.0);\nconst float outlineSize = 0.02;\nconst float innerRadius = 0.25;\nconst float outerRadius = 0.42;\nconst float innerSquareLength = 0.15;\nvoid main() {\nmediump float dist = length(v_pos);\nmediump float fillalpha1 = smoothstep(outerRadius, outerRadius + outlineSize, dist);\nfillalpha1 *= (1.0-smoothstep(outerRadius + outlineSize, outerRadius + 0.1 + outlineSize, dist));\n#ifdef INNER_CIRCLE\nmediump float fillalpha2 = smoothstep(innerRadius, innerRadius + outlineSize, dist);\nfillalpha2 *= (1.0-smoothstep(innerRadius + outlineSize, innerRadius + 0.1 + outlineSize, dist));\n#else\nmediump float fillalpha2 = (abs(v_pos.x) < innerSquareLength ? 1.0 : 0.0) * (abs(v_pos.y) < innerSquareLength ? 1.0 : 0.0);\n#endif\ngl_FragColor = (fillalpha2 + fillalpha1) * outlineColor * u_opacity;\n}","scalar.vert":"precision mediump float;\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_vv;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform vec2 u_symbolSize;\nuniform vec2 u_symbolPercentRange;\nuniform vec2 u_dataRange;\nvarying vec2 v_pos;\nvoid main()\n{\n#ifdef DATA_RANGE\nfloat valuePercentage = clamp((a_vv.y - u_dataRange.x) / (u_dataRange.y - u_dataRange.x), 0.0, 1.0);\nfloat sizeRatio = u_symbolPercentRange.x + valuePercentage * (u_symbolPercentRange.y - u_symbolPercentRange.x);\nfloat sizePercentage = clamp(sizeRatio, u_symbolPercentRange.x, u_symbolPercentRange.y);\n#else\nfloat sizePercentage = (u_symbolPercentRange.x + u_symbolPercentRange.y) / 2.0;\n#endif\nvec2 size = u_symbolSize * sizePercentage;\nvec2 pos = a_pos + a_offset * size;\nv_pos = a_offset;\ngl_Position = vec4(u_dvsMat3 * vec3(pos * u_coordScale, 1.0), 1.0);\n}"},stretch:{"stretch.frag":"precision mediump float;\nvarying highp vec2 v_texcoord;\n#include <raster/common/common.glsl>\nuniform float u_minCutOff[3];\nuniform float u_maxCutOff[3];\nuniform float u_minOutput;\nuniform float u_maxOutput;\nuniform float u_factor[3];\nuniform bool u_useGamma;\nuniform float u_gamma[3];\nuniform float u_gammaCorrection[3];\n#include <raster/lut/colorize.glsl>\nfloat stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) {\nif (val >= maxCutOff) {\nreturn maxOutput;\n} else if (val <= minCutOff) {\nreturn minOutput;\n}\nfloat stretchedVal;
1\nif (useGamma) {\nfloat tempf = 1.0;\nfloat outRange = maxOutput - minOutput;\nfloat relativeVal = (val - minCutOff) / (maxCutOff - minCutOff);\nif (gamma > 1.0) {\ntempf -= pow(1.0 / outRange, relativeVal * gammaCorrection);\n}\nstretchedVal = (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0;\n} else {\nstretchedVal = minOutput + (val - minCutOff) * factor;\n}\nreturn stretchedVal;\n}\nvoid main() {\nvec2 pixelLocation = getPixelLocation(v_texcoord);\nif (isOutside(pixelLocation)) {\ngl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\nreturn;\n}\nvec4 currentPixel = getPixel(pixelLocation);\n#ifdef NOOP\ngl_FragColor = vec4(currentPixel.rgb, 1.0) * currentPixel.a * u_opacity;\nreturn;\n#endif\nif (u_bandCount == 1) {\nfloat grayVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]);\n#ifdef APPLY_COLORMAP\nvec4 result = colorize(vec4(grayVal, grayVal, grayVal, 1.0), u_useGamma ? 255.0 : 1.0);\ngl_FragColor = vec4(result.xyz, 1.0) * result.a * currentPixel.a * u_opacity;\n#else\ngl_FragColor = vec4(grayVal, grayVal, grayVal, 1.0) * currentPixel.a * u_opacity;\n#endif\n} else {\nfloat redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]);\nfloat greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]);\nfloat blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]);\ngl_FragColor = vec4(redVal, greenVal, blueVal, 1.0) * currentPixel.a * u_opacity;\n}\n}","stretch.vert":"precision mediump float;\nattribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform highp vec2 u_coordScale;\nuniform highp float u_scale;\nuniform highp vec2 u_offset;\nvarying highp vec2 v_texcoord;\nvoid main()\n{\nv_texcoord = a_pos * u_scale + u_offset;\ngl_Position = vec4(u_dvsMat3 * vec3(a_pos * u_coordScale, 1.0), 1.0);\n}"}},stencil:{"stencil.frag":"void main() {\ngl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n}","stencil.vert":"attribute vec2 a_pos;\nvoid main() {\ngl_Position = vec4(a_pos, 0.0, 1.0);\n}"},tileInfo:{"tileInfo.frag":"uniform mediump sampler2D u_texture;\nvarying mediump vec2 v_tex;\nvoid main(void) {\nlowp vec4 color = texture2D(u_texture, v_tex);\ngl_FragColor = 0.75 * color;\n}","tileInfo.vert":"attribute vec2 a_pos;\nuniform highp mat3 u_dvsMat3;\nuniform mediump float u_depth;\nuniform mediump vec2 u_coord_ratio;\nuniform mediump vec2 u_delta;\nuniform mediump vec2 u_dimensions;\nvarying mediump vec2 v_tex;\nvoid main() {\nmediump vec2 offset = u_coord_ratio * vec2(u_delta + a_pos * u_dimensions);\nvec3 v_pos = u_dvsMat3 * vec3(offset, 1.0);\ngl_Position = vec4(v_pos.xy, 0.0, 1.0);\nv_tex = a_pos;\n}"},util:{"encoding.glsl":"const vec4 rgba2float_factors = vec4(\n255.0 / (256.0),\n255.0 / (256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0),\n255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n);\nfloat rgba2float(vec4 rgba) {\nreturn dot(rgba, rgba2float_factors);\n}"}});var a=new i.a((function(e){var t=r;return e.split("/").forEach((function(e){t&&(t=t[e])})),t}));function o(e){return a.resolveIncludes(e)}},559:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return u})),n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return h})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return f})),n.d(t,"j",(function(){return d})),n.d(t,"k",(function(){return v}));n(541);var i=n(539);function r(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"nearest",a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=!(a&&"u8"===t.pixelType),s=o?5126:5121,l=null==t.pixels||0===t.pixels.length?null:o?t.getAsRGBAFloat():t.getAsRGBA(),u=null==(n=e.capabilities.textureFloat)?void 0:n.textureFloatLinear,c={width:t.width,height:t.height,target:3553,pixelFormat:6408,internalFormat:"webgl2"===e.webglVersion&&o?34836:6408,samplingMode:!u||"bilinear"!==r&&"cubic"!==r?9728:9729,dataType:s,wrapMode:33071,flipped:!1};return new i.a(e,c,l)}function a(e,t){for(var n=4*t.size[0],r=t.size[1],a={width:n,height:r,target:3553,pixelFormat:6408,internalFormat:"webgl2"===e.webglVersion?34836:6408,dataType:5126,samplingMode:9728,wrapMode:33071,flipped:!1},o=new Float32Array(n*r*4),s=0,l=0;l<t.coefficients.length;l++)o[s++]=t.coefficients[l],l%3==2&&(o[s++]=1);return new i.a(e,a,o)}function o(e,t){var n={width:t.length/4,height:1,target:3553,pixelFormat:6408,internalFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071,flipped:!1};return new i.a(e,n,t)}function s(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return{u_flipY:r,u_isFloatTexture:a,u_applyTransform:!!e,u_opacity:i,u_transformSpacing:e?e.spacing:null,u_transformGridSize:e?e.size:null,u_targetImageSize:t,u_srcImageSize:n}}function l(e,t){return{u_colormapOffset:t||0,u_colormapMaxIndex:e?e.length/4-1:null}}function u(e,t){return{u_scale:e,u_offset:t}}function c(e){return{u_bandCount:e.bandCount,u_minOutput:e.outMin,u_maxOutput:e.outMax,u_minCutOff:e.minCutOff,u_maxCutOff:e.maxCutOff,u_factor:e.factor,u_useGamma:e.useGamma,u_gamma:e.gamma,u_gammaCorrection:e.gammaCorrection}}function h(e){return{u_hillshadeType:e.hillshadeType,u_sinZcosAs:e.sinZcosAs,u_sinZsinAs:e.sinZsinAs,u_cosZs:e.cosZs,u_weights:e.weights,u_factor:e.factor,u_minValue:e.minValue,u_maxValue:e.maxValue}}function f(e,t){for(var n,i=e.gl,r=t.glName,a=i.getProgramParameter(r,i.ACTIVE_UNIFORMS),o=new Map,s=0;s<a;s++)(n=i.getActiveUniform(r,s))&&o.set(n.name,{location:i.getUniformLocation(r,n.name),info:n});return o}
1function v(e,t,n){Object.keys(n).forEach((function(i){var r=t.get(i)||t.get(i+"[0]");r&&function(e,t,n,i){if(null===i||null==n)return!1;var r=i.info;switch(r.type){case 5126:r.size>1?e.setUniform1fv(t,n):e.setUniform1f(t,n);break;case 35664:e.setUniform2fv(t,n);break;case 35665:e.setUniform3fv(t,n);break;case 35666:e.setUniform4fv(t,n);break;case 35675:e.setUniformMatrix3fv(t,n);break;case 35676:e.setUniformMatrix4fv(t,n);break;case 5124:r.size>1?e.setUniform1iv(t,n):e.setUniform1i(t,n);break;case 35670:e.setUniform1i(t,n?1:0);break;case 35667:case 35671:e.setUniform2iv(t,n);break;case 35668:case 35672:e.setUniform3iv(t,n);break;case 35669:case 35673:e.setUniform4iv(t,n);break;default:return!1}}(e,i,n[i],r)}))}function d(e,t,n,i){n.length===i.length&&(i.some((function(e){return null==e}))||n.some((function(e){return null==e}))||n.forEach((function(n,r){t.setUniform1i(n,r),e.bindTexture(i[r],r)})))}},561:function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var i=n(11),r=n(3),a=n(2),o=n(105),s=n(399),l=n(47),u=n(374),c=n(550),h=n(534),f=n(598),v=function(){function e(t,n,i,a){Object(r.a)(this,e),this.center=Object(u.b)(t,n),this.centerT=Object(u.a)(),this.halfWidth=i/2,this.halfHeight=a/2,this.width=i,this.height=a}return Object(a.a)(e,[{key:"x",get:function(){return this.center[0]},set:function(e){this.center[0]=e}},{key:"y",get:function(){return this.center[1]},set:function(e){this.center[1]=e}},{key:"blX",get:function(){return this.center[0]+this.halfWidth}},{key:"blY",get:function(){return this.center[1]+this.halfHeight}},{key:"trX",get:function(){return this.center[0]-this.halfWidth}},{key:"trY",get:function(){return this.center[1]-this.halfHeight}},{key:"xmin",get:function(){return this.x-this.halfWidth}},{key:"xmax",get:function(){return this.x+this.halfWidth}},{key:"ymin",get:function(){return this.y-this.halfHeight}},{key:"ymax",get:function(){return this.y+this.halfHeight}},{key:"clone",value:function(){return new e(this.x,this.y,this.width,this.height)}},{key:"serialize",value:function(e){return e.writeF32(this.center[0]),e.writeF32(this.center[1]),e.push(this.width),e.push(this.height),e}},{key:"findCollisionDelta",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=Math.abs(e.centerT[0]-this.centerT[0]),i=Math.abs(e.centerT[1]-this.centerT[1]),r=(e.halfWidth+this.halfWidth+t)/n,a=(e.halfHeight+this.halfHeight+t)/i,o=Math.min(r,a);return Math.log2(o)}},{key:"extend",value:function(e){var t=Math.min(this.xmin,e.xmin),n=Math.min(this.ymin,e.ymin),i=Math.max(this.xmax,e.xmax)-t,r=Math.max(this.ymax,e.ymax)-n,a=t+i/2,o=n+r/2;this.width=i,this.height=r,this.halfWidth=i/2,this.halfHeight=r/2,this.x=a,this.y=o}}],[{key:"deserialize",value:function(t){return new e(t.readF32(),t.readF32(),t.readInt32(),t.readInt32())}}]),e}(),d=Math.PI/180,p=function(){function e(t,n,i,a){Object(r.a)(this,e),this._rotationT=Object(s.a)(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;var o=i.rect,l=new Float32Array(8);t*=a,n*=a;var u=i.code?o.width*a:i.metrics.width,c=i.code?o.height*a:i.metrics.height;l[0]=t,l[1]=n,l[2]=t+u,l[3]=n,l[4]=t,l[5]=n+c,l[6]=t+u,l[7]=n+c,this._data=l,this._setTextureCoords(o),this._scale=a,this._mosaic=i,this.x=t,this.y=n,this.maxOffset=Math.max(t+u,n+c)}return Object(a.a)(e,[{key:"width",get:function(){return this._mosaic.metrics.width*this._scale}},{key:"mosaic",get:function(){return this._mosaic}},{key:"angle",get:function(){return this._angle},set:function(e){this._angle=e,Object(o.d)(this._rotationT),Object(o.f)(this._rotationT,this._rotationT,-e),this._setOffsets(this._data)}},{key:"xTopLeft",get:function(){return this._data[0]}},{key:"yTopLeft",get:function(){return this._data[1]}},{key:"xBottomRight",get:function(){return this._data[6]}},{key:"yBottomRight",get:function(){return this._data[7]}},{key:"texcoords",get:function(){return this._texcoords}},{key:"textureBinding",get:function(){return this._mosaic.textureBinding}},{key:"offsets",get:function(){return this._offsets||this._setOffsets(this._data),this._offsets}},{key:"char",get:function(){return String.fromCharCode(this._mosaic.code)}},{key:"code",get:function(){return this._mosaic.code}},{key:"bounds",get:function(){if(!this._bounds){var e=this._mosaic.metrics,t=e.height,n=e.width*this._scale,i=Math.abs(t)*this._scale,r=new Float32Array(8);r[0]=this.x,r[1]=this.y,r[2]=this.x+n,r[3]=this.y,r[4]=this.x,r[5]=this.y+i,r[6]=this.x+n,r[7]=this.y+i;var a=Object(o.e)(Object(s.a)(),this._rotationT,this._T);Object(s.b)(r,r,a);for(var l=1/0,u=1/0,c=0,h=0,f=0;f<4;f++){var d=r[2*f],p=r[2*f+1];l=Math.min(l,d),u=Math.min(u,p),c=Math.max(c,d),h=Math.max(h,p)}var y=c-l,_=h-u,m=l+y/2,g=u+_/2;this._bounds=new v(m,g,y,_)}return this._bounds}},{key:"setTransform",value:function(e){this._T=e,this._offsets=null}},{key:"_setOffsets",value:function(e){this._offsets||(this._offsets={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0});var t=this._offsets,n=new Float32Array(8),i=Object(o.e)(Object(s.a)(),this._rotationT,this._T);Object(s.b)(n,e,i),t.upperLeft=Object(h.a)(8*n[0],8*n[1]),t.upperRight=Object(h.a)(8*n[2],8*n[3]),t.lowerLeft=Object(h.a)(8*n[4],8*n[5]),t.lowerRight=Object(h.a)(8*n[6],8*n[7])}},{key:"_setTextureCoords",value:function(e){var t=e.x,n=e.y,i=e.width,r=e.height;this._texcoords={upperLeft:Object(h.a)(t,n),upperRight:Object(h.a)(t+i,n),lowerLeft:Object(h.a)(t,n+r),lowerRight:Object(h.a)(t+i,n+r)}}}]),e}(),y=function(e,t){return{code:0,page:0,sdf:!0,rect:new f.a(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:e,left:0,top:0}}},_=function(){function e(t,n,a){Object(r.a)(this,e),this._rotation=0,this._decorate(t,n,a),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=n.length>1,this._hasRotation=0!==a.angle,this._T=this._createGlyphTransform(this.bounds,a);var o,s=Object(i.a)(t);try{for(s.s();!(o=s.n()).done;){o.value.setTransform(this._T)}}catch(l){s.e(l)}finally{s.f()}}return Object(a.a)(e,[{key:"setRotation",value:function(e){if(0!==e||0!==this._rotation){this._rotation=e;var t=this._T,n=Object(o.b)(Object(s.a)(),e);Object(o.e)(t,n,t);var r,a=Object(i.a)(this.glyphs);try{for(a.s();!(r=a.n()).done;){r.value.setTransform(this._T)}}catch(l){a.e(l)}finally{a.f()}}}},{key:"_decorate",value:function(e,t,n){if(n.decoration&&"none"!==n.decoration&&e.length){var r,a=n.scale,o="underline"===n.decoration?30:20,s=e[0].textureBinding,l=Object(i.a)(t);try{for(l.s();!(r=l.n()).done;){var u=r.value,c=u.startX*a,h=u.startY*a,f=(u.width+u.glyphWidthEnd)*a;
1e.push(new p(c,h+o*a,y(f,s),1))}}catch(v){l.e(v)}finally{l.f()}}}},{key:"boundsT",get:function(){var e=this.bounds,t=Object(l.m)(Object(u.a)(),e.x,e.y);if(Object(l.n)(t,t,this._T),this._hasRotation){var n=Math.max(e.width,e.height);return new v(t[0],t[1],n,n)}return new v(t[0],t[1],e.width,e.height)}},{key:"_createBounds",value:function(e){var t,n=1/0,r=1/0,a=0,o=0,s=Object(i.a)(e);try{for(s.s();!(t=s.n()).done;){var l=t.value;n=Math.min(n,l.xTopLeft),r=Math.min(r,l.yTopLeft),a=Math.max(a,l.xTopLeft+l.width),o=Math.max(o,l.yBottomRight)}}catch(h){s.e(h)}finally{s.f()}var u=a-n,c=o-r;return new v(n+u/2,r+c/2,u,c)}},{key:"_createGlyphTransform",value:function(e,t){var n=d*t.angle,i=Object(s.a)(),r=Object(u.a)();return Object(o.h)(i,i,Object(l.m)(r,t.xOffset,-t.yOffset)),t.isCIM?Object(o.f)(i,i,n):(Object(o.h)(i,i,Object(l.m)(r,e.x,e.y)),Object(o.f)(i,i,n),Object(o.h)(i,i,Object(l.m)(r,-e.x,-e.y))),i}}]),e}(),m=Object(a.a)((function e(t,n,i,a,o,s){Object(r.a)(this,e),this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(n,i)),this.end=Math.max(0,Math.max(n,i)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].metrics.width),this.width=a,this.yMin=o,this.yMax=s})),g=function(e){return 10===e},b=function(e){return 32===e};function x(e,t,n){for(var i=n.scale,r=new Array,a=function(e,t,n){for(var i=new Array,r=1/n.scale,a=n.maxLineWidth*r,o=t?e.length-1:0,s=t?-1:e.length,l=t?-1:1,u=o,c=0,h=0,f=u,v=f,d=0,p=1/0,y=0;u!==s;){var _=e[u],x=_.code,O=_.metrics,w=Math.abs(O.top);if(g(x)||b(x)||(p=Math.min(p,w),y=Math.max(y,w+O.height)),g(x))u!==o&&(i.push(new m(e,f,u-l,c,p,y)),p=1/0,y=0),c=0,f=u+l,v=u+l,h=0;else if(b(x))v=u+l,h=0,d=O.advance,c+=O.advance;else if(c>a){if(v!==f){var k=v-2*l;c-=d,i.push(new m(e,f,k,c-h,p,y)),p=1/0,y=0,f=v,c=h}else i.push(new m(e,f,u-l,c,p,y)),p=1/0,y=0,f=u,v=u,c=0;c+=O.advance,h+=O.advance}else c+=O.advance,h+=O.advance;u+=l}var S=new m(e,f,u-l,c,p,y);return S.start>=0&&S.end<e.length&&i.push(S),i}(e,t,n),o=function(e,t){for(var n=0,i=0;i<e.length;i++){var r=e[i].width;n=Math.max(r,n)}var a="underline"===t.decoration?4:0,o=e[0].yMin;return{x:0,y:o,height:e[e.length-1].yMax+t.lineHeight*(e.length-1)+a-o,width:n}}(a,n),s=n.vAlign,l=n.hAlign,u=s===c.b.Baseline?1:0,h=u?0:s-1,f=(1-u)*-o.y+h*(o.height/2)+-26*(u?1:0),v=0;v<a.length;v++){var d=a[v],y=d.start,x=d.end,O=-1*(l+1)*(d.width/2)-3,w=v*n.lineHeight+f-3;a[v].startX=O,a[v].startY=w;for(var k=y;k<=x;k++){var S=e[k];if(!g(S.code)){var j=new p(O+S.metrics.left,w-S.metrics.top,S,i);O+=S.metrics.advance,r.push(j)}}}return new _(r,a,n)}},562:function(e,t,n){"use strict";n.d(t,"a",(function(){return z})),n.d(t,"b",(function(){return R})),n.d(t,"c",(function(){return V})),n.d(t,"d",(function(){return E})),n.d(t,"e",(function(){return Y})),n.d(t,"f",(function(){return M}));var i=n(36),r=n(9),a=n(23),o=n(3),s=n(2),l=n(11),u=n(41),c=n(555),h=n(590),f=n(18),v=n(21),d=n(74),p=n(7),y=n(37),_=n(138),m=n(304),g=n(554),b=n(597),x=n(104),O=n(599),w=n(531),k=n(561),S=Math.PI,j=S/2,P=96/72,T=Math.PI/180,C=v.a.getLogger("esri.symbols.cim.CIMSymbolHelper");function M(e){if(!e||!e.type)return null;var t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":t=R.fromSimpleMarker(e);break;case"picture-marker":t=R.fromPictureMarker(e);break;case"simple-line":t=R.fromSimpleLineSymbol(e);break;case"simple-fill":t=R.fromSimpleFillSymbol(e);break;case"picture-fill":t=R.fromPictureFillSymbol(e);break;case"text":t=R.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function I(e,t){switch(t.type){case"CIMSymbolReference":return I(e,t.symbol);case"CIMPointSymbol":e.drawSymbol(t,{x:0,y:0});break;case"CIMLineSymbol":e.drawSymbol(t,{paths:[[[0,0],[0,1]]]});break;case"CIMPolygonSymbol":e.drawSymbol(t,{rings:[[[0,0],[0,1],[0,0]]]});break;case"CIMTextSymbol":e.drawSymbol(t,{x:0,y:0});break;case"CIMVectorMarker":var n=new g.a;e.drawMarker(t,n)}return e.envelope()}function L(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function A(e){if(!e)return 0;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(Object(x.f)(e.offsetX)),Math.abs(Object(x.f)(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude)}}function D(e){if(!e)return 0;var t,n=0,i=Object(l.a)(e);try{for(i.s();!(t=i.n()).done;){n+=A(t.value)}}catch(r){i.e(r)}finally{i.f()}return n}var z=function(){function e(){Object(o.a)(this,e)}return Object(s.a)(e,[{key:"getSymbolInflateSize",value:function(e,t,n,i,r){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,n,i,r):e}},{key:"_vectorMarkerBounds",value:function(e,t,n,i){var r=!0,a=Object(_.g)();if(t&&t.markerGraphics){var o,s=Object(l.a)(t.markerGraphics);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=[0,0,0,0];u.geometry&&(Object(m.a)(a,u.geometry),c[0]=0,c[1]=0,c[2]=0,c[3]=0,this.get
1SymbolInflateSize(c,u.symbol,n,0,i),a[0]+=c[0],a[1]+=c[1],a[2]+=c[2],a[3]+=c[3],r?(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],r=!1):(e[0]=Math.min(e[0],a[0]),e[1]=Math.min(e[1],a[1]),e[2]=Math.max(e[2],a[2]),e[3]=Math.max(e[3],a[3])))}}catch(h){s.e(h)}finally{s.f()}}return e}},{key:"_getInflateSize",value:function(e,t,n,i,r){if(function(e){return void 0!==e.symbolLayers}(t)){var a=this._getLayersInflateSize(e,t.symbolLayers,n,i,r),o=D(t.effects);return o>0&&(a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o),a}return this._getTextInflatedSize(e,t,r)}},{key:"_getLayersInflateSize",value:function(e,t,n,i,r){var a=!0;if(!t)return e;var o,s=Object(l.a)(t);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u){var c=[0,0,0,0];switch(u.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":var h=u,f=h.width;"Square"===h.capStyle||"Miter"===h.joinStyle?f/=1.4142135623730951:f/=2,c[0]=-f,c[1]=-f,c[2]=f,c[3]=f;break;case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":var v=u;if("CIMVectorMarker"===u.type){var d=u;if(c=this._vectorMarkerBounds(c,d,n,r),d.frame){var y=(d.frame.xmin+d.frame.xmax)/2,m=(d.frame.ymin+d.frame.ymax)/2;c[0]-=y,c[1]-=m,c[2]-=y,c[3]-=m;var g=d.size/(d.frame.ymax-d.frame.ymin);c[0]*=g,c[1]*=g,c[2]*=g,c[3]*=g}}else if("CIMPictureMarker"===u.type){var b=u,w=n.getResource(b.url),k=1;Object(p.k)(w)&&w.height&&(k=w.width/w.height);var S=v.size/2,j=v.size*k*b.scaleX/2;c=[-j,-S,j,S]}else{var P=v.size/2;c=[-P,-P,P,P]}if(v.anchorPoint){var C=void 0,M=void 0;"Absolute"===v.anchorPointUnits?(C=v.anchorPoint.x,M=v.anchorPoint.y):(C=v.anchorPoint.x*(c[2]-c[0]),M=v.anchorPoint.y*(c[3]-c[1])),c[0]-=C,c[1]-=M,c[2]-=C,c[3]-=M}var I=Object(x.f)(v.rotation);if(v.rotateClockwise&&(I=-I),i&&(I-=i),I){var A=T*I,z=Math.cos(A),R=Math.sin(A),E=Object(_.g)([O.c,O.c,-O.c,-O.c]);Object(_.j)(E,[c[0]*z-c[1]*R,c[0]*R+c[1]*z]),Object(_.j)(E,[c[0]*z-c[3]*R,c[0]*R+c[3]*z]),Object(_.j)(E,[c[2]*z-c[1]*R,c[2]*R+c[1]*z]),Object(_.j)(E,[c[2]*z-c[3]*R,c[2]*R+c[3]*z]),c=E}var V=Object(x.f)(v.offsetX),F=Object(x.f)(v.offsetY);if(i){var U=T*i,B=Math.cos(U),N=Math.sin(U),G=V*N+F*B;V=V*B-F*N,F=G}c[0]+=V,c[1]+=F,c[2]+=V,c[3]+=F;var H=L(v.markerPlacement);H>0&&(c[0]-=H,c[1]-=H,c[2]+=H,c[3]+=H)}var W=D(u.effects);W>0&&(c[0]-=W,c[1]-=W,c[2]+=W,c[3]+=W),a?(e[0]=c[0],e[1]=c[1],e[2]=c[2],e[3]=c[3],a=!1):(e[0]=Math.min(e[0],c[0]),e[1]=Math.min(e[1],c[1]),e[2]=Math.max(e[2],c[2]),e[3]=Math.max(e[3],c[3]))}}}catch(q){s.e(q)}finally{s.f()}return e}},{key:"_getTextInflatedSize",value:function(e,t,n){var i,r,a=null!=(i=t.height)?i:10;if(e[0]=-a/2,e[1]=-a/2,e[2]=a/2,e[3]=a/2,!n)return e;var o=n.get(t);if(!o)return e;var s=o.text,l=o.mosaicItem;if(!l||0===l.glyphMosaicItems.length)return e;var u=Object(b.f)(t.lineGapType,null!=(r=t.lineGap)?r:0,a),h=Object(c.a)(s)[1],f=l.glyphMosaicItems,v=Object(k.a)(f,h,{scale:a/w.o,angle:Object(x.f)(t.angle),xOffset:Object(x.f)(t.offsetX),yOffset:Object(x.f)(t.offsetY),hAlign:Object(b.e)(t.horizontalAlignment),vAlign:Object(b.g)(t.verticalAlignment),maxLineWidth:512,lineHeight:w.r*Math.max(.25,Math.min(u||1,4)),decoration:t.font.decoration||"none",isCIM:!0}).boundsT;return e[0]=v.x-v.halfWidth,e[1]=-v.y-v.halfHeight,e[2]=v.x+v.halfWidth,e[3]=-v.y+v.halfHeight,e}}],[{key:"SafeSize",value:function(e){var t=Math.max(Math.abs(e[0]),Math.abs(e[2])),n=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+n*n)}}]),e}(),R=function(){function e(){Object(o.a)(this,e)}return Object(s.a)(e,null,[{key:"getEnvelope",value:function(e,t){var n=new b.b(t);if(Array.isArray(e)){var i,r,a=Object(l.a)(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i?i.union(I(n,o)):i=I(n,o)}}catch(s){a.e(s)}finally{a.f()}return i}return I(n,e)}},{key:"getTextureAnchor",value:function(e,t){var n=this.getEnvelope(e,t);if(!n)return[0,0,0];var i=(n.x+.5*n.width)*P,r=-(n.y+.5*n.height)*P,a=n.width*P+2,o=n.height*P+2;return[i/a,r/o,o]}},{key:"rasterize",value:function(e,t,n,i){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=n||this.getEnvelope(t,i);if(!a)return[null,0,0,0,0];var o=(a.x+.5*a.width)*P,s=(a.y+.5*a.height)*P;e.width=a.width*P,e.height=a.height*P,n||(e.width+=2,e.height+=2);var l=e.getContext("2d"),u=b.d.createScale(P,-P);u.translate(.5*e.width-o,.5*e.height+s);var c=new b.a(l,i,u);switch(t.type){case"CIMPointSymbol":var h={type:"point",x:0,y:0};c.drawSymbol(t,h);break;case"CIMVectorMarker":var f=new g.a;c.drawMarker(t,f)}var v=l.getImageData(0,0,e.width,e.height),d=new Uint8Array(v.data);if(r)for(var p,y=0;y<d.length;y+=4)p=d[y+3]/255,d[y]=d[y]*p,d[y+1]=d[y+1]*p,d[y+2]=d[y+2]*p;return[d,e.width,e.height,-o/e.width,-s/e.height]}},{key:"fromTextSymbol",value:function(e){var t,n,i,r,a,o=e.angle,s=e.color,l=e.font,u=e.haloColor,h=e.haloSize,f=e.horizontalAlignment,v=e.kerning,d=e.text,p=e.verticalAlignment,y=e.xoffset,_=e.yoffset;l&&(t=l.family,n=l.style,i=l.weight,r=l.size,a=l.decoration);var m=!1;return d&&(m=Object(c.a)(d)[1]),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",angle:o,blockProgression:2,depth3D:1,extrapolateBaselines:!0,fontEffects:0,fontEncoding:1,fontFamilyName:t||"Arial",fontStyleName:H(n,i),fontType:0,haloSize:h,height:r,hinting:1,horizontalAlignment:B(null!=f?f:"center"),kerning:v,letterWidth:100,ligatures:!0,lineGapType:"Multiple",offsetX:Object(x.f)(y),offsetY:Object(x.f)(_),strikethrough:"line-through"===a,underline:"underline"===a,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:G(s)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:G(u)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:m?1:0,verticalAlignment:N(null!=p?p:"baseline"),verticalGlyphOrientation:0,wordSpacing:100,billboardMode3D:2},textString:d}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}},{key:"fromPictureFillSymbol",value:function(e){var t=e.height,n=e.outline,i=e.width,r=e.xoffset,a=e.xscale,o=e.yoffset,s=e.yscale,l=[],u={type:"CIMPolygonSymbol",symbolLayers:l};if(n){var c=n.cap,h=n.join,f=n.miterLimit,v=n.width;l.push({type:"CIMSolidStroke",color:G(n.color),capStyle:F(c),joinStyle:U(h),miterLimit:f,width:v})}var d=e.url;"esriPFS"===e.type&&e.imageData&&(d=e.imageData);var p="angle"in e?e.angle:0,y=i*(a||1),_=t*(s||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:d,height:_,width:y,offsetX:Object(x.f)(r),offsetY:Object(x.f)(o),rotation:Object(x.f)(-p),colorSubstitutions:null}),u}},{key:"fromSimpleFillSymbol",value:function(e){var t=e.color,n=e.style,i=e.outline,r=[],a={type:"CIMPolygonSymbol",symbolLayers:r},o=null;if(i){var s=i.cap,l=i.join,u=i.style;"solid"!==u&&"none"!==u&&"esriSLSSolid"!==u&&"esriSLSNull"!==u&&(
1o=[{type:"CIMGeometricEffectDashes",dashTemplate:Y(u,s),lineDashEnding:"NoConstraint",scaleDash:!0}]),r.push({type:"CIMSolidStroke",color:G(i.color),capStyle:F(s),joinStyle:U(l),miterLimit:i.miterLimit,width:i.width,effects:o})}if(n&&"solid"!==n&&"none"!==n&&"esriSFSSolid"!==n&&"esriSFSNull"!==n){var c={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:G(t),capStyle:"Butt",joinStyle:"Miter",width:.75}]},h=0,v=Object(d.j)(Math.ceil(window.devicePixelRatio)),p=X(n)?8*v:10*v;switch(n){case"vertical":case"esriSFSVertical":h=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":h=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":h=45;break;case"cross":case"esriSFSCross":h=0}r.push({type:"CIMHatchFill",lineSymbol:c,offsetX:0,offsetY:0,rotation:h,separation:p}),"cross"===n||"esriSFSCross"===n?r.push({type:"CIMHatchFill",lineSymbol:Object(f.a)(c),offsetX:0,offsetY:0,rotation:90,separation:p}):"diagonal-cross"!==n&&"esriSFSDiagonalCross"!==n||r.push({type:"CIMHatchFill",lineSymbol:Object(f.a)(c),offsetX:0,offsetY:0,rotation:45,separation:p})}else!n||"solid"!==n&&"esriSFSSolid"!==n||r.push({type:"CIMSolidFill",enable:!0,color:G(t)});return a}},{key:"fromSimpleLineSymbol",value:function(t){var n=t.cap,i=t.color,r=t.join,a=t.marker,o=t.miterLimit,s=t.style,l=t.width,u=null;"solid"!==s&&"none"!==s&&"esriSLSSolid"!==s&&"esriSLSNull"!==s&&(u=[{type:"CIMGeometricEffectDashes",dashTemplate:Y(s,n),lineDashEnding:"NoConstraint",scaleDash:!0}]);var c=[];if(a){var h;switch(a.placement){case"begin-end":h="Both";break;case"begin":h="JustBegin";break;case"end":h="JustEnd";break;default:h="None"}var f=e.fromSimpleMarker(a,l,i).symbolLayers[0];f.markerPlacement={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:h,offsetAlongLine:0},c.push(f)}return"none"!==s&&"esriSLSNull"!==s&&c.push({type:"CIMSolidStroke",color:G(i),capStyle:F(n),joinStyle:U(r),miterLimit:o,width:l,effects:u}),{type:"CIMLineSymbol",symbolLayers:c}}},{key:"fromPictureMarker",value:function(e){var t=e.angle,n=e.height,i=e.width,r=e.xoffset,a=e.yoffset,o=e.url;return"esriPMS"===e.type&&e.imageData&&(o=e.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:o,size:n,width:i,offsetX:Object(x.f)(r),offsetY:Object(x.f)(a),rotation:Object(x.f)(-t)}]}}},{key:"fromSimpleMarker",value:function(e,t,n){var i,r=e.style,o=null!=(i=e.color)?i:n;if("path"===r){var s=[];if("outline"in e&&e.outline){var l=e.outline;s.push({type:"CIMSolidStroke",enable:!0,width:Object(y.c)(Math.round(Object(y.d)(l.width))),color:G(l.color)})}s.push({type:"CIMSolidFill",enable:!0,color:G(o),path:e.path});var u=Z("square"),c=Object(a.a)(u,2),h=c[0],f=c[1];return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:Object(x.f)(-e.angle),size:Object(x.f)(e.size||6),offsetX:Object(x.f)(e.xoffset),offsetY:Object(x.f)(e.yoffset),frame:h,markerGraphics:[{type:"CIMMarkerGraphic",geometry:f,symbol:{type:"CIMPolygonSymbol",symbolLayers:s}}]}]}}var v,d=Z(r),p=Object(a.a)(d,2),_=p[0],m=p[1];if(m&&_){var g=[];if("outline"in e&&e.outline){var b=e.outline;g.push({type:"CIMSolidStroke",enable:!0,width:Object(y.c)(Math.round(Object(y.d)(b.width))),color:G(b.color)})}else!t||"line-marker"!==e.type||"cross"!==e.style&&"x"!==e.style||g.push({type:"CIMSolidStroke",enable:!0,width:t,color:G(o)});g.push({type:"CIMSolidFill",enable:!0,color:G(o)});var O={type:"CIMPolygonSymbol",symbolLayers:g};v={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:Object(x.f)(-e.angle),size:Object(x.f)(e.size||6*t),offsetX:Object(x.f)(e.xoffset),offsetY:Object(x.f)(e.yoffset),frame:_,markerGraphics:[{type:"CIMMarkerGraphic",geometry:m,symbol:O}]}]}}return v}},{key:"fromCIMHatchFill",value:function(e){for(var t,n=null!=(t=e.separation)?t:4,i=n/2,r=this._getLineSymbolPeriod(e.lineSymbol)||4;r<4;)r*=2;var a=r/2;return{type:"CIMVectorMarker",frame:{xmin:-a,xmax:a,ymin:-i,ymax:i},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-a,0],[a,0]]]},symbol:e.lineSymbol}],size:n}}},{key:"_getLineSymbolPeriod",value:function(e){if(e){var t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers){var n,i=Object(l.a)(e.symbolLayers);try{for(i.s();!(n=i.n()).done;){var r=n.value,a=this._getEffectsRepeat(r.effects);if(a)return a;
1if(r){var o=this._getPlacementRepeat(r.markerPlacement);if(o)return o}}}catch(s){i.e(s)}finally{i.f()}}}return 0}},{key:"_getEffectsRepeat",value:function(e){if(e){var t,n=Object(l.a)(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i)switch(i.type){case"CIMGeometricEffectDashes":var r=i.dashTemplate;if(r&&r.length){var a,o=0,s=Object(l.a)(r);try{for(s.s();!(a=s.n()).done;){o+=a.value}}catch(u){s.e(u)}finally{s.f()}return 1&r.length&&(o*=2),o}break;case"CIMGeometricEffectWave":return i.period;default:C.error("unsupported geometric effect type ".concat(i.type))}}}catch(u){n.e(u)}finally{n.f()}}return 0}},{key:"_getPlacementRepeat",value:function(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":var t=e.placementTemplate;if(t&&t.length){var n,i=0,r=Object(l.a)(t);try{for(r.s();!(n=r.n()).done;){i+=n.value}}catch(a){r.e(a)}finally{r.f()}return 1&t.length&&(i*=2),i}}return 0}},{key:"fromCIMInsidePolygon",value:function(e){var t,n,i,a,o=e.markerPlacement,s=Object(r.a)({type:e.type},e);return s.markerPlacement=null,s.anchorPoint=null,!0===o.shiftOddRows?(n=o.stepX/2,i=o.stepY,a=2*o.stepY,t=[{x:-n,y:0},{x:n,y:0},{x:0,y:i},{x:0,y:-i}].map((function(e){return{type:"CIMMarkerGraphic",geometry:e,symbol:{type:"CIMPointSymbol",symbolLayers:[s]}}}))):(n=o.stepX/2,i=o.stepY/2,a=o.stepY,t=[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:{type:"CIMPointSymbol",symbolLayers:[s]}}]),{type:"CIMVectorMarker",frame:{xmin:-n,xmax:n,ymin:-i,ymax:i},markerGraphics:t,size:a}}},{key:"getFillColor",value:function(t){if(!t)return null;switch(t.type){case"CIMPolygonSymbol":if(t.symbolLayers){var n,i=Object(l.a)(t.symbolLayers);try{for(i.s();!(n=i.n()).done;){var r=n.value,a=e.getFillColor(r);if(null!=a)return a}}catch(o){i.e(o)}finally{i.f()}}break;case"CIMTextSymbol":return e.getFillColor(t.symbol);case"CIMSolidFill":return t.color}}},{key:"getStrokeColor",value:function(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(t.symbolLayers){var n,i=Object(l.a)(t.symbolLayers);try{for(i.s();!(n=i.n()).done;){var r=n.value,a=e.getStrokeColor(r);if(void 0!==a)return a}}catch(o){i.e(o)}finally{i.f()}}break;case"CIMTextSymbol":return e.getStrokeColor(t.symbol);case"CIMSolidStroke":return t.color}}},{key:"getStrokeWidth",value:function(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(t.symbolLayers){var n,i=Object(l.a)(t.symbolLayers);try{for(i.s();!(n=i.n()).done;){var r=n.value,a=e.getStrokeWidth(r);if(void 0!==a)return a}}catch(o){i.e(o)}finally{i.f()}}break;case"CIMTextSymbol":return e.getStrokeWidth(t.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return t.width}}},{key:"getSize",value:function(t){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":var n=0;if(t.symbolLayers){var i,r=Object(l.a)(t.symbolLayers);try{for(r.s();!(i=r.n()).done;){var a=i.value,o=e.getSize(a);o>n&&(n=o)}}catch(s){r.e(s)}finally{r.f()}}return n;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":return t.width;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":return t.size}}},{key:"getMarkerScaleRatio",value:function(e){if(e&&"CIMVectorMarker"===e.type&&!1!==e.scaleSymbolsProportionally&&e.frame){var t=e.frame.ymax-e.frame.ymin;return e.size/t}return 1}}]),e}(),E=function(){function e(){Object(o.a)(this,e)}return Object(s.a)(e,null,[{key:"rasterizeSimpleFill",value:function(e,t,n){"solid"!==t&&"none"!==t&&"esriSFSSolid"!==t&&"esriSFSNull"!==t||console.error("Unexpected: style does not require rasterization");var i=Object(d.j)(Math.ceil(n)),r=X(t)?8*i:16*i,a=2*i;e.width=r,e.height=r;var o=e.getContext("2d");o.strokeStyle="#FFFFFF",o.lineWidth=i,o.beginPath(),"vertical"!==t&&"cross"!==t&&"esriSFSCross"!==t&&"esriSFSVertical"!==t||(o.moveTo(r/2,-a),o.lineTo(r/2,r+a)),"horizontal"!==t&&"cross"!==t&&"esriSFSCross"!==t&&"esriSFSHorizontal"!==t||(o.moveTo(-a,r/2),o.lineTo(r+a,r/2)),"forward-diagonal"!==t&&"diagonal-cross"!==t&&"esriSFSDiagonalCross"!==t&&"esriSFSForwardDiagonal"!==t||(o.moveTo(-a,-a),o.lineTo(r+a,r+a),o.moveTo(r-a,-a),o.lineTo(r+a,a),o.moveTo(-a,r-a),o.lineTo(a,r+a)),"backward-diagonal"!==t&&"diagonal-cross"!==t&&"esriSFSBackwardDiagonal"!==t&&"esriSFSDiagonalCross"!==t||(o.moveTo(r+a,-a),o.lineTo(-a,r+a),o.moveTo(a,-a),o.lineTo(-a,a),o.moveTo(r+a,r-a),o.lineTo(r-a,r+a)),o.stroke();for(var s,l=o.getImageData(0,0,e.width,e.height),u=new Uint8Array(l.data),c=0;c<u.length;c+=4)s=u[c+3]/255,u[c]=u[c]*s,u[c+1]=u[c+1]*s,u[c+2]=u[c+2]*s;return[u,e.width,e.height]}},{key:"rasterizeSimpleLine",value:function(e,t){return this.rasterizeDash(e,t)}},{key:"rasterizeDash",value:function(e,t){var n="Butt"===t,r="Square"===t,a=!n&&!r;e.length%2==1&&(e=[].concat(Object(i.a)(e),Object(i.a)(e)));var o,s=15.5,u=0,c=Object(l.a)(e);try{for(c.s();!(o=c.n()).done;){u+=o.value}}catch(C){c.e(C)}finally{c.f()}var f,v=Math.round(u*s),d=new Float32Array(31*v),p=7.75,y=0,_=0,m=.5,g=!0,b=Object(l.a)(e);try{for(b.s();!(f=b.n()).done;){var x=f.value;for(y=_,_+=x*s;
1m<=_;){for(var O=.5;O<31;){var w=(O-.5)*v+m-.5,k=a?(O-s)*(O-s):Math.abs(O-s);d[w]=g?n?Math.max(Math.max(y+p-m,k),Math.max(m-_+p,k)):k:a?Math.min((m-y)*(m-y)+k,(m-_)*(m-_)+k):r?Math.min(Math.max(m-y,k),Math.max(_-m,k)):Math.min(Math.max(m-y+p,k),Math.max(_+p-m,k)),O++}m++}g=!g}}catch(C){b.e(C)}finally{b.f()}for(var S=d.length,j=new Uint8Array(4*S),P=0;P<S;++P){var T=(a?Math.sqrt(d[P]):d[P])/s;Object(h.a)(T,j,4*P)}return[j,v,31]}}]),e}(),V=function(){function e(){Object(o.a)(this,e)}return Object(s.a)(e,null,[{key:"findApplicableOverrides",value:function(t,n,i){if(n){if(t.primitiveName){var r,a=!1,o=Object(l.a)(i);try{for(o.s();!(r=o.n()).done;){if(r.value.primitiveName===t.primitiveName){a=!0;break}}}catch(w){o.e(w)}finally{o.f()}if(!a){var s,u=Object(l.a)(n);try{for(u.s();!(s=u.n()).done;){var c=s.value;c.primitiveName===t.primitiveName&&i.push(c)}}catch(w){u.e(w)}finally{u.f()}}}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects){var h,f=Object(l.a)(t.effects);try{for(f.s();!(h=f.n()).done;){var v=h.value;e.findApplicableOverrides(v,n,i)}}catch(w){f.e(w)}finally{f.f()}}if(t.symbolLayers){var d,p=Object(l.a)(t.symbolLayers);try{for(p.s();!(d=p.n()).done;){var y=d.value;e.findApplicableOverrides(y,n,i)}}catch(w){p.e(w)}finally{p.f()}}break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(t.effects){var _,m=Object(l.a)(t.effects);try{for(m.s();!(_=m.n()).done;){var g=_.value;e.findApplicableOverrides(g,n,i)}}catch(w){m.e(w)}finally{m.f()}}if(t.markerPlacement&&e.findApplicableOverrides(t.markerPlacement,n,i),"CIMVectorMarker"===t.type){if(t.markerGraphics){var b,x=Object(l.a)(t.markerGraphics);try{for(x.s();!(b=x.n()).done;){var O=b.value;e.findApplicableOverrides(O,n,i),e.findApplicableOverrides(O.symbol,n,i)}}catch(w){x.e(w)}finally{x.f()}}}else"CIMCharacterMarker"===t.type?e.findApplicableOverrides(t.symbol,n,i):"CIMHatchFill"===t.type&&e.findApplicableOverrides(t.lineSymbol,n,i)}}}},{key:"applyOverrides",value:function(t,n,i,r){if(n){var a=function(e){return e?e.charAt(0).toLowerCase()+e.substr(1):e};if(t.primitiveName){var o,s=Object(l.a)(n);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.primitiveName===t.primitiveName){var c=a(u.propertyName);if(r&&r.push({cim:t,nocapPropertyName:c,value:t[c]}),u.expression&&(u.value=e.toValue(u.propertyName,u.expression)),i){var h,f=!1,v=Object(l.a)(i);try{for(v.s();!(h=v.n()).done;){h.value.primitiveName===t.primitiveName&&(f=!0)}}catch(j){v.e(j)}finally{v.f()}f||i.push(u)}t[c]=u.value}}}catch(j){s.e(j)}finally{s.f()}}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects){var d,p=Object(l.a)(t.effects);try{for(p.s();!(d=p.n()).done;){var y=d.value;e.applyOverrides(y,n,i,r)}}catch(j){p.e(j)}finally{p.f()}}if(t.symbolLayers){var _,m=Object(l.a)(t.symbolLayers);try{for(m.s();!(_=m.n()).done;){var g=_.value;e.applyOverrides(g,n,i,r)}}catch(j){m.e(j)}finally{m.f()}}break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(t.effects){var b,x=Object(l.a)(t.effects);try{for(x.s();!(b=x.n()).done;){var O=b.value;e.applyOverrides(O,n,i,r)}}catch(j){x.e(j)}finally{x.f()}}if("CIMVectorMarker"===t.type&&t.markerGraphics){var w,k=Object(l.a)(t.markerGraphics);try{for(k.s();!(w=k.n()).done;){var S=w.value;e.applyOverrides(S,n,i,r),e.applyOverrides(S.symbol,n,i,r)}}catch(j){k.e(j)}finally{k.f()}}}}}},{key:"restoreOverrides",value:function(e){var t,n=Object(l.a)(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.cim[i.nocapPropertyName]=i.value}}catch(r){n.e(r)}finally{n.f()}}},{key:"buildOverrideKey",value:function(e){var t,n="",i=Object(l.a)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;void 0!==r.value&&(n+="".concat(r.primitiveName).concat(r.propertyName).concat(JSON.stringify(r.value)))}}catch(a){i.e(a)}finally{i.f()}return n}},{key:"toValue",value:function(e,t){if("DashTemplate"===e)return t.split(" ").map((function(e){return Number(e)}));if("Color"===e){var n=new u.a(t).toRgba();return n[3]*=255,n}return t}}]),e}(),F=function(e){if(!e)return"Butt";switch(e){case"butt":return"Butt";case"square":return"Square";case"round":return"Round"}},U=function(e){if(!e)return"Miter";switch(e){case"miter":return"Miter";case"round":return"Round";case"bevel":return"Bevel"}},B=function(e){if(!e)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center";case"justify":return"Justify"}},N=function(e){if(!e)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}}
1,G=function(e){return e?[e.r,e.g,e.b,255*e.a]:[0,0,0,0]},H=function(e,t){var n=W(t),i=q(e);return n&&i?"".concat(n,"-").concat(i):"".concat(n).concat(i)},W=function(e){if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},q=function(e){if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Y=function(e,t){var n="butt"===t;switch(e){case"dash":case"esriSLSDash":return n?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return n?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return n?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return n?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return n?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return n?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return n?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return n?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return n?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return n?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":return C.error("Unexpected: style does not require rasterization"),[0,0];default:return C.error("Tried to rasterize SLS, but found an unexpected style: ".concat(e,"!")),[0,0]}};var Z=function(e){var t,n,i=50,r=e;if("circle"===r||"esriSMSCircle"===r){var a=Math.acos(.995),o=Math.ceil(S/a/4);0===o&&(o=1),a=j/o,o*=4;var s=[];s.push([i,0]);for(var l=1;l<o;l++)s.push([i*Math.cos(l*a),-i*Math.sin(l*a)]);s.push([i,0]),t={rings:[s]},n={xmin:-i,ymin:-i,xmax:i,ymax:i}}else if("cross"===r||"esriSMSCross"===r){t={rings:[[[0,i],[0,0],[i,0],[i,-0],[0,-0],[0,-i],[-0,-i],[-0,-0],[-i,-0],[-i,0],[-0,0],[-0,i],[0,i]]]},n={xmin:-i,ymin:-i,xmax:i,ymax:i}}else if("diamond"===r||"esriSMSDiamond"===r)t={rings:[[[-i,0],[0,i],[i,0],[0,-i],[-i,0]]]},n={xmin:-i,ymin:-i,xmax:i,ymax:i};else if("square"===r||"esriSMSSquare"===r)t={rings:[[[-i,-i],[-i,i],[i,i],[i,-i],[-i,-i]]]},n={xmin:-i,ymin:-i,xmax:i,ymax:i};else if("x"===r||"esriSMSX"===r){t={rings:[[[0,0],[50,i],[i,50],[0,0],[i,-50],[50,-i],[0,-0],[-50,-i],[-i,-50],[-0,0],[-i,50],[-50,i],[0,0]]]},n={xmin:-i,ymin:-i,xmax:i,ymax:i}}else if("triangle"===r||"esriSMSTriangle"===r){var u=57.735026918962575,c=-u,h=2/3*100,f=h-100;t={rings:[[[c,f],[0,h],[u,f],[c,f]]]},n={xmin:c,ymin:f,xmax:u,ymax:h}}else"arrow"===r&&(t={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},n={xmin:-i,ymin:-i,xmax:i,ymax:i});return[n,t]},X=function(e){return"vertical"===e||"horizontal"===e||"cross"===e||"esriSFSCross"===e||"esriSFSVertical"===e||"esriSFSHorizontal"===e}},565:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var i=n(3),r=n(2),a=n(4),o=n(5),s=n(547),l=n(538),u=(n(541),n(12),n(543),n(542),n(544),n(548)),c=(n(539),n(537)),h=n(535),f=n(552),v=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.apply(this,arguments))._color=Object(s.a)(1,0,0,1),e._initialized=!1,e}return Object(r.a)(n,[{key:"dispose",value:function(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}},{key:"prepareState",value:function(e,t){var n=e.context;n.setDepthWriteEnabled(!1),n.setDepthTestEnabled(!1),n.setStencilTestEnabled(!0),n.setBlendingEnabled(!1),n.setColorMask(!1,!1,!1,!1),n.setStencilOp(7680,7680,7681),n.setStencilWriteMask(255),n.setStencilFunctionSeparate(1032,516,t.stencilRef,255)}},{key:"draw",value:function(e,t){var n=e.context;this._initialized||this._initialize(n),n.bindVAO(this._solidVertexArrayObject),n.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.dvs),this._solidProgram.setUniform2fv("u_coord_range",[t.rangeX,t.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),n.drawArrays(5,0,4),n.bindVAO()}},{key:"_initialize",value:function(e){if(this._initialized)return!0;var t=Object(u.a)(e,f.a);if(!t)return!1;var n=new Int8Array([0,0,1,0,0,1,1,1]),i=l.a.createVertex(e,35044,n
1),r=new c.a(e,f.a.attributes,{geometry:[{name:"a_pos",count:2,type:5120,offset:0,stride:2,normalized:!1,divisor:0}]},{geometry:i});return this._solidProgram=t,this._solidVertexArrayObject=r,this._initialized=!0,!0}}]),n}(h.a)},566:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i,r,a,o={exports:{}};i=o,r=function(){function e(e,n,r){r=r||2;var a,o,s,u,c,h,f,v=n&&n.length,d=v?n[0]*r:e.length,p=t(e,0,d,r,!0),y=[];if(!p||p.next===p.prev)return y;if(v&&(p=l(e,n,p,r)),e.length>80*r){a=s=e[0],o=u=e[1];for(var _=r;_<d;_+=r)(c=e[_])<a&&(a=c),(h=e[_+1])<o&&(o=h),c>s&&(s=c),h>u&&(u=h);f=0!==(f=Math.max(s-a,u-o))?1/f:0}return i(p,y,r,a,o,f),y}function t(e,t,n,i,r){var a,o;if(r===T(e,t,n,i)>0)for(a=t;a<n;a+=i)o=S(a,e[a],e[a+1],o);else for(a=n-i;a>=t;a-=i)o=S(a,e[a],e[a+1],o);if(o&&g(o,o.next)){var s=o.next;j(o),o=s}return o}function n(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!g(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{var r=i.prev;if(j(i),(i=t=r)===i.next)break;n=!0}}while(n||i!==t);return t}function i(e,t,l,u,c,h,f){if(e){!f&&h&&v(e,u,c,h);for(var d,p,y=e;e.prev!==e.next;)if(d=e.prev,p=e.next,h?a(e,u,c,h):r(e))t.push(d.i/l),t.push(e.i/l),t.push(p.i/l),j(e),e=p.next,y=p.next;else if((e=p)===y){f?1===f?i(e=o(n(e),t,l),t,l,u,c,h,2):2===f&&s(e,t,l,u,c,h):i(n(e),t,l,u,c,h,1);break}}}function r(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(y(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function a(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,l=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,u=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,c=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,h=d(s,l,t,n,i),f=d(u,c,t,n,i),v=e.prevZ,p=e.nextZ;v&&v.z>=h&&p&&p.z<=f;){if(v!==e.prev&&v!==e.next&&y(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,p!==e.prev&&p!==e.next&&y(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(;v&&v.z>=h;){if(v!==e.prev&&v!==e.next&&y(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;p&&p.z<=f;){if(p!==e.prev&&p!==e.next&&y(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.nextZ}return!0}function o(e,t,i){var r=e;do{var a=r.prev,o=r.next.next;!g(a,o)&&b(a,r,r.next,o)&&w(a,o)&&w(o,a)&&(t.push(a.i/i),t.push(r.i/i),t.push(o.i/i),j(r),j(r.next),r=e=o),r=r.next}while(r!==e);return n(r)}function s(e,t,r,a,o,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&_(l,u)){var c=k(l,u);return l=n(l,l.next),c=n(c,c.next),i(l,t,r,a,o,s),void i(c,t,r,a,o,s)}u=u.next}l=l.next}while(l!==e)}function l(e,i,r,a){var o,s,l,c=[];for(o=0,s=i.length;o<s;o++)(l=t(e,i[o]*a,o<s-1?i[o+1]*a:e.length,a,!1))===l.next&&(l.steiner=!0),c.push(p(l));for(c.sort(u),o=0;o<c.length;o++)r=n(r=h(c[o],r),r.next);return r}function u(e,t){return e.x-t.x}function c(e){if(e.next.prev===e)return e;for(var t=e;;){var n=t.next;if(n.prev===t||n===t||n===e)break;t=n}return t}function h(e,t){var i=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!n)return null;if(r===o)return n;var l,u=n,c=n.x,h=n.y,v=1/0;i=n;do{r>=i.x&&i.x>=c&&r!==i.x&&y(a<h?r:o,a,c,h,a<h?o:r,a,i.x,i.y)&&(l=Math.abs(a-i.y)/(r-i.x),w(i,e)&&(l<v||l===v&&(i.x>n.x||i.x===n.x&&f(n,i)))&&(n=i,v=l)),i=i.next}while(i!==u);return n}(e,t);if(!i)return t;var r=k(i,e),a=n(i,i.next),o=c(r);return n(o,o.next),a=c(a),c(t===i?a:t)}function f(e,t){return m(e.prev,e,t.prev)<0&&m(t.next,e,e.next)<0}function v(e,t,n,i){var r=e;do{if(null===r.z&&(r.z=d(r.x,r.y,t,n,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,v(e,t,n,i);r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,l,u=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t<u&&(s++,i=i.nextZ);t++);for(l=u;s>0||l>0&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,u*=2}while(o>1)}(r)}function d(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function p(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}
1while(t!==e);return n}function y(e,t,n,i,r,a,o,s){return(r-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&b(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(w(e,t)&&w(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(m(e.prev,e,t.prev)||m(e,t.prev,t))||g(e,t)&&m(e.prev,e,e.next)>0&&m(t.prev,t,t.next)>0)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function g(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,n,i){var r=O(m(e,t,n)),a=O(m(e,t,i)),o=O(m(n,i,e)),s=O(m(n,i,t));return r!==a&&o!==s||!(0!==r||!x(e,n,t))||!(0!==a||!x(e,i,t))||!(0!==o||!x(n,e,i))||!(0!==s||!x(n,t,i))}function x(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function O(e){return e>0?1:e<0?-1:0}function w(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function k(e,t){var n=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function S(e,t,n,i){var r=new P(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(e,t,n,i){for(var r=0,a=t,o=n-i;a<n;a+=i)r+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return r}return e.deviation=function(e,t,n,i){var r=t&&t.length,a=r?t[0]*n:e.length,o=Math.abs(T(e,0,a,n));if(r)for(var s=0,l=t.length;s<l;s++){var u=t[s]*n,c=s<l-1?t[s+1]*n:e.length;o-=Math.abs(T(e,u,c,n))}var h=0;for(s=0;s<i.length;s+=3){var f=i[s]*n,v=i[s+1]*n,d=i[s+2]*n;h+=Math.abs((e[f]-e[d])*(e[v+1]-e[f+1])-(e[f]-e[v])*(e[d+1]-e[f+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,r=0;r<e.length;r++){for(var a=0;a<e[r].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[r][a][o]);r>0&&(i+=e[r-1].length,n.holes.push(i))}return n},e},void 0!==(a=r())&&(i.exports=a);var s=o.exports},567:function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var i=n(3),r=n(2),a=n(4),o=n(5),s=n(547),l=n(538),u=(n(541),n(12),n(543),n(542),n(544),n(548)),c=n(539),h=n(537),f=n(535),v=n(552),d=n(558),p={shaders:{vertexShader:Object(d.a)("tileInfo/tileInfo.vert"),fragmentShader:Object(d.a)("tileInfo/tileInfo.frag")},attributes:new Map([["a_pos",0]])},y=300,_=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.apply(this,arguments))._color=Object(s.a)(1,0,0,1),e}return Object(r.a)(n,[{key:"dispose",value:function(){this._outlineProgram&&(this._outlineProgram.dispose(),this._outlineProgram=null),this._tileInfoProgram&&(this._tileInfoProgram.dispose(),this._tileInfoProgram=null),this._outlineVertexArrayObject&&(this._outlineVertexArrayObject.dispose(),this._outlineVertexArrayObject=null),this._tileInfoVertexArrayObject&&(this._tileInfoVertexArrayObject.dispose(),this._tileInfoVertexArrayObject=null),this._canvas=null}},{key:"prepareState",value:function(e){var t=e.context;t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(1,771,1,771),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1)}},{key:"draw",value:function(e,t){var n=e.context;if(t.isReady){this._loadWGLResources(n),n.bindVAO(this._outlineVertexArrayObject),n.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.dvs),this._outlineProgram.setUniform2f("u_coord_range",t.rangeX,t.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),n.drawArrays(3,0,4);var i=this._getTexture(n,t);i?(n.bindVAO(this._tileInfoVertexArrayObject),n.useProgram(this._tileInfoProgram),n.bindTexture(i,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",t.transforms.dvs),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",t.rangeX/t.width,t.rangeY/t.height),this._tileInfoProgram.setUniform2f("u_delta",8,8),this._tileInfoProgram.setUniform2f("u_dimensions",i.descriptor.width,i.descriptor.height),n.drawArrays(5,0,4),n.bindVAO()):n.bindVAO()}}},{key:"_loadWGLResources",value:function(e){if(!this._outlineProgram||!this._tileInfoProgram){var t=Object(u.a)(e,v.a),n=Object(u.a)(e,p),i={geometry:[{name:"a_pos",count:2,type:5120,offset:0,stride:2,normalized:!1,divisor:0}]},r=new Int8Array([0,0,1,0,1,1,0,1]),a=l.a.createVertex(e,35044,r),o=new h.a(e,v.a.attributes,i,{geometry:a}
1),s=new Int8Array([0,0,1,0,0,1,1,1]),c=l.a.createVertex(e,35044,s),f=new h.a(e,p.attributes,i,{geometry:c});this._outlineProgram=t,this._tileInfoProgram=n,this._outlineVertexArrayObject=o,this._tileInfoVertexArrayObject=f}}},{key:"_getTexture",value:function(e,t){if(t.texture&&t.triangleCountReportedInDebug===t.triangleCount)return t.texture;t.triangleCountReportedInDebug=t.triangleCount,this._canvas||(this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","canvas2d"),this._canvas.setAttribute("width","".concat(y)),this._canvas.setAttribute("height","".concat(32)),this._canvas.setAttribute("style","display:none"));var n=t.triangleCount,i=t.key.id;t.triangleCount>0&&(i+=", ".concat(n));var r=this._canvas,a=r.getContext("2d");return a.font="24px sans-serif",a.textAlign="left",a.textBaseline="top",a.clearRect(0,0,y,32),n>1e5?(a.fillStyle="red",a.fillRect(0,0,y,32),a.fillStyle="black"):(a.clearRect(0,0,y,32),a.fillStyle="blue"),a.fillText(i,0,0),t.texture=new c.a(e,{target:3553,pixelFormat:6408,dataType:5121,samplingMode:9728,wrapMode:33071},r),t.texture}}]),n}(f.a)},569:function(e,t,n){"use strict";n.d(t,"a",(function(){return Q}));var i=n(581),r=n(3),a=n(2),o=n(4),s=n(5),l=n(531),u=n(556),c=n(535),h={nearest:{defines:[],samplingMode:9728,mips:!1},bilinear:{defines:[],samplingMode:9729,mips:!1},bicubic:{defines:["bicubic"],samplingMode:9729,mips:!1},trilinear:{defines:[],samplingMode:9987,mips:!0}},f=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments))._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_position",0],["a_texcoord",1]])},e}return Object(a.a)(n,[{key:"dispose",value:function(){this._quad&&this._quad.dispose()}},{key:"prepareState",value:function(e,t){var n=e.context;n.setBlendingEnabled(!0),"additive"===t.blendFunction?n.setBlendFunctionSeparate(1,1,1,1):n.setBlendFunctionSeparate(1,771,1,771),n.setColorMask(!0,!0,!0,!0),n.setStencilWriteMask(0),n.setStencilTestEnabled(!0),n.setStencilFunction(514,t.stencilRef,255)}},{key:"draw",value:function(e,t){var n=e.context,i=e.renderingOptions,r=e.painter;if(t.source){e.timeline.begin(this.name),this._quad||(this._quad=new u.a(n,[0,0,1,0,0,1,1,1]));var a=function(e,t,n){if("dynamic"===n.samplingMode){var i=e.state,r=t.resolution/t.pixelRatio/i.resolution,a=Math.round(e.pixelRatio)!==e.pixelRatio,o=r>1.05||r<.95;return i.rotation||o||a||t.isSourceScaled||t.rotation?h.bilinear:h.nearest}return h[n.samplingMode]}(e,t,i),o=r.materialManager.getProgram(e,this._desc,a.defines),s=t.coordScale,c=t.computedOpacity,f=t.transforms;t.setSamplingProfile(a),t.bind(e.context,l.C),n.useProgram(o),o.setUniformMatrix3fv("u_dvsMat3",f.dvs),o.setUniform1i("u_texture",l.C),o.setUniform2fv("u_coordScale",s),o.setUniform1f("u_opacity",c),this._quad.draw(),e.timeline.end(this.name)}}}]),n}(c.a),v=n(7),d=n(547),p=n(533),y=n(552),_=n(548),m=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments))._color=Object(d.a)(0,1,0,1),e}return Object(a.a)(n,[{key:"dispose",value:function(){this._program&&this._program.dispose()}},{key:"prepareState",value:function(e){var t=e.context;t.setStencilTestEnabled(!0),t.setBlendingEnabled(!1),t.setFaceCullingEnabled(!1),t.setColorMask(!1,!1,!1,!1),t.setStencilOp(7680,7680,7681),t.setStencilWriteMask(255),t.setStencilFunction(519,0,255)}},{key:"draw",value:function(e,t){var n=e.context,i=e.state,r=Object(p.g)("clip",{geometry:[{location:0,name:"a_pos",count:2,type:5122}]}),a=t.getVAO(n,i,r.attributes,r.bufferLayouts);Object(v.j)(a.indexBuffer)||(this._program||(this._program=Object(_.a)(n,y.a)),n.useProgram(this._program),this._program.setUniform2fv("u_coord_range",[1,1]),this._program.setUniform4fv("u_color",this._color),this._program.setUniformMatrix3fv("u_dvsMat3",i.displayMat3),n.bindVAO(a),n.drawElements(4,a.indexBuffer.size,5125,0),n.bindVAO())}}]),n}(c.a),g=n(567),b=n(565),x=n(11),O=n(74),w=n(303),k=n(538),S=(n(541),n(12),n(543),n(542),n(544),n(539)),j=n(537),P=n(532),T=n(534),C=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments))._color=Object(d.a)(1,0,0,1),e._patternMatrix=Object(w.b)(),e._programOptions={id:!1,pattern:!1},e}return Object(a.a)(n,[{key:"dispose",value:function(){this._vao&&(this._vao.dispose(),this._vao=null)}},{key:"drawMany",value:function(e,t){var n=e.context,i=e.painter,r=e.styleLayerUID;this._loadWGLResources(e);var a,o,s=e.displayLevel,u=e.styleLayer,c=u.backgroundMaterial,h=i.vectorTilesMaterialManager,f=u.getPaintValue("background-color",s),d=u.getPaintValue("background-opacity",s),p=u.getPaintValue("background-pattern",s),y=void 0!==p,_=f[3]*d,m=1|window.devicePixelRatio,g=e.spriteMosaic,b=m>l.M?2:1,w=e.drawPhase===P.c.HITTEST,k=this._programOptions;k.id=w,k.pattern=y;var S=h.getMaterialProgram(n,c,k);if(n.bindVAO(this._vao),n.useProgram(S),y){var j=g.getMosaicItemPosition(p,!0);if(Object(v.k)(j)){var C=j.tl,M=j.br,I=j.page;a=M[0]-C[0],o=M[1]-C[1];var L=g.getPageSize(I);Object(v.k)(L)&&(g.bind(n,9729,I,l.O),S.setUniform4f("u_tlbr",C[0],C[1],M[0],M[1]),S.setUniform2fv("u_mosaicSize",L),S.setUniform1i("u_texture",l.O))}S.setUniform1f("u_opacity",d)}else this._color[0]=_*f[0],this._color[1]=_*f[1],this._color[2]=_*f[2],this._color[3]=_,S.setUniform4fv("u_color",this._color);if(S.setUniform1f("u_depth",u.z||0),w){var A=Object(T.c)(r+1);S.setUniform4fv("u_id",A)}var D,z=Object(x.a)(t);try{for(z.s();!(D=z.n()).done;){var R=D.value;if(S.setUniform1f("u_coord_range",R.rangeX),S.setUniformMatrix3fv("u_dvsMat3",R.transforms.dvs),y){var E=Math.max(Math.pow(2,Math.round(s)-R.key.level),1),V=b*R.width*E,F=V/Object(O.j)(a),U=V/Object(O.j)(o);this._patternMatrix[0]=F,this._patternMatrix[4]=U,S.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}n.setStencilFunction(514,R.stencilRef,255),n.drawArrays(5,0,4)}}catch(B){z.e(B)}finally{z.f()}}},{key:"_loadWGLResources",value:function(e){if(!this._vao){var t=e.context,n=e.styleLayer.backgroundMaterial,i=new Int8Array([0,0,1,0,0,1,1,1]),r=k.a.createVertex(t,35044,i),a=new j.a(t,n.getAttributeLocations(),n.getLayoutInfo(),{geometry:r});this._vao=a}}}]),n}(c.a),M=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments))._programOptions={id:!1},e}return Object(a.a)(n,[{key:"dispose",value:function(){}},{key:"drawMany",value:function(e,t){var n=e.context,i=e.displayLevel,r=e.requiredLevel,a=e.state,o=e.drawPhase,s=e.painter,l=e.spriteMosaic,u=e.styleLayerUID;if(t.some((function(e){var t,n;return null!=(t=null==(n=e.layerData.get(u))?void 0:n.circleIndexCount)&&t}))){var c=e.styleLayer,h=c.circleMaterial,f=s.vectorTilesMaterialManager,d=c.getPaintValue("circle-translate",i
1),p=c.getPaintValue("circle-translate-anchor",i),y=o===P.c.HITTEST,_=this._programOptions;_.id=y;var m=f.getMaterialProgram(n,h,_);n.useProgram(m),m.setUniformMatrix3fv("u_displayMat3",1===p?a.displayMat3:a.displayViewMat3),m.setUniform2fv("u_circleTranslation",d),m.setUniform1f("u_depth",c.z),m.setUniform1f("u_antialiasingWidth",1.2);var g=-1;if(y){var b=Object(T.c)(u+1);m.setUniform4fv("u_id",b)}var O,w=Object(x.a)(t);try{for(w.s();!(O=w.n()).done;){var k=O.value;if(k.layerData.has(u)){k.key.level!==g&&(g=k.key.level,h.setDataUniforms(m,i,c,g,l));var S=k.layerData.get(u);if(S.circleIndexCount){S.prepareForRendering(n);var j=S.circleVertexArrayObject;Object(v.j)(j)||(n.bindVAO(j),m.setUniformMatrix3fv("u_dvsMat3",k.transforms.dvs),r!==k.key.level?n.setStencilFunction(514,k.stencilRef,255):n.setStencilFunction(516,255,255),n.drawElements(4,S.circleIndexCount,5125,Uint32Array.BYTES_PER_ELEMENT*S.circleIndexStart),k.triangleCount+=S.circleIndexCount/3)}}}}catch(C){w.e(C)}finally{w.f()}}}}]),n}(c.a),I=n(23),L=1/65536,A=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments))._fillProgramOptions={id:!1,pattern:!1},e._outlineProgramOptions={id:!1},e}return Object(a.a)(n,[{key:"dispose",value:function(){}},{key:"drawMany",value:function(e,t){var n,i=e.displayLevel,r=e.drawPhase,a=e.renderPass,o=e.spriteMosaic,s=e.styleLayerUID,l=!1,u=Object(x.a)(t);try{for(u.s();!(n=u.n()).done;){var c=n.value;if(c.layerData.has(s)){var h=c.layerData.get(s);if(h.fillIndexCount>0||h.outlineIndexCount>0){l=!0;break}}}}catch(I){u.e(I)}finally{u.f()}if(l){var f,v=e.styleLayer,d=v.getPaintProperty("fill-pattern"),p=void 0!==d,y=p&&d.isDataDriven;if(p&&!y){var _=d.getValue(i);f=o.getMosaicItemPosition(_,!0)}var m=!p&&v.getPaintValue("fill-antialias",i),g=!0,b=1;if(!p){var O=v.getPaintProperty("fill-color"),w=v.getPaintProperty("fill-opacity");if(!(null!=O&&O.isDataDriven||null!=w&&w.isDataDriven)){var k=v.getPaintValue("fill-color",i);(b=v.getPaintValue("fill-opacity",i)*k[3])>=1&&(g=!1)}}if(!g||"opaque"!==a){var S;r===P.c.HITTEST&&(S=Object(T.c)(s+1));var j=v.getPaintValue("fill-translate",i),C=v.getPaintValue("fill-translate-anchor",i);(g||"translucent"!==a)&&this._drawFill(e,s,v,t,j,C,p,f,y,S);var M=!v.hasDataDrivenOutlineColor&&v.outlineUsesFillColor&&b<1;m&&"opaque"!==a&&!M&&this._drawOutline(e,s,v,t,j,C,S)}}}},{key:"_drawFill",value:function(e,t,n,i,r,a,o,s,u,c){if(!o||u||!Object(v.j)(s)){var h=e.context,f=e.displayLevel,d=e.state,p=e.drawPhase,y=e.painter,_=e.pixelRatio,m=e.spriteMosaic,g=n.fillMaterial,b=y.vectorTilesMaterialManager,O=_>l.M?2:1,w=p===P.c.HITTEST,k=this._fillProgramOptions;k.id=w,k.pattern=o;var S=b.getMaterialProgram(h,g,k);if(h.useProgram(S),Object(v.k)(s)){var j=s.page,T=m.getPageSize(j);Object(v.k)(T)&&(m.bind(h,9729,j,l.O),S.setUniform2fv("u_mosaicSize",T),S.setUniform1i("u_texture",l.O))}S.setUniformMatrix3fv("u_displayMat3",1===a?d.displayMat3:d.displayViewMat3),S.setUniform2fv("u_fillTranslation",r),S.setUniform1f("u_depth",n.z+L),w&&S.setUniform4fv("u_id",c);var C,M=-1,A=Object(x.a)(i);try{for(A.s();!(C=A.n()).done;){var D=C.value;if(D.layerData.has(t)){D.key.level!==M&&(M=D.key.level,g.setDataUniforms(S,f,n,M,m));var z=D.layerData.get(t);if(z.fillIndexCount){z.prepareForRendering(h);var R=z.fillVertexArrayObject;if(!Object(v.j)(R)){if(h.bindVAO(R),S.setUniformMatrix3fv("u_dvsMat3",D.transforms.dvs),h.setStencilFunction(514,D.stencilRef,255),o){var E=Math.max(Math.pow(2,Math.round(f)-D.key.level),1),V=D.rangeX/(O*D.width*E);S.setUniform1f("u_patternFactor",V)}if(u){var F=z.patternMap;if(!F)continue;var U,B=Object(x.a)(F);try{for(B.s();!(U=B.n()).done;){var N=Object(I.a)(U.value,2),G=N[0],H=N[1],W=m.getPageSize(G);Object(v.k)(W)&&(m.bind(h,9729,G,l.O),S.setUniform2fv("u_mosaicSize",W),S.setUniform1i("u_texture",l.O),h.drawElements(4,H[1],5125,Uint32Array.BYTES_PER_ELEMENT*H[0]))}}catch(q){B.e(q)}finally{B.f()}}else h.drawElements(4,z.fillIndexCount,5125,Uint32Array.BYTES_PER_ELEMENT*z.fillIndexStart);D.triangleCount+=z.fillIndexCount/3}}}}}
1catch(q){A.e(q)}finally{A.f()}}}},{key:"_drawOutline",value:function(e,t,n,i,r,a,o){var s=e.context,l=e.displayLevel,u=e.state,c=e.drawPhase,h=e.painter,f=e.pixelRatio,d=e.spriteMosaic,p=n.outlineMaterial,y=h.vectorTilesMaterialManager,_=.75/f,m=c===P.c.HITTEST,g=this._outlineProgramOptions;g.id=m;var b=y.getMaterialProgram(s,p,g);s.useProgram(b),b.setUniformMatrix3fv("u_displayMat3",1===a?u.displayMat3:u.displayViewMat3),b.setUniform2fv("u_fillTranslation",r),b.setUniform1f("u_depth",n.z+L),b.setUniform1f("u_outline_width",_),m&&b.setUniform4fv("u_id",o);var O,w=-1,k=Object(x.a)(i);try{for(k.s();!(O=k.n()).done;){var S=O.value;if(S.layerData.has(t)){S.key.level!==w&&(w=S.key.level,p.setDataUniforms(b,l,n,w,d));var j=S.layerData.get(t);if(j.prepareForRendering(s),j.outlineIndexCount){var T=j.outlineVertexArrayObject;Object(v.j)(T)||(s.bindVAO(T),b.setUniformMatrix3fv("u_dvsMat3",S.transforms.dvs),s.setStencilFunction(514,S.stencilRef,255),s.drawElements(4,j.outlineIndexCount,5125,Uint32Array.BYTES_PER_ELEMENT*j.outlineIndexStart),S.triangleCount+=j.outlineIndexCount/3)}}}}catch(C){k.e(C)}finally{k.f()}}}]),n}(c.a),D=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments))._programOptions={id:!1,pattern:!1,sdf:!1},e}return Object(a.a)(n,[{key:"dispose",value:function(){}},{key:"drawMany",value:function(e,t){var n=e.context,i=e.displayLevel,r=e.state,a=e.drawPhase,o=e.painter,s=e.pixelRatio,u=e.spriteMosaic,c=e.styleLayerUID;if(t.some((function(e){var t,n;return null!=(t=null==(n=e.layerData.get(c))?void 0:n.lineIndexCount)&&t}))){var h,f,d=e.styleLayer,p=d.lineMaterial,y=o.vectorTilesMaterialManager,_=d.getPaintValue("line-translate",i),m=d.getPaintValue("line-translate-anchor",i),g=d.getPaintProperty("line-pattern"),b=void 0!==g,O=b&&g.isDataDriven;if(b&&!O){var w=g.getValue(i);h=u.getMosaicItemPosition(w)}var k=!1;if(!b){var S=d.getPaintProperty("line-dasharray");if(k=(f=void 0!==S)&&S.isDataDriven,f&&!k){var j=S.getValue(i),C=d.getDashKey(j,d.getLayoutValue("line-cap",i));h=u.getMosaicItemPosition(C)}}var M=1/s,L=a===P.c.HITTEST,A=this._programOptions;A.id=L,A.pattern=b,A.sdf=f;var D=y.getMaterialProgram(n,p,A);if(n.useProgram(D),D.setUniformMatrix3fv("u_displayViewMat3",r.displayViewMat3),D.setUniformMatrix3fv("u_displayMat3",1===m?r.displayMat3:r.displayViewMat3),D.setUniform2fv("u_lineTranslation",_),D.setUniform1f("u_depth",d.z),D.setUniform1f("u_antialiasing",M),L){var z=Object(T.c)(c+1);D.setUniform4fv("u_id",z)}if(h&&Object(v.k)(h)){var R=h.page,E=u.getPageSize(R);Object(v.k)(E)&&(u.bind(n,9729,R,l.O),D.setUniform2fv("u_mosaicSize",E),D.setUniform1i("u_texture",l.O))}var V,F=-1,U=Object(x.a)(t);try{for(U.s();!(V=U.n()).done;){var B=V.value;if(B.layerData.has(c)){B.key.level!==F&&(F=B.key.level,p.setDataUniforms(D,i,d,F,u));var N=Math.pow(2,i-F)/s;D.setUniform1f("u_zoomFactor",N);var G=B.layerData.get(c);if(G.lineIndexCount){G.prepareForRendering(n);var H=G.lineVertexArrayObject;if(!Object(v.j)(H)){if(n.bindVAO(H),D.setUniformMatrix3fv("u_dvsMat3",B.transforms.dvs),n.setStencilFunction(514,B.stencilRef,255),O||k){var W=G.patternMap;if(!W)continue;var q,Y=Object(x.a)(W);try{for(Y.s();!(q=Y.n()).done;){var Z=Object(I.a)(q.value,2),X=Z[0],K=Z[1],J=u.getPageSize(X);Object(v.k)(J)&&(u.bind(n,9729,X,l.O),D.setUniform2fv("u_mosaicSize",J),D.setUniform1i("u_texture",l.O),n.drawElements(4,K[1],5125,Uint32Array.BYTES_PER_ELEMENT*K[0]))}}catch(Q){Y.e(Q)}finally{Y.f()}}else n.drawElements(4,G.lineIndexCount,5125,Uint32Array.BYTES_PER_ELEMENT*G.lineIndexStart);B.triangleCount+=G.lineIndexCount/3}}}}}catch(Q){U.e(Q)}finally{U.f()}}}}]),n}(c.a),z=n(374),R=n(574),E=n(553),V=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments))._iconProgramOptions={id:!1,sdf:!1},e._sdfProgramOptions={id:!1},e._spritesTextureSize=Object(z.a)(),e}return Object(a.a)(n,[{key:"dispose",value:function(){}},{key:"drawMany",value:function(e,t){var n,i=e.drawPhase,r=e.styleLayerUID,a=e.styleLayer;i===P.c.HITTEST&&(n=Object(T.c)(r+1)),this._drawIcons(e,a,t,n),this._drawText(e,a,t,n)}},{key:"_drawIcons",value:function(e,t,n,i){var r,a,o=e.context,s=e.displayLevel,u=e.drawPhase,c=e.painter,h=e.spriteMosaic,f=e.state,d=e.styleLayerUID,p=t.iconMaterial,y=c.vectorTilesMaterialManager,_=!1,m=Object(x.a)(n);try{for(m.s();!(a=m.n()).done;){var g=a.value;if(g.layerData.has(d)&&(r=g.layerData.get(d)).iconPerPageElementsMap.size>0){_=!0;break}}}catch(H){m.e(H)}finally{m.f()}if(_){var b=t.getPaintValue("icon-translate",s),O=t.getPaintValue("icon-translate-anchor",s),w=t.getLayoutValue("icon-rotation-alignment",s);2===w&&(w=0===t.getLayoutValue("symbol-placement",s)?1:0);var k=0===w,S=t.getLayoutValue("icon-keep-upright",s)&&k,j=r.isIconSDF,T=u===P.c.HITTEST,C=this._iconProgramOptions;C.id=T,C.sdf=j;var M=y.getMaterialProgram(o,p,C);o.useProgram(M),M.setUniformMatrix3fv("u_displayViewMat3",0===w?f.displayViewMat3:f.displayMat3),M.setUniformMatrix3fv("u_displayMat3",1===O?f.displayMat3:f.displayViewMat3),M.setUniform2fv("u_iconTranslation",b),M.setUniform1f("u_depth",t.z),M.setUniform1f("u_mapRotation",Object(E.b)(f.rotation)),M.setUniform1f("u_keepUpright",S?1:0),M.setUniform1f("u_level",10*s),M.setUniform1i("u_texture",l.O),M.setUniform1f("u_fadeDuration",R.d/1e3),T&&M.setUniform4fv("u_id",i);var L,A=-1,D=Object(x.a)(n);try{for(D.s();!(L=D.n()).done;){var z=L.value;if(z.layerData.has(d)&&(z.key.level!==A&&(A=z.key.level,p.setDataUniforms(M,s,t,A,h)),0!==(r=z.layerData.get(d)).iconPerPageElementsMap.size)){r.prepareForRendering(o),r.updateOpacityInfo();var V=r.iconVertexArrayObject;if(!Object(v.j)(V)){o.bindVAO(V),M.setUniformMatrix3fv("u_dvsMat3",z.transforms.dvs),M.setUniform1f("u_time",(performance.now()-r.lastOpacityUpdate)/1e3);var F,U=Object(x.a)(r.iconPerPageElementsMap);try{for(U.s();!(F=U.n()).done;){var B=Object(I.a)(F.value,2),N=B[0],G=B[1];this._renderIconRange(e,M,G,N,z)}}catch(H){U.e(H)}finally{U.f()}}}}}catch(H){D.e(H)}finally{D.f()}}}},{key:"_renderIconRange",value:function(e,t,n,i,r){var a=e.context,o=e.spriteMosaic;this._spritesTextureSize[0]=o.getWidth(i)/4,this._spritesTextureSize[1]=o.getHeight(i)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),o.bind(a,9729,i,l.O),a.setStencilTestEnabled(!0),a.setStencilFunction(516,255,255),a.setStencilWriteMask(0),a.drawElements(4,n[1],5125,Uint32Array.BYTES_PER_ELEMENT*n[0]),r.triangleCount+=n[1]/3}},{key:"_drawText",value:function(e,t,n,i){var r,a,o=this,s=e.context,u=e.displayLevel,c=e.drawPhase,h=e.glyphMosaic,f=e.painter,d=e.pixelRatio,p=e.spriteMosaic,y=e.state,_=e.styleLayerUID,m=t.textMaterial,g=f.vectorTilesMaterialManager,b=!1,O=Object(x.a)(n);try{for(O.s();!(a=O.n()).done;){var w=a.value;if(w.layerData.has(_)&&(r=w.layerData.get(_)).glyphPerPageElementsMap.size>0){b=!0;break}}}catch(Y){O.e(Y)}finally{O.f()}if(b){var k=t.getPaintProperty("text-opacity");if(!k||k.isDataDriven||0!==k.getValue(u)){var S=t.getPaintProperty("text-color"),j=!S||S.isDataDriven||S.getValue(u)[3]>0,T=t.getPaintProperty("text-halo-width"),C=t.getPaintProperty("text-halo-color"),M=(!T||T.isDataDriven||T.getValue(u)>0)&&(!C||C.isDataDriven||C.getValue(u)[3]>0);if(j||M){var I=t.getLayoutValue("text-rotation-alignment",u);2===I&&(I=0===t.getLayoutValue("symbol-placement",u)?1:0);var L=0===I,A=t.getLayoutValue("text-keep-upright",u)&&L,D=c===P.c.HITTEST,V=.8*3/d;this._glyphTextureSize||(this._glyphTextureSize=Object(z.b)(h.width/4,h.height/4));var F=t.getPaintValue("text-translate",u),U=t.getPaintValue("text-translate-anchor",u),B=this._sdfProgramOptions;B.id=D;var N=g.getMaterialProgram(s,m,B);s.useProgram(N),N.setUniformMatrix3fv("u_displayViewMat3",0===I?y.displayViewMat3:y.displayMat3),N.setUniformMatrix3fv("u_displayMat3",1===U?y.displayMat3:y.displayViewMat3),N.setUniform2fv("u_textTranslation",F),N.setUniform1f("u_depth",t.z+152587890625e-16),N.setUniform2fv("u_mosaicSize",this._glyphTextureSize),N.setUniform1f("u_mapRotation",Object(E.b)(y.rotation)),N.setUniform1f("u_keepUpright",A?1:0),N.setUniform1f("u_level",10*u),N.setUniform1i("u_texture",l.N),N.setUniform1f("u_antialiasingWidth",V),N.setUniform1f("u_fadeDuration",R.d/1e3),D&&N.setUniform4fv("u_id",i);var G,H=-1,W=Object(x.a)(n);try{var q=function(){var e=G.value;if(!e.layerData.has(_))return"continue";if(e.key.level!==H&&(H=e.key.level,m.setDataUniforms(N,u,t,H,p)),0===(r=e.layerData.get(_)).glyphPerPageElementsMap.size)return"continue";r.prepareForRendering(s),r.updateOpacityInfo();var n=r.textVertexArrayObject;if(Object(v.j)(n))return"continue";s.bindVAO(n),N.setUniformMatrix3fv("u_dvsMat3",e.transforms.dvs),s.setStencilTestEnabled(!0),s.setStencilFunction(516,255,255),s.setStencilWriteMask(0);var i=(performance.now()-r.lastOpacityUpdate)/1e3;
1N.setUniform1f("u_time",i),r.glyphPerPageElementsMap.forEach((function(t,n){o._renderGlyphRange(s,t,n,h,N,M,j,e)}))};for(W.s();!(G=W.n()).done;)q()}catch(Y){W.e(Y)}finally{W.f()}}}}}},{key:"_renderGlyphRange",value:function(e,t,n,i,r,a,o,s){i.bind(e,9729,n,l.N),a&&(r.setUniform1f("u_halo",1),e.drawElements(4,t[1],5125,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3),o&&(r.setUniform1f("u_halo",0),e.drawElements(4,t[1],5125,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3)}}]),n}(c.a),F=n(402),U=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"prepareState",value:function(e,t,n){var i=e.context,r=n&&-1!==n.indexOf("id");i.setBlendingEnabled(!r),i.setBlendFunctionSeparate(1,771,1,771),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!0),i.setStencilFunction(514,t.stencilRef,255)}},{key:"draw",value:function(e,t,n){var i=this,r=this.getGeometryType();t.commit(e);var a=t.getGeometry(r);Object(v.j)(a)||(e.timeline.begin(this.name),e.attributeView.bindTextures(e.context),a.forEachCommand((function(r){return i.drawGeometry(e,t,r,n)})))}},{key:"_setSharedUniforms",value:function(e,t,n){var i=t.displayLevel,r=t.pixelRatio,a=t.state;e.setUniform1f("u_pixelRatio",r),e.setUniformMatrix3fv("u_dvsMat3",n.transforms.dvs,!1,!0),e.setUniformMatrix3fv("u_displayViewMat3",a.displayViewMat3,!1,!0),e.setUniform1f("u_currentZoom",Math.round(i*l.t)),e.setUniform1i("u_attributeTextureSize",t.attributeView.size),e.setUniform1i("u_attributeData0",l.y),e.setUniform1i("u_attributeData1",l.z),e.setUniform1i("u_attributeData2",l.A),e.setUniform1i("u_attributeData3",l.B)}},{key:"_setSizeVVUniforms",value:function(e,t,n,i){if(e.vvSizeMinMaxValue&&t.setUniform4fv("u_vvSizeMinMaxValue",n.vvSizeMinMaxValue),e.vvSizeScaleStops&&t.setUniform1f("u_vvSizeScaleStopsValue",n.vvSizeScaleStopsValue),e.vvSizeFieldStops){var r=n.getSizeVVFieldStops(i.key.level);t.setUniform1fv("u_vvSizeFieldStopsValues",r.values),t.setUniform1fv("u_vvSizeFieldStopsSizes",r.sizes)}e.vvSizeUnitValue&&t.setUniform1f("u_vvSizeUnitValueWorldToPixelsRatio",n.vvSizeUnitValueToPixelsRatio)}},{key:"_setColorAndOpacityVVUniforms",value:function(e,t,n){e.vvColor&&(t.setUniform1fv("u_vvColorValues",n.vvColorValues),t.setUniform4fv("u_vvColors",n.vvColors)),e.vvOpacity&&(t.setUniform1fv("u_vvOpacityValues",n.vvOpacityValues),t.setUniform1fv("u_vvOpacities",n.vvOpacities))}},{key:"_setRotationVVUniforms",value:function(e,t,n){e.vvRotation&&t.setUniform1f("u_vvRotationType","geographic"===n.vvMaterialParameters.vvRotationType?0:1)}}]),n}(c.a),B=n(536),N=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments))._dotTextureSize=0,e._dotTextures=null,e._dotSamplers=new Int32Array([l.G,l.H]),e}return Object(a.a)(n,[{key:"dispose",value:function(){this._disposeTextures()}},{key:"getGeometryType",value:function(){return P.d.FILL}},{key:"drawGeometry",value:function(e,t,n,i){var r=e.context,a=e.painter,o=e.rendererInfo,s=e.requiredLevel,u=B.a.load(n.materialKey),c=function(e){var t={geometry:[{location:0,name:"a_pos",count:2,type:5122},{location:1,name:"a_id",count:3,type:5121},{location:2,name:"a_bitset",count:1,type:5121}]};return e.dotDensity?(t.geometry.push({location:3,name:"a_inverseArea",count:1,type:5126}),Object(p.g)(e.data,t)):(t.geometry.push({location:3,name:"a_color",count:4,type:5121,normalized:!0}),e.simple||t.geometry.push({location:4,name:"a_aux1",count:4,type:5123}),t.geometry.push({location:5,name:"a_aux2",count:4,type:5121},{location:6,name:"a_aux3",count:4,type:5121}),e.simple||t.geometry.push({location:7,name:"a_zoomRange",count:2,type:5123}),Object(p.g)(e.data,t))}(u),h=c.bufferLayouts,f=c.attributes,v=a.materialManager.getMaterialProgram(e,u,"materials/fill",f,i);if(r.useProgram(v),this._setSharedUniforms(v,e,t),v.setUniform2f("u_tileOffset",512*t.key.col,512*t.key.row),u.textureBinding){a.textureManager.bindTextures(r,v,u);var d=1/Math.pow(2,s-t.key.level)/e.pixelRatio;v.setUniform1f("u_zoomFactor",d)}var y=1/e.pixelRatio;if(v.setUniform1f("u_blur",y),v.setUniform1f("u_antialiasing",y),this._setSizeVVUniforms(u,v,o,t),this._setColorAndOpacityVVUniforms(u,v,o),u.dotDensity){var _=l.L/o.ddDotSize,m=_*window.devicePixelRatio*_*window.devicePixelRatio,g=1/Math.pow(2,s-t.key.level),b=1/g*(1/g),x=o.ddDotScale?e.state.scale/o.ddDotScale:1;v.setUniform1f("u_tileZoomFactor",g),v.setUniform1f("u_tileDotsOverArea",m/(l.L*window.devicePixelRatio*l.L*window.devicePixelRatio)),v.setUniformMatrix4fv("u_dotColors",o.ddColors),v.setUniform4fv("u_isActive",o.ddActiveDots),v.setUniform4fv("u_dotBackgroun
1dColor",o.ddBackgroundColor),v.setUniform1f("u_dotValue",Math.max(1,o.ddDotValue*x*b)),this._bindDotDensityTextures(r,v,o,_)}n.draw(r,h,f)}},{key:"_disposeTextures",value:function(){if(this._dotTextures){for(var e=0;e<this._dotTextures.length;e++)this._dotTextures[e].dispose();this._dotTextures=null}}},{key:"_bindDotDensityTextures",value:function(e,t,n,i){var r=this._createDotDensityTextures(e,i,n.ddSeed);t.setUniform1iv("u_dotTextures",this._dotSamplers);for(var a=0;a<r.length;a++)e.bindTexture(r[a],this._dotSamplers[a])}},{key:"_createDotDensityTextures",value:function(e,t,n){if(this._dotTextureSize===t&&this._seed===n||(this._disposeTextures(),this._dotTextureSize=t,this._seed=n),null===this._dotTextures){var i=new F.a(n);this._dotTextures=[this._allocDotDensityTexture(e,t,i),this._allocDotDensityTexture(e,t,i)]}return this._dotTextures}},{key:"_allocDotDensityTexture",value:function(e,t,n){for(var i=new Float32Array(t*t*4),r=0;r<i.length;r++)i[r]=n.getFloat();return new S.a(e,{wrapMode:10497,pixelFormat:6408,dataType:5126,samplingMode:9728,width:t,height:t},i)}}]),n}(U),G=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"dispose",value:function(){}},{key:"getGeometryType",value:function(){return P.d.LABEL}},{key:"drawGeometry",value:function(e,t,n,i){var r=e.context,a=e.painter,o=e.state,s=e.rendererInfo,l=B.b.load(n.materialKey),u=l.mapAligned?1:0;if(u||!(Math.abs(t.key.level-Math.round(100*e.displayLevel)/100)>=1)){var c=function(e){return Object(p.g)(e.data,{geometry:[{location:0,name:"a_pos",count:2,type:5122},{location:1,name:"a_id",count:4,type:5121},{location:2,name:"a_color",count:4,type:5121,normalized:!0},{location:3,name:"a_haloColor",count:4,type:5121,normalized:!0},{location:4,name:"a_texAndSize",count:4,type:5121},{location:5,name:"a_refSymbolAndPlacementOffset",count:4,type:5121},{location:6,name:"a_glyphData",count:4,type:5121},{location:7,name:"a_vertexOffset",count:2,type:5122},{location:8,name:"a_texCoords",count:2,type:5123}]})}(l),h=c.bufferLayouts,f=c.attributes,v=a.materialManager.getMaterialProgram(e,l,"materials/label",f,i);e.context.setStencilFunction(514,0,255),r.useProgram(v),this._setSharedUniforms(v,e,t),a.textureManager.bindTextures(r,v,l);var d=1===u?o.displayViewMat3:o.displayMat3;this._setSizeVVUniforms(l,v,s,t),v.setUniform1f("u_mapRotation",Math.floor(o.rotation/360*254)),v.setUniform1f("u_mapAligned",u),v.setUniformMatrix3fv("u_displayMat3",d),v.setUniform1f("u_opacity",1),v.setUniform2fv("u_screenSize",e.state.size),v.setUniform1f("u_isHalo",1),n.draw(r,h,f),v.setUniform1f("u_isHalo",0),n.draw(r,h,f),r.setStencilTestEnabled(!0),r.setBlendingEnabled(!0)}}}]),n}(U),H=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"dispose",value:function(){}},{key:"getGeometryType",value:function(){return P.d.LINE}},{key:"drawGeometry",value:function(e,t,n,i){var r=e.context,a=e.painter,o=e.rendererInfo,s=e.displayLevel,l=B.c.load(n.materialKey),u=function(e){return Object(p.g)(e.data,{geometry:[{location:0,name:"a_pos",count:2,type:5122},{location:1,name:"a_id",count:4,type:5121},{location:2,name:"a_color",count:4,type:5121,normalized:!0},{location:3,name:"a_offsetAndNormal",count:4,type:5120},{location:4,name:"a_accumulatedDistanceAndHalfWidth",count:2,type:5123},{location:5,name:"a_tlbr",count:4,type:5123},{location:6,name:"a_segmentDirection",count:4,type:5120},{location:7,name:"a_aux",count:2,type:5123},{location:8,name:"a_zoomRange",count:2,type:5123}]})}(l),c=u.bufferLayouts,h=u.attributes,f=a.materialManager.getMaterialProgram(e,l,"materials/line",h,i),v=1/e.pixelRatio;r.useProgram(f),this._setSharedUniforms(f,e,t),l.textureBinding&&a.textureManager.bindTextures(r,f,l);var d=Math.pow(2,s-t.key.level)/e.pixelRatio;f.setUniform1f("u_zoomFactor",d),f.setUniform1f("u_blur",0+v),f.setUniform1f("u_antialiasing",v),this._setSizeVVUniforms(l,f,o,t),this._setColorAndOpacityVVUniforms(l,f,o),r.setFaceCullingEnabled(!1),n.draw(r,c,h)}}]),n}(U),W=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"dispose",value:function(){}},{key:"getGeometryType",value:function(){return P.d.MARKER}},{key:"drawGeometry",value:function(e,t,n,i){var r=e.context,a=e.painter,o=e.rendererInfo,s=e.state,l=B.d.load(n.materialKey),u=function(e){return Object(p.g)(e.data,{geometry:[{location:0,name:"a_pos",count:2,type:5122},{location:1,name:"a_vertexOffset",count:2,type:5122},{location:2,name:"a_texCoords",count:2,type:5123},{location:3,name:"a_bitSetAndDistRatio",count:2,type:5123},{location:4,name:"a_id",count:4,type:5121},{location:5,name:"a_color",count:4,type:5121,normalized:!0},{location:6,name:"a_outlineColor",count:4,type:5121,normalized:!0},{location:7,name:"a_sizeAndOutlineWidth",count:4,type:5121},{location:8,name:"a_zoomRange",count:2,type:5123}]})}(l),c=u.bufferLayouts,h=u.attributes,f=a.materialManager.getMaterialProgram(e,l,"materials/icon",h,i);r.useProgram(f),l.textureBinding&&a.textureManager.bindTextures(r,f,l,!0),this._setSharedUniforms(f,e,t);var v=l.vvRotation?s.displayViewMat3:s.displayMat3;f.setUniformMatrix3fv("u_displayMat3",v),this._setSizeVVUniforms(l,f,o,t),this._setColorAndOpacityVVUniforms(l,f,o),this._setRotationVVUniforms(l,f,o),n.draw(r,c,h)}}]),n}(U),q=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"dispose",value:function(){}},{key:"getGeometryType",value:function(){return P.d.TEXT}},{key:"drawGeometry",value:function(e,t,n,i){var r=e.context,a=e.painter,o=e.rendererInfo,s=e.state,l=B.f.load(n.materialKey),u=function(e){return Object(p.g)(e.data,{geometry:[{location:0,name:"a_pos",count:2,type:5122},{location:1,name:"a_id",count:4,type:5121},{location:2,name:"a_color",count:4,type:5121,normalized:!0},{location:3,name:"a_haloColor",count:4,type:5121,normalized:!0},{location:4,name:"a_texFontSize",count:4,type:5121},{location:5,name:"a_aux",count:4,type:5120},{location:6,name:"a_zoomRange",count:2,type:5123},{location:7,name:"a_vertexOffset",count:2,type:5122},{location:8,name:"a_texCoords",count:2,type:5123}]})}(l),c=u.bufferLayouts,h=u.attributes,f=a.materialManager.getMaterialProgram(e,l,"materials/text",h,i);r.useProgram(f),this._setSharedUniforms(f,e,t),a.textureManager.bindTextures(r,f,l),f.setUniformMatrix3fv("u_displayMat3",s.displayMat3),f.setUniformMatrix3fv("u_displayViewMat3",s.displayViewMat3),this._setSizeVVUniforms(l,f,o,t),this._setColorAndOpacityVVUniforms(l,f,o),this._setRotationVVUniforms(l,f,o),f.setUniform1f("u_isHalo",1),n.draw(r,c,h),f.setUniform1f("u_isHalo",0),n.draw(r,c,h)}}]),n}(U),Y=n(9),Z=n(584),X=n(559),K=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments))._desc={lut:{vsPath:"raster/lut",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])},stretch:{vsPath:"raster/stretch",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])},hillshade:{vsPath:"raster/hillshade",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])}},e._rendererUniformInfos=new Map,e}return Object(a.a)(n,[{key:"dispose",value:function(){this._quad&&this._quad.dispose()}},{key:"prepareState",value:function(e,t){var n=e.context;n.setBlendingEnabled(!0),n.setBlendFunctionSeparate(1,771,1,771),n.setColorMask(!0,!0,
1!0,!0),n.setStencilWriteMask(0),n.setStencilTestEnabled(!0),n.setStencilFunction(514,t.stencilRef,255)}},{key:"draw",value:function(e,t){var n;if(Object(Z.b)(t)&&!t.suspended){e.timeline.begin(this.name);var i=!(null!=(n=e.context.capabilities.textureFloat)&&n.textureFloatLinear);t.updateTexture(e);var r=this.getShaderVariations(t,i),a=e.painter.materialManager.getProgram(e,this._desc[t.symbolizerParameters.type],r);this.drawWithProgram(e.context,a,t),e.timeline.end(this.name)}}},{key:"drawWithProgram",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[0,0],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];this._quad||(this._quad=new u.a(e,[0,0,1,0,0,1,1,1]));var o=n.symbolizerParameters,s=n.transformGrid,l=n.width,c=n.height,h=n.opacity,f=o.type;e.useProgram(t);var v=this.getShaderVariations(n),d=this.getUniformInfos(f,e,t,v),p=n.getTextures(),y=p.names,_=p.textures;Object(X.j)(e,t,y,_);var m=Object(X.d)(i,r),g=Object(X.f)(s,[l,c],[n.source.width,n.source.height],h,a);if(Object(X.k)(t,d,Object(Y.a)(Object(Y.a)({u_coordScale:n.coordScale,u_dvsMat3:n.transforms.dvs},m),g)),o.colormap){var b=o.colormap,x=o.colormapOffset,O=Object(X.e)(b,x);Object(X.k)(t,d,O)}if("stretch"===o.type){var w=Object(X.h)(o);Object(X.k)(t,d,w)}else if("hillshade"===o.type){var k=Object(X.g)(o);Object(X.k)(t,d,k)}this._quad.draw()}},{key:"getUniformInfos",value:function(e,t,n,i){var r=i.length>0?e+"-"+i.join("-"):e;if(this._rendererUniformInfos.has(r))return this._rendererUniformInfos.get(r);var a=Object(X.i)(t,n);return this._rendererUniformInfos.set(r,a),a}},{key:"getShaderVariations",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],i=e.interpolation,r=e.symbolizerParameters,a=r.type,o=r.colormap;return"cubic"===i?n.push("bicubic"):"bilinear"===i&&"stretch"===a&&null!=o?(n.push("bilinear"),n.push("nnedge")):t&&"bilinear"===i&&n.push("bilinear"),e.isRendereredSource?n.push("noop"):o&&n.push("applyColormap"),e.transformGrid&&n.push("applyProjection"),n}}]),n}(c.a),J=n(585),Q={marker:W,line:H,fill:N,text:q,label:G,clip:m,stencil:b.a,bitmap:f,raster:K,rasterVF:J.a,flow:i.a,tileInfo:g.a,vtlBackground:C,vtlFill:A,vtlLine:D,vtlCircle:M,vtlSymbol:V}},571:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(3),r=n(2),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Object(i.a)(this,e),this.x=t,this.y=n,this.width=r,this.height=a}return Object(r.a)(e,[{key:"isEmpty",get:function(){return this.width<=0||this.height<=0}},{key:"union",value:function(e){this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.width=Math.max(this.width,e.width),this.height=Math.max(this.height,e.height)}}]),e}()},574:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return o}));var i=!0,r=32,a=1.5,o=200},575:function(e,t,n){"use strict";n.d(t,"a",(function(){return de})),n.d(t,"b",(function(){return pe}));var i=n(11),r=n(3),a=n(2),o=n(18),s=n(51),l=n(540),u=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new c(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();u.instance=null;var c=function(){function e(t,n,i){Object(r.a)(this,e),this._inputGeometries=t,this._angleTolerance=void 0!==n.angleTolerance?n.angleTolerance:120,this._maxCosAngle=Math.cos((1-Math.abs(this._angleTolerance)/180)*Math.PI)}return Object(a.a)(e,[{key:"next",value:function(){for(var e=this._inputGeometries.next();e;){if(Object(s.g)(e)){this._isClosed=!0;var t=Object(o.a)(e);return this._processMultipath(t.rings),t}if(Object(s.h)(e)){this._isClosed=!1;var n=Object(o.a)(e);return this._processMultipath(n.paths),n}if(Object(s.d)(e)){if(this._maxCosAngle)return e;this._isClosed=!0;var i=[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]];return this._processPath(i),{rings:[i]}}e=this._inputGeometries.next()}return null}},{key:"_processMultipath",value:function(e){if(e){var t,n=Object(i.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this._processPath(r)}}catch(a){n.e(a)}finally{n.f()}}}},{key:"_processPath",value:function(e){if(e){var t,n,i,r,a,o,s=e.length,u=e[0];this._isClosed&&++s;for(var c=1;c<s;++c){var h,f=(h=this._isClosed&&c===s-1?e[0]:e[c])[0]-u[0],v=h[1]-u[1],d=Math.sqrt(f*f+v*v);c>1&&d>0&&i>0&&(t*f+n*v)/d/i<=this._maxCosAngle&&Object(l.j)(u,1),1===c&&(r=f,a=v,o=d),d>0&&(u=h,t=f,n=v,i=d)}this._isClosed&&i>0&&o>0&&(t*r+n*a)/o/i<=this._maxCosAngle&&Object(l.j)(e[0],1)}}}]),e}(),h=n(4),f=n(5),v=.03,d=function(){function e(){Object(r.a)(this,e),this._path=[]}return Object(a.a)(e,[{key:"path",value:function(){return this._path}},{key:"addPath",value:function(e,t){t||e.reverse(),Array.prototype.push.apply(this._path,e),t||e.reverse()}},{key:"startPath",value:function(e){this._path.push(e)}},{key:"lineTo",value:function(e){this._path.push(e)}},{key:"close",value:function(){var e=this._path;e.length>1&&(e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]||e.push([e[0][0],e[0][1]]))}}],[{key:"mergePath",value:function(e,t){t&&Array.prototype.push.apply(e,t)}}]),e}(),p=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"normalize",value:function(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);e[0]/=t,e[1]/=t}},{key:"calculateLength",value:function(e,t){var n=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(n*n+i*i)}},{key:"calculateSegLength",value:function(e,t){return this.calculateLength(e[t],e[t+1])}},{key:"calculatePathLength",value:function(e){for(var t=0,n=e?e.length:0,i=0;i<n-1;++i)t+=this.calculateSegLength(e,i);return t}},{key:"calculatePathArea",value:function(e){for(var t=0,n=e?e.length:0,i=0;i<n-1;++i)t+=(e[i+1][0]-e[i][0])*(e[i+1][1]+e[i][1]);return t/2}},{key:"getCoord2D",value:function(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}},{key:"getSegCoord2D",value:function(e,t,n){return this.getCoord2D(e[t],e[t+1],n)}},{key:"getAngle",value:function(e,t,n){var i=t[0]-e[0],r=t[1]-e[1];return Math.atan2(r,i)}},{key:"getSegAngle",value:function(e,t,n){return this.getAngle(e[t],e[t+1],n)}},{key:"getAngleCS",value:function(e,t,n){var i=t[0]-e[0],r=t[1]-e[1],a=Math.sqrt(i*i+r*r);return a>0?[i/a,r/a]:[1,0]}},{key:"getSegAngleCS",value:function(e,t,n){return this.getAngleCS(e[t],e[t+1],n)}},{key:"cut",value:function(e,t,n,i){return[n<=0?e[t]:this.getSegCoord2D(e,t,n),i>=1?e[t+1]:this.getSegCoord2D(e,t,i)]}},{key:"addSegment",value:function(e,t,n){n&&e.push(t[0]),e.push(t[1])}},{key:"getSubCurve",value:function(e,t,n){var i=[];return this.appendSubCurve(i,e,t,n)?i:null}},{key:"appendSubCurve",value:function(e,t,n,i){for(var r=t?t.length-1:0,a=0,o=!0,s=0;s<r;){var l=this.calculateSegLength(t,s);if(0!==l){if(o){if(a+l>n){var u=(n-a)/l,c=1,h=!1;a+l>=i&&(c=(i-a)/l,h=!0);var f=this.cut(t,s,u,c);if(f&&this.addSegment(e,f,o),h)break;o=!1}}else{if(a+l>i){var v=this.cut(t,s,0,(i-a)/l);v&&this.addSegment(e,v,o);break}this.addSegment(e,[t[s],t[s+1]],o)}a+=l,++s}else++s}return!0}},{key:"getCIMPointAlong",value:function(e,t){for(var n=e?e.length-1:0,i=0,r=-1;r<n;){++r;var a=this.calculateSegLength(e,r);if(0!==a){if(i+a>t){var o=(t-i)/a;return this.getCoord2D(e[r],e[r+1],o)}i+=a}}return null}},{key:"isEmpty",value:function(e,t){if(!e||e.length<=1)return!0;for(var n=e?e.length-1:0,i=-1;
1i<n;){if(e[++i+1][0]!==e[i][0]||e[i+1][1]!==e[i][1])return!1;if(t&&e[i+1][2]!==e[i][2])return!1}return!0}},{key:"offset",value:function(e,t,n,i,r){if(!e||e.length<2)return null;for(var a=0,o=e[a++],s=a;a<e.length;){var l=e[a];l[0]===o[0]&&l[1]===o[1]||(a!==s&&(e[s]=e[a]),o=e[s++]),a++}var u=e[0][0]===e[s-1][0]&&e[0][1]===e[s-1][1];if(u&&--s,s<(u?3:2))return null;var c=[];o=u?e[s-1]:null;for(var h=e[0],f=0;f<s;f++){var v=f===s-1?u?e[0]:null:e[f+1];if(o)if(v){var d=[v[0]-h[0],v[1]-h[1]];this.normalize(d);var p=[h[0]-o[0],h[1]-o[1]];this.normalize(p);var y=p[0]*d[1]-p[1]*d[0],_=p[0]*d[0]+p[1]*d[1];if(y>=0==t<=0){if(_<1){var m=[d[0]-p[0],d[1]-p[1]];this.normalize(m);var g=Math.sqrt((1+_)/2);if(g>1/i){var b=-Math.abs(t)/g;c.push([h[0]-m[0]*b,h[1]-m[1]*b])}}}else switch(n){case"Mitered":var x=Math.sqrt((1+_)/2);if(x>0&&1/x<i){var O=[d[0]-p[0],d[1]-p[1]];this.normalize(O);var w=Math.abs(t)/x;c.push([h[0]-O[0]*w,h[1]-O[1]*w]);break}case"Bevelled":c.push([h[0]+p[1]*t,h[1]-p[0]*t]),c.push([h[0]+d[1]*t,h[1]-d[0]*t]);break;case"Rounded":if(_<1){c.push([h[0]+p[1]*t,h[1]-p[0]*t]);var k=Math.floor(2.5*(1-_));if(k>0)for(var S=1/k,j=S,P=1;P<k;P++,j+=S){var T=[p[1]*(1-j)+d[1]*j,-p[0]*(1-j)-d[0]*j];this.normalize(T),c.push([h[0]+T[0]*t,h[1]+T[1]*t])}c.push([h[0]+d[1]*t,h[1]-d[0]*t])}break;default:if(y<0)c.push([h[0]+(p[1]+p[0])*t,h[1]+(p[1]-p[0])*t]),c.push([h[0]+(d[1]-d[0])*t,h[1]-(d[0]+d[1])*t]);else{var C=Math.sqrt((1+Math.abs(_))/2),M=[d[0]-p[0],d[1]-p[1]];this.normalize(M);var I=t/C;c.push([h[0]-M[0]*I,h[1]-M[1]*I])}}}else{var L=[h[0]-o[0],h[1]-o[1]];this.normalize(L),c.push([h[0]+L[1]*t,h[1]-L[0]*t])}else{var A=[v[0]-h[0],v[1]-h[1]];this.normalize(A),c.push([h[0]+A[1]*t,h[1]-A[0]*t])}o=h,h=v}return c.length<(u?3:2)?null:(u&&c.push([c[0][0],c[0][1]]),c)}}]),e}(),y=1.7320508075688772,_=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new m(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();_.instance=null;var m=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,a){var o;return Object(r.a)(this,n),(o=t.call(this,e,!1,!0))._curveHelper=new p,o._width=(void 0!==i.width?i.width:5)*a,o._arrowType=void 0!==i.geometricEffectArrowType?i.geometricEffectArrowType:"OpenEnded",o._offsetFlattenError=v*a,o}return Object(a.a)(n,[{key:"processPath",value:function(e){switch(this._arrowType){case"OpenEnded":default:return this._constructSimpleArrow(e,!0);case"Block":return this._constructSimpleArrow(e,!1);case"Crossed":return this._constructCrossedArrow(e)}}},{key:"_constructSimpleArrow",value:function(e,t){var n=this._curveHelper.calculatePathLength(e),i=this._width;n<2*i&&(i=n/2);var r=this._curveHelper.getSubCurve(e,0,n-i);if(!r)return null;var a=i/2;if(this._curveHelper.isEmpty(r,!1))return null;var o=this._constructOffset(r,-a);if(!o)return null;var s=this._constructOffset(r,a);if(!s)return null;var l=this._constructArrowBasePoint(o,-a/2);if(!l)return null;var u=this._constructArrowBasePoint(s,a/2);if(!u)return null;var c=e[e.length-1];t||(this._makeControlPoint(s,!0),this._makeControlPoint(o,!0));var h=new d;return h.addPath(s,!0),h.lineTo(u),this._makeControlPoint(h.path()),h.lineTo(c),this._makeControlPoint(h.path()),h.lineTo(l),this._makeControlPoint(h.path()),h.addPath(o,!1),t?{paths:[h.path()]}:(h.close(),{rings:[h.path()]})}},{key:"_constructCrossedArrow",value:function(e){var t=this._curveHelper.calculatePathLength(e),n=this._width;t<3.732050807568877*n&&(n=t/3.732050807568877);var i=this._curveHelper.getSubCurve(e,0,t-n*(1+y));if(!i)return null;var r=n/2;if(this._curveHelper.isEmpty(i,!1))return null;var a=this._constructOffset(i,r);if(!a)return null;var o=this._constructOffset(i,-r);if(!o)return null;var s=this._curveHelper.getSubCurve(e,0,t-n);if(!s)return null;if(this._curveHelper.isEmpty(s,!1))return null;var l=this._constructOffset(s,r);if(!l)return null;var u=this._constructOffset(s,-r);if(!u)return null;var c=l[l.length-1],h=this._constructArrowBasePoint(l,r/2);if(!h)return null;var f=u[u.length-1],v=this._constructArrowBasePoint(u,-r/2);if(!v)return null;var p=e[e.length-1];this._makeControlPoint(a,!1),this._makeControlPoint(o,!1);var _=new d;return _.addPath(a,!0),this._makeControlPoint(_.path()),_.lineTo(f),_.lineTo(v),this._makeControlPoint(_.path()),_.lineTo(p),this._makeControlPoint(_.path()),_.lineTo(h),this._makeControlPoint(_.path()),_.lineTo(c),this._makeControlPoint(_.path()),_.addPath(o,!1),{paths:[_.path()]}}},{key:"_constructOffset",value:function(e,t){return this._curveHelper.offset(e,t,"Rounded",4,this._offsetFlattenError)}},{key:"_constructArrowBasePoint",value:function(e,t){if(!e||e.length<2)return null;var n=e[e.length-2],i=e[e.length-1],r=[i[0]-n[0],i[1]-n[1]];return this._curveHelper.normalize(r),[i[0]+r[1]*t,i[1]-r[0]*t]}},{key:"_makeControlPoint",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(l.j)(t?e[0]:e[e.length-1],1)}}]),n}(l.a),g=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new b(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();g.instance=null;var b=function(){function e(t,n,i){Object(r.a)(this,e),this._inputGeometries=t,this._curveHelper=new p,this._size=(void 0!==n.size?n.size:1)*i,this._offsetFlattenError=v*i}return Object(a.a)(e,[{key:"next",value:function(){for(var e=this._inputGeometries.next();e;){if(Object(s.d)(e))if(this._size>0){var t=[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]],n=this._curveHelper.offset(t,this._size,"Rounded",4,this._offsetFlattenError);if(n)return{rings:[n]}}else{if(!(this._size<0))return e;if(Math.min(e.xmax-e.xmin,e.ymax-e.ymin)+2*this._size>
10)return{xmin:e.xmin-this._size,xmax:e.xmax+this._size,ymin:e.ymin-this._size,ymax:e.ymax+this._size}}if(Object(s.g)(e)){if(0===this._size)return e;var r,a=[],o=Object(i.a)(e.rings);try{for(o.s();!(r=o.n()).done;){var l=r.value,u=this._curveHelper.offset(l,this._size,"Rounded",4,this._offsetFlattenError);u&&a.push(u)}}catch(_){o.e(_)}finally{o.f()}if(a.length)return{rings:a}}if(Object(s.h)(e)&&this._size>0){var c,h=[],f=Object(i.a)(e.paths);try{for(f.s();!(c=f.n()).done;){var v=c.value;if(v&&v.length>1){var d=this._curveHelper.offset(v,this._size,"Rounded",4,this._offsetFlattenError),p=this._curveHelper.offset(v,-this._size,"Rounded",4,this._offsetFlattenError);if(d&&p){for(var y=p.length-1;y>=0;y--)d.push(p[y]);d.push([d[0][0],d[0][1]]),h.push(d)}}}}catch(_){f.e(_)}finally{f.f()}if(h.length)return{rings:h}}Object(s.f)(e)&&this._size,e=this._inputGeometries.next()}return null}}]),e}(),x=n(23),O=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new w(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();O.instance=null;var w=function(){function e(t,n,i){var a;Object(r.a)(this,e),this._default_point_size=20,this._inputGeometries=t,this._geomUnitsPerPoint=i,this._rule=null!=(a=n.rule)?a:"FullGeometry",this._default_size=this._default_point_size*i}return Object(a.a)(e,[{key:"next",value:function(){for(var e;e=this._inputGeometries.next();){var t=void 0;if(Object(s.f)(e)?t=this._processGeom([[[e.x,e.y]]]):Object(s.e)(e)?t=this._processGeom([e.points]):Object(s.h)(e)?t=this._processGeom(e.paths):Object(s.g)(e)&&(t=this._processGeom(e.rings)),t&&t.length)return{paths:t}}return null}},{key:"_clone",value:function(e){return[e[0],e[1]]}},{key:"_mid",value:function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}},{key:"_mix",value:function(e,t,n,i){return[e[0]*t+n[0]*i,e[1]*t+n[1]*i]}},{key:"_add",value:function(e,t){return[e[0]+t[0],e[1]+t[1]]}},{key:"_add2",value:function(e,t,n){return[e[0]+t,e[1]+n]}},{key:"_sub",value:function(e,t){return[e[0]-t[0],e[1]-t[1]]}},{key:"_dist",value:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}},{key:"_norm",value:function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}},{key:"_normalize",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t/this._norm(e);e[0]*=n,e[1]*=n}},{key:"_leftPerpendicular",value:function(e){var t=e[1],n=-e[0];e[0]=t,e[1]=n}},{key:"_leftPerp",value:function(e){return[e[1],-e[0]]}},{key:"_rightPerpendicular",value:function(e){var t=-e[1],n=e[0];e[0]=t,e[1]=n}},{key:"_rightPerp",value:function(e){return[-e[1],e[0]]}},{key:"_dotProduct",value:function(e,t){return e[0]*t[0]+e[1]*t[1]}},{key:"_crossProduct",value:function(e,t){return-(e[0]*t[1]-e[1]*t[0])}},{key:"_rotateDirect",value:function(e,t,n){n=-n;var i=e[0]*t-e[1]*n,r=e[0]*n+e[1]*t;e[0]=i,e[1]=r}},{key:"_makeCtrlPt",value:function(e){var t=[e[0],e[1]];return Object(l.j)(t,1),t}},{key:"_addAngledTicks",value:function(e,t,n,i){var r=this._sub(n,t);this._normalize(r);var a,o=this._crossProduct(r,this._sub(i,t));a=o>0?this._rightPerp(r):this._leftPerp(r);var s=Math.abs(o)/2,l=[];l.push([t[0]+(a[0]-r[0])*s,t[1]+(a[1]-r[1])*s]),l.push(t),l.push(n),l.push([n[0]+(a[0]+r[0])*s,n[1]+(a[1]+r[1])*s]),e.push(l)}},{key:"_addBezier2",value:function(e,t,n,i,r){if(0!=r--){var a=this._mid(t,n),o=this._mid(n,i),s=this._mid(a,o);this._addBezier2(e,t,a,s,r),this._addBezier2(e,s,o,i,r)}else e.push(i)}},{key:"_addBezier3",value:function(e,t,n,i,r,a){if(0!=a--){var o=this._mid(t,n),s=this._mid(n,i),l=this._mid(i,r),u=this._mid(o,s),c=this._mid(s,l),h=this._mid(u,c);this._addBezier3(e,t,o,u,h,a),this._addBezier3(e,h,c,l,r,a)}else e.push(r)}},{key:"_add90DegArc",value:function(e,t,n,i,r){var a=null!=r?r:this._crossProduct(this._sub(n,t),this._sub(i,t))>0,o=this._mid(t,n),s=this._sub(o,t);a?this._leftPerpendicular(s):this._rightPerpendicular(s),o[0]+=s[0],o[1]+=s[1],this._addBezier3(e,t,this._mix(t,.33333,o,.66667),this._mix(n,.33333,o,.66667),n,4)}},{key:"_addArrow",value:function(e,t,n){var i=t[0],r=t[1],a=t[t.length-1],o=this._sub(i,r);this._normalize(o);var s=this._crossProduct(o,this._sub(a,r)),l=.5*s,u=this._leftPerp(o),c=[a[0]-u[0]*s,a[1]-u[1]*s],h=t.length-1,f=[];f.push(n?[-u[0],-u[1]]:u);for(var v=[-o[0],-o[1]],d=1;d<h-1;d++){var p=this._sub(t[d+1],t[d]);this._normalize(p);var y=this._dotProduct(p,v),_=this._crossProduct(p,v),m=Math.sqrt((1+y)/2),g=this._sub(p,v);this._normalize(g),g[0]/=m,g[1]/=m,f.push(_<0?[-g[0],-g[1]]:g),v=p}f.push(this._rightPerp(v));for(var b=f.length-1;b>0;
1b--)e.push([t[b][0]+f[b][0]*l,t[b][1]+f[b][1]*l]);e.push([c[0]+f[0][0]*l,c[1]+f[0][1]*l]),e.push([c[0]+f[0][0]*s,c[1]+f[0][1]*s]),e.push(i),e.push([c[0]-f[0][0]*s,c[1]-f[0][1]*s]),e.push([c[0]-f[0][0]*l,c[1]-f[0][1]*l]);for(var x=1;x<f.length;x++)e.push([t[x][0]-f[x][0]*l,t[x][1]-f[x][1]*l])}},{key:"_cp2",value:function(e,t,n){return e.length>=2?e[1]:this._add2(e[0],t*this._default_size,-n*this._default_size)}},{key:"_cp3",value:function(e,t,n,i){if(e.length>=3)return e[2];var r=this._mix(e[0],1-n,t,n),a=this._sub(t,e[0]);return this._normalize(a),this._rightPerpendicular(a),[r[0]+a[0]*i*this._default_size,r[1]+a[1]*i*this._default_size]}},{key:"_arrowPath",value:function(e){if(e.length>2)return e;var t=e[0],n=this._cp2(e,-4,0),i=this._sub(t,n);this._normalize(i);var r=this._rightPerp(i);return[t,n,[t[0]+(r[0]-i[0])*this._default_size,t[1]+(r[1]-i[1])*this._default_size]]}},{key:"_arrowLastSeg",value:function(e){var t,n=e[0],i=this._cp2(e,-4,0);if(e.length>=3)t=e[e.length-1];else{var r=this._sub(n,i);this._normalize(r);var a=this._rightPerp(r);t=[n[0]+(a[0]-r[0])*this._default_size,n[1]+(a[1]-r[1])*this._default_size]}return[i,t]}},{key:"_processGeom",value:function(e){if(!e)return null;var t,n=[],r=Object(i.a)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(a&&0!==a.length){var o=a.length,s=a[0];switch(this._rule){case"PerpendicularFromFirstSegment":var u=this._cp2(a,0,-1),c=this._cp3(a,u,.5,4),h=[];h.push(c),h.push(this._mid(s,u)),n.push(h);break;case"ReversedFirstSegment":var f=this._cp2(a,0,-1);n.push([f,s]);break;case"PerpendicularToSecondSegment":var v=this._cp2(a,-4,1),d=this._cp3(a,v,.882353,-1.94),p=[];p.push(this._mid(v,d)),p.push(s),n.push(p);break;case"SecondSegmentWithTicks":var y=this._cp2(a,-4,1),_=this._cp3(a,y,.882353,-1.94),m=this._sub(_,y),g=void 0;g=this._crossProduct(m,this._sub(s,y))>0?this._rightPerp(g):this._leftPerp(m);var b=[];b.push([y[0]+(g[0]-m[0])/3,y[1]+(g[1]-m[1])/3]),b.push(y),b.push(_),b.push([_[0]+(g[0]+m[0])/3,_[1]+(g[1]+m[1])/3]),n.push(b);break;case"DoublePerpendicular":var O=this._cp2(a,0,-1),w=this._cp3(a,O,.5,3),k=this._mid(s,O),S=this._sub(k,w);this._normalize(S);var j=this._crossProduct(S,this._sub(s,w));this._leftPerpendicular(S);var P=[];P.push(s),P.push([w[0]+S[0]*j,w[1]+S[1]*j]),n.push(P);var T=[];T.push([w[0]-S[0]*j,w[1]-S[1]*j]),T.push(O),n.push(T);break;case"OppositeToFirstSegment":var C=this._cp2(a,0,-1),M=this._cp3(a,C,.5,3),I=this._mid(s,C),L=this._sub(I,M);this._normalize(L);var A=this._crossProduct(L,this._sub(s,M));this._leftPerpendicular(L);var D=[];D.push([M[0]+L[0]*A,M[1]+L[1]*A]),D.push([M[0]-L[0]*A,M[1]-L[1]*A]),n.push(D);break;case"TriplePerpendicular":var z=this._cp2(a,0,-1),R=this._cp3(a,z,.5,4),E=this._mid(s,z),V=this._sub(E,R);this._normalize(V);var F=this._crossProduct(V,this._sub(s,R));this._leftPerpendicular(V);var U=[];U.push([R[0]+V[0]*F*.8,R[1]+V[1]*F*.8]),U.push([E[0]+.8*(s[0]-E[0]),E[1]+.8*(s[1]-E[1])]),n.push(U),n.push([R,E]);var B=[];B.push([R[0]-V[0]*F*.8,R[1]-V[1]*F*.8]),B.push([E[0]+.8*(z[0]-E[0]),E[1]+.8*(z[1]-E[1])]),n.push(B);break;case"HalfCircleFirstSegment":var N=this._cp2(a,0,-1),G=this._cp3(a,N,.5,4),H=this._mid(s,N),W=this._sub(N,s),q=Math.cos(Math.PI/18),Y=Math.sin(Math.PI/18),Z=Math.sqrt((1+q)/2),X=Math.sqrt((1-q)/2),K=[],J=void 0;this._crossProduct(W,this._sub(G,s))>0?(K.push(s),W=this._sub(s,H),J=N):(K.push(N),W=this._sub(N,H),J=s),this._rotateDirect(W,Z,X),W[0]/=Z,W[1]/=Z;for(var Q=1;Q<=18;Q++)K.push(this._add(H,W)),this._rotateDirect(W,q,Y);K.push(J),n.push(K);break;case"HalfCircleSecondSegment":var $=this._cp2(a,0,-1),ee=this._cp3(a,$,1,-1),te=this._sub(s,$);this._normalize(te);var ne=this._crossProduct(te,this._sub(ee,$))/2;this._leftPerpendicular(te);var ie=[$[0]+te[0]*ne,$[1]+te[1]*ne];te=this._sub($,ie);var re=Math.cos(Math.PI/18),ae=Math.sin(Math.PI/18);ne>0&&(ae=-ae);for(var oe=[$],se=1;se<=18;se++)this._rotateDirect(te,re,ae),oe.push(this._add(ie,te));n.push(oe);break;case"HalfCircleExtended":var le=this._cp2(a,0,-2),ue=this._cp3(a,le,1,-1),ce=void 0;if(o>=4)ce=a[3];else{var he=this._sub(s,le);ce=this._add(ue,he)}var fe=this._dist(le,ue)/2/.75,ve=this._sub(le,s);this._normalize(ve,fe);var de=this._sub(ue,ce);this._normalize(de,fe);var pe=[ce,ue];n.push(pe);var ye=[this._clone(ue)];this._addBezier3(ye,ue,this._add(ue,de),this._add(le,ve),le,4),ye.push(s),n.push(ye);break;case"OpenCircle":for(var _e=this._cp2(a,-2,0),me=this._sub(_e,s),ge=Math.cos(Math.PI/18),be=-Math.sin(Math.PI/18),xe=[_e],Oe=1;Oe<=33;Oe++)this._rotateDirect(me,ge,be),xe.push(this._add(s,me));n.push(xe);break;case"CoverageEdgesWithTicks":var we=this._cp2(a,0,-1),ke=void 0,Se=void 0;if(o>=3)ke=a[2];else{var je=this._sub(we,s),Pe=this._leftPerp(je);ke=[s[0]+Pe[0]-.25*je[0],s[1]+Pe[1]-.25*je[1]]}if(o>=4)Se=a[3];else{var Te=this._mid(s,we),Ce=this._sub(s,we);this._normalize(Ce),this._leftPerpendicular(Ce);var Me=this._crossProduct(Ce,this._sub(ke,Te));this._rightPerpendicular(Ce),Se=[ke[0]+Ce[0]*Me*2,ke[1]+Ce[1]*Me*2]}var Ie=this._sub(we,s),Le=void 0,Ae=void 0;Le=this._crossProduct(Ie,this._sub(ke,s))>
10?this._rightPerp(Ie):this._leftPerp(Ie),(Ae=[]).push(ke),Ae.push(s),Ae.push([s[0]+(Le[0]-Ie[0])/3,s[1]+(Le[1]-Ie[1])/3]),n.push(Ae),Le=this._crossProduct(Ie,this._sub(Se,we))>0?this._rightPerp(Le):this._leftPerp(Ie),(Ae=[]).push([we[0]+(Le[0]+Ie[0])/3,we[1]+(Le[1]+Ie[1])/3]),Ae.push(we),Ae.push(Se),n.push(Ae);break;case"GapExtentWithDoubleTicks":var De=this._cp2(a,0,2),ze=this._cp3(a,De,0,1),Re=void 0;if(o>=4)Re=a[3];else{var Ee=this._sub(De,s);Re=this._add(ze,Ee)}this._addAngledTicks(n,s,De,this._mid(ze,Re)),this._addAngledTicks(n,ze,Re,this._mid(s,De));break;case"GapExtentMidline":var Ve=this._cp2(a,2,0),Fe=this._cp3(a,Ve,0,1),Ue=void 0;if(o>=4)Ue=a[3];else{var Be=this._sub(Ve,s);Ue=this._add(Fe,Be)}var Ne=[];Ne.push(this._mid(s,Fe)),Ne.push(this._mid(Ve,Ue)),n.push(Ne);break;case"Chevron":var Ge=this._cp2(a,-1,-1),He=void 0;if(o>=3)He=a[2];else{var We=this._sub(Ge,s);this._leftPerpendicular(We),He=this._add(s,We)}n.push([Ge,this._makeCtrlPt(s),He]);break;case"PerpendicularWithArc":var qe=this._cp2(a,0,-2),Ye=this._cp3(a,qe,.5,-1),Ze=this._sub(qe,s),Xe=this._norm(Ze);Ze[0]/=Xe,Ze[1]/=Xe;var Ke=this._crossProduct(Ze,this._sub(Ye,s)),Je=this._dotProduct(Ze,this._sub(Ye,s));Je<.05*Xe?Je=.05*Xe:Je>.95*Xe&&(Je=.95*Xe);var Qe=[s[0]+Ze[0]*Je,s[1]+Ze[1]*Je];this._leftPerpendicular(Ze);var $e=[];$e.push([Qe[0]-Ze[0]*Ke,Qe[1]-Ze[1]*Ke]),$e.push([Qe[0]+Ze[0]*Ke,Qe[1]+Ze[1]*Ke]),n.push($e);var et=[qe[0]+Ze[0]*Ke,qe[1]+Ze[1]*Ke];Ze=this._sub(qe,et);var tt=Math.cos(Math.PI/18),nt=Math.sin(Math.PI/18);Ke<0&&(nt=-nt),$e=[s,qe];for(var it=1;it<=9;it++)this._rotateDirect(Ze,tt,nt),$e.push(this._add(et,Ze));n.push($e);break;case"ClosedHalfCircle":for(var rt=this._cp2(a,2,0),at=this._mid(s,rt),ot=this._sub(rt,at),st=Math.cos(Math.PI/18),lt=Math.sin(Math.PI/18),ut=[s,rt],ct=1;ct<=18;ct++)this._rotateDirect(ot,st,lt),ut.push(this._add(at,ot));n.push(ut);break;case"TripleParallelExtended":var ht=this._cp2(a,0,-2),ft=this._cp3(a,ht,1,-2),vt=this._mid(s,ht),dt=this._sub(ft,ht);this._normalize(dt);var pt=Math.abs(this._crossProduct(dt,this._sub(vt,ht)))/2,yt=this._dist(ht,ft),_t=[ht,s];_t.push([s[0]+dt[0]*yt*.5,s[1]+dt[1]*yt*.5]),n.push(_t);var mt=[];mt.push([vt[0]-dt[0]*pt,vt[1]-dt[1]*pt]),mt.push([vt[0]+dt[0]*yt*.375,vt[1]+dt[1]*yt*.375]),Object(l.j)(mt[mt.length-1],1),mt.push([vt[0]+dt[0]*yt*.75,vt[1]+dt[1]*yt*.75]),n.push(mt);var gt=[ht,ft];n.push(gt);break;case"ParallelWithTicks":var bt=this._cp2(a,3,0),xt=this._cp3(a,bt,.5,-1),Ot=this._sub(xt,bt);this._normalize(Ot);var wt=this._crossProduct(Ot,this._sub(xt,s));this._leftPerpendicular(Ot),this._addAngledTicks(n,s,bt,xt),this._addAngledTicks(n,this._mix(s,1,Ot,wt),this._mix(bt,1,Ot,wt),this._mid(s,bt));break;case"Parallel":var kt=this._cp2(a,3,0),St=this._cp3(a,kt,.5,-1),jt=this._sub(kt,s);this._normalize(jt);var Pt=this._leftPerp(jt),Tt=this._crossProduct(jt,this._sub(St,s)),Ct=[s,kt];n.push(Ct),(Ct=[]).push([s[0]+Pt[0]*Tt,s[1]+Pt[1]*Tt]),Ct.push([kt[0]+Pt[0]*Tt,kt[1]+Pt[1]*Tt]),n.push(Ct);break;case"PerpendicularToFirstSegment":var Mt=this._cp2(a,3,0),It=this._cp3(a,Mt,.5,-1),Lt=this._mid(s,Mt),At=this._sub(Mt,s);this._normalize(At);var Dt=this._crossProduct(At,this._sub(It,s));this._leftPerpendicular(At);var zt=[];zt.push([Lt[0]-At[0]*Dt*.25,Lt[1]-At[1]*Dt*.25]),zt.push([Lt[0]+At[0]*Dt*1.25,Lt[1]+At[1]*Dt*1.25]),n.push(zt);break;case"ParallelOffset":var Rt=this._cp2(a,3,0),Et=this._cp3(a,Rt,.5,-1),Vt=this._sub(Rt,s);this._normalize(Vt);var Ft=this._crossProduct(Vt,this._sub(Et,s));this._leftPerpendicular(Vt);var Ut=[];Ut.push([s[0]-Vt[0]*Ft,s[1]-Vt[1]*Ft]),Ut.push([Rt[0]-Vt[0]*Ft,Rt[1]-Vt[1]*Ft]),n.push(Ut);var Bt=[];Bt.push([s[0]+Vt[0]*Ft,s[1]+Vt[1]*Ft]),Bt.push([Rt[0]+Vt[0]*Ft,Rt[1]+Vt[1]*Ft]),n.push(Bt);break;case"OffsetOpposite":var Nt=this._cp2(a,3,0),Gt=this._cp3(a,Nt,.5,-1),Ht=this._sub(Nt,s);this._normalize(Ht);var Wt=this._crossProduct(Ht,this._sub(Gt,s));this._leftPerpendicular(Ht);var qt=[];qt.push([s[0]-Ht[0]*Wt,s[1]-Ht[1]*Wt]),qt.push([Nt[0]-Ht[0]*Wt,Nt[1]-Ht[1]*Wt]),n.push(qt);break;case"OffsetSame":var Yt=this._cp2(a,3,0),Zt=this._cp3(a,Yt,.5,-1),Xt=this._sub(Yt,s);this._normalize(Xt);var Kt=this._crossProduct(Xt,this._sub(Zt,s));this._leftPerpendicular(Xt);var Jt=[];Jt.push([s[0]+Xt[0]*Kt,s[1]+Xt[1]*Kt]),Jt.push([Yt[0]+Xt[0]*Kt,Yt[1]+Xt[1]*Kt]),n.push(Jt);break;case"CircleWithArc":var Qt=this._cp2(a,3,0),$t=this._cp3(a,Qt,.5,-1),en=void 0,tn=void 0;if(o>=4)en=a[3],tn=this._crossProduct(this._sub(en,Qt),this._sub($t,Qt))>0;else{en=Qt,tn=this._crossProduct(this._sub(en,s),this._sub($t,s))>0;var nn=24*this._geomUnitsPerPoint,rn=this._sub(en,s);this._normalize(rn,nn);var an=Math.sqrt(2)/2;this._rotateDirect(rn,an,tn?an:-an),Qt=this._add(s,rn)}for(var on=this._sub(Qt,s),sn=Math.cos(Math.PI/18),ln=Math.sin(Math.PI/18),un=[Qt],cn=1;cn<=36;cn++)this._rotateDirect(on,sn,ln),un.push(this._add(s,on));this._add90DegArc(un,Qt,en,$t,tn),Object(l.j)(un[un.length-8],1),n.push(un);break;case"DoubleJog":var hn=void 0,fn=void 0,vn=this._cp2(a,-3,1);if(hn=o>=3?a[2]:this._add(s,this._sub(s,vn)),o>=4)fn=a[3];else{var dn=s;s=vn,fn=hn;var pn=this._dist(s,dn),yn=this._dist(fn,dn),_n=30*this._geomUnitsPerPoint;
1.5*pn<_n&&(_n=.5*pn),.5*yn<_n&&(_n=.5*yn),vn=this._mix(s,_n/pn,dn,(pn-_n)/pn),hn=this._mix(fn,_n/yn,dn,(yn-_n)/yn)}var mn=this._mid(s,vn),gn=this._mid(fn,hn),bn=this._dist(s,vn),xn=this._dist(hn,fn),On=Math.min(bn,xn)/8;On=Math.min(On,24*this._geomUnitsPerPoint);var wn=Math.cos(Math.PI/4),kn=this._sub(s,vn);this._normalize(kn,On),this._crossProduct(kn,this._sub(fn,vn))>0?this._rotateDirect(kn,wn,-wn):this._rotateDirect(kn,wn,wn);var Sn=[];Sn.push(vn),Sn.push(this._add(mn,kn)),Sn.push(this._sub(mn,kn)),Sn.push(s),n.push(Sn),kn=this._sub(fn,hn),this._normalize(kn,On),this._crossProduct(kn,this._sub(s,hn))<0?this._rotateDirect(kn,wn,wn):this._rotateDirect(kn,wn,-wn),(Sn=[]).push(hn),Sn.push(this._add(gn,kn)),Sn.push(this._sub(gn,kn)),Sn.push(fn),n.push(Sn);break;case"PerpendicularOffset":var jn=this._cp2(a,-4,1),Pn=this._cp3(a,jn,.882353,-1.94),Tn=this._sub(Pn,jn);this._crossProduct(Tn,this._sub(s,jn))>0?this._rightPerpendicular(Tn):this._leftPerpendicular(Tn);var Cn=[Tn[0]/8,Tn[1]/8],Mn=this._sub(this._mid(jn,Pn),Cn);n.push([Mn,s]);break;case"LineExcludingLastSegment":for(var In=this._arrowPath(a),Ln=[],An=In.length-2;An--;)Ln.push(In[An]);n.push(Ln);break;case"MultivertexArrow":var Dn=this._arrowPath(a),zn=[];this._addArrow(zn,Dn,!1),n.push(zn);break;case"CrossedArrow":var Rn=this._arrowPath(a),En=[];this._addArrow(En,Rn,!0),n.push(En);break;case"ChevronArrow":var Vn=this._arrowLastSeg(a),Fn=Object(x.a)(Vn,2),Un=Fn[0],Bn=Fn[1],Nn=10*this._geomUnitsPerPoint,Gn=this._sub(s,Un);this._normalize(Gn);var Hn=this._crossProduct(Gn,this._sub(Bn,Un)),Wn=this._leftPerp(Gn),qn=[Bn[0]-Wn[0]*Hn*2,Bn[1]-Wn[1]*Hn*2],Yn=[];Yn.push([Bn[0]+Gn[0]*Nn,Bn[1]+Gn[1]*Nn]),Yn.push(s),Yn.push([qn[0]+Gn[0]*Nn,qn[1]+Gn[1]*Nn]),n.push(Yn);break;case"ChevronArrowOffset":var Zn=this._arrowLastSeg(a),Xn=Object(x.a)(Zn,2),Kn=Xn[0],Jn=Xn[1],Qn=this._sub(s,Kn);this._normalize(Qn);var $n=this._crossProduct(Qn,this._sub(Jn,Kn));this._leftPerpendicular(Qn);var ei=[Jn[0]-Qn[0]*$n,Jn[1]-Qn[1]*$n],ti=[];ti.push([ei[0]+Qn[0]*$n*.5,ei[1]+Qn[1]*$n*.5]),ti.push(this._mid(ei,s)),ti.push([ei[0]-Qn[0]*$n*.5,ei[1]-Qn[1]*$n*.5]),n.push(ti);break;case"PartialFirstSegment":var ni=this._arrowLastSeg(a),ii=Object(x.a)(ni,2),ri=ii[0],ai=ii[1],oi=this._sub(s,ri);this._normalize(oi);var si=this._crossProduct(oi,this._sub(ai,ri));this._leftPerpendicular(oi);var li=[ai[0]-oi[0]*si,ai[1]-oi[1]*si];n.push([ri,li]);break;case"Arch":var ui=this._cp2(a,0,-1),ci=this._cp3(a,ui,.5,1),hi=this._sub(s,ui),fi=this._mix(ci,1,hi,.55),vi=this._mix(ci,1,hi,-.55),di=[s];this._addBezier2(di,s,fi,ci,4),this._addBezier2(di,ci,vi,ui,4),n.push(di);break;case"CurvedParallelTicks":var pi=this._cp2(a,-4,1),yi=this._cp3(a,pi,.882353,-1.94),_i=this._sub(yi,pi);this._crossProduct(_i,this._sub(s,pi))>0?this._rightPerpendicular(_i):this._leftPerpendicular(_i);var mi=[_i[0]/8,_i[1]/8],gi=this._sub(this._mid(pi,yi),mi),bi=this._sub(this._mix(pi,.75,yi,.25),mi),xi=this._sub(this._mix(pi,.25,yi,.75),mi),Oi=[pi];this._addBezier2(Oi,pi,bi,gi,3),this._addBezier2(Oi,gi,xi,yi,3),n.push(Oi);for(var wi=0;wi<8;wi++){var ki=Oi[2*wi+1],Si=[this._clone(ki)];Si.push(this._add(ki,[_i[0]/4,_i[1]/4])),n.push(Si)}break;case"Arc90Degrees":var ji=this._cp2(a,0,-1),Pi=this._cp3(a,ji,.5,1),Ti=[ji];this._add90DegArc(Ti,ji,s,Pi),n.push(Ti);break;default:n.push(a)}}}}catch(Ci){r.e(Ci)}finally{r.f()}return n}}]),e}(),k=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new S(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();k.instance=null;var S=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,a){var o;return Object(r.a)(this,n),(o=t.call(this,e,!0,!0))._curveHelper=new p,o._beginCut=(void 0!==i.beginCut?i.beginCut:1)*a,o._endCut=(void 0!==i.endCut?i.endCut:1)*a,o._middleCut=(void 0!==i.middleCut?i.middleCut:0)*a,o._invert=void 0!==i.invert&&i.invert,o._beginCut<0&&(o._beginCut=0),o._endCut<0&&(o._endCut=0),o._middleCut<0&&(o._middleCut=0),o}return Object(a.a)(n,[{key:"processPath",value:function(e){var t=this._beginCut,n=this._endCut,i=this._middleCut,r=this._curveHelper.calculatePathLength(e),a=[];if(this._invert)if(0===t&&0===n&&0===i);else if(t+n+i>=r)a.push(e);else{var o=this._curveHelper.getSubCurve(e,0,t);o&&a.push(o),(o=this._curveHelper.getSubCurve(e,.5*(r-i),.5*(r+i)))&&a.push(o),(o=this._curveHelper.getSubCurve(e,r-n,n))&&a.push(o)}else if(0===t&&0===n&&0===i)a.push(e);else if(t+n+i>=r);else if(0===i){var s=this._curveHelper.getSubCurve(e,t,r-n);s&&a.push(s)}else{var l=this._curveHelper.getSubCurve(e,t,.5*(r-i));l&&a.push(l),(l=this._curveHelper.getSubCurve(e,.5*(r+i),r-n))&&a.push(l)}return 0===a.length?null:{paths:a}}}]),n}(l.a),j=1e-7,P=function(){function e(){Object(r.a)(this,e),this._values=[],this.extPtGap=0,this.ctrlPtGa
1p=0,this._length=0,this._currentValue=0}return Object(a.a)(e,[{key:"isEmpty",value:function(){return 0===this._values.length}},{key:"size",value:function(){return this._values.length}},{key:"init",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this._setEmpty(),!e||0===e.length)return!1;for(var i=0;i<e.length;i++){var r=Math.abs(e[i]);n&&r<j&&(r=j),this._values.push(r),this._length+=r}return t&&1&e.length&&(this._length*=2),0!==this._length&&(this.ctrlPtGap=this.extPtGap=0,this._currentValue=-1,!0)}},{key:"scale",value:function(e){for(var t=this._values?this._values.length:0,n=0;n<t;++n)this._values[n]*=e;this._length*=e,this.extPtGap*=e,this.ctrlPtGap*=e}},{key:"addValue",value:function(e){this._length+=e,this._values.push(e)}},{key:"firstValue",value:function(){return this._values[0]}},{key:"lastValue",value:function(){return this._values[this._values.length-1]}},{key:"nextValue",value:function(){return this._currentValue++,this._currentValue===this._values.length&&(this._currentValue=0),this._values[this._currentValue]}},{key:"reset",value:function(){this._currentValue=-1}},{key:"length",value:function(){return this._length}},{key:"_setEmpty",value:function(){this.extPtGap=this.ctrlPtGap=this._length=0,this._currentValue=-1,this._values.length=0}}]),e}(),T=function(){function e(){Object(r.a)(this,e),this.reset()}return Object(a.a)(e,[{key:"reset",value:function(){this.segment=-1,this.segmentLength=0,this.abscissa=0,this.isPathEnd=!1,this.isPartEnd=!1}},{key:"isValid",value:function(){return-1!==this.segment}},{key:"copyTo",value:function(e){e.segment=this.segment,e.segmentLength=this.segmentLength,e.abscissa=this.abscissa,e.isPathEnd=this.isPathEnd,e.isPartEnd=this.isPartEnd}}]),e}(),C=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(r.a)(this,n),(e=t.call(this,i,a))._tolerance=v,e._currentPosition=new T,e}return Object(a.a)(n,[{key:"updateTolerance",value:function(e){this._tolerance=v*e}},{key:"init",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return n?(this._patternLength=t.length(),this._partExtPtGap=t.extPtGap,this._partCtrlPtGap=t.ctrlPtGap):(this._patternLength=0,this._partExtPtGap=0,this._partCtrlPtGap=0),this._currentPosition.reset(),this._partSegCount=0,this._path=e,this._seg=-1,this.setPosAtNextPart()}},{key:"curPositionIsValid",value:function(){return this._currentPosition.isValid()}},{key:"nextPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new T;return!!this._nextPosition(e,n,null,t)&&(n.copyTo(this._currentPosition),!0)}},{key:"curPointAndAngle",value:function(e){e.pt=this._getPoint(this._currentPosition);var t=this._getAngle(this._currentPosition),n=Object(x.a)(t,2),i=n[0],r=n[1];e.ca=i,e.sa=r}},{key:"nextPointAndAngle",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=new T;if(!this._nextPosition(e,i,null,n))return!1;i.copyTo(this._currentPosition),t.pt=this._getPoint(i);var r=this._getAngle(i),a=Object(x.a)(r,2),o=a[0],s=a[1];return t.ca=o,t.sa=s,!0}},{key:"nextCurve",value:function(e){if(0===e)return null;var t=[],n=new T;return this._nextPosition(e,n,t,1)?(n.copyTo(this._currentPosition),t):null}},{key:"isPathEnd",value:function(){return this._currentPosition.isPathEnd}},{key:"getPathEnd",value:function(){if(-1===this._currentPosition.segment)throw new Error("missing segment");return this._path[this._currentPosition.segment+1]}},{key:"_nextPosition",value:function(e,t,n,i){if(this._currentPosition.isPathEnd)return!1;var r=this._currentPosition.abscissa;for(this._currentPosition.segmentLength>0&&(r/=this._currentPosition.segmentLength),this._currentPosition.copyTo(t);t.abscissa+e*this._partLengthRatio>t.segmentLength+this._tolerance;){if(n){if(0===n.length)if(0===r){var a=this._path[t.segment];n.push([a[0],a[1]])}else n.push(this.getSegCoord2D(this._path,t.segment,r));var o=this._path[t.segment+1];n.push([o[0],o[1]])}if(r=0,e-=(t.segmentLength-t.abscissa)/this._partLengthRatio,this._partSegCount)t.segment=this.nextSegment(),t.segmentLength=this.calculateSegLength(this._path,t.segment),t.abscissa=0,this._partSegCount--;else{if(!this.setPosAtNextPart())return 0!==i&&(t.segmentLength=this.calculateSegLength(this._path,t.segment),t.isPartEnd=!0,1===i?(t.abscissa=t.segmentLength,t.isPathEnd=!0):t.abscissa=t.segmentLength+e,!0);this._currentPosition.copyTo(t)}}if(t.abscissa+=e*this._partLengthRatio,n){if(0===n.length)if(0===r){var s=this._path[t.segment];n.push([s[0],s[1]])}else n.push(this.getSegCoord2D(this._path,t.segment,r));var l=t.abscissa/t.segmentLength;if(1===l){var u=this._path[t.segment+1];n.push([u[0],u[1]])}else n.push(this.getSegCoord2D(this._path,t.segment,l))}return this._partSegCount||Math.abs(t.abscissa-t.segmentLength)<this._tolerance&&(t.isPathEnd=this._partIsLast,t.isPartEnd=!0),!0}},{key:"_getPoint",value:function(e){if(-1===e.segment)throw new Error("missing segment");var t=e.segmentLength<=0?0:e.abscissa/e.segmentLength;
1return this.getSegCoord2D(this._path,e.segment,t)}},{key:"_getAngle",value:function(e){if(-1===e.segment)throw new Error("missing segment");var t=e.segmentLength<=0?0:e.abscissa/e.segmentLength;return this.getSegAngleCS(this._path,e.segment,t)}},{key:"setPosAtNextPart",value:function(){for(;this._partSegCount;)this.hasNextSegment()&&this.nextSegment(),this._partSegCount--;if(!this.hasNextSegment())return!1;for(this._partLength=0,this._partIsLast=!0,this._partSegCount=0;this.hasNextSegment();)if(this._partLength+=this.calculateSegLength(this._path,this.nextSegment()),this._partSegCount++,1===Object(l.f)(this._path[this.getEndPointIndex()])){this._partIsLast=!this.hasNextSegment();break}for(var e=this._partSegCount;e;)this.previousSegment(),--e;this._currentPosition.segment=this.nextSegment(),this._currentPosition.segmentLength=this.calculateSegLength(this._path,this._currentPosition.segment),this._currentPosition.abscissa=0,this._currentPosition.isPathEnd=this._currentPosition.isPartEnd=!1,--this._partSegCount;var t=this.getStartPointIndex();this._ctrlPtBegin=1===Object(l.f)(this._path[t]);var n=t+this._partSegCount+1;if(n>=this._path.length&&(n=0),this._ctrlPtEnd=1===Object(l.f)(this._path[n]),this._patternLength>0){var i=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,r=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap,a=Math.round((this._partLength-(i+r))/this._patternLength);a<=0&&(a=i+r>0?0:1),this._partLengthRatio=this._partLength/(i+r+a*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}},{key:"hasNextSegment",value:function(){return this._seg<this._path.length-2}},{key:"previousSegment",value:function(){return--this._seg}},{key:"nextSegment",value:function(){return++this._seg}},{key:"getStartPointIndex",value:function(){return this._seg}},{key:"getEndPointIndex",value:function(){return this._seg+1}}]),n}(p),M=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new I(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();M.instance=null;var I=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,a){var o,s,l;return Object(r.a)(this,n),(o=t.call(this,e,!0,!0))._walker=new C,o._walker.updateTolerance(a),o._endings=i.lineDashEnding,o._customDashPos=-(null!=(s=i.offsetAlongLine)?s:0)*a,o._offsetAtEnd=(null!=(l=i.customEndingOffset)?l:0)*a,o._pattern=new P,o._pattern.init(i.dashTemplate,!0),o._pattern.scale(a),o}return Object(a.a)(n,[{key:"processPath",value:function(e){if(0===this._pattern.length())return this.iteratePath=!1,{paths:[e]};if(!this.iteratePath){var t=!0;switch(this._endings){case"HalfPattern":case"HalfGap":default:this._pattern.extPtGap=0;break;case"FullPattern":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case"FullGap":this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case"NoConstraint":this.isClosed||(t=!1);break;case"Custom":this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}var n=this._walker.calculatePathLength(e);if(this._pattern.isEmpty()||n<.1*this._pattern.length())return{paths:[e]};if(!this._walker.init(e,this._pattern,t))return{paths:[e]}}var i;if(this.iteratePath)i=this._pattern.nextValue();else{var r;switch(this._endings){case"HalfPattern":default:r=.5*this._pattern.firstValue();break;case"HalfGap":r=.5*-this._pattern.lastValue();break;case"FullGap":r=-this._pattern.lastValue();break;case"FullPattern":r=0;break;case"NoConstraint":case"Custom":r=-this._customDashPos}var a=r/this._pattern.length();r=(a-=Math.floor(a))*this._pattern.length(),this._pattern.reset(),i=this._pattern.nextValue();for(var o=!1;r>=i;)r-=i,i=this._pattern.nextValue(),o=!o;i-=r,o?(this._walker.nextPosition(i),i=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(i),i=this._pattern.nextValue(),this._walker.nextPosition(i),i=this._pattern.nextValue())}var s=this._walker.nextCurve(i);return s?this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(this._firstCurve.splice(0,1),d.mergePath(s,this._firstCurve),this._firstCurve=null)):(i=this._pattern.nextValue(),!this._walker.nextPosition(i)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s=this._firstCurve,this._firstCurve=null)):this.iteratePath=!0):(this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null),{paths:[s]}}}]),n}(l.a),L=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new A(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();L.instance=null;var A=function(){function e(t,n,i){switch(Object(r.a)(this,e),this._inputGeometries=t,this._curveHelper=new p,this._width=(void 0!==n.width?n.width:2)*i,n.method){case"Mitered":default:this._method="Mitered";break;case"Bevelled":this._method="Bevelled";break;case"Rounded":case"TrueBuffer":this._method="Rounded";break;case"Square":this._method="Square"}this._option=n.option,this._offsetFlattenError=v*i}return Object(a.a)(e,[{key:"next",value:function(){for(var e=this._inputGeometries.next();e;){if(Object(s.d)(e)&&this._width>0){if(Math.min(e.xmax-e.xmin,e.ymax-e.ymin)-2*this._width<0)return e;var t=[];return t.push([[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]),t.push([[e.xmin+this._width,e.ymin+this._width],[e.xmax-this._width,e.ymin+this._width],[e.xmax-this._width,e.ymax-this._width],[e.xmin+this._width,e.ymax-this._width],[e.xmin+this._width,e.ymin+this._width]]),{rings:t}}if(Object(s.g)(e)&&this._width>0){var n,r=[],a=Object(i.a)(e.rings);try{for(a.s();!(n=a.n()).done;){var o=n.value,l=this._curveHelper.calculatePathLength(o),u=this._curveHelper.offset(o,this._width,this._method,4,this._offsetFlattenError);u&&(l<0&&u.reverse(),r.push(u))}}catch(c){a.e(c)}finally{a.f()}if(r.length)return{rings:r}}e=this._inputGeometries.next()}return null}}]),e}(),D=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new z(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();D.instance=null;var z=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,a){var o;return Object(r.a)(this,n),(o=t.call(this,e,!1,!0))._curveHelper=new p,o._length=(void 0!==i.length?i.length:20)*a,o._angle=void 0!==i.angle?i.angle:225,o._position=void 0!==i.position?i.position:50,o._length<0&&(o._length=-o._length),o._position<20&&(o._position=20),o._position>80&&(o._position=80),o._mirror=!1,o}return Object(a.a)(n,[{key:"processPath",value:function(e){if(this._curveHelper.isEmpty(e,!1))return null;var t=e[0],n=e[e.length-1],i=[n[0]-t[0],n[1]-t[1]];this._curveHelper.normalize(i);var r=[t[0]+(n[0]-t[0])*this._position/100,t[1]+(n[1]-t[1])*this._position/100],a=Math.cos((90-this._angle)/180*Math.PI),o=Math.sin((90-this._angle)/180*Math.PI);return this._mirror&&(o=-o),this._mirror=!this._mirror,{paths:[[t,[r[0]-this._length/2*a,r[1]-this._length/2*o],[r[0]+this._length/2*a,r[1]+this._length/2*o],n]]}}}]),n}(l.a),R=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new E(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();R.instance=null;var E=function(){function e(t,n,i){Object(r.a)(this,e),this._inputGeometries=t,this._offsetX=void 0!==n.offsetX?n.offsetX*i:0,this._offsetY=void 0!==n.offsetY?-n.offsetY*i:0}return Object(a.a)(e,[{key:"next",value:function(){for(var e=this._inputGeometries.next();e;){if(Object(s.d)(e))return{xmin:e.xmin+this._offsetX,xmax:e.xmax+this._offsetX,ymin:e.ymin+this._offsetY,ymax:e.ymax+this._offsetY};if(Object(s.g)(e)){var t=Object(o.a)(e);return this._moveMultipath(t.rings,this._offsetX,this._offsetY),t}if(Object(s.h)(e)){var n=Object(o.a)(e);return this._moveMultipath(n.paths,this._offsetX,this._offsetY),n}if(Object(s.e)(e)){var i=Object(o.a)(e);return this._movePath(i.points,this._offsetX,this._offsetY),i}if(Object(s.f)(e))return{x:e.x+this._offsetX,y:e.y+this._offsetY};e=this._inputGeometries.next()}return null}},{key:"_moveMultipath",value:function(e,t,n){if(e){var r,a=Object(i.a)(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;this._movePath(o,t,n)}}catch(s){a.e(s)}finally{a.f()}}}},{key:"_movePath",value:function(e,t,n){if(e){var r,a=Object(i.a)(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;o[0]+=t,o[1]+=n}}catch(s){a.e(s)}finally{a.f()}}}}]),e}(),V=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n,i){return new F(e,t,n,i)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();V.instance=null;var F=function(){function e(t,n,i,a){var o;Object(r.a)(this,e),this._inputGeometries=t,this._curveHelper=new p,this._offset=(null!=(o=n.offset)?o:1)*i,a||(this._offset=-this._offset),this._method=n.method,this._option=n.option,this._offsetFlattenError=v*i}return Object(a.a)(e,[{key:"next",value:function(){for(var e=this._inputGeometries.next();e;){if(0===this._offset)return e;if(Object(s.d)(e)){if("Rounded"===this._method&&this._offset>0){var t=[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]],n=this._curveHelper.offset(t,this._offset,this._method,4,this._offsetFlattenError);return n?{rings:[n]}:null}if(Math.min(e.xmax-e.xmin,e.ymax-e.ymin)+2*this._offset>0)return{xmin:e.xmin-this._offset,xmax:e.xmax+this._offset,ymin:e.
1ymin-this._offset,ymax:e.ymax+this._offset}}if(Object(s.g)(e)){var r,a=[],o=Object(i.a)(e.rings);try{for(o.s();!(r=o.n()).done;){var l=r.value,u=this._curveHelper.offset(l,this._offset,this._method,4,this._offsetFlattenError);u&&a.push(u)}}catch(p){o.e(p)}finally{o.f()}if(a.length)return{rings:a}}if(Object(s.h)(e)){var c,h=[],f=Object(i.a)(e.paths);try{for(f.s();!(c=f.n()).done;){var v=c.value,d=this._curveHelper.offset(v,this._offset,this._method,4,this._offsetFlattenError);d&&h.push(d)}}catch(p){f.e(p)}finally{f.f()}if(h.length)return{paths:h}}e=this._inputGeometries.next()}return null}}]),e}(),U=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new B(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();U.instance=null;var B=function(){function e(t,n,i){Object(r.a)(this,e),this._inputGeometries=t,this._reverse=void 0===n.reverse||n.reverse}return Object(a.a)(e,[{key:"next",value:function(){for(var e=this._inputGeometries.next();e;){if(!this._reverse)return e;if(Object(s.h)(e)){var t=Object(o.a)(e);return Object(l.h)(t.paths),t}e=this._inputGeometries.next()}return null}}]),e}(),N=n(138),G=n(304),H=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new W(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();H.instance=null;var W=function(){function e(t,n,i){Object(r.a)(this,e),this._inputGeometries=t,this._rotateAngle=void 0!==n.angle?-n.angle*Math.PI/180:0}return Object(a.a)(e,[{key:"next",value:function(){for(var e=this._inputGeometries.next();e;){if(0===this._rotateAngle)return e;var t=Object(N.g)();Object(G.a)(t,e);var n=(t[2]+t[0])/2,i=(t[3]+t[1])/2;if(Object(s.d)(e)){var r={rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]};return this._rotateMultipath(r.rings,n,i),r}if(Object(s.g)(e)){var a=Object(o.a)(e);return this._rotateMultipath(a.rings,n,i),a}if(Object(s.h)(e)){var l=Object(o.a)(e);return this._rotateMultipath(l.paths,n,i),l}if(Object(s.e)(e)){var u=Object(o.a)(e);return this._rotatePath(u.points,n,i),u}if(Object(s.f)(e))return e;e=this._inputGeometries.next()}return null}},{key:"_rotateMultipath",value:function(e,t,n){if(e){var r,a=Object(i.a)(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;this._rotatePath(o,t,n)}}catch(s){a.e(s)}finally{a.f()}}}},{key:"_rotatePath",value:function(e,t,n){if(e){var r,a=Math.cos(this._rotateAngle),o=Math.sin(this._rotateAngle),s=Object(i.a)(e);try{for(s.s();!(r=s.n()).done;){var l=r.value,u=l[0]-t,c=l[1]-n;l[0]=t+u*a-c*o,l[1]=n+u*o+c*a}}catch(h){s.e(h)}finally{s.f()}}}}]),e}(),q=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new Y(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();q.instance=null;var Y=function(){function e(t,n,i){Object(r.a)(this,e),this._inputGeometries=t,this._xFactor=void 0!==n.xScaleFactor?n.xScaleFactor:1.15,this._yFactor=void 0!==n.yScaleFactor?n.yScaleFactor:1.15}return Object(a.a)(e,[{key:"next",value:function(){for(var e=this._inputGeometries.next();e;){if(1===this._xFactor&&1===this._yFactor)return e;var t=Object(N.g)();Object(G.a)(t,e);var n=(t[2]+t[0])/2,i=(t[3]+t[1])/2;if(Object(s.d)(e)){var r={rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]};return this._scaleMultipath(r.rings,n,i),r}if(Object(s.g)(e)){var a=Object(o.a)(e);return this._scaleMultipath(a.rings,n,i),a}if(Object(s.h)(e)){var l=Object(o.a)(e);return this._scaleMultipath(l.paths,n,i),l}if(Object(s.e)(e)){var u=Object(o.a)(e);return this._scalePath(u.points,n,i),u}if(Object(s.f)(e))return e;e=this._inputGeometries.next()}return null}},{key:"_scaleMultipath",value:function(e,t,n){if(e){var r,a=Object(i.a)(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;this._scalePath(o,t,n)}}catch(s){a.e(s)}finally{a.f()}}}},{key:"_scalePath",value:function(e,t,n){if(e){var r,a=Object(i.a)(e);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=(o[0]-t)*this._xFactor,l=(o[1]-n)*this._yFactor;o[0]=t+s,o[1]=n+l}}catch(u){a.e(u)}finally{a.f()}}}}]),e}(),Z=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new J
1(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();Z.instance=null;var X,K,J=function(){function e(t,n,i){Object(r.a)(this,e),this._inputGeometries=t,this._height=(void 0!==n.amplitude?n.amplitude:2)*i,this._period=(void 0!==n.period?n.period:3)*i,this._style=n.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new P,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new C,this._walker.updateTolerance(i)}return Object(a.a)(e,[{key:"next",value:function(){for(var e=this._inputGeometries.next();e;){if(0===this._height||0===this._period)return e;if(Object(s.h)(e)){var t=this._processGeom(e.paths);if(t.length)return{paths:t}}if(Object(s.g)(e)){var n=this._processGeom(e.rings);if(n.length)return{rings:n}}e=this._inputGeometries.next()}return null}},{key:"_processGeom",value:function(e){var t,n=[],r=Object(i.a)(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(this._walker.init(a,this._pattern))switch(this._style){case"Sinus":default:n.push(this._constructCurve(a,!1));break;case"Square":n.push(this._constructSquare(a));break;case"Triangle":n.push(this._constructTriangle(a));break;case"Random":n.push(this._constructCurve(a,!0))}else n.push(a)}}catch(o){r.e(o)}finally{r.f()}return n}},{key:"_constructCurve",value:function(e,t){var n=new d,i=this._walker.calculatePathLength(e),r=Math.round(i/this._period);0===r&&(r=1);var a=16*r+1,o=i/r,s=this._period/16,l=1/a,u=2*Math.PI*i/o,c=2*Math.PI*Math.random(),h=2*Math.PI*Math.random(),f=2*Math.PI*Math.random(),v=.75-Math.random()/2,p=.75-Math.random()/2,y={};this._walker.curPointAndAngle(y),n.startPath(y.pt);for(var _=0;;){if(!this._walker.nextPointAndAngle(s,y)){n.lineTo(e[e.length-1]);break}var m=_,g=void 0;if(_+=l,t){var b=this._height/2*(1+.3*Math.sin(v*u*m+c));g=b*Math.sin(u*m+h),g+=b*Math.sin(p*u*m+f),g/=2}else g=.5*this._height*Math.sin(.5*u*m);n.lineTo([y.pt[0]-g*y.sa,y.pt[1]+g*y.ca])}return n.path()}},{key:"_constructSquare",value:function(e){var t=new d,n=this._walker.calculatePathLength(e);Math.round(n/this._period);for(var i=!0;;){var r=!1;if(this._walker.curPositionIsValid()){var a={};this._walker.curPointAndAngle(a);var o={};if(this._walker.nextPointAndAngle(this._period,o)){var s={};this._walker.nextPointAndAngle(this._period,s)&&(i?(t.startPath(a.pt),i=!1):t.lineTo(a.pt),t.lineTo([a.pt[0]-this._height/2*a.sa,a.pt[1]+this._height/2*a.ca]),t.lineTo([o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca]),t.lineTo([o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca]),t.lineTo([s.pt[0]+this._height/2*s.sa,s.pt[1]-this._height/2*s.ca]),r=!0)}}if(!r){t.lineTo(this._walker.getPathEnd());break}}return t.path()}},{key:"_constructTriangle",value:function(e){var t=new d,n=this._walker.calculatePathLength(e);Math.round(n/this._period);for(var i=!0;;){var r=!1;if(this._walker.curPositionIsValid()){var a={};this._walker.curPointAndAngle(a);var o={};if(this._walker.nextPointAndAngle(this._period/2,o)){var s={};this._walker.nextPointAndAngle(this._period,s)&&(this._walker.nextPosition(this._period/2)&&(i?(t.startPath(a.pt),i=!1):t.lineTo(a.pt),t.lineTo([o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca]),t.lineTo([s.pt[0]+this._height/2*s.sa,s.pt[1]-this._height/2*s.ca])),r=!0)}}if(!r){t.lineTo(this._walker.getPathEnd());break}}return t.path()}}]),e}();(K=X||(X={})).NoConstraint="NoConstraint",K.WithMarkers="WithMarkers",K.WithFullGap="WithFullGap",K.WithHalfGap="WithHalfGap",K.Custom="Custom";var Q=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new $(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();Q.instance=null;var $=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,a){var o,s,l,u,c;return Object(r.a)(this,n),(o=t.call(this,e,!0,!0))._geometryWalker=new C,o._geometryWalker.updateTolerance(a),o._angleToLine=null==(s=i.angleToLine)||s,o._offset=(null!=(l=i.offset)?l:0)*a,o._originalEndings=i.endings,o._offsetAtEnd=(null!=(u=i.customEndingOffset)?u:0)*a,o._position=-(null!=(c=i.offsetAlongLine)?c:0)*a,o._pattern=new P,o._pattern.init(i.placementTemplate,!1),o._pattern.scale(a),o._endings=o._originalEndings,o}return Object(a.a)(n,[{key:"processPath",value:function(e){if(this._pattern.isEmpty())return null;var t;if(this.iteratePath)t=this._pattern.nextValue();else{this._originalEndings===X.WithFullGap&&this.isClosed?this._endings=X.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;var n,i=!0;switch(this._endings){case X.NoConstraint:n=-this._position,n=this._adjustPosition(n),i=!1;break;
1case X.WithHalfGap:default:n=-this._pattern.lastValue()/2;break;case X.WithFullGap:n=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case X.WithMarkers:n=0;break;case X.Custom:n=-this._position,n=this._adjustPosition(n),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(e,this._pattern,i))return null;this._pattern.reset();for(var r=0;n>r;)n-=r,r=this._pattern.nextValue();t=r-=n,this.iteratePath=!0}var a={};return this._geometryWalker.nextPointAndAngle(t,a)?this._endings===X.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===X.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(a.pt[0]-this._offset*a.sa,a.pt[1]+this._offset*a.ca),this._angleToLine&&this.internalPlacement.setRotateCS(a.ca,a.sa),this.internalPlacement):(this.iteratePath=!1,null)}},{key:"_adjustPosition",value:function(e){var t=e/this._pattern.length();return(t-=Math.floor(t))*this._pattern.length()}}]),n}(l.b),ee=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new te(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();ee.instance=null;var te=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,a){var o;return Object(r.a)(this,n),(o=t.call(this,e,!1,!0))._curveHelper=new p,o._angleToLine=void 0===i.angleToLine||i.angleToLine,o._offset=void 0!==i.offset?i.offset*a:0,o._type=i.extremityPlacement,o._position=void 0!==i.offsetAlongLine?i.offsetAlongLine*a:0,o._beginProcessed=!1,o}return Object(a.a)(n,[{key:"processPath",value:function(e){var t;switch(this._type){case"Both":default:this._beginProcessed?(t=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(t=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case"JustBegin":t=this._atExtremities(e,this._position,!0);break;case"JustEnd":t=this._atExtremities(e,this._position,!1);case"None":}return t}},{key:"_atExtremities",value:function(e,t,n){var i=e.length;if(i<2)return null;for(var r,a=n?1:i-2,o=n?i:-1,s=n?1:-1,u=0,c=n?e[0]:e[i-1],h=a;h!==o;h+=s){r=c,c=e[h];var f=this._curveHelper.calculateLength(r,c);if(u+f>t){var v=(t-u)/f,d=this._curveHelper.getAngleCS(r,c,v),p=Object(x.a)(d,2),y=p[0],_=p[1],m=Object(l.e)(r,c,v);return this.internalPlacement.setTranslate(m[0]-this._offset*_,m[1]+this._offset*y),this._angleToLine&&this.internalPlacement.setRotateCS(-y,-_),this.internalPlacement}u+=f}return null}}]),n}(l.b),ne=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new ie(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();ne.instance=null;var ie=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,a){var o;return Object(r.a)(this,n),(o=t.call(this,e,!0,!0))._walker=new C,o._walker.updateTolerance(a),o._angleToLine=void 0===i.angleToLine||i.angleToLine,o._offset=void 0!==i.offset?i.offset*a:0,o._beginGap=void 0!==i.beginPosition?i.beginPosition*a:0,o._endGap=void 0!==i.endPosition?i.endPosition*a:0,o._flipFirst=void 0===i.flipFirst||i.flipFirst,o._pattern=new P,o._pattern.init(i.positionArray,!1,!1),o._subPathLen=0,o._posCount=o._pattern.size(),o._isFirst=!0,o._prevPos=0,o}return Object(a.a)(n,[{key:"processPath",value:function(e){if(this._pattern.isEmpty())return null;var t;if(this.iteratePath){var n=this._pattern.nextValue()*this._subPathLen,i=this._beginGap+n;t=i-this._prevPos,this._prevPos=i}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=this._walker.calculatePathLength(e)-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(e,this._pattern,!1))return null;this._pattern.reset();var r=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+r;t=a-this._prevPos,this._prevPos=a,this.iteratePath=!0}var o={};if(!this._walker.nextPointAndAngle(t,o,1))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(o.pt[0]-this._offset*o.sa,o.pt[1]+this._offset*o.ca);var s,l,u=this._isFirst&&this._flipFirst;
1return this._angleToLine?(s=o.ca,l=o.sa):(s=1,l=0),u&&(s=-s,l=-l),this.internalPlacement.setRotateCS(s,l),this._isFirst=!1,this._posCount--,0===this._posCount&&(this.iteratePath=!1),this.internalPlacement}}]),n}(l.b),re=n(554);var ae=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new oe(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();ae.instance=null;var oe=function(){function e(t,n,i){if(Object(r.a)(this,e),this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._stepX=(void 0!==n.stepX?Math.abs(n.stepX):16)*i,this._stepY=(void 0!==n.stepY?Math.abs(n.stepY):16)*i,0!==this._stepX&&0!==this._stepY&&t&&function(e){return void 0!==e.rings}(t)&&t.rings){if(this._gridType=void 0!==n.gridType?n.gridType:"Fixed","Random"===this._gridType)this._randomness=void 0!==n.randomness?n.randomness/100:1,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0;else{if(this._randomness=0,this._gridAngle=void 0!==n.gridAngle?n.gridAngle:0,this._shiftOddRows=void 0!==n.shiftOddRows&&n.shiftOddRows,this._offsetX=void 0!==n.offsetX?n.offsetX*i:0,this._offsetY=void 0!==n.offsetY?n.offsetY*i:0,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}this._graphicOriginX=0,this._graphicOriginY=0,this._internalPlacement=new re.a,this._calculateMinMax(t),this._geometry=t}}return Object(a.a)(e,[{key:"next",value:function(){return this._geometry?this._nextInside():null}},{key:"_calculateMinMax",value:function(e){var t,n,r,a,o,s,l,u;this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,o=s=Number.MAX_VALUE,l=u=-Number.MAX_VALUE;var c,h=Object(i.a)(e.rings);try{for(h.s();!(c=h.n()).done;)for(var f=c.value,v=f?f.length:0,d=0;d<v;++d)t=f[d][0]-this._graphicOriginX-this._offsetX,n=f[d][1]-this._graphicOriginY-this._offsetY,r=this._cosAngle*t-this._sinAngle*n,a=this._sinAngle*t+this._cosAngle*n,o=Math.min(o,r),l=Math.max(l,r),s=Math.min(s,a),u=Math.max(u,a)}catch(p){h.e(p)}finally{h.f()}o+=this._graphicOriginX,l+=this._graphicOriginX,s+=this._graphicOriginY,u+=this._graphicOriginY,this._xMin=Math.round(o/this._stepX),this._xMax=Math.round(l/this._stepX),this._yMin=Math.round(s/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1}},{key:"_nextInside",value:function(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}var e=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(e+=.5*this._stepX);var t=this._currentY*this._stepY+this._offsetY,n=void 0,i=void 0;return this._currentX++,"Random"===this._gridType?(n=this._graphicOriginX+e+this._stepX*this._randomness*(.5-Math.random())*2/3,i=this._graphicOriginY+t+this._stepY*this._randomness*(.5-Math.random())*2/3):(n=this._graphicOriginX+this._cosAngle*e+this._sinAngle*t,i=this._graphicOriginY-this._sinAngle*e+this._cosAngle*t),this._internalPlacement.setTranslate(n,i),this._internalPlacement}}}]),e}(),se=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new le(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();se.instance=null;var le=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,a){var o;return Object(r.a)(this,n),(o=t.call(this,e,!0,!0))._curveHelper=new p,o._angleToLine=void 0===i.angleToLine||i.angleToLine,o._offset=void 0!==i.offset?i.offset*a:0,o._relativeTo=i.relativeTo,o._position=void 0!==i.startPointOffset?i.startPointOffset*a:0,o._epsilon=.001*a,o}return Object(a.a)(n,[{key:"processPath",value:function(e){var t=this._position;if("SegmentMidpoint"===this._relativeTo){for(this.iteratePath||(this._segmentCount=e.length,this._curSegment=1,this.iteratePath=!0);this._curSegment<this._segmentCount;){var n=this._curSegment;this._curSegment++;
1var i=e[n-1],r=e[n],a=this._curveHelper.calculateLength(i,r);if(!(a<this._epsilon)){var o=.5+this._position/a,s=this._curveHelper.getAngleCS(i,r,o),u=Object(x.a)(s,2),c=u[0],h=u[1],f=Object(l.e)(i,r,o);return this.internalPlacement.setTranslate(f[0]-this._offset*h,f[1]+this._offset*c),this._angleToLine&&this.internalPlacement.setRotateCS(c,h),this.internalPlacement}}return this.iteratePath=!1,null}"LineEnd"===this._relativeTo&&Object(l.i)(e);var v=this.onLine(e,t);return"LineEnd"===this._relativeTo&&Object(l.i)(e),v}},{key:"onLine",value:function(e,t){var n,i=!1;switch(this._relativeTo){case"LineMiddle":default:n=this._curveHelper.calculatePathLength(e)/2+t;break;case"LineBeginning":n=t;break;case"LineEnd":n=t,i=!0}for(var r,a=e.length,o=0,s=e[0],u=1;u<a;++u){r=s,s=e[u];var c=this._curveHelper.calculateLength(r,s);if(o+c>n){var h=(n-o)/c,f=this._curveHelper.getAngleCS(r,s,h),v=Object(x.a)(f,2),d=v[0],p=v[1],y=Object(l.e)(r,s,h),_=i?this._offset:-this._offset;return this.internalPlacement.setTranslate(y[0]-_*p,y[1]+_*d),this._angleToLine&&(i?this.internalPlacement.setRotateCS(-d,-p):this.internalPlacement.setRotateCS(d,p)),this.internalPlacement}o+=c}return null}}]),n}(l.b),ue=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new ce(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();ue.instance=null;var ce=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,a){var o;return Object(r.a)(this,n),(o=t.call(this,e,!0,!0))._curveHelper=new p,o._angleToLine=void 0===i.angleToLine||i.angleToLine,o._offset=void 0!==i.offset?i.offset*a:0,o._endPoints=void 0===i.placeOnEndPoints||i.placeOnEndPoints,o._controlPoints=void 0===i.placeOnControlPoints||i.placeOnControlPoints,o._regularVertices=void 0===i.placeOnRegularVertices||i.placeOnRegularVertices,o._tags=[],o._tagIterator=0,o}return Object(a.a)(n,[{key:"processPath",value:function(e){if(this.iteratePath||(this._preparePath(e),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;var t=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(t[2]);var n=t[0],i=t[1];if(0!==this._offset){var r=Math.cos(t[2]),a=Math.sin(t[2]);n-=this._offset*a,i+=this._offset*r}return this.internalPlacement.setTranslate(n,i),this._tagIterator++,this.internalPlacement}},{key:"_preparePath",value:function(e){this._tags.length=0,this._tagIterator=0;for(var t,n,i=Object(l.g)(e),r=e.length-1,a=0,o=0,s=0,u=0,c=0;a<r;){t=e[++a-1],n=e[a];var h=Object(l.f)(t),f=Object(l.f)(n);(this._angleToLine||0!==this._offset)&&(u=this._curveHelper.getAngle(t,n,0)),1===a?i?(o=u,s=h):(this._endPoints||this._controlPoints&&1===h)&&this._tags.push([t[0],t[1],u]):1===h?this._controlPoints&&this._tags.push([t[0],t[1],he(c,u)]):this._regularVertices&&this._tags.push([t[0],t[1],he(c,u)]),(this._angleToLine||0!==this._offset)&&(c=this._curveHelper.getAngle(t,n,1)),a===r&&(i?1===f||1===s?this._controlPoints&&this._tags.push([n[0],n[1],he(c,o)]):this._regularVertices&&this._tags.push([n[0],n[1],he(c,o)]):(this._endPoints||this._controlPoints&&1===f)&&this._tags.push([n[0],n[1],c]))}this._tagIterator=0}}]),n}(l.b);function he(e,t){for(var n=Math.PI;Math.abs(t-e)>n+2e-15;)t-e>n?t-=2*n:t+=2*n;return(e+t)/2}var fe=function(){function e(){Object(r.a)(this,e)}return Object(a.a)(e,[{key:"execute",value:function(e,t,n){return new ve(e,t,n)}}],[{key:"local",value:function(){return null===e.instance&&(e.instance=new e),e.instance}}]),e}();fe.instance=null;var ve=function(){function e(t,n,i){Object(r.a)(this,e),this._geometry=t,this._offsetX=void 0!==n.offsetX?n.offsetX*i:0,this._offsetY=void 0!==n.offsetY?n.offsetY*i:0,this._method=void 0!==n.method?n.method:"OnPolygon",this._internalPlacement=new re.a}return Object(a.a)(e,[{key:"next",value:function(){var e=this._geometry;return this._geometry=null,e&&function(e){return void 0!==e.rings}(e)?this._polygonCenter(e):null}},{key:"_polygonCenter",value:function(e){this._method;var t=Object(N.g)();return Object(G.a)(t,e),this._internalPlacement.setTranslate((t[2]+t[0])/2+this._offsetX,(t[3]+t[1])/2-this._offsetY),!0?this._internalPlacement:null}}]),e}();function de(e){if(!e)return null;switch(e.type){case"CIMGeometricEffectAddControlPoints":return u.local();case"CIMGeometricEffectArrow":return _.local();case"CIMGeometricEffectBuffer":return g.local();case"CIMGeometricEffectControlMeasureLine":return O.local();case"CIMGeometricEffectCut":return k.local();case"CIMGeometricEffectDashes":return M.local();case"CIMGeometricEffectDonut":return L.local();case"CIMGeometricEffectJog":return D.local();case"CIMGeometricEffectMove":return R.local();case"CIMGeometricEffectOffset":return V.local();case"CIMGeometricEffectReverse":return U.local();case"CIMGeometricEffectRotate":return H.local();case"CIMGeometricEffectScale":return q.local();case"CIMGeometricEffectWave":return Z.local()}return null}function pe(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return Q.local();case"CIMMarkerPlacementAtExtremities":return ee.local();case"CIMMarkerPlacementAtRatioPositions":return ne.local();case"CIMMarkerPlacementInsidePolygon":return ae.local();case"CIMMarkerPlacementOnLine":return se.local();case"CIMMarkerPlacementOnVertices":return ue.local();case"CIMMarkerPlacementPolygonCenter":return fe.local()}return null}},576:function(e,t,n){"use strict";n.d(t,"a",(function(){return R}));var i=n(11),r=n(3),a=n(2),o=n(43),s=n(39),l=n(4),u=n(5),c=(n(12),n(7)),h=n(303),f=n(569),v=n(573),d=n(23),p=n(14),y=n(21),_=n(549),m=n(24),g=n(9),b=n(566),x=n(47),O=n(84),w=n(375),k=n(129),S=n(534),j=n(538),P=y.a.getL
1ogger("esri.views.2d.engine.webgl.Mesh2D"),T=function(e,t,n,i){for(var r=0,a=1;a<n;a++){var o=e[2*(t+a-1)],s=e[2*(t+a-1)+1];r+=(e[2*(t+a)]-o)*(e[2*(t+a)+1]+s)}return i?r>0:r<0},C=function(e,t){for(var n=e.coords,r=e.lengths,a=[],o=0,s=0;o<r.length;s+=r[o],o+=1){for(var l=s,u=[];o<r.length-1&&T(n,s+r[o],r[o+1],t);s+=r[o+=1])u.push(s+r[o]-l);var c,h=n.slice(2*l,2*(s+r[o])),f=Object(b.a)(h,u,2),v=Object(i.a)(f);try{for(v.s();!(c=v.n()).done;){var d=c.value;a.push(d+l)}}catch(p){v.e(p)}finally{v.f()}}return a},M=function(){function e(t,n,i){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object(r.a)(this,e),this._cache={},this.vertices=t,this.indices=n,this.primitiveType=i,this.isMapSpace=a}return Object(a.a)(e,[{key:"destroy",value:function(){for(var e in Object(c.k)(this._cache.indexBuffer)&&this._cache.indexBuffer.dispose(),this._cache.vertexBuffers)Object(c.k)(this._cache.vertexBuffers[e])&&this._cache.vertexBuffers[e].dispose()}},{key:"elementType",get:function(){return function(e){switch(e.BYTES_PER_ELEMENT){case 1:return 5121;case 2:return 5123;case 4:return 5125;default:throw new p.a("Cannot get DataType of array")}}(this.indices)}},{key:"getIndexBuffer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35044;return this._cache.indexBuffer||(this._cache.indexBuffer=j.a.createIndex(e,t,this.indices)),this._cache.indexBuffer}},{key:"getVertexBuffers",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:35044;return this._cache.vertexBuffers||(this._cache.vertexBuffers=Object.keys(this.vertices).reduce((function(i,r){return Object(g.a)(Object(g.a)({},i),{},Object(m.a)({},r,j.a.createVertex(e,n,t.vertices[r])))}),{})),this._cache.vertexBuffers}}],[{key:"fromRect",value:function(t){var n=t.x,i=t.y,r=n+t.width,a=i+t.height;return e.fromScreenExtent({xmin:n,ymin:i,xmax:r,ymax:a})}},{key:"fromPath",value:function(t){for(var n=Object(w.f)(new k.a,t.path,!1,!1),i=n.coords,r=new Uint32Array(C(n,!0)),a=new Uint32Array(i.length/2),o=0;o<a.length;o++)a[o]=Object(S.a)(Math.floor(i[2*o]),Math.floor(i[2*o+1]));return new e({geometry:a},r,4)}},{key:"fromGeometry",value:function(t,n){var i=n.geometry.type;switch(i){case"polygon":return e.fromPolygon(t,n.geometry);case"extent":return e.fromMapExtent(t,n.geometry);default:return P.error(new p.a("mapview-bad-type","Unable to create a mesh from type ".concat(i),n)),e.fromRect({x:0,y:0,width:1,height:1})}}},{key:"fromPolygon",value:function(t,n){for(var i=Object(w.g)(new k.a,n,!1,!1),r=i.coords,a=new Uint32Array(C(i,!1)),o=new Uint32Array(r.length/2),s=Object(O.a)(),l=Object(O.a)(),u=0;u<o.length;u++)Object(x.m)(s,r[2*u],r[2*u+1]),t.toScreen(l,s),o[u]=Object(S.a)(Math.floor(l[0]),Math.floor(l[1]));return new e({geometry:o},a,4,!0)}},{key:"fromScreenExtent",value:function(t){var n=t.xmin,i=t.xmax,r=t.ymin,a=t.ymax;return new e({geometry:new Uint32Array([Object(S.a)(n,r),Object(S.a)(i,r),Object(S.a)(n,a),Object(S.a)(n,a),Object(S.a)(i,r),Object(S.a)(i,a)])},new Uint32Array([0,1,2,3,4,5]),4)}},{key:"fromMapExtent",value:function(t,n){var i=t.toScreen([0,0],[n.xmin,n.ymin]),r=Object(d.a)(i,2),a=r[0],o=r[1],s=t.toScreen([0,0],[n.xmax,n.ymax]),l=Object(d.a)(s,2),u=l[0],c=l[1];return new e({geometry:new Uint32Array([Object(S.a)(a,o),Object(S.a)(u,o),Object(S.a)(a,c),Object(S.a)(a,c),Object(S.a)(u,o),Object(S.a)(u,c)])},new Uint32Array([0,1,2,3,4,5]),4)}}]),e}(),I=n(537),L=y.a.getLogger("esri.views.2d.engine.webgl.ClippingInfo"),A=function(e){return parseFloat(e)/100},D=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(e,i){var a;return Object(r.a)(this,n),(a=t.call(this))._clip=i,a._cache={},a.stage=e,a._handle=i.watch("version",(function(){return a._invalidate()})),a.ready(),a}return Object(a.a)(n,[{key:"_destroyGL",value:function(){Object(c.k)(this._cache.mesh)&&(this._cache.mesh.destroy(),this._cache.mesh=null),Object(c.k)(this._cache.vao)&&(this._cache.vao.dispose(),this._cache.vao=null)}},{key:"destroy",value:function(){this._destroyGL(),this._handle.remove()}},{key:"getVAO",value:function(e,t,n,i){var r=Object(d.a)(t.size,2),a=r[0],o=r[1];if("geometry"!==this._clip.type&&this._lastWidth===a&&this._lastHeight===o||(this._lastWidth=a,this._lastHeight=o,this._destroyGL()),Object(c.j)(this._cache.vao)){var s=this._createMesh(t,this._clip),l=s.getIndexBuffer(e),u=s.getVertexBuffers(e);this._cache.mesh=s,this._cache.vao=new I.a(e,n,i,u,l)}return this._cache.vao}},{key:"_createTransforms",value:function(){return{dvs:Object(h.b)()}}},{key:"_invalidate",value:function(){this._destroyGL(),this.requestRender()}},{key:"_createScreenRect",value:function(e,t){var n=Object(d.a)(e.size,2),i=n[0],r=n[1],a="string"==typeof t.left?A(t.left)*i:t.left,o="str
1ing"==typeof t.right?A(t.right)*i:t.right,s="string"==typeof t.top?A(t.top)*r:t.top,l="string"==typeof t.bottom?A(t.bottom)*r:t.bottom,u=a,c=s;return{x:u,y:c,width:Math.max(i-o-u,0),height:Math.max(r-l-c,0)}}},{key:"_createMesh",value:function(e,t){switch(t.type){case"rect":return M.fromRect(this._createScreenRect(e,t));case"path":return M.fromPath(t);case"geometry":return M.fromGeometry(e,t);default:return L.error(new p.a("mapview-bad-type","Unable to create ClippingInfo mesh from clip of type: ${clip.type}")),M.fromRect({x:0,y:0,width:1,height:1})}}}],[{key:"fromClipArea",value:function(e,t){return new n(e,t)}}]),n}(_.a),z=n(532),R=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments)).name=e.constructor.name,e}return Object(a.a)(n,[{key:"clips",set:function(e){this._clips=e,this.children.forEach((function(t){return t.clips=e})),this._updateClippingInfo()}},{key:"_createTransforms",value:function(){return{dvs:Object(h.b)()}}},{key:"doRender",value:function(e){var t=this.createRenderParams(e),n=t.painter,i=t.globalOpacity,r=t.profiler,a=t.drawPhase,o=a===z.c.LABEL||a===z.c.HIGHLIGHT?1:i*this.computedOpacity;r.recordContainerStart(this.name),n.beforeRenderLayer(t,this._clippingInfos?255:0,o),this.updateTransforms(e.state),this.renderChildren(t),n.compositeLayer(t,o),r.recordContainerEnd()}},{key:"renderChildren",value:function(e){Object(c.j)(this._renderPasses)&&(this._renderPasses=this.prepareRenderPasses(e.painter));var t,n=Object(i.a)(this.children);try{for(n.s();!(t=n.n()).done;){t.value.beforeRender(e)}}catch(u){n.e(u)}finally{n.f()}var r,a=Object(i.a)(this._renderPasses);try{for(a.s();!(r=a.n()).done;){var o=r.value;try{o.render(e)}catch(h){}}}catch(u){a.e(u)}finally{a.f()}var s,l=Object(i.a)(this.children);try{for(l.s();!(s=l.n()).done;){s.value.afterRender(e)}}catch(u){l.e(u)}finally{l.f()}}},{key:"createRenderParams",value:function(e){return e.requireFBO=this.requiresDedicatedFBO,e}},{key:"prepareRenderPasses",value:function(e){var t=this;return[e.registerRenderPass({name:"clip",brushes:[f.a.clip],target:function(){return t._clippingInfos},drawPhase:z.c.MAP|z.c.LABEL|z.c.LABEL_ALPHA|z.c.DEBUG|z.c.HIGHLIGHT})]}},{key:"updateTransforms",value:function(e){var t,n=Object(i.a)(this.children);try{for(n.s();!(t=n.n()).done;){t.value.setTransform(e)}}catch(r){n.e(r)}finally{n.f()}}},{key:"onAttach",value:function(){Object(o.a)(Object(s.a)(n.prototype),"onAttach",this).call(this),this._updateClippingInfo()}},{key:"onDetach",value:function(){Object(o.a)(Object(s.a)(n.prototype),"onDetach",this).call(this),this._updateClippingInfo()}},{key:"_updateClippingInfo",value:function(){var e=this;if(Object(c.k)(this._clippingInfos)&&(this._clippingInfos.forEach((function(e){return e.destroy()})),this._clippingInfos=null),this.stage){var t=this._clips;Object(c.k)(t)&&t.length&&(this._clippingInfos=t.items.map((function(t){return D.fromClipArea(e.stage,t)}))),this.requestRender()}}}]),n}(v.a)},577:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(3),r=n(2),a=function(){function e(t){Object(i.a)(this,e),this.readFile=t}return Object(r.a)(e,[{key:"resolveIncludes",value:function(e){return this.resolve(e)}},{key:"resolve",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Map;if(n.has(e))return n.get(e);var i=this.read(e);if(!i)throw new Error("cannot find shader file ".concat(e));for(var r=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm,a=r.exec(i),o=[];null!=a;)o.push({path:a[1],start:a.index,length:a[0].length}),a=r.exec(i);var s=0,l="";return o.forEach((function(e){l+=i.slice(s,e.start),l+=n.has(e.path)?"":t.resolve(e.path,n),s=e.start+e.length})),l+=i.slice(s),n.set(e,l),l}},{key:"read",value:function(e){return this.readFile(e)}}]),e}()},578:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var i=n(3),r=n(2),a=n(4),o=n(5),s=n(0),l=n(30),u=n(96),c=n(83),h=n(176),f=n(21),v=n(7),d=n(151),p=n(1),y=(n(15),n(12),n(10),n(6)),_=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(e){var r;return Object(i.a)(this,n),(r=t.call(this,e)).layer=null,r.parent=null,r}return Object(r.a)(n,[{key:"initialize",value:function(){var e=this;this.when().catch((function(t){if("layerview:create-error"!==t.name){var n=e.layer&&e.layer.id||"no id",
1i=e.layer&&e.layer.title||"no title";throw f.a.getLogger(e.declaredClass).error("#resolve()","Failed to resolve layer view (layer title: '".concat(i,"', id: '").concat(n,"')"),t),t}}))}},{key:"fullOpacity",get:function(){return Object(v.s)(this.get("layer.opacity"),1)*Object(v.s)(this.get("parent.fullOpacity"),1)}},{key:"suspended",get:function(){return!this.canResume()}},{key:"suspendInfo",get:function(){return this.getSuspendInfo()}},{key:"legendEnabled",get:function(){return!this.suspended&&!0===this.layer.legendEnabled}},{key:"updating",get:function(){return!!(this.updatingHandles&&this.updatingHandles.updating||this.isUpdating())}},{key:"updatingProgress",get:function(){return this.updating?0:1}},{key:"visible",get:function(){var e;return!0===(null==(e=this.layer)?void 0:e.visible)},set:function(e){void 0!==e?this._override("visible",e):this._clearOverride("visible")}},{key:"canResume",value:function(){return!this.get("parent.suspended")&&this.get("view.ready")&&this.get("layer.loaded")&&this.visible||!1}},{key:"getSuspendInfo",value:function(){var e=this.parent&&this.parent.suspended?this.parent.suspendInfo:{};return this.view&&this.view.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}},{key:"isUpdating",value:function(){return!1}}]),n}(Object(c.b)(Object(h.a)(Object(d.b)(u.a.EventedMixin(l.a)))));Object(s.a)([Object(p.b)()],_.prototype,"fullOpacity",null),Object(s.a)([Object(p.b)()],_.prototype,"layer",void 0),Object(s.a)([Object(p.b)()],_.prototype,"parent",void 0),Object(s.a)([Object(p.b)({readOnly:!0})],_.prototype,"suspended",null),Object(s.a)([Object(p.b)({readOnly:!0})],_.prototype,"suspendInfo",null),Object(s.a)([Object(p.b)({readOnly:!0})],_.prototype,"legendEnabled",null),Object(s.a)([Object(p.b)({type:Boolean,readOnly:!0})],_.prototype,"updating",null),Object(s.a)([Object(p.b)({readOnly:!0})],_.prototype,"updatingProgress",null),Object(s.a)([Object(p.b)()],_.prototype,"visible",null);var m=_=Object(s.a)([Object(y.a)("esri.views.layers.LayerView")],_)},579:function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var i,r=n(3),a=n(2),o=n(43),s=n(39),l=n(4),u=n(5),c=n(0),h=n(34),f=n(123),v=n(28),d=n(1),p=(n(15),n(12),n(10),n(6)),y=n(573),_=n(16),m=(n(21),n(139),function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n)}(_.a)),g=m=Object(c.a)([Object(p.a)("esri.views.layers.support.ClipArea")],m),b=i=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments)).type="rect",e.left=null,e.right=null,e.top=null,e.bottom=null,e}return Object(a.a)(n,[{key:"clone",value:function(){return new i({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}},{key:"version",get:function(){return(this._get("version")||0)+1}}]),n}(g);Object(c.a)([Object(d.b)({type:[Number,String],json:{write:!0}})],b.prototype,"left",void 0),Object(c.a)([Object(d.b)({type:[Number,String],json:{write:!0}})],b.prototype,"right",void 0),Object(c.a)([Object(d.b)({type:[Number,String],json:{write:!0}})],b.prototype,"top",void 0),Object(c.a)([Object(d.b)({type:[Number,String],json:{write:!0}})],b.prototype,"bottom",void 0),Object(c.a)([Object(d.b)({readOnly:!0})],b.prototype,"version",null);var x,O=b=i=Object(c.a)([Object(p.a)("esri.views.layers.support.ClipRect")],b),w=(n(58),n(79)),k=n(51),S=n(40),j=n(78),P={base:w.a,key:"type",typeMap:{extent:S.a,polygon:j.a}},T=x=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments)).type="geometry",e.geometry=null,e}return Object(a.a)(n,[{key:"version",get:function(){return(this._get("version")||0)+1}},{key:"clone",value:function(){return new x({geometry:this.geometry.clone()})}}]),n}(g);Object(c.a)([Object(d.b)({types:P,json:{read:k.a,write:!0}})],T.prototype,"geometry",void 0),Object(c.a)([Object(d.b)({readOnly:!0})],T.prototype,"version",null);var C=T=x=Object(c.a)([Object(p.a)("esri.views.layers.support.Geometry")],T),M=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments)).type="path",e.path=[],e}return Object(a.a)(n,[{key:"version",get:function(){return(this._get("version")||0)+1}}]),n}(g);Object(c.a)([Object(d.b)({type:[[[Number]]],json:{write:!0}})],M.prototype,"path",void 0),Object(c.a)([Object(d.b)({readOnly:!0}
1)],M.prototype,"version",null);var I=M=Object(c.a)([Object(p.a)("esri.views.layers.support.Path")],M),L=h.a.ofType({key:"type",base:g,typeMap:{rect:O,path:I,geometry:C}}),A=function(e){var t=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){var e;return Object(r.a)(this,n),(e=t.apply(this,arguments)).clips=new L,e.moving=!1,e.attached=!1,e.lastUpdateId=-1,e.updateRequested=!1,e}return Object(a.a)(n,[{key:"initialize",value:function(){var e,t=this;this.container||(this.container=new y.a),this.container.fadeTransitionEnabled=!0,this.container.opacity=0,this.container.clips=this.clips,this.handles.add([Object(v.a)(this,"suspended",(function(e){t.container&&(t.container.visible=!e),t.view&&!e&&t.updateRequested&&t.view.requestUpdate()}),!0),Object(v.a)(this,["layer.opacity","container"],(function(){var e,n;t.container&&(t.container.opacity=null!=(e=null==(n=t.layer)?void 0:n.opacity)?e:1)}),!0),Object(v.a)(this,["layer.blendMode"],(function(e){t.container&&(t.container.blendMode=e)}),!0),Object(v.a)(this,["layer.effect"],(function(e){t.container&&(t.container.effect=e)}),!0),this.clips.on("change",(function(){t.container.clips=t.clips,t.notifyChange("clips")}))]),null!=(e=this.view)&&e.whenLayerView?this.view.whenLayerView(this.layer).then((function(e){e!==t||t.attached||t.destroyed||(t.attach(),t.requestUpdate(),t.attached=!0)}),(function(){})):this.when().then((function(){t.attached||t.destroyed||(t.attach(),t.requestUpdate(),t.attached=!0)}),(function(){}))}},{key:"destroy",value:function(){this.attached&&(this.detach(),this.attached=!1),this.handles.remove("initialize"),this.updateRequested=!1}},{key:"updating",get:function(){return!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!(!this.updatingHandles||!this.updatingHandles.updating)}},{key:"isVisibleAtScale",value:function(e){var t=!0,n=this.layer,i=n.minScale,r=n.maxScale;if(null!=i&&null!=r){var a=!i,o=!r;!a&&e<=i&&(a=!0),!o&&e>=r&&(o=!0),t=a&&o}return t}},{key:"requestUpdate",value:function(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}},{key:"processUpdate",value:function(e){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",e),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(e))):this.updateRequested=!1}},{key:"hitTest",value:function(e,t){return Promise.resolve(null)}},{key:"isUpdating",value:function(){return!1}},{key:"isRendering",value:function(){return!1}},{key:"canResume",value:function(){return!!Object(o.a)(Object(s.a)(n.prototype),"canResume",this).call(this)&&this.isVisibleAtScale(this.view.scale)}}]),n}(e);return Object(c.a)([Object(d.b)({type:L,set:function(e){var t=Object(f.b)(e,this._get("clips"),L);this._set("clips",t)}})],t.prototype,"clips",void 0),Object(c.a)([Object(d.b)()],t.prototype,"moving",void 0),Object(c.a)([Object(d.b)()],t.prototype,"attached",void 0),Object(c.a)([Object(d.b)()],t.prototype,"container",void 0),Object(c.a)([Object(d.b)()],t.prototype,"suspended",void 0),Object(c.a)([Object(d.b)({readOnly:!0})],t.prototype,"updateParameters",void 0),Object(c.a)([Object(d.b)()],t.prototype,"updateRequested",void 0),Object(c.a)([Object(d.b)()],t.prototype,"updating",null),Object(c.a)([Object(d.b)()],t.prototype,"view",void 0),t=Object(c.a)([Object(p.a)("esri.views.2d.layers.LayerView2D")],t)}},581:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n(3),r=n(2),a=n(4),o=n(5),s=n(7),l=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(r.a)(n,[{key:"dispose",value:function(){}},{key:"prepareState",value:function(e){var t=e.context;t.setColorMask(!0,!0,!0,!0),t.setStencilFunction(514,0,255)}},{key:"draw",value:function(e,t){var n=e.context,i=t.displayData;if(!Object(s.j)(i)&&("loaded"===i.state.name&&i.prepareForRendering(n,u,c),"attached"===i.state.name)){var r=i.state.resources,a=e.painter.materialManager.getProgram(e,{vsPath:"raster/flow",fsPath:"raster/flow",attributes:u});n.setFaceCullingEnabled(!1),n.setBlendingEnabled(!0),n.setBlendFunctionSeparate(1,771,1,1),n.useProgram(a),a.setUniform1f("u_time",e.time/1e3),a.setUniform1f("u_fadeDuration",i.flowStyle.render
1Settings.fadeDuration),a.setUniform1f("u_lineSpeed",i.flowStyle.renderSettings.lineSpeed),a.setUniformMatrix3fv("u_dvsMat3",t.transforms.dvs),a.setUniformMatrix3fv("u_displayViewMat3",e.state.displayViewMat3),a.setUniform4f("u_lineColor",i.flowStyle.renderSettings.lineColor[0]*e.globalOpacity,i.flowStyle.renderSettings.lineColor[1]*e.globalOpacity,i.flowStyle.renderSettings.lineColor[2]*e.globalOpacity,i.flowStyle.renderSettings.lineColor[3]*e.globalOpacity),a.setUniform1f("u_lineHalfWidth",i.flowStyle.renderSettings.lineRenderWidth/2),n.bindVAO(r.vertexArray),n.drawElements(4,r.indexBuffer.size,5125,0),i.flowStyle.animated&&t.requestRender()}}}]),n}(n(535).a),u=new Map;u.set("a_positionAndSide",0),u.set("a_timeInfo",1),u.set("a_extrude",2);var c={geometry:[{name:"a_positionAndSide",count:3,type:5126,offset:0,stride:32,normalized:!1},{name:"a_timeInfo",count:3,type:5126,offset:12,stride:32,normalized:!1},{name:"a_extrude",count:2,type:5126,offset:24,stride:32,normalized:!1}]}},584:function(e,t,n){"use strict";n.d(t,"a",(function(){return _})),n.d(t,"b",(function(){return m}));var i=n(36),r=n(23),a=n(3),o=n(2),s=n(4),l=n(5),u=n(7),c=n(235),h=n(303),f=n(374),v=n(589),d=n(549),p=n(559),y={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"},_=function(e){Object(s.a)(n,e);var t=Object(l.a)(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object(a.a)(this,n),(e=t.call(this))._textureInvalidated=!0,e._colormapTextureInvalidated=!0,e._supportsBilinearTexture=!0,e.stencilRef=0,e.coordScale=[1,1],e._symbolizerParameters=null,e.height=null,e.isRendereredSource=!1,e.pixelRatio=1,e.resolution=0,e.rotation=0,e._source=null,e.rawPixelData=null,e._suspended=!1,e._bandIds=null,e._interpolation=null,e._transformGrid=null,e.width=null,e.x=0,e.y=0,e.source=i,e.transformGrid=r,e.interpolation=o,e}return Object(o.a)(n,[{key:"destroy",value:function(){var e=this.getTextures();null==e||e.textures.forEach((function(e){return e.dispose()})),this._rasterTexture=null,this._transformGridTexture=null,this._colormapTexture=null}},{key:"symbolizerParameters",get:function(){return this._symbolizerParameters||y},set:function(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0)}},{key:"source",get:function(){return this._source},set:function(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.invalidateTexture())}},{key:"suspended",get:function(){return this._suspended},set:function(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}},{key:"bandIds",get:function(){return this._bandIds},set:function(e){this._bandIds=e,this._isBandIdschanged(e)&&this.invalidateTexture()}},{key:"interpolation",get:function(){return this._interpolation||"nearest"},set:function(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(e)?9729:9728)}},{key:"transformGrid",get:function(){return this._transformGrid},set:function(e){this._transformGrid=e,this._transformGridTexture&&(this._transformGridTexture.dispose(),this._transformGridTexture=null)}},{key:"invalidateTexture",value:function(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}},{key:"_createTransforms",value:function(){return{dvs:Object(h.b)()}}},{key:"setTransform",value:function(e){var t=Object(c.b)(this.transforms.dvs),n=e.toScreenNoRotation([0,0],[this.x,this.y]),i=Object(r.a)(n,2),a=i[0],o=i[1],s=this.resolution/this.pixelRatio/e.resolution,l=s*this.width,u=s*this.height,h=Math.PI*this.rotation/180;Object(c.c)(t,t,Object(f.b)(a,o)),Object(c.c)(t,t,Object(f.b)(l/2,u/2)),Object(c.j)(t,t,-h),Object(c.c)(t,t,Object(f.b)(-l/2,-u/2)),Object(c.g)(t,t,Object(f.b)(l,u)),Object(c.h)(this.transforms.dvs,e.displayViewMat3,t)}},{key:"getTextures",value:function(){if(!this._rasterTexture)return null;var e=[],t=[];return this._transformGridTexture&&(t.push(this._transformGridTexture),e.push("u_transformGrid")),this._rasterTexture&&(t.push(this._rasterTexture),e.push("u_image")),this._colormapTexture&&(t.push(this._colormapTexture),e.push("u_colormap")),{names:e,textures:t}}},{key:"onAttach",value:function(){this.invalidateTexture()}},{key:"onDetach",value:function(){this.invalidateTexture()}},{key:"updateTexture",value:function(e){var t,n,i,r=e.context;if(!this.stage)return null==(t=this._rasterTexture)||t.dispose(),null==(n=this._transformGridTexture)||n.dispose(),null==(i=this._colormapTexture)||i.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,void(this._colormapTexture=null);var a=this._isValidSource(this.source);a&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(r)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(r),this._rasterTexture&&(a?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=Object(p.c)(r,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}},{key:"_createOrDestroyRasterTexture",value:function(e){var t,n,r=Object(u.k)(this.source)?Object(v.h)(this.source,this.bandIds):null;if(this._isValidSource(r)){var a=!this._isBandIdschanged(this.bandIds);if(this._rasterTexture){if(a)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=null==(t=e.capabilities.textureFloat)?void 0:t.textureFloatLinear;var o=this._getTextureSamplingMethod(this.interpolation),s=this.isRendereredSource||!(null!=(n=e.capabilities.textureFloat)&&n.textureFloat);this._rasterTexture=Object(p.b)(e,r,o,s),this._rasterTextureBandIds=this.bandIds?Object(i.a)(this.bandIds):null}else this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null)}},{key:"_isBandIdschanged",value:function(e){var t=this._rasterTextureBandIds;return!(null==t&&null==e||t&&e&&t.join("")===e.join(""))}},{key:"_isValidSource",value:function(e){var t;return Object(u.k)(e)&&(null==(t=e.pixels)?void 0:t.length)>0}},{key:"_getTextureSamplingMethod",value:function(e){var t=this.symbolizerParameters,n=t.type,i=t.colormap,r
1="lut"===n||"stretch"===n&&Object(u.k)(i);return!this._supportsBilinearTexture||r||"bilinear"!==e&&"cubic"!==e?"nearest":"bilinear"}},{key:"_updateColormapTexture",value:function(e){var t=this._colormap,n=this.symbolizerParameters.colormap;return n?t?n.length!==t.length||n.some((function(e,n){return e!==t[n]}))?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=Object(p.a)(e,n),void(this._colormap=n)):void 0:(this._colormapTexture=Object(p.a)(e,n),void(this._colormap=n)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}}]),n}(d.a);function m(e){return Object(u.k)(e.source)}},585:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n(3),r=n(2),a=n(4),o=n(5),s=n(7),l=n(535),u=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),c={beaufort_ft:u,beaufort_m:u,beaufort_km:u,beaufort_mi:u,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),single_arrow:new Float32Array([0,92/255,230/255,1]),wind_speed:new Float32Array([0,0,0,1])},h=function(e){Object(a.a)(n,e);var t=Object(o.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.apply(this,arguments))._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}},e}return Object(r.a)(n,[{key:"dispose",value:function(){}},{key:"prepareState",value:function(e,t){var n=e.context;n.setBlendingEnabled(!0),n.setBlendFunctionSeparate(1,771,1,771),n.setColorMask(!0,!0,!0,!0),n.setStencilWriteMask(0),n.setStencilTestEnabled(!0),n.setStencilOp(7680,7680,7681),n.setStencilFunction(514,t.stencilRef,255)}},{key:"draw",value:function(e,t){if(!Object(s.j)(t.source)&&0!==t.source.validPixelCount){var n=e.timeline;if(n.begin(this.name),t.updateVectorFieldVAO(e),"scalar"===e.renderPass){var i=t.vaoData.scalar;i&&this._drawScalars(e,t,i.vao,i.elementCount)}
1else{var r=t.vaoData.magdir;r&&this._drawTriangles(e,t,r.vao,r.elementCount)}n.end(this.name)}}},{key:"_drawTriangles",value:function(e,t,n,i){var r=e.context,a=e.painter,o=t.symbolizerParameters,s=o.dataRange?["dataRange"]:[];"geographic"===o.rotationType&&s.push("rotationGeographic");var l=a.materialManager.getProgram(e,this._desc.magdir,s);r.useProgram(l);var u=t.coordScale,h=t.opacity,f=t.transforms;l.setUniform2fv("u_coordScale",u),l.setUniform1f("u_opacity",h),l.setUniformMatrix3fv("u_dvsMat3",f.dvs);var v=o.style,d=o.dataRange,p=o.rotation,y=o.symbolPercentRange;l.setUniform4fv("u_colors",c[v]||c.single_arrow),l.setUniform2fv("u_dataRange",d),l.setUniform1f("u_rotation",p),l.setUniform2fv("u_symbolPercentRange",y);var _=this._getSymbolSize(e,t);l.setUniform2fv("u_symbolSize",_),r.bindVAO(n),r.drawElements(4,i,5125,0)}},{key:"_drawScalars",value:function(e,t,n,i){var r=e.context,a=e.painter,o=t.symbolizerParameters,s=[];"wind_speed"===o.style?s.push("innerCircle"):o.dataRange&&s.push("dataRange"),"geographic"===o.rotationType&&s.push("rotationGeographic");var l=a.materialManager.getProgram(e,this._desc.scalar,s);r.useProgram(l);
1var u=t.coordScale,c=t.opacity,h=t.transforms;l.setUniform2fv("u_coordScale",u),l.setUniform1f("u_opacity",c),l.setUniformMatrix3fv("u_dvsMat3",h.dvs);var f=o.dataRange,v=o.symbolPercentRange;l.setUniform2fv("u_dataRange",f),l.setUniform2fv("u_symbolPercentRange",v);var d=this._getSymbolSize(e,t);l.setUniform2fv("u_symbolSize",d),r.bindVAO(n),r.drawElements(4,i,5125,0)}},{key:"_getSymbolSize",value:function(e,t){var n=Math.pow(2,e.displayLevel-t.key.level),i=t.symbolizerParameters.symbolTileSize;return[i/(Math.round((t.width-t.offset[0])/i)*i)/n,i/(Math.round((t.height-t.offset[1])/i)*i)/n]}}]),n}(l.a)},590:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}));var i=n(74);function r(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Object(i.d)(e,0,l),a=0;a<4;a++)t[n+a]=Math.floor(256*u(r*o[a]))}function a(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0,i=0;i<4;i++)n+=e[t+i]*s[i];return n}var o=[1,256,65536,16777216],s=[1/256,1/65536,1/16777216,1/4294967296],l=a(new Uint8ClampedArray([255,255,255,255]));function u(e){return e-Math.floor(e)}},594:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(3),r=n(2),a=(n(18),function(){function e(t){Object(i.a)(this,e),this._geometry=t}return Object(r.a)(e,[{key:"next",value:function(){var e=this._geometry;return this._geometry=null,e}}]),e}())},595:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n(23),r=n(3),a=n(2),o=n(4),s=n(5),l=n(235),u=n(549),c=n(162),h=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e,i,a,o,s){var l,u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:o,h=arguments.length>6&&void 0!==arguments[6]?arguments[6]:s;return Object(r.a)(this,n),(l=t.call(this)).triangleCountReportedInDebug=0,l.triangleCount=0,l.texture=null,l.key=new c.a(e),l.x=i,l.y=a,l.width=o,l.height=s,l.rangeX=u,l.rangeY=h,l}return Object(a.a)(n,[{key:"destroy",value:function(){this.texture&&(this.texture.dispose(),this.texture=null)}},{key:"setTransform",value:function(e,t){var n=t/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,a=e.toScreenNoRotation([0,0],[this.x,this.y]),o=Object(i.a)(a,2),s=o[0],u=o[1],c=this.width/this.rangeX*n,h=this.height/this.rangeY*n;Object(l.k)(r,c,0,0,0,h,0,s,u,1),Object(l.h)(this.transforms.dvs,e.displayViewMat3,r)}}]),n}(u.a)},597:function(e,t,n){"use strict";n.d(t,"a",(function(){return I})),n.d(t,"b",(function(){return C})),n.d(t,"c",(function(){return M})),n.d(t,"d",(function(){return P})),n.d(t,"e",(function(){return A})),n.d(t,"f",(function(){return z})),n.d(t,"g",(function(){return D}));var i=n(4),r=n(5),a=n(11),o=n(3),s=n(2),l=n(555),u=n(21),c=n(7),h=n(130),f=n(37),v=n(138),d=n(304),p=n(51),y=n(594),_=n(575),m=n(554),g=n(616),b=n(571),x=n(622),O=n(550),w=n(531),k=n(561),S=Math.PI/180,j=u.a.getLogger("esri.symbols.cim.CIMSymbolDrawHelper"),P=function(){function e(t){Object(o.a)(this,e),this._t=t}return Object(s.a)(e,[{key:"clone",value:function(){return new e(this._t.slice())}},{key:"transform",value:function(e){var t=this._t;return[t[0]*e[0]+t[1]*e[1]+t[2],t[3]*e[0]+t[4]*e[1]+t[5]]}},{key:"scale",value:function(e,t){var n=this._t;return n[0]*=e,n[1]*=e,n[2]*=e,n[3]*=t,n[4]*=t,n[5]*=t,this}},{key:"scaleRatio",value:function(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}},{key:"translate",value:function(e,t){var n=this._t;return n[2]+=e,n[5]+=t,this}},{key:"rotate",value:function(t){return e.multiply(this,e.createRotate(t),this)}},{key:"invert",value:function(){var t=this._t,n=t[0]*t[4]-t[1]*t[3];if(0===n)return new e([0,0,0,0,0,0]);n=1/n;var i=(t[1]*t[5]-t[2]*t[4])*n,r=(t[2]*t[3]-t[0]*t[5])*n;return new e([t[4]*n,-t[1]*n,i,-t[3]*n,t[0]*n,r])}}],[{key:"createIdentity",value:function(){return new e([1,0,0,0,1,0])}},{key:"createScale",value:function(t,n){return new e([t,0,0,0,n,0])}},{key:"createTranslate",value:function(t,n){return new e([0,0,t,0,0,n])}},{key:"createRotate",value:function(t){var n=Math.cos(t),i=Math.sin(t);return new e([n,-i,0,i,n,0])}},{key:"multiply",value:function(e,t,n){var i=e._t,r=t._t,a=i[0]*r[0]+i[3]*r[1],o=i[1]*r[0]+i[4]*r[1],s=i[2]*r[0]+i[5
1]*r[1]+r[2],l=i[0]*r[3]+i[3]*r[4],u=i[1]*r[3]+i[4]*r[4],c=i[2]*r[3]+i[5]*r[4]+r[5],h=n._t;return h[0]=a,h[1]=o,h[2]=s,h[3]=l,h[4]=u,h[5]=c,n}}]),e}(),T=function(){function e(t,n){Object(o.a)(this,e),this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._flippedYs=!1,this._placementPool=new h.a(m.a,null,null,100),this._earlyReturn=!1,this._mapRotation=0,this._resourceManager=t||new g.a,this._transfos.push(n||P.createIdentity()),this._sizeTransfos.push(n?n.scaleRatio():1)}return Object(s.a)(e,[{key:"setTransform",value:function(e,t){this._transfos=[e||P.createIdentity()],this._sizeTransfos=[t||(e?e.scaleRatio():1)]}},{key:"setGeomUnitsPerPoint",value:function(e){this._geomUnitsPerPoint=e}},{key:"setFlippedYs",value:function(e){this._flippedYs=e}},{key:"transformPt",value:function(e){return this._transfos[this._transfos.length-1].transform(e)}},{key:"transformSize",value:function(e){return e*this._sizeTransfos[this._sizeTransfos.length-1]}},{key:"reverseTransformPt",value:function(e){return this._transfos[this._transfos.length-1].invert().transform(e)}},{key:"reverseTransformSize",value:function(e){return e/this._sizeTransfos[this._sizeTransfos.length-1]}},{key:"geomUnitsPerPoint",value:function(){return this.isEmbedded()?1:this._geomUnitsPerPoint}},{key:"flippedYs",value:function(){return!this.isEmbedded()&&this._flippedYs}},{key:"isEmbedded",value:function(){return this._transfos.length>1}},{key:"back",value:function(){return this._transfos[this._transfos.length-1]}},{key:"push",value:function(e,t){var n=t?e.scaleRatio():1;P.multiply(e,this.back(),e),this._transfos.push(e),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*n)}},{key:"pop",value:function(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}},{key:"drawSymbol",value:function(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(e,t);break;case"CIMTextSymbol":this.drawTextSymbol(e,t)}}},{key:"drawMultiLayerSymbol",value:function(e,t){if(e){var n=e.symbolLayers;if(n){var i=e.effects;if(i&&i.length>0){var r=this.executeEffects(i,t);if(r)for(var a=r.next();a;)this.drawSymbolLayers(n,a),a=r.next()}else this.drawSymbolLayers(n,t)}}}},{key:"executeEffects",value:function(e,t){var n,i=new y.a(t),r=Object(a.a)(e);try{for(r.s();!(n=r.n()).done;){var o=n.value,s=Object(_.a)(o);s&&(i=s.execute(i,o,this.geomUnitsPerPoint(),this.flippedYs()))}}catch(l){r.e(l)}finally{r.f()}return i}},{key:"drawSymbolLayers",value:function(e,t){for(var n=e.length;n--;){var i=e[n];if(i&&!1!==i.enable){var r=i.effects;if(r&&r.length>0){var a=this.executeEffects(r,t);if(a)for(var o=null;(o=a.next())&&(this.drawSymbolLayer(i,o),!this._earlyReturn););}else this.drawSymbolLayer(i,t);if(this._earlyReturn)return}}}},{key:"drawSymbolLayer",value:function(e,t){switch(e.type){case"CIMSolidFill":this.drawSolidFill(t,e.color);break;case"CIMHatchFill":this.drawHatchFill(t,e);break;case"CIMPictureFill":this.drawPictureFill(t,e);break;case"CIMGradientFill":this.drawGradientFill(t,e);break;case"CIMSolidStroke":this.drawSolidStroke(t,e.color,e.width,e.capStyle,e.joinStyle,e.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(t,e);break;case"CIMGradientStroke":this.drawGradientStroke(t,e);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(e,t)}}},{key:"drawHatchFill",value:function(e,t){var n=this._buildHatchPolyline(t,e,this.geomUnitsPerPoint());n&&(this.pushClipPath(e),this.drawMultiLayerSymbol(t.lineSymbol,n),this.popClipPath())}},{key:"drawPictureFill",value:function(e,t){}},{key:"drawGradientFill",value:function(e,t){}},{key:"drawPictureStroke",value:function(e,t){}},{key:"drawGradientStroke",value:function(e,t){}},{key:"drawMarkerLayer",value:function(e,t){var n=e.markerPlacement;if(n){var i=Object(_.b)(n);if(i){var r="CIMMarkerPlacementInsidePolygon"===n.type;r&&this.pushClipPath(t);var o=i.execute(t,n,this.geomUnitsPerPoint());if(o)for(var s=null;(s=o.next())&&(this.drawMarker(e,s),!this._earlyReturn););r&&this.popClipPath()}}else{var l=this._placementPool.acquire();if(Object(p.f)(t))l.tx=t.x,l.ty=t.y,this.drawMarker(e,l);else{var u,c=Object(a.a)(t.points);try{for(c.s();!(u=c.n()).done;){var h=u.value;if(l.tx=h[0],l.ty=h[1],this.drawMarker(e,l),this._earlyReturn)break}}catch(f){c.e(f)}finally{c.f()}}this._placementPool.release(l)}}},{key:"drawMarker",value:function(e,t){switch(e.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(e,t);break;case"CIMVectorMarker":this.drawVectorMarker(e,t)}}},{key:"drawPictureMarker",value:function(e,t){var n,i,r,a,o;if(e){var s=this._resourceManager.getResource(e.url),l=null!=(n=e.size)?n:10;if(!(Object(c.j)(s)||l<=0)){var u=s.width,h=s.height;if(u&&h){var f=u/h,v=null!=(i=e.scaleX)?i:1,d=P.createIdentity(),p=e.anchorPoint;if(p){var y=p.x,_=p.y;"Absolute"!==e.anchorPointUnits&&(y*=l*f*v,_*=l),d.translate(-y,-_)}var m=null!=(r=e.rotation)?r:0;e.rotateClockwise&&(m=-m),this._mapRotation&&(m+=this._mapRotation),m&&d.rotate(m*S);var g=null!=(a=e.offsetX)?a:0,b=null!=(o=e.offsetY)?o:0;if(g||b){if(this._mapRotation){var x=S*this._mapRotation,O=Math.cos(x),w=Math.sin(x),k=g*w+b*O;g=g*O-b*w,b=k}d.translate(g,b)}var j=this.geomUnitsPerPoint();1!==j&&d.scale(j,j);var T=t.getAngle();T&&d.rotate(T),d.translate(t.tx,t.ty),this.push(d,!1),this.drawImage(e.url,l,e.scaleX),this.pop()}}}}},{key:"drawVectorMarker",value:function(e,t){var n,i,r,o;
1if(e){var s=e.markerGraphics;if(s){var l=null!=(n=e.size)?n:10,u=e.frame,c=u?u.ymax-u.ymin:0,h=l&&c?l/c:1,f=P.createIdentity();u&&f.translate(.5*-(u.xmax+u.xmin),.5*-(u.ymax+u.ymin));var v=e.anchorPoint;if(v){var d=v.x,p=v.y;"Absolute"!==e.anchorPointUnits?u&&(d*=u.xmax-u.xmin,p*=u.ymax-u.ymin):(d/=h,p/=h),f.translate(-d,-p)}1!==h&&f.scale(h,h);var y=null!=(i=e.rotation)?i:0;e.rotateClockwise&&(y=-y),this._mapRotation&&(y+=this._mapRotation),y&&f.rotate(y*S);var _=null!=(r=e.offsetX)?r:0,m=null!=(o=e.offsetY)?o:0;if(_||m){if(this._mapRotation){var g=S*this._mapRotation,b=Math.cos(g),x=Math.sin(g),O=_*x+m*b;_=_*b-m*x,m=O}f.translate(_,m)}var w=this.geomUnitsPerPoint();1!==w&&f.scale(w,w);var k=t.getAngle();k&&f.rotate(k),f.translate(t.tx,t.ty),this.push(f,e.scaleSymbolsProportionally);var T,C=Object(a.a)(s);try{for(C.s();!(T=C.n()).done;){var M=T.value;if(M&&M.symbol&&M.geometry||j.error("Invalid marker graphic",M),this.drawSymbol(M.symbol,M.geometry),this._earlyReturn)break}}catch(I){C.e(I)}finally{C.f()}this.pop()}}}},{key:"drawTextSymbol",value:function(e,t){var n,i,r,a;if(e&&Object(p.f)(t)&&!((null!=(n=e.height)?n:10)<=0)){var o=P.createIdentity(),s=null!=(i=e.angle)?i:0;(s=-s)&&o.rotate(s*S);var l=null!=(r=e.offsetX)?r:0,u=null!=(a=e.offsetY)?a:0;(l||u)&&o.translate(l,u);var c=this.geomUnitsPerPoint();1!==c&&o.scale(c,c),o.translate(t.x,t.y),this.push(o,!1),this.drawText(e),this.pop()}}},{key:"_buildHatchPolyline",value:function(e,t,n){var i=(void 0!==e.separation?e.separation:4)*n,r=void 0!==e.rotation?e.rotation:0;if(0===i)return null;i<0&&(i=-i);for(var a=0,o=.5*i;a>o;)a-=i;for(;a<-o;)a+=i;var s=Object(v.g)();Object(d.a)(s,t),s[0]-=o,s[1]-=o,s[2]+=o,s[3]+=o;for(var l=[[s[0],s[1]],[s[0],s[3]],[s[2],s[3]],[s[2],s[1]]];r>180;)r-=180;for(;r<0;)r+=180;var u,c,h,f,p=Math.cos(r*S),y=Math.sin(r*S),_=-i*y,m=i*p;a=(void 0!==e.offsetX?e.offsetX*n:0)*y-(void 0!==e.offsetY?e.offsetY*n:0)*p,u=h=Number.MAX_VALUE,c=f=-Number.MAX_VALUE;for(var g=0,b=l;g<b.length;g++){var x=b[g],O=x[0],w=x[1],k=p*O+y*w,j=-y*O+p*w;u=Math.min(u,k),h=Math.min(h,j),c=Math.max(c,k),f=Math.max(f,j)}for(var P=p*u-y*(h=Math.floor(h/i)*i)-_*a/i,T=y*u+p*h-m*a/i,C=p*c-y*h-_*a/i,M=y*c+p*h-m*a/i,I=1+Math.round((f-h)/i),L=[],A=0;A<I;A++)P+=_,T+=m,C+=_,M+=m,L.push([[P,T],[C,M]]);return{paths:L}}}]),e}(),C=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e,i){var r;return Object(o.a)(this,n),(r=t.call(this,e,i)).reset(),r}return Object(s.a)(n,[{key:"reset",value:function(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}},{key:"envelope",value:function(){return new b.a(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}},{key:"bounds",value:function(){return Object(v.m)(this._xmin,this._ymin,this._xmax,this._ymax)}},{key:"drawSolidFill",value:function(e){if(e&&!(this._clipCount>0))if(Object(p.g)(e))this._processPath(e.rings,0);else if(Object(p.h)(e))this._processPath(e.paths,0);else if(Object(p.d)(e)){var t=L(e);t&&this._processPath(t.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}},{key:"drawSolidStroke",value:function(e,t,n){if(e&&!(this._clipCount>0)){var i=.5*this.transformSize(n);if(Object(p.g)(e))this._processPath(e.rings,i);else if(Object(p.h)(e))this._processPath(e.paths,i);else if(Object(p.d)(e)){var r=L(e);r&&this._processPath(r.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}}},{key:"pushClipPath",value:function(e){this.drawSolidFill(e),++this._clipCount}},{key:"popClipPath",value:function(){--this._clipCount}},{key:"drawImage",value:function(e,t,n){var i=n*t,r=t,a=this._resourceManager.getResource(e);!t&&Object(c.k)(a)&&(i=n*a.width,r=a.height),this._merge(this.transformPt([-i/2,-r/2]),0),this._merge(this.transformPt([-i/2,r/2]),0),this._merge(this.transformPt([i/2,-r/2]),0),this._merge(this.transformPt([i/2,r/2]),0)}},{key:"drawText",value:function(e){this._textRasterizer||(this._textRasterizer=new x.a)}},{key:"_processPath",value:function(e,t){if(e){var n,i=Object(a.a)(e);try{for(i.s();!(n=i.n()).done;){var r=n.value,o=r?r.length:0;if(o>1){this._merge(this.transformPt(r[0]),t);for(var s=1;s<o;++s)this._merge(this.transformPt(r[s]),t)}}}catch(l){i.e(l)}finally{i.f()}}}},{key:"_merge",value:function(e,t){e[0]-t<this._xmin&&(this._xmin=e[0]-t),e[0]+t>this._xmax&&(this._xmax=e[0]+t),e[1]-t<this._ymin&&(this._ymin=e[1]-t),e[1]+t>this._ymax&&(this._ymax=e[1]+t)}}]),n}(T),M=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){var e;return Object(o.a)(this,n),(e=t.apply(this,arguments))._searchPoint=[0,0],e._searchDistPoint=0,e}return Object(s.a)(n,[{key:"hitTest",value:function(e,t,n,i,r,a){var o=a*Object(f.c)(1);this.setTransform(),this.setGeomUnitsPerPoint(o),this._searchPoint=[(e[0]+e[2])/2,(e[1]+e[3])/2],this._searchDistPoint=(e[2]-e[0])/2/o,this._textInfo=i;var s=t&&("CIMPointSymbol"===t.type&&"Map"!==t.angleAlignment||"CIMTextSymbol"===t.type);return this._mapRotation=s?r:0,this._earlyReturn=!1,this.drawSymbol(t,n),this._earlyReturn}},{key:"drawSolidFill",value:function(e,t){this._hitTestFill(e)}},{key:"drawHatchFill",value:function(e,t){this._hitTestFill(e)}},{key:"drawPictureFill",value:function(e,t){this._hitTestFill(e)}},{key:"drawGradientFill",value:function(e,t){this._hitTestFill(e)}},{key:"drawSolidStroke",value:function(e,t,n,i,r,a){this._hitTestStroke(e,n)}},{key:"drawPictureStroke",value:function(e,t){this._hitTestStroke(e,t.width)}},{key:"drawGradientStroke",value:function(e,t){this._hitTestStroke(e,t.width)}},{key:"pushClipPath",value:function(e){}},{key:"popClipPath",value:function(){}},{key:"drawImage",value:function(e,t,n){var i=this._resourceManager.getResource(e);if(!Object(c.j)(i)&&0!==i.height&&0!==t){var r=t*this.geomUnitsPerPoint(),a=r*n*(i.width/i.height),o=this.reverseTransformPt(this._searchPoint),s=this._searchDistPoint;Math.abs(o[0])<a/2+s&&Math.abs(o[1])<r/2+s&&(this._earlyReturn=!0)}}},{key:"drawText",value:function(e){var t,n,i=this._textInfo;if(i){var r=i.get(e);if(r){var o=r.text,s=r.mosaicItem;if(s&&0!==s.glyphMosaicItems.length){var u,c=null!=(t=e.height)?t:10,h=z(e.lineGapType,null!=(n=e.lineGap)?n:0,c),f=Object(l.a)(o)[1],v=s.glyphMosaicItems,d=Object(k.a)(v,f,{scale:c/w.o,angle:0,xOffset:0,yOffset:0,hAlign:A(e.horizontalAlignment),vAlign:D(e.verticalAlignment),maxLineWidth:512,lineHeight:w.r*Math.max(.25,Math.min(h||1,4)),decoration:e.font.decoration||"none",isCIM:!0}),p=this.reverseTransformPt(this._searchPoint),y=p[0],_=p[1],m=Object(a.a)(d.glyphs);try{for(m.s();!(u=m.n()).done;){var g=u.value;if(y>g.xTopLeft&&y<g.xBottomRight&&_>-g.yBottomRight&&_<-g.yTopLeft){this._earlyReturn=!0;break}}}
1catch(b){m.e(b)}finally{m.f()}}}}}},{key:"_hitTestFill",value:function(e){var t=null;if(Object(p.d)(e)){var n=e;t=[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]}else if(Object(p.g)(e))t=e.rings;else{if(!Object(p.h)(e))return;t=e.paths}var i=this.reverseTransformPt(this._searchPoint);this._pointInPolygon(i,t)&&(this._earlyReturn=!0);var r=this.reverseTransformSize(this._searchDistPoint)*this.geomUnitsPerPoint();this._nearLine(i,t,r)&&(this._earlyReturn=!0)}},{key:"_hitTestStroke",value:function(e,t){var n=null;if(Object(p.d)(e)){var i=e;n=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(Object(p.g)(e))n=e.rings;else{if(!Object(p.h)(e))return;n=e.paths}var r=this.reverseTransformPt(this._searchPoint),a=t*this.geomUnitsPerPoint(),o=this.reverseTransformSize(this._searchDistPoint)*this.geomUnitsPerPoint();this._nearLine(r,n,a/2+o)&&(this._earlyReturn=!0)}},{key:"_pointInPolygon",value:function(e,t){var n,i=0,r=Object(a.a)(t);try{for(r.s();!(n=r.n()).done;)for(var o=n.value,s=o.length,l=1;l<s;++l){var u=o[l-1],c=o[l];u[1]>e[1]!=c[1]>e[1]&&((c[0]-u[0])*(e[1]-u[1])-(c[1]-u[1])*(e[0]-u[0])>0?i++:i--)}}catch(h){r.e(h)}finally{r.f()}return 0!==i}},{key:"_nearLine",value:function(e,t,n){var i,r=Object(a.a)(t);try{for(r.s();!(i=r.n()).done;)for(var o=i.value,s=o.length,l=1;l<s;++l){var u=o[l-1],c=o[l],h=(c[0]-u[0])*(c[0]-u[0])+(c[1]-u[1])*(c[1]-u[1]);if(0!==h){h=Math.sqrt(h);var f=((c[0]-u[0])*(e[1]-u[1])-(c[1]-u[1])*(e[0]-u[0]))/h;if(Math.abs(f)<n){var v=((c[0]-u[0])*(e[0]-u[0])+(c[1]-u[1])*(e[1]-u[1]))/h;if(v>-n&&v<h+n)return!0}}}}catch(d){r.e(d)}finally{r.f()}return!1}}]),n}(T),I=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e,i,r){var a;return Object(o.a)(this,n),(a=t.call(this,i,r))._ctx=e,a}return Object(s.a)(n,[{key:"drawSolidFill",value:function(e,t){if(e){if(Object(p.g)(e))this._buildPath(e.rings,!0);else if(Object(p.h)(e))this._buildPath(e.paths,!0);else if(Object(p.d)(e))this._buildPath(L(e).rings,!0);else{if(!Object(p.e)(e))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}var n=this._ctx;n.fillStyle="string"==typeof t?t:"rgba("+Math.round(t[0])+","+Math.round(t[1])+","+Math.round(t[2])+","+t[3]/255+")",n.fill("evenodd")}}},{key:"drawSolidStroke",value:function(e,t,n,i,r,a){if(e&&t&&0!==n){if(Object(p.g)(e))this._buildPath(e.rings,!0);else if(Object(p.h)(e))this._buildPath(e.paths,!1);else{if(!Object(p.d)(e))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(L(e).rings,!0)}var o=this._ctx;o.strokeStyle="string"==typeof t?t:"rgba("+Math.round(t[0])+","+Math.round(t[1])+","+Math.round(t[2])+","+t[3]/255+")",o.lineWidth=this.transformSize(n)+.5,this._setCapStyle(i),this._setJoinStyle(r),o.miterLimit=a,o.stroke()}}},{key:"pushClipPath",value:function(e){if(this._ctx.save(),Object(p.g)(e))this._buildPath(e.rings,!0);else if(Object(p.h)(e))this._buildPath(e.paths,!0);else{if(!Object(p.d)(e))return;this._buildPath(L(e).rings,!0)}this._ctx.clip("evenodd")}},{key:"popClipPath",value:function(){this._ctx.restore()}},{key:"drawImage",value:function(e,t,n){var i=this._resourceManager.getResource(e);if(!Object(c.j)(i)){var r=this._ctx,a=r.canvas.width,o=r.canvas.height,s=t*n*(i.width/i.height),l=n*t;t||(s=n*i.width,l=n*i.height),this._ctx.drawImage(i,0,0,i.width,i.height,0,0,Math.min(this.transformSize(s),a),Math.min(this.transformSize(l),o))}}},{key:"drawText",value:function(e){this._textRasterizer||(this._textRasterizer=new x.a)}},{key:"_buildPath",value:function(e,t){var n=this._ctx;if(n.beginPath(),e){var i,r=Object(a.a)(e);try{for(r.s();!(i=r.n()).done;){var o=i.value,s=o?o.length:0;if(s>1){var l=this.transformPt(o[0]);n.moveTo(l[0],l[1]);for(var u=1;u<s;++u)l=this.transformPt(o[u]),n.lineTo(l[0],l[1]);t&&n.closePath()}}}catch(c){r.e(c)}finally{r.f()}}}},{key:"_setCapStyle",value:function(e){switch(e){case"Butt":this._ctx.lineCap="butt";break;case"Round":this._ctx.lineCap="round";break;case"Square":this._ctx.lineCap="square"}}},{key:"_setJoinStyle",value:function(e){switch(e){case"Bevel":this._ctx.lineJoin="bevel";break;case"Round":this._ctx.lineJoin="round";break;case"Miter":this._ctx.lineJoin="miter"}}}]),n}(T),L=function(e){return e?{spatialReference:e.spatialReference,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:null},A=function(e){switch(e){case"Left":return O.a.Left;case"Right":return O.a.Right;case"Center":case"Justify":return O.a.Center}},D=function(e){switch(e){case"Top":return O.b.Top;case"Center":return O.b.Center;case"Bottom":return O.b.Bottom;case"Baseline":return O.b.Baseline}},z=function(e,t,n){switch(e){case"ExtraLeading":return 1+t/n;case"Multiple":return t;case"Exact":return t/n}}},598:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(3),r=n(2),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Object(i.a)(this,e),this.x=t,this.y=n,this.width=r,this.height=a}return Object(r.a)(e,[{key:"isEmpty",get:function(){return this.width<=0||this.height<=0}},{key:"union",value:function(e){this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.width=Math.max(this.width,e.width),this.height=Math.max(this.height,e.height)}}]),e}()},599:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return r})),n.d(t,"e",(function(){return f})),n.d(t,"f",(function(){return h})),n.d(t,"g",(function(){return u})),n.d(t,"h",(function(){return c}));var i=Number.POSITIVE_INFINITY,r=Math.PI,a=2*r,o=128/r,s=r/180,l=1/Math.LN2;function u(e,t){return(e%=t)>=0?e:e+t}function c(e){return u(e*o,256)}function h(e){return Math.log(e)*l}function f(e,t,n){return e*(1-n)+t*n}},603:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}
1));var i=n(11),r=n(3),a=n(2),o=n(43),s=n(39),l=n(4),u=n(5),c=n(12),h=n(532),f=n(576),v=n(567),d=n(565),p=function(e,t){return e.key.level-t.key.level!=0?e.key.level-t.key.level:e.key.row-t.key.row!=0?e.key.row-t.key.row:e.key.col-t.key.col},y=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(e){var i;return Object(r.a)(this,n),(i=t.call(this))._tileInfoView=e,i}return Object(a.a)(n,[{key:"requiresDedicatedFBO",get:function(){return!1}},{key:"renderChildren",value:function(e){this.sortChildren(p),this.setStencilReference(),Object(o.a)(Object(s.a)(n.prototype),"renderChildren",this).call(this,e)}},{key:"createRenderParams",value:function(e){var t=e.state,i=Object(o.a)(Object(s.a)(n.prototype),"createRenderParams",this).call(this,e);return i.requiredLevel=this._tileInfoView.getClosestInfoForScale(t.scale).level,i.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(t.scale),i}},{key:"prepareRenderPasses",value:function(e){var t=this,i=Object(o.a)(Object(s.a)(n.prototype),"prepareRenderPasses",this).call(this,e);return i.push(e.registerRenderPass({name:"stencil",brushes:[d.a],drawPhase:h.c.DEBUG|h.c.MAP|h.c.HIGHLIGHT,target:function(){return t.getStencilTarget()}})),Object(c.a)("esri-tiles-debug")&&i.push(e.registerRenderPass({name:"tileInfo",brushes:[v.a],drawPhase:h.c.DEBUG,target:function(){return t.children}})),i}},{key:"getStencilTarget",value:function(){return this.children}},{key:"updateTransforms",value:function(e){var t,n=Object(i.a)(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value,a=this._tileInfoView.getTileResolution(r.key);r.setTransform(e,a)}}catch(o){n.e(o)}finally{n.f()}}},{key:"setStencilReference",value:function(){var e,t=1,n=Object(i.a)(this.children);try{for(n.s();!(e=n.n()).done;){e.value.stencilRef=t++}}catch(r){n.e(r)}finally{n.f()}}}]),n}(f.a)},616:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n(9),r=n(13),a=n(3),o=n(2),s=n(8),l=n.n(s),u=n(49),c=n(14),h=n(22),f=function(){function e(){Object(a.a)(this,e),this._resourceMap=new Map,this._inFlightResourceMap=new Map}return Object(o.a)(e,[{key:"destroy",value:function(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}},{key:"getResource",value:function(e){var t;return null!=(t=this._resourceMap.get(e))?t:null}},{key:"fetchResource",value:function(){var e=Object(r.a)(l.a.mark((function e(t,n){var i,r,a,o,s=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i={width:0,height:0},r=this._resourceMap,!(a=r.get(t))){e.next=3;break}return e.abrupt("return",(i.width=a.width,i.height=a.height,i));case 3:return o=this._inFlightResourceMap.get(t),e.abrupt("return",o||(o=v(t,n),this._inFlightResourceMap.set(t,o),o=o.then((function(e){if(s._inFlightResourceMap.delete(t),e.ok){r.set(t,e.value);var n=e.value;return i.width=n.width,i.height=n.height,i}return i})),o));case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"deleteResource",value:function(e){this._inFlightResourceMap.delete(e),this._resourceMap.delete(e)}}]),e}();function v(e,t){if(e.includes(";base64,")){var n=new Image;return n.src=e,n.decode().then((function(){return{ok:!0,value:n}})).catch((function(t){return Object(h.l)(t)?{ok:!1,error:t}:{ok:!1,error:new c.a("invalid-resource","Could not fetch requested resource at ".concat(e))}}))}return Object(u.default)(e,Object(i.a)({responseType:"image"},t)).then((function(e){return{ok:!0,value:e.data}})).catch((function(t){return Object(h.l)(t)?{ok:!1,error:t}:{ok:!1,error:new c.a("invalid-resource","Could not fetch requested resource at ".concat(e))}}))}},620:function(e,t,n){"use strict";n.d(t,"a",(function(){return T}));var i=n(3),r=n(2),a=[["(",")"],[")","("],["<",">"],[">","<"],["[","]"],["]","["],["{","}"],["}","{"],["\xab","\xbb"],["\xbb","\xab"],["\u2039","\u203a"],["\u203a","\u2039"],["\u207d","\u207e"],["\u207e","\u207d"],["\u208d","\u208e"],["\u208e","\u208d"],["\u2264","\u2265"],["\u2265","\u2264"],["\u2329","\u232a"],["\u232a","\u2329"],["\ufe59","\ufe5a"],["\ufe5a","\ufe59"],["\ufe5b","\ufe5c"],["\ufe5c","\ufe5b"],["\ufe5d","\ufe5e"],["\ufe5e","\ufe5d"],["\ufe64","\ufe65"],["\ufe65","\ufe64"]],o=["\u0622","\u0623","\u0625","\u0627"],s=["\ufef5","\ufef7","\ufef9","\ufefb"],l=["\ufef6","\ufef8","\ufefa","\ufefc"],u=["\u0627","\u0628","\u062a","\u062b","\u062c","\u062d","\u062e","\u062f","\u0630","\u0631","\u0632","\u0633","\u0634","\u0635","\u0636","\u0637","\u0638","\u0639","\u063a","\u0641","\u0642","\u0643","\u0644","\u0645","\u0646","\u0647","\u0648","\u064a","\u0625","\u0623","\u0622","\u0629","\u0649","\u0644","\u0645","\u0646","\u0647","\u0648","\u064a","\u0625","\u0623","\u0622","\u0629","\u0649","\u06cc","\u0626","\u0624"],c=["\ufe8d","\ufe8f","\ufe95","\ufe99","\ufe9d","\ufea1","\ufea5","\ufea9","\ufeab","\ufead","\ufeaf","\ufeb1","\ufeb5","\ufeb9","\ufebd","\ufec1","\ufec5","\ufec9","\ufecd","\ufed1","\ufed5","\ufed9","\ufedd","\ufee1","\ufee5","\ufee9","\ufeed","\ufef1","\ufe87","\ufe83","\ufe81","\ufe93","\ufeef","\ufbfc","\ufe89","\ufe85","\ufe70","\ufe72","\ufe74","\ufe76","\ufe78","\ufe7a","\ufe7c","\ufe7e","\ufe80","\ufe89","\ufe85"],h=["\ufe8e","\ufe90","\ufe96","\ufe9a","\ufe9e","\ufea2","\ufea6","\ufeaa","\ufeac","\ufeae","\ufeb0","\ufeb2","\ufeb6","\ufeba","\ufebe","\ufec2","\ufec6","\ufeca","\ufece","\ufed2","\ufed6","\ufeda","\ufede","\ufee2","\ufee6","\ufeea","\ufeee","\ufef2","\ufe88","\ufe84","\ufe82","\ufe94","\ufef0","\ufbfd","\ufe8a","\ufe86","\ufe70","\ufe72","\ufe74","\ufe76","\ufe78","\ufe7a","\ufe7c","\ufe7e","\ufe80","\ufe8a","\ufe86"],f=["\ufe8e","\ufe92","\ufe98","\ufe9c","\ufea0","\ufea4","\ufea8","\ufeaa","\ufeac","\ufeae","\ufeb0","\ufeb4","\ufeb8","\ufebc","\ufec0","\ufec4","\ufec8","\ufecc","\ufed0","\ufed4","\ufed8","\ufedc","\ufee0","\ufee4","\ufee8","\ufeec","\ufeee","\ufef4","\ufe88","\ufe84","\ufe82","\ufe94","\ufef0","\ufbff","\ufe8c","\ufe86","\ufe71","\ufe72","\ufe74","\ufe77","\ufe79","\ufe7b","\ufe7d","\ufe7f","\ufe80","\ufe8c","\ufe86"],v=["\ufe8d","\ufe91","\ufe97","\ufe9b","\ufe9f","\ufea3","\ufea7","\ufea9","\ufeab","\ufead","\ufeaf","\ufeb3","\ufeb7","\ufebb","\ufebf","\ufec3","\ufec7","\ufecb","\ufecf","\ufed3","\ufed7","\ufedb","\ufedf","\ufee3","\ufee7","\ufeeb","\ufeed","\ufef3","\ufe87","\ufe83","\ufe81","\ufe93","\ufeef","\ufbfe","\ufe8b","\ufe85","\ufe70","\ufe72","\ufe74","\ufe76","\ufe78","\ufe7a","\ufe7c","\ufe7e","\ufe80","\ufe8b","\ufe85"],d=["\u0621","\u0622","\u0623","\u0624","\u0625","\u0627","\u0629","\u062f","\u0630","\u0631","\u0632","\u0648","\u0649"],p=["\u064b","\u064b","\u064c","\u061f","\u064d","\u061f","\u064e","\u064e","\u064f","\u064f","\u0650","\u0650","\u0651","\u0651","\u0652","\u0652","\u0621","\u0622","\u0622","\u0623","\u0623","\u0624","\u0624","\u0625","\u0625","\u0626","\u0626","\u0626","\u0626","\u0627","\u0627","\u0628","\u0628","\u0628","\u0628","\u0629","\u0629","\u062a","\u062a","\u062a","\u062a","\u062b","\u062b","\u062b","\u062b","\u062c","\u062c","\u062c","\u062c","\u062d","\u062d","\u062d","\u062d","\u062e","\u062e","\u062e","\u062e","\u062f","\u062f","\u0630","\u0630","\u0631","\u0631","\u0632","\u0632","\u0633","\u0633","\u0633","\u0633","\u0634","\u0634","\u0634","\u0634","\u0635","\u0635","\u0635","\u0635","\u0636","\u0636","\u0636","\u0636","\u0637","\u0637","\u0637","\u0637","\u0638","\u0638","\u0638","\u0638","\u0639","\u0639","\u0639","\u0639","\u063a","\u063a","\u063a","\u063a","\u0641","\u0641","\u0641","\u0641","\u0642","\u0642","\u0642","\u0642","\u0643","\u0643","\u0643","\u0643","\u0644","\u0644","\u0644","\u0644","\u0645","\u0645","\u0645","\u0645","\u0646","\u0646","\u0646","\u0646","\u0647","\u0647","\u0647","\u0647","\u0648","\u0648","\u0649","\u0649","\u064a","\u064a","\u064a","\u064a","\ufef5","\ufef6","\ufef7","\ufef8","\ufef9","\ufefa","\ufefb","\ufefc","\u061f","\u061f","\u061f"],y=["\u0621","\u0641"],_=["\u063a","\u064a"],m=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],g=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],b=10,x=11,O=12,w=18,k=["UBAT_L","UBAT_R","UBAT_EN","UBAT_AN","UBAT_ON","UBAT_B","UBAT_S","UBAT_AL","UBAT_WS","UBAT_CS","UBAT_ES","UBAT_ET","UBAT_NSM","UBAT_LRE","UBAT_RLE","UBAT_PDF","UBAT_LRO","UBAT_RLO","UBAT_BN"],S=100,j=[100,0,0,0,0,101,102,103,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,4,4,4,0,4,0,4,0,4,4,4,0,0,4,4,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,4,4,0,0,4,4,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,105,7,7,106,107],P=[[w,w,w,w,w,w,w,w,w,6,5,6,8,5,w,w,w,w,w,w,w,w,w,w,w,w,w,w,5,5,5,6,8,4,4,x,x,x,4,4,4,4,4,b,9,b,9,9,2,2,2,2,2,2,2,2,2,2,9,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,w,w,w,w,w,w,5,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,9,4,x,x,x,x,4,4,4,4,0,4,4,w,4,4,x,x,2,2,4,0,4,4,4,2,0,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,4,4,4,4,4,4,4,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,1,O,1,O,O,1,O,O,1,O,4,4,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,4,4,4,4,1,1,1,1,1,4,4,4,4,4,4,4,4,4,4,4],[3,3,3,3,4,4,4,4,7,x,x,7,9,7,4,4,O,O,O,O,O,O,O,O,O,O,O,7,4,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,3,3,3,3,3,3,3,3,3,3,x,3,3,7,7,7,O,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,O,O,O,O,O,O,O,3,4,O,O,O,O,O,O,7,7,O,O,4,O,O,O,O,7,7,2,2,2,2,2,2,2,2,2,2,7,7,7,7,7,7],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,4,7,7,O,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,4,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,O,O,O,O,O,O,O,O,O,O,O,7,4,4,4,4,4,4,4,4,4,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,O,O,O,O,O,O,O,O,O,1,1,4,4,4,4,1,4,4,4,4,4],[8,8,8,8,8,8,8,8,8,8,8,w,w,w,0,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,5,13,14,15,16,17,9,x,x,x,x,x,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,w,w,w,w,w,4,4,4,4,4,w,w,w,w,w,w,2,0,4,4,2,2,2,2,2,2,b,b,4,4,4,0,2,2,2,2,2,2,2,2,2,2,b,b,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4],[0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,4,4,4,4,4,1,O,1,1,1,1,1,1,1,1,1,1,b,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,4,1,4,1,1,4,1,1,4,1,1,1,1,1,1,1,1,1,1,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,O,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,O,O,O,O,O,O,O,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,9,4,4,9,4,4,4,4,4,4,4,4,4,x,4,4,b,b,4,4,4,4,4,x,x,4,4,4,4,4,7,7,7,7,7,4,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,4,4,w],[4,4,4,x,x,x,4,4,4,4,4,b,9,b,9,9,2,2,2,2,2,2,2,2,2,2,9,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,0,0,0,0,0,0,4,4,0,0,0,0,0,0,4,4,0,0,0,0,0,0,4,4,0,0,0,4,4,4,x,x,4,4,4,x,x,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4]],T=function(){function e(){Object(i.a)(this,e),this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}return Object(r.a)(e,[{key:"bidiTransform",value:function(e,t,n){if(this.sourceToTarget=[],this.targetToSource=[],!e)return"";if(function(e,t,n){K=[],Q=[];for(var i=0;i<n;i++)e[i]=i,t[i]=i,K[i]=i}(this.sourceToTarget,this.targetToSource,e.length),!this.checkParameters(t,n))return e;t=this.inputFormat,n=this.outputFormat;var i,r=$,a=q(t.charAt(1)),u=q(n.charAt(1)),f=("I"===t.charAt(0)?"L":t.charAt(0))+a,d=("I"===n.charAt(0)?"L":n.charAt(0))+u,y=t.charAt(2)+n.charAt(2);r.defInFormat=f,r.defOutFormat=d,r.defSwap=y;var _=C(e,f,d,y,r),m=!1;return"R"===n.charAt(1)?m=!0:"C"!==n.charAt(1)&&"D"!==n.charAt(1)||(m="rtl"===this.checkContextual(_)),this.sourceToTarget=K,this.targetToSource=function(e){for(var t=new Array(e.length),n=0;n<e.length;n++)t[e[n]]=n;return t}(this.sourceToTarget),J=this.targetToSource,i=t.charAt(3)===n.charAt(3)?_:"S"===n.charAt(3)?function(e,t,n){if(0===t.length)return"";void 0===e&&(e=!0),void 0===n&&(n=!0);var i=(t=String(t)).split(""),r=0,a=1,o=i.length;e||(r=i.length-1,a=-1,o=1);for(var u=function(e,t,n,i,r){for(var a=0,o=[],u=0,f=t;f*n<i;
1f+=n)if(R(e[f])||W(e[f])){if("\u0644"===e[f]&&V(e,f+n,n,i)){e[f]=Z(e[f+n],0===a?s:l),Y(e,f+=n,n,i),r&&(o[u]=f,u++),a=0;continue}var d=e[f];1===a?e[f]=E(e,f+n,n,i)?G(e[f]):H(e[f],h):!0===E(e,f+n,n,i)?e[f]=H(e[f],v):e[f]=H(e[f],c),W(d)||(a=1),!0===N(d)&&(a=0)}else a=0;return o}(i,r,a,o,n),f="",d=0;d<i.length;d++)n&&z(u,u.length,d)>-1?(X(J,d,!e,-1),K.splice(d,1)):f+=i[d];return f}(m,_,!0):function(e,t,n){if(0===e.length)return"";void 0===n&&(n=!0),void 0===t&&(t=!0);for(var i="",r=(e=String(e)).split(""),a=0;a<e.length;a++){var s=!1;if(r[a]>="\ufe70"&&r[a]<"\ufeff"){var l=e.charCodeAt(a);r[a]>="\ufef5"&&r[a]<="\ufefc"?(t?(a>0&&n&&" "===r[a-1]?i=i.substring(0,i.length-1)+"\u0644":(i+="\u0644",s=!0),i+=o[(l-65269)/2]):(i+=o[(l-65269)/2],i+="\u0644",a+1<e.length&&n&&" "===r[a+1]?a++:s=!0),s&&(X(J,a,!0,1),K.splice(a,0,K[a]))):i+=p[l-65136]}else i+=r[a]}return i}(_,m,!0),this.sourceToTarget=K,this.targetToSource=J,this.levels=Q,i}},{key:"_inputFormatSetter",value:function(e){if(!re.test(e))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=e}},{key:"_outputFormatSetter",value:function(e){if(!re.test(e))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=e}},{key:"checkParameters",value:function(e,t){return e?this._inputFormatSetter(e):e=this.inputFormat,t?this._outputFormatSetter(t):t=this.outputFormat,e!==t}},{key:"checkContextual",value:function(e){var t=M(e);if("ltr"!==t&&"rtl"!==t){try{t=document.dir.toLowerCase()}catch(n){}"ltr"!==t&&"rtl"!==t&&(t="ltr")}return t}},{key:"hasBidiChar",value:function(e){return ae.test(e)}}]),e}();function C(e,t,n,i,r){var a=function(e,t,n){if(void 0===t.inFormat&&(t.inFormat=n.defInFormat),void 0===t.outFormat&&(t.outFormat=n.defOutFormat),void 0===t.swap&&(t.swap=n.defSwap),t.inFormat===t.outFormat)return t;var i,r=t.inFormat.substring(0,1),a=t.outFormat.substring(0,1),o=t.inFormat.substring(1,4),s=t.outFormat.substring(1,4);return"C"===o.charAt(0)&&(i=M(e),o="ltr"===i||"rtl"===i?i.toUpperCase():"L"===t.inFormat.charAt(2)?"LTR":"RTL",t.inFormat=r+o),"C"===s.charAt(0)&&("rtl"===(i=M(e))?s="RTL":"ltr"===i?(i=function(e){var t=e.split("");return t.reverse(),M(t.join(""))}(e),s=i.toUpperCase()):s="L"===t.outFormat.charAt(2)?"LTR":"RTL",t.outFormat=a+s),t}(e,{inFormat:t,outFormat:n,swap:i},r);if(a.inFormat===a.outFormat)return e;t=a.inFormat,n=a.outFormat,i=a.swap;var o=t.substring(0,1),s=t.substring(1,4),l=n.substring(0,1),u=n.substring(1,4);if(r.inFormat=t,r.outFormat=n,r.swap=i,"L"===o&&"VLTR"===n){if("LTR"===s)return r.dir=ne,I(e,r);if("RTL"===s)return r.dir=ie,I(e,r)}if("V"===o&&"V"===l)return r.dir="RTL"===s?ie:ne,D(e,r);if("L"===o&&"VRTL"===n)return"LTR"===s?(r.dir=ne,e=I(e,r)):(r.dir=ie,e=I(e,r)),D(e);if("VLTR"===t&&"LLTR"===n)return r.dir=ne,I(e,r);if("V"===o&&"L"===l&&s!==u)return e=D(e),"RTL"===s?C(e,"LLTR","VLTR",i,r):C(e,"LRTL","VRTL",i,r);if("VRTL"===t&&"LRTL"===n)return C(e,"LRTL","VRTL",i,r);if("L"===o&&"L"===l){var c=r.swap;return r.swap=c.substr(0,1)+"N","RTL"===s?(r.dir=ie,e=I(e,r),r.swap="N"+c.substr(1,2),r.dir=ne,e=I(e,r)):(r.dir=ne,e=I(e,r),r.swap="N"+c.substr(1,2),e=C(e,"VLTR","LRTL",r.swap,r)),e}return e}function M(e){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(e);return t?t[0]<="z"?"ltr":"rtl":""}function I(e,t){var n=e.split(""),i=[];return L(n,i,t),function(e,t,n){if(0!==n.hiLevel&&n.swap.substr(0,1)!==n.swap.substr(1,2))for(var i=0;i<e.length;i++)1===t[i]&&(e[i]=B(e[i]))}(n,i,t),F(2,n,i,t),F(1,n,i,t),Q=i,n.join("")}function L(e,t,n){var i=e.length,r=n.dir?g:m,a=0,o=-1,s=[],l=[];n.hiLevel=n.dir,n.lastArabic=!1,n.hasUbatAl=!1,n.hasUbatB=!1,n.hasUbatS=!1;for(var u=0;u<i;u++)s[u]=A(e[u]);for(var c=0;c<i;c++){var h=a,f=U(e,s,l,c,n);l[c]=f;var v=240&(a=r[h][f]),d=r[a&=15][ee];if(t[c]=d,v>0)if(16===v){for(var p=o;p<c;p++)t[p]=1;o=-1}else o=-1;if(r[a][te])-1===o&&(o=c);else if(o>-1){for(var y=o;y<c;y++)t[y]=d;o=-1}5===s[c]&&(t[c]=0),n.hiLevel|=d}n.hasUbatS&&function(e,t,n,i){for(var r=0;r<n;r++)if(6===e[r]){t[r]=i.dir;for(var a=r-1;a>=0&&8===e[a];a--)t[a]=i.dir}}(s,t,i,n)}function A(e){var t=e.charCodeAt(0),n=j[t>>8];return n<S?n:P[n-S][255&t]}function D(e,t){var n=e.split("");
1if(t){var i=[];L(n,i,t),Q=i}return n.reverse(),K.reverse(),n.join("")}function z(e,t,n){for(var i=0;i<t;i++)if(e[i]===n)return i;return-1}function R(e){for(var t=0;t<y.length;t++)if(e>=y[t]&&e<=_[t])return!0;return!1}function E(e,t,n,i){for(;t*n<i&&W(e[t]);)t+=n;return!!(t*n<i&&R(e[t]))}function V(e,t,n,i){for(;t*n<i&&W(e[t]);)t+=n;var r;if(!(t*n<i))return!1;r=e[t];for(var a=0;a<o.length;a++)if(o[a]===r)return!0;return!1}function F(e,t,n,i){if(!(i.hiLevel<e)){if(1===e&&i.dir===ie&&!i.hasUbatB)return t.reverse(),void K.reverse();for(var r,a,o,s,l,u=t.length,c=0;c<u;){if(n[c]>=e){for(r=c+1;r<u&&n[r]>=e;)r++;for(a=c,o=r-1;a<o;a++,o--)s=t[a],t[a]=t[o],t[o]=s,l=K[a],K[a]=K[o],K[o]=l;c=r}c++}}}function U(e,t,n,i,r){var a=t[i];return{UBAT_L:function(){return r.lastArabic=!1,0},UBAT_R:function(){return r.lastArabic=!1,1},UBAT_ON:function(){return 4},UBAT_AN:function(){return 3},UBAT_EN:function(){return r.lastArabic?3:2},UBAT_AL:function(){return r.lastArabic=!0,r.hasUbatAl=!0,1},UBAT_WS:function(){return 4},UBAT_CS:function(){var e,a;return i<1||i+1>=t.length||2!==(e=n[i-1])&&3!==e||2!==(a=t[i+1])&&3!==a?4:(r.lastArabic&&(a=3),a===e?a:4)},UBAT_ES:function(){return 2===(i>0?n[i-1]:5)&&i+1<t.length&&2===t[i+1]?2:4},UBAT_ET:function(){if(i>0&&2===n[i-1])return 2;if(r.lastArabic)return 4;for(var e=i+1,a=t.length;e<a&&t[e]===x;)e++;return e<a&&2===t[e]?2:4},UBAT_NSM:function(){if("VLTR"===r.inFormat){for(var a=t.length,o=i+1;o<a&&t[o]===O;)o++;if(o<a){var s=e[i].charCodeAt[0],l=s>=1425&&s<=2303||64286===s,u=t[o];if(l&&(1===u||7===u))return 1}}return i<1||5===t[i-1]?4:n[i-1]},UBAT_B:function(){return r.lastArabic=!0,r.hasUbatB=!0,r.dir},UBAT_S:function(){return r.hasUbatS=!0,4},UBAT_LRE:function(){return r.lastArabic=!1,4},UBAT_RLE:function(){return r.lastArabic=!1,4},UBAT_LRO:function(){return r.lastArabic=!1,4},UBAT_RLO:function(){return r.lastArabic=!1,4},UBAT_PDF:function(){return r.lastArabic=!1,4},UBAT_BN:function(){return 4}}[k[a]]()}function B(e){for(var t,n=0,i=a.length-1;n<=i;)if(t=Math.floor((n+i)/2),e<a[t][0])i=t-1;else{if(!(e>a[t][0]))return a[t][1];n=t+1}return e}function N(e){for(var t=0;t<d.length;t++)if(d[t]===e)return!0;return!1}function G(e){for(var t=0;t<u.length;t++)if(e===u[t])return f[t];return e}function H(e,t){for(var n=0;n<u.length;n++)if(e===u[n])return t[n];return e}function W(e){return e>="\u064b"&&e<="\u0655"}function q(e){return"L"===e?"LTR":"R"===e?"RTL":"C"===e?"CLR":"D"===e?"CRL":""}function Y(e,t,n,i){for(;t*n<i&&W(e[t]);)t+=n;return t*n<i&&(e[t]=" ",!0)}function Z(e,t){for(var n=0;n<o.length;n++)if(e===o[n])return t[n];return e}function X(e,t,n,i){for(var r=0;r<e.length;r++)(e[r]>t||!n&&e[r]===t)&&(e[r]+=i)}var K=[],J=[],Q=[],$={dir:0,defInFormat:"LLTR",defoutFormat:"VLTR",defSwap:"YN",inFormat:"LLTR",outFormat:"VLTR",swap:"YN",hiLevel:0,lastArabic:!1,hasUbatAl:!1,hasBlockSep:!1,hasSegSep:!1,defOutFormat:""},ee=5,te=6,ne=0,ie=1,re=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,ae=/[\u0591-\u06ff\ufb1d-\ufefc]/},622:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var i=n(23),r=n(11),a=n(3),o=n(2),s=n(37);var l=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"rasterizeText",value:function(e,t){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));var n=this._textRasterizationCanvas,i=n.getContext("2d");this.setFontProperties(i,t),this.parameters=t,this.textLines=e.split(/\r?\n/),this.lineHeight=this.computeLineHeight();var a=this.computeTextWidth(i,t),o=t.font,s=o.decoration,l=o.weight;this.lineThroughWidthOffset=s&&"line-through"===s?.1*this.lineHeight:0;var u=this.lineHeight*this.textLines.length;n.width=a+2*this.lineThroughWidthOffset,n.height=u,this.renderedLineHeight=Math.round(this.lineHeight*t.pixelRatio),this.renderedHaloSize=t.halo.size*t.pixelRatio,this.renderedWidth=a*t.pixelRatio,this.renderedHeight=u*t.pixelRatio,this.lineThroughWidthOffset*=t.pixelRatio,this.fillStyle=function(e){return"rgba(".concat(e.slice(0,3).toString(),",").concat(e[3],")")}(t.color),this.haloStyle=function(e){return"rgb(".concat(e.slice(0,3).toString(),")")}(t.halo.color);var c=this.renderedLineHeight,h=this.renderedHaloSize;this.setFontProperties(i,t);var f=function(e,t){return"center"===e?.5*t:"right"===e?t:0}(i.textAlign,this.renderedWidth)+h,v=h,d=h>0,p=this.lineThroughWidthOffset,y=0;d&&this.renderHalo(i,f,v,p,y,t),y+=v,p+=f;var _,m=Object(r.a)(this.textLines);try{for(m.s();!(_=m.n()).done;){var g=_.value;i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(g,p,y),i.globalCompositeOperation="source-over",i.fillStyle=this.fillStyle,i.fillText(g,p,y),s&&"none"!==s&&this.renderDecoration(i,p,y,s,l),y+=c}}catch(j){m.e(j)}finally{m.f()}var b=this.renderedWidth+2*this.lineThroughWidthOffset,x=this.renderedHeight,O=i.getImageData(0,0,b,x),w=new Uint8Array(O.data);if(t.premultiplyColors)for(var k,S=0;S<w.length;S+=4)k=w[S+3]/255,w[S]=w[S]*k,w[S+1]=w[S+1]*k,w[S+2]=w[S+2]*k;return{size:[b,x],image:new Uint32Array(w.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}},{key:"renderHalo",value:function(e,t,n,i,r,a){var o=this.renderedWidth,s=this.renderedHeight;this._haloRasterizationCanvas||(this._haloRasterizationCanvas=document.createElement("canvas")),this._haloRasterizationCanvas.width=o,this._haloRasterizationCanvas.height=s;var l=this._haloRasterizationCanvas,u=l.getContext("2d");u.clearRect(0,0,o,s),this.setFontProperties(u,a);var c=a.font,h=c.decoration,f=c.weight;u.fillStyle=this.haloStyle,u.strokeStyle=this.haloStyle;var v=this.renderedHaloSize<3;u.lineJoin=v?"miter":"round",v?this.renderHaloEmulated(u,t,n,h,f):this.renderHaloNative(u,t,n,h,f),e.globalAlpha=this.parameters.halo.color[3],e.drawImage(l,0,0,o,s,i,r,o,s),e.globalAlpha=1}},{key:"renderHaloEmulated",value:function(e,t,n,a,o){var s,l=this.renderedLineHeight,c=this.renderedHaloSize,h=Object(r.a)(this.textLines);try{for(h.s();!(s=h.n()).done;){var f,v=s.value,d=Object(r.a)(u);try{for(d.s();!(f=d.n()).done;){var p=Object(i.a)(f.value,2),y=p[0],_=p[1];e.fillText(v,t+c*y,n+c*_)}}catch(m){d.e(m)}finally{d.f()}a&&"none"!==a&&this.renderDecoration(e,t,n,a,o),n+=l}}catch(m){h.e(m)}finally{h.f()}}},{key:"renderHaloNative",value:function(e,t,n,i,a){var o,s=this.renderedLineHeight,l=this.renderedHaloSize,u=Object(r.a)(this.textLines);try{for(u.s();!(o=u.n()).done;){for(var c=o.value,h=2*l,f=0;f<5;f++){var v=.6+.1*f;e.lineWidth=v*h,e.strokeText(c,t,n),i&&"none"!==i&&this.renderDecoration(e,t,n,i,a)}n+=s}}catch(d){u.e(d)}finally{u.f()}}},{key:"setFontProperties",value:function(e,t){var n,i=t.font,r="".concat(i.style," ").concat(i.weight," ").concat(Object(s.c)(t.size*t.pixelRatio),"px ").concat(i.family,", sans-serif");switch(e.font=r,e.textBaseline="top",t.horizontalAlignment){case"left":default:n="left";break;case"right":n="right";break;case"center":n="center"}e.textAlign=n}},{key:"computeTextSize",value:function(e,t){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));var n=this._textRasterizationCanvas,i=n.getContext("2d");this.setFontProperties(i,t),this.parameters=t,this.textLines=e.split(/\r?\n/),this.lineHeight=this.computeLineHeight();var r=this.computeTextWidth(i,t),a=this.lineHeight*this.textLines.length;return n.width=r,n.height=a,[r*t.pixelRatio,a*t.pixelRatio]}},{key:"computeTextWidth",value:function(e,t){var n,i=0,a=Object(r.a)(this.textLines);try{for(a.s();!(n=a.n()).done;){var o=n.value;i=Math.max(i,e.measureText(o).width)}}catch(l){a.e(l)}finally{a.f()}var s=t.font;return("italic"===s.style||"oblique"===s.style||"string"==typeof s.weight&&("bold"===s.weight||"bolder"===s.weight)||"number"==typeof s.weight&&s.weight>600)&&(i+=.3*e.measureText("w").width),i+=2*this.parameters.halo.size,Math.round(i)}},{key:"computeLineHeight",value:function(){var e=1.275*this.parameters.size,t=this.parameters.font.decoration;return t&&"underline"===t&&(e*=1.3),Math.round(e+2*this.parameters.halo.size)}},{key:"renderDecoration",value:function(e,t,n,i,r){var a=.9*this.lineHeight,o="bold"===r?.06:"bolder"===r?.09:.04;switch(e.textAlign){case"center":t-=this.renderedWidth/2;break;case"right":t-=this.renderedWidth}var s=e.textBaseline;if("underline"===i)switch(s){case"top":n+=a;break;case"middle":n+=a/2}else if("line-through"===i)switch(s){case"top":n+=a/1.5;break;case"middle":n+=a/3}e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=Math.ceil(a*o),e.moveTo(t-this.lineThroughWidthOffset,n),e.lineTo(t+this.renderedWidth+2*this.lineThroughWidthOffset,n),e.stroke(),e.restore(
1)}}]),e}();for(var u=[],c=0;c<360;c+=22.5)u.push([Math.cos(Math.PI*c/180),Math.sin(Math.PI*c/180)])},632:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i=n(3),r=n(2),a=n(7),o=function(){function e(t,n,r){Object(i.a)(this,e),this.pixelBlock=t,this.extent=n,this.originalPixelBlock=r}return Object(r.a)(e,[{key:"width",get:function(){return Object(a.k)(this.pixelBlock)?this.pixelBlock.width:0}},{key:"height",get:function(){return Object(a.k)(this.pixelBlock)?this.pixelBlock.height:0}},{key:"render",value:function(e){var t=this.pixelBlock;if(!Object(a.j)(t)){var n=this.filter({pixelBlock:t});if(!Object(a.j)(n.pixelBlock)){var i=n.pixelBlock.getAsRGBA(),r=e.createImageData(n.pixelBlock.width,n.pixelBlock.height);r.data.set(i),e.putImageData(r,0,0)}}}},{key:"getRenderedRasterPixels",value:function(){var e=this.filter({pixelBlock:this.pixelBlock});return Object(a.j)(e.pixelBlock)?null:{width:e.pixelBlock.width,height:e.pixelBlock.height,renderedRasterPixels:new Uint8Array(e.pixelBlock.getAsRGBA().buffer)}}}]),e}()},639:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var i=n(23),r=n(3),a=n(2),o=n(29),s=n(43),l=n(39),u=n(4),c=n(5),h=n(7),f=n(235),v=n(303),d=n(374),p=n(549),y=n(632),_=n(539);function m(e,t,n){var i={target:3553,pixelFormat:6408,internalFormat:6408,dataType:5121,wrapMode:33071};return t&&n&&(i.width=t,i.height=n),new _.a(e,i)}var g=function(e){Object(u.a)(n,e);var t=Object(c.a)(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1?arguments[1]:void 0,s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Object(r.a)(this,n),(e=t.call(this)).requestRenderOnSourceChangedEnabled=s,e._textureInvalidated=!0,e.stencilRef=0,e.coordScale=[1,1],e._height=void 0,e.pixelRatio=1,e.resolution=0,e.rotation=0,e._source=null,e._width=void 0,e.x=0,e.y=0,e.blendFunction=a,e.source=i,e.requestRender=e.requestRender.bind(Object(o.a)(e)),e}return Object(a.a)(n,[{key:"destroy",value:function(){this._texture&&(this._texture.dispose(),this._texture=null)}},{key:"isSourceScaled",get:function(){return this.width!==this.sourceWidth||this.height!==this.sourceHeight}},{key:"height",get:function(){return void 0!==this._height?this._height:this.sourceHeight},set:function(e){this._height=e}},{key:"source",get:function(){return this._source},set:function(e){this._source=e,this.invalidateTexture()}},{key:"sourceHeight",get:function(){return this._source instanceof HTMLImageElement?this._source.naturalHeight:this._source.height}},{key:"sourceWidth",get:function(){return this._source instanceof HTMLImageElement?this._source.naturalWidth:this._source.width}},{key:"width",get:function(){return void 0!==this._width?this._width:this.sourceWidth},set:function(e){this._width=e}},{key:"beforeRender",value:function(e){Object(s.a)(Object(l.a)(n.prototype),"beforeRender",this).call(this,e),this.updateTexture(e.context)}},{key:"invalidateTexture",value:function(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRenderOnSourceChangedEnabled&&this.requestRender())}},{key:"_createTransforms",value:function(){return{dvs:Object(v.b)()}}},{key:"setTransform",value:function(e){var t=Object(f.b)(this.transforms.dvs),n=e.toScreenNoRotation([0,0],[this.x,this.y]),r=Object(i.a)(n,2),a=r[0],o=r[1],s=this.resolution/this.pixelRatio/e.resolution,l=s*this.width,u=s*this.height,c=Math.PI*this.rotation/180;Object(f.c)(t,t,Object(d.b)(a,o)),Object(f.c)(t,t,Object(d.b)(l/2,u/2)),Object(f.j)(t,t,-c),Object(f.c)(t,t,Object(d.b)(-l/2,-u/2)),Object(f.g)(t,t,Object(d.b)(l,u)),Object(f.h)(this.transforms.dvs,e.displayViewMat3,t)}},{key:"setSamplingProfile",value:function(e){this._texture&&(e.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(e.samplingMode))}},{key:"bind",value:function(e,t){this._texture&&e.bindTexture(this._texture,t)}},{key:"updateTexture",value:function(e){var t;if(!this.stage)return null==(t=this._texture)||t.dispose(),void(this._texture=null);if(this._textureInvalidated){this._textureInvalidated=!1,this._texture||(this.source?this._texture=m(e,this.sourceWidth,this.sourceHeight):this._texture=m(e));var n,i=this.source;if(i){if(this._texture.resize(this.sourceWidth,this.sourceHeight),(n=i)&&"render"
1in n)if(i instanceof y.a){var r=i.getRenderedRasterPixels();this._texture.setData(Object(h.k)(r)?r.renderedRasterPixels:null)}else this._texture.setData(function(e){var t=document.createElement("canvas");return t.width=e.width,t.height=e.height,e.render(t.getContext("2d")),t}(i));else(function(e){return e&&!("render"in e)})(i)&&this._texture.setData(i);this.ready()}else this._texture.setData(null)}}},{key:"onAttach",value:function(){this.invalidateTexture()}},{key:"onDetach",value:function(){this.invalidateTexture()}}]),n}(p.a)},659:function(e,t,n){"use strict";function i(e){return"h"in e&&"s"in e&&"v"in e}function r(e){return"l"in e&&"a"in e&&"b"in e}function a(e){return"l"in e&&"c"in e&&"h"in e}function o(e){return"x"in e&&"y"in e&&"z"in e}n.d(t,"a",(function(){return g})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return x})),n.d(t,"d",(function(){return m}));var s=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],l=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function u(e,t){var n,i,r=[];if(e[0].length!==t.length)throw"dimensions do not match";var a=e.length,o=e[0].length,s=0;for(n=0;n<a;n++){for(s=0,i=0;i<o;i++)s+=e[n][i]*t[i];
1r.push(s)}return r}function c(e){var t=[e.r/255,e.g/255,e.b/255].map((function(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)})),n=u(s,t);return{x:100*n[0],y:100*n[1],z:100*n[2]}}function h(e){var t=u(l,[e.x/100,e.y/100,e.z/100]).map((function(e){var t=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055;return Math.min(1,Math.max(t,0))}));return{r:Math.round(255*t[0]),g:Math.round(255*t[1]),b:Math.round(255*t[2])}}function f(e){var t=[e.x/95.047,e.y/100,e.z/108.883].map((function(e){return e>Math.pow(6/29,3)?Math.pow(e,1/3):1/3*Math.pow(29/6,2)*e+4/29}));return{l:116*t[1]-16,a:500*(t[0]-t[1]),b:200*(t[1]-t[2])}}function v(e){var t=e.l,n=[(t+16)/116+e.a/500,(t+16)/116,(t+16)/116-e.b/200].map((function(e){return e>6/29?Math.pow(e,3):3*Math.pow(6/29,2)*(e-4/29)}));return{x:95.047*n[0],y:100*n[1],z:108.883*n[2]}}function d(e){return f(c(e))}function p(e){return h(v(e))}function y(e){return function(e){var t=e.l,n=e.a,i=e.b,r=Math.sqrt(n*n+i*i),a=Math.atan2(i,n);return{l:t,c:r,h:a=a>0?a:a+2*Math.PI}}(f(c(e)))}function _(e){return h(v(function(e){var t=e.l,n=e.c,i=e.h;return{l:t,a:n*Math.cos(i),b:n*Math.sin(i)}}(e)))}function m(e){return function(e){return"r"in e&&"g"in e&&"b"in e}(e)?e:a(e)?_(e):r(e)?p(e):o(e)?h(e):i(e)?function(e){var t,n=(e.h+360)%360/60,i=e.s/100,r=e.v/100*255,a=r*i,o=a*(1-Math.abs(n%2-1));switch(Math.floor(n)){case 0:t={r:a,g:o,b:0};break;case 1:t={r:o,g:a,b:0};break;case 2:t={r:0,g:a,b:o};break;case 3:t={r:0,g:o,b:a};break;case 4:t={r:o,g:0,b:a};break;case 5:case 6:t={r:a,g:0,b:o};break;default:t={r:0,g:0,b:0}}return t.r=Math.round(t.r+r-a),t.g=Math.round(t.g+r-a),t.b=Math.round(t.b+r-a),t}(e):e}function g(e){return i(e)?e:function(e){var t=e.r,n=e.g,i=e.b,r=Math.max(t,n,i),a=r-Math.min(t,n,i),o=r,s=0===a?0:r===t?(n-i)/a%6:r===n?(i-t)/a+2:(t-n)/a+4,l=0===a?0:a/o;return s<0&&(s+=6),{h:s*=60,s:l*=100,v:o*=100/255}}(m(e))}function b(e){return r(e)?e:d(m(e))}function x(e){return a(e)?e:y(m(e))}},661:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var i=n(36),r=n(3),a=n(2),o=n(43),s=n(39),l=n(4),u=n(5),c=n(569),h=n(532),f=function(e){Object(l.a)(n,e);var t=Object(u.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"requiresDedicatedFBO",get:function(){return this.children.some((function(e){return"additive"===e.blendFunction}))}},{key:"prepareRenderPasses",value:function(e){var t=this,r=e.registerRenderPass({name:"bitmap",brushes:[c.a.bitmap],target:function(){return t.children},drawPhase:h.c.MAP});return[].concat(Object(i.a)(Object(o.a)(Object(s.a)(n.prototype),"prepareRenderPasses",this).call(this,e)),[r])}}]),n}(n(576).a)},716:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(3),r=n(2),a=function(){function e(t){Object(i.a)(this,e),this._array=[],t<=0&&console.error("strideInBytes must be positive!"),this._stride=t}return Object(r.a)(e,[{key:"array",get:function(){return this._array}},{key:"index",get:function(){return 4*this._array.length/this._stride}},{key:"itemSize",get:function(){return this._stride}},{key:"sizeInBytes",get:function(){return 4*this._array.length}},{key:"reset",value:function(){this.array.length=0}},{key:"toBuffer",value:function(){return new Uint32Array(this._array).buffer}}],[{key:"i1616to32",value:function(e,t){return 65535&e|t<<16}},{key:"i8888to32",value:function(e,t,n,i){return 255&e|(255&t)<<8|(255&n)<<16|i<<24}},{key:"i8816to32",value:function(e,t,n){return 255&e|(255&t)<<8|n<<16}}]),e}()},746:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n(11),r=n(3),a=n(2),o=n(762),s=function(){function e(t){var n=this;if(Object(r.a)(this,e),this._style=t,this.backgroundBucketIds=[],this._uidToLayer=new Map,this._layerByName={},this._runningId=0,t.layers||(t.layers=[]),this.version=parseFloat(t.version),this.layers=t.layers.map((function(e,t,i){return n._create(e,t,i)})),this.layers)for(var i,a=0;a<this.layers.length;a++)i=this.layers[a],this._layerByName[i.id]=i,this._uidToLayer.set(i.uid,i),0===i.type&&this.backgroundBucketIds.push(i.id);this._identifyRefLayers()}return Object(a.a)(e,[{key:"isPainterDataDriven",value:function(e){var t=this._layerByName[e];return!!t&&t.isPainterDataDriven()}},{key:"getStyleLayerId",value:function(e){return e>=this.layers.length?null:this.layers[e].id}},{key:"getStyleLayerByUID",value:function(e){var t=this._uidToLayer.get(e);return null!=t?t:null}},{key:"getStyleLayerIndex",value:function(e){var t=this._layerByName[e];return t?this.layers.indexOf(t):-1}},{key:"setStyleLayer",value:function(t,n){if(t&&t.id){var i=this._style;null!=n&&n>=this.layers.length&&(n=this.layers.length-1);var r,a=!0,o=this._layerByName[t.id];if(o){var s=this.layers.indexOf(o);n||(n=s),n===s?(a=!1,r=e._recreateLayer(t,o),this.layers[n]=r,i.layers[n]=t):(this.layers.splice(s,1),i.layers.splice(s,1),r=this._create(t,n,this.layers),this.layers.splice(n,0,r),i.layers.splice(n,0,t))}else r=this._create(t,n,this.layers),!n||n>=this.layers.length?(this.layers.push(r),i.layers.push(t)):(this.layers.splice(n,0,r),i.layers.splice(n,0,t));this._layerByName[t.id]=r,this._uidToLayer.set(r.uid,r),a&&this._recomputeZValues(),this._identifyRefLayers()}}},{key:"getStyleLayer",value:function(e){var t=this._layerByName[e];
1return t?{type:t.typeName,id:t.id,source:t.source,"source-layer":t.sourceLayer,minzoom:t.minzoom,maxzoom:t.maxzoom,filter:t.filter,layout:t.layout,paint:t.paint}:null}},{key:"deleteStyleLayer",value:function(e){var t=this._layerByName[e];if(t){delete this._layerByName[e],this._uidToLayer.delete(t.uid);var n=this.layers.indexOf(t);this.layers.splice(n,1),this._style.layers.splice(n,1),this._recomputeZValues(),this._identifyRefLayers()}}},{key:"getLayerById",value:function(e){return this._layerByName[e]}},{key:"getLayoutProperties",value:function(e){var t=this._layerByName[e];return t?t.layout:null}},{key:"getPaintProperties",value:function(e){var t=this._layerByName[e];return t?t.paint:null}},{key:"setPaintProperties",value:function(t,n){var i=this._layerByName[t];if(i){var r={type:i.typeName,id:i.id,source:i.source,"source-layer":i.sourceLayer,minzoom:i.minzoom,maxzoom:i.maxzoom,filter:i.filter,layout:i.layout,paint:n},a=e._recreateLayer(r,i),o=this.layers.indexOf(i);this.layers[o]=a,this._style.layers[o].paint=n,this._layerByName[i.id]=a,this._uidToLayer.set(i.uid,a)}}},{key:"setLayoutProperties",value:function(t,n){var i=this._layerByName[t];if(i){var r={type:i.typeName,id:i.id,source:i.source,"source-layer":i.sourceLayer,minzoom:i.minzoom,maxzoom:i.maxzoom,filter:i.filter,layout:n,paint:i.paint},a=e._recreateLayer(r,i),o=this.layers.indexOf(i);this.layers[o]=a,this._style.layers[o].layout=n,this._layerByName[i.id]=a,this._uidToLayer.set(i.uid,a)}}},{key:"setStyleLayerVisibility",value:function(t,n){var i=this._layerByName[t];if(i){var r=i.layout||{};r.visibility=n;var a={type:i.typeName,id:i.id,source:i.source,"source-layer":i.sourceLayer,minzoom:i.minzoom,maxzoom:i.maxzoom,filter:i.filter,layout:r,paint:i.paint},o=e._recreateLayer(a,i),s=this.layers.indexOf(i);this.layers[s]=o,this._style.layers[s].layout=r,this._layerByName[i.id]=o,this._uidToLayer.set(i.uid,o)}}},{key:"getStyleLayerVisibility",value:function(e){var t,n=this._layerByName[e];if(!n)return"none";var i=n.layout;return null!=(t=null==i?void 0:i.visibility)?t:"visible"}},{key:"_recomputeZValues",value:function(){for(var e=this.layers,t=1/(e.length+1),n=0;n<e.length;n++)e[n].z=1-(1+n)*t}},{key:"_identifyRefLayers",value:function(){var e,t=[],n=[],r=0,a=Object(i.a)(this.layers);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=o.layout;if(1===o.type){var l,u=o,c=o.source+"|"+o.sourceLayer;c+=null!=(l="|"+(null==s?void 0:s.visibility))?l:"",c+="|"+o.minzoom,c+="|"+o.maxzoom,c+="|"+JSON.stringify(o.filter),(u.hasDataDrivenFill||u.hasDataDrivenOutline)&&(c+="|"+r),t.push({key:c,layer:o})}else if(2===o.type){var h,f=o,v=o.source+"|"+o.sourceLayer;v+=null!=(h="|"+(null==s?void 0:s.visibility))?h:"",v+="|"+o.minzoom,v+="|"+o.maxzoom,v+="|"+JSON.stringify(o.filter),v+="|"+(void 0!==s?s["line-cap"]:""),v+="|"+(void 0!==s?s["line-join"]:""),f.hasDataDrivenLine&&(v+="|"+r),n.push({key:v,layer:o})}++r}}catch(d){a.e(d)}finally{a.f()}this._assignRefLayers(t),this._assignRefLayers(n)}},{key:"_assignRefLayers",value:function(e){var t,n;e.sort((function(e,t){return e.key<t.key?-1:e.key>t.key?1:0}));for(var i=e.length,r=0;r<i;r++){var a=e[r];if(a.key===t)a.layer.refLayerId=n;else if(t=a.key,n=a.layer.id,1===a.layer.type){if(!a.layer.getPaintProperty("fill-outline-color"))for(var o=r+1;o<i;o++){var s=e[o];if(s.key!==t)break;if(s.layer.getPaintProperty("fill-outline-color")){e[r]=s,e[o]=a,n=s.layer.id;break}}}else if(2===a.layer.type)for(var l=a.layer,u=r+1;u<i;u++){var c=e[u];if(c.key!==t)break;var h=c.layer;(l.canUseThinTessellation&&!h.canUseThinTessellation||!l.canUseThinTessellation&&(h.getPaintProperty("line-pattern")||h.getPaintProperty("line-dasharray")))&&(l=h,e[r]=c,e[u]=a,n=c.layer.id)}}}},{key:"_create",value:function(e,t,n){var i=1-(1+t)*(1/(n.length+1)),r=this._runningId++;switch(e.type){case"background":return new o.a(0,e,i,r);case"fill":return new o.c(1,e,i,r);case"line":return new o.e(2,e,i,r);case"symbol":return new o.f(3,e,i,r);case"raster":throw new Error("Unsupported vector tile raster layer");case"circle":return new o.b(4,e,i,r)}throw new Error("Unknown vector tile layer")}}],[{key:"_recreateLayer",value:function(e,t){switch(e.type){case"background":return new o.a(0,e,t.z,t.uid);case"fill":return new o.c(1,e,t.z,t.uid);case"line":return new o.e(2,e,t.z,t.uid);case"symbol":return new o.f(3,e,t.z,t.uid);case"raster":throw new Error("Unsupported vector tile raster layer");case"circle":return new o.b(4,e,t.z,t.uid)}}}]),e}()},762:function(e,t,n){"use strict";n.d(t,"a",(function(){return Ue})),n.d(t,"b",(function(){return He})),n.d(t,"c",(function(){return Be})),n.d(t,"d",(function(){return We})),n.d(t,"e",(function(){return Ne})),n.d(t,"f",(function(){return Ge})),n.d(t,"g",(function(){return qe}));var i=n(4),r=n(5),a=n(11),o=n(3),s=n(2),l=n(9),u=n(7),c=n(716),h=function(){function e(t){Object(o.a)(this,e),this._locations=new Map,this._key=t}return Object(s.a)(e,[{key:"key",get:function(){return this._key}},{key:"type",get:function(){return 7&this._key}},{key:"defines",value:function(){return[]}},{key:"getStride",value:function(){return this._layoutInfo||this._buildAttributesInfo(),this._stride}},{key:"getAttributeLocations",value:function(){return 0===this._locations.size&&this._buildAttributesInfo(),this._locations}},{key:"getLayoutInfo",value:function(){return this._layoutInfo||this._buildAttributesInfo(),this._layoutInfo}},{key:"getEncodingInfos",value:function(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}},{key:"getUniforms",value:function(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}},{key:"getShaderHeader",value:function(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}},{key:"getShaderMain",value:function(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}},{key:"setDataUniforms",value:function(e,t,n,i,r){var o,s=this.getUniforms(),l=Object(a.a)(s);try{for(l.s();!(o=l.n()).done;){var u=o.value,c=u.name,h=u.type,f=(0,u.getValue)(n,t,i,r);if(null!==f)switch(h){case"float":e.setUniform1f(c,f);break;case"vec2":e.setUniform2fv(c,f);break;case"vec4":e.setUniform4fv(c,f)}}}catch(v){l.e(v)}finally{l.f()}}},{key:"encodeAttributes",value:function(e,t,n,i){for(var r=this.attributesInfo(),o=this.getEncodingInfos(),s=[],l=0,u=0,c=0,h=Object.keys(o);c<h.length;c++){var f,v,d=h[c],p=o[d],y=r[d],_=y.type,m=y.precisionFactor,g=y.isLayout?n.getLayoutProperty(d):n.getPaintProperty(d),b=null==(f=g.interpolator)?void 0:f.getInterpolationRange(t),x=0,O=Object(a.a)(p);try{for(O.s();!(v=O.n()).done;){var w=v.value,k=w.offset,S=w.bufferElementsToAdd;if(S>0){for(var j=0;j<S;j++)s.push(0);l+=u,u=w.bufferElementsToAdd}var P=null!=i?i:g.getValue(b?b[x]:t,e);switch(_){case 0:case 1:s[l]|=this._encodeByte(P*(m||1),8*k);break;case 2:case 3:s[l]|=this._encodeShort(P*(m||1),8*k);break;case 4:case 5:s[l]|=this._encodeByte(P*(m||1),8*k),s[l]|=this._encodeByte(P*(m||1),8*k+8);break;case 6:case 7:s[l]|=this._encodeShort(P*(m||1),8*k),s[l]|=this._encodeShort(P*(m||1),8*k+16);break;case 8:case 9:s[l]|=this._encodeByte(P*(m||1),8*k),s[l]|=this._encodeByte(P*(m||1),8*k+8),s[l]|=this._encodeByte(P*(m||1),8*k+16),s[l]|=this._encodeByte(P*(m||1),8*k+24);break;case 10:s[l]=this._encodeColor(P);break;case 11:case 12:this._encodePattern(l,s,P);break;default:throw new Error("Unsupported encoding type")}x++}}catch(T){O.e(T)}finally{O.f()}}return s}},{key:"getAtributeState",value:function(e){var t=0,n=3+2*e;return t|=this._bit(n),t|=this._bit(n+1)<<1}},{key:"_buildAttributesInfo",value:function(){var t,n=[],i={},r={},o=-1,s=this.attributesInfo(),l=this.attributes(),u=-1,c=Object(a.a)(l);try{for(c.s();!(t=c.n()).done;){var h=t.value;u++;var f=this.getAtributeState(u);if(0!==f&&3!==f){var v=s[h],d=[];i[h]=d;for(var p=v.type,y=0;y<f;y++){var _=e._encodingInfo[p],m=_.dataType,g=_.bytesPerElement,b=_.count,x=_.normalized,O=g*b,w=r[m],k=0;if(!w||w.count+b>4)w={dataIndex:++o,count:0,offset:0},4!==b&&(r[m]=w),n.push({location:-1,name:"a_data_"+o,count:b,type:m,normalized:x}),k=Math.ceil(Math.max(O/4,1));else{var S=n[w.dataIndex];
1S.count+=b,k=Math.ceil(Math.max(S.count*g/4,1))-Math.ceil(Math.max(w.offset/4,1))}d.push({dataIndex:w.dataIndex,offset:w.offset,bufferElementsToAdd:k}),w.offset+=O,w.count+=b}}}}catch(V){c.e(V)}finally{c.f()}for(var j=0,P=n;j<P.length;j++){var T=P[j];switch(T.type){case 5120:case 5121:T.count=4;case 5122:case 5123:T.count+=T.count%2}}this._buildVertexBufferLayout(n);var C,M=0,I=this._layoutInfo.geometry,L=Object(a.a)(I);try{for(L.s();!(C=L.n()).done;){var A=C.value;this._locations.set(A.name,M++)}}catch(V){L.e(V)}finally{L.f()}var D=this._layoutInfo.opacity;if(D){var z,R=Object(a.a)(D);try{for(R.s();!(z=R.n()).done;){var E=z.value;this._locations.set(E.name,M++)}}catch(V){R.e(V)}finally{R.f()}}this._buildShaderInfo(n,i),this._propertyEncodingInfo=i}},{key:"_buildVertexBufferLayout",value:function(e){var t={},n=this.geometryInfo(),i=n[0].stride;if(0===e.length)t.geometry=n;else{var r,o=[],s=i,u=Object(a.a)(e);try{for(u.s();!(r=u.n()).done;){var c=r.value;i+=f(c.type)*c.count}}catch(g){u.e(g)}finally{u.f()}var h,v=Object(a.a)(n);try{for(v.s();!(h=v.n()).done;){var d=h.value,p=Object(l.a)({},d);p.stride=i,o.push(p)}}catch(g){v.e(g)}finally{v.f()}var y,_=Object(a.a)(e);try{for(_.s();!(y=_.n()).done;){var m=y.value;o.push({name:m.name,count:m.count,type:m.type,offset:s,stride:i,normalized:m.normalized||!1,divisor:0}),s+=f(m.type)*m.count}}catch(g){_.e(g)}finally{_.f()}t.geometry=o}this.opacityInfo()&&(t.opacity=this.opacityInfo()),this._layoutInfo=t,this._stride=i}},{key:"_buildShaderInfo",value:function(t,n){var i,r=this,o="\n",s="\n",l=[],c=Object(a.a)(t);try{for(c.s();!(i=c.n()).done;){var h=i.value;o+="attribute ".concat(this._getType(h.count)," ").concat(h.name,";\n")}}catch(g){c.e(g)}finally{c.f()}var f,d=this.attributes(),p=this.attributesInfo(),y=-1,_=Object(a.a)(d);try{var m=function(){var t=f.value;y++;var i=p[t],a=i.name,c=i.type,h=i.precisionFactor,d=i.isLayout,_=h&&1!==h?" * "+1/h:"",m=e._encodingInfo[c],g=m.bytesPerElement,b=m.count,x=function(e){return"a_data_".concat(e.dataIndex).concat(v(b,e.offset,g))};switch(r.getAtributeState(y)){case 0:var O=r._getType(b),w="u_".concat(a);l.push({name:w,type:O,getValue:function(e,n,i,r){var a=d?e.getLayoutValue(t,n):e.getPaintValue(t,n);if(11===c){var o=e.getDashKey(a,e.getLayoutValue("line-cap",n)),s=r.getMosaicItemPosition(o,!1);if(Object(u.j)(s))return null;var l=s.tl,h=s.br;return[l[0],h[1],h[0],l[1]]}if(12===c){var f=r.getMosaicItemPosition(a,-1===t.indexOf("line-"));if(Object(u.j)(f))return null;var v=f.tl,p=f.br;return[v[0],p[1],p[0],v[1]]}if(10===c){var y=a[3];return[y*a[0],y*a[1],y*a[2],y]}return a}}),o+="uniform ".concat(O," ").concat(w,";\n"),s+="".concat(O," ").concat(a," = ").concat(w,";\n");break;case 1:var k=x(n[t][0]);s+="".concat(r._getType(b)," ").concat(a," = ").concat(k).concat(_,";\n");break;case 2:var S="u_t_".concat(a);l.push({name:S,type:"float",getValue:function(e,n,i,r){return(d?e.getLayoutProperty(t):e.getPaintProperty(t)).interpolator.interpolationUniformValue(i,n)}}),o+="uniform float ".concat(S,";\n");var j=x(n[t][0]),P=x(n[t][1]);s+="".concat(r._getType(b)," ").concat(a," = mix(").concat(j).concat(_,", ").concat(P).concat(_,", ").concat(S,");\n")}};for(_.s();!(f=_.n()).done;)m()}catch(g){_.e(g)}finally{_.f()}this._shaderHeader=o,this._shaderMain=s,this._uniforms=l}},{key:"_bit",value:function(e){return(this._key&1<<e)>>e}},{key:"_getType",value:function(e){switch(e){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}},{key:"_encodeColor",value:function(e){var t=255*e[3];return c.a.i8888to32(e[0]*t,e[1]*t,e[2]*t,t)}},{key:"_encodePattern",value:function(e,t,n){if(n&&n.rect){var i=n.rect,r=n.width,a=n.height;t[e]=this._encodeShort(i.x+2,0),t[e]|=this._encodeShort(i.y+2+a,16),t[e+1]=this._encodeShort(i.x+2+r,0),t[e+1]|=this._encodeShort(i.y+2,16)}}},{key:"_encodeByte",value:function(e,t){return(255&e)<<t}},{key:"_encodeShort",value:function(e,t){return(65535&e)<<t}}]),e}();h._encodingInfo={0:{dataType:5120,bytesPerElement:1,count:1,normalized:!1},1:{dataType:5121,bytesPerElement:1,count:1,normalized:!1},2:{dataType:5122,bytesPerElement:2,count:1,normalized:!1},3:{dataType:5123,bytesPerElement:2,count:1,normalized:!1},4:{dataType:5120,bytesPerElement:1,count:2,normalized:!1},5:{dataType:5121,bytesPerElement:1,count:2,normalized:!1},6:{dataType:5122,bytesPerElement:2,count:2,normalized:!1},7:{dataType:5123,bytesPerElement:2,count:2,normalized:!1},8:{dataType:5120,bytesPerElement:1,count:4,normalized:!1},9:{dataType:5121,bytesPerElement:1,count:4,normalized:!1},10:{dataType:5121,bytesPerElement:1,count:4,normalized:!0},11:{dataType:5123,bytesPerElement:2,count:4,normalized:!1},12:{dataType:5123,bytesPerElement:2,count:4,normalized:!1}};var f=function(e){switch(e){case 5126:case 5124:case 5125:return 4;case 5122:case 5123:return 2;case 5120:case 5121:return 1}},v=function(e,t,n){var i=t/n;
1if(1===e)switch(i){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(2===e)switch(i){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(3===e)switch(i){case 0:return".xyz";case 1:return".yzw"}return""},d=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e){return Object(o.a)(this,n),t.call(this,e)}return Object(s.a)(n,[{key:"geometryInfo",value:function(){return n.GEOMETRY_LAYOUT}},{key:"opacityInfo",value:function(){return null}},{key:"attributes",value:function(){return n.ATTRIBUTES}},{key:"attributesInfo",value:function(){return n.ATTRIBUTES_INFO}}]),n}(h);d.ATTRIBUTES=[],d.GEOMETRY_LAYOUT=[{name:"a_pos",count:2,type:5120,offset:0,stride:2,normalized:!1,divisor:0}],d.ATTRIBUTES_INFO={};var p=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e){return Object(o.a)(this,n),t.call(this,e)}return Object(s.a)(n,[{key:"geometryInfo",value:function(){return n.GEOMETRY_LAYOUT}},{key:"opacityInfo",value:function(){return null}},{key:"attributes",value:function(){return n.ATTRIBUTES}},{key:"attributesInfo",value:function(){return n.ATTRIBUTES_INFO}}]),n}(h);p.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],p.GEOMETRY_LAYOUT=[{name:"a_pos",count:2,type:5122,offset:0,stride:4,normalized:!1,divisor:0}],p.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:1},"circle-color":{name:"color",type:10},"circle-opacity":{name:"opacity",type:1,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:1,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:10},"circle-stroke-opacity":{name:"stroke_opacity",type:1,precisionFactor:100},"circle-blur":{name:"blur",type:1,precisionFactor:32}};var y=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e){return Object(o.a)(this,n),t.call(this,e)}return Object(s.a)(n,[{key:"geometryInfo",value:function(){return n.GEOMETRY_LAYOUT}},{key:"opacityInfo",value:function(){return null}},{key:"attributes",value:function(){return n.ATTRIBUTES}},{key:"attributesInfo",value:function(){return n.ATTRIBUTES_INFO}}]),n}(h);y.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],y.GEOMETRY_LAYOUT=[{name:"a_pos",count:2,type:5122,offset:0,stride:4,normalized:!1,divisor:0}],y.ATTRIBUTES_INFO={"fill-color":{name:"color",type:10},"fill-opacity":{name:"opacity",type:1,precisionFactor:100},"fill-pattern":{name:"tlbr",type:12,isOptional:!0}};var _=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e,i){var r;return Object(o.a)(this,n),(r=t.call(this,e)).usefillColor=i,r}return Object(s.a)(n,[{key:"geometryInfo",value:function(){return n.GEOMETRY_LAYOUT}},{key:"opacityInfo",value:function(){return null}},{key:"attributes",value:function(){return this.usefillColor?n.ATTRIBUTES_FILL:n.ATTRIBUTES_OUTLINE}},{key:"attributesInfo",value:function(){return this.usefillColor?n.ATTRIBUTES_INFO_FILL:n.ATTRIBUTES_INFO_OUTLINE}}]),n}(h);_.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],_.ATTRIBUTES_FILL=["fill-color","fill-opacity"],_.GEOMETRY_LAYOUT=[{name:"a_pos",count:2,type:5122,offset:0,stride:8,normalized:!1,divisor:0},{name:"a_offset",count:2,type:5120,offset:4,stride:8,normalized:!1,divisor:0},{name:"a_xnormal",count:2,type:5120,offset:6,stride:8,normalized:!1,divisor:0}],_.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:10},"fill-opacity":{name:"opacity",type:1,precisionFactor:100}},_.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:10},"fill-opacity":{name:"opacity",type:1,precisionFactor:100}};var m=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e){return Object(o.a)(this,n),t.call(this,e)}return Object(s.a)(n,[{key:"geometryInfo",value:function(){return n.GEOMETRY_LAYOUT}},{key:"opacityInfo",value:function(){return null}},{key:"attributes",value:function(){return n.ATTRIBUTES}},{key:"attributesInfo",value:function(){return n.ATTRIBUTES_INFO}}]),n}(h);m.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],m.GEOMETRY_LAYOUT=[{name:"a_pos",count:2,type:5122,offset:0,stride:16,normalized:!1,divisor:0},{name:"a_extrude_offset",count:4,type:5120,offset:4,stride:16,normalized:!1,divisor:0},{name:"a_dir_normal",count:4,type:5120,offset:8,stride:16,normalized:!1,divisor:0},{name:"a_accumulatedDistance",count:2,type:5123,offset:12,stride:16,normalized:!1,divisor:0}],m.ATTRIBUTES_INFO={"line-width":{name:"width",type:1,precisionFactor:2},"line-gap-width":{name:"gap_width",type:1,precisionFactor:2},"line-offset":{name:"offset",type:0,precisionFactor:2},"line-color":{name:"color",type:10},"line-opacity":{name:"opacity",type:1,precisionFactor:100}
1,"line-blur":{name:"blur",type:1,precisionFactor:4},"line-pattern":{name:"tlbr",type:12,isOptional:!0},"line-dasharray":{name:"tlbr",type:11,isOptional:!0}};var g=[{name:"a_pos",count:2,type:5122,offset:0,stride:16,normalized:!1,divisor:0},{name:"a_vertexOffset",count:2,type:5122,offset:4,stride:16,normalized:!1,divisor:0},{name:"a_texAngleRange",count:4,type:5121,offset:8,stride:16,normalized:!1,divisor:0},{name:"a_levelInfo",count:4,type:5121,offset:12,stride:16,normalized:!1,divisor:0}],b=[{name:"a_opacityInfo",count:1,type:5121,offset:0,stride:1,normalized:!1,divisor:0}],x=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e){return Object(o.a)(this,n),t.call(this,e)}return Object(s.a)(n,[{key:"geometryInfo",value:function(){return g}},{key:"opacityInfo",value:function(){return b}},{key:"attributes",value:function(){return n.ATTRIBUTES}},{key:"attributesInfo",value:function(){return n.ATTRIBUTES_INFO}}]),n}(h);x.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],x.ATTRIBUTES_INFO={"icon-color":{name:"color",type:10},"icon-opacity":{name:"opacity",type:1,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:10},"icon-halo-width":{name:"halo_width",type:1,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:1,precisionFactor:4},"icon-size":{name:"size",type:1,precisionFactor:32,isLayout:!0}};var O=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e){return Object(o.a)(this,n),t.call(this,e)}return Object(s.a)(n,[{key:"geometryInfo",value:function(){return g}},{key:"opacityInfo",value:function(){return b}},{key:"attributes",value:function(){return n.ATTRIBUTES}},{key:"attributesInfo",value:function(){return n.ATTRIBUTES_INFO}}]),n}(h);O.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],O.ATTRIBUTES_INFO={"text-color":{name:"color",type:10},"text-opacity":{name:"opacity",type:1,precisionFactor:100},"text-halo-color":{name:"halo_color",type:10},"text-halo-width":{name:"halo_width",type:1,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:1,precisionFactor:4},"text-size":{name:"size",type:1,isLayout:!0}};var w=n(36),k=n(41),S=n(659),j=n(296),P=n(599),T={kind:"null"},C={kind:"number"},M={kind:"string"},I={kind:"boolean"},L={kind:"color"},A={kind:"object"},D={kind:"value"};function z(e,t){return{kind:"array",itemType:e,n:t}}var R=[T,C,M,I,L,A,z(D)];function E(e){if("array"===e.kind){var t=E(e.itemType);return"number"==typeof e.n?"array<".concat(t,", ").concat(e.n,">"):"value"===e.itemType.kind?"array":"array<".concat(t,">")}return e.kind}function V(e){if(null===e)return T;if("string"==typeof e)return M;if("boolean"==typeof e)return I;if("number"==typeof e)return C;if(e instanceof k.a)return L;if(Array.isArray(e)){var t,n,i=Object(a.a)(e);try{for(i.s();!(n=i.n()).done;){var r=V(n.value);if(t){if(t!==r){t=D;break}}else t=r}}catch(o){i.e(o)}finally{i.f()}return z(t||D,e.length)}return"object"==typeof e?A:D}function F(e,t){if("array"===t.kind)return"array"===e.kind&&(0===e.n&&"value"===e.itemType.kind||F(e.itemType,t.itemType))&&("number"!=typeof t.n||t.n===e.n);if("value"===t.kind){var n,i=Object(a.a)(R);try{for(i.s();!(n=i.n()).done;){if(F(e,n.value))return!0}}catch(r){i.e(r)}finally{i.f()}}return t.kind===e.kind}function U(e){if(null===e)return"";var t=typeof e;return"string"===t?e:"number"===t||"boolean"===t?String(e):e instanceof k.a?e.toString():JSON.stringify(e)}var B=function(){function e(t){Object(o.a)(this,e),this.parent=t,this.vars={}}return Object(s.a)(e,[{key:"add",value:function(e,t){this.vars[e]=t}},{key:"get",value:function(e){return this.vars[e]?this.vars[e]:this.parent?this.parent.get(e):null}}]),e}(),N=function(){function e(){Object(o.a)(this,e),this.type=D}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return null==e?void 0:e.id}}],[{key:"parse",value:function(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new e}}]),e}(),G=function(){function e(){Object(o.a)(this,e),this.type=M}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){if(!e)return null;switch(e.type){case 1:return"Point";case 2:return"LineString";case 3:return"Polygon";default:return null}}}],[{key:"parse",value:function(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new e}}]),e}(),H=function(){function e(){Object(o.a)(this,e),this.type=A}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return null==e?void 0:e.values}}],[{key:"parse",value:function(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new e}}]),e}(),W=function(){function e(){Object(o.a)(this,e),this.type=C}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return t}}],[{key:"parse",value:function(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new e}}]),e}(),q=function(){function e(t,n,i){Object(o.a)(this,e),this.lhs=t,this.rhs=n,this.compare=i,this.type=I}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return this.compare(this.lhs.evaluate(e,t),this.rhs.evaluate(e,t))}}],[{key:"parse",value:function(t,n,i){if(3!==t.length&&4!==t.length)throw new Error('"'.concat(t[0],'" expects 2 or 3 arguments'));if(4===t.length)throw new Error('"'.concat(t[0],'" collator not supported'));return new e(Ae(t[1],n),Ae(t[2],n),i)}}]),e}(),Y=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){return q.parse(e,t,(function(e,t){return e===t}))}}]),n}(q),Z=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){return q.parse(e,t,(function(e,t){return e!==t}))}}]),n}(q),X=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){return q.parse(e,t,(function(e,t){return e<t}))}}]),n}(q),K=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){return q.parse(e,t,(function(e,t){return e<=t}))}}]),n}(q),J=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){return q.parse(e,t,(function(e,t){return e>t}))}}]),n}(q),Q=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){return q.parse(e,t,(function(e,t){return e>=t}))}}]),n}(q),$=function(){function e(t){Object(o.a)(this,e),this.arg=t,this.type=I}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return!this.arg.evaluate(e,t)}}],[{key:"parse",value:function(t,n){if(2!==t.length)throw new Error('"!" expects 1 argument');return new e(Ae(t[1],n))}}]),e}(),ee=function(){function e(t){Object(o.a)(this,e),this.args=t,this.type=I}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n,i=Object(a.a)(this.args);try{for(i.s();!(n=i.n()).done;){if(!n.value.evaluate(e,t))return!1}}catch(r){i.e(r)}finally{i.f()}return!0}}],[{key:"parse",value:function(t,n){for(var i=[],r=1;r<t.length;r++)i.push(Ae(t[r],n));return new e(i)}}]),e}(),te=function(){function e(t){Object(o.a)(this,e),this.args=t,this.type=I}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n,i=Object(a.a)(this.args);try{for(i.s();!(n=i.n()).done;){if(n.value.evaluate(e,t))return!0}}catch(r){i.e(r)}finally{i.f()}return!1}}],[{key:"parse",value:function(t,n){for(var i=[],r=1;r<t.length;r++)i.push(Ae(t[r],n));return new e(i)}}]),e}(),ne=function(){function e(t){Object(o.a)(this,e),this.args=t,this.type=I}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n,i=Object(a.a)(this.args);try{for(i.s();!(n=i.n()).done;){if(n.value.evaluate(e,t))return!1}}catch(r){i.e(r)}finally{i.f()}return!0}}],[{key:"parse",value:function(t,n){for(var i=[],r=1;r<t.length;r++)i.push(Ae(t[r],n));return new e(i)}}]),e}(),ie=function(){function e(t,n,i){Object(o.a)(this,e),this.type=t,this.args=n,this.fallback=i}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n,i=Object(a.a)(this.args);try{for(i.s();!(n=i.n()).done;){var r=n.value;if(r.condition.evaluate(e,t))return r.output.evaluate(e,t)}}catch(o){i.e(o)}finally{i.f()}return this.fallback.evaluate(e,t)}}],[{key:"parse",value:function(t,n,i){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');for(var r,a=[],o=1;o<t.length-1;o+=2){var s=Ae(t[o],n),l=Ae(t[o+1],n,i);r||(r=l.type),a.push({condition:s,output:l})}var u=Ae(t[t.length-1],n,i);return r||(r=u.type),new e(r,a,u)}}]),e}(),re=function(){function e(t,n){Object(o.a)(this,e),this.type=t,this.args=n}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n,i=Object(a.a)(this.args);try{for(i.s();!(n=i.n()).done;){var r=n.value.evaluate(e,t);if(null!==r)return r}}catch(o){i.e(o)}finally{i.f()}return null}}],[{key:"parse",value:function(t,n){if(t.length<2)throw new Error('"coalesce" expects at least 1 argument');for(var i,r=[],a=1;a<t.length;a++){var o=Ae(t[a],n);i||(i=o.type),r.push(o)}return new e(i,r)}}]),e}(),ae=function(){function e(t,n,i,r,a){Object(o.a)(this,e),this.type=t,this.input=n,this.labels=i,this.outputs=r,this.fallback=a}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this.input.evaluate(e,t);return(this.outputs[this.labels[n]]||this.fallback).evaluate(e,t)}}],[{key:"parse",value:function(t,n){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');for(var i,r,o=Ae(t[1],n),s=[],l={},u=2;u<t.length-1;u+=2){var c=t[u];Array.isArray(c)||(c=[c]);var h,f=Object(a.a)(c);try{for(f.s();!(h=f.n()).done;){var v=h.value,d=typeof v;if("string"!==d&&"number"!==d)throw new Error('"match" requires string or number literal as labels');if(r){if(d!==r)throw new Error('"match" requires labels to have the same type')}else r=d;l[v]=s.length}}catch(y){f.e(y)}finally{f.f()}var p=Ae(t[u+1],n);i||(i=p.type),s.push(p)}return new e(i,o,l,s,Ae(t[t.length-1],n))}}]),e}(),oe=function(){function e(t,n,i,r,a){Object(o.a)(this,e),this.operator=t,this.type=n,this.interpolation=i,this.input=r,this.stops=a}return Object(s.a)(e,[{key:"evaluate",value:function(t,n){var i=this.stops;if(1===i.length)return i[0][1].evaluate(t,n);var r=this.input.evaluate(t,n);if(r<=i[0][0])return i[0][1].evaluate(t,n);if(r>=i[i.length-1][0])return i[i.length-1][1].evaluate(t,n);for(var a=0;++a<i.length&&!(r<i[a][0]););var o=i[a-1][0],s=i[a][0],u=e.interpolationRatio(this.interpolation,r,o,s),c=i[a-1][1].evaluate(t,n),h=i[a][1].evaluate(t,n);if("interpolate"===this.operator){if("array"===this.type.kind&&Array.isArray(c)&&Array.isArray(h))return c.map((function(e,t){return Object(P.e)(e,h[t],u)}));if("color"===this.type.kind&&c instanceof k.a&&h instanceof k.a){var f=new k.a(c),v=new k.a(h);return new k.a([Object(P.e)(f.r,v.r,u),Object(P.e)(f.g,v.g,u),Object(P.e)(f.b,v.b,u),Object(P.e)(f.a,v.a,u)])}if("number"===this.type.kind&&"number"==typeof c&&"number"==typeof h)return Object(P.e)(c,h,u);throw new Error('"'.concat(this.operator,'" cannot interpolate type ').concat(E(this.type)))}if("interpolate-hcl"===this.operator){var d=Object(S.c)(c),p=Object(S.c)(h),y=p.h-d.h,_=Object(S.d)({h:d.h+u*(y>180||y<-180?y-360*Math.round(y/360):y),c:Object(P.e)(d.c,p.c,u),l:Object(P.e)(d.l,p.l,u)});return new k.a(Object(l.a)({a:Object(P.e)(c.a,h.a,u)},_))}if("interpolate-lab"===this.operator){var m=Object(S.b)(c),g=Object(S.b)(h),b=Object(S.d)({l:Object(P.e)(m.l,g.l,u),a:Object(P.e)(m.a,g.a,u),b:Object(P.e)(m.b,g.b,u)});return new k.a(Object(l.a)({a:Object(P.e)(c.a,h.a,u)},b))}throw new Error('Unexpected operator "'.concat(this.operator,'"'))}},{key:"interpolationUniformValue",value:function(t,n){var i=this.stops;if(1===i.length)return 0;if(t>=i[i.length-1][0])return 0;for(var r=0;++r<i.length&&!(t<i[r][0]););var a=i[r-1][0],o=i[r][0];return e.interpolationRatio(this.interpolation,n,a,o)}},{key:"getInterpolationRange",value:function(e){var t=this.stops;if(1===t.length){var n=t[0][0];return[n,n]}var i=t[t.length-1][0];if(e>=i)return[i,i];for(var r=0;++r<t.length&&!(e<t[r][0]););return[t[r-1][0],t[r][0]]}}],[{key:"parse",value:function(t,n,i){var r=t[0];if(t.length<5)throw new Error('"'.concat(r,'" expects at least 4 arguments'));var a=t[1];if(!Array.isArray(a)||0===a.length)throw new Error('"'.concat(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(var o=1;o<5;o++){var s=a[o];if("number"!=typeof s||s<0||s>1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error('"'.concat(t[0],'" unknown interpolation type "').concat(a[0],'"'))}if(t.length%2!=1)throw new Error('"'.concat(r,'" expects an even number of arguments'));var l,u=Ae(t[2],n,C);"interpolate-hcl"===r||"interpolate-lab"===r?l=L:i&&"value"!==i.kind&&(l=i);for(var c=[],h=3;h<t.length;h+=2){var f=t[h];if("number"!=typeof f)throw new Error('"'.concat(r,'" requires stop input
1s as literal numbers'));if(c.length&&c[c.length-1][0]>=f)throw new Error('"'.concat(r,'" requires strictly ascending stop inputs'));var v=Ae(t[h+1],n,l);l||(l=v.type),c.push([f,v])}if(l&&l!==L&&l!==C&&("array"!==l.kind||l.itemType!==C))throw new Error('"'.concat(r,'" cannot interpolate type ').concat(E(l)));return new e(r,l,a,u,c)}},{key:"interpolationRatio",value:function(t,n,i,r){var a=0;return"linear"===t[0]?a=e.exponentialInterpolationRatio(n,1,i,r):"exponential"===t[0]?a=e.exponentialInterpolationRatio(n,t[1],i,r):"cubic-bezier"===t[0]&&(a=Object(j.c)(t[1],t[2],t[3],t[4])(e.exponentialInterpolationRatio(n,1,i,r),1e-5)),a<0?a=0:a>1&&(a=1),a}},{key:"exponentialInterpolationRatio",value:function(e,t,n,i){var r=i-n;if(0===r)return 0;var a=e-n;return 1===t?a/r:(Math.pow(t,a)-1)/(Math.pow(t,r)-1)}}]),e}(),se=function(){function e(t,n,i){Object(o.a)(this,e),this.type=t,this.input=n,this.stops=i}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this.stops;if(1===n.length)return n[0][1].evaluate(e,t);for(var i=this.input.evaluate(e,t),r=0;++r<n.length&&!(i<n[r][0]););return this.stops[r-1][1].evaluate(e,t)}}],[{key:"parse",value:function(t,n){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');var i,r=Ae(t[1],n,C),a=[];a.push([-1/0,Ae(t[2],n)]);for(var o=3;o<t.length;o+=2){var s=t[o];if("number"!=typeof s)throw new Error('"step" requires stop inputs as literal numbers');if(a.length&&a[a.length-1][0]>=s)throw new Error('"step" requires strictly ascending stop inputs');var l=Ae(t[o+1],n);i||(i=l.type),a.push([s,l])}return new e(i,r,a)}}]),e}(),le=function(){function e(t,n){Object(o.a)(this,e),this.type=t,this.output=n}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return this.output.evaluate(e,t)}}],[{key:"parse",value:function(t,n,i){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');for(var r=new B(n),a=1;a<t.length-1;a+=2){var o=t[a];if("string"!=typeof o)throw new Error('"let" requires a string to define variable names - found '.concat(o));r.add(o,Ae(t[a+1],n))}var s=Ae(t[t.length-1],r,i);return new e(s.type,s)}}]),e}(),ue=function(){function e(t,n){Object(o.a)(this,e),this.type=t,this.output=n}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return this.output.evaluate(e,t)}}],[{key:"parse",value:function(t,n,i){if(2!==t.length||"string"!=typeof t[1])throw new Error('"var" requires just one literal string argument');var r=n.get(t[1]);if(!r)throw new Error("".concat(t[1],' must be defined before being used in a "var" expression'));return new e(i||D,r)}}]),e}(),ce=function(){function e(t,n,i){Object(o.a)(this,e),this.type=t,this.index=n,this.array=i}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this.index.evaluate(e,t),i=this.array.evaluate(e,t);if(n<0||n>=i.length)throw new Error('"at" index out of bounds');if(n!==Math.floor(n))throw new Error('"at" index must be an integer');return i[n]}}],[{key:"parse",value:function(t,n){if(3!==t.length)throw new Error('"at" expects 2 arguments');var i=Ae(t[1],n,C),r=Ae(t[2],n);return new e(r.type.itemType,i,r)}}]),e}(),he=function(){function e(t,n){Object(o.a)(this,e),this.key=t,this.obj=n,this.type=D}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this.key.evaluate(e,t);return this.obj?this.obj.evaluate(e,t)[n]:null==e?void 0:e.values[n]}}],[{key:"parse",value:function(t,n){switch(t.length){case 2:return new e(Ae(t[1],n));case 3:return new e(Ae(t[1],n),Ae(t[2],n));default:throw new Error('"get" expects 1 or 2 arguments')}}}]),e}(),fe=function(){function e(t,n){Object(o.a)(this,e),this.key=t,this.obj=n,this.type=I}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this.key.evaluate(e,t);return this.obj?n in this.obj.evaluate(e,t):!(null==e||!e.values[n])}}],[{key:"parse",value:function(t,n){switch(t.length){case 2:return new e(Ae(t[1],n));case 3:return new e(Ae(t[1],n),Ae(t[2],n));default:throw new Error('"has" expects 1 or 2 arguments')}}}]),e}(),ve=function(){function e(t,n){Object(o.a)(this,e),this.key=t,this.vals=n,this.type=I}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this.key.evaluate(e,t);return-1!==this.vals.evaluate(e,t).indexOf(n)}}],[{key:"parse",value:function(t,n){if(3!==t.length)throw new Error('"in" expects 2 arguments');return new e(Ae(t[1],n),Ae(t[2],n))}}]),e}(),de=function(){function e(t,n,i){Object(o.a)(this,e),this.item=t,this.array=n,this.from=i,this.type=C}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this.item.evaluate(e,t),i=this.array.evaluate(e,t);if(this.from){var r=this.from.evaluate(e,t);if(r!==Math.floor(r))throw new Error('"index-of" index must be an integer');return i.indexOf(n,r)}return i.indexOf(n)}}],[{key:"parse",value:function(t,n){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');
1var i=Ae(t[1],n),r=Ae(t[2],n);return 4===t.length?new e(i,r,Ae(t[3],n,C)):new e(i,r)}}]),e}(),pe=function(){function e(t){Object(o.a)(this,e),this.arg=t,this.type=C}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this.arg.evaluate(e,t);if("string"==typeof n)return n.length;if(Array.isArray(n))return n.length;throw new Error('"length" expects string or array')}}],[{key:"parse",value:function(t,n){if(2!==t.length)throw new Error('"length" expects 2 arguments');return new e(Ae(t[1],n))}}]),e}(),ye=function(){function e(t,n,i,r){Object(o.a)(this,e),this.type=t,this.array=n,this.from=i,this.to=r}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this.array.evaluate(e,t);if(!Array.isArray(n)&&"string"!=typeof n)throw new Error('"slice" input must be an array or a string');var i=this.from.evaluate(e,t);if(i<0||i>=n.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){var r=this.to.evaluate(e,t);if(r<0||r>=n.length)throw new Error('"slice" index out of bounds');if(r!==Math.floor(r))throw new Error('"slice" index must be an integer');return n.slice(i,r)}return n.slice(i)}}],[{key:"parse",value:function(t,n){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');var i=Ae(t[1],n),r=Ae(t[2],n,C);if(r.type!==C)throw new Error('"slice" index must return a number');if(4===t.length){var a=Ae(t[3],n,C);if(a.type!==C)throw new Error('"slice" index must return a number');return new e(i.type,i,r,a)}return new e(i.type,i,r)}}]),e}(),_e=function(){function e(){Object(o.a)(this,e),this.type=I}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return e&&void 0!==e.id}}],[{key:"parse",value:function(t){if(1!==t.length)throw new Error('"has-id" expects no arguments');return new e}}]),e}(),me=function(){function e(t,n){Object(o.a)(this,e),this.args=t,this.calculate=n,this.type=C}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n;return this.args&&(n=this.args.map((function(n){return n.evaluate(e,t)}))),this.calculate(n)}}],[{key:"parse",value:function(t,n,i){return new e(t.slice(1).map((function(e){return Ae(e,n)})),i)}}]),e}(),ge=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){switch(e.length){case 2:return me.parse(e,t,(function(e){return-e[0]}));case 3:return me.parse(e,t,(function(e){return e[0]-e[1]}));default:throw new Error('"-" expects 1 or 2 arguments')}}}]),n}(me),be=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){return me.parse(e,t,(function(e){var t,n=1,i=Object(a.a)(e);try{for(i.s();!(t=i.n()).done;){n*=t.value}}catch(r){i.e(r)}finally{i.f()}return n}))}}]),n}(me),xe=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){if(3===e.length)return me.parse(e,t,(function(e){return e[0]/e[1]}));throw new Error('"/" expects 2 arguments')}}]),n}(me),Oe=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){if(3===e.length)return me.parse(e,t,(function(e){return e[0]%e[1]}));throw new Error('"%" expects 2 arguments')}}]),n}(me),we=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){if(3===e.length)return me.parse(e,t,(function(e){return Math.pow(e[0],e[1])}));throw new Error('"^" expects 1 or 2 arguments')}}]),n}(me),ke=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,null,[{key:"parse",value:function(e,t){return me.parse(e,t,(function(e){var t,n=0,i=Object(a.a)(e);try{for(i.s();!(t=i.n()).done;){n+=t.value}}catch(r){i.e(r)}finally{i.f()}return n}))}}]),n}(me),Se=function(){function e(t,n){Object(o.a)(this,e),this.args=t,this.calculate=n,this.type=C}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n;return this.args&&(n=this.args.map((function(n){return n.evaluate(e,t)}))),this.calculate(n)}}],[{key:"parse",value:function(t,n){return new e(t.slice(1).map((function(e){return Ae(e,n)})),e.ops[t[0]])}}]),e}();Se.ops={abs:function(e){return Math.abs(e[0])},acos:function(e){return Math.acos(e[0])},asin:function(e){return Math.asin(e[0])},atan:function(e){return Math.atan(e[0])},ceil:function(e){return Math.ceil(e[0])},cos:function(e){return Math.cos(e[0])},e:function(){return Math.E},floor:function(e){return Math.floor(e[0])},ln:function(e){return Math.log(e[0])},ln2:function(){return Math.LN2},log10:function(e){return Math.log(e[0])/Math.LN10},log2:function(e){return Math.log(e[0])/Math.LN2},max:function(e){return Math.max.apply(Math,Object(w.a)(e))},min:function(e){return Math.min.apply(Math,Object(w.a)(e))},pi:function(){return Math.PI}
1,round:function(e){return Math.round(e[0])},sin:function(e){return Math.sin(e[0])},sqrt:function(e){return Math.sqrt(e[0])},tan:function(e){return Math.tan(e[0])}};var je=function(){function e(t){Object(o.a)(this,e),this.args=t,this.type=M}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return this.args.map((function(n){return n.evaluate(e,t)})).join("")}}],[{key:"parse",value:function(t,n){return new e(t.slice(1).map((function(e){return Ae(e,n)})))}}]),e}(),Pe=function(){function e(t,n){Object(o.a)(this,e),this.arg=t,this.calculate=n,this.type=M}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return this.calculate(this.arg.evaluate(e,t))}}],[{key:"parse",value:function(t,n){if(2!==t.length)throw new Error("".concat(t[0]," expects 1 argument"));return new e(Ae(t[1],n),e.ops[t[0]])}}]),e}();Pe.ops={downcase:function(e){return e.toLowerCase()},upcase:function(e){return e.toUpperCase()}};var Te=function(){function e(t){Object(o.a)(this,e),this.args=t,this.type=L}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this._validate(this.args[0].evaluate(e,t)),i=this._validate(this.args[1].evaluate(e,t)),r=this._validate(this.args[2].evaluate(e,t));return new k.a({r:n,g:i,b:r})}},{key:"_validate",value:function(e){if("number"!=typeof e||e<0||e>255)throw new Error("".concat(e,": invalid color component"));return Math.round(e)}}],[{key:"parse",value:function(t,n){if(4!==t.length)throw new Error('"rgb" expects 3 arguments');return new e(t.slice(1).map((function(e){return Ae(e,n)})))}}]),e}(),Ce=function(){function e(t){Object(o.a)(this,e),this.args=t,this.type=L}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n=this._validate(this.args[0].evaluate(e,t)),i=this._validate(this.args[1].evaluate(e,t)),r=this._validate(this.args[2].evaluate(e,t)),a=this._validateAlpha(this.args[3].evaluate(e,t));return new k.a({r:n,g:i,b:r,a:a})}},{key:"_validate",value:function(e){if("number"!=typeof e||e<0||e>255)throw new Error("".concat(e,": invalid color component"));return Math.round(e)}},{key:"_validateAlpha",value:function(e){if("number"!=typeof e||e<0||e>1)throw new Error("".concat(e,": invalid alpha color component"));return e}}],[{key:"parse",value:function(t,n){if(5!==t.length)throw new Error('"rgba" expects 4 arguments');return new e(t.slice(1).map((function(e){return Ae(e,n)})))}}]),e}(),Me=function(){function e(t){Object(o.a)(this,e),this.color=t,this.type=z(C,4)}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return new k.a(this.color.evaluate(e,t)).toRgba()}}],[{key:"parse",value:function(t,n){if(2!==t.length)throw new Error('"to-rgba" expects 1 argument');return new e(Ae(t[1],n))}}]),e}(),Ie=function(){function e(t,n){Object(o.a)(this,e),this.type=t,this.args=n}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){var n,i,r=Object(a.a)(this.args);try{for(r.s();!(i=r.n()).done;){var o=i.value.evaluate(e,t);if(F(n=V(o),this.type))return o}}catch(s){r.e(s)}finally{r.f()}throw new Error("Expected ".concat(E(this.type)," but got ").concat(E(n)))}}],[{key:"parse",value:function(t,n){var i=t[0];if(t.length<2)throw new Error("".concat(i," expects at least one argument"));var r,a=1;if("array"===i){if(t.length>2){switch(t[1]){case"string":r=M;break;case"number":r=C;break;case"boolean":r=I;break;default:throw new Error('"array" type argument must be string, number or boolean')}a++}else r=D;var o;if(t.length>3){if(null!==(o=t[2])&&("number"!=typeof o||o<0||o!==Math.floor(o)))throw new Error('"array" length argument must be a positive integer literal');a++}r=z(r,o)}else switch(i){case"string":r=M;break;case"number":r=C;break;case"boolean":r=I;break;case"object":r=A}for(var s=[];a<t.length;a++){var l=Ae(t[a],n);s.push(l)}return new e(r,s)}}]),e}(),Le=function(){function e(t,n){Object(o.a)(this,e),this.type=t,this.args=n}return Object(s.a)(e,[{key:"evaluate",value:function(t,n){if(this.type===I)return Boolean(this.args[0].evaluate(t,n));if(this.type===M)return U(this.args[0].evaluate(t,n));if(this.type===C){var i,r=Object(a.a)(this.args);try{for(r.s();!(i=r.n()).done;){var o=i.value,s=Number(o.evaluate(t,n));if(!isNaN(s))return s}}catch(f){r.e(f)}finally{r.f()}return null}
1if(this.type===L){var l,u=Object(a.a)(this.args);try{for(u.s();!(l=u.n()).done;){var c=l.value;try{var h=e.toColor(c.evaluate(t,n));if(h instanceof k.a)return h}catch(v){}}}catch(f){u.e(f)}finally{u.f()}return null}}}],[{key:"parse",value:function(t,n){var i=t[0],r=e.types[i];if(r===I||r===M){if(2!==t.length)throw new Error("".concat(i," expects one argument"))}else if(t.length<2)throw new Error("".concat(i," expects at least one argument"));for(var a=[],o=1;o<t.length;o++){var s=Ae(t[o],n);a.push(s)}return new e(r,a)}},{key:"toBoolean",value:function(e){return Boolean(e)}},{key:"toString",value:function(e){return U(e)}},{key:"toNumber",value:function(e){var t=Number(e);if(isNaN(t))throw new Error('"'.concat(e,'" is not a number'));return t}},{key:"toColor",value:function(e){if(e instanceof k.a)return e;if("string"==typeof e){var t=k.a.fromString(e);if(t)return t;throw new Error('"'.concat(e,'" is not a color'))}if(Array.isArray(e))return k.a.fromArray(e);throw new Error('"'.concat(e,'" is not a color'))}}]),e}();function Ae(e,t,n){var i=typeof e;if("string"===i||"boolean"===i||"number"===i||null===e){if(n)switch(n.kind){case"string":"string"!==i&&(e=Le.toString(e));break;case"number":"number"!==i&&(e=Le.toNumber(e));break;case"color":e=Le.toColor(e)}e=["literal",e]}if(!Array.isArray(e)||0===e.length)throw new Error("Expression must be a non empty array");var r=e[0];if("string"!=typeof r)throw new Error("First element of expression must be a string");var a=De[r];if(void 0===a)throw new Error('Invalid expression operator "'.concat(r,'"'));if(!a)throw new Error('Unimplemented expression operator "'.concat(r,'"'));return a.parse(e,t,n)}Le.types={"to-boolean":I,"to-color":L,"to-number":C,"to-string":M};var De={array:Ie,boolean:Ie,collator:null,format:null,image:null,literal:function(){function e(t){Object(o.a)(this,e),this.val=t,this.type=V(t)}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return this.val}}],[{key:"parse",value:function(t){if(2!==t.length)throw new Error('"literal" expects 1 argument');return new e(t[1])}}]),e}(),number:Ie,"number-format":null,object:Ie,string:Ie,"to-boolean":Le,"to-color":Le,"to-number":Le,"to-string":Le,typeof:function(){function e(t){Object(o.a)(this,e),this.arg=t,this.type=M}return Object(s.a)(e,[{key:"evaluate",value:function(e,t){return E(V(this.arg.evaluate(e,t)))}}],[{key:"parse",value:function(t,n){if(2!==t.length)throw new Error('"typeof" expects 1 argument');return new e(Ae(t[1],n))}}]),e}(),accumulated:null,"feature-state":null,"geometry-type":G,id:N,"line-progress":null,properties:H,at:ce,get:he,has:fe,in:ve,"index-of":de,length:pe,slice:ye,"!":$,"!=":Z,"<":X,"<=":K,"==":Y,">":J,">=":Q,all:ee,any:te,case:ie,coalesce:re,match:ae,within:null,interpolate:oe,"interpolate-hcl":oe,"interpolate-lab":oe,step:se,let:le,var:ue,concat:je,downcase:Pe,"is-supported-script":null,"resolved-locale":null,upcase:Pe,rgb:Te,rgba:Ce,"to-rgba":Me,"-":ge,"*":be,"/":xe,"%":Oe,"^":we,"+":ke,abs:Se,acos:Se,asin:Se,atan:Se,ceil:Se,cos:Se,e:Se,floor:Se,ln:Se,ln2:Se,log10:Se,log2:Se,max:Se,min:Se,pi:Se,round:Se,sin:Se,sqrt:Se,tan:Se,zoom:W,"heatmap-density":null,"has-id":_e,none:ne},ze=function(){function e(t){Object(o.a)(this,e),this._expression=t}return Object(s.a)(e,[{key:"filter",value:function(e,t){if(!this._expression)return!0;try{return this._expression.evaluate(e,t)}catch(n){return console.log(n.message),!0}}}],[{key:"createFilter",value:function(t){if(!t)return null;this.isLegacyFilter(t)&&(t=this.convertLegacyFilter(t));try{var n;return new e(Ae(t,null,I))}catch(n){return console.log(n.message),null}}},{key:"isLegacyFilter",value:function(e){if(!Array.isArray(e))return!0;if(0===e.length)return!0;switch(e[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return 3===e.length&&"string"==typeof e[1]&&!Array.isArray(e[2]);case"in":return e.length>=3&&"string"==typeof e[1]&&!Array.isArray(e[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(var t=1;t<e.length;t++)if(!this.isLegacyFilter(e[1]))return!1;return!0;case"has":return 2===e.length&&("$id"===e[1]||"$type"===e[1]);default:return!1}}},{key:"convertLegacyFilter",value:function(t){if(!Array.isArray(t)||0===t.length)return!0;var n=t[0];if(1===t.length)return"any"!==n;switch(n){case"==":return e.convertComparison("==",t[1],t[2]);case"!=":return e.negate(e.convertComparison("==",t[1],t[2]));case">":case"<":case">=":case"<=":return e.convertComparison(n,t[1],t[2]);case"in":return e.convertIn(t[1],t.slice(2));case"!in":return e.negate(e.convertIn(t[1],t.slice(2)));
1case"any":case"all":case"none":return e.convertCombining(n,t.slice(1));case"has":return e.convertHas(t[1]);case"!has":return e.negate(e.convertHas(t[1]));default:throw new Error("Unexpected legacy filter.")}}},{key:"convertComparison",value:function(e,t,n){switch(t){case"$type":return[e,["geometry-type"],n];case"$id":return[e,["id"],n];default:return[e,["get",t],n]}}},{key:"convertIn",value:function(e,t){switch(e){case"$type":return["in",["geometry-type"],["literal",t]];case"$id":return["in",["id"],["literal",t]];default:return["in",["get",e],["literal",t]]}}},{key:"convertHas",value:function(e){switch(e){case"$type":return!0;case"$id":return["has-id"];default:return["has",e]}}},{key:"convertCombining",value:function(e,t){return[e].concat(t.map(this.convertLegacyFilter))}},{key:"negate",value:function(e){return["!",e]}}]),e}(),Re=Object(s.a)((function e(){Object(o.a)(this,e)}));Re.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:0}},Re.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:0}},Re.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}},Re.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]}},Re.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:0}},Re.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}},Re.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}}
1,Re.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}},Re.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}},Re.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}},Re.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 Ee=function(){function e(t,n){var i;switch(Object(o.a)(this,e),this.isDataDriven=!1,this.interpolator=null,t.type){case"number":case"color":i=!0;break;case"array":i="number"===t.value;break;default:i=!1}if(null==n&&(n=t.default),Array.isArray(n)&&n.length>0&&De[n[0]]){var r={number:C,color:L,string:M,boolean:I,enum:M};try{var s=Ae(n,null,"array"===t.type?z(r[t.value]||D,t.length):r[t.type]);this.getValue=this._buildExpression(s,t),this.isDataDriven=!0,s instanceof oe&&s.input instanceof W&&(this.interpolator=s)}catch(f){console.log(f.message),this.getValue=this._buildSimple(t.default)}}else{i&&"interval"===n.type&&(i=!1);var l=n&&n.stops&&n.stops.length>0;if(l){var u,c=Object(a.a)(n.stops);try{for(c.s();!(u=c.n()).done;){var h=u.value;h[1]=this._validate(h[1],t)}}catch(v){c.e(v)}finally{c.f()}}if(this.isDataDriven=!!n&&!!n.property,this.isDataDriven)if(void 0!==n.default&&(n.default=this._validate(n.default,t)),l)switch(n.type){case"identity":this.getValue=this._buildIdentity(n,t);break;case"categorical":this.getValue=this._buildCategorical(n,t);break;default:this.getValue=i?this._buildInterpolate(n,t):this._buildInterval(n,t)}else this.getValue=this._buildIdentity(n,t);else l?this.getValue=i?this._buildZoomInterpolate(n):this._buildZoomInterval(n):(n=this._validate(n,t),this.getValue=this._buildSimple(n))}}return Object(s.a)(e,[{key:"_validate",value:function(t,n){if("number"===n.type){if(t<n.minimum)return n.minimum;if(t>n.maximum)return n.maximum}else"color"===n.type?t=e._parseColor(t):"enum"===n.type?"string"==typeof t&&(t=n.values.indexOf(t)):"array"===n.type&&"enum"===n.value?t=t.map((function(e){return"string"==typeof e?n.values.indexOf(e):e})):"string"===n.type&&(t=U(t));return t}},{key:"_buildSimple",value:function(e){return function(){return e}}},{key:"_buildExpression",value:function(e,t){var n=this;return function(i,r){try{var a=e.evaluate(r,i);return void 0===a?t.default:n._validate(a,t)}catch(o){return console.log(o.message),t.default}}}},{key:"_buildIdentity",value:function(e,t){var n=this;return function(i,r){var a;return r&&(a=r.values[e.property]),void 0!==a&&(a=n._validate(a,t)),null!=a?a:void 0!==e.default?e.default:t.default}}},{key:"_buildCategorical",value:function(e,t){var n=this;return function(i,r){var a;return r&&(a=r.values[e.property]),void 0!==(a=n._categorical(a,e.stops))?a:void 0!==e.default?e.default:t.default}}},{key:"_buildInterval",value:function(e,t){var n=this;return function(i,r){var a;return r&&(a=r.values[e.property]),"number"==typeof a?n._interval(a,e.stops):void 0!==e.default?e.default:t.default}}},{key:"_buildInterpolate",value:function(e,t){var n=this;return function(i,r){var a;return r&&(a=r.values[e.property]),"number"==typeof a?n._interpolate(a,e.stops,e.base||1):void 0!==e.default?e.default:t.default}}},{key:"_buildZoomInterpolate",value:function(e){var t=this;return function(n){return t._interpolate(n,e.stops,e.base||1)}}},{key:"_buildZoomInterval",value:function(e){var t=this;return function(n){return t._interval(n,e.stops)}}},{key:"_categorical",value:function(e,t){for(var n=t.length,i=0;i<n;i++)if(t[i][0]===e)return t[i][1]}},{key:"_interval",value:function(e,t){for(var n=t.length,i=0,r=0;r<n&&t[r][0]<=e;r++)i=r;return t[i][1]}},{key:"_interpolate",value:function(e,t,n){for(var i,r,a=t.length,o=0;o<a;o++){var s=t[o];if(!(s[0]<=e)){r=s;break}i=s}if(i&&r){var l=r[0]-i[0],u=e-i[0],c=1===n?u/l:(Math.pow(n,u)-1)/(Math.pow(n,l)-1);if(Array.isArray(i[1])){for(var h=i[1],f=r[1],v=[],d=0;d<h.length;d++)v.push(Object(P.e)(h[d],f[d],c));return v}return Object(P.e)(i[1],r[1],c)}return i?i[1]:r?r[1]:void 0}}],[{key:"_isEmpty",value:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}},{key:"_parseColor",value:function(e){return Array.isArray(e)?e:("string"==typeof e&&(e=new k.a(e)),e instanceof k.a&&!this._isEmpty(e)?k.a.toUnitRGBA(e):void 0)}}]),e}(),Ve=n(531),Fe=function(){function e(t,n,i,r){switch(Object(o.a)(this,e),this.type=t,this.typeName=n.type,this.id=n.id,this.source=n.source,this.sourceLayer=n["source-layer"],this.minzoom=n.minzoom,this.maxzoom=n.maxzoom,this.filter=n.filter,this.layout=n.layout,this.paint=n.paint,this.z=i,this.uid=r,t){case 0:this._layoutDefinition=Re.backgroundLayoutDefinition,this._paintDefinition=Re.backgroundPaintDefinition;break;case 1:this._layoutDefinition=Re.fillLayoutDefinition,this._paintDefinition=Re.fillPaintDefinition;break;case 2:this._layoutDefinition=Re.lineLayoutDefinition,this._paintDefinition=Re.linePaintDefinition;break;case 3:this._layoutDefinition=Re.symbolLayoutDefinition,this._paintDefinition=Re.symbolPaintDefinition;break;case 4:this._layoutDefinition=Re.circleLayoutDefinition,this._paintDefinition=Re.circlePaintDefinition}this._layoutProperties=this._parseLayout(this.layout),this._paintProperties=this._parsePaint(this.paint)}return Object(s.a)(e,[{key:"getFeatureFilter",value:function(){return void 0!==this._featureFilter?this._featureFilter:this._featureFilter=ze.createFilter(this.filter)}},{key:"getLayoutProperty",value:function(e){return this._layoutProperties[e]}},{key:"getPaintProperty",value:function(e){return this._paintProperties[e]}},{key:"getLayoutValue",value:function(e,t,n){var i,r=this._layoutProperties[e];return r&&(i=r.getValue(t,n)),void 0===i&&(i=this._layoutDefinition[e].default),i}},{key:"getPaintValue",value:function(e,t,n){var i,r=this._paintProperties[e];return r&&(i=r.getValue(t,n)),void 0===i&&(i=this._paintDefinition[e].default),i}},{key:"isPainterDataDriven",value:function(){var e=this._paintProperties;if(e)for(var t in e)if(e[t].isDataDriven)return!0;return!1}},{key:"_parseLayout",value:function(e){var t={};for(var n in e){var i=this._layoutDefinition[n];i&&(t[n]=new Ee(i,e[n]))}return t}},{key:"_parsePaint",value:function(e){var t={};for(var n in e){var i=this._paintDefinition[n];i&&(t[n]=new Ee(i,e[n]))}return t}},{key:"computeAttributesKey",value:function(e,t,n,i){var r,o=0,s=0,l=Object(a.a)(t);try{for(l.s();!(r=l.n()).done;){var u=r.value,c=3;if(!u||u!==i){var h=n[u],f=h.isLayout,v=h.isOptional,d=f?this.getLayoutProperty(u):this.getPaintProperty(u);c=null!=d&&d.interpolator?2:null!=d&&d.isDataDriven?1:v&&!d?3:0}s|=c<<o,o+=2}}catch(p){l.e(p)}finally{l.f()}return s<<3|e}}]),e}(),Ue=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e,i,r,a){var s;return Object(o.a)(this,n),(s=t.call(this,e,i,r,a)).backgroundMaterial=new d(s.computeAttributesKey(0,d.ATTRIBUTES,d.ATTRIBUTES_INFO)),s}return Object(s.a)(n)}(Fe),Be=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e,i,r,a){var s;Object(o.a)(this,n);var l=(s=t.call(this,e,i,r,a)).getPaintProperty("fill-color"),u=s.getPaintProperty("fill-opacity"),c=s.getPaintProperty("fill-pattern");s.hasDataDrivenColor=null==l?void 0:l.isDataDriven,s.hasDataDrivenOpacity=null==u?void 0:u.isDataDriven,s.hasDataDrivenFill=s.hasDataDrivenColor||s.hasDataDrivenOpacity||(null==c?void 0:c.isDataDriven);var h=s.getPaintProperty("fill-outline-color");return s.outlineUsesFillColor=!h,s.hasDataDrivenOutlineColor=null==h?void 0:h.isDataDriven,s.hasDataDrivenOutline=h?h.isDataDriven:!!l&&l.isDataDriven,s.hasDataDrivenOutline=(
1h?s.hasDataDrivenOutlineColor:s.hasDataDrivenColor)||s.hasDataDrivenOpacity,s.fillMaterial=new y(s.computeAttributesKey(1,y.ATTRIBUTES,y.ATTRIBUTES_INFO)),s.outlineMaterial=new _(s.computeAttributesKey(2,s.outlineUsesFillColor?_.ATTRIBUTES_FILL:_.ATTRIBUTES_OUTLINE,s.outlineUsesFillColor?_.ATTRIBUTES_INFO_FILL:_.ATTRIBUTES_INFO_OUTLINE),s.outlineUsesFillColor),s}return Object(s.a)(n)}(Fe),Ne=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e,i,r,a){var s,l,u,c,h,f,v,d,p,y;Object(o.a)(this,n);var _=(s=t.call(this,e,i,r,a)).getPaintProperty("line-pattern");if(s.lineMaterial=new m(s.computeAttributesKey(3,m.ATTRIBUTES,m.ATTRIBUTES_INFO,_?"line-dasharray":"")),s.hasDataDrivenLine=(null==(l=s.getPaintProperty("line-blur"))?void 0:l.isDataDriven)||(null==(u=s.getPaintProperty("line-color"))?void 0:u.isDataDriven)||(null==(c=s.getPaintProperty("line-gap-width"))?void 0:c.isDataDriven)||(null==(h=s.getPaintProperty("line-offset"))?void 0:h.isDataDriven)||(null==(f=s.getPaintProperty("line-opacity"))?void 0:f.isDataDriven)||(null==(v=s.getPaintProperty("line-pattern"))?void 0:v.isDataDriven)||(null==(d=s.getPaintProperty("line-dasharray"))?void 0:d.isDataDriven)||(null==(p=s.getLayoutProperty("line-cap"))?void 0:p.isDataDriven)||(null==(y=s.getPaintProperty("line-width"))?void 0:y.isDataDriven),s.canUseThinTessellation=!1,!s.hasDataDrivenLine){var g=s.getPaintProperty("line-width");if(!g||"number"==typeof g&&.5*g<Ve.K){var b=s.getPaintProperty("line-offset");(!b||"number"==typeof b&&0===b)&&(s.canUseThinTessellation=!0)}}return s}return Object(s.a)(n,[{key:"getDashKey",value:function(e,t){var n;switch(t){case 0:default:n="Butt";break;case 1:n="Round";break;case 2:n="Square"}return"dasharray-[".concat(e.toString(),"]-").concat(n)}}]),n}(Fe),Ge=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e,i,r,a){var s,l,u,c,h,f,v,d,p,y,_,m,g;return Object(o.a)(this,n),(s=t.call(this,e,i,r,a)).iconMaterial=new x(s.computeAttributesKey(4,x.ATTRIBUTES,x.ATTRIBUTES_INFO)),s.textMaterial=new O(s.computeAttributesKey(6,O.ATTRIBUTES,O.ATTRIBUTES_INFO)),s.hasDataDrivenIcon=(null==(l=s.getPaintProperty("icon-color"))?void 0:l.isDataDriven)||(null==(u=s.getPaintProperty("icon-halo-blur"))?void 0:u.isDataDriven)||(null==(c=s.getPaintProperty("icon-halo-color"))?void 0:c.isDataDriven)||(null==(h=s.getPaintProperty("icon-halo-width"))?void 0:h.isDataDriven)||(null==(f=s.getPaintProperty("icon-opacity"))?void 0:f.isDataDriven)||(null==(v=s.getLayoutProperty("icon-size"))?void 0:v.isDataDriven),s.hasDataDrivenText=(null==(d=s.getPaintProperty("text-color"))?void 0:d.isDataDriven)||(null==(p=s.getPaintProperty("text-halo-blur"))?void 0:p.isDataDriven)||(null==(y=s.getPaintProperty("text-halo-color"))?void 0:y.isDataDriven)||(null==(_=s.getPaintProperty("text-halo-width"))?void 0:_.isDataDriven)||(null==(m=s.getPaintProperty("text-opacity"))?void 0:m.isDataDriven)||(null==(g=s.getLayoutProperty("text-size"))?void 0:g.isDataDriven),s}return Object(s.a)(n)}(Fe),He=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(e,i,r,a){var s;return Object(o.a)(this,n),(s=t.call(this,e,i,r,a)).circleMaterial=new p(s.computeAttributesKey(5,p.ATTRIBUTES,p.ATTRIBUTES_INFO)),s}return Object(s.a)(n)}(Fe),We=function(){function e(t,n,i){var r,a,s,l,u,c;Object(o.a)(this,e),this.allowOverlap=t.getLayoutValue("icon-allow-overlap",n),this.ignorePlacement=t.getLayoutValue("icon-ignore-placement",n),this.keepUpright=t.getLayoutValue("icon-keep-upright",n),this.optional=t.getLayoutValue("icon-optional",n),this.rotationAlignment=t.getLayoutValue("icon-rotation-alignment",n),2===this.rotationAlignment&&(this.rotationAlignment=i?0:1),null!=(r=c=t.getLayoutProperty("icon-anchor"))&&r.isDataDriven?this._anchorProp=c:this.anchor=t.getLayoutValue("icon-anchor",n),null!=(a=c=t.getLayoutProperty("icon-offset"))&&a.isDataDriven?this._offsetProp=c:this.offset=t.getLayoutValue("icon-offset",n),null!=(s=c=t.getLayoutProperty("icon-padding"))&&s.isDataDriven?this._paddingProp=c:this.padding=t.getLayoutValue("icon-padding",n),null!=(l=c=t.getLayoutProperty("icon-rotate"))&&l.isDataDriven?this._rotateProp=c:this.rotate=t.getLayoutValue("icon-rotate",n),null!=(u=c=t.getLayoutProperty("icon-size"))&&u.isDataDriven?this._sizeProp=c:this.size=t.getLayoutValue("icon-size",n)}return Object(s.a)(e,[{key:"update",value:function(e,t){this._anchorProp&&(this.anchor=this._anchorProp.getValue(e,t)),this._offsetProp&&
1(this.offset=this._offsetProp.getValue(e,t)),this._paddingProp&&(this.padding=this._paddingProp.getValue(e,t)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(e,t)),this._sizeProp&&(this.size=this._sizeProp.getValue(e,t))}}]),e}(),qe=function(){function e(t,n,i){var r,a,s,l,u,c,h,f,v,d,p,y;Object(o.a)(this,e),this.allowOverlap=t.getLayoutValue("text-allow-overlap",n),this.ignorePlacement=t.getLayoutValue("text-ignore-placement",n),this.keepUpright=t.getLayoutValue("text-keep-upright",n),this.optional=t.getLayoutValue("text-optional",n),this.rotationAlignment=t.getLayoutValue("text-rotation-alignment",n),2===this.rotationAlignment&&(this.rotationAlignment=i?0:1),null!=(r=y=t.getLayoutProperty("text-anchor"))&&r.isDataDriven?this._anchorProp=y:this.anchor=t.getLayoutValue("text-anchor",n),null!=(a=y=t.getLayoutProperty("text-justify"))&&a.isDataDriven?this._justifyProp=y:this.justify=t.getLayoutValue("text-justify",n),null!=(s=y=t.getLayoutProperty("text-letter-spacing"))&&s.isDataDriven?this._letterSpacingProp=y:this.letterSpacing=t.getLayoutValue("text-letter-spacing",n),null!=(l=y=t.getLayoutProperty("text-line-height"))&&l.isDataDriven?this._lineHeightProp=y:this.lineHeight=t.getLayoutValue("text-line-height",n),null!=(u=y=t.getLayoutProperty("text-max-angle"))&&u.isDataDriven?this._maxAngleProp=y:this.maxAngle=t.getLayoutValue("text-max-angle",n),null!=(c=y=t.getLayoutProperty("text-max-width"))&&c.isDataDriven?this._maxWidthProp=y:this.maxWidth=t.getLayoutValue("text-max-width",n),null!=(h=y=t.getLayoutProperty("text-offset"))&&h.isDataDriven?this._offsetProp=y:this.offset=t.getLayoutValue("text-offset",n),null!=(f=y=t.getLayoutProperty("text-padding"))&&f.isDataDriven?this._paddingProp=y:this.padding=t.getLayoutValue("text-padding",n),null!=(v=y=t.getLayoutProperty("text-rotate"))&&v.isDataDriven?this._rotateProp=y:this.rotate=t.getLayoutValue("text-rotate",n),null!=(d=y=t.getLayoutProperty("text-size"))&&d.isDataDriven?this._sizeProp=y:this.size=t.getLayoutValue("text-size",n),null!=(p=y=t.getLayoutProperty("text-writing-mode"))&&p.isDataDriven?this._writingModeProp=y:this.writingMode=t.getLayoutValue("text-writing-mode",n)}return Object(s.a)(e,[{key:"update",value:function(e,t){this._anchorProp&&(this.anchor=this._anchorProp.getValue(e,t)),this._justifyProp&&(this.justify=this._justifyProp.getValue(e,t)),this._letterSpacingProp&&(this.letterSpacing=this._letterSpacingProp.getValue(e,t)),this._lineHeightProp&&(this.lineHeight=this._lineHeightProp.getValue(e,t)),this._maxAngleProp&&(this.maxAngle=this._maxAngleProp.getValue(e,t)),this._maxWidthProp&&(this.maxWidth=this._maxWidthProp.getValue(e,t)),this._offsetProp&&(this.offset=this._offsetProp.getValue(e,t)),this._paddingProp&&(this.padding=this._paddingProp.getValue(e,t)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(e,t)),this._sizeProp&&(this.size=this._sizeProp.getValue(e,t)),this._writingModeProp&&(this.writingMode=this._writingModeProp.getValue(e,t))}}]),e}()},975:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return Ge}));var i=n(36),r=n(23),a=n(11),o=n(13),s=n(3),l=n(2),u=n(43),c=n(39),h=n(4),f=n(5),v=n(8),d=n.n(v),p=n(0),y=n(70),_=n(14),m=n(18),g=n(21),b=n(7),x=n(22),O=n(28),w=n(1),k=(n(10),n(6)),S=n(404),j=n(138),P=n(9),T=n(49),C=n(12),M=n(26),I=n(317),L=n(538),A=(n(541),n(543),n(542),n(544),n(539)),D=n(537),z=n(598),R=function(){function e(t,n){Object(s.a)(this,e),this._width=0,this._height=0,this._free=[],this._width=t,this._height=n,this._free.push(new z.a(0,0,t,n))}return Object(l.a)(e,[{key:"width",get:function(){return this._width}},{key:"height",get:function(){return this._height}},{key:"allocate",value:function(e,t){if(e>this._width||t>this._height)return new z.a;for(var n=null,i=-1,r=0;r<this._free.length;++r){var a=this._free[r];e<=a.width&&t<=a.height&&(null===n||a.y<=n.y&&a.x<=n.x)&&(n=a,i=r)}return null===n?new z.a:(this._free.splice(i,1),n.width<n.height?(n.width>e&&this._free.push(new z.a(n.x+e,n.y,n.width-e,t)),n.height>t&&this._free.push(new z.a(n.x,n.y+t,n.width,n.height-t))):(n.width>e&&this._free.push(new z.a(n.x+e,n.y,n.width-e,n.height)),n.height>t&&this._free.push(new z.a(n.x,n.y+t,e,n.height-t))),new z.a(n.x,n.y,e,t))}},{key:"release",value:function(e){for(var t=0;t<this._free.length;++t){var n=this._free[t];if(n.y===e.y&&n.height===e.height&&n.x+n.width===e.x)n.width+=e.width;else if(n.x===e.x&&n.width===e.width&&n.y+n.height===e.y)n.height+=e.height;else if(e.y===n.y&&e.height===n.height&&e.x+e.width===n.x)n.x=e.x,n.width+=e.width;else{if(e.x!==n.x||e.width!==n.width||e.y+e.height!==n.y)continue;n.y=e.y,n.height+=e.height}this._free.splice(t,1),this.release(e)}this._free.push(e)}}]),e}(),E=function(){function e(t,n,i){Object(s.a)(this,e),this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphIndex={},this._textures=[],this._rangePromises=new Map,this.width=t,this.height=n,this._glyphSource=i,this._binPack=new R(t-4,n-4),this._glyphData.push(new Uint8Array(t*n)),this._dirties.push(!0),this._textures.push(void 0)}return Object(l.a)(e,[{key:"getGlyphItems",value:function(e,t){var n,i=this,r=[],o=this._glyphSource,s=new Set,l=Object(a.a)(t);try{for(l.s();!(n=l.n()).done;){var u=n.value,c=Math.floor(.00390625*u);s.add(c)}}catch(f){l.e(f)}finally{l.f()}var h=[];
1return s.forEach((function(t){if(t<=256){var n=e+t;if(i._rangePromises.has(n))h.push(i._rangePromises.get(n));else{var r=o.getRange(e,t).then((function(){i._rangePromises.delete(n)}),(function(){i._rangePromises.delete(n)}));i._rangePromises.set(n,r),h.push(r)}}})),Promise.all(h).then((function(){var n=i._glyphIndex[e];n||(n={},i._glyphIndex[e]=n);var s,l=Object(a.a)(t);try{for(l.s();!(s=l.n()).done;){var u=s.value,c=n[u];if(c)r[u]={sdf:!0,rect:c.rect,metrics:c.metrics,page:c.page,code:u};else{var h=o.getGlyph(e,u);if(h&&h.metrics){var v=h.metrics,d=void 0;if(0===v.width)d=new z.a(0,0,0,0);else{var p=v.width+6,y=v.height+6,_=p%4?4-p%4:4,m=y%4?4-y%4:4;1===_&&(_=5),1===m&&(m=5),(d=i._binPack.allocate(p+_,y+m)).isEmpty&&(i._dirties[i._currentPage]||(i._glyphData[i._currentPage]=null),i._currentPage=i._glyphData.length,i._glyphData.push(new Uint8Array(i.width*i.height)),i._dirties.push(!0),i._textures.push(void 0),i._binPack=new R(i.width-4,i.height-4),d=i._binPack.allocate(p+_,y+m));var g=i._glyphData[i._currentPage],b=h.bitmap,x=void 0,O=void 0;if(b)for(var w=0;w<y;w++){x=p*w,O=i.width*(d.y+w+1)+d.x;for(var k=0;k<p;k++)g[O+k+1]=b[x+k]}}n[u]={rect:d,metrics:v,tileIDs:null,page:i._currentPage},r[u]={sdf:!0,rect:d,metrics:v,page:i._currentPage,code:u},i._dirties[i._currentPage]=!0}}}}catch(f){l.e(f)}finally{l.f()}return r}))}},{key:"removeGlyphs",value:function(e){for(var t in this._glyphIndex){var n=this._glyphIndex[t];if(n){var i=void 0;for(var r in n)if((i=n[r]).tileIDs.delete(e),0===i.tileIDs.size){for(var a=this._glyphData[i.page],o=i.rect,s=void 0,l=void 0,u=0;u<o.height;u++)for(s=this.width*(o.y+u)+o.x,l=0;l<o.width;l++)a[s+l]=0;delete n[r],this._dirties[i.page]=!0}}}}},{key:"bind",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this._textures[n]||(this._textures[n]=new A.a(e,{pixelFormat:6406,dataType:5121,width:this.width,height:this.height},new Uint8Array(this.width*this.height)));var r=this._textures[n];r.setSamplingMode(t),this._dirties[n]&&r.setData(this._glyphData[n]),e.bindTexture(r,i),this._dirties[n]=!1}},{key:"dispose",value:function(){this._binPack=null;var e,t=Object(a.a)(this._textures);try{for(t.s();!(e=t.n()).done;){var n=e.value;n&&n.dispose()}}catch(i){t.e(i)}finally{t.f()}this._textures.length=0}}]),e}(),V=n(419),F=function(){function e(t){if(Object(s.a)(this,e),this._metrics=[],this._bitmaps=[],t)for(;t.next();)if(1===t.tag()){for(var n=t.getMessage();n.next();)if(3===n.tag()){for(var i=n.getMessage(),r=void 0,a=void 0,o=void 0,l=void 0,u=void 0,c=void 0,h=void 0;i.next();)switch(i.tag()){case 1:r=i.getUInt32();break;case 2:a=i.getBytes();break;case 3:o=i.getUInt32();break;case 4:l=i.getUInt32();break;case 5:u=i.getSInt32();break;case 6:c=i.getSInt32();break;case 7:h=i.getUInt32();break;default:i.skip()}i.release(),r&&(this._metrics[r]={width:o,height:l,left:u,top:c,advance:h},this._bitmaps[r]=a)}else n.skip();n.release()}else t.skip()}return Object(l.a)(e,[{key:"getMetrics",value:function(e){return this._metrics[e]}},{key:"getBitmap",value:function(e){return this._bitmaps[e]}}]),e}(),U=function(){function e(){Object(s.a)(this,e),this._ranges=[]}return Object(l.a)(e,[{key:"getRange",value:function(e){return this._ranges[e]}},{key:"addRange",value:function(e,t){this._ranges[e]=t}}]),e}(),B=function(){function e(t){Object(s.a)(this,e),this._glyphInfo={},this._baseURL=t}return Object(l.a)(e,[{key:"getRange",value:function(e,t){var n=this._getFontStack(e);if(n.getRange(t))return Promise.resolve();var i=256*t,r=i+255,a=this._baseURL.replace("{fontstack}",e).replace("{range}",i+"-"+r);return Object(T.default)(a,{responseType:"array-buffer"}).then((function(e){n.addRange(t,new F(new V.a(new Uint8Array(e.data),new DataView(e.data))))})).catch((function(){n.addRange(t,new F)}))}},{key:"getGlyph",value:function(e,t){var n=this._getFontStack(e);if(n){var i=Math.floor(t/256);if(!(i>256)){var r=n.getRange(i);return r?{metrics:r.getMetrics(t),bitmap:r.getBitmap(t)}:void 0}}}},{key:"_getFontStack",value:function(e){var t=this._glyphInfo[e];return t||(t=this._glyphInfo[e]=new U),t}}]),e}(),N=n(562),G="dasharray-",H=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(s.a)(this,e),this._size=[],this._mosaicsData=[],this._textures=[],this._dirties=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects={},this.pixelRatio=1,(t<=0||n<=0)&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=t,this._pageHeight=n,i>0&&(this._maxItemSize=i),this._binPack=new R(t-4,n-4)}return Object(l.a)(e,[{key:"dispose",value:function(){this._binPack=null,this._mosaicRects={};var e,t=Object(a.a)(this._textures);try{for(t.s();!(e=t.n()).done;){var n=e.value;n&&n.dispose()}}catch(i){t.e(i)}finally{t.f()}this._textures.length=0}},{key:"getWidth",value:function(e){return e>=this._size.length?-1:this._size[e][0]}},{key:"getHeight",value:function(e){return e>=this._size.length?-1:this._size[e][1]}},{key:"getPageSize",value:function(e){return e>=this._size.length?null:this._size[e]}},{key:"setSpriteSource",value:function(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,0===this._mosaicsData.length){this._binPack=new R(this._pageWidth-4,this._pageHeight-4);var t=Math.floor(this._pageWidth),n=Math.floor(this._pageHeight),i=new Uint32Array(t*n);this._mosaicsData[0]=i,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}},{key:"getSpriteItem",value:function(e){var t,n,i,a,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=this._mosaicRects[e];if(s)return s;if(!this._sprites||"loaded"!==this._sprites.loadStatus)return null;if(e&&e.startsWith(G)?(t=this._rasterizeDash(e),i=(n=Object(r.a)(t,2))[0],a=n[1],o=!0):i=this._sprites.getSpriteInfo(e),!i||!i.width||!i.height||i.width<0||i.height<0)return null;var l=i.width,u=i.height,c=this._allocateImage(l,u),h=Object(r.a)(c,3),f=h[0],v=h[1],d=h[2];return f.width<=0?null:(this._copy(f,i,v,d,o,a),s={rect:f,width:l,height:u,sdf:i.sdf,simplePattern:!1,pixelRatio:i.pixelRatio,page:v},this._mosaicRects[e]=s,s)}},{key:"getSpriteItems",value:function(e){var t,n={},i=Object(a.a)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;n[r.name]=this.getSpriteItem(r.name,r.repeat)}}catch(o){i.e(o)}finally{i.f()}return n}},{key:"getMosaicItemPosition",value:function(e,t){var n=this.getSpriteItem(e,t),i=n&&n.rect;if(!i)return null;i.width=n.width,i.height=n.height;var r=n.width,a=n.height;return{tl:[i.x+2,i.y+2],br:[i.x+2+r,i.y+2+a],page:n.page}}},{key:"bind",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this._textures[n]||(this._textures[n]=new A.a(e,{pixelFormat:6408,dataType:5121,wrapMode:33071,width:this._size[n][0],height:this._size[n][1]},new Uint8Array(this._mosaicsData[n].buffer)));var r=this._textures[n];r.setSamplingMode(t),this._dirties[n]&&r.setData(new Uint8Array(this._mosaicsData[n].buffer)),e.bindTexture(r,i),this._dirties[n]=!1}},{key:"_copy",value:function(t,n,i,r,a,o){if(this._sprites&&"loaded"===this._sprites.loadStatus&&!(i>=this._mosaicsData.length)){var s=new Uint32Array(o?o.buffer:this._sprites.image.buffer),l=this._mosaicsData[i];l&&s||console.error("Source or target images are uninitialized!");var u=o?n.width:this._sprites.width;e._copyBits(s,u,n.x,n.y,l,r[0],t.x+2,t.y+2,n.width,n.height,a),this._dirties[i]=!0}}},{key:"_allocateImage",value:function(e,t){e+=2,t+=2;var n=Math.max(e,t);if(this._maxItemSize&&this._maxItemSize<n){var i=new z.a(0,0,e,t);return this._mosaicsData.push(new Uint32Array(e*t)),this._dirties.push(!0),this._size.push([e,t]),this._textures.push(void 0),[i,this._mosaicsData.length-1,[e,t]]}var r=e%4?4-e%4:4,a=t%4?4-t%4:4;1===r&&(r=5),1===a&&(a=5);var o=this._binPack.allocate(e+r,t+a);return o.width<=0?(this._dirties[this._currentPage]||(this._mosaicsData[this._currentPage]=null),this._currentPage=this._mosaicsData.length,this._mosaicsData.push(new Uint32Array(this._pageWidth*this._pageHeight)),this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0),this._binPack=new R(this._pageWidth-4,this._pageHeight-4),this._allocateImage(e,t)):[o,this._currentPage,[this._pageWidth,this._pageHeight]]}},{key:"_rasterizeDash",value:function(e){var t=e.match(/\[(.*?)\]/);if(!t)return null;var n=t[1].split(",").map(Number),i=e.slice(e.lastIndexOf("-")+1),a=N.d.rasterizeDash(n,i),o=Object(r.a)(a,3),s=o[0];return[{x:0,y:0,width:o[1],height:o[2],sdf:!0,pixelRatio:1},new Uint8Array(s.buffer)]}}],[{key:"_copyBits",value:function(e,t,n,i,r,a,o,s,l,u,c){var h=i*t+n,f=s*a+o;if(c){f-=a;for(var v=-1;v<=u;h=((++v+u)%u+i)*t+n,f+=a)for(var d=-1;d<=l;d++)r[f+d]=e[h+(d+l)%l]}else for(var p=0;p<u;p++){for(var y=0;y<l;y++)r[f+y]=e[h+y];h+=t,f+=a}}}]),e}();function W(e,t,n,i,r,a){e.fillStyle=t,e.fillRect(n,i,r,a)}
1function q(e,t,n,i,r,a){e.strokeStyle=t,e.strokeRect(n,i,r,a)}function Y(e,t){for(var n=window.COLLISION_XRAY,i=0;i<t.length;++i){var r=!t[i].unique.show;if(n||!r){var o,s=Object(a.a)(t[i].colliders);try{for(s.s();!(o=s.n()).done;){var l=o.value;if(l.enabled){var u=!t[i].unique.parts[l.partIndex].show;if(n||!u){var c=l.xScreen,h=l.yScreen,f=l.dxScreen,v=l.dyScreen;e.globalAlpha=r||u?.2:1,W(e,"green",c-1,h-1,3,3),q(e,"red",c+f,h+v,l.width,l.height),W(e,"blue",c+f-1,h+v-1,3,3),e.globalAlpha=1}}}}catch(d){s.e(d)}finally{s.f()}}}}var Z=n(162),X=function(){function e(t,n,i){Object(s.a)(this,e),this._layer=t,this._styleRepository=n,this.devicePixelRatio=i,this._spriteMosaic=null,this._glyphMosaic=null,this._connection=null}return Object(l.a)(e,[{key:"destroy",value:function(){this._connection&&(this._connection.close(),this._connection=null),this._styleRepository=null,this._layer=null,this._spriteMosaic&&(this._spriteMosaic=null),this._glyphMosaic&&(this._glyphMosaic=null)}},{key:"spriteMosaic",get:function(){var e=this;return this._spriteSourcePromise.then((function(){return e._spriteMosaic}))}},{key:"glyphMosaic",get:function(){return this._glyphMosaic}},{key:"start",value:function(){var e=Object(o.a)(d.a.mark((function e(t){var n,i=this;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,t),this._spriteSourcePromise.then((function(e){i._spriteMosaic=new H(1024,1024,250),i._spriteMosaic.setSpriteSource(e)}
1)),n=new B(this._layer.currentStyleInfo.glyphsUrl?Object(M.e)(this._layer.currentStyleInfo.glyphsUrl,Object(P.a)(Object(P.a)({},this._layer.customParameters),{},{token:this._layer.apiKey})):null),this._glyphMosaic=new E(1024,1024,n),this._broadcastPromise=Object(I.b)("WorkerTileHandler",{client:this,schedule:t.schedule,signal:t.signal}).then((function(e){return i._connection=e,Promise.all(i._connection.broadcast("setStyle",{style:i._layer.currentStyleInfo.style,vectorTileLayerMaxBuffers:Object(C.a)("vectortilelayer-max-buffers")},t))}));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"updateStyle",value:function(){var e=Object(o.a)(d.a.mark((function e(t){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._broadcastPromise;case 2:return this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",t)),e.abrupt("return",this._broadcastPromise);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setStyle",value:function(){var e=Object(o.a)(d.a.mark((function e(t,n){var i,r=this;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._broadcastPromise;case 2:return this._styleRepository=t,this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,null),this._spriteSourcePromise.then((function(e){r._spriteMosaic=new H(1024,1024,250),r._spriteMosaic.setSpriteSource(e)}
1)),i=new B(this._layer.currentStyleInfo.glyphsUrl?Object(M.e)(this._layer.currentStyleInfo.glyphsUrl,Object(P.a)(Object(P.a)({},this._layer.customParameters),{},{token:this._layer.apiKey})):null),e.abrupt("return",(this._glyphMosaic=new E(1024,1024,i),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:n,vectorTileLayerMaxBuffers:Object(C.a)("vectortilelayer-max-buffers")})),this._broadcastPromise));case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"fetchTileData",value:function(e,t){var n=this;return this._getRefKeys(e,t).then((function(e){var i=n._layer.sourceNameToSource,r=[];for(var a in i)r.push(a);return n._getSourcesData(r,e,t)}))}},{key:"parseTileData",value:function(e,t){var n=this,i=e&&e.data;if(!i)return Promise.resolve(null);var r=i.sourceName2DataAndRefKey,a=i.transferList;return 0===Object.keys(r).length?Promise.resolve(null):this._broadcastPromise.then((function(){return n._connection.getAvailableClient().then((function(n){return n.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:r,styleLayerUIDs:e.styleLayerUIDs},Object(P.a)(Object(P.a)({},t),{},{transferList:a}))}))}))}},{key:"getSprites",value:function(){var e=Object(o.a)(d.a.mark((function e(t){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._spriteSourcePromise;case 2:return e.abrupt("return",this._spriteMosaic.getSpriteItems(t));case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getGlyphs",value:function(e){return this._glyphMosaic.getGlyphItems(e.font,e.codePoints)}},{key:"perfReport",value:function(e){!function(e,t,n){if(window.PERFORMANCE_RECORDING_STORAGE){var i=window.PERFORMANCE_RECORDING_STORAGE;i.perf=i.perf||{};var r=i.perf;r[e]=r[e]||{start:null,time:0,min:void 0,max:void 0,samples:[],unit:n},r[e].time+=t,r[e].samples.push(t),(null==r[e].min||t<r[e].min)&&(r[e].min=t),(null==r[e].max||t>r[e].max)&&(r[e].max=t)}}(e.key,e.milliseconds,"ms")}},{key:"_getTilePayload",value:function(){var e=Object(o.a)(d.a.mark((function e(t,n,i){var r,a;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Z.a.pool.acquire(t.id),a=this._layer.sourceNameToSource[n].getSourceTileUrl(r.level,r.row,r.col),Z.a.pool.release(r),e.prev=2,e.next=5,this.request(a,i);case 5:return e.t0=e.sent,e.t1=n,e.abrupt("return",{protobuff:e.t0,sourceName:e.t1});case 10:if(e.prev=10,e.t2=e.catch(2),!Object(x.l)(e.t2)){e.next=14;break}throw e.t2;case 14:return e.abrupt("return",{protobuff:null,sourceName:n});case 15:case"end":return e.stop()}}),e,this,[[2,10]])})));return function(t,n,i){return e.apply(this,arguments)}}()},{key:"request",value:function(e,t){return Object(T.default)(e,Object(P.a)({responseType:"array-buffer"},t)).then((function(e){return e.data}))}},{key:"_getRefKeys",value:function(e,t){var n=this._layer.sourceNameToSource,i=new Array;for(var r in n){var a=n[r].getRefKey(e,t);i.push(a)}return Object(x.i)(i)}},{key:"_getSourcesData",value:function(e,t,n){for(var i=[],r=0;r<t.length;r++)if(null==t[r].value||null==e[r])i.push(null);else{var a=this._getTilePayload(t[r].value,e[r],n);i.push(a)}return Object(x.i)(i).then((function(e){for(var n={},i=[],r=0;r<e.length;r++)if(e[r].value&&e[r].value&&e[r].value.protobuff&&e[r].value.protobuff.byteLength>0){var a=t[r].value.id;n[e[r].value.sourceName]={refKey:a,protobuff:e[r].value.protobuff},i.push(e[r].value.protobuff)}return{sourceName2DataAndRefKey:n,transferList:i}}))}}]),e}(),K=n(318),J=n(238),Q=function(e,t){return e+1/(1<<2*t)},$=function(){function e(t,n){Object(s.a)(this,e),this._tiles=new Map,this._tileCache=new K.a(40,(function(e){return e.dispose()})),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,this._container=n}return Object(l.a)(e,[{key:"destroy",value:function(){var e,t=Object(a.a)(this._tiles);try{for(t.s();!(e=t.n()).done;){var n=Object(r.a)(e.value,2);n[0];n[1].dispose()}}catch(i){t.e(i)}finally{t.f()}this._tiles=null,this._tileCache.clear(),this._tileCache=null}},{key:"update",value:function(e){this._updateCacheSize(e);var t,n=this.tileInfoView,i=n.getTileCoverage(e.state,0,"smallest"),o=i.spans,s=i.lodInfo,l=s.level,u=this._tiles,c=new Set,h=new Set,f=Object(a.a)(o);try{for(f.s();!(t=f.n()).done;)for(var v=t.value,d=v.row,p=v.colFrom,y=v.colTo,_=p;_<=y;_++){var m=Z.a.getId(l,d,s.normalizeCol(_),s.getWorldForColumn(_)),g=this._getOrAcquireTile(m);c.add(m),g.processed()?this._addToContainer(g):h.add(new Z.a(m))}}catch(E){f.e(E)}finally{f.f()}var b,x=Object(a.a)(u);try{for(x.s();!(b=x.n()).done;){var O=Object(r.a)(b.value,2),w=O[0];O[1].isCoverage=c.has(w)}}catch(E){x.e(E)}finally{x.f()}var k,S=Object(a.a)(h);try{for(S.s();!(k=S.n()).done;){var j=k.value;this._findPlaceholdersForMissingTiles(j,c)}}catch(E){S.e(E)}finally{S.f()}var P,T=!1,C=Object(a.a)(u);try{for(C.s();!(P=C.n()).done;){var M=Object(r.a)(P.value,2),I=M[0],L=M[1];L.neededForCoverage=c.has(I),L.neededForCoverage||L.isHoldingForFade&&n.intersects(i,L.key)&&c.add(I),L.isFading&&(T=!0)}}catch(E){C.e(E)}finally{C.f()}var A,D=Object(a.a)(this._tiles);try{for(D.s();!(A=D.n()).done;){var z=Object(r.a)(A.value,2),R=z[0];z[1];c.has(R)||this._releaseTile(R)}}catch(E){D.e(E)}finally{D.f()}return J.a.pool.release(i),!T}},{key:"clear",value:function(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}},{key:"clearCache",value:function(){this._tileCache.clear()}},{key:"_findPlaceholdersForMissingTiles",value:function(e,t){var n,i=[],o=Object(a.a)(this._tiles);try{for(o.s();!(n=o.n()).done;){var s=Object(r.a)(n.value,2),l=(s[0],s[1]);this._addPlaceholderChild(i,l,e,t)}}catch(c){o.e(c)}finally{o.f()}var u=i.reduce(Q,0);Math.abs(1-u)<1e-6||this._addPlaceholderParent(e.id,t)}},{key:"_addPlaceholderChild",value:function(e,t,n,i){t.key.level<=n.level||!t.hasData()||function(e,t){var n=t.level-e.level;return e.row===t.row>>n&&e.col===t.col>>n&&e.world===t.world}
1(n,t.key)&&(this._addToContainer(t),i.add(t.id),e.push(t.key.level-n.level))}},{key:"_addPlaceholderParent",value:function(e,t){for(var n=this._tiles,i=e;;){if(!(i=ee(i))||t.has(i))return;var r=n.get(i);if(r&&r.hasData())return this._addToContainer(r),void t.add(r.id)}}},{key:"_getOrAcquireTile",value:function(e){var t=this._tiles.get(e);return t||((t=this._tileCache.pop(e))||(t=this.acquireTile(new Z.a(e))),this._tiles.set(e,t),t)}},{key:"_releaseTile",value:function(e){var t=this._tiles.get(e);this.releaseTile(t),this._removeFromContainer(t),this._tiles.delete(e),t.hasData()?this._tileCache.put(e,t,1):t.dispose()}},{key:"_addToContainer",value:function(e){var t,n=[],i=this._container;if(!i.contains(e)){var o,s=this._visibleTiles,l=Object(a.a)(s);try{for(l.s();!(o=l.n()).done;){var u=Object(r.a)(o.value,2),c=(u[0],u[1]);this._canConnectDirectly(e,c)&&n.push(c),Object(b.j)(t)&&this._canConnectDirectly(c,e)&&(t=c)}}catch(_){l.e(_)}finally{l.f()}if(Object(b.k)(t)){var h,f=Object(a.a)(n);try{for(f.s();!(h=f.n()).done;){var v=h.value;t.childrenTiles.delete(v),e.childrenTiles.add(v),v.parentTile=e}}catch(_){f.e(_)}finally{f.f()}t.childrenTiles.add(e),e.parentTile=t}else{var d,p=Object(a.a)(n);try{for(p.s();!(d=p.n()).done;){var y=d.value;e.childrenTiles.add(y),y.parentTile=e}}catch(_){p.e(_)}finally{p.f()}}s.set(e.id,e),i.addChild(e)}}},{key:"_removeFromContainer",value:function(e){if(this._visibleTiles.delete(e.id),this._container.removeChild(e),Object(b.k)(e.parentTile)){e.parentTile.childrenTiles.delete(e);var t,n=Object(a.a)(e.childrenTiles);try{for(n.s();!(t=n.n()).done;){var i=t.value;Object(b.k)(e.parentTile)&&e.parentTile.childrenTiles.add(i)}}catch(s){n.e(s)}finally{n.f()}}var r,o=Object(a.a)(e.childrenTiles);try{for(o.s();!(r=o.n()).done;){r.value.parentTile=e.parentTile}}catch(s){o.e(s)}finally{o.f()}e.parentTile=null,e.childrenTiles.clear()}},{key:"_canConnectDirectly",value:function(e,t){for(var n=e.key,i=t.key,r=i.level,a=i.row,o=i.col,s=i.world,l=this._visibleTiles;r>0;){if(r--,a>>=1,o>>=1,n.level===r&&n.row===a&&n.col===o&&n.world===s)return!0;if(l.has("".concat(r,"/").concat(a,"/").concat(o,"/").concat(s)))return!1}return!1}},{key:"_updateCacheSize",value:function(e){var t=e.state.size;if(t[0]!==this._viewSize[0]||t[1]!==this._viewSize[1]){var n=Math.ceil(t[0]/512)+1,i=Math.ceil(t[1]/512)+1;this._viewSize[0]=t[0],this._viewSize[1]=t[1],this._tileCache.maxSize=5*n*i}}}]),e}();function ee(e){var t=e.split("/"),n=Object(r.a)(t,4),i=n[0],a=n[1],o=n[2],s=n[3],l=parseInt(i,10);return 0===l?null:"".concat(l-1,"/").concat(parseInt(a,10)>>1,"/").concat(parseInt(o,10)>>1,"/").concat(parseInt(s,10))}var te=n(235),ne=n(303),ie=Object(l.a)((function e(t){Object(s.a)(this,e),this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=t})),re=Object(l.a)((function e(){Object(s.a)(this,e),this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}));function ae(e,t,n,i,r,a){var o=n-r;if(o>=0)return(t>>o)+(i-(a<<o))*(e>>o);var s=-o;return t-(a-(i<<s))*(e>>s)<<s}var oe=function(){function e(t,n,i){Object(s.a)(this,e),this._rows=Math.ceil(n/i),this._columns=Math.ceil(t/i),this._cellSize=i,this.cells=new Array(this._rows);for(var r=0;r<this._rows;r++){this.cells[r]=new Array(this._columns);for(var a=0;a<this._columns;a++)this.cells[r][a]=[]}}return Object(l.a)(e,[{key:"getCell",value:function(e,t){var n=Math.min(Math.max(Math.floor(t/this._cellSize),0),this._rows-1),i=Math.min(Math.max(Math.floor(e/this._cellSize),0),this._columns-1);return this.cells[n]&&this.cells[n][i]||null}},{key:"getCellSpan",value:function(e,t,n,i){return[Math.min(Math.max(Math.floor(e/this._cellSize),0),this.columns-1),Math.min(Math.max(Math.floor(t/this._cellSize),0),this.rows-1),Math.min(Math.max(Math.floor(n/this._cellSize),0),this.columns-1),Math.min(Math.max(Math.floor(i/this._cellSize),0),this.rows-1)]}},{key:"cellSize",get:function(){return this._cellSize}},{key:"columns",get:function(){return this._columns}},{key:"rows",get:function(){return this._rows}}]),e}();function se(e,t,n,i,o){var s=e.layerData.get(o);if(3===s.type){var l,u=Object(a.a)(i);try{for(u.s();!(l=u.n()).done;){var c=l.value,h=c.unique,f=void 0;if(c.selectedForRendering){var v=h.parts[0],d=v.startOpacity,p=v.targetOpacity;e.allSymbolsFadingOut=e.allSymbolsFadingOut&&0===p;var y=n?Math.floor(127*d)|p<<7:p?255:0;f=y<<24|y<<16|y<<8|y}else f=0;var _,m=Object(a.a)(c.iconVertexRanges);try{for(m.s();!(_=m.n()).done;)for(var g=Object(r.a)(_.value,2),b=g[0],x=g[1],O=b;O<b+x;O+=4)s.iconOpacity[O/4]=f}catch(A){m.e(A)}finally{m.f()}if(c.selectedForRendering){var w=h.parts[1],k=w.startOpacity,S=w.targetOpacity;e.allSymbolsFadingOut=e.allSymbolsFadingOut&&0===S;var j=n?Math.floor(127*k)|S<<7:S?255:0;f=j<<24|j<<16|j<<8|j}else f=0;var P,T=Object(a.a)(c.textVertexRanges);try{for(T.s();!(P=T.n()).done;)for(var C=Object(r.a)(P.value,2),M=C[0],I=C[1],L=M;L<M+I;L+=4)s.textOpacity[L/4]=f}catch(A){T.e(A)}finally{T.f()}}}catch(A){u.e(A)}finally{u.f()}s.lastOpacityUpdate=t,s.opacityChanged=!0}}var le=function(){function e(t,n){Object(s.a)(this,e),this.layerUIDs=[],this.isDestroyed=!1,this.data=t,this.memoryUsed=t.byteLength;var i=1,r=new Uint32Array(t);this.layerUIDs=[];for(var a=r[i++],o=0;o<a;o++)this.layerUIDs[o]=r[i++];this.bufferDataOffset=i,n&&(this.layer=n.getStyleLayerByUID(this.layerUIDs[0]))}return Object(l.a)(e,[{key:"isPreparedForRendering",get:function(){return Object(b.j)(this.data)}},{key:"offset",get:function(){return this.bufferDataOffset}},{key:"destroy",value:function(){this.isDestroyed||(this.doDestroy(),this.isDestroyed=!0)}},{key:"prepareForRendering",value:function(e){Object(b.j)(this.data)||(this.doPrepareForRendering(e,this.data,this.bufferDataOffset),this.data=null)}}]),e}(),ue=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i){var r;Object(s.a)(this,n),(r=t.call(this,e,i)).type=2,r.lineIndexStart=0,r.lineIndexCount=0;var a=new Uint32Array(e),o=r.bufferDataOffset;r.lineIndexStart=a[o++],r.lineIndexCount=a[o++];var l=a[o++];if(l>0){for(var u=new Map,c=0;c<l;c++){var h=a[o++],f=a[o++],v=a[o++];u.set(h,[f,v])}r.patternMap=u}return r.bufferDataOffset=o,r}return Object(l.a)(n,[{key:"hasData",value:function(){return this.lineIndexCount>0}},{key:"triangleCount",value:function(){return this.lineIndexCount/3}},{key:"doDestroy",value:function(){Object(b.k)(this.lineVertexArrayObject)&&this.lineVertexArrayObject.dispose(),Object(b.k)(this.lineVertexBuffer)&&this.lineVertexBuffer.dispose(),Object(b.k)(this.lineIndexBuffer)&&this.lineIndexBuffer.dispose(),this.lineVertexArrayObject=null,this.lineVertexBuffer=null,this.lineIndexBuffer=null,this.memoryUsed=0}},{key:"doPrepareForRendering",value:function(e,t,n){var i=new Uint32Array(t),r=new Int32Array(i.buffer),a=i[n++];this.lineVertexBuffer=L.a.createVertex(e,35044,new Int32Array(r.buffer,4*n,a)),n+=a;var o=i[n++];this.lineIndexBuffer=L.a.createIndex(e,35044,new Uint32Array(i.buffer,4*n,o)),n+=o;var s=this.layer.lineMaterial;
1this.lineVertexArrayObject=new D.a(e,s.getAttributeLocations(),s.getLayoutInfo(),{geometry:this.lineVertexBuffer},this.lineIndexBuffer)}}]),n}(le),ce=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i){var r;Object(s.a)(this,n),(r=t.call(this,e,i)).type=1,r.fillIndexStart=0,r.fillIndexCount=0,r.outlineIndexStart=0,r.outlineIndexCount=0;var a=new Uint32Array(e),o=r.bufferDataOffset;r.fillIndexStart=a[o++],r.fillIndexCount=a[o++],r.outlineIndexStart=a[o++],r.outlineIndexCount=a[o++];var l=a[o++];if(l>0){for(var u=new Map,c=0;c<l;c++){var h=a[o++],f=a[o++],v=a[o++];u.set(h,[f,v])}r.patternMap=u}return r.bufferDataOffset=o,r}return Object(l.a)(n,[{key:"hasData",value:function(){return this.fillIndexCount>0||this.outlineIndexCount>0}},{key:"triangleCount",value:function(){return(this.fillIndexCount+this.outlineIndexCount)/3}},{key:"doDestroy",value:function(){Object(b.k)(this.fillVertexArrayObject)&&this.fillVertexArrayObject.dispose(),Object(b.k)(this.fillVertexBuffer)&&this.fillVertexBuffer.dispose(),Object(b.k)(this.fillIndexBuffer)&&this.fillIndexBuffer.dispose(),this.fillVertexArrayObject=null,this.fillVertexBuffer=null,this.fillIndexBuffer=null,Object(b.k)(this.outlineVertexArrayObject)&&this.outlineVertexArrayObject.dispose(),Object(b.k)(this.outlineVertexBuffer)&&this.outlineVertexBuffer.dispose(),Object(b.k)(this.outlineIndexBuffer)&&this.outlineIndexBuffer.dispose(),this.outlineVertexArrayObject=null,this.outlineVertexBuffer=null,this.outlineIndexBuffer=null,this.memoryUsed=0}},{key:"doPrepareForRendering",value:function(e,t,n){var i=new Uint32Array(t),r=new Int32Array(i.buffer),a=i[n++];this.fillVertexBuffer=L.a.createVertex(e,35044,new Int32Array(r.buffer,4*n,a)),n+=a;var o=i[n++];this.fillIndexBuffer=L.a.createIndex(e,35044,new Uint32Array(i.buffer,4*n,o)),n+=o;var s=i[n++];this.outlineVertexBuffer=L.a.createVertex(e,35044,new Int32Array(r.buffer,4*n,s)),n+=s;var l=i[n++];this.outlineIndexBuffer=L.a.createIndex(e,35044,new Uint32Array(i.buffer,4*n,l)),n+=l;var u=this.layer,c=u.fillMaterial,h=u.outlineMaterial;this.fillVertexArrayObject=new D.a(e,c.getAttributeLocations(),c.getLayoutInfo(),{geometry:this.fillVertexBuffer},this.fillIndexBuffer),this.outlineVertexArrayObject=new D.a(e,h.getAttributeLocations(),h.getLayoutInfo(),{geometry:this.outlineVertexBuffer},this.outlineIndexBuffer)}}]),n}(le),he=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,r){var a;Object(s.a)(this,n),(a=t.call(this,e,i)).type=3,a.iconPerPageElementsMap=new Map,a.glyphPerPageElementsMap=new Map,a.symbolInstances=[],a.isIconSDF=!1,a.opacityChanged=!1,a.lastOpacityUpdate=0,a.symbols=[];var o=new Uint32Array(e),l=new Int32Array(e),u=new Float32Array(e),c=a.bufferDataOffset;a.isIconSDF=!!o[c++];for(var h=o[c++],f=0;f<h;f++){var v=o[c++],d=o[c++],p=o[c++];a.iconPerPageElementsMap.set(v,[d,p])}for(var y=o[c++],_=0;_<y;_++){var m=o[c++],g=o[c++],b=o[c++];a.glyphPerPageElementsMap.set(m,[g,b])}var x=o[c++],O=o[c++];return a.iconOpacity=new Int32Array(x),a.textOpacity=new Int32Array(O),c=function(e,t,n,i,r,a){for(var o=t[i++],s=0;s<o;s++){var l=new ie(a);l.xTile=t[i++],l.yTile=t[i++],l.hash=t[i++],l.priority=t[i++];for(var u=t[i++],c=0;c<u;c++){var h=t[i++],f=t[i++],v=t[i++],d=t[i++],p=!!t[i++],y=t[i++],_=n[i++],m=n[i++],g=t[i++],b=t[i++];l.colliders.push({xTile:h,yTile:f,dxPixels:v,dyPixels:d,hard:p,partIndex:y,width:g,height:b,minLod:_,maxLod:m})}for(var x=e[i++],O=0;O<x;O++)l.textVertexRanges.push([e[i++],e[i++]]);for(var w=e[i++],k=0;k<w;k++)l.iconVertexRanges.push([e[i++],e[i++]]);r.push(l)}return i}(o,l,u,c,a.symbols,r),a.bufferDataOffset=c,a}return Object(l.a)(n,[{key:"hasData",value:function(){return this.iconPerPageElementsMap.size>0||this.glyphPerPageElementsMap.size>0}},{key:"triangleCount",value:function(){var e,t=0,n=Object(a.a)(this.iconPerPageElementsMap);try{for(n.s();!(e=n.n()).done;){var i=Object(r.a)(e.value,2);i[0];t+=i[1][1]}}catch(u){n.e(u)}finally{n.f()}var o,s=Object(a.a)(this.glyphPerPageElementsMap);try{for(s.s();!(o=s.n()).done;){var l=Object(r.a)(o.value,2);l[0];t+=l[1][1]}}catch(u){s.e(u)}finally{s.f()}return t/3}},{key:"doDestroy",value:function(){Object(b.k)(this.iconVertexArrayObject)&&this.iconVertexArrayObject.dispose(),Object(b.k)(this.iconVertexBuffer)&&this.iconVertexBuffer.dispose(),Object(b.k)(this.iconOpacityBuffer)&&this.iconOpacityBuffer.dispose(),Object(b.k)(this.iconIndexBuffer)&&this.iconIndexBuffer.dispose(),this.iconVertexArrayObject=null,this.iconVertexBuffer=null,this.iconOpacityBuffer=null,this.iconIndexBuffer=null,Object(b.k)(this.textVertexArrayObject)&&this.textVertexArrayObject.dispose(),Object(b.k)(this.textVertexBuffer)&&this.textVertexBuffer.dispose(),Object(b.k)(this.textOpacityBuffer)&&this.textOpacityBuffer.dispose(),Object(b.k)(this.textIndexBuffer)&&this.textIndexBuffer.dispose(),this.textVertexArrayObject=null,this.textVertexBuffer=null,this.textOpacityBuffer=null,this.textIndexBuffer=null,this.memoryUsed=0}},{key:"updateOpacityInfo",value:function(){if(this.opacityChanged){this.opacityChanged=!1;var e=Object(b.r)(this.iconOpacity),t=Object(b.r)(this.iconOpacityBuffer);e.length>0&&e.byteLength===t.size&&t.setSubData(e);var n=Object(b.r)(this.textOpacity),i=Object(b.r)(this.textOpacityBuffer);n.length>0&&n.byteLength===i.size&&i.setSubData(n)}}},{key:"doPrepareForRendering",value:function(e,t,n){var i=new Uint32Array(t),r=new Int32Array(i.buffer),a=i[n++];this.iconVertexBuffer=L.a.createVertex(e,35044,new Int32Array(r.buffer,4*n,a)),n+=a;var o=i[n++];this.iconIndexBuffer=L.a.createIndex(e,35044,new Uint32Array(i.buffer,4*n,o)),n+=o;var s=i[n++];this.textVertexBuffer=L.a.createVertex(e,35044,new Int32Array(r.buffer,4*n,s)),n+=s;var l=i[n++];this.textIndexBuffer=L.a.createIndex(e,35044,new Uint32Array(i.buffer,4*n,l)),n+=l,this.iconOpacityBuffer=L.a.createVertex(e,35044,Object(b.r)(this.iconOpacity).buffer),this.textOpacityBuffer=L.a.createVertex(e,35044,Object(b.r)(this.textOpacity).buffer);var u=this.layer,c=u.iconMaterial,h=u.textMaterial;
1this.iconVertexArrayObject=new D.a(e,c.getAttributeLocations(),c.getLayoutInfo(),{geometry:this.iconVertexBuffer,opacity:this.iconOpacityBuffer},this.iconIndexBuffer),this.textVertexArrayObject=new D.a(e,h.getAttributeLocations(),h.getLayoutInfo(),{geometry:this.textVertexBuffer,opacity:this.textOpacityBuffer},this.textIndexBuffer)}}]),n}(le),fe=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i){var r;Object(s.a)(this,n),(r=t.call(this,e,i)).type=4,r.circleIndexStart=0,r.circleIndexCount=0;var a=new Uint32Array(e),o=r.bufferDataOffset;return r.circleIndexStart=a[o++],r.circleIndexCount=a[o++],r.bufferDataOffset=o,r}return Object(l.a)(n,[{key:"hasData",value:function(){return this.circleIndexCount>0}},{key:"triangleCount",value:function(){return this.circleIndexCount/3}},{key:"doDestroy",value:function(){Object(b.k)(this.circleVertexArrayObject)&&this.circleVertexArrayObject.dispose(),Object(b.k)(this.circleVertexBuffer)&&this.circleVertexBuffer.dispose(),Object(b.k)(this.circleIndexBuffer)&&this.circleIndexBuffer.dispose(),this.circleVertexArrayObject=null,this.circleVertexBuffer=null,this.circleIndexBuffer=null,this.memoryUsed=0}},{key:"doPrepareForRendering",value:function(e,t,n){var i=new Uint32Array(t),r=new Int32Array(i.buffer),a=i[n++];this.circleVertexBuffer=L.a.createVertex(e,35044,new Int32Array(r.buffer,4*n,a)),n+=a;var o=i[n++];this.circleIndexBuffer=L.a.createIndex(e,35044,new Uint32Array(i.buffer,4*n,o)),n+=o;var s=this.layer.circleMaterial;this.circleVertexArrayObject=new D.a(e,s.getAttributeLocations(),s.getLayoutInfo(),{geometry:this.circleVertexBuffer},this.circleIndexBuffer)}}]),n}(le),ve=n(574),de=n(595),pe=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i,r,a,o,l){var u,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;return Object(s.a)(this,n),(u=t.call(this,e,i,r,a,o,4096,4096))._memCache=c,u.type="vector-tile",u._referenced=0,u._hasSymbolBuckets=!1,u._memoryUsedByLayerData=0,u.layerData=new Map,u.layerCount=0,u.status="loading",u.allSymbolsFadingOut=!1,u.lastOpacityUpdate=0,u.symbols=new Map,u.isCoverage=!1,u.neededForCoverage=!1,u.decluttered=!1,u.invalidating=!1,u.parentTile=null,u.childrenTiles=new Set,u._processed=!1,u._referenced=1,u.styleRepository=l,u.id=e.id,u}return Object(l.a)(n,[{key:"hasSymbolBuckets",get:function(){return this._hasSymbolBuckets}},{key:"isFading",get:function(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<ve.d}},{key:"isHoldingForFade",get:function(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<ve.d)}},{key:"wasRequested",get:function(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}},{key:"setData",value:function(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this.invalidating=!1,this._processed=!0}},{key:"deleteLayerData",value:function(e){var t,n=!1,i=Object(a.a)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;if(this.layerData.has(r)){var o=this.layerData.get(r);this._memoryUsedByLayerData-=o.memoryUsed,3===o.type&&this.symbols.has(r)&&(this.symbols.delete(r),n=!0),o.destroy(),this.layerData.delete(r),this.layerCount--}}}catch(s){i.e(s)}finally{i.f()}Object(b.k)(this._memCache)&&this._memCache.updateSize(this.key.id,this,this._memoryUsedByLayerData),n&&this.emit("symbols-changed"),this.requestRender()}},{key:"processed",value:function(){return this._processed}},{key:"hasData",value:function(){return this.layerCount>0}},{key:"dispose",value:function(){"unloaded"!==this.status&&(ye.delete(this),n._destroyRenderBuckets(this.layerData),this.layerData=null,this.layerCount=0,this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}},{key:"release",value:function(){return 0==--this._referenced&&(this.dispose(),this.stage=null,!0)}},{key:"retain",value:function(){++this._referenced}},{key:"referenced",get:function(){return this._referenced}},{key:"memoryUsage",get:function(){return(this._memoryUsedByLayerData+256)/(this._referenced||1)}},{key:"changeDataImpl",value:function(e){var t=!1;if(e){var n,i=this._createRenderBuckets(e),o=Object(a.a)(i);try{for(o.s();!(n=o.n()).done;){var s=Object(r.a)(n.value,2),l=s[0],u=s[1];if(this.layerData.has(l)){var c=this.layerData.get(l);this._memoryUsedByLayerData-=u.memoryUsed,c.destroy(),this.layerData.delete(l),this.layerCount--}3===u.type&&(this.symbols.set(l,u.symbols),t=!0),this._memoryUsedByLayerData+=u.memoryUsed,this.layerData.set(l,u),this.layerCount++}}catch(d){o.e(d)}finally{o.f()}Object(b.k)(this._memCache)&&this._memCache.updateSize(this.key.id,this,this._memoryUsedByLayerData)}this._hasSymbolBuckets=!1;var h,f=Object(a.a)(this.layerData);try{for(f.s();!(h=f.n()).done;){var v=Object(r.a)(h.value,2);v[0];3===v[1].type&&(this._hasSymbolBuckets=!0)}}catch(d){f.e(d)}finally{f.f()}
1t&&this.emit("symbols-changed")}},{key:"attachWithContext",value:function(e){this.stage={context:e,trashDisplayObject:function(e){e.processDetach()},untrashDisplayObject:function(){return!1}}}},{key:"setTransform",value:function(e,t){Object(u.a)(Object(c.a)(n.prototype),"setTransform",this).call(this,e,t);var i=t/(e.resolution*e.pixelRatio),r=this.width/this.rangeX*i,a=this.height/this.rangeY*i,o=[0,0];e.toScreen(o,[this.x,this.y]);var s=this.transforms.tileUnitsToPixels;Object(te.b)(s),Object(te.c)(s,s,o),Object(te.j)(s,s,Math.PI*e.rotation/180),Object(te.d)(s,s,[r,a,1])}},{key:"_createTransforms",value:function(){return{dvs:Object(ne.b)(),tileMat3:Object(ne.b)(),tileUnitsToPixels:Object(ne.b)()}}},{key:"_createRenderBuckets",value:function(e){var t,n=new Map,i=new Map,r=Object(a.a)(e);try{for(r.s();!(t=r.n()).done;){var o,s=t.value,l=this._deserializeBucket(s,i),u=Object(a.a)(l.layerUIDs);try{for(u.s();!(o=u.n()).done;){var c=o.value;n.set(c,l)}}catch(h){u.e(h)}finally{u.f()}}}catch(h){r.e(h)}finally{r.f()}return n}},{key:"_deserializeBucket",value:function(e,t){var n=t.get(e);if(n)return n;switch(new Uint32Array(e)[0]){case 1:n=new ce(e,this.styleRepository);break;case 2:n=new ue(e,this.styleRepository);break;case 3:n=new he(e,this.styleRepository,this);break;case 4:n=new fe(e,this.styleRepository)}return t.set(e,n),n}}],[{key:"_destroyRenderBuckets",value:function(e){if(e){var t=new Set;e.forEach((function(e){t.has(e)||(e.destroy(),t.add(e))})),e.clear()}}}]),n}(de.a),ye=new Map;var _e=n(96);function me(e,t,n,i,o,s){var l,u=i.iconRotationAlignment,c=i.textRotationAlignment,h=i.iconTranslate,f=i.iconTranslateAnchor,v=i.textTranslate,d=i.textTranslateAnchor,p=0,y=Object(a.a)(e.colliders);try{for(y.s();!(l=y.n()).done;){var _=l.value,m=0===_.partIndex?h:v,g=Object(r.a)(m,2),b=g[0],x=g[1],O=0===_.partIndex?f:d,w=_.minLod<=s&&s<=_.maxLod;p+=w?0:1,_.enabled=w,_.xScreen=_.xTile*o[0]+_.yTile*o[3]+o[6],_.yScreen=_.xTile*o[1]+_.yTile*o[4]+o[7],0===O?(_.xScreen+=n*b-t*x,_.yScreen+=t*b+n*x):(_.xScreen+=b,_.yScreen+=x),1===(0===_.partIndex?u:c)?(_.dxScreen=_.dxPixels,_.dyScreen=_.dyPixels):(_.dxScreen=n*(_.dxPixels+_.width/2)-t*(_.dyPixels+_.height/2)-_.width/2,_.dyScreen=t*(_.dxPixels+_.width/2)+n*(_.dyPixels+_.height/2)-_.height/2)}}catch(k){y.e(k)}finally{y.f()}e.colliders.length>0&&p===e.colliders.length&&(e.unique.show=!1)}var ge=function(){function e(t,n,i,r,o,l){Object(s.a)(this,e),this._symbols=t,this._styleRepository=r,this._zoom=o,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new oe(n,i,ve.a),this._si=Math.sin(Math.PI*l/180),this._co=Math.cos(Math.PI*l/180);var u,c=Object(a.a)(t);try{for(c.s();!(u=c.n()).done;){var h,f=u.value,v=Object(a.a)(f.symbols);try{for(v.s();!(h=v.n()).done;){var d=h.value;this._allNeededMatrices.has(d.tile)||this._allNeededMatrices.set(d.tile,Object(ne.a)(d.tile.transforms.tileUnitsToPixels))}}catch(p){v.e(p)}finally{v.f()}}}catch(p){c.e(p)}finally{c.f()}}return Object(l.a)(e,[{key:"work",value:function(e){var t=this._gridIndex;function n(e){for(var n=e.xScreen+e.dxScreen,i=e.yScreen+e.dyScreen,o=n+e.width,s=i+e.height,l=t.getCellSpan(n,i,o,s),u=Object(r.a)(l,4),c=u[0],h=u[1],f=u[2],v=u[3],d=h;d<=v;d++)for(var p=c;p<=f;p++){var y,_=t.cells[d][p],m=Object(a.a)(_);try{for(m.s();!(y=m.n()).done;){var g=y.value,b=g.xScreen+g.dxScreen,x=g.yScreen+g.dyScreen,O=b+g.width,w=x+g.height;if(!(o<b||n>O||s<x||i>w))return!0}}catch(k){m.e(k)}finally{m.f()}}return!1}for(var i=performance.now();this._currentLayerCursor<this._symbols.length;this._currentLayerCursor++,this._currentSymbolCursor=0)for(var o=this._symbols[this._currentLayerCursor],s=this._getProperties(o.styleLayerUID);this._currentSymbolCursor<o.symbols.length;this._currentSymbolCursor++){if(this._currentSymbolCursor%100==99&&performance.now()-i>e)return!1;var l=o.symbols[this._currentSymbolCursor];if(l.unique.show){me(l,this._si,this._co,s,this._allNeededMatrices.get(l.tile),this._zoom);var u=l.unique;if(u.show){var c,h=s.iconAllowOverlap,f=s.iconIgnorePlacement,v=s.textAllowOverlap,d=s.textIgnorePlacement,p=Object(a.a)(l.colliders);try{for(p.s();!(c=p.n()).done;){var y=c.value;if(y.enabled){var _=u.parts[y.partIndex];_.show&&!(y.partIndex?v:h)&&n(y)&&(y.hard?u.show=!1:_.show=!1)}}}catch(A){p.e(A)}finally{p.f()}if(u.show){var m,g=Object(a.a)(l.colliders);try{for(g.s();!(m=g.n()).done;){var b=m.value;if(b.enabled&&(!(b.partIndex?d:f)&&u.parts[b.partIndex].show))for(var x=b.xScreen+b.dxScreen,O=b.yScreen+b.dyScreen,w=x+b.width,k=O+b.height,S=this._gridIndex.getCellSpan(x,O,w,k),j=Object(r.a)(S,4),P=j[0],T=j[1],C=j[2],M=j[3],I=T;I<=M;I++)for(var L=P;L<=C;L++)this._gridIndex.cells[I][L].push(b)}}catch(A){g.e(A)}finally{g.f()}}}}}return!0}},{key:"_getProperties",value:function(e){var t=this._styleProps.get(e);if(t)return t;var n=this._zoom,i=this._styleRepository.getStyleLayerByUID(e),r=0!==i.getLayoutValue("symbol-placement",n),a=i.getLayoutValue("icon-rotation-alignment",n);2===a&&(a=r?0:1);var o=i.getLayoutValue("text-rotation-alignment",n);2===o&&(o=r?0:1);var s=i.getPaintValue("icon-translate",n),l=i.getPaintValue("icon-translate-anchor",n),u=i.getPaintValue("text-translate",n),c=i.getPaintValue("text-translate-anchor",n),h={iconAllowOverlap:i.getLayoutValue("icon-allow-overlap",n),iconIgnorePlacement:i.getLayoutValue("icon-ignore-placement",n),textAllowOverlap:i.getLayoutValue("text-allow-overlap",n),textIgnorePlacement:i.getLayoutValue("text-ignore-placement",n),iconRotationAlignment:a,textRotationAlignment:o,iconTranslateAnchor:l,iconTranslate:s,textTranslateAnchor:c,textTranslate:u};return this._styleProps.set(e,h),h}}]),e}();function be(e,t){if(e.priority-t.priority)return e.priority-t.priority;var n=e.tile.key,i=t.tile.key;return n.world-i.world?n.world-i.world:n.level-i.level?n.level-i.level:n.row-i.row?n.row-i.row:n.col-i.col?n.c
1ol-i.col:e.xTile-t.xTile?e.xTile-t.xTile:e.yTile-t.yTile}var xe=function(){function e(t,n,i,r,a,o){Object(s.a)(this,e),this._visibleTiles=t,this._symbolRepository=n,this._createCollisionJob=i,this._assignTileSymbolsOpacity=r,this._symbolLayerSorter=a,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}return Object(l.a)(e,[{key:"running",get:function(){return this._running}},{key:"setScreenSize",value:function(e,t){this._screenWidth===e&&this._screenHeight===t||this.restart(),this._screenWidth=e,this._screenHeight=t}},{key:"restart",value:function(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}},{key:"continue",value:function(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){var t=performance.now();if(!this._selectionJob.work(e))return!1;if(this._selectionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-t))))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){var n=performance.now();if(!this._collisionJob.work(e))return!1;if(this._collisionJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-n))))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){var i=performance.now();if(!this._opacityJob.work(e))return!1;if(this._opacityJobCompleted=!0,0===(e=Math.max(0,e-(performance.now()-i))))return!1}return this._running=!1,!0}},{key:"_createSelectionJob",value:function(){for(var e=this._symbolRepository.uniqueSymbols,t=0;t<e.length;t++)for(var n=e[t],i=0;i<n.uniqueSymbols.length;i++){var r,o=n.uniqueSymbols[i],s=Object(a.a)(o.tileSymbols);try{for(s.s();!(r=s.n()).done;){r.value.selectedForRendering=!1}}catch(v){s.e(v)}finally{s.f()}}var l=[],u=0,c=0,h=this._isLayerVisible;var f=this._symbolLayerSorter;return{work:function(t){for(var n,i=performance.now();c<e.length;c++,u=0){var r=e[c],o=r.styleLayerUID;if(h(o)){l[c]=l[c]||{styleLayerUID:o,symbols:[]};for(var s=l[c];u<r.uniqueSymbols.length;u++){if(n=r.uniqueSymbols[u],u%100==99&&performance.now()-i>t)return!1;var f,d=null,p=!1,y=!1,_=Object(a.a)(n.tileSymbols);try{for(_.s();!(f=_.n()).done;){var m=f.value;if(!y||!p){var g=m.tile;(!d||g.isCoverage||g.neededForCoverage&&!p)&&(d=m,(g.neededForCoverage||g.isCoverage)&&(y=!0),g.isCoverage&&(p=!0))}}}catch(v){_.e(v)}finally{_.f()}if(d.selectedForRendering=!0,y){s.symbols.push(d),n.show=!0;var b,x=Object(a.a)(n.parts);try{for(x.s();!(b=x.n()).done;){b.value.show=!0}}catch(v){x.e(v)}finally{x.f()}}else n.show=!1}}else l[c]||(l[c]={styleLayerUID:o,symbols:[]})}var O,w=Object(a.a)(l);try{for(w.s();!(O=w.n()).done;){O.value.symbols.sort(be)}}catch(v){w.e(v)}finally{w.f()}return!0},get sortedSymbols(){return l.sort(f)}}}},{key:"_createOpacityJob",value:function(){var e=this._assignTileSymbolsOpacity,t=this._visibleTiles,n=0;function i(t,n){var o,s=t.symbols,l=Object(a.a)(s);try{for(l.s();!(o=l.n()).done;){var u=Object(r.a)(o.value,2);u[0];Oe(u[1],n)}}catch(f){l.e(f)}finally{l.f()}e(t,n);var c,h=Object(a.a)(t.childrenTiles);try{for(h.s();!(c=h.n()).done;){i(c.value,n)}}catch(f){h.e(f)}finally{h.f()}}return{work:function(e){for(var r=performance.now();n<t.length;n++){if(performance.now()-r>e)return!1;var a=t[n];Object(b.k)(a.parentTile)||i(a,performance.now())}return!0}}}}]),e}();function Oe(e,t){var n,i=Object(a.a)(e);try{for(i.s();!(n=i.n()).done;){var r,o=n.value.unique,s=Object(a.a)(o.parts);try{for(s.s();!(r=s.n()).done;){var l=r.value,u=l.targetOpacity>.5?1:-1;l.startOpacity+=u*((t-l.startTime)/ve.d),l.startOpacity=Math.min(Math.max(l.startOpacity,0),1),l.startTime=t,l.targetOpacity=o.show&&l.show?1:0}}catch(c){s.e(c)}finally{s.f()}}}catch(c){i.e(c)}finally{i.f()}}var we=function(){function e(t,n,i){Object(s.a)(this,e),this.tileCoordRange=t,this._visibleTiles=n,this._createUnique=i,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}return Object(l.a)(e,[{key:"uniqueSymbols",get:function(){return Object(b.j)(this._uniqueSymbolLayerArray)&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}},{key:"add",value:function(e,t){this._uniqueSymbolLayerArray=null;var n=this._tiles.get(e.id);n||(n={symbols:new Map},this._tiles.set(e.id,n));var i=new Map;if(t){var o,s=Object(a.a)(t);try{for(s.s();!(o=s.n()).done;){var l=o.value;n.symbols.has(l)&&(i.set(l,n.symbols.get(l)),n.symbols.delete(l))}}catch(j){s.e(j)}finally{s.f()}}else{var u,c=Object(a.a)(e.layerData);try{for(c.s();!(u=c.n()).done;){var h=Object(r.a)(u.value,2),f=h[0];h[1];n.symbols.has(f)&&(i.set(f,n.symbols.get(f)),n.symbols.delete(f))}}catch(j){c.e(j)}finally{c.f()}}this._removeSymbols(i);var v,d=e.symbols,p=new Map,y=Object(a.a)(d);try{for(y.s();!(v=y.n()).done;){var _=Object(r.a)(v.value,2),m=_[0],g=_[1],b=g.length;if(b>=32){var x=this.tileCoordRange;do{x/=2,b/=4}while(b>8&&x>64);var O=new oe(this.tileCoordRange,this.tileCoordRange,x);p.set(m,{flat:g,index:O}),n.symbols.set(m,{flat:g,index:O});var w,k=Object(a.a)(g);try{for(k.s();!(w=k.n()).done;){var S=w.value;O.getCell(S.xTile,S.yTile).push(S)}}catch(j){k.e(j)}finally{k.f()}}else p.set(m,{flat:g}),n.symbols.set(m,{flat:g})}}catch(j){y.e(j)}finally{y.f()}
1this._addSymbols(e.key,d)}},{key:"deleteStyleLayers",value:function(e){this._uniqueSymbolLayerArray=null;var t,n=Object(a.a)(this._tiles);try{for(n.s();!(t=n.n()).done;){var i,o=Object(r.a)(t.value,2),s=o[0],l=o[1],u=new Map,c=Object(a.a)(e);try{for(c.s();!(i=c.n()).done;){var h=i.value;l.symbols.has(h)&&(u.set(h,l.symbols.get(h)),l.symbols.delete(h))}}catch(f){c.e(f)}finally{c.f()}this._removeSymbols(u),0===l.symbols.size&&this._tiles.delete(s)}}catch(f){n.e(f)}finally{n.f()}}},{key:"removeTile",value:function(e){this._uniqueSymbolLayerArray=null;var t=this._tiles.get(e.id);if(t){var n,i=new Map,o=Object(a.a)(e.symbols);try{for(o.s();!(n=o.n()).done;){var s=Object(r.a)(n.value,2),l=s[0];s[1];t.symbols.has(l)&&(i.set(l,t.symbols.get(l)),t.symbols.delete(l))}}catch(u){o.e(u)}finally{o.f()}this._removeSymbols(i),0===t.symbols.size&&this._tiles.delete(e.id)}}},{key:"_removeSymbols",value:function(e){var t,n=Object(a.a)(e);try{for(n.s();!(t=n.n()).done;){var i,o=Object(r.a)(t.value,2),s=o[0],l=o[1].flat,u=Object(a.a)(l);try{for(u.s();!(i=u.n()).done;){for(var c=i.value,h=c.unique,f=h.tileSymbols,v=f.length-1,d=0;d<v;d++)if(f[d]===c){f[d]=f[v];break}if(f.length=v,0===v){var p=this._uniqueSymbolsReferences.get(s);p.delete(h),0===p.size&&this._uniqueSymbolsReferences.delete(s)}c.unique=null}}catch(y){u.e(y)}finally{u.f()}}}catch(y){n.e(y)}finally{n.f()}}},{key:"_addSymbols",value:function(e,t){if(0!==t.size){var n,i=this._visibleTiles,o=Object(a.a)(i);try{for(o.s();!(n=o.n()).done;){var s=n.value;s.parentTile||s.key.world!==e.world||s.key.level===e.level&&!s.key.equals(e)||this._matchSymbols(s,e,t)}}catch(m){o.e(m)}finally{o.f()}var l,u=Object(a.a)(t);try{for(u.s();!(l=u.n()).done;){var c,h=Object(r.a)(l.value,2),f=h[0],v=h[1],d=Object(a.a)(v);try{for(d.s();!(c=d.n()).done;){var p=c.value;if(Object(b.j)(p.unique)){var y=this._createUnique();p.unique=y,y.tileSymbols.push(p);var _=this._uniqueSymbolsReferences.get(f);_||(_=new Set,this._uniqueSymbolsReferences.set(f,_)),_.add(y)}}}catch(m){d.e(m)}finally{d.f()}}}catch(m){u.e(m)}finally{u.f()}}}},{key:"_matchSymbols",value:function(e,t,n){if(e.key.level>t.level){var i=e.key.level-t.level;if(e.key.row>>i!==t.row||e.key.col>>i!==t.col)return}if(t.level>e.key.level){var o=t.level-e.key.level;if(t.row>>o!==e.key.row||t.col>>o!==e.key.col)return}if(t.equals(e.key)){var s,l=Object(a.a)(e.childrenTiles);try{for(l.s();!(s=l.n()).done;){var u=s.value;this._matchSymbols(u,t,n)}}catch(G){l.e(G)}finally{l.f()}}else{var c,h=new Map,f=Object(a.a)(n);try{for(f.s();!(c=f.n()).done;){var v,d=Object(r.a)(c.value,2),p=d[0],y=d[1],_=[],m=Object(a.a)(y);try{for(m.s();!(v=m.n()).done;){var g=v.value,x=ae(this.tileCoordRange,g.xTile,t.level,t.col,e.key.level,e.key.col),O=ae(this.tileCoordRange,g.yTile,t.level,t.row,e.key.level,e.key.row);x>=0&&x<this.tileCoordRange&&O>=0&&O<this.tileCoordRange&&_.push({symbol:g,xTransformed:x,yTransformed:O})}}catch(G){m.e(G)}finally{m.f()}var w=[],k=e.key.level<t.level?1:1<<e.key.level-t.level,S=this._tiles.get(e.id).symbols.get(p);if(S){var j,P=S.flat,T=Object(a.a)(_);try{for(T.s();!(j=T.n()).done;){var C,M=j.value,I=!1,L=M.xTransformed,A=M.yTransformed;C=Object(b.k)(S.index)?S.index.getCell(L,A):P;var D,z=M.symbol,R=z.hash,E=Object(a.a)(C);try{for(E.s();!(D=E.n()).done;){var V=D.value;if(R===V.hash&&Math.abs(L-V.xTile)<=k&&Math.abs(A-V.yTile)<=k){var F=V.unique;z.unique=F,F.tileSymbols.push(z),I=!0;break}}}catch(G){E.e(G)}finally{E.f()}I||w.push(z)}}catch(G){T.e(G)}finally{T.f()}}w.length>0&&h.set(p,w)}}catch(G){f.e(G)}finally{f.f()}var U,B=Object(a.a)(e.childrenTiles);try{for(B.s();!(U=B.n()).done;){var N=U.value;this._matchSymbols(N,t,h)}}catch(G){B.e(G)}finally{B.f()}}}},{key:"_createUniqueSymbolLayerArray",value:function(){var e,t,n=this._uniqueSymbolsReferences,i=new Array(n.size),o=0,s=Object(a.a)(n);try{for(s.s();!(t=s.n()).done;){var l=Object(r.a)(t.value,2),u=l[0],c=l[1],h=new Array(c.size);e=0;var f,v=Object(a.a)(c);try{for(v.s();!(f=v.n()).done;){var d=f.value;h[e++]=d}}catch(p){v.e(p)}finally{v.f()}i[o]={styleLayerUID:u,uniqueSymbols:h},o++}}catch(p){s.e(p)}finally{s.f()}return i}}]),e}(),ke=1e-6,Se=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e,i){var o;return Object(s.a)(this,n),(o=t.call(this)).styleRepository=e,o._tileToHandle=new Map,o._viewState={scale:0,rotation:0,
1center:[0,0],size:[0,0]},o._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},o._completed=!1,o._symbolRepository=new we(4096,i,(function(){return new re})),o._symbolDeclutterer=new xe(i,o._symbolRepository,(function(e,t,n){return new ge(e,t,n,o.styleRepository,o._zoom,o._viewState.rotation)}),(function(e,t){e.allSymbolsFadingOut=!0,e.lastOpacityUpdate=t,function(e,t,n){var i,o=Object(a.a)(e.symbols);try{for(o.s();!(i=o.n()).done;){var s=Object(r.a)(i.value,2),l=s[0];se(e,t,n,s[1],l)}}catch(u){o.e(u)}finally{o.f()}}(e,t,!0),e.decluttered=!0,e.requestRender()}),(function(e,t){return o.styleRepository.getStyleLayerByUID(e.styleLayerUID).z-o.styleRepository.getStyleLayerByUID(t.styleLayerUID).z}),(function(e){var t=o.styleRepository.getStyleLayerByUID(e);if(o._zoom+ke<t.minzoom||o._zoom-ke>=t.maxzoom)return!1;var n=t.getLayoutProperty("visibility");return!n||1!==n.getValue()})),o}return Object(l.a)(n,[{key:"addTile",value:function(e){var t=this;e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",(function(){t._symbolRepository.add(e),t.restartDeclutter()}))),this._symbolRepository.add(e),this.restartDeclutter()}},{key:"removeTile",value:function(e){var t=this._tileToHandle.get(e);t&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),t.remove(),this._tileToHandle.delete(e))}},{key:"update",value:function(e,t){return this._zoom=e,this._viewState={scale:t.scale,rotation:t.rotation,center:[t.center[0],t.center[1]],size:[t.size[0],t.size[1]]},this._continueDeclutter(),this._completed}},{key:"restartDeclutter",value:function(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}},{key:"clear",value:function(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach((function(e){return e.remove()})),this._tileToHandle.clear()}},{key:"stale",get:function(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}},{key:"deleteStyleLayers",value:function(e){this._symbolRepository.deleteStyleLayers(e)}},{key:"_continueDeclutter",value:function(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(ve.b),this._completed&&this._scheduleNotifyStable())}},{key:"_scheduleNotifyStable",value:function(){var e=this;Object(b.k)(this._stableNotificationHandle)&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout((function(){e._stableNotificationHandle=null,e.emit("fade-complete")}),1.5*ve.d)}},{key:"_notifyUnstable",value:function(){Object(b.k)(this._stableNotificationHandle)&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this.emit("fade-start")}}]),n}(_e.a),je=n(532),Pe=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(){return Object(s.a)(this,n),t.apply(this,arguments)}return Object(l.a)(n,[{key:"_createTransforms",value:function(){return{dvs:Object(ne.b)(),tileMat3:Object(ne.b)()}}}]),n}(de.a),Te=n(603),Ce=1e-6;function Me(e,t){if(e){var n=e.getLayoutProperty("visibility");if(!n||1!==n.getValue()&&(void 0===e.minzoom||e.minzoom<t+Ce)&&(void 0===e.maxzoom||e.maxzoom>=t-Ce))return!0}return!1}var Ie=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e){var i;return Object(s.a)(this,n),(i=t.call(this,e))._backgroundTiles=[],i._pointToCallbacks=new Map,i}return Object(l.a)(n,[{key:"destroy",value:function(){this.removeAllChildren(),this._spriteMosaic&&(this._spriteMosaic.dispose(),this._spriteMosaic=null),this._glyphMosaic&&(this._glyphMosaic.dispose(),this._glyphMosaic=null),Object(b.k)(this._symbolFader)&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[],this._pointToCallbacks.clear()}},{key:"setStyleResources",value:function(e,t,n){var i=this;if(this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=n,Object(b.j)(this._symbolFader)){var r=new Se(this._styleRepository,this.children);r.on("fade-start",(function(){i.emit("fade-start"),i.requestRender()})),r.on("fade-complete",(function(){i.emit("fade-complete"),i.requestRender()})),this._symbolFader=r}Object(b.r)(this._symbolFader).styleRepository=n}},{key:"deleteStyleLayers",value:function(e){Object(b.k)(this._symbolFader)&&this._symbolFader.deleteStyleLayers(e)}},{key:"hitTest",value:function(){var e=Object(o.a)(d.a.mark((function e(t){var n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(x.f)(),e.abrupt("return",(this._pointToCallbacks.set(t,n),this.requestRender(),n.promise));case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"enterTileInvalidation",value:function(){var e,t=Object(a.a)(this.children);try{for(t.s();!(e=t.n()).done;
1){e.value.invalidating=!0}}catch(n){t.e(n)}finally{t.f()}}},{key:"createRenderParams",value:function(e){return Object(P.a)(Object(P.a)({},Object(u.a)(Object(c.a)(n.prototype),"createRenderParams",this).call(this,e)),{},{renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos})}},{key:"doRender",value:function(e){!this.visible||e.drawPhase!==je.c.MAP&&e.drawPhase!==je.c.DEBUG||void 0===this._spriteMosaic||Object(u.a)(Object(c.a)(n.prototype),"doRender",this).call(this,e)}},{key:"addChild",value:function(e){return Object(u.a)(Object(c.a)(n.prototype),"addChild",this).call(this,e),Object(b.k)(this._symbolFader)?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}},{key:"removeChild",value:function(e){return Object(b.k)(this._symbolFader)&&this._symbolFader.removeTile(e),this.requestRender(),Object(u.a)(Object(c.a)(n.prototype),"removeChild",this).call(this,e)}},{key:"renderChildren",value:function(e){var t=e.drawPhase;if(t!==je.c.DEBUG){if(this._doRender(e),this._pointToCallbacks.size>0){e.drawPhase=je.c.HITTEST;var i=e.painter.effects.hittest;i.bind(e),this._doRender(e),i.draw(e,this._pointToCallbacks),i.unbind(e),e.drawPhase=t}}else Object(u.a)(Object(c.a)(n.prototype),"renderChildren",this).call(this,e)}},{key:"removeAllChildren",value:function(){for(var e=0;e<this.children.length;e++){var t=this.children[e];Object(b.k)(this._symbolFader)&&this._symbolFader.removeTile(t),t.dispose()}Object(u.a)(Object(c.a)(n.prototype),"removeAllChildren",this).call(this)}},{key:"getStencilTarget",value:function(){return this.children.filter((function(e){return e.neededForCoverage&&e.hasData()}))}},{key:"restartDeclutter",value:function(){Object(b.k)(this._symbolFader)&&this._symbolFader.restartDeclutter()}},{key:"_doRender",value:function(e){var t=e.context,i=this._styleRepository;if(i){var r=i.layers,o=!0;e.drawPhase===je.c.HITTEST&&(o=!1),i.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,i.backgroundBucketIds)),Object(u.a)(Object(c.a)(n.prototype),"renderChildren",this).call(this,e),e.drawPhase===je.c.MAP&&this._fade(e.displayLevel,e.state);var s=this.children.filter((function(e){return e.visible&&e.hasData()}));if(!s||0===s.length)return t.bindVAO(),t.setStencilTestEnabled(!0),void t.setBlendingEnabled(!0);var l,h=Object(a.a)(s);try{for(h.s();!(l=h.n()).done;){l.value.triangleCount=0}}catch(p){h.e(p)}finally{h.f()}t.setStencilWriteMask(0),t.setColorMask(!0,!0,!0,!0),t.setStencilOp(7680,7680,7681),t.setStencilTestEnabled(!0),t.setBlendingEnabled(!1),t.setDepthTestEnabled(!0),t.setDepthWriteEnabled(!0),t.setDepthFunction(515),t.setClearDepth(1),t.clear(t.gl.DEPTH_BUFFER_BIT),e.renderPass="opaque";for(var f=r.length-1;f>=0;f--)this._renderStyleLayer(r[f],e,s);t.setDepthWriteEnabled(!1),t.setBlendingEnabled(o),t.setBlendFunctionSeparate(1,771,1,771),e.renderPass="translucent";for(var v=0;v<r.length;v++)this._renderStyleLayer(r[v],e,s);t.setDepthTestEnabled(!1),e.renderPass="symbol";for(var d=0;d<r.length;d++)this._renderStyleLayer(r[d],e,s);t.bindVAO(),t.setStencilTestEnabled(!0),t.setBlendingEnabled(!0)}}},{key:"_fade",value:function(e,t){Object(b.k)(this._symbolFader)&&(this._symbolFader.update(e,t)||this.requestRender())}},{key:"_renderStyleLayer",value:function(e,t,n){var i=t.painter,r=t.renderPass;if(void 0!==e){var o=e.getLayoutProperty("visibility");if(!o||1!==o.getValue()){var s;switch(e.type){case 0:return;case 1:if("opaque"!==r&&"translucent"!==t.renderPass)return;s="vtlFill";break;case 2:if("translucent"!==r)return;s="vtlLine";break;case 4:if("symbol"!==r)return;s="vtlCircle";break;case 3:if("symbol"!==r)return;s="vtlSymbol"}if(n=3===e.type?n.filter((function(e){return e.decluttered})):n.filter((function(e){return e.neededForCoverage})),"vtlSymbol"!==s){var l=t.displayLevel;if(0===n.length||void 0!==e.minzoom&&e.minzoom>=l+Ce||void 0!==e.maxzoom&&e.maxzoom<l-Ce)return}var u=e.uid;t.styleLayerUID=u,t.styleLayer=e;var c,h=Object(a.a)(n);try{for(h.s();!(c=h.n()).done;){if(c.value.layerData.has(u)){i.renderObjects(t,n,s);break}}}catch(f){h.e(f)}finally{h.f()}}}}}
1,{key:"_renderBackgroundLayers",value:function(e,t){var n,i=e.context,r=e.displayLevel,o=e.painter,s=e.state,l=this._styleRepository,u=!1,c=Object(a.a)(t);try{for(c.s();!(n=c.n()).done;){var h=n.value;if(0===l.getLayerById(h).type&&Me(l.getLayerById(h),r)){u=!0;break}}}catch(V){c.e(V)}finally{c.f()}if(u){var f=this._tileInfoView.getTileCoverage(e.state,0,"smallest"),v=f.spans,d=f.lodInfo,p=d.level,y=Object(j.g)(),_=[];if(this._renderPasses){var m=this._renderPasses[0];Object(b.k)(this._clippingInfos)&&(m.brushes[0].prepareState(e,this._clippingInfos[0]),m.brushes[0].drawMany(e,this._clippingInfos))}var g,x,O=this._backgroundTiles,w=0,k=Object(a.a)(v);try{for(k.s();!(x=k.n()).done;)for(var S=x.value,P=S.row,T=S.colFrom,C=S.colTo,M=T;M<=C;M++){if(w<O.length)(g=O[w]).key.set(p,P,d.normalizeCol(M),d.getWorldForColumn(M)),this._tileInfoView.getTileBounds(y,g.key,!1),g.x=y[0],g.y=y[3];else{var I=new Z.a(p,P,d.normalizeCol(M),d.getWorldForColumn(M)),L=this._tileInfoView.getTileBounds(Object(j.g)(),I);g=new Pe(I,L[0],L[3],512,512,4096,4096),O.push(g)}g.setTransform(s,this._tileInfoView.getTileResolution(g.key)),_.push(g),w++}}catch(V){k.e(V)}finally{k.f()}i.setStencilWriteMask(0),i.setColorMask(!0,!0,!0,!0),i.setStencilOp(7680,7680,7681),i.setStencilFunction(514,0,255);var A=!0;e.drawPhase===je.c.HITTEST&&(A=!1),i.setStencilTestEnabled(A);var D,z=Object(a.a)(t);try{for(z.s();!(D=z.n()).done;){var R=D.value,E=l.getLayerById(R);0===E.type&&Me(E,r)&&(e.styleLayerUID=E.uid,e.styleLayer=E,o.renderObjects(e,_,"vtlBackground"))}}catch(V){z.e(V)}finally{z.f()}J.a.pool.release(f)}}}]),n}(Te.a),Le=n(746),Ae=n(579),De=n(29),ze=n(639),Re=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(e){var i;return Object(s.a)(this,n),(i=t.call(this)).requestRender=i.requestRender.bind(Object(De.a)(i)),i._layerView=e,i._canvas=document.createElement("canvas"),i._context=i._canvas.getContext("2d"),i._bitmap=new ze.a(null,"standard",!1),i.addChild(i._bitmap),i}return Object(l.a)(n,[{key:"doRender",value:function(e){var t=e.state,i=this._createCustomRenderParams(e),r=this._canvas,a=this._bitmap,o=window.devicePixelRatio;r.width=t.size[0]*o,r.height=t.size[1]*o,a.resolution=t.resolution;var s=t.clone();s.pixelRatio=o,a.pixelRatio=o,i.state=s,a.x=t.viewpoint.targetGeometry.x-Math.abs(t.extent.xmax-t.extent.xmin)/2,a.y=t.viewpoint.targetGeometry.y+Math.abs(t.extent.ymax-t.extent.ymin)/2,this._layerView.render(i),a.source=r,a.rotation=t.rotation,Object(u.a)(Object(c.a)(n.prototype),"doRender",this).call(this,Object(P.a)(Object(P.a)({},e),{},{state:s}))}},{key:"_createCustomRenderParams",value:function(e){return{globalOpacity:e.globalOpacity,state:e.state,stationary:e.stationary,pixelRatio:window.devicePixelRatio,context:this._context}}}]),n}(n(661).a),Ee=n(212),Ve=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(){var e;return Object(s.a)(this,n),(e=t.apply(this,arguments))._fullCacheLodInfos=null,e._levelByScale={},e}return Object(l.a)(n,[{key:"getTileParentId",value:function(e){var t=Z.a.pool.acquire(e),n=0===t.level?null:Z.a.getId(t.level-1,t.row>>1,t.col>>1,t.world);return Z.a.pool.release(t),n}},{key:"getTileCoverage",value:function(e,t,i){var r=Object(u.a)(Object(c.a)(n.prototype),"getTileCoverage",this).call(this,e,t,i);if(!r)return r;var a=1<<r.lodInfo.level;return r.spans=r.spans.filter((function(e){return e.row>=0&&e.row<a})),r}},{key:"scaleToLevel",value:function(e){if(this._fullCacheLodInfos||this._initializeFullCacheLODs(this._lodInfos),this._levelByScale[e])return this._levelByScale[e];var t,n,i=this._fullCacheLodInfos;if(e>i[0].scale)return i[0].level;for(var r=0;r<i.length-1;r++)if(e>(n=i[r+1]).scale)return(t=i[r]).level+(t.scale-e)/(t.scale-n.scale);return i[i.length-1].level}},{key:"_initializeFullCacheLODs",value:function(e){var t;if(0===e[0].level)t=e.map((function(e){return{level:e.level,resolution:e.resolution,scale:e.scale}}));else{var n=this.tileInfo.size[0],i=this.tileInfo.spatialReference;t=Ee.a.create({size:n,spatialReference:i}).lods.map((function(e){return{level:e.level,resolution:e.resolution,scale:e.scale}}))}for(var r=0;r<t.length;r++)this._levelByScale[t[r].scale]=t[r].level;this._fullCacheLodInfos=t}}]),n}(n(403).a),Fe=n(472),Ue=n(578),Be=g.a.getLogger("esri.views.2d.layers.VectorTileLayerView2D"),Ne=function(e){Object(h.a)(n,e);var t=Object(f.a)(n);function n(){var e;return Object(s.a)(this,n),(e=t.apply(this,arguments))._styleChanges=[],e._fetchQueue=null,e._parseQueue=null,e._isTileHandlerReady=!1,e.fading=!1,e}return Object(l.a)(n,[{key:"initialize",value:function(){var e=this,t=this.layer.tileInfo;if((t&&t.spatialReference).equals(this.view.spatialReference)){var n=this.layer.currentStyleInfo.style;this._styleRepository=new Le.a(n),this._tileInfoView=new Ve(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Ie(this._tileInfoView),this._tileHandler=new X(this.layer,this._styleRepository,window.devicePixelRatio||1),this.container.addChild(this._vectorTileContainer),this.handles.add([this._vectorTileContainer.on("fade-start",(function(){e.fading=!0,e.notifyChange("updating"),e.requestUpdate()})),this._vectorTileContainer.on("fade-complete",(function(){e._collisionBoxesDisplay&&e._collisionBoxesDisplay.requestRender(),e.fading=!1,e.notifyChange("updating"),e.requestUpdate()})),Object(O.a)(this.layer,"symbolCollisionBoxesVisible",(function(t){t?(e._collisionBoxesDisplay=new Re({render:function(t){return e._renderCollisionBoxes(t.context)}}),e.container.addChild(e._collisionBoxesDisplay)):(e.container.removeChild(e._collisionBoxesDisplay),e._collisionBoxesDisplay=null)}))])}else this.addResolvingPromise(Promise.reject(new _.a("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer})))}},{key:"destroy",value:function(){var e;this._stop(),this.container.removeAllChildren(),this._vectorTileContainer&&(this._vectorTileContainer.destroy(),this._vectorTileContainer=null),null==(e=this._tileHandler)||e.destroy(),this._tileHandler=null}},{key:"hitTest",value:function(){var e=Object(o.a)(d.a.mark((function e(t,n){var i,r,a,o,s,l;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._tileHandlerPromise){e.next=2;break}return e.abrupt("return",null);case 2:return e.next=4,this._tileHandlerPromise;case 4:return e.next=6,this._vectorTileContainer.hitTest(n);case 6:if((i=e.sent)&&0!==i.length){e.next=9;break}return e.abrupt("return",null);case 9:if(r=i[0]-1,a=this._styleRepository,o=a.getStyleLayerByUID(r)){e.next=12;break}return e.abrupt("return",null);case 12:return s=a.getStyleLayerIndex(o.id),l=new y.a({attributes:{layerId:s,layerName:o.id,layerUID:r}}),e.abrupt("return",(l.layer=this.layer,l.sourceLayer=this.layer,[l]));case 14:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"update",value:function(e){if(this._tileHandlerPromise&&this._isTileHandlerReady)return e.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=e.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=e.state,this._parseQueue.state=e.state,this._tileManager.update(e)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}},{key:"attach",value:function(){var e=this;this._start(),this.handles.add([this.layer.on("paint-change",(function(t){if(t.isDataDriven)e._styleChanges.push({type:0,data:t}),e.notifyChange("updating"),e.requestUpdate();else{var n=e._styleRepository,i=n.getLayerById(t.layer);if(!i)return;var r=3===i.type;n.setPaintProperties(t.layer,t.paint),r&&e._vectorTileContainer.restartDeclutter(),e._vectorTileContainer.requestRender()}})),this.layer.on("layout-change",(function(t){var n=e._styleRepository,i=n.getLayerById(t.layer);if(i){var r=Object(S.a)(i.layout,t.layout);if(!Object(b.j)(r)){if(Object(S.b)(r,"visibility")&&1===function(e){if(Object(b.j)(e))return 0;switch(e.type){case"partial":return Object.keys(e.diff).length;case"complete":return Math.max(Object.keys(e.oldValue).length,Object.keys(e.newValue).length);case"collection":return Object.keys(e.added).length+Object.keys(e.changed).length+Object.keys(e.removed).length}}
1(r))return n.setLayoutProperties(t.layer,t.layout),3===i.type&&e._vectorTileContainer.restartDeclutter(),void e._vectorTileContainer.requestRender();e._styleChanges.push({type:1,data:t}),e.notifyChange("updating"),e.requestUpdate()}}})),this.layer.on("style-layer-visibility-change",(function(t){var n=e._styleRepository,i=n.getLayerById(t.layer);i&&(n.setStyleLayerVisibility(t.layer,t.visibility),3===i.type&&e._vectorTileContainer.restartDeclutter(),e._vectorTileContainer.requestRender())})),this.layer.on("style-layer-change",(function(t){e._styleChanges.push({type:2,data:t}),e.notifyChange("updating"),e.requestUpdate()})),this.layer.on("delete-style-layer",(function(t){e._styleChanges.push({type:3,data:t}),e.notifyChange("updating"),e.requestUpdate()})),this.layer.on("load-style",(function(){return e._loadStyle()}))],this.declaredClass)}},{key:"detach",value:function(){this._stop(),this.handles.remove(this.declaredClass)}},{key:"moveStart",value:function(){this.requestUpdate()}},{key:"viewChange",value:function(){this.requestUpdate()}},{key:"moveEnd",value:function(){this._collisionBoxesDisplay&&this._vectorTileContainer.restartDeclutter(),this.requestUpdate()}},{key:"canResume",value:function(){var e=Object(u.a)(Object(c.a)(n.prototype),"canResume",this).call(this),t=this.layer;if(e&&t.currentStyleInfo){var i=this.view.scale,r=t.currentStyleInfo;if(r&&r.layerDefinition){var a=r.layerDefinition;a.minScale&&a.minScale<i&&(e=!1),a.maxScale&&a.maxScale>i&&(e=!1)}}return e}},{key:"isUpdating",value:function(){var e=this._vectorTileContainer.children;return!this._isTileHandlerReady||!this._fetchQueue||!this._parseQueue||this._fetchQueue.updating||this._parseQueue.updating||e.length>0&&e.filter((function(e){return e.invalidating})).length>0||this.fading}},{key:"acquireTile",value:function(e){var t=this,n=this._createVectorTile(e);return this._tileHandlerPromise.then((function(){t._fetchQueue.push(n.key).then((function(e){return t._parseQueue.push({key:n.key,data:e})})).then((function(e){n.once("attach",(function(){return t.requestUpdate()})),n.setData(e),t.requestUpdate(),t.notifyChange("updating")})).catch((function(e){t.notifyChange("updating"),Object(x.l)(e)||Be.error(e)}))})),n}},{key:"releaseTile",value:function(e){var t=e.key.id;this._fetchQueue.abort(t),this._parseQueue.abort(t),this.requestUpdate()}},{key:"_start",value:function(){var e=this;if(this._stop(),this._tileManager=new $({acquireTile:function(t){return e.acquireTile(t)},releaseTile:function(t){return e.releaseTile(t)},tileInfoView:this._tileInfoView},this._vectorTileContainer),this.layer.currentStyleInfo){var t=new AbortController,n=this._tileHandler.start({signal:t.signal}).then((function(){e._fetchQueue=new Fe.a({tileInfoView:e._tileInfoView,process:function(t,n){return e._getTileData(t,n)},concurrency:15}),e._parseQueue=new Fe.a({tileInfoView:e._tileInfoView,process:function(t,n){return e._parseTileData(t,n)},concurrency:8}),e.requestUpdate(),e._isTileHandlerReady=!0}));this._tileHandler.spriteMosaic.then((function(t){e._vectorTileContainer.setStyleResources(t,e._tileHandler.glyphMosaic,e._styleRepository),e.requestUpdate()})),this._tileHandlerAbortController=t,this._tileHandlerPromise=n}}},{key:"_stop",value:function(){if(this._tileHandlerAbortController&&this._vectorTileContainer){var e=this._tileHandlerAbortController;e&&e.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue&&(this._fetchQueue.destroy(),this._fetchQueue=null),this._parseQueue&&(this._parseQueue.destroy(),this._parseQueue=null),this._tileManager&&(this._tileManager.destroy(),this._tileManager=null),this._vectorTileContainer.removeAllChildren()}}},{key:"_getTileData",value:function(){var e=Object(o.a)(d.a.mark((function e(t,n){var i;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._tileHandler.fetchTileData(t,n);case 2:return i=e.sent,e.abrupt("return",(this.notifyChange("updating"),i));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_parseTileData",value:function(){var e=Object(o.a)(d.a.mark((function e(t,n){return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._tileHandler.parseTileData(t,n));case 1:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_applyStyleChanges",value:function(){var e=Object(o.a)(d.a.mark((function e(){var t,n,i,r,o,s,l,u,c,h,f,v,p=this;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache(),t=this._styleChanges,e.prev=2,e.next=5,this._tileHandler.updateStyle(t);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),Be.error("error applying vector-tiles style update",e.t0.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0;case 10:if(n=this._styleRepository,i=[],t.forEach((function(e){if(3===e.type){var t=e.data,r=n.getLayerById(t.layer);r&&i.push(r.uid)}})),r=[],t.forEach((function(e){var t=e.type,i=e.data;switch(t){case 0:n.setPaintProperties(i.layer,i.paint),o=i.layer;break;case 1:n.setLayoutProperties(i.layer,i.layout),o=i.layer;break;case 3:return void n.deleteStyleLayer(i.layer);case 2:n.setStyleLayer(i.layer,i.index),o=i.layer.id}var a=n.getLayerById(o);a&&r.push(a.uid)})),s=this._vectorTileContainer.children,i.length>0){this._vectorTileContainer.deleteStyleLayers(i),l=Object(a.a)(s);try{for(l.s();!(u=l.n()).done;)u.value.deleteLayerData(i)}
1catch(d){l.e(d)}finally{l.f()}}if(this._fetchQueue.resume(),this._parseQueue.resume(),!(r.length>0)){e.next=22;break}c=[],h=Object(a.a)(s);try{for(v=function(){var e=f.value,t=p._fetchQueue.push(e.key).then((function(t){return p._parseQueue.push({key:e.key,data:t,styleLayerUIDs:r})})).then((function(t){return e.setData(t)}));c.push(t)},h.s();!(f=h.n()).done;)v()}catch(d){h.e(d)}finally{h.f()}return e.next=22,Promise.all(c);case 22:this._styleChanges=[],this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate();case 23:case"end":return e.stop()}}),e,this,[[2,7]])})));return function(){return e.apply(this,arguments)}}()},{key:"_loadStyle",value:function(){var e=Object(o.a)(d.a.mark((function e(){var t,n,i,r;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.layer.currentStyleInfo.style,n=Object(m.a)(t),this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this.notifyChange("updating"),this._styleRepository=new Le.a(n),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController,i=this._tileHandlerAbortController.signal,e.prev=3,this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,n),e.next=7,this._tileHandlerPromise;case 7:e.next=13;break;case 9:if(e.prev=9,e.t0=e.catch(3),Object(x.l)(e.t0)){e.next=13;break}throw e.t0;case 13:if(!i.aborted){e.next=15;break}return e.abrupt("return",(this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),void this.requestUpdate()));case 15:return e.next=17,this._tileHandler.spriteMosaic;case 17:r=e.sent,this._vectorTileContainer.setStyleResources(r,this._tileHandler.glyphMosaic,this._styleRepository),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate();case 19:case"end":return e.stop()}}),e,this,[[3,9]])})));return function(){return e.apply(this,arguments)}}()},{key:"_createVectorTile",value:function(e){var t=this._tileInfoView.getTileBounds(Object(j.g)(),e);return new pe(e,t[0],t[3],512,512,this._styleRepository)}},{key:"_renderCollisionBoxes",value:function(e){var t,n=Object(a.a)(this._vectorTileContainer.children);try{for(n.s();!(t=n.n()).done;){var o=t.value;if(o.symbols){var s,l=[],u=Object(a.a)(o.symbols);try{for(u.s();!(s=u.n()).done;){var c=Object(r.a)(s.value,2),h=(c[0],c[1]);l.push.apply(l,Object(i.a)(h))}}catch(f){u.e(f)}finally{u.f()}Y(e,l)}}}catch(f){n.e(f)}finally{n.f()}}}]),n}(Object(Ae.a)(Ue.a));Object(p.a)([Object(w.b)()],Ne.prototype,"_fetchQueue",void 0),Object(p.a)([Object(w.b)()],Ne.prototype,"_parseQueue",void 0),Object(p.a)([Object(w.b)()],Ne.prototype,"_isTileHandlerReady",void 0),Object(p.a)([Object(w.b)()],Ne.prototype,"fading",void 0);var Ge=Ne=Object(p.a)([Object(k.a)("esri.views.2d.layers.VectorTileLayerView2D")],Ne)}}]);
2//# sourceMappingURL=52.7dbdf2be.chunk.js.map

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