/*
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","../CIMCursor","../GeometryWalker"],(function(t,e,i,n){"use strict";let s=function(){function t(){}return t.local=function(){return null===t.instance&&(t.instance=new t),t.instance},t.prototype.execute=function(t,e,i,n){return new r(t,e,i)},t}();s.instance=null;let r=function(t){function i(e,i,s){var r;return(r=t.call(this,e,!0,!0)||this)._walker=new n.GeometryWalker,r._walker.updateTolerance(s),r._angleToLine=void 0===i.angleToLine||i.angleToLine,r._offset=void 0!==i.offset?i.offset*s:0,r._beginGap=void 0!==i.beginPosition?i.beginPosition*s:0,r._endGap=void 0!==i.endPosition?i.endPosition*s:0,r._flipFirst=void 0===i.flipFirst||i.flipFirst,r._pattern=new n.DashPattern,r._pattern.init(i.positionArray,!1,!1),r._subPathLen=0,r._posCount=r._pattern.size(),r._isFirst=!0,r._prevPos=0,r}return e._inheritsLoose(i,t),i.prototype.processPath=function(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath){const t=this._pattern.nextValue()*this._subPathLen,i=this._beginGap+t;e=i-this._prevPos,this._prevPos=i}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=this._walker.calculatePathLength(t)-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const i=this._pattern.nextValue()*this._subPathLen,n=this._beginGap+i;e=n-this._prevPos,this._prevPos=n,this.iteratePath=!0}const i={};if(!this._walker.nextPointAndAngle(e,i,n.EndType.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(i.pt[0]-this._offset*i.sa,i.pt[1]+this._offset*i.ca);const s=this._isFirst&&this._flipFirst;let r,a;return this._angleToLine?(r=i.ca,a=i.sa):(r=1,a=0),s&&(r=-r,a=-a),this.internalPlacement.setRotateCS(r,a),this._isFirst=!1,this._posCount--,0===this._posCount&&(this.iteratePath=!1),this.internalPlacement},i}(i.PathTransformationCursor);t.PlacementAtRatioPositions=s,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
