/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as a}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as r}from"../FeatureTechnique.js";import{isHittest as o,getSelectionDefines as n,getFeatureTextures as s,getLocalTileOffset as m,getFeatureUniforms as u,resolveDynamicUniforms as l,getFeaturePipelineState as c}from"../featureTechniqueUtils.js";import{getAntialiasingControls as g}from"../line/utils.js";class f extends r{render(r,f){const{context:p,painter:x,pixelRatio:d}=r,{target:b}=f,{freezeGlobalTime:h}=a,T=0,D=x.textureManager.animationStore.getTexture(p,T),y=[2/r.state.size[0],0,0,0,-2/r.state.size[1],0,-1,1,1],R=Array.from(e(i(),y)),j=Array.from(t(i(),R,b.transforms.displayViewScreenMat3)),z=f.instance.getInput(),M=x.textureManager.getMosaicInfo(r,f.textureKey,!1),{optionalAttributes:S}=z,A=S.zoomRange,I=S.value1Position2Value2,q="accumulatedDistance"in S&&S.accumulatedDistance,w="segmentDirection"in S&&S.segmentDirection,P="normal"in S&&S.normal;x.setShader({shader:this.shaders.geometry,uniforms:{...l(r,f.target,z.uniforms),...u(r,f.target),antialiasingControls:g(d),mosaicInfo:M,animationInfo:{globalTime:r.animationsEnabled?!1===h?r.time/1e3:h:0,animationTextureSize:[D.descriptor.width,D.descriptor.height],toScreen:j,toNdc:y,mapRotation:r.state.rotation,pixelRatio:r.state.pixelRatio},localTileOffset:m(f.target)},textures:{...s(r),mosaicTexture:x.textureManager.getMosaicTexture(r,f.textureKey,!1),animationTexture:{unit:6,texture:D}},defines:{...n(r)},optionalAttributes:{zoomRange:A,value1Position2Value2:I,accumulatedDistance:q,segmentDirection:w,normal:P},useComputeBuffer:o(r)}),x.setPipelineState({...c(r)}),x.submitDraw(r,f),!1===h&&r.animationsEnabled&&b.requestRender()}}export{f as AnimatedTechnique};
