From fbc811b31c50e314550eae6cbf7b0caf796322f7 Mon Sep 17 00:00:00 2001 From: Michele Memoli Date: Tue, 26 Jan 2016 14:50:16 +0000 Subject: [PATCH] feat(domain): custom domain Added ability to override the domain for climb --- dist/ea94cbc37b70ee0fc232e6ab2fa00a02.png | Bin 3345 -> 0 bytes dist/index.html | 2 +- dist/react-climb-social.js | 3353 ++++++++++++----- dist/react-climb-social.min.js | 12 +- package.json | 2 +- .../slideshow/SlideshowContainer.jsx | 11 +- src/components/wall/WallContainer.jsx | 11 +- src/index.html | 2 +- src/index.js | 6 +- 9 files changed, 2402 insertions(+), 997 deletions(-) delete mode 100644 dist/ea94cbc37b70ee0fc232e6ab2fa00a02.png diff --git a/dist/ea94cbc37b70ee0fc232e6ab2fa00a02.png b/dist/ea94cbc37b70ee0fc232e6ab2fa00a02.png deleted file mode 100644 index 97e2cbfa11e12416cab9a69c4bb9de74bf362910..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3345 zcmV+s4es)ZP)X1^@s6z%Z8^00001b5ch_0Itp) z=>Px>%Sl8*RA>e58*Ok?RrcQZlC(*he$X~aL&Z`-TwOqDDKa3oog%ihP;>#m7EotV zmW3Tg+f~;Yg1hcIMI5J{k*%%+x)xa+U1=#*TBL}$d{v8uX-&pr2i-TUr2@7#M%ULd%Emb&u5c<%fgt^O+Pp#9i>D8}8f`mbrg z+NGO(SKP%Kvw1*F3m2S{RrCr%+_xPk_U#C!Gtj!*j_zk51SpvN&ygMp8wJ{D;vY=- zH<1Mh0gqmU82#)e*L%->)zW+ULi5SGChOz{1*^k7r!liI3qbH9fb1I}BSSel{VWml zdtpYW=O-pLMmF;8ipM`9;CKLR9-75a@bV%S@bSJ$0qF1Jw`0c)tAQa49wl?&Xcebt zjk)6aMgj}#9*N9Pop-EkB;F^o&k=DvVG`u*zC(b0z1!!)>3A%5eOsm(7R~n`y{V;`EsXxe!95APxasg5iihmoV4Qp&tty(e^2#2I_eJ zm5+JJtkG)MRx<=rw1g}4A;YrnV^)wLPN>h!pCgQK_QUVMSlEcR0tF2jHe3#Lb>gd6 z`qF3TAzM#EY_js}Gw=QF$FS*7%Z|pG%!A}|CvFU@Ajj?qX5%J*71fW z{qA2|zYH)x6`g!nb_}c49mFY!3Gm!TTq4;`V>B9K3h~hzE2AMq9Pc?9{w5;e4vf@B z0TqQvi0Dxp;u>UZOpJCp4q}-&j+p>t-X1qQKUKzr5fFK@St$)4x9R$9atwQPu(RYJi9J5j6(u$6f3MdJArGVT}mMcDzSw>>GBbPdRbs)%Lm#6~UiJ^uYd? zBTN{-aN}~W=fXc_1i*p#q?iTgYIipX^7P8I3p{w!ws`GEP3jChlhJV?p zm#ZIQGGyI95dzgk>~Q`(Jpb$V6SeOPx(u@yJ;?y(9bqi(@y`#<9mi^@QIEcEsRqv& zGW?|pQ<8Iz?$~jO&Jh@ETJ%yL-+hMqu=od(9?dw-$_sV7YiJrwd236MrL{~-3uQec zv0qRtfe_U7q$Uu>;cg+2bF+qqZDH8St+RJk{xldKUC_57wv6 z&nM9*q(ZjgkDyAmhdeyIrwH zx>+>7;c%OWBLc9JN`@d2Mn_c;T2jWs6x?MKc(}$W+}Z7LEFsedENt2IrFrv062SY( zST4z;m0Z>d3U=+g;KgGDb9IZYzG&d3$bdmByXm&P`+YA%m~H51BMAA>>R&AQPowQ+ z*Be3$F9ii(x2>R}A~FBu`( zeGYoE+d%3@jPGiLheHucUG=%i|DHgk5MUM2Ux?)s;?W9nB@uA?`<~k7|4;&j-Va!! z$`+T-)e&mMZOAAuiC2NE2|ePm0Nd^SLjpWp&j1{r*}=|dX-oG&q;*WW zj!9exmD;^tln6NU@2JYLu%T-5f_ZThCQZ{%nUxMUt^GRW<8}!=F6*eZ$|kXdkPNW_59;nfa;O+HJMhY5X^gOP!;} z4z(pD^U6^?NAVm!GkDj-uV#s!9*ATu9mFMYnt{A1(0&!Mc% z-ut9j#%Xo9Ba9d)g*&zvU&c-^YdzhT`qNe0Y_86)e|P8N{&Fz`%?=RQd!9bJkNxhz zjyK!B+*JgVG8Tws2<&u$IW$>93#SdW#+<&s_O`!too{aa?$9TF=bwMwX+6HBi$rLA z`1nOXzhjy#gwhz!`VF}+`85azdrp1y(MbV$VFR?cHoU*3#{5=9zNI7c7)%Mp*iU4| zV1!W6G7jS5dqf8hP%Y^tjg(b_Hl@i@y^7#Cr=t!#s^8*q z_LviYcedZBSz>tsW*FEez`mZm&!cNyhu?dYSH@D0M?qtMAG%-n7ociUyY z`IdW&cc$h&Sz^3rF$Z0P^9QYP(=Brs9-{Hz2u`7ldK|yW{?CVi!-@uX5xxB!{5^I) z>N)}9{vnyGWix?(^;}(L`$8B9{xeuGiXRmsVlNG)_vn1-Z@;fdrWr)`xz^2^Q zW^I4dg!Uu5?}Pc3TIofc@NqnvKzd>aX^cW3D!%ghLg&Q1$4gA}9+A4! z!tWC9H$S!muTI(OhjR}guvvP`kkd+u+6YX|)ohHU4HaFVBudxha>dTSHG9Qt#up#@ zR!R$X?2g=Bhu(RH_BIAmqENyUfoLPer(_jm;^Xj6sT>dacg48Q<25^R_9}5IxTpL4 z5x>$-=drruvV;Uejoy^BP^@n>@bu~G9I>2n{nyEiqxTU3cdf1WumE$d4SpFm=W@)) z>5uHLsnMvm2r^v)5`IPh$+Uo(W~qV=9D1B6J2OD6nq zZ{(0P%i7MgG#+@4rcA)eE=B@js29`m|AOSv4j-$Xu1<-Q0pQ>r&mbHC1$BrAe#h(( zp6t`70*}x$!2PL|FdT7jn!rp8UP|)Z7KlSi|7${@&<4J3_;j0>hO=QdznXd^dwGTc zjSiJwIPmG4UVNl%NHX-;$xnFa2>}q>m&Q)$-n%L(nRFi8lfcBL1(*ckLMF4W^{e{3 z1!b28u-6+Y1zIF* zNOWJRe|-l`nl7s$5}HN_OO3dYjO{VhLbE><*rmPjNe%goN24CJ9Vz>RH_}LXZ)B{? zC`!U2~Xs8Hs<8GsJtTN?JNI0K1$m^aCY0Pvcx0%AX4;xygh;My@=PM2E3NV zd@soOMC$y&scWke80$Cg{V`=4x*PsPMBjwR)et7d4Xoy306 bKpXrI{<|+YxwAGw00000NkvXXu0mjf%iMjI diff --git a/dist/index.html b/dist/index.html index e726458..e196437 100644 --- a/dist/index.html +++ b/dist/index.html @@ -35,7 +35,7 @@ -
+
diff --git a/dist/react-climb-social.js b/dist/react-climb-social.js index 86d83e0..c34c14f 100644 --- a/dist/react-climb-social.js +++ b/dist/react-climb-social.js @@ -74,11 +74,11 @@ return /******/ (function(modules) { // webpackBootstrap var _componentsWallWallContainer2 = _interopRequireDefault(_componentsWallWallContainer); - var _componentsSlideshowSlideshowContainer = __webpack_require__(32); + var _componentsSlideshowSlideshowContainer = __webpack_require__(37); var _componentsSlideshowSlideshowContainer2 = _interopRequireDefault(_componentsSlideshowSlideshowContainer); - __webpack_require__(36); + __webpack_require__(41); if (window) { window.Climb = window.Climb || {}; @@ -89,8 +89,9 @@ return /******/ (function(modules) { // webpackBootstrap var $item = $walls[i]; var collectionId = $item.dataset.collectionId; var limit = $item.dataset.limit; + var domain = $item.dataset.domain; - _reactDom2['default'].render(_react2['default'].createElement(_componentsWallWallContainer2['default'], { collectionId: collectionId, limit: limit }), $item); + _reactDom2['default'].render(_react2['default'].createElement(_componentsWallWallContainer2['default'], { collectionId: collectionId, limit: limit, domain: domain }), $item); } var $slideshows = document.querySelectorAll('.climb-slideshow'); @@ -99,14 +100,15 @@ return /******/ (function(modules) { // webpackBootstrap var $item = $slideshows[i]; var collectionId = $item.dataset.collectionId; var delay = parseInt($item.dataset.delay, 0); + var domain = $item.dataset.domain; - _reactDom2['default'].render(_react2['default'].createElement(_componentsSlideshowSlideshowContainer2['default'], { collectionId: collectionId, delay: delay }), $item); + _reactDom2['default'].render(_react2['default'].createElement(_componentsSlideshowSlideshowContainer2['default'], { collectionId: collectionId, delay: delay, domain: domain }), $item); } } exports.WallContainer = _componentsWallWallContainer2['default']; - var _componentsWallWall = __webpack_require__(9); + var _componentsWallWall = __webpack_require__(14); Object.defineProperty(exports, 'Wall', { enumerable: true, @@ -115,7 +117,7 @@ return /******/ (function(modules) { // webpackBootstrap } }); - var _componentsWallTile = __webpack_require__(10); + var _componentsWallTile = __webpack_require__(15); Object.defineProperty(exports, 'Tile', { enumerable: true, @@ -164,11 +166,11 @@ return /******/ (function(modules) { // webpackBootstrap var _climbSocial2 = _interopRequireDefault(_climbSocial); - var _Wall = __webpack_require__(9); + var _Wall = __webpack_require__(14); var _Wall2 = _interopRequireDefault(_Wall); - var _ClimbBadge = __webpack_require__(30); + var _ClimbBadge = __webpack_require__(35); var _ClimbBadge2 = _interopRequireDefault(_ClimbBadge); @@ -193,7 +195,7 @@ return /******/ (function(modules) { // webpackBootstrap return; } - _climbSocial2['default'].getStream(this.props.collectionId).subscribe(function (items) { + _climbSocial2['default'].getStream(this.props.collectionId, this.props.refresh, this.props.domain).subscribe(function (items) { var maxSize = parseInt(_this.props.limit, 0); @@ -238,6 +240,7 @@ return /******/ (function(modules) { // webpackBootstrap key: 'propTypes', value: { collectionId: _react.PropTypes.string.isRequired, + domain: _react.PropTypes.string, limit: _react.PropTypes.oneOfType([_react.PropTypes.number, _react.PropTypes.string]) }, enumerable: true @@ -245,7 +248,9 @@ return /******/ (function(modules) { // webpackBootstrap key: 'defaultProps', value: { collectionId: '561ba63445284e1740e016f7', - limit: 30 + limit: 30, + refresh: 8, + domain: 'http://app.climb.social' }, enumerable: true }]); @@ -274,11 +279,29 @@ return /******/ (function(modules) { // webpackBootstrap var _fetchJsonp2 = _interopRequireDefault(_fetchJsonp); + var _url = __webpack_require__(9); + var getStream = function getStream(collectionId) { + var intervalSeconds = arguments.length <= 1 || arguments[1] === undefined ? 8 : arguments[1]; + var domain = arguments.length <= 2 || arguments[2] === undefined ? 'http://app.climb.social' : arguments[2]; + + if (!collectionId) { + throw new Error('Please specify a collectionId'); + } + + if (typeof intervalSeconds !== 'number') { + throw new Error('Polling interval should be a positive integer. A ' + typeof intervalSeconds + ' was provided.'); + } + + if (intervalSeconds <= 0) { + throw new Error('Polling interval should be a positive integer. ' + intervalSeconds + ' was specified.'); + } + + var pollRate = intervalSeconds * 1000; - var pollRate = 5 * 1000; + var URL = (0, _url.resolve)(domain, '/api/v1/collections/' + collectionId); - var requestStream = _rxLite.Observable.just('http://app.climb.social/api/v1/collections/' + collectionId); + var requestStream = _rxLite.Observable.just(URL); var updateStream = _rxLite.Observable.interval(pollRate).startWith(null); @@ -349,7 +372,7 @@ return /******/ (function(modules) { // webpackBootstrap var isFn = function (value) { return typeof value == 'function' || false; - } + }; // fallback for older versions of Chrome and Safari if (isFn(/x/)) { @@ -553,7 +576,7 @@ return /******/ (function(modules) { // webpackBootstrap case 1: return function(arg) { return func.call(thisArg, arg); - } + }; case 2: return function(value, index) { return func.call(thisArg, value, index); @@ -579,280 +602,303 @@ return /******/ (function(modules) { // webpackBootstrap 'constructor'], dontEnumsLength = dontEnums.length; - /** `Object#toString` result shortcuts */ - var argsClass = '[object Arguments]', - arrayClass = '[object Array]', - boolClass = '[object Boolean]', - dateClass = '[object Date]', - errorClass = '[object Error]', - funcClass = '[object Function]', - numberClass = '[object Number]', - objectClass = '[object Object]', - regexpClass = '[object RegExp]', - stringClass = '[object String]'; - - var toString = Object.prototype.toString, - hasOwnProperty = Object.prototype.hasOwnProperty, - supportsArgsClass = toString.call(arguments) == argsClass, // For less -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER; + } - var isEqual = Rx.internals.isEqual = function (x, y) { - return deepEquals(x, y, [], []); + var isHostObject = (function() { + try { + Object({ 'toString': 0 } + ''); + } catch(e) { + return function() { return false; }; + } + return function(value) { + return typeof value.toString !== 'function' && typeof (value + '') === 'string'; }; + }()); - /** @private - * Used for deep comparison - **/ - function deepEquals(a, b, stackA, stackB) { - // exit early for identical values - if (a === b) { - // treat `+0` vs. `-0` as not equal - return a !== 0 || (1 / a == 1 / b); - } + function isTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; + } + + var isArray = Array.isArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) === arrayTag; + }; - var type = typeof a, - otherType = typeof b; + function arraySome (array, predicate) { + var index = -1, + length = array.length; - // exit early for unlike primitive values - if (a === a && (a == null || b == null || - (type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) { - return false; + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; } + } + return false; + } - // compare [[Class]] names - var className = toString.call(a), - otherClass = toString.call(b); + function equalArrays(array, other, equalFunc, isLoose, stackA, stackB) { + var index = -1, + arrLength = array.length, + othLength = other.length; - if (className == argsClass) { - className = objectClass; - } - if (otherClass == argsClass) { - otherClass = objectClass; - } - if (className != otherClass) { + if (arrLength !== othLength && !(isLoose && othLength > arrLength)) { + return false; + } + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index], + result; + + if (result !== undefined) { + if (result) { + continue; + } return false; } - switch (className) { - case boolClass: - case dateClass: - // coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal - return +a == +b; - - case numberClass: - // treat `NaN` vs. `NaN` as equal - return (a != +a) ? - b != +b : - // but treat `-0` vs. `+0` as not equal - (a == 0 ? (1 / a == 1 / b) : a == +b); - - case regexpClass: - case stringClass: - // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) - // treat string primitives and their corresponding object instances as equal - return a == String(b); - } - var isArr = className == arrayClass; - if (!isArr) { - - // exit for functions and DOM nodes - if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) { - return false; - } - // in older versions of Opera, `arguments` objects have `Array` constructors - var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor, - ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor; - - // non `Object` object instances with different constructors are not equal - if (ctorA != ctorB && - !(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) && - !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && - ('constructor' in a && 'constructor' in b) - ) { + // Recursively compare arrays (susceptible to call stack limits). + if (isLoose) { + if (!arraySome(other, function(othValue) { + return arrValue === othValue || equalFunc(arrValue, othValue, isLoose, stackA, stackB); + })) { return false; } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, isLoose, stackA, stackB))) { + return false; } - // assume cyclic structures are equal - // the algorithm for detecting cyclic structures is adapted from ES 5.1 - // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) - var initedStack = !stackA; - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == a) { - return stackB[length] == b; - } - } - var size = 0; - var result = true; + } + return true; + } - // add `a` and `b` to the stack of traversed objects - stackA.push(a); - stackB.push(b); + function baseIsEqualDeep(object, other, equalFunc, isLoose, stackA, stackB) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; - // recursively compare objects and arrays (susceptible to call stack limits) - if (isArr) { - // compare lengths to determine if a deep comparison is necessary - length = a.length; - size = b.length; - result = size == length; + if (!objIsArr) { + objTag = objToString.call(object); + if (objTag === argsTag) { + objTag = objectTag; + } else if (objTag !== objectTag) { + objIsArr = isTypedArray(object); + } + } + if (!othIsArr) { + othTag = objToString.call(other); + if (othTag === argsTag) { + othTag = objectTag; + } + } + var objIsObj = objTag === objectTag && !isHostObject(object), + othIsObj = othTag === objectTag && !isHostObject(other), + isSameTag = objTag === othTag; - if (result) { - // deep compare the contents, ignoring non-numeric properties - while (size--) { - var index = length, - value = b[size]; + if (isSameTag && !(objIsArr || objIsObj)) { + return equalByTag(object, other, objTag); + } + if (!isLoose) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - if (!(result = deepEquals(a[size], value, stackA, stackB))) { - break; - } - } - } + if (objIsWrapped || othIsWrapped) { + return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, isLoose, stackA, stackB); } - else { - // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` - // which, in this case, is more costly - internalForIn(b, function(value, key, b) { - if (hasOwnProperty.call(b, key)) { - // count the number of properties. - size++; - // deep compare each property value. - return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB)); - } - }); + } + if (!isSameTag) { + return false; + } + // Assume cyclic values are equal. + // For more information on detecting circular references see https://es5.github.io/#JO. + stackA || (stackA = []); + stackB || (stackB = []); - if (result) { - // ensure both objects have the same number of properties - internalForIn(a, function(value, key, a) { - if (hasOwnProperty.call(a, key)) { - // `size` will be `-1` if `a` has more properties than `b` - return (result = --size > -1); - } - }); - } + var length = stackA.length; + while (length--) { + if (stackA[length] === object) { + return stackB[length] === other; } - stackA.pop(); - stackB.pop(); + } + // Add `object` and `other` to the stack of traversed objects. + stackA.push(object); + stackB.push(other); - return result; + var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, isLoose, stackA, stackB); + + stackA.pop(); + stackB.pop(); + + return result; + } + + function baseIsEqual(value, other, isLoose, stackA, stackB) { + if (value === other) { + return true; } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, isLoose, stackA, stackB); + } + + var isEqual = Rx.internals.isEqual = function (value, other) { + return baseIsEqual(value, other); + }; var hasProp = {}.hasOwnProperty, slice = Array.prototype.slice; @@ -896,7 +942,6 @@ return /******/ (function(modules) { // webpackBootstrap var args = [], i, len; if (Array.isArray(arguments[0])) { args = arguments[0]; - len = args.length; } else { len = arguments.length; args = new Array(len); @@ -1151,7 +1196,7 @@ return /******/ (function(modules) { // webpackBootstrap this.dueTime = dueTime; this.comparer = comparer || defaultSubComparer; this.disposable = new SingleAssignmentDisposable(); - } + }; ScheduledItem.prototype.invoke = function () { this.disposable.setDisposable(this.invokeCore()); @@ -1319,7 +1364,7 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Function} action Action to be executed, potentially updating the state. * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). */ - Scheduler.prototype.schedulePeriodic = function(state, period, action) { + schedulerProto.schedulePeriodic = function(state, period, action) { if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); } period = normalizeTime(period); var s = state, id = root.setInterval(function () { s = action(s); }, period); @@ -1571,34 +1616,45 @@ return /******/ (function(modules) { // webpackBootstrap function scheduleAction(disposable, action, scheduler, state) { return function schedule() { - !disposable.isDisposed && disposable.setDisposable(Disposable._fixup(action(scheduler, state))); + disposable.setDisposable(Disposable._fixup(action(scheduler, state))); }; } - function ClearDisposable(method, id) { + function ClearDisposable(id) { this._id = id; - this._method = method; this.isDisposed = false; } ClearDisposable.prototype.dispose = function () { if (!this.isDisposed) { this.isDisposed = true; - this._method.call(null, this._id); + clearMethod(this._id); + } + }; + + function LocalClearDisposable(id) { + this._id = id; + this.isDisposed = false; + } + + LocalClearDisposable.prototype.dispose = function () { + if (!this.isDisposed) { + this.isDisposed = true; + localClearTimeout(this._id); } }; DefaultScheduler.prototype.schedule = function (state, action) { var disposable = new SingleAssignmentDisposable(), id = scheduleMethod(scheduleAction(disposable, action, this, state)); - return new BinaryDisposable(disposable, new ClearDisposable(clearMethod, id)); + return new BinaryDisposable(disposable, new ClearDisposable(id)); }; DefaultScheduler.prototype._scheduleFuture = function (state, dueTime, action) { if (dueTime === 0) { return this.schedule(state, action); } var disposable = new SingleAssignmentDisposable(), id = localSetTimeout(scheduleAction(disposable, action, this, state), dueTime); - return new BinaryDisposable(disposable, new ClearDisposable(localClearTimeout, id)); + return new BinaryDisposable(disposable, new LocalClearDisposable(id)); }; return DefaultScheduler; @@ -1702,22 +1758,20 @@ return /******/ (function(modules) { // webpackBootstrap throw new NotImplementedError(); }; - Notification.prototype._acceptObservable = function (onNext, onError, onCompleted) { + Notification.prototype._acceptObserver = function (onNext, onError, onCompleted) { throw new NotImplementedError(); }; /** * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. - * - * @memberOf Notification - * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. - * @param {Function} onError Delegate to invoke for an OnError notification. - * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. + * @param {Function | Observer} observerOrOnNext Function to invoke for an OnNext notification or Observer to invoke the notification on.. + * @param {Function} onError Function to invoke for an OnError notification. + * @param {Function} onCompleted Function to invoke for an OnCompleted notification. * @returns {Any} Result produced by the observation. */ Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { return observerOrOnNext && typeof observerOrOnNext === 'object' ? - this._acceptObservable(observerOrOnNext) : + this._acceptObserver(observerOrOnNext) : this._accept(observerOrOnNext, onError, onCompleted); }; @@ -1733,7 +1787,7 @@ return /******/ (function(modules) { // webpackBootstrap isScheduler(scheduler) || (scheduler = immediateScheduler); return new AnonymousObservable(function (o) { return scheduler.schedule(self, function (_, notification) { - notification._acceptObservable(o); + notification._acceptObserver(o); notification.kind === 'N' && o.onCompleted(); }); }); @@ -1753,7 +1807,7 @@ return /******/ (function(modules) { // webpackBootstrap return onNext(this.value); }; - OnNextNotification.prototype._acceptObservable = function (o) { + OnNextNotification.prototype._acceptObserver = function (o) { return o.onNext(this.value); }; @@ -1775,7 +1829,7 @@ return /******/ (function(modules) { // webpackBootstrap return onError(this.error); }; - OnErrorNotification.prototype._acceptObservable = function (o) { + OnErrorNotification.prototype._acceptObserver = function (o) { return o.onError(this.error); }; @@ -1796,7 +1850,7 @@ return /******/ (function(modules) { // webpackBootstrap return onCompleted(); }; - OnCompletedNotification.prototype._acceptObservable = function (o) { + OnCompletedNotification.prototype._acceptObserver = function (o) { return o.onCompleted(); }; @@ -2061,45 +2115,48 @@ return /******/ (function(modules) { // webpackBootstrap this.disposable = new SerialDisposable(); } - ScheduledObserver.prototype.next = function (value) { - var self = this; - this.queue.push(function () { self.observer.onNext(value); }); + function enqueueNext(observer, x) { return function () { observer.onNext(x); }; } + function enqueueError(observer, e) { return function () { observer.onError(e); }; } + function enqueueCompleted(observer) { return function () { observer.onCompleted(); }; } + + ScheduledObserver.prototype.next = function (x) { + this.queue.push(enqueueNext(this.observer, x)); }; ScheduledObserver.prototype.error = function (e) { - var self = this; - this.queue.push(function () { self.observer.onError(e); }); + this.queue.push(enqueueError(this.observer, e)); }; ScheduledObserver.prototype.completed = function () { - var self = this; - this.queue.push(function () { self.observer.onCompleted(); }); + this.queue.push(enqueueCompleted(this.observer)); }; + + function scheduleMethod(state, recurse) { + var work; + if (state.queue.length > 0) { + work = state.queue.shift(); + } else { + state.isAcquired = false; + return; + } + var res = tryCatch(work)(); + if (res === errorObj) { + state.queue = []; + state.hasFaulted = true; + return thrower(res.e); + } + recurse(state); + } + ScheduledObserver.prototype.ensureActive = function () { var isOwner = false; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } - if (isOwner) { - this.disposable.setDisposable(this.scheduler.scheduleRecursive(this, function (parent, self) { - var work; - if (parent.queue.length > 0) { - work = parent.queue.shift(); - } else { - parent.isAcquired = false; - return; - } - var res = tryCatch(work)(); - if (res === errorObj) { - parent.queue = []; - parent.hasFaulted = true; - return thrower(res.e); - } - self(parent); - })); - } + isOwner && + this.disposable.setDisposable(this.scheduler.scheduleRecursive(this, scheduleMethod)); }; ScheduledObserver.prototype.dispose = function () { @@ -2188,7 +2245,7 @@ return /******/ (function(modules) { // webpackBootstrap InnerObserver.prototype.error = function(e) { this.o.onError(e); }; - InnerObserver.prototype.onCompleted = function() { this.o.onCompleted(); }; + InnerObserver.prototype.completed = function() { this.o.onCompleted(); }; return FlatMapObservable; @@ -2215,39 +2272,45 @@ return /******/ (function(modules) { // webpackBootstrap __super__.call(this); } - ConcatEnumerableObservable.prototype.subscribeCore = function (o) { - var state = { isDisposed: false }, subscription = new SerialDisposable(); - var cancelable = currentThreadScheduler.scheduleRecursive(this.sources[$iterator$](), function (e, self) { - if (state.isDisposed) { return; } - var currentItem = tryCatch(e.next).call(e); - if (currentItem === errorObj) { return o.onError(currentItem.e); } + function scheduleMethod(state, recurse) { + if (state.isDisposed) { return; } + var currentItem = tryCatch(state.e.next).call(state.e); + if (currentItem === errorObj) { return state.o.onError(currentItem.e); } + if (currentItem.done) { return state.o.onCompleted(); } - if (currentItem.done) { - return o.onCompleted(); - } + // Check if promise + var currentValue = currentItem.value; + isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); - // Check if promise - var currentValue = currentItem.value; - isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); + var d = new SingleAssignmentDisposable(); + state.subscription.setDisposable(d); + d.setDisposable(currentValue.subscribe(new InnerObserver(state, recurse))); + } - var d = new SingleAssignmentDisposable(); - subscription.setDisposable(d); - d.setDisposable(currentValue.subscribe(new InnerObserver(o, self, e))); - }); + ConcatEnumerableObservable.prototype.subscribeCore = function (o) { + var subscription = new SerialDisposable(); + var state = { + isDisposed: false, + o: o, + subscription: subscription, + e: this.sources[$iterator$]() + }; + var cancelable = currentThreadScheduler.scheduleRecursive(state, scheduleMethod); return new NAryDisposable([subscription, cancelable, new IsDisposedDisposable(state)]); }; - inherits(InnerObserver, AbstractObserver); - function InnerObserver(o, s, e) { - this._o = o; - this._s = s; - this._e = e; + function InnerObserver(state, recurse) { + this._state = state; + this._recurse = recurse; AbstractObserver.call(this); } - InnerObserver.prototype.onNext = function (x) { this._o.onNext(x); }; - InnerObserver.prototype.onError = function (e) { this._o.onError(e); }; - InnerObserver.prototype.onCompleted = function () { this._s(this._e); }; + + inherits(InnerObserver, AbstractObserver); + + InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; + InnerObserver.prototype.error = function (e) { this._state.o.onError(e); }; + InnerObserver.prototype.completed = function () { this._recurse(this._state); }; return ConcatEnumerableObservable; }(ObservableBase)); @@ -2257,46 +2320,52 @@ return /******/ (function(modules) { // webpackBootstrap }; var CatchErrorObservable = (function(__super__) { - inherits(CatchErrorObservable, __super__); function CatchErrorObservable(sources) { this.sources = sources; __super__.call(this); } - CatchErrorObservable.prototype.subscribeCore = function (o) { - var e = this.sources[$iterator$](); + inherits(CatchErrorObservable, __super__); - var state = { isDisposed: false }, subscription = new SerialDisposable(); - var cancelable = currentThreadScheduler.scheduleRecursive(null, function (lastException, self) { - if (state.isDisposed) { return; } - var currentItem = tryCatch(e.next).call(e); - if (currentItem === errorObj) { return o.onError(currentItem.e); } + function scheduleMethod(state, recurse) { + if (state.isDisposed) { return; } + var currentItem = tryCatch(state.e.next).call(state.e); + if (currentItem === errorObj) { return state.o.onError(currentItem.e); } + if (currentItem.done) { return state.lastError !== null ? state.o.onError(state.lastError) : state.o.onCompleted(); } - if (currentItem.done) { - return lastException !== null ? o.onError(lastException) : o.onCompleted(); - } + var currentValue = currentItem.value; + isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); - // Check if promise - var currentValue = currentItem.value; - isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); + var d = new SingleAssignmentDisposable(); + state.subscription.setDisposable(d); + d.setDisposable(currentValue.subscribe(new InnerObserver(state, recurse))); + } - var d = new SingleAssignmentDisposable(); - subscription.setDisposable(d); - d.setDisposable(currentValue.subscribe(new InnerObserver(o, self))); - }); + CatchErrorObservable.prototype.subscribeCore = function (o) { + var subscription = new SerialDisposable(); + var state = { + isDisposed: false, + e: this.sources[$iterator$](), + subscription: subscription, + lastError: null, + o: o + }; + + var cancelable = currentThreadScheduler.scheduleRecursive(state, scheduleMethod); return new NAryDisposable([subscription, cancelable, new IsDisposedDisposable(state)]); }; - inherits(InnerObserver, AbstractObserver); - function InnerObserver(o, recurse) { - this._o = o; + function InnerObserver(state, recurse) { + this._state = state; this._recurse = recurse; AbstractObserver.call(this); } - InnerObserver.prototype.next = function (x) { this._o.onNext(x); }; - InnerObserver.prototype.error = function (e) { this._recurse(e); }; - InnerObserver.prototype.completed = function () { this._o.onCompleted(); }; + inherits(InnerObserver, AbstractObserver); + + InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; + InnerObserver.prototype.error = function (e) { this._state.lastError = e; this._recurse(this._state); }; + InnerObserver.prototype.completed = function () { this._state.o.onCompleted(); }; return CatchErrorObservable; }(ObservableBase)); @@ -2316,7 +2385,7 @@ return /******/ (function(modules) { // webpackBootstrap var e = sources[$iterator$](); var state = { isDisposed: false }, - lastException, + lastError, subscription = new SerialDisposable(); var cancelable = currentThreadScheduler.scheduleRecursive(null, function (_, self) { if (state.isDisposed) { return; } @@ -2324,8 +2393,8 @@ return /******/ (function(modules) { // webpackBootstrap if (currentItem === errorObj) { return o.onError(currentItem.e); } if (currentItem.done) { - if (lastException) { - o.onError(lastException); + if (lastError) { + o.onError(lastError); } else { o.onCompleted(); } @@ -2359,11 +2428,11 @@ return /******/ (function(modules) { // webpackBootstrap var RepeatEnumerable = (function (__super__) { inherits(RepeatEnumerable, __super__); - function RepeatEnumerable(v, c) { this.v = v; this.c = c == null ? -1 : c; } + RepeatEnumerable.prototype[$iterator$] = function () { return new RepeatEnumerator(this); }; @@ -2372,6 +2441,7 @@ return /******/ (function(modules) { // webpackBootstrap this.v = p.v; this.l = p.c; } + RepeatEnumerator.prototype.next = function () { if (this.l === 0) { return doneEnumerator; } if (this.l > 0) { this.l--; } @@ -2401,6 +2471,7 @@ return /******/ (function(modules) { // webpackBootstrap this.l = this.s.length; this.fn = p.fn; } + OfEnumerator.prototype.next = function () { return ++this.i < this.l ? { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } : @@ -2539,54 +2610,40 @@ return /******/ (function(modules) { // webpackBootstrap var FromObservable = (function(__super__) { inherits(FromObservable, __super__); - function FromObservable(iterable, mapper, scheduler) { - this.iterable = iterable; - this.mapper = mapper; - this.scheduler = scheduler; + function FromObservable(iterable, fn, scheduler) { + this._iterable = iterable; + this._fn = fn; + this._scheduler = scheduler; __super__.call(this); } - FromObservable.prototype.subscribeCore = function (o) { - var sink = new FromSink(o, this); - return sink.run(); - }; - - return FromObservable; - }(ObservableBase)); - - var FromSink = (function () { - function FromSink(o, parent) { - this.o = o; - this.parent = parent; - } - - FromSink.prototype.run = function () { - var list = Object(this.parent.iterable), - it = getIterable(list), - o = this.o, - mapper = this.parent.mapper; - - function loopRecursive(i, recurse) { + function createScheduleMethod(o, it, fn) { + return function loopRecursive(i, recurse) { var next = tryCatch(it.next).call(it); if (next === errorObj) { return o.onError(next.e); } if (next.done) { return o.onCompleted(); } var result = next.value; - if (isFunction(mapper)) { - result = tryCatch(mapper)(result, i); + if (isFunction(fn)) { + result = tryCatch(fn)(result, i); if (result === errorObj) { return o.onError(result.e); } } o.onNext(result); recurse(i + 1); - } + }; + } + + FromObservable.prototype.subscribeCore = function (o) { + var list = Object(this._iterable), + it = getIterable(list); - return this.parent.scheduler.scheduleRecursive(0, loopRecursive); + return this._scheduler.scheduleRecursive(0, createScheduleMethod(o, it, this._fn)); }; - return FromSink; - }()); + return FromObservable; + }(ObservableBase)); var maxSafeInteger = Math.pow(2, 53) - 1; @@ -2697,40 +2754,30 @@ return /******/ (function(modules) { // webpackBootstrap var FromArrayObservable = (function(__super__) { inherits(FromArrayObservable, __super__); function FromArrayObservable(args, scheduler) { - this.args = args; - this.scheduler = scheduler; + this._args = args; + this._scheduler = scheduler; __super__.call(this); } - FromArrayObservable.prototype.subscribeCore = function (observer) { - var sink = new FromArraySink(observer, this); - return sink.run(); + function scheduleMethod(o, args) { + var len = args.length; + return function loopRecursive (i, recurse) { + if (i < len) { + o.onNext(args[i]); + recurse(i + 1); + } else { + o.onCompleted(); + } + }; + } + + FromArrayObservable.prototype.subscribeCore = function (o) { + return this._scheduler.scheduleRecursive(0, scheduleMethod(o, this._args)); }; return FromArrayObservable; }(ObservableBase)); - function FromArraySink(observer, parent) { - this.observer = observer; - this.parent = parent; - } - - function loopRecursive(args, observer) { - var len = args.length; - return function loop (i, recurse) { - if (i < len) { - observer.onNext(args[i]); - recurse(i + 1); - } else { - observer.onCompleted(); - } - }; - } - - FromArraySink.prototype.run = function () { - return this.parent.scheduler.scheduleRecursive(0, loopRecursive(this.parent.args, this.observer)); - }; - /** * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. * @deprecated use Observable.from or Observable.of @@ -2793,41 +2840,32 @@ return /******/ (function(modules) { // webpackBootstrap var PairsObservable = (function(__super__) { inherits(PairsObservable, __super__); - function PairsObservable(obj, scheduler) { - this.obj = obj; - this.keys = Object.keys(obj); - this.scheduler = scheduler; + function PairsObservable(o, scheduler) { + this._o = o; + this._keys = Object.keys(o); + this._scheduler = scheduler; __super__.call(this); } - PairsObservable.prototype.subscribeCore = function (observer) { - var sink = new PairsSink(observer, this); - return sink.run(); + function scheduleMethod(o, obj, keys) { + return function loopRecursive(i, recurse) { + if (i < keys.length) { + var key = keys[i]; + o.onNext([key, obj[key]]); + recurse(i + 1); + } else { + o.onCompleted(); + } + }; + } + + PairsObservable.prototype.subscribeCore = function (o) { + return this._scheduler.scheduleRecursive(0, scheduleMethod(o, this._o, this._keys)); }; return PairsObservable; }(ObservableBase)); - function PairsSink(observer, parent) { - this.observer = observer; - this.parent = parent; - } - - PairsSink.prototype.run = function () { - var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length; - function loopRecursive(i, recurse) { - if (i < len) { - var key = keys[i]; - observer.onNext([key, obj[key]]); - recurse(i + 1); - } else { - observer.onCompleted(); - } - } - - return this.parent.scheduler.scheduleRecursive(0, loopRecursive); - }; - /** * Convert an object into an observable sequence of [key, value] pairs. * @param {Object} obj The object to inspect. @@ -2848,40 +2886,26 @@ return /******/ (function(modules) { // webpackBootstrap __super__.call(this); } - RangeObservable.prototype.subscribeCore = function (observer) { - var sink = new RangeSink(observer, this); - return sink.run(); - }; - - return RangeObservable; - }(ObservableBase)); - - var RangeSink = (function () { - function RangeSink(observer, parent) { - this.observer = observer; - this.parent = parent; - } - - function loopRecursive(start, count, observer) { + function loopRecursive(start, count, o) { return function loop (i, recurse) { if (i < count) { - observer.onNext(start + i); + o.onNext(start + i); recurse(i + 1); } else { - observer.onCompleted(); + o.onCompleted(); } }; } - RangeSink.prototype.run = function () { - return this.parent.scheduler.scheduleRecursive( + RangeObservable.prototype.subscribeCore = function (o) { + return this.scheduler.scheduleRecursive( 0, - loopRecursive(this.parent.start, this.parent.rangeCount, this.observer) + loopRecursive(this.start, this.rangeCount, o) ); }; - return RangeSink; - }()); + return RangeObservable; + }(ObservableBase)); /** * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. @@ -2946,22 +2970,18 @@ return /******/ (function(modules) { // webpackBootstrap var JustObservable = (function(__super__) { inherits(JustObservable, __super__); function JustObservable(value, scheduler) { - this.value = value; - this.scheduler = scheduler; + this._value = value; + this._scheduler = scheduler; __super__.call(this); } - JustObservable.prototype.subscribeCore = function (observer) { - var sink = new JustSink(observer, this.value, this.scheduler); - return sink.run(); + JustObservable.prototype.subscribeCore = function (o) { + var state = [this._value, o]; + return this._scheduler === immediateScheduler ? + scheduleItem(null, state) : + this._scheduler.schedule(state, scheduleItem); }; - function JustSink(observer, value, scheduler) { - this.observer = observer; - this.value = value; - this.scheduler = scheduler; - } - function scheduleItem(s, state) { var value = state[0], observer = state[1]; observer.onNext(value); @@ -2969,13 +2989,6 @@ return /******/ (function(modules) { // webpackBootstrap return disposableEmpty; } - JustSink.prototype.run = function () { - var state = [this.value, this.observer]; - return this.scheduler === immediateScheduler ? - scheduleItem(null, state) : - this.scheduler.schedule(state, scheduleItem); - }; - return JustObservable; }(ObservableBase)); @@ -2994,30 +3007,24 @@ return /******/ (function(modules) { // webpackBootstrap var ThrowObservable = (function(__super__) { inherits(ThrowObservable, __super__); function ThrowObservable(error, scheduler) { - this.error = error; - this.scheduler = scheduler; + this._error = error; + this._scheduler = scheduler; __super__.call(this); } ThrowObservable.prototype.subscribeCore = function (o) { - var sink = new ThrowSink(o, this); - return sink.run(); + var state = [this._error, o]; + return this._scheduler === immediateScheduler ? + scheduleItem(null, state) : + this._scheduler.schedule(state, scheduleItem); }; - function ThrowSink(o, p) { - this.o = o; - this.p = p; - } - function scheduleItem(s, state) { var e = state[0], o = state[1]; o.onError(e); + return disposableEmpty; } - ThrowSink.prototype.run = function () { - return this.p.scheduler.schedule([this.p.error, this.o], scheduleItem); - }; - return ThrowObservable; }(ObservableBase)); @@ -3226,49 +3233,56 @@ return /******/ (function(modules) { // webpackBootstrap return observableConcat.apply(null, args); }; + var ConcatObserver = (function(__super__) { + inherits(ConcatObserver, __super__); + function ConcatObserver(s, fn) { + this._s = s; + this._fn = fn; + __super__.call(this); + } + + ConcatObserver.prototype.next = function (x) { this._s.o.onNext(x); }; + ConcatObserver.prototype.error = function (e) { this._s.o.onError(e); }; + ConcatObserver.prototype.completed = function () { this._s.i++; this._fn(this._s); }; + + return ConcatObserver; + }(AbstractObserver)); + var ConcatObservable = (function(__super__) { inherits(ConcatObservable, __super__); function ConcatObservable(sources) { - this.sources = sources; + this._sources = sources; __super__.call(this); } - ConcatObservable.prototype.subscribeCore = function(o) { - var sink = new ConcatSink(this.sources, o); - return sink.run(); - }; + function scheduleRecursive (state, recurse) { + if (state.disposable.isDisposed) { return; } + if (state.i === state.sources.length) { return state.o.onCompleted(); } - function ConcatSink(sources, o) { - this.sources = sources; - this.o = o; - } - ConcatSink.prototype.run = function () { - var isDisposed, subscription = new SerialDisposable(), sources = this.sources, length = sources.length, o = this.o; - var cancelable = immediateScheduler.scheduleRecursive(0, function (i, self) { - if (isDisposed) { return; } - if (i === length) { - return o.onCompleted(); - } + // Check if promise + var currentValue = state.sources[state.i]; + isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); - // Check if promise - var currentValue = sources[i]; - isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); + var d = new SingleAssignmentDisposable(); + state.subscription.setDisposable(d); + d.setDisposable(currentValue.subscribe(new ConcatObserver(state, recurse))); + } - var d = new SingleAssignmentDisposable(); - subscription.setDisposable(d); - d.setDisposable(currentValue.subscribe( - function (x) { o.onNext(x); }, - function (e) { o.onError(e); }, - function () { self(i + 1); } - )); - }); + ConcatObservable.prototype.subscribeCore = function(o) { + var subscription = new SerialDisposable(); + var disposable = disposableCreate(noop); + var state = { + o: o, + i: 0, + subscription: subscription, + disposable: disposable, + sources: this._sources + }; - return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { - isDisposed = true; - })); + var cancelable = immediateScheduler.scheduleRecursive(state, scheduleRecursive); + return new NAryDisposable([subscription, disposable, cancelable]); }; - return ConcatObservable; }(ObservableBase)); @@ -3315,7 +3329,7 @@ return /******/ (function(modules) { // webpackBootstrap }(ObservableBase)); - var MergeObserver = (function () { + var MergeObserver = (function (__super__) { function MergeObserver(o, max, g) { this.o = o; this.max = max; @@ -3323,97 +3337,55 @@ return /******/ (function(modules) { // webpackBootstrap this.done = false; this.q = []; this.activeCount = 0; - this.isStopped = false; + __super__.call(this); } + + inherits(MergeObserver, __super__); + MergeObserver.prototype.handleSubscribe = function (xs) { var sad = new SingleAssignmentDisposable(); this.g.add(sad); isPromise(xs) && (xs = observableFromPromise(xs)); sad.setDisposable(xs.subscribe(new InnerObserver(this, sad))); }; - MergeObserver.prototype.onNext = function (innerSource) { - if (this.isStopped) { return; } - if(this.activeCount < this.max) { - this.activeCount++; - this.handleSubscribe(innerSource); - } else { - this.q.push(innerSource); - } - }; - MergeObserver.prototype.onError = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - } - }; - MergeObserver.prototype.onCompleted = function () { - if (!this.isStopped) { - this.isStopped = true; - this.done = true; - this.activeCount === 0 && this.o.onCompleted(); - } - }; - MergeObserver.prototype.dispose = function() { this.isStopped = true; }; - MergeObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - return false; - }; - - function InnerObserver(parent, sad) { - this.parent = parent; - this.sad = sad; - this.isStopped = false; + MergeObserver.prototype.next = function (innerSource) { + if(this.activeCount < this.max) { + this.activeCount++; + this.handleSubscribe(innerSource); + } else { + this.q.push(innerSource); } - InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.parent.o.onNext(x); } }; - InnerObserver.prototype.onError = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.parent.o.onError(e); - } - }; - InnerObserver.prototype.onCompleted = function () { - if(!this.isStopped) { - this.isStopped = true; - var parent = this.parent; - parent.g.remove(this.sad); - if (parent.q.length > 0) { - parent.handleSubscribe(parent.q.shift()); - } else { - parent.activeCount--; - parent.done && parent.activeCount === 0 && parent.o.onCompleted(); - } - } - }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.parent.o.onError(e); - return true; - } - - return false; - }; - - return MergeObserver; - }()); + }; + MergeObserver.prototype.error = function (e) { this.o.onError(e); }; + MergeObserver.prototype.completed = function () { this.done = true; this.activeCount === 0 && this.o.onCompleted(); }; + function InnerObserver(parent, sad) { + this.parent = parent; + this.sad = sad; + __super__.call(this); + } + inherits(InnerObserver, __super__); + InnerObserver.prototype.next = function (x) { this.parent.o.onNext(x); }; + InnerObserver.prototype.error = function (e) { this.parent.o.onError(e); }; + InnerObserver.prototype.completed = function () { + this.parent.g.remove(this.sad); + if (this.parent.q.length > 0) { + this.parent.handleSubscribe(this.parent.q.shift()); + } else { + this.parent.activeCount--; + this.parent.done && this.parent.activeCount === 0 && this.parent.o.onCompleted(); + } + }; + return MergeObserver; + }(AbstractObserver)); /** * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. * Or merges two observable sequences into a single observable sequence. - * - * @example - * 1 - merged = sources.merge(1); - * 2 - merged = source.merge(otherSource); * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ @@ -3567,85 +3539,63 @@ return /******/ (function(modules) { // webpackBootstrap __super__.call(this); } - MergeAllObservable.prototype.subscribeCore = function (observer) { + MergeAllObservable.prototype.subscribeCore = function (o) { var g = new CompositeDisposable(), m = new SingleAssignmentDisposable(); g.add(m); - m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g))); + m.setDisposable(this.source.subscribe(new MergeAllObserver(o, g))); return g; }; + return MergeAllObservable; + }(ObservableBase)); + + var MergeAllObserver = (function (__super__) { function MergeAllObserver(o, g) { this.o = o; this.g = g; - this.isStopped = false; this.done = false; + __super__.call(this); } - MergeAllObserver.prototype.onNext = function(innerSource) { - if(this.isStopped) { return; } + + inherits(MergeAllObserver, __super__); + + MergeAllObserver.prototype.next = function(innerSource) { var sad = new SingleAssignmentDisposable(); this.g.add(sad); - isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); - sad.setDisposable(innerSource.subscribe(new InnerObserver(this, sad))); }; - MergeAllObserver.prototype.onError = function (e) { - if(!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - } - }; - MergeAllObserver.prototype.onCompleted = function () { - if(!this.isStopped) { - this.isStopped = true; - this.done = true; - this.g.length === 1 && this.o.onCompleted(); - } + + MergeAllObserver.prototype.error = function (e) { + this.o.onError(e); }; - MergeAllObserver.prototype.dispose = function() { this.isStopped = true; }; - MergeAllObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - return false; + MergeAllObserver.prototype.completed = function () { + this.done = true; + this.g.length === 1 && this.o.onCompleted(); }; function InnerObserver(parent, sad) { this.parent = parent; this.sad = sad; - this.isStopped = false; + __super__.call(this); } - InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } }; - InnerObserver.prototype.onError = function (e) { - if(!this.isStopped) { - this.isStopped = true; - this.parent.o.onError(e); - } + + inherits(InnerObserver, __super__); + + InnerObserver.prototype.next = function (x) { + this.parent.o.onNext(x); }; - InnerObserver.prototype.onCompleted = function () { - if(!this.isStopped) { - var parent = this.parent; - this.isStopped = true; - parent.g.remove(this.sad); - parent.done && parent.g.length === 1 && parent.o.onCompleted(); - } + InnerObserver.prototype.error = function (e) { + this.parent.o.onError(e); }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.parent.o.onError(e); - return true; - } - - return false; + InnerObserver.prototype.completed = function () { + this.parent.g.remove(this.sad); + this.parent.done && this.parent.g.length === 1 && this.parent.o.onCompleted(); }; - return MergeAllObservable; - }(ObservableBase)); + return MergeAllObserver; + }(AbstractObserver)); /** * Merges an observable sequence of observable sequences into an observable sequence. @@ -3793,7 +3743,7 @@ return /******/ (function(modules) { // webpackBootstrap InnerObserver.prototype.completed = function () { if (this.parent.latest === this.id) { this.parent.hasLatest = false; - this.parent.isStopped && this.parent.o.onCompleted(); + this.parent.stopped && this.parent.o.onCompleted(); } }; @@ -3888,9 +3838,9 @@ return /******/ (function(modules) { // webpackBootstrap subscriptions[i] = sad; } - var sad = new SingleAssignmentDisposable(); - sad.setDisposable(this._s.subscribe(new WithLatestFromSourceObserver(o, this._cb, state))); - subscriptions[n] = sad; + var outerSad = new SingleAssignmentDisposable(); + outerSad.setDisposable(this._s.subscribe(new WithLatestFromSourceObserver(o, this._cb, state))); + subscriptions[n] = outerSad; return new NAryDisposable(subscriptions); }; @@ -3978,7 +3928,7 @@ return /******/ (function(modules) { // webpackBootstrap ZipObservable.prototype.subscribeCore = function(observer) { var n = this._s.length, - subscriptions = new Array(n); + subscriptions = new Array(n), done = arrayInitialize(n, falseFactory), q = arrayInitialize(n, emptyArrayFactory); @@ -4081,6 +4031,78 @@ return /******/ (function(modules) { // webpackBootstrap return args; } + var ZipIterableObservable = (function(__super__) { + inherits(ZipIterableObservable, __super__); + function ZipIterableObservable(sources, cb) { + this.sources = sources; + this._cb = cb; + __super__.call(this); + } + + ZipIterableObservable.prototype.subscribeCore = function (o) { + var sources = this.sources, len = sources.length, subscriptions = new Array(len); + + var state = { + q: arrayInitialize(len, emptyArrayFactory), + done: arrayInitialize(len, falseFactory), + cb: this._cb, + o: o + }; + + for (var i = 0; i < len; i++) { + (function (i) { + var source = sources[i], sad = new SingleAssignmentDisposable(); + (isArrayLike(source) || isIterable(source)) && (source = observableFrom(source)); + + subscriptions[i] = sad; + sad.setDisposable(source.subscribe(new ZipIterableObserver(state, i))); + }(i)); + } + + return new NAryDisposable(subscriptions); + }; + + return ZipIterableObservable; + }(ObservableBase)); + + var ZipIterableObserver = (function (__super__) { + inherits(ZipIterableObserver, __super__); + function ZipIterableObserver(s, i) { + this._s = s; + this._i = i; + __super__.call(this); + } + + function notEmpty(x) { return x.length > 0; } + function shiftEach(x) { return x.shift(); } + function notTheSame(i) { + return function (x, j) { + return j !== i; + }; + } + + ZipIterableObserver.prototype.next = function (x) { + this._s.q[this._i].push(x); + if (this._s.q.every(notEmpty)) { + var queuedValues = this._s.q.map(shiftEach), + res = tryCatch(this._s.cb).apply(null, queuedValues); + if (res === errorObj) { return this._s.o.onError(res.e); } + this._s.o.onNext(res); + } else if (this._s.done.filter(notTheSame(this._i)).every(identity)) { + this._s.o.onCompleted(); + } + }; + + ZipIterableObserver.prototype.error = function (e) { this._s.o.onError(e); }; + + ZipIterableObserver.prototype.completed = function () { + this._s.done[this._i] = true; + this._s.done.every(identity) && this._s.o.onCompleted(); + }; + + return ZipIterableObserver; + }(AbstractObserver)); + /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args. @@ -4095,38 +4117,7 @@ return /******/ (function(modules) { // webpackBootstrap var parent = this; args.unshift(parent); - return new AnonymousObservable(function (o) { - var n = args.length, - queues = arrayInitialize(n, emptyArrayFactory), - isDone = arrayInitialize(n, falseFactory); - - var subscriptions = new Array(n); - for (var idx = 0; idx < n; idx++) { - (function (i) { - var source = args[i], sad = new SingleAssignmentDisposable(); - - (isArrayLike(source) || isIterable(source)) && (source = observableFrom(source)); - - sad.setDisposable(source.subscribe(function (x) { - queues[i].push(x); - if (queues.every(function (x) { return x.length > 0; })) { - var queuedValues = queues.map(function (x) { return x.shift(); }), - res = tryCatch(resultSelector).apply(parent, queuedValues); - if (res === errorObj) { return o.onError(res.e); } - o.onNext(res); - } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { - o.onCompleted(); - } - }, function (e) { o.onError(e); }, function () { - isDone[i] = true; - isDone.every(identity) && o.onCompleted(); - })); - subscriptions[i] = sad; - })(idx); - } - - return new CompositeDisposable(subscriptions); - }, parent); + return new ZipIterableObservable(args, resultSelector); }; function asObservable(source) { @@ -4329,25 +4320,48 @@ return /******/ (function(modules) { // webpackBootstrap return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted); }; + var FinallyObservable = (function (__super__) { + inherits(FinallyObservable, __super__); + function FinallyObservable(source, fn, thisArg) { + this.source = source; + this._fn = bindCallback(fn, thisArg, 0); + __super__.call(this); + } + + FinallyObservable.prototype.subscribeCore = function (o) { + var d = tryCatch(this.source.subscribe).call(this.source, o); + if (d === errorObj) { + this._fn(); + thrower(d.e); + } + + return new FinallyDisposable(d, this._fn); + }; + + function FinallyDisposable(s, fn) { + this.isDisposed = false; + this._s = s; + this._fn = fn; + } + FinallyDisposable.prototype.dispose = function () { + if (!this.isDisposed) { + var res = tryCatch(this._s.dispose).call(this._s); + this._fn(); + res === errorObj && thrower(res.e); + } + }; + + return FinallyObservable; + + }(ObservableBase)); + /** * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ - observableProto['finally'] = function (action) { - var source = this; - return new AnonymousObservable(function (observer) { - var subscription = tryCatch(source.subscribe).call(source, observer); - if (subscription === errorObj) { - action(); - return thrower(subscription.e); - } - return disposableCreate(function () { - var r = tryCatch(subscription.dispose).call(subscription); - action(); - r === errorObj && thrower(r.e); - }); - }, this); + observableProto['finally'] = function (action, thisArg) { + return new FinallyObservable(this, action, thisArg); }; var IgnoreElementsObservable = (function(__super__) { @@ -4675,7 +4689,7 @@ return /******/ (function(modules) { // webpackBootstrap } function innerMap(selector, self) { - return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); } + return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }; } MapObservable.prototype.internalMap = function (selector, thisArg) { @@ -4758,13 +4772,6 @@ return /******/ (function(modules) { // webpackBootstrap return new FlatMapObservable(this, selector, resultSelector, thisArg).mergeAll(); }; - - // - //Rx.Observable.prototype.flatMapWithMaxConcurrent = function(limit, selector, resultSelector, thisArg) { - // return new FlatMapObservable(this, selector, resultSelector, thisArg).merge(limit); - //}; - // - Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisArg) { return new FlatMapObservable(this, selector, resultSelector, thisArg).switchLatest(); }; @@ -4772,47 +4779,35 @@ return /******/ (function(modules) { // webpackBootstrap inherits(SkipObservable, __super__); function SkipObservable(source, count) { this.source = source; - this.skipCount = count; + this._count = count; __super__.call(this); } - + SkipObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new InnerObserver(o, this.skipCount)); + return this.source.subscribe(new SkipObserver(o, this._count)); }; - - function InnerObserver(o, c) { - this.c = c; - this.r = c; - this.o = o; - this.isStopped = false; - } - InnerObserver.prototype.onNext = function (x) { - if (this.isStopped) { return; } - if (this.r <= 0) { - this.o.onNext(x); + + function SkipObserver(o, c) { + this._o = o; + this._r = c; + AbstractObserver.call(this); + } + + inherits(SkipObserver, AbstractObserver); + + SkipObserver.prototype.next = function (x) { + if (this._r <= 0) { + this._o.onNext(x); } else { - this.r--; - } - }; - InnerObserver.prototype.onError = function(e) { - if (!this.isStopped) { this.isStopped = true; this.o.onError(e); } - }; - InnerObserver.prototype.onCompleted = function() { - if (!this.isStopped) { this.isStopped = true; this.o.onCompleted(); } - }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function(e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; + this._r--; } - return false; }; - + SkipObserver.prototype.error = function(e) { this._o.onError(e); }; + SkipObserver.prototype.completed = function() { this._o.onCompleted(); }; + return SkipObservable; - }(ObservableBase)); - + }(ObservableBase)); + /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. @@ -4822,6 +4817,7 @@ return /******/ (function(modules) { // webpackBootstrap if (count < 0) { throw new ArgumentOutOfRangeError(); } return new SkipObservable(this, count); }; + var SkipWhileObservable = (function (__super__) { inherits(SkipWhileObservable, __super__); function SkipWhileObservable(source, fn) { @@ -4879,57 +4875,38 @@ return /******/ (function(modules) { // webpackBootstrap var TakeObservable = (function(__super__) { inherits(TakeObservable, __super__); - function TakeObservable(source, count) { this.source = source; - this.takeCount = count; + this._count = count; __super__.call(this); } - + TakeObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new InnerObserver(o, this.takeCount)); + return this.source.subscribe(new TakeObserver(o, this._count)); }; - - function InnerObserver(o, c) { - this.o = o; - this.c = c; - this.r = c; - this.isStopped = false; + + function TakeObserver(o, c) { + this._o = o; + this._c = c; + this._r = c; + AbstractObserver.call(this); } - InnerObserver.prototype = { - onNext: function (x) { - if (this.isStopped) { return; } - if (this.r-- > 0) { - this.o.onNext(x); - this.r <= 0 && this.o.onCompleted(); - } - }, - onError: function (err) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(err); - } - }, - onCompleted: function () { - if (!this.isStopped) { - this.isStopped = true; - this.o.onCompleted(); - } - }, - dispose: function () { this.isStopped = true; }, - fail: function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - return false; + + inherits(TakeObserver, AbstractObserver); + + TakeObserver.prototype.next = function (x) { + if (this._r-- > 0) { + this._o.onNext(x); + this._r <= 0 && this._o.onCompleted(); } }; - + + TakeObserver.prototype.error = function (e) { this._o.onError(e); }; + TakeObserver.prototype.completed = function () { this._o.onCompleted(); }; + return TakeObservable; - }(ObservableBase)); - + }(ObservableBase)); + /** * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). * @param {Number} count The number of elements to return. @@ -5559,8 +5536,8 @@ return /******/ (function(modules) { // webpackBootstrap } RefCountObservable.prototype.subscribeCore = function (o) { - var shouldConnect = ++this._count === 1, subscription = this.source.subscribe(o); - shouldConnect && (this._connectableSubscription = this.source.connect()); + var subscription = this.source.subscribe(o); + ++this._count === 1 && (this._connectableSubscription = this.source.connect()); return new RefCountDisposable(this, subscription); }; @@ -5585,34 +5562,31 @@ return /******/ (function(modules) { // webpackBootstrap inherits(ConnectableObservable, __super__); function ConnectableObservable(source, subject) { this.source = source; - this._hasSubscription = false; - this._subscription = null; - this._sourceObservable = source.asObservable(); + this._connection = null; + this._source = source.asObservable(); this._subject = subject; __super__.call(this); } - function ConnectDisposable(parent) { + function ConnectDisposable(parent, subscription) { this._p = parent; - this.isDisposed = false; + this._s = subscription; } ConnectDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - this._p._hasSubscription = false; + if (this._s) { + this._s.dispose(); + this._s = null; + this._p._connection = null; } }; ConnectableObservable.prototype.connect = function () { - if (!this._hasSubscription) { - this._hasSubscription = true; - this._subscription = new BinaryDisposable( - this._sourceObservable.subscribe(this._subject), - new ConnectDisposable(this) - ); + if (!this._connection) { + var subscription = this._source.subscribe(this._subject); + this._connection = new ConnectDisposable(this, subscription); } - return this._subscription; + return this._connection; }; ConnectableObservable.prototype._subscribe = function (o) { @@ -6102,7 +6076,7 @@ return /******/ (function(modules) { // webpackBootstrap timeoutDurationSelector = firstTimeout; firstTimeout = observableNever(); } - other || (other = observableThrow(new TimeoutError())); + Observable.isObservable(other) || (other = observableThrow(new TimeoutError())); return new AnonymousObservable(function (o) { var subscription = new SerialDisposable(), timer = new SerialDisposable(), @@ -6162,7 +6136,7 @@ return /******/ (function(modules) { // webpackBootstrap } if (other instanceof Error) { other = observableThrow(other); } isScheduler(scheduler) || (scheduler = defaultScheduler); - + Observable.isObservable(other) || (other = observableThrow(new TimeoutError())); return new AnonymousObservable(function (o) { var id = 0, original = new SingleAssignmentDisposable(), @@ -6423,8 +6397,8 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Observable} pauser The observable sequence used to pause the underlying sequence. * @returns {Observable} The observable sequence which is paused based upon the pauser. */ - observableProto.pausableBuffered = function (subject) { - return new PausableBufferedObservable(this, subject); + observableProto.pausableBuffered = function (pauser) { + return new PausableBufferedObservable(this, pauser); }; var ControlledObservable = (function (__super__) { @@ -7014,11 +6988,9 @@ return /******/ (function(modules) { // webpackBootstrap * @returns {Mixed} The initial value passed to the constructor until onNext is called; after which, the last value passed to onNext. */ getValue: function () { - checkDisposed(this); - if (this.hasError) { - throw this.error; - } - return this.value; + checkDisposed(this); + if (this.hasError) { thrower(this.error); } + return this.value; }, /** * Indicates whether the subject has observers subscribed to it. @@ -7341,153 +7313,1567 @@ return /******/ (function(modules) { // webpackBootstrap } }; - // v8 likes predictible objects - function Item(fun, array) { - this.fun = fun; - this.array = array; + // v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() {} + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function() { return 0; }; + + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + factory(exports, module); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, mod); + global.fetchJsonp = mod.exports; + } + })(this, function (exports, module) { + 'use strict'; + + var defaultOptions = { + timeout: 5000, + jsonpCallback: 'callback' + }; + + function generateCallbackFunction() { + return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000); + } + + // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout + function clearFunction(functionName) { + // IE8 throws an exception when you try to delete a property on window + // http://stackoverflow.com/a/1824228/751089 + try { + delete window[functionName]; + } catch (e) { + window[functionName] = undefined; + } + } + + function removeScript(scriptId) { + var script = document.getElementById(scriptId); + document.getElementsByTagName("head")[0].removeChild(script); + } + + var fetchJsonp = function fetchJsonp(url) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout; + var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback; + + var timeoutId = undefined; + + return new Promise(function (resolve, reject) { + var callbackFunction = generateCallbackFunction(); + + window[callbackFunction] = function (response) { + resolve({ + ok: true, + // keep consistent with fetch API + json: function json() { + return Promise.resolve(response); + } + }); + + if (timeoutId) clearTimeout(timeoutId); + + removeScript(jsonpCallback + '_' + callbackFunction); + + clearFunction(callbackFunction); + }; + + // Check if the user set their own params, and if not add a ? to start a list of params + url += url.indexOf('?') === -1 ? '?' : '&'; + + var jsonpScript = document.createElement('script'); + jsonpScript.setAttribute("src", url + jsonpCallback + '=' + callbackFunction); + jsonpScript.id = jsonpCallback + '_' + callbackFunction; + document.getElementsByTagName("head")[0].appendChild(jsonpScript); + + timeoutId = setTimeout(function () { + reject(new Error('JSONP request to ' + url + ' timed out')); + + clearFunction(callbackFunction); + removeScript(jsonpCallback + '_' + callbackFunction); + }, timeout); + }); + }; + + // export as global function + /* + let local; + if (typeof global !== 'undefined') { + local = global; + } else if (typeof self !== 'undefined') { + local = self; + } else { + try { + local = Function('return this')(); + } catch (e) { + throw new Error('polyfill failed because global object is unavailable in this environment'); + } + } + + local.fetchJsonp = fetchJsonp; + */ + + module.exports = fetchJsonp; + }); + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + // Copyright Joyent, Inc. and other Node contributors. + // + // 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. + + var punycode = __webpack_require__(10); + + exports.parse = urlParse; + exports.resolve = urlResolve; + exports.resolveObject = urlResolveObject; + exports.format = urlFormat; + + exports.Url = Url; + + function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; + } + + // Reference: RFC 3986, RFC 1808, RFC 2396 + + // define these here so at least they only have to be + // compiled once on the first module load. + var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = __webpack_require__(11); + + function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; + } + + Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a puny coded representation of "domain". + // It only converts the part of the domain name that + // has non ASCII characters. I.e. it dosent matter if + // you call it with a domain that already is in ASCII. + var domainArray = this.hostname.split('.'); + var newOut = []; + for (var i = 0; i < domainArray.length; ++i) { + var s = domainArray[i]; + newOut.push(s.match(/[^A-Za-z0-9_-]/) ? + 'xn--' + punycode.encode(s) : s); + } + this.hostname = newOut.join('.'); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; + }; + + // format a parsed object into a url string + function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); + } + + Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + isObject(this.query) && + Object.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; + }; + + function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); + } + + Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); + }; + + function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); + } + + Url.prototype.resolveObject = function(relative) { + if (isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + Object.keys(this).forEach(function(k) { + result[k] = this[k]; + }, this); + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + Object.keys(relative).forEach(function(k) { + if (k !== 'protocol') + result[k] = relative[k]; + }); + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + Object.keys(relative).forEach(function(k) { + result[k] = relative[k]; + }); + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especialy happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!isNull(result.pathname) || !isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host) && (last === '.' || last === '..') || + last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last == '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especialy happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!isNull(result.pathname) || !isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + }; + + Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; + }; + + function isString(arg) { + return typeof arg === "string"; } - Item.prototype.run = function () { - this.fun.apply(null, this.array); - }; - process.title = 'browser'; - process.browser = true; - process.env = {}; - process.argv = []; - process.version = ''; // empty string to avoid regexp issues - process.versions = {}; - function noop() {} + function isObject(arg) { + return typeof arg === 'object' && arg !== null; + } - process.on = noop; - process.addListener = noop; - process.once = noop; - process.off = noop; - process.removeListener = noop; - process.removeAllListeners = noop; - process.emit = noop; + function isNull(arg) { + return arg === null; + } + function isNullOrUndefined(arg) { + return arg == null; + } + + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */ + ;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } - process.binding = function (name) { - throw new Error('process.binding is not supported'); - }; + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw RangeError(errors[type]); + } - process.cwd = function () { return '/' }; - process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); - }; - process.umask = function() { return 0; }; - + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * http://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.3.2', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + true + ) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { + return punycode; + }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { // in Rhino or a web browser + root.punycode = punycode; + } + + }(this)); + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)(module), (function() { return this; }()))) /***/ }, -/* 8 */ +/* 11 */ /***/ function(module, exports, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) { - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { - factory(exports, module); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, mod); - global.fetchJsonp = mod.exports; - } - })(this, function (exports, module) { - 'use strict'; + 'use strict'; - var defaultOptions = { - timeout: 5000, - jsonpCallback: 'callback' - }; + exports.decode = exports.parse = __webpack_require__(12); + exports.encode = exports.stringify = __webpack_require__(13); + + +/***/ }, +/* 12 */ +/***/ function(module, exports) { + + // Copyright Joyent, Inc. and other Node contributors. + // + // 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 generateCallbackFunction() { - return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000); + 'use strict'; + + // If obj.hasOwnProperty has been overridden, then calling + // obj.hasOwnProperty(prop) will break. + // See: https://github.com/joyent/node/issues/1707 + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; } - // Known issue: Will throw 'Uncaught ReferenceError: callback_*** is not defined' error if request timeout - function clearFunction(functionName) { - // IE8 throws an exception when you try to delete a property on window - // http://stackoverflow.com/a/1824228/751089 - try { - delete window[functionName]; - } catch (e) { - window[functionName] = undefined; - } + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; } - function removeScript(scriptId) { - var script = document.getElementById(scriptId); - document.getElementsByTagName("head")[0].removeChild(script); + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; } - var fetchJsonp = function fetchJsonp(url) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; - var timeout = options.timeout != null ? options.timeout : defaultOptions.timeout; - var jsonpCallback = options.jsonpCallback != null ? options.jsonpCallback : defaultOptions.jsonpCallback; + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } - var timeoutId = undefined; + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); - return new Promise(function (resolve, reject) { - var callbackFunction = generateCallbackFunction(); + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (Array.isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } - window[callbackFunction] = function (response) { - resolve({ - ok: true, - // keep consistent with fetch API - json: function json() { - return Promise.resolve(response); - } - }); + return obj; + }; + + +/***/ }, +/* 13 */ +/***/ function(module, exports) { + + // Copyright Joyent, Inc. and other Node contributors. + // + // 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. - if (timeoutId) clearTimeout(timeoutId); + 'use strict'; - removeScript(jsonpCallback + '_' + callbackFunction); + var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; - clearFunction(callbackFunction); - }; + case 'boolean': + return v ? 'true' : 'false'; - // Check if the user set their own params, and if not add a ? to start a list of params - url += url.indexOf('?') === -1 ? '?' : '&'; + case 'number': + return isFinite(v) ? v : ''; - var jsonpScript = document.createElement('script'); - jsonpScript.setAttribute("src", url + jsonpCallback + '=' + callbackFunction); - jsonpScript.id = jsonpCallback + '_' + callbackFunction; - document.getElementsByTagName("head")[0].appendChild(jsonpScript); + default: + return ''; + } + }; - timeoutId = setTimeout(function () { - reject(new Error('JSONP request to ' + url + ' timed out')); + module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } - clearFunction(callbackFunction); - removeScript(jsonpCallback + '_' + callbackFunction); - }, timeout); - }); - }; + if (typeof obj === 'object') { + return Object.keys(obj).map(function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (Array.isArray(obj[k])) { + return obj[k].map(function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); - // export as global function - /* - let local; - if (typeof global !== 'undefined') { - local = global; - } else if (typeof self !== 'undefined') { - local = self; - } else { - try { - local = Function('return this')(); - } catch (e) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } } - - local.fetchJsonp = fetchJsonp; - */ - module.exports = fetchJsonp; - }); + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); + }; + /***/ }, -/* 9 */ +/* 14 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -7514,11 +8900,11 @@ return /******/ (function(modules) { // webpackBootstrap var _react2 = _interopRequireDefault(_react); - var _Tile = __webpack_require__(10); + var _Tile = __webpack_require__(15); var _Tile2 = _interopRequireDefault(_Tile); - var _reactMotion = __webpack_require__(14); + var _reactMotion = __webpack_require__(19); var Wall = (function (_Component) { _inherits(Wall, _Component); @@ -7623,7 +9009,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 10 */ +/* 15 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -7646,15 +9032,15 @@ return /******/ (function(modules) { // webpackBootstrap var _react2 = _interopRequireDefault(_react); - var _commonImage = __webpack_require__(11); + var _commonImage = __webpack_require__(16); var _commonImage2 = _interopRequireDefault(_commonImage); - var _commonMessage = __webpack_require__(12); + var _commonMessage = __webpack_require__(17); var _commonMessage2 = _interopRequireDefault(_commonMessage); - var _commonAuthor = __webpack_require__(13); + var _commonAuthor = __webpack_require__(18); var _commonAuthor2 = _interopRequireDefault(_commonAuthor); @@ -7770,7 +9156,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 11 */ +/* 16 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -7823,7 +9209,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 12 */ +/* 17 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -7877,7 +9263,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 13 */ +/* 18 */ /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -7946,7 +9332,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 14 */ +/* 19 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -7959,11 +9345,11 @@ return /******/ (function(modules) { // webpackBootstrap var _react2 = _interopRequireDefault(_react); - var _components2 = __webpack_require__(15); + var _components2 = __webpack_require__(20); var _components3 = _interopRequireDefault(_components2); - var _reorderKeys = __webpack_require__(27); + var _reorderKeys = __webpack_require__(32); var _reorderKeys2 = _interopRequireDefault(_reorderKeys); @@ -7980,13 +9366,13 @@ return /******/ (function(modules) { // webpackBootstrap exports.StaggeredMotion = StaggeredMotion; exports.TransitionMotion = TransitionMotion; - var _spring2 = __webpack_require__(28); + var _spring2 = __webpack_require__(33); var _spring3 = _interopRequireDefault(_spring2); exports.spring = _spring3['default']; - var _presets2 = __webpack_require__(29); + var _presets2 = __webpack_require__(34); var _presets3 = _interopRequireDefault(_presets2); @@ -7997,7 +9383,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.utils = utils; /***/ }, -/* 15 */ +/* 20 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -8010,33 +9396,33 @@ return /******/ (function(modules) { // webpackBootstrap function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var _noVelocity = __webpack_require__(16); + var _noVelocity = __webpack_require__(21); var _noVelocity2 = _interopRequireDefault(_noVelocity); - var _hasReachedStyle = __webpack_require__(17); + var _hasReachedStyle = __webpack_require__(22); var _hasReachedStyle2 = _interopRequireDefault(_hasReachedStyle); - var _mergeDiff = __webpack_require__(18); + var _mergeDiff = __webpack_require__(23); var _mergeDiff2 = _interopRequireDefault(_mergeDiff); - var _animationLoop = __webpack_require__(19); + var _animationLoop = __webpack_require__(24); var _animationLoop2 = _interopRequireDefault(_animationLoop); - var _zero = __webpack_require__(22); + var _zero = __webpack_require__(27); var _zero2 = _interopRequireDefault(_zero); - var _updateTree = __webpack_require__(23); + var _updateTree = __webpack_require__(28); - var _deprecatedSprings2 = __webpack_require__(25); + var _deprecatedSprings2 = __webpack_require__(30); var _deprecatedSprings3 = _interopRequireDefault(_deprecatedSprings2); - var _stripStyle = __webpack_require__(26); + var _stripStyle = __webpack_require__(31); var _stripStyle2 = _interopRequireDefault(_stripStyle); @@ -8456,7 +9842,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 16 */ +/* 21 */ /***/ function(module, exports) { // currentStyle keeps the info about whether a prop is configured as a spring @@ -8481,7 +9867,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 17 */ +/* 22 */ /***/ function(module, exports) { "use strict"; @@ -8514,7 +9900,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 18 */ +/* 23 */ /***/ function(module, exports) { // this function is allocation-less thanks to babel, which transforms the tail @@ -8628,7 +10014,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 19 */ +/* 24 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -8638,11 +10024,11 @@ return /******/ (function(modules) { // webpackBootstrap function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var _performanceNow = __webpack_require__(20); + var _performanceNow = __webpack_require__(25); var _performanceNow2 = _interopRequireDefault(_performanceNow); - var _raf = __webpack_require__(21); + var _raf = __webpack_require__(26); var _raf2 = _interopRequireDefault(_raf); @@ -8777,7 +10163,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 20 */ +/* 25 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {// Generated by CoffeeScript 1.7.1 @@ -8816,10 +10202,10 @@ return /******/ (function(modules) { // webpackBootstrap /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(7))) /***/ }, -/* 21 */ +/* 26 */ /***/ function(module, exports, __webpack_require__) { - var now = __webpack_require__(20) + var now = __webpack_require__(25) , global = typeof window === 'undefined' ? {} : window , vendors = ['moz', 'webkit'] , suffix = 'AnimationFrame' @@ -8890,7 +10276,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 22 */ +/* 27 */ /***/ function(module, exports) { // used by the tree-walking updates and springs. Avoids some allocations @@ -8906,7 +10292,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 23 */ +/* 28 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -8918,7 +10304,7 @@ return /******/ (function(modules) { // webpackBootstrap function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var _stepper = __webpack_require__(24); + var _stepper = __webpack_require__(29); var _stepper2 = _interopRequireDefault(_stepper); @@ -9003,7 +10389,7 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }, -/* 24 */ +/* 29 */ /***/ function(module, exports) { "use strict"; @@ -9040,7 +10426,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 25 */ +/* 30 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -9093,7 +10479,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 26 */ +/* 31 */ /***/ function(module, exports) { // turn {x: {val: 1, config: [1, 2]}, y: 2} into {x: 1, y: 2} @@ -9116,7 +10502,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 27 */ +/* 32 */ /***/ function(module, exports) { "use strict"; @@ -9138,7 +10524,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 28 */ +/* 33 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -9148,7 +10534,7 @@ return /******/ (function(modules) { // webpackBootstrap function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var _presets = __webpack_require__(29); + var _presets = __webpack_require__(34); var _presets2 = _interopRequireDefault(_presets); @@ -9163,7 +10549,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 29 */ +/* 34 */ /***/ function(module, exports) { // [stiffness, damping] @@ -9179,7 +10565,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports["default"]; /***/ }, -/* 30 */ +/* 35 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -9215,7 +10601,7 @@ return /******/ (function(modules) { // webpackBootstrap key: 'render', value: function render() { - var logo = __webpack_require__(31); + var logo = __webpack_require__(36); return _react2['default'].createElement('a', { href: 'http://climb.social/', className: 'climb-social-badge', @@ -9230,13 +10616,13 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 31 */ +/* 36 */ /***/ function(module, exports) { module.exports = "Climb Logo BetaCreated with Sketch." /***/ }, -/* 32 */ +/* 37 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -9263,7 +10649,7 @@ return /******/ (function(modules) { // webpackBootstrap var _climbSocial2 = _interopRequireDefault(_climbSocial); - var _Slideshow = __webpack_require__(33); + var _Slideshow = __webpack_require__(38); var _Slideshow2 = _interopRequireDefault(_Slideshow); @@ -9288,7 +10674,7 @@ return /******/ (function(modules) { // webpackBootstrap return; } - _climbSocial2['default'].getStream(this.props.collectionId).subscribe(function (items) { + _climbSocial2['default'].getStream(this.props.collectionId, this.props.refresh, this.props.domain).subscribe(function (items) { var mappedItems = {}; items.map(function (item) { @@ -9314,6 +10700,7 @@ return /******/ (function(modules) { // webpackBootstrap key: 'propTypes', value: { collectionId: _react.PropTypes.string.isRequired, + domain: _react.PropTypes.string, delay: _react.PropTypes.number }, enumerable: true @@ -9321,7 +10708,9 @@ return /******/ (function(modules) { // webpackBootstrap key: 'defaultProps', value: { collectionId: '561ba63445284e1740e016f7', - delay: 5 + delay: 5, + refresh: 8, + domain: 'http://app.climb.social' }, enumerable: true }]); @@ -9333,7 +10722,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 33 */ +/* 38 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -9358,11 +10747,11 @@ return /******/ (function(modules) { // webpackBootstrap var _react2 = _interopRequireDefault(_react); - var _slide = __webpack_require__(34); + var _slide = __webpack_require__(39); var _slide2 = _interopRequireDefault(_slide); - var _reactMotion = __webpack_require__(14); + var _reactMotion = __webpack_require__(19); var Slideshow = (function (_Component) { _inherits(Slideshow, _Component); @@ -9500,7 +10889,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 34 */ +/* 39 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -9523,15 +10912,15 @@ return /******/ (function(modules) { // webpackBootstrap var _react2 = _interopRequireDefault(_react); - var _Panel = __webpack_require__(35); + var _Panel = __webpack_require__(40); var _Panel2 = _interopRequireDefault(_Panel); - var _commonImage = __webpack_require__(11); + var _commonImage = __webpack_require__(16); var _commonImage2 = _interopRequireDefault(_commonImage); - var _reactMotion = __webpack_require__(14); + var _reactMotion = __webpack_require__(19); var Slide = (function (_Component) { _inherits(Slide, _Component); @@ -9665,7 +11054,7 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 35 */ +/* 40 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; @@ -9688,11 +11077,11 @@ return /******/ (function(modules) { // webpackBootstrap var _react2 = _interopRequireDefault(_react); - var _commonMessage = __webpack_require__(12); + var _commonMessage = __webpack_require__(17); var _commonMessage2 = _interopRequireDefault(_commonMessage); - var _commonAuthor = __webpack_require__(13); + var _commonAuthor = __webpack_require__(18); var _commonAuthor2 = _interopRequireDefault(_commonAuthor); @@ -9748,16 +11137,16 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = exports['default']; /***/ }, -/* 36 */ +/* 41 */ /***/ function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a