//>>built
define("dojo/request/iframe","module,require,./watch,./util,./handlers,../_base/lang,../io-query,../query,../has,../dom,../dom-construct,../_base/window,../NodeList-dom".split(","),function(y,z,A,o,B,u,w,C,p,x,q,d){function D(){return!this.isFulfilled()}function E(){return!!this._finished}function F(a,b){if(!b)try{var f=a.options,i=c.doc(c._frame),e=f.handleAs;if("html"!==e){if("xml"===e)if("html"===i.documentElement.tagName.toLowerCase()){C("a",i.documentElement).orphan();var d=i.documentElement.innerText,
d=d.replace(/>\s+</g,"><");a.text=u.trim(d)}else a.data=i;else a.text=i.getElementsByTagName("textarea")[0].value;B(a)}else a.data=i}catch(g){b=g}b?this.reject(b):this._finished?this.resolve(a):this.reject(Error("Invalid dojo/request/iframe request state"))}function G(){this._callNext()}function c(a,b,f){var d=o.parseArgs(a,o.deepCreate(H,b),!0),a=d.url,b=d.options;if("GET"!==b.method&&"POST"!==b.method)throw Error(b.method+" not supported by dojo/request/iframe");if(!c._frame)c._frame=c.create(c._iframeName,
v+"();");a=o.deferred(d,null,D,E,F,G);a._callNext=function(){if(!this._calledNext)this._calledNext=!0,c._currentDfd=null,c._fireNextRequest()};a._legacy=f;c._dfdQueue.push(a);c._fireNextRequest();A(a);return f?a:a.promise}var r=y.id.replace(/[\/\.\-]/g,"_"),v=r+"_onload";d.global[v]||(d.global[v]=function(){var a=c._currentDfd;if(a){var b=x.byId(a.response.options.form)||a._tmpForm;if(b){for(var f=a._contentToClean,d=0;d<f.length;d++)for(var e=f[d],j=0;j<b.childNodes.length;j++){var g=b.childNodes[j];
if(g.name===e){q.destroy(g);break}}a._originalAction&&b.setAttribute("action",a._originalAction);if(a._originalMethod)b.setAttribute("method",a._originalMethod),b.method=a._originalMethod;if(a._originalTarget)b.setAttribute("target",a._originalTarget),b.target=a._originalTarget}a._tmpForm&&(q.destroy(a._tmpForm),delete a._tmpForm);a._finished=!0}else c._fireNextRequest()});var H={method:"POST"};c.create=function(a,b,c){if(d.global[a])return d.global[a];if(d.global.frames[a])return d.global.frames[a];
c||(p("config-useXDomain")&&p("config-dojoBlankHtmlUrl"),c=p("config-dojoBlankHtmlUrl")||z.toUrl("dojo/resources/blank.html"));b=q.place('<iframe id="'+a+'" name="'+a+'" src="'+c+'" onload="'+b+'" style="position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden">',d.body());return d.global[a]=b};c.doc=function(a){if(a.contentDocument)return a.contentDocument;var b=a.name;if(b){var c=d.doc.getElementsByTagName("iframe");if(a.document&&c[b].contentWindow&&c[b].contentWindow.document)return c[b].contentWindow.document;
if(d.doc.frames[b]&&d.doc.frames[b].document)return d.doc.frames[b].document}return null};c.setSrc=function(a,b,c){a=d.global.frames[a.name];if(a.contentWindow)a=a.contentWindow;try{c?a.location.replace(b):a.location=b}catch(i){}};c._iframeName=r+"_IoIframe";c._notifyStart=function(){};c._dfdQueue=[];c._currentDfd=null;c._fireNextRequest=function(){var a;try{if(!c._currentDfd&&c._dfdQueue.length){do a=c._currentDfd=c._dfdQueue.shift();while(a&&(a.canceled||a.isCanceled&&a.isCanceled())&&c._dfdQueue.length);
if(!a||a.canceled||a.isCanceled&&a.isCanceled())c._currentDfd=null;else{var b=a.response,f=b.options,i=a._contentToClean=[],e=x.byId(f.form),j=o.notify,g=f.data||null,l;!a._legacy&&"POST"===f.method&&!e?e=a._tmpForm=q.create("form",{name:r+"_form",style:{position:"absolute",top:"-1000px",left:"-1000px"}},d.body()):"GET"===f.method&&e&&-1<b.url.indexOf("?")&&(l=b.url.slice(b.url.indexOf("?")+1),g=u.mixin(w.queryToObject(l),g));if(e){if(!a._legacy){var h=e;do h=h.parentNode;while(h&&h!==d.doc.documentElement);
if(!h)e.style.position="absolute",e.style.left="-1000px",e.style.top="-1000px",d.body().appendChild(e);if(!e.name)e.name=r+"_form"}if(g){var h=function(a,b){q.create("input",{type:"hidden",name:a,value:b},e);i.push(a)},m;for(m in g){var n=g[m];if(u.isArray(n)&&1<n.length)for(l=0;l<n.length;l++)h(m,n[l]);else e[m]?e[m].value=n:h(m,n)}}var s=e.getAttributeNode("action"),k=e.getAttributeNode("method"),t=e.getAttributeNode("target");if(b.url)a._originalAction=s?s.value:null,s?s.value=b.url:e.setAttribute("action",
b.url);if(a._legacy){if(!k||!k.value)k?k.value=f.method:e.setAttribute("method",f.method)}else a._originalMethod=k?k.value:null,k?k.value=f.method:e.setAttribute("method",f.method);a._originalTarget=t?t.value:null;t?t.value=c._iframeName:e.setAttribute("target",c._iframeName);e.target=c._iframeName;j&&j.emit("send",b,a.promise.cancel);c._notifyStart(b);e.submit()}else{f="";if(b.options.data)f=b.options.data,"string"!==typeof f&&(f=w.objectToQuery(f));h=b.url+(-1<b.url.indexOf("?")?"&":"?")+f;j&&j.emit("send",
b,a.promise.cancel);c._notifyStart(b);c.setSrc(c._frame,h,!0)}}}}catch(p){a.reject(p)}};o.addCommonMethods(c,["GET","POST"]);return c});