function g(t){var n=this.constructor;return this.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){return n.reject(e)})})}function w(t){var n=this;return new n(function(e,r){if(!(t&&typeof t.length!="undefined"))return r(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(t);if(i.length===0)return e([]);var h=i.length;function f(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var s=c.then;if(typeof s=="function"){s.call(c,function(y){f(u,y)},function(y){i[u]={status:"rejected",reason:y},--h===0&&e(i)});return}}i[u]={status:"fulfilled",value:c},--h===0&&e(i)}for(var a=0;a