@goatlab/fluent-formio 0.2.2 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 FAO
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/Makefile DELETED
@@ -1,2 +0,0 @@
1
- link:
2
- npm link && npm link @goatlab/goat-fluent && npm run dev
@@ -1,2 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("axios")):"function"==typeof define&&define.amd?define("@goatlab/fluent-formio",["axios"],t):"object"==typeof exports?exports["@goatlab/fluent-formio"]=t(require("axios")):e["@goatlab/fluent-formio"]=t(e.axios)}(this,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(t,r){t.exports=e},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c,u=[],l=!1,f=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&h())}function h(){if(!l){var e=s(p);l=!0;for(var t=u.length;t;){for(c=u,u=[];++f<t;)c&&c[f].run();f=-1,t=u.length}c=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new d(e,t)),1!==u.length||l||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=r(4),i=(n=o)&&n.__esModule?n:{default:n};t.default=i.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(o)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=l(r(5)),a=l(r(6)),s=l(r(1)),c=r(7),u=l(r(9));function l(e){return e&&e.__esModule?e:{default:e}}function f(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(o,i){try{var a=t[o](i),s=a.value}catch(e){return void r(e)}if(!a.done)return Promise.resolve(s).then(function(e){n("next",e)},function(e){n("throw",e)});e(s)}("next")})}}t.default=c.Interface.compose({methods:{getToken:function(){return localStorage.getItem("formioToken")},baseUrl:function(){var e=this.connector,t=e.baseUrl,r=e.name;if(!t)throw new Error('You did not provide a baseUrl for the "'+r+'" connector');return t.replace(/\/+$/,"")},get:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var r,n,a,s;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.ownerId&&e.andWhere("owner","=",e.ownerId),r=void 0,n=void 0,t.next=5,(0,i.default)(e.httpGET());case 5:if(a=t.sent,s=o(a,2),r=s[0],n=s[1],!r){t.next=12;break}throw console.log(r),new Error("Error while getting submissions");case 12:return n=e.jsApplySelect(n&&n.data),n=e.jsApplyOrderBy(n),t.abrupt("return",n);case 15:case"end":return t.stop()}},t,e)}))()},all:function(){var e=this;return f(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.get());case 1:case"end":return t.stop()}},t,e)}))()},numberOfRows:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var r,n,o,i,a,c;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.getUrl(),n=e.getHeaders(),o=e.getFilters(),"?limit=1",i=e.getSkip(),a=e.getSelect(),"",r+="?limit=1",r=o?r+e.getSpacer(r)+o:r,r=i?r+e.getSpacer(r)+i:r,r=a?r+e.getSpacer(r)+a:r,t.next=13,u.default.isOnline();case 13:if(t.sent){t.next=16;break}throw new Error("Cannot make get request to "+r+".You are not online");case 16:return t.next=18,s.default.get(r,{headers:n});case 18:return c=t.sent,t.abrupt("return",c.headers["content-range"].split("/")[1]);case 20:case"end":return t.stop()}},t,e)}))()},paginate:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.numberOfRows();case 2:return n=r.sent,t.offset((e.page-1)*e.rowsPerPage).take(e.rowsPerPage),o={},r.next=7,t.get();case 7:return o.data=r.sent,o.paginator={page:e.page,rowsPerPage:e.rowsPerPage,rowsNumber:n},console.log("paginator",o),r.abrupt("return",o);case 11:case"end":return r.stop()}},r,t)}))()},insert:function(e,t){var r=this;return f(regeneratorRuntime.mark(function n(){var a,s,c,u;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(e)){n.next=2;break}return n.abrupt("return",r.ArrayInsert(e,t));case 2:return n.next=4,(0,i.default)(r.httpPOST(e));case 4:if(a=n.sent,s=o(a,2),c=s[0],u=s[1],!c){n.next=10;break}throw new Error("Cannot insert data");case 10:return n.abrupt("return",u.data);case 11:case"end":return n.stop()}},n,r)}))()},update:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n,a,s,c;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(e._id){r.next=2;break}throw new Error("Formio connector error. Cannot update a Model without _id key");case 2:if(!e._id.includes("_local")){r.next=4;break}throw new Error("Formio connector error. Cannot update a local document");case 4:return r.next=6,(0,i.default)(t.httpPUT(e));case 6:if(n=r.sent,a=o(n,2),s=a[0],c=a[1],!s){r.next=13;break}throw console.log(s),new Error("Cannot insert data");case 13:return r.abrupt("return",c.data);case 14:case"end":return r.stop()}},r,t)}))()},clear:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var r,n,a,c,u,l=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).sure;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(l&&!0===l){t.next=2;break}throw new Error('Clear() method will delete everything!, you must set the "sure" parameter "clear({sure:true})" to continue');case 2:return r=[],t.next=5,(0,i.default)(e.select("_id").pluck("_id"));case 5:if(n=t.sent,a=o(n,2),c=a[0],u=a[1],!c){t.next=12;break}throw console.log(c),new Error("Cannot get remote Model");case 12:return u.forEach(function(t){r.push(e.httpDelete(t))}),t.abrupt("return",s.default.all(r));case 14:case"end":return t.stop()}},t,e)}))()},remove:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n,a,s,c;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,i.default)(t.httpDelete(e));case 2:if(n=r.sent,a=o(n,2),s=a[0],c=a[1],!s){r.next=9;break}throw console.log(s),new Error("FormioConnector: Could not delete "+e);case 9:return r.abrupt("return",c);case 10:case"end":return r.stop()}},r,t)}))()},find:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var a,s,c,u;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if("string"==typeof e){r.next=2;break}throw new Error('Formio connector find() method only accepts strings "'+(void 0===e?"undefined":n(e))+'" given "'+e+'"');case 2:return r.next=4,(0,i.default)(t.where("_id","=",e).first());case 4:if(a=r.sent,s=o(a,2),c=s[0],u=s[1],!c){r.next=11;break}throw console.log(c),new Error("Find() could not get remote data");case 11:return r.abrupt("return",u);case 12:case"end":return r.stop()}},r,t)}))()},getUrl:function(){var e=this,t=this&&this.baseUrl()?this.baseUrl():void 0,r=a.default.get(function(){return e.remoteConnection.path},void 0),n=a.default.get(function(){return e.remoteConnection.id},void 0);if(!a.default.get(function(){return e.remoteConnection.pullForm},void 0)&&r&&(r=n?r+"/submission/"+n:r+"/submission"),!t)throw new Error("Cannot get remote model. baseUrl not defined");return r?t+"/"+r:t},getHeaders:function(){var e={},t={};return"undefined"!=typeof localStorage&&(t=localStorage.getItem("formioToken")),(this.remoteConnection.token||""===this.remoteConnection.token)&&(t=this.remoteConnection.token),t?(e[this.getTokenType(t)]=t,e):e},getSpacer:function(e){return"&"===e.substr(e.length-1)?"":"&"},httpGET:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var r,n,o,i,a,c;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.getUrl(),n=e.getHeaders(),o=e.getFilters(),i=e.getLimit(),a=e.getSkip(),c=e.getSelect(),"",r=r+""+i,r=o?r+e.getSpacer(r)+o:r,r=a?r+e.getSpacer(r)+a:r,r=c?r+e.getSpacer(r)+c:r,t.next=13,u.default.isOnline();case 13:if(t.sent){t.next=16;break}throw new Error("Cannot make get request to "+r+".You are not online");case 16:return t.abrupt("return",s.default.get(r,{headers:n}));case 17:case"end":return t.stop()}},t,e)}))()},httpPOST:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.getUrl(),o=t.getHeaders(),r.next=4,u.default.isOnline();case 4:if(r.sent){r.next=7;break}throw new Error("Cannot make request post to "+n+".You are not online");case 7:return r.abrupt("return",s.default.post(n,e,{headers:o}));case 8:case"end":return r.stop()}},r,t)}))()},httpPUT:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n,o,i;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,u.default.isOnline();case 2:if(n=r.sent,o=t.getUrl()+"/"+e._id,i=t.getHeaders(),n){r.next=7;break}throw new Error("Cannot make request post to "+o+".You are not online");case 7:return r.abrupt("return",s.default.put(o,e,{headers:i}));case 8:case"end":return r.stop()}},r,t)}))()},httpDelete:function(e){var t=this.getHeaders(),r=this.getUrl()+"/"+e;return s.default.delete(r,{headers:t})},getTokenType:function(e){return e.length>32?"x-jwt-token":"x-token"},getFilters:function(){var e=this.whereArray;if(e&&0!==e.length){var t="";return e.forEach(function(e){var r="",n=e[0],o=e[1],i=e[2];switch(o){case"=":t=t+n+"="+i+"&";break;case"!=":t=t+n+"__ne="+i+"&";break;case">":t=t+n+"__gt="+i+"&";break;case">=":t=t+n+"__gte="+i+"&";break;case"<":t=t+n+"__lt="+i+"&";break;case"<=":t=t+n+"__lte="+i+"&";break;case"in":r="",i.forEach(function(e,t,n){r=t===n.length-1?r+e:r+e+","}),t=t+n+"__in="+r+"&";break;case"nin":r="",i.forEach(function(e,t,n){r=t===n.length-1?r+e:r+e+","}),t=t+n+"__nin="+r+"&";break;case"exists":t=t+n+"__exists="+!0+"&";break;case"!exists":t=t+n+"__exists="+!1+"&";break;case"regex":t=t+n+"__regex="+i+"&"}}),t.substring(0,t.length-1)}},getLimit:function(){return this.limitNumber&&0!==this.limitNumber||(this.limitNumber=50),"?limit="+this.limitNumber},getSkip:function(){return this.offsetNumber||(this.offsetNumber=0),"skip="+this.offsetNumber},getSelect:function(){var e=this.selectArray;if(e=e.map(function(e){return e.split(" as ")[0]}))return"select="+e.join(",")}}})},function(e,t,r){"use strict";function n(e,t){return e.then(function(e){return[null,e]}).catch(function(e){return t&&Object.assign(e,t),[e,void 0]})}r.r(t),r.d(t,"to",function(){return n}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i,a,s,c=(i=function(e,t){try{return e()}catch(e){return t}},a=function(e,t,r){var n=t;t.includes(" as ")&&(n=(t=t.split(" as "))[0]);var o=i(function(){return Array.isArray(t)&&t[1].trim()},void 0),a=n.replace(/\[/g,".").replace(/]/g,"").split(".").filter(Boolean).map(function(e){return e.trim()});return{label:o||n,value:a.every(function(t){return!(t&&void 0===(e=e[t]))})?e:r}},s=function e(t,r,o,i,a){t&&(i=i||"",t.forEach(function(t){if(t){var s=t.columns&&Array.isArray(t.columns),c=t.rows&&Array.isArray(t.rows),u=t.components&&Array.isArray(t.components),l=!1,f=t.key?i?i+"."+t.key:t.key:"";a&&(t.parent=n({},a),delete t.parent.components,delete t.parent.componentMap,delete t.parent.columns,delete t.parent.rows),(o||t.tree||!s&&!c&&!u)&&(l=r(t,f));var p=function(){return t.key&&!["panel","table","well","columns","fieldset","tabs","form"].includes(t.type)&&(["datagrid","container","editgrid"].includes(t.type)||t.tree)?f:t.key&&"form"===t.type?f+".data":i};l||(s?t.columns.forEach(function(n){return e(n.components,r,o,p(),a?t:null)}):c?t.rows.forEach(function(n){Array.isArray(n)&&n.forEach(function(n){return e(n.components,r,o,p(),a?t:null)})}):u&&e(t.components,r,o,p(),a?t:null))}}))},Object.freeze({cloneDeep:function(e){return JSON.parse(JSON.stringify(e))},get:i,orderBy:function(){},isEmpty:function(e){if(!e)return!0;if(Array.isArray(e)||"string"==typeof e)return!e.length;for(var t in e)if(hasOwnProperty.call(e,t))return!1;return!0},debounce:function(e,t){var r=void 0;return function(){var n=this,o=arguments;clearTimeout(r),r=setTimeout(function(){return e.apply(n,o)},t)}},getFromPath:a,deleteNulls:function e(t){var r=t,n=r instanceof Array;for(var i in r)null===r[i]?n?r.splice(i,1):delete r[i]:"object"===o(r[i])&&e(r[i]);return r},eachComponent:s,findComponents:function(e,t){var r=[];return s(e,function(e,n){(function(e,t){if("string"==typeof t)return e.key===t;var r=!1;return Object.keys(t).forEach(function(n){if(!(r=a(e,n).value===t[n]))return!1}),r})(e,t)&&(e.path=n,r.push(e))},!0),r},unixDate:function(){return Math.round(+new Date/1e3)}}));t.default=c},function(e,t,r){"use strict";(function(e){var r,n,o,i,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==(void 0===e?"undefined":a(e))&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=12)}([function(e,t,r){var n=r(2),o=r(16),i=r(6),a=r(17),s=r(1),c=r(3),u=r(8),l=r(7),f=Array.prototype.concat;function p(){var e=f.apply([],arguments).filter(c);return 0===e.length?void 0:e}function h(e){if(!s(e))return e;var t=e.methods,r=e.properties,n=e.props,o=e.initializers,i=e.init,c=e.composers,f=e.deepProperties,h=e.deepProps,d=e.propertyDescriptors,v=e.staticProperties,_=e.statics,y=e.staticDeepProperties,m=e.deepStatics,g=e.configuration,b=e.conf,w=e.deepConfiguration,C=e.deepConf,E=s(n)||s(r)?l({},n,r):void 0,k=s(h)?u({},h):void 0;k=s(f)?u(k,f):k;var j=s(_)||s(v)?l({},_,v):void 0,x=s(m)?u({},m):void 0;x=s(y)?u(x,y):x;var F=e.staticPropertyDescriptors;a(e.name)&&(F=l({},F||{},{name:{value:e.name}}));var P=s(b)||s(g)?l({},b,g):void 0,T=s(C)?u({},C):void 0;T=s(w)?u(T,w):T;var O=p(i,o),A=p(c),S={};return t&&(S.methods=t),E&&(S.properties=E),O&&(S.initializers=O),A&&(S.composers=A),k&&(S.deepProperties=k),j&&(S.staticProperties=j),x&&(S.staticDeepProperties=x),d&&(S.propertyDescriptors=d),F&&(S.staticPropertyDescriptors=F),P&&(S.configuration=P),T&&(S.deepConfiguration=T),S}function d(){for(var e=arguments.length,t=[],r=0;r<e;r+=1){var o=arguments[r];t.push(i(o)?o:h(o))}return n.apply(this||v,t)}var v=o.compose({staticProperties:{create:function(){return this.apply(this,arguments)},compose:d}}),_=o.compose.staticProperties;for(var y in _)d[y]=_[y].bind(v);d.compose=d.bind(),e.exports=d},function(e,t){e.exports=function(e){var t=void 0===e?"undefined":a(e);return Boolean(e)&&("object"===t||"function"===t)}},function(e,t,r){var n=r(5),o=r(3),i=r(1),a=r(6),s=r(14),c=r(7),u=r(8),l=Array.prototype.slice;function f(e,t){var r=function e(t){var r=e.compose||{},n={__proto__:r.methods};if(u(n,r.deepProperties),c(n,r.properties),Object.defineProperties(n,r.propertyDescriptors||{}),!r.initializers||0===r.initializers.length)return n;void 0===t&&(t={});for(var i=r.initializers,a=i.length,s=0;s<a;s+=1){var f=i[s];if(o(f)){var p=f.call(n,t,{instance:n,stamp:e,args:l.apply(arguments)});n=void 0===p?n:p}}return n};e.staticDeepProperties&&u(r,e.staticDeepProperties),e.staticProperties&&c(r,e.staticProperties),e.staticPropertyDescriptors&&Object.defineProperties(r,e.staticPropertyDescriptors);var n=o(r.compose)?r.compose:t;return c(r.compose=function(){return n.apply(this,arguments)},e),r}function p(e,t,r){if(n(t)){var i=t.length,a=e[r]||[];e[r]=a;for(var s=0;s<i;s+=1){var c=t[s];o(c)&&a.indexOf(c)<0&&a.push(c)}}}function h(e,t,r,n){i(t[r])&&(i(e[r])||(e[r]={}),n(e[r],t[r]))}function d(e,t,r){h(e,t,r,u)}function v(e,t,r){h(e,t,r,c)}function _(e,t){var r=t&&t.compose||t;v(e,r,"methods"),v(e,r,"properties"),d(e,r,"deepProperties"),v(e,r,"propertyDescriptors"),v(e,r,"staticProperties"),d(e,r,"staticDeepProperties"),v(e,r,"staticPropertyDescriptors"),v(e,r,"configuration"),d(e,r,"deepConfiguration"),p(e,r.initializers,"initializers"),p(e,r.composers,"composers")}e.exports=function e(){var t={},r=[];s(this)&&(_(t,this),r.push(this));for(var o=0;o<arguments.length;o++){var i=arguments[o];s(i)&&(_(t,i),r.push(i))}var c=f(t,e),u=t.composers;if(n(u)&&u.length>0)for(var l=0;l<u.length;l+=1){var p=(0,u[l])({stamp:c,composables:r});c=a(p)?p:c}return c}},function(e,t){e.exports=function(e){return"function"==typeof e}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==("undefined"==typeof window?"undefined":a(window))&&(r=window)}e.exports=r},function(e,t){e.exports=Array.isArray},function(e,t,r){var n=r(3);e.exports=function(e){return n(e)&&n(e.compose)}},function(e,t){e.exports=Object.assign},function(e,t,r){var n=r(15),o=r(1),i=r(5);function a(e,t){if(void 0===t)return e;if(i(t))return(i(e)?e:[]).concat(t);if(!n(t))return t;for(var r=o(e)?e:{},s=Object.keys(t),c=0;c<s.length;c+=1){var u=s[c],l=t[u];if(void 0!==l){var f=r[u],p=n(f)||i(l)?f:{};r[u]=a(p,l)}}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++)e=a(e,arguments[t]);return e}},function(e,t,r){(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=i(r(0)),o=i(r(18));function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,n.default)({properties:{name:"baseModel",config:{remote:{path:void 0,token:void 0,pullForm:!1},local:{connector:"loki"},merge:{connector:"formio-loki"}}},methods:{getModelName:function(){return this.name},getFluentConfig:function(){var t=void 0;return"undefined"!=typeof window&&window&&window._FLUENT_?t=window._FLUENT_:e&&e._FLUENT_&&(t=e._FLUENT_),t},getConnector:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Array.isArray(e)?this.getConnectorFromArray(e,t,r):e instanceof Object?e:void 0},getConnectorFromArray:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(1===e.length)return e[0];if(this.config&&this.config[t]&&this.config[t].connector){var o=e.find(function(e){return e.name===r.config[t].connector});if(o instanceof Object)return o}if(n){var i=e.find(function(e){return e.name===n});if(i instanceof Object)return i}var a=e.find(function(e){return e.default});return a instanceof Object?a:void 0},remote:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.token,r=void 0===t?void 0:t,n=e.pullForm,o=void 0===n?void 0:n,i=e.connectorName,a=void 0===i?void 0:i,s=this.getFluentConfig(),c=s&&s.connectors&&s.connectors.remote;if(!c)throw new Error("No remote connector was defined. Please define it using Fluent.config()");var u=this.getConnector(c,"remote",a||!1);if(this.config.remote.token=r||this.config.remote.token,o&&(this.config.remote.pullForm=o||this.config.remote.pullForm),u)return u.connector({remoteConnection:this.config.remote,connector:u});throw new Error("No default remote connector found. Please assign one as your default in Fluent.config")},local:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).connectorName,t=void 0===e?void 0:e,r=this.getFluentConfig(),n=r&&r.connectors&&r.connectors.local;if(!n)throw new Error("No local connector was defined. Please define it using Fluent.config()");var o=this.getConnector(n,"local",t||!1);if(o)return o.connector({name:this.name,connector:o});throw new Error("No default local connector found. Please assign one as your default in Fluent.config")},merged:function(){var e=this.local(),t=this.remote(),r=this.getFluentConfig(),n=r&&r.connectors&&r.connectors.merge;if(!n)throw new Error("No merge connector was defined. Please define it using Fluent.config()");var o=this.getConnector(n,"merge");if(o)return o.connector({local:e,remote:t,name:this.name,connector:o});throw new Error("No default merge connector found. Please assign one as your default in Fluent.config")}}}).compose(o.default)}).call(this,r(4))},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=a(r(0)),i=a(r(11));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}t.default=(0,o.default)({init:function(e){if(!Array.isArray(e))throw new Error("Collect method only accepts arrays of data");this.data=e},properties:{data:[]},methods:{get:function(){return this.data},all:function(){return this.get()},avg:function(e){return this.average(e)},average:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=[].concat(s(this.data)),r=t.reduce(function(t,r){var n=r;if(r instanceof Object){var o=i.default.getFromPath(r,e,void 0);void 0!==o&&o.value&&(n=o.value)}return t+n},0);try{return r/t.length}catch(e){throw new Error('Division between "'+r+'" and "'+t.length+'" is not valid.')}},chunkApply:function(e,t){var r,n=this;return(r=regeneratorRuntime.mark(function r(){var o,i,a,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==t){r.next=2;break}throw new Error("Callback function not defined.");case 2:return o=n.data.length,i=0,n.chunks(e),a=function(r,n){return r.then(function(){return Promise.all(n.map(function(e){return t(e)}))}).then(function(){i=i+e>o?o:i+e,console.log("Processed "+i+"/"+o+" elements...")})},console.log("Processed "+i+"/"+o+" elements..."),s=n.data.reduce(a,Promise.resolve()),r.abrupt("return",s);case 9:case"end":return r.stop()}},r,n)}),function(){var e=r.apply(this,arguments);return new Promise(function(t,r){return function n(o,i){try{var a=e[o](i),s=a.value}catch(e){return void r(e)}if(!a.done)return Promise.resolve(s).then(function(e){n("next",e)},function(e){n("throw",e)});t(s)}("next")})})()},chunks:function(e){for(var t=[].concat(s(this.data)),r=[];t.length;)r.push(t.splice(0,e));return this.data=r,this},collapse:function(){var e=[].concat(s(this.data)),t=[];return e.forEach(function(e){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}),this.data=t,this},unChunk:function(){return this.collapse()},combine:function(e){var t=[].concat(s(this.data)),r=void 0;return t.forEach(function(t,o){t instanceof Object?(r||(r=[]),r[o]=n({},t,{_value:e[o]})):(r||(r={}),r[t]=e[o])}),this.data=r,this},concat:function(e){return this.data=[].concat(s(this.data),s(e)),this},contains:function(){var e=void 0,t=void 0,r=void 0;return 1===arguments.length?(this.isFunction(arguments.length<=0?void 0:arguments[0])&&(r=arguments.length<=0?void 0:arguments[0]),e=arguments.length<=0?void 0:arguments[0]):(e=arguments.length<=1?void 0:arguments[1],t=arguments.length<=0?void 0:arguments[0]),[].concat(s(this.data)).some(function(n,o){if(r)return!!r(n,o);var a=n;if(n instanceof Object){var s=i.default.getFromPath(n,t,void 0);s.value&&(a=s.value)}return a===e})},duplicatesBy:function(e){var t=[].concat(s(this.data)),r=[];return t.reduce(function(t,n){var o=e.reduce(function(e,t){return e+i.default.getFromPath(n,t,"").value},"");return t.hasOwnProperty(o)?r.push(n):t[o]=!0,t},{}),this.data=r,this},count:function(){return this.data.length},isFunction:function(e){return e&&"[object Function]"==={}.toString.call(e)}}})},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n,o=(n=function(e,t){try{return e()}catch(e){return t}},Object.freeze({get:n,getFromPath:function(e,t,r){var o=t;t.includes(" as ")&&(o=(t=t.split(" as "))[0]);var i=n(function(){return Array.isArray(t)&&t[1].trim()},void 0),a=o.replace(/\[/g,".").replace(/]/g,"").split(".").filter(Boolean).map(function(e){return e.trim()});return{label:i||o,value:a.every(function(t){return!(t&&void 0===(e=e[t]))})?e:r}}}));t.default=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Interface=t.Fluent=t.Model=void 0;var n=a(r(13)),o=a(r(9)),i=a(r(19));function a(e){return e&&e.__esModule?e:{default:e}}t.Model=o.default,t.Fluent=n.default,t.Interface=i.default},function(e,t,r){(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(0)),o=a(r(9)),i=a(r(10));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var c=(0,n.default)({init:function(){this.registerGlobalVariable()},properties:{},methods:{model:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.registerModel(t),o.default.compose.apply(o.default,s(t))},extend:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.registerModel(t),o.default.compose.apply(o.default,s(t))},compose:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.registerModel(t),o.default.compose.apply(o.default,s(t))},collect:function(e){return(0,i.default)(e)},registerGlobalVariable:function(){"undefined"!=typeof window&&window&&!window._FLUENT_&&(window._FLUENT_={connectors:{},models:{}}),e&&!e._FLUENT_&&(e._FLUENT_={connectors:{},models:{}})},registerModel:function(t){var r=t&&t[0]&&t[0].properties&&t[0].properties.name?t[0].properties.name:void 0;if(r&&"baseModel"!==r){if("string"!=typeof r)throw new Error("You must assign a name to your Model when using Fluent.compose");"undefined"==typeof window?e._FLUENT_.models[r]=!0:window._FLUENT_.models[r]=!0}},config:function(t){var r=t.REMOTE_CONNECTORS,n=void 0===r?void 0:r,o=t.LOCAL_CONNECTORS,i=void 0===o?void 0:o,a=t.MERGE_CONNECTORS,s=void 0===a?void 0:a;"undefined"!=typeof window&&window&&(window._FLUENT_.connectors={local:i,remote:n,merge:s}),void 0!==e&&e&&(e._FLUENT_.connectors={local:i,remote:n,merge:s})},getConfig:function(){return"undefined"!=typeof window&&window?window._FLUENT_:void 0!==e&&e?e._FLUENT_:void 0}}})();t.default=c}).call(this,r(4))},function(e,t,r){e.exports=r(1)},function(e,t){e.exports=function(e){return Boolean(e)&&"object"==(void 0===e?"undefined":a(e))&&Object.getPrototypeOf(e)===Object.prototype}},function(e,t,r){var n=r(2);function o(e){return function(t){var r={};return r[e]=t,this&&this.compose?this.compose(r):n(r)}}var i=o("properties"),a=o("staticProperties"),s=o("configuration"),c=o("deepProperties"),u=o("staticDeepProperties"),l=o("deepConfiguration"),f=o("initializers");e.exports=n({staticProperties:{methods:o("methods"),props:i,properties:i,statics:a,staticProperties:a,conf:s,configuration:s,deepProps:c,deepProperties:c,deepStatics:u,staticDeepProperties:u,deepConf:l,deepConfiguration:l,init:f,initializers:f,composers:o("composers"),propertyDescriptors:o("propertyDescriptors"),staticPropertyDescriptors:o("staticPropertyDescriptors")}})},function(e,t){e.exports=function(e){return"string"==typeof e}},function(e,t,r){var n=r(2),o=new WeakMap,i=function(e,t){function r(){var t=o.get(this);return e.apply(t,arguments)}return Object.defineProperty(r,"name",{value:t,configurable:!0}),r};function a(e,t){var r=t.stamp.compose,n=r.deepConfiguration.Privatize.methods,a={};o.set(a,this);var s=r.methods;if(!s)return a;for(var c=Object.keys(s),u=0;u<c.length;u++){var l=c[u];n.indexOf(l)<0&&(a[l]=i(s[l],l))}if("undefined"!=typeof Symbol){var f=Symbol.for("stamp");s[f]&&(a[f]=t.stamp)}return a}var s=n({initializers:[a],deepConfiguration:{Privatize:{methods:[]}},staticProperties:{privatizeMethods:function(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];"string"==typeof r&&r.length>0&&e.push(r)}return(this&&this.compose?this:s).compose({deepConfiguration:{Privatize:{methods:e}}})}},composers:[function(e){var t=e.stamp.compose.initializers;t.splice(t.indexOf(a),1),t.push(a)}]});e.exports=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==a(Symbol.iterator)?function(e){return void 0===e?"undefined":a(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":a(e)},o=c(r(0)),i=c(r(11)),s=c(r(10));function c(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function l(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(o,i){try{var a=t[o](i),s=a.value}catch(e){return void r(e)}if(!a.done)return Promise.resolve(s).then(function(e){n("next",e)},function(e){n("throw",e)});e(s)}("next")})}}t.default=(0,o.default)({init:function(e){var t=e.name,r=e.remoteConnection,n=e.connector;if(!t&&!r)throw new Error("Model must have a name or path");if(!n)throw new Error("Model must have a connector. Please register one using Fluent.config");this.name=t||this.name,this.remoteConnection=r||this.remoteConnection,this.connector=n||this.connector,this.chainReference=[],this.whereArray=[],this.orWhereArray=[],this.selectArray=[],this.orderByArray=[],this.limitNumber=void 0,this.offsetNumber=void 0,this.populate=[],this.chunk=null,this.pullSize=null,this.ownerId=void 0,this.paginator=void 0,this.rawQuery=void 0},properties:{operators:["=","<",">","<=",">=","<>","!=","in","nin","like","regexp","startsWith","endsWith","contains"]},methods:{get:function(){throw new Error("get() method not implemented")},all:function(){throw new Error("all() method not implemented")},find:function(e){throw new Error("find() method not implemented")},findOne:function(){throw new Error("findOne() method not implemented")},remove:function(){throw new Error("remove() method not implemented")},softDelete:function(){throw new Error("softDelete() method not implemented")},insert:function(){throw new Error("insert() method not implemented")},update:function(){throw new Error("update() method not implemented")},clear:function(){throw new Error("clear() method not implemented")},updateOrCreate:function(){throw new Error("updateOrCreate() method not implemented")},findAndRemove:function(){throw new Error("findAndRemove() method not implemented")},paginate:function(){throw new Error("paginate() method not implemented")},tableView:function(){throw new Error("tableView() method not implemented")},raw:function(){throw new Error("raw() method not implemented")},owner:function(e){return this.chainReference.push({method:"owner",args:e}),this.ownerId=e,this},own:function(e){return this.owner(e)},first:function(){var e=this;return l(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.get();case 2:return r=t.sent,t.abrupt("return",i.default.get(function(){return r[0]},[]));case 4:case"end":return t.stop()}},t,e)}))()},collect:function(){var e=this;return l(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.get();case 2:if(r=t.sent,Array.isArray(r)){t.next=5;break}throw new Error("Collect method only accepts arrays of data");case 5:return t.abrupt("return",(0,s.default)(r));case 6:case"end":return t.stop()}},t,e)}))()},select:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t=this.prepareInput(t),this.chainReference.push({method:"select",args:t}),this.selectArray=this.selectArray.concat(t).filter(function(e,t,r){return r.indexOf(e)===t}),this},jsApplySelect:function(e){var t=this,r=Array.isArray(e)?[].concat(u(e)):[e];return this.selectArray.length>0&&(r=r.map(function(e){var r={};return t.selectArray.forEach(function(t){var o=i.default.getFromPath(e,t,void 0),a=i.default.get(function(){return o.value},void 0);void 0!==a&&("object"===(void 0===a?"undefined":n(a))&&a.hasOwnProperty("data")&&a.data.hasOwnProperty("name")?r[o.label]=a.data.name:r[o.label]=a)}),r})),r},offset:function(e){return this.chainReference.push({method:"offset",args:e}),this.offsetNumber=e,this},skip:function(e){return this.offset(e)},where:function(){for(var e=this,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.chainReference.push({method:"where",args:r}),this.whereArray=[],(r=Array.isArray(r[0])?r:[r]).forEach(function(t){if(3!==t.length)throw new Error('There where clouse is not properly formatted, expecting: ["attribute", "operator","value"] but got "'+JSON.stringify(t)+'" ');e.whereArray.push(t)}),this},andWhere:function(){for(var e=this,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.chainReference.push({method:"andWhere",args:r}),(r=Array.isArray(r[0])?r:[r]).forEach(function(t){if(3!==t.length)throw new Error('There where clouse is not properly formatted, expecting: ["attribute", "operator","value"] but got "'+JSON.stringify(t)+'" ');e.whereArray.push(t)}),this},orWhere:function(){for(var e=this,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.chainReference.push({method:"orWhere",args:r}),(r=Array.isArray(r[0])?r:[r]).forEach(function(t){if(3!==t.length)throw new Error('There orWhere clouse is not properly formatted, expecting: ["attribute", "operator","value"] but got "'+JSON.stringify(t)+'" ');e.orWhereArray.push(t)}),this},limit:function(e){return this.chainReference.push({method:"limit",args:e}),this.limitNumber=e,this},take:function(e){return this.limit(e)},pluck:function(e){var t=this;return l(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t.chainReference.push({method:"pluck",args:e}),r.next=3,t.get();case 3:return n=(n=r.sent).map(function(t){var r=i.default.getFromPath(t,e,void 0);if(void 0!==r.value)return r.value}),r.abrupt("return",n);case 6:case"end":return r.stop()}},r,t)}))()},orderBy:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return this.chainReference.push({method:"orderBy",args:t}),this.orderByArray=t,this},jsApplyOrderBy:function(e){var t=[].concat(u(e));if(0===this.orderByArray.length)return t;var r=this.orderByArray[0];if(this.selectArray.length>0&&(r.includes(".")||r.includes("[")))throw new Error('Cannot orderBy nested attribute "'+r+'" when using Select. You must rename the attribute');var n=this.orderByArray[1],o=this.orderByArray[2];return o||(o="string"),t.sort(function(e,t){var a=i.default.getFromPath(e,r,void 0).value,s=i.default.getFromPath(t,r,void 0).value;if(void 0===a||void 0===s)throw new Error('Cannot order by property "'+r+'" not all values have this property');return o.includes("string")||o.includes("number")?"asc"===n?a>s?1:a<s?-1:0:a>s?-1:a<s?1:0:o.includes("date")?"asc"===n?new Date(a)-new Date(s):new Date(s)-new Date(a):void 0})},prepareInput:function(e){var t=[];return e.forEach(function(e){var r=Array.isArray(e)?e:e.split(",");r=r.map(function(e){return e.trim()}),t=t.concat(r)}),t.filter(function(e,t,r){return r.indexOf(e)===t}),t},ArrayInsert:function(e,t){var r=this;return l(regeneratorRuntime.mark(function n(){var o,i,a,s,c,u,l,f;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:o=1,i=e.length,a=!0,s=!1,c=void 0,n.prev=5,u=e[Symbol.iterator]();case 7:if(a=(l=u.next()).done){n.next=26;break}return f=l.value,t&&t.showProgress&&console.log("Inserting "+o+" of "+i),n.prev=10,n.next=13,r.insert(f,t);case 13:n.sent,t&&t.showProgress&&console.log("Element "+o+" inserted"),o++,n.next=23;break;case 18:n.prev=18,n.t0=n.catch(10),console.log("ERROR - Element "+o+" - "+JSON.stringify(f)+" could not be inserted"),console.log(n.t0),o++;case 23:a=!0,n.next=7;break;case 26:n.next=32;break;case 28:n.prev=28,n.t1=n.catch(5),s=!0,c=n.t1;case 32:n.prev=32,n.prev=33,!a&&u.return&&u.return();case 35:if(n.prev=35,!s){n.next=38;break}throw c;case 38:return n.finish(35);case 39:return n.finish(32);case 40:case"end":return n.stop()}},n,r,[[5,28,32,40],[10,18],[33,,35,39]])}))()}}})}])},"object"==a(t)&&"object"==a(e)?e.exports=i():(n=[],void 0===(o="function"==typeof(r=i)?r.apply(t,n):r)||(e.exports=o))}).call(this,r(8)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a(r(10)),o=a(r(11)),i=a(r(1));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){var e="undefined"==typeof window||!window||!window.navigator||window.navigator.onLine;return Object.freeze({isOnline:function(){return new o.default(function(e,t){i.default.get("https://yesno.wtf/api").then(function(t){e(!0)}).catch(function(t){e(!1)})})},initEventListeners:function(){n.default.listen({name:"online",callback:function(){console.log("App is now online"),e||(e=!0,n.default.emit({name:"FAST:CONNECTION:ONLINE",data:e,text:"Application is now online"}))}}),n.default.listen({name:"offline",callback:function(){console.log("App is now offline"),e&&(e=!1,n.default.emit({name:"FAST:CONNECTION:OFFLINE",data:e,text:"Application is now offline"}))}})}})}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){var e=function(e,t){var r=document.createEvent("CustomEvent");return t=t||{bubbles:!1,cancelable:!1,detail:void 0},r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r};return Object.freeze({emit:function(t){var r=t.name,n=t.data,o=t.text;if(!r)throw new Error("Event must have a name.");if(!n)throw new Error("Event must have data.");if(!o)throw new Error("Event must have a text.");var i=e(r,{detail:{data:n,text:o}});window.dispatchEvent(i)},listen:function(e){var t=e.name,r=e.callback;if(!t)throw new Error("Listener must have a name.");if(!r)throw new Error("Listener must have a callback.");window.addEventListener(t,r)},remove:function(e){var t=e.name,r=e.callback;if(!t)throw new Error("Listener must have a name to detach");if(!r)throw new Error("Listener must have a callback to detach");window.removeEventListener(t,r)}})}();t.default=n},function(e,t,r){(function(t,r,n){var o;o=function(){var e,o,i;return function e(t,r,n){function o(a,s){if(!r[a]){if(!t[a]){var c="function"==typeof _dereq_&&_dereq_;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return o(r||e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var i="function"==typeof _dereq_&&_dereq_,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,t,r){"use strict";t.exports=function(e){var t=e._SomePromiseArray;function r(e){var r=new t(e),n=r.promise();return r.setHowMany(1),r.setUnwrap(),r.init(),n}e.any=function(e){return r(e)},e.prototype.any=function(){return r(this)}}},{}],2:[function(e,r,n){"use strict";var o;try{throw new Error}catch(e){o=e}var i=e("./schedule"),a=e("./queue"),s=e("./util");function c(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new a(16),this._normalQueue=new a(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=i}function u(e,t,r){this._lateQueue.push(e,t,r),this._queueTick()}function l(e,t,r){this._normalQueue.push(e,t,r),this._queueTick()}function f(e){this._normalQueue._pushOne(e),this._queueTick()}function p(e){for(;e.length()>0;)h(e)}function h(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var r=e.shift(),n=e.shift();t.call(r,n)}}c.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},c.prototype.hasCustomScheduler=function(){return this._customScheduler},c.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},c.prototype.disableTrampolineIfNecessary=function(){s.hasDevTools&&(this._trampolineEnabled=!1)},c.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},c.prototype.fatalError=function(e,r){r?(t.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),t.exit(2)):this.throwLater(e)},c.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.hasDevTools?(c.prototype.invokeLater=function(e,t,r){this._trampolineEnabled?u.call(this,e,t,r):this._schedule(function(){setTimeout(function(){e.call(t,r)},100)})},c.prototype.invoke=function(e,t,r){this._trampolineEnabled?l.call(this,e,t,r):this._schedule(function(){e.call(t,r)})},c.prototype.settlePromises=function(e){this._trampolineEnabled?f.call(this,e):this._schedule(function(){e._settlePromises()})}):(c.prototype.invokeLater=u,c.prototype.invoke=l,c.prototype.settlePromises=f),c.prototype._drainQueues=function(){p(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,p(this._lateQueue)},c.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},c.prototype._reset=function(){this._isTickUsed=!1},r.exports=c,r.exports.firstLineError=o},{"./queue":26,"./schedule":29,"./util":36}],3:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var o=!1,i=function(e,t){this._reject(t)},a=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(i,i,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},c=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(i){o||(o=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var u=r(i),l=new e(t);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(u),u instanceof e){var p={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:u};f._then(t,a,void 0,l,p),u._then(s,c,void 0,l,p),l._setOnCancel(u)}else l._resolveCallback(f);return l},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,r){return e.resolve(r).bind(t)}}},{}],4:[function(e,t,r){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var o=e("./promise")();o.noConflict=function(){try{Promise===o&&(Promise=n)}catch(e){}return o},t.exports=o},{"./promise":22}],5:[function(e,t,r){"use strict";var n=Object.create;if(n){var o=n(null),i=n(null);o[" size"]=i[" size"]=0}t.exports=function(t){var r=e("./util"),n=r.canEvaluate;r.isIdentifier;function o(e){return function(e,n){var o;if(null!=e&&(o=e[n]),"function"!=typeof o){var i="Object "+r.classString(e)+" has no method '"+r.toString(n)+"'";throw new t.TypeError(i)}return o}(e,this.pop()).apply(e,this)}function i(e){return e[this]}function a(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(o,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t;if("number"==typeof e)t=a;else if(n){var r=(void 0)(e);t=null!==r?r:i}else t=i;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,r){"use strict";t.exports=function(t,r,n,o){var i=e("./util"),a=i.tryCatch,s=i.errorObj,c=t._async;t.prototype.break=t.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var r=e._cancellationParent;if(null==r||!r._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=r}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(i.isArray(e))for(var r=0;r<e.length;++r)this._doInvokeOnCancel(e[r],t);else if(void 0!==e)if("function"==typeof e){if(!t){var n=a(e).call(this._boundValue());n===s&&(this._attachExtraTrace(n.e),c.throwLater(n.e))}}else e._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,e)},t.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},t.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(e,t,r){"use strict";t.exports=function(t){var r=e("./util"),n=e("./es5").keys,o=r.tryCatch,i=r.errorObj;return function(e,a,s){return function(c){var u=s._boundValue();e:for(var l=0;l<e.length;++l){var f=e[l];if(f===Error||null!=f&&f.prototype instanceof Error){if(c instanceof f)return o(a).call(u,c)}else if("function"==typeof f){var p=o(f).call(u,c);if(p===i)return p;if(p)return o(a).call(u,c)}else if(r.isObject(c)){for(var h=n(f),d=0;d<h.length;++d){var v=h[d];if(f[v]!=c[v])continue e}return o(a).call(u,c)}}return t}}}},{"./es5":13,"./util":36}],8:[function(e,t,r){"use strict";t.exports=function(e){var t=!1,r=[];function n(){this._trace=new n.CapturedTrace(o())}function o(){var e=r.length-1;if(e>=0)return r[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var e=r.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},n.CapturedTrace=null,n.create=function(){if(t)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=e.prototype._pushContext,i=e.prototype._popContext,a=e._peekContext,s=e.prototype._peekContext,c=e.prototype._promiseCreated;n.deactivateLongStackTraces=function(){e.prototype._pushContext=r,e.prototype._popContext=i,e._peekContext=a,e.prototype._peekContext=s,e.prototype._promiseCreated=c,t=!1},t=!0,e.prototype._pushContext=n.prototype._pushContext,e.prototype._popContext=n.prototype._popContext,e._peekContext=e.prototype._peekContext=o,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},n}},{}],9:[function(e,r,n){"use strict";r.exports=function(r,n){var o,i,a,s=r._getDomain,c=r._async,u=e("./errors").Warning,l=e("./util"),f=e("./es5"),p=l.canAttachTrace,h=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,v=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,_=null,y=null,m=!1,g=!(0==l.env("BLUEBIRD_DEBUG")),b=!(0==l.env("BLUEBIRD_WARNINGS")||!g&&!l.env("BLUEBIRD_WARNINGS")),w=!(0==l.env("BLUEBIRD_LONG_STACK_TRACES")||!g&&!l.env("BLUEBIRD_LONG_STACK_TRACES")),C=0!=l.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!l.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},r.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var e=this;setTimeout(function(){e._notifyUnhandledRejection()},1)}},r.prototype._notifyUnhandledRejectionIsHandled=function(){$("rejectionHandled",o,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),$("unhandledRejection",i,e,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(e,t,r){return B(e,t,r||this)},r.onPossiblyUnhandledRejection=function(e){var t=s();i="function"==typeof e?null===t?e:l.domainBind(t,e):void 0},r.onUnhandledRejectionHandled=function(e){var t=s();o="function"==typeof e?null===t?e:l.domainBind(t,e):void 0};var E=function(){};r.longStackTraces=function(){if(c.haveItemsQueued()&&!Z.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!Z.longStackTraces&&Q()){var e=r.prototype._captureStackTrace,t=r.prototype._attachExtraTrace,o=r.prototype._dereferenceTrace;Z.longStackTraces=!0,E=function(){if(c.haveItemsQueued()&&!Z.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=e,r.prototype._attachExtraTrace=t,r.prototype._dereferenceTrace=o,n.deactivateLongStackTraces(),c.enableTrampoline(),Z.longStackTraces=!1},r.prototype._captureStackTrace=L,r.prototype._attachExtraTrace=U,r.prototype._dereferenceTrace=V,n.activateLongStackTraces(),c.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return Z.longStackTraces&&Q()};var k=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return l.global.dispatchEvent(e),function(e,t){var r={detail:t,cancelable:!0};f.defineProperty(r,"promise",{value:t.promise}),f.defineProperty(r,"reason",{value:t.reason});var n=new CustomEvent(e.toLowerCase(),r);return!l.global.dispatchEvent(n)}}if("function"==typeof Event){e=new Event("CustomEvent");return l.global.dispatchEvent(e),function(e,t){var r=new Event(e.toLowerCase(),{cancelable:!0});return r.detail=t,f.defineProperty(r,"promise",{value:t.promise}),f.defineProperty(r,"reason",{value:t.reason}),!l.global.dispatchEvent(r)}}return(e=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),l.global.dispatchEvent(e),function(e,t){var r=document.createEvent("CustomEvent");return r.initCustomEvent(e.toLowerCase(),!1,!0,t),!l.global.dispatchEvent(r)}}catch(e){}return function(){return!1}}(),j=l.isNode?function(){return t.emit.apply(t,arguments)}:l.global?function(e){var t="on"+e.toLowerCase(),r=l.global[t];return!!r&&(r.apply(l.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function x(e,t){return{promise:t}}var F={promiseCreated:x,promiseFulfilled:x,promiseRejected:x,promiseResolved:x,promiseCancelled:x,promiseChained:function(e,t,r){return{promise:t,child:r}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,r){return{reason:t,promise:r}},rejectionHandled:x},P=function(e){var t=!1;try{t=j.apply(null,arguments)}catch(e){c.throwLater(e),t=!0}var r=!1;try{r=k(e,F[e].apply(null,arguments))}catch(e){c.throwLater(e),r=!0}return r||t};function T(){return!1}function O(e,t,r){var n=this;try{e(t,r,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+l.toString(e));n._attachCancellationCallback(e)})}catch(e){return e}}function A(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?l.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function S(){return this._onCancelField}function R(e){this._onCancelField=e}function N(){this._cancellationParent=void 0,this._onCancelField=void 0}function D(e,t){if(0!=(1&t)){this._cancellationParent=e;var r=e._branchesRemainingToCancel;void 0===r&&(r=0),e._branchesRemainingToCancel=r+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}r.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?r.longStackTraces():!e.longStackTraces&&r.hasLongStackTraces()&&E()),"warnings"in e){var t=e.warnings;Z.warnings=!!t,C=Z.warnings,l.isObject(t)&&"wForgottenReturn"in t&&(C=!!t.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!Z.cancellation){if(c.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=N,r.prototype._propagateFrom=D,r.prototype._onCancel=S,r.prototype._setOnCancel=R,r.prototype._attachCancellationCallback=A,r.prototype._execute=O,I=D,Z.cancellation=!0}return"monitoring"in e&&(e.monitoring&&!Z.monitoring?(Z.monitoring=!0,r.prototype._fireEvent=P):!e.monitoring&&Z.monitoring&&(Z.monitoring=!1,r.prototype._fireEvent=T)),r},r.prototype._fireEvent=T,r.prototype._execute=function(e,t,r){try{e(t,r)}catch(e){return e}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(e){},r.prototype._attachCancellationCallback=function(e){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._dereferenceTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(e,t){};var I=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function M(){var e=this._boundTo;return void 0!==e&&e instanceof r?e.isFulfilled()?e.value():void 0:e}function L(){this._trace=new J(this._peekContext())}function U(e,t){if(p(e)){var r=this._trace;if(void 0!==r&&t&&(r=r._parent),void 0!==r)r.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=q(e);l.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),l.notEnumerableProp(e,"__stackCleaned__",!0)}}}function V(){this._trace=void 0}function B(e,t,n){if(Z.warnings){var o,i=new u(e);if(t)n._attachExtraTrace(i);else if(Z.longStackTraces&&(o=r._peekContext()))o.attachExtraTrace(i);else{var a=q(i);i.stack=a.message+"\n"+a.stack.join("\n")}P("warning",i)||z(i,"",!0)}}function H(e){for(var t=[],r=0;r<e.length;++r){var n=e[r],o=" (No stack trace)"===n||_.test(n),i=o&&G(n);o&&!i&&(m&&" "!==n.charAt(0)&&(n=" "+n),t.push(n))}return t}function q(e){var t=e.stack,r=e.toString();return t="string"==typeof t&&t.length>0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),r=0;r<t.length;++r){var n=t[r];if(" (No stack trace)"===n||_.test(n))break}return r>0&&"SyntaxError"!=e.name&&(t=t.slice(r)),t}(e):[" (No stack trace)"],{message:r,stack:"SyntaxError"==e.name?t:H(t)}}function z(e,t,r){if("undefined"!=typeof console){var n;if(l.isObject(e)){var o=e.stack;n=t+y(o,e)}else n=t+String(e);"function"==typeof a?a(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function $(e,t,r,n){var o=!1;try{"function"==typeof t&&(o=!0,"rejectionHandled"===e?t(n):t(r,n))}catch(e){c.throwLater(e)}"unhandledRejection"===e?P(e,r,n)||o||z(r,"Unhandled rejection "):P(e,n)}function W(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():l.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){if(e.length<41)return e;return e.substr(0,38)+"..."}(t)+">, no stack trace)"}function Q(){return"function"==typeof K}var G=function(){return!1},X=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Y(e){var t=e.match(X);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function J(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);K(this,J),t>32&&this.uncycle()}l.inherits(J,Error),n.CapturedTrace=J,J.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],r={},n=0,o=this;void 0!==o;++n)t.push(o),o=o._parent;for(n=(e=this._length=n)-1;n>=0;--n){var i=t[n].stack;void 0===r[i]&&(r[i]=n)}for(n=0;n<e;++n){var a=r[t[n].stack];if(void 0!==a&&a!==n){a>0&&(t[a-1]._parent=void 0,t[a-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var s=n>0?t[n-1]:this;a<e-1?(s._parent=t[a+1],s._parent.uncycle(),s._length=s._parent._length+1):(s._parent=void 0,s._length=1);for(var c=s._length+1,u=n-2;u>=0;--u)t[u]._length=c,c++;return}}}},J.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=q(e),r=t.message,n=[t.stack],o=this;void 0!==o;)n.push(H(o.stack.split("\n"))),o=o._parent;!function(e){for(var t=e[0],r=1;r<e.length;++r){for(var n=e[r],o=t.length-1,i=t[o],a=-1,s=n.length-1;s>=0;--s)if(n[s]===i){a=s;break}for(s=a;s>=0;--s){var c=n[s];if(t[o]!==c)break;t.pop(),o--}t=n}}(n),function(e){for(var t=0;t<e.length;++t)(0===e[t].length||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}(n),l.notEnumerableProp(e,"stack",function(e,t){for(var r=0;r<t.length-1;++r)t[r].push("From previous event:"),t[r]=t[r].join("\n");return r<t.length&&(t[r]=t[r].join("\n")),e+"\n"+t.join("\n")}(r,n)),l.notEnumerableProp(e,"__stackCleaned__",!0)}};var K=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():W(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,_=e,y=t;var r=Error.captureStackTrace;return G=function(e){return h.test(e)},function(e,t){Error.stackTraceLimit+=6,r(e,t),Error.stackTraceLimit-=6}}var n,o=new Error;if("string"==typeof o.stack&&o.stack.split("\n")[0].indexOf("stackDetection@")>=0)return _=/@/,y=t,m=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){n="stack"in e}return"stack"in o||!n||"number"!=typeof Error.stackTraceLimit?(y=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?W(t):t.toString()},null):(_=e,y=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(a=function(e){console.warn(e)},l.isNode&&t.stderr.isTTY?a=function(e,t){var r=t?"":"";console.warn(r+e+"\n")}:l.isNode||"string"!=typeof(new Error).stack||(a=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var Z={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1};return w&&r.longStackTraces(),{longStackTraces:function(){return Z.longStackTraces},warnings:function(){return Z.warnings},cancellation:function(){return Z.cancellation},monitoring:function(){return Z.monitoring},propagateFromFunction:function(){return I},boundValueFunction:function(){return M},checkForgottenReturns:function(e,t,r,n,o){if(void 0===e&&null!==t&&C){if(void 0!==o&&o._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var i="",a="";if(t._trace){for(var s=t._trace.stack.split("\n"),c=H(s),u=c.length-1;u>=0;--u){var l=c[u];if(!d.test(l)){var f=l.match(v);f&&(i="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(c.length>0){var p=c[0];for(u=0;u<s.length;++u)if(s[u]===p){u>0&&(a="\n"+s[u-1]);break}}}var h="a promise was created in a "+r+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(h,!0,t)}},setBounds:function(e,t){if(Q()){for(var r,n,o=e.stack.split("\n"),i=t.stack.split("\n"),a=-1,s=-1,c=0;c<o.length;++c)if(u=Y(o[c])){r=u.fileName,a=u.line;break}for(c=0;c<i.length;++c){var u;if(u=Y(i[c])){n=u.fileName,s=u.line;break}}a<0||s<0||!r||!n||r!==n||a>=s||(G=function(e){if(h.test(e))return!0;var t=Y(e);return!!(t&&t.fileName===r&&a<=t.line&&t.line<=s)})}},warn:B,deprecated:function(e,t){var r=e+" is deprecated and will be removed in a future version.";return t&&(r+=" Use "+t+" instead."),B(r)},CapturedTrace:J,fireDomEvent:k,fireGlobalEvent:j}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(e,t,r){"use strict";t.exports=function(e){function t(){return this.value}function r(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(r){return r instanceof e&&r.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:r},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(r,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof e&&r.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:r},void 0);var n=arguments[1];n instanceof e&&n.suppressUnhandledRejections();return this.caught(r,function(){return n})}}},{}],11:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.reduce,n=e.all;function o(){return n(this)}e.prototype.each=function(e){return r(this,e,t,0)._then(o,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,n){return r(e,n,t,0)._then(o,void 0,void 0,e,void 0)},e.mapSeries=function(e,n){return r(e,n,t,t)}}},{}],12:[function(e,t,r){"use strict";var n,o,i=e("./es5"),a=i.freeze,s=e("./util"),c=s.inherits,u=s.notEnumerableProp;function l(e,t){function r(n){if(!(this instanceof r))return new r(n);u(this,"message","string"==typeof n?n:t),u(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(r,Error),r}var f=l("Warning","warning"),p=l("CancellationError","cancellation error"),h=l("TimeoutError","timeout error"),d=l("AggregateError","aggregate error");try{n=TypeError,o=RangeError}catch(e){n=l("TypeError","type error"),o=l("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),_=0;_<v.length;++_)"function"==typeof Array.prototype[v[_]]&&(d.prototype[v[_]]=Array.prototype[v[_]]);i.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var y=0;function m(e){if(!(this instanceof m))return new m(e);u(this,"name","OperationalError"),u(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(u(this,"message",e.message),u(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}d.prototype.toString=function(){var e=Array(4*y+1).join(" "),t="\n"+e+"AggregateError of:\n";y++,e=Array(4*y+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",o=n.split("\n"),i=0;i<o.length;++i)o[i]=e+o[i];t+=(n=o.join("\n"))+"\n"}return y--,t},c(m,Error);var g=Error.__BluebirdErrorTypes__;g||(g=a({CancellationError:p,TimeoutError:h,OperationalError:m,RejectionError:m,AggregateError:d}),i.defineProperty(Error,"__BluebirdErrorTypes__",{value:g,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error:Error,TypeError:n,RangeError:o,CancellationError:g.CancellationError,OperationalError:g.OperationalError,TimeoutError:g.TimeoutError,AggregateError:g.AggregateError,Warning:f}},{"./es5":13,"./util":36}],13:[function(e,t,r){var n=function(){"use strict";return void 0===this}();if(n)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:n,propertyIsWritable:function(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!(r&&!r.writable&&!r.set)}};else{var o={}.hasOwnProperty,i={}.toString,a={}.constructor.prototype,s=function(e){var t=[];for(var r in e)o.call(e,r)&&t.push(r);return t};t.exports={isArray:function(e){try{return"[object Array]"===i.call(e)}catch(e){return!1}},keys:s,names:s,defineProperty:function(e,t,r){return e[t]=r.value,e},getDescriptor:function(e,t){return{value:e[t]}},freeze:function(e){return e},getPrototypeOf:function(e){try{return Object(e).constructor.prototype}catch(e){return a}},isES5:n,propertyIsWritable:function(){return!0}}}},{}],14:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.map;e.prototype.filter=function(e,n){return r(this,e,n,t)},e.filter=function(e,n,o){return r(e,n,o,t)}}},{}],15:[function(e,t,r){"use strict";t.exports=function(t,r,n){var o=e("./util"),i=t.CancellationError,a=o.errorObj,s=e("./catch_filter")(n);function c(e,t,r){this.promise=e,this.type=t,this.handler=r,this.called=!1,this.cancelPromise=null}function u(e){this.finallyHandler=e}function l(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function f(){return h.call(this,this.promise._target()._settledValue())}function p(e){if(!l(this,e))return a.e=e,a}function h(e){var o=this.promise,s=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?s.call(o._boundValue()):s.call(o._boundValue(),e);if(c===n)return c;if(void 0!==c){o._setReturnedNonUndefined();var h=r(c,o);if(h instanceof t){if(null!=this.cancelPromise){if(h._isCancelled()){var d=new i("late cancellation observer");return o._attachExtraTrace(d),a.e=d,a}h.isPending()&&h._attachCancellationCallback(new u(this))}return h._then(f,p,void 0,this,void 0)}}}return o.isRejected()?(l(this),a.e=e,a):(l(this),e)}return c.prototype.isFinallyHandler=function(){return 0===this.type},u.prototype._resultCancelled=function(){l(this.finallyHandler)},t.prototype._passThrough=function(e,t,r,n){return"function"!=typeof e?this.then():this._then(r,n,void 0,new c(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,h,h)},t.prototype.tap=function(e){return this._passThrough(e,1,h)},t.prototype.tapCatch=function(e){var r=arguments.length;if(1===r)return this._passThrough(e,1,void 0,h);var n,i=new Array(r-1),a=0;for(n=0;n<r-1;++n){var c=arguments[n];if(!o.isObject(c))return t.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+o.classString(c)));i[a++]=c}i.length=a;var u=arguments[n];return this._passThrough(s(i,u,this),1,void 0,h)},c}},{"./catch_filter":7,"./util":36}],16:[function(e,t,r){"use strict";t.exports=function(t,r,n,o,i,a){var s=e("./errors").TypeError,c=e("./util"),u=c.errorObj,l=c.tryCatch,f=[];function p(e,r,o,i){if(a.cancellation()){var s=new t(n),c=this._finallyPromise=new t(n);this._promise=s.lastly(function(){return c}),s._captureStackTrace(),s._setOnCancel(this)}else{(this._promise=new t(n))._captureStackTrace()}this._stack=i,this._generatorFunction=e,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof o?[o].concat(f):f,this._yieldedPromise=null,this._cancellationPhase=!1}c.inherits(p,i),p.prototype._isResolved=function(){return null===this._promise},p.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},p.prototype._promiseCancelled=function(){if(!this._isResolved()){var e;if(void 0!==this._generator.return)this._promise._pushContext(),e=l(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new t.CancellationError("generator .return() sentinel");t.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),e=l(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(e)}},p.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=l(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},p.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=l(this._generator.throw).call(this._generator,e);this._promise._popContext(),this._continue(t)},p.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof t){var e=this._yieldedPromise;this._yieldedPromise=null,e.cancel()}},p.prototype.promise=function(){return this._promise},p.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},p.prototype._continue=function(e){var r=this._promise;if(e===u)return this._cleanup(),this._cancellationPhase?r.cancel():r._rejectCallback(e.e,!1);var n=e.value;if(!0===e.done)return this._cleanup(),this._cancellationPhase?r.cancel():r._resolveCallback(n);var i=o(n,this._promise);if(i instanceof t||null!==(i=function(e,r,n){for(var i=0;i<r.length;++i){n._pushContext();var a=l(r[i])(e);if(n._popContext(),a===u){n._pushContext();var s=t.reject(u.e);return n._popContext(),s}var c=o(a,n);if(c instanceof t)return c}return null}(i,this._yieldHandlers,this._promise))){var a=(i=i._target())._bitField;0==(50397184&a)?(this._yieldedPromise=i,i._proxy(this,null)):0!=(33554432&a)?t._async.invoke(this._promiseFulfilled,this,i._value()):0!=(16777216&a)?t._async.invoke(this._promiseRejected,this,i._reason()):this._promiseCancelled()}else this._promiseRejected(new s("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(n))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},t.coroutine=function(e,t){if("function"!=typeof e)throw new s("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=Object(t).yieldHandler,n=p,o=(new Error).stack;return function(){var t=e.apply(this,arguments),i=new n(void 0,void 0,r,o),a=i.promise();return i._generator=t,i._promiseFulfilled(void 0),a}},t.coroutine.addYieldHandler=function(e){if("function"!=typeof e)throw new s("expecting a function but got "+c.classString(e));f.push(e)},t.spawn=function(e){if(a.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof e)return r("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=new p(e,this),o=n.promise();return n._run(t.spawn),o}}},{"./errors":12,"./util":36}],17:[function(e,t,r){"use strict";t.exports=function(t,r,n,o,i,a){var s=e("./util");s.canEvaluate,s.tryCatch,s.errorObj;t.join=function(){var e,t=arguments.length-1;t>0&&"function"==typeof arguments[t]&&(e=arguments[t]);var n=[].slice.call(arguments);e&&n.pop();var o=new r(n).promise();return void 0!==e?o.spread(e):o}}},{"./util":36}],18:[function(e,t,r){"use strict";t.exports=function(t,r,n,o,i,a){var s=t._getDomain,c=e("./util"),u=c.tryCatch,l=c.errorObj,f=t._async;function p(e,t,r,n){this.constructor$(e),this._promise._captureStackTrace();var o=s();this._callback=null===o?t:c.domainBind(o,t),this._preservedValues=n===i?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function h(e,r,o,i){if("function"!=typeof r)return n("expecting a function but got "+c.classString(r));var a=0;if(void 0!==o){if("object"!=typeof o||null===o)return t.reject(new TypeError("options argument must be an object but it is "+c.classString(o)));if("number"!=typeof o.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+c.classString(o.concurrency)));a=o.concurrency}return new p(e,r,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,i).promise()}c.inherits(p,r),p.prototype._asyncInit=function(){this._init$(void 0,-2)},p.prototype._init=function(){},p.prototype._promiseFulfilled=function(e,r){var n=this._values,i=this.length(),s=this._preservedValues,c=this._limit;if(r<0){if(n[r=-1*r-1]=e,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return n[r]=e,this._queue.push(r),!1;null!==s&&(s[r]=e);var f=this._promise,p=this._callback,h=f._boundValue();f._pushContext();var d=u(p).call(h,e,r,i),v=f._popContext();if(a.checkForgottenReturns(d,v,null!==s?"Promise.filter":"Promise.map",f),d===l)return this._reject(d.e),!0;var _=o(d,this._promise);if(_ instanceof t){var y=(_=_._target())._bitField;if(0==(50397184&y))return c>=1&&this._inFlight++,n[r]=_,_._proxy(this,-1*(r+1)),!1;if(0==(33554432&y))return 0!=(16777216&y)?(this._reject(_._reason()),!0):(this._cancel(),!0);d=_._value()}n[r]=d}return++this._totalResolved>=i&&(null!==s?this._filter(n,s):this._resolve(n),!0)},p.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var n=e.pop();this._promiseFulfilled(r[n],n)}},p.prototype._filter=function(e,t){for(var r=t.length,n=new Array(r),o=0,i=0;i<r;++i)e[i]&&(n[o++]=t[i]);n.length=o,this._resolve(n)},p.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(e,t){return h(this,e,t,null)},t.map=function(e,t,r,n){return h(e,t,r,n)}}},{"./util":36}],19:[function(e,t,r){"use strict";t.exports=function(t,r,n,o,i){var a=e("./util"),s=a.tryCatch;t.method=function(e){if("function"!=typeof e)throw new t.TypeError("expecting a function but got "+a.classString(e));return function(){var n=new t(r);n._captureStackTrace(),n._pushContext();var o=s(e).apply(this,arguments),a=n._popContext();return i.checkForgottenReturns(o,a,"Promise.method",n),n._resolveFromSyncValue(o),n}},t.attempt=t.try=function(e){if("function"!=typeof e)return o("expecting a function but got "+a.classString(e));var n,c=new t(r);if(c._captureStackTrace(),c._pushContext(),arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],l=arguments[2];n=a.isArray(u)?s(e).apply(l,u):s(e).call(l,u)}else n=s(e)();var f=c._popContext();return i.checkForgottenReturns(n,f,"Promise.try",c),c._resolveFromSyncValue(n),c},t.prototype._resolveFromSyncValue=function(e){e===a.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,r){"use strict";var n=e("./util"),o=n.maybeWrapAsError,i=e("./errors").OperationalError,a=e("./es5");var s=/^(?:name|message|stack|cause)$/;function c(e){var t;if(function(e){return e instanceof Error&&a.getPrototypeOf(e)===Error.prototype}(e)){(t=new i(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var r=a.keys(e),o=0;o<r.length;++o){var c=r[o];s.test(c)||(t[c]=e[c])}return t}return n.markAsOriginatingFromRejection(e),e}t.exports=function(e,t){return function(r,n){if(null!==e){if(r){var i=c(o(r));e._attachExtraTrace(i),e._reject(i)}else if(t){var a=[].slice.call(arguments,1);e._fulfill(a)}else e._fulfill(n);e=null}}}},{"./errors":12,"./es5":13,"./util":36}],21:[function(e,t,r){"use strict";t.exports=function(t){var r=e("./util"),n=t._async,o=r.tryCatch,i=r.errorObj;function a(e,t){if(!r.isArray(e))return s.call(this,e,t);var a=o(t).apply(this._boundValue(),[null].concat(e));a===i&&n.throwLater(a.e)}function s(e,t){var r=this._boundValue(),a=void 0===e?o(t).call(r,null):o(t).call(r,null,e);a===i&&n.throwLater(a.e)}function c(e,t){if(!e){var r=new Error(e+"");r.cause=e,e=r}var a=o(t).call(this._boundValue(),e);a===i&&n.throwLater(a.e)}t.prototype.asCallback=t.prototype.nodeify=function(e,t){if("function"==typeof e){var r=s;void 0!==t&&Object(t).spread&&(r=a),this._then(r,c,void 0,this,e)}return this}}},{"./util":36}],22:[function(e,r,n){"use strict";r.exports=function(){var n=function(){return new d("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},o=function(){return new T.PromiseInspection(this._target())},i=function(e){return T.reject(new d(e))};function a(){}var s,c={},u=e("./util");s=u.isNode?function(){var e=t.domain;return void 0===e&&(e=null),e}:function(){return null},u.notEnumerableProp(T,"_getDomain",s);var l=e("./es5"),f=e("./async"),p=new f;l.defineProperty(T,"_async",{value:p});var h=e("./errors"),d=T.TypeError=h.TypeError;T.RangeError=h.RangeError;var v=T.CancellationError=h.CancellationError;T.TimeoutError=h.TimeoutError,T.OperationalError=h.OperationalError,T.RejectionError=h.OperationalError,T.AggregateError=h.AggregateError;var _=function(){},y={},m={},g=e("./thenables")(T,_),b=e("./promise_array")(T,_,g,i,a),w=e("./context")(T),C=w.create,E=e("./debuggability")(T,w),k=(E.CapturedTrace,e("./finally")(T,g,m)),j=e("./catch_filter")(m),x=e("./nodeback"),F=u.errorObj,P=u.tryCatch;function T(e){e!==_&&function(e,t){if(null==e||e.constructor!==T)throw new d("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof t)throw new d("expecting a function but got "+u.classString(t))}(this,e),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(e),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function O(e){this.promise._resolveCallback(e)}function A(e){this.promise._rejectCallback(e,!1)}function S(e){var t=new T(_);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}return T.prototype.toString=function(){return"[object Promise]"},T.prototype.caught=T.prototype.catch=function(e){var t=arguments.length;if(t>1){var r,n=new Array(t-1),o=0;for(r=0;r<t-1;++r){var a=arguments[r];if(!u.isObject(a))return i("Catch statement predicate: expecting an object but got "+u.classString(a));n[o++]=a}return n.length=o,e=arguments[r],this.then(void 0,j(n,e,this))}return this.then(void 0,e)},T.prototype.reflect=function(){return this._then(o,o,void 0,this,void 0)},T.prototype.then=function(e,t){if(E.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var r=".then() only accepts functions but was passed: "+u.classString(e);arguments.length>1&&(r+=", "+u.classString(t)),this._warn(r)}return this._then(e,t,void 0,void 0,void 0)},T.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},T.prototype.spread=function(e){return"function"!=typeof e?i("expecting a function but got "+u.classString(e)):this.all()._then(e,void 0,void 0,y,void 0)},T.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},T.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new b(this).promise()},T.prototype.error=function(e){return this.caught(u.originatesFromRejection,e)},T.getNewLibraryCopy=r.exports,T.is=function(e){return e instanceof T},T.fromNode=T.fromCallback=function(e){var t=new T(_);t._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=P(e)(x(t,r));return n===F&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},T.all=function(e){return new b(e).promise()},T.cast=function(e){var t=g(e);return t instanceof T||((t=new T(_))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},T.resolve=T.fulfilled=T.cast,T.reject=T.rejected=function(e){var t=new T(_);return t._captureStackTrace(),t._rejectCallback(e,!0),t},T.setScheduler=function(e){if("function"!=typeof e)throw new d("expecting a function but got "+u.classString(e));return p.setScheduler(e)},T.prototype._then=function(e,t,r,n,o){var i=void 0!==o,a=i?o:new T(_),c=this._target(),l=c._bitField;i||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&l)?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var f=s();if(0!=(50397184&l)){var h,d,y=c._settlePromiseCtx;0!=(33554432&l)?(d=c._rejectionHandler0,h=e):0!=(16777216&l)?(d=c._fulfillmentHandler0,h=t,c._unsetRejectionIsUnhandled()):(y=c._settlePromiseLateCancellationObserver,d=new v("late cancellation observer"),c._attachExtraTrace(d),h=t),p.invoke(y,c,{handler:null===f?h:"function"==typeof h&&u.domainBind(f,h),promise:a,receiver:n,value:d})}else c._addCallbacks(e,t,a,n,f);return a},T.prototype._length=function(){return 65535&this._bitField},T.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},T.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},T.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},T.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},T.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},T.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},T.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},T.prototype._isFinal=function(){return(4194304&this._bitField)>0},T.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},T.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},T.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},T.prototype._setAsyncGuaranteed=function(){p.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},T.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==c)return void 0===t&&this._isBound()?this._boundValue():t},T.prototype._promiseAt=function(e){return this[4*e-4+2]},T.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},T.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},T.prototype._boundValue=function(){},T.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,r=e._rejectionHandler0,n=e._promise0,o=e._receiverAt(0);void 0===o&&(o=c),this._addCallbacks(t,r,n,o,null)},T.prototype._migrateCallbackAt=function(e,t){var r=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),o=e._promiseAt(t),i=e._receiverAt(t);void 0===i&&(i=c),this._addCallbacks(r,n,o,i,null)},T.prototype._addCallbacks=function(e,t,r,n,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=r,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=null===o?e:u.domainBind(o,e)),"function"==typeof t&&(this._rejectionHandler0=null===o?t:u.domainBind(o,t));else{var a=4*i-4;this[a+2]=r,this[a+3]=n,"function"==typeof e&&(this[a+0]=null===o?e:u.domainBind(o,e)),"function"==typeof t&&(this[a+1]=null===o?t:u.domainBind(o,t))}return this._setLength(i+1),i},T.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},T.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(n(),!1);var r=g(e,this);if(!(r instanceof T))return this._fulfill(e);t&&this._propagateFrom(r,2);var o=r._target();if(o!==this){var i=o._bitField;if(0==(50397184&i)){var a=this._length();a>0&&o._migrateCallback0(this);for(var s=1;s<a;++s)o._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(o)}else if(0!=(33554432&i))this._fulfill(o._value());else if(0!=(16777216&i))this._reject(o._reason());else{var c=new v("late cancellation observer");o._attachExtraTrace(c),this._reject(c)}}else this._reject(n())}},T.prototype._rejectCallback=function(e,t,r){var n=u.ensureErrorObject(e),o=n===e;if(!o&&!r&&E.warnings()){var i="a promise was rejected with a non-error: "+u.classString(e);this._warn(i,!0)}this._attachExtraTrace(n,!!t&&o),this._reject(e)},T.prototype._resolveFromExecutor=function(e){if(e!==_){var t=this;this._captureStackTrace(),this._pushContext();var r=!0,n=this._execute(e,function(e){t._resolveCallback(e)},function(e){t._rejectCallback(e,r)});r=!1,this._popContext(),void 0!==n&&t._rejectCallback(n,!0)}},T.prototype._settlePromiseFromHandler=function(e,t,r,n){var o=n._bitField;if(0==(65536&o)){var i;n._pushContext(),t===y?r&&"number"==typeof r.length?i=P(e).apply(this._boundValue(),r):(i=F).e=new d("cannot .spread() a non-array: "+u.classString(r)):i=P(e).call(t,r);var a=n._popContext();0==(65536&(o=n._bitField))&&(i===m?n._reject(r):i===F?n._rejectCallback(i.e,!1):(E.checkForgottenReturns(i,a,"",n,this),n._resolveCallback(i)))}},T.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},T.prototype._followee=function(){return this._rejectionHandler0},T.prototype._setFollowee=function(e){this._rejectionHandler0=e},T.prototype._settlePromise=function(e,t,r,n){var i=e instanceof T,s=this._bitField,c=0!=(134217728&s);0!=(65536&s)?(i&&e._invokeInternalOnCancel(),r instanceof k&&r.isFinallyHandler()?(r.cancelPromise=e,P(t).call(r,n)===F&&e._reject(F.e)):t===o?e._fulfill(o.call(r)):r instanceof a?r._promiseCancelled(e):i||e instanceof b?e._cancel():r.cancel()):"function"==typeof t?i?(c&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,r,n,e)):t.call(r,n,e):r instanceof a?r._isResolved()||(0!=(33554432&s)?r._promiseFulfilled(n,e):r._promiseRejected(n,e)):i&&(c&&e._setAsyncGuaranteed(),0!=(33554432&s)?e._fulfill(n):e._reject(n))},T.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,r=e.promise,n=e.receiver,o=e.value;"function"==typeof t?r instanceof T?this._settlePromiseFromHandler(t,n,o,r):t.call(n,o,r):r instanceof T&&r._reject(o)},T.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},T.prototype._settlePromise0=function(e,t,r){var n=this._promise0,o=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,e,o,t)},T.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},T.prototype._fulfill=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(e===this){var r=n();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():p.settlePromises(this),this._dereferenceTrace())}},T.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return p.fatalError(e,u.isNode);(65535&t)>0?p.settlePromises(this):this._ensurePossibleRejectionHandled()}},T.prototype._fulfillPromises=function(e,t){for(var r=1;r<e;r++){var n=this._fulfillmentHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,t)}},T.prototype._rejectPromises=function(e,t){for(var r=1;r<e;r++){var n=this._rejectionHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,t)}},T.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(0!=(16842752&e)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,e),this._rejectPromises(t,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},T.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},T.defer=T.pending=function(){return E.deprecated("Promise.defer","new Promise"),{promise:new T(_),resolve:O,reject:A}},u.notEnumerableProp(T,"_makeSelfResolutionError",n),e("./method")(T,_,g,i,E),e("./bind")(T,_,g,E),e("./cancel")(T,b,i,E),e("./direct_resolve")(T),e("./synchronous_inspection")(T),e("./join")(T,b,g,_,p,s),T.Promise=T,T.version="3.5.3",e("./map.js")(T,b,i,g,_,E),e("./call_get.js")(T),e("./using.js")(T,i,g,C,_,E),e("./timers.js")(T,_,E),e("./generators.js")(T,i,_,g,a,E),e("./nodeify.js")(T),e("./promisify.js")(T,_),e("./props.js")(T,b,g,i),e("./race.js")(T,_,g,i),e("./reduce.js")(T,b,i,g,_,E),e("./settle.js")(T,b,E),e("./some.js")(T,b,i),e("./filter.js")(T,_),e("./each.js")(T,_),e("./any.js")(T),u.toFastProperties(T),u.toFastProperties(T.prototype),S({a:1}),S({b:2}),S({c:3}),S(1),S(function(){}),S(void 0),S(!1),S(new T(_)),E.setBounds(f.firstLineError,u.lastLineError),T}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(e,t,r){"use strict";t.exports=function(t,r,n,o,i){var a=e("./util");a.isArray;function s(e){var n=this._promise=new t(r);e instanceof t&&n._propagateFrom(e,3),n._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(r,i){var s=n(this._values,this._promise);if(s instanceof t){var c=(s=s._target())._bitField;if(this._values=s,0==(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,i);if(0==(33554432&c))return 0!=(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===i?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(i));else{var u=o("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(u,!1)}},s.prototype._iterate=function(e){var r=this.getActualLength(e.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var o=this._promise,i=!1,a=null,s=0;s<r;++s){var c=n(e[s],o);a=c instanceof t?(c=c._target())._bitField:null,i?null!==a&&c.suppressUnhandledRejections():null!==a?0==(50397184&a)?(c._proxy(this,s),this._values[s]=c):i=0!=(33554432&a)?this._promiseFulfilled(c._value(),s):0!=(16777216&a)?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):i=this._promiseFulfilled(c,s)}i||o._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(e){this._values=null,this._promise._fulfill(e)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(e){this._values=null,this._promise._rejectCallback(e,!1)},s.prototype._promiseFulfilled=function(e,t){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var r=0;r<e.length;++r)e[r]instanceof t&&e[r].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(e){return e},s}},{"./util":36}],24:[function(e,t,r){"use strict";t.exports=function(t,r){var n={},o=e("./util"),i=e("./nodeback"),a=o.withAppended,s=o.maybeWrapAsError,c=o.canEvaluate,u=e("./errors").TypeError,l={__isPromisified__:!0},f=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),p=function(e){return o.isIdentifier(e)&&"_"!==e.charAt(0)&&"constructor"!==e};function h(e){return!f.test(e)}function d(e){try{return!0===e.__isPromisified__}catch(e){return!1}}function v(e,t,r){var n=o.getDataPropertyOrDefault(e,t+r,l);return!!n&&d(n)}function _(e,t,r,n){for(var i=o.inheritedDataKeys(e),a=[],s=0;s<i.length;++s){var c=i[s],l=e[c],f=n===p||p(c,l,e);"function"!=typeof l||d(l)||v(e,c,t)||!n(c,l,e,f)||a.push(c,l)}return function(e,t,r){for(var n=0;n<e.length;n+=2){var o=e[n];if(r.test(o))for(var i=o.replace(r,""),a=0;a<e.length;a+=2)if(e[a]===i)throw new u("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",t))}}(a,t,r),a}var y=function(e){return e.replace(/([$])/,"\\$")};var m=c?void 0:function(e,c,u,l,f,p){var h=function(){return this}(),d=e;function v(){var o=c;c===n&&(o=this);var u=new t(r);u._captureStackTrace();var l="string"==typeof d&&this!==h?this[d]:e,f=i(u,p);try{l.apply(o,a(arguments,f))}catch(e){u._rejectCallback(s(e),!0,!0)}return u._isFateSealed()||u._setAsyncGuaranteed(),u}return"string"==typeof d&&(e=l),o.notEnumerableProp(v,"__isPromisified__",!0),v};function g(e,t,r,i,a){for(var s=new RegExp(y(t)+"$"),c=_(e,t,s,r),u=0,l=c.length;u<l;u+=2){var f=c[u],p=c[u+1],h=f+t;if(i===m)e[h]=m(f,n,f,p,t,a);else{var d=i(p,function(){return m(f,n,f,p,t,a)});o.notEnumerableProp(d,"__isPromisified__",!0),e[h]=d}}return o.toFastProperties(e),e}t.promisify=function(e,t){if("function"!=typeof e)throw new u("expecting a function but got "+o.classString(e));if(d(e))return e;var r=function(e,t,r){return m(e,t,void 0,e,null,r)}(e,void 0===(t=Object(t)).context?n:t.context,!!t.multiArgs);return o.copyDescriptors(e,r,h),r},t.promisifyAll=function(e,t){if("function"!=typeof e&&"object"!=typeof e)throw new u("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var r=!!(t=Object(t)).multiArgs,n=t.suffix;"string"!=typeof n&&(n="Async");var i=t.filter;"function"!=typeof i&&(i=p);var a=t.promisifier;if("function"!=typeof a&&(a=m),!o.isIdentifier(n))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=o.inheritedDataKeys(e),c=0;c<s.length;++c){var l=e[s[c]];"constructor"!==s[c]&&o.isClass(l)&&(g(l.prototype,n,i,a,r),g(l,n,i,a,r))}return g(e,n,i,a,r)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(e,t,r){"use strict";t.exports=function(t,r,n,o){var i,a=e("./util"),s=a.isObject,c=e("./es5");"function"==typeof Map&&(i=Map);var u=function(){var e=0,t=0;function r(r,n){this[e]=r,this[e+t]=n,e++}return function(n){t=n.size,e=0;var o=new Array(2*n.size);return n.forEach(r,o),o}}();function l(e){var t,r=!1;if(void 0!==i&&e instanceof i)t=u(e),r=!0;else{var n=c.keys(e),o=n.length;t=new Array(2*o);for(var a=0;a<o;++a){var s=n[a];t[a]=e[s],t[a+o]=s}}this.constructor$(t),this._isMap=r,this._init$(void 0,r?-6:-3)}function f(e){var r,i=n(e);return s(i)?(r=i instanceof t?i._then(t.props,void 0,void 0,void 0,void 0):new l(i).promise(),i instanceof t&&r._propagateFrom(i,2),r):o("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}a.inherits(l,r),l.prototype._init=function(){},l.prototype._promiseFulfilled=function(e,t){if(this._values[t]=e,++this._totalResolved>=this._length){var r;if(this._isMap)r=function(e){for(var t=new i,r=e.length/2|0,n=0;n<r;++n){var o=e[r+n],a=e[n];t.set(o,a)}return t}(this._values);else{r={};for(var n=this.length(),o=0,a=this.length();o<a;++o)r[this._values[o+n]]=this._values[o]}return this._resolve(r),!0}return!1},l.prototype.shouldCopyValues=function(){return!1},l.prototype.getActualLength=function(e){return e>>1},t.prototype.props=function(){return f(this)},t.props=function(e){return f(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function n(e){this._capacity=e,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(e){return this._capacity<e},n.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1),this[this._front+t&this._capacity-1]=e,this._length=t+1},n.prototype.push=function(e,t,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(e),this._pushOne(t),void this._pushOne(r);var o=this._front+n-3;this._checkCapacity(n);var i=this._capacity-1;this[o+0&i]=e,this[o+1&i]=t,this[o+2&i]=r,this._length=n},n.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t},n.prototype.length=function(){return this._length},n.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},n.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e,function(e,t,r,n,o){for(var i=0;i<o;++i)r[i+n]=e[i+t],e[i+t]=void 0}(this,0,this,t,this._front+this._length&t-1)},t.exports=n},{}],27:[function(e,t,r){"use strict";t.exports=function(t,r,n,o){var i=e("./util"),a=function(e){return e.then(function(t){return s(t,e)})};function s(e,s){var c=n(e);if(c instanceof t)return a(c);if(null===(e=i.asArray(e)))return o("expecting an array or an iterable object but got "+i.classString(e));var u=new t(r);void 0!==s&&u._propagateFrom(s,3);for(var l=u._fulfill,f=u._reject,p=0,h=e.length;p<h;++p){var d=e[p];(void 0!==d||p in e)&&t.cast(d)._then(l,f,void 0,u,null)}return u}t.race=function(e){return s(e,void 0)},t.prototype.race=function(){return s(this,void 0)}}},{"./util":36}],28:[function(e,t,r){"use strict";t.exports=function(t,r,n,o,i,a){var s=t._getDomain,c=e("./util"),u=c.tryCatch;function l(e,r,n,o){this.constructor$(e);var a=s();this._fn=null===a?r:c.domainBind(a,r),void 0!==n&&(n=t.resolve(n))._attachCancellationCallback(this),this._initialValue=n,this._currentCancellable=null,this._eachValues=o===i?Array(this._length):0===o?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function f(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function p(e,t,r,o){return"function"!=typeof t?n("expecting a function but got "+c.classString(t)):new l(e,t,r,o).promise()}function h(e){this.accum=e,this.array._gotAccum(e);var r=o(this.value,this.array._promise);return r instanceof t?(this.array._currentCancellable=r,r._then(d,void 0,void 0,this,void 0)):d.call(this,r)}function d(e){var r,n=this.array,o=n._promise,i=u(n._fn);o._pushContext(),(r=void 0!==n._eachValues?i.call(o._boundValue(),e,this.index,this.length):i.call(o._boundValue(),this.accum,e,this.index,this.length))instanceof t&&(n._currentCancellable=r);var s=o._popContext();return a.checkForgottenReturns(r,s,void 0!==n._eachValues?"Promise.each":"Promise.reduce",o),r}c.inherits(l,r),l.prototype._gotAccum=function(e){void 0!==this._eachValues&&null!==this._eachValues&&e!==i&&this._eachValues.push(e)},l.prototype._eachComplete=function(e){return null!==this._eachValues&&this._eachValues.push(e),this._eachValues},l.prototype._init=function(){},l.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},l.prototype.shouldCopyValues=function(){return!1},l.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},l.prototype._resultCancelled=function(e){if(e===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel())},l.prototype._iterate=function(e){var r,n;this._values=e;var o=e.length;if(void 0!==this._initialValue?(r=this._initialValue,n=0):(r=t.resolve(e[0]),n=1),this._currentCancellable=r,!r.isRejected())for(;n<o;++n){var i={accum:null,value:e[n],index:n,length:o,array:this};r=r._then(h,void 0,void 0,i,void 0)}void 0!==this._eachValues&&(r=r._then(this._eachComplete,void 0,void 0,this,void 0)),r._then(f,f,void 0,r,this)},t.prototype.reduce=function(e,t){return p(this,e,t,null)},t.reduce=function(e,t,r,n){return p(e,t,r,n)}}},{"./util":36}],29:[function(e,o,i){"use strict";var a,s=e("./util"),c=s.getNativePromise();if(s.isNode&&"undefined"==typeof MutationObserver){var u=r.setImmediate,l=t.nextTick;a=s.isRecentNode?function(e){u.call(r,e)}:function(e){l.call(t,e)}}else if("function"==typeof c&&"function"==typeof c.resolve){var f=c.resolve();a=function(e){f.then(e)}}else a="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?void 0!==n?function(e){n(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var e=document.createElement("div"),t={attributes:!0},r=!1,n=document.createElement("div");new MutationObserver(function(){e.classList.toggle("foo"),r=!1}).observe(n,t);return function(o){var i=new MutationObserver(function(){i.disconnect(),o()});i.observe(e,t),r||(r=!0,n.classList.toggle("foo"))}}();o.exports=a},{"./util":36}],30:[function(e,t,r){"use strict";t.exports=function(t,r,n){var o=t.PromiseInspection;function i(e){this.constructor$(e)}e("./util").inherits(i,r),i.prototype._promiseResolved=function(e,t){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(e,t){var r=new o;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},i.prototype._promiseRejected=function(e,t){var r=new o;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},t.settle=function(e){return n.deprecated(".settle()",".reflect()"),new i(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,r){"use strict";t.exports=function(t,r,n){var o=e("./util"),i=e("./errors").RangeError,a=e("./errors").AggregateError,s=o.isArray,c={};function u(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function l(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new u(e),o=r.promise();return r.setHowMany(t),r.init(),o}o.inherits(u,r),u.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=s(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(e){this._howMany=e},u.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},u.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t<this._values.length;++t)this._values[t]!==c&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(e){this._values.push(e)},u.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new i(t)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return l(e,t)},t.prototype.some=function(e){return l(this,e)},t._SomePromiseArray=u}},{"./errors":12,"./util":36}],32:[function(e,t,r){"use strict";t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var r=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},o=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},i=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return a.call(this._target())},e.prototype.isRejected=function(){return i.call(this._target())},e.prototype.isFulfilled=function(){return o.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),n.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,r){"use strict";t.exports=function(t,r){var n=e("./util"),o=n.errorObj,i=n.isObject;var a={}.hasOwnProperty;return function(e,s){if(i(e)){if(e instanceof t)return e;var c=function(e){try{return function(e){return e.then}(e)}catch(e){return o.e=e,o}}(e);if(c===o){s&&s._pushContext();var u=t.reject(c.e);return s&&s._popContext(),u}if("function"==typeof c)return function(e){try{return a.call(e,"_promise0")}catch(e){return!1}}(e)?(u=new t(r),e._then(u._fulfill,u._reject,void 0,u,null),u):function(e,i,a){var s=new t(r),c=s;a&&a._pushContext(),s._captureStackTrace(),a&&a._popContext();var u=!0,l=n.tryCatch(i).call(e,function(e){s&&(s._resolveCallback(e),s=null)},function(e){s&&(s._rejectCallback(e,u,!0),s=null)});return u=!1,s&&l===o&&(s._rejectCallback(l.e,!0,!0),s=null),c}(e,c,s)}return e}}},{"./util":36}],34:[function(e,t,r){"use strict";t.exports=function(t,r,n){var o=e("./util"),i=t.TimeoutError;function a(e){this.handle=e}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(e){return c(+this).thenReturn(e)},c=t.delay=function(e,o){var i,c;return void 0!==o?(i=t.resolve(o)._then(s,null,null,e,void 0),n.cancellation()&&o instanceof t&&i._setOnCancel(o)):(i=new t(r),c=setTimeout(function(){i._fulfill()},+e),n.cancellation()&&i._setOnCancel(new a(c)),i._captureStackTrace()),i._setAsyncGuaranteed(),i};t.prototype.delay=function(e){return c(e,this)};function u(e){return clearTimeout(this.handle),e}function l(e){throw clearTimeout(this.handle),e}t.prototype.timeout=function(e,t){var r,s;e=+e;var c=new a(setTimeout(function(){r.isPending()&&function(e,t,r){var n;n="string"!=typeof t?t instanceof Error?t:new i("operation timed out"):new i(t),o.markAsOriginatingFromRejection(n),e._attachExtraTrace(n),e._reject(n),null!=r&&r.cancel()}(r,t,s)},e));return n.cancellation()?(s=this.then(),(r=s._then(u,l,void 0,c,void 0))._setOnCancel(c)):r=this._then(u,l,void 0,c,void 0),r}}},{"./util":36}],35:[function(e,t,r){"use strict";t.exports=function(t,r,n,o,i,a){var s=e("./util"),c=e("./errors").TypeError,u=e("./util").inherits,l=s.errorObj,f=s.tryCatch,p={};function h(e){setTimeout(function(){throw e},0)}function d(e,r){var o=0,a=e.length,s=new t(i);return function i(){if(o>=a)return s._fulfill();var c=function(e){var t=n(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(e[o++]);if(c instanceof t&&c._isDisposable()){try{c=n(c._getDisposer().tryDispose(r),e.promise)}catch(e){return h(e)}if(c instanceof t)return c._then(i,h,null,null,null)}i()}(),s}function v(e,t,r){this._data=e,this._promise=t,this._context=r}function _(e,t,r){this.constructor$(e,t,r)}function y(e){return v.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function m(e){this.length=e,this.promise=null,this[e-1]=null}v.prototype.data=function(){return this._data},v.prototype.promise=function(){return this._promise},v.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():p},v.prototype.tryDispose=function(e){var t=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=t!==p?this.doDispose(t,e):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},v.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},u(_,v),_.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},m.prototype._resultCancelled=function(){for(var e=this.length,r=0;r<e;++r){var n=this[r];n instanceof t&&n.cancel()}},t.using=function(){var e=arguments.length;if(e<2)return r("you must pass at least 2 arguments to Promise.using");var o,i=arguments[e-1];if("function"!=typeof i)return r("expecting a function but got "+s.classString(i));var c=!0;2===e&&Array.isArray(arguments[0])?(e=(o=arguments[0]).length,c=!1):(o=arguments,e--);for(var u=new m(e),p=0;p<e;++p){var h=o[p];if(v.isDisposer(h)){var _=h;(h=h.promise())._setDisposable(_)}else{var g=n(h);g instanceof t&&(h=g._then(y,null,null,{resources:u,index:p},void 0))}u[p]=h}var b=new Array(u.length);for(p=0;p<b.length;++p)b[p]=t.resolve(u[p]).reflect();var w=t.all(b).then(function(e){for(var t=0;t<e.length;++t){var r=e[t];if(r.isRejected())return l.e=r.error(),l;if(!r.isFulfilled())return void w.cancel();e[t]=r.value()}C._pushContext(),i=f(i);var n=c?i.apply(void 0,e):i(e),o=C._popContext();return a.checkForgottenReturns(n,o,"Promise.using",C),n}),C=w.lastly(function(){var e=new t.PromiseInspection(w);return d(u,e)});return u.promise=C,C._setOnCancel(u),C},t.prototype._setDisposable=function(e){this._bitField=131072|this._bitField,this._disposer=e},t.prototype._isDisposable=function(){return(131072&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new _(e,this,o());throw new c}}},{"./errors":12,"./util":36}],36:[function(e,n,o){"use strict";var i=e("./es5"),a="undefined"==typeof navigator,s={e:{}},c,u="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:void 0!==this?this:null;function l(){try{var e=c;return c=null,e.apply(this,arguments)}catch(e){return s.e=e,s}}function f(e){return c=e,l}var p=function(e,t){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=e,this.constructor$=t,t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}return n.prototype=t.prototype,e.prototype=new n,e.prototype};function h(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function d(e){return"function"==typeof e||"object"==typeof e&&null!==e}function v(e){return h(e)?new Error(F(e)):e}function _(e,t){var r,n=e.length,o=new Array(n+1);for(r=0;r<n;++r)o[r]=e[r];return o[r]=t,o}function y(e,t,r){if(!i.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var n=Object.getOwnPropertyDescriptor(e,t);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function m(e,t,r){if(h(e))return e;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return i.defineProperty(e,t,n),e}function g(e){throw e}var b=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1};if(i.isES5){var r=Object.getOwnPropertyNames;return function(e){for(var n=[],o=Object.create(null);null!=e&&!t(e);){var a;try{a=r(e)}catch(e){return n}for(var s=0;s<a.length;++s){var c=a[s];if(!o[c]){o[c]=!0;var u=Object.getOwnPropertyDescriptor(e,c);null!=u&&null==u.get&&null==u.set&&n.push(c)}}e=i.getPrototypeOf(e)}return n}}var n={}.hasOwnProperty;return function(r){if(t(r))return[];var o=[];e:for(var i in r)if(n.call(r,i))o.push(i);else{for(var a=0;a<e.length;++a)if(n.call(e[a],i))continue e;o.push(i)}return o}}(),w=/this\s*\.\s*\S+\s*=/;function C(e){try{if("function"==typeof e){var t=i.names(e.prototype),r=i.isES5&&t.length>1,n=t.length>0&&!(1===t.length&&"constructor"===t[0]),o=w.test(e+"")&&i.names(e).length>0;if(r||n||o)return!0}return!1}catch(e){return!1}}function E(e){function t(){}t.prototype=e;var r=new t;function n(){return typeof r.foo}return n(),n(),e}var k=/^[a-z$_][a-z$_0-9]*$/i;function j(e){return k.test(e)}function x(e,t,r){for(var n=new Array(e),o=0;o<e;++o)n[o]=t+o+r;return n}function F(e){try{return e+""}catch(e){return"[no string representation]"}}function P(e){return e instanceof Error||null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name}function T(e){try{m(e,"isOperational",!0)}catch(e){}}function O(e){return null!=e&&(e instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===e.isOperational)}function A(e){return P(e)&&i.propertyIsWritable(e,"stack")}var S="stack"in new Error?function(e){return A(e)?e:new Error(F(e))}:function(e){if(A(e))return e;try{throw new Error(F(e))}catch(e){return e}};function R(e){return{}.toString.call(e)}function N(e,t,r){for(var n=i.names(e),o=0;o<n.length;++o){var a=n[o];if(r(a))try{i.defineProperty(t,a,i.getDescriptor(e,a))}catch(e){}}}var D=function(e){return i.isArray(e)?e:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var I="function"==typeof Array.from?function(e){return Array.from(e)}:function(e){for(var t,r=[],n=e[Symbol.iterator]();!(t=n.next()).done;)r.push(t.value);return r};D=function(e){return i.isArray(e)?e:null!=e&&"function"==typeof e[Symbol.iterator]?I(e):null}}var M=void 0!==t&&"[object process]"===R(t).toLowerCase(),L=void 0!==t&&void 0!==t.env;function U(e){return L?t.env[e]:void 0}function V(){if("function"==typeof Promise)try{var e=new Promise(function(){});if("[object Promise]"==={}.toString.call(e))return Promise}catch(e){}}function B(e,t){return e.bind(t)}var H={isClass:C,isIdentifier:j,inheritedDataKeys:b,getDataPropertyOrDefault:y,thrower:g,isArray:i.isArray,asArray:D,notEnumerableProp:m,isPrimitive:h,isObject:d,isError:P,canEvaluate:a,errorObj:s,tryCatch:f,inherits:p,withAppended:_,maybeWrapAsError:v,toFastProperties:E,filledRange:x,toString:F,canAttachTrace:A,ensureErrorObject:S,originatesFromRejection:O,markAsOriginatingFromRejection:T,classString:R,copyDescriptors:N,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:M,hasEnvVariables:L,env:U,global:u,getNativePromise:V,domainBind:B},q;H.isRecentNode=H.isNode&&(q=t.versions.node.split(".").map(Number),0===q[0]&&q[1]>10||q[0]>0),H.isNode&&H.toFastProperties(t);try{throw new Error}catch(e){H.lastLineError=e}n.exports=H},{"./es5":13}]},{},[4])(4)},e.exports=o(),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,r(2),r(0),r(12).setImmediate)},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(13),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(0))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,o,i,a,s,c=1,u={},l=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},n=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,n=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):n=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var o={callback:e,args:t};return u[c]=o,n(c),c++},p.clearImmediate=h}function h(e){delete u[e]}function d(e){if(l)setTimeout(d,0,e);else{var t=u[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(r,n)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(0),r(2))}])});
2
- //# sourceMappingURL=fluent-formio.min.js.map