@arcgis/core 5.1.0-next.103 → 5.1.0-next.104

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/3fed503185ea1913fb84.js +1 -0
  3. package/assets/esri/core/workers/chunks/4b130db9b7b4e2e32ea4.js +1 -0
  4. package/config.js +1 -1
  5. package/kernel.js +1 -1
  6. package/package.json +1 -1
  7. package/support/revision.js +1 -1
  8. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  9. package/symbols/cim/utils.js +1 -1
  10. package/symbols/support/cimSymbolUtils.js +1 -1
  11. package/symbols/support/utils.js +1 -1
  12. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  13. package/views/2d/engine/webgl/RenderingDevice.js +1 -1
  14. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  15. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  16. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  17. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  18. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  19. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  20. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  21. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  22. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  23. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  24. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  25. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  26. package/views/2d/layers/features/FeatureContainer.js +1 -1
  27. package/assets/esri/core/workers/chunks/f196ad0c7dbcbf632776.js +0 -1
  28. package/assets/esri/core/workers/chunks/fae79769df54eb4c4154.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as s}from"../../core/mathUtils.js";import i from"../../core/ObjectPool.js";import{pt2px as n,px2pt as o}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{create as l,fromValues as h,empty as c,expandPointInPlace as m,center as f,width as u,height as d,diagonal as g}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as p}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{segmentIntersects as y}from"../../geometry/support/intersectsBase.js";import{isExtent as P,isPolygon as S,isPolyline as x,isPoint as w,isMultipoint as M}from"../../geometry/support/jsonTypeUtils.js";import{SimpleEffectCursor as b}from"./CIMEffects.js";import k from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as T,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{getFirstFrame as R}from"./imageUtils.js";import{rotate as z}from"./mathUtils.js";import{addColorStops as L}from"./rasterizingUtils.js";import U from"./Rect.js";import F from"./TextRasterizer.js";import{isMarkerScreenAligned as A,isCIMFill as j,getSize as G,getNumericValue as D,getEffectsInflateSize as H,isSVGImage as E,getRelativeGradientSize as B,fromCIMFontDecoration as X,fromCIMFontStyle as J,fromCIMHorizontalAlignment as N,fromCIMVerticalAlignment as O,getFillColor as q,getStrokeColor as V,getStrokeWidth as W,getFontWeight as Y,getFontStyle as K}from"./utils.js";import{destroyHiddenSvg as $,createHiddenSvg as Q,createSvgElement as Z}from"../../views/2d/engine/svgUtils.js";import{magicLabelLineHeight as tt,glyphSize as et,hittestToleranceSmallSymbol as rt,hittestSmallSymbolThreshold as st}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as it}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as nt,getLineWidth as ot}from"../../views/2d/layers/graphics/graphicsUtils.js";const at=Math.PI/180,lt=.5,ht=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class ct{constructor(t){this._t=t}static createIdentity(){return new ct([1,0,0,0,1,0])}clone(){const t=this._t;return new ct(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new ct([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new ct([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new ct([e,-r,0,r,e,0])}rotate(t){return ct.multiply(this,ct.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const s=t._t,i=e._t,n=s[0]*i[0]+s[3]*i[1],o=s[1]*i[0]+s[4]*i[1],a=s[2]*i[0]+s[5]*i[1]+i[2],l=s[0]*i[3]+s[3]*i[4],h=s[1]*i[3]+s[4]*i[4],c=s[2]*i[3]+s[5]*i[4]+i[5],m=r._t;return m[0]=n,m[1]=o,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new ct([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,s=(t[2]*t[3]-t[0]*t[5])*e,i=t[4]*e,n=-t[1]*e,o=-t[3]*e,a=t[0]*e;return new ct([i,n,r,o,a,s])}}class mt{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new i(()=>new v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||ct.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||ct.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;ct.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const s=t.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this.geomUnitsPerPoint(),s=null,i=H(t),n=!1;let o=new b(a.fromJSONCIM(e));for(const a of t){const t=T(a);t&&(o=t.execute(o,a,{geomUnitsPerPoint:r,tileKey:s,maxInflateSize:i,scale:null,spatialReference:e.spatialReference,preventClipping:n}))}return o}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const s=t[r];if(!s||!1===s.enable)continue;const i=s.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(s,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(s,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=gt(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const s=C(r);if(s){const i="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;i&&this.pushClipPath(e);const n=s.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null);if(n){let e=null;for(;(e=n.next())&&(this.drawMarker(t,e),!this._earlyReturn););}i&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(w(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(S(e)){const s=_(e);s&&([r.tx,r.ty]=s,this.drawMarker(t,r))}else if(x(e)){for(const s of e.paths)for(const e of s)if(r.tx=e[0],r.ty=e[1],this.drawMarker(t,r),this._earlyReturn)break}else for(const s of e.points)if(r.tx=s[0],r.ty=s[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),s=D(t.size,I.CIMPictureMarker.size);if(null==r||s<=0)return;const i=r.width,n=r.height;if(!i||!n)return;const o=i/n,a=D(t.scaleX,1),l=ct.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=s*o*a,r*=s),l.translate(-e,-r)}let c=D(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*at);let m=D(t.offsetX),f=D(t.offsetY);if(m||f){if(this._mapRotation){const t=at*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=m*r+f*e;m=m*e-f*r,f=s}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,s),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const s=D(t.size,I.CIMVectorMarker.size),i=t.frame,n=i?i.ymax-i.ymin:0,o=s&&n?s/n:1,a=ct.createIdentity();i&&a.translate(.5*-(i.xmax+i.xmin),.5*-(i.ymax+i.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?i&&(e*=i.xmax-i.xmin,r*=i.ymax-i.ymin):(e/=o,r/=o),a.translate(-e,-r)}1!==o&&a.scale(o,o);let h=D(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*at);let c=D(t.offsetX),m=D(t.offsetY);if(c||m){if(this._mapRotation){const t=at*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=c*r+m*e;c=c*e-m*r,m=s}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||ht().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!w(e))return;if(D(t.height,I.CIMTextSymbol.height)<=0)return;const s=ct.createIdentity();let i=D(t.angle);i=-i,i&&s.rotate(i*at);const n=D(t.offsetX),o=D(t.offsetY);(n||o)&&s.translate(n,o);const a=this.geomUnitsPerPoint();1!==a&&s.scale(a,a),s.translate(e.x,e.y),this.push(s,!1),this.drawText(t,r),this.pop()}}class ft extends mt{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new U(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return h(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(S(t))this._processPath(t.rings,0);else if(x(t))this._processPath(t.paths,0);else if(P(t)){const e=Pt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const s=Math.max(.5*this.transformSize(D(r,I.CIMSolidStroke.width)),.5*lt);if(S(t))this._processPath(t.rings,s);else if(x(t))this._processPath(t.paths,s);else if(P(t)){const e=Pt(t);e&&this._processPath(e.rings,s)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){S(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,s=D(t.scaleX,1);let i=s*e,n=e;const o=this._resourceManager.getResource(r);if(null!=o){const t=o.height/o.width;i=s*(e?t>1?e:e/t:o.width),n=e?t>1?e*t:e:o.height}this._merge(this.transformPt([-i/2,-n/2]),0),this._merge(this.transformPt([-i/2,n/2]),0),this._merge(this.transformPt([i/2,-n/2]),0),this._merge(this.transformPt([i/2,n/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=xt(t);let[s,i]=this._textRasterizer.computeTextSize(e,r);s=o(s),i=o(i);const n=this.transformSize(1)*this.reverseTransformScalar(1);s*=n,i*=n;const a=t.horizontalAlignment??I.CIMTextSymbol.horizontalalignment,l=t.verticalAlignment??I.CIMTextSymbol.verticalalignment;let h=0;switch(a){case"Left":h=s/2;break;case"Right":h=-s/2}let c=0;switch(l){case"Bottom":c=i/2;break;case"Top":c=-i/2;break;case"Baseline":c=i/6}this._merge(this.transformPt([-s/2+h,-i/2+c]),0),this._merge(this.transformPt([-s/2+h,i/2+c]),0),this._merge(this.transformPt([s/2+h,-i/2+c]),0),this._merge(this.transformPt([s/2+h,i/2+c]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let s=1;s<t;s++)this._merge(this.transformPt(r[s]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class ut extends mt{constructor(){super(...arguments),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=$(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,s,i,a,l,h){this._resetHittest();const c=a*n(1);switch(this.setGeomUnitsPerPoint(c),h){case"point":if(1!==t.length)return ht().error("Unexpected hittest area",t),!1;this._hittestType="point",this._searchDistPoint=l/2/c,this._searchTarget=[[t[0].x,t[0].y]];break;case"rect":if(4!==t.length)return ht().error("Unexpected hittest area",t),!1;this._hittestType="rect",this._searchDistPoint=0,this._searchTarget=t.map(t=>[t.x,t.y])}this._textInfo=s;const m=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type||e.symbolLayers?.some(t=>A(t)));if(this._mapRotation=m?i:0,!has("esri-mobile")){const t=o(rt*window.devicePixelRatio),r=o(st);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(j))&&"CIMMeshSymbol"!==e?.type&&(G(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,s,i,n,o){null!=o?this._hittestSvgPath(t,o,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,s=D(t.scaleX,1),i=this._resourceManager.getResource(r);if(null==i||0===i.height||0===e)return;const n=e*this.geomUnitsPerPoint(),o=n*s*(i.width/i.height);if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=this._searchDistPoint;Math.abs(t[0])<o/2+e&&Math.abs(t[1])<n/2+e&&(this._earlyReturn=!0)}else{const t=o/2,e=n/2,r=[[-t,e],[t,e],[t,-e],[-t,-e],[-t,e]];kt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[r])&&(this._earlyReturn=!0)}}drawText(t,e){const r=this._textInfo;if(!r)return;const s=r.get(t);if(!s)return;if(!s.glyphMosaicItems.glyphs.length)return;const i=nt(D(t.height,I.CIMTextSymbol.height)),{lineGapType:n,lineGap:o}=t,a=n?St(n,D(o),i):0,l=t.horizontalAlignment??I.CIMTextSymbol.horizontalalignment,h=t.verticalAlignment??I.CIMTextSymbol.verticalalignment,c="CIMBackgroundCallout"===t.callout?.type,m=it(s.glyphMosaicItems,{scale:i/et,angle:0,xOffset:0,yOffset:0,horizontalAlignment:l,verticalAlignment:h,maxLineWidth:ot(t.lineWidth),lineHeight:tt*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:c});if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=t[0],r=t[1];for(const s of m.glyphs){const[t,i]=s.offsets.topLeft,[n,o]=s.offsets.bottomRight;if(e>t&&e<n&&r>-o&&r<-i){this._earlyReturn=!0;break}}}else for(const f of m.glyphs){const[t,e]=f.offsets.topLeft,[r,s]=f.offsets.bottomRight,i=[[t,-e],[r,-e],[r,-s],[t,-s],[t,-e]];if(kt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[i])){this._earlyReturn=!0;break}}}_hitTestFill(t){let e=null;if(P(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(S(t))e=t.rings;else{if(!x(t))return;e=t.paths}if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]);if(pt(t,e)&&(this._earlyReturn=!0),!this._earlyReturn){_t(t,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}else{kt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,e)&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=Q(),this._path??=Z("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,s=0){const i=l();p(i,t);const n={x:i[0],y:i[1],width:i[2]-i[0],height:i[3]-i[1]},o=this._getSvgPath();o.setAttribute("d",e);const a=o.getBBox();if("point"===this._hittestType){const t=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),i=this.reverseTransformPt(this._searchTarget[0]);let o=Math.max(a.width/n.width,a.height/n.height),l=1;const h=2*t*o;h<1&&(l=2/h,o*=l,a.x*=l,a.y*=l,a.width*=l,a.height*=l);const c=1+s*o/2,m=this._getCanvasContext(a.width+2*c,a.height+2*c);m.setTransform(l,0,0,l,-a.x+c,-a.y+c);const f=new Path2D(e);r?m.fill(f):(m.lineWidth=s*(o/l),m.stroke(f));const u=(n.width*o-a.width)/2,d=(n.height*o-a.height)/2,g=Math.floor((i[0]-n.x-t)*o-u+c),p=Math.floor((n.height-(i[1]-n.y)-t)*o+d+c),_=Math.ceil(2*t*o),y=Math.ceil(2*t*o),P=m.getImageData(g,p,_,y).data;for(let e=3;e<P.length;e+=4)if(P[e]>127.5)return void(this._earlyReturn=!0)}else{const t=[[n.x,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height],[n.x+n.width,n.y],[n.x,n.y]];if(kt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[t]))return void(this._earlyReturn=!0)}}_hitTestStroke(t,e){let r=null;if(P(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(S(t))r=t.rings;else{if(!x(t))return;r=t.paths}if("point"===this._hittestType){_t(this.reverseTransformPt(this._searchTarget[0]),r,D(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}else{kt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,r)&&(this._earlyReturn=!0)}}_resetHittest(){this.setTransform(),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null}}class dt extends mt{constructor(t,e,r,s){super(e,r),this._applyAdditionalRenderProps=s,this._colorSubstitutionHelper=new k,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!0);else if(P(t))this._buildPath(Pt(t).rings,!0);else{if(!M(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,s,i,n){if(!t||!e||0===r)return;if(S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!1);else{if(!P(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(Pt(t).rings,!0)}const o=this._ctx;o.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",o.lineWidth=Math.max(this.transformSize(r),lt),this._setCapStyle(s),this._setJoinStyle(i),o.miterLimit=n,o.stroke()}pushClipPath(t){if(this._ctx.save(),S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!0);else{if(!P(t))return;this._buildPath(Pt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:s,tintColor:i}=t,n=D(t.scaleX,1),o=this._resourceManager.getResource(s);if(null==o)return;let a=e*(o.width/o.height),l=e;e||(a=o.width,l=o.height);const h=E(s)||"src"in o&&E(o.src);let c="getFrame"in o?R(o):o;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&i&&(c=this._colorSubstitutionHelper.tintImageData(c,i));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:n*d*f,m12:n*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=xt(t,this.transformSize(o(1))),s=this._textRasterizer.rasterizeText(e,r);if(!s)return;const{size:i,anchorX:n,anchorY:a,canvas:l}=s,h=i[0]*(n+.5),c=i[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:s,offsetX:i,offsetY:n,rotation:o,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!0);else if(P(t))this._buildPath(Pt(t).rings,!0);else{if(!M(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=E(h)||"src"in c&&E(c.src);let u,d="getFrame"in c?R(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);o||(o=0),i?i*=t:i=0,n?n*=t:n=0,s&&(s*=t);const e=s?s/c.height:1,r=a&&s?a*s/c.width:1;if(0!==o||1!==e||1!==r||0!==i||0!==n){const t=new DOMMatrix;t.rotateSelf(0,0,-o).translateSelf(i,n).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:s,capStyle:i,joinStyle:o,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(S(t))f=t.rings;else if(x(t))f=t.paths;else{if(!P(t))return M(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=Pt(t).rings}c||(c=m.width);const u=E(h)||"src"in m&&E(m.src);let d="getFrame"in m?R(m):m;s&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,s)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(n(c)),.5),p=g/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let w,b;_.save(),this._setCapStyle(i),this._setJoinStyle(o),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let n of f)if(n=e(n),Mt(n),n&&!(n.length<=1)){w=this.transformPt(n[0]);for(let t=1;t<n.length;t++){b=this.transformPt(n[t]);const e=yt(w,b),r=new DOMMatrix;r.translateSelf(0,w[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),y.setTransform(r),_.strokeStyle=y,_.beginPath(),_.moveTo(w[0],w[1]),_.lineTo(b[0],b[1]),_.stroke(),w=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(S(t))r=t.rings;else if(x(t))r=t.paths;else{if(!P(t))return void ht().error("Unable to draw gradient fill");r=Pt(t).rings}this._buildPath(r,!0);const{angle:i,gradientMethod:o,gradientSize:a,gradientSizeUnits:l}=e,h=I.CIMGradientFill,p=e.gradientType??h.gradientType,_=-s(i??0),y=c();for(const s of r){const t=s?s.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(s[e]);"Linear"!==o&&"Rectangular"!==o||(t=z(t,-_)),m(y,t)}}const[w,M,b,k]=y,T=this._ctx;switch(T.save(),o){case"Buffered":ht().error(`Gradient method "${o}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(b-w),[s,i]="Discrete"===p?[b,b-r]:[w+r,w],o=z([s,t],_),c=z([i,t],_),m=T.createLinearGradient(o[0],o[1],c[0],c[1]);L(m,e),T.fillStyle=m,T.fill("evenodd");break}case"Circular":{const t=f(y),r=g(y)/2,s="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*r,[i,o]="Discrete"===p?[r,r-s]:[s,0],c=T.createRadialGradient(t[0],t[1],i,t[0],t[1],o);L(c,e),T.fillStyle=c,T.fill("evenodd");break}case"Rectangular":{const r=f(y),s=r[0],i=r[1],o=z(r,_),c=(r,s,i,n,a,l,h,c)=>{T.save(),this.pushClipPath(t);const m=z([a,l],_),f=z([h,c],_);T.beginPath(),T.moveTo(o[0],o[1]),T.lineTo(m[0],m[1]),T.lineTo(f[0],f[1]),T.lineTo(o[0],o[1]),T.clip();const u=z([r,s],_),d=z([i,n],_),g=T.createLinearGradient(u[0],u[1],d[0],d[1]);L(g,e),T.fillStyle=g,T.fill("evenodd"),T.restore()};let m="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(u(y)/2),[g,P]="Discrete"===p?[b,b-m]:[s+m,s];c(g,i,P,i,b,M,b,k),[g,P]="Discrete"===p?[w,w+m]:[s-m,s],c(g,i,P,i,w,k,w,M),m="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(d(y)/2);let[S,x]="Discrete"===p?[k,k-m]:[i+m,i];c(s,S,s,x,b,k,w,k),[S,x]="Discrete"===p?[M,M+m]:[i-m,i],c(s,S,s,x,w,M,b,M);break}}T.restore()}drawGradientStroke(t,r){const{capStyle:s,gradientMethod:i,gradientSize:o,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(S(t))m=t.rings;else if(x(t))m=t.paths;else{if(!P(t))return void ht().error("Unable to draw gradient stroke");m=Pt(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(n(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(s),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),Mt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],s=p[1]-g[1];t+=Math.sqrt(r*r+s*s),g=p}const s="Absolute"===a?this.transformSize(n(o)):B(o,I.CIMGradientStroke.gradientSize)*("AcrossLine"===i?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const n=p[0]-g[0],o=p[1]-g[1],a=Math.sqrt(n*n+o*o);let h,c,m,y;switch(i){case"AcrossLine":{const[t,e]=z([n/a,o/a],-Math.PI/2),r=u/2,i="Discrete"===f?r:s-r;h=(g[0]+p[0])/2+t*i,c=(g[1]+p[1])/2+e*i,m=h-t*s,y=c-e*s;break}case"AlongLine":{const e=n/a,r=o/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*s,y=c+r*s):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*s,c=y-r*s);break}default:return ht().error("Unrecognized gradient method:",i),void d.restore()}const P=d.createLinearGradient(h,c,m,y);L(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const s of t){const t=s?s.length:0;if(t>1){let i=this.transformPt(s[0]);r.moveTo(i[0],i[1]);for(let e=1;e<t;e++)i=this.transformPt(s[e]),r.lineTo(i[0],i[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case"Butt":this._ctx.lineCap="butt";break;case"Round":this._ctx.lineCap="round";break;case"Square":this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case"Bevel":this._ctx.lineJoin="bevel";break;case"Round":this._ctx.lineJoin="round";break;case"Miter":this._ctx.lineJoin="miter"}}}function gt(t,e,r){let s=D(t.separation,I.CIMHatchFill.separation)*r,i=D(t.rotation);if(0===s)return null;s<0&&(s=-s);let n=0;const o=.5*s;for(;n>o;)n-=s;for(;n<-o;)n+=s;const a=l();p(a,e),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;i>180;)i-=180;for(;i<0;)i+=180;const c=Math.cos(i*at),m=Math.sin(i*at),f=-s*m,u=s*c;let d,g,_,y;n=D(t.offsetX)*r*m-D(t.offsetY)*r*c,d=_=Number.MAX_VALUE,g=y=-Number.MAX_VALUE;for(const l of h){const t=l[0],e=l[1],r=c*t+m*e,s=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,s),g=Math.max(g,r),y=Math.max(y,s)}_=Math.floor(_/s)*s;let P=c*d-m*_-f*n/s,S=m*d+c*_-u*n/s,x=c*g-m*_-f*n/s,w=m*g+c*_-u*n/s;const M=1+Math.round((y-_)/s),b=[];for(let l=0;l<M;l++)P+=f,S+=u,x+=f,w+=u,b.push([[P,S],[x,w]]);return{paths:b}}function pt(t,e){let r=0;for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],n=s[i];if(e[1]>t[1]==n[1]>t[1])continue;(n[0]-e[0])*(t[1]-e[1])-(n[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function _t(t,e,r){for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],n=s[i];let o=(n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]);if(0===o)continue;o=Math.sqrt(o);const a=((n[0]-e[0])*(t[1]-e[1])-(n[1]-e[1])*(t[0]-e[0]))/o;if(Math.abs(a)<r){const s=((n[0]-e[0])*(t[0]-e[0])+(n[1]-e[1])*(t[1]-e[1]))/o;if(s>-r&&s<o+r)return!0}}}return!1}function yt(t,e){const r=e[0]-t[0],s=e[1]-t[1];return 180/Math.PI*Math.atan2(s,r)}const Pt=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,St=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function xt(e,r=1){const s=X(e),i=J(e.fontStyleName),n=e.fontFamilyName??t,{weight:o,style:a}=i,l=r*(e.height||5),h=N(e.horizontalAlignment),c=O(e.verticalAlignment),m=q(e),f=q(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=V(e.symbol),g=r*(W(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=q(p),y=W(p),P=V(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:n,style:K(a),weight:Y(o),decoration:s},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const wt=1e-4;function Mt(t){let e,r,s,i,n,o=t[0],a=1;for(;a<t.length;)e=t[a][0]-o[0],r=t[a][1]-o[1],i=0!==e?r/e:Math.PI/2,void 0!==s&&Math.abs(i-s)<=wt?(t.splice(a-1,1),o=n):(n=o,o=t[a],a++),s=i}function bt(t){const e=t[0],r=t[t.length-1];return e[0]===r[0]&&e[1]===r[1]}function kt(t,e){t.length>1&&!bt(t)&&(t=[...t,t[0]]);for(let r=0;r<e.length;r++){const s=e[r],i=s.length;for(const e of s)if(pt(e,[t]))return!0;if(bt(s))for(const r of t)if(pt(r,e))return!0;for(let e=1;e<i;e++){const r=s[e-1],i=s[e];for(let e=0;e<t.length;e++){const s=t[e],n=t[(e+1)%t.length];if(y(r,i,s,n))return!0}}}return!1}export{mt as CIMSymbolDrawHelper,dt as CanvasDrawHelper,ft as EnvDrawHelper,ut as HittestDrawHelper,ct as Transformation,at as cDegToRad,St as lineGapType2LineHeight};
2
+ import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as s}from"../../core/mathUtils.js";import i from"../../core/ObjectPool.js";import{pt2px as n,px2pt as o}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{create as l,fromValues as h,empty as c,expandPointInPlace as m,center as f,width as u,height as d,diagonal as g}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as p}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{segmentIntersects as y}from"../../geometry/support/intersectsBase.js";import{isExtent as P,isPolygon as S,isPolyline as x,isPoint as w,isMultipoint as M}from"../../geometry/support/jsonTypeUtils.js";import{SimpleEffectCursor as b}from"./CIMEffects.js";import k from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as T,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{getFirstFrame as R}from"./imageUtils.js";import{rotate as z}from"./mathUtils.js";import{addColorStops as L}from"./rasterizingUtils.js";import U from"./Rect.js";import F from"./TextRasterizer.js";import{isCIMFill as A,getSize as j,getNumericValue as G,getEffectsInflateSize as D,isSVGImage as H,getRelativeGradientSize as E,fromCIMFontDecoration as B,fromCIMFontStyle as X,fromCIMHorizontalAlignment as J,fromCIMVerticalAlignment as N,getFillColor as O,getStrokeColor as q,getStrokeWidth as V,getFontWeight as W,getFontStyle as Y}from"./utils.js";import{destroyHiddenSvg as K,createHiddenSvg as $,createSvgElement as Q}from"../../views/2d/engine/svgUtils.js";import{magicLabelLineHeight as Z,glyphSize as tt,hittestToleranceSmallSymbol as et,hittestSmallSymbolThreshold as rt}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as st}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as it,getLineWidth as nt}from"../../views/2d/layers/graphics/graphicsUtils.js";const ot=Math.PI/180,at=.5,lt=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class ht{constructor(t){this._t=t}static createIdentity(){return new ht([1,0,0,0,1,0])}clone(){const t=this._t;return new ht(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new ht([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new ht([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new ht([e,-r,0,r,e,0])}rotate(t){return ht.multiply(this,ht.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const s=t._t,i=e._t,n=s[0]*i[0]+s[3]*i[1],o=s[1]*i[0]+s[4]*i[1],a=s[2]*i[0]+s[5]*i[1]+i[2],l=s[0]*i[3]+s[3]*i[4],h=s[1]*i[3]+s[4]*i[4],c=s[2]*i[3]+s[5]*i[4]+i[5],m=r._t;return m[0]=n,m[1]=o,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new ht([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,s=(t[2]*t[3]-t[0]*t[5])*e,i=t[4]*e,n=-t[1]*e,o=-t[3]*e,a=t[0]*e;return new ht([i,n,r,o,a,s])}}class ct{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new i(()=>new v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||ht.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||ht.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;ht.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const s=t.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this.geomUnitsPerPoint(),s=null,i=D(t),n=!1;let o=new b(a.fromJSONCIM(e));for(const a of t){const t=T(a);t&&(o=t.execute(o,a,{geomUnitsPerPoint:r,tileKey:s,maxInflateSize:i,scale:null,spatialReference:e.spatialReference,preventClipping:n}))}return o}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const s=t[r];if(!s||!1===s.enable)continue;const i=s.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(s,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(s,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=dt(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const s=C(r);if(s){const i="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;i&&this.pushClipPath(e);const n=s.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null);if(n){let e=null;for(;(e=n.next())&&(this.drawMarker(t,e),!this._earlyReturn););}i&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(w(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(S(e)){const s=_(e);s&&([r.tx,r.ty]=s,this.drawMarker(t,r))}else if(x(e)){for(const s of e.paths)for(const e of s)if(r.tx=e[0],r.ty=e[1],this.drawMarker(t,r),this._earlyReturn)break}else for(const s of e.points)if(r.tx=s[0],r.ty=s[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),s=G(t.size,I.CIMPictureMarker.size);if(null==r||s<=0)return;const i=r.width,n=r.height;if(!i||!n)return;const o=i/n,a=G(t.scaleX,1),l=ht.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=s*o*a,r*=s),l.translate(-e,-r)}let c=G(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*ot);let m=G(t.offsetX),f=G(t.offsetY);if(m||f){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=m*r+f*e;m=m*e-f*r,f=s}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,s),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const s=G(t.size,I.CIMVectorMarker.size),i=t.frame,n=i?i.ymax-i.ymin:0,o=s&&n?s/n:1,a=ht.createIdentity();i&&a.translate(.5*-(i.xmax+i.xmin),.5*-(i.ymax+i.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?i&&(e*=i.xmax-i.xmin,r*=i.ymax-i.ymin):(e/=o,r/=o),a.translate(-e,-r)}1!==o&&a.scale(o,o);let h=G(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*ot);let c=G(t.offsetX),m=G(t.offsetY);if(c||m){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=c*r+m*e;c=c*e-m*r,m=s}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||lt().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!w(e))return;if(G(t.height,I.CIMTextSymbol.height)<=0)return;const s=ht.createIdentity();let i=G(t.angle);i=-i,i&&s.rotate(i*ot);const n=G(t.offsetX),o=G(t.offsetY);(n||o)&&s.translate(n,o);const a=this.geomUnitsPerPoint();1!==a&&s.scale(a,a),s.translate(e.x,e.y),this.push(s,!1),this.drawText(t,r),this.pop()}}class mt extends ct{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new U(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return h(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(S(t))this._processPath(t.rings,0);else if(x(t))this._processPath(t.paths,0);else if(P(t)){const e=yt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const s=Math.max(.5*this.transformSize(G(r,I.CIMSolidStroke.width)),.5*at);if(S(t))this._processPath(t.rings,s);else if(x(t))this._processPath(t.paths,s);else if(P(t)){const e=yt(t);e&&this._processPath(e.rings,s)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){S(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,s=G(t.scaleX,1);let i=s*e,n=e;const o=this._resourceManager.getResource(r);if(null!=o){const t=o.height/o.width;i=s*(e?t>1?e:e/t:o.width),n=e?t>1?e*t:e:o.height}this._merge(this.transformPt([-i/2,-n/2]),0),this._merge(this.transformPt([-i/2,n/2]),0),this._merge(this.transformPt([i/2,-n/2]),0),this._merge(this.transformPt([i/2,n/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=St(t);let[s,i]=this._textRasterizer.computeTextSize(e,r);s=o(s),i=o(i);const n=this.transformSize(1)*this.reverseTransformScalar(1);s*=n,i*=n;const a=t.horizontalAlignment??I.CIMTextSymbol.horizontalalignment,l=t.verticalAlignment??I.CIMTextSymbol.verticalalignment;let h=0;switch(a){case"Left":h=s/2;break;case"Right":h=-s/2}let c=0;switch(l){case"Bottom":c=i/2;break;case"Top":c=-i/2;break;case"Baseline":c=i/6}this._merge(this.transformPt([-s/2+h,-i/2+c]),0),this._merge(this.transformPt([-s/2+h,i/2+c]),0),this._merge(this.transformPt([s/2+h,-i/2+c]),0),this._merge(this.transformPt([s/2+h,i/2+c]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let s=1;s<t;s++)this._merge(this.transformPt(r[s]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class ft extends ct{constructor(){super(...arguments),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=K(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,s,i,a,l,h){this._resetHittest();const c=a*n(1);switch(this.setGeomUnitsPerPoint(c),h){case"point":if(1!==t.length)return lt().error("Unexpected hittest area",t),!1;this._hittestType="point",this._searchDistPoint=l/2/c,this._searchTarget=[[t[0].x,t[0].y]];break;case"rect":if(4!==t.length)return lt().error("Unexpected hittest area",t),!1;this._hittestType="rect",this._searchDistPoint=0,this._searchTarget=t.map(t=>[t.x,t.y])}this._textInfo=s;const m=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type);if(this._mapRotation=m?i:0,!has("esri-mobile")){const t=o(et*window.devicePixelRatio),r=o(rt);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(A))&&"CIMMeshSymbol"!==e?.type&&(j(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,s,i,n,o){null!=o?this._hittestSvgPath(t,o,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,s=G(t.scaleX,1),i=this._resourceManager.getResource(r);if(null==i||0===i.height||0===e)return;const n=e*this.geomUnitsPerPoint(),o=n*s*(i.width/i.height);if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=this._searchDistPoint;Math.abs(t[0])<o/2+e&&Math.abs(t[1])<n/2+e&&(this._earlyReturn=!0)}else{const t=o/2,e=n/2,r=[[-t,e],[t,e],[t,-e],[-t,-e],[-t,e]];bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[r])&&(this._earlyReturn=!0)}}drawText(t,e){const r=this._textInfo;if(!r)return;const s=r.get(t);if(!s)return;if(!s.glyphMosaicItems.glyphs.length)return;const i=it(G(t.height,I.CIMTextSymbol.height)),{lineGapType:n,lineGap:o}=t,a=n?Pt(n,G(o),i):0,l=t.horizontalAlignment??I.CIMTextSymbol.horizontalalignment,h=t.verticalAlignment??I.CIMTextSymbol.verticalalignment,c="CIMBackgroundCallout"===t.callout?.type,m=st(s.glyphMosaicItems,{scale:i/tt,angle:0,xOffset:0,yOffset:0,horizontalAlignment:l,verticalAlignment:h,maxLineWidth:nt(t.lineWidth),lineHeight:Z*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:c});if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=t[0],r=t[1];for(const s of m.glyphs){const[t,i]=s.offsets.topLeft,[n,o]=s.offsets.bottomRight;if(e>t&&e<n&&r>-o&&r<-i){this._earlyReturn=!0;break}}}else for(const f of m.glyphs){const[t,e]=f.offsets.topLeft,[r,s]=f.offsets.bottomRight,i=[[t,-e],[r,-e],[r,-s],[t,-s],[t,-e]];if(bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[i])){this._earlyReturn=!0;break}}}_hitTestFill(t){let e=null;if(P(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(S(t))e=t.rings;else{if(!x(t))return;e=t.paths}if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]);if(gt(t,e)&&(this._earlyReturn=!0),!this._earlyReturn){pt(t,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,e)&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=$(),this._path??=Q("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,s=0){const i=l();p(i,t);const n={x:i[0],y:i[1],width:i[2]-i[0],height:i[3]-i[1]},o=this._getSvgPath();o.setAttribute("d",e);const a=o.getBBox();if("point"===this._hittestType){const t=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),i=this.reverseTransformPt(this._searchTarget[0]);let o=Math.max(a.width/n.width,a.height/n.height),l=1;const h=2*t*o;h<1&&(l=2/h,o*=l,a.x*=l,a.y*=l,a.width*=l,a.height*=l);const c=1+s*o/2,m=this._getCanvasContext(a.width+2*c,a.height+2*c);m.setTransform(l,0,0,l,-a.x+c,-a.y+c);const f=new Path2D(e);r?m.fill(f):(m.lineWidth=s*(o/l),m.stroke(f));const u=(n.width*o-a.width)/2,d=(n.height*o-a.height)/2,g=Math.floor((i[0]-n.x-t)*o-u+c),p=Math.floor((n.height-(i[1]-n.y)-t)*o+d+c),_=Math.ceil(2*t*o),y=Math.ceil(2*t*o),P=m.getImageData(g,p,_,y).data;for(let e=3;e<P.length;e+=4)if(P[e]>127.5)return void(this._earlyReturn=!0)}else{const t=[[n.x,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height],[n.x+n.width,n.y],[n.x,n.y]];if(bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[t]))return void(this._earlyReturn=!0)}}_hitTestStroke(t,e){let r=null;if(P(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(S(t))r=t.rings;else{if(!x(t))return;r=t.paths}if("point"===this._hittestType){pt(this.reverseTransformPt(this._searchTarget[0]),r,G(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,r)&&(this._earlyReturn=!0)}}_resetHittest(){this.setTransform(),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null}}class ut extends ct{constructor(t,e,r,s){super(e,r),this._applyAdditionalRenderProps=s,this._colorSubstitutionHelper=new k,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!0);else if(P(t))this._buildPath(yt(t).rings,!0);else{if(!M(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,s,i,n){if(!t||!e||0===r)return;if(S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!1);else{if(!P(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(yt(t).rings,!0)}const o=this._ctx;o.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",o.lineWidth=Math.max(this.transformSize(r),at),this._setCapStyle(s),this._setJoinStyle(i),o.miterLimit=n,o.stroke()}pushClipPath(t){if(this._ctx.save(),S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!0);else{if(!P(t))return;this._buildPath(yt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:s,tintColor:i}=t,n=G(t.scaleX,1),o=this._resourceManager.getResource(s);if(null==o)return;let a=e*(o.width/o.height),l=e;e||(a=o.width,l=o.height);const h=H(s)||"src"in o&&H(o.src);let c="getFrame"in o?R(o):o;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&i&&(c=this._colorSubstitutionHelper.tintImageData(c,i));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:n*d*f,m12:n*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=St(t,this.transformSize(o(1))),s=this._textRasterizer.rasterizeText(e,r);if(!s)return;const{size:i,anchorX:n,anchorY:a,canvas:l}=s,h=i[0]*(n+.5),c=i[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:s,offsetX:i,offsetY:n,rotation:o,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!0);else if(P(t))this._buildPath(yt(t).rings,!0);else{if(!M(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=H(h)||"src"in c&&H(c.src);let u,d="getFrame"in c?R(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);o||(o=0),i?i*=t:i=0,n?n*=t:n=0,s&&(s*=t);const e=s?s/c.height:1,r=a&&s?a*s/c.width:1;if(0!==o||1!==e||1!==r||0!==i||0!==n){const t=new DOMMatrix;t.rotateSelf(0,0,-o).translateSelf(i,n).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:s,capStyle:i,joinStyle:o,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(S(t))f=t.rings;else if(x(t))f=t.paths;else{if(!P(t))return M(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=yt(t).rings}c||(c=m.width);const u=H(h)||"src"in m&&H(m.src);let d="getFrame"in m?R(m):m;s&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,s)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(n(c)),.5),p=g/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let w,b;_.save(),this._setCapStyle(i),this._setJoinStyle(o),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let n of f)if(n=e(n),wt(n),n&&!(n.length<=1)){w=this.transformPt(n[0]);for(let t=1;t<n.length;t++){b=this.transformPt(n[t]);const e=_t(w,b),r=new DOMMatrix;r.translateSelf(0,w[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),y.setTransform(r),_.strokeStyle=y,_.beginPath(),_.moveTo(w[0],w[1]),_.lineTo(b[0],b[1]),_.stroke(),w=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(S(t))r=t.rings;else if(x(t))r=t.paths;else{if(!P(t))return void lt().error("Unable to draw gradient fill");r=yt(t).rings}this._buildPath(r,!0);const{angle:i,gradientMethod:o,gradientSize:a,gradientSizeUnits:l}=e,h=I.CIMGradientFill,p=e.gradientType??h.gradientType,_=-s(i??0),y=c();for(const s of r){const t=s?s.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(s[e]);"Linear"!==o&&"Rectangular"!==o||(t=z(t,-_)),m(y,t)}}const[w,M,b,k]=y,T=this._ctx;switch(T.save(),o){case"Buffered":lt().error(`Gradient method "${o}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(n(a)):E(a,h.gradientSize)*(b-w),[s,i]="Discrete"===p?[b,b-r]:[w+r,w],o=z([s,t],_),c=z([i,t],_),m=T.createLinearGradient(o[0],o[1],c[0],c[1]);L(m,e),T.fillStyle=m,T.fill("evenodd");break}case"Circular":{const t=f(y),r=g(y)/2,s="Absolute"===l?this.transformSize(n(a)):E(a,h.gradientSize)*r,[i,o]="Discrete"===p?[r,r-s]:[s,0],c=T.createRadialGradient(t[0],t[1],i,t[0],t[1],o);L(c,e),T.fillStyle=c,T.fill("evenodd");break}case"Rectangular":{const r=f(y),s=r[0],i=r[1],o=z(r,_),c=(r,s,i,n,a,l,h,c)=>{T.save(),this.pushClipPath(t);const m=z([a,l],_),f=z([h,c],_);T.beginPath(),T.moveTo(o[0],o[1]),T.lineTo(m[0],m[1]),T.lineTo(f[0],f[1]),T.lineTo(o[0],o[1]),T.clip();const u=z([r,s],_),d=z([i,n],_),g=T.createLinearGradient(u[0],u[1],d[0],d[1]);L(g,e),T.fillStyle=g,T.fill("evenodd"),T.restore()};let m="Absolute"===l?this.transformSize(n(a)):E(a,h.gradientSize)*(u(y)/2),[g,P]="Discrete"===p?[b,b-m]:[s+m,s];c(g,i,P,i,b,M,b,k),[g,P]="Discrete"===p?[w,w+m]:[s-m,s],c(g,i,P,i,w,k,w,M),m="Absolute"===l?this.transformSize(n(a)):E(a,h.gradientSize)*(d(y)/2);let[S,x]="Discrete"===p?[k,k-m]:[i+m,i];c(s,S,s,x,b,k,w,k),[S,x]="Discrete"===p?[M,M+m]:[i-m,i],c(s,S,s,x,w,M,b,M);break}}T.restore()}drawGradientStroke(t,r){const{capStyle:s,gradientMethod:i,gradientSize:o,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(S(t))m=t.rings;else if(x(t))m=t.paths;else{if(!P(t))return void lt().error("Unable to draw gradient stroke");m=yt(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(n(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(s),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),wt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],s=p[1]-g[1];t+=Math.sqrt(r*r+s*s),g=p}const s="Absolute"===a?this.transformSize(n(o)):E(o,I.CIMGradientStroke.gradientSize)*("AcrossLine"===i?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const n=p[0]-g[0],o=p[1]-g[1],a=Math.sqrt(n*n+o*o);let h,c,m,y;switch(i){case"AcrossLine":{const[t,e]=z([n/a,o/a],-Math.PI/2),r=u/2,i="Discrete"===f?r:s-r;h=(g[0]+p[0])/2+t*i,c=(g[1]+p[1])/2+e*i,m=h-t*s,y=c-e*s;break}case"AlongLine":{const e=n/a,r=o/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*s,y=c+r*s):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*s,c=y-r*s);break}default:return lt().error("Unrecognized gradient method:",i),void d.restore()}const P=d.createLinearGradient(h,c,m,y);L(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const s of t){const t=s?s.length:0;if(t>1){let i=this.transformPt(s[0]);r.moveTo(i[0],i[1]);for(let e=1;e<t;e++)i=this.transformPt(s[e]),r.lineTo(i[0],i[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case"Butt":this._ctx.lineCap="butt";break;case"Round":this._ctx.lineCap="round";break;case"Square":this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case"Bevel":this._ctx.lineJoin="bevel";break;case"Round":this._ctx.lineJoin="round";break;case"Miter":this._ctx.lineJoin="miter"}}}function dt(t,e,r){let s=G(t.separation,I.CIMHatchFill.separation)*r,i=G(t.rotation);if(0===s)return null;s<0&&(s=-s);let n=0;const o=.5*s;for(;n>o;)n-=s;for(;n<-o;)n+=s;const a=l();p(a,e),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;i>180;)i-=180;for(;i<0;)i+=180;const c=Math.cos(i*ot),m=Math.sin(i*ot),f=-s*m,u=s*c;let d,g,_,y;n=G(t.offsetX)*r*m-G(t.offsetY)*r*c,d=_=Number.MAX_VALUE,g=y=-Number.MAX_VALUE;for(const l of h){const t=l[0],e=l[1],r=c*t+m*e,s=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,s),g=Math.max(g,r),y=Math.max(y,s)}_=Math.floor(_/s)*s;let P=c*d-m*_-f*n/s,S=m*d+c*_-u*n/s,x=c*g-m*_-f*n/s,w=m*g+c*_-u*n/s;const M=1+Math.round((y-_)/s),b=[];for(let l=0;l<M;l++)P+=f,S+=u,x+=f,w+=u,b.push([[P,S],[x,w]]);return{paths:b}}function gt(t,e){let r=0;for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],n=s[i];if(e[1]>t[1]==n[1]>t[1])continue;(n[0]-e[0])*(t[1]-e[1])-(n[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function pt(t,e,r){for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],n=s[i];let o=(n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]);if(0===o)continue;o=Math.sqrt(o);const a=((n[0]-e[0])*(t[1]-e[1])-(n[1]-e[1])*(t[0]-e[0]))/o;if(Math.abs(a)<r){const s=((n[0]-e[0])*(t[0]-e[0])+(n[1]-e[1])*(t[1]-e[1]))/o;if(s>-r&&s<o+r)return!0}}}return!1}function _t(t,e){const r=e[0]-t[0],s=e[1]-t[1];return 180/Math.PI*Math.atan2(s,r)}const yt=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,Pt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function St(e,r=1){const s=B(e),i=X(e.fontStyleName),n=e.fontFamilyName??t,{weight:o,style:a}=i,l=r*(e.height||5),h=J(e.horizontalAlignment),c=N(e.verticalAlignment),m=O(e),f=O(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=q(e.symbol),g=r*(V(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=O(p),y=V(p),P=q(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:n,style:Y(a),weight:W(o),decoration:s},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const xt=1e-4;function wt(t){let e,r,s,i,n,o=t[0],a=1;for(;a<t.length;)e=t[a][0]-o[0],r=t[a][1]-o[1],i=0!==e?r/e:Math.PI/2,void 0!==s&&Math.abs(i-s)<=xt?(t.splice(a-1,1),o=n):(n=o,o=t[a],a++),s=i}function Mt(t){const e=1e-6,r=t[0],s=t[t.length-1];return Math.abs(r[0]-s[0])<=e&&Math.abs(r[1]-s[1])<=e}function bt(t,e){t.length>1&&!Mt(t)&&(t=[...t,t[0]]);for(let r=0;r<e.length;r++){const s=e[r],i=s.length;for(const e of s)if(gt(e,[t]))return!0;if(Mt(s))for(const r of t)if(gt(r,e))return!0;for(let e=1;e<i;e++){const r=s[e-1],i=s[e];for(let e=0;e<t.length;e++){const s=t[e],n=t[(e+1)%t.length];if(y(r,i,s,n))return!0}}}return!1}export{ct as CIMSymbolDrawHelper,ut as CanvasDrawHelper,mt as EnvDrawHelper,ft as HittestDrawHelper,ht as Transformation,ot as cDegToRad,Pt as lineGapType2LineHeight};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const i=" /-,\n";function a(e){let t=e.length;for(;t--;)if(!i.includes(e.charAt(t)))return!1;return!0}function l(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,a(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const i=t[e.slice(n,o)];i&&r.push([null,i,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,a(t)])}return r}function c(e,t,r){let n="",o=null;for(const i of t){const[t,r,a]=i;if(null!=t&&""!==t)a?o=t:(null!=o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);null!=t&&""!==t&&(null!==o&&(n+=o,o=null),n+=t)}}return u(n,r)}function s(e,t,r,n){let o="",i=null;for(const a of t){const[t,n,l]=a;if(null!=t&&""!==t)l?i=t:(null!=i&&(o+=i,i=null),o+=t);else{let t=n;null!=r&&(t=Y(n,r));const a=e.attributes[t];null!=a&&""!==a&&(null!=i&&(o+=i,i=null),o+=a)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,i,a=!0){const l=t/o,c=r/i,s=Math.ceil(l/2),u=Math.ceil(c/2);for(let f=0;f<i;f++)for(let r=0;r<o;r++){const M=4*(r+(a?i-f-1:f)*o);let m=0,y=0,C=0,h=0,I=0,p=0,b=0;const d=(f+.5)*c;for(let n=Math.floor(f*c);n<(f+1)*c;n++){const o=Math.abs(d-(n+.5))/u,i=(r+.5)*l,a=o*o;for(let c=Math.floor(r*l);c<(r+1)*l;c++){let r=Math.abs(i-(c+.5))/s;const o=Math.sqrt(a+r*r);o>=-1&&o<=1&&(m=2*o*o*o-3*o*o+1,m>0&&(r=4*(c+n*t),b+=m*e[r+3],C+=m,e[r+3]<255&&(m=m*e[r+3]/250),h+=m*e[r],I+=m*e[r+1],p+=m*e[r+2],y+=m))}}n[M]=h/y,n[M+1]=I/y,n[M+2]=p/y,n[M+3]=b/C}}function M(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function m(e){return e.data?.symbol??null}function y(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function h(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function I(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const p=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?M(e.tintColor):[255,255,255,1];class g{constructor(e){this._import=e}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(e=>this.module=e)),this._promise}}function S(e){return new g(e)}function P(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function L(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function E(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function G(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=G(t);if(null!=e)return e}break;case"CIMTextSymbol":return G(e.symbol);case"CIMSolidFill":return e.color}return null}function T(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=T(e);if(null!=t)return t}break}case"CIMTextSymbol":return T(e.symbol);case"CIMSolidStroke":return e.color}}function x(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function A(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=A(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return A(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function v(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":return"center";case"Justify":return"justify"}}function N(e){switch(e){default:case"Bottom":return"bottom";case"Top":return"top";case"Center":return"middle";case"Baseline":return"baseline"}}function z(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}const F=e=>e.includes("data:image/svg+xml");function V(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function O(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function B(e,t,r,n,o,i,a=!0){const{infos:l}=i;let c=1,s=0,u=0,f=0,M=1;for(const{absoluteAnchorPoint:C,offsetX:h,offsetY:I,rotation:p,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:g}of l){M=C?1:c;u=Q(h,I,s,M,u),f=K(h,I,s,M,f),d&&(g||a)&&(c*=b/d),s=Z(p,k,s)}const m=Q(n,o,s,M,u),y=K(n,o,s,M,f);return{size:e*c,rotation:Z(t,r,s),offsetX:m,offsetY:y}}function R(e){if(null==e)return!1;if(Array.isArray(e))return e.every(e=>R(e));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function D(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function j(e){return e.split(" ").map(e=>Number(e))}function q(e){return"string"==typeof e?j(e):e}function W(e){return e?.dashTemplate&&(e.dashTemplate=q(e.dashTemplate)),e}function _(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return _(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return _(e.symbol)}}return"Normal"}function X(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&I(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function Y(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function H(e){return e.map(e=>({...e,propertyName:O(e.propertyName)}))}function J(e){const t={};for(const r in e){const n=e[r];t[O(r)]=n}return t}function U(e){if(!e)return 0;let t=0;for(const r of e)t+=$(r);return t}function $(e){if(!e)return 0;if(le(e))return e.inflateSize??256;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(p(e.offsetX)),Math.abs(p(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRadial":return Math.abs(e.length??5);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function K(e,t,r,n,o){const i=r*Math.PI/180;if(i){const r=Math.cos(i);return(Math.sin(i)*e+r*t)*n+o}return t*n+o}function Q(e,t,r,n,o){const i=r*Math.PI/180;if(i){return(Math.cos(i)*e-Math.sin(i)*t)*n+o}return e*n+o}function Z(e,t,r){return t?r-e:r+e}function ee(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let i=t[O(r)];if(null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180)),null==i&&(i=D(t.type,r.toLowerCase()),null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]]:o&&(i*=Math.PI/180))),null!=t.primitiveName){const a=e[t.primitiveName];if(null!=a){const e=a[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(i=e,null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180))):(i={valueExpressionInfo:e,defaultValue:i},null!=i&&(n?i={type:"Process",op:"ArcadeColor",value:i}:o&&(i={type:"Process",op:"Divide",left:i,right:180/Math.PI}))))}}if(null==i)throw new Error(`Failed to derive a value or an expression for "${r}".`);return i}function te(e,t,r){if(null!=t[O(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function re(e,t){return Math.max(Math.min((e??t)/100,1),0)}function ne(e){if(!e)return 3;switch(e){case"Begin":return 0;case"End":return 2;case"Both":return 1;default:return 3}}function oe(e){if(!e)return 2;switch(e){case"Tolerance":return 0;case"Text":return 1;default:return 2}}function ie(e){if(!e)return 2;switch(e){case"MoveBegin":return 0;case"MoveEnd":return 1;default:return 2}}function ae(e){if(!e)return 3;switch(e){case"Only":return 0;case"Suffix":return 1;case"Expression":return 2;default:return 3}}function le(e){return null!=e&&"inflateSize"in e&&null!=e.inflateSize}function ce(e){if("CIMPictureMarker"!==e.type&&"CIMVectorMarker"!==e.type)return!1;const t=e.markerPlacement;return!(I(t)&&!0===t.angleToLine)}function se(e){return null!=e&&ue(e)?e:void 0}function ue(e){return"setControlPoint"in e&&"getControlPoint"in e&&"setControlPointAt"in e&&"getControlPointAt"in e}export{u as adjustTextCase,l as analyzeTextParts,B as applyParentTransform,se as asCIMGeometryCursor,s as assignTextValuesFromFeature,z as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,E as fromCIMFontDecoration,L as fromCIMFontStyle,v as fromCIMHorizontalAlignment,N as fromCIMVerticalAlignment,D as getDefaultCIMValue,U as getEffectsInflateSize,d as getEnum,Y as getFieldName,G as getFillColor,P as getFontStyle,w as getFontWeight,p as getNumericValue,ee as getProcessParam,re as getRelativeGradientSize,X as getSize,T as getStrokeColor,A as getStrokeWidth,_ as getTextCasing,c as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,te as hasProcessParam,x as hasStrokeLayer,S as importLazily,h as isCIMFill,y as isCIMMarker,I as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,le as isGeometricLinearEffect,ce as isMarkerScreenAligned,F as isSVGImage,R as isValidCIMValue,V as mapCIMSymbolToGeometryType,M as normalizeAlpha,W as normalizeDashEffectTemplate,q as normalizeDashTemplate,H as normalizePrimitiveOverrideProps,j as parseDashTemplate,f as resampleHermite,oe as stringToDimensionMarkerFit,ne as stringToDimensionPartOptions,ie as stringToDimensionTextFit,ae as stringToDimensionTextOptions,m as toCIMSymbolJSON,J as toLowerCaseProps,O as uncapitalize};
2
+ import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const i=" /-,\n";function a(e){let t=e.length;for(;t--;)if(!i.includes(e.charAt(t)))return!1;return!0}function l(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,a(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const i=t[e.slice(n,o)];i&&r.push([null,i,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,a(t)])}return r}function c(e,t,r){let n="",o=null;for(const i of t){const[t,r,a]=i;if(null!=t&&""!==t)a?o=t:(null!=o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);null!=t&&""!==t&&(null!==o&&(n+=o,o=null),n+=t)}}return u(n,r)}function s(e,t,r,n){let o="",i=null;for(const a of t){const[t,n,l]=a;if(null!=t&&""!==t)l?i=t:(null!=i&&(o+=i,i=null),o+=t);else{let t=n;null!=r&&(t=Y(n,r));const a=e.attributes[t];null!=a&&""!==a&&(null!=i&&(o+=i,i=null),o+=a)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,i,a=!0){const l=t/o,c=r/i,s=Math.ceil(l/2),u=Math.ceil(c/2);for(let f=0;f<i;f++)for(let r=0;r<o;r++){const M=4*(r+(a?i-f-1:f)*o);let m=0,y=0,C=0,h=0,I=0,p=0,b=0;const d=(f+.5)*c;for(let n=Math.floor(f*c);n<(f+1)*c;n++){const o=Math.abs(d-(n+.5))/u,i=(r+.5)*l,a=o*o;for(let c=Math.floor(r*l);c<(r+1)*l;c++){let r=Math.abs(i-(c+.5))/s;const o=Math.sqrt(a+r*r);o>=-1&&o<=1&&(m=2*o*o*o-3*o*o+1,m>0&&(r=4*(c+n*t),b+=m*e[r+3],C+=m,e[r+3]<255&&(m=m*e[r+3]/250),h+=m*e[r],I+=m*e[r+1],p+=m*e[r+2],y+=m))}}n[M]=h/y,n[M+1]=I/y,n[M+2]=p/y,n[M+3]=b/C}}function M(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function m(e){return e.data?.symbol??null}function y(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function h(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function I(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const p=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?M(e.tintColor):[255,255,255,1];class g{constructor(e){this._import=e}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(e=>this.module=e)),this._promise}}function S(e){return new g(e)}function P(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function L(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function E(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function G(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=G(t);if(null!=e)return e}break;case"CIMTextSymbol":return G(e.symbol);case"CIMSolidFill":return e.color}return null}function x(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=x(e);if(null!=t)return t}break}case"CIMTextSymbol":return x(e.symbol);case"CIMSolidStroke":return e.color}}function T(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function A(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=A(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return A(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function v(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":return"center";case"Justify":return"justify"}}function N(e){switch(e){default:case"Bottom":return"bottom";case"Top":return"top";case"Center":return"middle";case"Baseline":return"baseline"}}function z(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}const F=e=>e.includes("data:image/svg+xml");function V(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function O(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function B(e,t,r,n,o,i,a=!0){const{infos:l}=i;let c=1,s=0,u=0,f=0,M=1;for(const{absoluteAnchorPoint:C,offsetX:h,offsetY:I,rotation:p,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:g}of l){M=C?1:c;u=Q(h,I,s,M,u),f=K(h,I,s,M,f),d&&(g||a)&&(c*=b/d),s=Z(p,k,s)}const m=Q(n,o,s,M,u),y=K(n,o,s,M,f);return{size:e*c,rotation:Z(t,r,s),offsetX:m,offsetY:y}}function R(e){if(null==e)return!1;if(Array.isArray(e))return e.every(e=>R(e));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function D(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function j(e){return e.split(" ").map(e=>Number(e))}function q(e){return"string"==typeof e?j(e):e}function W(e){return e?.dashTemplate&&(e.dashTemplate=q(e.dashTemplate)),e}function _(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return _(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return _(e.symbol)}}return"Normal"}function X(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&I(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function Y(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function H(e){return e.map(e=>({...e,propertyName:O(e.propertyName)}))}function J(e){const t={};for(const r in e){const n=e[r];t[O(r)]=n}return t}function U(e){if(!e)return 0;let t=0;for(const r of e)t+=$(r);return t}function $(e){if(!e)return 0;if(le(e))return e.inflateSize??256;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(p(e.offsetX)),Math.abs(p(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRadial":return Math.abs(e.length??5);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function K(e,t,r,n,o){const i=r*Math.PI/180;if(i){const r=Math.cos(i);return(Math.sin(i)*e+r*t)*n+o}return t*n+o}function Q(e,t,r,n,o){const i=r*Math.PI/180;if(i){return(Math.cos(i)*e-Math.sin(i)*t)*n+o}return e*n+o}function Z(e,t,r){return t?r-e:r+e}function ee(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let i=t[O(r)];if(null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180)),null==i&&(i=D(t.type,r.toLowerCase()),null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]]:o&&(i*=Math.PI/180))),null!=t.primitiveName){const a=e[t.primitiveName];if(null!=a){const e=a[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(i=e,null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180))):(i={valueExpressionInfo:e,defaultValue:i},null!=i&&(n?i={type:"Process",op:"ArcadeColor",value:i}:o&&(i={type:"Process",op:"Divide",left:i,right:180/Math.PI}))))}}if(null==i)throw new Error(`Failed to derive a value or an expression for "${r}".`);return i}function te(e,t,r){if(null!=t[O(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function re(e,t){return Math.max(Math.min((e??t)/100,1),0)}function ne(e){if(!e)return 3;switch(e){case"Begin":return 0;case"End":return 2;case"Both":return 1;default:return 3}}function oe(e){if(!e)return 2;switch(e){case"Tolerance":return 0;case"Text":return 1;default:return 2}}function ie(e){if(!e)return 2;switch(e){case"MoveBegin":return 0;case"MoveEnd":return 1;default:return 2}}function ae(e){if(!e)return 3;switch(e){case"Only":return 0;case"Suffix":return 1;case"Expression":return 2;default:return 3}}function le(e){return null!=e&&"inflateSize"in e&&null!=e.inflateSize}function ce(e){return null!=e&&se(e)?e:void 0}function se(e){return"setControlPoint"in e&&"getControlPoint"in e&&"setControlPointAt"in e&&"getControlPointAt"in e}export{u as adjustTextCase,l as analyzeTextParts,B as applyParentTransform,ce as asCIMGeometryCursor,s as assignTextValuesFromFeature,z as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,E as fromCIMFontDecoration,L as fromCIMFontStyle,v as fromCIMHorizontalAlignment,N as fromCIMVerticalAlignment,D as getDefaultCIMValue,U as getEffectsInflateSize,d as getEnum,Y as getFieldName,G as getFillColor,P as getFontStyle,w as getFontWeight,p as getNumericValue,ee as getProcessParam,re as getRelativeGradientSize,X as getSize,x as getStrokeColor,A as getStrokeWidth,_ as getTextCasing,c as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,te as hasProcessParam,T as hasStrokeLayer,S as importLazily,h as isCIMFill,y as isCIMMarker,I as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,le as isGeometricLinearEffect,F as isSVGImage,R as isValidCIMValue,V as mapCIMSymbolToGeometryType,M as normalizeAlpha,W as normalizeDashEffectTemplate,q as normalizeDashTemplate,H as normalizePrimitiveOverrideProps,j as parseDashTemplate,f as resampleHermite,oe as stringToDimensionMarkerFit,ne as stringToDimensionPartOptions,ie as stringToDimensionTextFit,ae as stringToDimensionTextOptions,m as toCIMSymbolJSON,J as toLowerCaseProps,O as uncapitalize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../Color.js";import{toCIMSymbolJSON as t,isCIMStroke as o,isCIMMarker as r,isCIMMarkerStrokePlacement as a,normalizeAlpha as n,isCIMFill as s}from"../cim/utils.js";function i(e){const a=t(e);if("CIMTextSymbol"===a?.type)return a.height??0;let n=0;if(a?.symbolLayers)for(const t of a.symbolLayers)r(t)&&null!=t.size&&t.size>n?n=t.size:o(t)&&null!=t.width&&t.width>n?n=t.width:s(t);return n}function c(e,o,r){if(!e)return;const a=t(e),n=i(e);if(0===n)return void l(a,o);f(a,o/n,!1,r)}function l(e,t){if(e)if("CIMTextSymbol"!==e.type){if(e.symbolLayers)for(const o of e.symbolLayers)switch(o.type){case"CIMPictureMarker":case"CIMVectorMarker":o.size=t;break;case"CIMPictureStroke":case"CIMSolidStroke":case"CIMGradientStroke":o.width=t}}else e.height=t}function f(e,t,o,r){if(e)if("CIMTextSymbol"!==e.type){if(o&&e.effects)for(const o of e.effects)M(o,t);if(e.symbolLayers)for(const o of e.symbolLayers){switch(o.type){case"CIMPictureMarker":case"CIMVectorMarker":m(o,t,r);break;case"CIMPictureStroke":case"CIMSolidStroke":case"CIMGradientStroke":!r?.preserveOutlineWidth&&o.width&&(o.width*=t);break;case"CIMPictureFill":o.height&&(o.height*=t),o.offsetX&&(o.offsetX*=t),o.offsetY&&(o.offsetY*=t);break;case"CIMHatchFill":f(o.lineSymbol,t,!0,{...r,preserveOutlineWidth:!1}),o.offsetX&&(o.offsetX*=t),o.offsetY&&(o.offsetY*=t),o.separation&&(o.separation*=t)}if(o.effects)for(const e of o.effects)M(e,t)}}else null!=e.height&&(e.height*=t)}function m(e,t,o){if(e&&(e.markerPlacement&&C(e.markerPlacement,t),e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t),e.anchorPoint&&"Absolute"===e.anchorPointUnits&&(e.anchorPoint={x:e.anchorPoint.x*t,y:e.anchorPoint.y*t}),e.size=null!=e.size?e.size*t:0,"CIMVectorMarker"===e.type&&e.markerGraphics))for(const r of e.markerGraphics)e.scaleSymbolsProportionally||f(r.symbol,t,!0,o)}function C(e,t){switch(a(e)&&e.offset&&(e.offset*=t),e.type){case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineSameSize":if(e.customEndingOffset&&(e.customEndingOffset*=t),e.offsetAlongLine&&(e.offsetAlongLine*=t),e.placementTemplate&&e.placementTemplate.length){const o=e.placementTemplate.map(e=>e*t);e.placementTemplate=o}break;case"CIMMarkerPlacementAlongLineVariableSize":if(e.maxRandomOffset&&(e.maxRandomOffset*=t),e.placementTemplate&&e.placementTemplate.length){const o=e.placementTemplate.map(e=>e*t);e.placementTemplate=o}break;case"CIMMarkerPlacementOnLine":e.startPointOffset&&(e.startPointOffset*=t);break;case"CIMMarkerPlacementAtExtremities":e.offsetAlongLine&&(e.offsetAlongLine*=t);break;case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementOnVertices":break;case"CIMMarkerPlacementAtRatioPositions":e.beginPosition&&(e.beginPosition*=t),e.endPosition&&(e.endPosition*=t);break;case"CIMMarkerPlacementPolygonCenter":e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t);break;case"CIMMarkerPlacementInsidePolygon":e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t),e.stepX&&(e.stepX*=t),e.stepY&&(e.stepY*=t)}}function M(e,t){switch(e.type){case"CIMGeometricEffectArrow":case"CIMGeometricEffectDonut":e.width&&(e.width*=t);break;case"CIMGeometricEffectBuffer":e.size&&(e.size*=t);break;case"CIMGeometricEffectCut":e.beginCut&&(e.beginCut*=t),e.endCut&&(e.endCut*=t),e.middleCut&&(e.middleCut*=t);break;case"CIMGeometricEffectDashes":if(e.customEndingOffset&&(e.customEndingOffset*=t),e.offsetAlongLine&&(e.offsetAlongLine*=t),e.dashTemplate&&e.dashTemplate.length){const o=e.dashTemplate.map(e=>e*t);e.dashTemplate=o}break;case"CIMGeometricEffectExtension":case"CIMGeometricEffectJog":case"CIMGeometricEffectRadial":e.length&&(e.length*=t);break;case"CIMGeometricEffectMove":e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t);break;case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":e.offset&&(e.offset*=t);break;case"CIMGeometricEffectRegularPolygon":e.radius&&(e.radius*=t);break;case"CIMGeometricEffectTaperedPolygon":e.fromWidth&&(e.fromWidth*=t),e.length&&(e.length*=t),e.toWidth&&(e.toWidth*=t);break;case"CIMGeometricEffectWave":e.amplitude&&(e.amplitude*=t),e.period&&(e.period*=t)}}function u(o){const r=[];return y(t(o),r),r.length?new e(n(r[0])):null}function y(e,t){if(!e)return;let n;n="CIMTextSymbol"===e.type?e.symbol:e;const s="CIMPolygonSymbol"===e.type;if(n?.symbolLayers)for(const i of n.symbolLayers)if(!(i.colorLocked||s&&(o(i)||r(i)&&i.markerPlacement&&a(i.markerPlacement))))switch(i.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":i.tintColor&&p(t,i.tintColor);break;case"CIMVectorMarker":i.markerGraphics?.forEach(e=>{y(e.symbol,t)});break;case"CIMSolidStroke":case"CIMSolidFill":p(t,i.color);break;case"CIMGradientFill":I(t,i);break;case"CIMHatchFill":y(i.lineSymbol,t)}}function p(e,t){for(const o of e)if(o.join(".")===t.join("."))return;e.push(t)}function I(e,t){const o=t.colorRamp?.type;switch(o){case"CIMMultipartColorRamp":t.colorRamp.colorRamps?.forEach(t=>{"CIMLinearContinuousColorRamp"===t.type&&b(e,t)});break;case"CIMLinearContinuousColorRamp":case"CIMPolarContinuousColorRamp":b(e,t.colorRamp)}}function b(e,t){t&&(t.fromColor&&p(e,t.fromColor),t.toColor&&p(e,t.toColor))}function k(o,r,a){r instanceof e||(r=new e(r));const n=t(o);n&&h(n,r,a)}function h(e,t,n){if(!e)return;let i;i="CIMTextSymbol"===e.type?e.symbol:e;const c="CIMPolygonSymbol"===i?.type;if(i?.symbolLayers)for(const l of i.symbolLayers){if(l.colorLocked)continue;if(c)if(n){const{layersToColor:e}=n;if((o(l)||r(l)&&l.markerPlacement&&a(l.markerPlacement))&&"fill"===e||s(l)&&"outline"===e)continue}else if(o(l)||r(l)&&l.markerPlacement&&a(l.markerPlacement))continue;const e=t.toArray();switch(l.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":l.tintColor=e;break;case"CIMVectorMarker":l.markerGraphics?.forEach(e=>{h(e.symbol,t,n)});break;case"CIMSolidStroke":case"CIMSolidFill":l.color=e;break;case"CIMGradientFill":d(l,t);break;case"CIMHatchFill":h(l.lineSymbol,t,n)}}}function d(e,t){const o=e.colorRamp?.type;switch(o){case"CIMMultipartColorRamp":e.colorRamp.colorRamps?.forEach(e=>{"CIMLinearContinuousColorRamp"===e.type&&P(e,t)});break;case"CIMLinearContinuousColorRamp":case"CIMPolarContinuousColorRamp":P(e.colorRamp,t)}}function P(e,t){if(e&&(e.fromColor&&(e.fromColor=t.toArray()),e.toColor)){const o=t.clone();o.a=0,e.toColor=o.toArray()}}function g(e,o=!1){const r=t(e);if("CIMTextSymbol"===r?.type||"CIMPointSymbol"===r?.type){const e=r.angle;return null!=e&&o?360-e:e??0}return 0}function S(e,o,a=!1){const n=t(e);if(a&&(o=360-o),"CIMTextSymbol"!==n?.type){if("CIMPointSymbol"===n?.type&&n.symbolLayers){const e=o-(n.angle||0);for(const t of n.symbolLayers)if(r(t)){let o=t.rotation||0;t.rotateClockwise?o-=e:o+=e,t.rotation=o}n.angle=o}}else n.angle=o}function L(e){const o=t(e);if(!o)return null;switch(o.type){case"CIMPointSymbol":return"CIMPointSymbol";case"CIMLineSymbol":return"CIMLineSymbol";case"CIMPolygonSymbol":return"CIMPolygonSymbol";case"CIMTextSymbol":return"CIMTextSymbol";case"CIMMeshSymbol":return"CIMMeshSymbol";default:return null}}export{k as applyCIMSymbolColor,S as applyCIMSymbolRotation,u as getCIMSymbolColor,g as getCIMSymbolRotation,i as getCIMSymbolSize,L as getCIMSymbolType,m as scaleCIMMarker,f as scaleCIMSymbol,c as scaleCIMSymbolTo};
2
+ import e from"../../Color.js";import{toCIMSymbolJSON as t,isCIMStroke as o,isCIMMarker as r,isCIMMarkerStrokePlacement as a,isCIMFill as n,normalizeAlpha as s}from"../cim/utils.js";function i(e){const a=t(e);if("CIMTextSymbol"===a?.type)return a.height??0;let s=0;if(a?.symbolLayers)for(const t of a.symbolLayers)r(t)&&null!=t.size&&t.size>s?s=t.size:o(t)&&null!=t.width&&t.width>s?s=t.width:n(t);return s}function c(e,o,r){if(!e)return;const a=t(e),n=i(e);if(0===n)return void l(a,o);f(a,o/n,!1,r)}function l(e,t){if(e)if("CIMTextSymbol"!==e.type){if(e.symbolLayers)for(const o of e.symbolLayers)switch(o.type){case"CIMPictureMarker":case"CIMVectorMarker":o.size=t;break;case"CIMPictureStroke":case"CIMSolidStroke":case"CIMGradientStroke":o.width=t}}else e.height=t}function f(e,t,o,r){if(e)if("CIMTextSymbol"!==e.type){if(o&&e.effects)for(const o of e.effects)M(o,t);if(e.symbolLayers)for(const o of e.symbolLayers){switch(o.type){case"CIMPictureMarker":case"CIMVectorMarker":m(o,t,r);break;case"CIMPictureStroke":case"CIMSolidStroke":case"CIMGradientStroke":!r?.preserveOutlineWidth&&o.width&&(o.width*=t);break;case"CIMPictureFill":o.height&&(o.height*=t),o.offsetX&&(o.offsetX*=t),o.offsetY&&(o.offsetY*=t);break;case"CIMHatchFill":f(o.lineSymbol,t,!0,{...r,preserveOutlineWidth:!1}),o.offsetX&&(o.offsetX*=t),o.offsetY&&(o.offsetY*=t),o.separation&&(o.separation*=t)}if(o.effects)for(const e of o.effects)M(e,t)}}else null!=e.height&&(e.height*=t)}function m(e,t,o){if(e&&(e.markerPlacement&&C(e.markerPlacement,t),e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t),e.anchorPoint&&"Absolute"===e.anchorPointUnits&&(e.anchorPoint={x:e.anchorPoint.x*t,y:e.anchorPoint.y*t}),e.size=null!=e.size?e.size*t:0,"CIMVectorMarker"===e.type&&e.markerGraphics))for(const r of e.markerGraphics)e.scaleSymbolsProportionally||f(r.symbol,t,!0,o)}function C(e,t){switch(a(e)&&e.offset&&(e.offset*=t),e.type){case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineSameSize":if(e.customEndingOffset&&(e.customEndingOffset*=t),e.offsetAlongLine&&(e.offsetAlongLine*=t),e.placementTemplate&&e.placementTemplate.length){const o=e.placementTemplate.map(e=>e*t);e.placementTemplate=o}break;case"CIMMarkerPlacementAlongLineVariableSize":if(e.maxRandomOffset&&(e.maxRandomOffset*=t),e.placementTemplate&&e.placementTemplate.length){const o=e.placementTemplate.map(e=>e*t);e.placementTemplate=o}break;case"CIMMarkerPlacementOnLine":e.startPointOffset&&(e.startPointOffset*=t);break;case"CIMMarkerPlacementAtExtremities":e.offsetAlongLine&&(e.offsetAlongLine*=t);break;case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementOnVertices":break;case"CIMMarkerPlacementAtRatioPositions":e.beginPosition&&(e.beginPosition*=t),e.endPosition&&(e.endPosition*=t);break;case"CIMMarkerPlacementPolygonCenter":e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t);break;case"CIMMarkerPlacementInsidePolygon":e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t),e.stepX&&(e.stepX*=t),e.stepY&&(e.stepY*=t)}}function M(e,t){switch(e.type){case"CIMGeometricEffectArrow":case"CIMGeometricEffectDonut":e.width&&(e.width*=t);break;case"CIMGeometricEffectBuffer":e.size&&(e.size*=t);break;case"CIMGeometricEffectCut":e.beginCut&&(e.beginCut*=t),e.endCut&&(e.endCut*=t),e.middleCut&&(e.middleCut*=t);break;case"CIMGeometricEffectDashes":if(e.customEndingOffset&&(e.customEndingOffset*=t),e.offsetAlongLine&&(e.offsetAlongLine*=t),e.dashTemplate&&e.dashTemplate.length){const o=e.dashTemplate.map(e=>e*t);e.dashTemplate=o}break;case"CIMGeometricEffectExtension":case"CIMGeometricEffectJog":case"CIMGeometricEffectRadial":e.length&&(e.length*=t);break;case"CIMGeometricEffectMove":e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t);break;case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":e.offset&&(e.offset*=t);break;case"CIMGeometricEffectRegularPolygon":e.radius&&(e.radius*=t);break;case"CIMGeometricEffectTaperedPolygon":e.fromWidth&&(e.fromWidth*=t),e.length&&(e.length*=t),e.toWidth&&(e.toWidth*=t);break;case"CIMGeometricEffectWave":e.amplitude&&(e.amplitude*=t),e.period&&(e.period*=t)}}function u(o){const r=[];return y(t(o),r),r.length?new e(s(r[0])):null}function y(e,t){if(!e)return;let n;n="CIMTextSymbol"===e.type?e.symbol:e;const s="CIMPolygonSymbol"===e.type;if(n?.symbolLayers)for(const i of n.symbolLayers)if(!(i.colorLocked||s&&(o(i)||r(i)&&i.markerPlacement&&a(i.markerPlacement))))switch(i.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":i.tintColor&&p(t,i.tintColor);break;case"CIMVectorMarker":i.markerGraphics?.forEach(e=>{y(e.symbol,t)});break;case"CIMSolidStroke":case"CIMSolidFill":p(t,i.color);break;case"CIMGradientFill":I(t,i);break;case"CIMHatchFill":y(i.lineSymbol,t)}}function p(e,t){for(const o of e)if(o.join(".")===t.join("."))return;e.push(t)}function I(e,t){const o=t.colorRamp?.type;switch(o){case"CIMMultipartColorRamp":t.colorRamp.colorRamps?.forEach(t=>{"CIMLinearContinuousColorRamp"===t.type&&b(e,t)});break;case"CIMLinearContinuousColorRamp":case"CIMPolarContinuousColorRamp":b(e,t.colorRamp)}}function b(e,t){t&&(t.fromColor&&p(e,t.fromColor),t.toColor&&p(e,t.toColor))}function k(o,r,a){r instanceof e||(r=new e(r));const n=t(o);n&&h(n,r,a)}function h(e,t,s){if(!e)return;let i;i="CIMTextSymbol"===e.type?e.symbol:e;const c="CIMPolygonSymbol"===i?.type;if(i?.symbolLayers)for(const l of i.symbolLayers){if(l.colorLocked)continue;if(c)if(s){const{layersToColor:e}=s;if((o(l)||r(l)&&l.markerPlacement&&a(l.markerPlacement))&&"fill"===e||n(l)&&"outline"===e)continue}else if(o(l)||r(l)&&l.markerPlacement&&a(l.markerPlacement))continue;const e=t.toArray();switch(l.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":l.tintColor=e;break;case"CIMVectorMarker":l.markerGraphics?.forEach(e=>{h(e.symbol,t,s)});break;case"CIMSolidStroke":case"CIMSolidFill":l.color=e;break;case"CIMGradientFill":d(l,t);break;case"CIMHatchFill":h(l.lineSymbol,t,s)}}}function d(e,t){const o=e.colorRamp?.type;switch(o){case"CIMMultipartColorRamp":e.colorRamp.colorRamps?.forEach(e=>{"CIMLinearContinuousColorRamp"===e.type&&P(e,t)});break;case"CIMLinearContinuousColorRamp":case"CIMPolarContinuousColorRamp":P(e.colorRamp,t)}}function P(e,t){if(e&&(e.fromColor&&(e.fromColor=t.toArray()),e.toColor)){const o=t.clone();o.a=0,e.toColor=o.toArray()}}function g(e,o=!1){const r=t(e);if("CIMTextSymbol"===r?.type||"CIMPointSymbol"===r?.type){const e=r.angle;return null!=e&&o?360-e:e??0}return 0}function S(e,o,a=!1){const n=t(e);if(a&&(o=360-o),"CIMTextSymbol"!==n?.type){if("CIMPointSymbol"===n?.type&&n.symbolLayers){const e=o-(n.angle||0);for(const t of n.symbolLayers)if(r(t)){let o=t.rotation||0;t.rotateClockwise?o-=e:o+=e,t.rotation=o}n.angle=o}}else n.angle=o}function L(e){const o=t(e);if(!o)return null;switch(o.type){case"CIMPointSymbol":return"CIMPointSymbol";case"CIMLineSymbol":return"CIMLineSymbol";case"CIMPolygonSymbol":return"CIMPolygonSymbol";case"CIMTextSymbol":return"CIMTextSymbol";case"CIMMeshSymbol":return"CIMMeshSymbol";default:return null}}export{k as applyCIMSymbolColor,S as applyCIMSymbolRotation,u as getCIMSymbolColor,g as getCIMSymbolRotation,i as getCIMSymbolSize,L as getCIMSymbolType,m as scaleCIMMarker,f as scaleCIMSymbol,c as scaleCIMSymbolTo};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../Color.js";import{forEach as t}from"../../core/asyncUtils.js";import{px2pt as r}from"../../core/screenUtils.js";import{ONES as o}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{effectFunctionsFromJSON as n}from"../../layers/effects/jsonUtils.js";import{applyCIMSymbolRotation as l,getCIMSymbolColor as i}from"./cimSymbolUtils.js";import{getStroke as c}from"./gfxUtils.js";import u from"./Symbol3DMaterial.js";import{isSymbol3D as s,isSymbol2D as a}from"./typeUtils.js";function f(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.size}function m(e){if(!e)return 0;if(s(e)){const t=f(e);return null!=t?t:0}return r(c(e)?.width)}function y(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.color}function p(t){if(!t)return null;if(s(t))return y(t);const r=c(t)?.color;return r?new e(r):null}function h(e){if(null==e||!("symbolLayers"in e)||null==e.symbolLayers)return!1;switch(e.type){case"point-3d":return e.symbolLayers.some(e=>"object"===e.type);case"line-3d":return e.symbolLayers.some(e=>"path"===e.type);case"polygon-3d":return e.symbolLayers.some(e=>"object"===e.type||"extrude"===e.type);default:return!1}}function d(e){return e.resource?.href??""}function b(t,r){if(!t)return null;let o=null;return s(t)?o=w(t):a(t)&&(o="cim"===t.type?i(t):t.color?new e(t.color):null),o?k(o,r):null}function w(t){const r=t.symbolLayers;if(!r)return null;let o=null;return r.forEach(e=>{"object"===e.type&&e.resource?.href||(o="water"===e.type?e.color:e.material?e.material.color:null)}),o?new e(o):null}function k(t,r){if(null==r||null==t)return t;const o=t.toRgba();return o[3]=o[3]*r,new e(o)}function g(t,r,o){const n=t.symbolLayers;if(!n)return;const l=(t,n=!1)=>{let l=r??t??null;return null!=o?.override&&(!l&&n&&(l=new e([255,255,255])),l&&(l.a=o.override)),k(l,o?.add)};n.forEach(e=>{if("water"===e.type)return void(e.color=k(e.color,o?.add));const t=null!=e.material?e.material.color:null,r=l(t,"icon"===e.type&&null!=e.resource?.href);null==e.material?e.material=new u({color:r}):e.material.color=r,"outline"in e&&e.outline?.color&&null!=o?.add&&(e.outline.color=k(e.outline.color,o.add)),"marker"in e&&null!=e.marker&&(e.marker.color=l(e.marker.color))})}function j(e,t,r){t=t??e.color,null!=r?.override&&t&&(t.a=r.override),t&&(e.color=k(t,r?.add)),"outline"in e&&e.outline?.color&&(e.outline.color=k(e.outline.color,r?.add))}function L(t,r,o){t&&(r||null!=o)&&(r&&(r=new e(r)),s(t)?g(t,r,o):a(t)&&j(t,r,o))}async function v(e,r){const o=e.symbolLayers;o&&await t(o,async e=>z(e,r))}async function z(e,t){switch(e.type){case"extrude":U(e,t);break;case"icon":case"line":case"text":x(e,t);break;case"path":O(e,t);break;case"object":await E(e,t)}}function x(e,t){const r=S(t);null!=r&&(e.size=r)}function S(e){for(const t of e)if("number"==typeof t)return t;return null}function U(e,t){const r=t[2];"number"==typeof r&&(e.size=r)}async function E(e,t){const{resourceSize:r,symbolSize:o}=await C(e),n=R(t,r,o);null!=n&&(e.width=D(t[0],o[0],r[0],n),e.depth=D(t[1],o[1],r[1],n),e.height=D(t[2],o[2],r[2],n))}function O(e,t){const r=R(t,o,[e.width,void 0,e.height]);null!=r&&(e.width=D(t[0],e.width,1,r),e.height=D(t[2],e.height,1,r))}function R(e,t,r){for(let o=0;o<3;o++){const n=e[o];switch(n){case"symbol-value":{const e=r[o];return null!=e?e/t[o]:1}case"proportional":break;default:if(null!=n&&t[o])return n/t[o]}}return null}async function C(e){const{computeObjectLayerResourceSize:t}=await import("./symbolLayerUtils.js"),r=await t(e,10),{width:o,height:n,depth:l}=e,i=[o,l,n];let c=1;for(let u=0;u<3;u++){const e=i[u];if(null!=e){c=e/r[u];break}}for(let u=0;u<3;u++)null==i[u]&&(i[u]=r[u]*c);return{resourceSize:r,symbolSize:i}}function D(e,t,r,o){switch(e){case"proportional":return r*o;case"symbol-value":return null!=t?t:r;default:return e}}function J(e,t){const r=S(t);if(null!=r)switch(e.type){case"simple-marker":e.size=r;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=r,e.height=r*t):(e.width=r*t,e.height=r);break}case"simple-line":e.width=r;break;case"text":e.font.size=r}}async function M(e,t){if(e&&t)return s(e)?v(e,t):void(a(e)&&J(e,t))}function N(e,t,r){if(e&&null!=t)if(s(e)){const o=e.symbolLayers;o&&o.forEach(e=>{if("object"===e.type)switch(r){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)})}else if(a(e))switch(e.type){case"simple-marker":case"picture-marker":case"text":e.angle+=t;break;case"cim":l(e,t,!0)}}function q(e,t){if(!e)return null;const r=(t?e.effects:e.effects.filter(e=>"bloom"!==e.type)).map(e=>e.toJSON());return n(r)}function A(e){return null!=e&&"polygon-3d"===e.type&&e.symbolLayers.some(e=>"extrude"===e.type)}export{L as applyColorToSymbol,k as applyOpacityToColor,N as applyRotationToSymbol,M as applySizesToSymbol,q as getCSSFilterFromEffectList,b as getColorFromSymbol,d as getIconHref,p as getSymbolOutlineColor,m as getSymbolOutlineSize,h as isVolumetricSymbol,A as symbolHasExtrudeSymbolLayer};
2
+ import e from"../../Color.js";import{forEach as t}from"../../core/asyncUtils.js";import{px2pt as r}from"../../core/screenUtils.js";import{ONES as n}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{effectFunctionsFromJSON as o}from"../../layers/effects/jsonUtils.js";import{applyCIMSymbolRotation as l,scaleCIMSymbolTo as i,getCIMSymbolColor as c}from"./cimSymbolUtils.js";import{getStroke as s}from"./gfxUtils.js";import u from"./Symbol3DMaterial.js";import{isSymbol3D as a,isSymbol2D as f}from"./typeUtils.js";function m(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.size}function y(e){if(!e)return 0;if(a(e)){const t=m(e);return null!=t?t:0}return r(s(e)?.width)}function p(e){const t=e.symbolLayers?.at(-1);if(t&&"outline"in t)return t?.outline?.color}function h(t){if(!t)return null;if(a(t))return p(t);const r=s(t)?.color;return r?new e(r):null}function d(e){if(null==e||!("symbolLayers"in e)||null==e.symbolLayers)return!1;switch(e.type){case"point-3d":return e.symbolLayers.some(e=>"object"===e.type);case"line-3d":return e.symbolLayers.some(e=>"path"===e.type);case"polygon-3d":return e.symbolLayers.some(e=>"object"===e.type||"extrude"===e.type);default:return!1}}function b(e){return e.resource?.href??""}function w(t,r){if(!t)return null;let n=null;return a(t)?n=k(t):f(t)&&(n="cim"===t.type?c(t):t.color?new e(t.color):null),n?g(n,r):null}function k(t){const r=t.symbolLayers;if(!r)return null;let n=null;return r.forEach(e=>{"object"===e.type&&e.resource?.href||(n="water"===e.type?e.color:e.material?e.material.color:null)}),n?new e(n):null}function g(t,r){if(null==r||null==t)return t;const n=t.toRgba();return n[3]=n[3]*r,new e(n)}function j(t,r,n){const o=t.symbolLayers;if(!o)return;const l=(t,o=!1)=>{let l=r??t??null;return null!=n?.override&&(!l&&o&&(l=new e([255,255,255])),l&&(l.a=n.override)),g(l,n?.add)};o.forEach(e=>{if("water"===e.type)return void(e.color=g(e.color,n?.add));const t=null!=e.material?e.material.color:null,r=l(t,"icon"===e.type&&null!=e.resource?.href);null==e.material?e.material=new u({color:r}):e.material.color=r,"outline"in e&&e.outline?.color&&null!=n?.add&&(e.outline.color=g(e.outline.color,n.add)),"marker"in e&&null!=e.marker&&(e.marker.color=l(e.marker.color))})}function L(e,t,r){t=t??e.color,null!=r?.override&&t&&(t.a=r.override),t&&(e.color=g(t,r?.add)),"outline"in e&&e.outline?.color&&(e.outline.color=g(e.outline.color,r?.add))}function v(t,r,n){t&&(r||null!=n)&&(r&&(r=new e(r)),a(t)?j(t,r,n):f(t)&&L(t,r,n))}async function z(e,r){const n=e.symbolLayers;n&&await t(n,async e=>x(e,r))}async function x(e,t){switch(e.type){case"extrude":E(e,t);break;case"icon":case"line":case"text":S(e,t);break;case"path":R(e,t);break;case"object":await O(e,t)}}function S(e,t){const r=U(t);null!=r&&(e.size=r)}function U(e){for(const t of e)if("number"==typeof t)return t;return null}function E(e,t){const r=t[2];"number"==typeof r&&(e.size=r)}async function O(e,t){const{resourceSize:r,symbolSize:n}=await D(e),o=C(t,r,n);null!=o&&(e.width=J(t[0],n[0],r[0],o),e.depth=J(t[1],n[1],r[1],o),e.height=J(t[2],n[2],r[2],o))}function R(e,t){const r=C(t,n,[e.width,void 0,e.height]);null!=r&&(e.width=J(t[0],e.width,1,r),e.height=J(t[2],e.height,1,r))}function C(e,t,r){for(let n=0;n<3;n++){const o=e[n];switch(o){case"symbol-value":{const e=r[n];return null!=e?e/t[n]:1}case"proportional":break;default:if(null!=o&&t[n])return o/t[n]}}return null}async function D(e){const{computeObjectLayerResourceSize:t}=await import("./symbolLayerUtils.js"),r=await t(e,10),{width:n,height:o,depth:l}=e,i=[n,l,o];let c=1;for(let s=0;s<3;s++){const e=i[s];if(null!=e){c=e/r[s];break}}for(let s=0;s<3;s++)null==i[s]&&(i[s]=r[s]*c);return{resourceSize:r,symbolSize:i}}function J(e,t,r,n){switch(e){case"proportional":return r*n;case"symbol-value":return null!=t?t:r;default:return e}}function M(e,t){const r=U(t);if(null!=r)switch(e.type){case"simple-marker":e.size=r;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=r,e.height=r*t):(e.width=r*t,e.height=r);break}case"simple-line":e.width=r;break;case"text":e.font.size=r;break;case"simple-fill":case"picture-fill":break;case"cim":i(e,r,{preserveOutlineWidth:!1})}}async function N(e,t){if(e&&t)return a(e)?z(e,t):void(f(e)&&M(e,t))}function W(e,t,r){if(e&&null!=t)if(a(e)){const n=e.symbolLayers;n&&n.forEach(e=>{if("object"===e.type)switch(r){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)})}else if(f(e))switch(e.type){case"simple-marker":case"picture-marker":case"text":e.angle+=t;break;case"cim":l(e,t,!0)}}function q(e,t){if(!e)return null;const r=(t?e.effects:e.effects.filter(e=>"bloom"!==e.type)).map(e=>e.toJSON());return o(r)}function A(e){return null!=e&&"polygon-3d"===e.type&&e.symbolLayers.some(e=>"extrude"===e.type)}export{v as applyColorToSymbol,g as applyOpacityToColor,W as applyRotationToSymbol,N as applySizesToSymbol,q as getCSSFilterFromEffectList,w as getColorFromSymbol,b as getIconHref,h as getSymbolOutlineColor,y as getSymbolOutlineSize,d as isVolumetricSymbol,A as symbolHasExtrudeSymbolLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{dataDrivenUnit2 as r,dataDrivenUnit1 as a,dataDrivenUnit0 as n,visualVariableUnit as u,localTimeOriginUnit as h,gpgpuUnit as o,animationUnit as d,filterFlagsUnit as l}from"./definitions.js";import{getDisplayIdTexel as g}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as _}from"./Utils.js";import{DisposableFramebufferObject as c}from"../../../webgl/FramebufferObject.js";import x from"../../../webgl/Texture.js";import{TextureDescriptor as f}from"../../../webgl/TextureDescriptor.js";const b=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:a}=t,n=p(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=a,a||(this.data=new n(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new f(this.size);return t.wrapMode=33071,t.samplingMode=9728,t.dataType=this.pixelType,t}get usedMemory(){return null!=this.data?i(this.data):0}setData(t,e,i){const s=g(t),r=this.data,a=s*this.texelSize+e;!r||a>=r.length||(r[a]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=g(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new c(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const a=this.data.buffer,n=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,d=h,l=this.size,g=o,_=h*this.size*u,c=(l+g*this.size)*u-_,x=p(this.pixelType),f=new x(a,_*x.BYTES_PER_ELEMENT,c),m=this.size,T=g-d+1;if(T>this.size)return void b().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));n.updateData(0,0,d,m,T,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const a=1<<i%this.texelSize;t.layout&a&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new x(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,a=this._lastTexture.descriptor.pixelFormat,n=this.getFBO(t),u=_(r),h=new(p(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.boundFramebuffer,{x:d,y:l,width:g,height:c}=t.getViewport();t.bindFramebuffer(n),n.readPixels(0,0,i,s,a,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(d,l,g,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class T{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._hasPendingUpdate=s(!1),this._locked=!1}get updating(){return this._hasPendingUpdate.value}get locked(){return this._locked}get usedMemory(){let t=0;for(const e of this._data??[])null!=e&&(t+=e.usedMemory);return t}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map((t,e)=>null!=t?new m(t,this.size,e):null);else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new m(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}setLocalTimeOrigin(t,e){this.setData(t,7,0,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVisualVariableData(t,e){return this.getData(t,3,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const a=r.getData(t,i);return null!=a?a:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),this._hasPendingUpdate.value=!0,has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}get hasPendingUpdates(){return this._pendingAttributeUpdates.length>0}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const e of t){const{blockData:t,initArgs:i,sendUpdateEpoch:s,version:r}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=i&&this._initialize(i);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}}this._hasPendingUpdate.value=!1}getUniforms(){return{size:this.size}}getTextures(t){return{filterFlags:{texture:this._getTexture(t,0),unit:l},animation:{texture:this._getTexture(t,1),unit:d},gpgpu:{texture:this._getTexture(t,2),unit:o},localTimeOrigin:{texture:this._getTexture(t,7),unit:h},visualVariableData:{texture:this._getTexture(t,3),unit:u},dataDriven0:{texture:this._getTexture(t,4),unit:n},dataDriven1:{texture:this._getTexture(t,5),unit:a},dataDriven2:{texture:this._getTexture(t,6),unit:r}}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new f(1);e.wrapMode=33071,e.samplingMode=9728,this._defaultTexture=new x(t,e,new Uint8Array(4))}return this._defaultTexture}}export{T as AttributeStoreView};
2
+ import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{dataDrivenUnit2 as r,dataDrivenUnit1 as a,dataDrivenUnit0 as n,visualVariableUnit as u,localTimeOriginUnit as h,gpgpuUnit as o,animationUnit as d,filterFlagsUnit as l}from"./definitions.js";import{getDisplayIdTexel as p}from"./DisplayId.js";import{getPixelArrayCtor as g,getPixelBytes as _}from"./Utils.js";import{SizedPixelFormat as c}from"../../../webgl/enums.js";import{DisposableFramebufferObject as x}from"../../../webgl/FramebufferObject.js";import f from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class T{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:a}=t,n=g(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=a,a||(this.data=new n(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b(this.size);if(t.wrapMode=33071,t.samplingMode=9728,t.dataType=this.pixelType,2===this.blockIndex)t.pixelFormat=6403,t.internalFormat=c.R8;return t}get usedMemory(){return null!=this.data?i(this.data):0}setData(t,e,i){const s=p(t),r=this.data,a=s*this.texelSize+e;!r||a>=r.length||(r[a]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=p(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const a=this.data.buffer,n=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,d=h,l=this.size,p=o,_=h*this.size*u,c=(l+p*this.size)*u-_,x=g(this.pixelType),f=new x(a,_*x.BYTES_PER_ELEMENT,c),b=this.size,T=p-d+1;if(T>this.size)return void m().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));n.updateData(0,0,d,b,T,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const a=1<<i%this.texelSize;t.layout&a&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=g(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,a=this._lastTexture.descriptor.pixelFormat,n=this.getFBO(t),u=_(r),h=new(g(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.boundFramebuffer,{x:d,y:l,width:p,height:c}=t.getViewport();t.bindFramebuffer(n),n.readPixels(0,0,i,s,a,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(d,l,p,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._hasPendingUpdate=s(!1),this._locked=!1}get updating(){return this._hasPendingUpdate.value}get locked(){return this._locked}get usedMemory(){let t=0;for(const e of this._data??[])null!=e&&(t+=e.usedMemory);return t}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map((t,e)=>null!=t?new T(t,this.size,e):null);else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new T(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}setLocalTimeOrigin(t,e){this.setData(t,7,0,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVisualVariableData(t,e){return this.getData(t,3,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const a=r.getData(t,i);return null!=a?a:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),this._hasPendingUpdate.value=!0,has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}get hasPendingUpdates(){return this._pendingAttributeUpdates.length>0}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const e of t){const{blockData:t,initArgs:i,sendUpdateEpoch:s,version:r}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=i&&this._initialize(i);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}}this._hasPendingUpdate.value=!1}getUniforms(){return{size:this.size}}getTextures(t){return{filterFlags:{texture:this._getTexture(t,0),unit:l},animation:{texture:this._getTexture(t,1),unit:d},gpgpu:{texture:this._getTexture(t,2),unit:o},localTimeOrigin:{texture:this._getTexture(t,7),unit:h},visualVariableData:{texture:this._getTexture(t,3),unit:u},dataDriven0:{texture:this._getTexture(t,4),unit:n},dataDriven1:{texture:this._getTexture(t,5),unit:a},dataDriven2:{texture:this._getTexture(t,6),unit:r}}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b(1);e.wrapMode=33071,e.samplingMode=9728,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../../../core/has.js";import"../../../../core/Logger.js";import{TechniqueProgramCache as e}from"./shaderGraph/techniques/TechniqueProgramCache.js";class t{constructor(){this._currentPipelineStateNeedsUpdate=!1,this._programCache=new e}dispose(){this._programCache.destroy()}clearShaderCache(){this._programCache.destroy(),this._programCache=new e}setShader(e){return this._shaderState={shader:e.shader,uniforms:e.uniforms,textures:e.textures,defines:e.defines,optionalAttributes:e.optionalAttributes,useComputeBuffer:e.useComputeBuffer??!1},this._shaderState}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}getPipelineState(){return this._currentPipelineState}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i}=r;if(null==t)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(1032,s,t,i)}}}setPipelineStateNeedsUpdate(e){this._currentPipelineStateNeedsUpdate=e}getShaderState(){return this._shaderState}getProgramCache(){return this._programCache}submitDraw(e,t,s){let r=s?.stencilRef;if(!this._shaderState)return null;const{shader:i,uniforms:n,textures:a,defines:l,optionalAttributes:o}=this._shaderState,c=e.context,d=t.getAttributePrecisionPackFactors(),p=this._programCache.getProgram(i,d,n,a??{},l??{},o??{});if(p.setUniforms(n),p.setTextures(a),p.bind(c),this.updatePipelineState(c),null==r){const e=t.getStencilReference();null!=e&&(r=e)}return null!=r&&this.setStencilRef(c,r),t.draw(e,i.locationInfo),p.cleanupTemporaryTextures(),{vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){const i=r?.parts,n=r?.stencilRef,{precisionFactors:a,materialKey:l}=t,{shader:o,uniforms:c,textures:d,defines:p,optionalAttributes:h}=this.setShader(t),u=this._programCache.getProgram(o,a||{},c,d??{},p??{},h??{},l);if(u.setUniforms(c),u.setTextures(d),u.bind(e),this.updatePipelineState(e),this.setStencilRef(e,n),i)for(const S of i)s.bind(e,t.shader.locationInfo,S),s.draw(e);else for(let S=0;S<s.parts.length;S++)s.bind(e,t.shader.locationInfo,S),s.draw(e);s.unbind(e),u.cleanupTemporaryTextures()}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled("none"!==s),e.setBlendEquation(32774),s){case"composite":e.setBlendFunctionSeparate(1,771,1,771);break;case"additive":e.setBlendFunctionSeparate(1,1,1,1);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(32779),e.setBlendFunctionSeparate(1,771,1,771);break;case"none":e.setBlendingEnabled(!1)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{op:s}=t;e.setStencilTestEnabled(!0),e.setStencilOpSeparate(1032,s.fail,s.zFail,s.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}}export{t as RenderingDevice};
2
+ import"../../../../core/has.js";import"../../../../core/Logger.js";import{TechniqueProgramCache as e}from"./shaderGraph/techniques/TechniqueProgramCache.js";class t{constructor(){this._currentPipelineStateNeedsUpdate=!1,this._programCache=new e}dispose(){this._programCache.destroy()}clearShaderCache(){this._programCache.destroy(),this._programCache=new e}setShader(e){return this._shaderState={shader:e.shader,uniforms:e.uniforms,textures:e.textures,defines:e.defines,optionalAttributes:e.optionalAttributes,useComputeBuffer:e.useComputeBuffer??!1},this._shaderState}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}getPipelineState(){return this._currentPipelineState}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i}=r;if(null==t)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(1032,s,t,i)}}}setPipelineStateNeedsUpdate(e){this._currentPipelineStateNeedsUpdate=e}getShaderState(){return this._shaderState}getProgramCache(){return this._programCache}submitDraw(e,t,s){let r=s?.stencilRef;if(!this._shaderState)return null;const{shader:i,uniforms:n,textures:a,defines:l,optionalAttributes:o}=this._shaderState,c=e.context,d=t.getAttributePrecisionPackFactors(),p=this._programCache.getProgram(i,d,n,a??{},l??{},o??{});if(p.setUniforms(n),p.setTextures(a),p.bind(c),this.updatePipelineState(c),null==r){const e=t.getStencilReference();null!=e&&(r=e)}return null!=r&&this.setStencilRef(c,r),t.draw(e,i.locationInfo),p.cleanupTemporaryTextures(),{vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){const i=r?.parts,n=r?.stencilRef,{precisionFactors:a,materialKey:l}=t,{shader:o,uniforms:c,textures:d,defines:p,optionalAttributes:h}=this.setShader(t),u=this._programCache.getProgram(o,a||{},c,d??{},p??{},h??{},l);if(u.setUniforms(c),u.setTextures(d),u.bind(e),this.updatePipelineState(e),this.setStencilRef(e,n),i)for(const S of i)s.bind(e,t.shader.locationInfo,S),s.draw(e);else for(let S=0;S<s.parts.length;S++)s.bind(e,t.shader.locationInfo,S),s.draw(e);s.unbind(e),u.cleanupTemporaryTextures()}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled("none"!==s),e.setBlendEquation(32774),s){case"composite":e.setBlendFunctionSeparate(1,771,1,771);break;case"additive":e.setBlendFunctionSeparate(1,1,1,1);break;case"custom":{const{blendParameters:s,blendEquation:r}=t,{dstAlpha:i,dstRGB:n,srcAlpha:a,srcRGB:l}=s;r&&e.setBlendEquation(r),e.setBlendFunctionSeparate(l,n,a,i);break}case"delete":e.setBlendEquation(32779),e.setBlendFunctionSeparate(1,771,1,771);break;case"none":e.setBlendingEnabled(!1)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{op:s}=t;e.setStencilTestEnabled(!0),e.setStencilOpSeparate(1032,s.fail,s.zFail,s.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}}export{t as RenderingDevice};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"../../../../../core/has.js";import{hittestSmallSymbolThreshold as t,hittestToleranceMobile as e,hittestToleranceDesktop as s,hittestToleranceSmallSymbol as i}from"../definitions.js";import{Effect as o}from"./Effect.js";import{PixelType as n}from"../../../../webgl/enums.js";class r extends o{constructor(){super(...arguments),this.name=this.constructor.name,this.defines=["hittest"]}dispose(){null!=this._fbo&&this._fbo.dispose()}createOptions({pixelRatio:o},n){if(!n.length)return null;const r=n.shift();this._outstanding=r;const l=has("esri-mobile"),h=(l?e:s)*o,a=(l?e:i)*o,c=t,{query:u}=r,f=u.hittestType;let d=[-1,-1,-1,-1],m=[],p=[-1,-1];if("rect"===f){const t=u.input;m=[[t.x,t.y],[t.x,t.y+t.height],[t.x+t.width,t.y+t.height],[t.x+t.width,t.y]];let e=1/0,s=1/0,i=-1/0,o=-1/0;for(const[n,r]of m)e=Math.min(e,n),s=Math.min(s,r),i=Math.max(i,n),o=Math.max(o,r);d=[e,s,i,o]}else if("point"===f){const t=u.input;p=[t.x,t.y]}return{type:"hittest",distance:h,smallSymbolDistance:a,smallSymbolSizeThreshold:c,position:p,tlbr:d,hittestType:f}}bind(t){const{context:e,attributeView:s}=t;if(!s.size)return;const i=s.getBlock(2);if(null==i)return;const o=i.getFBO(e);e.setViewport(0,0,s.size,s.size),e.bindFramebuffer(o),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(16640)}unbind(){}draw(t){if(null==this._outstanding)return;const e=this._outstanding;this._outstanding=null,this._resolve(t,e.resolvers)}async _resolve(t,e){const{context:s,attributeView:i}=t,o=i.getBlock(2);if(null==o)return void e.forEach(t=>t.resolve([]));const r=o.getFBO(s),l=new Uint8Array(r.width*r.height*4);try{await r.readPixelsAsync(0,0,r.width,r.height,6408,n.UNSIGNED_BYTE,l)}catch(a){return void e.forEach(t=>t.resolve([]))}const h=[];for(let n=0;n<l.length;n+=4){const t=n/4;l[n]&&h.push(t)}e.forEach(t=>t.resolve(h))}}export{r as HittestEffect};
2
+ import has from"../../../../../core/has.js";import{hittestSmallSymbolThreshold as t,hittestToleranceMobile as e,hittestToleranceDesktop as i,hittestToleranceSmallSymbol as s}from"../definitions.js";import{Effect as o}from"./Effect.js";import{PixelType as n}from"../../../../webgl/enums.js";class r extends o{constructor(){super(...arguments),this.name=this.constructor.name,this.defines=["hittest"]}dispose(){null!=this._fbo&&this._fbo.dispose()}createOptions({pixelRatio:o},n){if(!n.length)return null;const r=n.shift();this._outstanding=r;const l=has("esri-mobile"),a=(l?e:i)*o,h=(l?e:s)*o,c=t,{query:d}=r,u=d.hittestType;let f=[-1,-1,-1,-1],m=[],p=[-1,-1];if("rect"===u){const t=d.input;m=[[t.x,t.y],[t.x,t.y+t.height],[t.x+t.width,t.y+t.height],[t.x+t.width,t.y]];let e=1/0,i=1/0,s=-1/0,o=-1/0;for(const[n,r]of m)e=Math.min(e,n),i=Math.min(i,r),s=Math.max(s,n),o=Math.max(o,r);f=[e,i,s,o]}else if("point"===u){const t=d.input;p=[t.x,t.y]}return{type:"hittest",distance:a,smallSymbolDistance:h,smallSymbolSizeThreshold:c,position:p,tlbr:f,hittestType:u}}bind(t){const{context:e,attributeView:i}=t;if(!i.size)return;const s=i.getBlock(2);if(null==s)return;const o=s.getFBO(e);e.setViewport(0,0,i.size,i.size),e.bindFramebuffer(o),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(16640)}unbind(){}draw(t){if(null==this._outstanding)return;const e=this._outstanding;this._outstanding=null,this._resolve(t,e.resolvers)}async _resolve(t,e){const{context:i,attributeView:s}=t,o=s.getBlock(2);if(null==o)return void e.forEach(t=>t.resolve({trueHitIds:[],candidateHitIds:[]}));const r=o.getFBO(i),l=new Uint8Array(r.width*r.height);try{await r.readPixelsAsync(0,0,r.width,r.height,6403,n.UNSIGNED_BYTE,l)}catch(c){return void e.forEach(t=>t.resolve({trueHitIds:[],candidateHitIds:[]}))}const a=[],h=[];for(let n=0;n<l.length;n++){const t=l[n];t>=2?a.push(n):t>=1&&h.push(n)}e.forEach(t=>t.resolve({trueHitIds:a,candidateHitIds:h}))}}export{r as HittestEffect};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getMetersPerUnitForSR as t}from"../../../../../../core/units.js";import{maxRepresentableInt as e,tileSize as i}from"../../definitions.js";const o={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7681}}}},n={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},r={...o,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function s({pixelRatio:e,state:i,displayLevel:o,requiredLevel:n},r){const s=1/2**(o-r.key.level),l=1/2**(n-r.key.level);return{displayMat3:i.displayMat3,displayViewMat3:i.displayViewMat3,displayViewScreenMat3:r.transforms.displayViewScreenMat3,viewMat3:i.viewMat3,tileMat3:r.transforms.tileMat3,displayZoomFactor:s,requiredZoomFactor:l,tileOffset:[r.x,r.y],currentScale:i.scale,currentZoom:o,metersPerSRUnit:t(i.spatialReference),rotation:i.rotation,pixelRatio:e}}function l(t){return"highlight"===t.passOptions?.type}function a(t){return"hittest"===t.passOptions?.type}function c(t){if(!a(t))return null;const{position:e,distance:i,smallSymbolDistance:o,smallSymbolSizeThreshold:n,tlbr:r}=t.passOptions;return{position:e,distance:i,smallSymbolDistance:o,smallSymbolSizeThreshold:n,tlbr:r}}function u(t){if(!l(t))return null;const{activeReasons:e,highlightAll:i}=t.passOptions;return{activeReasons:e,highlightAll:i?1:0}}function p(t,e,i){const o={};for(const n in i)"function"!=typeof i[n]?o[n]=i[n]:o[n]=i[n](t,e);return o}function f(t,e){return{storage:t.attributeView.getUniforms(),view:s(t,e),hittestRequest:c(t),highlight:u(t)}}function d(t){return t.attributeView.getTextures(t.context)}function m(t){return{storageTextures:d(t)}}function h(t){return{inside:2===t.selection,outside:3===t.selection}}function y(t){return a(t)?n:l(t)&&"clear"===t.passOptions.stepType?r:o}function M(t){const{row:o,col:n}=t.key,r=n*i,s=o*i;return{tileOffsetFromLocalOrigin:[r%e,s%e],maxIntsToLocalOrigin:[Math.floor(r/e),Math.floor(s/e)]}}export{y as getFeaturePipelineState,d as getFeatureStorageTextures,m as getFeatureTextures,f as getFeatureUniforms,M as getLocalTileOffset,h as getSelectionDefines,s as getViewUniforms,l as isHighlight,a as isHittest,p as resolveDynamicUniforms};
2
+ import{getMetersPerUnitForSR as t}from"../../../../../../core/units.js";import{maxRepresentableInt as e,tileSize as i}from"../../definitions.js";const o={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7681}}}},n={color:{write:[!0,!0,!0,!0],blendParameters:{srcRGB:1,dstRGB:1,srcAlpha:1,dstAlpha:1},blendEquation:32776,blendMode:"custom"},depth:!1,stencil:!1},s={...o,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function r({pixelRatio:e,state:i,displayLevel:o,requiredLevel:n},s){const r=1/2**(o-s.key.level),l=1/2**(n-s.key.level);return{displayMat3:i.displayMat3,displayViewMat3:i.displayViewMat3,displayViewScreenMat3:s.transforms.displayViewScreenMat3,viewMat3:i.viewMat3,tileMat3:s.transforms.tileMat3,displayZoomFactor:r,requiredZoomFactor:l,tileOffset:[s.x,s.y],currentScale:i.scale,currentZoom:o,metersPerSRUnit:t(i.spatialReference),rotation:i.rotation,pixelRatio:e}}function l(t){return"highlight"===t.passOptions?.type}function a(t){return"hittest"===t.passOptions?.type}function c(t){if(!a(t))return null;const{position:e,distance:i,smallSymbolDistance:o,smallSymbolSizeThreshold:n,tlbr:s}=t.passOptions;return{position:e,distance:i,smallSymbolDistance:o,smallSymbolSizeThreshold:n,tlbr:s}}function u(t){if(!l(t))return null;const{activeReasons:e,highlightAll:i}=t.passOptions;return{activeReasons:e,highlightAll:i?1:0}}function p(t,e,i){const o={};for(const n in i)"function"!=typeof i[n]?o[n]=i[n]:o[n]=i[n](t,e);return o}function f(t,e){return{storage:t.attributeView.getUniforms(),view:r(t,e),hittestRequest:c(t),highlight:u(t)}}function d(t){return t.attributeView.getTextures(t.context)}function m(t){return{storageTextures:d(t)}}function h(t){return{inside:2===t.selection,outside:3===t.selection}}function y(t){return a(t)?n:l(t)&&"clear"===t.passOptions.stepType?s:o}function M(t){const{row:o,col:n}=t.key,s=n*i,r=o*i;return{tileOffsetFromLocalOrigin:[s%e,r%e],maxIntsToLocalOrigin:[Math.floor(s/e),Math.floor(r/e)]}}export{y as getFeaturePipelineState,d as getFeatureStorageTextures,m as getFeatureTextures,f as getFeatureUniforms,M as getLocalTileOffset,h as getSelectionDefines,r as getViewUniforms,l as isHighlight,a as isHittest,p as resolveDynamicUniforms};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as e}from"tslib";import{location as i,option as o,uniform as s,texture as r,input as l,ComputeVertexInput as a}from"../../GraphShaderModule.js";import{Vec3 as p,min as n,max as u,Float as d,Mat3 as m,Vec4 as y,ifElse as h,lessThan as c,greaterThan as x,equal as v,texture2D as V,clamp as f,abs as w,mix as S,distance as b,Vec2 as g,negate as C,step as M,Sampler2D as z}from"../../graph/glsl.js";import{MarkerConstants as _}from"./markerConstants.js";import{AFeatureShader as R,FeatureVertexInput as j,FeatureFragmentInput as U}from"../shaders/AFeatureShader.js";import{c256ToRad as N,softEdgeRatio as T}from"../shaders/constants.js";import{isRectHittest as D,hittestScreenRect as q,distPointTriangle as F,xyToBarycentric as O,inTriangle as k,failHittest as A}from"../shaders/hittestUtils.js";import{MosaicInfo as P}from"../shaders/MosaicInfo.js";import{getBit as I,getBitBool as H,rgba2float as G}from"../shaders/utils.js";import{VisualVariableColor as L}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as B}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as E}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as J}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as K}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as Q}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as W}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as X,getVisualVariableColor as Y,getVisualVariableSize as Z,getVisualVariableRotation as $}from"../shaders/vvUtils.js";class tt extends j{}t([i(3,y)],tt.prototype,"color",void 0),t([i(4,y)],tt.prototype,"outlineColor",void 0),t([i(5,g)],tt.prototype,"offset",void 0),t([i(6,g)],tt.prototype,"textureUV",void 0),t([i(7,y)],tt.prototype,"sizing",void 0),t([i(8,d)],tt.prototype,"placementAngle",void 0),t([i(9,d)],tt.prototype,"sdfDecodeCoeff",void 0),t([i(10,g)],tt.prototype,"zoomRange",void 0);class et extends a{}t([i(11,g)],et.prototype,"offsetNextVertex1",void 0),t([i(12,g)],et.prototype,"offsetNextVertex2",void 0),t([i(13,g)],et.prototype,"textureUVNextVertex1",void 0),t([i(14,g)],et.prototype,"textureUVNextVertex2",void 0);class it extends U{}function ot(t,e,i,o){return e.multiply(t.x).add(i.multiply(t.y)).add(o.multiply(t.z))}function st(t){return t.multiply(t).divide(128)}class rt extends R{constructor(){super(...arguments),this.type="MarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=st(t.sizing.x),o=st(t.sizing.y),s=st(t.sizing.z),r=t.placementAngle,l=I(t.bitset,_.bitset.isSDF),a=I(t.bitset,_.bitset.isMapAligned),h=I(t.bitset,_.bitset.scaleSymbolsProportionally),c=H(t.bitset,_.bitset.colorLocked),x=X(this,t.id),v=Y(this,t.id,t.color,c).multiply(x),V=this.view.displayViewScreenMat3.multiply(new p(t.pos.xy,1)),f=Z(this,t.id,s).divide(s),w=i.multiply(f),S=t.offset.xy.multiply(f);let b=o.multiply(h.multiply(f.subtract(1)).add(1));b=n(b,u(w.subtract(.99),new d(0)));const g=u(b,new d(1)),C=n(b,new d(1)),M=m.fromRotation(r.multiply(N)),z=$(this,t.id),R=this._getViewRotationMatrix(a).multiply(z).multiply(M).multiply(new p(S.xy,0)),j=this.clip(t.id,t.zoomRange),U=new y(V.xy.add(R.xy),j,1),T=t.textureUV.divide(this.mosaicInfo.size),D=t.outlineColor.multiply(C),q=I(t.bitset,_.bitset.overrideOutlineColor),F=t.sdfDecodeCoeff.multiply(w);return{glPosition:U,color:v,textureUV:T,outlineColor:D,outlineSize:g,distanceToPx:F,isSDF:l,overrideOutlineColor:q,...this.maybeRunHittest(t,e,{pos:t.pos,size:w,sizeCorrection:f,isMapAligned:a,vvRotationMat3:z,placementMat3:M,outlineSize:g,distanceToPx:F,isSDF:l})}}fragment(t){const e=this._getColor(t.textureUV,t);return this.getFragmentOutput(e,t)}hittest(t,e,i){const{pos0:o,pos1:s,pos2:r}=this.computeHittestTriangle(t,e,i),l=D(this.hittestRequest);return h(l,()=>{const{tlbr:t}=this.hittestRequest;return q(o,s,r,t)},()=>{const o=h(c(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i));return h(x(o,this.hittestRequest.distance),new d(0),new d(1))})}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new d(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getViewScreenMatrix(t){const e=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,o=new d(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getColor(t,e){return h(v(e.isSDF,new d(1)),this._getSDFColor(t,e),this._getSpriteColor(t,e))}_getSpriteColor(t,e){return V(this.mosaicTexture,t).multiply(e.color)}_getSDFColor(t,e){const i=V(this.mosaicTexture,t),o=new d(.5).subtract(G(i)).multiply(e.distanceToPx).multiply(T),s=f(new d(.5).subtract(o),new d(0),new d(1)),r=e.color.multiply(s);let l=e.outlineSize;this.highlight&&(l=u(l,e.overrideOutlineColor.multiply(4)));const a=l.multiply(.5),p=w(o).subtract(a),n=f(new d(.5).subtract(p),new d(0),new d(1)),m=S(e.outlineColor,e.color,e.overrideOutlineColor).multiply(n);return new d(1).subtract(m.a).multiply(r).add(m)}_hittestSmallMarker(t,e,i){const{position:o,distance:s,smallSymbolDistance:r}=this.hittestRequest,l=s.subtract(r),{viewMat3:a,tileMat3:n}=this.view,u=a.multiply(n).multiply(new p(i.pos,1)).xy,d=i.size.multiply(.5);return b(u,o).subtract(d).add(l)}_hittestMarker(t,e,i){const{pos0:o,pos1:s,pos2:r}=this.computeHittestTriangle(t,e,i),l=this.hittestRequest.position,a=this.hittestRequest.distance,p=F(l,o,s,r);return h(x(p,a),p,this._hittestSamples(o,s,r,t,e,i))}computeHittestTriangle(t,e,i){const{pos:o,sizeCorrection:s,isMapAligned:r}=i,l=new p(t.offset.multiply(s),0),a=new p(e.offsetNextVertex1.multiply(s),0),n=new p(e.offsetNextVertex2.multiply(s),0),{viewMat3:u,tileMat3:d}=this.view,m=u.multiply(d).multiply(new p(o,1)),y=this._getViewScreenMatrix(r).multiply(i.vvRotationMat3).multiply(i.placementMat3);return{pos0:m.add(y.multiply(l)).xy,pos1:m.add(y.multiply(a)).xy,pos2:m.add(y.multiply(n)).xy}}_hittestSamples(t,e,i,o,s,r){const{outlineSize:l,isSDF:a,distanceToPx:p}=r,n=this.hittestRequest.position,u=this.hittestRequest.distance,m=O(n.add(new g(C(u),C(u))),t,e,i),h=O(n.add(new g(0,C(u))),t,e,i),c=O(n.add(new g(u,C(u))),t,e,i),x=O(n.add(new g(C(u),0)),t,e,i),v=O(n,t,e,i),V=O(n.add(new g(u,0)),t,e,i),f=O(n.add(new g(C(u),u)),t,e,i),w=O(n.add(new g(0,u)),t,e,i),S=O(n.add(new g(u,u)),t,e,i),b=o.textureUV.divide(this.mosaicInfo.size),z=s.textureUVNextVertex1.divide(this.mosaicInfo.size),_=s.textureUVNextVertex2.divide(this.mosaicInfo.size),R={color:new y(1),outlineColor:new y(1),overrideOutlineColor:new d(1),outlineSize:l,distanceToPx:p,isSDF:a};let j=new d(0);return j=j.add(k(m).multiply(this._getColor(ot(m,b,z,_),R).a)),j=j.add(k(h).multiply(this._getColor(ot(h,b,z,_),R).a)),j=j.add(k(c).multiply(this._getColor(ot(c,b,z,_),R).a)),j=j.add(k(x).multiply(this._getColor(ot(x,b,z,_),R).a)),j=j.add(k(v).multiply(this._getColor(ot(v,b,z,_),R).a)),j=j.add(k(V).multiply(this._getColor(ot(V,b,z,_),R).a)),j=j.add(k(f).multiply(this._getColor(ot(f,b,z,_),R).a)),j=j.add(k(w).multiply(this._getColor(ot(w,b,z,_),R).a)),j=j.add(k(S).multiply(this._getColor(ot(S,b,z,_),R).a)),M(j,new d(.05)).multiply(A(this.hittestRequest))}}t([o(L)],rt.prototype,"visualVariableColor",void 0),t([o(B)],rt.prototype,"visualVariableOpacity",void 0),t([o(E)],rt.prototype,"visualVariableRotation",void 0),t([o(J)],rt.prototype,"visualVariableSizeMinMaxValue",void 0),t([o(K)],rt.prototype,"visualVariableSizeScaleStops",void 0),t([o(Q)],rt.prototype,"visualVariableSizeStops",void 0),t([o(W)],rt.prototype,"visualVariableSizeUnitValue",void 0),t([s(P)],rt.prototype,"mosaicInfo",void 0),t([r(z)],rt.prototype,"mosaicTexture",void 0),t([e(0,l(tt)),e(1,l(et))],rt.prototype,"vertex",null),t([e(0,l(it))],rt.prototype,"fragment",null);export{it as MarkerFragmentInput,rt as MarkerShader,tt as MarkerVertexInput};
2
+ import{__decorate as t,__param as e}from"tslib";import{location as i,option as o,uniform as s,texture as r,input as l,ComputeVertexInput as a}from"../../GraphShaderModule.js";import{Vec3 as p,min as n,max as u,Float as d,Mat3 as m,Vec4 as y,ifElse as h,lessThan as c,greaterThan as x,equal as v,texture2D as V,clamp as f,abs as w,mix as S,distance as b,Vec2 as g,negate as C,step as M,Sampler2D as z}from"../../graph/glsl.js";import{MarkerConstants as _}from"./markerConstants.js";import{AFeatureShader as R,FeatureVertexInput as j,FeatureFragmentInput as U}from"../shaders/AFeatureShader.js";import{c256ToRad as N,noHit as T,trueHit as D,softEdgeRatio as q}from"../shaders/constants.js";import{isRectHittest as F,hittestScreenRect as O,distPointTriangle as k,xyToBarycentric as A,inTriangle as P,failHittest as I}from"../shaders/hittestUtils.js";import{MosaicInfo as H}from"../shaders/MosaicInfo.js";import{getBit as G,getBitBool as L,rgba2float as B}from"../shaders/utils.js";import{VisualVariableColor as E}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as J}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as K}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as Q}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as W}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as X}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as Y}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as Z,getVisualVariableColor as $,getVisualVariableSize as tt,getVisualVariableRotation as et}from"../shaders/vvUtils.js";class it extends j{}t([i(3,y)],it.prototype,"color",void 0),t([i(4,y)],it.prototype,"outlineColor",void 0),t([i(5,g)],it.prototype,"offset",void 0),t([i(6,g)],it.prototype,"textureUV",void 0),t([i(7,y)],it.prototype,"sizing",void 0),t([i(8,d)],it.prototype,"placementAngle",void 0),t([i(9,d)],it.prototype,"sdfDecodeCoeff",void 0),t([i(10,g)],it.prototype,"zoomRange",void 0);class ot extends a{}t([i(11,g)],ot.prototype,"offsetNextVertex1",void 0),t([i(12,g)],ot.prototype,"offsetNextVertex2",void 0),t([i(13,g)],ot.prototype,"textureUVNextVertex1",void 0),t([i(14,g)],ot.prototype,"textureUVNextVertex2",void 0);class st extends U{}function rt(t,e,i,o){return e.multiply(t.x).add(i.multiply(t.y)).add(o.multiply(t.z))}function lt(t){return t.multiply(t).divide(128)}class at extends R{constructor(){super(...arguments),this.type="MarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=lt(t.sizing.x),o=lt(t.sizing.y),s=lt(t.sizing.z),r=t.placementAngle,l=G(t.bitset,_.bitset.isSDF),a=G(t.bitset,_.bitset.isMapAligned),h=G(t.bitset,_.bitset.scaleSymbolsProportionally),c=L(t.bitset,_.bitset.colorLocked),x=Z(this,t.id),v=$(this,t.id,t.color,c).multiply(x),V=this.view.displayViewScreenMat3.multiply(new p(t.pos.xy,1)),f=tt(this,t.id,s).divide(s),w=i.multiply(f),S=t.offset.xy.multiply(f);let b=o.multiply(h.multiply(f.subtract(1)).add(1));b=n(b,u(w.subtract(.99),new d(0)));const g=u(b,new d(1)),C=n(b,new d(1)),M=m.fromRotation(r.multiply(N)),z=et(this,t.id),R=this._getViewRotationMatrix(a).multiply(z).multiply(M).multiply(new p(S.xy,0)),j=this.clip(t.id,t.zoomRange),U=new y(V.xy.add(R.xy),j,1),T=t.textureUV.divide(this.mosaicInfo.size),D=t.outlineColor.multiply(C),q=G(t.bitset,_.bitset.overrideOutlineColor),F=t.sdfDecodeCoeff.multiply(w);return{glPosition:U,color:v,textureUV:T,outlineColor:D,outlineSize:g,distanceToPx:F,isSDF:l,overrideOutlineColor:q,...this.maybeRunHittest(t,e,{pos:t.pos,size:w,sizeCorrection:f,isMapAligned:a,vvRotationMat3:z,placementMat3:M,outlineSize:g,distanceToPx:F,isSDF:l})}}fragment(t){const e=this._getColor(t.textureUV,t);return this.getFragmentOutput(e,t)}hittest(t,e,i){const{pos0:o,pos1:s,pos2:r}=this.computeHittestTriangle(t,e,i),l=F(this.hittestRequest);return h(l,()=>{const{tlbr:t}=this.hittestRequest;return O(o,s,r,t)},()=>{const o=h(c(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i));return h(x(o,this.hittestRequest.distance),new d(T),new d(D))})}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new d(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getViewScreenMatrix(t){const e=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,o=new d(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getColor(t,e){return h(v(e.isSDF,new d(1)),this._getSDFColor(t,e),this._getSpriteColor(t,e))}_getSpriteColor(t,e){return V(this.mosaicTexture,t).multiply(e.color)}_getSDFColor(t,e){const i=V(this.mosaicTexture,t),o=new d(.5).subtract(B(i)).multiply(e.distanceToPx).multiply(q),s=f(new d(.5).subtract(o),new d(0),new d(1)),r=e.color.multiply(s);let l=e.outlineSize;this.highlight&&(l=u(l,e.overrideOutlineColor.multiply(4)));const a=l.multiply(.5),p=w(o).subtract(a),n=f(new d(.5).subtract(p),new d(0),new d(1)),m=S(e.outlineColor,e.color,e.overrideOutlineColor).multiply(n);return new d(1).subtract(m.a).multiply(r).add(m)}_hittestSmallMarker(t,e,i){const{position:o,distance:s,smallSymbolDistance:r}=this.hittestRequest,l=s.subtract(r),{viewMat3:a,tileMat3:n}=this.view,u=a.multiply(n).multiply(new p(i.pos,1)).xy,d=i.size.multiply(.5);return b(u,o).subtract(d).add(l)}_hittestMarker(t,e,i){const{pos0:o,pos1:s,pos2:r}=this.computeHittestTriangle(t,e,i),l=this.hittestRequest.position,a=this.hittestRequest.distance,p=k(l,o,s,r);return h(x(p,a),p,this._hittestSamples(o,s,r,t,e,i))}computeHittestTriangle(t,e,i){const{pos:o,sizeCorrection:s,isMapAligned:r}=i,l=new p(t.offset.multiply(s),0),a=new p(e.offsetNextVertex1.multiply(s),0),n=new p(e.offsetNextVertex2.multiply(s),0),{viewMat3:u,tileMat3:d}=this.view,m=u.multiply(d).multiply(new p(o,1)),y=this._getViewScreenMatrix(r).multiply(i.vvRotationMat3).multiply(i.placementMat3);return{pos0:m.add(y.multiply(l)).xy,pos1:m.add(y.multiply(a)).xy,pos2:m.add(y.multiply(n)).xy}}_hittestSamples(t,e,i,o,s,r){const{outlineSize:l,isSDF:a,distanceToPx:p}=r,n=this.hittestRequest.position,u=this.hittestRequest.distance,m=A(n.add(new g(C(u),C(u))),t,e,i),h=A(n.add(new g(0,C(u))),t,e,i),c=A(n.add(new g(u,C(u))),t,e,i),x=A(n.add(new g(C(u),0)),t,e,i),v=A(n,t,e,i),V=A(n.add(new g(u,0)),t,e,i),f=A(n.add(new g(C(u),u)),t,e,i),w=A(n.add(new g(0,u)),t,e,i),S=A(n.add(new g(u,u)),t,e,i),b=o.textureUV.divide(this.mosaicInfo.size),z=s.textureUVNextVertex1.divide(this.mosaicInfo.size),_=s.textureUVNextVertex2.divide(this.mosaicInfo.size),R={color:new y(1),outlineColor:new y(1),overrideOutlineColor:new d(1),outlineSize:l,distanceToPx:p,isSDF:a};let j=new d(0);return j=j.add(P(m).multiply(this._getColor(rt(m,b,z,_),R).a)),j=j.add(P(h).multiply(this._getColor(rt(h,b,z,_),R).a)),j=j.add(P(c).multiply(this._getColor(rt(c,b,z,_),R).a)),j=j.add(P(x).multiply(this._getColor(rt(x,b,z,_),R).a)),j=j.add(P(v).multiply(this._getColor(rt(v,b,z,_),R).a)),j=j.add(P(V).multiply(this._getColor(rt(V,b,z,_),R).a)),j=j.add(P(f).multiply(this._getColor(rt(f,b,z,_),R).a)),j=j.add(P(w).multiply(this._getColor(rt(w,b,z,_),R).a)),j=j.add(P(S).multiply(this._getColor(rt(S,b,z,_),R).a)),M(j,new d(.05)).multiply(I(this.hittestRequest))}}t([o(E)],at.prototype,"visualVariableColor",void 0),t([o(J)],at.prototype,"visualVariableOpacity",void 0),t([o(K)],at.prototype,"visualVariableRotation",void 0),t([o(Q)],at.prototype,"visualVariableSizeMinMaxValue",void 0),t([o(W)],at.prototype,"visualVariableSizeScaleStops",void 0),t([o(X)],at.prototype,"visualVariableSizeStops",void 0),t([o(Y)],at.prototype,"visualVariableSizeUnitValue",void 0),t([s(H)],at.prototype,"mosaicInfo",void 0),t([r(z)],at.prototype,"mosaicTexture",void 0),t([e(0,l(it)),e(1,l(ot))],at.prototype,"vertex",null),t([e(0,l(st))],at.prototype,"fragment",null);export{st as MarkerFragmentInput,at as MarkerShader,it as MarkerVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{maxHighlightReasons as e}from"../../../definitions.js";import{GraphShaderModule as i,FragmentOutput as o,location as r,define as s,option as a,uniform as l,texture as h,VertexInput as g,ComputeVertexInput as u,FragmentInput as n}from"../../GraphShaderModule.js";import{Float as p,float as d,step as m,Vec4 as c,Vec3 as y,ifElse as w,equal as b,Vec2 as x}from"../../graph/glsl.js";import{EntityStorage as v,EntityStorageTextures as f}from"./EntityStorage.js";import{ShaderHighlight as C}from"./ShaderHighlight.js";import{ShaderHittest as H}from"./ShaderHittest.js";import{getFilterBit as V,getHighlightBit as D,getBit as A,uvToClip as T}from"./utils.js";import{ViewInfo as _}from"./ViewInfo.js";class j extends g{}t([r(0,y)],j.prototype,"id",void 0),t([r(1,p)],j.prototype,"bitset",void 0),t([r(2,x)],j.prototype,"pos",void 0);class R extends u{}t([r(14,x)],R.prototype,"nextPos1",void 0),t([r(15,x)],R.prototype,"nextPos2",void 0);class F extends n{}class S extends i{clip(t,e){let i=new p(0);const o=this.getFilterFlags(t);if(i=i.add(d(2).multiply(d(1).subtract(V(o,0)))),this.inside?i=i.add(d(2).multiply(d(1).subtract(V(o,1)))):this.outside?i=i.add(d(2).multiply(V(o,1))):this.highlight&&(i=i.add(d(2).multiply(d(1).subtract(this._checkHighlight(o))))),null!=e){const t=new p(1).subtract(m(e.x,this.view.currentZoom)),o=m(e.y,this.view.currentZoom);i=i.add(new p(2).multiply(t.add(o)))}return i}getFragmentOutput(t,e,i=new p(1/255)){const r=new o;return r.fragColor=this._maybeWriteHittest(e)??this._maybeHighlight(t,i)??t,r}_maybeHighlight(t,e){return this.highlight?new c(t.rgb,m(e,t.a)):null}_checkHighlight(t){let i=this._checkHighlightBit(t,0);for(let o=1;o<e;o++)i=i.add(this._checkHighlightBit(t,o));return m(new p(.1),i.add(this.highlight.highlightAll))}_checkHighlightBit(t,e){return D(t,e).multiply(A(this.highlight.activeReasons,e))}computeHittestTriangle(t,e,i){const{viewMat3:o,tileMat3:r}=this.view,s=o.multiply(r),{nextPos1:a,nextPos2:l}=e;return{pos0:s.multiply(new y(t.pos,1)).xy,pos1:s.multiply(new y(a,1)).xy,pos2:s.multiply(new y(l,1)).xy}}maybeRunHittest(t,e,i){if(null==this.hittestRequest)return null;const o=this.hittest(t,e,i);let r=w(b(o,new p(1)),new p(0),new p(2));const s=this.getAttributeDataCoords(t.id),a=T(s);r=r.add(this.clip(t.id,t.zoomRange));const l=new c(new p(1/255),0,0,0);return{glPointSize:new p(1),glPosition:new c(a,r,1),color:l}}_maybeWriteHittest(t){return null!=this.hittestRequest?t.color:null}getAttributeDataCoords(t){return this.storage.getAttributeDataCoords(t)}getVVData(t){return this.storageTextures.getVVData(this.getAttributeDataCoords(t))}getFilterFlags(t){return this.storageTextures.getFilterFlags(this.getAttributeDataCoords(t))}getLocalTimeOrigin(t){return this.storageTextures.getLocalTimeOrigin(this.getAttributeDataCoords(t))}getSizeValue(t){return this.storageTextures.getSizeValue(this.getAttributeDataCoords(t))}getColorValue(t){return this.storageTextures.getColorValue(this.getAttributeDataCoords(t))}getOpacityValue(t){return this.storageTextures.getOpacityValue(this.getAttributeDataCoords(t))}getRotationValue(t){return this.storageTextures.getRotationValue(this.getAttributeDataCoords(t))}}t([s],S.prototype,"inside",void 0),t([s],S.prototype,"outside",void 0),t([a(C)],S.prototype,"highlight",void 0),t([l(v)],S.prototype,"storage",void 0),t([h(f)],S.prototype,"storageTextures",void 0),t([l(_)],S.prototype,"view",void 0),t([a(H)],S.prototype,"hittestRequest",void 0);export{S as AFeatureShader,R as BaseHittestVertexInput,F as FeatureFragmentInput,j as FeatureVertexInput};
2
+ import{__decorate as t}from"tslib";import{maxHighlightReasons as e}from"../../../definitions.js";import{GraphShaderModule as i,FragmentOutput as o,location as r,define as s,option as a,uniform as l,texture as h,VertexInput as g,ComputeVertexInput as n,FragmentInput as u}from"../../GraphShaderModule.js";import{Float as p,float as d,step as m,Vec4 as c,Vec3 as y,equal as w,ifElse as b,or as x,Vec2 as v}from"../../graph/glsl.js";import{trueHit as f,candidateHit as C,noHit as H}from"./constants.js";import{EntityStorage as V,EntityStorageTextures as D}from"./EntityStorage.js";import{ShaderHighlight as A}from"./ShaderHighlight.js";import{ShaderHittest as T}from"./ShaderHittest.js";import{getFilterBit as j,getHighlightBit as _,getBit as R,uvToClip as F}from"./utils.js";import{ViewInfo as S}from"./ViewInfo.js";class P extends g{}t([r(0,y)],P.prototype,"id",void 0),t([r(1,p)],P.prototype,"bitset",void 0),t([r(2,v)],P.prototype,"pos",void 0);class k extends n{}t([r(14,v)],k.prototype,"nextPos1",void 0),t([r(15,v)],k.prototype,"nextPos2",void 0);class O extends u{}class z extends i{clip(t,e){let i=new p(0);const o=this.getFilterFlags(t);if(i=i.add(d(2).multiply(d(1).subtract(j(o,0)))),this.inside?i=i.add(d(2).multiply(d(1).subtract(j(o,1)))):this.outside?i=i.add(d(2).multiply(j(o,1))):this.highlight&&(i=i.add(d(2).multiply(d(1).subtract(this._checkHighlight(o))))),null!=e){const t=new p(1).subtract(m(e.x,this.view.currentZoom)),o=m(e.y,this.view.currentZoom);i=i.add(new p(2).multiply(t.add(o)))}return i}getFragmentOutput(t,e,i=new p(1/255)){const r=new o;return r.fragColor=this._maybeWriteHittest(e)??this._maybeHighlight(t,i)??t,r}_maybeHighlight(t,e){return this.highlight?new c(t.rgb,m(e,t.a)):null}_checkHighlight(t){let i=this._checkHighlightBit(t,0);for(let o=1;o<e;o++)i=i.add(this._checkHighlightBit(t,o));return m(new p(.1),i.add(this.highlight.highlightAll))}_checkHighlightBit(t,e){return _(t,e).multiply(R(this.highlight.activeReasons,e))}computeHittestTriangle(t,e,i){const{viewMat3:o,tileMat3:r}=this.view,s=o.multiply(r),{nextPos1:a,nextPos2:l}=e;return{pos0:s.multiply(new y(t.pos,1)).xy,pos1:s.multiply(new y(a,1)).xy,pos2:s.multiply(new y(l,1)).xy}}maybeRunHittest(t,e,i){if(null==this.hittestRequest)return null;const o=this.hittest(t,e,i),r=w(o,new p(f)),s=w(o,new p(C)),a=b(s,()=>new c(new p(1/255),0,0,0),b(r,()=>new c(new p(2/255),0,0,0),new c(H)));let l=b(x(r,s),new p(0),new p(2));const h=this.getAttributeDataCoords(t.id),g=F(h);return l=l.add(this.clip(t.id,t.zoomRange)),{glPointSize:new p(1),glPosition:new c(g,l,1),color:a}}_maybeWriteHittest(t){return null!=this.hittestRequest?t.color:null}getAttributeDataCoords(t){return this.storage.getAttributeDataCoords(t)}getVVData(t){return this.storageTextures.getVVData(this.getAttributeDataCoords(t))}getFilterFlags(t){return this.storageTextures.getFilterFlags(this.getAttributeDataCoords(t))}getLocalTimeOrigin(t){return this.storageTextures.getLocalTimeOrigin(this.getAttributeDataCoords(t))}getSizeValue(t){return this.storageTextures.getSizeValue(this.getAttributeDataCoords(t))}getColorValue(t){return this.storageTextures.getColorValue(this.getAttributeDataCoords(t))}getOpacityValue(t){return this.storageTextures.getOpacityValue(this.getAttributeDataCoords(t))}getRotationValue(t){return this.storageTextures.getRotationValue(this.getAttributeDataCoords(t))}}t([s],z.prototype,"inside",void 0),t([s],z.prototype,"outside",void 0),t([a(A)],z.prototype,"highlight",void 0),t([l(V)],z.prototype,"storage",void 0),t([h(D)],z.prototype,"storageTextures",void 0),t([l(S)],z.prototype,"view",void 0),t([a(T)],z.prototype,"hittestRequest",void 0);export{z as AFeatureShader,k as BaseHittestVertexInput,O as FeatureFragmentInput,P as FeatureVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as e}from"tslib";import{location as o,option as r,input as s}from"../../GraphShaderModule.js";import{Vec3 as i,Vec4 as l,Float as p,ifElse as n,greaterThan as a,Vec2 as u}from"../../graph/glsl.js";import{AFeatureShader as m,BaseHittestVertexInput as h,FeatureFragmentInput as c,FeatureVertexInput as d}from"./AFeatureShader.js";import{isRectHittest as y,hittestFill as v,hittestScreenRect as f}from"./hittestUtils.js";import{VisualVariableColor as g}from"./VisualVariableColor.js";import{VisualVariableOpacity as x}from"./VisualVariableOpacity.js";import{getVisualVariableOpacity as b,getVisualVariableColor as j}from"./vvUtils.js";class w extends d{}t([o(3,l)],w.prototype,"color",void 0),t([o(4,u)],w.prototype,"zoomRange",void 0);class V extends m{constructor(){super(...arguments),this.type="FillShader",this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,e){const o=b(this,t.id),r=j(this,t.id,t.color).multiply(o),s=this.view.displayViewScreenMat3.multiply(new i(t.pos.xy,1)),p=this.clip(t.id,t.zoomRange);return{glPosition:new l(s.xy,p,1),color:r,...this.maybeRunHittest(t,e,null)}}fragment(t){return this.getFragmentOutput(t.color,t,new p(0))}hittest(t,e){const{pos0:o,pos1:r,pos2:s}=this.computeHittestTriangle(t,e,null),i=y(this.hittestRequest);return n(i,()=>{const{tlbr:t}=this.hittestRequest;return f(o,r,s,t)},()=>{const o=v(this,t,e);return n(a(o,this.hittestRequest.distance),new p(0),new p(1))})}}t([r(g)],V.prototype,"visualVariableColor",void 0),t([r(x)],V.prototype,"visualVariableOpacity",void 0),t([e(0,s(w)),e(1,s(h))],V.prototype,"vertex",null),t([e(0,s(c))],V.prototype,"fragment",null);export{V as FillShader,w as FillVertexInput};
2
+ import{__decorate as t,__param as o}from"tslib";import{location as e,option as s,input as r}from"../../GraphShaderModule.js";import{Vec3 as i,Vec4 as l,Float as p,ifElse as n,greaterThan as a,Vec2 as m}from"../../graph/glsl.js";import{AFeatureShader as u,BaseHittestVertexInput as h,FeatureFragmentInput as c,FeatureVertexInput as d}from"./AFeatureShader.js";import{noHit as y,trueHit as f}from"./constants.js";import{isRectHittest as v,hittestFill as g,hittestScreenRect as x}from"./hittestUtils.js";import{VisualVariableColor as b}from"./VisualVariableColor.js";import{VisualVariableOpacity as j}from"./VisualVariableOpacity.js";import{getVisualVariableOpacity as w,getVisualVariableColor as V}from"./vvUtils.js";class R extends d{}t([e(3,l)],R.prototype,"color",void 0),t([e(4,m)],R.prototype,"zoomRange",void 0);class S extends u{constructor(){super(...arguments),this.type="FillShader",this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,o){const e=w(this,t.id),s=V(this,t.id,t.color).multiply(e),r=this.view.displayViewScreenMat3.multiply(new i(t.pos.xy,1)),p=this.clip(t.id,t.zoomRange);return{glPosition:new l(r.xy,p,1),color:s,...this.maybeRunHittest(t,o,null)}}fragment(t){return this.getFragmentOutput(t.color,t,new p(0))}hittest(t,o){const{pos0:e,pos1:s,pos2:r}=this.computeHittestTriangle(t,o,null),i=v(this.hittestRequest);return n(i,()=>{const{tlbr:t}=this.hittestRequest;return x(e,s,r,t)},()=>{const e=g(this,t,o);return n(a(e,this.hittestRequest.distance),new p(y),new p(f))})}}t([s(b)],S.prototype,"visualVariableColor",void 0),t([s(j)],S.prototype,"visualVariableOpacity",void 0),t([o(0,r(R)),o(1,r(h))],S.prototype,"vertex",null),t([o(0,r(c))],S.prototype,"fragment",null);export{S as FillShader,R as FillVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as i}from"tslib";import{location as e,uniform as o,option as l,input as r,UniformGroup as a}from"../../GraphShaderModule.js";import{step as s,min as n,ifElse as p,greaterThan as u,Float as m,length as d,clamp as y,max as c,Vec3 as f,Vec4 as h,Vec2 as v}from"../../graph/glsl.js";import{AFeatureShader as w,BaseHittestVertexInput as b,FeatureVertexInput as V,FeatureFragmentInput as S}from"./AFeatureShader.js";import{thinLineWidthFactor as g,thinLineHalfWidth as x,epsilon as j}from"./constants.js";import{isRectHittest as z,distPointSegment as W,hittestScreenRect as M}from"./hittestUtils.js";import{VisualVariableColor as R}from"./VisualVariableColor.js";import{VisualVariableOpacity as C}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as H}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as O}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as U}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as q}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableColor as P,getVisualVariableOpacity as A,hasVisualVariableSize as F,getVisualVariableSize as T}from"./vvUtils.js";class D extends V{}t([e(3,h)],D.prototype,"color",void 0),t([e(4,v)],D.prototype,"offset",void 0),t([e(5,v)],D.prototype,"normal",void 0),t([e(6,m)],D.prototype,"halfWidth",void 0),t([e(7,m)],D.prototype,"referenceHalfWidth",void 0),t([e(8,v)],D.prototype,"zoomRange",void 0);class G extends S{}class L extends a{}function k(t){return c(new m(g).multiply(s(t,new m(x))),new m(1))}function B(t,i){const{halfWidth:e,normal:o}=t,l=k(e),r=d(o).multiply(e);return y(l.multiply(e.subtract(r)).divide(i.add(l).subtract(new m(1))),new m(0),new m(1))}function E(t,i){const{id:e,halfWidth:o,referenceHalfWidth:l}=i;if(F(t)){const i=new m(2).multiply(l),r=T(t,e,i);return new m(.5).multiply(o.divide(c(l,new m(j)))).multiply(r)}return o}function I(t,i){const{id:e,offset:o,pos:l,normal:r,zoomRange:a}=i,{displayViewScreenMat3:n,displayViewMat3:p}=t.view,u=P(t,e,i.color),d=A(t,e),y=E(t,i),v=new m(.5).multiply(t.antialiasingControls.antialiasing),w=c(y.add(v),new m(.45)).add(new m(.1).multiply(v)),b=k(w).multiply(w).multiply(o),V=p.multiply(new f(b,new m(0))),S=n.multiply(new f(l,new m(1))).add(V),g=new m(2).multiply(s(y,new m(0))).add(t.clip(e,a)),x=new h(S.xy,g,1);return{color:u,opacity:d,halfWidth:w,normal:r,scaledOffset:b,scaledHalfWidth:y,glPosition:new h(x.xy,g,1)}}function J(t,i){const{opacity:e,color:o}=t,l=B(t,i);return e.multiply(o).multiply(l)}t([o(m)],L.prototype,"antialiasing",void 0),t([o(m)],L.prototype,"blur",void 0);class K extends w{constructor(){super(...arguments),this.type="LineShader",this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,i){const e=I(this,t);return{...e,...this.maybeRunHittest(t,i,e.halfWidth)}}fragment(t){const i=J(t,this.antialiasingControls.blur);return this.getFragmentOutput(i,t)}hittest(t,i,e){const{pos0:o,pos1:l,pos2:r}=this.computeHittestTriangle(t,i,null),a=z(this.hittestRequest),{distance:d,smallSymbolDistance:y,smallSymbolSizeThreshold:c,tlbr:f}=this.hittestRequest,h=s(e,c.multiply(.5)).multiply(d.subtract(y)),v=this.hittestRequest.position,w=n(W(v,o,l),W(v,o,r)).subtract(e).add(h);return p(a,M(o,l,r,f),p(u(w,d),new m(0),new m(1)))}}t([o(L)],K.prototype,"antialiasingControls",void 0),t([l(R)],K.prototype,"visualVariableColor",void 0),t([l(C)],K.prototype,"visualVariableOpacity",void 0),t([l(H)],K.prototype,"visualVariableSizeMinMaxValue",void 0),t([l(O)],K.prototype,"visualVariableSizeScaleStops",void 0),t([l(U)],K.prototype,"visualVariableSizeStops",void 0),t([l(q)],K.prototype,"visualVariableSizeUnitValue",void 0),t([i(0,r(D)),i(1,r(b))],K.prototype,"vertex",null),t([i(0,r(G))],K.prototype,"fragment",null);export{L as AntialiasingControls,G as LineFragmentInput,K as LineShader,D as LineVertexInput,B as getLineAntialiasing,J as getLineFragmentColor,k as getLineThinFactor,I as getLineVertexData};
2
+ import{__decorate as t,__param as i}from"tslib";import{location as e,uniform as o,option as l,input as r,UniformGroup as a}from"../../GraphShaderModule.js";import{step as s,min as n,ifElse as p,greaterThan as u,Float as m,length as d,clamp as y,max as c,Vec3 as f,Vec4 as h,Vec2 as v}from"../../graph/glsl.js";import{AFeatureShader as w,BaseHittestVertexInput as b,FeatureVertexInput as V,FeatureFragmentInput as S}from"./AFeatureShader.js";import{noHit as g,trueHit as x,thinLineWidthFactor as j,thinLineHalfWidth as z,epsilon as W}from"./constants.js";import{isRectHittest as M,distPointSegment as R,hittestScreenRect as C}from"./hittestUtils.js";import{VisualVariableColor as H}from"./VisualVariableColor.js";import{VisualVariableOpacity as O}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as U}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as q}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as P}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as A}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableColor as F,getVisualVariableOpacity as T,hasVisualVariableSize as D,getVisualVariableSize as G}from"./vvUtils.js";class L extends V{}t([e(3,h)],L.prototype,"color",void 0),t([e(4,v)],L.prototype,"offset",void 0),t([e(5,v)],L.prototype,"normal",void 0),t([e(6,m)],L.prototype,"halfWidth",void 0),t([e(7,m)],L.prototype,"referenceHalfWidth",void 0),t([e(8,v)],L.prototype,"zoomRange",void 0);class k extends S{}class B extends a{}function E(t){return c(new m(j).multiply(s(t,new m(z))),new m(1))}function I(t,i){const{halfWidth:e,normal:o}=t,l=E(e),r=d(o).multiply(e);return y(l.multiply(e.subtract(r)).divide(i.add(l).subtract(new m(1))),new m(0),new m(1))}function J(t,i){const{id:e,halfWidth:o,referenceHalfWidth:l}=i;if(D(t)){const i=new m(2).multiply(l),r=G(t,e,i);return new m(.5).multiply(o.divide(c(l,new m(W)))).multiply(r)}return o}function K(t,i){const{id:e,offset:o,pos:l,normal:r,zoomRange:a}=i,{displayViewScreenMat3:n,displayViewMat3:p}=t.view,u=F(t,e,i.color),d=T(t,e),y=J(t,i),v=new m(.5).multiply(t.antialiasingControls.antialiasing),w=c(y.add(v),new m(.45)).add(new m(.1).multiply(v)),b=E(w).multiply(w).multiply(o),V=p.multiply(new f(b,new m(0))),S=n.multiply(new f(l,new m(1))).add(V),g=new m(2).multiply(s(y,new m(0))).add(t.clip(e,a)),x=new h(S.xy,g,1);return{color:u,opacity:d,halfWidth:w,normal:r,scaledOffset:b,scaledHalfWidth:y,glPosition:new h(x.xy,g,1)}}function N(t,i){const{opacity:e,color:o}=t,l=I(t,i);return e.multiply(o).multiply(l)}t([o(m)],B.prototype,"antialiasing",void 0),t([o(m)],B.prototype,"blur",void 0);class Q extends w{constructor(){super(...arguments),this.type="LineShader",this.computeAttributes={pos:["nextPos1","nextPos2"]}}vertex(t,i){const e=K(this,t);return{...e,...this.maybeRunHittest(t,i,e.halfWidth)}}fragment(t){const i=N(t,this.antialiasingControls.blur);return this.getFragmentOutput(i,t)}hittest(t,i,e){const{pos0:o,pos1:l,pos2:r}=this.computeHittestTriangle(t,i,null),a=M(this.hittestRequest),{distance:d,smallSymbolDistance:y,smallSymbolSizeThreshold:c,tlbr:f}=this.hittestRequest,h=s(e,c.multiply(.5)).multiply(d.subtract(y)),v=this.hittestRequest.position,w=n(R(v,o,l),R(v,o,r)).subtract(e).add(h);return p(a,C(o,l,r,f),p(u(w,d),new m(g),new m(x)))}}t([o(B)],Q.prototype,"antialiasingControls",void 0),t([l(H)],Q.prototype,"visualVariableColor",void 0),t([l(O)],Q.prototype,"visualVariableOpacity",void 0),t([l(U)],Q.prototype,"visualVariableSizeMinMaxValue",void 0),t([l(q)],Q.prototype,"visualVariableSizeScaleStops",void 0),t([l(P)],Q.prototype,"visualVariableSizeStops",void 0),t([l(A)],Q.prototype,"visualVariableSizeUnitValue",void 0),t([i(0,r(L)),i(1,r(b))],Q.prototype,"vertex",null),t([i(0,r(k))],Q.prototype,"fragment",null);export{B as AntialiasingControls,k as LineFragmentInput,Q as LineShader,L as LineVertexInput,I as getLineAntialiasing,N as getLineFragmentColor,E as getLineThinFactor,K as getLineVertexData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as o}from"tslib";import{location as i,uniform as e,option as r,input as s}from"../../GraphShaderModule.js";import{greaterThan as a,Float as l,ifElse as p,Vec3 as n,Vec4 as u,Vec2 as m}from"../../graph/glsl.js";import{AFeatureShader as c,BaseHittestVertexInput as d,FeatureVertexInput as h}from"./AFeatureShader.js";import{bitsetTypeFillOutline as f,bitsetOutlineUsesColorVV as y}from"./constants.js";import{isRectHittest as v,failHittest as V,hittestFill as S,hittestScreenRect as b}from"./hittestUtils.js";import{getLineFragmentColor as j,getLineVertexData as x,AntialiasingControls as g,LineFragmentInput as w}from"./LineShader.js";import{getBit as z,getBitBool as M}from"./utils.js";import{VisualVariableColor as O}from"./VisualVariableColor.js";import{VisualVariableOpacity as R}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as q}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as C}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as P}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as U}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as W,getVisualVariableColor as F}from"./vvUtils.js";class H extends h{}t([i(3,m)],H.prototype,"offset",void 0),t([i(4,u)],H.prototype,"color",void 0),t([i(5,m)],H.prototype,"normal",void 0),t([i(6,l)],H.prototype,"halfWidth",void 0),t([i(7,l)],H.prototype,"referenceHalfWidth",void 0),t([i(8,m)],H.prototype,"zoomRange",void 0);class A extends w{}function G(t,o,i){const{id:e,bitset:r}=o,s=z(r,f),m=a(s,new l(.5)),c=x(t,o),d=p(m,c.halfWidth,new l(0)),h=W(t,e),v=F(t,e,o.color),V=p(m,p(M(r,y),v,o.color),v.multiply(h)),S=t.view.displayViewScreenMat3.multiply(new n(o.pos.xy,1)),b=t.clip(o.id),j=new u(S.xy,b,1),g=p(m,c.glPosition,j),w=i&&t.maybeRunHittest(o,i,m);return{isOutline:s,color:V,opacity:new l(1),halfWidth:d,normal:c.normal,glPosition:g,...w}}class L extends c{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}}t([e(g)],L.prototype,"antialiasingControls",void 0),t([r(O)],L.prototype,"visualVariableColor",void 0),t([r(R)],L.prototype,"visualVariableOpacity",void 0),t([r(q)],L.prototype,"visualVariableSizeMinMaxValue",void 0),t([r(C)],L.prototype,"visualVariableSizeScaleStops",void 0),t([r(P)],L.prototype,"visualVariableSizeStops",void 0),t([r(U)],L.prototype,"visualVariableSizeUnitValue",void 0);class T extends L{constructor(){super(...arguments),this.type="OutlineFillShader"}vertex(t,o){return G(this,t,o)}fragment(t){const{color:o,isOutline:i}=t,e=a(i,new l(.5)),r=j(t,this.antialiasingControls.blur),s=p(e,r,o),n=p(e,new l(1/255),new l(0));return this.getFragmentOutput(s,t,n)}hittest(t,o,i){const{pos0:e,pos1:r,pos2:s}=this.computeHittestTriangle(t,o,null),n=v(this.hittestRequest);return p(n,()=>{const{tlbr:t}=this.hittestRequest;return b(e,r,s,t)},()=>{const e=p(i,V(this.hittestRequest),S(this,t,o));return p(a(e,this.hittestRequest.distance),new l(0),new l(1))})}}t([o(0,s(H)),o(1,s(d))],T.prototype,"vertex",null),t([o(0,s(A))],T.prototype,"fragment",null);export{L as AOutlineFillShader,A as OutlineFillFragmentInput,T as OutlineFillShader,H as OutlineFillVertexInput,G as getOutlineFillVertexData};
2
+ import{__decorate as t,__param as o}from"tslib";import{location as i,uniform as e,option as r,input as s}from"../../GraphShaderModule.js";import{greaterThan as a,Float as l,ifElse as p,Vec3 as n,Vec4 as u,Vec2 as m}from"../../graph/glsl.js";import{AFeatureShader as c,BaseHittestVertexInput as d,FeatureVertexInput as h}from"./AFeatureShader.js";import{noHit as f,trueHit as y,bitsetTypeFillOutline as v,bitsetOutlineUsesColorVV as V}from"./constants.js";import{isRectHittest as S,failHittest as b,hittestFill as j,hittestScreenRect as x}from"./hittestUtils.js";import{getLineFragmentColor as g,getLineVertexData as w,AntialiasingControls as z,LineFragmentInput as M}from"./LineShader.js";import{getBit as O,getBitBool as R}from"./utils.js";import{VisualVariableColor as q}from"./VisualVariableColor.js";import{VisualVariableOpacity as C}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as P}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as U}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as W}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as F}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as H,getVisualVariableColor as A}from"./vvUtils.js";class G extends h{}t([i(3,m)],G.prototype,"offset",void 0),t([i(4,u)],G.prototype,"color",void 0),t([i(5,m)],G.prototype,"normal",void 0),t([i(6,l)],G.prototype,"halfWidth",void 0),t([i(7,l)],G.prototype,"referenceHalfWidth",void 0),t([i(8,m)],G.prototype,"zoomRange",void 0);class L extends M{}function T(t,o,i){const{id:e,bitset:r}=o,s=O(r,v),m=a(s,new l(.5)),c=w(t,o),d=p(m,c.halfWidth,new l(0)),h=H(t,e),f=A(t,e,o.color),y=p(m,p(R(r,V),f,o.color),f.multiply(h)),S=t.view.displayViewScreenMat3.multiply(new n(o.pos.xy,1)),b=t.clip(o.id),j=new u(S.xy,b,1),x=p(m,c.glPosition,j),g=i&&t.maybeRunHittest(o,i,m);return{isOutline:s,color:y,opacity:new l(1),halfWidth:d,normal:c.normal,glPosition:x,...g}}class k extends c{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}}t([e(z)],k.prototype,"antialiasingControls",void 0),t([r(q)],k.prototype,"visualVariableColor",void 0),t([r(C)],k.prototype,"visualVariableOpacity",void 0),t([r(P)],k.prototype,"visualVariableSizeMinMaxValue",void 0),t([r(U)],k.prototype,"visualVariableSizeScaleStops",void 0),t([r(W)],k.prototype,"visualVariableSizeStops",void 0),t([r(F)],k.prototype,"visualVariableSizeUnitValue",void 0);class B extends k{constructor(){super(...arguments),this.type="OutlineFillShader"}vertex(t,o){return T(this,t,o)}fragment(t){const{color:o,isOutline:i}=t,e=a(i,new l(.5)),r=g(t,this.antialiasingControls.blur),s=p(e,r,o),n=p(e,new l(1/255),new l(0));return this.getFragmentOutput(s,t,n)}hittest(t,o,i){const{pos0:e,pos1:r,pos2:s}=this.computeHittestTriangle(t,o,null),n=S(this.hittestRequest);return p(n,()=>{const{tlbr:t}=this.hittestRequest;return x(e,r,s,t)},()=>{const e=p(i,b(this.hittestRequest),j(this,t,o));return p(a(e,this.hittestRequest.distance),new l(f),new l(y))})}}t([o(0,s(G)),o(1,s(d))],B.prototype,"vertex",null),t([o(0,s(L))],B.prototype,"fragment",null);export{k as AOutlineFillShader,L as OutlineFillFragmentInput,B as OutlineFillShader,G as OutlineFillVertexInput,T as getOutlineFillVertexData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const e=3.14159265359/180,o=3.14159265359/128,t=180/3.141592654,c=1/8,n=1,p=1,r=1.1,s=1,x=1/4,a=1/8,b=.2,d=8,f=1e-5,g=.05,h=2,i=0,j=1,k=2,l=3,m=1e-30,q=1,u=4,v=0,w=2,y=3,z=0,A=2,B=2,C=3,D=0,E=3,F=16777216,G=1.1,H=16,I=128,J=1;export{j as attrVvColor,k as attrVvOpacity,l as attrVvRotation,i as attrVvSize,A as bitsetFillRandomPatternOffset,u as bitsetGenericConsiderAlphaOnly,q as bitsetGenericLockColor,C as bitsetLineIsSdf,B as bitsetLineScaleDash,v as bitsetMarkerAlignmentMap,w as bitsetMarkerOutlineAllowColorOverride,y as bitsetMarkerScaleSymbolsProportionally,J as bitsetOutlineUsesColorVV,D as bitsetTextIsBackground,E as bitsetTextIsMapAligned,z as bitsetTypeFillOutline,o as c256ToRad,e as cDegToRad,t as cRadToDeg,f as epsilon,g as epsilonHitTest,x as extrudeScalePlacementPadding,n as fillPositionPrecision,G as magnifierBarrelFactor,h as maxFilterCount,F as maxRepresentableInt,m as nanMagicNumber,a as offsetPrecision,b as outlineScale,H as packPrecision,d as placementPadding,c as positionPrecision,I as signedToUnsignedByte,p as softEdgeRatio,s as thinLineHalfWidth,r as thinLineWidthFactor};
2
+ const e=3.14159265359/180,o=3.14159265359/128,t=180/3.141592654,c=1/8,n=1,p=1,r=1.1,s=1,x=1/4,a=1/8,b=.2,d=8,f=1e-5,g=.05,h=2,i=0,j=1,k=2,l=3,m=1e-30,q=1,u=4,v=0,w=2,y=3,z=0,A=2,B=2,C=3,D=0,E=3,F=16777216,G=1.1,H=16,I=128,J=1,K=0,L=1,M=2;export{j as attrVvColor,k as attrVvOpacity,l as attrVvRotation,i as attrVvSize,A as bitsetFillRandomPatternOffset,u as bitsetGenericConsiderAlphaOnly,q as bitsetGenericLockColor,C as bitsetLineIsSdf,B as bitsetLineScaleDash,v as bitsetMarkerAlignmentMap,w as bitsetMarkerOutlineAllowColorOverride,y as bitsetMarkerScaleSymbolsProportionally,J as bitsetOutlineUsesColorVV,D as bitsetTextIsBackground,E as bitsetTextIsMapAligned,z as bitsetTypeFillOutline,o as c256ToRad,e as cDegToRad,t as cRadToDeg,L as candidateHit,f as epsilon,g as epsilonHitTest,x as extrudeScalePlacementPadding,n as fillPositionPrecision,G as magnifierBarrelFactor,h as maxFilterCount,F as maxRepresentableInt,m as nanMagicNumber,K as noHit,a as offsetPrecision,b as outlineScale,H as packPrecision,d as placementPadding,c as positionPrecision,I as signedToUnsignedByte,p as softEdgeRatio,s as thinLineHalfWidth,r as thinLineWidthFactor,M as trueHit};