//>>built
define("dojo/promise/instrumentation",["./tracer","../has","../_base/lang","../_base/array"],function(e,i,g,j){function k(c,a){a&&a.stack&&a.stack.split("\n").slice(1).join("\n").replace(/^\s+/," ")}function m(c,a,b,d){a||k(c,b,d)}function n(c,a,b,e){j.some(d,function(b){if(b.error===c){if(a)b.handled=!0;return!0}})||d.push({error:c,rejection:b,handled:a,deferred:e,timestamp:(new Date).getTime()});h||(h=setTimeout(l,f))}function l(){var c=(new Date).getTime(),a=c-f;d=j.filter(d,function(b){return b.timestamp<
a?(b.handled||k(b.error,b.rejection,b.deferred),!1):!0});h=d.length?setTimeout(l,d[0].timestamp+f-c):!1}i.add("config-useDeferredInstrumentation","report-unhandled-rejections");var d=[],h=!1,f=1E3;return function(c){var a=i("config-useDeferredInstrumentation");if(a){e.on("resolved",g.hitch(console,"log","resolved"));e.on("rejected",g.hitch(console,"log","rejected"));e.on("progress",g.hitch(console,"log","progress"));var b=[];"string"===typeof a&&(b=a.split(","),a=b.shift());if("report-rejections"===
a)c.instrumentRejected=m;else if("report-unhandled-rejections"===a||!0===a||1===a)c.instrumentRejected=n,f=parseInt(b[0],10)||f;else throw Error("Unsupported instrumentation usage <"+a+">");}}});