@flarehr/apollo-benefits 0.1.106 → 0.3.53396

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/README.md +19 -0
  2. package/dist/assets/@splitsoftware-7d799540.js +18 -0
  3. package/dist/assets/all_tab_color-548783b9.svg +21 -0
  4. package/dist/assets/all_tab_gray-a5051313.svg +6 -0
  5. package/dist/assets/check-57fe1dcb.svg +15 -0
  6. package/dist/assets/datadog-c7ede347.js +5 -0
  7. package/dist/assets/date-fns-c5d8fbc0.js +1 -0
  8. package/dist/assets/default_backdrop-fdd955b8.png +0 -0
  9. package/dist/assets/external_link-599a0aec.svg +3 -0
  10. package/dist/assets/external_link_white-55111b2e.svg +3 -0
  11. package/dist/assets/framer-motion-bb8d6b82.js +1 -0
  12. package/dist/assets/index-87923fdc.js +35 -0
  13. package/dist/assets/index-cfa25e28.css +1 -0
  14. package/dist/assets/index-ee9d2045.js +5 -0
  15. package/dist/assets/lodash-5d893f8c.js +1 -0
  16. package/dist/assets/logo-a34e9b4b.png +0 -0
  17. package/dist/assets/oidc-client-6f6e47c2.js +101 -0
  18. package/dist/assets/padlock-8c081120.svg +26 -0
  19. package/dist/assets/suitcase-6471ad05.svg +17 -0
  20. package/dist/assets/vendor-2d0139ca.js +788 -0
  21. package/dist/assets/warning-a7f1af23.svg +14 -0
  22. package/dist/assets/welcome_image_mobile-dbde6c80.png +0 -0
  23. package/dist/assets/welcome_image_v2-869c59e4.png +0 -0
  24. package/dist/assets/wellbeing_banner-6903d615.png +0 -0
  25. package/dist/assets/workplace_link_banner_mobile-6ebaa24b.png +0 -0
  26. package/dist/assets/workplace_link_banner_v2-c81ed849.png +0 -0
  27. package/dist/config.json +14 -0
  28. package/dist/favicon.ico +0 -0
  29. package/dist/icons/android-chrome-192x192.png +0 -0
  30. package/dist/icons/android-chrome-512x512.png +0 -0
  31. package/dist/icons/apple-touch-icon.png +0 -0
  32. package/dist/icons/favicon-16x16.png +0 -0
  33. package/dist/icons/favicon-32x32.png +0 -0
  34. package/dist/index.html +114 -0
  35. package/dist/manifest.json +21 -0
  36. package/dist/sw-esm.js +16 -0
  37. package/package.json +129 -60
  38. package/LICENSE +0 -21
  39. package/dist/lib/apollo-benefits/apollo-benefits.esm.js +0 -1
  40. package/dist/lib/apollo-benefits/assets/car-placeholder.svg +0 -5
  41. package/dist/lib/apollo-benefits/assets/check.svg +0 -13
  42. package/dist/lib/apollo-benefits/index.esm.js +0 -0
  43. package/dist/lib/apollo-benefits/p-06a1f65f.js +0 -1
  44. package/dist/lib/apollo-benefits/p-077d7f8d.entry.js +0 -1
  45. package/dist/lib/apollo-benefits/p-0a21a709.entry.js +0 -1
  46. package/dist/lib/apollo-benefits/p-14054f15.js +0 -1
  47. package/dist/lib/apollo-benefits/p-24a37d64.js +0 -1
  48. package/dist/lib/apollo-benefits/p-2b3f3b72.entry.js +0 -1
  49. package/dist/lib/apollo-benefits/p-3111d565.entry.js +0 -1
  50. package/dist/lib/apollo-benefits/p-327396fa.entry.js +0 -1
  51. package/dist/lib/apollo-benefits/p-3af26279.entry.js +0 -1
  52. package/dist/lib/apollo-benefits/p-3d4d2683.js +0 -1
  53. package/dist/lib/apollo-benefits/p-4474bcf8.entry.js +0 -1
  54. package/dist/lib/apollo-benefits/p-50fe790f.js +0 -1
  55. package/dist/lib/apollo-benefits/p-53bcbd1d.js +0 -1
  56. package/dist/lib/apollo-benefits/p-64a2b03a.entry.js +0 -1
  57. package/dist/lib/apollo-benefits/p-68c136da.js +0 -1
  58. package/dist/lib/apollo-benefits/p-6bd16f5b.js +0 -1
  59. package/dist/lib/apollo-benefits/p-71dbc8ff.entry.js +0 -1
  60. package/dist/lib/apollo-benefits/p-774d9bc5.entry.js +0 -1
  61. package/dist/lib/apollo-benefits/p-7a2ca86d.entry.js +0 -1
  62. package/dist/lib/apollo-benefits/p-7a572b50.js +0 -1
  63. package/dist/lib/apollo-benefits/p-7c2cd94a.entry.js +0 -1
  64. package/dist/lib/apollo-benefits/p-839493d7.entry.js +0 -1
  65. package/dist/lib/apollo-benefits/p-acf61bdc.js +0 -1
  66. package/dist/lib/apollo-benefits/p-b33fc683.js +0 -1
  67. package/dist/lib/apollo-benefits/p-beb8f728.entry.js +0 -1
  68. package/dist/lib/apollo-benefits/p-d7bea1d9.entry.js +0 -1
  69. package/dist/lib/apollo-benefits/p-ddb176cb.entry.js +0 -1
  70. package/dist/lib/apollo-benefits/p-e241f55b.entry.js +0 -1
  71. package/dist/lib/apollo-benefits/p-ef8ea713.entry.js +0 -1
  72. package/dist/lib/apollo-benefits/p-f603197d.js +0 -15
  73. package/dist/lib/cjs/active-router-0ecaf2b8.js +0 -75
  74. package/dist/lib/cjs/ap-ben-choose-vehicle-section_4.cjs.entry.js +0 -2684
  75. package/dist/lib/cjs/ap-ben-complete-section_4.cjs.entry.js +0 -108
  76. package/dist/lib/cjs/ap-ben-notifications-section.cjs.entry.js +0 -238
  77. package/dist/lib/cjs/apollo-benefits.cjs.js +0 -25
  78. package/dist/lib/cjs/app-globals-67583b8b.js +0 -12
  79. package/dist/lib/cjs/async-6a7926f0.js +0 -753
  80. package/dist/lib/cjs/cars-calculator-app.cjs.entry.js +0 -52
  81. package/dist/lib/cjs/cars-calculator.service-11b0cd88.js +0 -901
  82. package/dist/lib/cjs/context-consumer.cjs.entry.js +0 -29
  83. package/dist/lib/cjs/datorama-akita-31d23240.js +0 -2551
  84. package/dist/lib/cjs/delay-d31618c3.js +0 -206
  85. package/dist/lib/cjs/distinctUntilChanged-e8538790.js +0 -371
  86. package/dist/lib/cjs/dom-utils-b8befdd5.js +0 -63
  87. package/dist/lib/cjs/fl-button.cjs.entry.js +0 -30
  88. package/dist/lib/cjs/fl-dropdown-async_2.cjs.entry.js +0 -467
  89. package/dist/lib/cjs/fl-dropdown.cjs.entry.js +0 -232
  90. package/dist/lib/cjs/fl-loading-indicator.cjs.entry.js +0 -26
  91. package/dist/lib/cjs/fl-style-guide.cjs.entry.js +0 -91
  92. package/dist/lib/cjs/index-f1fadf90.js +0 -1735
  93. package/dist/lib/cjs/index.cjs.js +0 -2
  94. package/dist/lib/cjs/loader.cjs.js +0 -27
  95. package/dist/lib/cjs/location-utils-36fe7e5e.js +0 -237
  96. package/dist/lib/cjs/match-path-be4ea5f6.js +0 -279
  97. package/dist/lib/cjs/session.query-d61ba7ec.js +0 -1731
  98. package/dist/lib/cjs/stencil-async-content.cjs.entry.js +0 -32
  99. package/dist/lib/cjs/stencil-route-link.cjs.entry.js +0 -78
  100. package/dist/lib/cjs/stencil-route-switch.cjs.entry.js +0 -104
  101. package/dist/lib/cjs/stencil-route-title.cjs.entry.js +0 -32
  102. package/dist/lib/cjs/stencil-route.cjs.entry.js +0 -97
  103. package/dist/lib/cjs/stencil-router-prompt.cjs.entry.js +0 -59
  104. package/dist/lib/cjs/stencil-router-redirect.cjs.entry.js +0 -32
  105. package/dist/lib/cjs/stencil-router.cjs.entry.js +0 -640
  106. package/dist/lib/collection/assets/image/complete.svg +0 -122
  107. package/dist/lib/collection/collection-manifest.json +0 -53
  108. package/dist/lib/collection/components/cars-calculator-app/api/api-client.js +0 -5
  109. package/dist/lib/collection/components/cars-calculator-app/api/cars-calculator.api.js +0 -45
  110. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.css +0 -22
  111. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.js +0 -93
  112. package/dist/lib/collection/components/cars-calculator-app/modal-section/modal-section.css +0 -0
  113. package/dist/lib/collection/components/cars-calculator-app/modal-section/modal-section.js +0 -144
  114. package/dist/lib/collection/components/cars-calculator-app/notifications-section/notifications-section.js +0 -25
  115. package/dist/lib/collection/components/cars-calculator-app/pages/assets/car-placeholder.svg +0 -5
  116. package/dist/lib/collection/components/cars-calculator-app/pages/assets/check.svg +0 -13
  117. package/dist/lib/collection/components/cars-calculator-app/pages/choose-vehicle-section.component.js +0 -193
  118. package/dist/lib/collection/components/cars-calculator-app/pages/complete-section.component.js +0 -38
  119. package/dist/lib/collection/components/cars-calculator-app/pages/cost-breakdown-section.component.js +0 -47
  120. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.css +0 -34
  121. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.js +0 -64
  122. package/dist/lib/collection/components/cars-calculator-app/pages/personal-info-section.component.js +0 -66
  123. package/dist/lib/collection/components/cars-calculator-app/pages/quote-result-section.component.js +0 -86
  124. package/dist/lib/collection/components/cars-calculator-app/pages/submit-quote-section.component.js +0 -75
  125. package/dist/lib/collection/components/cars-calculator-app/services/app-configuration.service.js +0 -13
  126. package/dist/lib/collection/components/cars-calculator-app/services/cars-calculator.service.js +0 -103
  127. package/dist/lib/collection/components/cars-calculator-app/services/notifications.service.js +0 -37
  128. package/dist/lib/collection/components/cars-calculator-app/services/notifications.store.js +0 -3
  129. package/dist/lib/collection/components/cars-calculator-app/services/session.query.js +0 -35
  130. package/dist/lib/collection/components/cars-calculator-app/services/session.store.js +0 -78
  131. package/dist/lib/collection/global/config.js +0 -2
  132. package/dist/lib/collection/global/main.dev.js +0 -5
  133. package/dist/lib/collection/global/main.js +0 -5
  134. package/dist/lib/collection/index.js +0 -2
  135. package/dist/lib/collection/utils/config.js +0 -2
  136. package/dist/lib/collection/utils/index.js +0 -15
  137. package/dist/lib/collection/utils/lazy.js +0 -29
  138. package/dist/lib/esm/active-router-7c2ca849.js +0 -73
  139. package/dist/lib/esm/ap-ben-choose-vehicle-section_4.entry.js +0 -2677
  140. package/dist/lib/esm/ap-ben-complete-section_4.entry.js +0 -101
  141. package/dist/lib/esm/ap-ben-notifications-section.entry.js +0 -234
  142. package/dist/lib/esm/apollo-benefits.js +0 -23
  143. package/dist/lib/esm/app-globals-65714cca.js +0 -10
  144. package/dist/lib/esm/async-68e9cad7.js +0 -738
  145. package/dist/lib/esm/cars-calculator-app.entry.js +0 -48
  146. package/dist/lib/esm/cars-calculator.service-2cde6288.js +0 -894
  147. package/dist/lib/esm/context-consumer.entry.js +0 -25
  148. package/dist/lib/esm/datorama-akita-c87196a0.js +0 -2545
  149. package/dist/lib/esm/delay-115d4292.js +0 -200
  150. package/dist/lib/esm/distinctUntilChanged-bf69e0f8.js +0 -363
  151. package/dist/lib/esm/dom-utils-109a7d75.js +0 -55
  152. package/dist/lib/esm/fl-button.entry.js +0 -26
  153. package/dist/lib/esm/fl-dropdown-async_2.entry.js +0 -462
  154. package/dist/lib/esm/fl-dropdown.entry.js +0 -228
  155. package/dist/lib/esm/fl-loading-indicator.entry.js +0 -22
  156. package/dist/lib/esm/fl-style-guide.entry.js +0 -87
  157. package/dist/lib/esm/index-19c4d245.js +0 -1703
  158. package/dist/lib/esm/index.js +0 -1
  159. package/dist/lib/esm/loader.js +0 -23
  160. package/dist/lib/esm/location-utils-312665d3.js +0 -226
  161. package/dist/lib/esm/match-path-4b5c7d98.js +0 -276
  162. package/dist/lib/esm/polyfills/core-js.js +0 -11
  163. package/dist/lib/esm/polyfills/css-shim.js +0 -1
  164. package/dist/lib/esm/polyfills/dom.js +0 -79
  165. package/dist/lib/esm/polyfills/es5-html-element.js +0 -1
  166. package/dist/lib/esm/polyfills/index.js +0 -34
  167. package/dist/lib/esm/polyfills/system.js +0 -6
  168. package/dist/lib/esm/session.query-0f1c9503.js +0 -1719
  169. package/dist/lib/esm/stencil-async-content.entry.js +0 -28
  170. package/dist/lib/esm/stencil-route-link.entry.js +0 -74
  171. package/dist/lib/esm/stencil-route-switch.entry.js +0 -100
  172. package/dist/lib/esm/stencil-route-title.entry.js +0 -28
  173. package/dist/lib/esm/stencil-route.entry.js +0 -93
  174. package/dist/lib/esm/stencil-router-prompt.entry.js +0 -55
  175. package/dist/lib/esm/stencil-router-redirect.entry.js +0 -28
  176. package/dist/lib/esm/stencil-router.entry.js +0 -636
  177. package/dist/lib/index.cjs.js +0 -1
  178. package/dist/lib/index.js +0 -1
  179. package/dist/lib/loader/cdn.js +0 -3
  180. package/dist/lib/loader/index.cjs.js +0 -3
  181. package/dist/lib/loader/index.d.ts +0 -13
  182. package/dist/lib/loader/index.es2017.js +0 -3
  183. package/dist/lib/loader/index.js +0 -4
  184. package/dist/lib/loader/package.json +0 -10
  185. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/button/button.css +0 -45
  186. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown/dropdown.css +0 -9
  187. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown-async/dropdown-async.css +0 -9
  188. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/loading-indicator/loading-indicator.css +0 -141
  189. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/promise-button/promise-button.css +0 -5
  190. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/style-guide/style-guide.css +0 -0
  191. package/dist/lib/node_modules/@stencil/router/dist/collection/components/route/route.css +0 -3
  192. package/dist/lib/types/components/cars-calculator-app/api/api-client.d.ts +0 -2
  193. package/dist/lib/types/components/cars-calculator-app/api/cars-calculator.api.d.ts +0 -96
  194. package/dist/lib/types/components/cars-calculator-app/cars-calculator-app.d.ts +0 -15
  195. package/dist/lib/types/components/cars-calculator-app/modal-section/modal-section.d.ts +0 -16
  196. package/dist/lib/types/components/cars-calculator-app/notifications-section/notifications-section.d.ts +0 -5
  197. package/dist/lib/types/components/cars-calculator-app/pages/choose-vehicle-section.component.d.ts +0 -23
  198. package/dist/lib/types/components/cars-calculator-app/pages/complete-section.component.d.ts +0 -5
  199. package/dist/lib/types/components/cars-calculator-app/pages/cost-breakdown-section.component.d.ts +0 -6
  200. package/dist/lib/types/components/cars-calculator-app/pages/model-variants-section.component.d.ts +0 -12
  201. package/dist/lib/types/components/cars-calculator-app/pages/personal-info-section.component.d.ts +0 -10
  202. package/dist/lib/types/components/cars-calculator-app/pages/quote-result-section.component.d.ts +0 -13
  203. package/dist/lib/types/components/cars-calculator-app/pages/submit-quote-section.component.d.ts +0 -10
  204. package/dist/lib/types/components/cars-calculator-app/services/app-configuration.service.d.ts +0 -7
  205. package/dist/lib/types/components/cars-calculator-app/services/cars-calculator.service.d.ts +0 -11
  206. package/dist/lib/types/components/cars-calculator-app/services/notifications.service.d.ts +0 -15
  207. package/dist/lib/types/components/cars-calculator-app/services/notifications.store.d.ts +0 -14
  208. package/dist/lib/types/components/cars-calculator-app/services/session.query.d.ts +0 -25
  209. package/dist/lib/types/components/cars-calculator-app/services/session.store.d.ts +0 -74
  210. package/dist/lib/types/components.d.ts +0 -170
  211. package/dist/lib/types/global/config.d.ts +0 -2
  212. package/dist/lib/types/global/main.d.ts +0 -1
  213. package/dist/lib/types/global/main.dev.d.ts +0 -1
  214. package/dist/lib/types/index.d.ts +0 -2
  215. package/dist/lib/types/stencil-public-runtime.d.ts +0 -1555
  216. package/dist/lib/types/utils/config.d.ts +0 -2
  217. package/dist/lib/types/utils/index.d.ts +0 -7
  218. package/dist/lib/types/utils/lazy.d.ts +0 -12
  219. package/readme.md +0 -1
