/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t,__param as e}from"tslib";import{input as i}from"../../GraphShaderModule.js";import{Float as r,sin as s,cos as o,Vec3 as l,Vec4 as n,mix as a}from"../../graph/glsl.js";import{AAnimatedPolyShader as m,PolyVertexInput as p,PolyHittestVertexInput as u,PolyFragmentInput as d}from"./AAnimatedPolyShader.js";import{getPatternMatrix as h}from"../shaders/ComplexFillShader.js";import{c256ToRad as y}from"../shaders/constants.js";import{hittestFill as c}from"../shaders/hittestUtils.js";class f extends m{constructor(){super(...arguments),this.type="AnimatedFillShader"}vertex(t,e){const{distanceToPx:i,ndc:m,z:p,color:u,isOutline:d,strokeWidth:c,isSDF:f,scale:g,scaleSymbolsProportionally:x}=this._vertexPoly(t),b=this.view.requiredZoomFactor,P=t.sizing.xy,v=P.multiply(b),S=t.angle?t.angle.multiply(y):new r(0),j=s(S),w=o(S),F=h(t.id,v,j,w,t.bitset),O=this.localTileOffset.getPatternOffsetAtTileOrigin(P,j,w),A=b.multiply(t.offset.subtract(O)).divide(v),T=new l(t.pos,1),z=F.multiply(T).xy.subtract(A),k=t.tlbr.divide(this.mosaicInfo.size.xyxy);return{glPosition:new n(m,p,1),tlbr:k,uv:z,color:u.multiply(new r(1).subtract(d)),outlineColor:u.multiply(d),distanceToPx:i,strokeWidth:c.multiply(a(new r(1),g,x)),isOutline:d,isSDF:f,...this.maybeRunHittest(t,e,{})}}fragment(t){const e=this._fragmentPoly(t);return this.getFragmentOutput(e,t)}hittest(t,e,i){return c(this,t,e)}}t([e(0,i(p)),e(1,i(u))],f.prototype,"vertex",null),t([e(0,i(d))],f.prototype,"fragment",null);export{f as AnimatedFillShader};
