text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See https://js.arcgis.com/4.9/esri/copyright.txt for details.
  //>>built
  define("require exports ../../../../core/tsSupport/extendsHelper ../../../../core/screenUtils ../../../../geometry/Polygon ../../../../geometry/support/aaBoundingBox ./ElevationAligners ./Graphics3DDrapedGraphicLayer ./Graphics3DObject3DGraphicLayer ./Graphics3DSymbolCommonCode ./Graphics3DSymbolLayer ./graphicUtils ./lineUtils ../../lib/gl-matrix ../../webgl-engine/Stage ../../webgl-engine/lib/Geometry ../../webgl-engine/lib/Object3D ../../webgl-engine/lib/RenderGeometry".split(" "),function(N,O,
  C,z,D,A,E,F,G,n,H,I,x,t,B,J,K,L){return function(m){function g(){return null!==m&&m.apply(this,arguments)||this}C(g,m);g.prototype._prepareResources=function(){var a=this.symbol,b=this._isPropertyDriven("size")||this._isPropertyDriven("color")||this._isPropertyDriven("opacity"),d=this._getStageIdHint();a=null!=a.size?z.pt2px(a.size):1;d={idHint:d,width:a,color:this._getMaterialOpacityAndColor(),slicePlaneEnabled:this._context.slicePlaneEnabled};if(!this._isPropertyDriven("size")&&(a=I.validateSymbolLayerSize(d.width))){this._logWarning(a);
  this.reject();return}if(b||1.5<=d.width)this._isPropertyDriven("size")&&(d.width=0),this._material=x.createRibbonMaterial(d);else if(0<d.width)this._material=x.createNativeMaterial(d);else{this.reject();return}this._context.stage.add(B.ModelContentType.MATERIAL,this._material);this.resolve()};g.prototype.destroy=function(){m.prototype.destroy.call(this);this.isFulfilled()||this.reject();this._material&&(this._context.stage.remove(B.ModelContentType.MATERIAL,this._material.id),this._material=null)};
  g.prototype.createGraphics3DGraphic=function(a){var b=a.renderingInfo;a=a.graphic;var d=a.geometry;if("polyline"!==d.type&&"polygon"!==d.type&&"extent"!==d.type)return this._logWarning("unsupported geometry type for line symbol: "+d.type),null;if(!this._validateGeometry(d))return null;var d="polygon"===d.type||"extent"===d.type?"rings":"paths",c="graphic"+a.uid,e=this._getVertexOpacityAndColor(b,Float32Array,255),h=0;b.size&&this._isPropertyDriven("size")&&(h=n.getSingleSizeDriver(b.size),h=z.pt2px(h));
  b=this.getGraphicElevationContext(a);return"on-the-ground"===b.mode?this._createAsOverlay(a,d,e,h,b,c):this._createAs3DShape(a,d,e,h,b,c,a.uid)};g.prototype.layerPropertyChanged=function(a,b,d){if("opacity"===a)return b=this._material.getColor(),this._material.setColor([b[0],b[1],b[2],this._getMaterialOpacity()]),!0;if("elevationInfo"===a){a=this._elevationContext.mode;this._updateElevationContext();var c=this._elevationContext.mode;if(null==a||null==c)return!1;if("on-the-ground"===a&&"on-the-ground"===
  c)return!0;if(a!==c&&("on-the-ground"===a||"on-the-ground"===c))return!1;a=n.needsElevationUpdates2D(c);for(var e in b){var h=b[e];(c=d(h))&&"object3d"===c.type&&(h=h.graphic,c.needsElevationUpdates=a,c.elevationContext.set(this.getGraphicElevationContext(h)))}return!0}return!1};Object.defineProperty(g.prototype,"numberOfVertices",{get:function(){return 0},enumerable:!0,configurable:!0});g.prototype._getOutlineGeometry=function(a,b){return b};g.prototype._getGeometry=function(a){a=a.geometry;"extent"===
  a.type&&(a=D.fromExtent(a));return a};g.prototype._createAs3DShape=function(a,b,d,c,e,h,M){var f=this._getGeometry(a),g=f[b],r=this._getOutlineGeometry(f,g);a=[];var u=[],k=[],p=t.vec3d.create(),q=Array(6),f=n.getGeometryVertexData3D(r,f.hasZ,f.spatialReference,this._context.renderSpatialReference,this._context.elevationProvider,this._context.renderCoordsHelper,e);this._logGeometryCreationWarnings(f,g,b,"LineSymbol3DLayer");if(0<r.length){for(var g=f.geometryData.outlines,r=f.eleVertexData,m=f.vertexData,
  y=0;y<g.length;++y){var v=g[y];if(!(1>=v.count)){var l=v.index,w=v.count;if(this._context.clippingExtent&&(n.computeBoundingBox(r,l,w,q),n.boundingBoxClipped(q,this._context.clippingExtent)))continue;n.chooseOrigin(m,l,w,p);n.subtractCoordinates(m,l,w,p);v=new Float64Array(r.buffer,3*l*r.BYTES_PER_ELEMENT,3*w);l=new Float64Array(m.buffer,3*l*m.BYTES_PER_ELEMENT,3*w);l=x.createPolylineGeometry(l,v,"rings"===b,d,c);l=new J(l,h+"path"+y);l.singleUse=!0;a.push(l);u.push([this._material]);l=t.mat4d.identity();
  t.mat4d.translate(l,p,l);k.push(l)}}if(0<a.length)return b=new K({geometries:a,materials:u,transformations:k,castShadow:!1,metadata:{layerUid:this._context.layer.uid,graphicUid:M},idHint:h}),b=new G(this,b,a,null,null,E.perVertexElevationAligner,e),b.alignedTerrainElevation=f.terrainElevation,b.needsElevationUpdates=n.needsElevationUpdates2D(e.mode),b}return null};g.prototype._createAsOverlay=function(a,b,d,g,e,h){var c=this._getGeometry(a);this._material.renderPriority=this._symbolLayerOrder;var f=
  c[b],m=this._getOutlineGeometry(c,f);a=[];e=Array(6);var r=A.empty(),u=t.vec3d.create(),c=n.getGeometryVertexDataDraped(m,c.spatialReference,this._context.overlaySR);this._logGeometryCreationWarnings(c,f,b,"LineSymbol3DLayer");if(0<m.length){f=c.vertexData;m=c.geometryData.outlines;for(c=0;c<m.length;++c){var k=m[c],p=k.index,k=k.count;n.computeBoundingBox(f,p,k,e);if(!n.boundingBoxClipped(e,this._context.clippingExtent)){A.expand(r,e);n.chooseOrigin(f,p,k,u);n.subtractCoordinates(f,p,k,u);n.setZ(f,
  p,k,this._getDrapedZ());k=new Float64Array(f.buffer,3*p*f.BYTES_PER_ELEMENT,3*k);p=t.mat4d.identity();t.mat4d.translate(p,u,p);var k=x.createPolylineGeometry(k,null,"rings"===b,d,g),q=new L(k);q.material=this._material;q.center=[.5*(e[0]+e[3]),.5*(e[1]+e[4]),0];q.bsRadius=.5*Math.sqrt((e[3]-e[0])*(e[3]-e[0])+(e[4]-e[1])*(e[4]-e[1]));q.transformation=p;q.name=h;q.uniqueName=h+"#"+k.id;a.push(q)}}return new F(this,a,r)}return null};return g}(H)});