(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-11343bbf"],{"0c53":function(t,e,i){"use strict";i.d(e,"a",(function(){return l})),i.d(e,"b",(function(){return h}));var s=i("b2cd"),r=i("c120");const n=128e3;let o=null,a=null;async function l(){return o||(o=c()),o}async function c(){const t=Object(r["a"])("esri-csp-restrictions")?await i.e("chunk-038b6711").then(i.bind(null,"a546")).then(t=>t.l):await i.e("chunk-47c1d7bd").then(i.bind(null,"cfdc")).then(t=>t.l);a=await t.load({locateFile:()=>Object(s["b"])("esri/core/libs/libtess/libtess.wasm")})}function h(t,e){const i=Math.max(t.length,n);return a.triangulate(t,e,i)}},"0ec3":function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return S}));var s=i("a4ee"),r=i("f57e"),n=(i("ce50"),i("c120")),o=i("e92d"),a=i("b2b2"),l=i("f4cc"),c=(i("cea0"),i("b50f"),i("2dd4"),i("d386")),h=i("0f1c"),u=i("5996"),f=i("175e"),d=i("69c3"),m=i("2779"),y=i("0f0f2"),p=i("601e"),x=i("32b6"),_=i("ba46");class g{constructor(t){this._remoteClient=t,this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null}destroy(){}async fetchResource(t,e){const i=this._resourceMap,s=i.get(t);if(s)return s;let r=this._inFlightResourceMap.get(t);if(r)return r;try{r=this._remoteClient.invoke("tileRenderer.fetchResource",{url:t},{...e}),this._inFlightResourceMap.set(t,r),r.then(e=>(this._inFlightResourceMap.delete(t),i.set(t,e),e))}catch(n){return Object(l["m"])(n)?null:{width:0,height:0}}return r}getResource(t){var e;return null!=(e=this._resourceMap.get(t))?e:null}}function b(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}function v(t){const e=t.message,i={message:{data:{},tileKey:e.tileKey,tileKeyOrigin:e.tileKeyOrigin},transferList:new Array};for(const s in e.data){const t=e.data[s];if(i.message.data[s]=null,Object(a["k"])(t)){const e=t.stride,r=t.indices.slice(0),n=t.vertices.slice(0),o=t.records.slice(0),l={stride:e,indices:r,vertices:n,records:o,metrics:Object(a["b"])(t.metrics,t=>t.slice(0))};i.transferList.push(r,n,o),i.message.data[s]=l}}return i}o["a"].getLogger("esri.views.2d.layers.features.processors.SymbolProcessor");let O=class extends _["a"]{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new g(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(t){this._bufferIds.forEach(e=>{e.forEach(t)})}async update(t,e){const i=e.schema.processors[0];if("symbol"!==i.type)return;const s=Object(h["a"])(this._schema,i);Object(h["b"])(s,"mesh")&&(Object(n["a"])("esri-2d-update-debug")&&console.debug("Applying Update - Processor:",s),t.mesh=!0,t.why.mesh.push("Symbology changed"),this._schema=i,this._factory=this._createFactory(i),this._factory.update(i,this.tileStore.tileScheme.tileInfo))}onTileMessage(t,e,i,s){return Object(l["v"])(s),this._onTileData(t,e,i,s)}onTileClear(t){const e={clear:!0};return this._bufferData.delete(t.key.id),this._bufferIds.delete(t.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e})}onTileError(t,e,i){const s=i.signal,r={tileKey:t.id,error:e};return this.remoteClient.invoke("tileRenderer.onTileError",r,{signal:s})}onTileUpdate(t){for(const e of t.removed)this._bufferData.has(e.key.id)&&this._bufferData.delete(e.key.id),this._bufferIds.has(e.key.id)&&this._bufferIds.delete(e.key.id);for(const e of t.added)this._bufferData.forEach(t=>{for(const i of t)i.message.tileKey===e.id&&this._updateTileMesh("append",e,v(i),[],!1,!1,null)})}_addBufferData(t,e){this._bufferData.has(t)||this._bufferData.set(t,[]),this._bufferData.get(t).push(v(e))}_createFactory(t){const{geometryType:e,objectIdField:i,fields:s}=this.service,r=(t,e)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",t,e),n={geometryType:e,fields:s,spatialReference:u["a"].fromJSON(this.spatialReference)},o=new y["a"](r,this.tileStore.tileScheme.tileInfo),{matcher:l,aggregateMatcher:c}=t.mesh;return this._store=o,this._matchers.feature=Object(p["a"])(l,o,n,this._resourceManagerProxy),this._matchers.aggregate=Object(a["b"])(c,t=>Object(p["a"])(t,o,n,this._resourceManagerProxy)),new m["a"](e,i,o)}async _onTileData(t,e,i,s){Object(l["v"])(s);const{type:r,addOrUpdate:n,remove:o}=e,c=e.end,h=!!this._schema.mesh.sortKey;if(!n){const e={type:r,addOrUpdate:null,remove:o,clear:!1,end:c,sort:h};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e},s)}const u=this._processFeatures(t,n,i,s);try{const i=await u;if(Object(a["j"])(i)){const e={type:r,addOrUpdate:null,remove:o,clear:!1,end:c,sort:h};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e},s)}const n=[];for(const e of i){let i=!1;const s=e.message.bufferIds,r=t.key.id,o=e.message.tileKey;if(r!==o&&Object(a["k"])(s)){if(!this.tileStore.get(o)){this._addBufferData(r,e),n.push(e);continue}let t=this._bufferIds.get(o);t||(t=new Set,this._bufferIds.set(o,t));const a=Array.from(s);for(const e of a){if(t.has(e)){i=!0;break}t.add(e)}}i||(this._addBufferData(r,e),n.push(e))}await Object(l["b"])(n.map(i=>{const n=t.key.id===i.message.tileKey,o=n?e.remove:[],a=n&&e.end;return this._updateTileMesh(r,t,i,o,a,e.clear,s.signal)}))}catch(f){this._handleError(t,f,s)}}async _updateTileMesh(t,e,i,s,r,n,o){const c=t,h=i.message.tileKey,u=!!this._schema.mesh.sortKey;h!==e.key.id&&(r=!1);const f=Object(a["b"])(i,t=>t.message),d=Object(a["b"])(i,t=>t.transferList)||[],m={type:c,addOrUpdate:f,remove:s,clear:!1,end:r,sort:u},y={transferList:Object(a["t"])(d)||[],signal:o};return Object(l["v"])(y),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:h,data:m},y)}async _processFeatures(t,e,i,s){if(Object(a["j"])(e)||!e.hasFeatures)return null;const r={transform:t.transform,hasZ:!1,hasM:!1},n=this._factory,o={viewingMode:"",scale:t.scale},c=await this._matchers.feature,h=await this._matchers.aggregate;Object(l["v"])(s);const u=this._getLabelInfos(t,e);return await n.analyze(e.getCursor(),this._resourceManagerProxy,c,h,r,o),Object(l["v"])(s),this._writeFeatureSet(t,e,r,u,n,i)}_writeFeatureSet(t,e,i,s,r,n){const o=e.getSize(),l=new d["a"](t.key.id,{features:o,records:o,metrics:0},this._schema.mesh.matcher.stride,n,!0),c={viewingMode:"",scale:t.scale},h=e.getCursor();for(;h.next();)try{const e=h.getDisplayId(),n=Object(a["k"])(s)?s.get(e):null;r.writeCursor(l,h,i,c,t.level,n,this._resourceManagerProxy)}catch(f){}const u=t.tileInfoView.tileInfo.isWrappable;return l.serialize(u)}_handleError(t,e,i){if(!Object(l["m"])(e)){const s={tileKey:t.id,error:e.message};return this.remoteClient.invoke("tileRenderer.onTileError",s,{signal:i.signal})}}_getLabelingSchemaForScale(t){const e=this._schema.mesh.labels;if(Object(a["j"])(e))return null;if("subtype"===e.type){const i={type:"subtype",classes:{}};let s=!1;for(const r in e.classes){const n=e.classes[r].filter(e=>b(e,t.scale));s=s||!!n.length,i.classes[r]=n}return s?i:null}const i=e.classes.filter(e=>b(e,t.scale));return i.length?{type:"simple",classes:i}:null}_getLabels(t,e){if("subtype"===e.type){var i;const s=this.service.subtypeField,r=Object(a["v"])(s,"Expected to find subtype Field"),n=t.readAttribute(r);return null==n?[]:null!=(i=e.classes[n])?i:[]}return e.classes}_getLabelInfos(t,e){const i=this._getLabelingSchemaForScale(t);if(Object(a["j"])(i))return null;const s=new Map,n=e.getCursor();for(;n.next();){const t=n.getDisplayId(),e=[],o=Object(f["h"])(t),a=o&&1!==n.readAttribute("cluster_count")?"aggregate":"feature",l=this._getLabels(n,i);for(const i of l){if(i.target!==a)continue;const s=n.getStorage(),l=o&&"feature"===a?s.getComputedStringAtIndex(n.readAttribute("referenceId"),i.fieldIndex):s.getComputedStringAtIndex(t,i.fieldIndex);if(!l)continue;const c=Object(r["a"])(l.toString()),h=c[0],u=c[1];this._store.getMosaicItem(i.symbol,Object(x["a"])(h)).then(t=>{e[i.index]={glyphs:t.glyphMosaicItems,rtl:u,index:i.index}})}s.set(t,e)}return s}};O=Object(s["a"])([Object(c["a"])("esri.views.2d.layers.features.processors.SymbolProcessor")],O);const S=O},"0f0f2":function(t,e,i){"use strict";i.d(e,"a",(function(){return le})),i.d(e,"b",(function(){return oe}));var s=i("ce50"),r=i("e92d"),n=i("f4cc"),o=i("8246"),a=i("c84e"),l=i("18c6"),c=i("b2b2"),h=i("a915"),u=i("a9a2"),f=i("8c81"),d=i("1d01"),m=i("d114"),y=i("6a2c"),p=i("6655"),x=(i("9812"),i("0c53")),_=i("8152"),g=i("3976"),b=i("2da5");function v(t,e,i,s,r,n,o){$=0;const a=(s-i)*n,l=r&&r.length,c=l?(r[0]-i)*n:a;let h,u,f,d,m,y=O(e,i,s,0,c,n,!0);if(y&&y.next!==y.prev){if(l&&(y=I(e,i,s,r,y,n)),a>80*n){h=f=e[0+i*n],u=d=e[1+i*n];for(let t=n;t0)for(let l=s;l=s;l-=n)a=L(l+e*n,t[l+e*n],t[l+1+e*n],a);return a&&D(a,a.next)&&(P(a),a=a.next),a}function S(t,e=t){if(!t)return t;let i,s=t;do{if(i=!1,s.steiner||!D(s,s.next)&&0!==E(s.prev,s,s.next))s=s.next;else{if(P(s),s=e=s.prev,s===s.next)break;i=!0}}while(i||s!==e);return e}function M(t,e,i,s,r,n,o,a){if(!t)return;!a&&n&&(t=k(t,s,r,n));let l=t;for(;t.prev!==t.next;){const c=t.prev,h=t.next;if(n?j(t,s,r,n):w(t))e.push(c.index/i+o),e.push(t.index/i+o),e.push(h.index/i+o),P(t),t=h.next,l=h.next;else if((t=h)===l){a?1===a?M(t=G(t,e,i,o),e,i,s,r,n,o,2):2===a&&X(t,e,i,s,r,n,o):M(S(t),e,i,s,r,n,o,1);break}}}function w(t){const e=t.prev,i=t,s=t.next;if(E(e,i,s)>=0)return!1;let r=t.next.next;const n=r;let o=0;for(;r!==t.prev&&(0===o||r!==n);){if(o++,F(e.x,e.y,i.x,i.y,s.x,s.y,r.x,r.y)&&E(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function j(t,e,i,s){const r=t.prev,n=t,o=t.next;if(E(r,n,o)>=0)return!1;const a=r.xn.x?r.x>o.x?r.x:o.x:n.x>o.x?n.x:o.x,h=r.y>n.y?r.y>o.y?r.y:o.y:n.y>o.y?n.y:o.y,u=B(a,l,e,i,s),f=B(c,h,e,i,s);let d=t.prevZ,m=t.nextZ;for(;d&&d.z>=u&&m&&m.z<=f;){if(d!==t.prev&&d!==t.next&&F(r.x,r.y,n.x,n.y,o.x,o.y,d.x,d.y)&&E(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,m!==t.prev&&m!==t.next&&F(r.x,r.y,n.x,n.y,o.x,o.y,m.x,m.y)&&E(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;d&&d.z>=u;){if(d!==t.prev&&d!==t.next&&F(r.x,r.y,n.x,n.y,o.x,o.y,d.x,d.y)&&E(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;m&&m.z<=f;){if(m!==t.prev&&m!==t.next&&F(r.x,r.y,n.x,n.y,o.x,o.y,m.x,m.y)&&E(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function L(t,e,i,s){const r=Y.create(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function P(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function T(t){let e=t,i=t;do{(e.x=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=s&&t>o){if(o=t,t===s){if(r===i.y)return i;if(r===i.next.y)return i.next}n=i.x=i.x&&i.x>=l&&s!==i.x&&F(rn.x)&&W(i,t)&&(n=i,u=h)),i=i.next;return n}function k(t,e,i,s){for(let r;r!==t;r=r.next){if(r=r||t,null===r.z&&(r.z=B(r.x,r.y,e,i,s)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,k(t,e,i,s);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,R(t)}function R(t){let e,i=1;for(;;){let s,r=t;t=null,e=null;let n=0;for(;r;){n++,s=r;let o=0;for(;o0||a>0&&s;){let i;0===o?(i=s,s=s.nextZ,a--):0!==a&&s?r.z<=s.z?(i=r,r=r.nextZ,o--):(i=s,s=s.nextZ,a--):(i=r,r=r.nextZ,o--),e?e.nextZ=i:t=i,i.prevZ=e,e=i}r=s}if(e.nextZ=null,i*=2,n<2)return t}}function E(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function A(t,e,i,s){return!!(D(t,e)&&D(i,s)||D(t,s)&&D(i,e))||E(t,e,i)>0!=E(t,e,s)>0&&E(i,s,t)>0!=E(i,s,e)>0}function V(t,e){let i=t;do{if(i.index!==t.index&&i.next.index!==t.index&&i.index!==e.index&&i.next.index!==e.index&&A(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function N(t,e,i,s,r,n){let o=0;for(let a=s,l=r-n;a=0&&(t-o)*(s-a)-(i-o)*(e-a)>=0&&(i-o)*(n-a)-(r-o)*(s-a)>=0}function W(t,e){return E(t.prev,t,t.next)<0?E(t,e,t.next)>=0&&E(t,t.prev,e)>=0:E(t,e,t.prev)<0||E(t,t.next,e)<0}function B(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-s)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t,e){return t.x===e.x&&t.y===e.y}function U(t,e){return t.x-e.x}function G(t,e,i,s){let r=t;do{const n=r.prev,o=r.next.next;!D(n,o)&&A(n,r,r.next,o)&&W(n,o)&&W(o,n)&&(e.push(n.index/i+s),e.push(r.index/i+s),e.push(o.index/i+s),P(r),P(r.next),r=t=o),r=r.next}while(r!==t);return r}function X(t,e,i,s,r,n,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.index!==t.index&&K(a,t)){let l=H(a,t);return a=S(a,a.next),l=S(l,l.next),M(a,e,i,s,r,n,o,0),void M(l,e,i,s,r,n,o,0)}t=t.next}a=a.next}while(a!==t)}function K(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!V(t,e)&&W(t,e)&&W(e,t)&&Z(t,e)}function Z(t,e){let i=t,s=!1;const r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}function H(t,e){const i=Y.create(t.index,t.x,t.y),s=Y.create(e.index,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}class Y{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,i){const s=$0))break;r+=o,c.push(a+e),e+=n}const h=o.length;v(o,i,a,a+e,c,2,n);const u=st(o,i,h,o.length,n),f=Math.abs(r);if(Math.abs((u-f)/Math.max(1e-7,f))>Q)return o.length=0,!1;l=t,a+=e}return!0}function nt(t){const{coords:e,lengths:i}=t,{buffer:s}=Object(x["b"])(e,i);return s}function ot(t,e,i){let s=0;for(let r=0;ri||oi)return!0}s+=n}return!1}function at(t,e){if(Object(c["j"])(t))return null;if(!ot(t,-128,f["P"]+128))return t;tt.setPixelMargin(e),tt.reset(g["a"].Polygon);let i=0;for(let o=0;or||hr){o=!0;continue}e.push({x:c,y:h})}let u=!1;const f=l.length;for(let t=1;tr||hr){u=!0;break}e.push({x:c,y:h})}if(u)o=!0;else{if(o){const t=i.resultWithStarts();if(t)for(const e of t)n.push(e)}else n.push({line:e,start:0});a++,o=!1}}return n=n.filter(t=>t.line.length>1),0===n.length?null:n}tt.setExtent(f["P"]),et.setExtent(f["P"]);var ct=i("ab39"),ht=i("c8dd"),ut=i("2629");const ft=8,dt=16,mt=65535,yt=t=>class extends t{constructor(...t){super(...t),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=a["d"].LINE}writeGeometry(t,e,i,s){this._writeGeometry(t,e,i,s)}_initializeTessellator(t){const e=l["c"].load(this._materialKey),i=l["a"].load(this._materialKey),s=this._tessellationOptions,r=e.vvSizeFieldStops||e.vvSizeMinMaxValue||e.vvSizeScaleStops||e.vvSizeUnitValue,n=this.tessellationProperties._halfWidth(s,r,n,o,a,l,c,h,u,f,d)=>{const y=Object(m["a"])(d,Math.ceil(dt*t._halfWidth)),p=Object(m["b"])(Math.round(dt*c),Math.round(dt*h),Math.round(dt*u),Math.round(dt*f)),x=Object(m["b"])(dt*a,dt*l,0,t._bitset),_=t.out;return _.vertexBounds(s,r,e,i),_.vertexWrite(Object(m["a"])(ft*s,ft*r)),_.vertexWrite(t.id),_.vertexWrite(t._fillColor),_.vertexWrite(p),_.vertexWrite(y),_.vertexWrite(t._tl),_.vertexWrite(t._br),_.vertexWrite(x),_.vertexWrite(Object(m["a"])(Math.ceil(dt*t._halfReferenceWidth),0)),_.vertexWrite(t.minMaxZoom),_.vertexEnd(),t.offset+t.vertexCount++},xt=(t,e,i)=>(s,r,n,o,a,l,c,h,u,f,d)=>{const y=Object(m["b"])(0,0,dt*t._halfWidth,dt*t._halfReferenceWidth),p=Object(m["b"])(dt*c+128,dt*h+128,dt*u+128,dt*f+128),x=t.out,_=t._bitset<<24|t.id;return x.vertexBounds(s,r,e,i),x.vertexWrite(Object(m["a"])(ft*s,ft*r)),x.vertexWrite(_),x.vertexWrite(t._fillColor),t.key.simple||(x.vertexWrite(0),x.vertexWrite(0)),x.vertexWrite(y),x.vertexWrite(p),t.key.simple||x.vertexWrite(t.minMaxZoom),x.vertexEnd(),t.offset+t.vertexCount++},_t=t=>(e,i,s)=>{const r=t.out;r.indexWrite(e),r.indexWrite(i),r.indexWrite(s),t.indexCount+=3};var gt=i("f75e");const bt=r["a"].getLogger("esri.views.2d.engine.webgl.WGLLineTemplate");class vt extends(yt(gt["a"])){constructor(t,e,i,s,r,n,o,a,c,h,u,d,p,x,_,g,b,v,O){super();const S=l["c"].load(t);e&&(S.sdf=e.sdf,S.pattern=!0,S.textureBinding=e.textureBinding),this._capType=s,this._joinType=r,this._miterLimitCosine=Object(y["d"])(n),this.tessellationProperties._fillColor=o,this.tessellationProperties._tl=a,this.tessellationProperties._br=c,this._hasPattern=h,this._isDashed=u,this._zOrder=g,this._effects=b,this._minMaxZoom=Object(m["a"])(Math.round(v*f["w"]),Math.round(O*f["w"])),this._materialKey=S.data;const M=(p?f["g"]:0)|(x?f["m"]:0)|(d?f["h"]:0);this.tessellationProperties._bitset=M,this.tessellationProperties._halfWidth=.5*i,this.tessellationProperties._halfReferenceWidth=.5*_,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(t,e,i){const s=t.color,r=t.scaleFactor||1,n=!!t.dashTemplate;let o=t.cap;n&&o===ct["d"].ROUND&&(o=ct["d"].SQUARE);const a=t.join,l=Object(h["g"])(t.width)*r,c=Object(h["g"])(t.referenceWidth),d=Object(h["g"])(t.miterLimit),p=s&&Object(u["c"])(s)||0,[x,_]=Object(y["e"])(t.scaleInfo,i),g=!1;if(!e)return new vt(t.materialKey,e,l,o,a,d,p,0,0,!1,n,t.scaleDash,t.colorLocked,g,c,t.zOrder,t.effects,x,_);const{rect:b,width:v,height:O}=e,S=b.x+f["A"],M=b.y+f["A"],w=S+v,j=M+O,L=Object(m["a"])(S,M),P=Object(m["a"])(w,j),T=!1;return new vt(t.materialKey,e,l,o,a,d,p,L,P,!0,n,t.scaleDash,t.colorLocked,T,c,t.zOrder,t.effects,x,_)}static fromFillOutline(t){var e;return t.isOutlinedFill&&t.outline&&"esriSLSSolid"===(null==(e=t.outline)?void 0:e.style)?vt.fromSimpleLine({hash:"",materialKey:t.materialKey,...t.outline},null,!0):null}static fromSimpleLine(t,e,i=!1){const{color:s}=t,r="esriSLSSolid"!==t.style&&"esriSLSNull"!==t.style,n=Object(ht["i"])(t.cap||"round"),o=Object(ht["j"])(t.join||"round");let a=s&&"esriSLSNull"!==t.style&&Object(u["d"])(s)||0;"esriSLSNull"===t.style&&(a=0);const l=Object(h["g"])(t.width),c=t.miterLimit;if(!e)return new vt(t.materialKey,e,l,n,o,c,a,0,0,!1,r,!0,!1,i,l,0,null,y["b"],y["a"]);const{rect:d,width:p,height:x}=e,_=d.x+f["A"],g=d.y+f["A"],b=_+p,v=g+x,O=Object(m["a"])(_,g),S=Object(m["a"])(b,v);return new vt(t.materialKey,e,l,n,o,c,a,O,S,!0,r,!0,!1,i,l,0,null,y["b"],y["a"])}static fromPictureLineSymbol(t,e,i,s){return bt.error("PictureLineSymbol support does not exist!"),null}}const Ot=100,St=1,Mt=t=>class extends t{constructor(...t){super(...t),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=a["d"].FILL}_maybeAddLineTemplate(t){this._lineTemplate=vt.fromFillOutline(t)}_write(t,e,i,s){const r="esriGeometryPoint"===e.geometryType,n=l["a"].load(this._materialKey);t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(t,e,n,s,r),n.outlinedFill&&Object(c["k"])(this._lineTemplate)&&this._lineTemplate.writeGeometry(t,e,s,r),t.recordEnd()}_writeGeometry(t,e,i,s,r){const n=this._getGeometry(e,s,r);if(Object(c["j"])(n))return;const o=[];if(!(n.maxLength>Ot)&&!this.forceLibtess&&rt(o,n))return void(o.length&&this._writeVertices(t,e,n.coords,n.lengths,i,o));const a=nt(n);this._writeVertices(t,e,a,[a.length/2],i)}_writeVertex(t,e,i,s,r,n){const o=Object(m["a"])(St*s,St*r);t.vertexBounds(s,r,0,0),t.vertexWrite(o),t.vertexWrite(e),i.dotDensity?t.vertexWriteF32(1/Math.abs(n.readGeometryArea())):(t.vertexWrite(this.fillColor),i.simple||(t.vertexWrite(this.tl),t.vertexWrite(this.br)),t.vertexWrite(this.aux2),t.vertexWrite(this.aux3),i.simple||t.vertexWrite(this._minMaxZoom))}_writeVertices(t,e,i,s,r,n){const o=e.getDisplayId(),a=this._bitset<<24|o,l=s.reduce((t,e)=>t+e),c=r.dotDensity?4:10,h=t.vertexCount();t.vertexEnsureSize(c*l);let u=0;if(n)for(const f of n){const s=i[2*f],n=i[2*f+1];this._writeVertex(t,a,r,s,n,e),u++}else for(let f=0;f0,o=e.readLegacyFeature(),a=this._materialCache,l=this._cimLayer.materialHash;if(!l)return Lt.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const c="function"==typeof l?l(o,i,s):l;if(a.has(c)){const t=a.get(c);return Promise.resolve(t)}const h=this._ongoingMaterialRequestMap.get(c);if(h)return h;const u=this._cimLayer,f=Object(wt["a"])(u.cim,this._cimLayer.materialOverrides);f.mosaicHash=c;const{type:d,url:m}=u,y={cim:f,type:d,mosaicHash:c,url:m,size:null,dashTemplate:null,text:null,fontName:null};switch(d){case"marker":y.size=Object(jt["d"])(u.size,o,i,s);break;case"line":y.dashTemplate=u.dashTemplate;break;case"text":y.text=Object(jt["d"])(u.text,o,i,s),y.fontName=Object(jt["d"])(u.fontName,o,i,s)}const p=t.getMosaicItem(y,r).then(t=>(n||(this._ongoingMaterialRequestMap.delete(c),a.set(c,t)),t)).catch(t=>(this._ongoingMaterialRequestMap.delete(c),Lt.error(".analyze()",t.message),null));return n||this._ongoingMaterialRequestMap.set(c,p),p}}var Tt=i("1aa6");const It=128;class zt extends(Mt(Pt)){constructor(t,e,i){var s;if(super(t),this._minMaxZoom=Object(m["a"])(Math.round(e*f["w"]),Math.round(i*f["w"])),Object(y["f"])(t.color)){const e=(e,i,s)=>{const r=t.color(e,i,s);return r&&Object(u["c"])(r)||0};this._dynamicPropertyMap.set("fillColor",e)}else{const e=t.color;this.fillColor=e&&Object(u["c"])(e)||0}const r="CIMMarkerPlacementInsidePolygon"===(null==(s=t.cim.placement)?void 0:s.type)&&t.cim.placement.shiftOddRows?2:1,n=t.height;if(Object(y["f"])(n)){const t=(t,e,i)=>n(t,e,i)*r;this._dynamicPropertyMap.set("_height",t)}else this._height=(n||0)*r;const o=t.offsetX;if(Object(y["f"])(o)){const t=(t,e,i)=>{let s=Object(h["g"])(o(t,e,i))+It;return s>255?s=255:s<0&&(s=0),s};this._dynamicPropertyMap.set("_offsetX",t)}else{let t=Object(h["g"])(o||0)+It;t>255?t=255:t<0&&(t=0),this._offsetX=t}const a=t.offsetY;if(Object(y["f"])(a)){const t=(t,e,i)=>{let s=Object(h["g"])(-a(t,e,i))+It;return s>255?s=255:s<0&&(s=0),s};this._dynamicPropertyMap.set("_offsetY",t)}else{let t=Object(h["g"])(-a||0)+It;t>255?t=255:t<0&&(t=0),this._offsetY=t}const p=t.scaleX;Object(y["f"])(p)?this._dynamicPropertyMap.set("_scaleX",p):this._scaleX=p||1;const x=t.angle;if(Object(y["f"])(x)){const t=(t,e,i)=>Object(d["d"])(x(t,e,i));this._dynamicPropertyMap.set("_angle",t)}else this._angle=Object(d["d"])(x)||0;if(Object(c["k"])(t.effects)){const e=t.effects;Object(y["f"])(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}this._cimFillLayer=t,this._fillMaterialKey=l["a"].load(t.materialKey)}static fromCIMFill(t,e){const[i,s]=Object(y["e"])(t.scaleInfo,e);return new zt(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)});const r=this._fillMaterialKey,n=this._materialCache,o=(0,this._cimFillLayer.materialHash)(s,e,i),a=n.get(o);let l=null;if(a&&Object(Tt["a"])(a.spriteMosaicItem)&&(l=a.spriteMosaicItem),l){const{rect:t,width:e,height:i}=l,s=t.x+f["A"],n=t.y+f["A"],o=s+e,a=n+i;let c=Math.round(Object(h["g"])(this._height));c>255?c=255:c<=0&&(c=a-n);let u=Math.round(Object(h["g"])(this._height/i*e||0));u>255?u=255:u<=0&&(u=o-s);const d=this._scaleX,y=1;this.tl=Object(m["a"])(s,n),this.br=Object(m["a"])(o,a),this.aux2=Object(m["b"])(u,c,this._offsetX,this._offsetY),this.aux3=Object(m["b"])(d,y,this._angle,0),r.sdf=l.sdf,r.pattern=!0,r.textureBinding=l.textureBinding}else this.tl=0,this.br=0,this.aux2=0,this.aux3=0,r.sdf=!1,r.pattern=!1,r.textureBinding=0;this._materialKey=r.data}}class Ct extends(yt(Pt)){constructor(t,e,i){super(t),this._minMaxZoom=Object(m["a"])(Math.round(e*f["w"]),Math.round(i*f["w"])),this._cimLineLayer=t;let s=0;Object(y["f"])(t.width)||(s=.5*Object(h["g"])(t.width));const r=(e,i,r)=>Object(y["f"])(t.width)?.5*Object(h["g"])(t.width(e,i,r)):s;this._dynamicPropertyMap.set("_halfWidth",r),Object(y["f"])(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,Object(y["f"])(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join;const n=t.color;if(Object(y["f"])(n)){const t=(t,e,i)=>Object(u["c"])(n(t,e,i));this._dynamicPropertyMap.set("_fillColor",t)}else this._fillColor=n&&Object(u["c"])(n)||0;const o=t.miterLimit;if(Object(y["f"])(o)){const t=(t,e,i)=>Object(y["d"])(o(t,e,i));this._dynamicPropertyMap.set("_miterLimitCosine",t)}else this._miterLimitCosine=Object(y["d"])(o);if(Object(c["k"])(t.effects)){const e=t.effects;Object(y["f"])(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}this._scaleFactor=t.scaleFactor||1,this._isDashed=null!=t.dashTemplate,this.tessellationProperties._bitset=(t.colorLocked?1:0)|(t.scaleDash?1:0)<<1,this._materialKey=t.materialKey,this._initializeTessellator(!0)}static fromCIMLine(t,e){const[i,s]=Object(y["e"])(t.scaleInfo,e);return new Ct(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)}),this._halfWidth*=this._scaleFactor;const r=this._materialCache,n=(0,this._cimLineLayer.materialHash)(s,e,i),o=r.get(n);let a=null;if(o&&Object(Tt["a"])(o.spriteMosaicItem)&&(a=o.spriteMosaicItem),a){this._hasPattern=!0;const{rect:t,width:e,height:i}=a,s=t.x+f["A"],r=t.y+f["A"],n=s+e,o=r+i;this.tessellationProperties._tl=Object(m["a"])(s,r),this.tessellationProperties._br=Object(m["a"])(n,o)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const c=l["c"].load(this._materialKey);a&&(c.sdf=a.sdf,c.pattern=!0,c.textureBinding=a.textureBinding),this._materialKey=c.data}}var kt=i("2c63"),Rt=i("738e"),Et=i("f93c");const At=Object(Rt["a"])(),Vt=Object(kt["a"])(),Nt=r["a"].getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate");class Ft extends(Object(Et["a"])(Pt)){constructor(t,e,i){super(t),this._cimMarkerLayer=t,this._minMaxZoom=Object(m["a"])(Math.round(e*f["w"]),Math.round(i*f["w"]));const s=t.color;if(Object(y["f"])(s)){const t=(t,e,i)=>Object(u["c"])(s(t,e,i));this._dynamicPropertyMap.set("_fillColor",t)}else this._fillColor=Object(u["c"])(s);const r=t.outlineColor;if(Object(y["f"])(r)){const t=(t,e,i)=>Object(u["c"])(r(t,e,i));this._dynamicPropertyMap.set("_outlineColor",t)}else this._outlineColor=Object(u["c"])(r);const n=t.size;if(Object(y["f"])(n)){const t=(t,e,i)=>Object(h["g"])(n(t,e,i));this._dynamicPropertyMap.set("_size",t)}else this._size=Object(h["g"])(n)||0;const o=t.scaleX;Object(y["f"])(o)?this._dynamicPropertyMap.set("_scaleX",o):this._scaleX=o||1;const a=t.offsetX;if(Object(y["f"])(a)){const t=(t,e,i)=>Object(h["g"])(a(t,e,i));this._dynamicPropertyMap.set("xOffset",t)}else this.xOffset=Object(h["g"])(a)||0;const l=t.offsetY;if(Object(y["f"])(l)){const t=(t,e,i)=>Object(h["g"])(l(t,e,i));this._dynamicPropertyMap.set("yOffset",t)}else this.yOffset=Object(h["g"])(l)||0;const d=t.outlineWidth;if(Object(y["f"])(d)){const t=(t,e,i)=>Object(h["g"])(d(t,e,i));this._dynamicPropertyMap.set("_outlineWidth",t)}else this._outlineWidth=Object(h["g"])(d)||0;const p=t.rotation;if(Object(y["f"])(p)?this._dynamicPropertyMap.set("_angle",p):this._angle=p||0,Object(c["k"])(t.effects)){const e=t.effects;Object(y["f"])(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}if(Object(c["k"])(t.markerPlacement)){const e=t.markerPlacement;Object(y["f"])(e)?this._dynamicPropertyMap.set("_markerPlacement",e):this._markerPlacement=e}this._scaleFactor=Object(c["u"])(t.scaleFactor,1),this._bitSet=(t.alignment===ct["a"].MAP?1:0)|(t.colorLocked?1:0)<<1|(t.scaleSymbolsProportionally?1:0)<<3,this._materialKey=t.materialKey}static fromCIMMarker(t,e){const[i,s]=Object(y["e"])(t.scaleInfo,e);return new Ft(t,i,s)}bindFeature(t,e,i){const r=t.readLegacyFeature();this._dynamicPropertyMap.forEach((t,s)=>{this[s]=t(r,e,i)});const n=this._cimMarkerLayer.materialHash,o="function"==typeof n?n(r,e,i):n,a=this._materialCache.get(o);if(!a||!Object(Tt["a"])(a.spriteMosaicItem)||!a.spriteMosaicItem)return void Nt.error(new s["a"]("mapview-cim","Encountered an error when binding feature"));const c=a.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,d=c.width/c.height*this._scaleX,y=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let p=this._size,x=p*d;const _=this.xOffset,g=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const b=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/Object(h["g"])(this._cimMarkerLayer.frameHeight):1,v=this._outlineWidth*b,O=Object(h["g"])(this._cimMarkerLayer.referenceSize);let S=0,M=0;const w=this._cimMarkerLayer.anchorPoint;w&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(S=-w.x/(this._size*d),M=w.y/this._size):(S=w.x,M=w.y)),this._sizeOutlineWidth=Object(m["b"])(Math.round(Math.min(Math.sqrt(128*x),255)),Math.round(Math.min(Math.sqrt(128*p),255)),Math.round(Math.min(Math.sqrt(128*v),255)),Math.round(Math.min(Math.sqrt(128*O),255))),this.angle=y;const j=Math.round(64*u);this._bitestAndDistRatio=Object(m["a"])(this._bitSet,j);const L=c.rect.x+f["A"],P=c.rect.y+f["A"],T=L+c.width,I=P+c.height;this._texUpperLeft=Object(m["a"])(L,P),this._texUpperRight=Object(m["a"])(T,P),this._texBottomLeft=Object(m["a"])(L,I),this._texBottomRight=Object(m["a"])(T,I);const z=l["d"].load(this._materialKey);z.sdf=c.sdf,z.pattern=!0,z.textureBinding=c.textureBinding,this._materialKey=z.data,this._anchorX=.5-(.5+S)*c.width/c.width,this._anchorY=.5-(.5+M)*c.height/c.height,x*=u,p*=u,x*=this._scaleFactor,p*=this._scaleFactor,x*=c.rect.width/c.width,p*=c.rect.height/c.height,this._computedWidth=x,this._computedHeight=p,this._applyTransformation(Vt,At),this.xOffset=_,this.yOffset=g}}var Wt=i("32dd"),Bt=i("44d1"),Dt=i("32b6");const Ut=5;function Gt(t,e,i,s){return"string"==typeof t.text?t.text:"function"==typeof t.text?t.text(e,i,s):""}class Xt extends(Object(Bt["a"])(Pt)){constructor(t,e,i){super(t),this._horizontalAlignment="center",this._verticalAlignment="middle",this._textToGlyphs=new Map,this._minMaxZoom=Object(m["a"])(Math.round(e*f["w"]),Math.round(i*f["w"]));const s=t.scaleFactor||1;this._cimTextLayer=t;const r=t.color;if(Object(y["f"])(r)){const t=(t,e,i)=>Object(u["c"])(r(t,e,i));this._dynamicPropertyMap.set("_color",t)}else this._color=Object(u["c"])(r);const n=t.outlineColor;if(Object(y["f"])(n)){const t=(t,e,i)=>Object(u["c"])(n(t,e,i));this._dynamicPropertyMap.set("_haloColor",t)}else this._haloColor=Object(u["c"])(n);let o;Object(y["f"])(t.size)||(o=Math.min(Math.round(Object(h["g"])(t.size*t.sizeRatio)),127));const a=(e,i,s)=>Object(y["f"])(t.size)?Math.min(Math.round(Object(h["g"])(t.size(e,i,s)*t.sizeRatio)),127):o;if(this._dynamicPropertyMap.set("_size",a),Object(y["f"])(t.outlineSize)){const e=(e,i,s)=>Math.min(Math.floor(Ut*Object(h["g"])(t.outlineSize(e,i,s)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",e)}else this._haloSize=Math.min(Math.floor(Ut*Object(h["g"])(t.outlineSize*t.sizeRatio)),127);let d;Object(y["f"])(t.offsetX)||(d=Math.round(Object(h["g"])(t.offsetX*t.sizeRatio)));const p=(e,i,s)=>Object(y["f"])(t.offsetX)?Math.round(Object(h["g"])(t.offsetX(e,i,s)*t.sizeRatio)):d;let x;this._dynamicPropertyMap.set("_xOffset",p),Object(y["f"])(t.offsetY)||(x=Math.round(Object(h["g"])(t.offsetY*t.sizeRatio)));const _=(e,i,s)=>Object(y["f"])(t.offsetY)?Math.round(Object(h["g"])(t.offsetY(e,i,s)*t.sizeRatio)):x;if(this._dynamicPropertyMap.set("_yOffset",_),Object(y["f"])(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,Object(y["f"])(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,Object(y["f"])(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,Object(c["k"])(t.effects)){const e=t.effects;Object(y["f"])(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}if(Object(c["k"])(t.markerPlacement)){const e=t.markerPlacement;Object(y["f"])(e)?this._dynamicPropertyMap.set("_markerPlacement",e):this._textPlacement=e}Object(y["f"])(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text,this._scaleFactor=s;const g=Math.min(Math.round(Object(h["g"])(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*g)),this._materialKey=t.materialKey;const b=l["f"].load(this._materialKey);b.sdf=!0,this._bitset=(t.alignment===ct["a"].MAP?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=b.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(t,e){const[i,s]=Object(y["e"])(t.scaleInfo,e);return new Xt(t,i,s)}async analyze(t,e,i,s){const r=e.readLegacyFeature(),n=Gt(this._cimTextLayer,r,i,s),o=await super.analyze(t,e,i,s,Object(Dt["a"])(n));return o&&o.glyphMosaicItems&&this._textToGlyphs.set(n,o.glyphMosaicItems),o}bindFeature(t,e,i){const s=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach((t,r)=>{this[r]=t(s,e,i)}),!this._text||0===this._text.length)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/f["r"],this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=Object(Wt["e"])(this._horizontalAlignment||"center"),this._yAlignD=Object(Wt["g"])(this._verticalAlignment||"baseline");const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}const Kt=128;class Zt extends(Mt(gt["a"])){constructor(t,e,i,s,r,n,o,a,c,h,u,d,y,p,x,_){super(),this._effects=p;const g=l["a"].load(t);e&&(g.sdf=e.sdf,g.pattern=!0,g.textureBinding=e.textureBinding),this.fillColor=i,this.tl=s,this.br=r,this.aux2=Object(m["b"])(n,o,a,c),this.aux3=Object(m["b"])(h,u,d,0),this._bitset=y,this._minMaxZoom=Object(m["a"])(Math.round(x*f["w"]),Math.round(_*f["w"])),this._materialKey=g.data}static fromCIMFill(t,e,i){const s=t.color,r=s&&Object(u["c"])(s)||0,n=t.materialKey,[o,a]=Object(y["e"])(t.scaleInfo,i);if(!e)return new Zt(n,null,r,0,0,0,0,0,0,0,0,0,t.colorLocked?f["g"]:0,t.effects,o,a);const{rect:l,width:c,height:p}=e,x=t.scaleX||1,_=l.x+f["A"],g=l.y+f["A"],b=_+c,v=g+p,O=t.height,S=x*O;let M=Math.round(O);M>255?M=255:M<=0&&(M=v-g);let w=Math.round(S);w>255?w=255:w<=0&&(w=b-_);let j=Object(h["g"])(t.offsetX||0)+Kt;j>255&&(j=255);let L=Object(h["g"])(-t.offsetY||0)+Kt;L>255&&(L=255);const P=Object(m["a"])(_,g),T=Object(m["a"])(b,v);return new Zt(n,e,r,P,T,w,M,j,L,Kt,Kt,Object(d["b"])(t.angle),t.colorLocked?f["g"]:0,t.effects,o,a)}static fromSimpleFill(t,e,i=!1){const{color:s}=t,r=s&&"esriSFSNull"!==t.style&&Object(u["d"])(s)||0,n=i?f["g"]:0,o=t.materialKey;let a;if(e){const{rect:t,width:i,height:s}=e,l=t.x+f["A"],c=t.y+f["A"],h=l+i,u=c+s,d=Object(m["a"])(l,c),p=Object(m["a"])(h,u);a=new Zt(o,e,r,d,p,i,s,0,0,Kt,Kt,0,n,null,y["b"],y["a"])}else a=new Zt(o,null,r,0,0,0,0,0,0,0,0,0,n,null,y["b"],y["a"]);return a._maybeAddLineTemplate(t),a}static fromPictureFill(t,e,i=!1){const s=f["z"],{rect:r,width:n,height:o}=e,a=r.x+f["A"],l=r.y+f["A"],c=a+n,u=l+o,d=Object(m["a"])(a,l),p=Object(m["a"])(c,u);let x=Math.round(Object(h["g"])(t.width));x>255&&(x=255);let _=Math.round(Object(h["g"])(t.height));_>255&&(_=255);let g=Object(h["g"])(t.xoffset)+Kt;g>255&&(g=255);let b=Object(h["g"])(-t.yoffset)+Kt;b>255&&(b=255);const v=t.materialKey,O=i?f["g"]:0,S=new Zt(v,e,s,d,p,x,_,g,b,Kt*t.xscale,Kt*t.yscale,0,O,null,y["b"],y["a"]);return S._maybeAddLineTemplate(t),S}}var Ht=i("a8b5"),Yt=i("89e8");class qt{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){if(!this._resolver)return this._resolver=Object(n["g"])(),Promise.resolve();await this._resolver.promise,await this.acquire()}release(){const t=this._resolver;this._resolver=null,t.resolve()}}async function Jt(t,e,i){try{await t.acquire(),await e(i),t.release()}catch(s){throw t.release(),s}}var $t=i("f47d");const Qt=r["a"].getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),te=new Array,ee={isOutline:!1,isOutlinedFill:!1,placement:null,stride:{fill:"default"},vvFlags:0},ie={...o["g"],hash:JSON.stringify(o["g"]),materialKey:Object(l["g"])(a["d"].MARKER,ee)},se={...o["i"],hash:JSON.stringify(o["i"]),materialKey:Object(l["g"])(a["d"].LINE,ee)},re={...o["h"],hash:JSON.stringify(o["h"]),materialKey:Object(l["g"])(a["d"].FILL,ee)};function ne(t,e){const i=t.length;return t.push(null),e.then(e=>t[i]=e),t}function oe(t){return!!(1&t)}function ae(t){return"worker:port-closed"===t.name}class le{constructor(t,e){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new qt,this._fetchResource=t,this._tileInfo=e}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(t,e){this._initErrorTemplates();const i=t.hash;if(this._symbolToTemplate.has(i))return this._symbolToTemplate.get(i);const s=new Array;e&&this._createMeshTemplates(s,e,!0),this._createMeshTemplates(s,t,!1);const r=this._createGroupId("expanded-cim"===t.type&&ce(t));return this._idToTemplateGroup.set(r,s),this._symbolToTemplate.set(i,r),r}getTemplateGroup(t){return this._idToTemplateGroup.has(t)?this._idToTemplateGroup.get(t):te}getDynamicTemplateGroup(t){return this._idToTemplateGroup.has(t)?(oe(t)||Qt.error("mapview-template-store",`Id ${t} does not refer to a dynamic template`),this._idToTemplateGroup.get(t)):te}getMosaicItem(t,e){const i=this._createTemplateId(),s=new Promise(t=>this._idToResolver.set(i,t));return this._fetchQueue.push({symbol:t,id:i,glyphIds:e}),s}finalize(t){return this._fetchQueue.length||this._lock.isHeld()?Jt(this._lock,this._fetchAllQueuedResources.bind(this),t):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],re,!1),marker:this._createMeshTemplates([],ie,!1),line:this._createMeshTemplates([],se,!1)})}_fetchAllQueuedResources(t){if(!this._fetchQueue.length)return Promise.resolve();const e=this._fetchQueue,i=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(i).then(()=>this._fetchResource(e,t).then(t=>{for(const{id:e,mosaicItem:i}of t)this._idToResolver.get(e)(i),this._idToResolver.delete(e)})).catch(t=>{Object(n["m"])(t)?this._fetchQueue=this._fetchQueue.concat(e):ae(t)||Qt.error(new s["a"]("mapview-template-store","Unable to fetch requested texture resources",t))})}_createGroupId(t){return this._idCounter++<<1|(t?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(Tt["a"])(e,Qt)?Ht["a"].fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(Tt["a"])(e,Qt)?Ht["a"].fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(Tt["a"])(i,Qt)?Zt.fromSimpleFill(t,i,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(Tt["a"])(i,Qt)?Zt.fromPictureFill(t,i,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return Object(Tt["a"])(i,Qt)?vt.fromSimpleLine(t,i):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return Object(Tt["a"])(e,Qt)?Ht["a"].fromLineSymbolMarker(t,e):this._markerError}async _createTS(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t);return Yt["a"].fromText(t,e)}async _createCIMText(t){const{glyphMosaicItems:e}=await this.getMosaicItem(Object($t["a"])(t),Object(Dt["a"])(t.text));return Object(Tt["a"])(e,Qt)?Yt["a"].fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Object($t["a"])(t));return Object(Tt["a"])(e,Qt)?Zt.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Object($t["a"])(t));return Object(Tt["a"])(e,Qt)?vt.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Object($t["a"])(t));return Object(Tt["a"])(e,Qt)?Ht["a"].fromCIMMarker(t,e,this._tileInfo):this._markerError}async _createCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let i;switch(t.type){case"marker":i=await this._createCIMMarker(t);break;case"line":i=await this._createCIMLine(t);break;case"fill":i=await this._createCIMFill(t);break;case"text":i=await this._createCIMText(t)}return this._cimTemplateCache.set(e,i),i}async _createDynamicCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let i;switch(t.type){case"marker":i=Ft.fromCIMMarker(t,this._tileInfo);break;case"line":i=Ct.fromCIMLine(t,this._tileInfo);break;case"fill":i=zt.fromCIMFill(t,this._tileInfo);break;case"text":i=Xt.fromCIMText(t,this._tileInfo)}return this._cimTemplateCache.set(e,i),i}_createPrimitiveMeshTemplates(t,e,i){switch(e.type){case"esriSMS":return ne(t,this._createSMS(e));case"esriPMS":return ne(t,this._createPMS(e));case"esriSFS":return ne(t,this._createSFS(e,i));case"line-marker":return ne(t,this._createLMS(e));case"esriPFS":return ne(t,this._createPFS(e,i));case"esriSLS":return ne(t,this._createSLS(e,!1));case"esriTS":return ne(t,this._createTS(e));default:return Qt.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,i){if(-1!==e.type.indexOf("3d"))return Qt.error("3D symbols are not supported with MapView"),t;if("expanded-cim"===e.type){for(const i of e.layers)"function"==typeof i.materialHash?ne(t,this._createDynamicCIM(i)):ne(t,this._createCIM(i));return t}if("composite-symbol"===e.type){for(const s of e.layers)this._createPrimitiveMeshTemplates(t,s,i);return t}return"cim"===e.type||"label"===e.type||"web-style"===e.type?t:this._createPrimitiveMeshTemplates(t,e,i)}}const ce=t=>{if(!t.layers)return!1;for(const e of t.layers)if("function"==typeof e.materialHash)return!0;return!1}},"18c6":function(t,e,i){"use strict";i.d(e,"a",(function(){return z})),i.d(e,"b",(function(){return E})),i.d(e,"c",(function(){return k})),i.d(e,"d",(function(){return C})),i.d(e,"e",(function(){return j})),i.d(e,"f",(function(){return R})),i.d(e,"g",(function(){return w}));var s=i("ce50"),r=i("32dd"),n=i("c84e");function o(t,e){const i=n["e"].SIZE_FIELD_STOPS|n["e"].SIZE_MINMAX_VALUE|n["e"].SIZE_SCALE_STOPS|n["e"].SIZE_UNIT_VALUE,s=(t&(n["f"].FIELD_TARGETS_OUTLINE|n["f"].MINMAX_TARGETS_OUTLINE|n["f"].SCALE_TARGETS_OUTLINE|n["f"].UNIT_TARGETS_OUTLINE))>>>4;return e.isOutline||e.isOutlinedFill?i&s:i&~s}const a=0,l=8,c=7,h=8,u=11,f=11,d=12,m=13,y=14,p=15,x=15,_=16,g=17,b=18,v=19,O=20,S=21,M=22;function w(t,e){switch(t){case n["d"].FILL:return z.from(e);case n["d"].LINE:return k.from(e);case n["d"].MARKER:return C.from(e);case n["d"].TEXT:return R.from(e);case n["d"].LABEL:return E.from(e);default:throw new Error("Unable to createMaterialKey for unknown geometryType "+t)}}class j{constructor(t){this._data=0,this._data=t}static load(t){const e=this.shared;return e.data=t,e}set data(t){this._data=t}get data(){return this._data}get geometryType(){return this.bits(h,u)}set geometryType(t){this.setBits(t,h,u)}get mapAligned(){return!!this.bit(O)}set mapAligned(t){this.setBit(O,t)}get sdf(){return!!this.bit(f)}set sdf(t){this.setBit(f,t)}get pattern(){return!!this.bit(d)}set pattern(t){this.setBit(d,t)}get textureBinding(){return this.bits(a,l)}set textureBinding(t){this.setBits(t,a,l)}get geometryTypeString(){switch(this.geometryType){case n["d"].FILL:return"fill";case n["d"].MARKER:return"marker";case n["d"].LINE:return"line";case n["d"].TEXT:return"text";case n["d"].LABEL:return"label";default:throw new s["a"]("Unable to handle unknown geometryType: "+this.geometryType)}}setBit(t,e){const i=1<>t}setBits(t,e,i){for(let s=e,r=0;sclass extends t{get vvSizeMinMaxValue(){return 0!==this.bit(_)}set vvSizeMinMaxValue(t){this.setBit(_,t)}get vvSizeScaleStops(){return 0!==this.bit(g)}set vvSizeScaleStops(t){this.setBit(g,t)}get vvSizeFieldStops(){return 0!==this.bit(b)}set vvSizeFieldStops(t){this.setBit(b,t)}get vvSizeUnitValue(){return 0!==this.bit(v)}set vvSizeUnitValue(t){this.setBit(v,t)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(t,e){super.setVV(t,e);const i=o(t,e)&t;this.vvSizeMinMaxValue=!!(i&n["e"].SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(i&n["e"].SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(i&n["e"].SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(i&n["e"].SIZE_SCALE_STOPS)}},P=t=>class extends t{get vvRotation(){return 0!==this.bit(p)}set vvRotation(t){this.setBit(p,t)}hasVV(){return super.hasVV()||this.vvRotation}setVV(t,e){super.setVV(t,e),this.vvRotation=!e.isOutline&&!!(t&n["e"].ROTATION)}},T=t=>class extends t{get vvColor(){return 0!==this.bit(m)}set vvColor(t){this.setBit(m,t)}hasVV(){return super.hasVV()||this.vvColor}setVV(t,e){super.setVV(t,e),this.vvColor=!e.isOutline&&!!(t&n["e"].COLOR)}},I=t=>class extends t{get vvOpacity(){return 0!==this.bit(y)}set vvOpacity(t){this.setBit(y,t)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(t,e){super.setVV(t,e),this.vvOpacity=!e.isOutline&&!!(t&n["e"].OPACITY)}};class z extends(T(I(L(j)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n["d"].FILL,e.dotDensity="dot-density"===t.stride.fill,e.simple="simple"===t.stride.fill,e.outlinedFill=t.isOutlinedFill,e.dotDensity||e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),dotDensity:this.dotDensity,outlinedFill:this.outlinedFill,simple:this.simple,vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}get dotDensity(){return!!this.bit(x)}set dotDensity(t){this.setBit(x,t)}get simple(){return!!this.bit(M)}set simple(t){this.setBit(M,t)}get outlinedFill(){return!!this.bit(S)}set outlinedFill(t){this.setBit(S,t)}}z.shared=new z(0);class C extends(T(I(P(L(j))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n["d"].MARKER,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}C.shared=new C(0);class k extends(T(I(L(j)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n["d"].LINE,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}k.shared=new k(0);class R extends(T(I(P(L(j))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n["d"].TEXT,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}R.shared=new R(0);class E extends(L(j)){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n["d"].LABEL,e.setVV(t.vvFlags,t),e.mapAligned=Object(r["i"])(t.placement),e.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}E.shared=new E(0)},"1aa6":function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i("ce50");function r(t,e){if(t&&"name"in t){const i=t;return e&&e.error(new s["a"](i.name,i.message,i.details)),!1}return!0}},"1d01":function(t,e,i){"use strict";i.d(e,"a",(function(){return u})),i.d(e,"b",(function(){return c})),i.d(e,"c",(function(){return h})),i.d(e,"d",(function(){return l}));Number.POSITIVE_INFINITY;const s=Math.PI,r=128/s,n=256/360,o=1/Math.LN2;function a(t,e){return(t%=e)>=0?t:t+e}function l(t){return a(t*r,256)}function c(t){return a(t*n,256)}function h(t){return Math.log(t)*o}function u(t,e,i){return t>=e&&t<=i||t>=i&&t<=e}},2629:function(t,e,i){"use strict";i.d(e,"a",(function(){return y}));var s=i("ab39"),r=i("8c81");function n(t,e){return t.x===e.x&&t.y===e.y}function o(t){if(!t)return;const e=t.length;if(e<=1)return;let i=0;for(let s=1;si){r=!0;const t=(i-s)/u;u=i-s,e=(1-t)*n+t*e,a=(1-t)*o+t*a,--l}const f=this.writeVertex(n,o,0,0,c,h,h,-c,0,-1,s),d=this.writeVertex(n,o,0,0,c,h,-h,c,0,1,s);s+=u;const m=this.writeVertex(e,a,0,0,c,h,h,-c,0,-1,s),y=this.writeVertex(e,a,0,0,c,h,-h,c,0,1,s);this.writeTriangle(f,d,m),this.writeTriangle(d,m,y),n=e,o=a}}_tessellate(t,e){const i=t[0],r=t[t.length-1],o=n(i,r),y=o?3:2;if(t.length=0&&N>=0&&o>=0&&D(V,N,o),V=N,N=o,o};o&&(w=t[t.length-2],P.x=r.x-w.x,P.y=r.y-w.y,I=u(P),P.x/=I,P.y/=I);let G=!1;for(let n=0;nF&&(G=!0)),G){const e=(F-W)/T;T=F-W,w={x:(1-e)*w.x+e*t[n].x,y:(1-e)*w.y+e*t[n].y},--n}else w=t[n];S=w.x,M=w.y;const e=n<=0&&!G,i=n===t.length-1;if(e||(W+=T),j=i?o?t[1]:null:t[n+1],j?(P.x=j.x-S,P.y=j.y-M,I=u(P),P.x/=I,P.y/=I):(P.x=void 0,P.y=void 0),!o){if(e){l(z,P),C=z.x,k=z.y,x===s["d"].SQUARE&&(U(-P.y-P.x,P.x-P.y,P.x,P.y,0,-1),U(P.y-P.x,-P.x-P.y,P.x,P.y,0,1)),x===s["d"].ROUND&&(U(-P.y-P.x,P.x-P.y,P.x,P.y,-1,-1),U(P.y-P.x,-P.x-P.y,P.x,P.y,-1,1)),x!==s["d"].ROUND&&x!==s["d"].BUTT||(U(-P.y,P.x,P.x,P.y,0,-1),U(P.y,-P.x,P.x,P.y,0,1));continue}if(i){a(z,L),C=z.x,k=z.y,x!==s["d"].ROUND&&x!==s["d"].BUTT||(U(L.y,-L.x,-L.x,-L.y,0,-1),U(-L.y,L.x,-L.x,-L.y,0,1)),x===s["d"].SQUARE&&(U(L.y-L.x,-L.x-L.y,-L.x,-L.y,0,-1),U(-L.y-L.x,L.x-L.y,-L.x,-L.y,0,1)),x===s["d"].ROUND&&(U(L.y-L.x,-L.x-L.y,-L.x,-L.y,1,-1),U(-L.y-L.x,L.x-L.y,-L.x,-L.y,1,1));continue}}let r,y,B=-f(L,P);if(Math.abs(B)<.01)d(L,P)>0?(z.x=L.x,z.y=L.y,B=1,r=Number.MAX_VALUE,y=!0):(l(z,P),B=1,r=1,y=!1);else{z.x=(L.x+P.x)/B,z.y=(L.y+P.y)/B,r=u(z);const t=(r-1)*v*p;y=r>4||t>T&&t>I}C=z.x,k=z.y;let D=_;switch(_){case s["o"].BEVEL:r<1.05&&(D=s["o"].MITER);break;case s["o"].ROUND:rg&&(D=s["o"].BEVEL)}switch(D){case s["o"].MITER:if(U(z.x,z.y,-L.x,-L.y,0,-1),U(-z.x,-z.y,-L.x,-L.y,0,1),i)break;if(O){const t=G?0:W;V=this.writeVertex(S,M,C,k,P.x,P.y,z.x,z.y,0,-1,t),N=this.writeVertex(S,M,C,k,P.x,P.y,-z.x,-z.y,0,1,t)}break;case s["o"].BEVEL:{const t=B<0;let e,s,r,n;if(t){const t=V;V=N,N=t,e=R,s=E}else e=E,s=R;if(y)r=t?l(this.innerPrev,L):a(this.innerPrev,L),n=t?a(this.innerNext,P):l(this.innerNext,P);else{const e=t?h(this.inner,z):c(this.inner,z);r=e,n=e}const o=t?a(this.bevelStart,L):l(this.bevelStart,L);U(r.x,r.y,-L.x,-L.y,e.x,e.y);const u=U(o.x,o.y,-L.x,-L.y,s.x,s.y);if(i)break;const f=t?l(this.bevelEnd,P):a(this.bevelEnd,P);if(y){const t=this.writeVertex(S,M,C,k,-L.x,-L.y,0,0,0,0,W);V=this.writeVertex(S,M,C,k,P.x,P.y,n.x,n.y,e.x,e.y,W),N=this.writeVertex(S,M,C,k,P.x,P.y,f.x,f.y,s.x,s.y,W),this.writeTriangle(u,t,N)}else{if(O){const t=this.bevelMiddle;t.x=(o.x+f.x)/2,t.y=(o.y+f.y)/2,m(A,t,-L.x,-L.y),U(t.x,t.y,-L.x,-L.y,A.x,A.y),m(A,t,P.x,P.y),V=this.writeVertex(S,M,C,k,P.x,P.y,t.x,t.y,A.x,A.y,W),N=this.writeVertex(S,M,C,k,P.x,P.y,n.x,n.y,e.x,e.y,W)}else{const t=V;V=N,N=t}U(f.x,f.y,P.x,P.y,s.x,s.y)}if(t){const t=V;V=N,N=t}break}case s["o"].ROUND:{const t=B<0;let e,s;if(t){const t=V;V=N,N=t,e=R,s=E}else e=E,s=R;const n=t?h(this.inner,z):c(this.inner,z);let o,u;y?(o=t?l(this.innerPrev,L):a(this.innerPrev,L),u=t?a(this.innerNext,P):l(this.innerNext,P)):(o=n,u=n);const f=t?a(this.roundStart,L):l(this.roundStart,L),p=t?l(this.roundEnd,P):a(this.roundEnd,P),x=U(o.x,o.y,-L.x,-L.y,e.x,e.y),_=U(f.x,f.y,-L.x,-L.y,s.x,s.y);if(i)break;const g=this.writeVertex(S,M,C,k,-L.x,-L.y,0,0,0,0,W);y||this.writeTriangle(V,N,g);const b=h(this.outer,n),v=this.writeVertex(S,M,C,k,P.x,P.y,p.x,p.y,s.x,s.y,W);let w,j;const T=r>2;if(T){let e;r!==Number.MAX_VALUE?(b.x/=r,b.y/=r,e=d(L,b),e=(r*(e*e-1)+1)/e):e=-1,w=t?a(this.startBreak,L):l(this.startBreak,L),w.x+=L.x*e,w.y+=L.y*e,j=t?l(this.endBreak,P):a(this.endBreak,P),j.x+=P.x*e,j.y+=P.y*e}m(A,b,-L.x,-L.y);const I=this.writeVertex(S,M,C,k,-L.x,-L.y,b.x,b.y,A.x,A.y,W);m(A,b,P.x,P.y);const F=O?this.writeVertex(S,M,C,k,P.x,P.y,b.x,b.y,A.x,A.y,W):I,D=g,G=O?this.writeVertex(S,M,C,k,P.x,P.y,0,0,0,0,W):g;let X=-1,K=-1;if(T&&(m(A,w,-L.x,-L.y),X=this.writeVertex(S,M,C,k,-L.x,-L.y,w.x,w.y,A.x,A.y,W),m(A,j,P.x,P.y),K=this.writeVertex(S,M,C,k,P.x,P.y,j.x,j.y,A.x,A.y,W)),O?T?(this.writeTriangle(D,_,X),this.writeTriangle(D,X,I),this.writeTriangle(G,F,K),this.writeTriangle(G,K,v)):(this.writeTriangle(D,_,I),this.writeTriangle(G,F,v)):T?(this.writeTriangle(g,_,X),this.writeTriangle(g,X,K),this.writeTriangle(g,K,v)):(this.writeTriangle(g,_,I),this.writeTriangle(g,F,v)),y?(V=this.writeVertex(S,M,C,k,P.x,P.y,u.x,u.y,e.x,e.y,W),N=v):(V=O?this.writeVertex(S,M,C,k,P.x,P.y,u.x,u.y,e.x,e.y,W):x,this.writeTriangle(V,G,v),N=v),t){const t=V;V=N,N=t}break}}}}}},2779:function(t,e,i){"use strict";i.d(e,"a",(function(){return U}));i("c120");var s=i("b2b2"),r=i("f4cc"),n=i("0c53"),o=i("175e"),a=i("ce50"),l=i("e92d"),c=i("38a4"),h=i("a915"),u=i("ab39"),f=i("32dd"),d=i("a9a2"),m=i("8c81"),y=i("c84e"),p=i("d114"),x=i("18c6"),_=i("6a2c");function g(t,e){return t[e+1]}function b(t){return t.length-1}function v(t){let e=0;for(let i=0;it._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let i=Math.acos(e);return t>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1t)return this._seekBackwards(t-s);s+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>t)return this.seek(t-i,e);i+=this.length}return this._distance=1,e?this:null}}function M(t,e,i,s=!0){const r=v(t),n=S.create(t),o=r/2;if(!s)return n.seek(o),void i(n.clone(),0,o+0*e,r);const a=Math.max((r-e)/2,0),l=Math.floor(a/e),c=o-l*e;n.seek(c);for(let h=-l;h<=l;h++)n.x<512&&n.x>=0&&n.y<512&&n.y>=0&&i(n.clone(),h,o+h*e,r),n.seek(e)}function w(t,e){const i=e;for(let s=0;s=0&&!(r[s+1]r[u]+h);o++){const s=h-r[o-1]+r[u],c=r[o]-r[o-1],f=r[o]-r[u]P.error(new a["a"](e,t)),I=1,z=0,C=4;function k(t,e){const i=!!t.minScale&&e.scaleToZoom(t.minScale)||0;return Object(c["f"])(i,0,25.5)}function R(t,e){const i=!!t.maxScale&&e.scaleToZoom(t.maxScale)||255;return Object(c["f"])(i,0,25.5)}function E(t){const e=new Map;return i=>(e.has(i)||e.set(i,t(i)),e.get(i))}const A=E(t=>{let e=0;if(0===t)return 1/0;for(;!(t%2);)e++,t/=2;return e}),V=t=>Math.floor(127*t+127),N=t=>Math.floor(10*t),F=t=>Math.round(t*(254/360));class W extends L["a"]{constructor(t,e,i,s){var r,n,o;super(t,i.font.size,i.haloSize||0,i.font.size,i.color&&Object(d["d"])(i.color)||0,i.haloColor&&Object(d["d"])(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,Object(f["i"])(e.labelPlacement)?u["a"].MAP:u["a"].SCREEN,i.font.decoration,!1,i.angle||0,i.xoffset,i.yoffset,i.lineWidth,i.lineHeight,null,null,null,null,null),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=y["d"].LABEL,this._allowOverrun=null!=(r=e.allowOverrun)&&r,this._repeatLabel=null==(n=e.repeatLabel)||n,this._labelPosition=null!=(o=e.labelPosition)?o:"curved";const a=k(e,s),l=R(e,s),c=e.labelPlacement,[p,_]=Object(f["c"])(c);this._xAlignD=p,this._yAlignD=_,this._minZoom=a,this._maxZoom=l,this._refPlacementPadding=Object(h["g"])(i.haloSize)+m["N"],this._repeatLabelDistance=e.repeatLabelDistance?Object(h["g"])(e.repeatLabelDistance):128;const g=x["b"].load(t);g.sdf=!0,this._materialKey=g.data}static fromLabelClass(t,e){if("esriServerLinePlacementCenterAlong"===t.labelPlacement){const e=t.symbol;e.xoffset=0,e.yoffset=0,e.angle=0,e.font.decoration="none"}return new W(t.materialKey,t,t.symbol,e)}get _shapedBox(){return Object(s["t"])(this._shapingInfo).bounds}setZoomLevel(t){this._zoomLevel=t}bindReferenceTemplate(t){let e=Object(f["f"])(this._xAlignD),i=Object(f["h"])(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,Object(s["j"])(t))return void(this._refSymbolAndPlacementOffset=Object(p["b"])(0,0,V(e),V(i)));if("circle"===t.boundsType&&(e||i)){const t=Math.sqrt(e*e+i*i);e/=t,i/=t}const r=Math.max(t.height,t.width),n=this._refPlacementPadding*C;this._refSymbolAndPlacementOffset=Object(p["b"])(n,r,V(e),V(i)),this._referenceSize=r,this._refPlacementDirX=e,this._refPlacementDirY=i,this._refOffsetX=t.xOffset,this._refOffsetY=t.yOffset}_write(t,e){if(Object(s["j"])(this._shapingInfo))return;const i=this._shapingInfo,r=e.getDisplayId(),n="esriGeometryPolygon"===e.geometryType?e.readLegacyCentroid():e.readLegacyGeometry();if(n)switch(this.current={out:t,inId:r,inShaping:i,zoomLevel:this._zoomLevel},e.geometryType){case"esriGeometryPolyline":this._placeLineLabels(n);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(n);break;default:T("mapview-labeling",`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const i=N(this.current.zoomLevel);return N(t)<=i&&i<=N(e)}_placePointLabels(t){const{out:e,inId:i,inShaping:s}=this.current;this._writeGlyphs(e,i,t,s)}_placeLineLabels(t){const e=w(t.paths,this.current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),s=(this._shapedBox.width+this._repeatLabelDistance)/(1<=s);)this._placeOnSegment(n,e,o,i,-1,r),o+=n.length+z}_placeForward(t,e,i,s,r){const n=t.clone();let o=t.remainingLength+z;for(;n.next()&&!(o>=s);)this._placeOnSegment(n,e,o,i,1,r),o+=n.length+z}_placeFirst(t,e,i,s=!1){const r=t,n=this.current.inShaping,o=n.glyphs,a=this.current.zoomLevel,{out:l,inId:c}=this.current;for(const h of o){const o=h.x>n.bounds.x?i:1-i,u=o*t.remainingLength+(1-o)*t.backwardLength,f=Math.abs(h.x+h.width/2-n.bounds.x),d=Math.max(0,a+Math.log2(f/(u+z))),m=Math.max(e,s?0:d);if(h.maxZoom=25,h.angle=t.angle+(1-i)*Math.PI,h.minZoom=m,this._writeGlyph(l,c,r.x,r.y,h),i&&this._isVisible(h.minZoom,h.maxZoom)){const t=h.bounds;l.metricBoxWrite(t.center[0],t.center[1],t.width,t.height)}}}_placeOnSegment(t,e,i,s,r,n){const o=this.current.inShaping.glyphs,{out:a,inId:l}=this.current,c=this.current.inShaping,h=this.current.zoomLevel,u=t.dx/t.length,f=t.dy/t.length,d={x:t.x+i*-r*u,y:t.y+i*-r*f};for(const m of o){const o=m.x>c.bounds.x?n:1-n;if(!(o&&1===r||!o&&-1===r))continue;const u=Math.abs(m.x+m.width/2-c.bounds.x),f=Math.max(0,h+Math.log2(u/i)-.1),y=Math.max(s,h+Math.log2(u/(i+t.length+z)));if(0!==f&&(m.angle=t.angle+(1-n)*Math.PI,m.minZoom=y,m.maxZoom=f,this._writeGlyph(a,l,d.x,d.y,m),n&&this._isVisible(m.minZoom,m.maxZoom))){const i=m.bounds,s=t.x-e.x,r=t.y-e.y;a.metricBoxWrite(i.center[0]+s,i.center[1]+r,i.width,i.height)}}}_writeGlyphs(t,e,i,s,r=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;const n=i.x+this._refOffsetX,o=i.y-this._refOffsetY;for(const h of s.glyphs)h.minZoom=r,h.maxZoom=this._maxZoom,this._writeGlyph(t,e,n,o,h);const a=this._refPlacementDirX,l=this._refPlacementDirY,c=s.boundsT;t.metricStart(e,r,n,o,a,l,this._referenceSize,this._materialKey),t.metricBoxWrite(c.center[0],c.center[1],c.width,c.height),t.metricEnd()}_writeVertexCommon(t,e,i,s){const r=this._color,n=this._haloColor,o=Object(p["b"])(0,0,this._size,this._haloSize),a=Math.max(s.minZoom,this._minZoom),l=Math.min(s.maxZoom,this._maxZoom),c=Object(p["b"])(N(a),N(l),this._outLineLabelAngle,0);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(o),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(c)}}var B=i("a8b5"),D=i("0f0f2");class U{constructor(t,e,i){this._loadPromise=Object(n["a"])(),this._geometryType=t,this._idField=e,this._templateStore=i}update(t,e){Object(s["k"])(t.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(t.mesh.labels,e)),this._schema=t}_createLabelTemplates(t,e){const i=new Map;if("simple"===t.type){for(const s of t.classes){const t=W.fromLabelClass(s,e);i.set(s.index,t)}return i}for(const s in t.classes){const r=t.classes[s];for(const t of r){const s=W.fromLabelClass(t,e);i.set(t.index,s)}}return i}get templates(){return this._templateStore}async analyze(t,e,i,n,a,l,c){if(Object(r["n"])(c))return;let h;"dictionary"===i.type&&(h=await i.analyze(this._idField,t.copy(),e,a,l,c));let u=0;for(;t.next();){let e;if(e=h?h[u++]:Object(s["k"])(n)&&Object(o["h"])(t.getDisplayId())&&1!==t.readAttribute("cluster_count")?n.match(this._idField,t,this._geometryType,a,l):i.match(this._idField,t,this._geometryType,a,l),t.setGroupId(e),Object(D["b"])(e)){const i=this._templateStore.getDynamicTemplateGroup(e);for(const e of i)e&&e.analyze&&e.analyze(this._templateStore,t,a,l)}}return await this._loadPromise,this._templateStore.finalize(c)}async analyzeGraphics(t,e,i,s,n,o){if(Object(r["n"])(o))return;const a=t.getCursor();for(i&&await i.analyze(this._idField,a.copy(),e,s,n,o);a.next();){let t=a.getGroupId();if(null!=t&&-1!==t||(t=i.match(this._idField,a,a.geometryType,s,n),a.setGroupId(t)),Object(D["b"])(t)){const e=this._templateStore.getDynamicTemplateGroup(t);for(const t of e)t&&t.analyze&&t.analyze(this._templateStore,a,s,n)}a.setGroupId(t)}return await this._loadPromise,this._templateStore.finalize(o)}writeGraphic(t,e,i,s){const r=e.getGroupId(),n=e.getDisplayId(),o=this._templateStore.getTemplateGroup(r);if(t.featureStart(e.insertAfter,0),null!=n){if(Object(D["b"])(r))for(const t of o)t&&t.bindFeature(e,null,null);if(o){for(const r of o)r&&r.write(t,e,i,s);t.featureEnd()}}}writeCursor(t,e,i,r,n,o,a){const l=e.getGroupId(),c=e.getDisplayId(),h=this._templateStore.getTemplateGroup(l),u=this._schema.mesh.sortKey;let f=0;if(Object(s["k"])(u)&&(f=null!=u.fieldIndex?e.getComputedNumericAtIndex(u.fieldIndex):null!=u.field?e.readAttribute(u.field):e.readAttribute(this._idField),f*="asc"===u.order?1:-1),t.featureStart(0,null==f||isNaN(f)?0:f),null!=c&&h){if(Object(D["b"])(l))for(const t of h)t.bindFeature(e,i,r);for(const i of h)i.write(t,e,n,a);if(Object(s["k"])(o)&&t.hasRecords){const i=o&&this._findLabelRef(h);this._writeLabels(t,e,o,i,n,a)}t.featureEnd()}}_findLabelRef(t){for(const e of t)if(e instanceof B["a"])return e;return null}_writeLabels(t,e,i,r,n,o){for(const a of i)if(Object(s["k"])(a)&&a){const{glyphs:i,rtl:s,index:l}=a,c=this._labelTemplates.get(l);c.setZoomLevel(n),c.bindReferenceTemplate(r),c.bindTextInfo(i,s),c.write(t,e,null,o)}}}},"2da5":function(t,e,i){"use strict";i.d(e,"a",(function(){return c})),i.d(e,"b",(function(){return l}));var s,r=i("8c81"),n=i("3976"),o=i("1d01");class a{constructor(t,e,i){this.ratio=t,this.x=e,this.y=i}}class l{constructor(t,e,i,s=8,n=8){this.lines=[],this.starts=[],this.validateTessellation=!0,this.pixelRatio=s,this.pixelMargin=n,this.tileSize=r["P"]*s,this.dz=t,this.yPos=e,this.xPos=i}setPixelMargin(t){t!==this.pixelMargin&&(this.pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this.finalRatio=this.tileSize/t*(1<>this.dz;e>i&&(e=i),this.margin=e,this.xmin=i*this.xPos-e,this.ymin=i*this.yPos-e,this.xmax=this.xmin+i+2*e,this.ymax=this.ymin+i+2*e}reset(t){this.type=t,this.lines=[],this.starts=[],this.line=null,this.start=0}moveTo(t,e){this._pushLine(),this._prevIsIn=this._isIn(t,e),this._moveTo(t,e,this._prevIsIn),this._prevPt=new n["b"](t,e),this._firstPt=new n["b"](t,e),this._dist=0}lineTo(t,e){const i=this._isIn(t,e),s=new n["b"](t,e),r=n["b"].distance(this._prevPt,s);let o,l,c,h,u,f,d,m;if(i)this._prevIsIn?this._lineTo(t,e,!0):(o=this._prevPt,l=s,c=this._intersect(l,o),this.start=this._dist+r*(1-this._r),this._lineTo(c.x,c.y,!0),this._lineTo(l.x,l.y,!0));else if(this._prevIsIn)l=this._prevPt,o=s,c=this._intersect(l,o),this._lineTo(c.x,c.y,!0),this._lineTo(o.x,o.y,!1);else{const t=this._prevPt,e=s;if(t.x<=this.xmin&&e.x<=this.xmin||t.x>=this.xmax&&e.x>=this.xmax||t.y<=this.ymin&&e.y<=this.ymin||t.y>=this.ymax&&e.y>=this.ymax)this._lineTo(e.x,e.y,!1);else{const i=[];if((t.xthis.xmin||t.x>this.xmin&&e.x=this.ymax?f=!0:i.push(new a(h,this.xmin,m))),(t.xthis.xmax||t.x>this.xmax&&e.x=this.ymax?f=!0:i.push(new a(h,this.xmax,m))),(t.ythis.ymin||t.y>this.ymin&&e.y=this.xmax?u=!0:i.push(new a(h,d,this.ymin))),(t.ythis.ymax||t.y>this.ymax&&e.y=this.xmax?u=!0:i.push(new a(h,d,this.ymax))),0===i.length)u?f?this._lineTo(this.xmax,this.ymax,!0):this._lineTo(this.xmax,this.ymin,!0):f?this._lineTo(this.xmin,this.ymax,!0):this._lineTo(this.xmin,this.ymin,!0);else if(i.length>1&&i[0].ratio>i[1].ratio)this.start=this._dist+r*i[1].ratio,this._lineTo(i[1].x,i[1].y,!0),this._lineTo(i[0].x,i[0].y,!0);else{this.start=this._dist+r*i[0].ratio;for(let t=0;t2){const t=this._firstPt,e=this._prevPt;t.x===e.x&&t.y===e.y||this.lineTo(t.x,t.y);const i=this.line;let s=i.length;for(;s>=4&&(i[0].x===i[1].x&&i[0].x===i[s-2].x||i[0].y===i[1].y&&i[0].y===i[s-2].y);)i.pop(),i[0].x=i[s-2].x,i[0].y=i[s-2].y,--s}}result(t=!0){return this._pushLine(),0===this.lines.length?null:(this.type===n["a"].Polygon&&t&&h.simplify(this.tileSize,this.margin*this.finalRatio,this.lines),this.lines)}resultWithStarts(){if(this.type!==n["a"].LineString)throw new Error("Only valid for lines");this._pushLine();const t=this.lines,e=t.length;if(0===e)return null;const i=[];for(let s=0;s=this.xmin&&t<=this.xmax&&e>=this.ymin&&e<=this.ymax}_intersect(t,e){let i,s,r;if(e.x>=this.xmin&&e.x<=this.xmax)s=e.y<=this.ymin?this.ymin:this.ymax,r=(s-t.y)/(e.y-t.y),i=t.x+r*(e.x-t.x);else if(e.y>=this.ymin&&e.y<=this.ymax)i=e.x<=this.xmin?this.xmin:this.xmax,r=(i-t.x)/(e.x-t.x),s=t.y+r*(e.y-t.y);else{s=e.y<=this.ymin?this.ymin:this.ymax,i=e.x<=this.xmin?this.xmin:this.xmax;const n=(i-t.x)/(e.x-t.x),o=(s-t.y)/(e.y-t.y);n0&&(this.lines.push(this.line),this.starts.push(this.start)):this.type===n["a"].LineString?this.line.length>1&&(this.lines.push(this.line),this.starts.push(this.start)):this.type===n["a"].Polygon&&this.line.length>3&&(this.lines.push(this.line),this.starts.push(this.start))),this.line=[],this.start=0}_moveTo(t,e,i){this.type!==n["a"].Polygon?i&&(t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line.push(new n["b"](t,e))):(i||(tthis.xmax&&(t=this.xmax),ethis.ymax&&(e=this.ymax)),t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line.push(new n["b"](t,e)),this._is_h=!1,this._is_v=!1)}_lineTo(t,e,i){let s,r;if(this.type!==n["a"].Polygon)if(i){if(t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line.length>0&&(s=this.line[this.line.length-1],s.equals(t,e)))return;this.line.push(new n["b"](t,e))}else this.line&&this.line.length>0&&this._pushLine();else if(i||(tthis.xmax&&(t=this.xmax),ethis.ymax&&(e=this.ymax)),t=Math.round((t-(this.xmin+this.margin))*this.finalRatio),e=Math.round((e-(this.ymin+this.margin))*this.finalRatio),this.line&&this.line.length>0){s=this.line[this.line.length-1];const i=s.x===t,o=s.y===e;if(i&&o)return;this._is_h&&i||this._is_v&&o?(s.x=t,s.y=e,r=this.line[this.line.length-2],r.x===t&&r.y===e?(this.line.pop(),this.line.length<=1?(this._is_h=!1,this._is_v=!1):(r=this.line[this.line.length-2],this._is_h=r.x===t,this._is_v=r.y===e)):(this._is_h=r.x===t,this._is_v=r.y===e)):(this.line.push(new n["b"](t,e)),this._is_h=i,this._is_v=o)}else this.line.push(new n["b"](t,e))}}class c{setExtent(t){this._ratio=4096===t?1:4096/t}get validateTessellation(){return this._ratio<1}reset(t){this.lines=[],this.line=null}moveTo(t,e){this.line&&this.lines.push(this.line),this.line=[];const i=this._ratio;this.line.push(new n["b"](t*i,e*i))}lineTo(t,e){const i=this._ratio;this.line.push(new n["b"](t*i,e*i))}close(){const t=this.line;t&&!t[0].isEqual(t[t.length-1])&&t.push(t[0])}result(){return this.line&&this.lines.push(this.line),0===this.lines.length?null:this.lines}}!function(t){t[t.sideLeft=0]="sideLeft",t[t.sideRight=1]="sideRight",t[t.sideTop=2]="sideTop",t[t.sideBottom=3]="sideBottom"}(s||(s={}));class h{static simplify(t,e,i){if(!i)return;const r=-e,n=t+e,o=-e,a=t+e,l=[],c=[],u=i.length;for(let h=0;he.y?(l.push(h),l.push(i),l.push(s.sideLeft),l.push(-1)):(c.push(h),c.push(i),c.push(s.sideLeft),c.push(-1))),u.x>=n&&(u.y=a&&(u.x>e.x?(l.push(h),l.push(i),l.push(s.sideBottom),l.push(-1)):(c.push(h),c.push(i),c.push(s.sideBottom),c.push(-1)))),u=e}if(0===l.length||0===c.length)return;h.fillParent(i,c,l),h.fillParent(i,l,c);const f=[];h.calcDeltas(f,c,l),h.calcDeltas(f,l,c),h.addDeltas(f,i)}static fillParent(t,e,i){const r=i.length,n=e.length;for(let a=0;a1&&s[n-2]===r?0:(s.push(r),h.calcDelta(r,i,e,s)+1)}static addDeltas(t,e){const i=t.length;let r=0;for(let s=0;sr&&(r=e)}for(let n=0;n=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT)*s,this._buffer.BYTES_PER_ELEMENT),i=new ArrayBuffer(e),r=new this._ctor(i);r.set(this._buffer,0),this._array=i,this._buffer=r,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,i){this._i16View[2*t]+=e,this._i16View[2*t+1]+=i}getValue(t){return this._buffer[t]}incr(t){if(this._buffer.length!!t.effects)?null:{geom:r,asFill:"CIMPolygonSymbol"===n.type}}case"sdf":return{geom:t.geom,asFill:t.asFill}}return null}function a(t){return t?t.rings?t.rings:t.paths?t.paths:void 0!==t.xmin&&void 0!==t.ymin&&void 0!==t.xmax&&void 0!==t.ymax?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:null:null}function l(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;for(const n of t)for(const t of n)t[0]i&&(i=t[0]),t[1]r&&(r=t[1]);return new n["a"](e,s,i-e,r-s)}function c(t){let e=1/0,i=-1/0,s=1/0,r=-1/0;for(const n of t)for(const t of n)t[0]i&&(i=t[0]),t[1]r&&(r=t[1]);return[e,s,i,r]}function h(t){return t?t.rings?c(t.rings):t.paths?c(t.paths):Object(r["d"])(t)?[t.xmin,t.ymin,t.xmax,t.ymax]:null:null}function u(t,e,i,s,r){const[n,o,a,l]=t;if(a0){const t=(e.xmax-e.xmin)/(e.ymax-e.ymin);_=s.x/(i*t),g=s.y/i}}else _=s.x,g=s.y;return _=.5*(e.xmax+e.xmin)+_*(e.xmax-e.xmin),g=.5*(e.ymax+e.ymin)+g*(e.ymax-e.ymin),_-=n,g-=o,_*=m,g*=m,_+=d,g+=d,[x,_/y-.5,-(g/p-.5)]}function f(t){const e=a(t.geom),i=l(e),s=128,r=1,n=Math.floor(.5*(.5*s-r)),o=(s-2*(n+r))/Math.max(i.width,i.height),c=Math.round(i.width*o)+2*n,h=Math.round(i.height*o)+2*n,u=[];for(const a of e)if(a&&a.length>1){const e=[];for(const s of a){let[r,a]=s;r-=i.x,a-=i.y,r*=o,a*=o,r+=n-.5,a+=n-.5,t.asFill?e.push([r,a]):e.push([Math.round(r),Math.round(a)])}if(t.asFill){const t=e.length-1;e[0][0]===e[t][0]&&e[0][1]===e[t][1]||e.push(e[0])}u.push(e)}const f=d(u,c,h,n);return t.asFill&&m(u,c,h,n,f),[y(f,n),c,h]}function d(t,e,i,s){const r=e*i,n=new Array(r),o=s*s+1;for(let a=0;ae&&(d=e),m<0&&(m=0),y>i&&(y=i);const p=o[0]-t[0],x=o[1]-t[1],_=p*p+x*x;for(let s=f;s_?(a=o[0],l=o[1]):(c/=_,a=t[0]+c*p,l=t[1]+c*x);const h=(s-a)*(s-a)+(r-l)*(r-l),u=(i-r-1)*e+s;he-s&&(d=e-s),mi-s&&(y=i-s);for(let n=m;nn==a[1]>n)continue;const o=(i-n-1)*e;for(let e=f;eclass extends t{constructor(...t){super(...t),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=l["d"].TEXT,this._aux=Object(c["b"])(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,e){t&&t.length?this._shapingInfo=Object(s["b"])(t,t=>Object(u["a"])(t,e,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:a["u"]*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM})):this._shapingInfo=null}_write(t,e,i,s){const r=e.getDisplayId();this._writeGeometry(t,e,r,i,s)}_writeGeometry(t,e,i,r,o){const a=this._shapingInfo;if(Object(s["j"])(a))return;if(Object(s["k"])(this._textPlacement)){const s=null!=o?o:e.readLegacyGeometryForDisplay();return this._writePlacedText(t,i,s,a,r)}const l=o?Object(n["q"])(Object(n["d"])(o),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!Object(s["j"])(l)){if(l.isPoint){const[e,s]=l.coords;if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(e<0||e>=512||s<0||s>=512))return;return this._writeGlyphs(t,i,{x:e,y:s},a)}l.forEachVertex((e,s)=>this._writeGlyphs(t,i,{x:e,y:s},a))}}_writePlacedText(t,e,i,n,a){const l=Object(s["t"])(this._textPlacement),c=o["a"].getPlacement(i,l,Object(r["g"])(1),a.geometryEngine);if(!c)return;let h=c.next();for(;null!=h;){const i=-h.getAngle();n.setRotation(i);const s=h.tx,r=-h.ty;s<0||s>=512||r<0||r>=512||(this._writeGlyphs(t,e,{x:s,y:r},n),n.setRotation(-i)),h=c.next()}}_writeGlyphs(t,e,i,s){const r=h["e"].load(this._materialKey),n=Object(c["a"])(Math.round(f*i.x),Math.round(f*i.y)),o=this._vertexBoundsScale,a=s.bounds,l=2*Math.max(a.width,a.height);for(const c of s.glyphs)r.textureBinding=c.textureBinding,t.recordStart(e,r.data,this.geometryType,!0),t.vertexBounds(i.x+a.x+this._xOffset,i.y+a.y-this._yOffset,l*o,l*o),this._writeVertices(t,e,n,c),t.recordEnd()}_writeGlyph(t,e,i,s,r){const n=h["e"].load(this._materialKey),o=Object(c["a"])(Math.round(f*i),Math.round(f*s));n.textureBinding=r.textureBinding,t.recordStart(e,n.data,this.geometryType,!0);const a=r.bounds,l=this._vertexBoundsScale;t.vertexBounds(i+a.x*l,s+a.y*l,a.width*l,a.height*l),this._writeVertices(t,e,o,r),t.recordEnd()}_writeVertices(t,e,i,s){const r=t.vertexCount();this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperLeft),t.vertexWrite(s.texcoords.upperLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperRight),t.vertexWrite(s.texcoords.upperRight),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerLeft),t.vertexWrite(s.texcoords.lowerLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerRight),t.vertexWrite(s.texcoords.lowerRight),t.vertexEnd(),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}_writeVertexCommon(t,e,i,s){const r=this._color,n=this._haloColor,o=Object(c["b"])(0,0,this._referenceSize,this._bitset),a=Object(c["b"])(0,0,this._size,this._haloSize);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(a),t.vertexWrite(o),t.vertexWrite(this._minMaxZoom)}}},"4fcb":function(t,e,i){"use strict";i.d(e,"a",(function(){return Y})),i.d(e,"b",(function(){return j}));var s=i("9ef0"),r=i("7ffa"),n=i("e92d"),o=i("b2b2"),a=i("a915"),l=i("b3b6"),c=i("82fa"),h=i("793f"),u=i("ab39"),f=i("405c"),d=i("36b8"),m=i("5dbb"),y=i("89cb"),p=i("e513");const x=n["a"].getLogger("esri.symbols.cim.cimAnalyzer");function _(t){switch(t){case"Butt":return u["d"].BUTT;case"Square":return u["d"].SQUARE;default:return u["d"].ROUND}}function g(t){switch(t){case"Bevel":return u["o"].BEVEL;case"Miter":return u["o"].MITER;default:return u["o"].ROUND}}function b(t){switch(t){case"Left":default:return"left";case"Right":return"right";case"Center":return"center";case"Justify":return"justify"}}function v(t){switch(t){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function O(t){let e="",i="";if(t){const s=t.toLowerCase();-1!==s.indexOf("italic")?e="italic":-1!==s.indexOf("oblique")&&(e="oblique"),-1!==s.indexOf("bold")?i="bold":-1!==s.indexOf("light")&&(i="lighter")}return{style:e,weight:i}}function S(t){return t.underline?"underline":t.strikethrough?"line-through":"none"}function M(t,e,i,s){let r;t[e]?r=t[e]:(r={},t[e]=r),r[i]=s}function w(t){const e=t.markerPlacement;return e&&e.angleToLine?u["a"].MAP:u["a"].SCREEN}async function j(t,e,i,s,r){const n=null!=s?s:[];if(!t)return n;let o,a;const l={};if("CIMSymbolReference"!==t.type)return x.error("Expect cim type to be 'CIMSymbolReference'"),n;if(o=t.symbol,a=t.primitiveOverrides,a){const t=[];for(const i of a){const s=i.valueExpressionInfo;if(s&&e){const r=s.expression,n=Object(c["d"])(r,e.spatialReference,e.fields).then(t=>{t&&M(l,i.primitiveName,i.propertyName,t)});t.push(n)}else null!=i.value&&M(l,i.primitiveName,i.propertyName,i.value)}t.length>0&&await Promise.all(t)}const h=[];switch(J(o,i,h),h.length>0&&await Promise.all(h),o.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":L(o,a,l,e,n,i,r)}return n}function L(t,e,i,s,r,n,o){if(!t)return;const a=t.symbolLayers;if(!a)return;const l=t.effects;let c;const f=h["b"].getSize(t);"CIMPointSymbol"===t.type&&"Map"===t.angleAlignment&&(c=u["a"].MAP);let d=a.length;for(;d--;){const u=a[d];if(!u||!1===u.enable)continue;let m;l&&l.length&&(m=[...l]);const y=u.effects;y&&y.length&&(l?m.push(...y):m=[...y]);const p=[];let _;h["c"].findEffectOverrides(m,e,p),_=p.length>0?K(m,p,i,s):m;const g=[];switch(h["c"].findApplicableOverrides(u,e,g),u.type){case"CIMSolidFill":P(u,_,i,g,s,r);break;case"CIMPictureFill":T(u,_,i,g,s,n,r);break;case"CIMHatchFill":I(u,_,i,g,s,r);break;case"CIMGradientFill":z(u,_,i,g,s,r);break;case"CIMSolidStroke":C(u,_,i,g,s,r,"CIMPolygonSymbol"===t.type,f);break;case"CIMPictureStroke":k(u,_,i,g,s,r,"CIMPolygonSymbol"===t.type,f);break;case"CIMGradientStroke":R(u,_,i,g,s,r,"CIMPolygonSymbol"===t.type,f);break;case"CIMCharacterMarker":if(E(u,_,i,g,s,r))break;break;case"CIMPictureMarker":if(E(u,_,i,g,s,r))break;"CIMLineSymbol"===t.type&&(c=w(u)),A(u,_,i,g,s,n,r,c,f);break;case"CIMVectorMarker":if(E(u,_,i,g,s,r))break;"CIMLineSymbol"===t.type&&(c=w(u)),V(u,_,i,g,s,r,n,c,f,o);break;default:x.error("Cannot analyze CIM layer",u.type)}}}function P(t,e,i,s,r,n){const o=t.primitiveName,a=Object(d["e"])(t.color),[c,h]=q(s,o,e,null),u=Object(l["b"])(JSON.stringify(t)+h).toString();n.push({type:"fill",templateHash:u,materialHash:c?()=>u:u,cim:t,materialOverrides:null,colorLocked:t.colorLocked,color:X(o,i,"Color",r,a,G),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:e})}function T(t,e,i,s,r,n,a){const c=t.primitiveName,h=t.tintColor?Object(d["e"])(t.tintColor):{r:255,g:255,b:255,a:1},[u,f]=q(s,c,e,null),m=Object(l["b"])(JSON.stringify(t)+f).toString(),y=Object(l["b"])(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString();let p=Object(d["f"])(t.scaleX);if("width"in t){const e=t.width;let i=1;const s=n.getResource(t.url);Object(o["k"])(s)&&(i=s.width/s.height),p/=i*(t.height/e)}a.push({type:"fill",templateHash:m,materialHash:u?()=>y:y,cim:t,materialOverrides:null,colorLocked:t.colorLocked,effects:e,color:X(c,i,"TintColor",r,h,G),height:X(c,i,"Height",r,t.height),scaleX:X(c,i,"ScaleX",r,p),angle:X(c,i,"Rotation",r,Object(d["f"])(t.rotation)),offsetX:X(c,i,"OffsetX",r,Object(d["f"])(t.offsetX)),offsetY:X(c,i,"OffsetY",r,Object(d["f"])(t.offsetY)),url:t.url})}function I(t,e,i,s,r,n){const o=["Rotation","OffsetX","OffsetY"],a=s.filter(e=>e.primitiveName!==t.primitiveName&&-1===o.indexOf(e.propertyName)),c=t.primitiveName,[h,u]=q(s,c,e,null),f=Object(l["b"])(JSON.stringify(t)+u).toString(),m=Object(l["b"])(`${t.separation}${JSON.stringify(t.lineSymbol)}`).toString();n.push({type:"fill",templateHash:f,materialHash:h?H(m,i,a,r):m,cim:t,materialOverrides:a,colorLocked:t.colorLocked,effects:e,color:{r:255,g:255,b:255,a:1},height:X(c,i,"Separation",r,t.separation),scaleX:1,angle:X(c,i,"Rotation",r,Object(d["f"])(t.rotation)),offsetX:X(c,i,"OffsetX",r,Object(d["f"])(t.offsetX)),offsetY:X(c,i,"OffsetY",r,Object(d["f"])(t.offsetY))})}function z(t,e,i,s,r,n){const o=t.primitiveName,[a,c]=q(s,o,e,null),h=Object(l["b"])(JSON.stringify(t)+c).toString();n.push({type:"fill",templateHash:h,materialHash:a?H(h,i,s,r):h,cim:t,materialOverrides:null,colorLocked:t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1})}function C(t,e,i,s,r,n,o,a){const c=t.primitiveName,h=Object(d["e"])(t.color),u=void 0!==t.width?t.width:4,f=_(t.capStyle),m=g(t.joinStyle),y=t.miterLimit,[p,x]=q(s,c,e,null),b=Object(l["b"])(JSON.stringify(t)+x).toString();let v,O;if(e&&e instanceof Array&&e.length>0){const t=e[e.length-1];if("CIMGeometricEffectDashes"===t.type&&"NoConstraint"===t.lineDashEnding&&null===t.offsetAlongLine){const t=(e=[...e]).pop();v=t.dashTemplate,O=t.scaleDash}}n.push({type:"line",templateHash:b,materialHash:p?()=>b:b,cim:t,materialOverrides:null,isOutline:o,colorLocked:t.colorLocked,effects:e,color:X(c,i,"Color",r,h,G),width:X(c,i,"Width",r,u),cap:X(c,i,"CapStyle",r,f),join:X(c,i,"JoinStyle",r,m),miterLimit:X(c,i,"MiterLimit",r,y),referenceWidth:a,zOrder:U(t.name),dashTemplate:v,scaleDash:O})}function k(t,e,i,s,r,n,o,a){const c=Object(l["b"])(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),h=t.primitiveName,u=Object(d["e"])(t.tintColor),f=void 0!==t.width?t.width:4,m=_(t.capStyle),y=g(t.joinStyle),p=t.miterLimit,[x,b]=q(s,h,e,null),v=Object(l["b"])(JSON.stringify(t)+b).toString();n.push({type:"line",templateHash:v,materialHash:x?()=>c:c,cim:t,materialOverrides:null,isOutline:o,colorLocked:t.colorLocked,effects:e,color:X(h,i,"TintColor",r,u,G),width:X(h,i,"Width",r,f),cap:X(h,i,"CapStyle",r,m),join:X(h,i,"JoinStyle",r,y),miterLimit:X(h,i,"MiterLimit",r,p),referenceWidth:a,zOrder:U(t.name),dashTemplate:null,scaleDash:!1,url:t.url})}function R(t,e,i,s,r,n,o,a){const c=t.primitiveName,h=void 0!==t.width?t.width:4,u=_(t.capStyle),f=g(t.joinStyle),d=t.miterLimit,[m,y]=q(s,c,e,null),p=Object(l["b"])(JSON.stringify(t)+y).toString();n.push({type:"line",templateHash:p,materialHash:m?H(p,i,s,r):p,cim:t,materialOverrides:null,isOutline:o,colorLocked:t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},width:X(c,i,"Width",r,h),cap:X(c,i,"CapStyle",r,u),join:X(c,i,"JoinStyle",r,f),miterLimit:X(c,i,"MiterLimit",r,d),referenceWidth:a,zOrder:U(t.name),dashTemplate:null,scaleDash:!1})}function E(t,e,i,s,r,n){const o=t.markerPlacement;if(!o||"CIMMarkerPlacementInsidePolygon"!==o.type)return!1;const a=o,c=["Rotation","OffsetX","OffsetY"],h=s.filter(e=>e.primitiveName!==t.primitiveName&&-1===c.indexOf(e.propertyName)),u="url"in t?t.url:null,[f,m]=q(s,a.primitiveName,e,null),y=Object(l["b"])(JSON.stringify(t)+m).toString();let p=a.stepY,x=null,_=1;return o.shiftOddRows&&(p*=2,x=function(t){return t?2*t:0},_=.5),n.push({type:"fill",templateHash:y,materialHash:f?H(y,i,h,r):y,cim:t,materialOverrides:h,colorLocked:t.colorLocked,effects:e,color:{r:255,g:255,b:255,a:1},height:X(a.primitiveName,i,"StepY",r,p,x),scaleX:_,angle:X(a.primitiveName,i,"GridAngle",r,a.gridAngle),offsetX:X(a.primitiveName,i,"OffsetX",r,Object(d["f"])(a.offsetX)),offsetY:X(a.primitiveName,i,"OffsetY",r,Object(d["f"])(a.offsetY)),url:u}),!0}function A(t,e,i,s,r,n,a,c,h){var u;const f=t.primitiveName,m=Object(d["f"])(t.size);let y=Object(d["f"])(t.scaleX);const p=Object(d["f"])(t.rotation),x=Object(d["f"])(t.offsetX),_=Object(d["f"])(t.offsetY),g=t.tintColor?Object(d["e"])(t.tintColor):{r:255,g:255,b:255,a:1},b=Object(l["b"])(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),v=Z(t.markerPlacement,s,i,r),[O,S]=q(s,f,e,v),M=Object(l["b"])(JSON.stringify(t)+S).toString(),w=null!=(u=t.anchorPoint)?u:{x:0,y:0};if("width"in t){const e=t.width;let i=1;const s=n.getResource(t.url);Object(o["k"])(s)&&(i=s.width/s.height),y/=i*(m/e)}a.push({type:"marker",templateHash:M,materialHash:O?()=>b:b,cim:t,materialOverrides:null,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:!1,alignment:c,size:X(f,i,"Size",r,m),scaleX:X(f,i,"ScaleX",r,y),rotation:X(f,i,"Rotation",r,p),offsetX:X(f,i,"OffsetX",r,x),offsetY:X(f,i,"OffsetY",r,_),color:X(f,i,"TintColor",r,g,G),anchorPoint:{x:w.x,y:-w.y},isAbsoluteAnchorPoint:"Relative"!==t.anchorPointUnits,outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:t.rotateClockwise,referenceSize:h,sizeRatio:1,markerPlacement:t.markerPlacement,url:t.url})}function V(t,e,i,s,r,n,o,a,l,c){const h=t.markerGraphics;if(!h)return;let u=0;if(t.scaleSymbolsProportionally){const e=t.frame;e&&(u=e.ymax-e.ymin)}const f=Z(t.markerPlacement,s,i,r);for(const d of h)if(d){const h=d.symbol;if(!h)continue;switch(h.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":F(t,e,f,d,s,i,r,n,o,a,l,u,c);break;case"CIMTextSymbol":N(t,e,f,d,i,s,r,n,a,l,u)}}}function N(t,e,i,s,r,n,o,a,c,u,f){const m=[];h["c"].findApplicableOverrides(s,n,m);const y=s.geometry;if(!("x"in y)||!("y"in y))return;const x=s.symbol,_=S(x),g=O(x.fontStyleName),M=Object(p["a"])(x.fontFamilyName);x.font={family:M,decoration:_,...g};const w=t.frame,j=y.x-.5*(w.xmin+w.xmax),L=y.y-.5*(w.ymin+w.ymax),P=t.size/f,T=t.primitiveName,I=Object(d["f"])(x.height)*P,z=Object(d["f"])(x.angle),C=Object(d["f"])(t.offsetX)+(Object(d["f"])(x.offsetX)+j)*P,k=Object(d["f"])(t.offsetY)+(Object(d["f"])(x.offsetY)+L)*P,R=Object(d["e"])(h["b"].getFillColor(x));let E=Object(d["e"])(h["b"].getStrokeColor(x)),A=h["b"].getStrokeWidth(x);A||(E=Object(d["e"])(h["b"].getFillColor(x.haloSymbol)),A=x.haloSize*P);const[V,N]=q(n,T,e,i),F=JSON.stringify(t.effects)+Number(t.colorLocked)+JSON.stringify(t.anchorPoint)+t.anchorPointUnits+JSON.stringify(t.markerPlacement),W=Object(l["b"])(JSON.stringify(s)+F+N).toString();let B=X(s.primitiveName,r,"TextString",o,s.textString,d["a"],x.textCase);if(null==B)return;const{fontStyleName:D}=x,U=M+(D?"-"+D.toLowerCase():"-regular"),G=U;"string"==typeof B&&B.indexOf("[")>-1&&x.fieldMap&&(B=Object(d["c"])(x.fieldMap,B,x.textCase)),a.push({type:"text",templateHash:W,materialHash:V||"function"==typeof B||B.match(/\[(.*?)\]/)?(t,e,i)=>G+"-"+Object(d["d"])(B,t,e,i):G+"-"+Object(l["b"])(B),cim:x,materialOverrides:null,colorLocked:t.colorLocked,effects:e,alignment:c,anchorPoint:{x:t.anchorPoint?t.anchorPoint.x:0,y:t.anchorPoint?t.anchorPoint.y:0},isAbsoluteAnchorPoint:"Relative"!==t.anchorPointUnits,fontName:U,decoration:_,weight:X(T,r,"Weight",o,g.weight),style:X(T,r,"Size",o,g.style),size:X(T,r,"Size",o,I),angle:X(T,r,"Rotation",o,z),offsetX:X(T,r,"OffsetX",o,C),offsetY:X(T,r,"OffsetY",o,k),horizontalAlignment:b(x.horizontalAlignment),verticalAlignment:v(x.verticalAlignment),text:B,color:R,outlineColor:E,outlineSize:A,referenceSize:u,sizeRatio:1,markerPlacement:i})}function F(t,e,i,s,r,n,a,c,u,y,p,x,_){const g=s.symbol,b=g.symbolLayers;if(!b)return;if(_)return void B(t,e,i,s,n,r,a,c,u,y,p,x);let v=b.length;if($(b))return void W(t,e,i,s,b,r,n,a,c,y,p,x);const O=m["a"].applyEffects(g.effects,s.geometry,u.geometryEngine);if(O)for(;v--;){const _=b[v];if(_&&!1!==_.enable)switch(_.type){case"CIMSolidFill":case"CIMSolidStroke":{var S;const g=m["a"].applyEffects(_.effects,O,u.geometryEngine),b=Object(f["b"])(g);if(!b)continue;const[v,M,w]=Object(f["d"])(b,t.frame,t.size,t.anchorPoint,"Relative"!==t.anchorPointUnits),j="CIMSolidFill"===_.type,L={type:"sdf",geom:g,asFill:j},P=t.primitiveName,T=null!=(S=Object(d["f"])(t.size))?S:10,I=Object(d["f"])(t.rotation),z=Object(d["f"])(t.offsetX),C=Object(d["f"])(t.offsetY),k=_.path,R=_.primitiveName,E=Object(d["e"])(j?h["b"].getFillColor(_):h["b"].getStrokeColor(_)),A=j?{r:0,g:0,b:0,a:0}:Object(d["e"])(h["b"].getStrokeColor(_)),V=h["b"].getStrokeWidth(_);if(!j&&!V)break;let N=!1,F="";for(const t of r)t.primitiveName!==R&&t.primitiveName!==P||(void 0!==t.value?F+=`-${t.primitiveName}-${t.propertyName}-${JSON.stringify(t.value)}`:t.valueExpressionInfo&&(N=!0));Object(o["k"])(e)&&"function"==typeof e&&(N=!0);const W=JSON.stringify({...t,markerGraphics:null}),B=Object(l["b"])(JSON.stringify(L)+k).toString(),D={type:"marker",templateHash:Object(l["b"])(JSON.stringify(s)+JSON.stringify(_)+W+F).toString(),materialHash:N?()=>B:B,cim:L,materialOverrides:null,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:t.scaleSymbolsProportionally,alignment:y,anchorPoint:{x:M,y:w},isAbsoluteAnchorPoint:!1,size:X(t.primitiveName,n,"Size",a,T),rotation:X(t.primitiveName,n,"Rotation",a,I),offsetX:X(t.primitiveName,n,"OffsetX",a,z),offsetY:X(t.primitiveName,n,"OffsetY",a,C),scaleX:1,frameHeight:x,rotateClockwise:t.rotateClockwise,referenceSize:p,sizeRatio:v,color:X(R,n,"Color",a,E,G),outlineColor:X(R,n,"Color",a,A,G),outlineWidth:X(R,n,"Width",a,V),markerPlacement:i,path:k};c.push(D);break}default:B(t,e,i,s,n,r,a,c,u,y,p,x)}}}function W(t,e,i,s,r,n,o,a,c,u,m,y){const p=s.geometry,x=r[0],_=r[1],g=Object(f["b"])(p);if(!g)return;const[b,v,O]=Object(f["d"])(g,t.frame,t.size,t.anchorPoint,"Relative"!==t.anchorPointUnits),S={type:"sdf",geom:p,asFill:!0},M=t.primitiveName,w=Object(d["f"])(t.size),j=Object(d["f"])(t.rotation),L=Object(d["f"])(t.offsetX),P=Object(d["f"])(t.offsetY),T=_.path,I=_.primitiveName,z=x.primitiveName,C=Object(d["e"])(h["b"].getFillColor(_)),k=Object(d["e"])(h["b"].getStrokeColor(x)),R=h["b"].getStrokeWidth(x);let E=!1,A="";for(const l of n)l.primitiveName!==I&&l.primitiveName!==z&&l.primitiveName!==M||(void 0!==l.value?A+=`-${l.primitiveName}-${l.propertyName}-${JSON.stringify(l.value)}`:l.valueExpressionInfo&&(E=!0));const V=JSON.stringify({...t,markerGraphics:null}),N=Object(l["b"])(JSON.stringify(S)+T).toString(),F={type:"marker",templateHash:Object(l["b"])(JSON.stringify(s)+JSON.stringify(_)+JSON.stringify(x)+V+A).toString(),materialHash:E?()=>N:N,cim:S,materialOverrides:null,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:t.scaleSymbolsProportionally,alignment:u,anchorPoint:{x:v,y:O},isAbsoluteAnchorPoint:!1,size:X(t.primitiveName,o,"Size",a,w),rotation:X(t.primitiveName,o,"Rotation",a,j),offsetX:X(t.primitiveName,o,"OffsetX",a,L),offsetY:X(t.primitiveName,o,"OffsetY",a,P),scaleX:1,frameHeight:y,rotateClockwise:t.rotateClockwise,referenceSize:m,sizeRatio:b,color:X(I,o,"Color",a,C,G),outlineColor:X(z,o,"Color",a,k,G),outlineWidth:X(z,o,"Width",a,R),markerPlacement:i,path:T};c.push(F)}function B(t,e,i,s,r,n,c,u,f,m,y,p){const x=D(t,s);let _=[];const g=["Rotation","OffsetX","OffsetY"];_=n.filter(e=>e.primitiveName!==t.primitiveName||-1===g.indexOf(e.propertyName));let b="";for(const o of n)void 0!==o.value&&(b+=`-${o.primitiveName}-${o.propertyName}-${JSON.stringify(o.value)}`);const[v,O,S]=h["b"].getTextureAnchor(x,f),M=t.primitiveName,w=Object(d["f"])(t.rotation),j=Object(d["f"])(t.offsetX),L=Object(d["f"])(t.offsetY),P=Object(l["b"])(JSON.stringify(x)+b).toString(),T={type:"marker",templateHash:P,materialHash:_.length>0||Object(o["k"])(e)&&"function"==typeof e?H(P,r,_,c):P,cim:x,materialOverrides:_,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:t.scaleSymbolsProportionally,alignment:m,anchorPoint:{x:v,y:O},isAbsoluteAnchorPoint:!1,size:t.size,rotation:X(M,r,"Rotation",c,w),offsetX:X(M,r,"OffsetX",c,j),offsetY:X(M,r,"OffsetY",c,L),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:p,rotateClockwise:t.rotateClockwise,referenceSize:y,sizeRatio:S/Object(a["g"])(t.size),markerPlacement:i};u.push(T)}function D(t,e){return{type:t.type,enable:!0,name:t.name,colorLocked:t.colorLocked,primitiveName:t.primitiveName,anchorPoint:t.anchorPoint,anchorPointUnits:t.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:t.rotateClockwise,rotation:0,size:t.size,billboardMode3D:t.billboardMode3D,depth3D:t.depth3D,frame:t.frame,markerGraphics:[e],scaleSymbolsProportionally:t.scaleSymbolsProportionally,respectFrame:t.respectFrame,clippingPath:t.clippingPath}}function U(t){if(t&&0===t.indexOf("Level_")){const e=parseInt(t.substr(6),10);if(!isNaN(e))return e}return 0}function G(t){if(!t||0===t.length)return null;const e=new s["a"](t).toRgba();return{r:e[0],g:e[1],b:e[2],a:e[3]}}function X(t,e,i,s,r,n,o){const a=e[t];if(a){const t=a[i];if("string"==typeof t||"number"==typeof t||t instanceof Array)return n?n.call(null,t,o):t;if(null!=t&&t instanceof c["a"])return(e,i,a)=>{let l=Object(y["a"])(t,e,{$view:a},s.geometryType,i);return null!==l&&n&&(l=n.call(null,l,o)),null!==l?l:r}}return r}function K(t,e,i,s){for(const r of e)if(r.valueExpressionInfo){const t=i[r.primitiveName]&&i[r.primitiveName][r.propertyName];t instanceof c["a"]&&(r.fn=(e,i,r)=>Object(y["a"])(t,e,{$view:r},s.geometryType,i))}const n=t=>t?t.charAt(0).toLowerCase()+t.substr(1):t;return(i,s,o)=>{for(const t of e)t.fn&&(t.value=t.fn(i,s,o));const a=[];for(let c of t){var l;const t=null==(l=c)?void 0:l.primitiveName;if(t){let i=!1;for(const s of e)if(s.primitiveName===t){const t=n(s.propertyName);null!=s.value&&s.value!==c[t]&&(i||(c=Object(r["a"])(c),i=!0),c[t]=s.value)}}a.push(c)}return a}}function Z(t,e,i,s){const n=[];if(h["c"].findApplicableOverrides(t,e,n),0===n.length)return t;for(const r of n)if(r.valueExpressionInfo){const t=i[r.primitiveName]&&i[r.primitiveName][r.propertyName];t instanceof c["a"]&&(r.fn=(e,i,r)=>Object(y["a"])(t,e,{$view:r},s.geometryType,i))}const o=t=>t?t.charAt(0).toLowerCase()+t.substr(1):t;return(e,i,s)=>{for(const t of n)t.fn&&(t.value=t.fn(e,i,s));const a=Object(r["a"])(t),l=t.primitiveName;for(const t of n)if(t.primitiveName===l){const e=o(t.propertyName);null!=t.value&&t.value!==a[e]&&(a[e]=t.value)}return a}}function H(t,e,i,s){for(const r of i)if(r.valueExpressionInfo){const t=e[r.primitiveName]&&e[r.primitiveName][r.propertyName];t instanceof c["a"]&&(r.fn=(e,i,r)=>Object(y["a"])(t,e,{$view:r},s.geometryType,i))}return(e,s,r)=>{for(const t of i)t.fn&&(t.value=t.fn(e,s,r));return Object(l["b"])(t+h["c"].buildOverrideKey(i)).toString()}}function Y(t,e){if(!e||0===e.length)return t;const i=JSON.parse(JSON.stringify(t));return h["c"].applyOverrides(i,e),i}function q(t,e,i,s){let r=!1,n="";for(const o of t)o.primitiveName===e&&(void 0!==o.value?n+=`-${o.primitiveName}-${o.propertyName}-${JSON.stringify(o.value)}`:o.valueExpressionInfo&&(r=!0));return Object(o["k"])(i)&&"function"==typeof i&&(r=!0),Object(o["k"])(s)&&"function"==typeof s&&(r=!0),[r,n]}function J(t,e,i){if(t&&e)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const s=t.symbolLayers;if(!s)return;for(const t of s)switch(tt(t,e,i),t.type){case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMCharacterMarker":case"CIMPictureMarker":"url"in t&&t.url&&i.push(e.fetchResource(t.url,null));break;case"CIMVectorMarker":{const s=t.markerGraphics;if(!s)continue;for(const t of s)if(t){const s=t.symbol;s&&J(s,e,i)}}}}}}const $=t=>t&&2===t.length&&t[0].enable&&t[1].enable&&"CIMSolidStroke"===t[0].type&&"CIMSolidFill"===t[1].type&&!t[0].effects&&!t[1].effects;let Q;function tt(t,e,i){t.effects&&!Object(o["k"])(e.geometryEngine)&&(Q?i.push(Q):Object(d["l"])(t.effects)&&(Q=Object(d["g"])(),i.push(Q),Q.then(t=>e.geometryEngine=t)))}},"5dbb":function(t,e,i){"use strict";i.d(e,"a",(function(){return l}));var s=i("a9ab"),r=i("b6a7"),n=i("fe24"),o=i("9344");const a=96/72;class l{static executeEffects(t,e,i){const s=Object(r["c"])(e),l=a;let c=new n["a"](s);for(const r of t){const t=Object(o["a"])(r);t&&(c=t.execute(c,r,l,i))}return c}static next(t){const e=t.next();return Object(r["d"])(e),e}static applyEffects(t,e,i){if(!t)return e;let r=new n["a"](e);for(const s of t){const t=Object(o["a"])(s);t&&(r=t.execute(r,s,1,i))}let a,l=null;for(;a=r.next();)l?Object(s["h"])(l)?Object(s["h"])(a)&&l.paths.push(...a.paths):Object(s["g"])(l)&&Object(s["g"])(a)&&l.rings.push(...a.rings):l=a;return l}}},"601e":function(t,e,i){"use strict";i.d(e,"a",(function(){return h}));var s=i("ce50"),r=i("e92d"),n=i("c24e"),o=i("82fa"),a=i("89cb"),l=i("f47d");const c=r["a"].getLogger("esri/views/2d/engine/webgl/util/Matcher");async function h(t,e,i,s){switch(t.type){case"simple":return u.fromBasicRenderer(t,e,i,s);case"map":return m.fromUVRenderer(t,e,i,s);case"interval":return d.fromCBRenderer(t,e,i,s);case"dictionary":return _.fromDictionaryRenderer(t,e,i,s);case"subtype":return f.fromSubtypes(t,e,i,s)}}class u{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(t,e,i,s){const r=new u;if(t.symbol){const n=await Object(l["b"])(t.symbol,i,s),o=e.createTemplateGroup(n,null);r.setDefault(o)}return r}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}match(t,e,i,s,r){return this.getDefault()}async analyze(t,e,i,s,r,n){return null}}class f extends u{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e,i,s){const r=new Map,n=[];for(const o in t.renderers){const a=parseInt(o,10),l=h(t.renderers[o],e,i,s).then(t=>r.set(a,t));n.push(l)}return await Promise.all(n),new f(r,t.subtypeField)}match(t,e,i,s,r){const n=e.readAttribute(this._subtypeField),o=this._subMatchers.get(n);return o?o.match(t,e,i,s,r):null}}class d extends u{constructor(t,e,i,s){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=e,this._fieldIndex=s,this._field=t,this._normalizationInfo=i}static async fromCBRenderer(t,e,i,s){const{isMaxInclusive:r,normalizationField:n,normalizationTotal:o,normalizationType:a}=t,c=t.field,h=new d(c,r,{normalizationField:n,normalizationTotal:o,normalizationType:a},t.fieldIndex),u=await Object(l["b"])(t.backgroundFillSymbol,i,s);await Promise.all(t.intervals.map(async t=>{const r=await Object(l["b"])(t.symbol,i,s),n=await e.createTemplateGroup(r,u),o={min:t.min,max:t.max};h.add(o,n)}));const f=await Object(l["b"])(t.defaultSymbol,i,s);if(f){const t=await e.createTemplateGroup(f,u);h.setDefault(t)}return h}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort((t,e)=>t.interval.min-e.interval.min)}size(){return super.size()+this._intervals.length}match(t,e,i,s,r){if(null==this._fieldIndex&&!this._field)return this.getDefault();const n=null!=this._fieldIndex?e.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(e);if(!n&&(null==n||isNaN(n)))return this.getDefault();for(let o=0;o=t.min,s=this._isMaxInclusive?n<=t.max:n{const r=await Object(l["b"])(t.symbol,i,s),n=await e.createTemplateGroup(r,o);""===t.value?a.setNullResult(n):a.add(t.value,n)}));const c=await Object(l["b"])(t.defaultSymbol,i,s);if(c){const t=await e.createTemplateGroup(c,o);a.setDefault(t)}return a}setNullResult(t){this._nullResult=t}add(t,e){this._resultsMap.set(t.toString(),e)}size(){return super.size()+this._resultsMap.size}match(t,e,i,s,r){if(null==this._fieldsIndex&&!this._fields)return this.getDefault();const n=null!=this._fieldsIndex?e.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(e);if(null!==this._nullResult&&(null==n||""===n||""===n))return this._nullResult;if(!n&&null==n)return this.getDefault();const o=n.toString();return this._resultsMap.has(o)?this._resultsMap.get(o):this.getDefault()}_getValueFromFields(t){const e=[];for(const i of this._fields){const s=t.readAttribute(i);null==s||""===s?e.push(""):e.push(s)}return e.join(this._seperator)}}async function y(t,e){const i=t||1;if("number"==typeof i)return(t,e,s)=>i;const s=await Object(o["d"])(i,e.spatialReference,e.fields);return(t,i,r)=>Object(a["a"])(s,t,{$view:r},e.geometryType,i)||1}let p;async function x(){return p||(p=i.e("chunk-2d2304b7").then(i.bind(null,"ec58"))),p}class _ extends u{constructor(t,e,i,s,r,o){super(),this.type="dictionary",this._groupIdCache=new n["a"](100),this._loader=t,this._fieldMap=t.fieldMap,this._symbolFields=t.getSymbolFields(),this._templates=e,this._info=i,this._scaleFn=s,this._schemaUtilsModule=r,this._symbolOptions=o}static async fromDictionaryRenderer(t,e,s,r){const[{DictionaryLoader:n},o]=await Promise.all([Promise.resolve().then(i.bind(null,"226a")),x()]),a=new n(t.url,t.config,t.fieldMap);await a.fetchResources({spatialReference:s.spatialReference,fields:s.fields});const l=await y(t.scaleExpression,s);return new _(a,e,s,l,o,t.symbolOptions)}async _analyzeFeature(t,e,i,r,n){const o=t.readLegacyFeature(),a=this._scaleFn(o,i,r),h=this._attributeHash(o)+"-"+a,u=this._groupIdCache.get(h);if(u)return u;const f={...r,spatialReference:this._info.spatialReference,abortOptions:n,fields:this._info.fields},d=await this._loader.getSymbolAsync(o,f),m=this._schemaUtilsModule.createSymbolSchema(d,this._symbolOptions),y=Object(l["b"])(m,this._info,e,n).then(t=>{if("expanded-cim"!==t.type)return c.error(new s["a"]("mapview-bad-type",`Found unexpected type ${t.type} in dictionary response`)),null;t.hash+="-"+a;for(const e of t.layers)e.scaleFactor=a,e.templateHash+="-"+a;return this._templates.createTemplateGroup(t,null)});return this._groupIdCache.put(h,y,1),y}async analyze(t,e,i,s,r,n){const o=e.getCursor(),a=[];for(;o.next();)a.push(this._analyzeFeature(o,i,s,r,n));return Promise.all(a)}match(t,e,i,s,r){return null}_attributeHash(t){let e="";for(const i of this._symbolFields){const s=this._fieldMap[i];s&&(e+=t.attributes[s]+"-")}return e}}},"69c3":function(t,e,i){"use strict";i.d(e,"a",(function(){return L}));i("3e7b"),i("018d");var s=i("ae54"),r=(i("07cd"),i("d302"),i("8c81")),n=i("175e"),o=i("c84e"),a=i("c8dd");const l=new Map;function c(t,e,i){const{indicesPerRecord:s,multiplier:n,verticesPerRecord:o}=l.get(t);return{recordBytes:i*r["n"]*Uint32Array.BYTES_PER_ELEMENT,indexBytes:n*s*i*Uint32Array.BYTES_PER_ELEMENT,vertexBytes:n*o*i*e}}l.set(o["d"].MARKER,{multiplier:1,indicesPerRecord:6,verticesPerRecord:4}),l.set(o["d"].LINE,{multiplier:1,indicesPerRecord:24,verticesPerRecord:8}),l.set(o["d"].FILL,{multiplier:1,indicesPerRecord:10,verticesPerRecord:10}),l.set(o["d"].TEXT,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4}),l.set(o["d"].LABEL,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4});var h=i("3de4");class u{constructor(t,e,i){this._start={index:0,vertex:0};const s=c(t,e,i),r=e/4;this.geometryType=t,this._records=new h["a"](Int32Array,s.recordBytes),this._indices=new h["a"](Uint32Array,s.indexBytes),this._vertices=new h["a"](Uint32Array,s.vertexBytes),this._metrics=new h["a"](Float32Array,0),this._strideInt=r}serialize(t){const e=this._records.buffer(),i=this._indices.buffer(),s=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null,n=4*this._strideInt;return t.push(e,i,s),{stride:n,records:e,indices:i,vertices:s,metrics:r}}get strideInt(){return this._strideInt}get recordCount(){return this._records.length/r["n"]}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(t){this._vertices.ensureSize(t)}indexEnsureSize(t){this._indices.ensureSize(t)}recordStart(){this._start.index=this._indices.length,this._start.vertex=this._vertices.length}recordEnd(t,e,i,s,r,n,o,a){this._records.push(t),this._records.push(e),this._records.push(i),this._records.push(s),this._records.push(r),this._records.push(n),this._records.push(o),this._records.writeF32(a)}writeIndex(t){this._indices.push(t)}writeVertex(t){this._vertices.push(t)}writeVertexF32(t){this._vertices.writeF32(t)}copyLastFrom(t,e,i){const s=t._records.length-r["n"],n=t._records.getValue(s),o=t._records.getValue(s+1),a=t._records.getValue(s+2),l=t._records.getValue(s+4),c=t._records.getValue(s+6),h=t._records.getValue(s+7),u=this._vertices.length,f=(t._start.vertex-this._vertices.length)/this._strideInt,d=this._indices.length,m=this.vertexCount;for(let r=t._start.index;r!==t._indices.length;r++){const e=t._indices.getValue(r);this._indices.push(e-f)}for(let r=t._start.vertex;r!==t._vertices.length;r++){const e=t._vertices.getValue(r);this._vertices.push(e)}for(let r=u;r<=this._vertices.length;r+=this._strideInt)this._vertices.i1616Add(r,e,i);this._records.push(n),this._records.push(o),this._records.push(a),this._records.push(d),this._records.push(l),this._records.push(m),this._records.push(c),this._records.push(h)}}var f=i("a015");const d=1,m=2,y=4,p=8,x=16,_=32,g=64,b=128;function v(t){switch(t){case d:case p:case _:return-1;case m:case g:return 0;case y:case x:case b:return 1}}function O(t){switch(t){case d:case m:case y:return-1;case p:case x:return 0;case _:case g:case b:return 1}}const S=d|p|_,M=y|x|b,w=d|m|y,j=_|g|b;class L{constructor(t,e,i,s,r){this._hasAggregate=!1,this.hasRecords=!1,this._data={self:new Map,neighbors:new Array},this._current={geometryType:0,writer:null,overlaps:0,start:0,insertAfter:0,sortKey:0,id:0,materialKey:0,indexStart:0,vertStart:0,isDotDensity:!1,bufferingEnabled:!1,metricBoxLenPointer:0},this.hint=e,this.tileKey=t,this._hasAggregate=s,this._pixelBufferEnabled=r,this._strideOptions=i}get hasAggregates(){return this._hasAggregate}get hasPixelBufferEnabled(){return this._pixelBufferEnabled}serialize(t){const e=[];return e.push(this._serializeTileVertexData(this.tileKey,this.tileKey,this._data.self)),this._data.neighbors.forEach((i,r)=>{const n=1<=r["P"]-i?S:M|S)|(e<0+s?j:e>=r["P"]-s?w:j|w));this._current.overlaps|=n}_getVertexWriter(t){if(!this._data.self.has(t)){const e=this._data.self,i=Object(a["n"])(t,this._strideOptions).geometry;e.set(t,new u(t,i,this.hint.records))}return this._data.self.get(t)}}},"6a2c":function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return l})),i.d(e,"d",(function(){return h})),i.d(e,"e",(function(){return u})),i.d(e,"f",(function(){return c})),i.d(e,"g",(function(){return a})),i.d(e,"h",(function(){return n}));const s=0,r=100;function n(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function o(t,e){return Math.sqrt(t*t+e*e)}function a(t){const e=o(t[0],t[1]);t[0]/=e,t[1]/=e}function l(t,e){return o(t[0]-e[0],t[1]-e[1])}function c(t){return"function"==typeof t}function h(t=2){return 1/Math.max(t,1)}function u(t,e){return[!!t.minScale&&e.scaleToZoom(t.minScale)||s,!!t.maxScale&&e.scaleToZoom(t.maxScale)||r]}},"89e8":function(t,e,i){"use strict";i.d(e,"a",(function(){return y}));var s=i("f57e"),r=i("a915"),n=i("ab39"),o=i("32dd"),a=i("a9a2"),l=i("8c81"),c=i("d114"),h=i("18c6"),u=i("6a2c"),f=i("44d1"),d=i("f75e");const m=5;class y extends(Object(f["a"])(d["a"])){constructor(t,e,i,s,a,u,f,d,y,p,x,_,g,b,v,O,S,M,w=!1,j,L){super(),this._xOffset=Object(r["g"])(g),this._yOffset=Object(r["g"])(b),this._decoration=p||"none",this._color=a,this._haloColor=u,this._haloSize=Math.min(Math.floor(m*Object(r["g"])(Object(r["j"])(i))),127),this._size=Math.min(Math.round(Object(r["g"])(e)),127);const P=Math.min(Math.round(Object(r["g"])(s||e)),127);this._referenceSize=Math.round(Math.sqrt(256*P)),this._scale=this._size/l["r"],this._angle=_,this._justify=Object(o["d"])(f||"center"),this._xAlignD=Object(o["e"])(f||"center"),this._yAlignD=Object(o["g"])(d||"baseline"),this._baseline="baseline"===(d||"baseline"),this._bitset=(y===n["a"].MAP?1:0)|(x?1:0)<<1;const T=h["e"].load(t);T.sdf=!0,this._materialKey=T.data,this._lineWidth=Object(r["g"])(v)||512,this._lineHeight=O||1,this._textPlacement=S,this._effects=M,this._isCIM=w,this._minMaxZoom=Object(c["a"])(Math.round(j*l["w"]),Math.round(L*l["w"]))}static fromText(t,e){const i=new y(t.materialKey,t.font.size,t.haloSize||0,t.font.size,t.color&&Object(a["d"])(t.color)||0,t.haloColor&&Object(a["d"])(t.haloColor)||0,t.horizontalAlignment,t.verticalAlignment,n["a"].SCREEN,t.font.decoration,!1,t.angle||0,t.xoffset,t.yoffset,t.lineWidth,t.lineHeight,null,null,!1,u["b"],u["a"]),[,r]=Object(s["a"])(t.text);return i.bindTextInfo(e,r),i._vertexBoundsScale=t.maxVVSize?t.maxVVSize/t.font.size:1,i}static fromCIMText(t,e,i){const r=t.scaleFactor||1,n=t.size*t.sizeRatio*r,[o,l]=Object(u["e"])(t.scaleInfo,i),c=new y(t.materialKey,n,t.outlineSize*t.sizeRatio,t.referenceSize,Object(a["c"])(t.color),Object(a["c"])(t.outlineColor),t.horizontalAlignment,t.verticalAlignment,t.alignment,t.decoration,t.colorLocked,t.angle,t.offsetX*t.sizeRatio*r,t.offsetY*t.sizeRatio*r,512,1,t.markerPlacement,t.effects,!0,o,l),[,h]=Object(s["a"])(t.text);return c.bindTextInfo(e,h),c._vertexBoundsScale=t.maxVVSize?t.maxVVSize/n:1,c}}},a015:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));i("ee0e");function s(t,e,i,s){const r=t.clone(),n=1<=n?(r.col=o-n,r.world+=1):r.col=o,r.row=a,r}},a8b5:function(t,e,i){"use strict";i.d(e,"a",(function(){return y}));var s=i("b2b2"),r=i("a915"),n=i("2c63"),o=i("738e"),a=i("ab39"),l=i("a9a2"),c=i("8c81"),h=i("d114"),u=i("18c6"),f=i("6a2c"),d=i("f93c"),m=i("f75e");class y extends(Object(d["a"])(m["a"])){constructor(t,e,i,s,r,l,f,d,m,y,p,x,_,g,b,v,O,S,M,w,j,L,P){super(),this.angle=s,this.height=f,this.width=l,this.xOffset=e*M,this.yOffset=i*M,this._markerPlacement=w,this._effects=j,this._anchorX=.5-(.5+v)*b.width/b.width,this._anchorY=.5-(.5+O)*b.height/b.height,this._minMaxZoom=Object(h["a"])(Math.round(L*c["w"]),Math.round(P*c["w"]));const T=(g===a["a"].MAP?c["i"]:c["j"])|(p?c["g"]:0)|(_?c["k"]:0)|(x?c["l"]:0),I=b&&b.sdf,z=u["d"].load(t);z.sdf=I,z.pattern=!0,z.textureBinding=b.textureBinding,this._materialKey=z.data,this._fillColor=r,this._outlineColor=m,this._sizeOutlineWidth=Object(h["b"])(Math.round(Math.min(Math.sqrt(128*l),255)),Math.round(Math.min(Math.sqrt(128*f),255)),Math.round(Math.min(Math.sqrt(128*y),255)),Math.round(Math.min(Math.sqrt(128*d),255)));const C=b.rect.x+c["A"],k=b.rect.y+c["A"],R=C+b.width,E=k+b.height;this._offsets.xUpperLeft=C,this._offsets.yUpperLeft=k,this._offsets.xUpperRight=R,this._offsets.yUpperRight=k,this._offsets.xBottomLeft=C,this._offsets.yBottomLeft=E,this._offsets.xBottomRight=R,this._offsets.yBottomRight=E,this._texUpperLeft=Object(h["a"])(C,k),this._texUpperRight=Object(h["a"])(R,k),this._texBottomLeft=Object(h["a"])(C,E),this._texBottomRight=Object(h["a"])(R,E),l*=S,f*=S,l*=M,f*=M;const A=Math.round(64*S);this._bitestAndDistRatio=Object(h["a"])(T,A),this._computedWidth=l,this._computedHeight=f;const V=Object(o["a"])(),N=Object(n["a"])();this._applyTransformation(N,V)}static fromCIMMarker(t,e,i){const n=e&&e.width||1,o=e&&e.height||1,c=t.size,h=n/o*t.scaleX,u=t.scaleSymbolsProportionally&&t.frameHeight?c/t.frameHeight:1;let d=Object(l["c"])(t.color);const m=Object(l["c"])(t.outlineColor),p=Object(r["g"])(c),x=p*h,_=Object(r["g"])(t.offsetX||0),g=Object(r["g"])(t.offsetY||0),b=Object(r["g"])(t.outlineWidth||0)*u,v=t.alignment||a["a"].SCREEN,O=Object(r["g"])(t.referenceSize),[S,M]=Object(f["e"])(t.scaleInfo,i);e.sdf||0!==d||(d=-1);let w=t.rotation||0;t.rotateClockwise||(w=-w);let j=0,L=0;const P=t.anchorPoint;P&&(t.isAbsoluteAnchorPoint?c&&(j=-P.x/(c*h),L=P.y/c):(j=P.x,L=P.y));const T=new y(t.materialKey,_,g,w,d,x,p,O,m,b,t.colorLocked,t.scaleSymbolsProportionally,!1,v,e,j,L,t.sizeRatio,Object(s["u"])(t.scaleFactor,1),t.markerPlacement,t.effects,S,M);return T._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/x:1,T._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/p:1,T}static fromPictureMarker(t,e){const i=Math.round(Object(r["g"])(t.width)),s=Math.round(Object(r["g"])(t.height)),n=c["z"],o=Math.round(Object(r["g"])(t.xoffset||0)),l=Math.round(Object(r["g"])(t.yoffset||0)),h=new y(t.materialKey,o,l,t.angle,n,i,s,s,0,0,!1,!1,!1,a["a"].SCREEN,e,0,0,1,1,null,null,f["b"],f["a"]);return h._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,h._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,h}static fromSimpleMarker(t,e){const i=Object(l["d"])(t.color),s=Math.round(Object(r["g"])(t.size)),n=s,o=Math.round(Object(r["g"])(t.xoffset||0)),c=Math.round(Object(r["g"])(t.yoffset||0)),h=t.style,u=t.outline,d=0|(u&&u.color&&Object(l["d"])(u.color)),m=0|(u&&u.width&&Math.round(Object(r["g"])(u.width))),p=new y(t.materialKey,o,c,t.angle,i,s,n,n,d,m,!1,!1,"esriSMSCross"===h||"esriSMSX"===h,a["a"].SCREEN,e,0,0,126/64,1,null,null,f["b"],f["a"]);return p.boundsType="esriSMSCircle"===h?"circle":"square",p._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,p._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,p}static fromLineSymbolMarker(t,e){const i=Object(l["d"])(t.color),s=6,n=Math.round(Object(r["g"])(s*t.lineWidth)),o=n,c="cross"===t.style||"x"===t.style;let h;switch(t.placement){case"begin-end":h=a["e"].Both;break;case"begin":h=a["e"].JustBegin;break;case"end":h=a["e"].JustEnd;break;default:h=a["e"].None}const u={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:h,offsetAlongLine:0},d=new y(t.materialKey,0,0,0,i,n,o,o/s,i,c?Math.round(Object(r["g"])(t.lineWidth)):0,!1,!1,c,a["a"].MAP,e,0,0,126/64,1,u,null,f["b"],f["a"]);return d.boundsType="circle"===t.style?"circle":"square",d}}},ba46:function(t,e,i){"use strict";i.d(e,"a",(function(){return l}));var s=i("a4ee"),r=i("9096"),n=i("59b2"),o=(i("b50f"),i("c120"),i("cea0"),i("d386"));let a=class extends r["a"]{initialize(){}destroy(){}get supportsTileUpdates(){return!1}get spatialReference(){const t=this.get("tileStore.tileScheme.spatialReference");return t&&t.toJSON()||null}};Object(s["a"])([Object(n["b"])({readOnly:!0})],a.prototype,"supportsTileUpdates",null),Object(s["a"])([Object(n["b"])({constructOnly:!0})],a.prototype,"remoteClient",void 0),Object(s["a"])([Object(n["b"])({constructOnly:!0})],a.prototype,"service",void 0),Object(s["a"])([Object(n["b"])()],a.prototype,"spatialReference",null),Object(s["a"])([Object(n["b"])({constructOnly:!0})],a.prototype,"tileInfo",void 0),Object(s["a"])([Object(n["b"])({constructOnly:!0})],a.prototype,"tileStore",void 0),a=Object(s["a"])([Object(o["a"])("esri.views.2d.layers.features.processors.BaseProcessor")],a);const l=a},e416:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("b6a7"),r=i("9344");class n{static getPlacement(t,e,i,n){const o=Object(r["b"])(e);if(!o)return null;const a=Object(s["c"])(t);return o.execute(a,e,i,n)}}},e513:function(t,e,i){"use strict";i.d(e,"a",(function(){return s})),i.d(e,"b",(function(){return r}));function s(t){const e=t.toLowerCase().split(" ").join("-");switch(e){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return e}}function r(t){const e=n(t)+o(t);return s(t.family)+(e.length>0?e:"-regular")}function n(t){if(!t.weight)return"";switch(t.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function o(t){if(!t.style)return"";switch(t.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}},f47d:function(t,e,i){"use strict";i.d(e,"a",(function(){return v})),i.d(e,"b",(function(){return b}));var s=i("4fcb"),r=i("c84e"),n=i("18c6");const o={marker:r["d"].MARKER,fill:r["d"].FILL,line:r["d"].LINE,text:r["d"].TEXT};class a{constructor(t,e,i,s){const r={minScale:null==e?void 0:e.minScale,maxScale:null==e?void 0:e.maxScale},a=l(r);this.layers=t,this.data=e,this.hash=this._createHash()+a,this.rendererKey=i;const c={isOutline:!1,isOutlinedFill:!1,placement:null,stride:{fill:"default"},vvFlags:i};for(const l of t){const t=o[l.type];l.materialKey=Object(n["g"])(t,c),l.maxVVSize=s,l.scaleInfo=r,l.templateHash+=a}}get type(){return"expanded-cim"}_createHash(){let t="";for(const e of this.layers)t+=e.templateHash;return t}}function l(t){return t.minScale||t.maxScale?t.minScale+"-"+t.maxScale:""}var c=i("49b8"),h=i("ce50"),u=i("f4cc"),f=i("e041"),d=i("0224"),m=i("fcf2"),y=i("343a");async function p(t,e,i){if(!t.name)return Promise.reject(new h["a"]("style-symbol-reference-name-missing","Missing name in style symbol reference"));if(t.styleName&&"Esri2DPointSymbolsStyle"===t.styleName)return x(t,i);try{return _(await Object(y["b"])(t,e,i),t.name,e,i)}catch(s){return Object(u["v"])(s),null}}async function x(t,e){const i=y["a"].replace(/\{SymbolName\}/gi,t.name);try{const t=await Object(y["d"])(i,e);return Object(y["c"])(t.data)}catch(s){return Object(u["v"])(s),null}}async function _(t,e,i,s){const r=t.data,n={portal:i&&i.portal||d["a"].getDefault(),url:Object(f["M"])(t.baseUrl),origin:"portal-item"},o=r.items.find(t=>t.name===e);if(!o)throw new h["a"]("symbolstyleutils:symbol-name-not-found",`The symbol name '${e}' could not be found`,{symbolName:e});let a=Object(m["b"])(Object(y["e"])(o,"cimRef"),n);Object(c["b"])()&&(a=Object(c["a"])(a));try{const t=await Object(y["d"])(a,s);return Object(y["c"])(t.data)}catch(l){return Object(u["v"])(l),null}}const g=async(t,e,i)=>new a(await Object(s["b"])(t.data,e,i),t.data,t.rendererKey,t.maxVVSize),b=async(t,e,i,s)=>{if(!t)return null;if("cim"===t.type)return g(t,e,i);if("web-style"===t.type){const r={type:"cim",data:await p(t,null,s),rendererKey:t.rendererKey,maxVVSize:t.maxVVSize};return g(r,e,i)}return t};function v(t){if(!t)return null;const{type:e,cim:i,url:s,materialHash:r}=t,n={cim:i,type:e,mosaicHash:r,url:s,size:null,dashTemplate:null,path:null,text:null,fontName:null};switch(e){case"marker":n.size=t.size,n.path=t.path;break;case"line":n.dashTemplate=t.dashTemplate;break;case"text":n.text=t.text,n.fontName=t.fontName}return n}},f75e:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("b2b2"),r=i("5dbb");class n{bindFeature(t,e,i){}write(t,e,i,n){var o;if(Object(s["j"])(this._effects)||0===(null==(o=this._effects)?void 0:o.length))return this._write(t,e,n);const a=r["a"].executeEffects(this._effects,e.readLegacyGeometryForDisplay(),n.geometryEngine);let l=r["a"].next(a);for(;l;)this._write(t,e,n,l),l=r["a"].next(a)}_write(t,e,i,s){}}},f93c:function(t,e,i){"use strict";i.d(e,"a",(function(){return y}));var s=i("b2b2"),r=i("a915"),n=i("a29a"),o=i("2c63"),a=i("3349"),l=i("738e"),c=i("6655"),h=i("e416"),u=i("c84e"),f=i("d114");const d=3.14159265359/180,m=8,y=t=>class extends t{constructor(...t){super(...t),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this._offsets={xUpperLeft:0,yUpperLeft:0,xUpperRight:0,yUpperRight:0,xBottomLeft:0,yBottomLeft:0,xBottomRight:0,yBottomRight:0},this.geometryType=u["d"].MARKER}_write(t,e,i,s){const r=e.getDisplayId();t.recordStart(r,this._materialKey,this.geometryType,!0),this._writeGeometry(t,e,r,i,s),t.recordEnd()}_writeGeometry(t,e,i,r,n){if(Object(s["k"])(this._markerPlacement))return this._writePlacedMarkers(t,e,r,n);if(!n&&"esriGeometryPoint"===e.geometryType){const s=e.getX(),r=e.getY();if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(s<0||s>=513||r<0||r>=513))return;return this._writeVertices(t,i,this._getPos(s,r),s,r)}const o=n?Object(c["q"])(Object(c["d"])(n),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!Object(s["j"])(o)){if(o.isPoint){const[e,s]=o.coords;if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(e<0||e>=512||s<0||s>=512))return;return this._writeVertices(t,i,this._getPos(e,s),e,s)}o.forEachVertex((e,s)=>this._writeVertices(t,i,this._getPos(e,s),e,s))}}_writePlacedMarkers(t,e,i,n){const a=null!=n?n:e.readLegacyGeometryForDisplay(),c=h["a"].getPlacement(a,Object(s["t"])(this._markerPlacement),Object(r["g"])(1),i.geometryEngine);if(!c)return;const u=e.getDisplayId(),f=Object(l["a"])(),m=Object(o["a"])(),y=-128,p=640;let x=c.next();for(;null!=x;){const e=x.tx,i=-x.ty;e>=y&&e<=p&&i>=y&&i<=p&&(this._applyTransformation(m,f,-x.getAngle()/d),this._writeVertices(t,u,this._getPos(e,i),e,i)),x=c.next()}}_writeVertices(t,e,i,s,r){const n=t.vertexCount();if(this.angle){const e=Math.max(this._computedWidth*this._vertexBoundsScaleX,this._computedHeight*this._vertexBoundsScaleY);t.vertexBounds(s+this.xOffset,r-this.yOffset,e,e)}else t.vertexBounds(s+this.xOffset,r-this.yOffset,this._computedWidth*this._vertexBoundsScaleX,this._computedHeight*this._vertexBoundsScaleY);t.vertexWrite(i),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(this._texUpperLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(this._texUpperRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(this._texBottomLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(this._texBottomRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.indexWrite(n+0),t.indexWrite(n+1),t.indexWrite(n+2),t.indexWrite(n+1),t.indexWrite(n+3),t.indexWrite(n+2)}_applyTransformation(t,e,i=0){Object(n["a"])(t,Object(l["b"])(this.xOffset,-this.yOffset)),this.angle+i!==0&&Object(n["g"])(t,t,d*(this.angle+i));const s=this._computedWidth,r=this._computedHeight,o=(this._anchorX-.5)*s,c=(this._anchorY-.5)*r;Object(a["s"])(e,o,c),Object(a["t"])(e,e,t),this._offsetUpperLeft=Object(f["a"])(16*e[0],16*e[1]),this._offsets.xUpperLeft=e[0],this._offsets.yUpperLeft=e[1],Object(a["s"])(e,o+s,c),Object(a["t"])(e,e,t),this._offsetUpperRight=Object(f["a"])(16*e[0],16*e[1]),this._offsets.xUpperRight=e[0],this._offsets.yUpperRight=e[1],Object(a["s"])(e,o,c+r),Object(a["t"])(e,e,t),this._offsetBottomLeft=Object(f["a"])(16*e[0],16*e[1]),this._offsets.xBottomLeft=e[0],this._offsets.yBottomLeft=e[1],Object(a["s"])(e,o+s,c+r),Object(a["t"])(e,e,t),this._offsetBottomRight=Object(f["a"])(16*e[0],16*e[1]),this._offsets.xBottomRight=e[0],this._offsets.yBottomRight=e[1]}_getPos(t,e){return Object(f["a"])(Math.round(m*t),Math.round(m*e))}}}}]); //# sourceMappingURL=chunk-11343bbf.fc624775.js.map