Вход Регистрация
Файл: module-assets/admin/plupload/js/moxie.min.js
Строк: 4894
<?php
/**
 * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
 * v1.0a
 *
 * Copyright 2013, Moxiecode Systems AB
 * Released under GPL License.
 *
 * License: http://www.plupload.com/license
 * Contributing: http://www.plupload.com/contributing
 *
 * Date: 2012-11-13
 */
!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r<e.length;++r){if(n=s[e[r]]||o(e[r]),!n)throw"module definition dependecy not found: "+e[r];i.push(n)}t.apply(null,i)}function i(e,i,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(i===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";n(i,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var n=e,i=t.split(/[./]/),r=0;r<i.length;++r){if(!n[i[r]])return;n=n[i[r]]}return n}function a(n){for(var i=0;i<n.length;i++){for(var r=e,o=n[i],a=o.split(/[./]/),u=0;u<a.length-1;++u)r[a[u]]===t&&(r[a[u]]={}),r=r[a[u]];r[a[a.length-1]]=s[o]}}var s={},u="moxie/core/utils/Basic",c="moxie/core/I18n",l="moxie/core/utils/Mime",d="moxie/core/utils/Env",f="moxie/core/utils/Dom",p="moxie/core/Exceptions",h="moxie/core/EventTarget",m="moxie/core/utils/Encode",g="moxie/runtime/Runtime",v="moxie/runtime/RuntimeClient",y="moxie/file/Blob",E="moxie/file/File",R="moxie/file/FileInput",_="moxie/file/FileDrop",x="moxie/file/FileReader",w="moxie/core/utils/Url",b="moxie/runtime/RuntimeTarget",T="moxie/file/FileReaderSync",A="moxie/xhr/FormData",S="moxie/xhr/XMLHttpRequest",O="moxie/runtime/Transporter",I="moxie/core/JSON",D="moxie/image/Image",L="moxie/runtime/html5/Runtime",N="moxie/runtime/html5/file/Blob",M="moxie/core/utils/Events",C="moxie/runtime/html5/file/FileInput",F="moxie/runtime/html5/file/FileDrop",P="moxie/runtime/html5/file/FileReader",H="moxie/runtime/html5/xhr/XMLHttpRequest",B="moxie/runtime/html5/utils/BinaryReader",G="moxie/runtime/html5/image/JPEGHeaders",U="moxie/runtime/html5/image/ExifParser",z="moxie/runtime/html5/image/JPEG",k="moxie/runtime/html5/image/PNG",q="moxie/runtime/html5/image/ImageInfo",j="moxie/runtime/html5/image/MegaPixel",X="moxie/runtime/html5/image/Image",V="moxie/runtime/flash/Runtime",W="moxie/runtime/flash/file/Blob",Y="moxie/runtime/flash/file/FileInput",$="moxie/runtime/flash/file/FileReader",K="moxie/runtime/flash/file/FileReaderSync",J="moxie/runtime/flash/xhr/XMLHttpRequest",Z="moxie/runtime/flash/runtime/Transporter",Q="moxie/runtime/flash/image/Image",et="moxie/runtime/silverlight/Runtime",tt="moxie/runtime/silverlight/file/Blob",nt="moxie/runtime/silverlight/file/FileInput",it="moxie/runtime/silverlight/file/FileDrop",rt="moxie/runtime/silverlight/file/FileReader",ot="moxie/runtime/silverlight/file/FileReaderSync",at="moxie/runtime/silverlight/xhr/XMLHttpRequest",st="moxie/runtime/silverlight/runtime/Transporter",ut="moxie/runtime/silverlight/image/Image",ct="moxie/runtime/html4/Runtime",lt="moxie/runtime/html4/file/FileInput",dt="moxie/runtime/html4/file/FileReader",ft="moxie/runtime/html4/xhr/XMLHttpRequest",pt="moxie/runtime/html4/image/Image";i(u,[],function(){var e=function(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/s([a-z|A-Z]+)/)[1].toLowerCase()},t=function(i){var r;return n(arguments,function(a,s){s>0&&n(a,function(n,a){n!==r&&(e(i[a])===e(n)&&~o(e(n),["array","object"])?t(i[a],n):i[a]=n)})}),i},n=function(e,t){var n,i,r,o;if(e){try{n=e.length}catch(a){n=o}if(n===o){for(i in e)if(e.hasOwnProperty(i)&&t(e[i],i)===!1)return}else for(r=0;n>r;r++)if(t(e[r],r)===!1)return}},i=function(t){var n;if(!t||"object"!==e(t))return!0;for(n in t)return!1;return!0},r=function(t,n){function i(r){"function"===e(t[r])&&t[r](function(e){++r<o&&!e?i(r):n(e)})}var r=0,o=t.length;"function"!==e(n)&&(n=function(){}),t&&t.length||n(),i(r)},o=function(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return n}return-1},a=function(t,n){var i=[];"array"!==e(t)&&(t=[t]),"array"!==e(n)&&(n=[n]);for(var r in t)-1===o(t[r],n)&&i.push(t[r]);return i.length?i:!1},s=function(e){var t,n=[];for(t=0;t<e.length;t++)n[t]=e[t];return n},u=function(){var e=0;return function(t){var n=(new Date).getTime().toString(32),i;for(i=0;5>i;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}(),c=function(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^s*/,"").replace(/s*$/,""):e},l=function(e){if("string"!=typeof e)return e;var t={t:1099511627776,g:1073741824,m:1048576,k:1024},n;return e=/^([0-9]+)([mgk]?)$/.exec(e.toLowerCase().replace(/[^0-9mkg]/g,"")),n=e[2],e=+e[1],t.hasOwnProperty(n)&&(e*=t[n]),e};return{guid:u,typeOf:e,extend:t,each:n,isEmptyObj:i,inSeries:r,inArray:o,arrayDiff:a,toArray:s,trim:c,parseSizeStr:l}}),i(c,[u],function(e){var t={};return{addI18n:function(n){return e.extend(t,n)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(e){var t=[].slice.call(arguments,1),n="";return e.split(/%[sdf]/).forEach(function(e){n+=e,t.length&&(n+=t.shift())}),n}}}),i(l,[u,c],function(e,t){var n="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/mp4,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",i={mimes:{},extensions:{},addMimeType:function(e){var t=e.split(/,/),n,i,r;for(n=0;n<t.length;n+=2){for(r=t[n+1].split(/ /),i=0;i<r.length;i++)this.mimes[r[i]]=t[n];this.extensions[t[n]]=r}},extList2mimes:function(t){var n=this,i,r,o,a,s=[];e:for(r=0;r<t.length;r++)for(i=t[r].extensions.split(/s*,s*/),o=0;o<i.length;o++){if("*"===i[o]){s=[];break e}a=n.mimes[i[o]],a&&!~e.inArray(a,s)&&s.push(a)}return s},mimes2extList:function(n){var i=this,r=[],o=[];return n=e.trim(n).split(/s*,s*/),"*"!==n&&e.each(n,function(t){var n=t.match(/^(w+)/(*|w+)$/);n&&("*"===n[2]?e.each(i.extensions,function(e,t){new RegExp("^"+n[1]+"/").test(t)&&[].push.apply(r,i.extensions[t])}):i.extensions[t]&&[].push.apply(r,i.extensions[t]))}),o.push({title:t.translate("Files"),extensions:r.length?r.join(","):"*"}),o.mimes=n,o},getFileExtension:function(e){var t=e&&e.match(/.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return i.addMimeType(n),i}),i(d,[u],function(e){function t(e){for(var t,n,i=0;i<e.length;i++)if(t=e[i].s1,n=e[i].prop,o=e[i].sv||e[i].id,t){if(-1!=t.indexOf(e[i].s2))return e[i].id}else if(n)return e[i].id}function n(e){var t=e.indexOf(o);if(-1!=t)return parseFloat(e.substring(t+o.length+1))}var i=[{s1:navigator.userAgent,s2:"Android",id:"Android Browser",sv:"Version"},{s1:navigator.userAgent,s2:"Chrome",id:"Chrome"},{s1:navigator.vendor,s2:"Apple",id:"Safari",sv:"Version"},{prop:window.opera&&window.opera.buildNumber,id:"Opera",sv:"Version"},{s1:navigator.vendor,s2:"KDE",id:"Konqueror"},{s1:navigator.userAgent,s2:"Firefox",id:"Firefox"},{s1:navigator.vendor,s2:"Camino",id:"Camino"},{s1:navigator.userAgent,s2:"Netscape",id:"Netscape"},{s1:navigator.userAgent,s2:"MSIE",id:"IE",sv:"MSIE"},{s1:navigator.userAgent,s2:"Gecko",id:"Mozilla",sv:"rv"}],r=[{s1:navigator.platform,s2:"Win",id:"Windows"},{s1:navigator.platform,s2:"Mac",id:"Mac"},{s1:navigator.userAgent,s2:"iPhone",id:"iOS"},{s1:navigator.userAgent,s2:"iPad",id:"iOS"},{s1:navigator.userAgent,s2:"Android",id:"Android"},{s1:navigator.platform,s2:"Linux",id:"Linux"}],o,a=function(){var t={define_property:function(){return!1}(),create_canvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),return_response_type:function(t){if(!window.XMLHttpRequest)return!1;try{var n=new XMLHttpRequest;if("undefined"!==e.typeOf(n.responseType))return n.open("get","infinity-8.me"),n.responseType=t,n.responseType!==t?!1:!0}catch(i){}return!1},use_data_uri:function(){var e=new Image;return e.onload=function(){t.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return t.use_data_uri&&("IE"!==s.browser||s.version>=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(n){var i=[].slice.call(arguments);return i.shift(),"function"===e.typeOf(t[n])?t[n].apply(this,i):!!t[n]}}(),s={can:a,browser:t(i),version:n(navigator.userAgent)||n(navigator.appVersion),OS:t(r),swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return s}),i(f,[d],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},n=function(e,t){var n;return""===e.className?!1:(n=new RegExp("(^|\s+)"+t+"(\s+|$)"),n.test(e.className))},i=function(e,t){n(e,t)||(e.className=""===e.className?t:e.className.replace(/s+$/,"")+" "+t)},r=function(e,t){var n=new RegExp("(^|\s+)"+t+"(\s+|$)");e.className=e.className.replace(n,function(e,t,n){return" "===t&&" "===n?" ":""})},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,n){function i(e){var t,n,i=0,r=0;return e&&(n=e.getBoundingClientRect(),t="CSS1Compat"===s.compatMode?s.documentElement:s.body,i=n.left+t.scrollLeft,r=n.top+t.scrollTop),{x:i,y:r}}var r=0,o=0,a,s=document,u,c;if(t=t,n=n||s.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!s.documentMode||s.documentMode<8))return u=i(t),c=i(n),{x:u.x-c.x,y:u.y-c.y};for(a=t;a&&a!=n&&a.nodeType;)r+=a.offsetLeft||0,o+=a.offsetTop||0,a=a.offsetParent;for(a=t.parentNode;a&&a!=n&&a.nodeType;)r-=a.scrollLeft||0,o-=a.scrollTop||0,a=a.parentNode;return{x:r,y:o}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:n,addClass:i,removeClass:r,getStyle:o,getPos:a,getSize:s}}),i(p,[u],function(e){function t(e,t){var n;for(n in e)if(e[n]===t)return n;return null}return{RuntimeError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": RuntimeError "+this.code}var i={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(n,i),n.prototype=Error.prototype,n}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": ImageError "+this.code}var i={WRONG_FORMAT:1};return e.extend(n,i),n.prototype=Error.prototype,n}(),FileException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": FileException "+this.code}var i={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(n,i),n.prototype=Error.prototype,n}(),DOMException:function(){function n(e){this.code=e,this.name=t(i,e),this.message=this.name+": DOMException "+this.code}var i={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(n,i),n.prototype=Error.prototype,n}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),i(h,[p,u],function(e,n){function i(){var i={};n.extend(this,{uid:null,init:function(){this.uid||(this.uid=n.guid("uid_"))},addEventListener:function(e,t,r,o){var a=this,s;return e=n.trim(e),/s/.test(e)?(n.each(e.split(/s+/),function(e){a.addEventListener(e,t,r,o)}),void 0):(e=e.toLowerCase(),r=parseInt(r,10)||0,s=i[this.uid]&&i[this.uid][e]||[],s.push({fn:t,priority:r,scope:o||this}),i[this.uid]||(i[this.uid]={}),i[this.uid][e]=s,void 0)},hasEventListener:function(e){return e?!(!i[this.uid]||!i[this.uid][e]):!!i[this.uid]},removeEventListener:function(e,t){e=e.toLowerCase();var r=i[this.uid]&&i[this.uid][e],o;if(r){if(t){for(o=r.length-1;o>=0;o--)if(r[o].fn===t){r.splice(o,1);break}}else r=[];r.length||(delete i[this.uid][e],n.isEmptyObj(i[this.uid])&&delete i[this.uid])}},removeAllEventListeners:function(){i[this.uid]&&delete i[this.uid]},dispatchEvent:function(t){var r,o,a,s,u={};if("string"!==n.typeOf(t)){if(s=t,"string"!==n.typeOf(s.type))throw new e.EventException(e.EventException.UNSPECIFIED_EVENT_TYPE_ERR);t=s.type,s.total&&s.loaded&&(u.total=s.total,u.loaded=s.loaded),u.async=s.async||!1}if(-1!==t.indexOf("::")?function(e){r=e[0],t=e[1]}(t.split("::")):r=this.uid,t=t.toLowerCase(),o=i[r]&&i[r][t]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),u.type=t,a.unshift(u);var c=[];n.each(o,function(e){a[0].target=e.scope,u.async?c.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):c.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),c.length&&n.inSeries(c)}return!0},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){this.dispatchEvent.apply(this,arguments)},convertEventPropsToHandlers:function(e){var i;"array"!==n.typeOf(e)&&(e=[e]);for(var r=0;r<e.length;r++)i="on"+e[r],"function"===n.typeOf(this[i])?this.addEventListener(e[r],this[i]):this[i]===t&&(this[i]=null)}})}return i.instance=new i,i}),i(m,[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},n=function(e,n){if("function"==typeof window.atob)return n?t(window.atob(e)):window.atob(e);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,f=0,p=0,h="",m=[];if(!e)return e;e+="";do s=i.indexOf(e.charAt(f++)),u=i.indexOf(e.charAt(f++)),c=i.indexOf(e.charAt(f++)),l=i.indexOf(e.charAt(f++)),d=s<<18|u<<12|c<<6|l,r=255&d>>16,o=255&d>>8,a=255&d,m[p++]=64==c?String.fromCharCode(r):64==l?String.fromCharCode(r,o):String.fromCharCode(r,o,a);while(f<e.length);return h=m.join(""),n?t(h):h},i=function(t,n){if(n&&e(t),"function"==typeof window.btoa)return window.btoa(t);var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,o,a,s,u,c,l,d,f=0,p=0,h="",m=[];if(!t)return t;do r=t.charCodeAt(f++),o=t.charCodeAt(f++),a=t.charCodeAt(f++),d=r<<16|o<<8|a,s=63&d>>18,u=63&d>>12,c=63&d>>6,l=63&d,m[p++]=i.charAt(s)+i.charAt(u)+i.charAt(c)+i.charAt(l);while(f<t.length);h=m.join("");var g=t.length%3;return(g?h.slice(0,g-3):h)+"===".slice(g||3)};return{utf8_encode:e,utf8_decode:t,atob:n,btoa:i}}),i(g,[u,f,h],function(e,t,n){function i(n,i,r,a,s){function u(t,i){var r=this,o=n&&n.required_caps;return null!==f?f:(o&&!e.isEmptyObj(t)&&e.each(o,function(e,n){if(t.hasOwnProperty(n)){var i=r.can(n,e,t)?"client":"browser";if(f&&f!==i)return f=!1;f=i}}),null===f&&(f=i||"browser"),f&&o&&!this.can(o)&&(f=!1),void 0)}var c=this,l,d=e.guid(i+"_"),f=null;o[d]=this,r=e.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},r),l=function(){var t={};return{exec:function(e,n,i,r){return l[n]&&(t[e]||(t[e]={context:this,instance:new l[n]}),t[e].instance[i])?t[e].instance[i].apply(this,r):void 0},removeInstance:function(e){delete t[e]},removeAllInstances:function(){var n=this;e.each(t,function(t,i){"function"===e.typeOf(t.instance.destroy)&&t.instance.destroy.call(t.context),n.removeInstance(i)})}}}(),e.extend(this,{initialized:!1,uid:d,type:i,shimid:d+"_container",clients:0,options:n,can:function(t,n){var i=arguments[2]||r;if("string"===e.typeOf(t)&&"undefined"===e.typeOf(n)&&(t=function(t){var n={};return e.each(t,function(e){n[e]=!0}),n}(t.split(","))),"object"===e.typeOf(t)){for(var o in t)if(!this.can(o,t[o],i))return!1;return!0}return"function"===e.typeOf(i[t])?i[t].call(this,n):n===i[t]},getMode:function(){return f||!1},getShimContainer:function(){var n,i=t.get(this.shimid);return i||(n=this.options.container?t.get(this.options.container):document.body,i=document.createElement("div"),i.id=this.shimid,i.className="moxie-shim moxie-shim-"+this.type,e.extend(i.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),n.appendChild(i),n=null),i},getShim:function(){return l},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec.call(this,this.uid,e,t,n)},exec:function(e,t){var n=[].slice.call(arguments,2);return c[e]&&c[e][t]?c[e][t].apply(this,n):c.shimExec.apply(this,arguments)},destroy:function(){if(c){var e=t.get(this.shimid);e&&e.parentNode.removeChild(e),l&&l.removeAllInstances(),this.unbindAll(),delete o[this.uid],this.uid=null,d=c=l=f=e=null}}}),u.call(this,a,s)}var r={},o={};return i.order="html5,flash,silverlight,html4",i.getRuntime=function(e){return o[e]?o[e]:!1},i.addConstructor=function(e,t){t.prototype=n.instance,r[e]=t},i.getConstructor=function(e){return r[e]||null},i.getInfo=function(e){var t=i.getRuntime(e);return t?{uid:t.uid,type:t.type,can:t.can}:null},i.can=function(e,t){var n,r=i.getConstructor(e),o;return r?(n=new r({required_caps:t}),o=n.getMode(),n.destroy(),!!o):!1},i.thatCan=function(e,t){var n=(t||i.order).split(/s*,s*/);for(var r in n)if(i.can(n[r],e))return n[r];return null},i.capTrue=function(){return!0},i.capFalse=function(){return!1},i.capTest=function(e){return function(){return!!e}},i}),i(v,[p,u,g],function(e,t,n){return function i(){var i;t.extend(this,{connectRuntime:function(r){function o(t){var s,u;return t.length?(s=t.shift(),(u=n.getConstructor(s))?(i=new u(r),i.bind("Init",function(){i.initialized=!0,setTimeout(function(){i.clients++,a.trigger("RuntimeInit",i)},1)}),i.bind("Error",function(){i.destroy(),o(t)}),i.getMode()?(i.init(),void 0):(i.trigger("Error"),void 0)):(o(t),void 0)):(a.trigger("RuntimeError",new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)),i=null,void 0)}var a=this,s;if("string"===t.typeOf(r)?s=r:"string"===t.typeOf(r.ruid)&&(s=r.ruid),s){if(i=n.getRuntime(s))return i.clients++,i;throw new e.RuntimeError(e.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/s*,s*/))},getRuntime:function(){return i&&i.uid?i:(i=null,null)},disconnectRuntime:function(){i&&--i.clients<=0&&(i.destroy(),i=null)}})}}),i(y,[u,m,v],function(e,t,n){function i(o,a){function s(t,n,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new i(null,{type:o,size:n-t}),a.detach(s.substr(t,a.size)),a):null}o&&(n.call(this),this.connectRuntime(o)),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,n){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,n)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy",r[this.uid]),this.disconnectRuntime(),this.ruid=null),e=e||"";var n=e.match(/^data:([^;]*);base64,/);n&&(this.type=n[1],e=t.atob(e.substring(e.indexOf("base64,")+7))),this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return i}),i(E,[u,l,y],function(e,t,n){function i(i,r){var o,a;if(r||(r={}),a=r.type&&""!==r.type?r.type:t.getFileMime(r.name),r.name)o=r.name.replace(/\/g,"/"),o=o.substr(o.lastIndexOf("/")+1);else{var s=a.split("/")[0];o=e.guid((""!==s?s:"file")+"_"),t.extensions[a]&&(o+="."+t.extensions[a][0])}n.apply(this,arguments),e.extend(this,{type:a||"",name:o||e.guid("file_"),lastModifiedDate:r.lastModifiedDate||(new Date).toLocaleString()})}return i.prototype=n.prototype,i}),i(R,[u,l,f,p,h,c,E,v],function(e,t,n,i,r,o,a,s){function u(r){var u=this,l,d,f;if(-1!==e.inArray(e.typeOf(r),["string","node"])&&(r={browse_button:r}),d=n.get(r.browse_button),!d)throw new i.DOMException(i.DOMException.NOT_FOUND_ERR);f={accept:[{title:o.translate("All Files"),extensions:"*"}],name:"file",multiple:!1,required_caps:!1,container:d.parentNode||document.body},r="object"==typeof r?e.extend({},f,r):f,"string"==typeof r.accept&&(r.accept=t.mimes2extList(r.accept)),l=n.get(r.container),l||(l=document.body),"static"===n.getStyle(l,"position")&&(l.style.position="relative"),l=d=null,s.call(u),e.extend(u,{uid:e.guid("uid_"),ruid:null,files:null,init:function(){u.convertEventPropsToHandlers(c),u.bind("RuntimeInit",function(t,i){u.ruid=i.uid,u.bind("Ready",function(){u.trigger("Refresh")},999),u.bind("Change",function(){var t=i.exec.call(u,"FileInput","getFiles");u.files=[],e.each(t,function(e){u.files.push(new a(u.ruid,e))})},999),u.bind("Refresh",function(){var t,o,a,s;a=n.get(r.browse_button),s=n.get(i.shimid),a&&(t=n.getPos(a,n.get(r.container)),o=n.getSize(a),s&&e.extend(s.style,{top:t.y+"px",left:t.x+"px",width:o.w+"px",height:o.h+"px"})),s=a=null}),i.exec.call(u,"FileInput","init",r)}),u.connectRuntime(r)},disable:function(t){var n=this.getRuntime();n&&n.exec.call(this,"FileInput","disable","undefined"===e.typeOf(t)?!0:t)},refresh:function(){u.trigger("Refresh")},destroy:function(){var t=this.getRuntime();t&&(t.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===e.typeOf(this.files)&&e.each(this.files,function(e){e.destroy()}),this.files=null}})}var c=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return u.prototype=r.instance,u}),i(_,[c,f,p,u,E,v,h,l],function(e,t,n,i,r,o,a,s){function u(n){var a=this,u;"string"==typeof n&&(n={drop_zone:n}),u={accept:[{title:e.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},n="object"==typeof n?i.extend({},u,n):u,n.container=t.get(n.drop_zone)||document.body,"static"===t.getStyle(n.container,"position")&&(n.container.style.position="relative"),"string"==typeof n.accept&&(n.accept=s.mimes2extList(n.accept)),o.call(a),i.extend(a,{uid:i.guid("uid_"),ruid:null,files:null,init:function(){a.convertEventPropsToHandlers(c),a.bind("RuntimeInit",function(e,t){a.ruid=t.uid,a.bind("Drop",function(){var e=t.exec.call(a,"FileDrop","getFiles");a.files=[],i.each(e,function(e){a.files.push(new r(a.ruid,e))})},999),t.exec.call(a,"FileDrop","init",n),a.dispatchEvent("ready")}),a.connectRuntime(n)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null}})}var c=["ready","dragenter","dragleave","drop","error"];return u.prototype=a.instance,u}),i(x,[u,p,h,v],function(e,t,n,i){function r(){function n(e,n){if(this.readyState=r.EMPTY,this.error=null,this.readyState===r.LOADING||!n.ruid||!n.uid)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);this.convertEventPropsToHandlers(o),this.bind("Error",function(e,t){this.readyState=r.DONE,this.result=null,this.error=t,this.trigger("loadend")},999),this.bind("LoadStart",function(){this.readyState=r.LOADING},999),this.bind("Load",function(){this.readyState=r.DONE,this.trigger("loadend")},999),this.connectRuntime(n.ruid).exec.call(this,"FileReader","read",e,n)}i.call(this),e.extend(this,{uid:e.guid("uid_"),readyState:r.EMPTY,result:null,error:null,readAsBinaryString:function(e){this.result="",n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){n.call(this,"readAsDataURL",e)},readAsArrayBuffer:function(e){n.call(this,"readAsArrayBuffer",e)},readAsText:function(e){n.call(this,"readAsText",e)},abort:function(){if(this.result=null,!~e.inArray(this.readyState,[r.EMPTY,r.DONE])){this.readyState===r.LOADING&&(this.readyState=r.DONE);var t=this.getRuntime();t&&t.exec.call(this,"FileReader","abort"),this.bind("Abort",function(){this.trigger("loadend")})}},destroy:function(){this.abort();var e=this.getRuntime();e&&(e.exec.call(this,"FileReader","destroy"),this.disconnectRuntime())}})}var o=["loadstart","progress","load","abort","error","loadend"];return r.EMPTY=0,r.LOADING=1,r.DONE=2,r.prototype=n.instance,r}),i(w,[],function(){var e=function(e){for(var t=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],n=t.length,i={http:80,https:443},r={},o=/^(?:([^:/?#]+):)?(?://()(?:(?:()(?:([^:@]*):?([^:@]*))?@)?([^:/?#]*)(?::(d*))?))?()(?:(()(?:(?:[^?#/]*/)*)()(?:[^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,a=o.exec(e||"");n--;)a[n]&&(r[t[n]]=a[n]);if(/^[^/]/.test(r.path)&&!r.scheme){var s=document.location.pathname;/(/|/[^.]+)$/.test(s)||(s=s.replace(/[^/]+$/,"")),r.host=document.location.hostname,r.path=s+(r.path||"")}return r.scheme||(r.scheme=document.location.protocol.replace(/:$/,"")),r.host||(r.host=document.location.hostname),r.port||(r.port=document.location.port||i[r.scheme]||80),r.port=parseInt(r.port,10),r.path||(r.path="/"),delete r.source,r},t=function(t){var n={http:80,https:443},i=e(t);return i.scheme+"://"+i.host+(i.port!==n[i.scheme]?":"+i.port:"")+i.path+(i.query?i.query:"")},n=function(t){function n(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof t&&(t=e(t)),n(e())===n(t)};return{parseUrl:e,resolveUrl:t,hasSameOrigin:n}}),i(b,[u,v,h],function(e,t,n){function i(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return i.prototype=n.instance,i}),i(T,[u,v,m],function(e,t,n){return function(){function i(e,t){if(!t.isDetached()){var i=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),i}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+n.btoa(r);case"readAsText":for(var o="",a=0,s=r.length;s>a;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return i.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return i.call(this,"readAsDataURL",e)},readAsText:function(e){return i.call(this,"readAsText",e)}})}}),i(A,[p,u,y],function(e,t,n){function i(){var e,i={},r="";t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof n?(e&&delete i[e],e=r,i[r]=[o]):"array"===s?(r+="[]",t.each(o,function(e){a.append.call(a,r,e)})):"object"===s?t.each(o,function(e,t){a.append.call(a,r+"["+t+"]",e)}):(o=o.toString(),i[r]||(i[r]=[]),i[r].push(o))},hasBlob:function(){return!!e},getBlob:function(){return i[e]&&i[e][0]||null},getBlobName:function(){return e||null},each:function(e){t.each(i,function(n,i){t.each(n,function(t){e(t,i)})})},destroy:function(){e=null,r="",i={}}})}return i}),i(S,[u,p,h,m,w,b,y,T,A,d,l],function(e,t,n,i,r,o,a,s,u,c,l){function d(){this.uid=e.guid("uid_")}function f(){function n(e,t){return b.hasOwnProperty(e)?1===arguments.length?c.can("define_property")?b[e]:w[e]:(c.can("define_property")?b[e]=t:w[e]=t,void 0):void 0}function s(){return!window.XMLHttpRequest||"IE"===c.browser&&c.version<8?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(n){}}():new window.XMLHttpRequest}function v(e){var t=e.responseXML,n=e.responseText;return"IE"===c.browser&&n&&t&&!t.documentElement&&/[^/]+/[^+]++xml/.test(e.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(n)),t&&("IE"===c.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function y(){var t=this,i=0;W=m,j=s(),j.onreadystatechange=function r(){switch(n("readyState")>f.HEADERS_RECEIVED&&(n("status",j.status),n("statusText",j.statusText)),n("readyState",j.readyState),j.readyState!==f.OPENED&&t.dispatchEvent("readystatechange"),n("readyState")){case f.OPENED:r.loadstartDispatched||(t.dispatchEvent("loadstart"),r.loadstartDispatched=!0);break;case f.HEADERS_RECEIVED:try{B&&(i=j.getResponseHeader("Content-Length")||0)}catch(e){}break;case f.LOADING:var o=0;try{j.responseText&&(o=j.responseText.length)}catch(e){o=0}t.dispatchEvent({type:"progress",lengthComputable:!!i,total:parseInt(i,10),loaded:o});break;case f.DONE:j.onreadystatechange=function(){},0===j.status?(H=!0,t.dispatchEvent("error")):(n("responseText",j.responseText),n("responseXML",v(j)),n("response","document"===n("responseType")?n("responseXML"):n("responseText")),X=j.getAllResponseHeaders(),t.dispatchEvent("load")),j=null,t.dispatchEvent("loadend")}},j.open(S,A,T,I,D),e.isEmptyObj(O)||e.each(O,function(e,t){j.setRequestHeader(t,e)}),j.send()}function E(t){function i(){j.destroy(),j=null,a.dispatchEvent("loadend"),a=null}function r(r){j.bind("LoadStart",function(e){n("readyState",f.LOADING),a.dispatchEvent(e),F&&a.upload.dispatchEvent(e)}),j.bind("Progress",function(e){n("readyState",f.LOADING),a.dispatchEvent("readystatechange"),a.dispatchEvent(e)}),j.bind("UploadProgress",function(e){F&&a.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),j.bind("Load",function(t){n("readyState",f.DONE),n("status",Number(r.exec.call(j,"XMLHttpRequest","getStatus")||0)),n("statusText",p[n("status")]||""),n("response",r.exec.call(j,"XMLHttpRequest","getResponse",n("responseType"))),~e.inArray(n("responseType"),["text",""])?n("responseText",n("response")):"document"===n("responseType")&&n("responseXML",n("response")),X=r.exec.call(j,"XMLHttpRequest","getAllResponseHeaders"),a.dispatchEvent("readystatechange"),n("status")>0?(F&&a.upload.dispatchEvent(t),a.dispatchEvent(t)):(H=!0,a.dispatchEvent("error")),i()}),j.bind("Abort",function(e){a.dispatchEvent(e),i()}),j.bind("Error",function(e){H=!0,n("readyState",f.DONE),a.dispatchEvent("readystatechange"),P=!0,a.dispatchEvent(e),i()}),r.exec.call(j,"XMLHttpRequest","send",{url:A,method:S,async:T,user:I,password:D,headers:O,mimeType:N,encoding:L,responseType:a.responseType,withCredentials:a.withCredentials,options:q},t)}var a=this;W=g,j=new o,q.required_caps=e.extend({},q.required_caps,{return_response_type:a.responseType}),q.ruid?r(j.connectRuntime(q)):(j.bind("RuntimeInit",function(e,t){r(t)}),j.bind("RuntimeError",function(e,t){a.dispatchEvent("RuntimeError",t)}),j.connectRuntime(q))
}function R(e){G=(new Date).getTime(),_.call(this)?y.call(this,e):E.call(this,e)}function _(){return B&&("HEAD"===S||"GET"===S&&!!~e.inArray(n("responseType"),["","text","document"])||"POST"===S&&"application/x-www-form-urlencoded"===O["Content-Type"])}function x(){n("responseText",""),n("responseXML",null),n("response",null),n("status",0),n("statusText",""),G=U=null}var w=this,b={timeout:0,readyState:f.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,A,S,O={},I,D,L=null,N=null,M=!1,C=!1,F=!1,P=!1,H=!1,B=!1,G,U,z=null,k=null,q={},j,X="",V,W=m;e.extend(this,b,{uid:e.guid("uid_"),upload:new d,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[u0100-uffff]/.test(o)||i.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(S=o.toUpperCase()),~e.inArray(S,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=i.utf8_encode(a),l=r.parseUrl(a),B=r.hasSameOrigin(l),A=r.resolveUrl(a),(u||c)&&!B)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(I=u||l.user,D=c||l.pass,T=s||!0,T===!1&&(n("timeout")||n("withCredentials")||""!==n("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);M=!T,C=!1,O={},x.call(this),n("readyState",f.OPENED),this.convertEventPropsToHandlers(["readystatechange"]),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(n("readyState")!==f.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[u0100-uffff]/.test(r)||i.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy-|sec-)/.test(r)?!1:(O[r]?O[r]+=", "+o:O[r]=o,!0)},getAllResponseHeaders:function(){return X||""},getResponseHeader:function(t){return t=t.toLowerCase(),H||~e.inArray(t,["set-cookie","set-cookie2"])?null:X&&""!==X&&(V||(V={},e.each(X.split(/rn/),function(t){var n=t.split(/:s+/);2===n.length&&(n[0]=e.trim(n[0]),V[n[0].toLowerCase()]={header:n[0],value:e.trim(n[1])})})),V.hasOwnProperty(t))?V[t].header+": "+V[t].value:null},overrideMimeType:function(i){var r,o;if(~e.inArray(n("readyState"),[f.LOADING,f.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i=e.trim(i.toLowerCase()),/;/.test(i)&&(r=i.match(/^([^;]+)(?:;scharset=)?(.*)$/))&&(i=r[1],r[2]&&(o=r[2])),!l.mimes[i])throw new t.DOMException(t.DOMException.SYNTAX_ERR);z=i,k=o},send:function(n,r){if(q="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.convertEventPropsToHandlers(h),this.upload.convertEventPropsToHandlers(h),this.readyState!==f.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(!_())if(instanceof a)q.ruid=n.ruid,N=n.type;else if(instanceof u){if(n.hasBlob()){var o=n.getBlob();q.ruid=o.ruid,N=o.type}}else"string"==typeof n&&(L="UTF-8",N="text/plain;charset=UTF-8",n=i.utf8_encode(n));this.withCredentials||(this.withCredentials=q.required_caps&&q.required_caps.send_browser_cookies&&!B),F=!M&&this.upload.hasEventListener(),H=!1,P=!n,M||(C=!0),R.call(this,n)},abort:function(){var i;if(H=!0,M=!1,~e.inArray(n("readyState"),[f.UNSENT,f.OPENED,f.DONE]))n("readyState",f.UNSENT);else{if(n("readyState",f.DONE),C=!1,W===m)j.abort(),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort"),this.dispatchEvent("loadend"),P||(this.upload.dispatchEvent("abort"),this.upload.dispatchEvent("loadend"));else{if("function"!==e.typeOf(j.getRuntime)||!(i=j.getRuntime()))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);i.exec.call(j,"XMLHttpRequest","abort",P)}P=!0}},destroy:function(){j&&("function"===e.typeOf(j.destroy)&&j.destroy(),j=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}})}var p={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};d.prototype=n.instance;var h=["loadstart","progress","abort","error","load","timeout","loadend"],m=1,g=2;return f.UNSENT=0,f.OPENED=1,f.HEADERS_RECEIVED=2,f.LOADING=3,f.DONE=4,f.prototype=n.instance,f}),i(O,[u,m,v,h],function(e,t,n,i){function r(){function i(){l=d=0,c=this.result=null}function o(t,n){var i=this;u=n,i.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(i.state,[r.IDLE,r.DONE])&&a.call(i)},999),i.bind("TransportingComplete",function(){d=l,i.state=r.DONE,c=null,i.result=u.exec.call(i,"Transporter","getAsBlob",t||"")},999),i.state=r.BUSY,i.trigger("TransportingStarted"),a.call(i)}function a(){var e=this,n,i=l-d;f>i&&(f=i),n=t.btoa(c.substr(d,f)),u.exec.call(e,"Transporter","receive",n,l)}var s,u,c,l,d,f;n.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,n,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),f=r.chunk_size,i.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,n,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,n,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),i.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),i.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=i.instance,r}),i(I,[],function(){return!!window.JSON&&JSON.parse||function(){var e,n,i={'"':'"',"\":"\","/":"/",b:"b",f:"f",n:"n",r:"r",t:"    "},r,o=function(t){throw{name:"SyntaxError",message:t,at:e,text:r}},a=function(t){return t&&t!==n&&o("Expected '"+t+"' instead of '"+n+"'"),n=r.charAt(e),e+=1,n},s=function(){var e,t="";for("-"===n&&(t="-",a("-"));n>="0"&&"9">=n;)t+=n,a();if("."===n)for(t+=".";a()&&n>="0"&&"9">=n;)t+=n;if("e"===n||"E"===n)for(t+=n,a(),("-"===n||"+"===n)&&(t+=n,a());n>="0"&&"9">=n;)t+=n,a();return e=+t,isFinite(e)?e:(o("Bad number"),void 0)},u=function(){var e,t,r="",s;if('"'===n)for(;a();){if('"'===n)return a(),r;if("\"===n)if(a(),"u"===n){for(s=0,t=0;4>t&&(e=parseInt(a(),16),isFinite(e));t+=1)s=16*s+e;r+=String.fromCharCode(s)}else{if("string"!=typeof i[n])break;r+=i[n]}else r+=n}o("Bad string")},c=function(){for(;n&&" ">=n;)a()},l=function(){switch(n){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}o("Unexpected '"+n+"'")},d,f=function(){var e=[];if("["===n){if(a("["),c(),"]"===n)return a("]"),e;for(;n;){if(e.push(d()),c(),"]"===n)return a("]"),e;a(","),c()}}o("Bad array")},p=function(){var e,t={};if("{"===n){if(a("{"),c(),"}"===n)return a("}"),t;for(;n;){if(e=u(),c(),a(":"),Object.hasOwnProperty.call(t,e)&&o('Duplicate key "'+e+'"'),t[e]=d(),c(),"}"===n)return a("}"),t;a(","),c()}}o("Bad object")};return d=function(){switch(c(),n){case"{":return p();case"[":return f();case'"':return u();case"-":return s();default:return n>="0"&&"9">=n?s():l()}},function(i,a){var s;return r=i,e=0,n=" ",s=d(),c(),n&&o("Syntax error"),"function"==typeof a?function u(e,n){var i,r,o=e[n];if(o&&"object"==typeof o)for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r=u(o,i),r!==t?o[i]=r:delete o[i]);return a.call(e,n,o)}({"":s},""):s}}()}),i(D,[u,f,p,T,S,v,O,d,h,y,E,m,I],function(e,t,n,i,r,o,a,s,u,c,l,d,f){function p(){function i(t){if(t||(t=this.getRuntime().exec.call(this,"Image","getInfo")),t)if("string"===e.typeOf(t.meta))try{this.meta=f(t.meta)}catch(n){}else this.meta=t.meta;e.extend(this,{size:parseInt(t.size,10),width:parseInt(t.width,10),height:parseInt(t.height,10),type:t.type}),""===this.name&&(this.name=t.name)}function u(t){var i=e.typeOf(t);try{if(t instanceof p){if(!t.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);m.apply(this,arguments)}else if(t instanceof c){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new n.ImageError(n.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(i,["blob","file"]))u.call(this,new l(null,t),arguments[1]);else if("string"===i)/^data:[^;]*;base64,/.test(t)?u.call(this,new c(null,{data:t}),arguments[1]):v.apply(this,arguments);else{if("node"!==i||"img"!==t.nodeName)throw new n.DOMException(n.DOMException.TYPE_MISMATCH_ERR);u.call(this,t.src,arguments[1])}}catch(r){this.trigger("error")}}function m(t,n){var i=this.connectRuntime(t.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(n)?!0:n)}function g(t,n){function i(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){i(t)}),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},n))):i(this.connectRuntime(t.ruid))}function v(e,t){var n=this,i;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}o.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){this.bind("Load Resize",function(){i.call(this)},999),this.convertEventPropsToHandlers(h),u.apply(this,arguments)},downsize:function(t,i,r,o){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);(!t&&!i||"undefined"===e.typeOf(r))&&(r=!1),t=t||this.width,i=i||this.height,o="undefined"===e.typeOf(o)?!0:!!o,this.getRuntime().exec.call(this,"Image","downsize",t,i,r,o)},crop:function(e,t,n){this.downsize(e,t,!0,n)},getAsCanvas:function(){if(!s.can("create_canvas"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);var e=this.connectRuntime(this.ruid);return e.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return e||(e="image/jpeg"),"image/jpeg"!==e||t||(t=90),this.getRuntime().exec.call(this,"Image","getAsBlob",e,t)},getAsDataURL:function(e,t){if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);return this.getRuntime().exec.call(this,"Image","getAsDataURL",e,t)},getAsBinaryString:function(e,t){var n=this.getAsDataURL(e,t);return d.atob(n.substring(n.indexOf("base64,")+7))},embed:function(i){function r(){if(s.can("create_canvas")){var t=u.getAsCanvas();if(t)return i.appendChild(t),t=null,u.destroy(),o.trigger("embedded"),void 0}var r=u.getAsDataURL(c,l);if(!r)throw new n.ImageError(n.ImageError.WRONG_FORMAT);if(s.can("use_data_uri_of",r.length))i.innerHTML='<img src="'+r+'" width="'+u.width+'" height="'+u.height+'" />',u.destroy(),o.trigger("embedded");else{var f=new a;f.bind("TransportingComplete",function(){v=o.connectRuntime(this.result.ruid),o.bind("Embedded",function(){e.extend(v.getShimContainer().style,{top:"0px",left:"0px",width:u.width+"px",height:u.height+"px"}),v=null},999),v.exec.call(o,"ImageView","display",this.result.uid,m,g),u.destroy()}),f.transport(d.atob(r.substring(r.indexOf("base64,")+7)),c,e.extend({},h,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:i}))}}var o=this,u,c,l,f,h=arguments[1]||{},m=this.width,g=this.height,v;if(!(i=t.get(i)))throw new n.DOMException(n.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new n.DOMException(n.DOMException.INVALID_STATE_ERR);if(c=h.type||this.type||"image/jpeg",l=h.quality||90,f="undefined"!==e.typeOf(h.crop)?h.crop:!1,h.width)m=h.width,g=h.height||m;else{var y=t.getSize(i);y.w&&y.h&&(m=y.w,g=y.h)}return u=new p,u.bind("Resize",function(){r.call(o)}),u.bind("Load",function(){u.downsize(m,g,f,!1)}),u.clone(this,!1),u},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}})}var h=["progress","load","error","resize","embedded"];return p.prototype=u.instance,p}),i(L,[u,p,g,d],function(e,t,n,i){function r(r){var s=this,u=n.capTest,c=n.capTrue,l=e.extend({access_binary:u(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return s.can("access_binary")&&!!a.Image},display_media:u(i.can("create_canvas")||i.can("use_data_uri_over32kb")),do_cors:u(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:u(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==i.browser||i.version>9)}()),return_response_headers:c,return_response_type:function(e){return"json"===e?!0:i.can("return_response_type",e)},report_upload_progress:u(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return s.can("access_binary")&&i.can("create_canvas")},select_folder:u("Chrome"===i.browser&&i.version>=21),select_multiple:u(!("Safari"===i.browser&&"Windows"===i.OS)),send_binary_string:u(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:u(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||s.can("send_binary_string")},slice_blob:u(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return s.can("slice_blob")&&s.can("send_multipart")},summon_file_dialog:u(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||"IE"===i.browser&&i.version>=10||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:c},arguments[2]);n.call(this,r,arguments[1]||o,l),e.extend(this,{init:function(){return window.File&&i.can("use_fileinput")?(this.trigger("Init"),void 0):(this.trigger("Error",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),void 0)},destroy:function(e){return function(){e.call(s),e=s=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html5",a={};return n.addConstructor(o,r),a}),i(N,[L,y],function(e,t){function n(){function e(e,t,n){var i;if(!window.File.prototype.slice)return(i=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?i.call(e,t,n):null;try{return e.slice(),e.slice(t,n)}catch(r){return e.slice(t,n-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=n}),i(M,[u],function(e){function t(){this.returnValue=!1}function n(){this.cancelBubble=!0}var i={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=n,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),i.hasOwnProperty(o[r])||(i[o[r]]={}),l=i[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,n,o){var a,s;if(n=n.toLowerCase(),t[r]&&i[t[r]]&&i[t[r]][n]){a=i[t[r]][n];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(n,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+n,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete i[t[r]][n],e.isEmptyObj(i[t[r]])){delete i[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,n){t&&t[r]&&e.each(i[t[r]],function(e,i){a(t,i,n)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),i(C,[L,u,f,M,l],function(e,t,n,i,r){function o(){var e=[],o;t.extend(this,{init:function(a){var s=this,u=s.getRuntime(),c,l,d;o=a,e=[],d=o.accept.mimes||r.extList2mimes(o.accept),l=u.getShimContainer(),l.innerHTML='<input id="'+u.uid+'" type="file" style="font-size:999px;opacity:0;"'+(o.multiple&&u.can("select_multiple")?"multiple":"")+(o.directory&&u.can("select_folder")?"webkitdirectory directory":"")+' accept="'+d.join(",")+'" />',c=n.get(u.uid),t.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),function(){var e,t,r;e=n.get(o.browse_button),u.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),t=parseInt(n.getStyle(e,"z-index"),10)||1,e.style.zIndex=t,l.style.zIndex=t-1,i.addEvent(e,"click",function(e){c&&!c.disabled&&c.click(),e.preventDefault()},s.uid)),r=u.can("summon_file_dialog")?e:l,i.addEvent(r,"mouseover",function(){s.trigger("mouseenter")},s.uid),i.addEvent(r,"mouseout",function(){s.trigger("mouseleave")},s.uid),i.addEvent(r,"mousedown",function(){s.trigger("mousedown")},s.uid),i.addEvent(n.get(o.container),"mouseup",function(){s.trigger("mouseup")},s.uid)}(),c.onchange=function(){e=[],o.directory?t.each(this.files,function(t){"."!==t.name&&e.push(t)}):e=[].slice.call(this.files),this.value="",s.trigger("change")},s.trigger({type:"ready",async:!0})},getFiles:function(){return e},disable:function(e){var t=this.getRuntime(),i;(i=n.get(t.uid))&&(i.disabled=!!e)},destroy:function(){var t=this.getRuntime(),r=t.getShimContainer();i.removeAllEvents(r,this.uid),i.removeAllEvents(o&&n.get(o.container),this.uid),i.removeAllEvents(o&&n.get(o.browse_button),this.uid),r&&(r.innerHTML=""),e=o=null}})}return e.FileInput=o}),i(F,[L,u,f,M,l],function(e,t,n,i,r){function o(){function e(e){var n=c.accept.mimes||r.extList2mimes(c.accept),i=e.type||r.getFileMime(e.name)||"";return n.length&&-1===t.inArray(i,n)?!1:!0}function o(e,n){var i=[];t.each(e,function(e){i.push(function(t){a(e,t)})}),t.inSeries(i,function(){n()})}function a(t,n){t.isFile?t.file(function(t){e(t)&&u.push(t),n()},function(){n()}):t.isDirectory?s(t,n):n()}function s(e,t){function n(e){r.readEntries(function(t){t.length?([].push.apply(i,t),n(e)):e()},e)}var i=[],r=e.createReader();n(function(){o(i,t)})}var u=[],c;t.extend(this,{init:function(n){var r=this,a;c=n,a=c.container,i.addEvent(a,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},r.uid),i.addEvent(a,"drop",function(n){if(n.preventDefault(),n.stopPropagation(),u=[],n.dataTransfer.items&&n.dataTransfer.items[0].webkitGetAsEntry){var i=[];t.each(n.dataTransfer.items,function(e){i.push(e.webkitGetAsEntry())}),o(i,function(){r.trigger("drop")})}else t.each(n.dataTransfer.files,function(t){e(t)&&u.push(t)}),r.trigger("drop")},r.uid),i.addEvent(a,"dragenter",function(e){e.preventDefault(),e.stopPropagation(),r.trigger("dragenter")},r.uid),i.addEvent(a,"dragleave",function(e){e.preventDefault(),e.stopPropagation(),r.trigger("dragleave")},r.uid)},getFiles:function(){return u},destroy:function(){i.removeAllEvents(c&&n.get(c.container),this.uid),u=c=null}})}return e.FileDrop=o}),i(P,[L,u],function(e,t){function n(){this.read=function(e,n){var i=this,r=new window.FileReader;!function(){function e(e){~t.inArray(e.type,["progress","load"])&&(i.result=r.result),i.trigger(e)}function n(){t.each(o,function(t){r.removeEventListener(t,e)}),r.removeEventListener("loadend",n)}var o=["loadstart","progress","load","abort","error"];t.each(o,function(t){r.addEventListener(t,e)}),r.addEventListener("loadend",n)}(),"function"===t.typeOf(r[e])&&r[e](n.getSource())}}return e.FileReader=n}),i(H,[L,u,E,y,A,p,d,I],function(e,t,n,i,r,o,a,s){function u(){function e(e){var t="----moxieboundary"+(new Date).getTime(),n="--",r="rn",a="",s=this.getRuntime();if(!s.can("send_binary_string"))throw new o.RuntimeError(o.RuntimeError.NOT_SUPPORTED_ERR);return c.setRequestHeader("Content-Type","multipart/form-data; boundary="+t),e.each(function(e,o){a+=e instanceof i?n+t+r+'Content-Dispositionform-dataname="'+o+'"filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+r+"Content-Type: "+e.type+r+r+e.getSource()+r:n+t+r+'Content-Dispositionform-dataname="'+o+'"'+r+r+unescape(encodeURIComponent(e))+r}),a+=n+t+n+r}var u=this,c,l;t.extend(this,{send:function(n,o){var s=this,d=!1,f,p,h,m="Mozilla"===a.browser&&a.version>=4&&a.version<7,g="Android Browser"===a.browser;return(m||g)&&o instanceof r&&o.hasBlob()&&!o.getBlob().isDetached()&&(p=o.getBlob().getSource(),p instanceof window.Blob&&window.FileReader)?(h=new window.FileReader,h.onload=function(){o.append(o.getBlobName(),new i(null,{type:p.type,data:h.result})),u.send.call(s,n,o)},h.readAsBinaryString(p),void 0):(c=new window.XMLHttpRequest,l=n.url.replace(/^.+?/([w-.]+)$/,"$1").toLowerCase(),c.open(n.method,n.url,n.async,n.user,n.password),t.isEmptyObj(n.headers)||t.each(n.headers,function(e,t){c.setRequestHeader(t,e)}),""!==n.responseType&&(c.responseType="json"!==n.responseType||a.can("return_response_type","json")?n.responseType:"text"),n.withCredentials&&(c.withCredentials=!0),function(){function e(e){s.trigger(e)}function n(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})}function i(){t.each(r,function(t){c.removeEventListener(t,e)}),c.removeEventListener("loadend",i),c.upload&&c.upload.removeEventListener("progress",n),c=null}var r=["loadstart","progress","abort","error","load","timeout"];t.each(r,function(t){c.addEventListener(t,e)}),c.upload&&c.upload.addEventListener("progress",n),c.addEventListener("loadend",i)}(),o instanceof i?(o.isDetached()&&(d=!0),o=o.getSource()):o instanceof r&&(o.hasBlob()&&o.getBlob().isDetached()?(o=e.call(s,o),d=!0):(f=new window.FormData,o.each(function(e,t){e instanceof i?f.append(t,e.getSource()):f.append(t,e)}),o=f)),d?c.sendAsBinary?c.sendAsBinary(o):function(){for(var e=new Uint8Array(o.length),t=0;t<o.length;t++)e[t]=255&o.charCodeAt(t);c.send(e.buffer)}():c.send(o),void 0)},getStatus:function(){try{if(c)return c.status}catch(e){}},getResponse:function(e){var t=this.getRuntime();try{if(c){if("blob"===e){var i=new n(t.uid,c.response);try{var r=c.getResponseHeader("Content-Disposition");if(r){var o=r.match(/filename=(['"'])([^1]+)1/);o&&(l=o[2])}}catch(u){}return i.name=l,i}return"json"!==e||a.can("return_response_type","json")?c.response:200===c.status?s(c.response):null}}catch(u){}},getAllResponseHeaders:function(){try{return c.getAllResponseHeaders()}catch(e){}return""},abort:function(){c&&c.abort()},destroy:function(){u=l=null}})}return e.XMLHttpRequest=u}),i(B,[],function(){return function(){function e(e,t){var n=r?0:-8*(t-1),i=0,a;for(a=0;t>a;a++)i|=o.charCodeAt(e+a)<<Math.abs(n+8*a);return i}function n(e,t,n){n=3===arguments.length?n:o.length-t-1,o=o.substr(0,t)+e+o.substr(n+t)}function i(e,t,i){var o="",a=r?0:-8*(i-1),s;for(s=0;i>s;s++)o+=String.fromCharCode(255&t>>Math.abs(a+8*s));n(o,e,i)}var r=!1,o;return{II:function(e){return e===t?r:(r=e,void 0)},init:function(e){r=!1,o=e},SEGMENT:function(e,t,i){switch(arguments.length){case 1:return o.substr(e,o.length-e-1);case 2:return o.substr(e,t);case 3:n(i,e,t);break;default:return o}},BYTE:function(t){return e(t,1)},SHORT:function(t){return e(t,2)},LONG:function(n,r){return r===t?e(n,4):(i(n,r,4),void 0)},SLONG:function(t){var n=e(t,4);return n>2147483647?n-4294967296:n},STRING:function(t,n){var i="";for(n+=t;n>t;t++)i+=String.fromCharCode(e(t,1));return i}}}}),i(G,[B],function(e){return function t(n){var i=[],r,o,a,s=0;if(r=new e,r.init(n),65496===r.SHORT(0)){for(o=2;o<=n.length;)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;s=r.SHORT(o+2)+2,a>=65505&&65519>=a&&i.push({hex:a,name:"APP"+(15&a),start:o,length:s,segment:r.SEGMENT(o,s)}),o+=s}return r.init(null),{headers:i,restore:function(e){var t,n;for(r.init(e),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,t=i.length;t>n;n++)r.SEGMENT(o,0,i[n].segment),o+=i[n].length;return e=r.SEGMENT(),r.init(null),e},strip:function(e){var n,i,o;for(i=new t(e),n=i.headers,i.purge(),r.init(e),o=n.length;o--;)r.SEGMENT(n[o].start,n[o].length,"");return e=r.SEGMENT(),r.init(null),e},get:function(e){for(var t=[],n=0,r=i.length;r>n;n++)i[n].name===e.toUpperCase()&&t.push(i[n].segment);return t},set:function(e,t){var n=[],r,o,a;for("string"==typeof t?n.push(t):n=t,r=o=0,a=i.length;a>r&&(i[r].name===e.toUpperCase()&&(i[r].segment=n[o],i[r].length=n[o].length,o++),!(o>=n.length));r++);},purge:function(){i=[],r.init(null),r=null}}}}}),i(U,[u,B],function(e,n){return function i(){function i(e,n){var i=a.SHORT(e),r,o,s,u,d,f,p,h,m=[],g={};for(r=0;i>r;r++)if(p=f=e+12*r+2,s=n[a.SHORT(p)],s!==t){switch(u=a.SHORT(p+=2),d=a.LONG(p+=2),p+=4,m=[],u){case 1:case 7:for(d>4&&(p=a.LONG(p)+c.tiffHeader),o=0;d>o;o++)m[o]=a.BYTE(p+o);break;case 2:d>4&&(p=a.LONG(p)+c.tiffHeader),g[s]=a.STRING(p,d-1);continue;case 3:for(d>2&&(p=a.LONG(p)+c.tiffHeader),o=0;d>o;o++)m[o]=a.SHORT(p+2*o);break;case 4:for(d>1&&(p=a.LONG(p)+c.tiffHeader),o=0;d>o;o++)m[o]=a.LONG(p+4*o);break;case 5:for(p=a.LONG(p)+c.tiffHeader,o=0;d>o;o++)m[o]=a.LONG(p+4*o)/a.LONG(p+4*o+4);break;case 9:for(p=a.LONG(p)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(p+4*o);break;case 10:for(p=a.LONG(p)+c.tiffHeader,o=0;d>o;o++)m[o]=a.SLONG(p+4*o)/a.SLONG(p+4*o+4);break;default:continue}h=1==d?m[0]:m,g[s]=l.hasOwnProperty(s)&&"object"!=typeof h?l[s][h]:h}return g}function r(){var e=c.tiffHeader;return a.II(18761==a.SHORT(e)),42!==a.SHORT(e+=2)?!1:(c.IFD0=c.tiffHeader+a.LONG(e+=2),u=i(c.IFD0,s.tiff),"ExifIFDPointer"in u&&(c.exifIFD=c.tiffHeader+u.ExifIFDPointer,delete u.ExifIFDPointer),"GPSInfoIFDPointer"in u&&(c.gpsIFD=c.tiffHeader+u.GPSInfoIFDPointer,delete u.GPSInfoIFDPointer),!0)}function o(e,t,n){var i,r,o,u=0;if("string"==typeof t){var l=s[e.toLowerCase()];for(var d in l)if(l[d]===t){t=d;break}}i=c[e.toLowerCase()+"IFD"],r=a.SHORT(i);for(var f=0;r>f;f++)if(o=i+12*f+2,a.SHORT(o)==t){u=o+8;break}return u?(a.LONG(u,n),!0):!1}var a,s,u,c={},l;return a=new n,s={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 4500K)",15:"White fluorescent (WW 3200 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash firedcompulsory flash mode",13:"Flash firedcompulsory flash mode, return light not detected",15:"Flash firedcompulsory flash mode, return light detected",16:"Flash did not firecompulsory flash mode",24:"Flash did not fireauto mode",25:"Flash firedauto mode",29:"Flash firedauto mode, return light not detected",31:"Flash firedauto mode, return light detected",32:"No flash function",65:"Flash firedred-eye reduction mode",69:"Flash firedred-eye reduction mode, return light not detected",71:"Flash firedred-eye reduction mode, return light detected",73:"Flash firedcompulsory flash modered-eye reduction mode",77:"Flash firedcompulsory flash modered-eye reduction mode, return light not detected",79:"Flash firedcompulsory flash modered-eye reduction mode, return light detected",89:"Flash firedauto modered-eye reduction mode",93:"Flash firedauto mode, return light not detectedred-eye reduction mode",95:"Flash firedauto mode, return light detectedred-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},{init:function(e){return c={tiffHeader:10},e!==t&&e.length?(a.init(e),65505===a.SHORT(0)&&"EXIF"===a.STRING(4,5).toUpperCase()?r():!1):!1},TIFF:function(){return u},EXIF:function(){var t;if(t=i(c.exifIFD,s.exif),t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n<t.ExifVersion.length;n++)r+=String.fromCharCode(t.ExifVersion[n]);t.ExifVersion=r}return t},GPS:function(){var t;return t=i(c.gpsIFD,s.gps),t.GPSVersionID&&"array"===e.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join(".")),t},setExif:function(e,t){return"PixelXDimension"!==e&&"PixelYDimension"!==e?!1:o("exif",e,t)},getBinary:function(){return a.SEGMENT()},purge:function(){a.init(null),a=u=null,c={}}}}}),i(z,[u,p,G,B,U],function(e,t,n,i,r){function o(o){function a(){for(var e=0,t,n;e<=u.length;){if(t=c.SHORT(e+=2),t>=65472&&65475>=t)return e+=5,{height:c.SHORT(e),width:c.SHORT(e+=2)};n=c.SHORT(e+=2),e+=n-2}return null}function s(){d&&l&&c&&(d.purge(),l.purge(),c.init(null),u=f=l=d=c=null)}var u,c,l,d,f,p;if(u=o,c=new i,c.init(u),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new n(o),d=new r,p=!!d.init(l.get("app1")[0]),f=a.call(this),e.extend(this,{type:"image/jpeg",size:u.length,width:f&&f.width||0,height:f&&f.height||0,setExif:function(t,n){return p?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,n),l.set("app1",d.getBinary()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):u=l.restore(u)},stripHeaders:function(e){return l.strip(e)},purge:function(){s.call(this)}}),p&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS()})}return o}),i(k,[p,u,B],function(e,t,n){function i(i){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:u.LONG(t),height:u.LONG(t+=4)}):null}function o(){u&&(u.init(null),s=d=c=l=u=null)}function a(e){var t,n,i,r;return t=u.LONG(e),n=u.STRING(e+=4,4),i=e+=4,r=u.LONG(e+t),{length:t,type:n,start:i,CRC:r}}var s,u,c,l,d;s=i,u=new n,u.init(s),function(){var t=0,n=0,i=[35152,20039,3338,6666];for(n=0;n<i.length;n++,t+=2)if(i[n]!=u.SHORT(t))throw new e.ImageError(e.ImageError.WRONG_FORMAT)}(),d=r.call(this),t.extend(this,{type:"image/png",size:s.length,width:d.width,height:d.height,purge:function(){o.call(this)}}),o.call(this)}return i}),i(q,[u,p,z,k],function(e,t,n,i){return function(r){var o=[n,i],a;a=function(){for(var e=0;e<o.length;e++)try{return new o[e](r)}catch(n){}throw new t.ImageError(t.ImageError.WRONG_FORMAT)
}(),e.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){}}),e.extend(this,a),this.purge=function(){a.purge(),a=null}}}),i(j,[],function(){function e(e,i,r){var o=e.naturalWidth,a=e.naturalHeight,s=r.width,u=r.height,c=r.x||0,l=r.y||0,d=i.getContext("
2d");t(e)&&(o/=2,a/=2);var f=1024,p=document.createElement("canvas");p.width=p.height=f;for(var h=p.getContext("2d"),m=n(e,o,a),g=0;a>g;){for(var v=g+f>a?a-g:f,y=0;o>y;){var E=y+f>o?o-y:f;h.clearRect(0,0,f,f),h.drawImage(e,-y,-g);var R=y*s/o+c<<0,_=Math.ceil(E*s/o),x=g*u/a/m+l<<0,w=Math.ceil(v*u/a/m);d.drawImage(p,0,0,E,v,R,x,_,w),y+=f}g+=f}p=h=null}function t(e){var t=e.naturalWidth,n=e.naturalHeight;if(t*n>1048576){var i=document.createElement("canvas");i.width=i.height=1;var r=i.getContext("2d");return r.drawImage(e,-t+1,0),0===r.getImageData(0,0,1,1).data[3]}return!1}function n(e,t,n){var i=document.createElement("canvas");i.width=1,i.height=n;var r=i.getContext("2d");r.drawImage(e,0,0);for(var o=r.getImageData(0,0,1,n).data,a=0,s=n,u=n;u>a;){var c=o[4*(u-1)+3];0===c?s=u:a=u,u=s+a>>1}i=null;var l=u/n;return 0===l?1:l}return{isSubsampled:t,renderTo:e}}),i(X,[L,u,p,m,y,q,j,l,d],function(e,t,n,i,r,o,a,s,u){function c(){function e(){if(!R&&!y)throw new n.ImageError(n.DOMException.INVALID_STATE_ERR);return R||y}function c(e){return i.atob(e.substring(e.indexOf("base64,")+7))}function l(e,t){return"data:"+(t||"")+";base64,"+i.btoa(e)}function d(e){var t=this;y=new Image,y.onerror=function(){throw g.call(this),new n.ImageError(n.ImageError.WRONG_FORMAT)},y.onload=function(){t.trigger("load")},y.src=/^data:[^;]*;base64,/.test(e)?e:l(e,x.type)}function f(e,t){var n;return window.FileReader?(n=new FileReader,n.onload=function(){t(this.result)},n.readAsDataURL(e),void 0):t(e.getAsDataURL())}function p(n,i,r,o){var a=this,s,u,c,l,d,f,p,g,v;if(b=o,v=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,-1!==t.inArray(v,[5,6,7,8])){var y=n;n=i,i=y}return f=e(),c=r?Math.max:Math.min,u=c(n/f.width,i/f.height),u>1&&(!r||o)?(this.trigger("Resize"),void 0):(p=Math.round(f.width*u),g=Math.round(f.height*u),R||(R=document.createElement("canvas")),s=R.getContext("2d"),r?(R.width=n,R.height=i):(R.width=p,R.height=g),l=p>R.width?Math.round((p-R.width)/2):0,d=g>R.height?Math.round((g-R.height)/2):0,b||m(R.width,R.height,v),h.call(this,f,R,-l,-d,p,g),this.width=R.width,this.height=R.height,w=!0,a.trigger("Resize"),void 0)}function h(e,t,n,i,r,o){if("iOS"===u.OS)a.renderTo(e,t,{width:r,height:o,x:n,y:i});else{var s=t.getContext("2d");s.drawImage(e,n,i,r,o)}}function m(e,t,n){switch(n){case 5:case 6:case 7:case 8:R.width=t,R.height=e;break;default:R.width=e,R.height=t}var i=R.getContext("2d");switch(n){case 2:i.translate(e,0),i.scale(-1,1);break;case 3:i.translate(e,t),i.rotate(Math.PI);break;case 4:i.translate(0,t),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-t);break;case 7:i.rotate(.5*Math.PI),i.translate(e,-t),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-e,0)}}function g(){E&&(E.purge(),E=null),_=y=R=null,w=!1}var v=this,y,E,R,_,x,w=!1,b=!0;t.extend(this,{loadFromBlob:function(e){var t=this,i=t.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!i.can("access_binary"))throw new n.RuntimeError(n.RuntimeError.NOT_SUPPORTED_ERR);return e.isDetached()?(x={name:e.name,size:e.size,type:e.type},_=e.getSource(),d.call(this,_),void 0):(x=e.getSource(),f(x,function(e){r&&(_=c(e)),d.call(t,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,x={name:e.name,size:e.size,type:e.type},d.call(this,t?_=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t=this.getRuntime(),n;return!E&&_&&t.can("access_image_binary")&&(E=new o(_)),n={width:e().width||0,height:e().height||0,type:x.type||s.getFileMime(x.name),size:_&&_.length||x.size||0,name:x.name||"",meta:E&&E.meta||this.meta||{}}},downsize:function(){p.apply(this,arguments)},getAsCanvas:function(){return R&&(R.id=this.uid+"_canvas"),R},getAsBlob:function(e,t){return e!==this.type&&p.call(this,this.width,this.height,!1),new r(null,{type:e,data:v.getAsBinaryString.call(this,e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!w)return y.src;if("image/jpeg"!==e)return R.toDataURL("image/png");try{return R.toDataURL("image/jpeg",t/100)}catch(n){return R.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!w)return _||(_=c(v.getAsDataURL(e,t))),_;if("image/jpeg"!==e)_=c(v.getAsDataURL(e,t));else{var n;t||(t=90);try{n=R.toDataURL("image/jpeg",t/100)}catch(i){n=R.toDataURL("image/jpeg")}_=c(n),E&&(_=E.stripHeaders(_),b&&(E.meta&&E.meta.exif&&E.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),_=E.writeHeaders(_)),E.purge(),E=null)}return w=!1,_},destroy:function(){v=null,g.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),i(V,[u,d,f,p,g],function(e,t,n,i,r){function o(o){function u(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(n){e="0.0"}}return e=e.match(/d+/g),parseFloat(e[0]+"."+e[1])}var c=this,l;o=e.extend({swf_url:t.swf_url},o),r.call(this,o,a,{access_binary:function(e){return e&&"browser"===c.getMode()},access_image_binary:function(e){return e&&"browser"===c.getMode()},display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===c.getMode()},resize_image:r.capTrue,return_response_headers:!1,return_response_type:function(t){return!e.arrayDiff(t,["","text","json","document"])||"browser"===c.getMode()},return_status_code:function(t){return"browser"===c.getMode()||!e.arrayDiff(t,[200,404])},select_multiple:r.capTrue,send_binary_string:function(e){return e&&"browser"===c.getMode()},send_browser_cookies:function(e){return e&&"browser"===c.getMode()},send_custom_headers:function(e){return e&&"browser"===c.getMode()},send_multipart:r.capTrue,slice_blob:r.capTrue,stream_upload:function(e){return e&&"browser"===c.getMode()},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===c.getMode()},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:!1,access_image_binary:!1,return_response_type:function(t){return!e.arrayDiff(t,["","text","json","document"])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},send_binary_string:!1,send_browser_cookies:!1,send_custom_headers:!1,stream_upload:!0,upload_filesize:function(t){return e.parseSizeStr(t)>=2097152}},"client"),e.extend(this,{getShim:function(){return n.get(this.uid)},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var n,r,a;return u()<10?(this.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR)),void 0):(a=this.getShimContainer(),e.extend(a.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),n='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+o.swf_url+'" ',"IE"===t.browser&&(n+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),n+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+o.swf_url+'" />'+'<param name="flashvars" value="uid='+escape(this.uid)+"&target="+t.global_event_dispatcher+'" />'+'<param name="wmode" value="transparent" />'+'<param name="allowscriptaccess" value="always" />'+"</object>","IE"===t.browser?(r=document.createElement("div"),a.appendChild(r),r.outerHTML=n,r=a=null):a.innerHTML=n,l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},5e3),void 0)},destroy:function(e){return function(){e.call(c),clearTimeout(l),o=l=e=c=null}}(this.destroy)},s)}var a="flash",s={};return r.addConstructor(a,o),s}),i(W,[V,y],function(e,t){var n={slice:function(e,n,i,r){var o=this.getRuntime();return 0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),e=o.shimExec.call(this,"Blob","slice",n,i,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=n}),i(Y,[V],function(e){var t={init:function(e){this.getRuntime().shimExec.call(this,"FileInput","init",{name:e.name,accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=t}),i($,[V,m],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i={read:function(e,t){var i=this,r=i.getRuntime();return"readAsDataURL"===e&&(i.result="data:"+(t.type||"")+";base64,"),i.bind("Progress",function(t,r){r&&(i.result+=n(r,e))},999),r.shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=i}),i(K,[V,m],function(e,t){function n(e,n){switch(n){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var i={read:function(e,t){var i,r=this.getRuntime();return(i=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(i="data:"+(t.type||"")+";base64,"+i),n(i,e,t.type)):null}};return e.FileReaderSync=i}),i(J,[V,u,y,E,T,A,O,I],function(e,t,n,i,r,o,a,s){var u={send:function(e,i){function r(){e.transport=l.getMode(),l.shimExec.call(c,"XMLHttpRequest","send",e,i)}function s(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),i=null,r()}function u(e,t){var n=new a;n.bind("TransportingComplete",function(){s(e,this.result)}),n.transport(t.getSource(),t.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),i instanceof o){var d;if(i.each(function(e,t){e instanceof n?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),i.hasBlob()){var f=i.getBlob();f.isDetached()?u(d,f):s(d,f)}else i=null,r()}else i instanceof n?(l.shimExec.call(c,"XMLHttpRequest","setRequestHeader","Content-Type",i.type||"application/octet-stream"),i=i.uid,r()):r()},getResponse:function(e){var n,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new i(a.uid,o),"blob"===e)return o;if(~t.inArray(e,["","text"]))return n=new r,n.readAsText(o);if("arraybuffer"===e);else if("json"===e){n=new r;try{return s(n.readAsText(o))}catch(u){return null}}}return null},abort:function(e){var t=this.getRuntime();t.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=u}),i(Z,[V,y],function(e,t){var n={getAsBlob:function(e){var n=this.getRuntime(),i=n.shimExec.call(this,"Transporter","getAsBlob",e);return i?new t(n.uid,i):null}};return e.Transporter=n}),i(Q,[V,u,O,y,T],function(e,t,n,i,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(i,"Image","loadFromBlob",e.uid),i=r=null}var i=this,r=i.getRuntime();if(e.isDetached()){var o=new n;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getAsBlob:function(e,t){var n=this.getRuntime(),r=n.shimExec.call(this,"Image","getAsBlob",e,t);return r?new i(n.uid,r):null},getAsDataURL:function(){var e=this.getRuntime(),t=e.Image.getAsBlob.apply(this,arguments),n;return t?(n=new r,n.readAsDataURL(t)):null}};return e.Image=o}),i(et,[u,d,f,p,g],function(e,t,n,i,r){function o(o){function u(e){var t=!1,n=null,i,r,o,a,s,u=0;try{try{n=new ActiveXObject("AgControl.AgControl"),n.IsVersionSupported(e)&&(t=!0),n=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(i=l.description,"1.0.30226.2"===i&&(i="2.0.30226.2"),r=i.split(".");r.length>3;)r.pop();for(;r.length<4;)r.push(0);for(o=e.split(".");o.length>4;)o.pop();do a=parseInt(o[u],10),s=parseInt(r[u],10),u++;while(u<o.length&&a===s);s>=a&&!isNaN(a)&&(t=!0)}}}catch(d){t=!1}return t}var c=this,l;o=e.extend({xap_url:t.xap_url},o),r.call(this,o,a,{access_binary:r.capTrue,access_image_binary:r.capTrue,display_media:r.capTrue,do_cors:r.capTrue,drag_and_drop:!1,report_upload_progress:r.capTrue,resize_image:r.capTrue,return_response_headers:function(e){return e&&"client"===c.getMode()},return_response_type:r.capTrue,return_status_code:function(t){return"client"===c.getMode()||!e.arrayDiff(t,[200,404])},select_multiple:r.capTrue,send_binary_string:r.capTrue,send_browser_cookies:function(e){return e&&"browser"===c.getMode()},send_custom_headers:function(e){return e&&"client"===c.getMode()},send_multipart:r.capTrue,slice_blob:r.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:r.capTrue,use_http_method:function(t){return"client"===c.getMode()||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:!0,return_status_code:function(t){return e.arrayDiff(t,[200,404])},send_browser_cookies:!1,send_custom_headers:!0,use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{getShim:function(){return n.get(this.uid).content.Moxie},shimExec:function(e,t){var n=[].slice.call(arguments,2);return c.getShim().exec(this.uid,e,t,n)},init:function(){var e;return u("2.0.31005.0")&&"Opera"!==t.browser?(e=this.getShimContainer(),e.innerHTML='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">'+'<param name="source" value="'+o.xap_url+'"/>'+'<param name="background" value="Transparent"/>'+'<param name="windowless" value="true"/>'+'<param name="enablehtmlaccess" value="true"/>'+'<param name="initParams" value="uid='+this.uid+",target="+t.global_event_dispatcher+'"/>'+"</object>",l=setTimeout(function(){c&&!c.initialized&&c.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3),void 0):(this.trigger("Error",new i.RuntimeError(i.RuntimeError.NOT_INIT_ERR)),void 0)},destroy:function(e){return function(){e.call(c),clearTimeout(l),o=l=e=c=null}}(this.destroy)},s)}var a="silverlight",s={};return r.addConstructor(a,o),s}),i(tt,[et,u,W],function(e,t,n){return e.Blob=t.extend({},n)}),i(nt,[et],function(e){var t={init:function(e){function t(e){for(var t="",n=0;n<e.length;n++)t+=(""!==t?"|":"")+e[n].title+" | *."+e[n].extensions.replace(/,/g,";*.");return t}this.getRuntime().shimExec.call(this,"FileInput","init",t(e.accept),e.name,e.multiple),this.trigger("ready")}};return e.FileInput=t}),i(it,[et,f,M],function(e,t,n){var i={init:function(){var e=this,i=e.getRuntime(),r;return r=i.getShimContainer(),n.addEvent(r,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},e.uid),n.addEvent(r,"dragenter",function(e){e.preventDefault();var n=t.get(i.uid).dragEnter(e);n&&e.stopPropagation()},e.uid),n.addEvent(r,"drop",function(e){e.preventDefault();var n=t.get(i.uid).dragDrop(e);n&&e.stopPropagation()},e.uid),i.shimExec.call(this,"FileDrop","init")}};return e.FileDrop=i}),i(rt,[et,u,$],function(e,t,n){return e.FileReader=t.extend({},n)}),i(ot,[et,u,K],function(e,t,n){return e.FileReaderSync=t.extend({},n)}),i(at,[et,u,J],function(e,t,n){return e.XMLHttpRequest=t.extend({},n)}),i(st,[et,u,Z],function(e,t,n){return e.Transporter=t.extend({},n)}),i(ut,[et,u,Q],function(e,t,n){return e.Image=t.extend({},n)}),i(ct,[u,p,g,d],function(e,t,n,i){function r(r){var s=this,u=n.capTest,c=n.capTrue;n.call(this,r,o,{access_binary:u(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:u(a.Image&&(i.can("create_canvas")||i.can("use_data_uri_over32kb"))),do_cors:!1,drag_and_drop:!1,resize_image:function(){return a.Image&&s.can("access_binary")&&i.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return!!~e.inArray(t,["json","text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:!0,summon_file_dialog:u(function(){return"Firefox"===i.browser&&i.version>=4||"Opera"===i.browser&&i.version>=12||"IE"===i.browser&&i.version>=10||!!~e.inArray(i.browser,["Chrome","Safari"])}()),upload_filesize:c,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){return i.can("use_fileinput")?(this.trigger("Init"),void 0):(this.trigger("Error",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),void 0)},destroy:function(e){return function(){e.call(s),e=s=null}}(this.destroy)}),e.extend(this.getShim(),a)}var o="html4",a={};return n.addConstructor(o,r),a}),i(lt,[ct,u,f,M,l,d],function(e,t,n,i,r,o){function a(){function e(){var r=this,l=r.getRuntime(),d,f,p,h,m,g;g=t.guid("uid_"),d=l.getShimContainer(),a&&(p=n.get(a+"_form"),p&&t.extend(p.style,{top:"100%"})),h=document.createElement("form"),h.setAttribute("id",g+"_form"),h.setAttribute("method","post"),h.setAttribute("enctype","multipart/form-data"),h.setAttribute("encoding","multipart/form-data"),t.extend(h.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=document.createElement("input"),m.setAttribute("id",g),m.setAttribute("type","file"),m.setAttribute("name","Filedata"),m.setAttribute("accept",u.join(",")),t.extend(m.style,{fontSize:"999px",opacity:0}),h.appendChild(m),d.appendChild(h),t.extend(m.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===o.browser&&o.version<10&&t.extend(m.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),m.onchange=function(){var t;this.value&&(t=this.files?this.files[0]:{name:this.value},s=[t],this.onchange=function(){},e.call(r),r.bind("change",function(){var e=n.get(g),t=n.get(g+"_form"),i;r.files.length&&e&&t&&(i=r.files[0],e.setAttribute("id",i.uid),t.setAttribute("id",i.uid+"_form"),t.setAttribute("target",i.uid+"_iframe")),e=t=null},998),m=h=null,r.trigger("change"))},l.can("summon_file_dialog")&&(f=n.get(c.browse_button),i.removeEvent(f,"click",r.uid),i.addEvent(f,"click",function(e){m&&!m.disabled&&m.click(),e.preventDefault()},r.uid)),a=g,d=p=f=null,r.trigger({type:"ready",async:!0})}var a,s=[],u=[],c;t.extend(this,{init:function(t){var o=this,a=o.getRuntime(),s;c=t,u=t.accept.mimes||r.extList2mimes(t.accept),s=a.getShimContainer(),function(){var e,r,u;e=n.get(t.browse_button),a.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),r=parseInt(n.getStyle(e,"z-index"),10)||1,e.style.zIndex=r,s.style.zIndex=r-1),u=a.can("summon_file_dialog")?e:s,i.addEvent(u,"mouseover",function(){o.trigger("mouseenter")},o.uid),i.addEvent(u,"mouseout",function(){o.trigger("mouseleave")},o.uid),i.addEvent(u,"mousedown",function(){o.trigger("mousedown")},o.uid),i.addEvent(n.get(t.container),"mouseup",function(){o.trigger("mouseup")},o.uid),e=null}(),e.call(this),s=null},getFiles:function(){return s},disable:function(e){var t;(t=n.get(a))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShimContainer();i.removeAllEvents(t,this.uid),i.removeAllEvents(c&&n.get(c.container),this.uid),i.removeAllEvents(c&&n.get(c.browse_button),this.uid),t&&(t.innerHTML=""),a=s=u=c=null}})}return e.FileInput=a}),i(dt,[ct,P],function(e,t){return e.FileReader=t}),i(ft,[ct,u,f,w,p,M,y,A,I],function(e,t,n,i,r,o,a,s,u){function c(){function e(e){var t=this,i,r,a,s,u=!1;if(d){if(i=d.id.replace(/_iframe$/,""),r=n.get(i+"_form")){for(a=r.getElementsByTagName("input"),s=a.length;s--;)switch(a[s].getAttribute("type")){case"hidden":a[s].parentNode.removeChild(a[s]);break;case"file":u=!0}a=[],u||r.parentNode.removeChild(r),r=null}setTimeout(function(){o.removeEvent(d,"load",t.uid),d.parentNode&&d.parentNode.removeChild(d);var n=t.getRuntime().getShimContainer();n.children.length||n.parentNode.removeChild(n),n=d=null,e()},1)}}var c,l,d;t.extend(this,{send:function(u,f){function p(){var n=m.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='<iframe id="'+g+'_iframe" name="'+g+'_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>',d=r.firstChild,n.appendChild(d),o.addEvent(d,"load",function(){var n;try{n=d.contentWindow.document||d.contentDocument||window.frames[d.id].document,/^4d{2}s/.test(n.title)&&n.getElementsByTagName("address").length?c=n.title.replace(/^(d+).*$/,"$1"):(c=200,l=t.trim(n.body.innerHTML),h.trigger({type:"progress",loaded:l.length,total:l.length}),E&&h.trigger({type:"uploadprogress",loaded:E.size||1025,total:E.size||1025}))}catch(r){if(!i.hasSameOrigin(u.url))return e.call(h,function(){h.trigger("error")}),void 0;c=404}e.call(h,function(){h.trigger("load")})},h.uid)}var h=this,m=h.getRuntime(),g,v,y,E;if(c=l=null,f instanceof s&&f.hasBlob()){if(E=f.getBlob(),g=E.uid,y=n.get(g),v=n.get(g+"_form"),!v)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else g=t.guid("uid_"),v=document.createElement("form"),v.setAttribute("id",g+"_form"),v.setAttribute("method",u.method),v.setAttribute("enctype","multipart/form-data"),v.setAttribute("encoding","multipart/form-data"),v.setAttribute("target",g+"_iframe"),m.getShimContainer().appendChild(v);f instanceof s&&f.each(function(e,n){if(e instanceof a)y&&y.setAttribute("name",n);else{var i=document.createElement("input");t.extend(i,{type:"hidden",name:n,value:e}),v.appendChild(i)}}),v.setAttribute("action",u.url),p(),v.submit(),h.trigger("loadstart")},getStatus:function(){return c},getResponse:function(e){if("json"===e&&"string"===t.typeOf(l))try{return u(l.replace(/^s*<pre[^>]*>/,"").replace(/</pre>s*$/,""))}catch(n){return null}return l},abort:function(){var t=this;d&&d.contentWindow&&(d.contentWindow.stop?d.contentWindow.stop():d.contentWindow.document.execCommand?d.contentWindow.document.execCommand("Stop"):d.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=c}),i(pt,[ct,X],function(e,t){return e.Image=t}),a([u,c,l,d,f,p,h,m,g,v,y,E,R,_,x,w,b,T,A,S,O,I,D,M])}(this);(function(){"use strict";var e={},t=moxie.core.utils.Basic.inArray;return function n(r){var i,s;for(i in r)s=typeof r[i],s==="object"&&!~t(i,["Exceptions","Env","Mime"])?n(r[i]):s==="function"&&(e[i]=r[i])}(window.moxie),e.Env=window.moxie.core.utils.Env,e.Mime=window.moxie.core.utils.Mime,e.Exceptions=window.moxie.core.Exceptions,window.mOxie=e,window.o||(window.o=e),e})()
?>
Онлайн: 0
Реклама