YUI.add("io-nodejs",function(t,e){var r,u;t.IO.request||(t.IO.request=require("request").defaults({jar:!1})),r=require("http").STATUS_CODES,u=function(t){var s=[];return Object.keys(t).forEach(function(e){s.push(e+": "+t[e])}),s.join("\n")},t.IO.transports.nodejs=function(){return{send:function(s,e,o){return o.notify("start",s,o),o.method=o.method||"GET",o.method=o.method.toUpperCase(),e={method:o.method,uri:e},o.data&&(t.Lang.isString(o.data)&&(e.body=o.data),e.body&&"GET"===e.method&&(e.uri+=(-1<e.uri.indexOf("?")?"&":"?")+e.body,e.body="")),o.headers&&(e.headers=o.headers),o.timeout&&(e.timeout=o.timeout),o.request&&t.mix(e,o.request),t.IO.request(e,function(e,t){if(e)return s.c=e,void o.notify("ETIMEDOUT"===e.code?"timeout":"failure",s,o);t&&(s.c={status:t.statusCode,statusCode:t.statusCode,statusText:r[t.statusCode],headers:t.headers,responseText:t.body||"",responseXML:null,getResponseHeader:function(e){return this.headers[e]},getAllResponseHeaders:function(){return u(this.headers)}}),o.notify("complete",s,o),o.notify(t&&200<=t.statusCode&&t.statusCode<=299?"success":"failure",s,o)}),{io:s}}}},t.IO.defaultTransport("nodejs")},"patched-v3.18.3",{requires:["io-base"]});