/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{b as t,n as i,d as s}from"../../../../chunks/vec32.js";import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";class h{constructor(t,i,s,h,o){this.vertices=t,this.positionsES=i,this.offset=h,this.positions=o;const n=t.length,v=Math.floor(n/2),g=this.offset+3*v,f=s[g],r=s[g+1],c=s[g+2];this.origin=e(f,r,c);const l=this.offset+3*n;for(let e=this.offset;e<l;e+=3)o[e]=s[e]-f,o[e+1]=s[e+1]-r,o[e+2]=s[e+2]-c;this.updatePathVertexInformation()}updatePathVertexInformation(){const e=this.vertices.length,h=this.vertices[0];let o=this.offset;const n=this.positions;h.vRight[0]=n[o+3]-n[o],h.vRight[1]=n[o+4]-n[o+1],h.vRight[2]=n[o+5]-n[o+2],o+=3;let v=t(h.vRight);h.vMinSiblingLength=v,i(h.vRight,h.vRight);let g=h;for(let f=1;f<e;++f){const h=this.vertices[f];if(h.vLeft=g.vRight,f<e-1){h.vRight[0]=n[o+3]-n[o],h.vRight[1]=n[o+4]-n[o+1],h.vRight[2]=n[o+5]-n[o+2];const s=t(h.vRight);h.vMinSiblingLength=Math.min(v,s),v=s,i(h.vRight,h.vRight)}else s(h.vRight,h.vLeft),h.vMinSiblingLength=v;g=h,o+=3}}}export{h as Path};
