Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

1vk

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

1vk - npm Package Compare versions

Comparing version 1.0.2 to 1.2.0

0

dist/1vk.js
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n;n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,n.VK=t()}}(function(){var t;return function n(t,e,r){function o(u,c){if(!e[u]){if(!t[u]){var s="function"==typeof require&&require;if(!c&&s)return s(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var a=e[u]={exports:{}};t[u][0].call(a.exports,function(n){var e=t[u][1][n];return o(e?e:n)},a,a.exports,n,t,e,r)}return e[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,n){n.exports=t("./lib/ApiQueue")},{"./lib/ApiQueue":2}],2:[function(t,n){function e(t,n,e){this.queue=new r(t,n,e),this.currentBundle=new o}var r=t("./LimitingQueue"),o=t("./Bundle"),i=t("./Request"),u=t("underscore");e.prototype.request=function(t,n){var e=new i(t,n);return this.currentBundle.add(e).isFull()?this.sendCurrentBundleImmediate():this.sendCurrentBundle(),e.dfd.promise},e.prototype.sendCurrentBundleImmediate=function(){this.queue.add(this.currentBundle)["catch"](function(t){console.error(t)}),this.currentBundle=new o},e.prototype.sendCurrentBundle=u.debounce(e.prototype.sendCurrentBundleImmediate,50),n.exports=e},{"./Bundle":3,"./LimitingQueue":4,"./Request":5,underscore:7}],3:[function(t,n){function e(t){this.size=t||25,this.requests=[],this.dfd=r.defer()}var r=t("when"),o=t("underscore");e.prototype.restorePromise=function(){return this.dfd=r.defer(),this},e.prototype.isFull=function(){return this.requests.length===this.size},e.prototype.add=function(t){return this.requests.push(t),this},e.prototype.toApiString=function(){var t="var results = []; \n";return o.each(this.requests,function(n){t+="results.push("+n.toApiString()+"); \n"},this),t+="return results;"},e.prototype.start=function(t){1==this.requests.length&&this.requests[0].start(),t("execute",{code:this.toApiString()},this._handleResponse.bind(this))},e.prototype._handleResponse=function(t){t.error?this.dfd.reject(t.error):this._resolveResults(t.response)},e.prototype._resolveResults=function(t){o.each(t,function(t,n){this.requests[n].dfd.resolve(t)},this)},n.exports=e},{underscore:7,when:25}],4:[function(t,n){function e(t,n,e){this._limit=t,this._coldTime=n,this._api=e,this._requestToLimit=t,this._line=[],this._timeout=null,this._processRejection=this._processRejection.bind(this)}var r=t("underscore");e.prototype.add=function(t,n){var e=t.dfd.promise["catch"](this._processRejection.bind(this,t));return this.startRequest(t)||(n?this._line.unshift(t):this._line.push(t)),e},e.prototype._processRejection=function(t,n){return 6==n.error_code?this.add(t.restorePromise(),!0):n},e.prototype.startRequest=function(t){return null===this._timeout&&(this._timeout=setTimeout(this.resetLimit.bind(this),this._coldTime)),this._requestToLimit?(t.start(this._api),this._requestToLimit--,!0):!1},e.prototype.resetLimit=function(){this._timeout=null,this._requestToLimit=this._limit;var t=this._line.splice(0,this._limit);r.each(t,this.startRequest,this)},n.exports=e},{underscore:7}],5:[function(t,n){function e(t,n){this._type=t,this._param=n,this.dfd=r.defer()}var r=t("when"),o=t("underscore");e.prototype.start=function(t){return t(this._type,this._param,o.compose(this.dfd.resolve,o.property("response"))),this},e.prototype.toApiString=function(){return["API.",this._type,"(",JSON.stringify(this._param),")"].join("")},n.exports=e},{underscore:7,when:25}],6:[function(t,n){function e(){if(!u){u=!0;for(var t,n=i.length;n;){t=i,i=[];for(var e=-1;++e<n;)t[e]();n=i.length}u=!1}}function r(){}var o=n.exports={},i=[],u=!1;o.nextTick=function(t){i.push(t),u||setTimeout(e,0)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=r,o.addListener=r,o.once=r,o.off=r,o.removeListener=r,o.removeAllListeners=r,o.emit=r,o.binding=function(){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],7:[function(n,e,r){(function(){function n(t){function n(n,e,r,o,i,u){for(;i>=0&&u>i;i+=t){var c=o?o[i]:i;r=e(r,n[c],c,n)}return r}return function(e,r,o,i){r=w(r,i,4);var u=!O(e)&&b.keys(e),c=(u||e).length,s=t>0?0:c-1;return arguments.length<3&&(o=e[u?u[s]:s],s+=t),n(e,r,o,u,s,c)}}function o(t){return function(n,e,r){e=j(e,r);for(var o=null!=n&&n.length,i=t>0?0:o-1;i>=0&&o>i;i+=t)if(e(n[i],i,n))return i;return-1}}function i(t,n){var e=S.length,r=t.constructor,o=b.isFunction(r)&&r.prototype||f,i="constructor";for(b.has(t,i)&&!b.contains(n,i)&&n.push(i);e--;)i=S[e],i in t&&t[i]!==o[i]&&!b.contains(n,i)&&n.push(i)}var u=this,c=u._,s=Array.prototype,f=Object.prototype,a=Function.prototype,l=s.push,h=s.slice,p=f.toString,d=f.hasOwnProperty,v=Array.isArray,y=Object.keys,m=a.bind,g=Object.create,_=function(){},b=function(t){return t instanceof b?t:this instanceof b?void(this._wrapped=t):new b(t)};"undefined"!=typeof r?("undefined"!=typeof e&&e.exports&&(r=e.exports=b),r._=b):u._=b,b.VERSION="1.8.2";var w=function(t,n,e){if(void 0===n)return t;switch(null==e?3:e){case 1:return function(e){return t.call(n,e)};case 2:return function(e,r){return t.call(n,e,r)};case 3:return function(e,r,o){return t.call(n,e,r,o)};case 4:return function(e,r,o,i){return t.call(n,e,r,o,i)}}return function(){return t.apply(n,arguments)}},j=function(t,n,e){return null==t?b.identity:b.isFunction(t)?w(t,n,e):b.isObject(t)?b.matcher(t):b.property(t)};b.iteratee=function(t,n){return j(t,n,1/0)};var x=function(t,n){return function(e){var r=arguments.length;if(2>r||null==e)return e;for(var o=1;r>o;o++)for(var i=arguments[o],u=t(i),c=u.length,s=0;c>s;s++){var f=u[s];n&&void 0!==e[f]||(e[f]=i[f])}return e}},A=function(t){if(!b.isObject(t))return{};if(g)return g(t);_.prototype=t;var n=new _;return _.prototype=null,n},R=Math.pow(2,53)-1,O=function(t){var n=t&&t.length;return"number"==typeof n&&n>=0&&R>=n};b.each=b.forEach=function(t,n,e){n=w(n,e);var r,o;if(O(t))for(r=0,o=t.length;o>r;r++)n(t[r],r,t);else{var i=b.keys(t);for(r=0,o=i.length;o>r;r++)n(t[i[r]],i[r],t)}return t},b.map=b.collect=function(t,n,e){n=j(n,e);for(var r=!O(t)&&b.keys(t),o=(r||t).length,i=Array(o),u=0;o>u;u++){var c=r?r[u]:u;i[u]=n(t[c],c,t)}return i},b.reduce=b.foldl=b.inject=n(1),b.reduceRight=b.foldr=n(-1),b.find=b.detect=function(t,n,e){var r;return r=O(t)?b.findIndex(t,n,e):b.findKey(t,n,e),void 0!==r&&-1!==r?t[r]:void 0},b.filter=b.select=function(t,n,e){var r=[];return n=j(n,e),b.each(t,function(t,e,o){n(t,e,o)&&r.push(t)}),r},b.reject=function(t,n,e){return b.filter(t,b.negate(j(n)),e)},b.every=b.all=function(t,n,e){n=j(n,e);for(var r=!O(t)&&b.keys(t),o=(r||t).length,i=0;o>i;i++){var u=r?r[i]:i;if(!n(t[u],u,t))return!1}return!0},b.some=b.any=function(t,n,e){n=j(n,e);for(var r=!O(t)&&b.keys(t),o=(r||t).length,i=0;o>i;i++){var u=r?r[i]:i;if(n(t[u],u,t))return!0}return!1},b.contains=b.includes=b.include=function(t,n,e){return O(t)||(t=b.values(t)),b.indexOf(t,n,"number"==typeof e&&e)>=0},b.invoke=function(t,n){var e=h.call(arguments,2),r=b.isFunction(n);return b.map(t,function(t){var o=r?n:t[n];return null==o?o:o.apply(t,e)})},b.pluck=function(t,n){return b.map(t,b.property(n))},b.where=function(t,n){return b.filter(t,b.matcher(n))},b.findWhere=function(t,n){return b.find(t,b.matcher(n))},b.max=function(t,n,e){var r,o,i=-1/0,u=-1/0;if(null==n&&null!=t){t=O(t)?t:b.values(t);for(var c=0,s=t.length;s>c;c++)r=t[c],r>i&&(i=r)}else n=j(n,e),b.each(t,function(t,e,r){o=n(t,e,r),(o>u||o===-1/0&&i===-1/0)&&(i=t,u=o)});return i},b.min=function(t,n,e){var r,o,i=1/0,u=1/0;if(null==n&&null!=t){t=O(t)?t:b.values(t);for(var c=0,s=t.length;s>c;c++)r=t[c],i>r&&(i=r)}else n=j(n,e),b.each(t,function(t,e,r){o=n(t,e,r),(u>o||1/0===o&&1/0===i)&&(i=t,u=o)});return i},b.shuffle=function(t){for(var n,e=O(t)?t:b.values(t),r=e.length,o=Array(r),i=0;r>i;i++)n=b.random(0,i),n!==i&&(o[i]=o[n]),o[n]=e[i];return o},b.sample=function(t,n,e){return null==n||e?(O(t)||(t=b.values(t)),t[b.random(t.length-1)]):b.shuffle(t).slice(0,Math.max(0,n))},b.sortBy=function(t,n,e){return n=j(n,e),b.pluck(b.map(t,function(t,e,r){return{value:t,index:e,criteria:n(t,e,r)}}).sort(function(t,n){var e=t.criteria,r=n.criteria;if(e!==r){if(e>r||void 0===e)return 1;if(r>e||void 0===r)return-1}return t.index-n.index}),"value")};var T=function(t){return function(n,e,r){var o={};return e=j(e,r),b.each(n,function(r,i){var u=e(r,i,n);t(o,r,u)}),o}};b.groupBy=T(function(t,n,e){b.has(t,e)?t[e].push(n):t[e]=[n]}),b.indexBy=T(function(t,n,e){t[e]=n}),b.countBy=T(function(t,n,e){b.has(t,e)?t[e]++:t[e]=1}),b.toArray=function(t){return t?b.isArray(t)?h.call(t):O(t)?b.map(t,b.identity):b.values(t):[]},b.size=function(t){return null==t?0:O(t)?t.length:b.keys(t).length},b.partition=function(t,n,e){n=j(n,e);var r=[],o=[];return b.each(t,function(t,e,i){(n(t,e,i)?r:o).push(t)}),[r,o]},b.first=b.head=b.take=function(t,n,e){return null==t?void 0:null==n||e?t[0]:b.initial(t,t.length-n)},b.initial=function(t,n,e){return h.call(t,0,Math.max(0,t.length-(null==n||e?1:n)))},b.last=function(t,n,e){return null==t?void 0:null==n||e?t[t.length-1]:b.rest(t,Math.max(0,t.length-n))},b.rest=b.tail=b.drop=function(t,n,e){return h.call(t,null==n||e?1:n)},b.compact=function(t){return b.filter(t,b.identity)};var q=function(t,n,e,r){for(var o=[],i=0,u=r||0,c=t&&t.length;c>u;u++){var s=t[u];if(O(s)&&(b.isArray(s)||b.isArguments(s))){n||(s=q(s,n,e));var f=0,a=s.length;for(o.length+=a;a>f;)o[i++]=s[f++]}else e||(o[i++]=s)}return o};b.flatten=function(t,n){return q(t,n,!1)},b.without=function(t){return b.difference(t,h.call(arguments,1))},b.uniq=b.unique=function(t,n,e,r){if(null==t)return[];b.isBoolean(n)||(r=e,e=n,n=!1),null!=e&&(e=j(e,r));for(var o=[],i=[],u=0,c=t.length;c>u;u++){var s=t[u],f=e?e(s,u,t):s;n?(u&&i===f||o.push(s),i=f):e?b.contains(i,f)||(i.push(f),o.push(s)):b.contains(o,s)||o.push(s)}return o},b.union=function(){return b.uniq(q(arguments,!0,!0))},b.intersection=function(t){if(null==t)return[];for(var n=[],e=arguments.length,r=0,o=t.length;o>r;r++){var i=t[r];if(!b.contains(n,i)){for(var u=1;e>u&&b.contains(arguments[u],i);u++);u===e&&n.push(i)}}return n},b.difference=function(t){var n=q(arguments,!0,!0,1);return b.filter(t,function(t){return!b.contains(n,t)})},b.zip=function(){return b.unzip(arguments)},b.unzip=function(t){for(var n=t&&b.max(t,"length").length||0,e=Array(n),r=0;n>r;r++)e[r]=b.pluck(t,r);return e},b.object=function(t,n){for(var e={},r=0,o=t&&t.length;o>r;r++)n?e[t[r]]=n[r]:e[t[r][0]]=t[r][1];return e},b.indexOf=function(t,n,e){var r=0,o=t&&t.length;if("number"==typeof e)r=0>e?Math.max(0,o+e):e;else if(e&&o)return r=b.sortedIndex(t,n),t[r]===n?r:-1;if(n!==n)return b.findIndex(h.call(t,r),b.isNaN);for(;o>r;r++)if(t[r]===n)return r;return-1},b.lastIndexOf=function(t,n,e){var r=t?t.length:0;if("number"==typeof e&&(r=0>e?r+e+1:Math.min(r,e+1)),n!==n)return b.findLastIndex(h.call(t,0,r),b.isNaN);for(;--r>=0;)if(t[r]===n)return r;return-1},b.findIndex=o(1),b.findLastIndex=o(-1),b.sortedIndex=function(t,n,e,r){e=j(e,r,1);for(var o=e(n),i=0,u=t.length;u>i;){var c=Math.floor((i+u)/2);e(t[c])<o?i=c+1:u=c}return i},b.range=function(t,n,e){arguments.length<=1&&(n=t||0,t=0),e=e||1;for(var r=Math.max(Math.ceil((n-t)/e),0),o=Array(r),i=0;r>i;i++,t+=e)o[i]=t;return o};var E=function(t,n,e,r,o){if(!(r instanceof n))return t.apply(e,o);var i=A(t.prototype),u=t.apply(i,o);return b.isObject(u)?u:i};b.bind=function(t,n){if(m&&t.bind===m)return m.apply(t,h.call(arguments,1));if(!b.isFunction(t))throw new TypeError("Bind must be called on a function");var e=h.call(arguments,2),r=function(){return E(t,r,n,this,e.concat(h.call(arguments)))};return r},b.partial=function(t){var n=h.call(arguments,1),e=function(){for(var r=0,o=n.length,i=Array(o),u=0;o>u;u++)i[u]=n[u]===b?arguments[r++]:n[u];for(;r<arguments.length;)i.push(arguments[r++]);return E(t,e,this,this,i)};return e},b.bindAll=function(t){var n,e,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(n=1;r>n;n++)e=arguments[n],t[e]=b.bind(t[e],t);return t},b.memoize=function(t,n){var e=function(r){var o=e.cache,i=""+(n?n.apply(this,arguments):r);return b.has(o,i)||(o[i]=t.apply(this,arguments)),o[i]};return e.cache={},e},b.delay=function(t,n){var e=h.call(arguments,2);return setTimeout(function(){return t.apply(null,e)},n)},b.defer=b.partial(b.delay,b,1),b.throttle=function(t,n,e){var r,o,i,u=null,c=0;e||(e={});var s=function(){c=e.leading===!1?0:b.now(),u=null,i=t.apply(r,o),u||(r=o=null)};return function(){var f=b.now();c||e.leading!==!1||(c=f);var a=n-(f-c);return r=this,o=arguments,0>=a||a>n?(u&&(clearTimeout(u),u=null),c=f,i=t.apply(r,o),u||(r=o=null)):u||e.trailing===!1||(u=setTimeout(s,a)),i}},b.debounce=function(t,n,e){var r,o,i,u,c,s=function(){var f=b.now()-u;n>f&&f>=0?r=setTimeout(s,n-f):(r=null,e||(c=t.apply(i,o),r||(i=o=null)))};return function(){i=this,o=arguments,u=b.now();var f=e&&!r;return r||(r=setTimeout(s,n)),f&&(c=t.apply(i,o),i=o=null),c}},b.wrap=function(t,n){return b.partial(n,t)},b.negate=function(t){return function(){return!t.apply(this,arguments)}},b.compose=function(){var t=arguments,n=t.length-1;return function(){for(var e=n,r=t[n].apply(this,arguments);e--;)r=t[e].call(this,r);return r}},b.after=function(t,n){return function(){return--t<1?n.apply(this,arguments):void 0}},b.before=function(t,n){var e;return function(){return--t>0&&(e=n.apply(this,arguments)),1>=t&&(n=null),e}},b.once=b.partial(b.before,2);var k=!{toString:null}.propertyIsEnumerable("toString"),S=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];b.keys=function(t){if(!b.isObject(t))return[];if(y)return y(t);var n=[];for(var e in t)b.has(t,e)&&n.push(e);return k&&i(t,n),n},b.allKeys=function(t){if(!b.isObject(t))return[];var n=[];for(var e in t)n.push(e);return k&&i(t,n),n},b.values=function(t){for(var n=b.keys(t),e=n.length,r=Array(e),o=0;e>o;o++)r[o]=t[n[o]];return r},b.mapObject=function(t,n,e){n=j(n,e);for(var r,o=b.keys(t),i=o.length,u={},c=0;i>c;c++)r=o[c],u[r]=n(t[r],r,t);return u},b.pairs=function(t){for(var n=b.keys(t),e=n.length,r=Array(e),o=0;e>o;o++)r[o]=[n[o],t[n[o]]];return r},b.invert=function(t){for(var n={},e=b.keys(t),r=0,o=e.length;o>r;r++)n[t[e[r]]]=e[r];return n},b.functions=b.methods=function(t){var n=[];for(var e in t)b.isFunction(t[e])&&n.push(e);return n.sort()},b.extend=x(b.allKeys),b.extendOwn=b.assign=x(b.keys),b.findKey=function(t,n,e){n=j(n,e);for(var r,o=b.keys(t),i=0,u=o.length;u>i;i++)if(r=o[i],n(t[r],r,t))return r},b.pick=function(t,n,e){var r,o,i={},u=t;if(null==u)return i;b.isFunction(n)?(o=b.allKeys(u),r=w(n,e)):(o=q(arguments,!1,!1,1),r=function(t,n,e){return n in e},u=Object(u));for(var c=0,s=o.length;s>c;c++){var f=o[c],a=u[f];r(a,f,u)&&(i[f]=a)}return i},b.omit=function(t,n,e){if(b.isFunction(n))n=b.negate(n);else{var r=b.map(q(arguments,!1,!1,1),String);n=function(t,n){return!b.contains(r,n)}}return b.pick(t,n,e)},b.defaults=x(b.allKeys,!0),b.clone=function(t){return b.isObject(t)?b.isArray(t)?t.slice():b.extend({},t):t},b.tap=function(t,n){return n(t),t},b.isMatch=function(t,n){var e=b.keys(n),r=e.length;if(null==t)return!r;for(var o=Object(t),i=0;r>i;i++){var u=e[i];if(n[u]!==o[u]||!(u in o))return!1}return!0};var L=function(t,n,e,r){if(t===n)return 0!==t||1/t===1/n;if(null==t||null==n)return t===n;t instanceof b&&(t=t._wrapped),n instanceof b&&(n=n._wrapped);var o=p.call(t);if(o!==p.call(n))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+n;case"[object Number]":return+t!==+t?+n!==+n:0===+t?1/+t===1/n:+t===+n;case"[object Date]":case"[object Boolean]":return+t===+n}var i="[object Array]"===o;if(!i){if("object"!=typeof t||"object"!=typeof n)return!1;var u=t.constructor,c=n.constructor;if(u!==c&&!(b.isFunction(u)&&u instanceof u&&b.isFunction(c)&&c instanceof c)&&"constructor"in t&&"constructor"in n)return!1}e=e||[],r=r||[];for(var s=e.length;s--;)if(e[s]===t)return r[s]===n;if(e.push(t),r.push(n),i){if(s=t.length,s!==n.length)return!1;for(;s--;)if(!L(t[s],n[s],e,r))return!1}else{var f,a=b.keys(t);if(s=a.length,b.keys(n).length!==s)return!1;for(;s--;)if(f=a[s],!b.has(n,f)||!L(t[f],n[f],e,r))return!1}return e.pop(),r.pop(),!0};b.isEqual=function(t,n){return L(t,n)},b.isEmpty=function(t){return null==t?!0:O(t)&&(b.isArray(t)||b.isString(t)||b.isArguments(t))?0===t.length:0===b.keys(t).length},b.isElement=function(t){return!(!t||1!==t.nodeType)},b.isArray=v||function(t){return"[object Array]"===p.call(t)},b.isObject=function(t){var n=typeof t;return"function"===n||"object"===n&&!!t},b.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){b["is"+t]=function(n){return p.call(n)==="[object "+t+"]"}}),b.isArguments(arguments)||(b.isArguments=function(t){return b.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(b.isFunction=function(t){return"function"==typeof t||!1}),b.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},b.isNaN=function(t){return b.isNumber(t)&&t!==+t},b.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===p.call(t)},b.isNull=function(t){return null===t},b.isUndefined=function(t){return void 0===t},b.has=function(t,n){return null!=t&&d.call(t,n)},b.noConflict=function(){return u._=c,this},b.identity=function(t){return t},b.constant=function(t){return function(){return t}},b.noop=function(){},b.property=function(t){return function(n){return null==n?void 0:n[t]}},b.propertyOf=function(t){return null==t?function(){}:function(n){return t[n]}},b.matcher=b.matches=function(t){return t=b.extendOwn({},t),function(n){return b.isMatch(n,t)}},b.times=function(t,n,e){var r=Array(Math.max(0,t));n=w(n,e,1);for(var o=0;t>o;o++)r[o]=n(o);return r},b.random=function(t,n){return null==n&&(n=t,t=0),t+Math.floor(Math.random()*(n-t+1))},b.now=Date.now||function(){return(new Date).getTime()};var C={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},F=b.invert(C),N=function(t){var n=function(n){return t[n]},e="(?:"+b.keys(t).join("|")+")",r=RegExp(e),o=RegExp(e,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(o,n):t}};b.escape=N(C),b.unescape=N(F),b.result=function(t,n,e){var r=null==t?void 0:t[n];return void 0===r&&(r=e),b.isFunction(r)?r.call(t):r};var M=0;b.uniqueId=function(t){var n=++M+"";return t?t+n:n},b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var B=/(.)^/,P={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},I=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(t){return"\\"+P[t]};b.template=function(t,n,e){!n&&e&&(n=e),n=b.defaults({},n,b.templateSettings);var r=RegExp([(n.escape||B).source,(n.interpolate||B).source,(n.evaluate||B).source].join("|")+"|$","g"),o=0,i="__p+='";t.replace(r,function(n,e,r,u,c){return i+=t.slice(o,c).replace(I,Q),o=c+n.length,e?i+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":u&&(i+="';\n"+u+"\n__p+='"),n}),i+="';\n",n.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var u=new Function(n.variable||"obj","_",i)}catch(c){throw c.source=i,c}var s=function(t){return u.call(this,t,b)},f=n.variable||"obj";return s.source="function("+f+"){\n"+i+"}",s},b.chain=function(t){var n=b(t);return n._chain=!0,n};var z=function(t,n){return t._chain?b(n).chain():n};b.mixin=function(t){b.each(b.functions(t),function(n){var e=b[n]=t[n];b.prototype[n]=function(){var t=[this._wrapped];return l.apply(t,arguments),z(this,e.apply(b,t))}})},b.mixin(b),b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var n=s[t];b.prototype[t]=function(){var e=this._wrapped;return n.apply(e,arguments),"shift"!==t&&"splice"!==t||0!==e.length||delete e[0],z(this,e)}}),b.each(["concat","join","slice"],function(t){var n=s[t];b.prototype[t]=function(){return z(this,n.apply(this._wrapped,arguments))}}),b.prototype.value=function(){return this._wrapped},b.prototype.valueOf=b.prototype.toJSON=b.prototype.value,b.prototype.toString=function(){return""+this._wrapped},"function"==typeof t&&t.amd&&t("underscore",[],function(){return b})}).call(this)},{}],8:[function(n,e){!function(t){"use strict";t(function(t){var n=t("./makePromise"),e=t("./Scheduler"),r=t("./env").asap;return n({scheduler:new e(r)})})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./Scheduler":9,"./env":21,"./makePromise":23}],9:[function(n,e){!function(t){"use strict";t(function(){function t(t){this._async=t,this._running=!1,this._queue=this,this._queueLen=0,this._afterQueue={},this._afterQueueLen=0;var n=this;this.drain=function(){n._drain()}}return t.prototype.enqueue=function(t){this._queue[this._queueLen++]=t,this.run()},t.prototype.afterQueue=function(t){this._afterQueue[this._afterQueueLen++]=t,this.run()},t.prototype.run=function(){this._running||(this._running=!0,this._async(this.drain))},t.prototype._drain=function(){for(var t=0;t<this._queueLen;++t)this._queue[t].run(),this._queue[t]=void 0;for(this._queueLen=0,this._running=!1,t=0;t<this._afterQueueLen;++t)this._afterQueue[t].run(),this._afterQueue[t]=void 0;this._afterQueueLen=0},t})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],10:[function(n,e){!function(t){"use strict";t(function(){function t(n){Error.call(this),this.message=n,this.name=t.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],11:[function(n,e){!function(t){"use strict";t(function(){function t(t,e){function r(n,r,i){var u=t._defer(),c=i.length,s=new Array(c);return o({f:n,thisArg:r,args:i,params:s,i:c-1,call:e},u._handler),u}function o(n,r){if(n.i<0)return e(n.f,n.thisArg,n.params,r);var o=t._handler(n.args[n.i]);o.fold(i,n,void 0,r)}function i(t,n,e){t.params[t.i]=n,t.i-=1,o(t,e)}return arguments.length<2&&(e=n),r}function n(t,n,e,r){try{r.resolve(t.apply(n,e))}catch(o){r.reject(o)}}return t.tryCatchResolve=n,t})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],12:[function(n,e){!function(t){"use strict";t(function(t){var n=t("../state"),e=t("../apply");return function(t){function r(n){function e(t){a=null,this.resolve(t)}function r(t){this.resolved||(a.push(t),0===--f&&this.reject(a))}for(var o,i,u=t._defer(),c=u._handler,s=n.length>>>0,f=s,a=[],l=0;s>l;++l)if(i=n[l],void 0!==i||l in n){if(o=t._handler(i),o.state()>0){c.become(o),t._visitRemaining(n,l,o);break}o.visit(c,e,r)}else--f;return 0===f&&c.reject(new RangeError("any(): array must not be empty")),u}function o(n,e){function r(t){this.resolved||(a.push(t),0===--p&&(l=null,this.resolve(a)))}function o(t){this.resolved||(l.push(t),0===--i&&(a=null,this.reject(l)))}var i,u,c,s=t._defer(),f=s._handler,a=[],l=[],h=n.length>>>0,p=0;for(c=0;h>c;++c)u=n[c],(void 0!==u||c in n)&&++p;for(e=Math.max(e,0),i=p-e+1,p=Math.min(e,p),e>p?f.reject(new RangeError("some(): array must contain at least "+e+" item(s), but had "+p)):0===p&&f.resolve(a),c=0;h>c;++c)u=n[c],(void 0!==u||c in n)&&t._handler(u).visit(f,r,o,f.notify);return s}function i(n,e){return t._traverse(e,n)}function u(n,e){var r=g.call(n);return t._traverse(e,r).then(function(t){return c(r,t)})}function c(n,e){for(var r=e.length,o=new Array(r),i=0,u=0;r>i;++i)e[i]&&(o[u++]=t._handler(n[i]).value);return o.length=u,o}function s(t){return v(t.map(f))}function f(e){var r=t._handler(e);return 0===r.state()?d(e).then(n.fulfilled,n.rejected):(r._unreport(),n.inspect(r))}function a(t,n){return arguments.length>2?y.call(t,h(n),arguments[2]):y.call(t,h(n))}function l(t,n){return arguments.length>2?m.call(t,h(n),arguments[2]):m.call(t,h(n))}function h(t){return function(n,e,r){return p(t,void 0,[n,e,r])}}var p=e(t),d=t.resolve,v=t.all,y=Array.prototype.reduce,m=Array.prototype.reduceRight,g=Array.prototype.slice;return t.any=r,t.some=o,t.settle=s,t.map=i,t.filter=u,t.reduce=a,t.reduceRight=l,t.prototype.spread=function(t){return this.then(v).then(function(n){return t.apply(this,n)})},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../apply":11,"../state":24}],13:[function(n,e){!function(t){"use strict";t(function(){function t(){throw new TypeError("catch predicate must be a function")}function n(t,n){return e(n)?t instanceof n:n(t)}function e(t){return t===Error||null!=t&&t.prototype instanceof Error}function r(t){return("object"==typeof t||"function"==typeof t)&&null!==t}function o(t){return t}return function(e){function i(t,e){return function(r){return n(r,e)?t.call(this,r):f(r)}}function u(t,n,e,o){var i=t.call(n);return r(i)?c(i,e,o):e(o)}function c(t,n,e){return s(t).then(function(){return n(e)})}var s=e.resolve,f=e.reject,a=e.prototype["catch"];return e.prototype.done=function(t,n){this._handler.visit(this._handler.receiver,t,n)},e.prototype["catch"]=e.prototype.otherwise=function(n){return arguments.length<2?a.call(this,n):"function"!=typeof n?this.ensure(t):a.call(this,i(arguments[1],n))},e.prototype["finally"]=e.prototype.ensure=function(t){return"function"!=typeof t?this:this.then(function(n){return u(t,this,o,n)},function(n){return u(t,this,f,n)})},e.prototype["else"]=e.prototype.orElse=function(t){return this.then(void 0,function(){return t})},e.prototype["yield"]=function(t){return this.then(function(){return t})},e.prototype.tap=function(t){return this.then(t)["yield"](this)},e}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],14:[function(n,e){!function(t){"use strict";t(function(){return function(t){return t.prototype.fold=function(n,e){var r=this._beget();return this._handler.fold(function(e,r,o){t._handler(e).fold(function(t,e,r){r.resolve(n.call(this,e,t))},r,this,o)},e,r._handler.receiver,r._handler),r},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],15:[function(n,e){!function(t){"use strict";t(function(t){var n=t("../state").inspect;return function(t){return t.prototype.inspect=function(){return n(t._handler(this))},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../state":24}],16:[function(n,e){!function(t){"use strict";t(function(){return function(t){function n(t,n,r,o){return e(function(n){return[n,t(n)]},n,r,o)}function e(t,n,o,i){function u(i,u){return r(o(i)).then(function(){return e(t,n,o,u)})}return r(i).then(function(e){return r(n(e)).then(function(n){return n?e:r(t(e)).spread(u)})})}var r=t.resolve;return t.iterate=n,t.unfold=e,t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],17:[function(n,e){!function(t){"use strict";t(function(){return function(t){return t.prototype.progress=function(t){return this.then(void 0,void 0,t)},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],18:[function(n,e){!function(t){"use strict";t(function(t){function n(t,n,r,o){return e.setTimer(function(){t(r,o,n)},n)}var e=t("../env"),r=t("../TimeoutError");return function(t){function o(t,e,r){n(i,t,e,r)}function i(t,n){n.resolve(t)}function u(t,n,e){var o="undefined"==typeof t?new r("timed out after "+e+"ms"):t;n.reject(o)}return t.prototype.delay=function(t){var n=this._beget();return this._handler.fold(o,t,void 0,n._handler),n},t.prototype.timeout=function(t,r){var o=this._beget(),i=o._handler,c=n(u,t,r,o._handler);return this._handler.visit(i,function(t){e.clearTimer(c),this.resolve(t)},function(t){e.clearTimer(c),this.reject(t)},i.notify),o},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../TimeoutError":10,"../env":21}],19:[function(n,e){!function(t){"use strict";t(function(t){function n(t){throw t}function e(){}var r=t("../env").setTimer,o=t("../format");return function(t){function i(t){t.handled||(p.push(t),a("Potentially unhandled rejection ["+t.id+"] "+o.formatError(t.value)))}function u(t){var n=p.indexOf(t);n>=0&&(p.splice(n,1),l("Handled previous rejection ["+t.id+"] "+o.formatObject(t.value)))}function c(t,n){h.push(t,n),null===d&&(d=r(s,0))}function s(){for(d=null;h.length>0;)h.shift()(h.shift())}var f,a=e,l=e;"undefined"!=typeof console&&(f=console,a="undefined"!=typeof f.error?function(t){f.error(t)}:function(t){f.log(t)},l="undefined"!=typeof f.info?function(t){f.info(t)}:function(t){f.log(t)}),t.onPotentiallyUnhandledRejection=function(t){c(i,t)},t.onPotentiallyUnhandledRejectionHandled=function(t){c(u,t)},t.onFatalRejection=function(t){c(n,t.value)};var h=[],p=[],d=null;return t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"../env":21,"../format":22}],20:[function(n,e){!function(t){"use strict";t(function(){return function(t){return t.prototype["with"]=t.prototype.withThis=function(t){var n=this._beget(),e=n._handler;return e.receiver=t,this._handler.chain(e,t),n},t}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],21:[function(n,e){(function(r){!function(t){"use strict";t(function(t){function n(){return"undefined"!=typeof r&&null!==r&&"function"==typeof r.nextTick}function e(){return"function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver}function o(t){function n(){var t=e;e=void 0,t()}var e,r=document.createTextNode(""),o=new t(n);o.observe(r,{characterData:!0});var i=0;return function(t){e=t,r.data=i^=1}}var i,u="undefined"!=typeof setTimeout&&setTimeout,c=function(t,n){return setTimeout(t,n)},s=function(t){return clearTimeout(t)},f=function(t){return u(t,0)};if(n())f=function(t){return r.nextTick(t)};else if(i=e())f=o(i);else if(!u){var a=t,l=a("vertx");c=function(t,n){return l.setTimer(n,t)},s=l.cancelTimer,f=l.runOnLoop||l.runOnContext}return{setTimer:c,clearTimer:s,asap:f}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})}).call(this,n("_process"))},{_process:6}],22:[function(n,e){!function(t){"use strict";t(function(){function t(t){var e="object"==typeof t&&null!==t&&t.stack?t.stack:n(t);return t instanceof Error?e:e+" (WARNING: non-Error used)"}function n(t){var n=String(t);return"[object Object]"===n&&"undefined"!=typeof JSON&&(n=e(t,n)),n}function e(t,n){try{return JSON.stringify(t)}catch(e){return n}}return{formatError:t,formatObject:n,tryStringify:e}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],23:[function(n,e){(function(n){!function(t){"use strict";t(function(){return function(t){function e(t,n){this._handler=t===b?n:r(t)}function r(t){function n(t){o.resolve(t)}function e(t){o.reject(t)}function r(t){o.notify(t)}var o=new j;try{t(n,e,r)}catch(i){e(i)}return o}function o(t){return N(t)?t:new e(b,new x(m(t)))}function i(t){return new e(b,new x(new O(t)))}function u(){return tn}function c(){return new e(b,new j)}function s(t,n){var e=new j(t.receiver,t.join().context);return new n(b,e)}function f(t){return l(H,null,t)}function a(t,n){return l(Q,t,n)}function l(t,n,r){function o(e,o,u){u.resolved||h(r,i,e,t(n,o,e),u)}function i(t,n,e){a[t]=n,0===--f&&e.become(new R(a))}for(var u,c="function"==typeof n?o:i,s=new j,f=r.length>>>0,a=new Array(f),l=0;l<r.length&&!s.resolved;++l)u=r[l],void 0!==u||l in r?h(r,c,l,u,s):--f;return 0===f&&s.become(new R(a)),new e(b,s)}function h(t,n,e,r,o){if(M(r)){var i=g(r),u=i.state();0===u?i.fold(n,e,void 0,o):u>0?n(e,i.value,o):(o.become(i),p(t,e+1,i))}else n(e,r,o)}function p(t,n,e){for(var r=n;r<t.length;++r)d(m(t[r]),e)}function d(t,n){if(t!==n){var e=t.state();0===e?t.visit(t,void 0,t._unreport):0>e&&t._unreport()}}function v(t){return"object"!=typeof t||null===t?i(new TypeError("non-iterable passed to race()")):0===t.length?u():1===t.length?o(t[0]):y(t)}function y(t){var n,r,o,i=new j;for(n=0;n<t.length;++n)if(r=t[n],void 0!==r||n in t){if(o=m(r),0!==o.state()){i.become(o),p(t,n+1,o);break}o.visit(i,i.resolve,i.reject)}return new e(b,i)}function m(t){return N(t)?t._handler.join():M(t)?_(t):new R(t)
}function g(t){return N(t)?t._handler.join():_(t)}function _(t){try{var n=t.then;return"function"==typeof n?new A(n,t):new R(t)}catch(e){return new O(e)}}function b(){}function w(){}function j(t,n){e.createContext(this,n),this.consumers=void 0,this.receiver=t,this.handler=void 0,this.resolved=!1}function x(t){this.handler=t}function A(t,n){j.call(this),V.enqueue(new L(t,n,this))}function R(t){e.createContext(this),this.value=t}function O(t){e.createContext(this),this.id=++Y,this.value=t,this.handled=!1,this.reported=!1,this._report()}function T(t,n){this.rejection=t,this.context=n}function q(t){this.rejection=t}function E(){return new O(new TypeError("Promise cycle"))}function k(t,n){this.continuation=t,this.handler=n}function S(t,n){this.handler=n,this.value=t}function L(t,n,e){this._then=t,this.thenable=n,this.resolver=e}function C(t,n,e,r,o){try{t.call(n,e,r,o)}catch(i){r(i)}}function F(t,n,e,r){this.f=t,this.z=n,this.c=e,this.to=r,this.resolver=X,this.receiver=this}function N(t){return t instanceof e}function M(t){return("object"==typeof t||"function"==typeof t)&&null!==t}function B(t,n,r,o){return"function"!=typeof t?o.become(n):(e.enterContext(n),z(t,n.value,r,o),void e.exitContext())}function P(t,n,r,o,i){return"function"!=typeof t?i.become(r):(e.enterContext(r),K(t,n,r.value,o,i),void e.exitContext())}function I(t,n,r,o,i){return"function"!=typeof t?i.notify(n):(e.enterContext(r),U(t,n,o,i),void e.exitContext())}function Q(t,n,e){try{return t(n,e)}catch(r){return i(r)}}function z(t,n,e,r){try{r.become(m(t.call(e,n)))}catch(o){r.become(new O(o))}}function K(t,n,e,r,o){try{t.call(r,n,e,o)}catch(i){o.become(new O(i))}}function U(t,n,e,r){try{r.notify(t.call(e,n))}catch(o){r.notify(o)}}function D(t,n){n.prototype=$(t.prototype),n.prototype.constructor=n}function H(t,n){return n}function J(){}function W(){return"undefined"!=typeof n&&null!==n&&"function"==typeof n.emit?function(t,e){return"unhandledRejection"===t?n.emit(t,e.value,e):n.emit(t,e)}:"undefined"!=typeof self&&"function"==typeof CustomEvent?function(t,n,e){var r=!1;try{var o=new e("unhandledRejection");r=o instanceof e}catch(i){}return r?function(t,r){var o=new e(t,{detail:{reason:r.value,key:r},bubbles:!1,cancelable:!0});return!n.dispatchEvent(o)}:t}(J,self,CustomEvent):J}var V=t.scheduler,G=W(),$=Object.create||function(t){function n(){}return n.prototype=t,new n};e.resolve=o,e.reject=i,e.never=u,e._defer=c,e._handler=m,e.prototype.then=function(t,n,e){var r=this._handler,o=r.join().state();if("function"!=typeof t&&o>0||"function"!=typeof n&&0>o)return new this.constructor(b,r);var i=this._beget(),u=i._handler;return r.chain(u,r.receiver,t,n,e),i},e.prototype["catch"]=function(t){return this.then(void 0,t)},e.prototype._beget=function(){return s(this._handler,this.constructor)},e.all=f,e.race=v,e._traverse=a,e._visitRemaining=p,b.prototype.when=b.prototype.become=b.prototype.notify=b.prototype.fail=b.prototype._unreport=b.prototype._report=J,b.prototype._state=0,b.prototype.state=function(){return this._state},b.prototype.join=function(){for(var t=this;void 0!==t.handler;)t=t.handler;return t},b.prototype.chain=function(t,n,e,r,o){this.when({resolver:t,receiver:n,fulfilled:e,rejected:r,progress:o})},b.prototype.visit=function(t,n,e,r){this.chain(X,t,n,e,r)},b.prototype.fold=function(t,n,e,r){this.when(new F(t,n,e,r))},D(b,w),w.prototype.become=function(t){t.fail()};var X=new w;D(b,j),j.prototype._state=0,j.prototype.resolve=function(t){this.become(m(t))},j.prototype.reject=function(t){this.resolved||this.become(new O(t))},j.prototype.join=function(){if(!this.resolved)return this;for(var t=this;void 0!==t.handler;)if(t=t.handler,t===this)return this.handler=E();return t},j.prototype.run=function(){var t=this.consumers,n=this.handler;this.handler=this.handler.join(),this.consumers=void 0;for(var e=0;e<t.length;++e)n.when(t[e])},j.prototype.become=function(t){this.resolved||(this.resolved=!0,this.handler=t,void 0!==this.consumers&&V.enqueue(this),void 0!==this.context&&t._report(this.context))},j.prototype.when=function(t){this.resolved?V.enqueue(new k(t,this.handler)):void 0===this.consumers?this.consumers=[t]:this.consumers.push(t)},j.prototype.notify=function(t){this.resolved||V.enqueue(new S(t,this))},j.prototype.fail=function(t){var n="undefined"==typeof t?this.context:t;this.resolved&&this.handler.join().fail(n)},j.prototype._report=function(t){this.resolved&&this.handler.join()._report(t)},j.prototype._unreport=function(){this.resolved&&this.handler.join()._unreport()},D(b,x),x.prototype.when=function(t){V.enqueue(new k(t,this))},x.prototype._report=function(t){this.join()._report(t)},x.prototype._unreport=function(){this.join()._unreport()},D(j,A),D(b,R),R.prototype._state=1,R.prototype.fold=function(t,n,e,r){P(t,n,this,e,r)},R.prototype.when=function(t){B(t.fulfilled,this,t.receiver,t.resolver)};var Y=0;D(b,O),O.prototype._state=-1,O.prototype.fold=function(t,n,e,r){r.become(this)},O.prototype.when=function(t){"function"==typeof t.rejected&&this._unreport(),B(t.rejected,this,t.receiver,t.resolver)},O.prototype._report=function(t){V.afterQueue(new T(this,t))},O.prototype._unreport=function(){this.handled||(this.handled=!0,V.afterQueue(new q(this)))},O.prototype.fail=function(t){this.reported=!0,G("unhandledRejection",this),e.onFatalRejection(this,void 0===t?this.context:t)},T.prototype.run=function(){this.rejection.handled||this.rejection.reported||(this.rejection.reported=!0,G("unhandledRejection",this.rejection)||e.onPotentiallyUnhandledRejection(this.rejection,this.context))},q.prototype.run=function(){this.rejection.reported&&(G("rejectionHandled",this.rejection)||e.onPotentiallyUnhandledRejectionHandled(this.rejection))},e.createContext=e.enterContext=e.exitContext=e.onPotentiallyUnhandledRejection=e.onPotentiallyUnhandledRejectionHandled=e.onFatalRejection=J;var Z=new b,tn=new e(b,Z);return k.prototype.run=function(){this.handler.join().when(this.continuation)},S.prototype.run=function(){var t=this.handler.consumers;if(void 0!==t)for(var n,e=0;e<t.length;++e)n=t[e],I(n.progress,this.value,this.handler,n.receiver,n.resolver)},L.prototype.run=function(){function t(t){r.resolve(t)}function n(t){r.reject(t)}function e(t){r.notify(t)}var r=this.resolver;C(this._then,this.thenable,t,n,e)},F.prototype.fulfilled=function(t){this.f.call(this.c,this.z,t,this.to)},F.prototype.rejected=function(t){this.to.reject(t)},F.prototype.progress=function(t){this.to.notify(t)},e}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})}).call(this,n("_process"))},{_process:6}],24:[function(n,e){!function(t){"use strict";t(function(){function t(){return{state:"pending"}}function n(t){return{state:"rejected",reason:t}}function e(t){return{state:"fulfilled",value:t}}function r(r){var o=r.state();return 0===o?t():o>0?e(r.value):n(r.value)}return{pending:t,fulfilled:e,rejected:n,inspect:r}})}("function"==typeof t&&t.amd?t:function(t){e.exports=t()})},{}],25:[function(n,e){!function(t){"use strict";t(function(t){function n(t,n,e,r){var o=x.resolve(t);return arguments.length<2?o:o.then(n,e,r)}function e(t){return new x(t)}function r(t){return function(){for(var n=0,e=arguments.length,r=new Array(e);e>n;++n)r[n]=arguments[n];return A(t,this,r)}}function o(t){for(var n=0,e=arguments.length-1,r=new Array(e);e>n;++n)r[n]=arguments[n+1];return A(t,this,r)}function i(){return new u}function u(){function t(t){r._handler.resolve(t)}function n(t){r._handler.reject(t)}function e(t){r._handler.notify(t)}var r=x._defer();this.promise=r,this.resolve=t,this.reject=n,this.notify=e,this.resolver={resolve:t,reject:n,notify:e}}function c(t){return t&&"function"==typeof t.then}function s(){return x.all(arguments)}function f(t){return n(t,x.all)}function a(t){return n(t,x.settle)}function l(t,e){return n(t,function(t){return x.map(t,e)})}function h(t,e){return n(t,function(t){return x.filter(t,e)})}var p=t("./lib/decorators/timed"),d=t("./lib/decorators/array"),v=t("./lib/decorators/flow"),y=t("./lib/decorators/fold"),m=t("./lib/decorators/inspect"),g=t("./lib/decorators/iterate"),_=t("./lib/decorators/progress"),b=t("./lib/decorators/with"),w=t("./lib/decorators/unhandledRejection"),j=t("./lib/TimeoutError"),x=[d,v,y,g,_,m,b,p,w].reduce(function(t,n){return n(t)},t("./lib/Promise")),A=t("./lib/apply")(x);return n.promise=e,n.resolve=x.resolve,n.reject=x.reject,n.lift=r,n["try"]=o,n.attempt=o,n.iterate=x.iterate,n.unfold=x.unfold,n.join=s,n.all=f,n.settle=a,n.any=r(x.any),n.some=r(x.some),n.race=r(x.race),n.map=l,n.filter=h,n.reduce=r(x.reduce),n.reduceRight=r(x.reduceRight),n.isPromiseLike=c,n.Promise=x,n.defer=i,n.TimeoutError=j,n})}("function"==typeof t&&t.amd?t:function(t){e.exports=t(n)})},{"./lib/Promise":8,"./lib/TimeoutError":10,"./lib/apply":11,"./lib/decorators/array":12,"./lib/decorators/flow":13,"./lib/decorators/fold":14,"./lib/decorators/inspect":15,"./lib/decorators/iterate":16,"./lib/decorators/progress":17,"./lib/decorators/timed":18,"./lib/decorators/unhandledRejection":19,"./lib/decorators/with":20}]},{},[1])(1)});

