/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["require","exports","../../../../../../chunks/_rollupPluginBabelHelpers","../../../../../ViewingMode","./ComponentTechniqueConfiguration","./shader/ComponentData.glsl","../../../../../../chunks/ComponentShader.glsl","../../../core/shaderLibrary/ShaderOutputOptions","../../../core/shaderLibrary/util/DoublePrecision.glsl","../../../core/shaderTechnique/ReloadableShaderModule","../../../core/shaderTechnique/ShaderTechnique","../../../lib/basicInterfaces","../../../lib/OrderIndependentTransparency","../../../lib/Program","../../../lib/StencilUtils","../../../../../webgl/renderState"],(function(e,n,t,i,r,o,a,s,l,u,c,d,p,h,g,b){"use strict";let f=function(e){function n(){return e.apply(this,arguments)||this}t._inheritsLoose(n,e);var a=n.prototype;return a.bindDraw=function(e,n){const t=this.program;t.bindDraw(e,n),t.rebindTextures(),e.componentParameters.type===o.ComponentDataType.Varying&&e.componentParameters.texture.bind(t,"componentColorTex","componentColorTexInvDim")},a.initializeConfiguration=function(e,n){n.spherical=e.viewingMode===i.ViewingMode.Global,n.doublePrecisionRequiresObfuscation=l.doublePrecisionRequiresObfuscation(e.rctx)},a.initializeProgram=function(e){const t=n.shader.get(),i=t.build(this.configuration);return new h.Program(e.rctx,i,t.attributeLocations)},a._setPipelineState=function(e){const n=this.configuration,t=n.integratedMeshMode!==r.IntegratedMeshMode.None,i=e===d.TransparencyPassType.NONE,o=e===d.TransparencyPassType.FrontFace;return b.makePipelineState({blending:n.output!==s.ShaderOutput.Color&&n.output!==s.ShaderOutput.Alpha||!n.blendingEnabled?null:i?p.blendingDefault:p.oitBlending(e),culling:b.cullingParams(n.cullFace),depthTest:{func:p.oitDepthTest(e)},depthWrite:i||o?b.defaultDepthWriteParams:null,colorWrite:b.defaultColorWriteParams,stencilWrite:t||n.hasOccludees?g.stencilWriteMaskOn:null,stencilTest:t?g.replaceBitWhenDepthTestPasses(d.StencilBits.IntegratedMeshMaskExcluded):n.hasOccludees?g.stencilBaseAllZerosParams:null,polygonOffset:i||o?n.hasPolygonOffset?{factor:2,units:2}:null:p.OITPolygonOffset})},a.initializePipeline=function(){return this._setPipelineState(this.configuration.transparencyPassType)},n}(c.ShaderTechnique);f.shader=new u.ReloadableShaderModule(a.ComponentShader,(()=>new Promise(((n,t)=>e(["./shader/ComponentShader.glsl"],n,t))))),n.ComponentTechnique=f,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
