import{S as b,G as M,a as m}from"./init-CYWpB2eg.js";const F={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},i=0,n=1,d=2,r=3,l=4,o=5,h=class g{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<i)}set blend(t){!!(this.data&1<<i)!==t&&(this.data^=1<<i)}get offsets(){return!!(this.data&1<<n)}set offsets(t){!!(this.data&1<<n)!==t&&(this.data^=1<<n)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<d)}set culling(t){!!(this.data&1<<d)!==t&&(this.data^=1<<d)}get depthTest(){return!!(this.data&1<<r)}set depthTest(t){!!(this.data&1<<r)!==t&&(this.data^=1<<r)}get depthMask(){return!!(this.data&1<<o)}set depthMask(t){!!(this.data&1<<o)!==t&&(this.data^=1<<o)}get clockwiseFrontFace(){return!!(this.data&1<<l)}set clockwiseFrontFace(t){!!(this.data&1<<l)!==t&&(this.data^=1<<l)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=F[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new g;return t.depthTest=!1,t.blend=!0,t}};h.default2d=h.for2d();let k=h;const p=class c extends b{constructor(t){t={...c.defaultOptions,...t},super(t),this.enabled=!0,this._state=k.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,typeof t.antialias=="boolean"?this.antialias=t.antialias?"on":"off":this.antialias=t.antialias,this.resolution=t.resolution,this.blendRequired=t.blendRequired,this.clipToViewport=t.clipToViewport,this.addResource("uTexture",0,1),t.blendRequired&&this.addResource("uBackTexture",0,3)}apply(t,e,s,a){t.applyFilter(this,e,s,a)}get blendMode(){return this._state.blendMode}set blendMode(t){this._state.blendMode=t}static from(t){const{gpu:e,gl:s,...a}=t;let f,u;return e&&(f=M.from(e)),s&&(u=m.from(s)),new c({gpuProgram:f,glProgram:u,...a})}};p.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let y=p;export{y as F,k as S};
