a zip code crypto-currency system good for red ONLY

zone-patch-rxjs.js 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. /**
  2. * @license
  3. * Copyright Google Inc. All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. (function (global, factory) {
  9. typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('rxjs/add/observable/bindCallback'), require('rxjs/add/observable/bindNodeCallback'), require('rxjs/add/observable/defer'), require('rxjs/add/observable/forkJoin'), require('rxjs/add/observable/fromEventPattern'), require('rxjs/add/operator/multicast'), require('rxjs/Observable'), require('rxjs/scheduler/asap'), require('rxjs/Subscriber'), require('rxjs/Subscription'), require('rxjs/symbol/rxSubscriber')) :
  10. typeof define === 'function' && define.amd ? define(['rxjs/add/observable/bindCallback', 'rxjs/add/observable/bindNodeCallback', 'rxjs/add/observable/defer', 'rxjs/add/observable/forkJoin', 'rxjs/add/observable/fromEventPattern', 'rxjs/add/operator/multicast', 'rxjs/Observable', 'rxjs/scheduler/asap', 'rxjs/Subscriber', 'rxjs/Subscription', 'rxjs/symbol/rxSubscriber'], factory) :
  11. (factory(null,null,null,null,null,null,global.Rx,global.Rx.Scheduler,global.Rx,global.Rx,global.Rx.Symbol));
  12. }(this, (function (bindCallback,bindNodeCallback,defer,forkJoin,fromEventPattern,multicast,Observable,asap,Subscriber,Subscription,rxSubscriber) { 'use strict';
  13. /**
  14. * @license
  15. * Copyright Google Inc. All Rights Reserved.
  16. *
  17. * Use of this source code is governed by an MIT-style license that can be
  18. * found in the LICENSE file at https://angular.io/license
  19. */
  20. Zone.__load_patch('rxjs', function (global, Zone) {
  21. var symbol = Zone.__symbol__;
  22. var nextSource = 'rxjs.Subscriber.next';
  23. var errorSource = 'rxjs.Subscriber.error';
  24. var completeSource = 'rxjs.Subscriber.complete';
  25. var ObjectDefineProperties = Object.defineProperties;
  26. var empty = {
  27. closed: true,
  28. next: function (value) { },
  29. error: function (err) { throw err; },
  30. complete: function () { }
  31. };
  32. function toSubscriber(nextOrObserver, error, complete) {
  33. if (nextOrObserver) {
  34. if (nextOrObserver instanceof Subscriber.Subscriber) {
  35. return nextOrObserver;
  36. }
  37. if (nextOrObserver[rxSubscriber.rxSubscriber]) {
  38. return nextOrObserver[rxSubscriber.rxSubscriber]();
  39. }
  40. }
  41. if (!nextOrObserver && !error && !complete) {
  42. return new Subscriber.Subscriber(empty);
  43. }
  44. return new Subscriber.Subscriber(nextOrObserver, error, complete);
  45. }
  46. var patchObservable = function () {
  47. var ObservablePrototype = Observable.Observable.prototype;
  48. var symbolSubscribe = symbol('subscribe');
  49. var _symbolSubscribe = symbol('_subscribe');
  50. var _subscribe = ObservablePrototype[_symbolSubscribe] = ObservablePrototype._subscribe;
  51. var subscribe = ObservablePrototype[symbolSubscribe] = ObservablePrototype.subscribe;
  52. ObjectDefineProperties(Observable.Observable.prototype, {
  53. _zone: { value: null, writable: true, configurable: true },
  54. _zoneSource: { value: null, writable: true, configurable: true },
  55. _zoneSubscribe: { value: null, writable: true, configurable: true },
  56. source: {
  57. configurable: true,
  58. get: function () {
  59. return this._zoneSource;
  60. },
  61. set: function (source) {
  62. this._zone = Zone.current;
  63. this._zoneSource = source;
  64. }
  65. },
  66. _subscribe: {
  67. configurable: true,
  68. get: function () {
  69. if (this._zoneSubscribe) {
  70. return this._zoneSubscribe;
  71. }
  72. else if (this.constructor === Observable.Observable) {
  73. return _subscribe;
  74. }
  75. var proto = Object.getPrototypeOf(this);
  76. return proto && proto._subscribe;
  77. },
  78. set: function (subscribe) {
  79. this._zone = Zone.current;
  80. this._zoneSubscribe = subscribe;
  81. }
  82. },
  83. subscribe: {
  84. writable: true,
  85. configurable: true,
  86. value: function (observerOrNext, error, complete) {
  87. // Only grab a zone if we Zone exists and it is different from the current zone.
  88. var _zone = this._zone;
  89. if (_zone && _zone !== Zone.current) {
  90. // Current Zone is different from the intended zone.
  91. // Restore the zone before invoking the subscribe callback.
  92. return _zone.run(subscribe, this, [toSubscriber(observerOrNext, error, complete)]);
  93. }
  94. return subscribe.call(this, observerOrNext, error, complete);
  95. }
  96. }
  97. });
  98. };
  99. var patchSubscription = function () {
  100. var unsubscribeSymbol = symbol('unsubscribe');
  101. var unsubscribe = Subscription.Subscription.prototype[unsubscribeSymbol] =
  102. Subscription.Subscription.prototype.unsubscribe;
  103. ObjectDefineProperties(Subscription.Subscription.prototype, {
  104. _zone: { value: null, writable: true, configurable: true },
  105. _zoneUnsubscribe: { value: null, writable: true, configurable: true },
  106. _unsubscribe: {
  107. get: function () {
  108. if (this._zoneUnsubscribe) {
  109. return this._zoneUnsubscribe;
  110. }
  111. var proto = Object.getPrototypeOf(this);
  112. return proto && proto._unsubscribe;
  113. },
  114. set: function (unsubscribe) {
  115. this._zone = Zone.current;
  116. this._zoneUnsubscribe = unsubscribe;
  117. }
  118. },
  119. unsubscribe: {
  120. writable: true,
  121. configurable: true,
  122. value: function () {
  123. // Only grab a zone if we Zone exists and it is different from the current zone.
  124. var _zone = this._zone;
  125. if (_zone && _zone !== Zone.current) {
  126. // Current Zone is different from the intended zone.
  127. // Restore the zone before invoking the subscribe callback.
  128. _zone.run(unsubscribe, this);
  129. }
  130. else {
  131. unsubscribe.apply(this);
  132. }
  133. }
  134. }
  135. });
  136. };
  137. var patchSubscriber = function () {
  138. var next = Subscriber.Subscriber.prototype.next;
  139. var error = Subscriber.Subscriber.prototype.error;
  140. var complete = Subscriber.Subscriber.prototype.complete;
  141. Object.defineProperty(Subscriber.Subscriber.prototype, 'destination', {
  142. configurable: true,
  143. get: function () {
  144. return this._zoneDestination;
  145. },
  146. set: function (destination) {
  147. this._zone = Zone.current;
  148. this._zoneDestination = destination;
  149. }
  150. });
  151. // patch Subscriber.next to make sure it run
  152. // into SubscriptionZone
  153. Subscriber.Subscriber.prototype.next = function () {
  154. var currentZone = Zone.current;
  155. var subscriptionZone = this._zone;
  156. // for performance concern, check Zone.current
  157. // equal with this._zone(SubscriptionZone) or not
  158. if (subscriptionZone && subscriptionZone !== currentZone) {
  159. return subscriptionZone.run(next, this, arguments, nextSource);
  160. }
  161. else {
  162. return next.apply(this, arguments);
  163. }
  164. };
  165. Subscriber.Subscriber.prototype.error = function () {
  166. var currentZone = Zone.current;
  167. var subscriptionZone = this._zone;
  168. // for performance concern, check Zone.current
  169. // equal with this._zone(SubscriptionZone) or not
  170. if (subscriptionZone && subscriptionZone !== currentZone) {
  171. return subscriptionZone.run(error, this, arguments, errorSource);
  172. }
  173. else {
  174. return error.apply(this, arguments);
  175. }
  176. };
  177. Subscriber.Subscriber.prototype.complete = function () {
  178. var currentZone = Zone.current;
  179. var subscriptionZone = this._zone;
  180. // for performance concern, check Zone.current
  181. // equal with this._zone(SubscriptionZone) or not
  182. if (subscriptionZone && subscriptionZone !== currentZone) {
  183. return subscriptionZone.run(complete, this, arguments, completeSource);
  184. }
  185. else {
  186. return complete.apply(this, arguments);
  187. }
  188. };
  189. };
  190. var patchObservableInstance = function (observable) {
  191. observable._zone = Zone.current;
  192. };
  193. var patchObservableFactoryCreator = function (obj, factoryName) {
  194. var symbolFactory = symbol(factoryName);
  195. if (obj[symbolFactory]) {
  196. return;
  197. }
  198. var factoryCreator = obj[symbolFactory] = obj[factoryName];
  199. if (!factoryCreator) {
  200. return;
  201. }
  202. obj[factoryName] = function () {
  203. var factory = factoryCreator.apply(this, arguments);
  204. return function () {
  205. var observable = factory.apply(this, arguments);
  206. patchObservableInstance(observable);
  207. return observable;
  208. };
  209. };
  210. };
  211. var patchObservableFactory = function (obj, factoryName) {
  212. var symbolFactory = symbol(factoryName);
  213. if (obj[symbolFactory]) {
  214. return;
  215. }
  216. var factory = obj[symbolFactory] = obj[factoryName];
  217. if (!factory) {
  218. return;
  219. }
  220. obj[factoryName] = function () {
  221. var observable = factory.apply(this, arguments);
  222. patchObservableInstance(observable);
  223. return observable;
  224. };
  225. };
  226. var patchObservableFactoryArgs = function (obj, factoryName) {
  227. var symbolFactory = symbol(factoryName);
  228. if (obj[symbolFactory]) {
  229. return;
  230. }
  231. var factory = obj[symbolFactory] = obj[factoryName];
  232. if (!factory) {
  233. return;
  234. }
  235. obj[factoryName] = function () {
  236. var initZone = Zone.current;
  237. var args = Array.prototype.slice.call(arguments);
  238. var _loop_1 = function (i) {
  239. var arg = args[i];
  240. if (typeof arg === 'function') {
  241. args[i] = function () {
  242. var argArgs = Array.prototype.slice.call(arguments);
  243. var runningZone = Zone.current;
  244. if (initZone && runningZone && initZone !== runningZone) {
  245. return initZone.run(arg, this, argArgs);
  246. }
  247. else {
  248. return arg.apply(this, argArgs);
  249. }
  250. };
  251. }
  252. };
  253. for (var i = 0; i < args.length; i++) {
  254. _loop_1(i);
  255. }
  256. var observable = factory.apply(this, args);
  257. patchObservableInstance(observable);
  258. return observable;
  259. };
  260. };
  261. var patchMulticast = function () {
  262. var obj = Observable.Observable.prototype;
  263. var factoryName = 'multicast';
  264. var symbolFactory = symbol(factoryName);
  265. if (obj[symbolFactory]) {
  266. return;
  267. }
  268. var factory = obj[symbolFactory] = obj[factoryName];
  269. if (!factory) {
  270. return;
  271. }
  272. obj[factoryName] = function () {
  273. var _zone = Zone.current;
  274. var args = Array.prototype.slice.call(arguments);
  275. var subjectOrSubjectFactory = args.length > 0 ? args[0] : undefined;
  276. if (typeof subjectOrSubjectFactory !== 'function') {
  277. var originalFactory_1 = subjectOrSubjectFactory;
  278. subjectOrSubjectFactory = function () {
  279. return originalFactory_1;
  280. };
  281. }
  282. args[0] = function () {
  283. var subject;
  284. if (_zone && _zone !== Zone.current) {
  285. subject = _zone.run(subjectOrSubjectFactory, this, arguments);
  286. }
  287. else {
  288. subject = subjectOrSubjectFactory.apply(this, arguments);
  289. }
  290. if (subject && _zone) {
  291. subject._zone = _zone;
  292. }
  293. return subject;
  294. };
  295. var observable = factory.apply(this, args);
  296. patchObservableInstance(observable);
  297. return observable;
  298. };
  299. };
  300. var patchImmediate = function (asap$$1) {
  301. if (!asap$$1) {
  302. return;
  303. }
  304. var scheduleSymbol = symbol('scheduleSymbol');
  305. var zoneSymbol = symbol('zone');
  306. if (asap$$1[scheduleSymbol]) {
  307. return;
  308. }
  309. var schedule = asap$$1[scheduleSymbol] = asap$$1.schedule;
  310. asap$$1.schedule = function () {
  311. var args = Array.prototype.slice.call(arguments);
  312. var work = args.length > 0 ? args[0] : undefined;
  313. var delay = args.length > 1 ? args[1] : 0;
  314. var state = (args.length > 2 ? args[2] : undefined) || {};
  315. state[zoneSymbol] = Zone.current;
  316. var patchedWork = function () {
  317. var workArgs = Array.prototype.slice.call(arguments);
  318. var action = workArgs.length > 0 ? workArgs[0] : undefined;
  319. var scheduleZone = action && action[zoneSymbol];
  320. if (scheduleZone && scheduleZone !== Zone.current) {
  321. return scheduleZone.runGuarded(work, this, arguments);
  322. }
  323. else {
  324. return work.apply(this, arguments);
  325. }
  326. };
  327. return schedule.call(this, patchedWork, delay, state);
  328. };
  329. };
  330. patchObservable();
  331. patchSubscription();
  332. patchSubscriber();
  333. patchObservableFactoryCreator(Observable.Observable, 'bindCallback');
  334. patchObservableFactoryCreator(Observable.Observable, 'bindNodeCallback');
  335. patchObservableFactory(Observable.Observable, 'defer');
  336. patchObservableFactory(Observable.Observable, 'forkJoin');
  337. patchObservableFactoryArgs(Observable.Observable, 'fromEventPattern');
  338. patchMulticast();
  339. patchImmediate(asap.asap);
  340. });
  341. })));