//>>built
define(["dijit","dojo","dojox","dojo/require!dojo/io/script,dojo/io/iframe,dojox/xml/parser"],function(_1,_2,_3){
_2.provide("dojox.xmpp.bosh");
_2.require("dojo.io.script");
_2.require("dojo.io.iframe");
_2.require("dojox.xml.parser");
_3.xmpp.bosh={transportIframes:[],initialize:function(_4){
this.transportIframes=[];
var _5=_3._scopeName+".xmpp.bosh";
var c=_2.connect(_2.getObject(_5),"_iframeOnload",this,function(_6){
if(_6==0){
_4.load();
_2.disconnect(c);
}
});
for(var i=0;i<_4.iframes;i++){
var _7="xmpp-transport-"+i;
var _8=_2.byId("xmpp-transport-"+i);
if(_8){
if(window[_7]){
window[_7]=null;
}
if(window.frames[_7]){
window.frames[_7]=null;
}
_2.destroy(_8);
}
_8=_2.io.iframe.create("xmpp-transport-"+i,_5+"._iframeOnload("+i+");");
this.transportIframes.push(_8);
}
},_iframeOnload:function(_9){
var _a=_2.io.iframe.doc(_2.byId("xmpp-transport-"+_9));
_a.write("");
},findOpenIframe:function(){
for(var i=0;i0){
for(var i=0;i<_1c.length;i++){
_1b.remove(_1c[i].id,_1c[i].frameDoc);
_1c[i].frameDoc=null;
}
_3.xmpp.bosh._deadScripts=[];
}
return true;
},_ioCheck:function(dfd){
var _1d=dfd.ioArgs;
if(_1d.xmppMessage){
return true;
}
return false;
},_resHandle:function(dfd){
if(_3.xmpp.bosh._ioCheck(dfd)){
dfd.callback(dfd);
}else{
dfd.errback(new Error("inconceivable dojox.xmpp.bosh._resHandle error"));
}
}};
});