Comparing version 2.3.2 to 2.4.0
@@ -1,2 +0,2 @@ | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("canvas"),require("fs"),require("https")):"function"==typeof define&&define.amd?define(["canvas","fs","https"],r):"object"==typeof exports?exports.ssim=r(require("canvas"),require("fs"),require("https")):t.ssim=r(t.canvas,t.fs,t.https)}(this,function(t,r,i){return function(t){function r(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,r),n.l=!0,n.exports}var i={};return r.m=t,r.c=i,r.i=function(t){return t},r.d=function(t,r,i){Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:i})},r.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(i,"a",i),i},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=101)}([function(t,r,i){"use strict";var e=i(34)("wks"),n=i(26),o=i(1).Symbol,s="function"==typeof o,a=t.exports=function(t){return e[t]||(e[t]=s&&o[t]||(s?o:n)("Symbol."+t))};a.store=e},function(t,r){"use strict";var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,r,i){"use strict";var e=i(14);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,r){"use strict";var i=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=i)},function(t,r,i){"use strict";var e=i(15),n=i(33);t.exports=i(6)?function(t,r,i){return e.f(t,r,n(1,i))}:function(t,r,i){return t[r]=i,t}},function(t,r){"use strict";function i(t){return e(t)/t.length}function e(t){for(var r=0,i=0;i<t.length;i++)r+=t[i];return r}function n(t){for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=Math.floor(t[i]);return r}function o(t){for(var r=t.data,i=0,e=0;e<r.length;e++)i+=r[e];return i}function s(t,r){for(var i=t.data,e=t.width,n=t.height,o=r.data,s=new Array(i.length),a=0;a<n;a++)for(var u=a*e,h=0;h<e;h++)s[u+h]=i[u+h]+o[u+h];return{data:s,width:e,height:n}}function a(t,r){for(var i=t.data,e=t.width,n=t.height,o=new Array(i.length),s=0;s<i.length;s++)o[s]=i[s]+r;return{data:o,width:e,height:n}}function u(t,r){return"number"==typeof r?a(t,r):s(t,r)}function h(t,r){for(var i=t.data,e=t.width,n=t.height,o=new Array(i.length),s=0;s<i.length;s++)o[s]=i[s]/r;return{data:o,width:e,height:n}}function c(t,r){for(var i=t.data,e=t.width,n=t.height,o=r.data,s=new Array(i.length),a=0;a<i.length;a++)s[a]=i[a]/o[a];return{data:s,width:e,height:n}}function f(t,r){return"number"==typeof r?h(t,r):c(t,r)}function d(t,r){for(var i=t.data,e=t.width,n=t.height,o=new Array(i.length),s=0;s<i.length;s++)o[s]=i[s]*r;return{data:o,width:e,height:n}}function p(t,r){for(var i=t.data,e=t.width,n=t.height,o=r.data,s=new Array(i.length),a=0;a<i.length;a++)s[a]=i[a]*o[a];return{data:s,width:e,height:n}}function l(t,r){return"number"==typeof r?d(t,r):p(t,r)}function v(t){return l(t,t)}function m(t){return o(t)/t.data.length}t.exports={add2d:u,average:i,divide2d:f,floor:n,mean2d:m,multiply2d:l,square2d:v,sum:e,sum2d:o}},function(t,r,i){"use strict";t.exports=!i(13)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,r){"use strict";var i={}.hasOwnProperty;t.exports=function(t,r){return i.call(t,r)}},function(t,r){"use strict";t.exports={}},function(t,r,i){"use strict";var e=i(1),n=i(4),o=i(7),s=i(26)("src"),a="toString",u=Function[a],h=(""+u).split(a);i(3).inspectSource=function(t){return u.call(t)},(t.exports=function(t,r,i,a){var u="function"==typeof i;u&&(o(i,"name")||n(i,"name",r)),t[r]!==i&&(u&&(o(i,s)||n(i,s,t[r]?""+t[r]:h.join(String(r)))),t===e?t[r]=i:a?t[r]?t[r]=i:n(t,r,i):(delete t[r],n(t,r,i)))})(Function.prototype,a,function(){return"function"==typeof this&&this[s]||u.call(this)})},function(t,r){"use strict";var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,r,i){"use strict";var e=i(16);t.exports=function(t,r,i){if(e(t),void 0===r)return t;switch(i){case 1:return function(i){return t.call(r,i)};case 2:return function(i,e){return t.call(r,i,e)};case 3:return function(i,e,n){return t.call(r,i,e,n)}}return function(){return t.apply(r,arguments)}}},function(t,r,i){"use strict";var e=i(1),n=i(3),o=i(4),s=i(9),a=i(11),u="prototype",h=function t(r,i,h){var c,f,d,p,l=r&t.F,v=r&t.G,m=r&t.S,w=r&t.P,g=r&t.B,y=v?e:m?e[i]||(e[i]={}):(e[i]||{})[u],x=v?n:n[i]||(n[i]={}),b=x[u]||(x[u]={});v&&(h=i);for(c in h)f=!l&&y&&void 0!==y[c],d=(f?y:h)[c],p=g&&f?a(d,e):w&&"function"==typeof d?a(Function.call,d):d,y&&s(y,c,d,r&t.U),x[c]!=d&&o(x,c,p),w&&b[c]!=d&&(b[c]=d)};e.core=n,h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,h.U=64,h.R=128,t.exports=h},function(t,r){"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,r){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){return"object"===("undefined"==typeof t?"undefined":i(t))?null!==t:"function"==typeof t}},function(t,r,i){"use strict";var e=i(2),n=i(56),o=i(77),s=Object.defineProperty;r.f=i(6)?Object.defineProperty:function(t,r,i){if(e(t),r=o(r,!0),e(i),n)try{return s(t,r,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[r]=i.value),t}},function(t,r){"use strict";t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,r,i){"use strict";var e=i(10),n=i(0)("toStringTag"),o="Arguments"==e(function(){return arguments}()),s=function(t,r){try{return t[r]}catch(t){}};t.exports=function(t){var r,i,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=s(r=Object(t),n))?i:o?e(r):"Object"==(a=e(r))&&"function"==typeof r.callee?"Arguments":a}},function(t,r){"use strict";t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,r,i){"use strict";var e=i(14),n=i(1).document,o=e(n)&&e(n.createElement);t.exports=function(t){return o?n.createElement(t):{}}},function(t,r,i){"use strict";var e=i(69),n=i(28);t.exports=Object.keys||function(t){return e(t,n)}},function(t,r,i){"use strict";var e=i(15).f,n=i(7),o=i(0)("toStringTag");t.exports=function(t,r,i){t&&!n(t=i?t:t.prototype,o)&&e(t,o,{configurable:!0,value:r})}},function(t,r,i){"use strict";var e=i(34)("keys"),n=i(26);t.exports=function(t){return e[t]||(e[t]=n(t))}},function(t,r){"use strict";var i=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:i)(t)}},function(t,r,i){"use strict";var e=i(30),n=i(18);t.exports=function(t){return e(n(t))}},function(t,r,i){"use strict";var e=i(18);t.exports=function(t){return Object(e(t))}},function(t,r){"use strict";var i=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+e).toString(36))}},function(t,r,i){"use strict";var e=i(37),n=e.conv2,o=i(38),s=o.filter2,a=i(86),u=a.fspecial,h=i(87),c=h.imfilter,f=i(88),d=f.normpdf,p=i(41),l=p.ones,v=i(42),m=v.padarray,w=i(89),g=w.rgb2gray,y=i(90),x=y.skip2d,b=i(92),_=b.transpose,S=i(43),I=S.zeros;t.exports={conv2:n,filter2:s,fspecial:u,imfilter:c,normpdf:d,ones:l,padarray:m,rgb2gray:g,skip2d:x,transpose:_,zeros:I}},function(t,r){"use strict";t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,r,i){"use strict";t.exports=i(1).document&&document.documentElement},function(t,r,i){"use strict";var e=i(10);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,r,i){"use strict";var e=i(32),n=i(12),o=i(9),s=i(4),a=i(7),u=i(8),h=i(60),c=i(21),f=i(68),d=i(0)("iterator"),p=!([].keys&&"next"in[].keys()),l="@@iterator",v="keys",m="values",w=function(){return this};t.exports=function(t,r,i,g,y,x,b){h(i,r,g);var _,S,I,j=function(t){if(!p&&t in A)return A[t];switch(t){case v:return function(){return new i(this,t)};case m:return function(){return new i(this,t)}}return function(){return new i(this,t)}},E=r+" Iterator",M=y==m,O=!1,A=t.prototype,P=A[d]||A[l]||y&&A[y],U=P||j(y),k=y?M?j("entries"):U:void 0,L="Array"==r?A.entries||P:P;if(L&&(I=f(L.call(new t)),I!==Object.prototype&&(c(I,E,!0),e||a(I,d)||s(I,d,w))),M&&P&&P.name!==m&&(O=!0,U=function(){return P.call(this)}),e&&!b||!p&&!O&&A[d]||s(A,d,U),u[r]=U,u[E]=w,y)if(_={values:M?U:j(m),keys:x?U:j(v),entries:k},b)for(S in _)S in A||o(A,S,_[S]);else n(n.P+n.F*(p||O),r,_);return _}},function(t,r){"use strict";t.exports=!1},function(t,r){"use strict";t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},function(t,r,i){"use strict";var e=i(1),n="__core-js_shared__",o=e[n]||(e[n]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,r,i){"use strict";var e,n,o,s=i(11),a=i(57),u=i(29),h=i(19),c=i(1),f=c.process,d=c.setImmediate,p=c.clearImmediate,l=c.MessageChannel,v=0,m={},w="onreadystatechange",g=function(){var t=+this;if(m.hasOwnProperty(t)){var r=m[t];delete m[t],r()}},y=function(t){g.call(t.data)};d&&p||(d=function(t){for(var r=[],i=1;arguments.length>i;)r.push(arguments[i++]);return m[++v]=function(){a("function"==typeof t?t:Function(t),r)},e(v),v},p=function(t){delete m[t]},"process"==i(10)(f)?e=function(t){f.nextTick(s(g,t,1))}:l?(n=new l,o=n.port2,n.port1.onmessage=y,e=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(e=function(t){c.postMessage(t+"","*")},c.addEventListener("message",y,!1)):e=w in h("script")?function(t){u.appendChild(h("script"))[w]=function(){u.removeChild(this),g.call(t)}}:function(t){setTimeout(s(g,t,1),0)}),t.exports={set:d,clear:p}},function(t,r,i){"use strict";var e=i(23),n=Math.min;t.exports=function(t){return t>0?n(e(t),9007199254740991):0}},function(t,r,i){"use strict";function e(t,r){for(var i=t.data,e=t.width,n=t.height,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"full",s=e+r.width-1,u=n+r.height-1,h=d(u,s),c=h.data,f=0;f<r.height;f++)for(var p=0;p<r.width;p++){var l=r.data[f*r.width+p];if(l)for(var v=0;v<n;v++)for(var m=0;m<e;m++)c[(v+f)*s+m+p]+=i[v*e+m]*l}var w={data:c,width:s,height:u};return a(w,o,n,r.height,e,r.width)}function n(t,r){var i=r.data,e=r.width,n=r.height,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"full",a=l(n,1),u=l(1,e),h=s(t,a,u,o);return m(h,i[0])}function o(t){for(var r=t.data,i=r[0],e=1;e<r.length;e++)if(r[e]!==i)return!1;return!0}function s(t,r,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"full",o=Math.max(r.height,r.width),s=Math.max(i.height,i.width),u=e(t,r,"full"),h=e(u,i,"full");return a(h,n,t.height,o,t.width,s)}function a(t,r,i,e,n,o){if("full"===r)return t;if("same"===r){var s=Math.ceil((t.height-i)/2),a=Math.ceil((t.width-n)/2);return c(t,s,i,a,n)}return c(t,e-1,i-e+1,o-1,n-o+1)}function u(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return r[2]&&r[2].data?s.apply(void 0,r):o(r[1])?n.apply(void 0,r):e.apply(void 0,r)}var h=i(91),c=h.sub,f=i(43),d=f.zeros,p=i(41),l=p.ones,v=i(5),m=v.multiply2d;t.exports={conv2:u}},function(t,r,i){"use strict";function e(t){for(var r=t.data,i=t.width,e=t.height,n=new Array(r.length),o=0;o<e;o++)for(var s=0;s<i;s++)n[o*i+s]=r[(e-1-o)*i+i-1-s];return{data:n,width:i,height:e}}function n(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"same";return s(r,e(t),i)}var o=i(37),s=o.conv2;t.exports={filter2:n}},function(t,r){"use strict";function i(t,r,i){for(var e=r*t,n=new Array(e),o=0;o<e;o++)n[o]=i;return{data:n,width:r,height:t}}t.exports={numbers:i}},function(t,r){"use strict";function i(t,r){return t-r*Math.floor(t/r)}t.exports={mod:i}},function(t,r,i){"use strict";function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return o(t,r,1)}var n=i(39),o=n.numbers;t.exports={ones:e}},function(t,r,i){"use strict";function e(t){for(var r=t.data,i=t.width,e=t.height,n=new Array(r.length),o=0;o<e;o++)for(var s=0;s<i;s++)n[o*i+s]=r[o*i+i-1-s];return{data:n,width:i,height:e}}function n(t){for(var r=t.data,i=t.width,e=t.height,n=new Array(r.length),o=0;o<e;o++)for(var s=0;s<i;s++)n[o*i+s]=r[(e-1-o)*i+s];return{data:n,width:i,height:e}}function o(t,r){for(var i=t.width+r.width,e=new Array(t.height*i),n=0;n<t.height;n++){for(var o=0;o<t.width;o++)e[n*i+o]=t.data[n*t.width+o];for(var s=0;s<r.width;s++)e[n*i+s+t.width]=r.data[n*r.width+s]}return{data:e,width:i,height:t.height}}function s(t,r){return{data:t.data.concat(r.data),height:t.height+r.height,width:t.width}}function a(t,r){for(var i=t.width+2*r,n=new Array(i*t.height),s=o(t,e(t)),a=0;a<t.height;a++)for(var u=-r;u<t.width+r;u++)n[a*i+u+r]=s.data[a*s.width+p(u,s.width)];return{data:n,width:i,height:t.height}}function u(t,r){for(var i=s(t,n(t)),e=t.height+2*r,o=new Array(t.width*e),a=-r;a<t.height+r;a++)for(var u=0;u<t.width;u++)o[(a+r)*t.width+u]=i.data[p(a,i.height)*t.width+u];return{data:o,width:t.width,height:e}}function h(t,r){for(var i=f(r,2),e=i[0],n=i[1],o=t.width+2*n,s=t.height+2*e,a=new Array(o*s),u=-e;u<0;u++){for(var h=-n;h<0;h++)a[(u+e)*o+h+n]=t.data[(Math.abs(u)-1)*t.width+Math.abs(h)-1];for(var c=0;c<t.width;c++)a[(u+e)*o+c+n]=t.data[(Math.abs(u)-1)*t.width+c];for(var d=t.width;d<t.width+n;d++)a[(u+e)*o+d+n]=t.data[(Math.abs(u)-1)*t.width+2*t.width-d-1]}for(var p=0;p<t.height;p++){for(var l=-n;l<0;l++)a[(p+e)*o+l+n]=t.data[p*t.width+Math.abs(l)-1];for(var v=0;v<t.width;v++)a[(p+e)*o+v+n]=t.data[p*t.width+v];for(var m=t.width;m<t.width+n;m++)a[(p+e)*o+m+n]=t.data[p*t.width+2*t.width-m-1]}for(var w=t.height;w<t.height+e;w++){for(var g=-n;g<0;g++)a[(w+e)*o+g+n]=t.data[(2*t.height-w-1)*t.width+Math.abs(g)-1];for(var y=0;y<t.width;y++)a[(w+e)*o+y+n]=t.data[(2*t.height-w-1)*t.width+y];for(var x=t.width;x<t.width+n;x++)a[(w+e)*o+x+n]=t.data[(2*t.height-w-1)*t.width+2*t.width-x-1]}return{data:a,width:o,height:s}}function c(t,r){var i=f(r,2),e=i[0],n=i[1];return t.height>=e&&t.width>=n?h(t,[e,n]):u(a(t,n),e)}var f=function(){function t(t,r){var i=[],e=!0,n=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(e=(s=a.next()).done)&&(i.push(s.value),!r||i.length!==r);e=!0);}catch(t){n=!0,o=t}finally{try{!e&&a.return&&a.return()}finally{if(n)throw o}}return i}return function(r,i){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=i(40),p=d.mod;t.exports={padarray:c}},function(t,r,i){"use strict";function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return o(t,r,0)}var n=i(39),o=n.numbers;t.exports={zeros:e}},function(t,r){"use strict";function i(t){throw new Error("Missing "+t+" parameter")}function e(t,r,i){if(i&&t>=i&&r>=i){var e=t/r;return e>1?{height:i,width:Math.round(i/e)}:{height:Math.round(i*e),width:i}}return{width:t,height:r}}t.exports={force:i,getLimitDimensions:e}},function(t,r,i){"use strict";function e(t){if(Object.keys(t).forEach(function(t){if(!(t in _))throw new Error('"'+t+'" is not a valid option')}),"k1"in t&&("number"!=typeof t.k1||t.k1<0))throw new Error("Invalid k1 value. Default is "+_.k1);if("k2"in t&&("number"!=typeof t.k2||t.k2<0))throw new Error("Invalid k2 value. Default is "+_.k2)}function n(t){return e(t),Object.assign({},_,t)}function o(t){var r=h(t,2),i=r[0],e=r[1];if(i.width!==e.width||i.height!==e.height)throw new Error("Image dimensions do not match");return[i,e]}function s(t){var r=h(t,2),i=r[0],e=r[1];return i=p(i),e=p(e),[i,e]}function a(t,r){return"fast"===r.downsample?f(t,r.maxSize):f(t)}function u(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b("image1"),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b("image2"),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=(new Date).getTime();i=n(i);var u="fast"===i.ssim?w:y;return Promise.all([a(t,i),a(r,i)]).then(o).then(s).then(function(t){var r=h(t,2),e=r[0],n=r[1];return u(e,n,i)}).then(function(t){return{ssim_map:t,mssim:v(t),performance:(new Date).getTime()-e}})}var h=function(){function t(t,r){var i=[],e=!0,n=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(e=(s=a.next()).done)&&(i.push(s.value),!r||i.length!==r);e=!0);}catch(t){n=!0,o=t}finally{try{!e&&a.return&&a.return()}finally{if(n)throw o}}return i}return function(r,i){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=i(94),f=c.readpixels,d=i(27),p=d.rgb2gray,l=i(5),v=l.mean2d,m=i(95),w=m.ssim,g=i(93),y=g.originalSsim,x=i(44),b=x.force,_=i(97),S=i(96),I=S.version;u.ssim=w,u.version=I,t.exports=u},function(t,r,i){"use strict";i(80),i(82),i(83),i(81),t.exports=i(3).Promise},function(t,r,i){"use strict";var e=i(12);e(e.S+e.F,"Object",{assign:i(64)})},function(t,r,i){"use strict";var e=i(25),n=i(20);i(71)("keys",function(){return function(t){return n(e(t))}})},function(t,r,i){"use strict";var e=i(51),n=i(50);t.exports={encode:e,decode:n}},function(t,r){"use strict";function i(t,r){if(this.pos=0,this.buffer=t,this.is_with_alpha=!!r,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),"BM"!=this.flag)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}i.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var r=0;r<t;r++){var i=this.buffer.readUInt8(this.pos++),e=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),o=this.buffer.readUInt8(this.pos++);this.palette[r]={red:n,green:e,blue:i,quad:o}}}},i.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,r=this.width*this.height*4;this.data=new Buffer(r),this[t]()}catch(t){console.log("bit decode error:"+t)}},i.prototype.bit1=function(){for(var t=Math.ceil(this.width/8),r=t%4,i=this.height-1;i>=0;i--){for(var e=0;e<t;e++)for(var n=this.buffer.readUInt8(this.pos++),o=i*this.width*4+8*e*4,s=0;s<8&&8*e+s<this.width;s++){var a=this.palette[n>>7-s&1];this.data[o+4*s]=a.blue,this.data[o+4*s+1]=a.green,this.data[o+4*s+2]=a.red,this.data[o+4*s+3]=255}0!=r&&(this.pos+=4-r)}},i.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),r=t%4,i=this.height-1;i>=0;i--){for(var e=0;e<t;e++){var n=this.buffer.readUInt8(this.pos++),o=i*this.width*4+2*e*4,s=n>>4,a=15&n,u=this.palette[s];if(this.data[o]=u.blue,this.data[o+1]=u.green,this.data[o+2]=u.red,this.data[o+3]=255,2*e+1>=this.width)break;u=this.palette[a],this.data[o+4]=u.blue,this.data[o+4+1]=u.green,this.data[o+4+2]=u.red,this.data[o+4+3]=255}0!=r&&(this.pos+=4-r)}},i.prototype.bit8=function(){for(var t=this.width%4,r=this.height-1;r>=0;r--){for(var i=0;i<this.width;i++){var e=this.buffer.readUInt8(this.pos++),n=r*this.width*4+4*i;if(e<this.palette.length){var o=this.palette[e];this.data[n]=o.blue,this.data[n+1]=o.green,this.data[n+2]=o.red,this.data[n+3]=255}else this.data[n]=255,this.data[n+1]=255,this.data[n+2]=255,this.data[n+3]=255}0!=t&&(this.pos+=4-t)}},i.prototype.bit15=function(){for(var t=this.width%3,r=parseInt("11111",2),i=r,e=this.height-1;e>=0;e--){for(var n=0;n<this.width;n++){var o=this.buffer.readUInt16LE(this.pos);this.pos+=2;var s=(o&i)/i*255|0,a=(o>>5&i)/i*255|0,u=(o>>10&i)/i*255|0,h=o>>15?255:0,c=e*this.width*4+4*n;this.data[c]=u,this.data[c+1]=a,this.data[c+2]=s,this.data[c+3]=h}this.pos+=t}},i.prototype.bit16=function(){for(var t=this.width%3,r=parseInt("11111",2),i=r,e=parseInt("111111",2),n=e,o=this.height-1;o>=0;o--){for(var s=0;s<this.width;s++){var a=this.buffer.readUInt16LE(this.pos);this.pos+=2;var u=255,h=(a&i)/i*255|0,c=(a>>5&n)/n*255|0,f=(a>>11)/i*255|0,d=o*this.width*4+4*s;this.data[d]=f,this.data[d+1]=c,this.data[d+2]=h,this.data[d+3]=u}this.pos+=t}},i.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var r=0;r<this.width;r++){var i=this.buffer.readUInt8(this.pos++),e=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),o=t*this.width*4+4*r;this.data[o]=n,this.data[o+1]=e,this.data[o+2]=i,this.data[o+3]=255}this.pos+=this.width%4}},i.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--){for(var r=0;r<this.width;r++){var i=this.buffer.readUInt8(this.pos++),e=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),o=this.buffer.readUInt8(this.pos++),s=t*this.width*4+4*r;this.data[s]=n,this.data[s+1]=e,this.data[s+2]=i,this.data[s+3]=o}this.pos+=this.width%4}},i.prototype.getData=function(){return this.data},t.exports=function(t){var r=new i(t);return{data:r.getData(),width:r.width,height:r.height}}},function(t,r){"use strict";function i(t){this.buffer=t.data,this.width=t.width,this.height=t.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}i.prototype.encode=function(){var t=new Buffer(this.offset+this.rgbSize);this.pos=0,t.write(this.flag,this.pos,2),this.pos+=2,t.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,t.writeUInt32LE(this.reserved,this.pos),this.pos+=4,t.writeUInt32LE(this.offset,this.pos),this.pos+=4,t.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,t.writeUInt32LE(this.width,this.pos),this.pos+=4,t.writeUInt32LE(this.height,this.pos),this.pos+=4,t.writeUInt16LE(this.planes,this.pos),this.pos+=2,t.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,t.writeUInt32LE(this.compress,this.pos),this.pos+=4,t.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,t.writeUInt32LE(this.hr,this.pos),this.pos+=4,t.writeUInt32LE(this.vr,this.pos),this.pos+=4,t.writeUInt32LE(this.colors,this.pos),this.pos+=4,t.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var r=0,i=3*this.width+this.extraBytes,e=this.height-1;e>=0;e--){for(var n=0;n<this.width;n++){var o=this.pos+e*i+3*n;t[o+2]=this.buffer[r++],t[o+1]=this.buffer[r++],t[o]=this.buffer[r++],r++}if(this.extraBytes>0){var s=this.pos+e*i+3*this.width;t.fill(0,s,s+this.extraBytes)}}return t},t.exports=function(t,r){"undefined"==typeof r&&(r=100);var e=new i(t),n=e.encode();return{data:n,width:t.width,height:t.height}}},function(t,r,i){"use strict";var e=i(0)("unscopables"),n=Array.prototype;void 0==n[e]&&i(4)(n,e,{}),t.exports=function(t){n[e][t]=!0}},function(t,r){"use strict";t.exports=function(t,r,i,e){if(!(t instanceof r)||void 0!==e&&e in t)throw TypeError(i+": incorrect invocation!");return t}},function(t,r,i){"use strict";var e=i(24),n=i(36),o=i(76);t.exports=function(t){return function(r,i,s){var a,u=e(r),h=n(u.length),c=o(s,h);if(t&&i!=i){for(;h>c;)if(a=u[c++],a!=a)return!0}else for(;h>c;c++)if((t||c in u)&&u[c]===i)return t||c||0;return!t&&-1}}},function(t,r,i){"use strict";var e=i(11),n=i(59),o=i(58),s=i(2),a=i(36),u=i(78),h={},c={},f=t.exports=function(t,r,i,f,d){var p,l,v,m,w=d?function(){return t}:u(t),g=e(i,f,r?2:1),y=0;if("function"!=typeof w)throw TypeError(t+" is not iterable!");if(o(w)){for(p=a(t.length);p>y;y++)if(m=r?g(s(l=t[y])[0],l[1]):g(t[y]),m===h||m===c)return m}else for(v=w.call(t);!(l=v.next()).done;)if(m=n(v,g,l.value,r),m===h||m===c)return m};f.BREAK=h,f.RETURN=c},function(t,r,i){"use strict";t.exports=!i(6)&&!i(13)(function(){return 7!=Object.defineProperty(i(19)("div"),"a",{get:function(){return 7}}).a})},function(t,r){"use strict";t.exports=function(t,r,i){var e=void 0===i;switch(r.length){case 0:return e?t():t.call(i);case 1:return e?t(r[0]):t.call(i,r[0]);case 2:return e?t(r[0],r[1]):t.call(i,r[0],r[1]);case 3:return e?t(r[0],r[1],r[2]):t.call(i,r[0],r[1],r[2]);case 4:return e?t(r[0],r[1],r[2],r[3]):t.call(i,r[0],r[1],r[2],r[3])}return t.apply(i,r)}},function(t,r,i){"use strict";var e=i(8),n=i(0)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(e.Array===t||o[n]===t)}},function(t,r,i){"use strict";var e=i(2);t.exports=function(t,r,i,n){try{return n?r(e(i)[0],i[1]):r(i)}catch(r){var o=t.return;throw void 0!==o&&e(o.call(t)),r}}},function(t,r,i){"use strict";var e=i(65),n=i(33),o=i(21),s={};i(4)(s,i(0)("iterator"),function(){return this}),t.exports=function(t,r,i){t.prototype=e(s,{next:n(1,i)}),o(t,r+" Iterator")}},function(t,r,i){"use strict";var e=i(0)("iterator"),n=!1;try{var o=[7][e]();o.return=function(){n=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,r){if(!r&&!n)return!1;var i=!1;try{var o=[7],s=o[e]();s.next=function(){return{done:i=!0}},o[e]=function(){return s},t(o)}catch(t){}return i}},function(t,r){"use strict";t.exports=function(t,r){return{value:r,done:!!t}}},function(t,r,i){"use strict";var e=i(1),n=i(35).set,o=e.MutationObserver||e.WebKitMutationObserver,s=e.process,a=e.Promise,u="process"==i(10)(s);t.exports=function(){var t,r,i,h=function(){var e,n;for(u&&(e=s.domain)&&e.exit();t;){n=t.fn,t=t.next;try{n()}catch(e){throw t?i():r=void 0,e}}r=void 0,e&&e.enter()};if(u)i=function(){s.nextTick(h)};else if(o){var c=!0,f=document.createTextNode("");new o(h).observe(f,{characterData:!0}),i=function(){f.data=c=!c}}else if(a&&a.resolve){var d=a.resolve();i=function(){d.then(h)}}else i=function(){n.call(e,h)};return function(e){var n={fn:e,next:void 0};r&&(r.next=n),t||(t=n,i()),r=n}}},function(t,r,i){"use strict";var e=i(20),n=i(67),o=i(70),s=i(25),a=i(30),u=Object.assign;t.exports=!u||i(13)(function(){var t={},r={},i=Symbol(),e="abcdefghijklmnopqrst";return t[i]=7,e.split("").forEach(function(t){r[t]=t}),7!=u({},t)[i]||Object.keys(u({},r)).join("")!=e})?function(t,r){for(var i=s(t),u=arguments.length,h=1,c=n.f,f=o.f;u>h;)for(var d,p=a(arguments[h++]),l=c?e(p).concat(c(p)):e(p),v=l.length,m=0;v>m;)f.call(p,d=l[m++])&&(i[d]=p[d]);return i}:u},function(t,r,i){"use strict";var e=i(2),n=i(66),o=i(28),s=i(22)("IE_PROTO"),a=function(){},u="prototype",h=function(){var t,r=i(19)("iframe"),e=o.length,n="<",s=">";for(r.style.display="none",i(29).appendChild(r),r.src="javascript:",t=r.contentWindow.document,t.open(),t.write(n+"script"+s+"document.F=Object"+n+"/script"+s),t.close(),h=t.F;e--;)delete h[u][o[e]];return h()};t.exports=Object.create||function(t,r){var i;return null!==t?(a[u]=e(t),i=new a,a[u]=null,i[s]=t):i=h(),void 0===r?i:n(i,r)}},function(t,r,i){"use strict";var e=i(15),n=i(2),o=i(20);t.exports=i(6)?Object.defineProperties:function(t,r){n(t);for(var i,s=o(r),a=s.length,u=0;a>u;)e.f(t,i=s[u++],r[i]);return t}},function(t,r){"use strict";r.f=Object.getOwnPropertySymbols},function(t,r,i){"use strict";var e=i(7),n=i(25),o=i(22)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=n(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,r,i){"use strict";var e=i(7),n=i(24),o=i(54)(!1),s=i(22)("IE_PROTO");t.exports=function(t,r){var i,a=n(t),u=0,h=[];for(i in a)i!=s&&e(a,i)&&h.push(i);for(;r.length>u;)e(a,i=r[u++])&&(~o(h,i)||h.push(i));return h}},function(t,r){"use strict";r.f={}.propertyIsEnumerable},function(t,r,i){"use strict";var e=i(12),n=i(3),o=i(13);t.exports=function(t,r){var i=(n.Object||{})[t]||Object[t],s={};s[t]=r(i),e(e.S+e.F*o(function(){i(1)}),"Object",s)}},function(t,r,i){"use strict";var e=i(9);t.exports=function(t,r,i){for(var n in r)e(t,n,r[n],i);return t}},function(t,r,i){"use strict";var e=i(1),n=i(15),o=i(6),s=i(0)("species");t.exports=function(t){var r=e[t];o&&r&&!r[s]&&n.f(r,s,{configurable:!0,get:function(){return this}})}},function(t,r,i){"use strict";var e=i(2),n=i(16),o=i(0)("species");t.exports=function(t,r){var i,s=e(t).constructor;return void 0===s||void 0==(i=e(s)[o])?r:n(i)}},function(t,r,i){"use strict";var e=i(23),n=i(18);t.exports=function(t){return function(r,i){var o,s,a=String(n(r)),u=e(i),h=a.length;return u<0||u>=h?t?"":void 0:(o=a.charCodeAt(u),o<55296||o>56319||u+1===h||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):o:t?a.slice(u,u+2):(o-55296<<10)+(s-56320)+65536)}}},function(t,r,i){"use strict";var e=i(23),n=Math.max,o=Math.min;t.exports=function(t,r){return t=e(t),t<0?n(t+r,0):o(t,r)}},function(t,r,i){"use strict";var e=i(14);t.exports=function(t,r){if(!e(t))return t;var i,n;if(r&&"function"==typeof(i=t.toString)&&!e(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!e(n=i.call(t)))return n;if(!r&&"function"==typeof(i=t.toString)&&!e(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,r,i){"use strict";var e=i(17),n=i(0)("iterator"),o=i(8);t.exports=i(3).getIteratorMethod=function(t){if(void 0!=t)return t[n]||t["@@iterator"]||o[e(t)]}},function(t,r,i){"use strict";var e=i(52),n=i(62),o=i(8),s=i(24);t.exports=i(31)(Array,"Array",function(t,r){this._t=s(t),this._i=0,this._k=r},function(){var t=this._t,r=this._k,i=this._i++;return!t||i>=t.length?(this._t=void 0,n(1)):"keys"==r?n(0,i):"values"==r?n(0,t[i]):n(0,[i,t[i]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},function(t,r,i){"use strict";var e=i(17),n={};n[i(0)("toStringTag")]="z",n+""!="[object z]"&&i(9)(Object.prototype,"toString",function(){return"[object "+e(this)+"]"},!0)},function(t,r,i){"use strict";var e,n,o,s=i(32),a=i(1),u=i(11),h=i(17),c=i(12),f=i(14),d=i(16),p=i(53),l=i(55),v=i(74),m=i(35).set,w=i(63)(),g="Promise",y=a.TypeError,x=a.process,b=a[g],x=a.process,_="process"==h(x),S=function(){},I=!!function(){try{var t=b.resolve(1),r=(t.constructor={})[i(0)("species")]=function(t){t(S,S)};return(_||"function"==typeof PromiseRejectionEvent)&&t.then(S)instanceof r}catch(t){}}(),j=function(t,r){return t===r||t===b&&r===o},E=function(t){var r;return!(!f(t)||"function"!=typeof(r=t.then))&&r},M=function(t){return j(b,t)?new O(t):new n(t)},O=n=function(t){var r,i;this.promise=new t(function(t,e){if(void 0!==r||void 0!==i)throw y("Bad Promise constructor");r=t,i=e}),this.resolve=d(r),this.reject=d(i)},A=function(t){try{t()}catch(t){return{error:t}}},P=function(t,r){if(!t._n){t._n=!0;var i=t._c;w(function(){for(var e=t._v,n=1==t._s,o=0,s=function(r){var i,o,s=n?r.ok:r.fail,a=r.resolve,u=r.reject,h=r.domain;try{s?(n||(2==t._h&&L(t),t._h=1),s===!0?i=e:(h&&h.enter(),i=s(e),h&&h.exit()),i===r.promise?u(y("Promise-chain cycle")):(o=E(i))?o.call(i,a,u):a(i)):u(e)}catch(t){u(t)}};i.length>o;)s(i[o++]);t._c=[],t._n=!1,r&&!t._h&&U(t)})}},U=function(t){m.call(a,function(){var r,i,e,n=t._v;if(k(t)&&(r=A(function(){_?x.emit("unhandledRejection",n,t):(i=a.onunhandledrejection)?i({promise:t,reason:n}):(e=a.console)&&e.error&&e.error("Unhandled promise rejection",n)}),t._h=_||k(t)?2:1),t._a=void 0,r)throw r.error})},k=function t(r){if(1==r._h)return!1;for(var i,e=r._a||r._c,n=0;e.length>n;)if(i=e[n++],i.fail||!t(i.promise))return!1;return!0},L=function(t){m.call(a,function(){var r;_?x.emit("rejectionHandled",t):(r=a.onrejectionhandled)&&r({promise:t,reason:t._v})})},z=function(t){var r=this;r._d||(r._d=!0,r=r._w||r,r._v=t,r._s=2,r._a||(r._a=r._c.slice()),P(r,!0))},T=function t(r){var i,e=this;if(!e._d){e._d=!0,e=e._w||e;try{if(e===r)throw y("Promise can't be resolved itself");(i=E(r))?w(function(){var n={_w:e,_d:!1};try{i.call(r,u(t,n,1),u(z,n,1))}catch(t){ | ||
z.call(n,t)}}):(e._v=r,e._s=1,P(e,!1))}catch(t){z.call({_w:e,_d:!1},t)}}};I||(b=function(t){p(this,b,g,"_h"),d(t),e.call(this);try{t(u(T,this,1),u(z,this,1))}catch(t){z.call(this,t)}},e=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},e.prototype=i(72)(b.prototype,{then:function(t,r){var i=M(v(this,b));return i.ok="function"!=typeof t||t,i.fail="function"==typeof r&&r,i.domain=_?x.domain:void 0,this._c.push(i),this._a&&this._a.push(i),this._s&&P(this,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),O=function(){var t=new e;this.promise=t,this.resolve=u(T,t,1),this.reject=u(z,t,1)}),c(c.G+c.W+c.F*!I,{Promise:b}),i(21)(b,g),i(73)(g),o=i(3)[g],c(c.S+c.F*!I,g,{reject:function(t){var r=M(this),i=r.reject;return i(t),r.promise}}),c(c.S+c.F*(s||!I),g,{resolve:function(t){if(t instanceof b&&j(t.constructor,this))return t;var r=M(this),i=r.resolve;return i(t),r.promise}}),c(c.S+c.F*!(I&&i(61)(function(t){b.all(t).catch(S)})),g,{all:function(t){var r=this,i=M(r),e=i.resolve,n=i.reject,o=A(function(){var i=[],o=0,s=1;l(t,!1,function(t){var a=o++,u=!1;i.push(void 0),s++,r.resolve(t).then(function(t){u||(u=!0,i[a]=t,--s||e(i))},n)}),--s||e(i)});return o&&n(o.error),i.promise},race:function(t){var r=this,i=M(r),e=i.reject,n=A(function(){l(t,!1,function(t){r.resolve(t).then(i.resolve,e)})});return n&&e(n.error),i.promise}})},function(t,r,i){"use strict";var e=i(75)(!0);i(31)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,r=this._t,i=this._i;return i>=r.length?{value:void 0,done:!0}:(t=e(r,i),this._i+=t.length,{value:t,done:!1})})},function(t,r,i){"use strict";for(var e=i(79),n=i(9),o=i(1),s=i(4),a=i(8),u=i(0),h=u("iterator"),c=u("toStringTag"),f=a.Array,d=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var l,v=d[p],m=o[v],w=m&&m.prototype;if(w){w[h]||s(w,h,f),w[c]||s(w,c,v),a[v]=f;for(l in e)w[l]||n(w,l,e[l],!0)}}},function(t,r){"use strict";t.exports=function(t){return t&&t.length>1?255===t[0]&&216===t[1]&&255===t[2]?{ext:"jpg",mime:"image/jpeg"}:137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]?{ext:"png",mime:"image/png"}:71===t[0]&&73===t[1]&&70===t[2]?{ext:"gif",mime:"image/gif"}:87===t[8]&&69===t[9]&&66===t[10]&&80===t[11]?{ext:"webp",mime:"image/webp"}:70===t[0]&&76===t[1]&&73===t[2]&&70===t[3]?{ext:"flif",mime:"image/flif"}:(73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3])&&67===t[8]&&82===t[9]?{ext:"cr2",mime:"image/x-canon-cr2"}:73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3]?{ext:"tif",mime:"image/tiff"}:66===t[0]&&77===t[1]?{ext:"bmp",mime:"image/bmp"}:73===t[0]&&73===t[1]&&188===t[2]?{ext:"jxr",mime:"image/vnd.ms-photo"}:56===t[0]&&66===t[1]&&80===t[2]&&83===t[3]?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:80===t[0]&&75===t[1]&&3===t[2]&&4===t[3]&&109===t[30]&&105===t[31]&&109===t[32]&&101===t[33]&&116===t[34]&&121===t[35]&&112===t[36]&&101===t[37]&&97===t[38]&&112===t[39]&&112===t[40]&&108===t[41]&&105===t[42]&&99===t[43]&&97===t[44]&&116===t[45]&&105===t[46]&&111===t[47]&&110===t[48]&&47===t[49]&&101===t[50]&&112===t[51]&&117===t[52]&&98===t[53]&&43===t[54]&&122===t[55]&&105===t[56]&&112===t[57]?{ext:"epub",mime:"application/epub+zip"}:80===t[0]&&75===t[1]&&3===t[2]&&4===t[3]&&77===t[30]&&69===t[31]&&84===t[32]&&65===t[33]&&45===t[34]&&73===t[35]&&78===t[36]&&70===t[37]&&47===t[38]&&109===t[39]&&111===t[40]&&122===t[41]&&105===t[42]&&108===t[43]&&108===t[44]&&97===t[45]&&46===t[46]&&114===t[47]&&115===t[48]&&97===t[49]?{ext:"xpi",mime:"application/x-xpinstall"}:80!==t[0]||75!==t[1]||3!==t[2]&&5!==t[2]&&7!==t[2]||4!==t[3]&&6!==t[3]&&8!==t[3]?117===t[257]&&115===t[258]&&116===t[259]&&97===t[260]&&114===t[261]?{ext:"tar",mime:"application/x-tar"}:82!==t[0]||97!==t[1]||114!==t[2]||33!==t[3]||26!==t[4]||7!==t[5]||0!==t[6]&&1!==t[6]?31===t[0]&&139===t[1]&&8===t[2]?{ext:"gz",mime:"application/gzip"}:66===t[0]&&90===t[1]&&104===t[2]?{ext:"bz2",mime:"application/x-bzip2"}:55===t[0]&&122===t[1]&&188===t[2]&&175===t[3]&&39===t[4]&&28===t[5]?{ext:"7z",mime:"application/x-7z-compressed"}:120===t[0]&&1===t[1]?{ext:"dmg",mime:"application/x-apple-diskimage"}:0===t[0]&&0===t[1]&&0===t[2]&&(24===t[3]||32===t[3])&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]||51===t[0]&&103===t[1]&&112===t[2]&&53===t[3]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&109===t[8]&&112===t[9]&&52===t[10]&&50===t[11]&&109===t[16]&&112===t[17]&&52===t[18]&&49===t[19]&&109===t[20]&&112===t[21]&&52===t[22]&&50===t[23]&&105===t[24]&&115===t[25]&&111===t[26]&&109===t[27]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&105===t[8]&&115===t[9]&&111===t[10]&&109===t[11]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&109===t[8]&&112===t[9]&&52===t[10]&&50===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&0===t[15]?{ext:"mp4",mime:"video/mp4"}:0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&77===t[8]&&52===t[9]&&86===t[10]?{ext:"m4v",mime:"video/x-m4v"}:77===t[0]&&84===t[1]&&104===t[2]&&100===t[3]?{ext:"mid",mime:"audio/midi"}:109===t[31]&&97===t[32]&&116===t[33]&&114===t[34]&&111===t[35]&&115===t[36]&&107===t[37]&&97===t[38]?{ext:"mkv",mime:"video/x-matroska"}:26===t[0]&&69===t[1]&&223===t[2]&&163===t[3]?{ext:"webm",mime:"video/webm"}:0===t[0]&&0===t[1]&&0===t[2]&&20===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]?{ext:"mov",mime:"video/quicktime"}:82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]&&65===t[8]&&86===t[9]&&73===t[10]?{ext:"avi",mime:"video/x-msvideo"}:48===t[0]&&38===t[1]&&178===t[2]&&117===t[3]&&142===t[4]&&102===t[5]&&207===t[6]&&17===t[7]&&166===t[8]&&217===t[9]?{ext:"wmv",mime:"video/x-ms-wmv"}:0===t[0]&&0===t[1]&&1===t[2]&&"b"===t[3].toString(16)[0]?{ext:"mpg",mime:"video/mpeg"}:73===t[0]&&68===t[1]&&51===t[2]||255===t[0]&&251===t[1]?{ext:"mp3",mime:"audio/mpeg"}:102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&77===t[8]&&52===t[9]&&65===t[10]||77===t[0]&&52===t[1]&&65===t[2]&&32===t[3]?{ext:"m4a",mime:"audio/m4a"}:79===t[28]&&112===t[29]&&117===t[30]&&115===t[31]&&72===t[32]&&101===t[33]&&97===t[34]&&100===t[35]?{ext:"opus",mime:"audio/opus"}:79===t[0]&&103===t[1]&&103===t[2]&&83===t[3]?{ext:"ogg",mime:"audio/ogg"}:102===t[0]&&76===t[1]&&97===t[2]&&67===t[3]?{ext:"flac",mime:"audio/x-flac"}:82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]&&87===t[8]&&65===t[9]&&86===t[10]&&69===t[11]?{ext:"wav",mime:"audio/x-wav"}:35===t[0]&&33===t[1]&&65===t[2]&&77===t[3]&&82===t[4]&&10===t[5]?{ext:"amr",mime:"audio/amr"}:37===t[0]&&80===t[1]&&68===t[2]&&70===t[3]?{ext:"pdf",mime:"application/pdf"}:77===t[0]&&90===t[1]?{ext:"exe",mime:"application/x-msdownload"}:67!==t[0]&&70!==t[0]||87!==t[1]||83!==t[2]?123===t[0]&&92===t[1]&&114===t[2]&&116===t[3]&&102===t[4]?{ext:"rtf",mime:"application/rtf"}:119===t[0]&&79===t[1]&&70===t[2]&&70===t[3]&&(0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]||79===t[4]&&84===t[5]&&84===t[6]&&79===t[7])?{ext:"woff",mime:"application/font-woff"}:119===t[0]&&79===t[1]&&70===t[2]&&50===t[3]&&(0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]||79===t[4]&&84===t[5]&&84===t[6]&&79===t[7])?{ext:"woff2",mime:"application/font-woff"}:76===t[34]&&80===t[35]&&(0===t[8]&&0===t[9]&&1===t[10]||1===t[8]&&0===t[9]&&2===t[10]||2===t[8]&&0===t[9]&&2===t[10])?{ext:"eot",mime:"application/octet-stream"}:0===t[0]&&1===t[1]&&0===t[2]&&0===t[3]&&0===t[4]?{ext:"ttf",mime:"application/font-sfnt"}:79===t[0]&&84===t[1]&&84===t[2]&&79===t[3]&&0===t[4]?{ext:"otf",mime:"application/font-sfnt"}:0===t[0]&&0===t[1]&&1===t[2]&&0===t[3]?{ext:"ico",mime:"image/x-icon"}:70===t[0]&&76===t[1]&&86===t[2]&&1===t[3]?{ext:"flv",mime:"video/x-flv"}:37===t[0]&&33===t[1]?{ext:"ps",mime:"application/postscript"}:253===t[0]&&55===t[1]&&122===t[2]&&88===t[3]&&90===t[4]&&0===t[5]?{ext:"xz",mime:"application/x-xz"}:83===t[0]&&81===t[1]&&76===t[2]&&105===t[3]?{ext:"sqlite",mime:"application/x-sqlite3"}:78===t[0]&&69===t[1]&&83===t[2]&&26===t[3]?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:67===t[0]&&114===t[1]&&50===t[2]&&52===t[3]?{ext:"crx",mime:"application/x-google-chrome-extension"}:77===t[0]&&83===t[1]&&67===t[2]&&70===t[3]||73===t[0]&&83===t[1]&&99===t[2]&&40===t[3]?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:33===t[0]&&60===t[1]&&97===t[2]&&114===t[3]&&99===t[4]&&104===t[5]&&62===t[6]&&10===t[7]&&100===t[8]&&101===t[9]&&98===t[10]&&105===t[11]&&97===t[12]&&110===t[13]&&45===t[14]&&98===t[15]&&105===t[16]&&110===t[17]&&97===t[18]&&114===t[19]&&121===t[20]?{ext:"deb",mime:"application/x-deb"}:33===t[0]&&60===t[1]&&97===t[2]&&114===t[3]&&99===t[4]&&104===t[5]&&62===t[6]?{ext:"ar",mime:"application/x-unix-archive"}:237===t[0]&&171===t[1]&&238===t[2]&&219===t[3]?{ext:"rpm",mime:"application/x-rpm"}:31===t[0]&&160===t[1]||31===t[0]&&157===t[1]?{ext:"Z",mime:"application/x-compress"}:76===t[0]&&90===t[1]&&73===t[2]&&80===t[3]?{ext:"lz",mime:"application/x-lzip"}:208===t[0]&&207===t[1]&&17===t[2]&&224===t[3]&&161===t[4]&&177===t[5]&&26===t[6]&&225===t[7]?{ext:"msi",mime:"application/x-msi"}:null:{ext:"swf",mime:"application/x-shockwave-flash"}:{ext:"rar",mime:"application/x-rar-compressed"}:{ext:"zip",mime:"application/zip"}:null}},function(t,r,i){"use strict";var e=i(84);t.exports=function(t){var r=["jpg","png","gif","webp","tif","bmp","jxr","psd"],i=e(t);return r.indexOf(i&&i.ext)!==-1?i:null}},function(t,r,i){"use strict";function e(t){for(var r=2*t+1,i=new Array(Math.pow(r,2)),e=0;e<r;e++)for(var n=0;n<r;n++)i[e*r+n]=Math.pow(e-t,2)+Math.pow(n-t,2);return{data:i,width:r,height:r}}function n(t,r){for(var i=t.data,e=t.width,n=t.height,o=new Array(i.length),s=0;s<i.length;s++)o[s]=Math.exp(-i[s]/(2*Math.pow(r,2)));return{data:o,width:e,height:n}}function o(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"gaussian",arguments.length>1&&void 0!==arguments[1]?arguments[1]:3),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1.5;t=(t-1)/2;var i=e(t),o=n(i,r),s=a(o);return u(o,s)}var s=i(5),a=s.sum2d,u=s.divide2d;t.exports={fspecial:o}},function(t,r,i){"use strict";function e(t,r,i,e){if(t=h(t,f([r/2,i/2]),e),0===a(r,2)&&(t.data=t.data.slice(0,-t.width),t.height--),0===a(i,2)){for(var n=[],o=0;o<t.data.length;o++)(o+1)%t.width!==0&&n.push(t.data[o]);t.data=n,t.width--}return t}function n(t){return"same"===t&&(t="valid"),t}function o(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symmetric",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"same";return t=e(t,r.width,r.height,i),o=n(o),p(r,t,o)}var s=i(40),a=s.mod,u=i(42),h=u.padarray,c=i(5),f=c.floor,d=i(38),p=d.filter2;t.exports={imfilter:o}},function(t,r){"use strict";function i(t){for(var r=t.data,i=t.width,e=t.height,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=2.5066282746310007,a=new Array(r.length),u=0;u<r.length;u++){var h=(r[u]-n)/o;a[u]=Math.exp(-Math.pow(h,2)/2)/(o*s)}return{data:a,width:i,height:e}}t.exports={normpdf:i}},function(t,r){"use strict";function i(t){var r=n(t,3),i=r[0],e=r[1],o=r[2];return Math.round(.29894*i+.58704*e+.11402*o)}function e(t){for(var r=t.data,e=t.width,n=t.height,o=new Array(e*n),s=0;s<n;s++)for(var a=0;a<e;a++){var u=a+s*e,h=4*u;o[u]=i([r[h],r[h+1],r[h+2],r[h+3]])}return{data:o,width:e,height:n}}var n=function(){function t(t,r){var i=[],e=!0,n=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(e=(s=a.next()).done)&&(i.push(s.value),!r||i.length!==r);e=!0);}catch(t){n=!0,o=t}finally{try{!e&&a.return&&a.return()}finally{if(n)throw o}}return i}return function(r,i){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.exports={rgb2gray:e}},function(t,r){"use strict";function i(t,r,i){for(var n=e(r,3),o=n[0],s=n[1],a=n[2],u=e(i,3),h=u[0],c=u[1],f=u[2],d=Math.ceil((f-h)/c),p=Math.ceil((a-o)/s),l=new Array(d*p),v=0;v<p;v++)for(var m=0;m<d;m++){var w=o+v*s,g=h+m*c;l[v*d+m]=t.data[w*t.width+g]}return{data:l,width:d,height:p}}var e=function(){function t(t,r){var i=[],e=!0,n=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(e=(s=a.next()).done)&&(i.push(s.value),!r||i.length!==r);e=!0);}catch(t){n=!0,o=t}finally{try{!e&&a.return&&a.return()}finally{if(n)throw o}}return i}return function(r,i){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.exports={skip2d:i}},function(t,r){"use strict";function i(t,r,i,e,n){for(var o=t.data,s=t.width,a=new Array(n*i),u=0;u<i;u++)for(var h=0;h<n;h++)a[u*n+h]=o[(e+u)*s+r+h];return{data:a,width:n,height:i}}t.exports={sub:i}},function(t,r){"use strict";function i(t){for(var r=t.data,i=t.width,e=t.height,n=new Array(i*e),o=0;o<e;o++)for(var s=0;s<i;s++)n[s*e+o]=r[o*i+s];return{data:n,height:i,width:e}}t.exports={transpose:i}},function(t,r,i){"use strict";function e(t,r,i){var e=d("gaussian",i.windowSize,1.5),n=Math.pow(2,i.bitDepth)-1,c=Math.pow(i.k1*n,2),m=Math.pow(i.k2*n,2);if(e=s(e,h(e)),"original"===i.downsample){var w=Math.min(t.width,t.height)/i.maxSize,g=Math.round(w),y=Math.max(1,g);if(y>1){var x=l(y);x=s(x,h(x)),t=p(t,x,"symmetric","same"),r=p(r,x,"symmetric","same"),t=v(t,[0,y,t.height],[0,y,t.width]),r=v(r,[0,y,r.height],[0,y,r.width])}}var b=f(e,t,"valid"),_=f(e,r,"valid"),S=u(b),I=u(_),j=a(b,_),E=u(t),M=u(r),O=a(S,-1),A=a(I,-1),P=a(j,-1),U=o(f(e,E,"valid"),O),k=o(f(e,M,"valid"),A),L=o(f(e,a(t,r),"valid"),P);if(c>0&&m>0){var z=o(a(j,2),c),T=o(a(L,2),m),B=o(o(S,I),c),F=o(o(U,k),m);return s(a(z,T),a(B,F))}var q=a(j,2),D=a(L,2),C=o(S,I),R=o(U,k);return s(a(q,D),a(C,R))}var n=i(5),o=n.add2d,s=n.divide2d,a=n.multiply2d,u=n.square2d,h=n.sum2d,c=i(27),f=c.filter2,d=c.fspecial,p=c.imfilter,l=c.ones,v=c.skip2d;t.exports={originalSsim:e}},function(t,r,i){"use strict";function e(t,r){var i=c(t),e=i.ext,n=void 0;if("bmp"===e)n=f.decode(t);else{var o=new h.Image;o.src=t;var s=p(o.width,o.height,r),a=s.width,u=s.height,d=new h(a,u),l=d.getContext("2d");l.drawImage(o,0,0,o.width,o.height,0,0,a,u),n=l.getImageData(0,0,a,u)}return new Promise(function(t){t(n)})}function n(t){return new Promise(function(r,i){u.get(t).on("response",function(t){var i=[];t.on("data",function(t){return i.push(t)}),t.on("end",function(){return r(Buffer.concat(i))})}).on("error",i)})}function o(t){return new Promise(function(r,i){a.readFile(t,function(t,e){return t?void i(t):void r(e)})})}function s(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=void 0;return i=Buffer.isBuffer(t)?Promise.resolve(t):0===t.indexOf("http://")||0===t.indexOf("https://")?n(t):o(t),i.then(function(t){return e(t,r)})}var a=i(99),u=i(100),h=i(98),c=i(85),f=i(49),d=i(44),p=d.getLimitDimensions;t.exports={readpixels:s}},function(t,r,i){"use strict";function e(t,r,i){var e=y(n(i.windowSize),0,1.5),u=Math.pow(2,i.bitDepth)-1,c=Math.pow(i.k1*u,2),m=Math.pow(i.k2*u,2);e=d(e,v(e));var g=_(e);if("original"===i.downsample){var x=a(t,r,i.maxSize),b=h(x,2);t=b[0],r=b[1]}var S=w(t,e,g,"valid"),I=w(r,e,g,"valid"),j=l(S),E=l(I),M=p(S,I),O=l(t),A=l(r),P=p(j,-1),U=p(E,-1),k=p(M,-1),L=f(w(O,e,g,"valid"),P),z=f(w(A,e,g,"valid"),U),T=f(w(p(t,r),e,g,"valid"),k);return c>0&&m>0?o(M,T,j,E,L,z,c,m):s(M,T,j,E,L,z)}function n(t){for(var r=Math.floor(t/2),i=new Array(2*r+1),e=-r;e<=r;e++)i[e+r]=Math.abs(e);return{data:i,width:i.length,height:1}}function o(t,r,i,e,n,o,s,a){var u=f(p(t,2),s),h=f(p(r,2),a),c=f(f(i,e),s),l=f(f(n,o),a);return d(p(u,h),p(c,l))}function s(t,r,i,e,n,o){var s=p(t,2),a=p(r,2),u=f(i,e),h=f(n,o);return d(p(s,a),p(u,h))}function a(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256,e=Math.min(t.width,r.height)/i,n=Math.round(e);if(n>1){var o=x(n);o=d(o,v(o)),t=u(t,o,n),r=u(r,o,n)}return[t,r]}function u(t,r,i){var e=g(t,r,"symmetric","same");return b(e,[0,i,e.height],[0,i,e.width])}var h=function(){function t(t,r){var i=[],e=!0,n=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(e=(s=a.next()).done)&&(i.push(s.value),!r||i.length!==r);e=!0);}catch(t){n=!0,o=t}finally{try{!e&&a.return&&a.return()}finally{if(n)throw o}}return i}return function(r,i){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=i(5),f=c.add2d,d=c.divide2d,p=c.multiply2d,l=c.square2d,v=c.sum2d,m=i(27),w=m.conv2,g=m.imfilter,y=m.normpdf,x=m.ones,b=m.skip2d,_=m.transpose;t.exports={ssim:e}},function(t,r){"use strict";t.exports={type:"deploy",version:"2.3.2"}},function(t,r){t.exports={windowSize:11,k1:.01,k2:.03,bitDepth:8,downsample:"original",ssim:"fast",maxSize:256}},function(r,i){r.exports=t},function(t,r){t.exports=require("fs")},function(t,r){t.exports=require("https")},function(t,r,i){i(46),i(48),i(47),t.exports=i(45)}])}); | ||
!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i(require("canvas"),require("fs"),require("https")):"function"==typeof define&&define.amd?define(["canvas","fs","https"],i):"object"==typeof exports?exports.ssim=i(require("canvas"),require("fs"),require("https")):t.ssim=i(t.canvas,t.fs,t.https)}(this,function(t,i,e){return function(t){function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}var e={};return i.m=t,i.c=e,i.i=function(t){return t},i.d=function(t,i,e){Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:e})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},i.p="",i(i.s=70)}([function(t,i){function e(t){return r(t)/t.length}function r(t){for(var i=0,e=0;e<t.length;e++)i+=t[e];return i}function n(t){for(var i=new Array(t.length),e=0;e<t.length;e++)i[e]=Math.floor(t[e]);return i}function o(t){for(var i=t.data,e=0,r=0;r<i.length;r++)e+=i[r];return e}function a(t,i){for(var e=t.data,r=t.width,n=t.height,o=i.data,a=new Array(e.length),h=0;h<n;h++)for(var s=h*r,f=0;f<r;f++)a[s+f]=e[s+f]+o[s+f];return{data:a,width:r,height:n}}function h(t,i){for(var e=t.data,r=t.width,n=t.height,o=new Array(e.length),a=0;a<e.length;a++)o[a]=e[a]+i;return{data:o,width:r,height:n}}function s(t,i){return"number"==typeof i?h(t,i):a(t,i)}function f(t,i){for(var e=t.data,r=t.width,n=t.height,o=new Array(e.length),a=0;a<e.length;a++)o[a]=e[a]/i;return{data:o,width:r,height:n}}function u(t,i){for(var e=t.data,r=t.width,n=t.height,o=i.data,a=new Array(e.length),h=0;h<e.length;h++)a[h]=e[h]/o[h];return{data:a,width:r,height:n}}function d(t,i){return"number"==typeof i?f(t,i):u(t,i)}function c(t,i){for(var e=t.data,r=t.width,n=t.height,o=new Array(e.length),a=0;a<e.length;a++)o[a]=e[a]*i;return{data:o,width:r,height:n}}function p(t,i){for(var e=t.data,r=t.width,n=t.height,o=i.data,a=new Array(e.length),h=0;h<e.length;h++)a[h]=e[h]*o[h];return{data:a,width:r,height:n}}function l(t,i){return"number"==typeof i?c(t,i):p(t,i)}function m(t){return l(t,t)}function v(t){return o(t)/t.data.length}t.exports={add2d:s,average:e,divide2d:d,floor:n,mean2d:v,multiply2d:l,square2d:m,sum:r,sum2d:o}},function(t,i){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,i){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)},function(t,i){var e=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=e)},function(t,i,e){t.exports=!e(1)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,i){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){return"object"===("undefined"==typeof t?"undefined":e(t))?null!==t:"function"==typeof t}},function(t,i,e){var r=e(17),n=r.conv2,o=e(18),a=o.filter2,h=e(55),s=h.fspecial,f=e(56),u=f.imfilter,d=e(57),c=d.normpdf,p=e(21),l=p.ones,m=e(22),v=m.padarray,w=e(58),g=w.rgb2gray,x=e(59),y=x.skip2d,b=e(61),I=b.transpose,E=e(23),S=E.zeros;t.exports={conv2:n,filter2:a,fspecial:s,imfilter:u,normpdf:c,ones:l,padarray:v,rgb2gray:g,skip2d:y,transpose:I,zeros:S}},function(t,i){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,i,e){var r=e(2),n=e(3),o=e(10),a=e(46),h=e(35),s="prototype",f=function t(i,e,f){var u,d,c,p,l=i&t.F,m=i&t.G,v=i&t.S,w=i&t.P,g=i&t.B,x=m?r:v?r[e]||(r[e]={}):(r[e]||{})[s],y=m?n:n[e]||(n[e]={}),b=y[s]||(y[s]={});m&&(f=e);for(u in f)d=!l&&x&&void 0!==x[u],c=(d?x:f)[u],p=g&&d?h(c,r):w&&"function"==typeof c?h(Function.call,c):c,x&&a(x,u,c,i&t.U),y[u]!=c&&o(y,u,p),w&&b[u]!=c&&(b[u]=c)};r.core=n,f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},function(t,i){var e={}.hasOwnProperty;t.exports=function(t,i){return e.call(t,i)}},function(t,i,e){var r=e(40),n=e(45);t.exports=e(4)?function(t,i,e){return r.f(t,i,n(1,e))}:function(t,i,e){return t[i]=e,t}},function(t,i,e){var r=e(34);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,i,e){var r=e(42),n=e(37);t.exports=Object.keys||function(t){return r(t,n)}},function(t,i){var e=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:e)(t)}},function(t,i,e){var r=e(11),n=e(7);t.exports=function(t){return r(n(t))}},function(t,i,e){var r=e(7);t.exports=function(t){return Object(r(t))}},function(t,i){var e=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++e+r).toString(36))}},function(t,i,e){function r(t,i){for(var e=t.data,r=t.width,n=t.height,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"full",a=r+i.width-1,s=n+i.height-1,f=c(s,a),u=f.data,d=0;d<i.height;d++)for(var p=0;p<i.width;p++){var l=i.data[d*i.width+p];if(l)for(var m=0;m<n;m++)for(var v=0;v<r;v++)u[(m+d)*a+v+p]+=e[m*r+v]*l}var w={data:u,width:a,height:s};return h(w,o,n,i.height,r,i.width)}function n(t,i){var e=i.data,r=i.width,n=i.height,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"full",h=l(n,1),s=l(1,r),f=a(t,h,s,o);return v(f,e[0])}function o(t){for(var i=t.data,e=i[0],r=1;r<i.length;r++)if(i[r]!==e)return!1;return!0}function a(t,i,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"full",o=Math.max(i.height,i.width),a=Math.max(e.height,e.width),s=r(t,i,"full"),f=r(s,e,"full");return h(f,n,t.height,o,t.width,a)}function h(t,i,e,r,n,o){if("full"===i)return t;if("same"===i){var a=Math.ceil((t.height-e)/2),h=Math.ceil((t.width-n)/2);return u(t,a,e,h,n)}return u(t,r-1,e-r+1,o-1,n-o+1)}function s(){for(var t=arguments.length,i=Array(t),e=0;e<t;e++)i[e]=arguments[e];return i[2]&&i[2].data?a.apply(void 0,i):o(i[1])?n.apply(void 0,i):r.apply(void 0,i)}var f=e(60),u=f.sub,d=e(23),c=d.zeros,p=e(21),l=p.ones,m=e(0),v=m.multiply2d;t.exports={conv2:s}},function(t,i,e){function r(t){for(var i=t.data,e=t.width,r=t.height,n=new Array(i.length),o=0;o<r;o++)for(var a=0;a<e;a++)n[o*e+a]=i[(r-1-o)*e+e-1-a];return{data:n,width:e,height:r}}function n(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"same";return a(i,r(t),e)}var o=e(17),a=o.conv2;t.exports={filter2:n}},function(t,i){function e(t,i,e){for(var r=i*t,n=new Array(r),o=0;o<r;o++)n[o]=e;return{data:n,width:i,height:t}}t.exports={numbers:e}},function(t,i){function e(t,i){return t-i*Math.floor(t/i)}t.exports={mod:e}},function(t,i,e){function r(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return o(t,i,1)}var n=e(19),o=n.numbers;t.exports={ones:r}},function(t,i,e){function r(t){for(var i=t.data,e=t.width,r=t.height,n=new Array(i.length),o=0;o<r;o++)for(var a=0;a<e;a++)n[o*e+a]=i[o*e+e-1-a];return{data:n,width:e,height:r}}function n(t){for(var i=t.data,e=t.width,r=t.height,n=new Array(i.length),o=0;o<r;o++)for(var a=0;a<e;a++)n[o*e+a]=i[(r-1-o)*e+a];return{data:n,width:e,height:r}}function o(t,i){for(var e=t.width+i.width,r=new Array(t.height*e),n=0;n<t.height;n++){for(var o=0;o<t.width;o++)r[n*e+o]=t.data[n*t.width+o];for(var a=0;a<i.width;a++)r[n*e+a+t.width]=i.data[n*i.width+a]}return{data:r,width:e,height:t.height}}function a(t,i){return{data:t.data.concat(i.data),height:t.height+i.height,width:t.width}}function h(t,i){for(var e=t.width+2*i,n=new Array(e*t.height),a=o(t,r(t)),h=0;h<t.height;h++)for(var s=-i;s<t.width+i;s++)n[h*e+s+i]=a.data[h*a.width+p(s,a.width)];return{data:n,width:e,height:t.height}}function s(t,i){for(var e=a(t,n(t)),r=t.height+2*i,o=new Array(t.width*r),h=-i;h<t.height+i;h++)for(var s=0;s<t.width;s++)o[(h+i)*t.width+s]=e.data[p(h,e.height)*t.width+s];return{data:o,width:t.width,height:r}}function f(t,i){for(var e=d(i,2),r=e[0],n=e[1],o=t.width+2*n,a=t.height+2*r,h=new Array(o*a),s=-r;s<0;s++){for(var f=-n;f<0;f++)h[(s+r)*o+f+n]=t.data[(Math.abs(s)-1)*t.width+Math.abs(f)-1];for(var u=0;u<t.width;u++)h[(s+r)*o+u+n]=t.data[(Math.abs(s)-1)*t.width+u];for(var c=t.width;c<t.width+n;c++)h[(s+r)*o+c+n]=t.data[(Math.abs(s)-1)*t.width+2*t.width-c-1]}for(var p=0;p<t.height;p++){for(var l=-n;l<0;l++)h[(p+r)*o+l+n]=t.data[p*t.width+Math.abs(l)-1];for(var m=0;m<t.width;m++)h[(p+r)*o+m+n]=t.data[p*t.width+m];for(var v=t.width;v<t.width+n;v++)h[(p+r)*o+v+n]=t.data[p*t.width+2*t.width-v-1]}for(var w=t.height;w<t.height+r;w++){for(var g=-n;g<0;g++)h[(w+r)*o+g+n]=t.data[(2*t.height-w-1)*t.width+Math.abs(g)-1];for(var x=0;x<t.width;x++)h[(w+r)*o+x+n]=t.data[(2*t.height-w-1)*t.width+x];for(var y=t.width;y<t.width+n;y++)h[(w+r)*o+y+n]=t.data[(2*t.height-w-1)*t.width+2*t.width-y-1]}return{data:h,width:o,height:a}}function u(t,i){var e=d(i,2),r=e[0],n=e[1];return t.height>=r&&t.width>=n?f(t,[r,n]):s(h(t,n),r)}var d=function(){function t(t,i){var e=[],r=!0,n=!1,o=void 0;try{for(var a,h=t[Symbol.iterator]();!(r=(a=h.next()).done)&&(e.push(a.value),!i||e.length!==i);r=!0);}catch(t){n=!0,o=t}finally{try{!r&&h.return&&h.return()}finally{if(n)throw o}}return e}return function(i,e){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return t(i,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=e(20),p=c.mod;t.exports={padarray:u}},function(t,i,e){function r(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return o(t,i,0)}var n=e(19),o=n.numbers;t.exports={zeros:r}},function(t,i){function e(t){throw new Error("Missing "+t+" parameter")}function r(t,i,e){if(e&&t>=e&&i>=e){var r=t/i;return r>1?{height:e,width:Math.round(e/r)}:{height:Math.round(e*r),width:e}}return{width:t,height:i}}t.exports={force:e,getLimitDimensions:r}},function(t,i,e){function r(t){if(Object.keys(t).forEach(function(t){if(!(t in b))throw new Error('"'+t+'" is not a valid option')}),"k1"in t&&("number"!=typeof t.k1||t.k1<0))throw new Error("Invalid k1 value. Default is "+b.k1);if("k2"in t&&("number"!=typeof t.k2||t.k2<0))throw new Error("Invalid k2 value. Default is "+b.k2)}function n(t){return r(t),Object.assign({},b,t)}function o(t){if(t[0].width!==t[1].width||t[0].height!==t[1].height)throw new Error("Image dimensions do not match");return t}function a(t){return[c(t[0]),c(t[1])]}function h(t,i){return"fast"===i.downsample?u(t,s.Promise,i.maxSize):u(t,s.Promise)}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y("image1"),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y("image2"),e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(new Date).getTime();e=n(e);var f="fast"===e.ssim?v:g;return s.Promise.all([h(t,e),h(i,e)]).then(o).then(a).then(function(t){return f(t[0],t[1],e)}).then(function(t){return{ssim_map:t,mssim:l(t),performance:(new Date).getTime()-r}})}var f=e(63),u=f.readpixels,d=e(6),c=d.rgb2gray,p=e(0),l=p.mean2d,m=e(64),v=m.ssim,w=e(62),g=w.originalSsim,x=e(24),y=x.force,b=e(66),I=e(65),E=I.version,S=e(54);s.Promise=this.Promise||S,s.ssim=v,s.version=E,t.exports=s},function(t,i,e){var r=e(8);r(r.S+r.F,"Object",{assign:e(39)})},function(t,i,e){var r=e(15),n=e(12);e(44)("keys",function(){return function(t){return n(r(t))}})},function(t,i,e){var r=e(30),n=e(29);t.exports={encode:r,decode:n}},function(t,i){function e(t,i){if(this.pos=0,this.buffer=t,this.is_with_alpha=!!i,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),"BM"!=this.flag)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}e.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var i=0;i<t;i++){var e=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),o=this.buffer.readUInt8(this.pos++);this.palette[i]={red:n,green:r,blue:e,quad:o}}}},e.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,i=this.width*this.height*4;this.data=new Buffer(i),this[t]()}catch(t){console.log("bit decode error:"+t)}},e.prototype.bit1=function(){for(var t=Math.ceil(this.width/8),i=t%4,e=this.height-1;e>=0;e--){for(var r=0;r<t;r++)for(var n=this.buffer.readUInt8(this.pos++),o=e*this.width*4+8*r*4,a=0;a<8&&8*r+a<this.width;a++){var h=this.palette[n>>7-a&1];this.data[o+4*a]=h.blue,this.data[o+4*a+1]=h.green,this.data[o+4*a+2]=h.red,this.data[o+4*a+3]=255}0!=i&&(this.pos+=4-i)}},e.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),i=t%4,e=this.height-1;e>=0;e--){for(var r=0;r<t;r++){var n=this.buffer.readUInt8(this.pos++),o=e*this.width*4+2*r*4,a=n>>4,h=15&n,s=this.palette[a];if(this.data[o]=s.blue,this.data[o+1]=s.green,this.data[o+2]=s.red,this.data[o+3]=255,2*r+1>=this.width)break;s=this.palette[h],this.data[o+4]=s.blue,this.data[o+4+1]=s.green,this.data[o+4+2]=s.red,this.data[o+4+3]=255}0!=i&&(this.pos+=4-i)}},e.prototype.bit8=function(){for(var t=this.width%4,i=this.height-1;i>=0;i--){for(var e=0;e<this.width;e++){var r=this.buffer.readUInt8(this.pos++),n=i*this.width*4+4*e;if(r<this.palette.length){var o=this.palette[r];this.data[n]=o.blue,this.data[n+1]=o.green,this.data[n+2]=o.red,this.data[n+3]=255}else this.data[n]=255,this.data[n+1]=255,this.data[n+2]=255,this.data[n+3]=255}0!=t&&(this.pos+=4-t)}},e.prototype.bit15=function(){for(var t=this.width%3,i=parseInt("11111",2),e=i,r=this.height-1;r>=0;r--){for(var n=0;n<this.width;n++){var o=this.buffer.readUInt16LE(this.pos);this.pos+=2;var a=(o&e)/e*255|0,h=(o>>5&e)/e*255|0,s=(o>>10&e)/e*255|0,f=o>>15?255:0,u=r*this.width*4+4*n;this.data[u]=s,this.data[u+1]=h,this.data[u+2]=a,this.data[u+3]=f}this.pos+=t}},e.prototype.bit16=function(){for(var t=this.width%3,i=parseInt("11111",2),e=i,r=parseInt("111111",2),n=r,o=this.height-1;o>=0;o--){for(var a=0;a<this.width;a++){var h=this.buffer.readUInt16LE(this.pos);this.pos+=2;var s=255,f=(h&e)/e*255|0,u=(h>>5&n)/n*255|0,d=(h>>11)/e*255|0,c=o*this.width*4+4*a;this.data[c]=d,this.data[c+1]=u,this.data[c+2]=f,this.data[c+3]=s}this.pos+=t}},e.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var i=0;i<this.width;i++){var e=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),o=t*this.width*4+4*i;this.data[o]=n,this.data[o+1]=r,this.data[o+2]=e,this.data[o+3]=255}this.pos+=this.width%4}},e.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--){for(var i=0;i<this.width;i++){var e=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),o=this.buffer.readUInt8(this.pos++),a=t*this.width*4+4*i;this.data[a]=n,this.data[a+1]=r,this.data[a+2]=e,this.data[a+3]=o}this.pos+=this.width%4}},e.prototype.getData=function(){return this.data},t.exports=function(t){var i=new e(t);return{data:i.getData(),width:i.width,height:i.height}}},function(t,i){function e(t){this.buffer=t.data,this.width=t.width,this.height=t.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}e.prototype.encode=function(){var t=new Buffer(this.offset+this.rgbSize);this.pos=0,t.write(this.flag,this.pos,2),this.pos+=2,t.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,t.writeUInt32LE(this.reserved,this.pos),this.pos+=4,t.writeUInt32LE(this.offset,this.pos),this.pos+=4,t.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,t.writeUInt32LE(this.width,this.pos),this.pos+=4,t.writeUInt32LE(this.height,this.pos),this.pos+=4,t.writeUInt16LE(this.planes,this.pos),this.pos+=2,t.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,t.writeUInt32LE(this.compress,this.pos),this.pos+=4,t.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,t.writeUInt32LE(this.hr,this.pos),this.pos+=4,t.writeUInt32LE(this.vr,this.pos),this.pos+=4,t.writeUInt32LE(this.colors,this.pos),this.pos+=4,t.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var i=0,e=3*this.width+this.extraBytes,r=this.height-1;r>=0;r--){for(var n=0;n<this.width;n++){var o=this.pos+r*e+3*n;t[o+2]=this.buffer[i++],t[o+1]=this.buffer[i++],t[o]=this.buffer[i++],i++}if(this.extraBytes>0){var a=this.pos+r*e+3*this.width;t.fill(0,a,a+this.extraBytes)}}return t},t.exports=function(t,i){"undefined"==typeof i&&(i=100);var r=new e(t),n=r.encode();return{data:n,width:t.width,height:t.height}}},function(t,i){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,i,e){var r=e(5);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,i,e){var r=e(14),n=e(50),o=e(49);t.exports=function(t){return function(i,e,a){var h,s=r(i),f=n(s.length),u=o(a,f);if(t&&e!=e){for(;f>u;)if(h=s[u++],h!=h)return!0}else for(;f>u;u++)if((t||u in s)&&s[u]===e)return t||u||0;return!t&&-1}}},function(t,i){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},function(t,i,e){var r=e(31);t.exports=function(t,i,e){if(r(t),void 0===i)return t;switch(e){case 1:return function(e){return t.call(i,e)};case 2:return function(e,r){return t.call(i,e,r)};case 3:return function(e,r,n){return t.call(i,e,r,n)}}return function(){return t.apply(i,arguments)}}},function(t,i,e){var r=e(5),n=e(2).document,o=r(n)&&r(n.createElement);t.exports=function(t){return o?n.createElement(t):{}}},function(t,i){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,i,e){t.exports=!e(4)&&!e(1)(function(){return 7!=Object.defineProperty(e(36)("div"),"a",{get:function(){return 7}}).a})},function(t,i,e){"use strict";var r=e(12),n=e(41),o=e(43),a=e(15),h=e(11),s=Object.assign;t.exports=!s||e(1)(function(){var t={},i={},e=Symbol(),r="abcdefghijklmnopqrst";return t[e]=7,r.split("").forEach(function(t){i[t]=t}),7!=s({},t)[e]||Object.keys(s({},i)).join("")!=r})?function(t,i){for(var e=a(t),s=arguments.length,f=1,u=n.f,d=o.f;s>f;)for(var c,p=h(arguments[f++]),l=u?r(p).concat(u(p)):r(p),m=l.length,v=0;m>v;)d.call(p,c=l[v++])&&(e[c]=p[c]);return e}:s},function(t,i,e){var r=e(32),n=e(38),o=e(51),a=Object.defineProperty;i.f=e(4)?Object.defineProperty:function(t,i,e){if(r(t),i=o(i,!0),r(e),n)try{return a(t,i,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[i]=e.value),t}},function(t,i){i.f=Object.getOwnPropertySymbols},function(t,i,e){var r=e(9),n=e(14),o=e(33)(!1),a=e(47)("IE_PROTO");t.exports=function(t,i){var e,h=n(t),s=0,f=[];for(e in h)e!=a&&r(h,e)&&f.push(e);for(;i.length>s;)r(h,e=i[s++])&&(~o(f,e)||f.push(e));return f}},function(t,i){i.f={}.propertyIsEnumerable},function(t,i,e){var r=e(8),n=e(3),o=e(1);t.exports=function(t,i){var e=(n.Object||{})[t]||Object[t],a={};a[t]=i(e),r(r.S+r.F*o(function(){e(1)}),"Object",a)}},function(t,i){t.exports=function(t,i){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:i}}},function(t,i,e){var r=e(2),n=e(10),o=e(9),a=e(16)("src"),h="toString",s=Function[h],f=(""+s).split(h);e(3).inspectSource=function(t){return s.call(t)},(t.exports=function(t,i,e,h){var s="function"==typeof e;s&&(o(e,"name")||n(e,"name",i)),t[i]!==e&&(s&&(o(e,a)||n(e,a,t[i]?""+t[i]:f.join(String(i)))),t===r?t[i]=e:h?t[i]?t[i]=e:n(t,i,e):(delete t[i],n(t,i,e)))})(Function.prototype,h,function(){return"function"==typeof this&&this[a]||s.call(this)})},function(t,i,e){var r=e(48)("keys"),n=e(16);t.exports=function(t){return r[t]||(r[t]=n(t))}},function(t,i,e){var r=e(2),n="__core-js_shared__",o=r[n]||(r[n]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,i,e){var r=e(13),n=Math.max,o=Math.min;t.exports=function(t,i){return t=r(t),t<0?n(t+i,0):o(t,i)}},function(t,i,e){var r=e(13),n=Math.min;t.exports=function(t){return t>0?n(r(t),9007199254740991):0}},function(t,i,e){var r=e(5);t.exports=function(t,i){if(!r(t))return t;var e,n;if(i&&"function"==typeof(e=t.toString)&&!r(n=e.call(t)))return n;if("function"==typeof(e=t.valueOf)&&!r(n=e.call(t)))return n;if(!i&&"function"==typeof(e=t.toString)&&!r(n=e.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,i){"use strict";t.exports=function(t){return t&&t.length>1?255===t[0]&&216===t[1]&&255===t[2]?{ext:"jpg",mime:"image/jpeg"}:137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]?{ext:"png",mime:"image/png"}:71===t[0]&&73===t[1]&&70===t[2]?{ext:"gif",mime:"image/gif"}:87===t[8]&&69===t[9]&&66===t[10]&&80===t[11]?{ext:"webp",mime:"image/webp"}:70===t[0]&&76===t[1]&&73===t[2]&&70===t[3]?{ext:"flif",mime:"image/flif"}:(73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3])&&67===t[8]&&82===t[9]?{ext:"cr2",mime:"image/x-canon-cr2"}:73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3]?{ext:"tif",mime:"image/tiff"}:66===t[0]&&77===t[1]?{ext:"bmp",mime:"image/bmp"}:73===t[0]&&73===t[1]&&188===t[2]?{ext:"jxr",mime:"image/vnd.ms-photo"}:56===t[0]&&66===t[1]&&80===t[2]&&83===t[3]?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:80===t[0]&&75===t[1]&&3===t[2]&&4===t[3]&&109===t[30]&&105===t[31]&&109===t[32]&&101===t[33]&&116===t[34]&&121===t[35]&&112===t[36]&&101===t[37]&&97===t[38]&&112===t[39]&&112===t[40]&&108===t[41]&&105===t[42]&&99===t[43]&&97===t[44]&&116===t[45]&&105===t[46]&&111===t[47]&&110===t[48]&&47===t[49]&&101===t[50]&&112===t[51]&&117===t[52]&&98===t[53]&&43===t[54]&&122===t[55]&&105===t[56]&&112===t[57]?{ext:"epub",mime:"application/epub+zip"}:80===t[0]&&75===t[1]&&3===t[2]&&4===t[3]&&77===t[30]&&69===t[31]&&84===t[32]&&65===t[33]&&45===t[34]&&73===t[35]&&78===t[36]&&70===t[37]&&47===t[38]&&109===t[39]&&111===t[40]&&122===t[41]&&105===t[42]&&108===t[43]&&108===t[44]&&97===t[45]&&46===t[46]&&114===t[47]&&115===t[48]&&97===t[49]?{ext:"xpi",mime:"application/x-xpinstall"}:80!==t[0]||75!==t[1]||3!==t[2]&&5!==t[2]&&7!==t[2]||4!==t[3]&&6!==t[3]&&8!==t[3]?117===t[257]&&115===t[258]&&116===t[259]&&97===t[260]&&114===t[261]?{ext:"tar",mime:"application/x-tar"}:82!==t[0]||97!==t[1]||114!==t[2]||33!==t[3]||26!==t[4]||7!==t[5]||0!==t[6]&&1!==t[6]?31===t[0]&&139===t[1]&&8===t[2]?{ext:"gz",mime:"application/gzip"}:66===t[0]&&90===t[1]&&104===t[2]?{ext:"bz2",mime:"application/x-bzip2"}:55===t[0]&&122===t[1]&&188===t[2]&&175===t[3]&&39===t[4]&&28===t[5]?{ext:"7z",mime:"application/x-7z-compressed"}:120===t[0]&&1===t[1]?{ext:"dmg",mime:"application/x-apple-diskimage"}:0===t[0]&&0===t[1]&&0===t[2]&&(24===t[3]||32===t[3])&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]||51===t[0]&&103===t[1]&&112===t[2]&&53===t[3]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&109===t[8]&&112===t[9]&&52===t[10]&&50===t[11]&&109===t[16]&&112===t[17]&&52===t[18]&&49===t[19]&&109===t[20]&&112===t[21]&&52===t[22]&&50===t[23]&&105===t[24]&&115===t[25]&&111===t[26]&&109===t[27]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&105===t[8]&&115===t[9]&&111===t[10]&&109===t[11]||0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&109===t[8]&&112===t[9]&&52===t[10]&&50===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&0===t[15]?{ext:"mp4",mime:"video/mp4"}:0===t[0]&&0===t[1]&&0===t[2]&&28===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&77===t[8]&&52===t[9]&&86===t[10]?{ext:"m4v",mime:"video/x-m4v"}:77===t[0]&&84===t[1]&&104===t[2]&&100===t[3]?{ext:"mid",mime:"audio/midi"}:109===t[31]&&97===t[32]&&116===t[33]&&114===t[34]&&111===t[35]&&115===t[36]&&107===t[37]&&97===t[38]?{ext:"mkv",mime:"video/x-matroska"}:26===t[0]&&69===t[1]&&223===t[2]&&163===t[3]?{ext:"webm",mime:"video/webm"}:0===t[0]&&0===t[1]&&0===t[2]&&20===t[3]&&102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]?{ext:"mov",mime:"video/quicktime"}:82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]&&65===t[8]&&86===t[9]&&73===t[10]?{ext:"avi",mime:"video/x-msvideo"}:48===t[0]&&38===t[1]&&178===t[2]&&117===t[3]&&142===t[4]&&102===t[5]&&207===t[6]&&17===t[7]&&166===t[8]&&217===t[9]?{ext:"wmv",mime:"video/x-ms-wmv"}:0===t[0]&&0===t[1]&&1===t[2]&&"b"===t[3].toString(16)[0]?{ext:"mpg",mime:"video/mpeg"}:73===t[0]&&68===t[1]&&51===t[2]||255===t[0]&&251===t[1]?{ext:"mp3",mime:"audio/mpeg"}:102===t[4]&&116===t[5]&&121===t[6]&&112===t[7]&&77===t[8]&&52===t[9]&&65===t[10]||77===t[0]&&52===t[1]&&65===t[2]&&32===t[3]?{ext:"m4a",mime:"audio/m4a"}:79===t[28]&&112===t[29]&&117===t[30]&&115===t[31]&&72===t[32]&&101===t[33]&&97===t[34]&&100===t[35]?{ext:"opus",mime:"audio/opus"}:79===t[0]&&103===t[1]&&103===t[2]&&83===t[3]?{ext:"ogg",mime:"audio/ogg"}:102===t[0]&&76===t[1]&&97===t[2]&&67===t[3]?{ext:"flac",mime:"audio/x-flac"}:82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]&&87===t[8]&&65===t[9]&&86===t[10]&&69===t[11]?{ext:"wav",mime:"audio/x-wav"}:35===t[0]&&33===t[1]&&65===t[2]&&77===t[3]&&82===t[4]&&10===t[5]?{ext:"amr",mime:"audio/amr"}:37===t[0]&&80===t[1]&&68===t[2]&&70===t[3]?{ext:"pdf",mime:"application/pdf"}:77===t[0]&&90===t[1]?{ext:"exe",mime:"application/x-msdownload"}:67!==t[0]&&70!==t[0]||87!==t[1]||83!==t[2]?123===t[0]&&92===t[1]&&114===t[2]&&116===t[3]&&102===t[4]?{ext:"rtf",mime:"application/rtf"}:119===t[0]&&79===t[1]&&70===t[2]&&70===t[3]&&(0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]||79===t[4]&&84===t[5]&&84===t[6]&&79===t[7])?{ext:"woff",mime:"application/font-woff"}:119===t[0]&&79===t[1]&&70===t[2]&&50===t[3]&&(0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]||79===t[4]&&84===t[5]&&84===t[6]&&79===t[7])?{ext:"woff2",mime:"application/font-woff"}:76===t[34]&&80===t[35]&&(0===t[8]&&0===t[9]&&1===t[10]||1===t[8]&&0===t[9]&&2===t[10]||2===t[8]&&0===t[9]&&2===t[10])?{ext:"eot",mime:"application/octet-stream"}:0===t[0]&&1===t[1]&&0===t[2]&&0===t[3]&&0===t[4]?{ext:"ttf",mime:"application/font-sfnt"}:79===t[0]&&84===t[1]&&84===t[2]&&79===t[3]&&0===t[4]?{ext:"otf",mime:"application/font-sfnt"}:0===t[0]&&0===t[1]&&1===t[2]&&0===t[3]?{ext:"ico",mime:"image/x-icon"}:70===t[0]&&76===t[1]&&86===t[2]&&1===t[3]?{ext:"flv",mime:"video/x-flv"}:37===t[0]&&33===t[1]?{ext:"ps",mime:"application/postscript"}:253===t[0]&&55===t[1]&&122===t[2]&&88===t[3]&&90===t[4]&&0===t[5]?{ext:"xz",mime:"application/x-xz"}:83===t[0]&&81===t[1]&&76===t[2]&&105===t[3]?{ext:"sqlite",mime:"application/x-sqlite3"}:78===t[0]&&69===t[1]&&83===t[2]&&26===t[3]?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:67===t[0]&&114===t[1]&&50===t[2]&&52===t[3]?{ext:"crx",mime:"application/x-google-chrome-extension"}:77===t[0]&&83===t[1]&&67===t[2]&&70===t[3]||73===t[0]&&83===t[1]&&99===t[2]&&40===t[3]?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:33===t[0]&&60===t[1]&&97===t[2]&&114===t[3]&&99===t[4]&&104===t[5]&&62===t[6]&&10===t[7]&&100===t[8]&&101===t[9]&&98===t[10]&&105===t[11]&&97===t[12]&&110===t[13]&&45===t[14]&&98===t[15]&&105===t[16]&&110===t[17]&&97===t[18]&&114===t[19]&&121===t[20]?{ext:"deb",mime:"application/x-deb"}:33===t[0]&&60===t[1]&&97===t[2]&&114===t[3]&&99===t[4]&&104===t[5]&&62===t[6]?{ext:"ar",mime:"application/x-unix-archive"}:237===t[0]&&171===t[1]&&238===t[2]&&219===t[3]?{ext:"rpm",mime:"application/x-rpm"}:31===t[0]&&160===t[1]||31===t[0]&&157===t[1]?{ext:"Z",mime:"application/x-compress"}:76===t[0]&&90===t[1]&&73===t[2]&&80===t[3]?{ext:"lz",mime:"application/x-lzip"}:208===t[0]&&207===t[1]&&17===t[2]&&224===t[3]&&161===t[4]&&177===t[5]&&26===t[6]&&225===t[7]?{ext:"msi",mime:"application/x-msi"}:null:{ext:"swf",mime:"application/x-shockwave-flash"}:{ext:"rar",mime:"application/x-rar-compressed"}:{ext:"zip",mime:"application/zip"}:null}},function(t,i,e){"use strict";var r=e(52);t.exports=function(t){var i=["jpg","png","gif","webp","tif","bmp","jxr","psd"],e=r(t);return i.indexOf(e&&e.ext)!==-1?e:null}},function(t,i,e){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){function i(t){global.setImmediate?setImmediate(t):global.importScripts?setTimeout(t):(n++,o[n]=t,global.postMessage(n,"*"))}function e(t){"use strict";function n(t,i,e,n){if(2==f)return n();if("object"!=("undefined"==typeof u?"undefined":r(u))&&"function"!=typeof u||"function"!=typeof t)n();else try{var o=0;t.call(u,function(t){o++||(u=t,i())},function(t){o++||(u=t,e())})}catch(t){u=t,e()}}function o(){var t;try{t=u&&u.then}catch(t){return u=t,f=2,o()}n(t,function(){f=1,o()},function(){f=2,o()},function(){try{1==f&&"function"==typeof a?u=a(u):2==f&&"function"==typeof h&&(u=h(u),f=1)}catch(t){return u=t,c()}u==s?(u=TypeError(),c()):n(t,function(){c(3)},c,function(){c(1==f&&3)})})}if("function"!=typeof t&&void 0!=t)throw TypeError();if("object"!=r(this)||this&&this.then)throw TypeError();var a,h,s=this,f=0,u=0,d=[];s.promise=s,s.resolve=function(t){return a=s.fn,h=s.er,f||(u=t,f=1,i(o)),s},s.reject=function(t){return a=s.fn,h=s.er,f||(u=t,f=2,i(o)),s},s._d=1,s.then=function(t,i){if(1!=this._d)throw TypeError();var r=new e;return r.fn=t,r.er=i,3==f?r.resolve(u):4==f?r.reject(u):d.push(r),r},s.catch=function(t){return s.then(null,t)};var c=function(t){f=t||4,d.map(function(t){3==f&&t.resolve(u)||t.reject(u)})};try{"function"==typeof t&&t(s.resolve,s.reject)}catch(t){s.reject(t)}return s}global=this;var n=1,o={},a=!1;global.setImmediate||global.addEventListener("message",function(t){if(t.source==global)if(a)i(o[t.data]);else{a=!0;try{o[t.data]()}catch(t){}delete o[t.data],a=!1}}),e.resolve=function(t){if(1!=this._d)throw TypeError();return t instanceof e?t:new e(function(i){i(t)})},e.reject=function(t){if(1!=this._d)throw TypeError();return new e(function(i,e){e(t)})},e.all=function(t){function i(e,n){if(n)return r.resolve(n);if(e)return r.reject(e);var o=t.reduce(function(t,i){return i&&i.then?t+1:t},0);0==o&&r.resolve(t),t.map(function(e,r){e&&e.then&&e.then(function(e){return t[r]=e,i(),e},i)})}if(1!=this._d)throw TypeError();if(!(t instanceof Array))return e.reject(TypeError());var r=new e;return i(),r},e.race=function(t){function i(e,n){if(n)return r.resolve(n);if(e)return r.reject(e);var o=t.reduce(function(t,i){return i&&i.then?t+1:t},0);0==o&&r.resolve(t),t.map(function(t,e){t&&t.then&&t.then(function(t){i(null,t)},i)})}if(1!=this._d)throw TypeError();if(!(t instanceof Array))return e.reject(TypeError());if(0==t.length)return new e;var r=new e;return i(),r},e._d=1,t.exports=e}()},function(t,i,e){function r(t){for(var i=2*t+1,e=new Array(Math.pow(i,2)),r=0;r<i;r++)for(var n=0;n<i;n++)e[r*i+n]=Math.pow(r-t,2)+Math.pow(n-t,2);return{data:e,width:i,height:i}}function n(t,i){for(var e=t.data,r=t.width,n=t.height,o=new Array(e.length),a=0;a<e.length;a++)o[a]=Math.exp(-e[a]/(2*Math.pow(i,2)));return{data:o,width:r,height:n}}function o(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"gaussian",arguments.length>1&&void 0!==arguments[1]?arguments[1]:3),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1.5;t=(t-1)/2;var e=r(t),o=n(e,i),a=h(o);return s(o,a)}var a=e(0),h=a.sum2d,s=a.divide2d;t.exports={fspecial:o}},function(t,i,e){function r(t,i,e,r){ | ||
if(t=f(t,d([i/2,e/2]),r),0===h(i,2)&&(t.data=t.data.slice(0,-t.width),t.height--),0===h(e,2)){for(var n=[],o=0;o<t.data.length;o++)(o+1)%t.width!==0&&n.push(t.data[o]);t.data=n,t.width--}return t}function n(t){return"same"===t&&(t="valid"),t}function o(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symmetric",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"same";return t=r(t,i.width,i.height,e),o=n(o),p(i,t,o)}var a=e(20),h=a.mod,s=e(22),f=s.padarray,u=e(0),d=u.floor,c=e(18),p=c.filter2;t.exports={imfilter:o}},function(t,i){function e(t){for(var i=t.data,e=t.width,r=t.height,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=2.5066282746310007,h=new Array(i.length),s=0;s<i.length;s++){var f=(i[s]-n)/o;h[s]=Math.exp(-Math.pow(f,2)/2)/(o*a)}return{data:h,width:e,height:r}}t.exports={normpdf:e}},function(t,i){function e(t,i,e){return Math.round(.29894*t+.58704*i+.11402*e)}function r(t){for(var i=t.data,r=t.width,n=t.height,o=new Array(r*n),a=0;a<n;a++)for(var h=0;h<r;h++){var s=h+a*r,f=4*s;o[s]=e(i[f],i[f+1],i[f+2],i[f+3])}return{data:o,width:r,height:n}}t.exports={rgb2gray:r}},function(t,i){function e(t,i,e){for(var n=r(i,3),o=n[0],a=n[1],h=n[2],s=r(e,3),f=s[0],u=s[1],d=s[2],c=Math.ceil((d-f)/u),p=Math.ceil((h-o)/a),l=new Array(c*p),m=0;m<p;m++)for(var v=0;v<c;v++){var w=o+m*a,g=f+v*u;l[m*c+v]=t.data[w*t.width+g]}return{data:l,width:c,height:p}}var r=function(){function t(t,i){var e=[],r=!0,n=!1,o=void 0;try{for(var a,h=t[Symbol.iterator]();!(r=(a=h.next()).done)&&(e.push(a.value),!i||e.length!==i);r=!0);}catch(t){n=!0,o=t}finally{try{!r&&h.return&&h.return()}finally{if(n)throw o}}return e}return function(i,e){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return t(i,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.exports={skip2d:e}},function(t,i){function e(t,i,e,r,n){for(var o=t.data,a=t.width,h=new Array(n*e),s=0;s<e;s++)for(var f=0;f<n;f++)h[s*n+f]=o[(r+s)*a+i+f];return{data:h,width:n,height:e}}t.exports={sub:e}},function(t,i){function e(t){for(var i=t.data,e=t.width,r=t.height,n=new Array(e*r),o=0;o<r;o++)for(var a=0;a<e;a++)n[a*r+o]=i[o*e+a];return{data:n,height:e,width:r}}t.exports={transpose:e}},function(t,i,e){function r(t,i,e){var r=c("gaussian",e.windowSize,1.5),n=Math.pow(2,e.bitDepth)-1,u=Math.pow(e.k1*n,2),v=Math.pow(e.k2*n,2);if(r=a(r,f(r)),"original"===e.downsample){var w=Math.min(t.width,t.height)/e.maxSize,g=Math.round(w),x=Math.max(1,g);if(x>1){var y=l(x);y=a(y,f(y)),t=p(t,y,"symmetric","same"),i=p(i,y,"symmetric","same"),t=m(t,[0,x,t.height],[0,x,t.width]),i=m(i,[0,x,i.height],[0,x,i.width])}}var b=d(r,t,"valid"),I=d(r,i,"valid"),E=s(b),S=s(I),M=h(b,I),j=s(t),U=s(i),z=h(E,-1),O=h(S,-1),P=h(M,-1),A=o(d(r,j,"valid"),z),L=o(d(r,U,"valid"),O),k=o(d(r,h(t,i),"valid"),P);if(u>0&&v>0){var _=o(h(M,2),u),T=o(h(k,2),v),B=o(o(E,S),u),q=o(o(A,L),v);return a(h(_,T),h(B,q))}var D=h(M,2),F=h(k,2),C=o(E,S),G=o(A,L);return a(h(D,F),h(C,G))}var n=e(0),o=n.add2d,a=n.divide2d,h=n.multiply2d,s=n.square2d,f=n.sum2d,u=e(6),d=u.filter2,c=u.fspecial,p=u.imfilter,l=u.ones,m=u.skip2d;t.exports={originalSsim:r}},function(t,i,e){function r(t,i){var e=u(t),r=e.ext,n=void 0;if("bmp"===r)n=d.decode(t);else{var o=new f.Image;o.src=t;var a=p(o.width,o.height,i),h=a.width,s=a.height,c=new f(h,s),l=c.getContext("2d");l.drawImage(o,0,0,o.width,o.height,0,0,h,s),n=l.getImageData(0,0,h,s)}return n}function n(t,i){return new i(function(i,e){s.get(t).on("response",function(t){var e=[];t.on("data",function(t){return e.push(t)}),t.on("end",function(){return i(Buffer.concat(e))})}).on("error",e)})}function o(t,i){return new i(function(i,e){h.readFile(t,function(t,r){return t?void e(t):void i(r)})})}function a(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=void 0;return a=Buffer.isBuffer(t)?i.resolve(t):0===t.indexOf("http://")||0===t.indexOf("https://")?n(t,i):o(t,i),a.then(function(t){return r(t,e)})}var h=e(68),s=e(69),f=e(67),u=e(53),d=e(28),c=e(24),p=c.getLimitDimensions;t.exports={readpixels:a}},function(t,i,e){function r(t,i,e){var r=x(n(e.windowSize),0,1.5),s=Math.pow(2,e.bitDepth)-1,u=Math.pow(e.k1*s,2),v=Math.pow(e.k2*s,2);r=c(r,m(r));var g=I(r);if("original"===e.downsample){var y=h(t,i,e.maxSize),b=f(y,2);t=b[0],i=b[1]}var E=w(t,r,g,"valid"),S=w(i,r,g,"valid"),M=l(E),j=l(S),U=p(E,S),z=l(t),O=l(i),P=p(M,-1),A=p(j,-1),L=p(U,-1),k=d(w(z,r,g,"valid"),P),_=d(w(O,r,g,"valid"),A),T=d(w(p(t,i),r,g,"valid"),L);return u>0&&v>0?o(U,T,M,j,k,_,u,v):a(U,T,M,j,k,_)}function n(t){for(var i=Math.floor(t/2),e=new Array(2*i+1),r=-i;r<=i;r++)e[r+i]=Math.abs(r);return{data:e,width:e.length,height:1}}function o(t,i,e,r,n,o,a,h){var s=d(p(t,2),a),f=d(p(i,2),h),u=d(d(e,r),a),l=d(d(n,o),h);return c(p(s,f),p(u,l))}function a(t,i,e,r,n,o){var a=p(t,2),h=p(i,2),s=d(e,r),f=d(n,o);return c(p(a,h),p(s,f))}function h(t,i){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256,r=Math.min(t.width,i.height)/e,n=Math.round(r);if(n>1){var o=y(n);o=c(o,m(o)),t=s(t,o,n),i=s(i,o,n)}return[t,i]}function s(t,i,e){var r=g(t,i,"symmetric","same");return b(r,[0,e,r.height],[0,e,r.width])}var f=function(){function t(t,i){var e=[],r=!0,n=!1,o=void 0;try{for(var a,h=t[Symbol.iterator]();!(r=(a=h.next()).done)&&(e.push(a.value),!i||e.length!==i);r=!0);}catch(t){n=!0,o=t}finally{try{!r&&h.return&&h.return()}finally{if(n)throw o}}return e}return function(i,e){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return t(i,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=e(0),d=u.add2d,c=u.divide2d,p=u.multiply2d,l=u.square2d,m=u.sum2d,v=e(6),w=v.conv2,g=v.imfilter,x=v.normpdf,y=v.ones,b=v.skip2d,I=v.transpose;t.exports={ssim:r}},function(t,i){t.exports={type:"deploy",version:"2.4.0"}},function(t,i){t.exports={windowSize:11,k1:.01,k2:.03,bitDepth:8,downsample:"original",ssim:"fast",maxSize:256}},function(i,e){i.exports=t},function(t,i){t.exports=require("fs")},function(t,i){t.exports=require("https")},function(t,i,e){e(27),e(26),t.exports=e(25)}])}); |
@@ -1,2 +0,1 @@ | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.ssim=r():t.ssim=r()}(this,function(){return function(t){function r(e){if(n[e])return n[e].exports;var i=n[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,r),i.l=!0,i.exports}var n={};return r.m=t,r.c=n,r.i=function(t){return t},r.d=function(t,r,n){Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},r.p="",r(r.s=93)}([function(t,r,n){"use strict";var e=n(34)("wks"),i=n(26),o=n(1).Symbol,a="function"==typeof o,u=t.exports=function(t){return e[t]||(e[t]=a&&o[t]||(a?o:i)("Symbol."+t))};u.store=e},function(t,r){"use strict";var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,r,n){"use strict";var e=n(14);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,r){"use strict";var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,r,n){"use strict";var e=n(15),i=n(33);t.exports=n(6)?function(t,r,n){return e.f(t,r,i(1,n))}:function(t,r,n){return t[r]=n,t}},function(t,r){"use strict";function n(t){return e(t)/t.length}function e(t){for(var r=0,n=0;n<t.length;n++)r+=t[n];return r}function i(t){for(var r=new Array(t.length),n=0;n<t.length;n++)r[n]=Math.floor(t[n]);return r}function o(t){for(var r=t.data,n=0,e=0;e<r.length;e++)n+=r[e];return n}function a(t,r){for(var n=t.data,e=t.width,i=t.height,o=r.data,a=new Array(n.length),u=0;u<i;u++)for(var c=u*e,s=0;s<e;s++)a[c+s]=n[c+s]+o[c+s];return{data:a,width:e,height:i}}function u(t,r){for(var n=t.data,e=t.width,i=t.height,o=new Array(n.length),a=0;a<n.length;a++)o[a]=n[a]+r;return{data:o,width:e,height:i}}function c(t,r){return"number"==typeof r?u(t,r):a(t,r)}function s(t,r){for(var n=t.data,e=t.width,i=t.height,o=new Array(n.length),a=0;a<n.length;a++)o[a]=n[a]/r;return{data:o,width:e,height:i}}function f(t,r){for(var n=t.data,e=t.width,i=t.height,o=r.data,a=new Array(n.length),u=0;u<n.length;u++)a[u]=n[u]/o[u];return{data:a,width:e,height:i}}function h(t,r){return"number"==typeof r?s(t,r):f(t,r)}function d(t,r){for(var n=t.data,e=t.width,i=t.height,o=new Array(n.length),a=0;a<n.length;a++)o[a]=n[a]*r;return{data:o,width:e,height:i}}function l(t,r){for(var n=t.data,e=t.width,i=t.height,o=r.data,a=new Array(n.length),u=0;u<n.length;u++)a[u]=n[u]*o[u];return{data:a,width:e,height:i}}function v(t,r){return"number"==typeof r?d(t,r):l(t,r)}function p(t){return v(t,t)}function g(t){return o(t)/t.data.length}t.exports={add2d:c,average:n,divide2d:h,floor:i,mean2d:g,multiply2d:v,square2d:p,sum:e,sum2d:o}},function(t,r,n){"use strict";t.exports=!n(13)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,r){"use strict";var n={}.hasOwnProperty;t.exports=function(t,r){return n.call(t,r)}},function(t,r){"use strict";t.exports={}},function(t,r,n){"use strict";var e=n(1),i=n(4),o=n(7),a=n(26)("src"),u="toString",c=Function[u],s=(""+c).split(u);n(3).inspectSource=function(t){return c.call(t)},(t.exports=function(t,r,n,u){var c="function"==typeof n;c&&(o(n,"name")||i(n,"name",r)),t[r]!==n&&(c&&(o(n,a)||i(n,a,t[r]?""+t[r]:s.join(String(r)))),t===e?t[r]=n:u?t[r]?t[r]=n:i(t,r,n):(delete t[r],i(t,r,n)))})(Function.prototype,u,function(){return"function"==typeof this&&this[a]||c.call(this)})},function(t,r){"use strict";var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,r,n){"use strict";var e=n(16);t.exports=function(t,r,n){if(e(t),void 0===r)return t;switch(n){case 1:return function(n){return t.call(r,n)};case 2:return function(n,e){return t.call(r,n,e)};case 3:return function(n,e,i){return t.call(r,n,e,i)}}return function(){return t.apply(r,arguments)}}},function(t,r,n){"use strict";var e=n(1),i=n(3),o=n(4),a=n(9),u=n(11),c="prototype",s=function t(r,n,s){var f,h,d,l,v=r&t.F,p=r&t.G,g=r&t.S,w=r&t.P,y=r&t.B,m=p?e:g?e[n]||(e[n]={}):(e[n]||{})[c],x=p?i:i[n]||(i[n]={}),b=x[c]||(x[c]={});p&&(s=n);for(f in s)h=!v&&m&&void 0!==m[f],d=(h?m:s)[f],l=y&&h?u(d,e):w&&"function"==typeof d?u(Function.call,d):d,m&&a(m,f,d,r&t.U),x[f]!=d&&o(x,f,l),w&&b[f]!=d&&(b[f]=d)};e.core=i,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,r){"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){return"object"===("undefined"==typeof t?"undefined":n(t))?null!==t:"function"==typeof t}},function(t,r,n){"use strict";var e=n(2),i=n(53),o=n(74),a=Object.defineProperty;r.f=n(6)?Object.defineProperty:function(t,r,n){if(e(t),r=o(r,!0),e(n),i)try{return a(t,r,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[r]=n.value),t}},function(t,r){"use strict";t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,r,n){"use strict";var e=n(10),i=n(0)("toStringTag"),o="Arguments"==e(function(){return arguments}()),a=function(t,r){try{return t[r]}catch(t){}};t.exports=function(t){var r,n,u;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(r=Object(t),i))?n:o?e(r):"Object"==(u=e(r))&&"function"==typeof r.callee?"Arguments":u}},function(t,r){"use strict";t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,r,n){"use strict";var e=n(14),i=n(1).document,o=e(i)&&e(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,r,n){"use strict";var e=n(66),i=n(28);t.exports=Object.keys||function(t){return e(t,i)}},function(t,r,n){"use strict";var e=n(15).f,i=n(7),o=n(0)("toStringTag");t.exports=function(t,r,n){t&&!i(t=n?t:t.prototype,o)&&e(t,o,{configurable:!0,value:r})}},function(t,r,n){"use strict";var e=n(34)("keys"),i=n(26);t.exports=function(t){return e[t]||(e[t]=i(t))}},function(t,r){"use strict";var n=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:n)(t)}},function(t,r,n){"use strict";var e=n(30),i=n(18);t.exports=function(t){return e(i(t))}},function(t,r,n){"use strict";var e=n(18);t.exports=function(t){return Object(e(t))}},function(t,r){"use strict";var n=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+e).toString(36))}},function(t,r,n){"use strict";var e=n(37),i=e.conv2,o=n(38),a=o.filter2,u=n(81),c=u.fspecial,s=n(82),f=s.imfilter,h=n(83),d=h.normpdf,l=n(41),v=l.ones,p=n(42),g=p.padarray,w=n(84),y=w.rgb2gray,m=n(85),x=m.skip2d,b=n(87),_=b.transpose,j=n(43),S=j.zeros;t.exports={conv2:i,filter2:a,fspecial:c,imfilter:f,normpdf:d,ones:v,padarray:g,rgb2gray:y,skip2d:x,transpose:_,zeros:S}},function(t,r){"use strict";t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,r,n){"use strict";t.exports=n(1).document&&document.documentElement},function(t,r,n){"use strict";var e=n(10);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,r,n){"use strict";var e=n(32),i=n(12),o=n(9),a=n(4),u=n(7),c=n(8),s=n(57),f=n(21),h=n(65),d=n(0)("iterator"),l=!([].keys&&"next"in[].keys()),v="@@iterator",p="keys",g="values",w=function(){return this};t.exports=function(t,r,n,y,m,x,b){s(n,r,y);var _,j,S,M=function(t){if(!l&&t in E)return E[t];switch(t){case p:return function(){return new n(this,t)};case g:return function(){return new n(this,t)}}return function(){return new n(this,t)}},O=r+" Iterator",A=m==g,k=!1,E=t.prototype,P=E[d]||E[v]||m&&E[m],T=P||M(m),I=m?A?M("entries"):T:void 0,F="Array"==r?E.entries||P:P;if(F&&(S=h(F.call(new t)),S!==Object.prototype&&(f(S,O,!0),e||u(S,d)||a(S,d,w))),A&&P&&P.name!==g&&(k=!0,T=function(){return P.call(this)}),e&&!b||!l&&!k&&E[d]||a(E,d,T),c[r]=T,c[O]=w,m)if(_={values:A?T:M(g),keys:x?T:M(p),entries:I},b)for(j in _)j in E||o(E,j,_[j]);else i(i.P+i.F*(l||k),r,_);return _}},function(t,r){"use strict";t.exports=!1},function(t,r){"use strict";t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},function(t,r,n){"use strict";var e=n(1),i="__core-js_shared__",o=e[i]||(e[i]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,r,n){"use strict";var e,i,o,a=n(11),u=n(54),c=n(29),s=n(19),f=n(1),h=f.process,d=f.setImmediate,l=f.clearImmediate,v=f.MessageChannel,p=0,g={},w="onreadystatechange",y=function(){var t=+this;if(g.hasOwnProperty(t)){var r=g[t];delete g[t],r()}},m=function(t){y.call(t.data)};d&&l||(d=function(t){for(var r=[],n=1;arguments.length>n;)r.push(arguments[n++]);return g[++p]=function(){u("function"==typeof t?t:Function(t),r)},e(p),p},l=function(t){delete g[t]},"process"==n(10)(h)?e=function(t){h.nextTick(a(y,t,1))}:v?(i=new v,o=i.port2,i.port1.onmessage=m,e=a(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(e=function(t){f.postMessage(t+"","*")},f.addEventListener("message",m,!1)):e=w in s("script")?function(t){c.appendChild(s("script"))[w]=function(){c.removeChild(this),y.call(t)}}:function(t){setTimeout(a(y,t,1),0)}),t.exports={set:d,clear:l}},function(t,r,n){"use strict";var e=n(23),i=Math.min;t.exports=function(t){return t>0?i(e(t),9007199254740991):0}},function(t,r,n){"use strict";function e(t,r){for(var n=t.data,e=t.width,i=t.height,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"full",a=e+r.width-1,c=i+r.height-1,s=d(c,a),f=s.data,h=0;h<r.height;h++)for(var l=0;l<r.width;l++){var v=r.data[h*r.width+l];if(v)for(var p=0;p<i;p++)for(var g=0;g<e;g++)f[(p+h)*a+g+l]+=n[p*e+g]*v}var w={data:f,width:a,height:c};return u(w,o,i,r.height,e,r.width)}function i(t,r){var n=r.data,e=r.width,i=r.height,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"full",u=v(i,1),c=v(1,e),s=a(t,u,c,o);return g(s,n[0])}function o(t){for(var r=t.data,n=r[0],e=1;e<r.length;e++)if(r[e]!==n)return!1;return!0}function a(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"full",o=Math.max(r.height,r.width),a=Math.max(n.height,n.width),c=e(t,r,"full"),s=e(c,n,"full");return u(s,i,t.height,o,t.width,a)}function u(t,r,n,e,i,o){if("full"===r)return t;if("same"===r){var a=Math.ceil((t.height-n)/2),u=Math.ceil((t.width-i)/2);return f(t,a,n,u,i)}return f(t,e-1,n-e+1,o-1,i-o+1)}function c(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return r[2]&&r[2].data?a.apply(void 0,r):o(r[1])?i.apply(void 0,r):e.apply(void 0,r)}var s=n(86),f=s.sub,h=n(43),d=h.zeros,l=n(41),v=l.ones,p=n(5),g=p.multiply2d;t.exports={conv2:c}},function(t,r,n){"use strict";function e(t){for(var r=t.data,n=t.width,e=t.height,i=new Array(r.length),o=0;o<e;o++)for(var a=0;a<n;a++)i[o*n+a]=r[(e-1-o)*n+n-1-a];return{data:i,width:n,height:e}}function i(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"same";return a(r,e(t),n)}var o=n(37),a=o.conv2;t.exports={filter2:i}},function(t,r){"use strict";function n(t,r,n){for(var e=r*t,i=new Array(e),o=0;o<e;o++)i[o]=n;return{data:i,width:r,height:t}}t.exports={numbers:n}},function(t,r){"use strict";function n(t,r){return t-r*Math.floor(t/r)}t.exports={mod:n}},function(t,r,n){"use strict";function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return o(t,r,1)}var i=n(39),o=i.numbers;t.exports={ones:e}},function(t,r,n){"use strict";function e(t){for(var r=t.data,n=t.width,e=t.height,i=new Array(r.length),o=0;o<e;o++)for(var a=0;a<n;a++)i[o*n+a]=r[o*n+n-1-a];return{data:i,width:n,height:e}}function i(t){for(var r=t.data,n=t.width,e=t.height,i=new Array(r.length),o=0;o<e;o++)for(var a=0;a<n;a++)i[o*n+a]=r[(e-1-o)*n+a];return{data:i,width:n,height:e}}function o(t,r){for(var n=t.width+r.width,e=new Array(t.height*n),i=0;i<t.height;i++){for(var o=0;o<t.width;o++)e[i*n+o]=t.data[i*t.width+o];for(var a=0;a<r.width;a++)e[i*n+a+t.width]=r.data[i*r.width+a]}return{data:e,width:n,height:t.height}}function a(t,r){return{data:t.data.concat(r.data),height:t.height+r.height,width:t.width}}function u(t,r){for(var n=t.width+2*r,i=new Array(n*t.height),a=o(t,e(t)),u=0;u<t.height;u++)for(var c=-r;c<t.width+r;c++)i[u*n+c+r]=a.data[u*a.width+l(c,a.width)];return{data:i,width:n,height:t.height}}function c(t,r){for(var n=a(t,i(t)),e=t.height+2*r,o=new Array(t.width*e),u=-r;u<t.height+r;u++)for(var c=0;c<t.width;c++)o[(u+r)*t.width+c]=n.data[l(u,n.height)*t.width+c];return{data:o,width:t.width,height:e}}function s(t,r){for(var n=h(r,2),e=n[0],i=n[1],o=t.width+2*i,a=t.height+2*e,u=new Array(o*a),c=-e;c<0;c++){for(var s=-i;s<0;s++)u[(c+e)*o+s+i]=t.data[(Math.abs(c)-1)*t.width+Math.abs(s)-1];for(var f=0;f<t.width;f++)u[(c+e)*o+f+i]=t.data[(Math.abs(c)-1)*t.width+f];for(var d=t.width;d<t.width+i;d++)u[(c+e)*o+d+i]=t.data[(Math.abs(c)-1)*t.width+2*t.width-d-1]}for(var l=0;l<t.height;l++){for(var v=-i;v<0;v++)u[(l+e)*o+v+i]=t.data[l*t.width+Math.abs(v)-1];for(var p=0;p<t.width;p++)u[(l+e)*o+p+i]=t.data[l*t.width+p];for(var g=t.width;g<t.width+i;g++)u[(l+e)*o+g+i]=t.data[l*t.width+2*t.width-g-1]}for(var w=t.height;w<t.height+e;w++){for(var y=-i;y<0;y++)u[(w+e)*o+y+i]=t.data[(2*t.height-w-1)*t.width+Math.abs(y)-1];for(var m=0;m<t.width;m++)u[(w+e)*o+m+i]=t.data[(2*t.height-w-1)*t.width+m];for(var x=t.width;x<t.width+i;x++)u[(w+e)*o+x+i]=t.data[(2*t.height-w-1)*t.width+2*t.width-x-1]}return{data:u,width:o,height:a}}function f(t,r){var n=h(r,2),e=n[0],i=n[1];return t.height>=e&&t.width>=i?s(t,[e,i]):c(u(t,i),e)}var h=function(){function t(t,r){var n=[],e=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){i=!0,o=t}finally{try{!e&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=n(40),l=d.mod;t.exports={padarray:f}},function(t,r,n){"use strict";function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return o(t,r,0)}var i=n(39),o=i.numbers;t.exports={zeros:e}},function(t,r){"use strict";function n(t){throw new Error("Missing "+t+" parameter")}function e(t,r,n){if(n&&t>=n&&r>=n){var e=t/r;return e>1?{height:n,width:Math.round(n/e)}:{height:Math.round(n*e),width:n}}return{width:t,height:r}}t.exports={force:n,getLimitDimensions:e}},function(t,r,n){"use strict";function e(t){if(Object.keys(t).forEach(function(t){if(!(t in _))throw new Error('"'+t+'" is not a valid option')}),"k1"in t&&("number"!=typeof t.k1||t.k1<0))throw new Error("Invalid k1 value. Default is "+_.k1);if("k2"in t&&("number"!=typeof t.k2||t.k2<0))throw new Error("Invalid k2 value. Default is "+_.k2)}function i(t){return e(t),Object.assign({},_,t)}function o(t){var r=s(t,2),n=r[0],e=r[1];if(n.width!==e.width||n.height!==e.height)throw new Error("Image dimensions do not match");return[n,e]}function a(t){var r=s(t,2),n=r[0],e=r[1];return n=l(n),e=l(e),[n,e]}function u(t,r){return"fast"===r.downsample?h(t,r.maxSize):h(t)}function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b("image1"),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b("image2"),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=(new Date).getTime();n=i(n);var c="fast"===n.ssim?w:m;return Promise.all([u(t,n),u(r,n)]).then(o).then(a).then(function(t){var r=s(t,2),e=r[0],i=r[1];return c(e,i,n)}).then(function(t){return{ssim_map:t,mssim:p(t),performance:(new Date).getTime()-e}})}var s=function(){function t(t,r){var n=[],e=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){i=!0,o=t}finally{try{!e&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f=n(89),h=f.readpixels,d=n(27),l=d.rgb2gray,v=n(5),p=v.mean2d,g=n(90),w=g.ssim,y=n(88),m=y.originalSsim,x=n(44),b=x.force,_=n(92),j=n(91),S=j.version;c.ssim=w,c.version=S,t.exports=c},function(t,r,n){"use strict";n(77),n(79),n(80),n(78),t.exports=n(3).Promise},function(t,r,n){"use strict";var e=n(12);e(e.S+e.F,"Object",{assign:n(61)})},function(t,r,n){"use strict";var e=n(25),i=n(20);n(68)("keys",function(){return function(t){return i(e(t))}})},function(t,r,n){"use strict";var e=n(0)("unscopables"),i=Array.prototype;void 0==i[e]&&n(4)(i,e,{}),t.exports=function(t){i[e][t]=!0}},function(t,r){"use strict";t.exports=function(t,r,n,e){if(!(t instanceof r)||void 0!==e&&e in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,r,n){"use strict";var e=n(24),i=n(36),o=n(73);t.exports=function(t){return function(r,n,a){var u,c=e(r),s=i(c.length),f=o(a,s);if(t&&n!=n){for(;s>f;)if(u=c[f++],u!=u)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},function(t,r,n){"use strict";var e=n(11),i=n(56),o=n(55),a=n(2),u=n(36),c=n(75),s={},f={},h=t.exports=function(t,r,n,h,d){var l,v,p,g,w=d?function(){return t}:c(t),y=e(n,h,r?2:1),m=0;if("function"!=typeof w)throw TypeError(t+" is not iterable!");if(o(w)){for(l=u(t.length);l>m;m++)if(g=r?y(a(v=t[m])[0],v[1]):y(t[m]),g===s||g===f)return g}else for(p=w.call(t);!(v=p.next()).done;)if(g=i(p,y,v.value,r),g===s||g===f)return g};h.BREAK=s,h.RETURN=f},function(t,r,n){"use strict";t.exports=!n(6)&&!n(13)(function(){return 7!=Object.defineProperty(n(19)("div"),"a",{get:function(){return 7}}).a})},function(t,r){"use strict";t.exports=function(t,r,n){var e=void 0===n;switch(r.length){case 0:return e?t():t.call(n);case 1:return e?t(r[0]):t.call(n,r[0]);case 2:return e?t(r[0],r[1]):t.call(n,r[0],r[1]);case 3:return e?t(r[0],r[1],r[2]):t.call(n,r[0],r[1],r[2]);case 4:return e?t(r[0],r[1],r[2],r[3]):t.call(n,r[0],r[1],r[2],r[3])}return t.apply(n,r)}},function(t,r,n){"use strict";var e=n(8),i=n(0)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},function(t,r,n){"use strict";var e=n(2);t.exports=function(t,r,n,i){try{return i?r(e(n)[0],n[1]):r(n)}catch(r){var o=t.return;throw void 0!==o&&e(o.call(t)),r}}},function(t,r,n){"use strict";var e=n(62),i=n(33),o=n(21),a={};n(4)(a,n(0)("iterator"),function(){return this}),t.exports=function(t,r,n){t.prototype=e(a,{next:i(1,n)}),o(t,r+" Iterator")}},function(t,r,n){"use strict";var e=n(0)("iterator"),i=!1;try{var o=[7][e]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}t.exports=function(t,r){if(!r&&!i)return!1;var n=!1;try{var o=[7],a=o[e]();a.next=function(){return{done:n=!0}},o[e]=function(){return a},t(o)}catch(t){}return n}},function(t,r){"use strict";t.exports=function(t,r){return{value:r,done:!!t}}},function(t,r,n){"use strict";var e=n(1),i=n(35).set,o=e.MutationObserver||e.WebKitMutationObserver,a=e.process,u=e.Promise,c="process"==n(10)(a);t.exports=function(){var t,r,n,s=function(){var e,i;for(c&&(e=a.domain)&&e.exit();t;){i=t.fn,t=t.next;try{i()}catch(e){throw t?n():r=void 0,e}}r=void 0,e&&e.enter()};if(c)n=function(){a.nextTick(s)};else if(o){var f=!0,h=document.createTextNode("");new o(s).observe(h,{characterData:!0}),n=function(){h.data=f=!f}}else if(u&&u.resolve){var d=u.resolve();n=function(){d.then(s)}}else n=function(){i.call(e,s)};return function(e){var i={fn:e,next:void 0};r&&(r.next=i),t||(t=i,n()),r=i}}},function(t,r,n){"use strict";var e=n(20),i=n(64),o=n(67),a=n(25),u=n(30),c=Object.assign;t.exports=!c||n(13)(function(){var t={},r={},n=Symbol(),e="abcdefghijklmnopqrst";return t[n]=7,e.split("").forEach(function(t){r[t]=t}),7!=c({},t)[n]||Object.keys(c({},r)).join("")!=e})?function(t,r){for(var n=a(t),c=arguments.length,s=1,f=i.f,h=o.f;c>s;)for(var d,l=u(arguments[s++]),v=f?e(l).concat(f(l)):e(l),p=v.length,g=0;p>g;)h.call(l,d=v[g++])&&(n[d]=l[d]);return n}:c},function(t,r,n){"use strict";var e=n(2),i=n(63),o=n(28),a=n(22)("IE_PROTO"),u=function(){},c="prototype",s=function(){var t,r=n(19)("iframe"),e=o.length,i="<",a=">";for(r.style.display="none",n(29).appendChild(r),r.src="javascript:",t=r.contentWindow.document,t.open(),t.write(i+"script"+a+"document.F=Object"+i+"/script"+a),t.close(),s=t.F;e--;)delete s[c][o[e]];return s()};t.exports=Object.create||function(t,r){var n;return null!==t?(u[c]=e(t),n=new u,u[c]=null,n[a]=t):n=s(),void 0===r?n:i(n,r)}},function(t,r,n){"use strict";var e=n(15),i=n(2),o=n(20);t.exports=n(6)?Object.defineProperties:function(t,r){i(t);for(var n,a=o(r),u=a.length,c=0;u>c;)e.f(t,n=a[c++],r[n]);return t}},function(t,r){"use strict";r.f=Object.getOwnPropertySymbols},function(t,r,n){"use strict";var e=n(7),i=n(25),o=n(22)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,r,n){"use strict";var e=n(7),i=n(24),o=n(51)(!1),a=n(22)("IE_PROTO");t.exports=function(t,r){var n,u=i(t),c=0,s=[];for(n in u)n!=a&&e(u,n)&&s.push(n);for(;r.length>c;)e(u,n=r[c++])&&(~o(s,n)||s.push(n));return s}},function(t,r){"use strict";r.f={}.propertyIsEnumerable},function(t,r,n){"use strict";var e=n(12),i=n(3),o=n(13);t.exports=function(t,r){var n=(i.Object||{})[t]||Object[t],a={};a[t]=r(n),e(e.S+e.F*o(function(){n(1)}),"Object",a)}},function(t,r,n){"use strict";var e=n(9);t.exports=function(t,r,n){for(var i in r)e(t,i,r[i],n);return t}},function(t,r,n){"use strict";var e=n(1),i=n(15),o=n(6),a=n(0)("species");t.exports=function(t){var r=e[t];o&&r&&!r[a]&&i.f(r,a,{configurable:!0,get:function(){return this}})}},function(t,r,n){"use strict";var e=n(2),i=n(16),o=n(0)("species");t.exports=function(t,r){var n,a=e(t).constructor;return void 0===a||void 0==(n=e(a)[o])?r:i(n)}},function(t,r,n){"use strict";var e=n(23),i=n(18);t.exports=function(t){return function(r,n){var o,a,u=String(i(r)),c=e(n),s=u.length;return c<0||c>=s?t?"":void 0:(o=u.charCodeAt(c),o<55296||o>56319||c+1===s||(a=u.charCodeAt(c+1))<56320||a>57343?t?u.charAt(c):o:t?u.slice(c,c+2):(o-55296<<10)+(a-56320)+65536)}}},function(t,r,n){"use strict";var e=n(23),i=Math.max,o=Math.min;t.exports=function(t,r){return t=e(t),t<0?i(t+r,0):o(t,r)}},function(t,r,n){"use strict";var e=n(14);t.exports=function(t,r){if(!e(t))return t;var n,i;if(r&&"function"==typeof(n=t.toString)&&!e(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!e(i=n.call(t)))return i;if(!r&&"function"==typeof(n=t.toString)&&!e(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,r,n){"use strict";var e=n(17),i=n(0)("iterator"),o=n(8);t.exports=n(3).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[e(t)]}},function(t,r,n){"use strict";var e=n(49),i=n(59),o=n(8),a=n(24);t.exports=n(31)(Array,"Array",function(t,r){this._t=a(t),this._i=0,this._k=r},function(){var t=this._t,r=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,i(1)):"keys"==r?i(0,n):"values"==r?i(0,t[n]):i(0,[n,t[n]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},function(t,r,n){"use strict";var e=n(17),i={};i[n(0)("toStringTag")]="z",i+""!="[object z]"&&n(9)(Object.prototype,"toString",function(){return"[object "+e(this)+"]"},!0)},function(t,r,n){"use strict";var e,i,o,a=n(32),u=n(1),c=n(11),s=n(17),f=n(12),h=n(14),d=n(16),l=n(50),v=n(52),p=n(71),g=n(35).set,w=n(60)(),y="Promise",m=u.TypeError,x=u.process,b=u[y],x=u.process,_="process"==s(x),j=function(){},S=!!function(){try{var t=b.resolve(1),r=(t.constructor={})[n(0)("species")]=function(t){t(j,j)};return(_||"function"==typeof PromiseRejectionEvent)&&t.then(j)instanceof r}catch(t){}}(),M=function(t,r){return t===r||t===b&&r===o},O=function(t){var r;return!(!h(t)||"function"!=typeof(r=t.then))&&r},A=function(t){return M(b,t)?new k(t):new i(t)},k=i=function(t){var r,n;this.promise=new t(function(t,e){if(void 0!==r||void 0!==n)throw m("Bad Promise constructor");r=t,n=e}),this.resolve=d(r),this.reject=d(n)},E=function(t){try{t()}catch(t){return{error:t}}},P=function(t,r){if(!t._n){t._n=!0;var n=t._c;w(function(){for(var e=t._v,i=1==t._s,o=0,a=function(r){var n,o,a=i?r.ok:r.fail,u=r.resolve,c=r.reject,s=r.domain;try{a?(i||(2==t._h&&F(t),t._h=1),a===!0?n=e:(s&&s.enter(),n=a(e),s&&s.exit()),n===r.promise?c(m("Promise-chain cycle")):(o=O(n))?o.call(n,u,c):u(n)):c(e)}catch(t){c(t)}};n.length>o;)a(n[o++]);t._c=[],t._n=!1,r&&!t._h&&T(t)})}},T=function(t){g.call(u,function(){var r,n,e,i=t._v;if(I(t)&&(r=E(function(){_?x.emit("unhandledRejection",i,t):(n=u.onunhandledrejection)?n({promise:t,reason:i}):(e=u.console)&&e.error&&e.error("Unhandled promise rejection",i)}),t._h=_||I(t)?2:1),t._a=void 0,r)throw r.error})},I=function t(r){if(1==r._h)return!1;for(var n,e=r._a||r._c,i=0;e.length>i;)if(n=e[i++],n.fail||!t(n.promise))return!1;return!0},F=function(t){g.call(u,function(){var r;_?x.emit("rejectionHandled",t):(r=u.onrejectionhandled)&&r({promise:t,reason:t._v})})},z=function(t){var r=this;r._d||(r._d=!0,r=r._w||r,r._v=t,r._s=2,r._a||(r._a=r._c.slice()),P(r,!0))},D=function t(r){var n,e=this;if(!e._d){e._d=!0,e=e._w||e;try{if(e===r)throw m("Promise can't be resolved itself");(n=O(r))?w(function(){var i={_w:e,_d:!1};try{n.call(r,c(t,i,1),c(z,i,1))}catch(t){z.call(i,t)}}):(e._v=r,e._s=1,P(e,!1))}catch(t){z.call({_w:e,_d:!1},t)}}};S||(b=function(t){l(this,b,y,"_h"),d(t),e.call(this);try{t(c(D,this,1),c(z,this,1))}catch(t){z.call(this,t)}},e=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},e.prototype=n(69)(b.prototype,{then:function(t,r){var n=A(p(this,b));return n.ok="function"!=typeof t||t,n.fail="function"==typeof r&&r,n.domain=_?x.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&P(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),k=function(){var t=new e;this.promise=t,this.resolve=c(D,t,1),this.reject=c(z,t,1)}),f(f.G+f.W+f.F*!S,{Promise:b}),n(21)(b,y),n(70)(y),o=n(3)[y],f(f.S+f.F*!S,y,{reject:function(t){var r=A(this),n=r.reject;return n(t),r.promise}}),f(f.S+f.F*(a||!S),y,{resolve:function(t){if(t instanceof b&&M(t.constructor,this))return t;var r=A(this),n=r.resolve;return n(t),r.promise}}),f(f.S+f.F*!(S&&n(58)(function(t){b.all(t).catch(j)})),y,{all:function(t){var r=this,n=A(r),e=n.resolve,i=n.reject,o=E(function(){var n=[],o=0,a=1;v(t,!1,function(t){var u=o++,c=!1;n.push(void 0),a++,r.resolve(t).then(function(t){c||(c=!0,n[u]=t,--a||e(n))},i)}),--a||e(n)});return o&&i(o.error),n.promise},race:function(t){var r=this,n=A(r),e=n.reject,i=E(function(){v(t,!1,function(t){r.resolve(t).then(n.resolve,e)})});return i&&e(i.error),n.promise}})},function(t,r,n){"use strict";var e=n(72)(!0);n(31)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,r=this._t,n=this._i;return n>=r.length?{value:void 0,done:!0}:(t=e(r,n),this._i+=t.length,{value:t,done:!1})})},function(t,r,n){"use strict";for(var e=n(76),i=n(9),o=n(1),a=n(4),u=n(8),c=n(0),s=c("iterator"),f=c("toStringTag"),h=u.Array,d=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],l=0;l<5;l++){var v,p=d[l],g=o[p],w=g&&g.prototype;if(w){w[s]||a(w,s,h),w[f]||a(w,f,p),u[p]=h;for(v in e)w[v]||i(w,v,e[v],!0)}}},function(t,r,n){"use strict";function e(t){for(var r=2*t+1,n=new Array(Math.pow(r,2)),e=0;e<r;e++)for(var i=0;i<r;i++)n[e*r+i]=Math.pow(e-t,2)+Math.pow(i-t,2);return{data:n,width:r,height:r}}function i(t,r){for(var n=t.data,e=t.width,i=t.height,o=new Array(n.length),a=0;a<n.length;a++)o[a]=Math.exp(-n[a]/(2*Math.pow(r,2)));return{data:o,width:e,height:i}}function o(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"gaussian",arguments.length>1&&void 0!==arguments[1]?arguments[1]:3),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1.5;t=(t-1)/2;var n=e(t),o=i(n,r),a=u(o);return c(o,a)}var a=n(5),u=a.sum2d,c=a.divide2d;t.exports={fspecial:o}},function(t,r,n){"use strict";function e(t,r,n,e){if(t=s(t,h([r/2,n/2]),e),0===u(r,2)&&(t.data=t.data.slice(0,-t.width),t.height--),0===u(n,2)){for(var i=[],o=0;o<t.data.length;o++)(o+1)%t.width!==0&&i.push(t.data[o]);t.data=i,t.width--}return t}function i(t){return"same"===t&&(t="valid"),t}function o(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symmetric",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"same";return t=e(t,r.width,r.height,n),o=i(o),l(r,t,o)}var a=n(40),u=a.mod,c=n(42),s=c.padarray,f=n(5),h=f.floor,d=n(38),l=d.filter2;t.exports={imfilter:o}},function(t,r){"use strict";function n(t){for(var r=t.data,n=t.width,e=t.height,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=2.5066282746310007,u=new Array(r.length),c=0;c<r.length;c++){var s=(r[c]-i)/o;u[c]=Math.exp(-Math.pow(s,2)/2)/(o*a)}return{data:u,width:n,height:e}}t.exports={normpdf:n}},function(t,r){"use strict";function n(t){var r=i(t,3),n=r[0],e=r[1],o=r[2];return Math.round(.29894*n+.58704*e+.11402*o)}function e(t){for(var r=t.data,e=t.width,i=t.height,o=new Array(e*i),a=0;a<i;a++)for(var u=0;u<e;u++){var c=u+a*e,s=4*c;o[c]=n([r[s],r[s+1],r[s+2],r[s+3]])}return{data:o,width:e,height:i}}var i=function(){function t(t,r){var n=[],e=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){i=!0,o=t}finally{try{!e&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.exports={rgb2gray:e}},function(t,r){"use strict";function n(t,r,n){for(var i=e(r,3),o=i[0],a=i[1],u=i[2],c=e(n,3),s=c[0],f=c[1],h=c[2],d=Math.ceil((h-s)/f),l=Math.ceil((u-o)/a),v=new Array(d*l),p=0;p<l;p++)for(var g=0;g<d;g++){var w=o+p*a,y=s+g*f;v[p*d+g]=t.data[w*t.width+y]}return{data:v,width:d,height:l}}var e=function(){function t(t,r){var n=[],e=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){i=!0,o=t}finally{try{!e&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.exports={skip2d:n}},function(t,r){"use strict";function n(t,r,n,e,i){for(var o=t.data,a=t.width,u=new Array(i*n),c=0;c<n;c++)for(var s=0;s<i;s++)u[c*i+s]=o[(e+c)*a+r+s];return{data:u,width:i,height:n}}t.exports={sub:n}},function(t,r){"use strict";function n(t){for(var r=t.data,n=t.width,e=t.height,i=new Array(n*e),o=0;o<e;o++)for(var a=0;a<n;a++)i[a*e+o]=r[o*n+a];return{data:i,height:n,width:e}}t.exports={transpose:n}},function(t,r,n){"use strict";function e(t,r,n){var e=d("gaussian",n.windowSize,1.5),i=Math.pow(2,n.bitDepth)-1,f=Math.pow(n.k1*i,2),g=Math.pow(n.k2*i,2);if(e=a(e,s(e)),"original"===n.downsample){var w=Math.min(t.width,t.height)/n.maxSize,y=Math.round(w),m=Math.max(1,y);if(m>1){var x=v(m);x=a(x,s(x)),t=l(t,x,"symmetric","same"),r=l(r,x,"symmetric","same"),t=p(t,[0,m,t.height],[0,m,t.width]),r=p(r,[0,m,r.height],[0,m,r.width])}}var b=h(e,t,"valid"),_=h(e,r,"valid"),j=c(b),S=c(_),M=u(b,_),O=c(t),A=c(r),k=u(j,-1),E=u(S,-1),P=u(M,-1),T=o(h(e,O,"valid"),k),I=o(h(e,A,"valid"),E),F=o(h(e,u(t,r),"valid"),P);if(f>0&&g>0){var z=o(u(M,2),f),D=o(u(F,2),g),C=o(o(j,S),f),L=o(o(T,I),g);return a(u(z,D),u(C,L))}var R=u(M,2),N=u(F,2),U=o(j,S),q=o(T,I);return a(u(R,N),u(U,q))}var i=n(5),o=i.add2d,a=i.divide2d,u=i.multiply2d,c=i.square2d,s=i.sum2d,f=n(27),h=f.filter2,d=f.fspecial,l=f.imfilter,v=f.ones,p=f.skip2d; | ||
t.exports={originalSsim:e}},function(t,r,n){"use strict";function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=new Image,e=document.createElement("canvas"),i=e.getContext("2d");return new Promise(function(a,u){n.onload=function(){var t=o(n.width,n.height,r),c=t.width,s=t.height;return 0===c||0===s?u("Failed to load image"):(e.width=c,e.height=s,i.drawImage(n,0,0,n.width,n.height,0,0,c,s),a(i.getImageData(0,0,c,s)))},n.onerror=u,n.src=t})}var i=n(44),o=i.getLimitDimensions;t.exports={readpixels:e}},function(t,r,n){"use strict";function e(t,r,n){var e=m(i(n.windowSize),0,1.5),c=Math.pow(2,n.bitDepth)-1,f=Math.pow(n.k1*c,2),g=Math.pow(n.k2*c,2);e=d(e,p(e));var y=_(e);if("original"===n.downsample){var x=u(t,r,n.maxSize),b=s(x,2);t=b[0],r=b[1]}var j=w(t,e,y,"valid"),S=w(r,e,y,"valid"),M=v(j),O=v(S),A=l(j,S),k=v(t),E=v(r),P=l(M,-1),T=l(O,-1),I=l(A,-1),F=h(w(k,e,y,"valid"),P),z=h(w(E,e,y,"valid"),T),D=h(w(l(t,r),e,y,"valid"),I);return f>0&&g>0?o(A,D,M,O,F,z,f,g):a(A,D,M,O,F,z)}function i(t){for(var r=Math.floor(t/2),n=new Array(2*r+1),e=-r;e<=r;e++)n[e+r]=Math.abs(e);return{data:n,width:n.length,height:1}}function o(t,r,n,e,i,o,a,u){var c=h(l(t,2),a),s=h(l(r,2),u),f=h(h(n,e),a),v=h(h(i,o),u);return d(l(c,s),l(f,v))}function a(t,r,n,e,i,o){var a=l(t,2),u=l(r,2),c=h(n,e),s=h(i,o);return d(l(a,u),l(c,s))}function u(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256,e=Math.min(t.width,r.height)/n,i=Math.round(e);if(i>1){var o=x(i);o=d(o,p(o)),t=c(t,o,i),r=c(r,o,i)}return[t,r]}function c(t,r,n){var e=y(t,r,"symmetric","same");return b(e,[0,n,e.height],[0,n,e.width])}var s=function(){function t(t,r){var n=[],e=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(n.push(a.value),!r||n.length!==r);e=!0);}catch(t){i=!0,o=t}finally{try{!e&&u.return&&u.return()}finally{if(i)throw o}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return t(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),f=n(5),h=f.add2d,d=f.divide2d,l=f.multiply2d,v=f.square2d,p=f.sum2d,g=n(27),w=g.conv2,y=g.imfilter,m=g.normpdf,x=g.ones,b=g.skip2d,_=g.transpose;t.exports={ssim:e}},function(t,r){"use strict";t.exports={type:"deploy",version:"2.3.2"}},function(t,r){t.exports={windowSize:11,k1:.01,k2:.03,bitDepth:8,downsample:"original",ssim:"fast",maxSize:256}},function(t,r,n){n(46),n(48),n(47),t.exports=n(45)}])}); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.ssim=n():t.ssim=n()}(this,function(){return function(t){function n(e){if(r[e])return r[e].exports;var i=r[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var r={};return n.m=t,n.c=r,n.i=function(t){return t},n.d=function(t,n,r){Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(r,"a",r),r},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=65)}([function(t,n){function r(t){return e(t)/t.length}function e(t){for(var n=0,r=0;r<t.length;r++)n+=t[r];return n}function i(t){for(var n=new Array(t.length),r=0;r<t.length;r++)n[r]=Math.floor(t[r]);return n}function o(t){for(var n=t.data,r=0,e=0;e<n.length;e++)r+=n[e];return r}function a(t,n){for(var r=t.data,e=t.width,i=t.height,o=n.data,a=new Array(r.length),u=0;u<i;u++)for(var f=u*e,c=0;c<e;c++)a[f+c]=r[f+c]+o[f+c];return{data:a,width:e,height:i}}function u(t,n){for(var r=t.data,e=t.width,i=t.height,o=new Array(r.length),a=0;a<r.length;a++)o[a]=r[a]+n;return{data:o,width:e,height:i}}function f(t,n){return"number"==typeof n?u(t,n):a(t,n)}function c(t,n){for(var r=t.data,e=t.width,i=t.height,o=new Array(r.length),a=0;a<r.length;a++)o[a]=r[a]/n;return{data:o,width:e,height:i}}function h(t,n){for(var r=t.data,e=t.width,i=t.height,o=n.data,a=new Array(r.length),u=0;u<r.length;u++)a[u]=r[u]/o[u];return{data:a,width:e,height:i}}function d(t,n){return"number"==typeof n?c(t,n):h(t,n)}function l(t,n){for(var r=t.data,e=t.width,i=t.height,o=new Array(r.length),a=0;a<r.length;a++)o[a]=r[a]*n;return{data:o,width:e,height:i}}function s(t,n){for(var r=t.data,e=t.width,i=t.height,o=n.data,a=new Array(r.length),u=0;u<r.length;u++)a[u]=r[u]*o[u];return{data:a,width:e,height:i}}function p(t,n){return"number"==typeof n?l(t,n):s(t,n)}function v(t){return p(t,t)}function w(t){return o(t)/t.data.length}t.exports={add2d:f,average:r,divide2d:d,floor:i,mean2d:w,multiply2d:p,square2d:v,sum:e,sum2d:o}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,n,r){t.exports=!r(1)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){return"object"===("undefined"==typeof t?"undefined":r(t))?null!==t:"function"==typeof t}},function(t,n,r){(function(t,e){function i(t,n){this._id=t,this._clearFn=n}var o=r(50).nextTick,a=Function.prototype.apply,u=Array.prototype.slice,f={},c=0;n.setTimeout=function(){return new i(a.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new i(a.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(t){t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(t,n){clearTimeout(t._idleTimeoutId),t._idleTimeout=n},n.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},n._unrefActive=n.active=function(t){clearTimeout(t._idleTimeoutId);var n=t._idleTimeout;n>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},n))},n.setImmediate="function"==typeof t?t:function(t){var r=c++,e=!(arguments.length<2)&&u.call(arguments,1);return f[r]=!0,o(function(){f[r]&&(e?t.apply(null,e):t.call(null),n.clearImmediate(r))}),r},n.clearImmediate="function"==typeof e?e:function(t){delete f[t]}}).call(n,r(6).setImmediate,r(6).clearImmediate)},function(t,n,r){var e=r(18),i=e.conv2,o=r(19),a=o.filter2,u=r(53),f=u.fspecial,c=r(54),h=c.imfilter,d=r(55),l=d.normpdf,s=r(22),p=s.ones,v=r(23),w=v.padarray,y=r(56),m=y.rgb2gray,g=r(57),b=g.skip2d,x=r(59),T=x.transpose,M=r(24),S=M.zeros;t.exports={conv2:i,filter2:a,fspecial:f,imfilter:h,normpdf:l,ones:p,padarray:w,rgb2gray:m,skip2d:b,transpose:T,zeros:S}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){var e=r(2),i=r(3),o=r(11),a=r(44),u=r(33),f="prototype",c=function t(n,r,c){var h,d,l,s,p=n&t.F,v=n&t.G,w=n&t.S,y=n&t.P,m=n&t.B,g=v?e:w?e[r]||(e[r]={}):(e[r]||{})[f],b=v?i:i[r]||(i[r]={}),x=b[f]||(b[f]={});v&&(c=r);for(h in c)d=!p&&g&&void 0!==g[h],l=(d?g:c)[h],s=m&&d?u(l,e):y&&"function"==typeof l?u(Function.call,l):l,g&&a(g,h,l,n&t.U),b[h]!=l&&o(b,h,s),y&&x[h]!=l&&(x[h]=l)};e.core=i,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n,r){var e=r(38),i=r(43);t.exports=r(4)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(32);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n,r){var e=r(40),i=r(35);t.exports=Object.keys||function(t){return e(t,i)}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(12),i=r(8);t.exports=function(t){return e(i(t))}},function(t,n,r){var e=r(8);t.exports=function(t){return Object(e(t))}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){function e(t,n){for(var r=t.data,e=t.width,i=t.height,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"full",a=e+n.width-1,f=i+n.height-1,c=l(f,a),h=c.data,d=0;d<n.height;d++)for(var s=0;s<n.width;s++){var p=n.data[d*n.width+s];if(p)for(var v=0;v<i;v++)for(var w=0;w<e;w++)h[(v+d)*a+w+s]+=r[v*e+w]*p}var y={data:h,width:a,height:f};return u(y,o,i,n.height,e,n.width)}function i(t,n){var r=n.data,e=n.width,i=n.height,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"full",u=p(i,1),f=p(1,e),c=a(t,u,f,o);return w(c,r[0])}function o(t){for(var n=t.data,r=n[0],e=1;e<n.length;e++)if(n[e]!==r)return!1;return!0}function a(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"full",o=Math.max(n.height,n.width),a=Math.max(r.height,r.width),f=e(t,n,"full"),c=e(f,r,"full");return u(c,i,t.height,o,t.width,a)}function u(t,n,r,e,i,o){if("full"===n)return t;if("same"===n){var a=Math.ceil((t.height-r)/2),u=Math.ceil((t.width-i)/2);return h(t,a,r,u,i)}return h(t,e-1,r-e+1,o-1,i-o+1)}function f(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return n[2]&&n[2].data?a.apply(void 0,n):o(n[1])?i.apply(void 0,n):e.apply(void 0,n)}var c=r(58),h=c.sub,d=r(24),l=d.zeros,s=r(22),p=s.ones,v=r(0),w=v.multiply2d;t.exports={conv2:f}},function(t,n,r){function e(t){for(var n=t.data,r=t.width,e=t.height,i=new Array(n.length),o=0;o<e;o++)for(var a=0;a<r;a++)i[o*r+a]=n[(e-1-o)*r+r-1-a];return{data:i,width:r,height:e}}function i(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"same";return a(n,e(t),r)}var o=r(18),a=o.conv2;t.exports={filter2:i}},function(t,n){function r(t,n,r){for(var e=n*t,i=new Array(e),o=0;o<e;o++)i[o]=r;return{data:i,width:n,height:t}}t.exports={numbers:r}},function(t,n){function r(t,n){return t-n*Math.floor(t/n)}t.exports={mod:r}},function(t,n,r){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return o(t,n,1)}var i=r(20),o=i.numbers;t.exports={ones:e}},function(t,n,r){function e(t){for(var n=t.data,r=t.width,e=t.height,i=new Array(n.length),o=0;o<e;o++)for(var a=0;a<r;a++)i[o*r+a]=n[o*r+r-1-a];return{data:i,width:r,height:e}}function i(t){for(var n=t.data,r=t.width,e=t.height,i=new Array(n.length),o=0;o<e;o++)for(var a=0;a<r;a++)i[o*r+a]=n[(e-1-o)*r+a];return{data:i,width:r,height:e}}function o(t,n){for(var r=t.width+n.width,e=new Array(t.height*r),i=0;i<t.height;i++){for(var o=0;o<t.width;o++)e[i*r+o]=t.data[i*t.width+o];for(var a=0;a<n.width;a++)e[i*r+a+t.width]=n.data[i*n.width+a]}return{data:e,width:r,height:t.height}}function a(t,n){return{data:t.data.concat(n.data),height:t.height+n.height,width:t.width}}function u(t,n){for(var r=t.width+2*n,i=new Array(r*t.height),a=o(t,e(t)),u=0;u<t.height;u++)for(var f=-n;f<t.width+n;f++)i[u*r+f+n]=a.data[u*a.width+s(f,a.width)];return{data:i,width:r,height:t.height}}function f(t,n){for(var r=a(t,i(t)),e=t.height+2*n,o=new Array(t.width*e),u=-n;u<t.height+n;u++)for(var f=0;f<t.width;f++)o[(u+n)*t.width+f]=r.data[s(u,r.height)*t.width+f];return{data:o,width:t.width,height:e}}function c(t,n){for(var r=d(n,2),e=r[0],i=r[1],o=t.width+2*i,a=t.height+2*e,u=new Array(o*a),f=-e;f<0;f++){for(var c=-i;c<0;c++)u[(f+e)*o+c+i]=t.data[(Math.abs(f)-1)*t.width+Math.abs(c)-1];for(var h=0;h<t.width;h++)u[(f+e)*o+h+i]=t.data[(Math.abs(f)-1)*t.width+h];for(var l=t.width;l<t.width+i;l++)u[(f+e)*o+l+i]=t.data[(Math.abs(f)-1)*t.width+2*t.width-l-1]}for(var s=0;s<t.height;s++){for(var p=-i;p<0;p++)u[(s+e)*o+p+i]=t.data[s*t.width+Math.abs(p)-1];for(var v=0;v<t.width;v++)u[(s+e)*o+v+i]=t.data[s*t.width+v];for(var w=t.width;w<t.width+i;w++)u[(s+e)*o+w+i]=t.data[s*t.width+2*t.width-w-1]}for(var y=t.height;y<t.height+e;y++){for(var m=-i;m<0;m++)u[(y+e)*o+m+i]=t.data[(2*t.height-y-1)*t.width+Math.abs(m)-1];for(var g=0;g<t.width;g++)u[(y+e)*o+g+i]=t.data[(2*t.height-y-1)*t.width+g];for(var b=t.width;b<t.width+i;b++)u[(y+e)*o+b+i]=t.data[(2*t.height-y-1)*t.width+2*t.width-b-1]}return{data:u,width:o,height:a}}function h(t,n){var r=d(n,2),e=r[0],i=r[1];return t.height>=e&&t.width>=i?c(t,[e,i]):f(u(t,i),e)}var d=function(){function t(t,n){var r=[],e=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(r.push(a.value),!n||r.length!==n);e=!0);}catch(t){i=!0,o=t}finally{try{!e&&u.return&&u.return()}finally{if(i)throw o}}return r}return function(n,r){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return t(n,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=r(21),s=l.mod;t.exports={padarray:h}},function(t,n,r){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return o(t,n,0)}var i=r(20),o=i.numbers;t.exports={zeros:e}},function(t,n){function r(t){throw new Error("Missing "+t+" parameter")}function e(t,n,r){if(r&&t>=r&&n>=r){var e=t/n;return e>1?{height:r,width:Math.round(r/e)}:{height:Math.round(r*e),width:r}}return{width:t,height:n}}t.exports={force:r,getLimitDimensions:e}},function(t,n,r){function e(t){if(Object.keys(t).forEach(function(t){if(!(t in x))throw new Error('"'+t+'" is not a valid option')}),"k1"in t&&("number"!=typeof t.k1||t.k1<0))throw new Error("Invalid k1 value. Default is "+x.k1);if("k2"in t&&("number"!=typeof t.k2||t.k2<0))throw new Error("Invalid k2 value. Default is "+x.k2)}function i(t){return e(t),Object.assign({},x,t)}function o(t){if(t[0].width!==t[1].width||t[0].height!==t[1].height)throw new Error("Image dimensions do not match");return t}function a(t){return[l(t[0]),l(t[1])]}function u(t,n){return"fast"===n.downsample?h(t,f.Promise,n.maxSize):h(t,f.Promise)}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b("image1"),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b("image2"),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},e=(new Date).getTime();r=i(r);var c="fast"===r.ssim?w:m;return f.Promise.all([u(t,r),u(n,r)]).then(o).then(a).then(function(t){return c(t[0],t[1],r)}).then(function(t){return{ssim_map:t,mssim:p(t),performance:(new Date).getTime()-e}})}var c=r(61),h=c.readpixels,d=r(7),l=d.rgb2gray,s=r(0),p=s.mean2d,v=r(62),w=v.ssim,y=r(60),m=y.originalSsim,g=r(25),b=g.force,x=r(64),T=r(63),M=T.version,S=r(51);f.Promise=this.Promise||S,f.ssim=w,f.version=M,t.exports=f},function(t,n,r){var e=r(9);e(e.S+e.F,"Object",{assign:r(37)})},function(t,n,r){var e=r(16),i=r(13);r(42)("keys",function(){return function(t){return i(e(t))}})},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,r){var e=r(5);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n,r){var e=r(15),i=r(48),o=r(47);t.exports=function(t){return function(n,r,a){var u,f=e(n),c=i(f.length),h=o(a,c);if(t&&r!=r){for(;c>h;)if(u=f[h++],u!=u)return!0}else for(;c>h;h++)if((t||h in f)&&f[h]===r)return t||h||0;return!t&&-1}}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(29);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,i){return t.call(n,r,e,i)}}return function(){return t.apply(n,arguments)}}},function(t,n,r){var e=r(5),i=r(2).document,o=e(i)&&e(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,r){t.exports=!r(4)&&!r(1)(function(){return 7!=Object.defineProperty(r(34)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){"use strict";var e=r(13),i=r(39),o=r(41),a=r(16),u=r(12),f=Object.assign;t.exports=!f||r(1)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=f({},t)[r]||Object.keys(f({},n)).join("")!=e})?function(t,n){for(var r=a(t),f=arguments.length,c=1,h=i.f,d=o.f;f>c;)for(var l,s=u(arguments[c++]),p=h?e(s).concat(h(s)):e(s),v=p.length,w=0;v>w;)d.call(s,l=p[w++])&&(r[l]=s[l]);return r}:f},function(t,n,r){var e=r(30),i=r(36),o=r(49),a=Object.defineProperty;n.f=r(4)?Object.defineProperty:function(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return a(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,r){var e=r(10),i=r(15),o=r(31)(!1),a=r(45)("IE_PROTO");t.exports=function(t,n){var r,u=i(t),f=0,c=[];for(r in u)r!=a&&e(u,r)&&c.push(r);for(;n.length>f;)e(u,r=n[f++])&&(~o(c,r)||c.push(r));return c}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,r){var e=r(9),i=r(3),o=r(1);t.exports=function(t,n){var r=(i.Object||{})[t]||Object[t],a={};a[t]=n(r),e(e.S+e.F*o(function(){r(1)}),"Object",a)}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var e=r(2),i=r(11),o=r(10),a=r(17)("src"),u="toString",f=Function[u],c=(""+f).split(u);r(3).inspectSource=function(t){return f.call(t)},(t.exports=function(t,n,r,u){var f="function"==typeof r;f&&(o(r,"name")||i(r,"name",n)),t[n]!==r&&(f&&(o(r,a)||i(r,a,t[n]?""+t[n]:c.join(String(n)))),t===e?t[n]=r:u?t[n]?t[n]=r:i(t,n,r):(delete t[n],i(t,n,r)))})(Function.prototype,u,function(){return"function"==typeof this&&this[a]||f.call(this)})},function(t,n,r){var e=r(46)("keys"),i=r(17);t.exports=function(t){return e[t]||(e[t]=i(t))}},function(t,n,r){var e=r(2),i="__core-js_shared__",o=e[i]||(e[i]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,n,r){var e=r(14),i=Math.max,o=Math.min;t.exports=function(t,n){return t=e(t),t<0?i(t+n,0):o(t,n)}},function(t,n,r){var e=r(14),i=Math.min;t.exports=function(t){return t>0?i(e(t),9007199254740991):0}},function(t,n,r){var e=r(5);t.exports=function(t,n){if(!e(t))return t;var r,i;if(n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!e(i=r.call(t)))return i;if(!n&&"function"==typeof(r=t.toString)&&!e(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,n){function r(){throw new Error("setTimeout has not been defined")}function e(){throw new Error("clearTimeout has not been defined")}function i(t){if(h===setTimeout)return setTimeout(t,0);if((h===r||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(n){try{return h.call(null,t,0)}catch(n){return h.call(this,t,0)}}}function o(t){if(d===clearTimeout)return clearTimeout(t);if((d===e||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(n){try{return d.call(null,t)}catch(n){return d.call(this,t)}}}function a(){v&&s&&(v=!1,s.length?p=s.concat(p):w=-1,p.length&&u())}function u(){if(!v){var t=i(a);v=!0;for(var n=p.length;n;){for(s=p,p=[];++w<n;)s&&s[w].run();w=-1,n=p.length}s=null,v=!1,o(t)}}function f(t,n){this.fun=t,this.array=n}function c(){}var h,d,l=t.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:r}catch(t){h=r}try{d="function"==typeof clearTimeout?clearTimeout:e}catch(t){d=e}}();var s,p=[],v=!1,w=-1;l.nextTick=function(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)n[r-1]=arguments[r];p.push(new f(t,n)),1!==p.length||v||i(u)},f.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=c,l.addListener=c,l.once=c,l.off=c,l.removeListener=c,l.removeAllListeners=c,l.emit=c,l.binding=function(t){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(t){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},function(t,n,r){(function(n,r){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){function i(t){n.setImmediate?r(t):n.importScripts?setTimeout(t):(a++,u[a]=t,n.postMessage(a,"*"))}function o(t){"use strict";function n(t,n,r,i){if(2==c)return i();if("object"!=("undefined"==typeof h?"undefined":e(h))&&"function"!=typeof h||"function"!=typeof t)i();else try{var o=0;t.call(h,function(t){o++||(h=t,n())},function(t){o++||(h=t,r())})}catch(t){h=t,r()}}function r(){var t;try{t=h&&h.then}catch(t){return h=t,c=2,r()}n(t,function(){c=1,r()},function(){c=2,r()},function(){try{1==c&&"function"==typeof a?h=a(h):2==c&&"function"==typeof u&&(h=u(h),c=1)}catch(t){return h=t,l()}h==f?(h=TypeError(),l()):n(t,function(){l(3)},l,function(){l(1==c&&3)})})}if("function"!=typeof t&&void 0!=t)throw TypeError();if("object"!=e(this)||this&&this.then)throw TypeError();var a,u,f=this,c=0,h=0,d=[];f.promise=f,f.resolve=function(t){return a=f.fn,u=f.er,c||(h=t,c=1,i(r)),f},f.reject=function(t){return a=f.fn,u=f.er,c||(h=t,c=2,i(r)),f},f._d=1,f.then=function(t,n){if(1!=this._d)throw TypeError();var r=new o;return r.fn=t,r.er=n,3==c?r.resolve(h):4==c?r.reject(h):d.push(r),r},f.catch=function(t){return f.then(null,t)};var l=function(t){c=t||4,d.map(function(t){3==c&&t.resolve(h)||t.reject(h)})};try{"function"==typeof t&&t(f.resolve,f.reject)}catch(t){f.reject(t)}return f}n=this;var a=1,u={},f=!1;n.setImmediate||n.addEventListener("message",function(t){if(t.source==n)if(f)i(u[t.data]);else{f=!0;try{u[t.data]()}catch(t){}delete u[t.data],f=!1}}),o.resolve=function(t){if(1!=this._d)throw TypeError();return t instanceof o?t:new o(function(n){n(t)})},o.reject=function(t){if(1!=this._d)throw TypeError();return new o(function(n,r){r(t)})},o.all=function(t){function n(e,i){if(i)return r.resolve(i);if(e)return r.reject(e);var o=t.reduce(function(t,n){return n&&n.then?t+1:t},0);0==o&&r.resolve(t),t.map(function(r,e){r&&r.then&&r.then(function(r){return t[e]=r,n(),r},n)})}if(1!=this._d)throw TypeError();if(!(t instanceof Array))return o.reject(TypeError());var r=new o;return n(),r},o.race=function(t){function n(e,i){if(i)return r.resolve(i);if(e)return r.reject(e);var o=t.reduce(function(t,n){return n&&n.then?t+1:t},0);0==o&&r.resolve(t),t.map(function(t,r){t&&t.then&&t.then(function(t){n(null,t)},n)})}if(1!=this._d)throw TypeError();if(!(t instanceof Array))return o.reject(TypeError());if(0==t.length)return new o;var r=new o;return n(),r},o._d=1,t.exports=o}()}).call(n,r(52),r(6).setImmediate)},function(t,n){var r,e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":e(window))&&(r=window)}t.exports=r},function(t,n,r){function e(t){for(var n=2*t+1,r=new Array(Math.pow(n,2)),e=0;e<n;e++)for(var i=0;i<n;i++)r[e*n+i]=Math.pow(e-t,2)+Math.pow(i-t,2);return{data:r,width:n,height:n}}function i(t,n){for(var r=t.data,e=t.width,i=t.height,o=new Array(r.length),a=0;a<r.length;a++)o[a]=Math.exp(-r[a]/(2*Math.pow(n,2)));return{data:o,width:e,height:i}}function o(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"gaussian",arguments.length>1&&void 0!==arguments[1]?arguments[1]:3),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1.5;t=(t-1)/2;var r=e(t),o=i(r,n),a=u(o);return f(o,a)}var a=r(0),u=a.sum2d,f=a.divide2d;t.exports={fspecial:o}},function(t,n,r){function e(t,n,r,e){if(t=c(t,d([n/2,r/2]),e),0===u(n,2)&&(t.data=t.data.slice(0,-t.width),t.height--),0===u(r,2)){for(var i=[],o=0;o<t.data.length;o++)(o+1)%t.width!==0&&i.push(t.data[o]);t.data=i,t.width--}return t}function i(t){return"same"===t&&(t="valid"),t}function o(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"symmetric",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"same";return t=e(t,n.width,n.height,r),o=i(o),s(n,t,o)}var a=r(21),u=a.mod,f=r(23),c=f.padarray,h=r(0),d=h.floor,l=r(19),s=l.filter2;t.exports={imfilter:o}},function(t,n){function r(t){for(var n=t.data,r=t.width,e=t.height,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=2.5066282746310007,u=new Array(n.length),f=0;f<n.length;f++){var c=(n[f]-i)/o;u[f]=Math.exp(-Math.pow(c,2)/2)/(o*a)}return{data:u,width:r,height:e}}t.exports={normpdf:r}},function(t,n){function r(t,n,r){return Math.round(.29894*t+.58704*n+.11402*r)}function e(t){for(var n=t.data,e=t.width,i=t.height,o=new Array(e*i),a=0;a<i;a++)for(var u=0;u<e;u++){var f=u+a*e,c=4*f;o[f]=r(n[c],n[c+1],n[c+2],n[c+3])}return{data:o,width:e,height:i}}t.exports={rgb2gray:e}},function(t,n){function r(t,n,r){for(var i=e(n,3),o=i[0],a=i[1],u=i[2],f=e(r,3),c=f[0],h=f[1],d=f[2],l=Math.ceil((d-c)/h),s=Math.ceil((u-o)/a),p=new Array(l*s),v=0;v<s;v++)for(var w=0;w<l;w++){var y=o+v*a,m=c+w*h;p[v*l+w]=t.data[y*t.width+m]}return{data:p,width:l,height:s}}var e=function(){function t(t,n){var r=[],e=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(r.push(a.value),!n||r.length!==n);e=!0);}catch(t){i=!0,o=t}finally{try{!e&&u.return&&u.return()}finally{if(i)throw o}}return r}return function(n,r){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return t(n,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.exports={skip2d:r}},function(t,n){function r(t,n,r,e,i){for(var o=t.data,a=t.width,u=new Array(i*r),f=0;f<r;f++)for(var c=0;c<i;c++)u[f*i+c]=o[(e+f)*a+n+c];return{data:u,width:i,height:r}}t.exports={sub:r}},function(t,n){function r(t){for(var n=t.data,r=t.width,e=t.height,i=new Array(r*e),o=0;o<e;o++)for(var a=0;a<r;a++)i[a*e+o]=n[o*r+a];return{data:i,height:r,width:e}}t.exports={transpose:r}},function(t,n,r){function e(t,n,r){var e=l("gaussian",r.windowSize,1.5),i=Math.pow(2,r.bitDepth)-1,h=Math.pow(r.k1*i,2),w=Math.pow(r.k2*i,2);if(e=a(e,c(e)),"original"===r.downsample){var y=Math.min(t.width,t.height)/r.maxSize,m=Math.round(y),g=Math.max(1,m);if(g>1){var b=p(g);b=a(b,c(b)),t=s(t,b,"symmetric","same"),n=s(n,b,"symmetric","same"),t=v(t,[0,g,t.height],[0,g,t.width]),n=v(n,[0,g,n.height],[0,g,n.width])}}var x=d(e,t,"valid"),T=d(e,n,"valid"),M=f(x),S=f(T),j=u(x,T),_=f(t),A=f(n),E=u(M,-1),O=u(S,-1),k=u(j,-1),I=o(d(e,_,"valid"),E),P=o(d(e,A,"valid"),O),F=o(d(e,u(t,n),"valid"),k);if(h>0&&w>0){var z=o(u(j,2),h),D=o(u(F,2),w),L=o(o(M,S),h),q=o(o(I,P),w);return a(u(z,D),u(L,q))}var C=u(j,2),B=u(F,2),G=o(M,S),N=o(I,P);return a(u(C,B),u(G,N))}var i=r(0),o=i.add2d,a=i.divide2d,u=i.multiply2d,f=i.square2d,c=i.sum2d,h=r(7),d=h.filter2,l=h.fspecial,s=h.imfilter,p=h.ones,v=h.skip2d;t.exports={originalSsim:e}},function(t,n,r){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,e=new Image,i=document.createElement("canvas"),a=i.getContext("2d");return new n(function(n,u){e.onload=function(){var t=o(e.width,e.height,r),f=t.width,c=t.height;return 0===f||0===c?u("Failed to load image"):(i.width=f,i.height=c,a.drawImage(e,0,0,e.width,e.height,0,0,f,c),n(a.getImageData(0,0,f,c)))},e.onerror=u,e.src=t})}var i=r(25),o=i.getLimitDimensions;t.exports={readpixels:e}},function(t,n,r){function e(t,n,r){var e=g(i(r.windowSize),0,1.5),f=Math.pow(2,r.bitDepth)-1,h=Math.pow(r.k1*f,2),w=Math.pow(r.k2*f,2);e=l(e,v(e));var m=T(e);if("original"===r.downsample){var b=u(t,n,r.maxSize),x=c(b,2);t=x[0],n=x[1]}var M=y(t,e,m,"valid"),S=y(n,e,m,"valid"),j=p(M),_=p(S),A=s(M,S),E=p(t),O=p(n),k=s(j,-1),I=s(_,-1),P=s(A,-1),F=d(y(E,e,m,"valid"),k),z=d(y(O,e,m,"valid"),I),D=d(y(s(t,n),e,m,"valid"),P);return h>0&&w>0?o(A,D,j,_,F,z,h,w):a(A,D,j,_,F,z)}function i(t){for(var n=Math.floor(t/2),r=new Array(2*n+1),e=-n;e<=n;e++)r[e+n]=Math.abs(e);return{data:r,width:r.length,height:1}}function o(t,n,r,e,i,o,a,u){var f=d(s(t,2),a),c=d(s(n,2),u),h=d(d(r,e),a),p=d(d(i,o),u);return l(s(f,c),s(h,p))}function a(t,n,r,e,i,o){var a=s(t,2),u=s(n,2),f=d(r,e),c=d(i,o);return l(s(a,u),s(f,c))}function u(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256,e=Math.min(t.width,n.height)/r,i=Math.round(e);if(i>1){var o=b(i);o=l(o,v(o)),t=f(t,o,i),n=f(n,o,i)}return[t,n]}function f(t,n,r){var e=m(t,n,"symmetric","same");return x(e,[0,r,e.height],[0,r,e.width])}var c=function(){function t(t,n){var r=[],e=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(e=(a=u.next()).done)&&(r.push(a.value),!n||r.length!==n);e=!0);}catch(t){i=!0,o=t}finally{try{!e&&u.return&&u.return()}finally{if(i)throw o}}return r}return function(n,r){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return t(n,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=r(0),d=h.add2d,l=h.divide2d,s=h.multiply2d,p=h.square2d,v=h.sum2d,w=r(7),y=w.conv2,m=w.imfilter,g=w.normpdf,b=w.ones,x=w.skip2d,T=w.transpose;t.exports={ssim:e}},function(t,n){t.exports={type:"deploy",version:"2.4.0"}},function(t,n){t.exports={windowSize:11,k1:.01,k2:.03,bitDepth:8,downsample:"original",ssim:"fast",maxSize:256}},function(t,n,r){r(28),r(27),t.exports=r(26)}])}); |
@@ -6,3 +6,3 @@ { | ||
"browser": "dist/ssim.web.js", | ||
"version": "2.3.2", | ||
"version": "2.4.0", | ||
"scripts": { | ||
@@ -66,2 +66,3 @@ "commit": "git-cz", | ||
"image-type": "^2.1.0", | ||
"promiz": "^1.0.5", | ||
"yargs": "^6.5.0" | ||
@@ -80,3 +81,3 @@ }, | ||
"codeclimate-test-reporter": "^0.4.0", | ||
"commitizen": "^2.9.0", | ||
"commitizen": "^2.9.2", | ||
"condition-circle": "^1.5.0", | ||
@@ -105,3 +106,3 @@ "core-js": "^2.4.1", | ||
"tap-dot": "^1.0.5", | ||
"webdriverio": "^4.5.0", | ||
"webdriverio": "^4.5.1", | ||
"webpack": "^2.1.0-beta.27" | ||
@@ -108,0 +109,0 @@ }, |
@@ -80,8 +80,8 @@ [](https://circleci.com/gh/obartra/ssim/tree/master) [](https://codeclimate.com/github/obartra/ssim/coverage) [](https://opensource.org/licenses/MIT) | ||
| Documentation | [](https://inch-ci.org/github/obartra/ssim) | | ||
| Environments |   [](https://saucelabs.com/u/saucessim-master)| | ||
| Environments |   [](https://saucelabs.com/u/saucessim-master)| | ||
[](https://saucelabs.com/u/saucessim-master) | ||
## 💡 Rationale | ||
## 💡 Credits | ||
This project is a direct port of algorithms published by [Wang, et al. 2004](/assets/ssim.pdf) on "Image Quality Assessment: From Error Visibility to Structural Similarity". The original Matlab scripts are available [here](https://ece.uwaterloo.ca/~z70wang/research/iwssim/) with their datasets. To view the steps taken to validate `ssim.js` results, check the [wiki](https://github.com/obartra/ssim/wiki/Results-Validation). |
@@ -13,3 +13,5 @@ /** | ||
* @method luma | ||
* @param {Number[]} subpixels - The different pixels to use in the following order: r, g, b | ||
* @param {Number} r - The red pixel value | ||
* @param {Number} g - The green pixel value | ||
* @param {Number} b - The blue pixel value | ||
* @returns {Number} lumaValue - The value of the luminance for the [r,g,b] pixel | ||
@@ -20,3 +22,3 @@ * @private | ||
*/ | ||
function luma([r, g, b]) { | ||
function luma(r, g, b) { | ||
return Math.round(0.29894 * r + 0.58704 * g + 0.11402 * b); | ||
@@ -46,3 +48,3 @@ } | ||
data[grayIndex] = luma([d[imgIndex], d[imgIndex + 1], d[imgIndex + 2], d[imgIndex + 3]]); | ||
data[grayIndex] = luma(d[imgIndex], d[imgIndex + 1], d[imgIndex + 2], d[imgIndex + 3]); | ||
} | ||
@@ -49,0 +51,0 @@ } |
@@ -41,5 +41,3 @@ const fs = require('fs'); | ||
return new Promise((resolve) => { | ||
resolve(imageData); | ||
}); | ||
return imageData; | ||
} | ||
@@ -52,2 +50,3 @@ | ||
* @param {string} url - url to load image data from | ||
* @param {function} P - The Promise definition, must be a valid Promises/A+ implementation | ||
* @returns {Promise} promise - A promise that resolves with the image 3D matrix | ||
@@ -58,4 +57,4 @@ * @private | ||
*/ | ||
function loadUrl(url) { | ||
return new Promise((resolve, reject) => { | ||
function loadUrl(url, P) { | ||
return new P((resolve, reject) => { | ||
http | ||
@@ -78,2 +77,3 @@ .get(url) | ||
* @param {string} path - File path to load image data from | ||
* @param {function} P - The Promise definition, must be a valid Promises/A+ implementation | ||
* @returns {Promise} promise - A promise that resolves with the image 3D matrix | ||
@@ -84,4 +84,4 @@ * @private | ||
*/ | ||
function loadFs(path) { | ||
return new Promise((resolve, reject) => { | ||
function loadFs(path, P) { | ||
return new P((resolve, reject) => { | ||
fs.readFile(path, (err, data) => { | ||
@@ -103,2 +103,3 @@ if (err) { | ||
* @param {string|Buffer} url - A url, file path or buffer to use to load the image data | ||
* @param {function} P - The Promise definition, must be a valid Promises/A+ implementation | ||
* @param {number} [limit=0] - A limit that, if set and both dimensions (width / height) surpass it, | ||
@@ -111,11 +112,11 @@ * will downsize the image to that size on the smallest dimension. | ||
*/ | ||
function readpixels(url, limit = 0) { | ||
function readpixels(url, P, limit = 0) { | ||
let bufferPromise; | ||
if (Buffer.isBuffer(url)) { | ||
bufferPromise = Promise.resolve(url); | ||
bufferPromise = P.resolve(url); | ||
} else if (url.indexOf('http://') === 0 || url.indexOf('https://') === 0) { | ||
bufferPromise = loadUrl(url); | ||
bufferPromise = loadUrl(url, P); | ||
} else { | ||
bufferPromise = loadFs(url); | ||
bufferPromise = loadFs(url, P); | ||
} | ||
@@ -122,0 +123,0 @@ return bufferPromise |
@@ -9,2 +9,3 @@ /* eslint-env browser */ | ||
* @param {string} url - The url to use to load the image data | ||
* @param {function} P - The Promise definition, must be a valid Promises/A+ implementation | ||
* @param {number} [limit=0] - A limit that, if set and both dimensions (width / height) surpass it, | ||
@@ -16,3 +17,3 @@ * will downsize the image to that size on the smallest dimension. | ||
*/ | ||
function readpixels(url, limit = 0) { | ||
function readpixels(url, P, limit = 0) { | ||
const img = new Image(); | ||
@@ -22,3 +23,3 @@ const canvas = document.createElement('canvas'); | ||
return new Promise((resolve, reject) => { | ||
return new P((resolve, reject) => { | ||
img.onload = () => { | ||
@@ -25,0 +26,0 @@ const { width, height } = getLimitDimensions(img.width, img.height, limit); |
@@ -1,1 +0,1 @@ | ||
module.exports = { type: 'deploy', "version": "2.3.2"}; | ||
module.exports = { type: 'deploy', "version": "2.4.0"}; |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
5
136574
5
2180
+ Addedpromiz@^1.0.5
+ Addedpromiz@1.0.6(transitive)