/*
 Copyright (c) 2012, Vladimir Agafonkin
 Simplify.js is a high-performance polyline simplification library.
 http://mourner.github.com/simplify-js/
*/
(function(a,b){function c(a,b){var c=a.x-b.x,d=a.y-b.y;return c*c+d*d}function d(a,b,c){var d=b.x,e=b.y,f=c.x-d,g=c.y-e,h;if(f!==0||g!==0)h=((a.x-d)*f+(a.y-e)*g)/(f*f+g*g),h>1?(d=c.x,e=c.y):h>0&&(d+=f*h,e+=g*h);return f=a.x-d,g=a.y-e,f*f+g*g}function e(a,b){var d=a[0],e=[d],f=a.length,g,h;for(g=1;g<f;g++)h=a[g],c(h,d)>b&&(e.push(h),d=h);return d!==h&&e.push(h),e}function f(a,b,c,e,f){var g,h,i,j,k=[],l=[];while(f){g=0;for(h=e+1;h<f;h++)i=d(a[h],a[e],a[f]),i>g&&(j=h,g=i);g>c&&(b[j]=1,k.push(e),l.push(j),k.push(j),l.push(f)),e=k.pop(),f=l.pop()}}function g(a,c){var d=a.length,e=typeof Uint8Array!=b+""?Uint8Array:Array,g=new e(d),h,i=[];g[0]=g[d-1]=1,f(a,g,c,0,d-1);for(h=0;h<d;h++)g[h]&&i.push(a[h]);return i}"use strict";var h=typeof exports!=b+""?exports:a;h.simplify=function(a,c,d){c=c!==b?c:1,d=d!==b?d:!1;var f=c*c;return d||(a=e(a,f)),a=g(a,f),a}})(this)
@@ -414,82 +414,86 @@
 ar d
-=a%5B0%5D,e=%5Bd%5D,f=a.length,g,h
+,e=a.length,f,g=c,h=a%5B0%5D,i=%5Bh%5D
 ;for(
-g=1;g%3Cf;g++)h=a%5Bg%5D,c(h,d
+d=1;d%3Ce;d++)f=a%5Bd%5D,g(f,h
 )%3Eb&&(
-e
+i
 .push(
-h),d=h
+f),h=f
 );re
@@ -501,26 +501,26 @@
 urn 
-d!==h&&e
+h!==f&&i
 .push(
-h),e
+f),i
 %7Dfun
@@ -553,15 +553,19 @@
 ,i,j
-,k
+=d,k,l
 =%5B%5D,
-l
+m
 =%5B%5D;
@@ -597,17 +597,17 @@
 f;h++)i=
-d
+j
 (a%5Bh%5D,a%5B
@@ -621,17 +621,17 @@
 ),i%3Eg&&(
-j
+k
 =h,g=i);
@@ -642,14 +642,14 @@
 &(b%5B
-j
+k
 %5D=1,
-k
+l
 .pus
@@ -657,29 +657,29 @@
 (e),
-l
+m
 .push(
-j),k
+k),l
 .push(
-j),l
+k),m
 .pus
@@ -686,17 +686,17 @@
 h(f)),e=
-k
+l
 .pop(),f
@@ -696,17 +696,17 @@
 pop(),f=
-l
+m
 .pop()%7D%7D

update minified version