/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../chunks/_rollupPluginBabelHelpers","../../../chunks/mat3f32","../../../layers/effects/EffectView","./DisplayObject"],(function(e,t,i,n,s){"use strict";let r=function(e){function s(){var t;return(t=e.apply(this,arguments)||this)._childrenSet=new Set,t._needsSort=!1,t.children=[],t._effectView=null,t}t._inheritsLoose(s,e);var r=s.prototype;return r.updateTransitionProperties=function(t,i){e.prototype.updateTransitionProperties.call(this,t,i),this._effectView&&(this._effectView.transitionStep(t,i),this._effectView.transitioning&&this.requestRender())},r.doRender=function(e){const t=this.createRenderParams(e);this.renderChildren(t)},r.addChild=function(e){return this.addChildAt(e,this.children.length)},r.addChildAt=function(e,t=this.children.length){if(!e)return e;if(this.contains(e))return e;this._needsSort=!0;const i=e.parent;return i&&i!==this&&i.removeChild(e),t>=this.children.length?this.children.push(e):this.children.splice(t,0,e),this._childrenSet.add(e),e.parent=this,e.stage=this.stage,this!==this.stage&&(e.clips=this.clips),this.requestRender(),e},r.contains=function(e){return this._childrenSet.has(e)},r.removeAllChildren=function(){this._childrenSet.clear(),this._needsSort=!0;for(const e of this.children)this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null;this.children.length=0},r.removeChild=function(e){return this.contains(e)?this.removeChildAt(this.children.indexOf(e)):e},r.removeChildAt=function(e){if(e<0||e>=this.children.length)return null;this._needsSort=!0;const t=this.children.splice(e,1)[0];return this._childrenSet.delete(t),this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null,t},r.sortChildren=function(e){this._needsSort&&(this.children.sort(e),this._needsSort=!1)},r._createTransforms=function(){return{dvs:i.create()}},r.onAttach=function(){e.prototype.onAttach.call(this);const t=this.stage;for(const e of this.children)e.stage=t},r.onDetach=function(){e.prototype.onDetach.call(this);for(const e of this.children)e.stage=null},r.renderChildren=function(e){for(const t of this.children)t.beforeRender(e);for(const t of this.children)t.processRender(e);for(const t of this.children)t.afterRender(e)},r.createRenderParams=function(e){return{...e,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:e.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition}},t._createClass(s,[{key:"blendMode",get:function(){return this._blendMode},set:function(e){this._blendMode=e,this.requestRender()}},{key:"clips",get:function(){return this._clips},set:function(e){this._clips=e,this.children.forEach((t=>t.clips=e))}},{key:"computedEffects",get:function(){var e,t;return null!=(e=null==(t=this._effectView)?void 0:t.effects)?e:null}},{key:"effect",get:function(){var e,t;return null!=(e=null==(t=this._effectView)?void 0:t.effect)?e:""},set:function(e){(this._effectView||e)&&(this._effectView||(this._effectView=new n.EffectView),this._effectView.effect=e,this.requestRender())}}]),s}(s.DisplayObject);e.Container=r,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
