/*
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","../../../core/time"],(function(e,t,o){"use strict";let n=function(){function e(){this.segments=[]}var n=e.prototype;return n.interpolateComponentsAt=function(e,t){e=Math.min(Math.max(e,0),1),e*=this.time;let o=0,n=0;const s=this.definition;for(let r=0;r<this.segments.length;r++){const i=this.segments[r],a=i.definition;if(e<=i.time||r===this.segments.length-1){t=this.segmentInterpolateComponentsAt(i,e/i.time,t),s.hasPan?t.pan=(o+a.compared.pan*t.pan)/s.compared.pan:t.pan=1,s.hasRotate?t.rotate=(n+a.compared.rotate*t.rotate)/s.compared.rotate:t.rotate=1;const r=t.zoom*(a.compared.targetZoom-a.compared.sourceZoom)+a.compared.sourceZoom,m=this.segments[0].definition.compared.sourceZoom,c=this.segments[this.segments.length-1].definition.compared.targetZoom;return s.hasZoom?t.zoom=(r-m)/(c-m):t.zoom=1,t}e-=i.time,o+=a.compared.pan,n+=a.compared.rotate}},n.segmentInterpolateComponentsAt=function(e,t,o){return e.interpolateComponentsAt(t,o)},t._createClass(e,[{key:"time",get:function(){return this.segments.reduce(((e,t)=>o.Seconds(e+t.time)),o.Seconds(0))}}]),e}();e.Path=n,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
