//>>built
define("dojox/io/xhrPlugins",["dojo/_base/kernel","dojo/_base/xhr","dojo/AdapterRegistry"],function(b,m,n){function e(){return k=dojox.io.xhrPlugins.plainXhr=k||b._defaultXhr||m}b.getObject("io.xhrPlugins",!0,dojox);var d,k;dojox.io.xhrPlugins.register=function(){var g=e();d||(d=new n,b[b._defaultXhr?"_defaultXhr":"xhr"]=function(b,c,a){return d.match.apply(d,arguments)},d.register("xhr",function(b,c){if(!c.url.match(/^\w*:\/\//))return!0;var a=window.location.href.match(/^.*?\/\/.*?\//)[0];return c.url.substring(0,
a.length)==a},g));return d.register.apply(d,arguments)};dojox.io.xhrPlugins.addProxy=function(g){var h=e();dojox.io.xhrPlugins.register("proxy",function(b,a){return!0},function(c,a,p){a.url=g+encodeURIComponent(a.url);return h.call(b,c,a,p)})};var f;dojox.io.xhrPlugins.addCrossSiteXhr=function(g,h){var c=e();if(void 0===f&&window.XMLHttpRequest)try{(new XMLHttpRequest).open("GET","http://testing-cross-domain-capability.com",!0),f=!0,b.config.noRequestedWithHeaders=!0}catch(a){f=!1}dojox.io.xhrPlugins.register("cs-xhr",
function(a,b){return(f||window.XDomainRequest&&!0!==b.sync&&("GET"==a||"POST"==a||h))&&b.url.substring(0,g.length)==g},f?c:function(){var a=b._xhrObj;b._xhrObj=function(){function a(a,c){return function(){b.readyState=c;b.status=a}}var b=new XDomainRequest;b.readyState=1;b.setRequestHeader=function(){};b.getResponseHeader=function(a){return"Content-Type"==a?b.contentType:null};b.onload=a(200,4);b.onprogress=a(200,3);b.onerror=a(404,4);return b};var c=(h?h(e()):e()).apply(b,arguments);b._xhrObj=a;
return c})};dojox.io.xhrPlugins.fullHttpAdapter=function(g,h){return function(c,a,d){var e={},f={};"GET"!=c&&(f["http-method"]=c,a.putData&&h&&(e["http-content"]=a.putData,delete a.putData,d=!1),a.postData&&h&&(e["http-content"]=a.postData,delete a.postData,d=!1),c="POST");for(var l in a.headers){var k=l.match(/^X-/)?l.substring(2).replace(/-/g,"_").toLowerCase():"http-"+l;f[k]=a.headers[l]}a.query=b.objectToQuery(f);b._ioAddQueryToUrl(a);a.content=b.mixin(a.content||{},e);return g.call(b,c,a,d)}};
return dojox.io.xhrPlugins});