/*
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","../../../../chunks/tslib.es6","../core/shaderLibrary/ShaderOutputOptions","../core/shaderModules/interfaces","../core/shaderTechnique/ReloadableShaderModule","../core/shaderTechnique/ShaderTechnique","../core/shaderTechnique/ShaderTechniqueConfiguration","../lib/basicInterfaces","../lib/DefaultVertexAttributeLocations","../lib/OrderIndependentTransparency","../lib/Program","../lib/StencilUtils","../materials/DefaultTechniqueConfiguration","../../../../chunks/ImageMaterial.glsl","../../../webgl/enums","../../../webgl/renderState"],(function(e,t,a,r,n,i,o,s,l,u,c,p,d,h,f,y,P,g){"use strict";let T=function(e){function t(){return e.apply(this,arguments)||this}return a._inheritsLoose(t,e),t}(i.NoParameters),_=function(e){function t(){return e.apply(this,arguments)||this}a._inheritsLoose(t,e);var r=t.prototype;return r.initializeProgram=function(e){const a=t.shader.get().build(this.configuration);return new d.Program(e.rctx,a,c.Default3D)},r._setPipelineState=function(e,t){const a=this.configuration,r=e===u.TransparencyPassType.NONE,i=e===u.TransparencyPassType.FrontFace;return g.makePipelineState({blending:a.output!==n.ShaderOutput.Color&&a.output!==n.ShaderOutput.Alpha||!a.transparent?null:r?m:p.oitBlending(e),culling:g.cullingParams(a.cullFace),depthTest:{func:p.oitDepthTest(e)},depthWrite:r?a.writeDepth&&g.defaultDepthWriteParams:p.oitDepthWrite(e),colorWrite:g.defaultColorWriteParams,stencilWrite:a.hasOccludees?h.stencilWriteMaskOn:null,stencilTest:a.hasOccludees?t?h.stencilToolMaskBaseParams:h.stencilBaseAllZerosParams:null,polygonOffset:r||i?null:p.getOITPolygonOffset(a.enableOffset)})},r.initializePipeline=function(){return this._occludeePipelineState=this._setPipelineState(this.configuration.transparencyPassType,!0),this._setPipelineState(this.configuration.transparencyPassType,!1)},r.getPipelineState=function(t,a){return a?this._occludeePipelineState:e.prototype.getPipelineState.call(this,t,a)},t}(s.ShaderTechnique);_.shader=new o.ReloadableShaderModule(y.ImageMaterial,(()=>new Promise(((t,a)=>e(["./ImageMaterial.glsl"],t,a)))));const m=g.simpleBlendingParams(P.BlendFactor.ONE,P.BlendFactor.ONE_MINUS_SRC_ALPHA);let O=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).output=n.ShaderOutput.Color,t.cullFace=u.CullFaceOptions.None,t.hasSlicePlane=!1,t.transparent=!1,t.enableOffset=!0,t.writeDepth=!0,t.hasOccludees=!1,t.transparencyPassType=u.TransparencyPassType.NONE,t.hasMultipassTerrain=!1,t.cullAboveGround=!1,t}return a._inheritsLoose(t,e),t}(f.DefaultTechniqueConfiguration);r.__decorate([l.parameter({count:n.ShaderOutput.COUNT})],O.prototype,"output",void 0),r.__decorate([l.parameter({count:u.CullFaceOptions.COUNT})],O.prototype,"cullFace",void 0),r.__decorate([l.parameter()],O.prototype,"hasSlicePlane",void 0),r.__decorate([l.parameter()],O.prototype,"transparent",void 0),r.__decorate([l.parameter()],O.prototype,"enableOffset",void 0),r.__decorate([l.parameter()],O.prototype,"writeDepth",void 0),r.__decorate([l.parameter()],O.prototype,"hasOccludees",void 0),r.__decorate([l.parameter({count:u.TransparencyPassType.COUNT})],O.prototype,"transparencyPassType",void 0),r.__decorate([l.parameter()],O.prototype,"hasMultipassTerrain",void 0),r.__decorate([l.parameter()],O.prototype,"cullAboveGround",void 0),t.ImageMaterialPassParameters=T,t.ImageMaterialTechnique=_,t.ImageMaterialTechniqueConfiguration=O,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
