//>>built
define("dojo/request/script","module,./watch,./util,../_base/kernel,../_base/array,../_base/lang,../on,../dom,../dom-construct,../has,../_base/window".split(","),function(l,m,h,n,o,p,q,r,s,j,t){function u(a,b){a.canDelete&&f._remove(a.id,b.options.frameDoc,!0)}function v(a){g&&g.length&&(o.forEach(g,function(a){f._remove(a.id,a.frameDoc);a.frameDoc=null}),g=[]);return a.options.jsonp?!a.data:!0}function w(){return!!this.scriptLoaded}function x(a){return(a=a.options.checkString)&&eval("typeof("+a+
') !== "undefined"')}function y(a,b){if(this.canDelete){var c=this.response.options;g.push({id:this.id,frameDoc:c.ioArgs?c.ioArgs.frameDoc:c.frameDoc});if(c.ioArgs)c.ioArgs.frameDoc=null;c.frameDoc=null}b?this.reject(b):this.resolve(a)}function f(a,b,c){var d=h.parseArgs(a,h.deepCopy({},b)),a=d.url,b=d.options,e=h.deferred(d,u,v,b.jsonp?null:b.checkString?x:w,y);p.mixin(e,{id:k+z++,canDelete:!1});if(b.jsonp)RegExp("[?&]"+b.jsonp+"=").test(a)||(a+=(~a.indexOf("?")?"&":"?")+b.jsonp+"="+(b.frameDoc?
"parent.":"")+k+"_callbacks."+e.id),e.canDelete=!0,i[e.id]=function(a){d.data=a;e.handleResponse(d)};h.notify&&h.notify.emit("send",d,e.promise.cancel);if(!b.canAttach||b.canAttach(e)){var g=f._attach(e.id,a,b.frameDoc);if(!b.jsonp&&!b.checkString)var j=q(g,A,function(a){if("load"===a.type||B.test(g.readyState))j.remove(),e.scriptLoaded=a})}m(e);return c?e:e.promise}j.add("script-readystatechange",function(a,b){return"undefined"!==typeof b.createElement("script").onreadystatechange&&("undefined"===
typeof a.opera||"[object Opera]"!==a.opera.toString())});var k=l.id.replace(/[\/\.\-]/g,"_"),z=0,A=j("script-readystatechange")?"readystatechange":"load",B=/complete|loaded/,i=n.global[k+"_callbacks"]={},g=[];f.get=f;f._attach=function(a,b,c){var c=c||t.doc,d=c.createElement("script");d.type="text/javascript";d.src=b;d.id=a;d.async=!0;d.charset="utf-8";return c.getElementsByTagName("head")[0].appendChild(d)};f._remove=function(a,b,c){s.destroy(r.byId(a,b));i[a]&&(c?i[a]=function(){delete i[a]}:delete i[a])};
f._callbacksProperty=k+"_callbacks";return f});