triangulate-image
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -1,2 +0,2 @@ | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.triangulate=t()}}(function(){var t;return function e(t,n,r){function o(i,u){if(!n[i]){if(!t[i]){var f="function"==typeof require&&require;if(!u&&f)return f(i,!0);if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var s=n[i]={exports:{}};t[i][0].call(s.exports,function(e){var n=t[i][1][e];return o(n?n:e)},s,s.exports,e,t,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var o=t("es6-promise"),a=t("./browser"),i=r(a);(0,o.polyfill)(),n["default"]=i["default"],e.exports=n["default"]},{"./browser":2,"es6-promise":34}],2:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};n["default"]=function(t){function e(){return t}function n(){var t=o({},W);return B||o(t,L),t}function r(){var t=o({},W);return N||o(t,R),t}function a(t){return P(f["default"],t)}function u(t){return P(f["default"],t,!0)}function l(t){return P(function(t){return t},t)}function c(t){return P(function(t){return t},t,!0)}function p(t){return k(function(t){return t},t)}function h(t){return k(function(t){return t},t,!0)}function v(t){return k(d["default"],t)}function b(t){return k(d["default"],t,!0)}function _(t){return k(s["default"],t)}function w(t){return k(s["default"],t,!0)}function M(t){return k(g["default"],t)}function C(t){return k(g["default"],t,!0)}function P(t,e,n){return T=!!n,B=function(){return T?t(e):new Promise(function(n,r){try{var o=t(e);n(o)}catch(a){r(a)}})},O()?D():r()}function k(t,e,r){return E=!!r,N=function(n,r){return E?t(n,r,e):new Promise(function(o,a){try{var i=t(n,r,e);o(i)}catch(u){a(u)}})},O()?D():n()}function O(){return B&&N}function D(){if(T&&E){var e=B(t),n=(0,y["default"])(e,t),r=N(n,e);return r}return new Promise(function(e,n){var r;j().then(function(e){return r=e,S(r,t)},n).then(function(t){return I(t,r)},n).then(function(t){e(t)},n)})}function j(t){return new Promise(function(e,n){if(T)try{var r=B(t);e(r)}catch(o){n(o)}else B(t).then(e,n)})}function S(t,e){return new Promise(function(n,r){A.addEventListener("message",function(t){if(t.data&&t.data.polygonJSONStr){var e=JSON.parse(t.data.polygonJSONStr);n(e)}else r(t.data&&t.data.err?t.data.err:t)}),A.postMessage({params:e,imageData:t,imageDataWidth:t.width,imageDataHeight:t.height})})}function I(t,e){return new Promise(function(n,r){if(E)try{var o=N(t,e);n(o)}catch(a){r(a)}else N(t,e).then(n,r)})}t=(0,i["default"])(t);var T=!1,E=!1,A=(0,m["default"])(x["default"]),B=void 0,N=void 0,W={getParams:e,getInput:n,getOutput:r},L={fromImage:a,fromImageSync:u,fromImageData:l,fromImageDataSync:c},R={toData:p,toDataSync:h,toDataURL:v,toDataURLSync:b,toImageData:_,toImageDataSync:w,toSVG:M,toSVGSync:C};return n()};var a=t("./input/sanitizeInput"),i=r(a),u=t("./input/browser/fromImageToImageData"),f=r(u),l=t("./output/polygonsToImageData"),s=r(l),c=t("./output/polygonsToDataURL"),d=r(c),p=t("./output/polygonsToSVG"),g=r(p),h=t("./polygons/imageDataToPolygons"),y=r(h),v=t("webworkify"),m=r(v),b=t("./workers/triangulationWorker"),x=r(b);e.exports=n["default"]},{"./input/browser/fromImageToImageData":5,"./input/sanitizeInput":7,"./output/polygonsToDataURL":8,"./output/polygonsToImageData":9,"./output/polygonsToSVG":10,"./polygons/imageDataToPolygons":17,"./workers/triangulationWorker":31,webworkify:38}],3:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){var e=(0,i["default"])(t.width,t.height),n=e.getContext("2d");return n.putImageData(t,0,0),n.getImageData(0,0,t.width,t.height)}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){if((0,f["default"])(t)){if("undefined"==typeof Uint8ClampedArray){if("undefined"==typeof window)throw new Error("Can't copy imageData in webworker without Uint8ClampedArray support.");return o(t)}var e=new Uint8ClampedArray(t.data);if("undefined"==typeof ImageData)return{width:t.width,height:t.height,data:e};var n=void 0;try{n=new ImageData(e,t.width,t.height)}catch(r){if("undefined"==typeof window)throw new Error("Can't copy imageData in webworker without proper ImageData() support.");n=o(t)}return n}throw new Error("Given imageData object is not useable.")};var a=t("canvas-browserify"),i=r(a),u=t("../util/isImageData"),f=r(u);e.exports=n["default"]},{"../util/isImageData":24,"canvas-browserify":32}],4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){for(var e=t.data.length,n=void 0,r=0;e>r;r+=4)n=.34*t.data[r]+.5*t.data[r+1]+.16*t.data[r+2],t.data[r]=n,t.data[r+1]=n,t.data[r+2]=n;return t},e.exports=n["default"]},{}],5:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){if(t instanceof HTMLImageElement){if(!t.naturalWidth||!t.naturalHeight||t.complete===!1)throw new Error("This this image hasn't finished loading: "+t.src);var e=new a["default"](t.naturalWidth,t.naturalHeight),n=e.getContext("2d");n.drawImage(t,0,0,e.width,e.height);var r=n.getImageData(0,0,e.width,e.height);return r.data&&r.data.length&&("undefined"==typeof r.width&&(r.width=t.naturalWidth),"undefined"==typeof r.height&&(r.height=t.naturalHeight)),r}throw new Error("This object does not seem to be an image.")};var o=t("canvas-browserify"),a=r(o);a["default"].Image;e.exports=n["default"]},{"canvas-browserify":32}],6:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={accuracy:.7,blur:4,fill:!0,stroke:!0,strokeWidth:.5,lineJoin:"miter",vertexCount:700,threshold:50,transparentColor:!1},e.exports=n["default"]},{}],7:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};n["default"]=function(t){return t=(0,f["default"])(t),"object"!==("undefined"==typeof t?"undefined":o(t))&&(t={}),"number"!=typeof t.accuracy||isNaN(t.accuracy)?t.accuracy=d["default"].accuracy:t.accuracy=(0,i["default"])(t.accuracy,0,1),("number"!=typeof t.blur||isNaN(t.blur))&&(t.blur=d["default"].blur),t.blur<=0&&(t.blur=1),"string"!=typeof t.fill&&"boolean"!=typeof t.fill&&(t.fill=d["default"].fill),"string"!=typeof t.stroke&&"boolean"!=typeof t.stroke&&(t.stroke=d["default"].stroke),("number"!=typeof t.strokeWidth||isNaN(t.strokeWidth))&&(t.strokeWidth=d["default"].strokeWidth),"number"!=typeof t.threshold||isNaN(t.threshold)?t.threshold=d["default"].threshold:t.threshold=(0,i["default"])(t.threshold,1,100),("string"!=typeof t.lineJoin||-1===p.indexOf(t.lineJoin))&&(t.lineJoin=d["default"].lineJoin),t.gradients&&t.fill?t.gradients=!0:t.gradients=!1,t.gradients&&(("number"!=typeof t.gradientStops||isNaN(t.gradientStops)||t.gradientStops<2)&&(t.gradientStops=2),t.gradientStops=Math.round(t.gradientStops)),("number"!=typeof t.vertexCount||isNaN(t.vertexCount))&&(t.vertexCount=d["default"].vertexCount),t.vertexCount<=0&&(t.vertexCount=1),"string"!=typeof t.transparentColor&&"boolean"!=typeof t.transparentColor&&(t.transparentColor=d["default"].transparentColor),typeof t.transparentColor===!0&&(t.transparentColor=!1),"string"==typeof t.transparentColor&&(t.transparentColor=(0,s["default"])(t.transparentColor)),t};var a=t("../util/clamp"),i=r(a),u=t("../util/clone"),f=r(u),l=t("../util/toColor"),s=r(l),c=t("./defaultParams"),d=r(c),p=["miter","round","bevel"];e.exports=n["default"]},{"../util/clamp":18,"../util/clone":19,"../util/toColor":29,"./defaultParams":6}],8:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){var r=n&&n.dpr?n.dpr:1,o=(0,a["default"])(e,n,r);return(0,u["default"])(o.ctx,t,e,r),o.canvas.toDataURL()};var o=t("../util/makeCanvasAndContext"),a=r(o),i=t("../util/drawPolygonsOnContext"),u=r(i);e.exports=n["default"]},{"../util/drawPolygonsOnContext":21,"../util/makeCanvasAndContext":27}],9:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){var r=n&&n.dpr?n.dpr:1,o=(0,a["default"])(e,n,r,!0).ctx;return(0,u["default"])(o,t,e,r),o.getImageData(0,0,e.width*r,e.height*r)};var o=t("../util/makeCanvasAndContext"),a=r(o),i=t("../util/drawPolygonsOnContext"),u=r(i);e.exports=n["default"]},{"../util/drawPolygonsOnContext":21,"../util/makeCanvasAndContext":27}],10:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e){var n="";t.length&&t[0].gradient&&(n="<defs>");var r="";t.forEach(function(t,e){var o=t.a,i=t.b,u=t.c;r+='<polygon points="'+o.x+","+o.y+" "+i.x+","+i.y+" "+u.x+","+u.y+'"',t.gradient?!function(){var o=t.boundingBox,i=((t.gradient.x1-o.x)/o.width*100).toFixed(3),u=((t.gradient.y1-o.y)/o.height*100).toFixed(3),f=((t.gradient.x2-o.x)/o.width*100).toFixed(3),l=((t.gradient.y2-o.y)/o.height*100).toFixed(3);n+='\n <linearGradient id="gradient-'+e+'" x1="'+i+'%" y1="'+u+'%" x2="'+f+'%" y2="'+l+'%">';var s=t.gradient.colors.length-1;t.gradient.colors.forEach(function(t,e){var r=(0,a["default"])(t),o=(e/s*100).toFixed(3);n+='\n <stop offset="'+o+'%" stop-color="'+r+'"/>\n '}),n+="</linearGradient>",r+=' fill="url(#gradient-'+e+')"',t.strokeWidth>0&&(r+=' stroke="url(#gradient-'+e+')" stroke-width="'+t.strokeWidth+'" stroke-linejoin="'+t.lineJoin+'"')}():(r+=t.fill?' fill="'+t.fill+'"':' fill="transparent"',t.strokeColor&&(r+=' stroke="'+t.strokeColor+'" stroke-width="'+t.strokeWidth+'" stroke-linejoin="'+t.lineJoin+'"')),r+="/>\n "}),n.length&&(n+="\n </defs>");var o='<?xml version="1.0" standalone="yes"?>\n<svg width="'+e.width+'" height="'+e.height+'" xmlns="http://www.w3.org/2000/svg" version="1.1" >\n '+n+"\n "+r+"\n</svg>";return o};var o=t("../util/toRGBA"),a=r(o);e.exports=n["default"]},{"../util/toRGBA":30}],11:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){return t.forEach(function(t){t.boundingBox=(0,a["default"])([t.a,t.b,t.c])}),t.filter(function(t){return t.boundingBox.width>0&&t.boundingBox.height>0})};var o=t("../util/getBoundingBox"),a=r(o);e.exports=n["default"]},{"../util/getBoundingBox":22}],12:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){var r=n.fill,o=n.stroke,i=n.strokeWidth,f=n.lineJoin,s=n.transparentColor,d="string"==typeof r?r:!1,p="string"==typeof o?o:!1,g=function(t,e){var n=(0,l["default"])(t)&&s,r=n?s:t;return e&&!n?e:(0,c["default"])(r)};return t.forEach(function(t,n){var l=(0,a["default"])((0,u["default"])(t),e);r&&(t.fill=g(l,d)),o&&(t.strokeColor=g(l,p),t.strokeWidth=i,t.lineJoin=f)}),t};var o=t("../util/getColorByPos"),a=r(o),i=t("../util/polygonCenter"),u=r(i),f=t("../util/isTransparent"),l=r(f),s=t("../util/toRGBA"),c=r(s);e.exports=n["default"]},{"../util/getColorByPos":23,"../util/isTransparent":25,"../util/polygonCenter":28,"../util/toRGBA":30}],13:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){return t.forEach(function(t,r){var o={};"abc".split("").forEach(function(r){var i=(0,l["default"])(t[r],e,n.transparentColor);o[r]={key:r,color:i,x:t[r].x,y:t[r].y},o[r].luminance=(0,a["default"])(o[r].color);var u="abc".replace(r,"").split("");o[r].median={x:(t[u[0]].x+t[u[1]].x)/2,y:(t[u[0]].y+t[u[1]].y)/2},o[r].medianColor=(0,l["default"])(o[r].median,e,n.transparentColor),o[r].medianLuminance=(0,a["default"])(o[r].medianColor)});for(var i=[o.a,o.b,o.c].sort(function(t,e){return Math.abs(t.luminance-t.medianLuminance)-Math.abs(e.luminance-e.medianLuminance)}),f=i[0],s=i[0],c=f.median,d=[s],p=(0,u["default"])(s,c),g=1,h=n.gradientStops-2;h>g;g++){var y=g*(p/n.gradientStops),v=y/p,m={x:s.x+v*(c.x-s.x),y:s.y+v*(c.y-s.y)};d.push(m)}d.push(c),t.gradient={x1:f.x,y1:f.y,x2:f.median.x,y2:f.median.y,colors:d.map(function(t){return(0,l["default"])(t,e,n.transparentColor)})},n.stroke&&(t.strokeWidth=n.strokeWidth,t.lineJoin=n.lineJoin),o=null}),t};var o=t("../util/luminance"),a=r(o),i=t("../util/distance"),u=r(i),f=t("../util/getColorByPos"),l=r(f);e.exports=n["default"]},{"../util/distance":20,"../util/getColorByPos":23,"../util/luminance":26}],14:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e){return t.filter(function(t){var n=(0,a["default"])((0,u["default"])(t),e);return!(0,l["default"])(n)})};var o=t("../util/getColorByPos"),a=r(o),i=t("../util/polygonCenter"),u=r(i),f=t("../util/isTransparent"),l=r(f);e.exports=n["default"]},{"../util/getColorByPos":23,"../util/isTransparent":25,"../util/polygonCenter":28}],15:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e){var n,r,o,a,i,u,f,l,s,c=2,d=t.width,p=t.height,g=t.data,h=[];for(r=0;p>r;r+=c)for(n=0;d>n;n+=c){for(l=s=0,o=-1;1>=o;o++)if(u=r+o,f=u*d,u>=0&&p>u)for(a=-1;1>=a;a++)i=n+a,i>=0&&d>i&&(l+=g[i+f<<2],s++);s&&(l/=s),l>e&&h.push({x:n,y:r})}return h},e.exports=n["default"]},{}],16:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n){var r=t+"|"+e;n[r]||(n[r]={x:t,y:e}),r=null}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n,r,a){var i={},u=Math.max(~~(e*(1-n)),5),f=Math.round(Math.sqrt(u)),l=Math.round(Math.ceil(u/f)),s=~~(r/f),c=~~(a/l),d=0,p=0,g=0,h=0;for(h=0;a>h;h+=c)for(d++,p=d%2===0?~~(s/2):0,g=p;r>g;g+=s)r>g&&a>h&&o(~~(g+Math.cos(h)*c),~~(h+Math.sin(g)*s),i);o(0,0,i),o(r-1,0,i),o(r-1,a-1,i),o(0,a-1,i);var y=e-Object.keys(i).length,v=t.length,m=~~(v/y);if(e>0&&m>0){var b=0;for(b=0;v>b;b+=m)o(t[b].x,t[b].y,i)}return t=null,Object.keys(i).map(function(t){return i[t]})};var a=t("../util/clamp");r(a);e.exports=n["default"]},{"../util/clamp":18}],17:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e){if((0,l["default"])(t)){var n={width:t.width,height:t.height},r=(0,c["default"])(t),i=(0,c["default"])(t),f=(0,o.imageDataRGBA)(r,0,0,n.width,n.height,e.blur),s=(0,p["default"])(f),d=(0,u["default"])(s).toImageData(),g=(0,h["default"])(d,e.threshold),y=(0,v["default"])(g,e.vertexCount,e.accuracy,n.width,n.height),m=(0,a.triangulate)(y);return m=(0,b["default"])(m),e.transparentColor||(m=(0,P["default"])(m,i)),m=e.fill===!0&&e.gradients===!0?(0,M["default"])(m,i,e):(0,_["default"])(m,i,e)}throw new Error("Can't work with the imageData provided. It seems to be corrupt.")};var o=t("stackblur-canvas"),a=t("delaunay-fast"),i=t("sobel"),u=r(i),f=t("../util/isImageData"),l=r(f),s=t("../imagedata/copyImageData"),c=r(s),d=t("../imagedata/greyscale"),p=r(d),g=t("./getEdgePoints"),h=r(g),y=t("./getVerticesFromPoints"),v=r(y),m=t("./addBoundingBoxesToPolygons"),b=r(m),x=t("./addColorToPolygons"),_=r(x),w=t("./addGradientsToPolygons"),M=r(w),C=t("./filterTransparentPolygons"),P=r(C);e.exports=n["default"]},{"../imagedata/copyImageData":3,"../imagedata/greyscale":4,"../util/isImageData":24,"./addBoundingBoxesToPolygons":11,"./addColorToPolygons":12,"./addGradientsToPolygons":13,"./filterTransparentPolygons":14,"./getEdgePoints":15,"./getVerticesFromPoints":16,"delaunay-fast":33,sobel:36,"stackblur-canvas":37}],18:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){return e>t?e:t>n?n:t},e.exports=n["default"]},{}],19:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){var e=!1;if("undefined"!=typeof t)try{e=JSON.parse(JSON.stringify(t))}catch(n){}return e},e.exports=n["default"]},{}],20:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)},e.exports=n["default"]},{}],21:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n,r){return r=r||1,e.forEach(function(e,n){t.beginPath(),t.moveTo(e.a.x*r,e.a.y*r),t.lineTo(e.b.x*r,e.b.y*r),t.lineTo(e.c.x*r,e.c.y*r),t.lineTo(e.a.x*r,e.a.y*r),e.gradient?!function(){var n=t.createLinearGradient(e.gradient.x1*r,e.gradient.y1*r,e.gradient.x2*r,e.gradient.y2*r),o=e.gradient.colors.length-1;e.gradient.colors.forEach(function(t,e){var r=(0,a["default"])(t);n.addColorStop(e/o,r)}),t.fillStyle=n,t.fill(),e.strokeWidth>0&&(t.strokeStyle=n,t.lineWidth=e.strokeWidth*r,t.lineJoin=e.lineJoin,t.stroke())}():(e.fill&&(t.fillStyle=e.fill,t.fill()),e.strokeColor&&(t.strokeStyle=e.strokeColor,t.lineWidth=e.strokeWidth*r,t.lineJoin=e.lineJoin,t.stroke())),t.closePath()}),t};var o=t("./toRGBA"),a=r(o);e.exports=n["default"]},{"./toRGBA":30}],22:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){var e=1/0,n=-(1/0),r=1/0,o=-(1/0);return t.forEach(function(t){t.x<e&&(e=t.x),t.y<r&&(r=t.y),t.x>n&&(n=t.x),t.y>o&&(o=t.y)}),{x:e,y:r,width:n-e,height:o-r}},e.exports=n["default"]},{}],23:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,n){var r=(0,i["default"])(t.x,1,e.width-2),o=(0,i["default"])(t.y,1,e.height-2),a=(0|r)+(0|o)*e.width<<2;a>=e.data.length&&(a=e.data.length-5);var u=e.data[a+3]/255;return n&&0===u?n:{r:e.data[a],g:e.data[a+1],b:e.data[a+2],a:u}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=t("./clamp"),i=r(a);e.exports=n["default"]},{"./clamp":18}],24:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};n["default"]=function(t){return t&&"number"==typeof t.width&&"number"==typeof t.height&&t.data&&"number"==typeof t.data.length&&"object"===r(t.data)},e.exports=n["default"]},{}],25:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){return 0===t.a},e.exports=n["default"]},{}],26:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){var e=[t.r,t.g,t.b].map(function(t){return t/=255,.03928>=t?t/12.92:Math.pow((t+.055)/1.055,2.4)});return.2126*e[0]+.7152*e[1]+.0722*e[2]},e.exports=n["default"]},{}],27:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n,r){var o=e&&e.backgroundColor?e.backgroundColor:!1,i=new a["default"](t.width*n,t.height*n,r),u=i.getContext("2d");return o&&(u.fillStyle=o,u.fillRect(0,0,t.width*n,t.height*n),u.fillStyle="transparent"),{canvas:i,ctx:u}};var o=t("canvas-browserify"),a=r(o);e.exports=n["default"]},{"canvas-browserify":32}],28:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){return{x:.33333*(t.a.x+t.b.x+t.c.x),y:.33333*(t.a.y+t.b.y+t.c.y)}},e.exports=n["default"]},{}],29:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){var e=1,n=(0,a["default"])({width:e,height:e},{},1,!0).ctx;n.fillStyle=t,n.fillRect(0,0,e,e);var r=n.getImageData(0,0,e,e).data;return{r:r[0],g:r[1],b:r[2],a:r[3]/255}};var o=t("./makeCanvasAndContext"),a=r(o);e.exports=n["default"]},{"./makeCanvasAndContext":27}],30:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};n["default"]=function(t){var e=r({a:1},t);return"rgba("+e.r+", "+e.g+", "+e.b+", "+e.a+")"},e.exports=n["default"]},{}],31:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.addEventListener("message",function(e){if(e.data.imageData&&e.data.params)try{var n=e.data.imageData;"undefined"==typeof n.width&&"number"==typeof e.data.imageDataWidth&&(n.width=e.data.imageDataWidth),"undefined"==typeof n.height&&"number"==typeof e.data.imageDataHeight&&(n.height=e.data.imageDataHeight);var r=(0,i["default"])(e.data.imageData,e.data.params);t.postMessage({polygonJSONStr:JSON.stringify(r)})}catch(o){t.postMessage({err:o.message||o})}else e.data.imageData?t.postMessage({err:"Parameters are missing."}):t.postMessage({err:"ImageData is missing."});t.close()})}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=t("../polygons/imageDataToPolygons"),i=r(a);e.exports=n["default"]},{"../polygons/imageDataToPolygons":17}],32:[function(t,e,n){var r=e.exports=function(t,e){var n=document.createElement("canvas");return n.width=t||300,n.height=e||150,n};r.Image=function(){var t=document.createElement("img");return t}},{}],33:[function(t,e,n){function r(t,e,n){this.a=t,this.b=e,this.c=n;var r,o,a,i,u=e.x-t.x,f=e.y-t.y,l=n.x-t.x,s=n.y-t.y,c=u*(t.x+e.x)+f*(t.y+e.y),d=l*(t.x+n.x)+s*(t.y+n.y),p=2*(u*(n.y-e.y)-f*(n.x-e.x));Math.abs(p)<1e-6?(r=Math.min(t.x,e.x,n.x),o=Math.min(t.y,e.y,n.y),a=.5*(Math.max(t.x,e.x,n.x)-r),i=.5*(Math.max(t.y,e.y,n.y)-o),this.x=r+a,this.y=o+i,this.r=a*a+i*i):(this.x=(s*c-f*d)/p,this.y=(u*d-l*c)/p,a=this.x-t.x,i=this.y-t.y,this.r=a*a+i*i)}function o(t,e){return e.x-t.x}function a(t){var e,n,r,o,a,i=t.length;t:for(;i;)for(n=t[--i],e=t[--i],r=i;r;)if(a=t[--r],o=t[--r],e===o&&n===a||e===a&&n===o){t.splice(i,2),t.splice(r,2),i-=2;continue t}}function i(t){if(t.length<3)return[];t.sort(o);for(var e=t.length-1,n=t[e].x,i=t[0].x,u=t[e].y,f=u;e--;)t[e].y<u&&(u=t[e].y),t[e].y>f&&(f=t[e].y);var l,s,c,d=i-n,p=f-u,g=d>p?d:p,h=.5*(i+n),y=.5*(f+u),v=[new r({x:h-20*g,y:y-g,__sentinel:!0},{x:h,y:y+20*g,__sentinel:!0},{x:h+20*g,y:y-g,__sentinel:!0})],m=[],b=[];for(e=t.length;e--;){for(b.length=0,l=v.length;l--;)d=t[e].x-v[l].x,d>0&&d*d>v[l].r?(m.push(v[l]),v.splice(l,1)):(p=t[e].y-v[l].y,d*d+p*p>v[l].r||(b.push(v[l].a,v[l].b,v[l].b,v[l].c,v[l].c,v[l].a),v.splice(l,1)));for(a(b),l=b.length;l;)c=b[--l],s=b[--l],v.push(new r(s,c,t[e]))}for(Array.prototype.push.apply(m,v),e=m.length;e--;)(m[e].a.__sentinel||m[e].b.__sentinel||m[e].c.__sentinel)&&m.splice(e,1);return m}r.prototype.draw=function(t){t.beginPath(),t.moveTo(this.a.x,this.a.y),t.lineTo(this.b.x,this.b.y),t.lineTo(this.c.x,this.c.y),t.closePath(),t.stroke()},"undefined"!=typeof e&&(e.exports={Triangle:r,triangulate:i})},{}],34:[function(e,n,r){(function(r,o){(function(){"use strict";function a(t){return"function"==typeof t||"object"==typeof t&&null!==t}function i(t){return"function"==typeof t}function u(t){return"object"==typeof t&&null!==t}function f(t){V=t}function l(t){Q=t}function s(){return function(){r.nextTick(h)}}function c(){return function(){q(h)}}function d(){var t=0,e=new $(h),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function p(){var t=new MessageChannel;return t.port1.onmessage=h,function(){t.port2.postMessage(0)}}function g(){return function(){setTimeout(h,1)}}function h(){for(var t=0;K>t;t+=2){var e=nt[t],n=nt[t+1];e(n),nt[t]=void 0,nt[t+1]=void 0}K=0}function y(){try{var t=e,n=t("vertx");return q=n.runOnLoop||n.runOnContext,c()}catch(r){return g()}}function v(){}function m(){return new TypeError("You cannot resolve a promise with itself")}function b(){return new TypeError("A promises callback cannot return that same promise.")}function x(t){try{return t.then}catch(e){return it.error=e,it}}function _(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function w(t,e,n){Q(function(t){var r=!1,o=_(n,e,function(n){r||(r=!0,e!==n?P(t,n):O(t,n))},function(e){r||(r=!0,D(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,D(t,o))},t)}function M(t,e){e._state===ot?O(t,e._result):e._state===at?D(t,e._result):j(e,void 0,function(e){P(t,e)},function(e){D(t,e)})}function C(t,e){if(e.constructor===t.constructor)M(t,e);else{var n=x(e);n===it?D(t,it.error):void 0===n?O(t,e):i(n)?w(t,e,n):O(t,e)}}function P(t,e){t===e?D(t,m()):a(e)?C(t,e):O(t,e)}function k(t){t._onerror&&t._onerror(t._result),S(t)}function O(t,e){t._state===rt&&(t._result=e,t._state=ot,0!==t._subscribers.length&&Q(S,t))}function D(t,e){t._state===rt&&(t._state=at,t._result=e,Q(k,t))}function j(t,e,n,r){var o=t._subscribers,a=o.length;t._onerror=null,o[a]=e,o[a+ot]=n,o[a+at]=r,0===a&&t._state&&Q(S,t)}function S(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r,o,a=t._result,i=0;i<e.length;i+=3)r=e[i],o=e[i+n],r?E(n,r,o,a):o(a);t._subscribers.length=0}}function I(){this.error=null}function T(t,e){try{return t(e)}catch(n){return ut.error=n,ut}}function E(t,e,n,r){var o,a,u,f,l=i(n);if(l){if(o=T(n,r),o===ut?(f=!0,a=o.error,o=null):u=!0,e===o)return void D(e,b())}else o=r,u=!0;e._state!==rt||(l&&u?P(e,o):f?D(e,a):t===ot?O(e,o):t===at&&D(e,o))}function A(t,e){try{e(function(e){P(t,e)},function(e){D(t,e)})}catch(n){D(t,n)}}function B(t,e){var n=this;n._instanceConstructor=t,n.promise=new t(v),n._validateInput(e)?(n._input=e,n.length=e.length,n._remaining=e.length,n._init(),0===n.length?O(n.promise,n._result):(n.length=n.length||0,n._enumerate(),0===n._remaining&&O(n.promise,n._result))):D(n.promise,n._validationError())}function N(t){return new ft(this,t).promise}function W(t){function e(t){P(o,t)}function n(t){D(o,t)}var r=this,o=new r(v);if(!Y(t))return D(o,new TypeError("You must pass an array to race.")),o;for(var a=t.length,i=0;o._state===rt&&a>i;i++)j(r.resolve(t[i]),void 0,e,n);return o}function L(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(v);return P(n,t),n}function R(t){var e=this,n=new e(v);return D(n,t),n}function J(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function G(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this._id=pt++,this._state=void 0,this._result=void 0,this._subscribers=[],v!==t&&(i(t)||J(),this instanceof U||G(),A(this,t))}function F(){var t;if("undefined"!=typeof o)t=o;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;(!n||"[object Promise]"!==Object.prototype.toString.call(n.resolve())||n.cast)&&(t.Promise=gt)}var H;H=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var q,V,z,Y=H,K=0,Q=({}.toString,function(t,e){nt[K]=t,nt[K+1]=e,K+=2,2===K&&(V?V(h):z())}),X="undefined"!=typeof window?window:void 0,Z=X||{},$=Z.MutationObserver||Z.WebKitMutationObserver,tt="undefined"!=typeof r&&"[object process]"==={}.toString.call(r),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,nt=new Array(1e3);z=tt?s():$?d():et?p():void 0===X&&"function"==typeof e?y():g();var rt=void 0,ot=1,at=2,it=new I,ut=new I;B.prototype._validateInput=function(t){return Y(t)},B.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},B.prototype._init=function(){this._result=new Array(this.length)};var ft=B;B.prototype._enumerate=function(){for(var t=this,e=t.length,n=t.promise,r=t._input,o=0;n._state===rt&&e>o;o++)t._eachEntry(r[o],o)},B.prototype._eachEntry=function(t,e){var n=this,r=n._instanceConstructor;u(t)?t.constructor===r&&t._state!==rt?(t._onerror=null,n._settledAt(t._state,e,t._result)):n._willSettleAt(r.resolve(t),e):(n._remaining--,n._result[e]=t)},B.prototype._settledAt=function(t,e,n){var r=this,o=r.promise;o._state===rt&&(r._remaining--,t===at?D(o,n):r._result[e]=n),0===r._remaining&&O(o,r._result)},B.prototype._willSettleAt=function(t,e){var n=this;j(t,void 0,function(t){n._settledAt(ot,e,t)},function(t){n._settledAt(at,e,t)})};var lt=N,st=W,ct=L,dt=R,pt=0,gt=U;U.all=lt,U.race=st,U.resolve=ct,U.reject=dt,U._setScheduler=f,U._setAsap=l,U._asap=Q,U.prototype={constructor:U,then:function(t,e){var n=this,r=n._state;if(r===ot&&!t||r===at&&!e)return this;var o=new this.constructor(v),a=n._result;if(r){var i=arguments[r-1];Q(function(){E(r,o,i,a)})}else j(n,o,t,e);return o},"catch":function(t){return this.then(null,t)}};var ht=F,yt={Promise:gt,polyfill:ht};"function"==typeof t&&t.amd?t(function(){return yt}):"undefined"!=typeof n&&n.exports?n.exports=yt:"undefined"!=typeof this&&(this.ES6Promise=yt),ht()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:35}],35:[function(t,e,n){function r(){s=!1,u.length?l=u.concat(l):c=-1,l.length&&o()}function o(){if(!s){var t=setTimeout(r);s=!0;for(var e=l.length;e;){for(u=l,l=[];++c<e;)u&&u[c].run();c=-1,e=l.length}u=null,s=!1,clearTimeout(t)}}function a(t,e){this.fun=t,this.array=e}function i(){}var u,f=e.exports={},l=[],s=!1,c=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new a(t,e)),1!==l.length||s||setTimeout(o,0)},a.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=i,f.addListener=i,f.once=i,f.off=i,f.removeListener=i,f.removeAllListeners=i,f.emit=i,f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],36:[function(e,n,r){!function(e){"use strict";function o(t){function e(t){return function(e,n,r){return r=r||0,t[4*(a*n+e)+r]}}if(!(this instanceof o))return new o(t);var n,r,a=t.width,i=t.height,u=[[-1,0,1],[-2,0,2],[-1,0,1]],f=[[-1,-2,-1],[0,0,0],[1,2,1]],l=[],s=[],c=t.data,d=e(c);for(r=0;i>r;r++)for(n=0;a>n;n++){var p=d(n,r,0),g=d(n,r,1),h=d(n,r,2),y=(p+g+h)/3;s.push(y,y,y,255)}for(d=e(s),r=0;i>r;r++)for(n=0;a>n;n++){var v=u[0][0]*d(n-1,r-1)+u[0][1]*d(n,r-1)+u[0][2]*d(n+1,r-1)+u[1][0]*d(n-1,r)+u[1][1]*d(n,r)+u[1][2]*d(n+1,r)+u[2][0]*d(n-1,r+1)+u[2][1]*d(n,r+1)+u[2][2]*d(n+1,r+1),m=f[0][0]*d(n-1,r-1)+f[0][1]*d(n,r-1)+f[0][2]*d(n+1,r-1)+f[1][0]*d(n-1,r)+f[1][1]*d(n,r)+f[1][2]*d(n+1,r)+f[2][0]*d(n-1,r+1)+f[2][1]*d(n,r+1)+f[2][2]*d(n+1,r+1),b=Math.sqrt(v*v+m*m)>>>0;l.push(b,b,b,255)}var x=l;return"function"==typeof Uint8ClampedArray&&(x=new Uint8ClampedArray(l)),x.toImageData=function(){return o.toImageData(x,a,i)},x}function a(t,e,n){return{width:e,height:n,data:t}}o.toImageData=function(t,e,n){if("function"==typeof ImageData&&"[object Uint16Array]"===Object.prototype.toString.call(t))return new ImageData(t,e,n);if("object"==typeof window&&"object"==typeof window.document){var r=document.createElement("canvas");if("function"==typeof r.getContext){var o=r.getContext("2d"),i=o.createImageData(e,n); | ||
return i.data.set(t),i}return new a(t,e,n)}return new a(t,e,n)},"undefined"!=typeof r?("undefined"!=typeof n&&n.exports&&(r=n.exports=o),r.Sobel=o):"function"==typeof t&&t.amd?t([],function(){return o}):e.Sobel=o}(this)},{}],37:[function(t,e,n){function r(t,e,n,r){if("string"==typeof t)var t=document.getElementById(t);else if(!t instanceof HTMLImageElement)return;var o=t.naturalWidth,i=t.naturalHeight;if("string"==typeof e)var e=document.getElementById(e);else if(!e instanceof HTMLCanvasElement)return;e.style.width=o+"px",e.style.height=i+"px",e.width=o,e.height=i;var f=e.getContext("2d");f.clearRect(0,0,o,i),f.drawImage(t,0,0),isNaN(n)||1>n||(r?a(e,0,0,o,i,n):u(e,0,0,o,i,n))}function o(t,e,n,r,o){if("string"==typeof t)var t=document.getElementById(t);else if(!t instanceof HTMLCanvasElement)return;var a,i=t.getContext("2d");try{try{a=i.getImageData(e,n,r,o)}catch(u){throw new Error("unable to access local image data: "+u)}}catch(u){throw new Error("unable to access image data: "+u)}return a}function a(t,e,n,r,a,u){if(!(isNaN(u)||1>u)){u|=0;var f=o(t,e,n,r,a);f=i(f,e,n,r,a,u),t.getContext("2d").putImageData(f,e,n)}}function i(t,e,n,r,o,a){var i,u,f,d,p,g,h,y,v,m,b,x,_,w,M,C,P,k,O,D,j,S,I,T,E=t.data,A=a+a+1,B=r-1,N=o-1,W=a+1,L=W*(W+1)/2,R=new l,J=R;for(f=1;A>f;f++)if(J=J.next=new l,f==W)var G=J;J.next=R;var U=null,F=null;h=g=0;var H=s[a],q=c[a];for(u=0;o>u;u++){for(C=P=k=O=y=v=m=b=0,x=W*(D=E[g]),_=W*(j=E[g+1]),w=W*(S=E[g+2]),M=W*(I=E[g+3]),y+=L*D,v+=L*j,m+=L*S,b+=L*I,J=R,f=0;W>f;f++)J.r=D,J.g=j,J.b=S,J.a=I,J=J.next;for(f=1;W>f;f++)d=g+((f>B?B:f)<<2),y+=(J.r=D=E[d])*(T=W-f),v+=(J.g=j=E[d+1])*T,m+=(J.b=S=E[d+2])*T,b+=(J.a=I=E[d+3])*T,C+=D,P+=j,k+=S,O+=I,J=J.next;for(U=R,F=G,i=0;r>i;i++)E[g+3]=I=b*H>>q,0!=I?(I=255/I,E[g]=(y*H>>q)*I,E[g+1]=(v*H>>q)*I,E[g+2]=(m*H>>q)*I):E[g]=E[g+1]=E[g+2]=0,y-=x,v-=_,m-=w,b-=M,x-=U.r,_-=U.g,w-=U.b,M-=U.a,d=h+((d=i+a+1)<B?d:B)<<2,C+=U.r=E[d],P+=U.g=E[d+1],k+=U.b=E[d+2],O+=U.a=E[d+3],y+=C,v+=P,m+=k,b+=O,U=U.next,x+=D=F.r,_+=j=F.g,w+=S=F.b,M+=I=F.a,C-=D,P-=j,k-=S,O-=I,F=F.next,g+=4;h+=r}for(i=0;r>i;i++){for(P=k=O=C=v=m=b=y=0,g=i<<2,x=W*(D=E[g]),_=W*(j=E[g+1]),w=W*(S=E[g+2]),M=W*(I=E[g+3]),y+=L*D,v+=L*j,m+=L*S,b+=L*I,J=R,f=0;W>f;f++)J.r=D,J.g=j,J.b=S,J.a=I,J=J.next;for(p=r,f=1;a>=f;f++)g=p+i<<2,y+=(J.r=D=E[g])*(T=W-f),v+=(J.g=j=E[g+1])*T,m+=(J.b=S=E[g+2])*T,b+=(J.a=I=E[g+3])*T,C+=D,P+=j,k+=S,O+=I,J=J.next,N>f&&(p+=r);for(g=i,U=R,F=G,u=0;o>u;u++)d=g<<2,E[d+3]=I=b*H>>q,I>0?(I=255/I,E[d]=(y*H>>q)*I,E[d+1]=(v*H>>q)*I,E[d+2]=(m*H>>q)*I):E[d]=E[d+1]=E[d+2]=0,y-=x,v-=_,m-=w,b-=M,x-=U.r,_-=U.g,w-=U.b,M-=U.a,d=i+((d=u+W)<N?d:N)*r<<2,y+=C+=U.r=E[d],v+=P+=U.g=E[d+1],m+=k+=U.b=E[d+2],b+=O+=U.a=E[d+3],U=U.next,x+=D=F.r,_+=j=F.g,w+=S=F.b,M+=I=F.a,C-=D,P-=j,k-=S,O-=I,F=F.next,g+=r}return t}function u(t,e,n,r,a,i){if(!(isNaN(i)||1>i)){i|=0;var u=o(t,e,n,r,a);u=f(u,e,n,r,a,i),t.getContext("2d").putImageData(u,e,n)}}function f(t,e,n,r,o,a){var i,u,f,d,p,g,h,y,v,m,b,x,_,w,M,C,P,k,O,D,j=t.data,S=a+a+1,I=r-1,T=o-1,E=a+1,A=E*(E+1)/2,B=new l,N=B;for(f=1;S>f;f++)if(N=N.next=new l,f==E)var W=N;N.next=B;var L=null,R=null;h=g=0;var J=s[a],G=c[a];for(u=0;o>u;u++){for(w=M=C=y=v=m=0,b=E*(P=j[g]),x=E*(k=j[g+1]),_=E*(O=j[g+2]),y+=A*P,v+=A*k,m+=A*O,N=B,f=0;E>f;f++)N.r=P,N.g=k,N.b=O,N=N.next;for(f=1;E>f;f++)d=g+((f>I?I:f)<<2),y+=(N.r=P=j[d])*(D=E-f),v+=(N.g=k=j[d+1])*D,m+=(N.b=O=j[d+2])*D,w+=P,M+=k,C+=O,N=N.next;for(L=B,R=W,i=0;r>i;i++)j[g]=y*J>>G,j[g+1]=v*J>>G,j[g+2]=m*J>>G,y-=b,v-=x,m-=_,b-=L.r,x-=L.g,_-=L.b,d=h+((d=i+a+1)<I?d:I)<<2,w+=L.r=j[d],M+=L.g=j[d+1],C+=L.b=j[d+2],y+=w,v+=M,m+=C,L=L.next,b+=P=R.r,x+=k=R.g,_+=O=R.b,w-=P,M-=k,C-=O,R=R.next,g+=4;h+=r}for(i=0;r>i;i++){for(M=C=w=v=m=y=0,g=i<<2,b=E*(P=j[g]),x=E*(k=j[g+1]),_=E*(O=j[g+2]),y+=A*P,v+=A*k,m+=A*O,N=B,f=0;E>f;f++)N.r=P,N.g=k,N.b=O,N=N.next;for(p=r,f=1;a>=f;f++)g=p+i<<2,y+=(N.r=P=j[g])*(D=E-f),v+=(N.g=k=j[g+1])*D,m+=(N.b=O=j[g+2])*D,w+=P,M+=k,C+=O,N=N.next,T>f&&(p+=r);for(g=i,L=B,R=W,u=0;o>u;u++)d=g<<2,j[d]=y*J>>G,j[d+1]=v*J>>G,j[d+2]=m*J>>G,y-=b,v-=x,m-=_,b-=L.r,x-=L.g,_-=L.b,d=i+((d=u+E)<T?d:T)*r<<2,y+=w+=L.r=j[d],v+=M+=L.g=j[d+1],m+=C+=L.b=j[d+2],L=L.next,b+=P=R.r,x+=k=R.g,_+=O=R.b,w-=P,M-=k,C-=O,R=R.next,g+=r}return t}function l(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var s=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],c=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];e.exports={image:r,canvasRGBA:a,canvasRGB:u,imageDataRGBA:i,imageDataRGB:f}},{}],38:[function(t,e,n){var r=arguments[3],o=arguments[4],a=arguments[5],i=JSON.stringify;e.exports=function(t){for(var e,n=Object.keys(a),u=0,f=n.length;f>u;u++){var l=n[u],s=a[l].exports;if(s===t||s["default"]===t){e=l;break}}if(!e){e=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var c={},u=0,f=n.length;f>u;u++){var l=n[u];c[l]=l}o[e]=[Function(["require","module","exports"],"("+t+")(self)"),c]}var d=Math.floor(Math.pow(16,8)*Math.random()).toString(16),p={};p[e]=e,o[d]=[Function(["require"],"var f = require("+i(e)+");(f.default ? f.default : f)(self);"),p];var g="("+r+")({"+Object.keys(o).map(function(t){return i(t)+":["+o[t][0]+","+i(o[t][1])+"]"}).join(",")+"},{},["+i(d)+"])",h=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(h.createObjectURL(new Blob([g],{type:"text/javascript"})))}},{}]},{},[1])(1)}); | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.triangulate=t()}}(function(){var t;return function t(e,n,r){function o(i,u){if(!n[i]){if(!e[i]){var f="function"==typeof require&&require;if(!u&&f)return f(i,!0);if(a)return a(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var l=n[i]={exports:{}};e[i][0].call(l.exports,function(t){var n=e[i][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var o=t("es6-promise"),a=t("./browser"),i=r(a);(0,o.polyfill)(),n.default=i.default,e.exports=n.default},{"./browser":2,"es6-promise":34}],2:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};n.default=function(t){function e(){return t}function n(){var t=o({},W);return B||o(t,L),t}function r(){var t=o({},W);return N||o(t,R),t}function a(t){return P(f.default,t)}function u(t){return P(f.default,t,!0)}function s(t){return P(function(t){return t},t)}function c(t){return P(function(t){return t},t,!0)}function h(t){return k(function(t){return t},t)}function g(t){return k(function(t){return t},t,!0)}function v(t){return k(d.default,t)}function b(t){return k(d.default,t,!0)}function w(t){return k(l.default,t)}function _(t){return k(l.default,t,!0)}function M(t){return k(p.default,t)}function C(t){return k(p.default,t,!0)}function P(t,e,n){return I=!!n,B=function(){return I?t(e):new Promise(function(n,r){try{var o=t(e);n(o)}catch(t){r(t)}})},O()?D():r()}function k(t,e,r){return E=!!r,N=function(n,r){return E?t(n,r,e):new Promise(function(o,a){try{var i=t(n,r,e);o(i)}catch(t){a(t)}})},O()?D():n()}function O(){return B&&N}function D(){if(I&&E){var e=B(t),n=(0,y.default)(e,t),r=N(n,e);return r}return new Promise(function(e,n){var r;j().then(function(e){return r=e,S(r,t)},n).then(function(t){return T(t,r)},n).then(function(t){e(t)},n)})}function j(t){return new Promise(function(e,n){if(I)try{var r=B(t);e(r)}catch(t){n(t)}else B(t).then(e,n)})}function S(t,e){return new Promise(function(n,r){A.addEventListener("message",function(t){if(t.data&&t.data.polygonJSONStr){var e=JSON.parse(t.data.polygonJSONStr);n(e)}else r(t.data&&t.data.err?t.data.err:t)}),A.postMessage({params:e,imageData:t,imageDataWidth:t.width,imageDataHeight:t.height})})}function T(t,e){return new Promise(function(n,r){if(E)try{var o=N(t,e);n(o)}catch(t){r(t)}else N(t,e).then(n,r)})}t=(0,i.default)(t);var I=!1,E=!1,A=(0,m.default)(x.default),B=void 0,N=void 0,W={getParams:e,getInput:n,getOutput:r},L={fromImage:a,fromImageSync:u,fromImageData:s,fromImageDataSync:c},R={toData:h,toDataSync:g,toDataURL:v,toDataURLSync:b,toImageData:w,toImageDataSync:_,toSVG:M,toSVGSync:C};return n()};var a=t("./input/sanitizeInput"),i=r(a),u=t("./input/browser/fromImageToImageData"),f=r(u),s=t("./output/polygonsToImageData"),l=r(s),c=t("./output/polygonsToDataURL"),d=r(c),h=t("./output/polygonsToSVG"),p=r(h),g=t("./polygons/imageDataToPolygons"),y=r(g),v=t("webworkify"),m=r(v),b=t("./workers/triangulationWorker"),x=r(b);e.exports=n.default},{"./input/browser/fromImageToImageData":5,"./input/sanitizeInput":7,"./output/polygonsToDataURL":8,"./output/polygonsToImageData":9,"./output/polygonsToSVG":10,"./polygons/imageDataToPolygons":17,"./workers/triangulationWorker":31,webworkify:38}],3:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){var e=(0,i.default)(t.width,t.height),n=e.getContext("2d");return n.putImageData(t,0,0),n.getImageData(0,0,t.width,t.height)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){if((0,f.default)(t)){if("undefined"==typeof Uint8ClampedArray){if("undefined"==typeof window)throw new Error("Can't copy imageData in webworker without Uint8ClampedArray support.");return o(t)}var e=new Uint8ClampedArray(t.data);if("undefined"==typeof ImageData)return{width:t.width,height:t.height,data:e};var n=void 0;try{n=new ImageData(e,t.width,t.height)}catch(e){if("undefined"==typeof window)throw new Error("Can't copy imageData in webworker without proper ImageData() support.");n=o(t)}return n}throw new Error("Given imageData object is not useable.")};var a=t("canvas-browserify"),i=r(a),u=t("../util/isImageData"),f=r(u);e.exports=n.default},{"../util/isImageData":24,"canvas-browserify":32}],4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){for(var e=t.data.length,n=void 0,r=0;r<e;r+=4)n=.34*t.data[r]+.5*t.data[r+1]+.16*t.data[r+2],t.data[r]=n,t.data[r+1]=n,t.data[r+2]=n;return t},e.exports=n.default},{}],5:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){if(t instanceof HTMLImageElement){if(!t.naturalWidth||!t.naturalHeight||t.complete===!1)throw new Error("This this image hasn't finished loading: "+t.src);var e=new a.default(t.naturalWidth,t.naturalHeight),n=e.getContext("2d");n.drawImage(t,0,0,e.width,e.height);var r=n.getImageData(0,0,e.width,e.height);return r.data&&r.data.length&&("undefined"==typeof r.width&&(r.width=t.naturalWidth),"undefined"==typeof r.height&&(r.height=t.naturalHeight)),r}throw new Error("This object does not seem to be an image.")};var o=t("canvas-browserify"),a=r(o);a.default.Image;e.exports=n.default},{"canvas-browserify":32}],6:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default={accuracy:.7,blur:4,fill:!0,stroke:!0,strokeWidth:.5,lineJoin:"miter",vertexCount:700,threshold:50,transparentColor:!1},e.exports=n.default},{}],7:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};n.default=function(t){return t=(0,f.default)(t),"object"!==("undefined"==typeof t?"undefined":o(t))&&(t={}),"number"!=typeof t.accuracy||isNaN(t.accuracy)?t.accuracy=d.default.accuracy:t.accuracy=(0,i.default)(t.accuracy,0,1),("number"!=typeof t.blur||isNaN(t.blur))&&(t.blur=d.default.blur),t.blur<=0&&(t.blur=1),"string"!=typeof t.fill&&"boolean"!=typeof t.fill&&(t.fill=d.default.fill),"string"!=typeof t.stroke&&"boolean"!=typeof t.stroke&&(t.stroke=d.default.stroke),("number"!=typeof t.strokeWidth||isNaN(t.strokeWidth))&&(t.strokeWidth=d.default.strokeWidth),"number"!=typeof t.threshold||isNaN(t.threshold)?t.threshold=d.default.threshold:t.threshold=(0,i.default)(t.threshold,1,100),"string"==typeof t.lineJoin&&h.indexOf(t.lineJoin)!==-1||(t.lineJoin=d.default.lineJoin),t.gradients&&t.fill?t.gradients=!0:t.gradients=!1,t.gradients&&(("number"!=typeof t.gradientStops||isNaN(t.gradientStops)||t.gradientStops<2)&&(t.gradientStops=2),t.gradientStops=Math.round(t.gradientStops)),("number"!=typeof t.vertexCount||isNaN(t.vertexCount))&&(t.vertexCount=d.default.vertexCount),t.vertexCount<=0&&(t.vertexCount=1),"string"!=typeof t.transparentColor&&"boolean"!=typeof t.transparentColor&&(t.transparentColor=d.default.transparentColor),typeof t.transparentColor===!0&&(t.transparentColor=!1),"string"==typeof t.transparentColor&&(t.transparentColor=(0,l.default)(t.transparentColor)),t};var a=t("../util/clamp"),i=r(a),u=t("../util/clone"),f=r(u),s=t("../util/toColor"),l=r(s),c=t("./defaultParams"),d=r(c),h=["miter","round","bevel"];e.exports=n.default},{"../util/clamp":18,"../util/clone":19,"../util/toColor":29,"./defaultParams":6}],8:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){var r=n&&n.dpr?n.dpr:1,o=(0,a.default)(e,n,r);return(0,u.default)(o.ctx,t,e,r),o.canvas.toDataURL()};var o=t("../util/makeCanvasAndContext"),a=r(o),i=t("../util/drawPolygonsOnContext"),u=r(i);e.exports=n.default},{"../util/drawPolygonsOnContext":21,"../util/makeCanvasAndContext":27}],9:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){var r=n&&n.dpr?n.dpr:1,o=(0,a.default)(e,n,r,!0).ctx;return(0,u.default)(o,t,e,r),o.getImageData(0,0,e.width*r,e.height*r)};var o=t("../util/makeCanvasAndContext"),a=r(o),i=t("../util/drawPolygonsOnContext"),u=r(i);e.exports=n.default},{"../util/drawPolygonsOnContext":21,"../util/makeCanvasAndContext":27}],10:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){var n="";t.length&&t[0].gradient&&(n="<defs>");var r="";t.forEach(function(t,e){var o=t.a,i=t.b,u=t.c;r+='<polygon points="'+o.x+","+o.y+" "+i.x+","+i.y+" "+u.x+","+u.y+'"',t.gradient?!function(){var o=t.boundingBox,i=((t.gradient.x1-o.x)/o.width*100).toFixed(3),u=((t.gradient.y1-o.y)/o.height*100).toFixed(3),f=((t.gradient.x2-o.x)/o.width*100).toFixed(3),s=((t.gradient.y2-o.y)/o.height*100).toFixed(3);n+='\n\t<linearGradient id="gradient-'+e+'" x1="'+i+'%" y1="'+u+'%" x2="'+f+'%" y2="'+s+'%">';var l=t.gradient.colors.length-1;t.gradient.colors.forEach(function(t,e){var r=(0,a.default)(t),o=(e/l*100).toFixed(3);n+='\n\t\t\t\t\t<stop offset="'+o+'%" stop-color="'+r+'"/>\n\t\t\t\t'}),n+="</linearGradient>",r+=' fill="url(#gradient-'+e+')"',t.strokeWidth>0&&(r+=' stroke="url(#gradient-'+e+')" stroke-width="'+t.strokeWidth+'" stroke-linejoin="'+t.lineJoin+'"')}():(r+=t.fill?' fill="'+t.fill+'"':' fill="transparent"',t.strokeColor&&(r+=' stroke="'+t.strokeColor+'" stroke-width="'+t.strokeWidth+'" stroke-linejoin="'+t.lineJoin+'"')),r+="/>\n\t"}),n.length&&(n+="\n\t\t</defs>");var o='<?xml version="1.0" standalone="yes"?>\n<svg width="'+e.width+'" height="'+e.height+'" xmlns="http://www.w3.org/2000/svg" version="1.1" >\n\t'+n+"\n\t"+r+"\n</svg>";return o};var o=t("../util/toRGBA"),a=r(o);e.exports=n.default},{"../util/toRGBA":30}],11:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){return t.forEach(function(t){t.boundingBox=(0,a.default)([t.a,t.b,t.c])}),t.filter(function(t){return t.boundingBox.width>0&&t.boundingBox.height>0})};var o=t("../util/getBoundingBox"),a=r(o);e.exports=n.default},{"../util/getBoundingBox":22}],12:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){var r=n.fill,o=n.stroke,i=n.strokeWidth,f=n.lineJoin,l=n.transparentColor,d="string"==typeof r&&r,h="string"==typeof o&&o,p=function(t,e){var n=(0,s.default)(t)&&l,r=n?l:t;return e&&!n?e:(0,c.default)(r)};return t.forEach(function(t,n){var s=(0,a.default)((0,u.default)(t),e);r&&(t.fill=p(s,d)),o&&(t.strokeColor=p(s,h),t.strokeWidth=i,t.lineJoin=f)}),t};var o=t("../util/getColorByPos"),a=r(o),i=t("../util/polygonCenter"),u=r(i),f=t("../util/isTransparent"),s=r(f),l=t("../util/toRGBA"),c=r(l);e.exports=n.default},{"../util/getColorByPos":23,"../util/isTransparent":25,"../util/polygonCenter":28,"../util/toRGBA":30}],13:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){return t.forEach(function(t,r){var o={};"abc".split("").forEach(function(r){var i=(0,s.default)(t[r],e,n.transparentColor);o[r]={key:r,color:i,x:t[r].x,y:t[r].y},o[r].luminance=(0,a.default)(o[r].color);var u="abc".replace(r,"").split("");o[r].median={x:(t[u[0]].x+t[u[1]].x)/2,y:(t[u[0]].y+t[u[1]].y)/2},o[r].medianColor=(0,s.default)(o[r].median,e,n.transparentColor),o[r].medianLuminance=(0,a.default)(o[r].medianColor)});for(var i=[o.a,o.b,o.c].sort(function(t,e){return Math.abs(t.luminance-t.medianLuminance)-Math.abs(e.luminance-e.medianLuminance)}),f=i[0],l=i[0],c=f.median,d=[l],h=(0,u.default)(l,c),p=1,g=n.gradientStops-2;p<g;p++){var y=p*(h/n.gradientStops),v=y/h,m={x:l.x+v*(c.x-l.x),y:l.y+v*(c.y-l.y)};d.push(m)}d.push(c),t.gradient={x1:f.x,y1:f.y,x2:f.median.x,y2:f.median.y,colors:d.map(function(t){return(0,s.default)(t,e,n.transparentColor)})},n.stroke&&(t.strokeWidth=n.strokeWidth,t.lineJoin=n.lineJoin),o=null}),t};var o=t("../util/luminance"),a=r(o),i=t("../util/distance"),u=r(i),f=t("../util/getColorByPos"),s=r(f);e.exports=n.default},{"../util/distance":20,"../util/getColorByPos":23,"../util/luminance":26}],14:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){return t.filter(function(t){var n=(0,a.default)((0,u.default)(t),e);return!(0,s.default)(n)})};var o=t("../util/getColorByPos"),a=r(o),i=t("../util/polygonCenter"),u=r(i),f=t("../util/isTransparent"),s=r(f);e.exports=n.default},{"../util/getColorByPos":23,"../util/isTransparent":25,"../util/polygonCenter":28}],15:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){var n,r,o,a,i,u,f,s,l,c=2,d=t.width,h=t.height,p=t.data,g=[];for(r=0;r<h;r+=c)for(n=0;n<d;n+=c){for(s=l=0,o=-1;o<=1;o++)if(u=r+o,f=u*d,u>=0&&u<h)for(a=-1;a<=1;a++)i=n+a,i>=0&&i<d&&(s+=p[i+f<<2],l++);l&&(s/=l),s>e&&g.push({x:n,y:r})}return g},e.exports=n.default},{}],16:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){var r=t+"|"+e;n[r]||(n[r]={x:t,y:e}),r=null}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n,r,a){var i={},u=Math.max(~~(e*(1-n)),5),f=Math.round(Math.sqrt(u)),s=Math.round(Math.ceil(u/f)),l=~~(r/f),c=~~(a/s),d=0,h=0,p=0,g=0;for(g=0;g<a;g+=c)for(d++,h=d%2===0?~~(l/2):0,p=h;p<r;p+=l)p<r&&g<a&&o(~~(p+Math.cos(g)*c),~~(g+Math.sin(p)*l),i);o(0,0,i),o(r-1,0,i),o(r-1,a-1,i),o(0,a-1,i);var y=e-Object.keys(i).length,v=t.length,m=~~(v/y);if(e>0&&m>0){var b=0;for(b=0;b<v;b+=m)o(t[b].x,t[b].y,i)}return t=null,Object.keys(i).map(function(t){return i[t]})};var a=t("../util/clamp");r(a);e.exports=n.default},{"../util/clamp":18}],17:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){if((0,s.default)(t)){var n={width:t.width,height:t.height},r=(0,c.default)(t),i=(0,c.default)(t),f=(0,o.imageDataRGBA)(r,0,0,n.width,n.height,e.blur),l=(0,h.default)(f),d=(0,u.default)(l).toImageData(),p=(0,g.default)(d,e.threshold),y=(0,v.default)(p,e.vertexCount,e.accuracy,n.width,n.height),m=(0,a.triangulate)(y);return m=(0,b.default)(m),e.transparentColor||(m=(0,P.default)(m,i)),m=e.fill===!0&&e.gradients===!0?(0,M.default)(m,i,e):(0,w.default)(m,i,e)}throw new Error("Can't work with the imageData provided. It seems to be corrupt.")};var o=t("stackblur-canvas"),a=t("delaunay-fast"),i=t("sobel"),u=r(i),f=t("../util/isImageData"),s=r(f),l=t("../imagedata/copyImageData"),c=r(l),d=t("../imagedata/greyscale"),h=r(d),p=t("./getEdgePoints"),g=r(p),y=t("./getVerticesFromPoints"),v=r(y),m=t("./addBoundingBoxesToPolygons"),b=r(m),x=t("./addColorToPolygons"),w=r(x),_=t("./addGradientsToPolygons"),M=r(_),C=t("./filterTransparentPolygons"),P=r(C);e.exports=n.default},{"../imagedata/copyImageData":3,"../imagedata/greyscale":4,"../util/isImageData":24,"./addBoundingBoxesToPolygons":11,"./addColorToPolygons":12,"./addGradientsToPolygons":13,"./filterTransparentPolygons":14,"./getEdgePoints":15,"./getVerticesFromPoints":16,"delaunay-fast":33,sobel:36,"stackblur-canvas":37}],18:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){return t<e?e:t>n?n:t},e.exports=n.default},{}],19:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e=!1;if("undefined"!=typeof t)try{e=JSON.parse(JSON.stringify(t))}catch(t){}return e},e.exports=n.default},{}],20:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)},e.exports=n.default},{}],21:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n,r){return r=r||1,e.forEach(function(e,n){t.beginPath(),t.moveTo(e.a.x*r,e.a.y*r),t.lineTo(e.b.x*r,e.b.y*r),t.lineTo(e.c.x*r,e.c.y*r),t.lineTo(e.a.x*r,e.a.y*r),e.gradient?!function(){var n=t.createLinearGradient(e.gradient.x1*r,e.gradient.y1*r,e.gradient.x2*r,e.gradient.y2*r),o=e.gradient.colors.length-1;e.gradient.colors.forEach(function(t,e){var r=(0,a.default)(t);n.addColorStop(e/o,r)}),t.fillStyle=n,t.fill(),e.strokeWidth>0&&(t.strokeStyle=n,t.lineWidth=e.strokeWidth*r,t.lineJoin=e.lineJoin,t.stroke())}():(e.fill&&(t.fillStyle=e.fill,t.fill()),e.strokeColor&&(t.strokeStyle=e.strokeColor,t.lineWidth=e.strokeWidth*r,t.lineJoin=e.lineJoin,t.stroke())),t.closePath()}),t};var o=t("./toRGBA"),a=r(o);e.exports=n.default},{"./toRGBA":30}],22:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e=1/0,n=-(1/0),r=1/0,o=-(1/0);return t.forEach(function(t){t.x<e&&(e=t.x),t.y<r&&(r=t.y),t.x>n&&(n=t.x),t.y>o&&(o=t.y)}),{x:e,y:r,width:n-e,height:o-r}},e.exports=n.default},{}],23:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){var r=(0,i.default)(t.x,1,e.width-2),o=(0,i.default)(t.y,1,e.height-2),a=(0|r)+(0|o)*e.width<<2;a>=e.data.length&&(a=e.data.length-5);var u=e.data[a+3]/255;return n&&0===u?n:{r:e.data[a],g:e.data[a+1],b:e.data[a+2],a:u}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=o;var a=t("./clamp"),i=r(a);e.exports=n.default},{"./clamp":18}],24:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};n.default=function(t){return t&&"number"==typeof t.width&&"number"==typeof t.height&&t.data&&"number"==typeof t.data.length&&"object"===r(t.data)},e.exports=n.default},{}],25:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){return 0===t.a},e.exports=n.default},{}],26:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e=[t.r,t.g,t.b].map(function(t){return t/=255,t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return.2126*e[0]+.7152*e[1]+.0722*e[2]},e.exports=n.default},{}],27:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n,r){var o=!(!e||!e.backgroundColor)&&e.backgroundColor,i=new a.default(t.width*n,t.height*n,r),u=i.getContext("2d");return o&&(u.fillStyle=o,u.fillRect(0,0,t.width*n,t.height*n),u.fillStyle="transparent"),{canvas:i,ctx:u}};var o=t("canvas-browserify"),a=r(o);e.exports=n.default},{"canvas-browserify":32}],28:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){return{x:.33333*(t.a.x+t.b.x+t.c.x),y:.33333*(t.a.y+t.b.y+t.c.y)}},e.exports=n.default},{}],29:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e=1,n=(0,a.default)({width:e,height:e},{},1,!0).ctx;n.fillStyle=t,n.fillRect(0,0,e,e);var r=n.getImageData(0,0,e,e).data;return{r:r[0],g:r[1],b:r[2],a:r[3]/255}};var o=t("./makeCanvasAndContext"),a=r(o);e.exports=n.default},{"./makeCanvasAndContext":27}],30:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};n.default=function(t){var e=r({a:1},t);return"rgba("+e.r+", "+e.g+", "+e.b+", "+e.a+")"},e.exports=n.default},{}],31:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){t.addEventListener("message",function(e){if(e.data.imageData&&e.data.params)try{var n=e.data.imageData;"undefined"==typeof n.width&&"number"==typeof e.data.imageDataWidth&&(n.width=e.data.imageDataWidth),"undefined"==typeof n.height&&"number"==typeof e.data.imageDataHeight&&(n.height=e.data.imageDataHeight);var r=(0,i.default)(e.data.imageData,e.data.params);t.postMessage({polygonJSONStr:JSON.stringify(r)})}catch(e){t.postMessage({err:e.message||e})}else e.data.imageData?t.postMessage({err:"Parameters are missing."}):t.postMessage({err:"ImageData is missing."});t.close()})}Object.defineProperty(n,"__esModule",{value:!0}),n.default=o;var a=t("../polygons/imageDataToPolygons"),i=r(a);e.exports=n.default},{"../polygons/imageDataToPolygons":17}],32:[function(t,e,n){var r=e.exports=function(t,e){var n=document.createElement("canvas");return n.width=t||300,n.height=e||150,n};r.Image=function(){var t=document.createElement("img");return t}},{}],33:[function(t,e,n){function r(t,e,n){this.a=t,this.b=e,this.c=n;var r,o,a,i,u=e.x-t.x,f=e.y-t.y,s=n.x-t.x,l=n.y-t.y,c=u*(t.x+e.x)+f*(t.y+e.y),d=s*(t.x+n.x)+l*(t.y+n.y),h=2*(u*(n.y-e.y)-f*(n.x-e.x));Math.abs(h)<1e-6?(r=Math.min(t.x,e.x,n.x),o=Math.min(t.y,e.y,n.y),a=.5*(Math.max(t.x,e.x,n.x)-r),i=.5*(Math.max(t.y,e.y,n.y)-o),this.x=r+a,this.y=o+i,this.r=a*a+i*i):(this.x=(l*c-f*d)/h,this.y=(u*d-s*c)/h,a=this.x-t.x,i=this.y-t.y,this.r=a*a+i*i)}function o(t,e){return e.x-t.x}function a(t){var e,n,r,o,a,i=t.length;t:for(;i;)for(n=t[--i],e=t[--i],r=i;r;)if(a=t[--r],o=t[--r],e===o&&n===a||e===a&&n===o){t.splice(i,2),t.splice(r,2),i-=2;continue t}}function i(t){if(t.length<3)return[];t.sort(o);for(var e=t.length-1,n=t[e].x,i=t[0].x,u=t[e].y,f=u;e--;)t[e].y<u&&(u=t[e].y),t[e].y>f&&(f=t[e].y);var s,l,c,d=i-n,h=f-u,p=d>h?d:h,g=.5*(i+n),y=.5*(f+u),v=[new r({x:g-20*p,y:y-p,__sentinel:!0},{x:g,y:y+20*p,__sentinel:!0},{x:g+20*p,y:y-p,__sentinel:!0})],m=[],b=[];for(e=t.length;e--;){for(b.length=0,s=v.length;s--;)d=t[e].x-v[s].x,d>0&&d*d>v[s].r?(m.push(v[s]),v.splice(s,1)):(h=t[e].y-v[s].y,d*d+h*h>v[s].r||(b.push(v[s].a,v[s].b,v[s].b,v[s].c,v[s].c,v[s].a),v.splice(s,1)));for(a(b),s=b.length;s;)c=b[--s],l=b[--s],v.push(new r(l,c,t[e]))}for(Array.prototype.push.apply(m,v),e=m.length;e--;)(m[e].a.__sentinel||m[e].b.__sentinel||m[e].c.__sentinel)&&m.splice(e,1);return m}r.prototype.draw=function(t){t.beginPath(),t.moveTo(this.a.x,this.a.y),t.lineTo(this.b.x,this.b.y),t.lineTo(this.c.x,this.c.y),t.closePath(),t.stroke()},"undefined"!=typeof e&&(e.exports={Triangle:r,triangulate:i})},{}],34:[function(e,n,r){(function(o,a){!function(e,o){"object"==typeof r&&"undefined"!=typeof n?n.exports=o():"function"==typeof t&&t.amd?t(o):e.ES6Promise=o()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function n(t){return"function"==typeof t}function r(t){K=t}function i(t){Q=t}function u(){return function(){return o.nextTick(d)}}function f(){return function(){Y(d)}}function s(){var t=0,e=new $(d),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function l(){var t=new MessageChannel;return t.port1.onmessage=d,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(d,1)}}function d(){for(var t=0;t<z;t+=2){var e=nt[t],n=nt[t+1];e(n),nt[t]=void 0,nt[t+1]=void 0}z=0}function h(){try{var t=e,n=t("vertx");return Y=n.runOnLoop||n.runOnContext,f()}catch(t){return c()}}function p(t,e){var n=arguments,r=this,o=new this.constructor(y);void 0===o[ot]&&B(o);var a=r._state;return a?!function(){var t=n[a-1];Q(function(){return I(a,o,t,r._result)})}():D(r,o,t,e),o}function g(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(y);return C(n,t),n}function y(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function m(){return new TypeError("A promises callback cannot return that same promise.")}function b(t){try{return t.then}catch(t){return ft.error=t,ft}}function x(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}function w(t,e,n){Q(function(t){var r=!1,o=x(n,e,function(n){r||(r=!0,e!==n?C(t,n):k(t,n))},function(e){r||(r=!0,O(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,O(t,o))},t)}function _(t,e){e._state===it?k(t,e._result):e._state===ut?O(t,e._result):D(e,void 0,function(e){return C(t,e)},function(e){return O(t,e)})}function M(t,e,r){e.constructor===t.constructor&&r===p&&e.constructor.resolve===g?_(t,e):r===ft?O(t,ft.error):void 0===r?k(t,e):n(r)?w(t,e,r):k(t,e)}function C(e,n){e===n?O(e,v()):t(n)?M(e,n,b(n)):k(e,n)}function P(t){t._onerror&&t._onerror(t._result),j(t)}function k(t,e){t._state===at&&(t._result=e,t._state=it,0!==t._subscribers.length&&Q(j,t))}function O(t,e){t._state===at&&(t._state=ut,t._result=e,Q(P,t))}function D(t,e,n,r){var o=t._subscribers,a=o.length;t._onerror=null,o[a]=e,o[a+it]=n,o[a+ut]=r,0===a&&t._state&&Q(j,t)}function j(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,a=t._result,i=0;i<e.length;i+=3)r=e[i],o=e[i+n],r?I(n,r,o,a):o(a);t._subscribers.length=0}}function S(){this.error=null}function T(t,e){try{return t(e)}catch(t){return st.error=t,st}}function I(t,e,r,o){var a=n(r),i=void 0,u=void 0,f=void 0,s=void 0;if(a){if(i=T(r,o),i===st?(s=!0,u=i.error,i=null):f=!0,e===i)return void O(e,m())}else i=o,f=!0;e._state!==at||(a&&f?C(e,i):s?O(e,u):t===it?k(e,i):t===ut&&O(e,i))}function E(t,e){try{e(function(e){C(t,e)},function(e){O(t,e)})}catch(e){O(t,e)}}function A(){return lt++}function B(t){t[ot]=lt++,t._state=void 0,t._result=void 0,t._subscribers=[]}function N(t,e){this._instanceConstructor=t,this.promise=new t(y),this.promise[ot]||B(this.promise),V(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?k(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&k(this.promise,this._result))):O(this.promise,W())}function W(){return new Error("Array Methods must be provided an Array")}function L(t){return new N(this,t).promise}function R(t){var e=this;return new e(V(t)?function(n,r){for(var o=t.length,a=0;a<o;a++)e.resolve(t[a]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function J(t){var e=this,n=new e(y);return O(n,t),n}function G(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function U(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function F(t){this[ot]=A(),this._result=this._state=void 0,this._subscribers=[],y!==t&&("function"!=typeof t&&G(),this instanceof F?E(this,t):U())}function H(){var t=void 0;if("undefined"!=typeof a)t=a;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=F}var q=void 0;q=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var V=q,z=0,Y=void 0,K=void 0,Q=function(t,e){nt[z]=t,nt[z+1]=e,z+=2,2===z&&(K?K(d):rt())},X="undefined"!=typeof window?window:void 0,Z=X||{},$=Z.MutationObserver||Z.WebKitMutationObserver,tt="undefined"==typeof self&&"undefined"!=typeof o&&"[object process]"==={}.toString.call(o),et="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,nt=new Array(1e3),rt=void 0;rt=tt?u():$?s():et?l():void 0===X&&"function"==typeof e?h():c();var ot=Math.random().toString(36).substring(16),at=void 0,it=1,ut=2,ft=new S,st=new S,lt=0;return N.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===at&&n<t;n++)this._eachEntry(e[n],n)},N.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===g){var o=b(t);if(o===p&&t._state!==at)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===F){var a=new n(y);M(a,t,o),this._willSettleAt(a,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},N.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===at&&(this._remaining--,t===ut?O(r,n):this._result[e]=n),0===this._remaining&&k(r,this._result)},N.prototype._willSettleAt=function(t,e){var n=this;D(t,void 0,function(t){return n._settledAt(it,e,t)},function(t){return n._settledAt(ut,e,t)})},F.all=L,F.race=R,F.resolve=g,F.reject=J,F._setScheduler=r,F._setAsap=i,F._asap=Q,F.prototype={constructor:F,then:p,catch:function(t){return this.then(null,t)}},F.polyfill=H,F.Promise=F,F})}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:35}],35:[function(t,e,n){function r(){l=!1,u.length?s=u.concat(s):c=-1,s.length&&o()}function o(){if(!l){var t=setTimeout(r);l=!0;for(var e=s.length;e;){for(u=s,s=[];++c<e;)u&&u[c].run();c=-1,e=s.length}u=null,l=!1,clearTimeout(t)}}function a(t,e){this.fun=t,this.array=e}function i(){}var u,f=e.exports={},s=[],l=!1,c=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new a(t,e)),1!==s.length||l||setTimeout(o,0)},a.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=i,f.addListener=i,f.once=i,f.off=i,f.removeListener=i,f.removeAllListeners=i,f.emit=i,f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},{}],36:[function(e,n,r){!function(e){"use strict";function o(t){function e(t){return function(e,n,r){return r=r||0,t[4*(a*n+e)+r]}}if(!(this instanceof o))return new o(t);var n,r,a=t.width,i=t.height,u=[[-1,0,1],[-2,0,2],[-1,0,1]],f=[[-1,-2,-1],[0,0,0],[1,2,1]],s=[],l=[],c=t.data,d=e(c);for(r=0;r<i;r++)for(n=0;n<a;n++){var h=d(n,r,0),p=d(n,r,1),g=d(n,r,2),y=(h+p+g)/3;l.push(y,y,y,255)}for(d=e(l),r=0;r<i;r++)for(n=0;n<a;n++){var v=u[0][0]*d(n-1,r-1)+u[0][1]*d(n,r-1)+u[0][2]*d(n+1,r-1)+u[1][0]*d(n-1,r)+u[1][1]*d(n,r)+u[1][2]*d(n+1,r)+u[2][0]*d(n-1,r+1)+u[2][1]*d(n,r+1)+u[2][2]*d(n+1,r+1),m=f[0][0]*d(n-1,r-1)+f[0][1]*d(n,r-1)+f[0][2]*d(n+1,r-1)+f[1][0]*d(n-1,r)+f[1][1]*d(n,r)+f[1][2]*d(n+1,r)+f[2][0]*d(n-1,r+1)+f[2][1]*d(n,r+1)+f[2][2]*d(n+1,r+1),b=Math.sqrt(v*v+m*m)>>>0;s.push(b,b,b,255)}var x=s;return"function"==typeof Uint8ClampedArray&&(x=new Uint8ClampedArray(s)),x.toImageData=function(){return o.toImageData(x,a,i)},x}function a(t,e,n){return{width:e,height:n,data:t}}o.toImageData=function(t,e,n){if("function"==typeof ImageData&&"[object Uint16Array]"===Object.prototype.toString.call(t))return new ImageData(t,e,n);if("object"==typeof window&&"object"==typeof window.document){var r=document.createElement("canvas");if("function"==typeof r.getContext){var o=r.getContext("2d"),i=o.createImageData(e,n);return i.data.set(t),i}return new a(t,e,n)}return new a(t,e,n)},"undefined"!=typeof r?("undefined"!=typeof n&&n.exports&&(r=n.exports=o),r.Sobel=o):"function"==typeof t&&t.amd?t([],function(){ | ||
return o}):e.Sobel=o}(this)},{}],37:[function(t,e,n){function r(t,e,n,r){if("string"==typeof t)var t=document.getElementById(t);else if(!t instanceof HTMLImageElement)return;var o=t.naturalWidth,i=t.naturalHeight;if("string"==typeof e)var e=document.getElementById(e);else if(!e instanceof HTMLCanvasElement)return;e.style.width=o+"px",e.style.height=i+"px",e.width=o,e.height=i;var f=e.getContext("2d");f.clearRect(0,0,o,i),f.drawImage(t,0,0),isNaN(n)||n<1||(r?a(e,0,0,o,i,n):u(e,0,0,o,i,n))}function o(t,e,n,r,o){if("string"==typeof t)var t=document.getElementById(t);else if(!t instanceof HTMLCanvasElement)return;var a,i=t.getContext("2d");try{try{a=i.getImageData(e,n,r,o)}catch(t){throw new Error("unable to access local image data: "+t)}}catch(t){throw new Error("unable to access image data: "+t)}return a}function a(t,e,n,r,a,u){if(!(isNaN(u)||u<1)){u|=0;var f=o(t,e,n,r,a);f=i(f,e,n,r,a,u),t.getContext("2d").putImageData(f,e,n)}}function i(t,e,n,r,o,a){var i,u,f,d,h,p,g,y,v,m,b,x,w,_,M,C,P,k,O,D,j,S,T,I,E=t.data,A=a+a+1,B=r-1,N=o-1,W=a+1,L=W*(W+1)/2,R=new s,J=R;for(f=1;f<A;f++)if(J=J.next=new s,f==W)var G=J;J.next=R;var U=null,F=null;g=p=0;var H=l[a],q=c[a];for(u=0;u<o;u++){for(C=P=k=O=y=v=m=b=0,x=W*(D=E[p]),w=W*(j=E[p+1]),_=W*(S=E[p+2]),M=W*(T=E[p+3]),y+=L*D,v+=L*j,m+=L*S,b+=L*T,J=R,f=0;f<W;f++)J.r=D,J.g=j,J.b=S,J.a=T,J=J.next;for(f=1;f<W;f++)d=p+((B<f?B:f)<<2),y+=(J.r=D=E[d])*(I=W-f),v+=(J.g=j=E[d+1])*I,m+=(J.b=S=E[d+2])*I,b+=(J.a=T=E[d+3])*I,C+=D,P+=j,k+=S,O+=T,J=J.next;for(U=R,F=G,i=0;i<r;i++)E[p+3]=T=b*H>>q,0!=T?(T=255/T,E[p]=(y*H>>q)*T,E[p+1]=(v*H>>q)*T,E[p+2]=(m*H>>q)*T):E[p]=E[p+1]=E[p+2]=0,y-=x,v-=w,m-=_,b-=M,x-=U.r,w-=U.g,_-=U.b,M-=U.a,d=g+((d=i+a+1)<B?d:B)<<2,C+=U.r=E[d],P+=U.g=E[d+1],k+=U.b=E[d+2],O+=U.a=E[d+3],y+=C,v+=P,m+=k,b+=O,U=U.next,x+=D=F.r,w+=j=F.g,_+=S=F.b,M+=T=F.a,C-=D,P-=j,k-=S,O-=T,F=F.next,p+=4;g+=r}for(i=0;i<r;i++){for(P=k=O=C=v=m=b=y=0,p=i<<2,x=W*(D=E[p]),w=W*(j=E[p+1]),_=W*(S=E[p+2]),M=W*(T=E[p+3]),y+=L*D,v+=L*j,m+=L*S,b+=L*T,J=R,f=0;f<W;f++)J.r=D,J.g=j,J.b=S,J.a=T,J=J.next;for(h=r,f=1;f<=a;f++)p=h+i<<2,y+=(J.r=D=E[p])*(I=W-f),v+=(J.g=j=E[p+1])*I,m+=(J.b=S=E[p+2])*I,b+=(J.a=T=E[p+3])*I,C+=D,P+=j,k+=S,O+=T,J=J.next,f<N&&(h+=r);for(p=i,U=R,F=G,u=0;u<o;u++)d=p<<2,E[d+3]=T=b*H>>q,T>0?(T=255/T,E[d]=(y*H>>q)*T,E[d+1]=(v*H>>q)*T,E[d+2]=(m*H>>q)*T):E[d]=E[d+1]=E[d+2]=0,y-=x,v-=w,m-=_,b-=M,x-=U.r,w-=U.g,_-=U.b,M-=U.a,d=i+((d=u+W)<N?d:N)*r<<2,y+=C+=U.r=E[d],v+=P+=U.g=E[d+1],m+=k+=U.b=E[d+2],b+=O+=U.a=E[d+3],U=U.next,x+=D=F.r,w+=j=F.g,_+=S=F.b,M+=T=F.a,C-=D,P-=j,k-=S,O-=T,F=F.next,p+=r}return t}function u(t,e,n,r,a,i){if(!(isNaN(i)||i<1)){i|=0;var u=o(t,e,n,r,a);u=f(u,e,n,r,a,i),t.getContext("2d").putImageData(u,e,n)}}function f(t,e,n,r,o,a){var i,u,f,d,h,p,g,y,v,m,b,x,w,_,M,C,P,k,O,D,j=t.data,S=a+a+1,T=r-1,I=o-1,E=a+1,A=E*(E+1)/2,B=new s,N=B;for(f=1;f<S;f++)if(N=N.next=new s,f==E)var W=N;N.next=B;var L=null,R=null;g=p=0;var J=l[a],G=c[a];for(u=0;u<o;u++){for(_=M=C=y=v=m=0,b=E*(P=j[p]),x=E*(k=j[p+1]),w=E*(O=j[p+2]),y+=A*P,v+=A*k,m+=A*O,N=B,f=0;f<E;f++)N.r=P,N.g=k,N.b=O,N=N.next;for(f=1;f<E;f++)d=p+((T<f?T:f)<<2),y+=(N.r=P=j[d])*(D=E-f),v+=(N.g=k=j[d+1])*D,m+=(N.b=O=j[d+2])*D,_+=P,M+=k,C+=O,N=N.next;for(L=B,R=W,i=0;i<r;i++)j[p]=y*J>>G,j[p+1]=v*J>>G,j[p+2]=m*J>>G,y-=b,v-=x,m-=w,b-=L.r,x-=L.g,w-=L.b,d=g+((d=i+a+1)<T?d:T)<<2,_+=L.r=j[d],M+=L.g=j[d+1],C+=L.b=j[d+2],y+=_,v+=M,m+=C,L=L.next,b+=P=R.r,x+=k=R.g,w+=O=R.b,_-=P,M-=k,C-=O,R=R.next,p+=4;g+=r}for(i=0;i<r;i++){for(M=C=_=v=m=y=0,p=i<<2,b=E*(P=j[p]),x=E*(k=j[p+1]),w=E*(O=j[p+2]),y+=A*P,v+=A*k,m+=A*O,N=B,f=0;f<E;f++)N.r=P,N.g=k,N.b=O,N=N.next;for(h=r,f=1;f<=a;f++)p=h+i<<2,y+=(N.r=P=j[p])*(D=E-f),v+=(N.g=k=j[p+1])*D,m+=(N.b=O=j[p+2])*D,_+=P,M+=k,C+=O,N=N.next,f<I&&(h+=r);for(p=i,L=B,R=W,u=0;u<o;u++)d=p<<2,j[d]=y*J>>G,j[d+1]=v*J>>G,j[d+2]=m*J>>G,y-=b,v-=x,m-=w,b-=L.r,x-=L.g,w-=L.b,d=i+((d=u+E)<I?d:I)*r<<2,y+=_+=L.r=j[d],v+=M+=L.g=j[d+1],m+=C+=L.b=j[d+2],L=L.next,b+=P=R.r,x+=k=R.g,w+=O=R.b,_-=P,M-=k,C-=O,R=R.next,p+=r}return t}function s(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var l=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],c=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];e.exports={image:r,canvasRGBA:a,canvasRGB:u,imageDataRGBA:i,imageDataRGB:f}},{}],38:[function(t,e,n){var r=arguments[3],o=arguments[4],a=arguments[5],i=JSON.stringify;e.exports=function(t){for(var e,n=Object.keys(a),u=0,f=n.length;u<f;u++){var s=n[u],l=a[s].exports;if(l===t||l.default===t){e=s;break}}if(!e){e=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var c={},u=0,f=n.length;u<f;u++){var s=n[u];c[s]=s}o[e]=[Function(["require","module","exports"],"("+t+")(self)"),c]}var d=Math.floor(Math.pow(16,8)*Math.random()).toString(16),h={};h[e]=e,o[d]=[Function(["require"],"var f = require("+i(e)+");(f.default ? f.default : f)(self);"),h];var p="("+r+")({"+Object.keys(o).map(function(t){return i(t)+":["+o[t][0]+","+i(o[t][1])+"]"}).join(",")+"},{},["+i(d)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(g.createObjectURL(new Blob([p],{type:"text/javascript"})))}},{}]},{},[1])(1)}); |
@@ -1,1 +0,1 @@ | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.triangulate=t()}}(function(){var t;return function e(t,n,r){function a(i,u){if(!n[i]){if(!t[i]){var l="function"==typeof require&&require;if(!u&&l)return l(i,!0);if(o)return o(i,!0);var f=new Error("Cannot find module '"+i+"'");throw f.code="MODULE_NOT_FOUND",f}var d=n[i]={exports:{}};t[i][0].call(d.exports,function(e){var n=t[i][1][e];return a(n?n:e)},d,d.exports,e,t,n,r)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;i<r.length;i++)a(r[i]);return a}({1:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};n["default"]=function(t){function e(){return t}function n(){var t=a({},R);return N||a(t,J),t}function r(){var t=a({},R);return W||a(t,A),t}function o(t){return P(l["default"],t)}function u(t){return P(l["default"],t,!0)}function f(t){return P(function(t){return t},t)}function s(t){return P(function(t){return t},t,!0)}function g(t){return k(function(t){return t},t)}function p(t){return k(function(t){return t},t,!0)}function m(t){return k(c["default"],t)}function x(t){return k(c["default"],t,!0)}function w(t){return k(d["default"],t)}function _(t){return k(d["default"],t,!0)}function C(t){return k(y["default"],t)}function M(t){return k(y["default"],t,!0)}function P(t,e,n){return T=!!n,N=function(){return T?t(e):new Promise(function(n,r){try{var a=t(e);n(a)}catch(o){r(o)}})},D()?O():r()}function k(t,e,r){return B=!!r,W=function(n,r){return B?t(n,r,e):new Promise(function(a,o){try{var i=t(n,r,e);a(i)}catch(u){o(u)}})},D()?O():n()}function D(){return N&&W}function O(){if(T&&B){var e=N(t),n=(0,h["default"])(e,t),r=W(n,e);return r}return new Promise(function(e,n){var r;j().then(function(e){return r=e,I(r,t)},n).then(function(t){return S(t,r)},n).then(function(t){e(t)},n)})}function j(t){return new Promise(function(e,n){if(T)try{var r=N(t);e(r)}catch(a){n(a)}else N(t).then(e,n)})}function I(t,e){return new Promise(function(n,r){E.addEventListener("message",function(t){if(t.data&&t.data.polygonJSONStr){var e=JSON.parse(t.data.polygonJSONStr);n(e)}else r(t.data&&t.data.err?t.data.err:t)}),E.postMessage({params:e,imageData:t,imageDataWidth:t.width,imageDataHeight:t.height})})}function S(t,e){return new Promise(function(n,r){if(B)try{var a=W(t,e);n(a)}catch(o){r(o)}else W(t,e).then(n,r)})}t=(0,i["default"])(t);var T=!1,B=!1,E=(0,v["default"])(b["default"]),N=void 0,W=void 0,R={getParams:e,getInput:n,getOutput:r},J={fromImage:o,fromImageSync:u,fromImageData:f,fromImageDataSync:s},A={toData:g,toDataSync:p,toDataURL:m,toDataURLSync:x,toImageData:w,toImageDataSync:_,toSVG:C,toSVGSync:M};return n()};var o=t("./input/sanitizeInput"),i=r(o),u=t("./input/browser/fromImageToImageData"),l=r(u),f=t("./output/polygonsToImageData"),d=r(f),s=t("./output/polygonsToDataURL"),c=r(s),g=t("./output/polygonsToSVG"),y=r(g),p=t("./polygons/imageDataToPolygons"),h=r(p),m=t("webworkify"),v=r(m),x=t("./workers/triangulationWorker"),b=r(x);e.exports=n["default"]},{"./input/browser/fromImageToImageData":4,"./input/sanitizeInput":6,"./output/polygonsToDataURL":7,"./output/polygonsToImageData":8,"./output/polygonsToSVG":9,"./polygons/imageDataToPolygons":16,"./workers/triangulationWorker":30,webworkify:35}],2:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t){var e=(0,i["default"])(t.width,t.height),n=e.getContext("2d");return n.putImageData(t,0,0),n.getImageData(0,0,t.width,t.height)}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){if((0,l["default"])(t)){if("undefined"==typeof Uint8ClampedArray){if("undefined"==typeof window)throw new Error("Can't copy imageData in webworker without Uint8ClampedArray support.");return a(t)}var e=new Uint8ClampedArray(t.data);if("undefined"==typeof ImageData)return{width:t.width,height:t.height,data:e};var n=void 0;try{n=new ImageData(e,t.width,t.height)}catch(r){if("undefined"==typeof window)throw new Error("Can't copy imageData in webworker without proper ImageData() support.");n=a(t)}return n}throw new Error("Given imageData object is not useable.")};var o=t("canvas-browserify"),i=r(o),u=t("../util/isImageData"),l=r(u);e.exports=n["default"]},{"../util/isImageData":23,"canvas-browserify":31}],3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){for(var e=t.data.length,n=void 0,r=0;e>r;r+=4)n=.34*t.data[r]+.5*t.data[r+1]+.16*t.data[r+2],t.data[r]=n,t.data[r+1]=n,t.data[r+2]=n;return t},e.exports=n["default"]},{}],4:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){if(t instanceof HTMLImageElement){if(!t.naturalWidth||!t.naturalHeight||t.complete===!1)throw new Error("This this image hasn't finished loading: "+t.src);var e=new o["default"](t.naturalWidth,t.naturalHeight),n=e.getContext("2d");n.drawImage(t,0,0,e.width,e.height);var r=n.getImageData(0,0,e.width,e.height);return r.data&&r.data.length&&("undefined"==typeof r.width&&(r.width=t.naturalWidth),"undefined"==typeof r.height&&(r.height=t.naturalHeight)),r}throw new Error("This object does not seem to be an image.")};var a=t("canvas-browserify"),o=r(a);o["default"].Image;e.exports=n["default"]},{"canvas-browserify":31}],5:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]={accuracy:.7,blur:4,fill:!0,stroke:!0,strokeWidth:.5,lineJoin:"miter",vertexCount:700,threshold:50,transparentColor:!1},e.exports=n["default"]},{}],6:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};n["default"]=function(t){return t=(0,l["default"])(t),"object"!==("undefined"==typeof t?"undefined":a(t))&&(t={}),"number"!=typeof t.accuracy||isNaN(t.accuracy)?t.accuracy=c["default"].accuracy:t.accuracy=(0,i["default"])(t.accuracy,0,1),("number"!=typeof t.blur||isNaN(t.blur))&&(t.blur=c["default"].blur),t.blur<=0&&(t.blur=1),"string"!=typeof t.fill&&"boolean"!=typeof t.fill&&(t.fill=c["default"].fill),"string"!=typeof t.stroke&&"boolean"!=typeof t.stroke&&(t.stroke=c["default"].stroke),("number"!=typeof t.strokeWidth||isNaN(t.strokeWidth))&&(t.strokeWidth=c["default"].strokeWidth),"number"!=typeof t.threshold||isNaN(t.threshold)?t.threshold=c["default"].threshold:t.threshold=(0,i["default"])(t.threshold,1,100),("string"!=typeof t.lineJoin||-1===g.indexOf(t.lineJoin))&&(t.lineJoin=c["default"].lineJoin),t.gradients&&t.fill?t.gradients=!0:t.gradients=!1,t.gradients&&(("number"!=typeof t.gradientStops||isNaN(t.gradientStops)||t.gradientStops<2)&&(t.gradientStops=2),t.gradientStops=Math.round(t.gradientStops)),("number"!=typeof t.vertexCount||isNaN(t.vertexCount))&&(t.vertexCount=c["default"].vertexCount),t.vertexCount<=0&&(t.vertexCount=1),"string"!=typeof t.transparentColor&&"boolean"!=typeof t.transparentColor&&(t.transparentColor=c["default"].transparentColor),typeof t.transparentColor===!0&&(t.transparentColor=!1),"string"==typeof t.transparentColor&&(t.transparentColor=(0,d["default"])(t.transparentColor)),t};var o=t("../util/clamp"),i=r(o),u=t("../util/clone"),l=r(u),f=t("../util/toColor"),d=r(f),s=t("./defaultParams"),c=r(s),g=["miter","round","bevel"];e.exports=n["default"]},{"../util/clamp":17,"../util/clone":18,"../util/toColor":28,"./defaultParams":5}],7:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){var r=n&&n.dpr?n.dpr:1,a=(0,o["default"])(e,n,r);return(0,u["default"])(a.ctx,t,e,r),a.canvas.toDataURL()};var a=t("../util/makeCanvasAndContext"),o=r(a),i=t("../util/drawPolygonsOnContext"),u=r(i);e.exports=n["default"]},{"../util/drawPolygonsOnContext":20,"../util/makeCanvasAndContext":26}],8:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){var r=n&&n.dpr?n.dpr:1,a=(0,o["default"])(e,n,r,!0).ctx;return(0,u["default"])(a,t,e,r),a.getImageData(0,0,e.width*r,e.height*r)};var a=t("../util/makeCanvasAndContext"),o=r(a),i=t("../util/drawPolygonsOnContext"),u=r(i);e.exports=n["default"]},{"../util/drawPolygonsOnContext":20,"../util/makeCanvasAndContext":26}],9:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e){var n="";t.length&&t[0].gradient&&(n="<defs>");var r="";t.forEach(function(t,e){var a=t.a,i=t.b,u=t.c;r+='<polygon points="'+a.x+","+a.y+" "+i.x+","+i.y+" "+u.x+","+u.y+'"',t.gradient?!function(){var a=t.boundingBox,i=((t.gradient.x1-a.x)/a.width*100).toFixed(3),u=((t.gradient.y1-a.y)/a.height*100).toFixed(3),l=((t.gradient.x2-a.x)/a.width*100).toFixed(3),f=((t.gradient.y2-a.y)/a.height*100).toFixed(3);n+='\n <linearGradient id="gradient-'+e+'" x1="'+i+'%" y1="'+u+'%" x2="'+l+'%" y2="'+f+'%">';var d=t.gradient.colors.length-1;t.gradient.colors.forEach(function(t,e){var r=(0,o["default"])(t),a=(e/d*100).toFixed(3);n+='\n <stop offset="'+a+'%" stop-color="'+r+'"/>\n '}),n+="</linearGradient>",r+=' fill="url(#gradient-'+e+')"',t.strokeWidth>0&&(r+=' stroke="url(#gradient-'+e+')" stroke-width="'+t.strokeWidth+'" stroke-linejoin="'+t.lineJoin+'"')}():(r+=t.fill?' fill="'+t.fill+'"':' fill="transparent"',t.strokeColor&&(r+=' stroke="'+t.strokeColor+'" stroke-width="'+t.strokeWidth+'" stroke-linejoin="'+t.lineJoin+'"')),r+="/>\n "}),n.length&&(n+="\n </defs>");var a='<?xml version="1.0" standalone="yes"?>\n<svg width="'+e.width+'" height="'+e.height+'" xmlns="http://www.w3.org/2000/svg" version="1.1" >\n '+n+"\n "+r+"\n</svg>";return a};var a=t("../util/toRGBA"),o=r(a);e.exports=n["default"]},{"../util/toRGBA":29}],10:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){return t.forEach(function(t){t.boundingBox=(0,o["default"])([t.a,t.b,t.c])}),t.filter(function(t){return t.boundingBox.width>0&&t.boundingBox.height>0})};var a=t("../util/getBoundingBox"),o=r(a);e.exports=n["default"]},{"../util/getBoundingBox":21}],11:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){var r=n.fill,a=n.stroke,i=n.strokeWidth,l=n.lineJoin,d=n.transparentColor,c="string"==typeof r?r:!1,g="string"==typeof a?a:!1,y=function(t,e){var n=(0,f["default"])(t)&&d,r=n?d:t;return e&&!n?e:(0,s["default"])(r)};return t.forEach(function(t,n){var f=(0,o["default"])((0,u["default"])(t),e);r&&(t.fill=y(f,c)),a&&(t.strokeColor=y(f,g),t.strokeWidth=i,t.lineJoin=l)}),t};var a=t("../util/getColorByPos"),o=r(a),i=t("../util/polygonCenter"),u=r(i),l=t("../util/isTransparent"),f=r(l),d=t("../util/toRGBA"),s=r(d);e.exports=n["default"]},{"../util/getColorByPos":22,"../util/isTransparent":24,"../util/polygonCenter":27,"../util/toRGBA":29}],12:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){return t.forEach(function(t,r){var a={};"abc".split("").forEach(function(r){var i=(0,f["default"])(t[r],e,n.transparentColor);a[r]={key:r,color:i,x:t[r].x,y:t[r].y},a[r].luminance=(0,o["default"])(a[r].color);var u="abc".replace(r,"").split("");a[r].median={x:(t[u[0]].x+t[u[1]].x)/2,y:(t[u[0]].y+t[u[1]].y)/2},a[r].medianColor=(0,f["default"])(a[r].median,e,n.transparentColor),a[r].medianLuminance=(0,o["default"])(a[r].medianColor)});for(var i=[a.a,a.b,a.c].sort(function(t,e){return Math.abs(t.luminance-t.medianLuminance)-Math.abs(e.luminance-e.medianLuminance)}),l=i[0],d=i[0],s=l.median,c=[d],g=(0,u["default"])(d,s),y=1,p=n.gradientStops-2;p>y;y++){var h=y*(g/n.gradientStops),m=h/g,v={x:d.x+m*(s.x-d.x),y:d.y+m*(s.y-d.y)};c.push(v)}c.push(s),t.gradient={x1:l.x,y1:l.y,x2:l.median.x,y2:l.median.y,colors:c.map(function(t){return(0,f["default"])(t,e,n.transparentColor)})},n.stroke&&(t.strokeWidth=n.strokeWidth,t.lineJoin=n.lineJoin),a=null}),t};var a=t("../util/luminance"),o=r(a),i=t("../util/distance"),u=r(i),l=t("../util/getColorByPos"),f=r(l);e.exports=n["default"]},{"../util/distance":19,"../util/getColorByPos":22,"../util/luminance":25}],13:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e){return t.filter(function(t){var n=(0,o["default"])((0,u["default"])(t),e);return!(0,f["default"])(n)})};var a=t("../util/getColorByPos"),o=r(a),i=t("../util/polygonCenter"),u=r(i),l=t("../util/isTransparent"),f=r(l);e.exports=n["default"]},{"../util/getColorByPos":22,"../util/isTransparent":24,"../util/polygonCenter":27}],14:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e){var n,r,a,o,i,u,l,f,d,s=2,c=t.width,g=t.height,y=t.data,p=[];for(r=0;g>r;r+=s)for(n=0;c>n;n+=s){for(f=d=0,a=-1;1>=a;a++)if(u=r+a,l=u*c,u>=0&&g>u)for(o=-1;1>=o;o++)i=n+o,i>=0&&c>i&&(f+=y[i+l<<2],d++);d&&(f/=d),f>e&&p.push({x:n,y:r})}return p},e.exports=n["default"]},{}],15:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,e,n){var r=t+"|"+e;n[r]||(n[r]={x:t,y:e}),r=null}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n,r,o){var i={},u=Math.max(~~(e*(1-n)),5),l=Math.round(Math.sqrt(u)),f=Math.round(Math.ceil(u/l)),d=~~(r/l),s=~~(o/f),c=0,g=0,y=0,p=0;for(p=0;o>p;p+=s)for(c++,g=c%2===0?~~(d/2):0,y=g;r>y;y+=d)r>y&&o>p&&a(~~(y+Math.cos(p)*s),~~(p+Math.sin(y)*d),i);a(0,0,i),a(r-1,0,i),a(r-1,o-1,i),a(0,o-1,i);var h=e-Object.keys(i).length,m=t.length,v=~~(m/h);if(e>0&&v>0){var x=0;for(x=0;m>x;x+=v)a(t[x].x,t[x].y,i)}return t=null,Object.keys(i).map(function(t){return i[t]})};var o=t("../util/clamp");r(o);e.exports=n["default"]},{"../util/clamp":17}],16:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e){if((0,f["default"])(t)){var n={width:t.width,height:t.height},r=(0,s["default"])(t),i=(0,s["default"])(t),l=(0,a.imageDataRGBA)(r,0,0,n.width,n.height,e.blur),d=(0,g["default"])(l),c=(0,u["default"])(d).toImageData(),y=(0,p["default"])(c,e.threshold),h=(0,m["default"])(y,e.vertexCount,e.accuracy,n.width,n.height),v=(0,o.triangulate)(h);return v=(0,x["default"])(v),e.transparentColor||(v=(0,P["default"])(v,i)),v=e.fill===!0&&e.gradients===!0?(0,C["default"])(v,i,e):(0,w["default"])(v,i,e)}throw new Error("Can't work with the imageData provided. It seems to be corrupt.")};var a=t("stackblur-canvas"),o=t("delaunay-fast"),i=t("sobel"),u=r(i),l=t("../util/isImageData"),f=r(l),d=t("../imagedata/copyImageData"),s=r(d),c=t("../imagedata/greyscale"),g=r(c),y=t("./getEdgePoints"),p=r(y),h=t("./getVerticesFromPoints"),m=r(h),v=t("./addBoundingBoxesToPolygons"),x=r(v),b=t("./addColorToPolygons"),w=r(b),_=t("./addGradientsToPolygons"),C=r(_),M=t("./filterTransparentPolygons"),P=r(M);e.exports=n["default"]},{"../imagedata/copyImageData":2,"../imagedata/greyscale":3,"../util/isImageData":23,"./addBoundingBoxesToPolygons":10,"./addColorToPolygons":11,"./addGradientsToPolygons":12,"./filterTransparentPolygons":13,"./getEdgePoints":14,"./getVerticesFromPoints":15,"delaunay-fast":32,sobel:33,"stackblur-canvas":34}],17:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n){return e>t?e:t>n?n:t},e.exports=n["default"]},{}],18:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){var e=!1;if("undefined"!=typeof t)try{e=JSON.parse(JSON.stringify(t))}catch(n){}return e},e.exports=n["default"]},{}],19:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)},e.exports=n["default"]},{}],20:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n,r){return r=r||1,e.forEach(function(e,n){t.beginPath(),t.moveTo(e.a.x*r,e.a.y*r),t.lineTo(e.b.x*r,e.b.y*r),t.lineTo(e.c.x*r,e.c.y*r),t.lineTo(e.a.x*r,e.a.y*r),e.gradient?!function(){var n=t.createLinearGradient(e.gradient.x1*r,e.gradient.y1*r,e.gradient.x2*r,e.gradient.y2*r),a=e.gradient.colors.length-1;e.gradient.colors.forEach(function(t,e){var r=(0,o["default"])(t);n.addColorStop(e/a,r)}),t.fillStyle=n,t.fill(),e.strokeWidth>0&&(t.strokeStyle=n,t.lineWidth=e.strokeWidth*r,t.lineJoin=e.lineJoin,t.stroke())}():(e.fill&&(t.fillStyle=e.fill,t.fill()),e.strokeColor&&(t.strokeStyle=e.strokeColor,t.lineWidth=e.strokeWidth*r,t.lineJoin=e.lineJoin,t.stroke())),t.closePath()}),t};var a=t("./toRGBA"),o=r(a);e.exports=n["default"]},{"./toRGBA":29}],21:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){var e=1/0,n=-(1/0),r=1/0,a=-(1/0);return t.forEach(function(t){t.x<e&&(e=t.x),t.y<r&&(r=t.y),t.x>n&&(n=t.x),t.y>a&&(a=t.y)}),{x:e,y:r,width:n-e,height:a-r}},e.exports=n["default"]},{}],22:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t,e,n){var r=(0,i["default"])(t.x,1,e.width-2),a=(0,i["default"])(t.y,1,e.height-2),o=(0|r)+(0|a)*e.width<<2;o>=e.data.length&&(o=e.data.length-5);var u=e.data[o+3]/255;return n&&0===u?n:{r:e.data[o],g:e.data[o+1],b:e.data[o+2],a:u}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=a;var o=t("./clamp"),i=r(o);e.exports=n["default"]},{"./clamp":17}],23:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};n["default"]=function(t){return t&&"number"==typeof t.width&&"number"==typeof t.height&&t.data&&"number"==typeof t.data.length&&"object"===r(t.data)},e.exports=n["default"]},{}],24:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){return 0===t.a},e.exports=n["default"]},{}],25:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){var e=[t.r,t.g,t.b].map(function(t){return t/=255,.03928>=t?t/12.92:Math.pow((t+.055)/1.055,2.4)});return.2126*e[0]+.7152*e[1]+.0722*e[2]},e.exports=n["default"]},{}],26:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t,e,n,r){var a=e&&e.backgroundColor?e.backgroundColor:!1,i=new o["default"](t.width*n,t.height*n,r),u=i.getContext("2d");return a&&(u.fillStyle=a,u.fillRect(0,0,t.width*n,t.height*n),u.fillStyle="transparent"),{canvas:i,ctx:u}};var a=t("canvas-browserify"),o=r(a);e.exports=n["default"]},{"canvas-browserify":31}],27:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){return{x:.33333*(t.a.x+t.b.x+t.c.x),y:.33333*(t.a.y+t.b.y+t.c.y)}},e.exports=n["default"]},{}],28:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=function(t){var e=1,n=(0,o["default"])({width:e,height:e},{},1,!0).ctx;n.fillStyle=t,n.fillRect(0,0,e,e);var r=n.getImageData(0,0,e,e).data;return{r:r[0],g:r[1],b:r[2],a:r[3]/255}};var a=t("./makeCanvasAndContext"),o=r(a);e.exports=n["default"]},{"./makeCanvasAndContext":26}],29:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};n["default"]=function(t){var e=r({a:1},t);return"rgba("+e.r+", "+e.g+", "+e.b+", "+e.a+")"},e.exports=n["default"]},{}],30:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function a(t){t.addEventListener("message",function(e){if(e.data.imageData&&e.data.params)try{var n=e.data.imageData;"undefined"==typeof n.width&&"number"==typeof e.data.imageDataWidth&&(n.width=e.data.imageDataWidth),"undefined"==typeof n.height&&"number"==typeof e.data.imageDataHeight&&(n.height=e.data.imageDataHeight);var r=(0,i["default"])(e.data.imageData,e.data.params);t.postMessage({polygonJSONStr:JSON.stringify(r)})}catch(a){t.postMessage({err:a.message||a})}else e.data.imageData?t.postMessage({err:"Parameters are missing."}):t.postMessage({err:"ImageData is missing."});t.close()})}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=a;var o=t("../polygons/imageDataToPolygons"),i=r(o);e.exports=n["default"]},{"../polygons/imageDataToPolygons":16}],31:[function(t,e,n){var r=e.exports=function(t,e){var n=document.createElement("canvas");return n.width=t||300,n.height=e||150,n};r.Image=function(){var t=document.createElement("img");return t}},{}],32:[function(t,e,n){function r(t,e,n){this.a=t,this.b=e,this.c=n;var r,a,o,i,u=e.x-t.x,l=e.y-t.y,f=n.x-t.x,d=n.y-t.y,s=u*(t.x+e.x)+l*(t.y+e.y),c=f*(t.x+n.x)+d*(t.y+n.y),g=2*(u*(n.y-e.y)-l*(n.x-e.x));Math.abs(g)<1e-6?(r=Math.min(t.x,e.x,n.x),a=Math.min(t.y,e.y,n.y),o=.5*(Math.max(t.x,e.x,n.x)-r),i=.5*(Math.max(t.y,e.y,n.y)-a),this.x=r+o,this.y=a+i,this.r=o*o+i*i):(this.x=(d*s-l*c)/g,this.y=(u*c-f*s)/g,o=this.x-t.x,i=this.y-t.y,this.r=o*o+i*i)}function a(t,e){return e.x-t.x}function o(t){var e,n,r,a,o,i=t.length;t:for(;i;)for(n=t[--i],e=t[--i],r=i;r;)if(o=t[--r],a=t[--r],e===a&&n===o||e===o&&n===a){t.splice(i,2),t.splice(r,2),i-=2;continue t}}function i(t){if(t.length<3)return[];t.sort(a);for(var e=t.length-1,n=t[e].x,i=t[0].x,u=t[e].y,l=u;e--;)t[e].y<u&&(u=t[e].y),t[e].y>l&&(l=t[e].y);var f,d,s,c=i-n,g=l-u,y=c>g?c:g,p=.5*(i+n),h=.5*(l+u),m=[new r({x:p-20*y,y:h-y,__sentinel:!0},{x:p,y:h+20*y,__sentinel:!0},{x:p+20*y,y:h-y,__sentinel:!0})],v=[],x=[];for(e=t.length;e--;){for(x.length=0,f=m.length;f--;)c=t[e].x-m[f].x,c>0&&c*c>m[f].r?(v.push(m[f]),m.splice(f,1)):(g=t[e].y-m[f].y,c*c+g*g>m[f].r||(x.push(m[f].a,m[f].b,m[f].b,m[f].c,m[f].c,m[f].a),m.splice(f,1)));for(o(x),f=x.length;f;)s=x[--f],d=x[--f],m.push(new r(d,s,t[e]))}for(Array.prototype.push.apply(v,m),e=v.length;e--;)(v[e].a.__sentinel||v[e].b.__sentinel||v[e].c.__sentinel)&&v.splice(e,1);return v}r.prototype.draw=function(t){t.beginPath(),t.moveTo(this.a.x,this.a.y),t.lineTo(this.b.x,this.b.y),t.lineTo(this.c.x,this.c.y),t.closePath(),t.stroke()},"undefined"!=typeof e&&(e.exports={Triangle:r,triangulate:i})},{}],33:[function(e,n,r){!function(e){"use strict";function a(t){function e(t){return function(e,n,r){return r=r||0,t[4*(o*n+e)+r]}}if(!(this instanceof a))return new a(t);var n,r,o=t.width,i=t.height,u=[[-1,0,1],[-2,0,2],[-1,0,1]],l=[[-1,-2,-1],[0,0,0],[1,2,1]],f=[],d=[],s=t.data,c=e(s);for(r=0;i>r;r++)for(n=0;o>n;n++){var g=c(n,r,0),y=c(n,r,1),p=c(n,r,2),h=(g+y+p)/3;d.push(h,h,h,255)}for(c=e(d),r=0;i>r;r++)for(n=0;o>n;n++){var m=u[0][0]*c(n-1,r-1)+u[0][1]*c(n,r-1)+u[0][2]*c(n+1,r-1)+u[1][0]*c(n-1,r)+u[1][1]*c(n,r)+u[1][2]*c(n+1,r)+u[2][0]*c(n-1,r+1)+u[2][1]*c(n,r+1)+u[2][2]*c(n+1,r+1),v=l[0][0]*c(n-1,r-1)+l[0][1]*c(n,r-1)+l[0][2]*c(n+1,r-1)+l[1][0]*c(n-1,r)+l[1][1]*c(n,r)+l[1][2]*c(n+1,r)+l[2][0]*c(n-1,r+1)+l[2][1]*c(n,r+1)+l[2][2]*c(n+1,r+1),x=Math.sqrt(m*m+v*v)>>>0;f.push(x,x,x,255)}var b=f;return"function"==typeof Uint8ClampedArray&&(b=new Uint8ClampedArray(f)),b.toImageData=function(){return a.toImageData(b,o,i)},b}function o(t,e,n){return{width:e,height:n,data:t}}a.toImageData=function(t,e,n){if("function"==typeof ImageData&&"[object Uint16Array]"===Object.prototype.toString.call(t))return new ImageData(t,e,n);if("object"==typeof window&&"object"==typeof window.document){var r=document.createElement("canvas");if("function"==typeof r.getContext){var a=r.getContext("2d"),i=a.createImageData(e,n);return i.data.set(t),i}return new o(t,e,n)}return new o(t,e,n)},"undefined"!=typeof r?("undefined"!=typeof n&&n.exports&&(r=n.exports=a),r.Sobel=a):"function"==typeof t&&t.amd?t([],function(){return a}):e.Sobel=a}(this)},{}],34:[function(t,e,n){function r(t,e,n,r){if("string"==typeof t)var t=document.getElementById(t);else if(!t instanceof HTMLImageElement)return;var a=t.naturalWidth,i=t.naturalHeight;if("string"==typeof e)var e=document.getElementById(e);else if(!e instanceof HTMLCanvasElement)return;e.style.width=a+"px",e.style.height=i+"px",e.width=a,e.height=i;var l=e.getContext("2d");l.clearRect(0,0,a,i),l.drawImage(t,0,0),isNaN(n)||1>n||(r?o(e,0,0,a,i,n):u(e,0,0,a,i,n))}function a(t,e,n,r,a){if("string"==typeof t)var t=document.getElementById(t);else if(!t instanceof HTMLCanvasElement)return;var o,i=t.getContext("2d");try{try{o=i.getImageData(e,n,r,a)}catch(u){throw new Error("unable to access local image data: "+u)}}catch(u){throw new Error("unable to access image data: "+u)}return o}function o(t,e,n,r,o,u){if(!(isNaN(u)||1>u)){u|=0;var l=a(t,e,n,r,o);l=i(l,e,n,r,o,u),t.getContext("2d").putImageData(l,e,n)}}function i(t,e,n,r,a,o){var i,u,l,c,g,y,p,h,m,v,x,b,w,_,C,M,P,k,D,O,j,I,S,T,B=t.data,E=o+o+1,N=r-1,W=a-1,R=o+1,J=R*(R+1)/2,A=new f,G=A;for(l=1;E>l;l++)if(G=G.next=new f,l==R)var L=G;G.next=A;var U=null,H=null;p=y=0;var q=d[o],F=s[o];for(u=0;a>u;u++){for(M=P=k=D=h=m=v=x=0,b=R*(O=B[y]),w=R*(j=B[y+1]),_=R*(I=B[y+2]),C=R*(S=B[y+3]),h+=J*O,m+=J*j,v+=J*I,x+=J*S,G=A,l=0;R>l;l++)G.r=O,G.g=j,G.b=I,G.a=S,G=G.next;for(l=1;R>l;l++)c=y+((l>N?N:l)<<2),h+=(G.r=O=B[c])*(T=R-l),m+=(G.g=j=B[c+1])*T,v+=(G.b=I=B[c+2])*T,x+=(G.a=S=B[c+3])*T,M+=O,P+=j,k+=I,D+=S,G=G.next;for(U=A,H=L,i=0;r>i;i++)B[y+3]=S=x*q>>F,0!=S?(S=255/S,B[y]=(h*q>>F)*S,B[y+1]=(m*q>>F)*S,B[y+2]=(v*q>>F)*S):B[y]=B[y+1]=B[y+2]=0,h-=b,m-=w,v-=_,x-=C,b-=U.r,w-=U.g,_-=U.b,C-=U.a,c=p+((c=i+o+1)<N?c:N)<<2,M+=U.r=B[c],P+=U.g=B[c+1],k+=U.b=B[c+2],D+=U.a=B[c+3],h+=M,m+=P,v+=k,x+=D,U=U.next,b+=O=H.r,w+=j=H.g,_+=I=H.b,C+=S=H.a,M-=O,P-=j,k-=I,D-=S,H=H.next,y+=4;p+=r}for(i=0;r>i;i++){for(P=k=D=M=m=v=x=h=0,y=i<<2,b=R*(O=B[y]),w=R*(j=B[y+1]),_=R*(I=B[y+2]),C=R*(S=B[y+3]),h+=J*O,m+=J*j,v+=J*I,x+=J*S,G=A,l=0;R>l;l++)G.r=O,G.g=j,G.b=I,G.a=S,G=G.next;for(g=r,l=1;o>=l;l++)y=g+i<<2,h+=(G.r=O=B[y])*(T=R-l),m+=(G.g=j=B[y+1])*T,v+=(G.b=I=B[y+2])*T,x+=(G.a=S=B[y+3])*T,M+=O,P+=j,k+=I,D+=S,G=G.next,W>l&&(g+=r);for(y=i,U=A,H=L,u=0;a>u;u++)c=y<<2,B[c+3]=S=x*q>>F,S>0?(S=255/S,B[c]=(h*q>>F)*S,B[c+1]=(m*q>>F)*S,B[c+2]=(v*q>>F)*S):B[c]=B[c+1]=B[c+2]=0,h-=b,m-=w,v-=_,x-=C,b-=U.r,w-=U.g,_-=U.b,C-=U.a,c=i+((c=u+R)<W?c:W)*r<<2,h+=M+=U.r=B[c],m+=P+=U.g=B[c+1],v+=k+=U.b=B[c+2],x+=D+=U.a=B[c+3],U=U.next,b+=O=H.r,w+=j=H.g,_+=I=H.b,C+=S=H.a,M-=O,P-=j,k-=I,D-=S,H=H.next,y+=r}return t}function u(t,e,n,r,o,i){if(!(isNaN(i)||1>i)){i|=0;var u=a(t,e,n,r,o);u=l(u,e,n,r,o,i),t.getContext("2d").putImageData(u,e,n)}}function l(t,e,n,r,a,o){var i,u,l,c,g,y,p,h,m,v,x,b,w,_,C,M,P,k,D,O,j=t.data,I=o+o+1,S=r-1,T=a-1,B=o+1,E=B*(B+1)/2,N=new f,W=N;for(l=1;I>l;l++)if(W=W.next=new f,l==B)var R=W;W.next=N;var J=null,A=null;p=y=0;var G=d[o],L=s[o];for(u=0;a>u;u++){for(_=C=M=h=m=v=0,x=B*(P=j[y]),b=B*(k=j[y+1]),w=B*(D=j[y+2]),h+=E*P,m+=E*k,v+=E*D,W=N,l=0;B>l;l++)W.r=P,W.g=k,W.b=D,W=W.next;for(l=1;B>l;l++)c=y+((l>S?S:l)<<2),h+=(W.r=P=j[c])*(O=B-l),m+=(W.g=k=j[c+1])*O,v+=(W.b=D=j[c+2])*O,_+=P,C+=k,M+=D,W=W.next;for(J=N,A=R,i=0;r>i;i++)j[y]=h*G>>L,j[y+1]=m*G>>L,j[y+2]=v*G>>L,h-=x,m-=b,v-=w,x-=J.r,b-=J.g,w-=J.b,c=p+((c=i+o+1)<S?c:S)<<2,_+=J.r=j[c],C+=J.g=j[c+1],M+=J.b=j[c+2],h+=_,m+=C,v+=M,J=J.next,x+=P=A.r,b+=k=A.g,w+=D=A.b,_-=P,C-=k,M-=D,A=A.next,y+=4;p+=r}for(i=0;r>i;i++){for(C=M=_=m=v=h=0,y=i<<2,x=B*(P=j[y]),b=B*(k=j[y+1]),w=B*(D=j[y+2]),h+=E*P,m+=E*k,v+=E*D,W=N,l=0;B>l;l++)W.r=P,W.g=k,W.b=D,W=W.next;for(g=r,l=1;o>=l;l++)y=g+i<<2,h+=(W.r=P=j[y])*(O=B-l),m+=(W.g=k=j[y+1])*O,v+=(W.b=D=j[y+2])*O,_+=P,C+=k,M+=D,W=W.next,T>l&&(g+=r);for(y=i,J=N,A=R,u=0;a>u;u++)c=y<<2,j[c]=h*G>>L,j[c+1]=m*G>>L,j[c+2]=v*G>>L,h-=x,m-=b,v-=w,x-=J.r,b-=J.g,w-=J.b,c=i+((c=u+B)<T?c:T)*r<<2,h+=_+=J.r=j[c],m+=C+=J.g=j[c+1],v+=M+=J.b=j[c+2],J=J.next,x+=P=A.r,b+=k=A.g,w+=D=A.b,_-=P,C-=k,M-=D,A=A.next,y+=r}return t}function f(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var d=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],s=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];e.exports={image:r,canvasRGBA:o,canvasRGB:u,imageDataRGBA:i,imageDataRGB:l}},{}],35:[function(t,e,n){var r=arguments[3],a=arguments[4],o=arguments[5],i=JSON.stringify;e.exports=function(t){for(var e,n=Object.keys(o),u=0,l=n.length;l>u;u++){var f=n[u],d=o[f].exports;if(d===t||d["default"]===t){e=f;break}}if(!e){e=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var s={},u=0,l=n.length;l>u;u++){var f=n[u];s[f]=f}a[e]=[Function(["require","module","exports"],"("+t+")(self)"),s]}var c=Math.floor(Math.pow(16,8)*Math.random()).toString(16),g={};g[e]=e,a[c]=[Function(["require"],"var f = require("+i(e)+");(f.default ? f.default : f)(self);"),g];var y="("+r+")({"+Object.keys(a).map(function(t){return i(t)+":["+a[t][0]+","+i(a[t][1])+"]"}).join(",")+"},{},["+i(c)+"])",p=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(p.createObjectURL(new Blob([y],{type:"text/javascript"})))}},{}]},{},[1])(1)}); | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.triangulate=t()}}(function(){var t;return function t(e,n,r){function a(i,u){if(!n[i]){if(!e[i]){var l="function"==typeof require&&require;if(!u&&l)return l(i,!0);if(o)return o(i,!0);var f=new Error("Cannot find module '"+i+"'");throw f.code="MODULE_NOT_FOUND",f}var d=n[i]={exports:{}};e[i][0].call(d.exports,function(t){var n=e[i][1][t];return a(n?n:t)},d,d.exports,t,e,n,r)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;i<r.length;i++)a(r[i]);return a}({1:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};n.default=function(t){function e(){return t}function n(){var t=a({},R);return N||a(t,J),t}function r(){var t=a({},R);return W||a(t,A),t}function o(t){return P(l.default,t)}function u(t){return P(l.default,t,!0)}function f(t){return P(function(t){return t},t)}function s(t){return P(function(t){return t},t,!0)}function g(t){return k(function(t){return t},t)}function p(t){return k(function(t){return t},t,!0)}function m(t){return k(c.default,t)}function x(t){return k(c.default,t,!0)}function w(t){return k(d.default,t)}function _(t){return k(d.default,t,!0)}function C(t){return k(y.default,t)}function M(t){return k(y.default,t,!0)}function P(t,e,n){return T=!!n,N=function(){return T?t(e):new Promise(function(n,r){try{var a=t(e);n(a)}catch(t){r(t)}})},D()?O():r()}function k(t,e,r){return B=!!r,W=function(n,r){return B?t(n,r,e):new Promise(function(a,o){try{var i=t(n,r,e);a(i)}catch(t){o(t)}})},D()?O():n()}function D(){return N&&W}function O(){if(T&&B){var e=N(t),n=(0,h.default)(e,t),r=W(n,e);return r}return new Promise(function(e,n){var r;j().then(function(e){return r=e,I(r,t)},n).then(function(t){return S(t,r)},n).then(function(t){e(t)},n)})}function j(t){return new Promise(function(e,n){if(T)try{var r=N(t);e(r)}catch(t){n(t)}else N(t).then(e,n)})}function I(t,e){return new Promise(function(n,r){E.addEventListener("message",function(t){if(t.data&&t.data.polygonJSONStr){var e=JSON.parse(t.data.polygonJSONStr);n(e)}else r(t.data&&t.data.err?t.data.err:t)}),E.postMessage({params:e,imageData:t,imageDataWidth:t.width,imageDataHeight:t.height})})}function S(t,e){return new Promise(function(n,r){if(B)try{var a=W(t,e);n(a)}catch(t){r(t)}else W(t,e).then(n,r)})}t=(0,i.default)(t);var T=!1,B=!1,E=(0,v.default)(b.default),N=void 0,W=void 0,R={getParams:e,getInput:n,getOutput:r},J={fromImage:o,fromImageSync:u,fromImageData:f,fromImageDataSync:s},A={toData:g,toDataSync:p,toDataURL:m,toDataURLSync:x,toImageData:w,toImageDataSync:_,toSVG:C,toSVGSync:M};return n()};var o=t("./input/sanitizeInput"),i=r(o),u=t("./input/browser/fromImageToImageData"),l=r(u),f=t("./output/polygonsToImageData"),d=r(f),s=t("./output/polygonsToDataURL"),c=r(s),g=t("./output/polygonsToSVG"),y=r(g),p=t("./polygons/imageDataToPolygons"),h=r(p),m=t("webworkify"),v=r(m),x=t("./workers/triangulationWorker"),b=r(x);e.exports=n.default},{"./input/browser/fromImageToImageData":4,"./input/sanitizeInput":6,"./output/polygonsToDataURL":7,"./output/polygonsToImageData":8,"./output/polygonsToSVG":9,"./polygons/imageDataToPolygons":16,"./workers/triangulationWorker":30,webworkify:35}],2:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function a(t){var e=(0,i.default)(t.width,t.height),n=e.getContext("2d");return n.putImageData(t,0,0),n.getImageData(0,0,t.width,t.height)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){if((0,l.default)(t)){if("undefined"==typeof Uint8ClampedArray){if("undefined"==typeof window)throw new Error("Can't copy imageData in webworker without Uint8ClampedArray support.");return a(t)}var e=new Uint8ClampedArray(t.data);if("undefined"==typeof ImageData)return{width:t.width,height:t.height,data:e};var n=void 0;try{n=new ImageData(e,t.width,t.height)}catch(e){if("undefined"==typeof window)throw new Error("Can't copy imageData in webworker without proper ImageData() support.");n=a(t)}return n}throw new Error("Given imageData object is not useable.")};var o=t("canvas-browserify"),i=r(o),u=t("../util/isImageData"),l=r(u);e.exports=n.default},{"../util/isImageData":23,"canvas-browserify":31}],3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){for(var e=t.data.length,n=void 0,r=0;r<e;r+=4)n=.34*t.data[r]+.5*t.data[r+1]+.16*t.data[r+2],t.data[r]=n,t.data[r+1]=n,t.data[r+2]=n;return t},e.exports=n.default},{}],4:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){if(t instanceof HTMLImageElement){if(!t.naturalWidth||!t.naturalHeight||t.complete===!1)throw new Error("This this image hasn't finished loading: "+t.src);var e=new o.default(t.naturalWidth,t.naturalHeight),n=e.getContext("2d");n.drawImage(t,0,0,e.width,e.height);var r=n.getImageData(0,0,e.width,e.height);return r.data&&r.data.length&&("undefined"==typeof r.width&&(r.width=t.naturalWidth),"undefined"==typeof r.height&&(r.height=t.naturalHeight)),r}throw new Error("This object does not seem to be an image.")};var a=t("canvas-browserify"),o=r(a);o.default.Image;e.exports=n.default},{"canvas-browserify":31}],5:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default={accuracy:.7,blur:4,fill:!0,stroke:!0,strokeWidth:.5,lineJoin:"miter",vertexCount:700,threshold:50,transparentColor:!1},e.exports=n.default},{}],6:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};n.default=function(t){return t=(0,l.default)(t),"object"!==("undefined"==typeof t?"undefined":a(t))&&(t={}),"number"!=typeof t.accuracy||isNaN(t.accuracy)?t.accuracy=c.default.accuracy:t.accuracy=(0,i.default)(t.accuracy,0,1),("number"!=typeof t.blur||isNaN(t.blur))&&(t.blur=c.default.blur),t.blur<=0&&(t.blur=1),"string"!=typeof t.fill&&"boolean"!=typeof t.fill&&(t.fill=c.default.fill),"string"!=typeof t.stroke&&"boolean"!=typeof t.stroke&&(t.stroke=c.default.stroke),("number"!=typeof t.strokeWidth||isNaN(t.strokeWidth))&&(t.strokeWidth=c.default.strokeWidth),"number"!=typeof t.threshold||isNaN(t.threshold)?t.threshold=c.default.threshold:t.threshold=(0,i.default)(t.threshold,1,100),"string"==typeof t.lineJoin&&g.indexOf(t.lineJoin)!==-1||(t.lineJoin=c.default.lineJoin),t.gradients&&t.fill?t.gradients=!0:t.gradients=!1,t.gradients&&(("number"!=typeof t.gradientStops||isNaN(t.gradientStops)||t.gradientStops<2)&&(t.gradientStops=2),t.gradientStops=Math.round(t.gradientStops)),("number"!=typeof t.vertexCount||isNaN(t.vertexCount))&&(t.vertexCount=c.default.vertexCount),t.vertexCount<=0&&(t.vertexCount=1),"string"!=typeof t.transparentColor&&"boolean"!=typeof t.transparentColor&&(t.transparentColor=c.default.transparentColor),typeof t.transparentColor===!0&&(t.transparentColor=!1),"string"==typeof t.transparentColor&&(t.transparentColor=(0,d.default)(t.transparentColor)),t};var o=t("../util/clamp"),i=r(o),u=t("../util/clone"),l=r(u),f=t("../util/toColor"),d=r(f),s=t("./defaultParams"),c=r(s),g=["miter","round","bevel"];e.exports=n.default},{"../util/clamp":17,"../util/clone":18,"../util/toColor":28,"./defaultParams":5}],7:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){var r=n&&n.dpr?n.dpr:1,a=(0,o.default)(e,n,r);return(0,u.default)(a.ctx,t,e,r),a.canvas.toDataURL()};var a=t("../util/makeCanvasAndContext"),o=r(a),i=t("../util/drawPolygonsOnContext"),u=r(i);e.exports=n.default},{"../util/drawPolygonsOnContext":20,"../util/makeCanvasAndContext":26}],8:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){var r=n&&n.dpr?n.dpr:1,a=(0,o.default)(e,n,r,!0).ctx;return(0,u.default)(a,t,e,r),a.getImageData(0,0,e.width*r,e.height*r)};var a=t("../util/makeCanvasAndContext"),o=r(a),i=t("../util/drawPolygonsOnContext"),u=r(i);e.exports=n.default},{"../util/drawPolygonsOnContext":20,"../util/makeCanvasAndContext":26}],9:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){var n="";t.length&&t[0].gradient&&(n="<defs>");var r="";t.forEach(function(t,e){var a=t.a,i=t.b,u=t.c;r+='<polygon points="'+a.x+","+a.y+" "+i.x+","+i.y+" "+u.x+","+u.y+'"',t.gradient?!function(){var a=t.boundingBox,i=((t.gradient.x1-a.x)/a.width*100).toFixed(3),u=((t.gradient.y1-a.y)/a.height*100).toFixed(3),l=((t.gradient.x2-a.x)/a.width*100).toFixed(3),f=((t.gradient.y2-a.y)/a.height*100).toFixed(3);n+='\n\t<linearGradient id="gradient-'+e+'" x1="'+i+'%" y1="'+u+'%" x2="'+l+'%" y2="'+f+'%">';var d=t.gradient.colors.length-1;t.gradient.colors.forEach(function(t,e){var r=(0,o.default)(t),a=(e/d*100).toFixed(3);n+='\n\t\t\t\t\t<stop offset="'+a+'%" stop-color="'+r+'"/>\n\t\t\t\t'}),n+="</linearGradient>",r+=' fill="url(#gradient-'+e+')"',t.strokeWidth>0&&(r+=' stroke="url(#gradient-'+e+')" stroke-width="'+t.strokeWidth+'" stroke-linejoin="'+t.lineJoin+'"')}():(r+=t.fill?' fill="'+t.fill+'"':' fill="transparent"',t.strokeColor&&(r+=' stroke="'+t.strokeColor+'" stroke-width="'+t.strokeWidth+'" stroke-linejoin="'+t.lineJoin+'"')),r+="/>\n\t"}),n.length&&(n+="\n\t\t</defs>");var a='<?xml version="1.0" standalone="yes"?>\n<svg width="'+e.width+'" height="'+e.height+'" xmlns="http://www.w3.org/2000/svg" version="1.1" >\n\t'+n+"\n\t"+r+"\n</svg>";return a};var a=t("../util/toRGBA"),o=r(a);e.exports=n.default},{"../util/toRGBA":29}],10:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){return t.forEach(function(t){t.boundingBox=(0,o.default)([t.a,t.b,t.c])}),t.filter(function(t){return t.boundingBox.width>0&&t.boundingBox.height>0})};var a=t("../util/getBoundingBox"),o=r(a);e.exports=n.default},{"../util/getBoundingBox":21}],11:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){var r=n.fill,a=n.stroke,i=n.strokeWidth,l=n.lineJoin,d=n.transparentColor,c="string"==typeof r&&r,g="string"==typeof a&&a,y=function(t,e){var n=(0,f.default)(t)&&d,r=n?d:t;return e&&!n?e:(0,s.default)(r)};return t.forEach(function(t,n){var f=(0,o.default)((0,u.default)(t),e);r&&(t.fill=y(f,c)),a&&(t.strokeColor=y(f,g),t.strokeWidth=i,t.lineJoin=l)}),t};var a=t("../util/getColorByPos"),o=r(a),i=t("../util/polygonCenter"),u=r(i),l=t("../util/isTransparent"),f=r(l),d=t("../util/toRGBA"),s=r(d);e.exports=n.default},{"../util/getColorByPos":22,"../util/isTransparent":24,"../util/polygonCenter":27,"../util/toRGBA":29}],12:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){return t.forEach(function(t,r){var a={};"abc".split("").forEach(function(r){var i=(0,f.default)(t[r],e,n.transparentColor);a[r]={key:r,color:i,x:t[r].x,y:t[r].y},a[r].luminance=(0,o.default)(a[r].color);var u="abc".replace(r,"").split("");a[r].median={x:(t[u[0]].x+t[u[1]].x)/2,y:(t[u[0]].y+t[u[1]].y)/2},a[r].medianColor=(0,f.default)(a[r].median,e,n.transparentColor),a[r].medianLuminance=(0,o.default)(a[r].medianColor)});for(var i=[a.a,a.b,a.c].sort(function(t,e){return Math.abs(t.luminance-t.medianLuminance)-Math.abs(e.luminance-e.medianLuminance)}),l=i[0],d=i[0],s=l.median,c=[d],g=(0,u.default)(d,s),y=1,p=n.gradientStops-2;y<p;y++){var h=y*(g/n.gradientStops),m=h/g,v={x:d.x+m*(s.x-d.x),y:d.y+m*(s.y-d.y)};c.push(v)}c.push(s),t.gradient={x1:l.x,y1:l.y,x2:l.median.x,y2:l.median.y,colors:c.map(function(t){return(0,f.default)(t,e,n.transparentColor)})},n.stroke&&(t.strokeWidth=n.strokeWidth,t.lineJoin=n.lineJoin),a=null}),t};var a=t("../util/luminance"),o=r(a),i=t("../util/distance"),u=r(i),l=t("../util/getColorByPos"),f=r(l);e.exports=n.default},{"../util/distance":19,"../util/getColorByPos":22,"../util/luminance":25}],13:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){return t.filter(function(t){var n=(0,o.default)((0,u.default)(t),e);return!(0,f.default)(n)})};var a=t("../util/getColorByPos"),o=r(a),i=t("../util/polygonCenter"),u=r(i),l=t("../util/isTransparent"),f=r(l);e.exports=n.default},{"../util/getColorByPos":22,"../util/isTransparent":24,"../util/polygonCenter":27}],14:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){var n,r,a,o,i,u,l,f,d,s=2,c=t.width,g=t.height,y=t.data,p=[];for(r=0;r<g;r+=s)for(n=0;n<c;n+=s){for(f=d=0,a=-1;a<=1;a++)if(u=r+a,l=u*c,u>=0&&u<g)for(o=-1;o<=1;o++)i=n+o,i>=0&&i<c&&(f+=y[i+l<<2],d++);d&&(f/=d),f>e&&p.push({x:n,y:r})}return p},e.exports=n.default},{}],15:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function a(t,e,n){var r=t+"|"+e;n[r]||(n[r]={x:t,y:e}),r=null}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n,r,o){var i={},u=Math.max(~~(e*(1-n)),5),l=Math.round(Math.sqrt(u)),f=Math.round(Math.ceil(u/l)),d=~~(r/l),s=~~(o/f),c=0,g=0,y=0,p=0;for(p=0;p<o;p+=s)for(c++,g=c%2===0?~~(d/2):0,y=g;y<r;y+=d)y<r&&p<o&&a(~~(y+Math.cos(p)*s),~~(p+Math.sin(y)*d),i);a(0,0,i),a(r-1,0,i),a(r-1,o-1,i),a(0,o-1,i);var h=e-Object.keys(i).length,m=t.length,v=~~(m/h);if(e>0&&v>0){var x=0;for(x=0;x<m;x+=v)a(t[x].x,t[x].y,i)}return t=null,Object.keys(i).map(function(t){return i[t]})};var o=t("../util/clamp");r(o);e.exports=n.default},{"../util/clamp":17}],16:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){if((0,f.default)(t)){var n={width:t.width,height:t.height},r=(0,s.default)(t),i=(0,s.default)(t),l=(0,a.imageDataRGBA)(r,0,0,n.width,n.height,e.blur),d=(0,g.default)(l),c=(0,u.default)(d).toImageData(),y=(0,p.default)(c,e.threshold),h=(0,m.default)(y,e.vertexCount,e.accuracy,n.width,n.height),v=(0,o.triangulate)(h);return v=(0,x.default)(v),e.transparentColor||(v=(0,P.default)(v,i)),v=e.fill===!0&&e.gradients===!0?(0,C.default)(v,i,e):(0,w.default)(v,i,e)}throw new Error("Can't work with the imageData provided. It seems to be corrupt.")};var a=t("stackblur-canvas"),o=t("delaunay-fast"),i=t("sobel"),u=r(i),l=t("../util/isImageData"),f=r(l),d=t("../imagedata/copyImageData"),s=r(d),c=t("../imagedata/greyscale"),g=r(c),y=t("./getEdgePoints"),p=r(y),h=t("./getVerticesFromPoints"),m=r(h),v=t("./addBoundingBoxesToPolygons"),x=r(v),b=t("./addColorToPolygons"),w=r(b),_=t("./addGradientsToPolygons"),C=r(_),M=t("./filterTransparentPolygons"),P=r(M);e.exports=n.default},{"../imagedata/copyImageData":2,"../imagedata/greyscale":3,"../util/isImageData":23,"./addBoundingBoxesToPolygons":10,"./addColorToPolygons":11,"./addGradientsToPolygons":12,"./filterTransparentPolygons":13,"./getEdgePoints":14,"./getVerticesFromPoints":15,"delaunay-fast":32,sobel:33,"stackblur-canvas":34}],17:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n){return t<e?e:t>n?n:t},e.exports=n.default},{}],18:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e=!1;if("undefined"!=typeof t)try{e=JSON.parse(JSON.stringify(t))}catch(t){}return e},e.exports=n.default},{}],19:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)},e.exports=n.default},{}],20:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n,r){return r=r||1,e.forEach(function(e,n){t.beginPath(),t.moveTo(e.a.x*r,e.a.y*r),t.lineTo(e.b.x*r,e.b.y*r),t.lineTo(e.c.x*r,e.c.y*r),t.lineTo(e.a.x*r,e.a.y*r),e.gradient?!function(){var n=t.createLinearGradient(e.gradient.x1*r,e.gradient.y1*r,e.gradient.x2*r,e.gradient.y2*r),a=e.gradient.colors.length-1;e.gradient.colors.forEach(function(t,e){var r=(0,o.default)(t);n.addColorStop(e/a,r)}),t.fillStyle=n,t.fill(),e.strokeWidth>0&&(t.strokeStyle=n,t.lineWidth=e.strokeWidth*r,t.lineJoin=e.lineJoin,t.stroke())}():(e.fill&&(t.fillStyle=e.fill,t.fill()),e.strokeColor&&(t.strokeStyle=e.strokeColor,t.lineWidth=e.strokeWidth*r,t.lineJoin=e.lineJoin,t.stroke())),t.closePath()}),t};var a=t("./toRGBA"),o=r(a);e.exports=n.default},{"./toRGBA":29}],21:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e=1/0,n=-(1/0),r=1/0,a=-(1/0);return t.forEach(function(t){t.x<e&&(e=t.x),t.y<r&&(r=t.y),t.x>n&&(n=t.x),t.y>a&&(a=t.y)}),{x:e,y:r,width:n-e,height:a-r}},e.exports=n.default},{}],22:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function a(t,e,n){var r=(0,i.default)(t.x,1,e.width-2),a=(0,i.default)(t.y,1,e.height-2),o=(0|r)+(0|a)*e.width<<2;o>=e.data.length&&(o=e.data.length-5);var u=e.data[o+3]/255;return n&&0===u?n:{r:e.data[o],g:e.data[o+1],b:e.data[o+2],a:u}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=a;var o=t("./clamp"),i=r(o);e.exports=n.default},{"./clamp":17}],23:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};n.default=function(t){return t&&"number"==typeof t.width&&"number"==typeof t.height&&t.data&&"number"==typeof t.data.length&&"object"===r(t.data)},e.exports=n.default},{}],24:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){return 0===t.a},e.exports=n.default},{}],25:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e=[t.r,t.g,t.b].map(function(t){return t/=255,t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return.2126*e[0]+.7152*e[1]+.0722*e[2]},e.exports=n.default},{}],26:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e,n,r){var a=!(!e||!e.backgroundColor)&&e.backgroundColor,i=new o.default(t.width*n,t.height*n,r),u=i.getContext("2d");return a&&(u.fillStyle=a,u.fillRect(0,0,t.width*n,t.height*n),u.fillStyle="transparent"),{canvas:i,ctx:u}};var a=t("canvas-browserify"),o=r(a);e.exports=n.default},{"canvas-browserify":31}],27:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){return{x:.33333*(t.a.x+t.b.x+t.c.x),y:.33333*(t.a.y+t.b.y+t.c.y)}},e.exports=n.default},{}],28:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e=1,n=(0,o.default)({width:e,height:e},{},1,!0).ctx;n.fillStyle=t,n.fillRect(0,0,e,e);var r=n.getImageData(0,0,e,e).data;return{r:r[0],g:r[1],b:r[2],a:r[3]/255}};var a=t("./makeCanvasAndContext"),o=r(a);e.exports=n.default},{"./makeCanvasAndContext":26}],29:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};n.default=function(t){var e=r({a:1},t);return"rgba("+e.r+", "+e.g+", "+e.b+", "+e.a+")"},e.exports=n.default},{}],30:[function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function a(t){t.addEventListener("message",function(e){if(e.data.imageData&&e.data.params)try{var n=e.data.imageData;"undefined"==typeof n.width&&"number"==typeof e.data.imageDataWidth&&(n.width=e.data.imageDataWidth),"undefined"==typeof n.height&&"number"==typeof e.data.imageDataHeight&&(n.height=e.data.imageDataHeight);var r=(0,i.default)(e.data.imageData,e.data.params);t.postMessage({polygonJSONStr:JSON.stringify(r)})}catch(e){t.postMessage({err:e.message||e})}else e.data.imageData?t.postMessage({err:"Parameters are missing."}):t.postMessage({err:"ImageData is missing."});t.close()})}Object.defineProperty(n,"__esModule",{value:!0}),n.default=a;var o=t("../polygons/imageDataToPolygons"),i=r(o);e.exports=n.default},{"../polygons/imageDataToPolygons":16}],31:[function(t,e,n){var r=e.exports=function(t,e){var n=document.createElement("canvas");return n.width=t||300,n.height=e||150,n};r.Image=function(){var t=document.createElement("img");return t}},{}],32:[function(t,e,n){function r(t,e,n){this.a=t,this.b=e,this.c=n;var r,a,o,i,u=e.x-t.x,l=e.y-t.y,f=n.x-t.x,d=n.y-t.y,s=u*(t.x+e.x)+l*(t.y+e.y),c=f*(t.x+n.x)+d*(t.y+n.y),g=2*(u*(n.y-e.y)-l*(n.x-e.x));Math.abs(g)<1e-6?(r=Math.min(t.x,e.x,n.x),a=Math.min(t.y,e.y,n.y),o=.5*(Math.max(t.x,e.x,n.x)-r),i=.5*(Math.max(t.y,e.y,n.y)-a),this.x=r+o,this.y=a+i,this.r=o*o+i*i):(this.x=(d*s-l*c)/g,this.y=(u*c-f*s)/g,o=this.x-t.x,i=this.y-t.y,this.r=o*o+i*i)}function a(t,e){return e.x-t.x}function o(t){var e,n,r,a,o,i=t.length;t:for(;i;)for(n=t[--i],e=t[--i],r=i;r;)if(o=t[--r],a=t[--r],e===a&&n===o||e===o&&n===a){t.splice(i,2),t.splice(r,2),i-=2;continue t}}function i(t){if(t.length<3)return[];t.sort(a);for(var e=t.length-1,n=t[e].x,i=t[0].x,u=t[e].y,l=u;e--;)t[e].y<u&&(u=t[e].y),t[e].y>l&&(l=t[e].y);var f,d,s,c=i-n,g=l-u,y=c>g?c:g,p=.5*(i+n),h=.5*(l+u),m=[new r({x:p-20*y,y:h-y,__sentinel:!0},{x:p,y:h+20*y,__sentinel:!0},{x:p+20*y,y:h-y,__sentinel:!0})],v=[],x=[];for(e=t.length;e--;){for(x.length=0,f=m.length;f--;)c=t[e].x-m[f].x,c>0&&c*c>m[f].r?(v.push(m[f]),m.splice(f,1)):(g=t[e].y-m[f].y,c*c+g*g>m[f].r||(x.push(m[f].a,m[f].b,m[f].b,m[f].c,m[f].c,m[f].a),m.splice(f,1)));for(o(x),f=x.length;f;)s=x[--f],d=x[--f],m.push(new r(d,s,t[e]))}for(Array.prototype.push.apply(v,m),e=v.length;e--;)(v[e].a.__sentinel||v[e].b.__sentinel||v[e].c.__sentinel)&&v.splice(e,1);return v}r.prototype.draw=function(t){t.beginPath(),t.moveTo(this.a.x,this.a.y),t.lineTo(this.b.x,this.b.y),t.lineTo(this.c.x,this.c.y),t.closePath(),t.stroke()},"undefined"!=typeof e&&(e.exports={Triangle:r,triangulate:i})},{}],33:[function(e,n,r){!function(e){"use strict";function a(t){function e(t){return function(e,n,r){return r=r||0,t[4*(o*n+e)+r]}}if(!(this instanceof a))return new a(t);var n,r,o=t.width,i=t.height,u=[[-1,0,1],[-2,0,2],[-1,0,1]],l=[[-1,-2,-1],[0,0,0],[1,2,1]],f=[],d=[],s=t.data,c=e(s);for(r=0;r<i;r++)for(n=0;n<o;n++){var g=c(n,r,0),y=c(n,r,1),p=c(n,r,2),h=(g+y+p)/3;d.push(h,h,h,255)}for(c=e(d),r=0;r<i;r++)for(n=0;n<o;n++){var m=u[0][0]*c(n-1,r-1)+u[0][1]*c(n,r-1)+u[0][2]*c(n+1,r-1)+u[1][0]*c(n-1,r)+u[1][1]*c(n,r)+u[1][2]*c(n+1,r)+u[2][0]*c(n-1,r+1)+u[2][1]*c(n,r+1)+u[2][2]*c(n+1,r+1),v=l[0][0]*c(n-1,r-1)+l[0][1]*c(n,r-1)+l[0][2]*c(n+1,r-1)+l[1][0]*c(n-1,r)+l[1][1]*c(n,r)+l[1][2]*c(n+1,r)+l[2][0]*c(n-1,r+1)+l[2][1]*c(n,r+1)+l[2][2]*c(n+1,r+1),x=Math.sqrt(m*m+v*v)>>>0;f.push(x,x,x,255)}var b=f;return"function"==typeof Uint8ClampedArray&&(b=new Uint8ClampedArray(f)),b.toImageData=function(){return a.toImageData(b,o,i)},b}function o(t,e,n){return{width:e,height:n,data:t}}a.toImageData=function(t,e,n){if("function"==typeof ImageData&&"[object Uint16Array]"===Object.prototype.toString.call(t))return new ImageData(t,e,n);if("object"==typeof window&&"object"==typeof window.document){var r=document.createElement("canvas");if("function"==typeof r.getContext){var a=r.getContext("2d"),i=a.createImageData(e,n);return i.data.set(t),i}return new o(t,e,n)}return new o(t,e,n)},"undefined"!=typeof r?("undefined"!=typeof n&&n.exports&&(r=n.exports=a),r.Sobel=a):"function"==typeof t&&t.amd?t([],function(){return a}):e.Sobel=a}(this)},{}],34:[function(t,e,n){function r(t,e,n,r){if("string"==typeof t)var t=document.getElementById(t);else if(!t instanceof HTMLImageElement)return;var a=t.naturalWidth,i=t.naturalHeight;if("string"==typeof e)var e=document.getElementById(e);else if(!e instanceof HTMLCanvasElement)return;e.style.width=a+"px",e.style.height=i+"px",e.width=a,e.height=i;var l=e.getContext("2d");l.clearRect(0,0,a,i),l.drawImage(t,0,0),isNaN(n)||n<1||(r?o(e,0,0,a,i,n):u(e,0,0,a,i,n))}function a(t,e,n,r,a){if("string"==typeof t)var t=document.getElementById(t);else if(!t instanceof HTMLCanvasElement)return;var o,i=t.getContext("2d");try{try{o=i.getImageData(e,n,r,a)}catch(t){throw new Error("unable to access local image data: "+t)}}catch(t){throw new Error("unable to access image data: "+t)}return o}function o(t,e,n,r,o,u){if(!(isNaN(u)||u<1)){u|=0;var l=a(t,e,n,r,o);l=i(l,e,n,r,o,u),t.getContext("2d").putImageData(l,e,n)}}function i(t,e,n,r,a,o){var i,u,l,c,g,y,p,h,m,v,x,b,w,_,C,M,P,k,D,O,j,I,S,T,B=t.data,E=o+o+1,N=r-1,W=a-1,R=o+1,J=R*(R+1)/2,A=new f,G=A;for(l=1;l<E;l++)if(G=G.next=new f,l==R)var L=G;G.next=A;var U=null,H=null;p=y=0;var q=d[o],F=s[o];for(u=0;u<a;u++){for(M=P=k=D=h=m=v=x=0,b=R*(O=B[y]),w=R*(j=B[y+1]),_=R*(I=B[y+2]),C=R*(S=B[y+3]),h+=J*O,m+=J*j,v+=J*I,x+=J*S,G=A,l=0;l<R;l++)G.r=O,G.g=j,G.b=I,G.a=S,G=G.next;for(l=1;l<R;l++)c=y+((N<l?N:l)<<2),h+=(G.r=O=B[c])*(T=R-l),m+=(G.g=j=B[c+1])*T,v+=(G.b=I=B[c+2])*T,x+=(G.a=S=B[c+3])*T,M+=O,P+=j,k+=I,D+=S,G=G.next;for(U=A,H=L,i=0;i<r;i++)B[y+3]=S=x*q>>F,0!=S?(S=255/S,B[y]=(h*q>>F)*S,B[y+1]=(m*q>>F)*S,B[y+2]=(v*q>>F)*S):B[y]=B[y+1]=B[y+2]=0,h-=b,m-=w,v-=_,x-=C,b-=U.r,w-=U.g,_-=U.b,C-=U.a,c=p+((c=i+o+1)<N?c:N)<<2,M+=U.r=B[c],P+=U.g=B[c+1],k+=U.b=B[c+2],D+=U.a=B[c+3],h+=M,m+=P,v+=k,x+=D,U=U.next,b+=O=H.r,w+=j=H.g,_+=I=H.b,C+=S=H.a,M-=O,P-=j,k-=I,D-=S,H=H.next,y+=4;p+=r}for(i=0;i<r;i++){for(P=k=D=M=m=v=x=h=0,y=i<<2,b=R*(O=B[y]),w=R*(j=B[y+1]),_=R*(I=B[y+2]),C=R*(S=B[y+3]),h+=J*O,m+=J*j,v+=J*I,x+=J*S,G=A,l=0;l<R;l++)G.r=O,G.g=j,G.b=I,G.a=S,G=G.next;for(g=r,l=1;l<=o;l++)y=g+i<<2,h+=(G.r=O=B[y])*(T=R-l),m+=(G.g=j=B[y+1])*T,v+=(G.b=I=B[y+2])*T,x+=(G.a=S=B[y+3])*T,M+=O,P+=j,k+=I,D+=S,G=G.next,l<W&&(g+=r);for(y=i,U=A,H=L,u=0;u<a;u++)c=y<<2,B[c+3]=S=x*q>>F,S>0?(S=255/S,B[c]=(h*q>>F)*S,B[c+1]=(m*q>>F)*S,B[c+2]=(v*q>>F)*S):B[c]=B[c+1]=B[c+2]=0,h-=b,m-=w,v-=_,x-=C,b-=U.r,w-=U.g,_-=U.b,C-=U.a,c=i+((c=u+R)<W?c:W)*r<<2,h+=M+=U.r=B[c],m+=P+=U.g=B[c+1],v+=k+=U.b=B[c+2],x+=D+=U.a=B[c+3],U=U.next,b+=O=H.r,w+=j=H.g,_+=I=H.b,C+=S=H.a,M-=O,P-=j,k-=I,D-=S,H=H.next,y+=r}return t}function u(t,e,n,r,o,i){if(!(isNaN(i)||i<1)){i|=0;var u=a(t,e,n,r,o);u=l(u,e,n,r,o,i),t.getContext("2d").putImageData(u,e,n)}}function l(t,e,n,r,a,o){var i,u,l,c,g,y,p,h,m,v,x,b,w,_,C,M,P,k,D,O,j=t.data,I=o+o+1,S=r-1,T=a-1,B=o+1,E=B*(B+1)/2,N=new f,W=N;for(l=1;l<I;l++)if(W=W.next=new f,l==B)var R=W;W.next=N;var J=null,A=null;p=y=0;var G=d[o],L=s[o];for(u=0;u<a;u++){for(_=C=M=h=m=v=0,x=B*(P=j[y]),b=B*(k=j[y+1]),w=B*(D=j[y+2]),h+=E*P,m+=E*k,v+=E*D,W=N,l=0;l<B;l++)W.r=P,W.g=k,W.b=D,W=W.next;for(l=1;l<B;l++)c=y+((S<l?S:l)<<2),h+=(W.r=P=j[c])*(O=B-l),m+=(W.g=k=j[c+1])*O,v+=(W.b=D=j[c+2])*O,_+=P,C+=k,M+=D,W=W.next;for(J=N,A=R,i=0;i<r;i++)j[y]=h*G>>L,j[y+1]=m*G>>L,j[y+2]=v*G>>L,h-=x,m-=b,v-=w,x-=J.r,b-=J.g,w-=J.b,c=p+((c=i+o+1)<S?c:S)<<2,_+=J.r=j[c],C+=J.g=j[c+1],M+=J.b=j[c+2],h+=_,m+=C,v+=M,J=J.next,x+=P=A.r,b+=k=A.g,w+=D=A.b,_-=P,C-=k,M-=D,A=A.next,y+=4;p+=r}for(i=0;i<r;i++){for(C=M=_=m=v=h=0,y=i<<2,x=B*(P=j[y]),b=B*(k=j[y+1]),w=B*(D=j[y+2]),h+=E*P,m+=E*k,v+=E*D,W=N,l=0;l<B;l++)W.r=P,W.g=k,W.b=D,W=W.next;for(g=r,l=1;l<=o;l++)y=g+i<<2,h+=(W.r=P=j[y])*(O=B-l),m+=(W.g=k=j[y+1])*O,v+=(W.b=D=j[y+2])*O,_+=P,C+=k,M+=D,W=W.next,l<T&&(g+=r);for(y=i,J=N,A=R,u=0;u<a;u++)c=y<<2,j[c]=h*G>>L,j[c+1]=m*G>>L,j[c+2]=v*G>>L,h-=x,m-=b,v-=w,x-=J.r,b-=J.g,w-=J.b,c=i+((c=u+B)<T?c:T)*r<<2,h+=_+=J.r=j[c],m+=C+=J.g=j[c+1],v+=M+=J.b=j[c+2],J=J.next,x+=P=A.r,b+=k=A.g,w+=D=A.b,_-=P,C-=k,M-=D,A=A.next,y+=r}return t}function f(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var d=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],s=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];e.exports={image:r,canvasRGBA:o,canvasRGB:u,imageDataRGBA:i,imageDataRGB:l}},{}],35:[function(t,e,n){var r=arguments[3],a=arguments[4],o=arguments[5],i=JSON.stringify;e.exports=function(t){for(var e,n=Object.keys(o),u=0,l=n.length;u<l;u++){var f=n[u],d=o[f].exports;if(d===t||d.default===t){e=f;break}}if(!e){e=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var s={},u=0,l=n.length;u<l;u++){var f=n[u];s[f]=f}a[e]=[Function(["require","module","exports"],"("+t+")(self)"),s]}var c=Math.floor(Math.pow(16,8)*Math.random()).toString(16),g={};g[e]=e,a[c]=[Function(["require"],"var f = require("+i(e)+");(f.default ? f.default : f)(self);"),g];var y="("+r+")({"+Object.keys(a).map(function(t){return i(t)+":["+a[t][0]+","+i(a[t][1])+"]"}).join(",")+"},{},["+i(c)+"])",p=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(p.createObjectURL(new Blob([y],{type:"text/javascript"})))}},{}]},{},[1])(1)}); |
{ | ||
"name": "triangulate-image", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Converts images in to triangular polygons.", | ||
@@ -35,3 +35,3 @@ "author": "Georg Fischer <snorpey@gmail.com.com>", | ||
"dependencies": { | ||
"es6-promise": "^3.0.2", | ||
"es6-promise": "^4.0.3", | ||
"canvas-browserify": "^1.1.3", | ||
@@ -53,9 +53,9 @@ "delaunay-fast": "github:ironwallaby/delaunay#2d7110e", | ||
"mkdirp": "^0.5.1", | ||
"mocha": "^2.5.0", | ||
"mocha": "^3.0.0", | ||
"mocha-phantomjs-core": "^2.0.0", | ||
"phantomjs": "^2.1.7", | ||
"rimraf": "^2.4.3", | ||
"uglify-js": "^2.6.1", | ||
"uglify-js": "^2.7.2", | ||
"uglifyify": "^3.0.1" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
395149
6726
+ Addedes6-promise@4.2.8(transitive)
- Removedes6-promise@3.3.1(transitive)
Updatedes6-promise@^4.0.3