text: "use strict";var _typeof="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};!function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){(function(e,r){/* @preserve
               * The MIT License (MIT)
               * 
               * Copyright (c) 2013-2017 Petka Antonov
               * 
               * Permission is hereby granted, free of charge, to any person obtaining a copy
               * of this software and associated documentation files (the "Software"), to deal
               * in the Software without restriction, including without limitation the rights
               * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
               * copies of the Software, and to permit persons to whom the Software is
               * furnished to do so, subject to the following conditions:
               * 
               * The above copyright notice and this permission notice shall be included in
               * all copies or substantial portions of the Software.
               * 
               * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
               * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
               * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
               * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
               * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
               * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
               * THE SOFTWARE.
               * 
               */
  !function(e){if("object"==("undefined"==typeof n?"undefined":_typeof(n))&&"undefined"!=typeof t)t.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i;"undefined"!=typeof window?i=window:"undefined"!=typeof r?i=r:"undefined"!=typeof self&&(i=self),i.Promise=e()}}(function(){var t,n,i;return function o(e,t,n){function r(a,s){if(!t[a]){if(!e[a]){var l="function"==typeof _dereq_&&_dereq_;if(!s&&l)return l(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=t[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return r(n?n:t)},u,u.exports,o,e,t,n)}return t[a].exports}for(var i="function"==typeof _dereq_&&_dereq_,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(e,t,n){t.exports=function(e){function t(e){var t=new n(e),r=t.promise();return t.setHowMany(1),t.setUnwrap(),t.init(),r}var n=e._SomePromiseArray;e.any=function(e){return t(e)},e.prototype.any=function(){return t(this)}}},{}],2:[function(t,n,r){function i(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new f(16),this._normalQueue=new f(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=u}function o(e,t,n){this._lateQueue.push(e,t,n),this._queueTick()}function a(e,t,n){this._normalQueue.push(e,t,n),this._queueTick()}function s(e){this._normalQueue._pushOne(e),this._queueTick()}var l;try{throw new Error}catch(c){l=c}var u=t("./schedule"),f=t("./queue"),d=t("./util");i.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},i.prototype.hasCustomScheduler=function(){return this._customScheduler},i.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},i.prototype.disableTrampolineIfNecessary=function(){d.hasDevTools&&(this._trampolineEnabled=!1)},i.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},i.prototype.fatalError=function(t,n){n?(e.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),e.exit(2)):this.throwLater(t)},i.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(n){throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n")}},d.hasDevTools?(i.prototype.invokeLater=function(e,t,n){this._trampolineEnabled?o.call(this,e,t,n):this._schedule(function(){setTimeout(function(){e.call(t,n)},100)})},i.prototype.invoke=function(e,t,n){this._trampolineEnabled?a.call(this,e,t,n):this._schedule(function(){e.call(t,n)})},i.prototype.settlePromises=function(e){this._trampolineEnabled?s.call(this,e):this._schedule(function(){e._settlePromises()})}):(i.prototype.invokeLater=o,i.prototype.invoke=a,i.prototype.settlePromises=s),i.prototype._drainQueue=function(e){for(;e.length()>0;){var t=e.shift();if("function"==typeof t){var n=e.shift(),r=e.shift();t.call(n,r)}else t._settlePromises()}},i.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},i.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},i.prototype._reset=function(){this._isTickUsed=!1},n.exports=i,n.exports.firstLineError=l},{"./queue":26,"./schedule":29,"./util":36}],3:[function(e,t,n){t.exports=function(e,t,n,r){var i=!1,o=function(e,t){this._reject(t)},a=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(o,o,null,this,e)},s=function(e,t){0===(50397184&this._bitField)&&this._resolveCallback(t.target)},l=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(o){i||(i=!0,e.prototype._propagateFrom=r.propagateFromFunction(),e.prototype._boundValue=r.boundValueFunction());var c=n(o),u=new e(t);u._propagateFrom(this,1);var f=this._target();if(u._setBoundTo(c),c instanceof e){var d={promiseRejectionQueued:!1,promise:u,target:f,bindingPromise:c};f._then(t,a,void 0,u,d),c._then(s,l,void 0,u,d),u._setOnCancel(c)}else u._resolveCallback(f);return u},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=this._bitField&-2097153},e.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},e.bind=function(t,n){return e.resolve(n).bind(t)}}},{}],4:[function(e,t,n){function r(){try{Promise===o&&(Promise=i)}catch(e){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=e("./promise")();o.noConflict=r,t.exports=o},{"./promise":22}],5:[function(e,t,n){var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}t.exports=function(t){function n(e,n){var r;if(null!=e&&(r=e[n]),"function"!=typeof r){var i="Object "+s.classString(e)+" has no method '"+s.toString(n)+"'";throw new t.TypeError(i)}return r}function r(e){var t=this.pop(),r=n(e,t);return r.apply(e,this)}function i(e){return e[this]}function o(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}var a,s=e("./util"),l=s.canEvaluate;s.isIdentifier;t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(r,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t,n="number"==typeof e;if(n)t=o;else if(l){var r=a(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,n){t.exports=function(t,n,r,i){var o=e("./util"),a=o.tryCatch,s=o.errorObj,l=t._async;t.prototype["break"]=t.prototype.cancel=function(){if(!i.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 n=e._cancellationParent;if(null==n||!n._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=n}},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(),l.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(o.isArray(e))for(var n=0;n<e.length;++n)this._doInvokeOnCancel(e[n],t);else if(void 0!==e)if("function"==typeof e){if(!t){var r=a(e).call(this._boundValue());r===s&&(this._attachExtraTrace(r.e),l.throwLater(r.e))}}else e._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),l.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,n){t.exports=function(t){function n(e,n,s){return function(l){var c=s._boundValue();e:for(var u=0;u<e.length;++u){var f=e[u];if(f===Error||null!=f&&f.prototype instanceof Error){if(l instanceof f)return o(n).call(c,l)}else if("function"==typeof f){var d=o(f).call(c,l);if(d===a)return d;if(d)return o(n).call(c,l)}else if(r.isObject(l)){for(var p=i(f),h=0;h<p.length;++h){var v=p[h];if(f[v]!=l[v])continue e}return o(n).call(c,l)}}return t}}var r=e("./util"),i=e("./es5").keys,o=r.tryCatch,a=r.errorObj;return n}},{"./es5":13,"./util":36}],8:[function(e,t,n){t.exports=function(e){function t(){this._trace=new t.CapturedTrace(r())}function n(){if(i)return new t}function r(){var e=o.length-1;if(e>=0)return o[e]}var i=!1,o=[];return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},t.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},t.prototype._popContext=function(){if(void 0!==this._trace){var e=o.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},t.CapturedTrace=null,t.create=n,t.deactivateLongStackTraces=function(){},t.activateLongStackTraces=function(){var n=e.prototype._pushContext,o=e.prototype._popContext,a=e._peekContext,s=e.prototype._peekContext,l=e.prototype._promiseCreated;t.deactivateLongStackTraces=function(){e.prototype._pushContext=n,e.prototype._popContext=o,e._peekContext=a,e.prototype._peekContext=s,e.prototype._promiseCreated=l,i=!1},i=!0,e.prototype._pushContext=t.prototype._pushContext,e.prototype._popContext=t.prototype._popContext,e._peekContext=e.prototype._peekContext=r,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},t}},{}],9:[function(t,n,r){n.exports=function(n,r){function i(e,t){return{promise:t}}function o(){return!1}function a(e,t,n){var r=this;try{e(t,n,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+M.toString(e));r._attachCancellationCallback(e)})}catch(i){return i}}function s(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?M.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function l(){return this._onCancelField}function c(e){this._onCancelField=e}function u(){this._cancellationParent=void 0,this._onCancelField=void 0}function f(e,t){if(0!==(1&t)){this._cancellationParent=e;var n=e._branchesRemainingToCancel;void 0===n&&(n=0),e._branchesRemainingToCancel=n+1}0!==(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function d(e,t){0!==(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function p(){var e=this._boundTo;return void 0!==e&&e instanceof n?e.isFulfilled()?e.value():void 0:e}function h(){this._trace=new R(this._peekContext())}function v(e,t){if(U(e)){var n=this._trace;if(void 0!==n&&t&&(n=n._parent),void 0!==n)n.attachExtraTrace(e);else if(!e.__stackCleaned__){var r=E(e);M.notEnumerableProp(e,"stack",r.message+"\n"+r.stack.join("\n")),M.notEnumerableProp(e,"__stackCleaned__",!0)}}}function _(e,t,n,r,i){if(void 0===e&&null!==t&&J){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="",a="";if(t._trace){for(var s=t._trace.stack.split("\n"),l=C(s),c=l.length-1;c>=0;--c){var u=l[c];if(!B.test(u)){var f=u.match(V);f&&(o="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(l.length>0)for(var d=l[0],c=0;c<s.length;++c)if(s[c]===d){c>0&&(a="\n"+s[c-1]);break}}var p="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;r._warn(p,!0,t)}}function m(e,t){var n=e+" is deprecated and will be removed in a future version.";return t&&(n+=" Use "+t+" instead."),g(n)}function g(e,t,r){if(ae.warnings){var i,o=new N(e);if(t)r._attachExtraTrace(o);else if(ae.longStackTraces&&(i=n._peekContext()))i.attachExtraTrace(o);else{var a=E(o);o.stack=a.message+"\n"+a.stack.join("\n")}te("warning",o)||$(o,"",!0)}}function y(e,t){for(var n=0;n<t.length-1;++n)t[n].push("From previous event:"),t[n]=t[n].join("\n");return n<t.length&&(t[n]=t[n].join("\n")),e+"\n"+t.join("\n")}function b(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--)}function w(e){for(var t=e[0],n=1;n<e.length;++n){for(var r=e[n],i=t.length-1,o=t[i],a=-1,s=r.length-1;s>=0;--s)if(r[s]===o){a=s;break}for(var s=a;s>=0;--s){var l=r[s];if(t[i]!==l)break;t.pop(),i--}t=r}}function C(e){for(var t=[],n=0;n<e.length;++n){var r=e[n],i="    (No stack trace)"===r||q.test(r),o=i&&re(r);i&&!o&&(W&&" "!==r.charAt(0)&&(r="    "+r),t.push(r))}return t}function k(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),n=0;n<t.length;++n){var r=t[n];if("    (No stack trace)"===r||q.test(r))break}return n>0&&"SyntaxError"!=e.name&&(t=t.slice(n)),t}function E(e){var t=e.stack,n=e.toString();return t="string"==typeof t&&t.length>0?k(e):["    (No stack trace)"],{message:n,stack:"SyntaxError"==e.name?t:C(t)}}function $(e,t,n){if("undefined"!=typeof console){var r;if(M.isObject(e)){var i=e.stack;r=t+z(i,e)}else r=t+String(e);"function"==typeof L?L(r,n):"function"!=typeof console.log&&"object"!==_typeof(console.log)||console.log(r)}}function j(e,t,n,r){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(r):t(n,r))}catch(o){I.throwLater(o)}"unhandledRejection"===e?te(e,n,r)||i||$(n,"Unhandled rejection "):te(e,r)}function F(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():M.toString(e);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(t))try{var r=JSON.stringify(e);t=r}catch(i){}0===t.length&&(t="(empty array)")}return"(<"+x(t)+">, no stack trace)"}function x(e){var t=41;return e.length<t?e:e.substr(0,t-3)+"..."}function T(){return"function"==typeof oe}function S(e){var t=e.match(ie);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function P(e,t){if(T()){for(var n,r,i=e.stack.split("\n"),o=t.stack.split("\n"),a=-1,s=-1,l=0;l<i.length;++l){var c=S(i[l]);if(c){n=c.fileName,a=c.line;break}}for(var l=0;l<o.length;++l){var c=S(o[l]);if(c){r=c.fileName,s=c.line;break}}a<0||s<0||!n||!r||n!==r||a>=s||(re=function(e){if(H.test(e))return!0;var t=S(e);return!!(t&&t.fileName===n&&a<=t.line&&t.line<=s)})}}function R(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);oe(this,R),t>32&&this.uncycle()}var O,A,L,D=n._getDomain,I=n._async,N=t("./errors").Warning,M=t("./util"),U=M.canAttachTrace,H=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,B=/\((?:timers\.js):\d+:\d+\)/,V=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,z=null,W=!1,G=!(0==M.env("BLUEBIRD_DEBUG")),K=!(0==M.env("BLUEBIRD_WARNINGS")||!G&&!M.env("BLUEBIRD_WARNINGS")),Q=!(0==M.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!M.env("BLUEBIRD_LONG_STACK_TRACES")),J=0!=M.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(K||!!M.env("BLUEBIRD_W_FORGOTTEN_RETURN"));n.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=e._bitField&-1048577|524288},n.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},n.prototype._notifyUnhandledRejectionIsHandled=function(){j("rejectionHandled",O,void 0,this)},n.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},n.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},n.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),j("unhandledRejection",A,e,this)}},n.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},n.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},n.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},n.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},n.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},n.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},n.prototype._warn=function(e,t,n){return g(e,t,n||this)},n.onPossiblyUnhandledRejection=function(e){var t=D();A="function"==typeof e?null===t?e:M.domainBind(t,e):void 0},n.onUnhandledRejectionHandled=function(e){var t=D();O="function"==typeof e?null===t?e:M.domainBind(t,e):void 0};var X=function(){};n.longStackTraces=function(){if(I.haveItemsQueued()&&!ae.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");if(!ae.longStackTraces&&T()){var e=n.prototype._captureStackTrace,t=n.prototype._attachExtraTrace;ae.longStackTraces=!0,X=function(){if(I.haveItemsQueued()&&!ae.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");n.prototype._captureStackTrace=e,n.prototype._attachExtraTrace=t,r.deactivateLongStackTraces(),I.enableTrampoline(),ae.longStackTraces=!1},n.prototype._captureStackTrace=h,n.prototype._attachExtraTrace=v,r.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},n.hasLongStackTraces=function(){return ae.longStackTraces&&T()};var Y=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return M.global.dispatchEvent(e),function(e,t){var n=new CustomEvent(e.toLowerCase(),{detail:t,cancelable:!0});return!M.global.dispatchEvent(n)}}if("function"==typeof Event){var e=new Event("CustomEvent");return M.global.dispatchEvent(e),function(e,t){var n=new Event(e.toLowerCase(),{cancelable:!0});return n.detail=t,!M.global.dispatchEvent(n)}}var e=document.createEvent("CustomEvent");return e.initCustomEvent("testingtheevent",!1,!0,{}),M.global.dispatchEvent(e),function(e,t){var n=document.createEvent("CustomEvent");return n.initCustomEvent(e.toLowerCase(),!1,!0,t),!M.global.dispatchEvent(n)}}catch(t){}return function(){return!1}}(),Z=function(){return M.isNode?function(){return e.emit.apply(e,arguments)}:M.global?function(e){var t="on"+e.toLowerCase(),n=M.global[t];return!!n&&(n.apply(M.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),ee={promiseCreated:i,promiseFulfilled:i,promiseRejected:i,promiseResolved:i,promiseCancelled:i,promiseChained:function(e,t,n){return{promise:t,child:n}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,n){return{reason:t,promise:n}},rejectionHandled:i},te=function(e){var t=!1;try{t=Z.apply(null,arguments)}catch(n){I.throwLater(n),t=!0}var r=!1;try{r=Y(e,ee[e].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||t};n.config=function(e){if(e=Object(e),"longStackTraces"in e&&(e.longStackTraces?n.longStackTraces():!e.longStackTraces&&n.hasLongStackTraces()&&X()),"warnings"in e){var t=e.warnings;ae.warnings=!!t,J=ae.warnings,M.isObject(t)&&"wForgottenReturn"in t&&(J=!!t.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!ae.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");n.prototype._clearCancellationData=u,n.prototype._propagateFrom=f,n.prototype._onCancel=l,n.prototype._setOnCancel=c,n.prototype._attachCancellationCallback=s,n.prototype._execute=a,ne=f,ae.cancellation=!0}return"monitoring"in e&&(e.monitoring&&!ae.monitoring?(ae.monitoring=!0,n.prototype._fireEvent=te):!e.monitoring&&ae.monitoring&&(ae.monitoring=!1,n.prototype._fireEvent=o)),n},n.prototype._fireEvent=o,n.prototype._execute=function(e,t,n){try{e(t,n)}catch(r){return r}},n.prototype._onCancel=function(){},n.prototype._setOnCancel=function(e){},n.prototype._attachCancellationCallback=function(e){},n.prototype._captureStackTrace=function(){},n.prototype._attachExtraTrace=function(){},n.prototype._clearCancellationData=function(){},n.prototype._propagateFrom=function(e,t){};var ne=d,re=function(){return!1},ie=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;M.inherits(R,Error),r.CapturedTrace=R,R.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],n={},r=0,i=this;void 0!==i;++r)t.push(i),i=i._parent;e=this._length=r;for(var r=e-1;r>=0;--r){var o=t[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;r<e;++r){var a=t[r].stack,s=n[a];if(void 0!==s&&s!==r){s>0&&(t[s-1]._parent=void 0,t[s-1]._length=1),t[r]._parent=void 0,t[r]._length=1;var l=r>0?t[r-1]:this;s<e-1?(l._parent=t[s+1],l._parent.uncycle(),l._length=l._parent._length+1):(l._parent=void 0,l._length=1);for(var c=l._length+1,u=r-2;u>=0;--u)t[u]._length=c,c++;return}}}},R.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=E(e),n=t.message,r=[t.stack],i=this;void 0!==i;)r.push(C(i.stack.split("\n"))),i=i._parent;w(r),b(r),M.notEnumerableProp(e,"stack",y(n,r)),M.notEnumerableProp(e,"__stackCleaned__",!0)}};var oe=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():F(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=e,z=t;var n=Error.captureStackTrace;return re=function(e){return H.test(e)},function(e,t){Error.stackTraceLimit+=6,n(e,t),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,z=t,W=!0,function(e){e.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(z=function(e,t){return"string"==typeof e?e:"object"!==("undefined"==typeof t?"undefined":_typeof(t))&&"function"!=typeof t||void 0===t.name||void 0===t.message?F(t):t.toString()},null):(q=e,z=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(L=function(e){console.warn(e)},M.isNode&&e.stderr.isTTY?L=function(e,t){var n=t?"[33m":"[31m";console.warn(n+e+"[0m\n")}:M.isNode||"string"!=typeof(new Error).stack||(L=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var ae={warnings:K,longStackTraces:!1,cancellation:!1,monitoring:!1};return Q&&n.longStackTraces(),{longStackTraces:function(){return ae.longStackTraces},warnings:function(){return ae.warnings},cancellation:function(){return ae.cancellation},monitoring:function(){return ae.monitoring},propagateFromFunction:function(){return ne},boundValueFunction:function(){return p},checkForgottenReturns:_,setBounds:P,warn:g,deprecated:m,CapturedTrace:R,fireDomEvent:Y,fireGlobalEvent:Z}}},{"./errors":12,"./util":36}],10:[function(e,t,n){t.exports=function(e){function t(){return this.value}function n(){throw this.reason}e.prototype["return"]=e.prototype.thenReturn=function(n){return n instanceof e&&n.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:n},void 0)},e.prototype["throw"]=e.prototype.thenThrow=function(e){return this._then(n,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:e},void 0);var t=arguments[1],r=function(){throw t};return this.caught(e,r)},e.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof e&&n.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:n},void 0);var r=arguments[1];r instanceof e&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(e,t,n){t.exports=function(e,t){function n(){return o(this)}function r(e,n){return i(e,n,t,t)}var i=e.reduce,o=e.all;e.prototype.each=function(e){return i(this,e,t,0)._then(n,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return i(this,e,t,t)},e.each=function(e,r){return i(e,r,t,0)._then(n,void 0,void 0,e,void 0)},e.mapSeries=r}},{}],12:[function(e,t,n){function r(e,t){function n(r){return this instanceof n?(f(this,"message","string"==typeof r?r:t),f(this,"name",e),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(e){return this instanceof i?(f(this,"name","OperationalError"),f(this,"message",e),this.cause=e,this.isOperational=!0,void(e instanceof Error?(f(this,"message",e.message),f(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(e)}var o,a,s=e("./es5"),l=s.freeze,c=e("./util"),u=c.inherits,f=c.notEnumerableProp,d=r("Warning","warning"),p=r("CancellationError","cancellation error"),h=r("TimeoutError","timeout error"),v=r("AggregateError","aggregate error");try{o=TypeError,a=RangeError}catch(_){o=r("TypeError","type error"),a=r("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g<m.length;++g)"function"==typeof Array.prototype[m[g]]&&(v.prototype[m[g]]=Array.prototype[m[g]]);s.defineProperty(v.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),v.prototype.isOperational=!0;var y=0;v.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 n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",i=r.split("\n"),o=0;o<i.length;++o)i[o]=e+i[o];r=i.join("\n"),t+=r+"\n"}return y--,t},u(i,Error);var b=Error.__BluebirdErrorTypes__;b||(b=l({CancellationError:p,TimeoutError:h,OperationalError:i,RejectionError:i,AggregateError:v}),s.defineProperty(Error,"__BluebirdErrorTypes__",{value:b,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error:Error,TypeError:o,RangeError:a,CancellationError:b.CancellationError,OperationalError:b.OperationalError,TimeoutError:b.TimeoutError,AggregateError:b.AggregateError,Warning:d}},{"./es5":13,"./util":36}],13:[function(e,t,n){var r=function(){return void 0===this}();if(r)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!(n&&!n.writable&&!n.set)}};else{var i={}.hasOwnProperty,o={}.toString,a={}.constructor.prototype,s=function(e){var t=[];for(var n in e)i.call(e,n)&&t.push(n);return t},l=function(e,t){return{value:e[t]}},c=function(e,t,n){return e[t]=n.value,e},u=function(e){return e},f=function(e){try{return Object(e).constructor.prototype}catch(t){return a}},d=function(e){try{return"[object Array]"===o.call(e)}catch(t){return!1}};t.exports={isArray:d,keys:s,names:s,defineProperty:c,getDescriptor:l,freeze:u,getPrototypeOf:f,isES5:r,propertyIsWritable:function(){return!0}}}},{}],14:[function(e,t,n){t.exports=function(e,t){var n=e.map;e.prototype.filter=function(e,r){return n(this,e,r,t)},e.filter=function(e,r,i){return n(e,r,i,t)}}},{}],15:[function(e,t,n){t.exports=function(t,n,r){function i(e,t,n){this.promise=e,this.type=t,this.handler=n,this.called=!1,this.cancelPromise=null}function o(e){this.finallyHandler=e}function a(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function s(){return c.call(this,this.promise._target()._settledValue())}function l(e){if(!a(this,e))return d.e=e,d}function c(e){var i=this.promise,c=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?c.call(i._boundValue()):c.call(i._boundValue(),e);if(u===r)return u;if(void 0!==u){i._setReturnedNonUndefined();var p=n(u,i);if(p instanceof t){if(null!=this.cancelPromise){if(p._isCancelled()){var h=new f("late cancellation observer");return i._attachExtraTrace(h),d.e=h,d}p.isPending()&&p._attachCancellationCallback(new o(this))}return p._then(s,l,void 0,this,void 0)}}}return i.isRejected()?(a(this),d.e=e,d):(a(this),e)}var u=e("./util"),f=t.CancellationError,d=u.errorObj,p=e("./catch_filter")(r);return i.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){a(this.finallyHandler)},t.prototype._passThrough=function(e,t,n,r){return"function"!=typeof e?this.then():this._then(n,r,void 0,new i(this,t,e),void 0)},t.prototype.lastly=t.prototype["finally"]=function(e){return this._passThrough(e,0,c,c)},t.prototype.tap=function(e){return this._passThrough(e,1,c)},t.prototype.tapCatch=function(e){var n=arguments.length;if(1===n)return this._passThrough(e,1,void 0,c);var r,i=new Array(n-1),o=0;for(r=0;r<n-1;++r){var a=arguments[r];if(!u.isObject(a))return t.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+u.classString(a)));i[o++]=a}i.length=o;var s=arguments[r];return this._passThrough(p(i,s,this),1,void 0,c)},i}},{"./catch_filter":7,"./util":36}],16:[function(e,t,n){t.exports=function(t,n,r,i,o,a){function s(e,n,r){for(var o=0;o<n.length;++o){r._pushContext();var a=p(n[o])(e);if(r._popContext(),a===d){r._pushContext();var s=t.reject(d.e);return r._popContext(),s}var l=i(a,r);if(l instanceof t)return l}return null}function l(e,n,i,o){if(a.cancellation()){var s=new t(r),l=this._finallyPromise=new t(r);this._promise=s.lastly(function(){return l}),s._captureStackTrace(),s._setOnCancel(this)}else{var c=this._promise=new t(r);c._captureStackTrace()}this._stack=o,this._generatorFunction=e,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(h):h,this._yieldedPromise=null,this._cancellationPhase=!1}var c=e("./errors"),u=c.TypeError,f=e("./util"),d=f.errorObj,p=f.tryCatch,h=[];f.inherits(l,o),l.prototype._isResolved=function(){return null===this._promise},l.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},l.prototype._promiseCancelled=function(){if(!this._isResolved()){var e,n="undefined"!=typeof this._generator["return"];if(n)this._promise._pushContext(),e=p(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=p(this._generator["throw"]).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(e)}},l.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=p(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},l.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=p(this._generator["throw"]).call(this._generator,e);this._promise._popContext(),this._continue(t)},l.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof t){var e=this._yieldedPromise;this._yieldedPromise=null,e.cancel()}},l.prototype.promise=function(){return this._promise},l.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},l.prototype._continue=function(e){var n=this._promise;if(e===d)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(e.e,!1);var r=e.value;if(e.done===!0)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(r);var o=i(r,this._promise);if(!(o instanceof t)&&(o=s(o,this._yieldHandlers,this._promise),null===o))return void this._promiseRejected(new u("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(r))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));o=o._target();var a=o._bitField;0===(50397184&a)?(this._yieldedPromise=o,o._proxy(this,null)):0!==(33554432&a)?t._async.invoke(this._promiseFulfilled,this,o._value()):0!==(16777216&a)?t._async.invoke(this._promiseRejected,this,o._reason()):this._promiseCancelled()},t.coroutine=function(e,t){if("function"!=typeof e)throw new u("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");
  var n=Object(t).yieldHandler,r=l,i=(new Error).stack;return function(){var t=e.apply(this,arguments),o=new r((void 0),(void 0),n,i),a=o.promise();return o._generator=t,o._promiseFulfilled(void 0),a}},t.coroutine.addYieldHandler=function(e){if("function"!=typeof e)throw new u("expecting a function but got "+f.classString(e));h.push(e)},t.spawn=function(e){if(a.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof e)return n("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");var r=new l(e,this),i=r.promise();return r._run(t.spawn),i}}},{"./errors":12,"./util":36}],17:[function(e,t,n){t.exports=function(t,n,r,i,o,a){var s=e("./util");s.canEvaluate,s.tryCatch,s.errorObj;t.join=function(){var e,t=arguments.length-1;if(t>0&&"function"==typeof arguments[t]){e=arguments[t];var r}var i=[].slice.call(arguments);e&&i.pop();var r=new n(i).promise();return void 0!==e?r.spread(e):r}}},{"./util":36}],18:[function(e,t,n){t.exports=function(t,n,r,i,o,a){function s(e,t,n,r){this.constructor$(e),this._promise._captureStackTrace();var i=c();this._callback=null===i?t:u.domainBind(i,t),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],p.invoke(this._asyncInit,this,void 0)}function l(e,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+u.classString(n));var a=0;if(void 0!==i){if("object"!==("undefined"==typeof i?"undefined":_typeof(i))||null===i)return t.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));a=i.concurrency}return a="number"==typeof a&&isFinite(a)&&a>=1?a:0,new s(e,n,a,o).promise()}var c=t._getDomain,u=e("./util"),f=u.tryCatch,d=u.errorObj,p=t._async;u.inherits(s,n),s.prototype._asyncInit=function(){this._init$(void 0,-2)},s.prototype._init=function(){},s.prototype._promiseFulfilled=function(e,n){var r=this._values,o=this.length(),s=this._preservedValues,l=this._limit;if(n<0){if(n=n*-1-1,r[n]=e,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return r[n]=e,this._queue.push(n),!1;null!==s&&(s[n]=e);var c=this._promise,u=this._callback,p=c._boundValue();c._pushContext();var h=f(u).call(p,e,n,o),v=c._popContext();if(a.checkForgottenReturns(h,v,null!==s?"Promise.filter":"Promise.map",c),h===d)return this._reject(h.e),!0;var _=i(h,this._promise);if(_ instanceof t){_=_._target();var m=_._bitField;if(0===(50397184&m))return l>=1&&this._inFlight++,r[n]=_,_._proxy(this,(n+1)*-1),!1;if(0===(33554432&m))return 0!==(16777216&m)?(this._reject(_._reason()),!0):(this._cancel(),!0);h=_._value()}r[n]=h}var g=++this._totalResolved;return g>=o&&(null!==s?this._filter(r,s):this._resolve(r),!0)},s.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,n=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var r=e.pop();this._promiseFulfilled(n[r],r)}},s.prototype._filter=function(e,t){for(var n=t.length,r=new Array(n),i=0,o=0;o<n;++o)e[o]&&(r[i++]=t[o]);r.length=i,this._resolve(r)},s.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(e,t){return l(this,e,t,null)},t.map=function(e,t,n,r){return l(e,t,n,r)}}},{"./util":36}],19:[function(e,t,n){t.exports=function(t,n,r,i,o){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 r=new t(n);r._captureStackTrace(),r._pushContext();var i=s(e).apply(this,arguments),a=r._popContext();return o.checkForgottenReturns(i,a,"Promise.method",r),r._resolveFromSyncValue(i),r}},t.attempt=t["try"]=function(e){if("function"!=typeof e)return i("expecting a function but got "+a.classString(e));var r=new t(n);r._captureStackTrace(),r._pushContext();var l;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],u=arguments[2];l=a.isArray(c)?s(e).apply(u,c):s(e).call(u,c)}else l=s(e)();var f=r._popContext();return o.checkForgottenReturns(l,f,"Promise.try",r),r._resolveFromSyncValue(l),r},t.prototype._resolveFromSyncValue=function(e){e===a.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,n){function r(e){return e instanceof Error&&u.getPrototypeOf(e)===Error.prototype}function i(e){var t;if(r(e)){t=new c(e),t.name=e.name,t.message=e.message,t.stack=e.stack;for(var n=u.keys(e),i=0;i<n.length;++i){var o=n[i];f.test(o)||(t[o]=e[o])}return t}return a.markAsOriginatingFromRejection(e),e}function o(e,t){return function(n,r){if(null!==e){if(n){var o=i(s(n));e._attachExtraTrace(o),e._reject(o)}else if(t){var a=[].slice.call(arguments,1);e._fulfill(a)}else e._fulfill(r);e=null}}}var a=e("./util"),s=a.maybeWrapAsError,l=e("./errors"),c=l.OperationalError,u=e("./es5"),f=/^(?:name|message|stack|cause)$/;t.exports=o},{"./errors":12,"./es5":13,"./util":36}],21:[function(e,t,n){t.exports=function(t){function n(e,t){var n=this;if(!o.isArray(e))return r.call(n,e,t);var i=s(t).apply(n._boundValue(),[null].concat(e));i===l&&a.throwLater(i.e)}function r(e,t){var n=this,r=n._boundValue(),i=void 0===e?s(t).call(r,null):s(t).call(r,null,e);i===l&&a.throwLater(i.e)}function i(e,t){var n=this;if(!e){var r=new Error(e+"");r.cause=e,e=r}var i=s(t).call(n._boundValue(),e);i===l&&a.throwLater(i.e)}var o=e("./util"),a=t._async,s=o.tryCatch,l=o.errorObj;t.prototype.asCallback=t.prototype.nodeify=function(e,t){if("function"==typeof e){var o=r;void 0!==t&&Object(t).spread&&(o=n),this._then(o,i,void 0,this,e)}return this}}},{"./util":36}],22:[function(t,n,r){n.exports=function(){function r(){}function i(e,t){if(null==e||e.constructor!==o)throw new y("the promise constructor cannot be invoked directly\n\n    See http://goo.gl/MqrFmX\n");if("function"!=typeof t)throw new y("expecting a function but got "+h.classString(t))}function o(e){e!==w&&i(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 a(e){this.promise._resolveCallback(e)}function s(e){this.promise._rejectCallback(e,!1)}function l(e){var t=new o(w);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}var c,u=function(){return new y("circular promise resolution chain\n\n    See http://goo.gl/MqrFmX\n")},f=function(){return new o.PromiseInspection(this._target())},d=function(e){return o.reject(new y(e))},p={},h=t("./util");c=h.isNode?function(){var t=e.domain;return void 0===t&&(t=null),t}:function(){return null},h.notEnumerableProp(o,"_getDomain",c);var v=t("./es5"),_=t("./async"),m=new _;v.defineProperty(o,"_async",{value:m});var g=t("./errors"),y=o.TypeError=g.TypeError;o.RangeError=g.RangeError;var b=o.CancellationError=g.CancellationError;o.TimeoutError=g.TimeoutError,o.OperationalError=g.OperationalError,o.RejectionError=g.OperationalError,o.AggregateError=g.AggregateError;var w=function(){},C={},k={},E=t("./thenables")(o,w),$=t("./promise_array")(o,w,E,d,r),j=t("./context")(o),F=j.create,x=t("./debuggability")(o,j),T=(x.CapturedTrace,t("./finally")(o,E,k)),S=t("./catch_filter")(k),P=t("./nodeback"),R=h.errorObj,O=h.tryCatch;return o.prototype.toString=function(){return"[object Promise]"},o.prototype.caught=o.prototype["catch"]=function(e){var t=arguments.length;if(t>1){var n,r=new Array(t-1),i=0;for(n=0;n<t-1;++n){var o=arguments[n];if(!h.isObject(o))return d("Catch statement predicate: expecting an object but got "+h.classString(o));r[i++]=o}return r.length=i,e=arguments[n],this.then(void 0,S(r,e,this))}return this.then(void 0,e)},o.prototype.reflect=function(){return this._then(f,f,void 0,this,void 0)},o.prototype.then=function(e,t){if(x.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var n=".then() only accepts functions but was passed: "+h.classString(e);arguments.length>1&&(n+=", "+h.classString(t)),this._warn(n)}return this._then(e,t,void 0,void 0,void 0)},o.prototype.done=function(e,t){var n=this._then(e,t,void 0,void 0,void 0);n._setIsFinal()},o.prototype.spread=function(e){return"function"!=typeof e?d("expecting a function but got "+h.classString(e)):this.all()._then(e,void 0,void 0,C,void 0)},o.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},o.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new $(this).promise()},o.prototype.error=function(e){return this.caught(h.originatesFromRejection,e)},o.getNewLibraryCopy=n.exports,o.is=function(e){return e instanceof o},o.fromNode=o.fromCallback=function(e){var t=new o(w);t._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=O(e)(P(t,n));return r===R&&t._rejectCallback(r.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},o.all=function(e){return new $(e).promise()},o.cast=function(e){var t=E(e);return t instanceof o||(t=new o(w),t._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},o.resolve=o.fulfilled=o.cast,o.reject=o.rejected=function(e){var t=new o(w);return t._captureStackTrace(),t._rejectCallback(e,!0),t},o.setScheduler=function(e){if("function"!=typeof e)throw new y("expecting a function but got "+h.classString(e));return m.setScheduler(e)},o.prototype._then=function(e,t,n,r,i){var a=void 0!==i,s=a?i:new o(w),l=this._target(),u=l._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var f=c();if(0!==(50397184&u)){var d,p,v=l._settlePromiseCtx;0!==(33554432&u)?(p=l._rejectionHandler0,d=e):0!==(16777216&u)?(p=l._fulfillmentHandler0,d=t,l._unsetRejectionIsUnhandled()):(v=l._settlePromiseLateCancellationObserver,p=new b("late cancellation observer"),l._attachExtraTrace(p),d=t),m.invoke(v,l,{handler:null===f?d:"function"==typeof d&&h.domainBind(f,d),promise:s,receiver:r,value:p})}else l._addCallbacks(e,t,s,r,f);return s},o.prototype._length=function(){return 65535&this._bitField},o.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},o.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},o.prototype._setLength=function(e){this._bitField=this._bitField&-65536|65535&e},o.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},o.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},o.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},o.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},o.prototype._isFinal=function(){return(4194304&this._bitField)>0},o.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},o.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},o.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},o.prototype._setAsyncGuaranteed=function(){m.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},o.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==p)return void 0===t&&this._isBound()?this._boundValue():t},o.prototype._promiseAt=function(e){return this[4*e-4+2]},o.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},o.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},o.prototype._boundValue=function(){},o.prototype._migrateCallback0=function(e){var t=(e._bitField,e._fulfillmentHandler0),n=e._rejectionHandler0,r=e._promise0,i=e._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(t,n,r,i,null)},o.prototype._migrateCallbackAt=function(e,t){var n=e._fulfillmentHandlerAt(t),r=e._rejectionHandlerAt(t),i=e._promiseAt(t),o=e._receiverAt(t);void 0===o&&(o=p),this._addCallbacks(n,r,i,o,null)},o.prototype._addCallbacks=function(e,t,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof e&&(this._fulfillmentHandler0=null===i?e:h.domainBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=null===i?t:h.domainBind(i,t));else{var a=4*o-4;this[a+2]=n,this[a+3]=r,"function"==typeof e&&(this[a+0]=null===i?e:h.domainBind(i,e)),"function"==typeof t&&(this[a+1]=null===i?t:h.domainBind(i,t))}return this._setLength(o+1),o},o.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},o.prototype._resolveCallback=function(e,t){if(0===(117506048&this._bitField)){if(e===this)return this._rejectCallback(u(),!1);var n=E(e,this);if(!(n instanceof o))return this._fulfill(e);t&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(u());var i=r._bitField;if(0===(50397184&i)){var a=this._length();a>0&&r._migrateCallback0(this);for(var s=1;s<a;++s)r._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!==(33554432&i))this._fulfill(r._value());else if(0!==(16777216&i))this._reject(r._reason());else{var l=new b("late cancellation observer");r._attachExtraTrace(l),this._reject(l)}}},o.prototype._rejectCallback=function(e,t,n){var r=h.ensureErrorObject(e),i=r===e;if(!i&&!n&&x.warnings()){var o="a promise was rejected with a non-error: "+h.classString(e);this._warn(o,!0)}this._attachExtraTrace(r,!!t&&i),this._reject(e)},o.prototype._resolveFromExecutor=function(e){if(e!==w){var t=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(e,function(e){t._resolveCallback(e)},function(e){t._rejectCallback(e,n)});n=!1,this._popContext(),void 0!==r&&t._rejectCallback(r,!0)}},o.prototype._settlePromiseFromHandler=function(e,t,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;t===C?n&&"number"==typeof n.length?o=O(e).apply(this._boundValue(),n):(o=R,o.e=new y("cannot .spread() a non-array: "+h.classString(n))):o=O(e).call(t,n);var a=r._popContext();i=r._bitField,0===(65536&i)&&(o===k?r._reject(n):o===R?r._rejectCallback(o.e,!1):(x.checkForgottenReturns(o,a,"",r,this),r._resolveCallback(o)))}},o.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},o.prototype._followee=function(){return this._rejectionHandler0},o.prototype._setFollowee=function(e){this._rejectionHandler0=e},o.prototype._settlePromise=function(e,t,n,i){var a=e instanceof o,s=this._bitField,l=0!==(134217728&s);0!==(65536&s)?(a&&e._invokeInternalOnCancel(),n instanceof T&&n.isFinallyHandler()?(n.cancelPromise=e,O(t).call(n,i)===R&&e._reject(R.e)):t===f?e._fulfill(f.call(n)):n instanceof r?n._promiseCancelled(e):a||e instanceof $?e._cancel():n.cancel()):"function"==typeof t?a?(l&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,n,i,e)):t.call(n,i,e):n instanceof r?n._isResolved()||(0!==(33554432&s)?n._promiseFulfilled(i,e):n._promiseRejected(i,e)):a&&(l&&e._setAsyncGuaranteed(),0!==(33554432&s)?e._fulfill(i):e._reject(i))},o.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,n=e.promise,r=e.receiver,i=e.value;"function"==typeof t?n instanceof o?this._settlePromiseFromHandler(t,r,i,n):t.call(r,i,n):n instanceof o&&n._reject(i)},o.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},o.prototype._settlePromise0=function(e,t,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,e,i,t)},o.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},o.prototype._fulfill=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(e===this){var n=u();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!==(134217728&t)?this._settlePromises():m.settlePromises(this))}},o.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16))return this._setRejected(),this._fulfillmentHandler0=e,this._isFinal()?m.fatalError(e,h.isNode):void((65535&t)>0?m.settlePromises(this):this._ensurePossibleRejectionHandled())},o.prototype._fulfillPromises=function(e,t){for(var n=1;n<e;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,t)}},o.prototype._rejectPromises=function(e,t){for(var n=1;n<e;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,t)}},o.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(0!==(16842752&e)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,e),this._rejectPromises(t,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,e),this._fulfillPromises(t,r)}this._setLength(0)}this._clearCancellationData()},o.prototype._settledValue=function(){var e=this._bitField;return 0!==(33554432&e)?this._rejectionHandler0:0!==(16777216&e)?this._fulfillmentHandler0:void 0},o.defer=o.pending=function(){x.deprecated("Promise.defer","new Promise");var e=new o(w);return{promise:e,resolve:a,reject:s}},h.notEnumerableProp(o,"_makeSelfResolutionError",u),t("./method")(o,w,E,d,x),t("./bind")(o,w,E,x),t("./cancel")(o,$,d,x),t("./direct_resolve")(o),t("./synchronous_inspection")(o),t("./join")(o,$,E,w,m,c),o.Promise=o,o.version="3.5.0",t("./map.js")(o,$,d,E,w,x),t("./call_get.js")(o),t("./using.js")(o,d,E,F,w,x),t("./timers.js")(o,w,x),t("./generators.js")(o,d,w,E,r,x),t("./nodeify.js")(o),t("./promisify.js")(o,w),t("./props.js")(o,$,E,d),t("./race.js")(o,w,E,d),t("./reduce.js")(o,$,d,E,w,x),t("./settle.js")(o,$,x),t("./some.js")(o,$,d),t("./filter.js")(o,w),t("./each.js")(o,w),t("./any.js")(o),h.toFastProperties(o),h.toFastProperties(o.prototype),l({a:1}),l({b:2}),l({c:3}),l(1),l(function(){}),l(void 0),l(!1),l(new o(w)),x.setBounds(_.firstLineError,h.lastLineError),o}},{"./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,n){t.exports=function(t,n,r,i,o){function a(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}function s(e){var r=this._promise=new t(n);e instanceof t&&r._propagateFrom(e,3),r._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var l=e("./util");l.isArray;return l.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(e,n){var o=r(this._values,this._promise);if(o instanceof t){o=o._target();var s=o._bitField;if(this._values=o,0===(50397184&s))return this._promise._setAsyncGuaranteed(),o._then(c,this._reject,void 0,this,n);if(0===(33554432&s))return 0!==(16777216&s)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=l.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+l.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(n===-5?this._resolveEmptyArray():this._resolve(a(n))):void this._iterate(o)},s.prototype._iterate=function(e){var n=this.getActualLength(e.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,a=null,s=0;s<n;++s){var l=r(e[s],i);l instanceof t?(l=l._target(),a=l._bitField):a=null,o?null!==a&&l.suppressUnhandledRejections():null!==a?0===(50397184&a)?(l._proxy(this,s),this._values[s]=l):o=0!==(33554432&a)?this._promiseFulfilled(l._value(),s):0!==(16777216&a)?this._promiseRejected(l._reason(),s):this._promiseCancelled(s):o=this._promiseFulfilled(l,s)}o||i._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){this._values[t]=e;var n=++this._totalResolved;return n>=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 n=0;n<e.length;++n)e[n]instanceof t&&e[n].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(e){return e},s}},{"./util":36}],24:[function(e,t,n){t.exports=function(t,n){function r(e){return!C.test(e)}function i(e){try{return e.__isPromisified__===!0}catch(t){return!1}}function o(e,t,n){var r=p.getDataPropertyOrDefault(e,t+n,b);return!!r&&i(r)}function a(e,t,n){for(var r=0;r<e.length;r+=2){var i=e[r];if(n.test(i))for(var o=i.replace(n,""),a=0;a<e.length;a+=2)if(e[a]===o)throw new g("Cannot promisify an API that has normal methods with '%s'-suffix\n\n    See http://goo.gl/MqrFmX\n".replace("%s",t))}}function s(e,t,n,r){for(var s=p.inheritedDataKeys(e),l=[],c=0;c<s.length;++c){var u=s[c],f=e[u],d=r===k||k(u,f,e);"function"!=typeof f||i(f)||o(e,u,t)||!r(u,f,e,d)||l.push(u,f)}return a(l,t,n),l}function l(e,r,i,o,a,s){function l(){var i=r;r===d&&(i=this);var o=new t(n);o._captureStackTrace();var a="string"==typeof u&&this!==c?this[u]:e,l=h(o,s);try{a.apply(i,v(arguments,l))}catch(f){o._rejectCallback(_(f),!0,!0)}return o._isFateSealed()||o._setAsyncGuaranteed(),o}var c=function(){return this}(),u=e;return"string"==typeof u&&(e=o),p.notEnumerableProp(l,"__isPromisified__",!0),l}function c(e,t,n,r,i){for(var o=new RegExp(E(t)+"$"),a=s(e,t,o,n),l=0,c=a.length;l<c;l+=2){var u=a[l],f=a[l+1],h=u+t;if(r===$)e[h]=$(u,d,u,f,t,i);else{var v=r(f,function(){return $(u,d,u,f,t,i)});p.notEnumerableProp(v,"__isPromisified__",!0),e[h]=v}}return p.toFastProperties(e),e}function u(e,t,n){return $(e,t,void 0,e,null,n)}var f,d={},p=e("./util"),h=e("./nodeback"),v=p.withAppended,_=p.maybeWrapAsError,m=p.canEvaluate,g=e("./errors").TypeError,y="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=new RegExp("^(?:"+w.join("|")+")$"),k=function(e){return p.isIdentifier(e)&&"_"!==e.charAt(0)&&"constructor"!==e},E=function(e){return e.replace(/([$])/,"\\$")},$=m?f:l;t.promisify=function(e,t){if("function"!=typeof e)throw new g("expecting a function but got "+p.classString(e));if(i(e))return e;t=Object(t);var n=void 0===t.context?d:t.context,o=!!t.multiArgs,a=u(e,n,o);return p.copyDescriptors(e,a,r),a},t.promisifyAll=function(e,t){if("function"!=typeof e&&"object"!==("undefined"==typeof e?"undefined":_typeof(e)))throw new g("the target of promisifyAll must be an object or a function\n\n    See http://goo.gl/MqrFmX\n");t=Object(t);var n=!!t.multiArgs,r=t.suffix;"string"!=typeof r&&(r=y);var i=t.filter;"function"!=typeof i&&(i=k);var o=t.promisifier;if("function"!=typeof o&&(o=$),!p.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n    See http://goo.gl/MqrFmX\n");for(var a=p.inheritedDataKeys(e),s=0;s<a.length;++s){var l=e[a[s]];"constructor"!==a[s]&&p.isClass(l)&&(c(l.prototype,r,i,o,n),c(l,r,i,o,n))}return c(e,r,i,o,n)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(e,t,n){t.exports=function(t,n,r,i){function o(e){var t,n=!1;if(void 0!==s&&e instanceof s)t=f(e),n=!0;else{var r=u.keys(e),i=r.length;t=new Array(2*i);for(var o=0;o<i;++o){var a=r[o];t[o]=e[a],t[o+i]=a}}this.constructor$(t),this._isMap=n,this._init$(void 0,n?-6:-3)}function a(e){var n,a=r(e);return c(a)?(n=a instanceof t?a._then(t.props,void 0,void 0,void 0,void 0):new o(a).promise(),a instanceof t&&n._propagateFrom(a,2),n):i("cannot await properties of a non-object\n\n    See http://goo.gl/MqrFmX\n")}var s,l=e("./util"),c=l.isObject,u=e("./es5");"function"==typeof Map&&(s=Map);var f=function(){function e(e,r){this[t]=e,this[t+n]=r,t++}var t=0,n=0;return function(r){n=r.size,t=0;var i=new Array(2*r.size);return r.forEach(e,i),i}}(),d=function(e){for(var t=new s,n=e.length/2|0,r=0;r<n;++r){var i=e[n+r],o=e[r];t.set(i,o)}return t};l.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(e,t){this._values[t]=e;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=d(this._values);else{r={};for(var i=this.length(),o=0,a=this.length();o<a;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(e){return e>>1},t.prototype.props=function(){return a(this)},t.props=function(e){return a(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,n){function r(e,t,n,r,i){for(var o=0;o<i;++o)n[o+r]=e[o+t],e[o+t]=void 0}function i(e){this._capacity=e,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(e){return this._capacity<e},i.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1);var n=this._front+t&this._capacity-1;this[n]=e,this._length=t+1},i.prototype.push=function(e,t,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(e),this._pushOne(t),void this._pushOne(n);var i=this._front+r-3;this._checkCapacity(r);var o=this._capacity-1;this[i+0&o]=e,this[i+1&o]=t,this[i+2&o]=n,this._length=r},i.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},i.prototype.length=function(){return this._length},i.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},i.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e;var n=this._front,i=this._length,o=n+i&t-1;r(this,0,this,t,o)},t.exports=i},{}],27:[function(e,t,n){t.exports=function(t,n,r,i){function o(e,o){var l=r(e);if(l instanceof t)return s(l);if(e=a.asArray(e),null===e)return i("expecting an array or an iterable object but got "+a.classString(e));var c=new t(n);void 0!==o&&c._propagateFrom(o,3);for(var u=c._fulfill,f=c._reject,d=0,p=e.length;d<p;++d){var h=e[d];(void 0!==h||d in e)&&t.cast(h)._then(u,f,void 0,c,null)}return c}var a=e("./util"),s=function(e){return e.then(function(t){return o(t,e)})};t.race=function(e){return o(e,void 0)},t.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(e,t,n){t.exports=function(t,n,r,i,o,a){function s(e,n,r,i){this.constructor$(e);var a=d();this._fn=null===a?n:p.domainBind(a,n),void 0!==r&&(r=t.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,i===o?this._eachValues=Array(this._length):0===i?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function l(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function c(e,t,n,i){if("function"!=typeof t)return r("expecting a function but got "+p.classString(t));var o=new s(e,t,n,i);return o.promise()}function u(e){this.accum=e,this.array._gotAccum(e);var n=i(this.value,this.array._promise);return n instanceof t?(this.array._currentCancellable=n,n._then(f,void 0,void 0,this,void 0)):f.call(this,n)}function f(e){var n=this.array,r=n._promise,i=h(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),e,this.index,this.length):i.call(r._boundValue(),this.accum,e,this.index,this.length),o instanceof t&&(n._currentCancellable=o);var s=r._popContext();return a.checkForgottenReturns(o,s,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var d=t._getDomain,p=e("./util"),h=p.tryCatch;p.inherits(s,n),s.prototype._gotAccum=function(e){void 0!==this._eachValues&&null!==this._eachValues&&e!==o&&this._eachValues.push(e)},s.prototype._eachComplete=function(e){return null!==this._eachValues&&this._eachValues.push(e),this._eachValues},s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},s.prototype.shouldCopyValues=function(){return!1},s.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},s.prototype._resultCancelled=function(e){return e===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel()))},s.prototype._iterate=function(e){this._values=e;var n,r,i=e.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=t.resolve(e[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;r<i;++r){var o={accum:null,value:e[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(l,l,void 0,n,this)},t.prototype.reduce=function(e,t){return c(this,e,t,null)},t.reduce=function(e,t,n,r){return c(e,t,n,r)}}},{"./util":36}],29:[function(t,n,i){var o,a=t("./util"),s=function(){throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n")},l=a.getNativePromise();if(a.isNode&&"undefined"==typeof MutationObserver){var c=r.setImmediate,u=e.nextTick;o=a.isRecentNode?function(e){c.call(r,e)}:function(t){u.call(e,t)}}else if("function"==typeof l&&"function"==typeof l.resolve){var f=l.resolve();o=function(e){f.then(e)}}else o="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(e){setImmediate(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:s:function(){var e=document.createElement("div"),t={attributes:!0},n=!1,r=document.createElement("div"),i=new MutationObserver(function(){e.classList.toggle("foo"),n=!1});i.observe(r,t);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(e,t),o()}}();n.exports=o},{"./util":36}],30:[function(e,t,n){t.exports=function(t,n,r){function i(e){this.constructor$(e)}var o=t.PromiseInspection,a=e("./util");a.inherits(i,n),i.prototype._promiseResolved=function(e,t){this._values[e]=t;var n=++this._totalResolved;return n>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(e,t){var n=new o;return n._bitField=33554432,n._settledValueField=e,this._promiseResolved(t,n)},i.prototype._promiseRejected=function(e,t){var n=new o;return n._bitField=16777216,n._settledValueField=e,this._promiseResolved(t,n)},t.settle=function(e){return r.deprecated(".settle()",".reflect()"),new i(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,n){t.exports=function(t,n,r){function i(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(e,t){if((0|t)!==t||t<0)return r("expecting a positive integer\n\n    See http://goo.gl/MqrFmX\n");var n=new i(e),o=n.promise();return n.setHowMany(t),n.init(),o}var a=e("./util"),s=e("./errors").RangeError,l=e("./errors").AggregateError,c=a.isArray,u={};
  a.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var e=c(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(e){this._howMany=e},i.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)},i.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new l,t=this.length();t<this._values.length;++t)this._values[t]!==u&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(e){this._values.push(e)},i.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new s(t)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return o(e,t)},t.prototype.some=function(e){return o(this,e)},t._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(e,t,n){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 n=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()},r=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()},i=t.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=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 o.call(this._target())},e.prototype.isFulfilled=function(){return i.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return n.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),r.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,n){t.exports=function(t,n){function r(e,r){if(u(e)){if(e instanceof t)return e;var i=o(e);if(i===c){r&&r._pushContext();var l=t.reject(i.e);return r&&r._popContext(),l}if("function"==typeof i){if(a(e)){var l=new t(n);return e._then(l._fulfill,l._reject,void 0,l,null),l}return s(e,i,r)}}return e}function i(e){return e.then}function o(e){try{return i(e)}catch(t){return c.e=t,c}}function a(e){try{return f.call(e,"_promise0")}catch(t){return!1}}function s(e,r,i){function o(e){s&&(s._resolveCallback(e),s=null)}function a(e){s&&(s._rejectCallback(e,f,!0),s=null)}var s=new t(n),u=s;i&&i._pushContext(),s._captureStackTrace(),i&&i._popContext();var f=!0,d=l.tryCatch(r).call(e,o,a);return f=!1,s&&d===c&&(s._rejectCallback(d.e,!0,!0),s=null),u}var l=e("./util"),c=l.errorObj,u=l.isObject,f={}.hasOwnProperty;return r}},{"./util":36}],34:[function(e,t,n){t.exports=function(t,n,r){function i(e){this.handle=e}function o(e){return clearTimeout(this.handle),e}function a(e){throw clearTimeout(this.handle),e}var s=e("./util"),l=t.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var c=function(e){return u(+this).thenReturn(e)},u=t.delay=function(e,o){var a,s;return void 0!==o?(a=t.resolve(o)._then(c,null,null,e,void 0),r.cancellation()&&o instanceof t&&a._setOnCancel(o)):(a=new t(n),s=setTimeout(function(){a._fulfill()},+e),r.cancellation()&&a._setOnCancel(new i(s)),a._captureStackTrace()),a._setAsyncGuaranteed(),a};t.prototype.delay=function(e){return u(e,this)};var f=function(e,t,n){var r;r="string"!=typeof t?t instanceof Error?t:new l("operation timed out"):new l(t),s.markAsOriginatingFromRejection(r),e._attachExtraTrace(r),e._reject(r),null!=n&&n.cancel()};t.prototype.timeout=function(e,t){e=+e;var n,s,l=new i(setTimeout(function(){n.isPending()&&f(n,t,s)},e));return r.cancellation()?(s=this.then(),n=s._then(o,a,void 0,l,void 0),n._setOnCancel(l)):n=this._then(o,a,void 0,l,void 0),n}}},{"./util":36}],35:[function(e,t,n){t.exports=function(t,n,r,i,o,a){function s(e){setTimeout(function(){throw e},0)}function l(e){var t=r(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}function c(e,n){function i(){if(a>=c)return u._fulfill();var o=l(e[a++]);if(o instanceof t&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),e.promise)}catch(f){return s(f)}if(o instanceof t)return o._then(i,s,null,null,null)}i()}var a=0,c=e.length,u=new t(o);return i(),u}function u(e,t,n){this._data=e,this._promise=t,this._context=n}function f(e,t,n){this.constructor$(e,t,n)}function d(e){return u.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function p(e){this.length=e,this.promise=null,this[e-1]=null}var h=e("./util"),v=e("./errors").TypeError,_=e("./util").inherits,m=h.errorObj,g=h.tryCatch,y={};u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():y},u.prototype.tryDispose=function(e){var t=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=t!==y?this.doDispose(t,e):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},_(f,u),f.prototype.doDispose=function(e,t){var n=this.data();return n.call(e,e,t)},p.prototype._resultCancelled=function(){for(var e=this.length,n=0;n<e;++n){var r=this[n];r instanceof t&&r.cancel()}},t.using=function(){var e=arguments.length;if(e<2)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[e-1];if("function"!=typeof i)return n("expecting a function but got "+h.classString(i));var o,s=!0;2===e&&Array.isArray(arguments[0])?(o=arguments[0],e=o.length,s=!1):(o=arguments,e--);for(var l=new p(e),f=0;f<e;++f){var v=o[f];if(u.isDisposer(v)){var _=v;v=v.promise(),v._setDisposable(_)}else{var y=r(v);y instanceof t&&(v=y._then(d,null,null,{resources:l,index:f},void 0))}l[f]=v}for(var b=new Array(l.length),f=0;f<b.length;++f)b[f]=t.resolve(l[f]).reflect();var w=t.all(b).then(function(e){for(var t=0;t<e.length;++t){var n=e[t];if(n.isRejected())return m.e=n.error(),m;if(!n.isFulfilled())return void w.cancel();e[t]=n.value()}C._pushContext(),i=g(i);var r=s?i.apply(void 0,e):i(e),o=C._popContext();return a.checkForgottenReturns(r,o,"Promise.using",C),r}),C=w.lastly(function(){var e=new t.PromiseInspection(w);return c(l,e)});return l.promise=C,C._setOnCancel(l),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=this._bitField&-131073,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new f(e,this,i());throw new v}}},{"./errors":12,"./util":36}],36:[function(t,n,i){function o(){try{var e=P;return P=null,e.apply(this,arguments)}catch(t){return S.e=t,S}}function a(e){return P=e,o}function s(e){return null==e||e===!0||e===!1||"string"==typeof e||"number"==typeof e}function l(e){return"function"==typeof e||"object"===("undefined"==typeof e?"undefined":_typeof(e))&&null!==e}function c(e){return s(e)?new Error(g(e)):e}function u(e,t){var n,r=e.length,i=new Array(r+1);for(n=0;n<r;++n)i[n]=e[n];return i[n]=t,i}function f(e,t,n){if(!x.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var r=Object.getOwnPropertyDescriptor(e,t);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function d(e,t,n){if(s(e))return e;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return x.defineProperty(e,t,r),e}function p(e){throw e}function h(e){try{if("function"==typeof e){var t=x.names(e.prototype),n=x.isES5&&t.length>1,r=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=L.test(e+"")&&x.names(e).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function v(e){function t(){}t.prototype=e;for(var n=8;n--;)new t;return e}function _(e){return D.test(e)}function m(e,t,n){for(var r=new Array(e),i=0;i<e;++i)r[i]=t+i+n;return r}function g(e){try{return e+""}catch(t){return"[no string representation]"}}function y(e){return null!==e&&"object"===("undefined"==typeof e?"undefined":_typeof(e))&&"string"==typeof e.message&&"string"==typeof e.name}function b(e){try{d(e,"isOperational",!0)}catch(t){}}function w(e){return null!=e&&(e instanceof Error.__BluebirdErrorTypes__.OperationalError||e.isOperational===!0)}function C(e){return y(e)&&x.propertyIsWritable(e,"stack")}function k(e){return{}.toString.call(e)}function E(e,t,n){for(var r=x.names(e),i=0;i<r.length;++i){var o=r[i];if(n(o))try{x.defineProperty(t,o,x.getDescriptor(e,o))}catch(a){}}}function $(t){return H?e.env[t]:void 0}function j(){if("function"==typeof Promise)try{var e=new Promise(function(){});if("[object Promise]"==={}.toString.call(e))return Promise}catch(t){}}function F(e,t){return e.bind(t)}var x=t("./es5"),T="undefined"==typeof navigator,S={e:{}},P,R="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof r?r:void 0!==this?this:null,O=function(e,t){function n(){this.constructor=e,this.constructor$=t;for(var n in t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}var r={}.hasOwnProperty;return n.prototype=t.prototype,e.prototype=new n,e.prototype},A=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1};if(x.isES5){var n=Object.getOwnPropertyNames;return function(e){for(var r=[],i=Object.create(null);null!=e&&!t(e);){var o;try{o=n(e)}catch(a){return r}for(var s=0;s<o.length;++s){var l=o[s];if(!i[l]){i[l]=!0;var c=Object.getOwnPropertyDescriptor(e,l);null!=c&&null==c.get&&null==c.set&&r.push(l)}}e=x.getPrototypeOf(e)}return r}}var r={}.hasOwnProperty;return function(n){if(t(n))return[];var i=[];e:for(var o in n)if(r.call(n,o))i.push(o);else{for(var a=0;a<e.length;++a)if(r.call(e[a],o))continue e;i.push(o)}return i}}(),L=/this\s*\.\s*\S+\s*=/,D=/^[a-z$_][a-z$_0-9]*$/i,I=function(){return"stack"in new Error?function(e){return C(e)?e:new Error(g(e))}:function(e){if(C(e))return e;try{throw new Error(g(e))}catch(t){return t}}}(),N=function(e){return x.isArray(e)?e:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var M="function"==typeof Array.from?function(e){return Array.from(e)}:function(e){for(var t,n=[],r=e[Symbol.iterator]();!(t=r.next()).done;)n.push(t.value);return n};N=function(e){return x.isArray(e)?e:null!=e&&"function"==typeof e[Symbol.iterator]?M(e):null}}var U="undefined"!=typeof e&&"[object process]"===k(e).toLowerCase(),H="undefined"!=typeof e&&"undefined"!=typeof e.env,B={isClass:h,isIdentifier:_,inheritedDataKeys:A,getDataPropertyOrDefault:f,thrower:p,isArray:x.isArray,asArray:N,notEnumerableProp:d,isPrimitive:s,isObject:l,isError:y,canEvaluate:T,errorObj:S,tryCatch:a,inherits:O,withAppended:u,maybeWrapAsError:c,toFastProperties:v,filledRange:m,toString:g,canAttachTrace:C,ensureErrorObject:I,originatesFromRejection:w,markAsOriginatingFromRejection:b,classString:k,copyDescriptors:E,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:U,hasEnvVariables:H,env:$,global:R,getNativePromise:j,domainBind:F};B.isRecentNode=B.isNode&&function(){var t=e.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}(),B.isNode&&B.toFastProperties(e);try{throw new Error}catch(V){B.lastLineError=V}n.exports=B},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,e("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{rH1JPG:4}],2:[function(e,t,n){!function(e){var r=!1;if("function"==typeof define&&define.amd&&(define(e),r=!0),"object"===("undefined"==typeof n?"undefined":_typeof(n))&&(t.exports=e(),r=!0),!r){var i=window.Cookies,o=window.Cookies=e();o.noConflict=function(){return window.Cookies=i,o}}}(function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(n){function r(t,i,o){var a;if("undefined"!=typeof document){if(arguments.length>1){if(o=e({path:"/"},r.defaults,o),"number"==typeof o.expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*o.expires),o.expires=s}o.expires=o.expires?o.expires.toUTCString():"";try{a=JSON.stringify(i),/^[\{\[]/.test(a)&&(i=a)}catch(l){}i=n.write?n.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape);var c="";for(var u in o)o[u]&&(c+="; "+u,o[u]!==!0&&(c+="="+o[u]));return document.cookie=t+"="+i+c}t||(a={});for(var f=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,p=0;p<f.length;p++){var h=f[p].split("="),v=h.slice(1).join("=");'"'===v.charAt(0)&&(v=v.slice(1,-1));try{var _=h[0].replace(d,decodeURIComponent);if(v=n.read?n.read(v,_):n(v,_)||v.replace(d,decodeURIComponent),this.json)try{v=JSON.parse(v)}catch(l){}if(t===_){a=v;break}t||(a[_]=v)}catch(l){}}return a}}return r.set=r,r.get=function(e){return r.call(r,e)},r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,n){r(t,"",e(n,{expires:-1}))},r.withConverter=t,r}return t(function(){})})},{}],3:[function(e,t,n){!function(e,r){"function"==typeof define&&define.amd?define(r):"object"===("undefined"==typeof n?"undefined":_typeof(n))?t.exports=r():e.NProgress=r()}(this,function(){function e(e,t,n){return e<t?t:e>n?n:e}function t(e){return 100*(-1+e)}function n(e,n,r){var i;return i="translate3d"===c.positionUsing?{transform:"translate3d("+t(e)+"%,0,0)"}:"translate"===c.positionUsing?{transform:"translate("+t(e)+"%,0)"}:{"margin-left":t(e)+"%"},i.transition="all "+n+"ms "+r,i}function r(e,t){var n="string"==typeof e?e:a(e);return n.indexOf(" "+t+" ")>=0}function i(e,t){var n=a(e),i=n+t;r(n,t)||(e.className=i.substring(1))}function o(e,t){var n,i=a(e);r(e,t)&&(n=i.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function a(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function s(e){e&&e.parentNode&&e.parentNode.removeChild(e)}var l={};l.version="0.2.0";var c=l.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};l.configure=function(e){var t,n;for(t in e)n=e[t],void 0!==n&&e.hasOwnProperty(t)&&(c[t]=n);return this},l.status=null,l.set=function(t){var r=l.isStarted();t=e(t,c.minimum,1),l.status=1===t?null:t;var i=l.render(!r),o=i.querySelector(c.barSelector),a=c.speed,s=c.easing;return i.offsetWidth,u(function(e){""===c.positionUsing&&(c.positionUsing=l.getPositioningCSS()),f(o,n(t,a,s)),1===t?(f(i,{transition:"none",opacity:1}),i.offsetWidth,setTimeout(function(){f(i,{transition:"all "+a+"ms linear",opacity:0}),setTimeout(function(){l.remove(),e()},a)},a)):setTimeout(e,a)}),this},l.isStarted=function(){return"number"==typeof l.status},l.start=function(){l.status||l.set(0);var e=function t(){setTimeout(function(){l.status&&(l.trickle(),t())},c.trickleSpeed)};return c.trickle&&e(),this},l.done=function(e){return e||l.status?l.inc(.3+.5*Math.random()).set(1):this},l.inc=function(t){var n=l.status;return n?("number"!=typeof t&&(t=(1-n)*e(Math.random()*n,.1,.95)),n=e(n+t,0,.994),l.set(n)):l.start()},l.trickle=function(){return l.inc(Math.random()*c.trickleRate)},function(){var e=0,t=0;l.promise=function(n){return n&&"resolved"!==n.state()?(0===t&&l.start(),e++,t++,n.always(function(){t--,0===t?(e=0,l.done()):l.set((e-t)/e)}),this):this}}(),l.render=function(e){if(l.isRendered())return document.getElementById("nprogress");i(document.documentElement,"nprogress-busy");var n=document.createElement("div");n.id="nprogress",n.innerHTML=c.template;var r,o=n.querySelector(c.barSelector),a=e?"-100":t(l.status||0),u=document.querySelector(c.parent);return f(o,{transition:"all 0 linear",transform:"translate3d("+a+"%,0,0)"}),c.showSpinner||(r=n.querySelector(c.spinnerSelector),r&&s(r)),u!=document.body&&i(u,"nprogress-custom-parent"),u.appendChild(n),n},l.remove=function(){o(document.documentElement,"nprogress-busy"),o(document.querySelector(c.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&s(e)},l.isRendered=function(){return!!document.getElementById("nprogress")},l.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var u=function(){function e(){var n=t.shift();n&&n(e)}var t=[];return function(n){t.push(n),1==t.length&&e()}}(),f=function(){function e(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()})}function t(e){var t=document.body.style;if(e in t)return e;for(var n,r=i.length,o=e.charAt(0).toUpperCase()+e.slice(1);r--;)if(n=i[r]+o,n in t)return n;return e}function n(n){return n=e(n),o[n]||(o[n]=t(n))}function r(e,t,r){t=n(t),e.style[t]=r}var i=["Webkit","O","Moz","ms"],o={};return function(e,t){var n,i,o=arguments;if(2==o.length)for(n in t)i=t[n],void 0!==i&&t.hasOwnProperty(n)&&r(e,n,i);else r(e,o[1],o[2])}}();return l})},{}],4:[function(e,t,n){function r(){}var i=t.exports={};i.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.on=r,i.addListener=r,i.once=r,i.off=r,i.removeListener=r,i.removeAllListeners=r,i.emit=r,i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],5:[function(e,t,n){/*!
          * screenfull
          * v3.2.0 - 2017-04-16
          * (c) Sindre Sorhus; MIT License
          */
  !function(){var e="undefined"==typeof window?{}:window.document,n="undefined"!=typeof t&&t.exports,r="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,i=function(){for(var t,n=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=0,i=n.length,o={};r<i;r++)if(t=n[r],t&&t[1]in e){for(r=0;r<t.length;r++)o[n[0][r]]=t[r];return o}return!1}(),o={request:function a(t){var a=i.requestFullscreen;t=t||e.documentElement,/5\.1[.\d]* Safari/.test(navigator.userAgent)?t[a]():t[a](r&&Element.ALLOW_KEYBOARD_INPUT)},exit:function(){e[i.exitFullscreen]()},toggle:function(e){this.isFullscreen?this.exit():this.request(e)},onchange:function(t){e.addEventListener(i.fullscreenchange,t,!1)},onerror:function(t){e.addEventListener(i.fullscreenerror,t,!1)},raw:i};return i?(Object.defineProperties(o,{isFullscreen:{get:function(){return Boolean(e[i.fullscreenElement])}},element:{enumerable:!0,get:function(){return e[i.fullscreenElement]}},enabled:{enumerable:!0,get:function(){return Boolean(e[i.fullscreenEnabled])}}}),void(n?t.exports=o:window.screenfull=o)):void(n?t.exports=!1:window.screenfull=!1)}()},{}],6:[function(e,t,n){function r(e){return new s(function(t,n){var r={browser_spellcheck:!0,document_base_url:e.baseUrl.replace(/\/$/,"")+"/",element_format:"html",entity_encoding:"raw",extended_valid_elements:"i[class],iframe[*],script[*]",formats:{alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",classes:"align-left"},{selector:"figure",classes:"align-left",ceFalseOverride:!0}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",classes:"align-center"},{selector:"figure",classes:"align-center",ceFalseOverride:!0}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",classes:"align-right"},{selector:"figure",classes:"align-right",ceFalseOverride:!0}],alignjustify:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",classes:"align-justify"}],h1:{},h5:{},h6:{},div:{},underline:{},strikethrough:{inline:"del"},insert:{inline:"ins"},highlight:{inline:"mark"}},hidden_input:!1,inline:!0,menubar:!1,object_resizing:!1,paste_preprocess:function(t,n){if(e.textOnly){var r=document.createElement("div");r.innerHTML=n.content,n.content=r.innerText}e.onPaste.call(e,n)},plugins:"lists,paste,textpattern,wordcount",relative_urls:!1,skin:!1,target:e.element,textpattern_patterns:e.textOnly||!e.convertMarkdown?[]:[{start:"*",end:"*",format:"italic"},{start:"_",end:"_",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"__",end:"__",format:"bold"},{start:"~~",end:"~~",format:"strikethrough"},{start:"`",end:"`",format:"code"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"> ",format:"blockquote"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"},{start:"1. ",cmd:"InsertOrderedList"}],toolbar:!1,setup:function(t){t.on("PreInit",function(){t.windowManager={alert:function(){},close:function(){},confirm:function(){},getParams:function(){},open:function(){},setParams:function(){}}}),t.on("BeforeSetContent",function(t){var n=new DOMParser,r=n.parseFromString(t.content,"text/html"),a=void 0;a=r.body.querySelectorAll("[data-embed]");for(var s=0;s<a.length;s++)a[s].setAttribute("data-embed",i(a[s].innerHTML)),a[s].setAttribute("contenteditable",!1);a=r.body.querySelectorAll("figure, figcaption");for(var l=0;l<a.length;l++)"FIGURE"===a[l].tagName&&a[l].setAttribute("contenteditable",!1),"FIGCAPTION"===a[l].tagName&&(a[l].setAttribute("contenteditable",!0),""===o(a[l].innerText)&&(a[l].innerHTML=e.captionPlaceholder));t.content=r.body.innerHTML}),t.on("GetContent",function(t){var n=new DOMParser,r=n.parseFromString(t.content,"text/html"),i=void 0;i=r.body.querySelectorAll("[data-embed]");for(var a=0;a<i.length;a++)i[a].removeAttribute("contenteditable"),i[a].innerHTML=i[a].getAttribute("data-embed"),i[a].setAttribute("data-embed",!0);i=r.body.querySelectorAll("figure, figcaption");for(var s=0;s<i.length;s++)i[s].removeAttribute("contenteditable"),"FIGCAPTION"===i[s].tagName&&o(i[s].innerText)===e.captionPlaceholder&&(i[s].innerText="");t.content=r.body.innerHTML}),e.allowNewlines===!1&&t.on("keydown",function(e){13===e.keyCode&&e.preventDefault()}),e.placeholder&&(t.on("focus",function(){e.getContent()===o(e.placeholder)&&e.selectAll()}),t.on("blur",function(){o(t.getContent()).length||e.setContent(e.placeholder)})),e.convertMarkdown&&t.on("keydown",function(e){if(13===e.keyCode){var n=t.selection.getNode(),r=n.innerText.match(/^```([a-z]+)?$/i);r&&(e.preventDefault(),t.undoManager.transact(function(){n.innerHTML="",r[1]&&n.setAttribute("class","language-"+r[1].toLowerCase()),t.formatter.apply("pre")}))}})},init_instance_callback:function(n){e.placeholder&&""===n.getContent()&&(n.setContent(e.placeholder),n.undoManager.clear()),e.captionPlaceholder&&(e.document.addEventListener("focus",function(t){"FIGCAPTION"===t.target.tagName&&t.target.innerText===e.captionPlaceholder&&(t.target.innerHTML='<br data-mce-bogus="1"/>')},!0),e.document.addEventListener("blur",function(t){"FIGCAPTION"===t.target.tagName&&""===o(t.target.innerText)&&(t.target.innerHTML=e.captionPlaceholder)},!0)),n.on("NodeChange",function(){return e.onSelectionChange.call(e)}),n.on("focus",function(){return e.onFocus.call(e)}),n.on("blur",function(){return e.onBlur.call(e)}),n.on("change",function(){return e.onChange.call(e)}),n.on("click",function(t){return e.onClick.call(e,t)}),n.on("dblclick",function(t){return e.onDoubleClick.call(e,t)}),n.on("keydown",function(t){return e.onKeyDown.call(e,t)},!1),n.on("keyup",function(t){return e.onKeyUp.call(e,t)},!1),t(n)}};e.textOnly&&(r.forced_root_block=!1,r.formats={h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},pre:{},div:{},p:{},blockquote:{},bold:{},italic:{},underline:{},code:{},strikethrough:{},subscript:{},superscript:{},alignleft:{},alignright:{},aligncenter:{},alignjustify:{}},r.valid_elements="br"),r.plugins.split(",").forEach(function(t){e.tinymce.PluginManager.lookup[t]||n(new Error("Required TinyMCE plugin missing: "+t))}),e.tinymce.init(r)})}function i(e){var t=new DOMParser,n=t.parseFromString(e,"text/html"),r=n.body.querySelectorAll("*"),i=void 0,o=void 0,a=void 0;for(o=0;o<r.length;o++)for(i=r[o].attributes,a=0;a<i.length;a++)i[a].name.match(/^data-mce-/)&&r[o].removeAttribute(i[a].name);return n.body.innerHTML}function o(e){return e.replace(/^\s+|\s+$/g,"")}function a(e){var t=this;if(e=e||{},this.element=e.element,!this.element.ownerDocument)throw new Error("Parameter `element` must be a valid HTML element.");if(this.document=e.element.ownerDocument,this.tinymce=this.document.defaultView.tinymce,!this.tinymce)throw new Error("TinyMCE is required but not loaded.");this.allowNewlines=e.allowNewlines!==!1,this.baseUrl=e.baseUrl||"/",this.cleanState=null,this.captionPlaceholder=e.captionPlaceholder||"",this.convertMarkdown=!!e.convertMarkdown,this.editor=null,this.isReady=!1,this.onBlur=e.onBlur||function(){},this.onChange=e.onChange||function(){},this.onClick=e.onClick||function(){},this.onDoubleClick=e.onDoubleClick||function(){},this.onFocus=e.onFocus||function(){},this.onKeyDown=e.onKeyDown||function(){},this.onKeyUp=e.onKeyUp||function(){},this.onPaste=e.onPaste||function(){},this.onSelectionChange=e.onSelectionChange||function(){},this.placeholder=e.placeholder||"",this.onReady=e.onReady||function(){},this.textOnly=!!e.textOnly,r(this).then(function(e){t.editor=e,t.cleanState=t.getContent(),t.isReady=!0,t.onReady()})["catch"](function(){throw new Error("Failed to initialize the editor")})}var s=e("bluebird");a.prototype.alignCenter=function(){return this.editor.execCommand("JustifyCenter"),this},a.prototype.alignJustify=function(){return this.editor.execCommand("JustifyFull"),this},a.prototype.alignLeft=function(){return this.editor.execCommand("JustifyLeft"),this},a.prototype.alignRight=function(){return this.editor.execCommand("JustifyRight"),this},a.prototype.applyFormat=function(e){return this.editor.formatter.apply(e),this.editor.nodeChanged(),this},a.prototype.collapseSelection=function(e){return this.editor.selection.collapse("start"===e?"start":"end"),this},a.prototype.getContent=function(){return this.textOnly?this.editor.getBody().textContent:this.editor.getContent()},a.prototype.getLocation=function(){return this.editor.selection.getBookmark(2)},a.prototype.getSelectedElement=function(){return this.editor.selection.getNode()},a.prototype.getWordCount=function(){return this.editor.plugins.wordcount.getCount()},a.prototype.focus=function(){return this.editor.focus(),this},a.prototype.hasFormat=function(e){return this.editor.formatter.match(e)},a.prototype.hasUndo=function(){return this.editor.undoManager.hasUndo()},a.prototype.hasRedo=function(){return this.editor.undoManager.hasRedo()},a.prototype.indent=function(){return this.editor.execCommand("indent"),this},a.prototype.insertContent=function(e){return this.editor.execCommand("mceInsertContent",!1,e),this},a.prototype.insertEmbed=function(e,t){var n=this;t=t||{};var r=this.editor.dom.getParent(this.editor.selection.getNode(),"[data-embed]");return this.editor.undoManager.transact(function(){if(r)r.setAttribute("data-embed",e),t.provider?r.setAttribute("data-embed-provider",t.provider):r.removeAttribute("data-embed-provider"),r.setAttribute("contenteditable",!1),r.innerHTML=e;else{var i=document.createElement("div");i.setAttribute("data-embed",e),t.provider&&i.setAttribute("data-embed-provider",t.provider),i.setAttribute("contenteditable",!1),i.innerHTML=e,n.editor.insertContent(i.outerHTML)}}),this},a.prototype.insertImage=function(e,t){var n=this;t=t||{};var r=this.editor.dom.getParent(this.editor.selection.getNode(),"figure"),i=r?this.editor.dom.select("img",r):null,o=r?this.editor.dom.select("figcaption",r):null;this.editor.undoManager.transact(function(){r?(n.editor.dom.setAttribs(i,{src:e||"",srcset:t.srcset||"",sizes:t.sizes||"",alt:t.alt||""}),"undefined"!=typeof t.caption&&(!o.length&&t.caption?(o=n.editor.dom.create("figcaption",null,n.captionPlaceholder),r.appendChild(o)):o.length&&!t.caption&&n.editor.dom.remove(o))):(r=n.editor.dom.create("figure",{"class":"image"}),i=n.editor.dom.create("img",{src:e||"",srcset:t.srcset||"",sizes:t.sizes||"",alt:t.alt||""}),r.appendChild(i),t.caption&&(o=n.editor.dom.create("figcaption",null,n.captionPlaceholder),r.appendChild(o)),n.editor.insertContent(r.outerHTML)),"undefined"!=typeof t.align&&(n.editor.formatter.remove("alignleft"),n.editor.formatter.remove("aligncenter"),n.editor.formatter.remove("alignright"),n.editor.formatter.remove("alignjustify"),"left"===t.align&&n.editor.formatter.apply("alignleft"),"center"===t.align&&n.editor.formatter.apply("aligncenter"),"right"===t.align&&n.editor.formatter.apply("alignright"))})},a.prototype.insertLink=function(e,t){return t=t||{},this.editor.execCommand("mceInsertLink",!1,{href:e||"",target:t.target||"",title:t.title||"",rel:t.target?"noopener":""}),this},a.prototype.isAlignCenter=function(){return this.editor.formatter.match("aligncenter")},a.prototype.isAlignJustify=function(){return this.editor.formatter.match("alignjustify")},a.prototype.isAlignLeft=function(){return this.editor.formatter.match("alignleft")},a.prototype.isAlignRight=function(){return this.editor.formatter.match("alignright")},a.prototype.isDirty=function(){return null!==this.cleanState&&this.cleanState!==this.getContent()},a.prototype.isEmbed=function(){return!!this.editor.dom.getParent(this.editor.selection.getNode(),"[data-embed]")},a.prototype.isImage=function(){return!!this.editor.dom.getParent(this.editor.selection.getNode(),"img, figure.image")},a.prototype.isLink=function(){return!!this.editor.dom.getParent(this.editor.selection.getNode(),"a")},a.prototype.isOrderedList=function(){return!!this.editor.dom.getParent(this.editor.selection.getNode(),"ol")},a.prototype.isUnorderedList=function(){return!!this.editor.dom.getParent(this.editor.selection.getNode(),"ul")},a.prototype.makeClean=function(){return this.cleanState=this.getContent(),this},a.prototype.outdent=function(){return this.editor.execCommand("outdent"),this},a.prototype.readonly=function(e){return this.editor.setMode(e===!0?"readonly":"design"),this},a.prototype.redo=function(e){return"test"===e?this.editor.undoManager.hasRedo():void this.editor.execCommand("Redo")},a.prototype.removeElement=function(e){return this.editor.dom.remove(e),this},a.prototype.removeFormat=function(e){return this.editor.formatter.remove(e),this.editor.nodeChanged(),this},a.prototype.removeLink=function(){return this.editor.execCommand("unlink"),this},a.prototype.removeTextFormatting=function(){return this.editor.execCommand("RemoveFormat"),this.editor},a.prototype.removeSelectedElement=function(){return this.editor.dom.remove(this.getSelectedElement()),this},a.prototype.resetUndo=function(){return this.editor.undoManager.clear(),this},a.prototype.selectAll=function(){return this.editor.selection.select(this.editor.getBody(),!0),this},a.prototype.setContent=function(e){return this.editor.setContent(e),this},a.prototype.setLocation=function(e){return this.editor.selection.moveToBookmark(e),this},a.prototype.setSelectedElement=function(e){return this.editor.selection.setNode(e),this},a.prototype.toggleFormat=function(e){return this.editor.formatter.toggle(e),this.editor.undoManager.add(),this.editor.nodeChanged(),this},a.prototype.toggleOrderedList=function(){return this.editor.execCommand("InsertOrderedList"),this},a.prototype.toggleUnorderedList=function(){return this.editor.execCommand("InsertUnorderedList"),this},a.prototype.undo=function(){return this.editor.execCommand("Undo"),this},t.exports=a},{bluebird:1}],7:[function(e,t,n){var r=e("js-cookie"),i=e("nprogress"),o=e("screenfull"),a=e("../modules/editor.js"),s=e("bluebird");$(function(){function e(e){$(".admin-toolbar").toggleClass("disabled",e)}function t(e){$(e.target).is("a[href]")&&$("#link-panel").panel("show"),$(e.target).is("figure.image, img")&&$("#image-panel").panel("show"),$(e.target).is("[data-embed]")&&$("#embed-panel").panel("show")}function n(e){e.preventDefault(),p()}function l(e){$("#file-manager").is(":visible")||(e.preventDefault(),_(e)&&k(e.target))}function c(e){var t=$(e.target).closest(".dropzone-target").attr("data-target");e.preventDefault(),p(),t&&_(e)&&R({file:e.originalEvent.dataTransfer.files[0],action:B,method:"POST"}).then(function(e){return e.upload&&e.upload.filename.match(/\.(gif|jpg|jpeg|png|svg)$/i)?"post:image"===t?($("#image").val(e.upload.path).trigger("change"),void g(C())):void W.insertImage(e.upload.path):e.upload&&"post:content"===t?void W.insertContent($("<a>").attr("href",e.upload.path).text(e.upload.filename).get(0).outerHTML):void 0})["catch"](function(e){e.message&&$.announce.warning(e.message)})}function u(e){var t=$("html").is(".mac"),n=t?e.metaKey:e.ctrlKey;n&&75===e.keyCode&&(e.preventDefault(),$("#link-panel").panel("show")),n&&e.shiftKey&&73===e.keyCode&&(e.preventDefault(),$("#image-panel").panel("show")),n&&e.shiftKey&&69===e.keyCode&&(e.preventDefault(),$("#embed-panel").panel("show")),n&&13===e.keyCode&&this.insertContent("<hr/>"),clearTimeout(J),J=setTimeout(P,500)}function f(){S()}function d(e){var t=e.content;t.match(/^https?:\/\//i)&&(e.stopPropagation(),e.preventDefault(),h(t))}function p(){G=setTimeout(function(){$("#dropzone").prop("hidden",!0),$("#dropzone .dropzone-target").removeClass("active")},10)}function h(e){return e.match(/^https?:\/\/(.*?)\.(gif|jpg|jpeg|png|svg)$/i)?W.insertImage(e):(i.start(),void $.ajax({url:L,type:"GET",data:{url:e}}).done(function(e){return e.embed&&e.embed.html?W.insertEmbed(e.embed.html,{provider:e.site_name}):e.preview?W.insertEmbed(e.preview):void 0}).always(function(){return i.done()}))}function v(){return z!==JSON.stringify(C())}function _(e){return void 0!==e.originalEvent&&(void 0!==e.originalEvent.dataTransfer&&$.inArray("Files",e.originalEvent.dataTransfer.types)>-1)}function m(){K=$("#editor-frame").get(0).contentWindow.document,$(".main-container").removeClass("loading");for(var r=[{code:"{@head/}",selector:'[data-postleaf-editor="styles"]'},{code:"{@foot/}",selector:'[data-postleaf-editor="scripts"]'},{code:'{@title editable="true"/}',selector:'[data-postleaf-region="title"]'},{code:'{@content editable="true/}',selector:'[data-postleaf-region="content"]'}],i=0;i<r.length;i++){var o=r[i];if(!$(o.selector,K).length)return void $("#missing-helper").find("code").text(o.code).end().prop("hidden",!1)}$("#editor-frame").prop("hidden",!1),$(K).on("click mousedown","a, area",function(e){$(this).parents().addBack().is("[data-postleaf-region]")||e.preventDefault()}).on("submit","form",function(e){return e.preventDefault()}).on("click keydown mousedown touchstart",function(e){return $(document).trigger(e)}),$(document).add(K).on("dragover",l).on("dragleave",n).on("drop",c),Q=new a({element:$('[data-postleaf-region="title"]',K).get(0),baseUrl:$("#editor-frame").attr("data-base-url"),placeholder:$("#editor-frame").attr("data-default-title"),textOnly:!0,allowNewlines:!1,onReady:function(){y(),Q.focus()}}),W=new a({element:$('[data-postleaf-region="content"]',K).get(0),baseUrl:$("#editor-frame").attr("data-base-url"),captionPlaceholder:$("#editor-frame").attr("data-caption-placeholder"),convertMarkdown:!0,placeholder:$("#editor-frame").attr("data-default-content"),onDoubleClick:t,onKeyDown:u,onPaste:d,onSelectionChange:f,onReady:function(){y(),e(!1),S(),P()}})}function g(e){return new s(function(t){$(".main-container").addClass("loading"),$("#editor-frame").animateCSS("fadeOut",100,function(){$(this).css("opacity",0),b(e).then(function(){$(".main-container").removeClass("loading"),$("#editor-frame").animateCSS("fadeIn",100,function(){$(this).css("opacity",1),t()})})})})}function y(){z=JSON.stringify(C())}function b(e){return new s(function(t){var n=Q.element,r=W.element,i=$("<form>");$('form[target="dummy_frame"], iframe[name="dummy_frame"]').remove(),$("<iframe>").hide().attr("name","dummy_frame").appendTo("body").one("load",function(){$("html",K).attr("class",this.contentWindow.document.documentElement.className),$("head",K).replaceWith(this.contentWindow.document.head),$("body",K).replaceWith(this.contentWindow.document.body),$('[data-postleaf-region="title"]',K).replaceWith(n),$('[data-postleaf-region="content"]',K).replaceWith(r),$(this).remove(),t()}),$(i).hide().attr("action",M+"?isEditor=true&isZenMode="+q).attr("method","post").attr("target","dummy_frame").append($('<input type="hidden" name="post">').val(JSON.stringify(e))).appendTo("body").submit().remove()})}function w(){i.start(),$(".form-group").removeClass("has-warning"),$.ajax({url:I?H.replace(":id",I):A,type:I?"PUT":"POST",data:C(),dataType:"json"}).done(function(e){if(y(),e.post){var t=I?O:N.replace(":name",e.post.title);$.announce.success(t),I=e.post.id}S(),T(!0)}).fail(function(e){var t=e.responseJSON;if(t.invalid)for(var n in t.invalid)$(':input[name="'+t.invalid[n]+'"]').closest(".form-group").addClass("has-warning");t.message&&$.announce.warning(t.message)}).always(i.done)}function C(){return{title:Q.isReady?Q.getContent():null,content:W.isReady?W.getContent():null,slug:$("#slug").val()||Postleaf.Slug(Q.getContent()),"published-at":$("#pub-date").val()+" "+$("#pub-time").val(),template:$("#template").val(),tags:$("#tags").get(0).selectize.items,"user-id":$("#author").val(),status:$("#status").val(),"is-featured":$("#is-featured").prop("checked"),"is-sticky":$("#is-sticky").prop("checked"),"is-page":$("#is-page").prop("checked"),"meta-title":$("#meta-title").val(),"meta-description":$("#meta-description").val(),image:$("#image").val()}}function k(e){e=$(e).parents().addBack(),clearTimeout(G),["post:image","post:content"].forEach(function(t){$('#dropzone [data-target="'+t+'"]').toggleClass("active",$(e).is('[data-target="'+t+'"]'))}),$("#dropzone").prop("hidden",!1)}function E(){o.enabled&&o.toggle()}function j(){V=!V,r.set("wordCount",V+""),$("#word-count").prop("hidden",!V),S()}function F(e){q=e,r.set("zenMode",e),$("#zen-mode-theme").prop("hidden",!q),W&&W.isReady&&(g(C()),S())}function x(e){r.set("zenTheme",e),$("[data-zen-theme]").attr("data-zen-theme",e),$(K.body).attr("data-theme",e)}function T(e){return new s(function(t,n){var r=$("#revisions").find("tr").length>0;$("#revisions").find("table").prop("hidden",!r),$("#no-revisions").prop("hidden",r),I&&e&&$.ajax({url:U,type:"GET",data:{postId:I,render:"revisionsTable"}}).done(function(e){e.html&&$("#revisions").html(e.html),t()}).fail(function(e){return n(e.responseJSON)})})}function S(){$("[data-zen-mode]").toggleClass("enabled",q),o.enabled&&$("[data-fullscreen]").toggleClass("enabled",o.isFullscreen),$("[data-word-count]").toggleClass("enabled",V),$('[data-editor="command:undo"]').prop("disabled",!W.hasUndo()),$('[data-editor="command:redo"]').prop("disabled",!W.hasRedo()),$('[data-editor^="format:"]').each(function(){var e=$(this).attr("data-editor").split(":")[1];$(this).toggleClass("enabled",W.hasFormat(e))}),$('[data-editor="command:toggleOrderedList"]').toggleClass("enabled",W.isOrderedList()),$('[data-editor="command:toggleUnorderedList"]').toggleClass("enabled",W.isUnorderedList()),$('[data-editor="panel:image"]').toggleClass("enabled",W.isImage()),$('[data-editor="panel:link"]').toggleClass("enabled",W.isLink()),$('[data-editor="panel:embed"]').toggleClass("enabled",W.isEmbed()),$(".dropdown-menu").each(function(){var e=this,t=$(e).closest(".dropdown").find('[data-toggle="dropdown"]');$(t).toggleClass("enabled",$(e).find(".enabled").length>0)})}function P(){var e=W.getWordCount();$("#word-count").prop("hidden",!V),$(".word-count-none").prop("hidden",e>0),$(".word-count-one").prop("hidden",1!==e),$(".word-count-many").prop("hidden",e<=1),$(".word-count").text(e)}function R(e){return new s(function(t,n){e=e||{};var r=new FormData;if("object"===_typeof(e.data))for(var o in e.data)r.append(o,e.data[o]);r.append("file",e.file),$.ajax({url:e.action,type:e.method||"POST",data:r,dataType:"json",contentType:!1,processData:!1,cache:!1,progress:function(e){e.lengthComputable&&i.set(e.loaded/e.total)}}).done(function(e){return t(e)}).fail(function(e){return n(e.responseJSON)})})}var O=$("#editor-frame").attr("data-changes-saved"),A=$("#editor-frame").attr("data-create-action"),L=$("#editor-frame").attr("data-embed-action"),D=JSON.parse($("#editor-frame").attr("data-link-suggestions")),I=$("#editor-frame").attr("data-post-id"),N=$("#editor-frame").attr("data-post-created"),M=$("#editor-frame").attr("data-preview-action"),U=$("#editor-frame").attr("data-revision-table-action"),H=$("#editor-frame").attr("data-update-action"),B=$("#editor-frame").attr("data-upload-action"),V="true"===r.get("wordCount"),q=!1,z=void 0,W=void 0,G=void 0,K=void 0,Q=void 0,J=void 0;T(!0),$(".image-control").imageControl().on("uploadProgress.imageControl",function(e,t){return i.set(.9*t)}).on("uploadComplete.imageControl",function(){return i.done(!1)}),$(".dropdown").on("shown.bs.dropdown",function(){return W.focus()}).on("shown.bs.dropdown",function(){var e=$(this).find(".dropdown-menu");$(e).removeClass("dropdown-menu-right").toggleClass("dropdown-menu-right",$(e).is(":off-right"))}),$(".admin-toolbar").on("mousedown",function(e){return e.preventDefault()}),$("#editor-frame").attr("src",$("#editor-frame").attr("data-src")).one("load",m),$("[data-fullscreen]").prop("hidden",!o.enabled).on("click",E),o.enabled&&o.onchange(S),$("[data-word-count]").on("click",j),$("[data-zen-mode]").on("click",function(){return F(!q)}),$("[data-zen-theme]").on("click",function(){var e=$(this).attr("data-zen-theme");x("night"===e?"day":"night")}),"true"===r.get("zenMode")&&F(!0),$("#slug").on("change",function(){this.value=Postleaf.Slug(this.value)}),$("#settings-panel").on("show.panel",function(){$(this).data("cleanState",JSON.stringify(C()))}).on("hide.panel",function(e){var t=C(),n=$(this).data("cleanState");return $("#file-manager").is(":visible")?void e.preventDefault():void(JSON.stringify(t)!==n&&g(t))}),$("#tags").selectize({items:JSON.parse($("#tags").attr("data-current-tags")||"[]").map(function(e){return e.id}),options:JSON.parse($("#tags").attr("data-all-tags")||"[]"),valueField:"id",labelField:"name",searchField:["slug","name"],delimiter:",",highlight:!1}),$('[data-autocomplete="links"]').typeahead({hint:!1,minLength:1,highlight:!1},{name:"linkSuggestions",limit:5,display:"url",templates:{suggestion:function(e){switch(e.type){case"post":return'<div><i class="fa fa-file-text"></i> '+e.label+"</div>";case"tag":return'<div><i class="fa fa-tag"></i> '+e.label+"</div>";case"user":return'<div><i class="fa fa-user"></i> '+e.label+"</div>";default:return"<div>"+e.label+"</div>"}}},source:function(e){return function(t,n){var r=[],i=new RegExp(t,"i");$.each(e,function(e,t){i.test(t.searchText)&&r.push(t)}),n(r)}}(D)}),$(document).on("click","[data-open-revision]",function(){var e=$(this).attr("data-open-revision");window.open(e)}),$(document).on("click","[data-edit-revision]",function(){var e=$(this).attr("data-edit-revision");$(".main-container").addClass("loading"),$("#editor-frame").animateCSS("fadeOut",100,function(){$(this).css("opacity",0),$.ajax({url:e,type:"GET"}).done(function(e){e.revision&&(Q.setContent(e.revision.title),W.setContent(e.revision.content),y(),W.resetUndo())}).always(function(){$(".main-container").removeClass("loading"),$("#editor-frame").animateCSS("fadeIn",100,function(){$(this).css("opacity",1)})})})}),$(document).on("click","[data-delete-revision]",function(){var e=this.closest("tr"),t=$(this).attr("data-confirm"),n=$(this).attr("data-delete-revision");$.alertable.confirm(t).then(function(){i.start(),$.ajax({url:n,type:"DELETE"}).done(function(){$(e).animateCSS("fadeOut",300,function(){$(this).remove(),T(!1)})}).always(function(){return i.done()})})}),$(document).on("click","[data-editor]",function(){var e=$(this).attr("data-editor").split(":"),t=e[0],n=e[1];switch(t){case"insert":W.insertContent($(this).attr("data-content"));break;case"format":W.toggleFormat(n);break;case"command":"function"==typeof W[n]&&W[n]()}}),$(document).on("keydown",function(e){var t=$("html").is(".mac"),n=t?e.metaKey:e.ctrlKey;e.altKey&&e.shiftKey&&70===e.keyCode&&(e.preventDefault(),E()),e.altKey&&e.shiftKey&&90===e.keyCode&&(e.preventDefault(),F(!q)),e.altKey&&e.shiftKey&&87===e.keyCode&&(e.preventDefault(),j()),n&&188===e.keyCode&&(e.preventDefault(),$("#settings-panel").panel("show")),n&&83===e.keyCode&&(e.preventDefault(),w())}),$("[data-save]").on("click",w),window.onbeforeunload=function(){if(z&&v())return $("#editor-frame").attr("data-save-confirmation")},function(){function e(){var e=$("#slug").val(),t=$.trim($("#meta-title").val())||$.trim(Q.getContent()),n=$.trim($("#meta-description").val())||$.trim($(W.getContent()).text());$(".search-engine-preview-slug").text(e),$(".search-engine-preview-title").text(t),$(".search-engine-preview-description").text(n)}$("#settings-panel").on("show.panel",function(){return e()}),$("#slug, #meta-title, #meta-description").on("change keyup paste",e)}(),function(){var e=void 0,t=void 0;$("#link-panel").on("show.panel",function(){var n=void 0,r=void 0;e=W.getLocation(),t=$(W.getSelectedElement()).closest("a"),n=decodeURI($(t).attr("href")||""),r=$(t).attr("title")||"",$("#link-href").typeahead("val",n),$("#link-title").val(r),$('[data-link="remove"]').prop("hidden",!t.length)}).on("shown.panel",function(){return $("#link-href").focus()}).on("hide.panel",function(e){return $("#file-manager").is(":visible")?void e.preventDefault():void W.focus()}),$("#link-panel form").on("submit",function(t){var n=encodeURI($("#link-href").typeahead("val")),r=$("#link-title").val();t.preventDefault(),W.setLocation(e),n.length?W.insertLink(n,{title:r}):W.removeLink()}),$('[data-link="remove"]').on("click",function(){W.removeLink(),$("#link-panel").panel("hide")}),$('[data-link="browse"]').on("click",function(){Postleaf.FileManager.select({multiSelect:!1,onSelect:function(e){return $("#link-href").typeahead("val",e.path)}})}),$("#link-panel").on("change",":file",function(e){var t=this;e.target.files.length&&R({file:e.target.files[0],action:B,method:"POST"}).then(function(e){$(t).val(""),e.upload&&$("#link-href").typeahead("val",e.upload.path)})["catch"](function(e){e.message&&$.announce.warning(e.message)})})}(),function(){var e=void 0,t=void 0,n=void 0;$("#image-panel").on("show.panel",function(){var r=void 0,i=void 0,o=void 0;e=W.getLocation(),t=$(W.getSelectedElement()).closest("figure"),n=t.length?$(t).find("img"):$(W.getSelectedElement()).closest("img"),r=decodeURI($(n).attr("src")||""),i=decodeURI($(n).parent().is("a")?$(n).parent().attr("href"):""),o=$(n).attr("alt")||"",$("#image-src").val(r),$("#image-href").val(i),$("#image-alt").val(o),$("#image-caption").prop("checked",$(t).find("figcaption").length>0),$('[data-image="delete"]').prop("hidden",!n.length),$("#image-align-none").trigger("click"),n&&(W.isAlignLeft()&&$("#image-align-left").trigger("click"),W.isAlignCenter()&&$("#image-align-center").trigger("click"),W.isAlignRight()&&$("#image-align-right").trigger("click"))}).on("shown.panel",function(){return $("#image-src").focus()}).on("hide.panel",function(e){return $("#file-manager").is(":visible")?void e.preventDefault():void W.focus()}),$("#image-panel form").on("submit",function(r){var i=encodeURI($("#image-src").val()),o=$("#image-alt").val(),a=$("#image-caption").prop("checked"),s=$("#image-panel").find('input[name="align"]:checked').val();r.preventDefault(),W.setLocation(e),i.length?W.insertImage(i,{src:i,alt:o,caption:a,align:s}):W.removeElement(t||n)}),$('[data-image="delete"]').on("click",function(){W.removeElement(t||n),$("#image-panel").panel("hide")}),$('[data-image="browse"]').on("click",function(){Postleaf.FileManager.select({mimeTypes:["image/gif","image/jpeg","image/png","image/svg+xml"],multiSelect:!1,onSelect:function(e){return $("#image-src").val(e.path)}})}),$("#image-panel").on("change",":file",function(e){var t=this;e.target.files.length&&R({file:e.target.files[0],action:B,method:"POST"}).then(function(e){$(t).val(""),e.upload&&$("#image-src").val(e.upload.path).trigger("change")})["catch"](function(e){e.message&&$.announce.warning(e.message)})})}(),function(){var e=void 0,t=void 0;$("#embed-panel").on("show.panel",function(){var n=void 0;e=W.getLocation(),t=$(W.getSelectedElement()).closest("[data-embed]"),n=$(t).attr("data-embed")||"",$("#embed-code").val(n),$('[data-embed="delete"]').prop("hidden",!t.length)}).on("shown.panel",function(){return $("#embed-code").focus()}).on("hide.panel",function(){return W.focus()}),$("#embed-panel form").on("submit",function(n){var r=$("#embed-code").val(),i=t?$(t).attr("data-embed-provider"):"";n.preventDefault(),W.setLocation(e),r.length?r.match(/^https?:\/\//i)?h(r):W.insertEmbed(r,{provider:i}):W.removeElement(t)}),$('[data-embed="delete"]').on("click",function(){W.removeElement(t),$("#embed-panel").panel("hide")})}(),function(){function e(){$("#editor-frame").css("marginTop",$(".admin-toolbar").outerHeight()),$(".admin-toolbar").css("top",$(window).scrollTop())}var t=void 0;$("html").is(".ios")&&($(".admin-toolbar").css({position:"absolute",zIndex:2,top:0,left:0,width:"100%"}),$("#editor-frame").on("load",e),$(window).on("orientationchange",e),$(window).on("scroll",function(){$(".admin-toolbar").prop("hidden",!0),clearTimeout(t),t=setTimeout(function(){
  $(".admin-toolbar").prop("hidden",!1),e()},100)}))}()})},{"../modules/editor.js":6,bluebird:1,"js-cookie":2,nprogress:3,screenfull:5}]},{},[7]);