define(["exports","./Matrix2-ccd5b911","./RuntimeError-346a3079","./ComponentDatatype-93750d1a","./when-4bbc8319","./EllipsoidRhumbLine-aa9e6266","./GeometryAttribute-c30799b8","./WebGLConstants-1c8239cc"],function(e,L,t,D,G,O,T,n){"use strict";var r=i,a=i;function i(e,t,n){n=n||2;var r,a,i,u,x,o=t&&t.length,s=o?t[0]*n:e.length,p=y(e,0,s,n,!0),h=[];if(!p||p.next===p.prev)return h;if(o&&(p=function(e,t,n,r){var a,i,u,x,o=[];for(a=0,i=t.length;a=r.next.y&&r.next.y!==r.y){var x=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(x<=a&&u=r.x&&r.x>=p&&a!==r.x&&g(in.x||r.x===n.x&&function(e,t){return b(e.prev,e,t.prev)<0&&b(t.next,e,e.next)<0}(n,r)))&&(n=r,f=o)),r=r.next,r!==s;);return n}(e,t);if(!n)return t;var r=E(n,e),e=c(n,n.next);return c(r,r.next),t===n?e:t}(o[a],n),n=c(n,n.next);return n}(e,t,p,n)),e.length>80*n){for(var f=r=e[0],l=a=e[1],v=n;vi.x?a.x>u.x?a:u:i.x>u.x?i:u).x,p=(a.y>i.y?a.y>u.y?a:u:i.y>u.y?i:u).y,h=C(x,o,t,n,r),f=C(s,p,t,n,r),l=e.prevZ,v=e.nextZ;for(;l&&l.z>=h&&v&&v.z<=f;){if(l!==e.prev&&l!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,l.x,l.y)&&0<=b(l.prev,l,l.next))return!1;if(l=l.prevZ,v!==e.prev&&v!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,v.x,v.y)&&0<=b(v.prev,v,v.next))return!1;v=v.nextZ}for(;l&&l.z>=h;){if(l!==e.prev&&l!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,l.x,l.y)&&0<=b(l.prev,l,l.next))return!1;l=l.prevZ}for(;v&&v.z<=f;){if(v!==e.prev&&v!==e.next&&g(a.x,a.y,i.x,i.y,u.x,u.y,v.x,v.y)&&0<=b(v.prev,v,v.next))return!1;v=v.nextZ}return!0}(e,r,a,i):function(e){var t=e.prev,n=e,r=e.next;if(0<=b(t,n,r))return!1;var a=e.next.next;for(;a!==e.prev;){if(g(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&0<=b(a.prev,a,a.next))return!1;a=a.next}return!0}(e))t.push(x.i/n),t.push(e.i/n),t.push(o.i/n),f(e),e=o.next,s=o.next;else if((e=o)===s){u?1===u?d(e=function(e,t,n){var r=e;do{var a=r.prev,i=r.next.next}while(!p(a,i)&&h(a,r,r.next,i)&&w(a,i)&&w(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),f(r),f(r.next),r=e=i),r=r.next,r!==e);return c(r)}(c(e),t,n),t,n,r,a,i,2):2===u&&function(e,t,n,r,a,i){var u=e;do{for(var x=u.next.next;x!==u.prev;){if(u.i!==x.i&&function(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&h(n,n.next,e,t))return!0}while(n=n.next,n!==e);return!1}(e,t)&&(w(e,t)&&w(t,e)&&function(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;for(;n.y>i!=n.next.y>i&&n.next.y!==n.y&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(e,t)&&(b(e.prev,e,t.prev)||b(e,t.prev,t))||p(e,t)&&0=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function s(e){return 0