!function(n){function o(e,t){var n,i,r;if("string"==typeof e)return a(e);for(n=[],i=e.length,r=0;r>0,r=!0;i&&(e.on("beforeFileQueued",function(e){return i<=n&&r&&(r=!1,this.trigger("error","Q_EXCEED_NUM_LIMIT",i,e),setTimeout(function(){r=!0},1)),!(i<=n)}),e.on("fileQueued",function(){n++}),e.on("fileDequeued",function(){n--}),e.on("uploadFinished",function(){n=0}))}),i.addValidator("fileSizeLimit",function(){var e=this,t=e.options,n=0,i=t.fileSizeLimit>>0,r=!0;i&&(e.on("beforeFileQueued",function(e){var t=n+e.size>i;return t&&r&&(r=!1,this.trigger("error","Q_EXCEED_SIZE_LIMIT",i,e),setTimeout(function(){r=!0},1)),!t}),e.on("fileQueued",function(e){n+=e.size}),e.on("fileDequeued",function(e){n-=e.size}),e.on("uploadFinished",function(){n=0}))}),i.addValidator("fileSingleSizeLimit",function(){var t=this.options.fileSingleSizeLimit;t&&this.on("beforeFileQueued",function(e){if(e.size>t)return e.setStatus(n.Status.INVALID,"exceed_size"),this.trigger("error","F_EXCEED_SIZE",e),!1})}),i.addValidator("duplicate",function(){var e=this.options,n={};e.duplicate||(this.on("beforeFileQueued",function(e){var t=e.__hash||(e.__hash=function(e){for(var t=0,n=0,i=e.length;na.byteLength);){if(r=f.parsers[n],!t&&r)for(o=0;oe.byteLength)){if(1===r)return d.getValue(e,s,o);for(u=[],c=0;ce.byteLength)h.log("Invalid Exif data: Invalid directory offset.");else{if(!((a=n+2+12*(o=e.getUint16(n,i)))+4>e.byteLength)){for(s=0;se.byteLength)h.log("Invalid Exif data: Invalid segment size.");else if(0===e.getUint16(t+8)){switch(e.getUint16(a)){case 18761:r=!0;break;case 19789:r=!1;break;default:return void h.log("Invalid Exif data: Invalid byte alignment marker.")}42===e.getUint16(a+2,r)?(o=e.getUint32(a+4,r),i.exif=new p.ExifMap,o=p.parseExifTags(e,a,a+o,r,i)):h.log("Invalid Exif data: Missing TIFF marker.")}else h.log("Invalid Exif data: Missing byte alignment offset.")},e.parsers[65505].push(p.parseExifData),p}),t("runtime/html5/jpegencoder",[],function(e,t,n){function i(e){Math.round;var R,E,k,F,t,f=Math.floor,T=new Array(64),D=new Array(64),S=new Array(64),A=new Array(64),v=new Array(65535),b=new Array(65535),K=new Array(64),_=new Array(64),O=[],U=0,I=7,C=new Array(64),q=new Array(64),L=new Array(64),n=new Array(256),H=new Array(2048),y=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],M=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],j=[0,1,2,3,4,5,6,7,8,9,10,11],B=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],P=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],z=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],$=[0,1,2,3,4,5,6,7,8,9,10,11],N=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],V=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function i(e,t){for(var n=0,i=0,r=new Array,o=1;o<=16;o++){for(var a=1;a<=e[o];a++)r[t[i]]=[],r[t[i]][0]=n,r[t[i]][1]=o,i++,n++;n*=2}return r}function Q(e){for(var t=e[0],n=e[1]-1;0<=n;)t&1<>8&255),G(255&e)}function W(e,t,n,i,r){for(var o,a=r[0],s=r[240],u=function(e,t){var n,i,r,o,a,s,u,c,l,f,d=0;for(l=0;l<8;++l){n=e[d],i=e[d+1],r=e[d+2],o=e[d+3],a=e[d+4],s=e[d+5],u=e[d+6];var h=n+(c=e[d+7]),p=n-c,g=i+u,m=i-u,v=r+s,b=r-s,_=o+a,y=o-a,w=h+_,x=h-_,R=g+v,E=g-v;e[d]=w+R,e[d+4]=w-R;var k=.707106781*(E+x);e[d+2]=x+k,e[d+6]=x-k;var F=.382683433*((w=y+b)-(E=m+p)),T=.5411961*w+F,D=1.306562965*E+F,S=.707106781*(R=b+m),A=p+S,O=p-S;e[d+5]=O+T,e[d+3]=O-T,e[d+1]=A+D,e[d+7]=A-D,d+=8}for(l=d=0;l<8;++l){n=e[d],i=e[d+8],r=e[d+16],o=e[d+24],a=e[d+32],s=e[d+40],u=e[d+48];var U=n+(c=e[d+56]),I=n-c,C=i+u,q=i-u,L=r+s,H=r-s,M=o+a,j=o-a,B=U+M,P=U-M,z=C+L,$=C-L;e[d]=B+z,e[d+32]=B-z;var N=.707106781*($+P);e[d+16]=P+N,e[d+48]=P-N;var V=.382683433*((B=j+H)-($=q+I)),Q=.5411961*B+V,G=1.306562965*$+V,J=.707106781*(z=H+q),W=I+J,X=I-J;e[d+40]=X+Q,e[d+24]=X-Q,e[d+8]=W+G,e[d+56]=W-G,d++}for(l=0;l<64;++l)f=e[l]*t[l],K[l]=0>4;for(var m=1;m<=d;++m)Q(s);g&=15}o=32767+_[h],Q(r[(g<<4)+b[o]]),Q(v[o]),h++}return 63!=f&&Q(a),n}function X(e){e<=0&&(e=1),100>3)*_+(h=4*(7&g)),b<=y+p&&(d-=_*(y+1+p-b)),_<=s+h&&(d-=s+h-_+4),u=m[d++],c=m[d++],l=m[d++],C[g]=(H[u]+H[c+256>>0]+H[l+512>>0]>>16)-128,q[g]=(H[u+768>>0]+H[c+1024>>0]+H[l+1280>>0]>>16)-128,L[g]=(H[u+1280>>0]+H[c+1536>>0]+H[l+1792>>0]>>16)-128;r=W(C,S,r,R,k),o=W(q,A,o,E,F),a=W(L,A,a,E,F),s+=32}y+=8}if(0<=I){var w=[];w[1]=I+1,w[0]=(1<>0]=38470*e,H[e+512>>0]=7471*e+32768,H[e+768>>0]=-11059*e,H[e+1024>>0]=-21709*e,H[e+1280>>0]=32768*e+8421375,H[e+1536>>0]=-27439*e,H[e+1792>>0]=-5329*e}(),X(e)}return i.encode=function(e,t){return new i(t).encode(e)},i}),t("runtime/html5/androidpatch",["runtime/html5/util","runtime/html5/jpegencoder","base"],function(e,u,c){var l,f=e.canvasToDataUrl;e.canvasToDataUrl=function(e,t,n){var i,r,o,a,s;return c.os.android?("image/jpeg"===t&&void 0===l&&(a=(a=(~(s=(a=f.apply(null,arguments)).split(","))[0].indexOf("base64")?atob:decodeURIComponent)(s[1])).substring(0,2),l=255===a.charCodeAt(0)&&216===a.charCodeAt(1)),"image/jpeg"!==t||l?f.apply(null,arguments):(r=e.width,o=e.height,i=e.getContext("2d"),u.encode(i.getImageData(0,0,r,o),n))):f.apply(null,arguments)}}),t("runtime/html5/image",["base","runtime/html5/runtime","runtime/html5/util"],function(e,t,r){return t.register("Image",{modified:!1,init:function(){var n=this,e=new Image;e.onload=function(){n._info={type:n.type,width:this.width,height:this.height},n._metas||"image/jpeg"!==n.type?n.owner.trigger("load"):r.parseMeta(n._blob,function(e,t){n._metas=t,n.owner.trigger("load")})},e.onerror=function(){n.owner.trigger("error")},n._img=e},loadFromBlob:function(e){var t=this._img;this._blob=e,this.type=e.type,t.src=r.createObjectURL(e.getSource()),this.owner.once("load",function(){r.revokeObjectURL(t.src)})},resize:function(e,t){var n=this._canvas||(this._canvas=document.createElement("canvas"));this._resize(this._img,n,e,t),this._blob=null,this.modified=!0,this.owner.trigger("complete")},getAsBlob:function(e){var t,n=this._blob,i=this.options;if(e=e||this.type,this.modified||this.type!==e){if(t=this._canvas,"image/jpeg"===e){if(n=r.canvasToDataUrl(t,"image/jpeg",i.quality),i.preserveHeaders&&this._metas&&this._metas.imageHead)return n=r.dataURL2ArrayBuffer(n),n=r.updateImageHead(n,this._metas.imageHead),n=r.arrayBufferToBlob(n,e)}else n=r.canvasToDataUrl(t,e);n=r.dataURL2Blob(n)}return n},getAsDataUrl:function(e){var t=this.options;return"image/jpeg"===(e=e||this.type)?r.canvasToDataUrl(this._canvas,e,t.quality):this._canvas.toDataURL(e)},getOrientation:function(){return this._metas&&this._metas.exif&&this._metas.exif.get("Orientation")||1},info:function(e){return e?(this._info=e,this):this._info},meta:function(e){return e?(this._meta=e,this):this._meta},destroy:function(){var e=this._canvas;this._img.onload=null,e&&(e.getContext("2d").clearRect(0,0,e.width,e.height),e.width=e.height=0,this._canvas=null),this._img.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D",this._img=this._blob=null},_resize:function(e,t,n,i){var r,o,a,s,u,c=this.options,l=e.width,f=e.height,d=this.getOrientation();~[5,6,7,8].indexOf(d)&&(n^=i,n^=i^=n),r=Math[c.crop?"max":"min"](n/l,i/f),c.allowMagnify||(r=Math.min(1,r)),o=l*r,a=f*r,c.crop?(t.width=n,t.height=i):(t.width=o,t.height=a),s=(t.width-o)/2,u=(t.height-a)/2,c.preserveHeaders||this._rotate2Orientaion(t,d),this._renderImageToCanvas(t,e,s,u,o,a)},_rotate2Orientaion:function(e,t){var n=e.width,i=e.height,r=e.getContext("2d");switch(t){case 5:case 6:case 7:case 8:e.width=i,e.height=n}switch(t){case 2:r.translate(n,0),r.scale(-1,1);break;case 3:r.translate(n,i),r.rotate(Math.PI);break;case 4:r.translate(0,i),r.scale(1,-1);break;case 5:r.rotate(.5*Math.PI),r.scale(1,-1);break;case 6:r.rotate(.5*Math.PI),r.translate(0,-i);break;case 7:r.rotate(.5*Math.PI),r.translate(n,-i),r.scale(-1,1);break;case 8:r.rotate(-.5*Math.PI),r.translate(-n,0)}},_renderImageToCanvas:function(){if(!e.os.ios)return function(e,t,n,i,r,o){e.getContext("2d").drawImage(t,n,i,r,o)};function k(e,t,n){var i,r,o=document.createElement("canvas"),a=o.getContext("2d"),s=0,u=n,c=n;for(o.width=1,o.height=n,a.drawImage(e,0,0),i=a.getImageData(0,0,1,n).data;s>1;return 0==(r=c/n)?1:r}return 7<=e.os.ios?function(e,t,n,i,r,o){var a=t.naturalWidth,s=t.naturalHeight,u=k(t,0,s);return e.getContext("2d").drawImage(t,0,0,a*u,s*u,n,i,r,o)}:function(e,t,n,i,r,o){var a,s,u,c,l,f,d,h,p,g,m,v=t.naturalWidth,b=t.naturalHeight,_=e.getContext("2d"),y=1048576<(m=(h=t).naturalWidth)*h.naturalHeight&&((p=document.createElement("canvas")).width=p.height=1,(g=p.getContext("2d")).drawImage(h,1-m,0),0===g.getImageData(0,0,1,1).data[3]),w="image/jpeg"===this.type,x=1024,R=0,E=0;for(y&&(v/=2,b/=2),_.save(),(a=document.createElement("canvas")).width=a.height=x,s=a.getContext("2d"),u=w?k(t,0,b):1,c=Math.ceil(x*r/v),l=Math.ceil(x*o/b/u);R',t.html(e)},getFlash:function(){return this._flash||(this._flash=r("#"+this.uid).get(0)),this._flash}}),e.register=function(e,t){return t=c[e]=u.inherits(i,r.extend({flashExec:function(){var e=this.owner;return this.getRuntime().flashExec.apply(e,arguments)}},t))},11.4<=function(){var t;try{t=(t=navigator.plugins["Shockwave Flash"]).description}catch(e){try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(e){t="0.0"}}return t=t.match(/\d+/g),parseFloat(t[0]+"."+t[1],10)}()&&n.addRuntime("flash",e),e}),t("runtime/flash/filepicker",["base","runtime/flash/runtime"],function(e,t){var r=e.$;return t.register("FilePicker",{init:function(e){var t,n,i=r.extend({},e);for(t=i.accept&&i.accept.length,n=0;n