@@ -1,738 +0,0 @@
1
- function isFunction(x) {
2
- return typeof x === 'function';
3
- }
4
-
5
- let _enable_super_gross_mode_that_will_cause_bad_things = false;
6
- const config = {
7
- Promise: undefined,
8
- set useDeprecatedSynchronousErrorHandling(value) {
9
- if (value) {
10
- const error = new Error();
11
- console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
12
- }
13
- else if (_enable_super_gross_mode_that_will_cause_bad_things) {
14
- console.log('RxJS: Back to a better error behavior. Thank you. <3');
15
- }
16
- _enable_super_gross_mode_that_will_cause_bad_things = value;
17
- },
18
- get useDeprecatedSynchronousErrorHandling() {
19
- return _enable_super_gross_mode_that_will_cause_bad_things;
20
- },
21
- };
22
-
23
- function hostReportError(err) {
24
- setTimeout(() => { throw err; }, 0);
25
- }
26
-
27
- const empty = {
28
- closed: true,
29
- next(value) { },
30
- error(err) {
31
- if (config.useDeprecatedSynchronousErrorHandling) {
32
- throw err;
33
- }
34
- else {
35
- hostReportError(err);
36
- }
37
- },
38
- complete() { }
39
- };
40
-
41
- const isArray = (() => Array.isArray || ((x) => x && typeof x.length === 'number'))();
42
-
43
- function isObject(x) {
44
- return x !== null && typeof x === 'object';
45
- }
46
-
47
- const UnsubscriptionErrorImpl = (() => {
48
- function UnsubscriptionErrorImpl(errors) {
49
- Error.call(this);
50
- this.message = errors ?
51
- `${errors.length} errors occurred during unsubscription:
52
- ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : '';
53
- this.name = 'UnsubscriptionError';
54
- this.errors = errors;
55
- return this;
56
- }
57
- UnsubscriptionErrorImpl.prototype = Object.create(Error.prototype);
58
- return UnsubscriptionErrorImpl;
59
- })();
60
- const UnsubscriptionError = UnsubscriptionErrorImpl;
61
-
62
- class Subscription {
63
- constructor(unsubscribe) {
64
- this.closed = false;
65
- this._parentOrParents = null;
66
- this._subscriptions = null;
67
- if (unsubscribe) {
68
- this._ctorUnsubscribe = true;
69
- this._unsubscribe = unsubscribe;
70
- }
71
- }
72
- unsubscribe() {
73
- let errors;
74
- if (this.closed) {
75
- return;
76
- }
77
- let { _parentOrParents, _ctorUnsubscribe, _unsubscribe, _subscriptions } = this;
78
- this.closed = true;
79
- this._parentOrParents = null;
80
- this._subscriptions = null;
81
- if (_parentOrParents instanceof Subscription) {
82
- _parentOrParents.remove(this);
83
- }
84
- else if (_parentOrParents !== null) {
85
- for (let index = 0; index < _parentOrParents.length; ++index) {
86
- const parent = _parentOrParents[index];
87
- parent.remove(this);
88
- }
89
- }
90
- if (isFunction(_unsubscribe)) {
91
- if (_ctorUnsubscribe) {
92
- this._unsubscribe = undefined;
93
- }
94
- try {
95
- _unsubscribe.call(this);
96
- }
97
- catch (e) {
98
- errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
99
- }
100
- }
101
- if (isArray(_subscriptions)) {
102
- let index = -1;
103
- let len = _subscriptions.length;
104
- while (++index < len) {
105
- const sub = _subscriptions[index];
106
- if (isObject(sub)) {
107
- try {
108
- sub.unsubscribe();
109
- }
110
- catch (e) {
111
- errors = errors || [];
112
- if (e instanceof UnsubscriptionError) {
113
- errors = errors.concat(flattenUnsubscriptionErrors(e.errors));
114
- }
115
- else {
116
- errors.push(e);
117
- }
118
- }
119
- }
120
- }
121
- }
122
- if (errors) {
123
- throw new UnsubscriptionError(errors);
124
- }
125
- }
126
- add(teardown) {
127
- let subscription = teardown;
128
- if (!teardown) {
129
- return Subscription.EMPTY;
130
- }
131
- switch (typeof teardown) {
132
- case 'function':
133
- subscription = new Subscription(teardown);
134
- case 'object':
135
- if (subscription === this || subscription.closed || typeof subscription.unsubscribe !== 'function') {
136
- return subscription;
137
- }
138
- else if (this.closed) {
139
- subscription.unsubscribe();
140
- return subscription;
141
- }
142
- else if (!(subscription instanceof Subscription)) {
143
- const tmp = subscription;
144
- subscription = new Subscription();
145
- subscription._subscriptions = [tmp];
146
- }
147
- break;
148
- default: {
149
- throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
150
- }
151
- }
152
- let { _parentOrParents } = subscription;
153
- if (_parentOrParents === null) {
154
- subscription._parentOrParents = this;
155
- }
156
- else if (_parentOrParents instanceof Subscription) {
157
- if (_parentOrParents === this) {
158
- return subscription;
159
- }
160
- subscription._parentOrParents = [_parentOrParents, this];
161
- }
162
- else if (_parentOrParents.indexOf(this) === -1) {
163
- _parentOrParents.push(this);
164
- }
165
- else {
166
- return subscription;
167
- }
168
- const subscriptions = this._subscriptions;
169
- if (subscriptions === null) {
170
- this._subscriptions = [subscription];
171
- }
172
- else {
173
- subscriptions.push(subscription);
174
- }
175
- return subscription;
176
- }
177
- remove(subscription) {
178
- const subscriptions = this._subscriptions;
179
- if (subscriptions) {
180
- const subscriptionIndex = subscriptions.indexOf(subscription);
181
- if (subscriptionIndex !== -1) {
182
- subscriptions.splice(subscriptionIndex, 1);
183
- }
184
- }
185
- }
186
- }
187
- Subscription.EMPTY = (function (empty) {
188
- empty.closed = true;
189
- return empty;
190
- }(new Subscription()));
191
- function flattenUnsubscriptionErrors(errors) {
192
- return errors.reduce((errs, err) => errs.concat((err instanceof UnsubscriptionError) ? err.errors : err), []);
193
- }
194
-
195
- const rxSubscriber = (() => typeof Symbol === 'function'
196
- ? Symbol('rxSubscriber')
197
- : '@@rxSubscriber_' + Math.random())();
198
-
199
- class Subscriber extends Subscription {
200
- constructor(destinationOrNext, error, complete) {
201
- super();
202
- this.syncErrorValue = null;
203
- this.syncErrorThrown = false;
204
- this.syncErrorThrowable = false;
205
- this.isStopped = false;
206
- switch (arguments.length) {
207
- case 0:
208
- this.destination = empty;
209
- break;
210
- case 1:
211
- if (!destinationOrNext) {
212
- this.destination = empty;
213
- break;
214
- }
215
- if (typeof destinationOrNext === 'object') {
216
- if (destinationOrNext instanceof Subscriber) {
217
- this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
218
- this.destination = destinationOrNext;
219
- destinationOrNext.add(this);
220
- }
221
- else {
222
- this.syncErrorThrowable = true;
223
- this.destination = new SafeSubscriber(this, destinationOrNext);
224
- }
225
- break;
226
- }
227
- default:
228
- this.syncErrorThrowable = true;
229
- this.destination = new SafeSubscriber(this, destinationOrNext, error, complete);
230
- break;
231
- }
232
- }
233
- [rxSubscriber]() { return this; }
234
- static create(next, error, complete) {
235
- const subscriber = new Subscriber(next, error, complete);
236
- subscriber.syncErrorThrowable = false;
237
- return subscriber;
238
- }
239
- next(value) {
240
- if (!this.isStopped) {
241
- this._next(value);
242
- }
243
- }
244
- error(err) {
245
- if (!this.isStopped) {
246
- this.isStopped = true;
247
- this._error(err);
248
- }
249
- }
250
- complete() {
251
- if (!this.isStopped) {
252
- this.isStopped = true;
253
- this._complete();
254
- }
255
- }
256
- unsubscribe() {
257
- if (this.closed) {
258
- return;
259
- }
260
- this.isStopped = true;
261
- super.unsubscribe();
262
- }
263
- _next(value) {
264
- this.destination.next(value);
265
- }
266
- _error(err) {
267
- this.destination.error(err);
268
- this.unsubscribe();
269
- }
270
- _complete() {
271
- this.destination.complete();
272
- this.unsubscribe();
273
- }
274
- _unsubscribeAndRecycle() {
275
- const { _parentOrParents } = this;
276
- this._parentOrParents = null;
277
- this.unsubscribe();
278
- this.closed = false;
279
- this.isStopped = false;
280
- this._parentOrParents = _parentOrParents;
281
- return this;
282
- }
283
- }
284
- class SafeSubscriber extends Subscriber {
285
- constructor(_parentSubscriber, observerOrNext, error, complete) {
286
- super();
287
- this._parentSubscriber = _parentSubscriber;
288
- let next;
289
- let context = this;
290
- if (isFunction(observerOrNext)) {
291
- next = observerOrNext;
292
- }
293
- else if (observerOrNext) {
294
- next = observerOrNext.next;
295
- error = observerOrNext.error;
296
- complete = observerOrNext.complete;
297
- if (observerOrNext !== empty) {
298
- context = Object.create(observerOrNext);
299
- if (isFunction(context.unsubscribe)) {
300
- this.add(context.unsubscribe.bind(context));
301
- }
302
- context.unsubscribe = this.unsubscribe.bind(this);
303
- }
304
- }
305
- this._context = context;
306
- this._next = next;
307
- this._error = error;
308
- this._complete = complete;
309
- }
310
- next(value) {
311
- if (!this.isStopped && this._next) {
312
- const { _parentSubscriber } = this;
313
- if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
314
- this.__tryOrUnsub(this._next, value);
315
- }
316
- else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
317
- this.unsubscribe();
318
- }
319
- }
320
- }
321
- error(err) {
322
- if (!this.isStopped) {
323
- const { _parentSubscriber } = this;
324
- const { useDeprecatedSynchronousErrorHandling } = config;
325
- if (this._error) {
326
- if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
327
- this.__tryOrUnsub(this._error, err);
328
- this.unsubscribe();
329
- }
330
- else {
331
- this.__tryOrSetError(_parentSubscriber, this._error, err);
332
- this.unsubscribe();
333
- }
334
- }
335
- else if (!_parentSubscriber.syncErrorThrowable) {
336
- this.unsubscribe();
337
- if (useDeprecatedSynchronousErrorHandling) {
338
- throw err;
339
- }
340
- hostReportError(err);
341
- }
342
- else {
343
- if (useDeprecatedSynchronousErrorHandling) {
344
- _parentSubscriber.syncErrorValue = err;
345
- _parentSubscriber.syncErrorThrown = true;
346
- }
347
- else {
348
- hostReportError(err);
349
- }
350
- this.unsubscribe();
351
- }
352
- }
353
- }
354
- complete() {
355
- if (!this.isStopped) {
356
- const { _parentSubscriber } = this;
357
- if (this._complete) {
358
- const wrappedComplete = () => this._complete.call(this._context);
359
- if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
360
- this.__tryOrUnsub(wrappedComplete);
361
- this.unsubscribe();
362
- }
363
- else {
364
- this.__tryOrSetError(_parentSubscriber, wrappedComplete);
365
- this.unsubscribe();
366
- }
367
- }
368
- else {
369
- this.unsubscribe();
370
- }
371
- }
372
- }
373
- __tryOrUnsub(fn, value) {
374
- try {
375
- fn.call(this._context, value);
376
- }
377
- catch (err) {
378
- this.unsubscribe();
379
- if (config.useDeprecatedSynchronousErrorHandling) {
380
- throw err;
381
- }
382
- else {
383
- hostReportError(err);
384
- }
385
- }
386
- }
387
- __tryOrSetError(parent, fn, value) {
388
- if (!config.useDeprecatedSynchronousErrorHandling) {
389
- throw new Error('bad call');
390
- }
391
- try {
392
- fn.call(this._context, value);
393
- }
394
- catch (err) {
395
- if (config.useDeprecatedSynchronousErrorHandling) {
396
- parent.syncErrorValue = err;
397
- parent.syncErrorThrown = true;
398
- return true;
399
- }
400
- else {
401
- hostReportError(err);
402
- return true;
403
- }
404
- }
405
- return false;
406
- }
407
- _unsubscribe() {
408
- const { _parentSubscriber } = this;
409
- this._context = null;
410
- this._parentSubscriber = null;
411
- _parentSubscriber.unsubscribe();
412
- }
413
- }
414
-
415
- function canReportError(observer) {
416
- while (observer) {
417
- const { closed, destination, isStopped } = observer;
418
- if (closed || isStopped) {
419
- return false;
420
- }
421
- else if (destination && destination instanceof Subscriber) {
422
- observer = destination;
423
- }
424
- else {
425
- observer = null;
426
- }
427
- }
428
- return true;
429
- }
430
-
431
- function toSubscriber(nextOrObserver, error, complete) {
432
- if (nextOrObserver) {
433
- if (nextOrObserver instanceof Subscriber) {
434
- return nextOrObserver;
435
- }
436
- if (nextOrObserver[rxSubscriber]) {
437
- return nextOrObserver[rxSubscriber]();
438
- }
439
- }
440
- if (!nextOrObserver && !error && !complete) {
441
- return new Subscriber(empty);
442
- }
443
- return new Subscriber(nextOrObserver, error, complete);
444
- }
445
-
446
- const observable = (() => typeof Symbol === 'function' && Symbol.observable || '@@observable')();
447
-
448
- function identity(x) {
449
- return x;
450
- }
451
-
452
- function pipeFromArray(fns) {
453
- if (fns.length === 0) {
454
- return identity;
455
- }
456
- if (fns.length === 1) {
457
- return fns[0];
458
- }
459
- return function piped(input) {
460
- return fns.reduce((prev, fn) => fn(prev), input);
461
- };
462
- }
463
-
464
- class Observable {
465
- constructor(subscribe) {
466
- this._isScalar = false;
467
- if (subscribe) {
468
- this._subscribe = subscribe;
469
- }
470
- }
471
- lift(operator) {
472
- const observable = new Observable();
473
- observable.source = this;
474
- observable.operator = operator;
475
- return observable;
476
- }
477
- subscribe(observerOrNext, error, complete) {
478
- const { operator } = this;
479
- const sink = toSubscriber(observerOrNext, error, complete);
480
- if (operator) {
481
- sink.add(operator.call(sink, this.source));
482
- }
483
- else {
484
- sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
485
- this._subscribe(sink) :
486
- this._trySubscribe(sink));
487
- }
488
- if (config.useDeprecatedSynchronousErrorHandling) {
489
- if (sink.syncErrorThrowable) {
490
- sink.syncErrorThrowable = false;
491
- if (sink.syncErrorThrown) {
492
- throw sink.syncErrorValue;
493
- }
494
- }
495
- }
496
- return sink;
497
- }
498
- _trySubscribe(sink) {
499
- try {
500
- return this._subscribe(sink);
501
- }
502
- catch (err) {
503
- if (config.useDeprecatedSynchronousErrorHandling) {
504
- sink.syncErrorThrown = true;
505
- sink.syncErrorValue = err;
506
- }
507
- if (canReportError(sink)) {
508
- sink.error(err);
509
- }
510
- else {
511
- console.warn(err);
512
- }
513
- }
514
- }
515
- forEach(next, promiseCtor) {
516
- promiseCtor = getPromiseCtor(promiseCtor);
517
- return new promiseCtor((resolve, reject) => {
518
- let subscription;
519
- subscription = this.subscribe((value) => {
520
- try {
521
- next(value);
522
- }
523
- catch (err) {
524
- reject(err);
525
- if (subscription) {
526
- subscription.unsubscribe();
527
- }
528
- }
529
- }, reject, resolve);
530
- });
531
- }
532
- _subscribe(subscriber) {
533
- const { source } = this;
534
- return source && source.subscribe(subscriber);
535
- }
536
- [observable]() {
537
- return this;
538
- }
539
- pipe(...operations) {
540
- if (operations.length === 0) {
541
- return this;
542
- }
543
- return pipeFromArray(operations)(this);
544
- }
545
- toPromise(promiseCtor) {
546
- promiseCtor = getPromiseCtor(promiseCtor);
547
- return new promiseCtor((resolve, reject) => {
548
- let value;
549
- this.subscribe((x) => value = x, (err) => reject(err), () => resolve(value));
550
- });
551
- }
552
- }
553
- Observable.create = (subscribe) => {
554
- return new Observable(subscribe);
555
- };
556
- function getPromiseCtor(promiseCtor) {
557
- if (!promiseCtor) {
558
- promiseCtor = Promise;
559
- }
560
- if (!promiseCtor) {
561
- throw new Error('no Promise impl found');
562
- }
563
- return promiseCtor;
564
- }
565
-
566
- class Action extends Subscription {
567
- constructor(scheduler, work) {
568
- super();
569
- }
570
- schedule(state, delay = 0) {
571
- return this;
572
- }
573
- }
574
-
575
- class AsyncAction extends Action {
576
- constructor(scheduler, work) {
577
- super(scheduler, work);
578
- this.scheduler = scheduler;
579
- this.work = work;
580
- this.pending = false;
581
- }
582
- schedule(state, delay = 0) {
583
- if (this.closed) {
584
- return this;
585
- }
586
- this.state = state;
587
- const id = this.id;
588
- const scheduler = this.scheduler;
589
- if (id != null) {
590
- this.id = this.recycleAsyncId(scheduler, id, delay);
591
- }
592
- this.pending = true;
593
- this.delay = delay;
594
- this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
595
- return this;
596
- }
597
- requestAsyncId(scheduler, id, delay = 0) {
598
- return setInterval(scheduler.flush.bind(scheduler, this), delay);
599
- }
600
- recycleAsyncId(scheduler, id, delay = 0) {
601
- if (delay !== null && this.delay === delay && this.pending === false) {
602
- return id;
603
- }
604
- clearInterval(id);
605
- return undefined;
606
- }
607
- execute(state, delay) {
608
- if (this.closed) {
609
- return new Error('executing a cancelled action');
610
- }
611
- this.pending = false;
612
- const error = this._execute(state, delay);
613
- if (error) {
614
- return error;
615
- }
616
- else if (this.pending === false && this.id != null) {
617
- this.id = this.recycleAsyncId(this.scheduler, this.id, null);
618
- }
619
- }
620
- _execute(state, delay) {
621
- let errored = false;
622
- let errorValue = undefined;
623
- try {
624
- this.work(state);
625
- }
626
- catch (e) {
627
- errored = true;
628
- errorValue = !!e && e || new Error(e);
629
- }
630
- if (errored) {
631
- this.unsubscribe();
632
- return errorValue;
633
- }
634
- }
635
- _unsubscribe() {
636
- const id = this.id;
637
- const scheduler = this.scheduler;
638
- const actions = scheduler.actions;
639
- const index = actions.indexOf(this);
640
- this.work = null;
641
- this.state = null;
642
- this.pending = false;
643
- this.scheduler = null;
644
- if (index !== -1) {
645
- actions.splice(index, 1);
646
- }
647
- if (id != null) {
648
- this.id = this.recycleAsyncId(scheduler, id, null);
649
- }
650
- this.delay = null;
651
- }
652
- }
653
-
654
- class Scheduler {
655
- constructor(SchedulerAction, now = Scheduler.now) {
656
- this.SchedulerAction = SchedulerAction;
657
- this.now = now;
658
- }
659
- schedule(work, delay = 0, state) {
660
- return new this.SchedulerAction(this, work).schedule(state, delay);
661
- }
662
- }
663
- Scheduler.now = () => Date.now();
664
-
665
- class AsyncScheduler extends Scheduler {
666
- constructor(SchedulerAction, now = Scheduler.now) {
667
- super(SchedulerAction, () => {
668
- if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
669
- return AsyncScheduler.delegate.now();
670
- }
671
- else {
672
- return now();
673
- }
674
- });
675
- this.actions = [];
676
- this.active = false;
677
- this.scheduled = undefined;
678
- }
679
- schedule(work, delay = 0, state) {
680
- if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
681
- return AsyncScheduler.delegate.schedule(work, delay, state);
682
- }
683
- else {
684
- return super.schedule(work, delay, state);
685
- }
686
- }
687
- flush(action) {
688
- const { actions } = this;
689
- if (this.active) {
690
- actions.push(action);
691
- return;
692
- }
693
- let error;
694
- this.active = true;
695
- do {
696
- if (error = action.execute(action.state, action.delay)) {
697
- break;
698
- }
699
- } while (action = actions.shift());
700
- this.active = false;
701
- if (error) {
702
- while (action = actions.shift()) {
703
- action.unsubscribe();
704
- }
705
- throw error;
706
- }
707
- }
708
- }
709
-
710
- const subscribeToArray = (array) => (subscriber) => {
711
- for (let i = 0, len = array.length; i < len && !subscriber.closed; i++) {
712
- subscriber.next(array[i]);
713
- }
714
- subscriber.complete();
715
- };
716
-
717
- function scheduleArray(input, scheduler) {
718
- return new Observable(subscriber => {
719
- const sub = new Subscription();
720
- let i = 0;
721
- sub.add(scheduler.schedule(function () {
722
- if (i === input.length) {
723
- subscriber.complete();
724
- return;
725
- }
726
- subscriber.next(input[i++]);
727
- if (!subscriber.closed) {
728
- sub.add(this.schedule());
729
- }
730
- }));
731
- return sub;
732
- });
733
- }
734
-
735
- const asyncScheduler = new AsyncScheduler(AsyncAction);
736
- const async = asyncScheduler;
737
-
738
- export { AsyncAction as A, Observable as O, Subscription as S, Subscriber as a, AsyncScheduler as b, scheduleArray as c, async as d, isArray as e, isFunction as f, hostReportError as h, isObject as i, observable as o, rxSubscriber as r, subscribeToArray as s };