/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["./GeographicTransformationStep"],(function(t){"use strict";return function(){function n(n){if(this.steps=[],this._cached_projection={},this._chain="",this._gtlistentry=null,n&&n.steps)for(const i of n.steps)i instanceof t?this.steps.push(i):this.steps.push(new t({wkid:i.wkid,wkt:i.wkt,isInverse:i.isInverse}))}n.cacheKey=function(t,n){return[void 0!==t.wkid&&null!==t.wkid?t.wkid.toString():"-1",void 0!==t.wkt&&null!==t.wkt?t.wkt.toString():"",void 0!==n.wkid&&null!==n.wkid?n.wkid.toString():"-1",void 0!==n.wkt&&null!==n.wkt?n.wkt.toString():""].join(",")},n.fromGE=function(i){const s=new n;let e="";for(const n of i.steps){const i=t.fromGE(n);s.steps.push(i),e+=i.uid.toString()+","}return s._cached_projection={},s._gtlistentry=null,s._chain=e,s};var i=n.prototype;return i.getInverse=function(){const t=new n;t.steps=[];for(let n=this.steps.length-1;n>=0;n--){const i=this.steps[n];t.steps.push(i.getInverse())}return t},i.getGTListEntry=function(){let t="";for(const n of this.steps)t+=n.uid.toString()+",";return t!==this._chain&&(this._gtlistentry=null,this._cached_projection={},this._chain=t),this._gtlistentry},i.assignCachedGe=function(t,i,s){this._cached_projection[n.cacheKey(t,i)]=s},i.getCachedGeTransformation=function(t,i){let s="";for(const n of this.steps)s+=n.uid.toString()+",";s!==this._chain&&(this._gtlistentry=null,this._cached_projection={},this._chain=s);const e=this._cached_projection[n.cacheKey(t,i)];return void 0===e?null:e},n}()}));
