/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
function t(t,r){return n(t,r.coords[0],r.coords[1])}function r(t,r){const{coords:o,lengths:e,stride:c}=r;if(!e)return!1;for(let s=0,f=0;s<e.length;s++,f+=c)if(!n(t,o[f],o[f+1]))return!1;return!0}function n(t,r,n){if(!t)return!1;const{coords:e,lengths:c,stride:s}=t;let f=!1,u=0;for(const i of c)f=o(f,e,s,u,i,r,n),u+=i*s;return f}function o(t,r,n,o,e,c,s){let f=t,u=o;for(let i=o,l=o+e*n;i<l;i+=n){u=i+n,u===l&&(u=o);const t=r[i],e=r[i+1],d=r[u],g=r[u+1];(e<s&&g>=s||g<s&&e>=s)&&t+(s-e)/(g-e)*(d-t)<c&&(f=!f)}return f}export{n as polygonContainsCoords,r as polygonContainsMultipoint,t as polygonContainsPoint};
