// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define(["exports","../../core/Collection"],function(c,h){c.ManipulatorVisibilityPredicate=void 0;(function(a){a[a.WhenToolEditable=0]="WhenToolEditable";a[a.WhenToolNotEditable=1]="WhenToolNotEditable";a[a.Always=2]="Always"})(c.ManipulatorVisibilityPredicate||(c.ManipulatorVisibilityPredicate={}));class k{constructor(){this._isToolEditable=!0;this._manipulators=new h;this._resourceContexts={manipulator3D:{}};this._attached=!1}set isToolEditable(a){this._isToolEditable=a}get length(){return this._manipulators.length}add(a, b=c.ManipulatorVisibilityPredicate.WhenToolEditable){this.addMany([a],b)}addMany(a,b=c.ManipulatorVisibilityPredicate.WhenToolEditable){for(const d of a)a={manipulator:d,visibilityPredicate:b,attached:!1},this._manipulators.add(a),this._attached&&this._updateManipulatorAttachment(a)}remove(a){for(let b=0;b{this._detachManipulator(a)}); this._manipulators.removeAll()}attach(){this._manipulators.forEach(a=>{this._updateManipulatorAttachment(a)});this._attached=!0}detach(){this._manipulators.forEach(a=>{this._detachManipulator(a)});this._attached=!1}destroy(){this.detach();this._manipulators.forEach(({manipulator:a})=>a.destroy());this._manipulators.destroy();this._resourceContexts=null}on(a,b){return this._manipulators.on(a,d=>{b(d)})}forEach(a){for(const b of this._manipulators.items)a(b)}some(a){return this._manipulators.items.some(a)}toArray(){const a= [];this.forEach(b=>a.push(b.manipulator));return a}intersect(a,b){let d=null,g=Number.MAX_VALUE;this._manipulators.forEach(({manipulator:f,attached:e})=>{e&&f.interactive&&(e=f.intersectionDistance(a,b),null!=e&&e