AUI.add("aui-io-request",function(k){var e=k.Lang,m=e.isBoolean,l=e.isFunction,G=e.isString,C=YUI.AUI.namespace("defaults.io"),h=function(A){return function(){return C[A];};},s="active",b="arguments",u="autoLoad",n="cache",D="cfg",p="complete",c="content-type",v="context",j="data",J="dataType",g="",M="end",o="failure",a="form",q="get",i="headers",K="IORequest",d="json",t="method",r="responseData",w="start",E="success",y="sync",x="timeout",z="transaction",B="uri",H="xdr",N="xml",f="Parser error: IO dataType is not correctly parsing",I={all:"*/*",html:"text/html",json:"application/json, text/javascript",text:"text/plain",xml:"application/xml, text/xml"};var F=k.Component.create({NAME:K,ATTRS:{autoLoad:{value:true,validator:m},cache:{value:true,validator:m},dataType:{setter:function(A){return(A||g).toLowerCase();},value:null,validator:G},responseData:{setter:function(A){return this._setResponseData(A);},value:null},uri:{setter:function(A){return this._parseURL(A);},value:null,validator:G},active:{value:false,validator:m},cfg:{getter:function(){var A=this;return{arguments:A.get(b),context:A.get(v),data:A.get(j),form:A.get(a),headers:A.get(i),method:A.get(t),on:{complete:k.bind(A.fire,A,p),end:k.bind(A._end,A),failure:k.bind(A.fire,A,o),start:k.bind(A.fire,A,w),success:k.bind(A._success,A)},sync:A.get(y),timeout:A.get(x),xdr:A.get(H)};},readOnly:true},transaction:{value:null},arguments:{valueFn:h(b)},context:{valueFn:h(v)},data:{valueFn:h(j),setter:"_setIOData"},form:{valueFn:h(a)},headers:{getter:function(O){var P=[];var A=this;var L=A.get(J);if(L){P.push(I[L]);}P.push(I.all);return k.merge(O,{Accept:P.join(", ")});},valueFn:h(i)},method:{valueFn:h(t)},selector:{value:null},sync:{valueFn:h(y)},timeout:{valueFn:h(x)},xdr:{valueFn:h(H)}},EXTENDS:k.Plugin.Base,prototype:{init:function(L){var A=this;F.superclass.init.apply(this,arguments);A._autoStart();},destructor:function(){var A=this;A.stop();A.set(z,null);},start:function(){var A=this;A.destructor();A.set(s,true);var L=k.io(A.get(B),A.get(D));A.set(z,L);},stop:function(){var A=this;var L=A.get(z);if(L){L.abort();}},_autoStart:function(){var A=this;if(A.get(u)){A.start();}},_parseURL:function(Q){var A=this;var O=A.get(n);var S=A.get(t);if((O===false)&&(S==q)){var R=+new Date;var P=Q.replace(/(\?|&)_=.*?(&|$)/,"$1_="+R+"$2");Q=P+((P==Q)?(Q.match(/\?/)?"&":"?")+"_="+R:"");}var L=C.uriFormatter;if(l(L)){Q=L.apply(A,[Q]);}return Q;},_end:function(L){var A=this;A.set(s,false);A.set(z,null);A.fire(M,L);},_success:function(O,L){var A=this;A.set(r,L);A.fire(E,O,L);},_setIOData:function(O){var A=this;var L=C.dataFormatter;if(l(L)){O=L.call(A,O);}return O;},_setResponseData:function(T){var Q=null;var L=this;if(T){var O=L.get(J);var S=T.getResponseHeader(c);if((O==N)||(!O&&S.indexOf(N)>=0)){Q=T.responseXML;if(Q.documentElement.tagName=="parsererror"){throw f;}}else{Q=T.responseText;}if(Q===g){Q=null;}if(O==d){try{Q=k.JSON.parse(Q);}catch(R){}}else{var A=L.get("selector");if(Q&&A){var P;if(Q.documentElement){P=k.one(Q);}else{P=k.Node.create(Q);}Q=P.all(A);}}}return Q;}}});k.IORequest=F;k.io.request=function(L,A){return new k.IORequest(k.merge(A,{uri:L}));};},"1.0.1",{requires:["aui-base","io-base","json","plugin","querystring-stringify"]});