s.device.version=l(s.device)):s.device={tablet:!1,family:"Other"};varu={};returne.regexes.mobile_browser_families.map(function(e){u[e]=!0}),e.regexes.mobile_os_families.map(function(e){u[e]=!0}),s.device.type="Spider"===s.browser.family?"Spider":s.browser.tablet||s.os.tablet||s.device.tablet?"Tablet":u.hasOwnProperty(s.browser.family)?"Mobile":"Desktop",s.device.manufacturer=s.browser.man||s.os.man||s.device.man||null,n([s.browser,s.os,s.device],["tablet","man"]),s},e}();"undefined"!=typeofexports?("undefined"!=typeofmodule&&module.exports&&(exports=module.exports=r),exports.detect=r):e.detect=r,"function"==typeofdefine&&define.amd&&define(function(){returnr})}(window),function(){functione(e){varr=e.naturalWidth,a=e.naturalHeight;if(r*a>1048576){varo=document.createElement("canvas");o.width=o.height=1;vart=o.getContext("2d");returnt.drawImage(e,-r+1,0),0===t.getImageData(0,0,1,1).data[3]}return!1}functionr(e,r,a){varo=document.createElement("canvas");o.width=1,o.height=a;vart=o.getContext("2d");t.drawImage(e,0,0);for(varn=t.getImageData(0,0,1,a).data,i=0,c=a,l=a;l>i;){vard=n[4*(l-1)+3];0===d?c=l:i=l,l=c+i>>1}varm=l/a;return0===m?1:m}functiona(e,r,a){vart=document.createElement("canvas");returno(e,t,r,a),t.toDataURL("image/jpeg",r.quality||.8)}functiono(a,o,n,i){varc=a.naturalWidth,l=a.naturalHeight;if(c+l){vard=n.width,m=n.height,p=o.getContext("2d");p.save(),t(o,p,d,m,n.orientation);vars=e(a);s&&(c/=2,l/=2);varu=1024,g=document.createElement("canvas");g.width=g.height=u;for(varf=g.getContext("2d"),x=i?r(a,c,l):1,v=Math.ceil(u*d/c),h=Math.ceil(u*m/l/x),b=0,_=0;l>b;){for(varw=0,y=0;c>w;)f.clearRect(0,0,u,u),f.drawImage(a,-w,-b),p.drawImage(g,0,0,u,u,y,_,v,h),w+=u,y+=v;b+=u,_+=h}p.restore(),g=f=null}}functiont(e,r,a,o,t){switch(t){case5:case6:case7:case8:e.width=o,e.height=a;break;default:e.width=a,e.height=o}switch(t){case2:r.translate(a,0),r.scale(-1,1);break;case3:r.translate(a,o),r.rotate(Math.PI);break;case4:r.translate(0,o),r.scale(1,-1);break;case5:r.rotate(.5*Math.PI),r.scale(1,-1);break;case6:r.rotate(.5*Math.PI),r.translate(0,-o);break;case7:r.rotate(.5*Math.PI),r.translate(a,-o),r.scale(-1,1);break;case8:r.rotate(-.5*Math.PI),r.translate(-a,0)}}functionn(e){if(window.Blob&&einstanceofBlob){if(!i)throwError("No createObjectURL function found to create blob url");varr=newImage;r.src=i.createObjectURL(e),this.blob=e,e=r}if(!e.naturalWidth&&!e.naturalHeight){vara=this;e.onload=e.onerror=function(){vare=a.imageLoadListeners;if(e){a.imageLoadListeners=null;for(varr=0,o=e.length;o>r;r++)e[r]()}},this.imageLoadListeners=[]}this.srcImage=e}vari=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;n.prototype.render=function(e,r,t){if(this.imageLoadListeners){varn=this;returnvoidthis.imageLoadListeners.push(function(){n.render(e,r,t)})}r=r||{};varc=this.srcImage.naturalWidth,l=this.srcImage.naturalHeight,d=r.width,m=r.height,p=r.maxWidth,s=r.maxHeight,u=!this.blob||"image/jpeg"===this.blob.type;d&&!m?m=l*d/c<<0:m&&!d?d=c*m/l<<0:(d=c,m=l),p&&d>p&&(d=p,m=l*d/c<<0),s&&m>s&&(m=s,d=c*m/l<<0);varg={width:d,height:m};for(varfinr)g[f]=r[f];varx=e.tagName.toLowerCase();"img"===x?e.src=a(this.srcImage,g,u):"canvas"===x&&o(this.srcImage,e,g,u),"function"==typeofthis.onrender&&this.onrender(e),t&&t(),this.blob&&(this.blob=null,i.revokeObjectURL(this.srcImage.src))},"function"==typeofdefine&&define.amd?define([],function(){returnn}):this.MegaPixImage=n}();
s.device.version=l(s.device)):s.device={tablet:!1,family:"Other"};varu={};returne.regexes.mobile_browser_families.map(function(e){u[e]=!0}),e.regexes.mobile_os_families.map(function(e){u[e]=!0}),s.device.type="Spider"===s.browser.family?"Spider":s.browser.tablet||s.os.tablet||s.device.tablet?"Tablet":u.hasOwnProperty(s.browser.family)?"Mobile":"Desktop",s.device.manufacturer=s.browser.man||s.os.man||s.device.man||null,n([s.browser,s.os,s.device],["tablet","man"]),s},e}();"undefined"!=typeofexports?("undefined"!=typeofmodule&&module.exports&&(exports=module.exports=r),exports.detect=r):e.detect=r,"function"==typeofdefine&&define.amd&&define(function(){returnr})}(window),function(){functione(e){varr=e.naturalWidth,a=e.naturalHeight;if(r*a>1048576){varo=document.createElement("canvas");o.width=o.height=1;vart=o.getContext("2d");returnt.drawImage(e,-r+1,0),0===t.getImageData(0,0,1,1).data[3]}return!1}functionr(e,r,a){varo=document.createElement("canvas");o.width=1,o.height=a;vart=o.getContext("2d");t.drawImage(e,0,0);for(varn=t.getImageData(0,0,1,a).data,i=0,c=a,l=a;l>i;){vard=n[4*(l-1)+3];0===d?c=l:i=l,l=c+i>>1}varm=l/a;return0===m?1:m}functiona(e,r,a){vart=document.createElement("canvas");returno(e,t,r,a),t.toDataURL("image/jpeg",r.quality||.8)}functiono(a,o,n,i){varc=a.naturalWidth,l=a.naturalHeight;if(c+l){vard=n.width,m=n.height,p=o.getContext("2d");p.save(),t(o,p,d,m,n.orientation);vars=e(a);s&&(c/=2,l/=2);varu=1024,g=document.createElement("canvas");g.width=g.height=u;for(varf=g.getContext("2d"),x=i?r(a,c,l):1,v=Math.ceil(u*d/c),h=Math.ceil(u*m/l/x),b=0,_=0;l>b;){for(varw=0,y=0;c>w;)f.clearRect(0,0,u,u),f.drawImage(a,-w,-b),p.drawImage(g,0,0,u,u,y,_,v,h),w+=u,y+=v;b+=u,_+=h}p.restore(),g=f=null}}functiont(e,r,a,o,t){switch(t){case5:case6:case7:case8:e.width=o,e.height=a;break;default:e.width=a,e.height=o}switch(t){case2:r.translate(a,0),r.scale(-1,1);break;case3:r.translate(a,o),r.rotate(Math.PI);break;case4:r.translate(0,o),r.scale(1,-1);break;case5:r.rotate(.5*Math.PI),r.scale(1,-1);break;case6:r.rotate(.5*Math.PI),r.translate(0,-o);break;case7:r.rotate(.5*Math.PI),r.translate(a,-o),r.scale(-1,1);break;case8:r.rotate(-.5*Math.PI),r.translate(-a,0)}}functionn(e){if(window.Blob&&einstanceofBlob){if(!i)throwError("No createObjectURL function found to create blob url");varr=newImage;r.src=i.createObjectURL(e),this.blob=e,e=r}if(!e.naturalWidth&&!e.naturalHeight){vara=this;e.onload=e.onerror=function(){vare=a.imageLoadListeners;if(e){a.imageLoadListeners=null;for(varr=0,o=e.length;o>r;r++)e[r]()}},this.imageLoadListeners=[]}this.srcImage=e}vari=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;n.prototype.render=function(e,r,t){if(this.imageLoadListeners){varn=this;returnvoidthis.imageLoadListeners.push(function(){n.render(e,r,t)})}r=r||{};varc=this.srcImage.naturalWidth,l=this.srcImage.naturalHeight,d=r.width,m=r.height,p=r.maxWidth,s=r.maxHeight,u=!this.blob||"image/jpeg"===this.blob.type;d&&!m?m=l*d/c<<0:m&&!d?d=c*m/l<<0:(d=c,m=l),p&&d>p&&(d=p,m=l*d/c<<0),s&&m>s&&(m=s,d=c*m/l<<0);varg={width:d,height:m};for(varfinr)g[f]=r[f];varx=e.tagName.toLowerCase();"img"===x?e.src=a(this.srcImage,g,u):"canvas"===x&&o(this.srcImage,e,g,u),"function"==typeofthis.onrender&&this.onrender(e),t&&t(),this.blob&&(this.blob=null,i.revokeObjectURL(this.srcImage.src))},"function"==typeofdefine&&define.amd?define([],function(){returnn}):this.MegaPixImage=n}();