8

lib/Bundle.js

@@ -1,2 +0,2 @@

var when = require('when')
var Deferred = require('promise-deferred')
, _ = require('underscore')

@@ -15,3 +15,3 @@ ;

this.requests = [];
this.dfd = when.defer();
this.dfd = Deferred();

@@ -22,3 +22,3 @@ }

Bundle.prototype.restorePromise = function () {
this.dfd = when.defer();
this.dfd = Deferred();
return this;

@@ -67,3 +67,3 @@ };

if (this.requests.length == 1) {
this.requests[0].start(api);
this.requests[0].start();
}

@@ -70,0 +70,0 @@

@@ -1,2 +0,2 @@

var when = require('when')
var Deferred = require('when')
, _ = require('underscore')

@@ -16,3 +16,3 @@ ;

this._param = param;
this.dfd = when.defer();
this.dfd = Deferred();

@@ -19,0 +19,0 @@ }

{
"name": "1vk",
"version": "1.0.2",
"version": "1.2.0",
"description": "smart and efficient sdk for vk.com API",

@@ -39,5 +39,5 @@ "main": "index.js",

"dependencies": {
"underscore": "^1.8.2",
"when": "^3.7.2"
"promise-deferred": "^2.0.1",
"underscore": "^1.8.2"
}
}
# 1vk
**Smart and efficient sdk for vk.com API**
## Behind the scene:
1. It uses `execute` api method to perform more api calls per permitted time interval.
2. It handles "Too many requests per second" error thus you no more need concern about it.
1. It uses [execute](https://vk.com/dev/execute) api method to perform more api calls per permitted time interval.<br/>
In fact, you have only [3 request per second](https://vk.com/dev/api_requests) permitted but **with 1vk you get up to 75 request per second**
2. It handles "Too many requests per second" error thus you no more need to concern about it.

@@ -15,5 +16,6 @@

```javascript
var ApiQueue = require("1vk");
// initialization and authorisation (VK.init , VK.Auth.login)
// then
var apiQueue = new VK(3, 1e3, VK.Api.call)
var apiQueue = new ApiQueue(3, 1e3, VK.Api.call)
var usersFriends = [];

@@ -23,8 +25,9 @@ // gets friends for 1000 users

apiQueue.request('friends.get', {user_id: i}).then(function(friends) {
console.log(friends)
usersFriends.push(friends)
})
console.dir(usersFriends);
```
### With node
You can use any open api like library (`function (methodName, params, callback)`)
You can use any open api like library (`function api(methodName, params, callback)`)

@@ -31,0 +34,0 @@ ### Docs

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc