@jsenv/core 27.0.0-alpha.64 → 27.0.0-alpha.65

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 (146) hide show
  1. package/dist/html/explorer.html +557 -0
  2. package/dist/js/controllable_file.mjs +227 -0
  3. package/dist/{event_source_client.js → js/event_source_client.js} +19 -244
  4. package/dist/js/global_this.js +32 -0
  5. package/dist/js/html_supervisor_installer.js +522 -0
  6. package/dist/js/html_supervisor_setup.js +79 -0
  7. package/dist/{import_meta_hot.js → js/import_meta_hot.js} +1 -3
  8. package/dist/js/inline_content.js +8 -0
  9. package/dist/js/new_stylesheet.js +409 -0
  10. package/dist/js/regenerator_runtime.js +721 -0
  11. package/dist/js/s.js +429 -0
  12. package/dist/main.js +13362 -0
  13. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/AsyncGenerator/AsyncGenerator.js +95 -0
  14. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/AwaitValue/AwaitValue.js +3 -0
  15. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/applyDecoratorDescriptor/applyDecoratorDescriptor.js +29 -0
  16. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/arrayLikeToArray/arrayLikeToArray.js +9 -0
  17. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/arrayWithHoles/arrayWithHoles.js +4 -0
  18. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/arrayWithoutHoles/arrayWithoutHoles.js +5 -0
  19. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/assertThisInitialized/assertThisInitialized.js +8 -0
  20. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/asyncGeneratorDelegate/asyncGeneratorDelegate.js +52 -0
  21. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/asyncIterator/asyncIterator.js +78 -0
  22. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/asyncToGenerator/asyncToGenerator.js +39 -0
  23. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/awaitAsyncGenerator/awaitAsyncGenerator.js +4 -0
  24. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +24 -0
  25. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classApplyDescriptorGet/classApplyDescriptorGet.js +7 -0
  26. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classApplyDescriptorSet/classApplyDescriptorSet.js +14 -0
  27. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classCallCheck/classCallCheck.js +5 -0
  28. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +5 -0
  29. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +6 -0
  30. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classExtractFieldDescriptor/classExtractFieldDescriptor.js +8 -0
  31. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classNameTDZError/classNameTDZError.js +4 -0
  32. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +6 -0
  33. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classPrivateFieldGet/classPrivateFieldGet.js +6 -0
  34. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +7 -0
  35. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +5 -0
  36. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classPrivateFieldSet/classPrivateFieldSet.js +7 -0
  37. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classPrivateMethodGet/classPrivateMethodGet.js +7 -0
  38. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classPrivateMethodSet/classPrivateMethodSet.js +3 -0
  39. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +8 -0
  40. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +9 -0
  41. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +5 -0
  42. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +3 -0
  43. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/construct/construct.js +15 -0
  44. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/createClass/createClass.js +18 -0
  45. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/createForOfIteratorHelper/createForOfIteratorHelper.js +63 -0
  46. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +22 -0
  47. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/createRawReactElement/createRawReactElement.js +50 -0
  48. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/createSuper/createSuper.js +22 -0
  49. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/decorate/decorate.js +622 -0
  50. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/defaults/defaults.js +14 -0
  51. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/defineEnumerableProperties/defineEnumerableProperties.js +26 -0
  52. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/defineProperty/defineProperty.js +19 -0
  53. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/extends/extends.js +16 -0
  54. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/get/get.js +21 -0
  55. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/getPrototypeOf/getPrototypeOf.js +2 -0
  56. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/inherits/inherits.js +21 -0
  57. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/inheritsLoose/inheritsLoose.js +6 -0
  58. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/initializerDefineProperty/initializerDefineProperty.js +10 -0
  59. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/initializerWarningHelper/initializerWarningHelper.js +3 -0
  60. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/instanceof/instanceof.js +7 -0
  61. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/interopRequireDefault/interopRequireDefault.js +5 -0
  62. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/interopRequireWildcard/interopRequireWildcard.js +49 -0
  63. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/isNativeFunction/isNativeFunction.js +4 -0
  64. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/isNativeReflectConstruct/isNativeReflectConstruct.js +21 -0
  65. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/iterableToArray/iterableToArray.js +3 -0
  66. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/iterableToArrayLimit/iterableToArrayLimit.js +38 -0
  67. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +13 -0
  68. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/jsx/jsx.js +49 -0
  69. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/maybeArrayLike/maybeArrayLike.js +10 -0
  70. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/newArrowCheck/newArrowCheck.js +5 -0
  71. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/nonIterableRest/nonIterableRest.js +3 -0
  72. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/nonIterableSpread/nonIterableSpread.js +3 -0
  73. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/objectDestructuringEmpty/objectDestructuringEmpty.js +3 -0
  74. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/objectSpread/objectSpread.js +22 -0
  75. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/objectSpread2/objectSpread2.js +41 -0
  76. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/objectWithoutProperties/objectWithoutProperties.js +20 -0
  77. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +15 -0
  78. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/possibleConstructorReturn/possibleConstructorReturn.js +10 -0
  79. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/readOnlyError/readOnlyError.js +4 -0
  80. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/readme.md +8 -0
  81. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/set/set.js +51 -0
  82. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/setPrototypeOf/setPrototypeOf.js +5 -0
  83. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/skipFirstGeneratorNext/skipFirstGeneratorNext.js +8 -0
  84. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/slicedToArray/slicedToArray.js +5 -0
  85. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/slicedToArrayLoose/slicedToArrayLoose.js +7 -0
  86. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/superPropBase/superPropBase.js +10 -0
  87. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/taggedTemplateLiteral/taggedTemplateLiteral.js +11 -0
  88. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +8 -0
  89. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/tdz/tdz.js +4 -0
  90. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/temporalRef/temporalRef.js +5 -0
  91. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/temporalUndefined/temporalUndefined.js +3 -0
  92. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/toArray/toArray.js +5 -0
  93. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/toConsumableArray/toConsumableArray.js +5 -0
  94. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/toPrimitive/toPrimitive.js +14 -0
  95. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/toPropertyKey/toPropertyKey.js +5 -0
  96. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/typeof/typeof.js +7 -0
  97. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/unsupportedIterableToArray/unsupportedIterableToArray.js +10 -0
  98. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/wrapAsyncGenerator/wrapAsyncGenerator.js +7 -0
  99. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/wrapNativeSuper/wrapNativeSuper.js +35 -0
  100. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/wrapRegExp/wrapRegExp.js +67 -0
  101. package/dist/node_modules/@jsenv/babel-plugins/src/babel_helpers/writeOnlyError/writeOnlyError.js +4 -0
  102. package/dist/other/jsenv.png +0 -0
  103. package/package.json +15 -11
  104. package/src/build/build.js +152 -67
  105. package/src/build/build_urls_generator.js +18 -2
  106. package/src/build/inject_service_worker_urls.js +1 -1
  107. package/src/build/resync_ressource_hints.js +56 -9
  108. package/src/dev/plugins/explorer/client/explorer.html +1 -1
  109. package/src/dev/start_dev_server.js +17 -3
  110. package/src/execute/execute.js +3 -0
  111. package/src/omega/errors.js +10 -7
  112. package/src/omega/kitchen.js +209 -216
  113. package/src/omega/url_graph/url_graph_report.js +2 -2
  114. package/src/omega/url_graph.js +1 -1
  115. package/src/plugins/autoreload/dev_sse/jsenv_plugin_dev_sse_client.js +5 -10
  116. package/src/plugins/autoreload/jsenv_plugin_autoreload.js +1 -3
  117. package/src/plugins/bundling/js_module/bundle_js_module.js +66 -24
  118. package/src/plugins/file_urls/jsenv_plugin_file_urls.js +171 -53
  119. package/src/plugins/html_supervisor/jsenv_plugin_html_supervisor.js +9 -13
  120. package/src/plugins/http_urls/jsenv_plugin_http_urls.js +6 -6
  121. package/src/plugins/import_meta_hot/jsenv_plugin_import_meta_hot.js +5 -10
  122. package/src/plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +12 -2
  123. package/src/plugins/node_runtime/jsenv_plugin_node_runtime.js +12 -0
  124. package/src/plugins/plugin_controller.js +17 -3
  125. package/src/plugins/plugins.js +16 -19
  126. package/src/plugins/transpilation/as_js_classic/jsenv_plugin_as_js_classic.js +7 -13
  127. package/src/plugins/transpilation/as_js_classic/{jsenv_plugin_script_type_module_as_classic.js → jsenv_plugin_as_js_classic_html.js} +0 -0
  128. package/src/plugins/transpilation/jsenv_plugin_transpilation.js +1 -2
  129. package/src/plugins/url_analysis/html/html_urls.js +3 -0
  130. package/src/plugins/url_analysis/js/js_urls.js +2 -1
  131. package/src/plugins/url_analysis/jsenv_plugin_url_analysis.js +87 -1
  132. package/src/plugins/url_analysis/webmanifest/webmanifest_urls.js +3 -0
  133. package/src/plugins/url_resolution/jsenv_plugin_url_resolution.js +0 -3
  134. package/src/test/execute_plan.js +2 -0
  135. package/dist/event_source_client.js.map +0 -188
  136. package/dist/html_supervisor_installer.js +0 -1236
  137. package/dist/html_supervisor_installer.js.map +0 -337
  138. package/dist/html_supervisor_setup.js +0 -95
  139. package/dist/html_supervisor_setup.js.map +0 -57
  140. package/dist/import_meta_hot.js.map +0 -42
  141. package/dist/s.js +0 -626
  142. package/dist/s.js.map +0 -207
  143. package/src/jsenv_root_directory_url.js +0 -1
  144. package/src/omega/compat/default_runtime_compat.js +0 -11
  145. package/src/plugins/filesystem_magic/jsenv_plugin_filesystem_magic.js +0 -61
  146. package/src/plugins/transpilation/babel/new_stylesheet/client/.eslintrc.cjs +0 -24
package/dist/s.js DELETED
@@ -1,626 +0,0 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define([], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory();
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory();
11
- global.s = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function () {
14
- "use strict";
15
-
16
- function _await(value, then, direct) {
17
- if (direct) {
18
- return then ? then(value) : value;
19
- }
20
-
21
- if (!value || !value.then) {
22
- value = Promise.resolve(value);
23
- }
24
-
25
- return then ? value.then(then) : value;
26
- }
27
-
28
- function _async(f) {
29
- return function () {
30
- for (var args = [], i = 0; i < arguments.length; i++) {
31
- args[i] = arguments[i];
32
- }
33
-
34
- try {
35
- return Promise.resolve(f.apply(this, args));
36
- } catch (e) {
37
- return Promise.reject(e);
38
- }
39
- };
40
- }
41
-
42
- function _empty() {}
43
-
44
- function _awaitIgnored(value, direct) {
45
- if (!direct) {
46
- return value && value.then ? value.then(_empty) : Promise.resolve();
47
- }
48
- }
49
-
50
- function _invoke(body, then) {
51
- var result = body();
52
-
53
- if (result && result.then) {
54
- return result.then(then);
55
- }
56
-
57
- return then(result);
58
- }
59
-
60
- function _catch(body, recover) {
61
- try {
62
- var result = body();
63
- } catch (e) {
64
- return recover(e);
65
- }
66
-
67
- if (result && result.then) {
68
- return result.then(void 0, recover);
69
- }
70
-
71
- return result;
72
- }
73
-
74
- function _slicedToArray(arr, i) {
75
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
76
- }
77
-
78
- function _nonIterableRest() {
79
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
80
- }
81
-
82
- function _unsupportedIterableToArray(o, minLen) {
83
- if (!o) return;
84
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
85
- var n = Object.prototype.toString.call(o).slice(8, -1);
86
- if (n === "Object" && o.constructor) n = o.constructor.name;
87
- if (n === "Map" || n === "Set") return Array.from(o);
88
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
89
- }
90
-
91
- function _arrayLikeToArray(arr, len) {
92
- if (len == null || len > arr.length) len = arr.length;
93
-
94
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
95
- arr2[i] = arr[i];
96
- }
97
-
98
- return arr2;
99
- }
100
-
101
- function _iterableToArrayLimit(arr, i) {
102
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
103
-
104
- if (_i == null) return;
105
- var _arr = [];
106
- var _n = true;
107
- var _d = false;
108
-
109
- var _s, _e;
110
-
111
- try {
112
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
113
- _arr.push(_s.value);
114
-
115
- if (i && _arr.length === i) break;
116
- }
117
- } catch (err) {
118
- _d = true;
119
- _e = err;
120
- } finally {
121
- try {
122
- if (!_n && _i["return"] != null) _i["return"]();
123
- } finally {
124
- if (_d) throw _e;
125
- }
126
- }
127
-
128
- return _arr;
129
- }
130
-
131
- function _arrayWithHoles(arr) {
132
- if (Array.isArray(arr)) return arr;
133
- }
134
-
135
- function _typeof(obj) {
136
- "@babel/helpers - typeof";
137
-
138
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
139
- return typeof obj;
140
- } : function (obj) {
141
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
142
- }, _typeof(obj);
143
- }
144
-
145
- (function () {
146
- /* eslint-env browser */
147
-
148
- /* globals self */
149
- var loadRegistry = Object.create(null);
150
- var registerRegistry = Object.create(null);
151
- var inlineScriptCount = 0;
152
- var System = {};
153
- var hasDocument = (typeof document === "undefined" ? "undefined" : _typeof(document)) === "object";
154
- var envGlobal = self;
155
- var isWorker = !hasDocument && typeof envGlobal.WorkerGlobalScope === "function" && envGlobal instanceof envGlobal.WorkerGlobalScope;
156
- var isServiceWorker = isWorker && typeof self.skipWaiting === "function";
157
- envGlobal.System = System;
158
- var baseUrl = envGlobal.location.href.split("#")[0].split("?")[0];
159
- var lastSlashIndex = baseUrl.lastIndexOf("/");
160
-
161
- if (lastSlashIndex !== -1) {
162
- baseUrl = baseUrl.slice(0, lastSlashIndex + 1);
163
- }
164
-
165
- var resolveUrl = function resolveUrl(specifier, baseUrl) {
166
- return new URL(specifier, baseUrl).href;
167
- };
168
-
169
- if (hasDocument) {
170
- var baseElement = document.querySelector("base[href]");
171
-
172
- if (baseElement) {
173
- baseUrl = baseElement.href;
174
- }
175
-
176
- System.register = function (deps, declare) {
177
- if (!document.currentScript) {
178
- throw new Error("unexpected call");
179
- }
180
-
181
- if (document.currentScript.__s__) {
182
- registerRegistry[document.currentScript.src] = [deps, declare];
183
- return null;
184
- }
185
-
186
- var url = document.currentScript.src || "".concat(window.location.href, "__inline_script__").concat(++inlineScriptCount);
187
- registerRegistry[url] = [deps, declare];
188
- return _import2(url);
189
- };
190
-
191
- System.instantiate = function (url) {
192
- var script = createScript(url);
193
- return new Promise(function (resolve, reject) {
194
- var lastWindowErrorUrl;
195
- var lastWindowError;
196
-
197
- var windowErrorCallback = function windowErrorCallback(event) {
198
- lastWindowErrorUrl = event.filename;
199
- lastWindowError = event.error;
200
- };
201
-
202
- window.addEventListener("error", windowErrorCallback);
203
- script.addEventListener("error", function () {
204
- window.removeEventListener("error", windowErrorCallback);
205
- reject("An error occured while loading url with <script> for ".concat(url));
206
- });
207
- script.addEventListener("load", function () {
208
- window.removeEventListener("error", windowErrorCallback);
209
- document.head.removeChild(script); // Note that if an error occurs that isn't caught by this if statement,
210
- // that getRegister will return null and a "did not instantiate" error will be thrown.
211
-
212
- if (lastWindowErrorUrl === url) {
213
- reject(lastWindowError);
214
- } else {
215
- resolve();
216
- }
217
- });
218
- document.head.appendChild(script);
219
- });
220
- };
221
-
222
- var createScript = function createScript(url) {
223
- var script = document.createElement("script");
224
- script.async = true; // Only add cross origin for actual cross origin
225
- // this is because Safari triggers for all
226
- // - https://bugs.webkit.org/show_bug.cgi?id=171566
227
-
228
- if (url.indexOf("".concat(self.location.origin, "/"))) {
229
- script.crossOrigin = "anonymous";
230
- }
231
-
232
- script.__s__ = true;
233
- script.src = url;
234
- return script;
235
- };
236
- }
237
-
238
- if (isWorker) {
239
- /*
240
- * SystemJs loads X files before executing the worker/service worker main file
241
- * It mean events dispatched during this phase could be missed
242
- * A warning like the one below is displayed in chrome devtools:
243
- * "Event handler of 'install' event must be added on the initial evaluation of worker script"
244
- * To fix that code below listen for these events early and redispatch them later
245
- * once the worker file is executed (the listeners are installed)
246
- */
247
- var firstImportCallbacks = [];
248
-
249
- if (isServiceWorker) {
250
- // for service worker there is more events to listen
251
- // and, to get rid of the warning, we override self.addEventListener
252
- var eventsToCatch = ["message", "install", "activate", "fetch"];
253
- var eventCallbackProxies = {};
254
- var firstImportPromise = new Promise(function (resolve) {
255
- firstImportCallbacks.push(resolve);
256
- });
257
- eventsToCatch.forEach(function (eventName) {
258
- var eventsToDispatch = [];
259
-
260
- var eventCallback = function eventCallback(event) {
261
- var eventCallbackProxy = eventCallbackProxies[event.type];
262
-
263
- if (eventCallbackProxy) {
264
- eventCallbackProxy(event);
265
- } else {
266
- eventsToDispatch.push(event);
267
- event.waitUntil(firstImportPromise);
268
- }
269
- };
270
-
271
- self.addEventListener(eventName, eventCallback);
272
- firstImportCallbacks.push(function () {
273
- if (eventsToDispatch.length) {
274
- var eventCallbackProxy = eventCallbackProxies[eventsToDispatch[0].type];
275
-
276
- if (eventCallbackProxy) {
277
- eventsToDispatch.forEach(function (event) {
278
- eventCallbackProxy(event);
279
- });
280
- }
281
-
282
- eventsToDispatch.length = 0;
283
- }
284
- });
285
- });
286
- var addEventListener = self.addEventListener;
287
-
288
- self.addEventListener = function (eventName, callback, options) {
289
- if (eventsToCatch.indexOf(eventName) > -1) {
290
- eventCallbackProxies[eventName] = callback;
291
- return null;
292
- }
293
-
294
- return addEventListener.call(self, eventName, callback, options);
295
- };
296
- } else {
297
- var _eventsToCatch = ["message"];
298
-
299
- _eventsToCatch.forEach(function (eventName) {
300
- var eventQueue = [];
301
-
302
- var eventCallback = function eventCallback(event) {
303
- eventQueue.push(event);
304
- };
305
-
306
- self.addEventListener(eventName, eventCallback);
307
- firstImportCallbacks.push(function () {
308
- self.removeEventListener(eventName, eventCallback);
309
- eventQueue.forEach(function (event) {
310
- self.dispatchEvent(event);
311
- });
312
- eventQueue.length = 0;
313
- });
314
- });
315
- }
316
-
317
- System.register = _async(function (deps, declare) {
318
- System.register = function () {
319
- throw new Error("unexpected call");
320
- };
321
-
322
- var url = self.location.href;
323
- registerRegistry[url] = [deps, declare];
324
- return _await(_import2(url), function (namespace) {
325
- firstImportCallbacks.forEach(function (firstImportCallback) {
326
- firstImportCallback();
327
- });
328
- firstImportCallbacks.length = 0;
329
- return namespace;
330
- });
331
- });
332
- System.instantiate = _async(function (url) {
333
- return _await(self.fetch(url, {
334
- credentials: "same-origin"
335
- }), function (response) {
336
- if (!response.ok) {
337
- throw Error("Failed to fetch module at ".concat(url));
338
- }
339
-
340
- return _await(response.text(), function (source) {
341
- if (source.indexOf("//# sourceURL=") < 0) {
342
- source += "\n//# sourceURL=".concat(url);
343
- }
344
-
345
- var register = System.register;
346
-
347
- System.register = function (deps, declare) {
348
- registerRegistry[url] = [deps, declare];
349
- };
350
-
351
- (0, self.eval)(source);
352
- System.register = register;
353
- });
354
- });
355
- });
356
- }
357
-
358
- var _import2 = function _import(specifier, parentUrl) {
359
- var url = resolveUrl(specifier, parentUrl);
360
- var load = getOrCreateLoad(url, parentUrl);
361
- return load.completionPromise || startExecution(load);
362
- };
363
-
364
- var getOrCreateLoad = function getOrCreateLoad(url, firstParentUrl) {
365
- var existingLoad = loadRegistry[url];
366
-
367
- if (existingLoad) {
368
- return existingLoad;
369
- }
370
-
371
- var load = {
372
- url: url
373
- };
374
- loadRegistry[url] = load;
375
- var importerSetters = [];
376
- load.importerSetters = importerSetters;
377
- var namespace = createNamespace();
378
- load.namespace = namespace;
379
- load.instantiatePromise = _async(function () {
380
- return _catch(function () {
381
- var registration = registerRegistry[url];
382
- return _invoke(function () {
383
- if (!registration) {
384
- var instantiateReturnValue = System.instantiate(url, firstParentUrl);
385
- return _invoke(function () {
386
- if (instantiateReturnValue) {
387
- return _awaitIgnored(instantiateReturnValue);
388
- }
389
- }, function () {
390
- registration = registerRegistry[url];
391
- });
392
- }
393
- }, function () {
394
- if (!registration) {
395
- throw new Error("System.register() not called after executing ".concat(url));
396
- }
397
-
398
- var _export = function _export(firstArg, secondArg) {
399
- load.hoistedExports = true;
400
- var changed = false;
401
-
402
- if (typeof firstArg === "string") {
403
- var name = firstArg;
404
- var value = secondArg;
405
-
406
- if (!(name in namespace) || namespace[name] !== value) {
407
- namespace[name] = value;
408
- changed = true;
409
- }
410
- } else {
411
- Object.keys(firstArg).forEach(function (name) {
412
- var value = firstArg[name];
413
-
414
- if (!(name in namespace) || namespace[name] !== value) {
415
- namespace[name] = value;
416
- changed = true;
417
- }
418
- });
419
-
420
- if (firstArg && firstArg.__esModule) {
421
- namespace.__esModule = firstArg.__esModule;
422
- }
423
- }
424
-
425
- if (changed) {
426
- importerSetters.forEach(function (importerSetter) {
427
- if (importerSetter) {
428
- importerSetter(namespace);
429
- }
430
- });
431
- }
432
-
433
- return secondArg;
434
- };
435
-
436
- var _registration = registration,
437
- _registration2 = _slicedToArray(_registration, 2),
438
- deps = _registration2[0],
439
- declare = _registration2[1];
440
-
441
- var _declare = declare(_export, {
442
- import: function _import(importId) {
443
- return _import2(importId, url);
444
- },
445
- meta: createMeta(url)
446
- }),
447
- setters = _declare.setters,
448
- _declare$execute = _declare.execute,
449
- execute = _declare$execute === void 0 ? function () {} : _declare$execute;
450
-
451
- load.deps = deps;
452
- load.setters = setters;
453
- load.execute = execute;
454
- });
455
- }, function (e) {
456
- load.error = e;
457
- load.execute = null;
458
- });
459
- })();
460
- load.linkPromise = _async(function () {
461
- return _await(load.instantiatePromise, function () {
462
- return _await(Promise.all(load.deps.map(_async(function (dep, index) {
463
- var setter = load.setters[index];
464
- var dependencyUrl = resolveUrl(dep, url);
465
- var dependencyLoad = getOrCreateLoad(dependencyUrl, url);
466
- return _invoke(function () {
467
- if (dependencyLoad.instantiatePromise) {
468
- return _awaitIgnored(dependencyLoad.instantiatePromise);
469
- }
470
- }, function () {
471
- if (setter) {
472
- dependencyLoad.importerSetters.push(setter);
473
-
474
- if (dependencyLoad.hoistedExports || !dependencyLoad.instantiatePromise) {
475
- setter(dependencyLoad.namespace);
476
- }
477
- }
478
-
479
- return dependencyLoad;
480
- });
481
- }))), function (dependencyLoads) {
482
- load.dependencyLoads = dependencyLoads;
483
- });
484
- });
485
- })();
486
- return load;
487
- };
488
-
489
- var startExecution = _async(function (load) {
490
- load.completionPromise = function () {
491
- return _await(instantiateAll(load, load, {}), function () {
492
- return _await(postOrderExec(load, {}), function () {
493
- return load.namespace;
494
- });
495
- });
496
- }();
497
-
498
- return load.completionPromise;
499
- });
500
-
501
- var instantiateAll = _async(function (load, parent, loaded) {
502
- if (loaded[load.url]) {
503
- return;
504
- }
505
-
506
- loaded[load.url] = true;
507
- return _catch(function () {
508
- return _invoke(function () {
509
- if (load.linkPromise) {
510
- // load.linkPromise is null once instantiated
511
- return _awaitIgnored(load.linkPromise);
512
- }
513
- }, function () {
514
- // if (!load.parent || !load.parent.execute) {
515
- // load.parent = parent
516
- // }
517
- return _awaitIgnored(Promise.all(load.dependencyLoads.map(function (dependencyLoad) {
518
- return instantiateAll(dependencyLoad, parent, loaded);
519
- })));
520
- });
521
- }, function (error) {
522
- if (load.error) {
523
- throw error;
524
- }
525
-
526
- load.execute = null;
527
- throw error;
528
- });
529
- });
530
-
531
- var postOrderExec = _async(function (load, seen) {
532
- var _exit = false;
533
-
534
- if (seen[load.url]) {
535
- return;
536
- }
537
-
538
- seen[load.url] = true;
539
- return _invoke(function () {
540
- if (!load.execute) {
541
- if (load.error) {
542
- throw load.error;
543
- }
544
-
545
- return _invoke(function () {
546
- if (load.executePromise) {
547
- return _awaitIgnored(load.executePromise);
548
- }
549
- }, function () {
550
- _exit = true;
551
- });
552
- }
553
- }, function (_result3) {
554
- if (_exit) return _result3; // deps execute first, unless circular
555
-
556
- var depLoadPromises = [];
557
- load.dependencyLoads.forEach(function (dependencyLoad) {
558
- try {
559
- var depLoadPromise = postOrderExec(dependencyLoad, seen);
560
-
561
- if (depLoadPromise) {
562
- depLoadPromises.push(depLoadPromise);
563
- }
564
- } catch (err) {
565
- load.execute = null;
566
- load.error = err;
567
- throw err;
568
- }
569
- });
570
- return _invoke(function () {
571
- if (depLoadPromises.length) {
572
- return _awaitIgnored(Promise.all(depLoadPromises));
573
- }
574
- }, function () {
575
- try {
576
- var executeReturnValue = load.execute.call(nullContext);
577
-
578
- if (executeReturnValue) {
579
- load.executePromise = executeReturnValue.then(function () {
580
- load.executePromise = null;
581
- load.completionPromise = load.namespace;
582
- }, function (error) {
583
- load.executePromise = null;
584
- load.error = error;
585
- throw error;
586
- });
587
- return;
588
- }
589
-
590
- load.instantiatePromise = null;
591
- load.linkPromise = null;
592
- load.completionPromise = load.namespace;
593
- } catch (error) {
594
- load.error = error;
595
- throw error;
596
- } finally {
597
- load.execute = null;
598
- }
599
- });
600
- });
601
- }); // the closest we can get to call(undefined)
602
-
603
-
604
- var nullContext = Object.freeze(Object.create(null));
605
-
606
- var createMeta = function createMeta(url) {
607
- return {
608
- url: url,
609
- resolve: function resolve(id, parentUrl) {
610
- return resolveUrl(id, parentUrl);
611
- }
612
- };
613
- };
614
-
615
- var createNamespace = typeof Symbol !== "undefined" && Symbol.toStringTag ? function () {
616
- var namespace = Object.create(null);
617
- Object.defineProperty(namespace, Symbol.toStringTag, {
618
- value: "Module"
619
- });
620
- return namespace;
621
- } : function () {
622
- return Object.create(null);
623
- };
624
- })();
625
- });
626
- //# sourceMappingURL=s.js.map?as_js_classic