@jsenv/core 26.0.1 → 27.0.0-alpha.2
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.
- package/main.js +17 -24
- package/package.json +35 -71
- package/readme.md +30 -37
- package/src/build/build.js +737 -0
- package/src/build/build_urls_generator.js +64 -0
- package/src/build/inject_version_mappings.js +62 -0
- package/src/build/plugins/bundle_js_module/jsenv_plugin_bundle_js_module.js +225 -0
- package/src/build/plugins/minify_html/jsenv_plugin_minify_html.js +30 -0
- package/src/build/plugins/minify_js/jsenv_plugin_minify_js.js +47 -0
- package/src/dev/plugins/autoreload/babel_plugin_metadata_import_meta_hot.js +98 -0
- package/src/dev/plugins/autoreload/client/autoreload_preference.js +11 -0
- package/src/dev/plugins/autoreload/client/event_source_client.js +186 -0
- package/src/{internal/dev_server/event_source_client → dev/plugins/autoreload/client}/event_source_connection.js +21 -25
- package/src/dev/plugins/autoreload/client/import_meta_hot.js +80 -0
- package/src/dev/plugins/autoreload/client/reload.js +101 -0
- package/src/dev/plugins/autoreload/client/url_helpers.js +20 -0
- package/src/dev/plugins/autoreload/html_hot_dependencies.js +156 -0
- package/src/dev/plugins/autoreload/jsenv_plugin_autoreload.js +374 -0
- package/src/dev/plugins/autoreload/sse_service.js +149 -0
- package/src/dev/plugins/explorer/client/explorer.html +607 -0
- package/src/{internal → dev/plugins/explorer/client}/jsenv.png +0 -0
- package/src/dev/plugins/explorer/jsenv_plugin_explorer.js +74 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/animation/toolbar_animation.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/eventsource/eventsource.css +2 -2
- package/src/dev/plugins/toolbar/client/eventsource/toolbar_eventsource.js +57 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/execution/execution.css +0 -0
- package/src/dev/plugins/toolbar/client/execution/toolbar_execution.js +88 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/focus.css +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/toolbar_focus.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/jsenv_logo.svg +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/notification/toolbar_notification.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/responsive/overflow_menu.css +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/responsive/toolbar_responsive.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/settings.css +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/toolbar_settings.js +1 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/jsenv_theme.css +1 -15
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/light_theme.css +0 -17
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/toolbar_theme.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar.html +40 -199
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_injector.js +8 -28
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_main.css +0 -24
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_main.js +10 -56
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.css +1 -1
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/animation.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/dom.js +0 -0
- package/src/{internal/browser_utils → dev/plugins/toolbar/client/util}/fetch_using_xhr.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/fetching.js +2 -4
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/iframe_to_parent_href.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/jsenv_logger.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/preferences.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/responsive.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/util.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/variant/variant.js +0 -0
- package/src/dev/plugins/toolbar/jsenv_plugin_toolbar.js +62 -0
- package/src/dev/start_dev_server.js +105 -0
- package/src/execute/execute.js +132 -0
- package/src/execute/run.js +208 -0
- package/src/execute/runtimes/browsers/chromium.js +8 -0
- package/src/execute/runtimes/browsers/firefox.js +7 -0
- package/src/execute/runtimes/browsers/from_playwright.js +464 -0
- package/src/{browser_runtimes.js → execute/runtimes/browsers/webkit.js} +4 -18
- package/src/{internal/node_launcher/child_process_options.js → execute/runtimes/node/child_exec_options.js} +25 -36
- package/src/{internal/node_launcher/node_controllable_file.mjs → execute/runtimes/node/controllable_file.mjs} +1 -18
- package/src/{internal/node_launcher/node_controllable_process.js → execute/runtimes/node/controlled_process.js} +128 -150
- package/src/execute/runtimes/node/exec_options.js +44 -0
- package/src/{internal/node_launcher → execute/runtimes/node}/kill_process_tree.js +3 -1
- package/src/execute/runtimes/node/node_process.js +92 -0
- package/src/execute/runtimes/node/node_worker_thread.js +28 -0
- package/src/omega/core_plugins/babel/babel_helper/babel_helper_directory.js +29 -0
- package/src/{internal/compile_server/js → omega/core_plugins/babel/babel_helper}/babel_plugin_babel_helpers_as_jsenv_imports.js +15 -19
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/.eslintrc.cjs +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AsyncGenerator/AsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AwaitValue/AwaitValue.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayLikeToArray/arrayLikeToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithHoles/arrayWithHoles.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithoutHoles/arrayWithoutHoles.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/assertThisInitialized/assertThisInitialized.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncIterator/asyncIterator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncToGenerator/asyncToGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCallCheck/classCallCheck.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classNameTDZError/classNameTDZError.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldGet/classPrivateFieldGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldSet/classPrivateFieldSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodGet/classPrivateMethodGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodSet/classPrivateMethodSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/construct/construct.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createClass/createClass.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createRawReactElement/createRawReactElement.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createSuper/createSuper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/decorate/decorate.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defaults/defaults.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineEnumerableProperties/defineEnumerableProperties.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineProperty/defineProperty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/extends/extends.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/get/get.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/getPrototypeOf/getPrototypeOf.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inherits/inherits.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inheritsLoose/inheritsLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerDefineProperty/initializerDefineProperty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerWarningHelper/initializerWarningHelper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/instanceof/instanceof.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireDefault/interopRequireDefault.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireWildcard/interopRequireWildcard.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeFunction/isNativeFunction.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArray/iterableToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimit/iterableToArrayLimit.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/jsx/jsx.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/maybeArrayLike/maybeArrayLike.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/newArrowCheck/newArrowCheck.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableRest/nonIterableRest.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableSpread/nonIterableSpread.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread/objectSpread.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread2/objectSpread2.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutProperties/objectWithoutProperties.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/possibleConstructorReturn/possibleConstructorReturn.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readOnlyError/readOnlyError.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readme.md +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/set/set.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/setPrototypeOf/setPrototypeOf.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArray/slicedToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArrayLoose/slicedToArrayLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/superPropBase/superPropBase.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/tdz/tdz.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalRef/temporalRef.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalUndefined/temporalUndefined.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toArray/toArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toConsumableArray/toConsumableArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPrimitive/toPrimitive.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPropertyKey/toPropertyKey.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/typeof/typeof.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapNativeSuper/wrapNativeSuper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapRegExp/wrapRegExp.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/writeOnlyError/writeOnlyError.js +0 -0
- package/src/omega/core_plugins/babel/global_this/babel_plugin_global_this_as_jsenv_import.js +35 -0
- package/{helpers/global-this/global-this.js → src/omega/core_plugins/babel/global_this/client/global_this.js} +0 -0
- package/src/omega/core_plugins/babel/helpers/babel_plugin_structure.js +187 -0
- package/src/{internal/features → omega/core_plugins/babel/helpers}/babel_plugins_compatibility.js +1 -24
- package/src/omega/core_plugins/babel/jsenv_plugin_babel.js +97 -0
- package/src/omega/core_plugins/babel/new_stylesheet/babel_plugin_new_stylesheet_as_jsenv_import.js +117 -0
- package/src/omega/core_plugins/babel/new_stylesheet/client/.eslintrc.cjs +24 -0
- package/{helpers/new_stylesheet → src/omega/core_plugins/babel/new_stylesheet/client}/new_stylesheet.js +0 -0
- package/src/omega/core_plugins/babel/regenerator_runtime/babel_plugin_regenerator_runtime_as_jsenv_import.js +34 -0
- package/{helpers/regenerator-runtime/regenerator-runtime.js → src/omega/core_plugins/babel/regenerator_runtime/client/regenerator_runtime.js} +0 -0
- package/src/omega/core_plugins/commonjs_globals/jsenv_plugin_commonjs_globals.js +169 -0
- package/src/omega/core_plugins/file_urls/jsenv_plugin_file_urls.js +67 -0
- package/src/omega/core_plugins/filesystem_magic/jsenv_plugin_filesystem_magic.js +58 -0
- package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/error_in_document.js +10 -16
- package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/error_in_notification.js +0 -0
- package/src/omega/core_plugins/html_supervisor/client/html_supervisor_installer.js +168 -0
- package/src/omega/core_plugins/html_supervisor/client/html_supervisor_setup.js +77 -0
- package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/perf_browser.js +0 -0
- package/src/{internal/runtime_client → omega/core_plugins/html_supervisor/client}/uneval_exception.js +0 -0
- package/src/omega/core_plugins/html_supervisor/jsenv_plugin_html_supervisor.js +233 -0
- package/src/omega/core_plugins/import_assertions/helpers/babel_plugin_metadata_import_assertions.js +98 -0
- package/src/{internal/building/import_assertions → omega/core_plugins/import_assertions/helpers}/json_module.js +3 -2
- package/src/omega/core_plugins/import_assertions/helpers/text_module.js +6 -0
- package/src/omega/core_plugins/import_assertions/jsenv_plugin_import_assertions.js +211 -0
- package/src/omega/core_plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +80 -0
- package/src/omega/core_plugins/importmap/jsenv_plugin_importmap.js +212 -0
- package/src/omega/core_plugins/inline/client/inline_content.js +6 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_data_urls.js +70 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_inline.js +13 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_inline_query_param.js +42 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_js_and_css_inside_html.js +142 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_new_inline_content.js +210 -0
- package/src/omega/core_plugins/leading_slash/jsenv_plugin_leading_slash.js +12 -0
- package/src/omega/core_plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +77 -0
- package/src/omega/core_plugins/url_resolution/jsenv_plugin_url_resolution.js +28 -0
- package/src/omega/core_plugins/url_version/jsenv_plugin_url_version.js +50 -0
- package/src/omega/core_plugins.js +39 -0
- package/src/omega/errors.js +168 -0
- package/src/omega/file_url_converter.js +63 -0
- package/src/omega/kitchen.js +777 -0
- package/src/omega/omega_server.js +129 -0
- package/src/omega/plugin_controller.js +240 -0
- package/src/omega/runtime_support/default_runtime_support.js +13 -0
- package/src/omega/runtime_support/features_compatibility.js +91 -0
- package/src/omega/runtime_support/runtime_support.js +20 -0
- package/src/omega/server/file_service.js +155 -0
- package/src/omega/server/user_agent.js +22 -0
- package/src/omega/url_graph/url_graph_load.js +68 -0
- package/src/omega/url_graph/url_graph_report.js +151 -0
- package/src/omega/url_graph/url_graph_sort.js +29 -0
- package/src/omega/url_graph/url_info_transformations.js +161 -0
- package/src/omega/url_graph.js +132 -0
- package/src/omega/url_mentions/css_url_mentions.js +63 -0
- package/src/omega/url_mentions/html_url_mentions.js +185 -0
- package/src/omega/url_mentions/js_module_url_mentions.js +91 -0
- package/src/omega/url_mentions/parse_url_mentions.js +37 -0
- package/src/omega/url_mentions/worker_classic_url_mentions.js +37 -0
- package/src/{internal/executing → test}/execute_plan.js +154 -211
- package/src/{execute_test_plan.js → test/execute_test_plan.js} +26 -81
- package/src/{internal/executing → test}/execution_colors.js +0 -0
- package/src/{internal/executing → test}/execution_steps.js +2 -8
- package/src/{internal/executing → test}/gc.js +0 -0
- package/src/test/logs_file_execution.js +223 -0
- package/dist/browser_client/asset-manifest.json +0 -4
- package/dist/browser_client/browser_client_fb33eaa4.js +0 -5320
- package/dist/browser_client/browser_client_fb33eaa4.js.map +0 -1089
- package/dist/build_manifest.js +0 -12
- package/dist/compile_proxy/asset-manifest.json +0 -4
- package/dist/compile_proxy/compile_proxy.html__inline__20_651d1e7b.js.map +0 -343
- package/dist/compile_proxy/compile_proxy_62f952c4.html +0 -2245
- package/dist/event_source_client/asset-manifest.json +0 -4
- package/dist/event_source_client/event_source_client_69f48287.js +0 -354
- package/dist/event_source_client/event_source_client_69f48287.js.map +0 -128
- package/dist/redirector/asset-manifest.json +0 -4
- package/dist/redirector/redirector.html__inline__12_171e07b4.js.map +0 -349
- package/dist/redirector/redirector_8117ec92.html +0 -2290
- package/dist/toolbar/asset-manifest.json +0 -13
- package/dist/toolbar/assets/compilation.css_7421bd55.map +0 -12
- package/dist/toolbar/assets/eventsource.css_c0c71e7b.map +0 -12
- package/dist/toolbar/assets/execution.css_f3377c10.map +0 -12
- package/dist/toolbar/assets/focus.css_896f3e45.map +0 -12
- package/dist/toolbar/assets/light_theme.css_5bff0336.map +0 -12
- package/dist/toolbar/assets/overflow_menu.css_9a0fc3d8.map +0 -12
- package/dist/toolbar/assets/settings.css_942b5a9e.map +0 -12
- package/dist/toolbar/assets/toolbar_main.css_b1c67dd7.map +0 -28
- package/dist/toolbar/assets/tooltip.css_a94a8bdd.map +0 -12
- package/dist/toolbar/toolbar_b0c9100c.html +0 -4976
- package/dist/toolbar/toolbar_main_f54c1bb0.js.map +0 -776
- package/dist/toolbar_injector/asset-manifest.json +0 -5
- package/dist/toolbar_injector/assets/jsenv_logo_192011c2.svg +0 -95
- package/dist/toolbar_injector/toolbar_injector_65b501eb.js +0 -976
- package/dist/toolbar_injector/toolbar_injector_65b501eb.js.map +0 -294
- package/helpers/import-meta/import-meta-url-commonjs.js +0 -9
- package/helpers/import-meta/import-meta-url-global.js +0 -54
- package/src/build_project.js +0 -336
- package/src/commonjs_to_js_module.js +0 -180
- package/src/dev_server.js +0 -302
- package/src/execute.js +0 -184
- package/src/import_using_child_process.js +0 -68
- package/src/internal/browser_client/browser_client.js +0 -220
- package/src/internal/browser_client/browser_client_factory.js +0 -144
- package/src/internal/browser_client/browser_error_stack_remap.js +0 -43
- package/src/internal/browser_client/browser_system.js +0 -216
- package/src/internal/browser_client/module_namespace_transfer.js +0 -90
- package/src/internal/browser_detection/browser_detection.js +0 -65
- package/src/internal/browser_detection/detect_android.js +0 -13
- package/src/internal/browser_detection/detect_chrome.js +0 -28
- package/src/internal/browser_detection/detect_edge.js +0 -13
- package/src/internal/browser_detection/detect_electron.js +0 -1
- package/src/internal/browser_detection/detect_firefox.js +0 -17
- package/src/internal/browser_detection/detect_internet_explorer.js +0 -14
- package/src/internal/browser_detection/detect_ios.js +0 -19
- package/src/internal/browser_detection/detect_opera.js +0 -27
- package/src/internal/browser_detection/detect_safari.js +0 -13
- package/src/internal/browser_detection/user_agent_data.js +0 -25
- package/src/internal/browser_detection/util.js +0 -13
- package/src/internal/browser_launcher/browser_runtime_profile.js +0 -81
- package/src/internal/browser_launcher/execute_html_file.js +0 -355
- package/src/internal/browser_launcher/from_playwright.js +0 -320
- package/src/internal/browser_launcher/page_errors_and_logs.js +0 -77
- package/src/internal/browser_utils/fetch_and_eval.js +0 -27
- package/src/internal/browser_utils/fetch_and_eval_using_script.js +0 -47
- package/src/internal/browser_utils/fetch_browser.js +0 -34
- package/src/internal/browser_utils/fetch_json.js +0 -7
- package/src/internal/building/build_logs.js +0 -134
- package/src/internal/building/build_stats.js +0 -100
- package/src/internal/building/build_url_generator.js +0 -153
- package/src/internal/building/build_using_rollup.js +0 -359
- package/src/internal/building/css/apply_post_css.js +0 -55
- package/src/internal/building/css/jsenv_parse_css.js +0 -260
- package/src/internal/building/css/move_css_urls.js +0 -44
- package/src/internal/building/css/parse_css_urls.js +0 -38
- package/src/internal/building/css/postcss_plugin_url_visitor.js +0 -245
- package/src/internal/building/css/replace_css_urls.js +0 -68
- package/src/internal/building/global_format/es_to_system.js +0 -34
- package/src/internal/building/html/html_node_mutations.js +0 -29
- package/src/internal/building/html/html_scan.js +0 -70
- package/src/internal/building/html/jsenv_parse_html.js +0 -813
- package/src/internal/building/html/minify_html.js +0 -7
- package/src/internal/building/import_assertions/css_module.js +0 -43
- package/src/internal/building/import_references.js +0 -80
- package/src/internal/building/importmap/jsenv_parse_importmap.js +0 -28
- package/src/internal/building/js/babel_plugin_inline_worker_imports.js +0 -96
- package/src/internal/building/js/jsenv_parse_js.js +0 -122
- package/src/internal/building/js/minify_js.js +0 -33
- package/src/internal/building/js/transform_worker.js +0 -55
- package/src/internal/building/json/jsenv_parse_json.js +0 -11
- package/src/internal/building/parse_ressource.js +0 -207
- package/src/internal/building/ressource_builder.js +0 -1098
- package/src/internal/building/ressource_builder_util.js +0 -194
- package/src/internal/building/rollup_plugin_jsenv.js +0 -1965
- package/src/internal/building/sort_pathnames.js +0 -10
- package/src/internal/building/sourcemap/sourcemap_loader.js +0 -70
- package/src/internal/building/svg/jsenv_parse_svg.js +0 -112
- package/src/internal/building/url_fetcher.js +0 -85
- package/src/internal/building/url_loader.js +0 -127
- package/src/internal/building/url_trace.js +0 -229
- package/src/internal/building/url_versioning/resolve_import_url_helper.js +0 -12
- package/src/internal/building/url_versioning/url_versioning.js +0 -65
- package/src/internal/building/webmanifest/jsenv_parse_webmanifest.js +0 -48
- package/src/internal/compile_server/commonjs/rollup_plugin_commonjs_named_exports.js +0 -187
- package/src/internal/compile_server/compile_file.js +0 -273
- package/src/internal/compile_server/compile_server.js +0 -519
- package/src/internal/compile_server/compiled_file_service.js +0 -264
- package/src/internal/compile_server/html/html_ast.js +0 -534
- package/src/internal/compile_server/html/html_source_file_service.js +0 -453
- package/src/internal/compile_server/html/jsenv_compile_html.js +0 -674
- package/src/internal/compile_server/importmap/jsenv_compile_importmap.js +0 -28
- package/src/internal/compile_server/js/ansi_to_html.js +0 -9
- package/src/internal/compile_server/js/babelHelper.js +0 -145
- package/src/internal/compile_server/js/babel_parse_error.js +0 -9
- package/src/internal/compile_server/js/babel_plugin_global_this_as_jsenv_import.js +0 -34
- package/src/internal/compile_server/js/babel_plugin_import_assertions.js +0 -121
- package/src/internal/compile_server/js/babel_plugin_import_metadata.js +0 -18
- package/src/internal/compile_server/js/babel_plugin_import_visitor.js +0 -84
- package/src/internal/compile_server/js/babel_plugin_new_stylesheet_as_jsenv_import.js +0 -113
- package/src/internal/compile_server/js/babel_plugin_proxy_external_imports.js +0 -31
- package/src/internal/compile_server/js/babel_plugin_regenerator_runtime_as_jsenv_import.js +0 -48
- package/src/internal/compile_server/js/babel_plugin_replace_expressions.js +0 -101
- package/src/internal/compile_server/js/babel_plugin_systemjs_prepend.js +0 -23
- package/src/internal/compile_server/js/babel_plugin_transform_import_meta.js +0 -134
- package/src/internal/compile_server/js/babel_plugins.js +0 -37
- package/src/internal/compile_server/js/generateBabelHelper.js +0 -36
- package/src/internal/compile_server/js/js_transformer.js +0 -195
- package/src/internal/compile_server/js/jsenv_compile_js.js +0 -62
- package/src/internal/compile_server/js/load_babel_plugin_map_from_file.js +0 -49
- package/src/internal/compile_server/jsenv_directory/comparison_utils.js +0 -27
- package/src/internal/compile_server/jsenv_directory/compilation_result.js +0 -243
- package/src/internal/compile_server/jsenv_directory/compilation_result_from_build.js +0 -184
- package/src/internal/compile_server/jsenv_directory/compile_asset.js +0 -24
- package/src/internal/compile_server/jsenv_directory/compile_context.js +0 -60
- package/src/internal/compile_server/jsenv_directory/compile_profile.js +0 -217
- package/src/internal/compile_server/jsenv_directory/file_lock_registry.js +0 -24
- package/src/internal/compile_server/jsenv_directory/file_lock_registry.test.js +0 -47
- package/src/internal/compile_server/jsenv_directory/fs_optimized_for_cache.js +0 -57
- package/src/internal/compile_server/jsenv_directory/jsenv_directory.js +0 -183
- package/src/internal/compile_server/jsenv_directory/reuse_or_create_compiled_file.js +0 -269
- package/src/internal/compile_server/jsenv_directory/update_compile_cache.js +0 -131
- package/src/internal/compile_server/jsenv_directory/validate_compile_cache.js +0 -264
- package/src/internal/compile_server/sse_service/sse_service.js +0 -369
- package/src/internal/coverage/babel_plugin_instrument.js +0 -90
- package/src/internal/coverage/coverage_reporter_html_directory.js +0 -37
- package/src/internal/coverage/coverage_reporter_json_file.js +0 -22
- package/src/internal/coverage/coverage_reporter_text_log.js +0 -20
- package/src/internal/coverage/empty_coverage_factory.js +0 -70
- package/src/internal/coverage/file_by_file_coverage.js +0 -28
- package/src/internal/coverage/istanbul_coverage_composition.js +0 -28
- package/src/internal/coverage/istanbul_coverage_map_from_coverage.js +0 -16
- package/src/internal/coverage/list_files_not_covered.js +0 -20
- package/src/internal/coverage/missing_coverage.js +0 -46
- package/src/internal/coverage/report_to_coverage.js +0 -198
- package/src/internal/coverage/v8_and_istanbul.js +0 -38
- package/src/internal/coverage/v8_coverage_composition.js +0 -23
- package/src/internal/coverage/v8_coverage_from_directory.js +0 -86
- package/src/internal/coverage/v8_coverage_to_istanbul.js +0 -100
- package/src/internal/data_url.js +0 -54
- package/src/internal/dev_server/event_source_client/event_source_client.js +0 -63
- package/src/internal/dev_server/event_source_client/file_changes.js +0 -82
- package/src/internal/dev_server/event_source_client/livereload_preference.js +0 -13
- package/src/internal/dev_server/exploring/exploring.css +0 -237
- package/src/internal/dev_server/exploring/exploring.html +0 -79
- package/src/internal/dev_server/exploring/exploring.js +0 -243
- package/src/internal/dev_server/exploring/fetch_exploring_json.js +0 -19
- package/src/internal/dev_server/toolbar/compilation/compilation.css +0 -23
- package/src/internal/dev_server/toolbar/compilation/toolbar_compilation.js +0 -202
- package/src/internal/dev_server/toolbar/eventsource/toolbar_eventsource.js +0 -83
- package/src/internal/dev_server/toolbar/execution/toolbar_execution.js +0 -91
- package/src/internal/error_stack_remap/install_error_stack_remapping.js +0 -142
- package/src/internal/error_stack_remap/remap_call_site.js +0 -315
- package/src/internal/error_stack_remap/remap_stack.js +0 -218
- package/src/internal/error_stack_remap/stringify_stack.js +0 -9
- package/src/internal/executing/launch_and_execute.js +0 -458
- package/src/internal/executing/logs_file_execution.js +0 -160
- package/src/internal/executing/logs_plan_summary.js +0 -144
- package/src/internal/features/browser_feature_detection/browser_feature_detect_dynamic_import.js +0 -20
- package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_css.js +0 -23
- package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_json.js +0 -25
- package/src/internal/features/browser_feature_detection/browser_feature_detect_importmap.js +0 -37
- package/src/internal/features/browser_feature_detection/browser_feature_detect_new_stylesheet.js +0 -9
- package/src/internal/features/browser_feature_detection/browser_feature_detect_top_level_await.js +0 -14
- package/src/internal/features/browser_feature_detection/browser_feature_detection.js +0 -89
- package/src/internal/features/browser_feature_detection/compile_proxy.html +0 -27
- package/src/internal/features/browser_feature_detection/execute_with_script_module.js +0 -24
- package/src/internal/features/features_compat_from_runtime.js +0 -38
- package/src/internal/features/features_compat_from_runtime_support.js +0 -31
- package/src/internal/features/features_compatibility.js +0 -37
- package/src/internal/features/node_feature_detection/feature_detect_dynamic_import.mjs +0 -5
- package/src/internal/features/node_feature_detection/feature_detect_top_level_await.mjs +0 -1
- package/src/internal/features/node_feature_detection/node_feature_detect_dynamic_import.js +0 -5
- package/src/internal/features/node_feature_detection/node_feature_detect_top_level_await.js +0 -16
- package/src/internal/features/node_feature_detection/node_feature_detection.js +0 -66
- package/src/internal/fetching.js +0 -28
- package/src/internal/import_resolution/default_extension.js +0 -40
- package/src/internal/import_resolution/import_resolver_importmap.js +0 -64
- package/src/internal/import_resolution/import_resolver_node.js +0 -254
- package/src/internal/import_resolution/importmap_default.js +0 -37
- package/src/internal/jsenv_builds.js +0 -19
- package/src/internal/jsenv_params_assertions.js +0 -12
- package/src/internal/jsenv_remote_directory.js +0 -156
- package/src/internal/logs/byte.js +0 -10
- package/src/internal/logs/byte_as_file_size.js +0 -9
- package/src/internal/logs/ms_as_duration.js +0 -12
- package/src/internal/memoize.js +0 -24
- package/src/internal/node_launcher/eval_source.js +0 -6
- package/src/internal/node_launcher/fetch_source.js +0 -8
- package/src/internal/node_launcher/node_error_stack_remap.js +0 -22
- package/src/internal/node_launcher/node_execution_dynamic_import.js +0 -75
- package/src/internal/node_launcher/node_execution_performance.js +0 -67
- package/src/internal/node_launcher/node_execution_systemjs.js +0 -125
- package/src/internal/node_launcher/node_runtime_report.js +0 -77
- package/src/internal/node_launcher/node_system.js +0 -192
- package/src/internal/node_launcher/perf_node.js +0 -13
- package/src/internal/node_launcher/process_options.js +0 -46
- package/src/internal/node_launcher/value_install.js +0 -14
- package/src/internal/origin_directory_converter.js +0 -62
- package/src/internal/promise_race.js +0 -19
- package/src/internal/redirector/redirector.html +0 -40
- package/src/internal/regexp_escape.js +0 -34
- package/src/internal/require.js +0 -3
- package/src/internal/response_validation.js +0 -130
- package/src/internal/runtime_client/module_registration.js +0 -207
- package/src/internal/runtime_client/s.js +0 -864
- package/src/internal/runtime_client/s.js.md +0 -1
- package/src/internal/runtime_support/jsenv_runtime_support.js +0 -15
- package/src/internal/runtime_support/runtime_support.js +0 -70
- package/src/internal/semantic_versioning/compare_versions.js +0 -28
- package/src/internal/semantic_versioning/highest_version.js +0 -11
- package/src/internal/semantic_versioning/is_above.js +0 -5
- package/src/internal/semantic_versioning/is_below.js +0 -5
- package/src/internal/semantic_versioning/is_equal.js +0 -3
- package/src/internal/semantic_versioning/lowest_version.js +0 -11
- package/src/internal/semantic_versioning/version_from_value.js +0 -42
- package/src/internal/sourcemap_utils.js +0 -112
- package/src/internal/template_string_escape.js +0 -20
- package/src/internal/url_conversion.js +0 -313
- package/src/internal/url_utils.js +0 -33
- package/src/internal/url_utils.test.js +0 -39
- package/src/internal/windows_file_path_utils.js +0 -16
- package/src/jsenv_file_urls.js +0 -35
- package/src/jsenv_service_worker_finalizer.js +0 -55
- package/src/json_to_js_module.js +0 -13
- package/src/node_runtime.js +0 -227
- package/src/require_using_child_process.js +0 -67
- package/src/text_to_js_module.js +0 -13
|
@@ -1,2245 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head>
|
|
2
|
-
<title>Compile proxy</title>
|
|
3
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
|
|
6
|
-
<script id="jsenv_inject_systemjs">/*
|
|
7
|
-
* SJS 6.11.0
|
|
8
|
-
* Minimal SystemJS Build
|
|
9
|
-
*/
|
|
10
|
-
(function () {
|
|
11
|
-
|
|
12
|
-
function errMsg(errCode, msg) {
|
|
13
|
-
return (msg || "") + " (SystemJS https://git.io/JvFET#" + errCode + ")";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
var hasSymbol = typeof Symbol !== 'undefined';
|
|
17
|
-
var hasSelf = typeof self !== 'undefined';
|
|
18
|
-
var hasDocument = typeof document !== 'undefined';
|
|
19
|
-
|
|
20
|
-
var envGlobal = hasSelf ? self : global;
|
|
21
|
-
|
|
22
|
-
var baseUrl;
|
|
23
|
-
|
|
24
|
-
if (hasDocument) {
|
|
25
|
-
var baseEl = document.querySelector('base[href]');
|
|
26
|
-
if (baseEl)
|
|
27
|
-
baseUrl = baseEl.href;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (!baseUrl && typeof location !== 'undefined') {
|
|
31
|
-
baseUrl = location.href.split('#')[0].split('?')[0];
|
|
32
|
-
var lastSepIndex = baseUrl.lastIndexOf('/');
|
|
33
|
-
if (lastSepIndex !== -1)
|
|
34
|
-
baseUrl = baseUrl.slice(0, lastSepIndex + 1);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var backslashRegEx = /\\/g;
|
|
38
|
-
function resolveIfNotPlainOrUrl (relUrl, parentUrl) {
|
|
39
|
-
if (relUrl.indexOf('\\') !== -1)
|
|
40
|
-
relUrl = relUrl.replace(backslashRegEx, '/');
|
|
41
|
-
// protocol-relative
|
|
42
|
-
if (relUrl[0] === '/' && relUrl[1] === '/') {
|
|
43
|
-
return parentUrl.slice(0, parentUrl.indexOf(':') + 1) + relUrl;
|
|
44
|
-
}
|
|
45
|
-
// relative-url
|
|
46
|
-
else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
|
|
47
|
-
relUrl.length === 1 && (relUrl += '/')) ||
|
|
48
|
-
relUrl[0] === '/') {
|
|
49
|
-
var parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1);
|
|
50
|
-
// Disabled, but these cases will give inconsistent results for deep backtracking
|
|
51
|
-
//if (parentUrl[parentProtocol.length] !== '/')
|
|
52
|
-
// throw Error('Cannot resolve');
|
|
53
|
-
// read pathname from parent URL
|
|
54
|
-
// pathname taken to be part after leading "/"
|
|
55
|
-
var pathname;
|
|
56
|
-
if (parentUrl[parentProtocol.length + 1] === '/') {
|
|
57
|
-
// resolving to a :// so we need to read out the auth and host
|
|
58
|
-
if (parentProtocol !== 'file:') {
|
|
59
|
-
pathname = parentUrl.slice(parentProtocol.length + 2);
|
|
60
|
-
pathname = pathname.slice(pathname.indexOf('/') + 1);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
pathname = parentUrl.slice(8);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
// resolving to :/ so pathname is the /... part
|
|
68
|
-
pathname = parentUrl.slice(parentProtocol.length + (parentUrl[parentProtocol.length] === '/'));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (relUrl[0] === '/')
|
|
72
|
-
return parentUrl.slice(0, parentUrl.length - pathname.length - 1) + relUrl;
|
|
73
|
-
|
|
74
|
-
// join together and split for removal of .. and . segments
|
|
75
|
-
// looping the string instead of anything fancy for perf reasons
|
|
76
|
-
// '../../../../../z' resolved to 'x/y' is just 'z'
|
|
77
|
-
var segmented = pathname.slice(0, pathname.lastIndexOf('/') + 1) + relUrl;
|
|
78
|
-
|
|
79
|
-
var output = [];
|
|
80
|
-
var segmentIndex = -1;
|
|
81
|
-
for (var i = 0; i < segmented.length; i++) {
|
|
82
|
-
// busy reading a segment - only terminate on '/'
|
|
83
|
-
if (segmentIndex !== -1) {
|
|
84
|
-
if (segmented[i] === '/') {
|
|
85
|
-
output.push(segmented.slice(segmentIndex, i + 1));
|
|
86
|
-
segmentIndex = -1;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// new segment - check if it is relative
|
|
91
|
-
else if (segmented[i] === '.') {
|
|
92
|
-
// ../ segment
|
|
93
|
-
if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {
|
|
94
|
-
output.pop();
|
|
95
|
-
i += 2;
|
|
96
|
-
}
|
|
97
|
-
// ./ segment
|
|
98
|
-
else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {
|
|
99
|
-
i += 1;
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
// the start of a new segment as below
|
|
103
|
-
segmentIndex = i;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// it is the start of a new segment
|
|
107
|
-
else {
|
|
108
|
-
segmentIndex = i;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
// finish reading out the last segment
|
|
112
|
-
if (segmentIndex !== -1)
|
|
113
|
-
output.push(segmented.slice(segmentIndex));
|
|
114
|
-
return parentUrl.slice(0, parentUrl.length - pathname.length) + output.join('');
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/*
|
|
119
|
-
* Import maps implementation
|
|
120
|
-
*
|
|
121
|
-
* To make lookups fast we pre-resolve the entire import map
|
|
122
|
-
* and then match based on backtracked hash lookups
|
|
123
|
-
*
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
function resolveUrl (relUrl, parentUrl) {
|
|
127
|
-
return resolveIfNotPlainOrUrl(relUrl, parentUrl) || (relUrl.indexOf(':') !== -1 ? relUrl : resolveIfNotPlainOrUrl('./' + relUrl, parentUrl));
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function resolveAndComposePackages (packages, outPackages, baseUrl, parentMap, parentUrl) {
|
|
131
|
-
for (var p in packages) {
|
|
132
|
-
var resolvedLhs = resolveIfNotPlainOrUrl(p, baseUrl) || p;
|
|
133
|
-
var rhs = packages[p];
|
|
134
|
-
// package fallbacks not currently supported
|
|
135
|
-
if (typeof rhs !== 'string')
|
|
136
|
-
continue;
|
|
137
|
-
var mapped = resolveImportMap(parentMap, resolveIfNotPlainOrUrl(rhs, baseUrl) || rhs, parentUrl);
|
|
138
|
-
if (!mapped) {
|
|
139
|
-
targetWarning('W1', p, rhs);
|
|
140
|
-
}
|
|
141
|
-
else
|
|
142
|
-
outPackages[resolvedLhs] = mapped;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
function resolveAndComposeImportMap (json, baseUrl, outMap) {
|
|
147
|
-
if (json.imports)
|
|
148
|
-
resolveAndComposePackages(json.imports, outMap.imports, baseUrl, outMap, null);
|
|
149
|
-
|
|
150
|
-
var u;
|
|
151
|
-
for (u in json.scopes || {}) {
|
|
152
|
-
var resolvedScope = resolveUrl(u, baseUrl);
|
|
153
|
-
resolveAndComposePackages(json.scopes[u], outMap.scopes[resolvedScope] || (outMap.scopes[resolvedScope] = {}), baseUrl, outMap, resolvedScope);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
for (u in json.depcache || {})
|
|
157
|
-
outMap.depcache[resolveUrl(u, baseUrl)] = json.depcache[u];
|
|
158
|
-
|
|
159
|
-
for (u in json.integrity || {})
|
|
160
|
-
outMap.integrity[resolveUrl(u, baseUrl)] = json.integrity[u];
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function getMatch (path, matchObj) {
|
|
164
|
-
if (matchObj[path])
|
|
165
|
-
return path;
|
|
166
|
-
var sepIndex = path.length;
|
|
167
|
-
do {
|
|
168
|
-
var segment = path.slice(0, sepIndex + 1);
|
|
169
|
-
if (segment in matchObj)
|
|
170
|
-
return segment;
|
|
171
|
-
} while ((sepIndex = path.lastIndexOf('/', sepIndex - 1)) !== -1)
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function applyPackages (id, packages) {
|
|
175
|
-
var pkgName = getMatch(id, packages);
|
|
176
|
-
if (pkgName) {
|
|
177
|
-
var pkg = packages[pkgName];
|
|
178
|
-
if (pkg === null) return;
|
|
179
|
-
if (id.length > pkgName.length && pkg[pkg.length - 1] !== '/') {
|
|
180
|
-
targetWarning('W2', pkgName, pkg);
|
|
181
|
-
}
|
|
182
|
-
else
|
|
183
|
-
return pkg + id.slice(pkgName.length);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function targetWarning (code, match, target, msg) {
|
|
188
|
-
console.warn(errMsg(code, [target, match].join(', ') ));
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function resolveImportMap (importMap, resolvedOrPlain, parentUrl) {
|
|
192
|
-
var scopes = importMap.scopes;
|
|
193
|
-
var scopeUrl = parentUrl && getMatch(parentUrl, scopes);
|
|
194
|
-
while (scopeUrl) {
|
|
195
|
-
var packageResolution = applyPackages(resolvedOrPlain, scopes[scopeUrl]);
|
|
196
|
-
if (packageResolution)
|
|
197
|
-
return packageResolution;
|
|
198
|
-
scopeUrl = getMatch(scopeUrl.slice(0, scopeUrl.lastIndexOf('/')), scopes);
|
|
199
|
-
}
|
|
200
|
-
return applyPackages(resolvedOrPlain, importMap.imports) || resolvedOrPlain.indexOf(':') !== -1 && resolvedOrPlain;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/*
|
|
204
|
-
* SystemJS Core
|
|
205
|
-
*
|
|
206
|
-
* Provides
|
|
207
|
-
* - System.import
|
|
208
|
-
* - System.register support for
|
|
209
|
-
* live bindings, function hoisting through circular references,
|
|
210
|
-
* reexports, dynamic import, import.meta.url, top-level await
|
|
211
|
-
* - System.getRegister to get the registration
|
|
212
|
-
* - Symbol.toStringTag support in Module objects
|
|
213
|
-
* - Hookable System.createContext to customize import.meta
|
|
214
|
-
* - System.onload(err, id, deps) handler for tracing / hot-reloading
|
|
215
|
-
*
|
|
216
|
-
* Core comes with no System.prototype.resolve or
|
|
217
|
-
* System.prototype.instantiate implementations
|
|
218
|
-
*/
|
|
219
|
-
|
|
220
|
-
var toStringTag = hasSymbol && Symbol.toStringTag;
|
|
221
|
-
var REGISTRY = hasSymbol ? Symbol() : '@';
|
|
222
|
-
|
|
223
|
-
function SystemJS () {
|
|
224
|
-
this[REGISTRY] = {};
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
var systemJSPrototype = SystemJS.prototype;
|
|
228
|
-
|
|
229
|
-
systemJSPrototype.import = function (id, parentUrl) {
|
|
230
|
-
var loader = this;
|
|
231
|
-
return Promise.resolve(loader.prepareImport())
|
|
232
|
-
.then(function() {
|
|
233
|
-
return loader.resolve(String(id), parentUrl);
|
|
234
|
-
})
|
|
235
|
-
.then(function (id) {
|
|
236
|
-
var load = getOrCreateLoad(loader, id);
|
|
237
|
-
return load.C || topLevelLoad(loader, load);
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
// Hookable createContext function -> allowing eg custom import meta
|
|
242
|
-
systemJSPrototype.createContext = function (parentId) {
|
|
243
|
-
var loader = this;
|
|
244
|
-
return {
|
|
245
|
-
url: parentId,
|
|
246
|
-
resolve: function (id, parentUrl) {
|
|
247
|
-
return Promise.resolve(loader.resolve(id, parentUrl || parentId));
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
function loadToId (load) {
|
|
252
|
-
return load.id;
|
|
253
|
-
}
|
|
254
|
-
function triggerOnload (loader, load, err, isErrSource) {
|
|
255
|
-
loader.onload(err, load.id, load.d && load.d.map(loadToId), !!isErrSource);
|
|
256
|
-
if (err)
|
|
257
|
-
throw err;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
var lastRegister;
|
|
261
|
-
systemJSPrototype.register = function (deps, declare) {
|
|
262
|
-
lastRegister = [deps, declare];
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
/*
|
|
266
|
-
* getRegister provides the last anonymous System.register call
|
|
267
|
-
*/
|
|
268
|
-
systemJSPrototype.getRegister = function () {
|
|
269
|
-
var _lastRegister = lastRegister;
|
|
270
|
-
lastRegister = undefined;
|
|
271
|
-
return _lastRegister;
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
function getOrCreateLoad (loader, id, firstParentUrl) {
|
|
275
|
-
var load = loader[REGISTRY][id];
|
|
276
|
-
if (load)
|
|
277
|
-
return load;
|
|
278
|
-
|
|
279
|
-
var importerSetters = [];
|
|
280
|
-
var ns = Object.create(null);
|
|
281
|
-
if (toStringTag)
|
|
282
|
-
Object.defineProperty(ns, toStringTag, { value: 'Module' });
|
|
283
|
-
|
|
284
|
-
var instantiatePromise = Promise.resolve()
|
|
285
|
-
.then(function () {
|
|
286
|
-
return loader.instantiate(id, firstParentUrl);
|
|
287
|
-
})
|
|
288
|
-
.then(function (registration) {
|
|
289
|
-
if (!registration)
|
|
290
|
-
throw Error(errMsg(2, id ));
|
|
291
|
-
function _export (name, value) {
|
|
292
|
-
// note if we have hoisted exports (including reexports)
|
|
293
|
-
load.h = true;
|
|
294
|
-
var changed = false;
|
|
295
|
-
if (typeof name === 'string') {
|
|
296
|
-
if (!(name in ns) || ns[name] !== value) {
|
|
297
|
-
ns[name] = value;
|
|
298
|
-
changed = true;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
else {
|
|
302
|
-
for (var p in name) {
|
|
303
|
-
var value = name[p];
|
|
304
|
-
if (!(p in ns) || ns[p] !== value) {
|
|
305
|
-
ns[p] = value;
|
|
306
|
-
changed = true;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
if (name && name.__esModule) {
|
|
311
|
-
ns.__esModule = name.__esModule;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
if (changed)
|
|
315
|
-
for (var i = 0; i < importerSetters.length; i++) {
|
|
316
|
-
var setter = importerSetters[i];
|
|
317
|
-
if (setter) setter(ns);
|
|
318
|
-
}
|
|
319
|
-
return value;
|
|
320
|
-
}
|
|
321
|
-
var declared = registration[1](_export, registration[1].length === 2 ? {
|
|
322
|
-
import: function (importId) {
|
|
323
|
-
return loader.import(importId, id);
|
|
324
|
-
},
|
|
325
|
-
meta: loader.createContext(id)
|
|
326
|
-
} : undefined);
|
|
327
|
-
load.e = declared.execute || function () {};
|
|
328
|
-
return [registration[0], declared.setters || []];
|
|
329
|
-
}, function (err) {
|
|
330
|
-
load.e = null;
|
|
331
|
-
load.er = err;
|
|
332
|
-
throw err;
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
var linkPromise = instantiatePromise
|
|
336
|
-
.then(function (instantiation) {
|
|
337
|
-
return Promise.all(instantiation[0].map(function (dep, i) {
|
|
338
|
-
var setter = instantiation[1][i];
|
|
339
|
-
return Promise.resolve(loader.resolve(dep, id))
|
|
340
|
-
.then(function (depId) {
|
|
341
|
-
var depLoad = getOrCreateLoad(loader, depId, id);
|
|
342
|
-
// depLoad.I may be undefined for already-evaluated
|
|
343
|
-
return Promise.resolve(depLoad.I)
|
|
344
|
-
.then(function () {
|
|
345
|
-
if (setter) {
|
|
346
|
-
depLoad.i.push(setter);
|
|
347
|
-
// only run early setters when there are hoisted exports of that module
|
|
348
|
-
// the timing works here as pending hoisted export calls will trigger through importerSetters
|
|
349
|
-
if (depLoad.h || !depLoad.I)
|
|
350
|
-
setter(depLoad.n);
|
|
351
|
-
}
|
|
352
|
-
return depLoad;
|
|
353
|
-
});
|
|
354
|
-
});
|
|
355
|
-
}))
|
|
356
|
-
.then(function (depLoads) {
|
|
357
|
-
load.d = depLoads;
|
|
358
|
-
});
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
// Capital letter = a promise function
|
|
362
|
-
return load = loader[REGISTRY][id] = {
|
|
363
|
-
id: id,
|
|
364
|
-
// importerSetters, the setters functions registered to this dependency
|
|
365
|
-
// we retain this to add more later
|
|
366
|
-
i: importerSetters,
|
|
367
|
-
// module namespace object
|
|
368
|
-
n: ns,
|
|
369
|
-
|
|
370
|
-
// instantiate
|
|
371
|
-
I: instantiatePromise,
|
|
372
|
-
// link
|
|
373
|
-
L: linkPromise,
|
|
374
|
-
// whether it has hoisted exports
|
|
375
|
-
h: false,
|
|
376
|
-
|
|
377
|
-
// On instantiate completion we have populated:
|
|
378
|
-
// dependency load records
|
|
379
|
-
d: undefined,
|
|
380
|
-
// execution function
|
|
381
|
-
e: undefined,
|
|
382
|
-
|
|
383
|
-
// On execution we have populated:
|
|
384
|
-
// the execution error if any
|
|
385
|
-
er: undefined,
|
|
386
|
-
// in the case of TLA, the execution promise
|
|
387
|
-
E: undefined,
|
|
388
|
-
|
|
389
|
-
// On execution, L, I, E cleared
|
|
390
|
-
|
|
391
|
-
// Promise for top-level completion
|
|
392
|
-
C: undefined,
|
|
393
|
-
|
|
394
|
-
// parent instantiator / executor
|
|
395
|
-
p: undefined
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
function instantiateAll (loader, load, parent, loaded) {
|
|
400
|
-
if (!loaded[load.id]) {
|
|
401
|
-
loaded[load.id] = true;
|
|
402
|
-
// load.L may be undefined for already-instantiated
|
|
403
|
-
return Promise.resolve(load.L)
|
|
404
|
-
.then(function () {
|
|
405
|
-
if (!load.p || load.p.e === null)
|
|
406
|
-
load.p = parent;
|
|
407
|
-
return Promise.all(load.d.map(function (dep) {
|
|
408
|
-
return instantiateAll(loader, dep, parent, loaded);
|
|
409
|
-
}));
|
|
410
|
-
})
|
|
411
|
-
.catch(function (err) {
|
|
412
|
-
if (load.er)
|
|
413
|
-
throw err;
|
|
414
|
-
load.e = null;
|
|
415
|
-
throw err;
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
function topLevelLoad (loader, load) {
|
|
421
|
-
return load.C = instantiateAll(loader, load, load, {})
|
|
422
|
-
.then(function () {
|
|
423
|
-
return postOrderExec(loader, load, {});
|
|
424
|
-
})
|
|
425
|
-
.then(function () {
|
|
426
|
-
return load.n;
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
// the closest we can get to call(undefined)
|
|
431
|
-
var nullContext = Object.freeze(Object.create(null));
|
|
432
|
-
|
|
433
|
-
// returns a promise if and only if a top-level await subgraph
|
|
434
|
-
// throws on sync errors
|
|
435
|
-
function postOrderExec (loader, load, seen) {
|
|
436
|
-
if (seen[load.id])
|
|
437
|
-
return;
|
|
438
|
-
seen[load.id] = true;
|
|
439
|
-
|
|
440
|
-
if (!load.e) {
|
|
441
|
-
if (load.er)
|
|
442
|
-
throw load.er;
|
|
443
|
-
if (load.E)
|
|
444
|
-
return load.E;
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
// deps execute first, unless circular
|
|
449
|
-
var depLoadPromises;
|
|
450
|
-
load.d.forEach(function (depLoad) {
|
|
451
|
-
try {
|
|
452
|
-
var depLoadPromise = postOrderExec(loader, depLoad, seen);
|
|
453
|
-
if (depLoadPromise)
|
|
454
|
-
(depLoadPromises = depLoadPromises || []).push(depLoadPromise);
|
|
455
|
-
}
|
|
456
|
-
catch (err) {
|
|
457
|
-
load.e = null;
|
|
458
|
-
load.er = err;
|
|
459
|
-
throw err;
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
if (depLoadPromises)
|
|
463
|
-
return Promise.all(depLoadPromises).then(doExec);
|
|
464
|
-
|
|
465
|
-
return doExec();
|
|
466
|
-
|
|
467
|
-
function doExec () {
|
|
468
|
-
try {
|
|
469
|
-
var execPromise = load.e.call(nullContext);
|
|
470
|
-
if (execPromise) {
|
|
471
|
-
execPromise = execPromise.then(function () {
|
|
472
|
-
load.C = load.n;
|
|
473
|
-
load.E = null; // indicates completion
|
|
474
|
-
if (!true) ;
|
|
475
|
-
}, function (err) {
|
|
476
|
-
load.er = err;
|
|
477
|
-
load.E = null;
|
|
478
|
-
if (!true) ;
|
|
479
|
-
throw err;
|
|
480
|
-
});
|
|
481
|
-
return load.E = execPromise;
|
|
482
|
-
}
|
|
483
|
-
// (should be a promise, but a minify optimization to leave out Promise.resolve)
|
|
484
|
-
load.C = load.n;
|
|
485
|
-
load.L = load.I = undefined;
|
|
486
|
-
}
|
|
487
|
-
catch (err) {
|
|
488
|
-
load.er = err;
|
|
489
|
-
throw err;
|
|
490
|
-
}
|
|
491
|
-
finally {
|
|
492
|
-
load.e = null;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
envGlobal.System = new SystemJS();
|
|
498
|
-
|
|
499
|
-
/*
|
|
500
|
-
* SystemJS browser attachments for script and import map processing
|
|
501
|
-
*/
|
|
502
|
-
|
|
503
|
-
var importMapPromise = Promise.resolve();
|
|
504
|
-
var importMap = { imports: {}, scopes: {}, depcache: {}, integrity: {} };
|
|
505
|
-
systemJSPrototype.importMap = importMap;
|
|
506
|
-
systemJSPrototype.baseUrl = baseUrl;
|
|
507
|
-
|
|
508
|
-
// Scripts are processed immediately, on the first System.import, and on DOMReady.
|
|
509
|
-
// Import map scripts are processed only once (by being marked) and in order for each phase.
|
|
510
|
-
// This is to avoid using DOM mutation observers in core, although that would be an alternative.
|
|
511
|
-
var processFirst = hasDocument;
|
|
512
|
-
systemJSPrototype.prepareImport = function (doProcessScripts) {
|
|
513
|
-
if (processFirst || doProcessScripts) {
|
|
514
|
-
processScripts();
|
|
515
|
-
processFirst = false;
|
|
516
|
-
}
|
|
517
|
-
return importMapPromise;
|
|
518
|
-
};
|
|
519
|
-
if (hasDocument) {
|
|
520
|
-
processScripts();
|
|
521
|
-
window.addEventListener('DOMContentLoaded', processScripts);
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
function processScripts () {
|
|
525
|
-
[].forEach.call(document.querySelectorAll('script'), function (script) {
|
|
526
|
-
if (script.sp) // sp marker = systemjs processed
|
|
527
|
-
return;
|
|
528
|
-
// TODO: deprecate systemjs-module in next major now that we have auto import
|
|
529
|
-
if (script.type === 'systemjs-module') {
|
|
530
|
-
script.sp = true;
|
|
531
|
-
if (!script.src)
|
|
532
|
-
return;
|
|
533
|
-
System.import(script.src.slice(0, 7) === 'import:' ? script.src.slice(7) : resolveUrl(script.src, baseUrl)).catch(function (e) {
|
|
534
|
-
// if there is a script load error, dispatch an "error" event
|
|
535
|
-
// on the script tag.
|
|
536
|
-
if (e.message.indexOf('https://git.io/JvFET#3') > -1) {
|
|
537
|
-
var event = document.createEvent('Event');
|
|
538
|
-
event.initEvent('error', false, false);
|
|
539
|
-
script.dispatchEvent(event);
|
|
540
|
-
}
|
|
541
|
-
return Promise.reject(e);
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
else if (script.type === 'systemjs-importmap') {
|
|
545
|
-
script.sp = true;
|
|
546
|
-
var fetchPromise = script.src ? fetch(script.src, { integrity: script.integrity }).then(function (res) {
|
|
547
|
-
if (!res.ok)
|
|
548
|
-
throw Error( res.status );
|
|
549
|
-
return res.text();
|
|
550
|
-
}).catch(function (err) {
|
|
551
|
-
err.message = errMsg('W4', script.src ) + '\n' + err.message;
|
|
552
|
-
console.warn(err);
|
|
553
|
-
if (typeof script.onerror === 'function') {
|
|
554
|
-
script.onerror();
|
|
555
|
-
}
|
|
556
|
-
return '{}';
|
|
557
|
-
}) : script.innerHTML;
|
|
558
|
-
importMapPromise = importMapPromise.then(function () {
|
|
559
|
-
return fetchPromise;
|
|
560
|
-
}).then(function (text) {
|
|
561
|
-
extendImportMap(importMap, text, script.src || baseUrl);
|
|
562
|
-
return importMap
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
function extendImportMap (importMap, newMapText, newMapUrl) {
|
|
569
|
-
var newMap = {};
|
|
570
|
-
try {
|
|
571
|
-
newMap = JSON.parse(newMapText);
|
|
572
|
-
} catch (err) {
|
|
573
|
-
console.warn(Error(( errMsg('W5') )));
|
|
574
|
-
}
|
|
575
|
-
resolveAndComposeImportMap(newMap, newMapUrl, importMap);
|
|
576
|
-
}
|
|
577
|
-
System.extendImportMap = extendImportMap
|
|
578
|
-
|
|
579
|
-
/*
|
|
580
|
-
* Script instantiation loading
|
|
581
|
-
*/
|
|
582
|
-
|
|
583
|
-
if (hasDocument) {
|
|
584
|
-
window.addEventListener('error', function (evt) {
|
|
585
|
-
lastWindowErrorUrl = evt.filename;
|
|
586
|
-
lastWindowError = evt.error;
|
|
587
|
-
});
|
|
588
|
-
var baseOrigin = location.origin;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
systemJSPrototype.createScript = function (url) {
|
|
592
|
-
var script = document.createElement('script');
|
|
593
|
-
script.async = true;
|
|
594
|
-
// Only add cross origin for actual cross origin
|
|
595
|
-
// this is because Safari triggers for all
|
|
596
|
-
// - https://bugs.webkit.org/show_bug.cgi?id=171566
|
|
597
|
-
if (url.indexOf(baseOrigin + '/'))
|
|
598
|
-
script.crossOrigin = 'anonymous';
|
|
599
|
-
var integrity = importMap.integrity[url];
|
|
600
|
-
if (integrity)
|
|
601
|
-
script.integrity = integrity;
|
|
602
|
-
script.src = url;
|
|
603
|
-
return script;
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
// Auto imports -> script tags can be inlined directly for load phase
|
|
607
|
-
var lastAutoImportDeps, lastAutoImportTimeout;
|
|
608
|
-
var autoImportCandidates = {};
|
|
609
|
-
var systemRegister = systemJSPrototype.register;
|
|
610
|
-
var inlineScriptCount = 0;
|
|
611
|
-
systemJSPrototype.register = function (deps, declare, autoUrl) {
|
|
612
|
-
if (hasDocument && document.readyState === 'loading' && typeof deps !== 'string') {
|
|
613
|
-
var scripts = document.querySelectorAll('script[src]');
|
|
614
|
-
var lastScript = scripts[scripts.length - 1];
|
|
615
|
-
var lastAutoImportUrl
|
|
616
|
-
lastAutoImportDeps = deps;
|
|
617
|
-
if (lastScript && lastScript.src) {
|
|
618
|
-
lastAutoImportUrl = lastScript.src;
|
|
619
|
-
}
|
|
620
|
-
else if (autoUrl) {
|
|
621
|
-
lastAutoImportUrl = autoUrl
|
|
622
|
-
}
|
|
623
|
-
else {
|
|
624
|
-
inlineScriptCount++
|
|
625
|
-
lastAutoImportUrl = document.location.href + "__inline_script__" + inlineScriptCount;
|
|
626
|
-
}
|
|
627
|
-
// if this is already a System load, then the instantiate has already begun
|
|
628
|
-
// so this re-import has no consequence
|
|
629
|
-
var loader = this;
|
|
630
|
-
lastAutoImportTimeout = setTimeout(function () {
|
|
631
|
-
autoImportCandidates[lastAutoImportUrl] = [deps, declare];
|
|
632
|
-
loader.import(lastAutoImportUrl);
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
else {
|
|
636
|
-
lastAutoImportDeps = undefined;
|
|
637
|
-
}
|
|
638
|
-
return systemRegister.call(this, deps, declare);
|
|
639
|
-
};
|
|
640
|
-
|
|
641
|
-
var lastWindowErrorUrl, lastWindowError;
|
|
642
|
-
systemJSPrototype.instantiate = function (url, firstParentUrl) {
|
|
643
|
-
var autoImportRegistration = autoImportCandidates[url];
|
|
644
|
-
if (autoImportRegistration) {
|
|
645
|
-
delete autoImportCandidates[url];
|
|
646
|
-
return autoImportRegistration;
|
|
647
|
-
}
|
|
648
|
-
var loader = this;
|
|
649
|
-
return Promise.resolve(systemJSPrototype.createScript(url)).then(function (script) {
|
|
650
|
-
return new Promise(function (resolve, reject) {
|
|
651
|
-
script.addEventListener('error', function () {
|
|
652
|
-
reject(Error(errMsg(3, [url, firstParentUrl].join(', ') )));
|
|
653
|
-
});
|
|
654
|
-
script.addEventListener('load', function () {
|
|
655
|
-
document.head.removeChild(script);
|
|
656
|
-
// Note that if an error occurs that isn't caught by this if statement,
|
|
657
|
-
// that getRegister will return null and a "did not instantiate" error will be thrown.
|
|
658
|
-
if (lastWindowErrorUrl === url) {
|
|
659
|
-
reject(lastWindowError);
|
|
660
|
-
}
|
|
661
|
-
else {
|
|
662
|
-
var register = loader.getRegister(url);
|
|
663
|
-
// Clear any auto import registration for dynamic import scripts during load
|
|
664
|
-
if (register && register[0] === lastAutoImportDeps)
|
|
665
|
-
clearTimeout(lastAutoImportTimeout);
|
|
666
|
-
resolve(register);
|
|
667
|
-
}
|
|
668
|
-
});
|
|
669
|
-
document.head.appendChild(script);
|
|
670
|
-
});
|
|
671
|
-
});
|
|
672
|
-
};
|
|
673
|
-
|
|
674
|
-
/*
|
|
675
|
-
* Fetch loader, sets up shouldFetch and fetch hooks
|
|
676
|
-
*/
|
|
677
|
-
systemJSPrototype.shouldFetch = function () {
|
|
678
|
-
return false;
|
|
679
|
-
};
|
|
680
|
-
if (typeof fetch !== 'undefined')
|
|
681
|
-
systemJSPrototype.fetch = fetch;
|
|
682
|
-
|
|
683
|
-
var instantiate = systemJSPrototype.instantiate;
|
|
684
|
-
var jsContentTypeRegEx = /^(text|application)\/(x-)?javascript(;|$)/;
|
|
685
|
-
systemJSPrototype.instantiate = function (url, parent) {
|
|
686
|
-
var loader = this;
|
|
687
|
-
if (!this.shouldFetch(url))
|
|
688
|
-
return instantiate.apply(this, arguments);
|
|
689
|
-
return this.fetch(url, {
|
|
690
|
-
credentials: 'same-origin',
|
|
691
|
-
integrity: importMap.integrity[url]
|
|
692
|
-
})
|
|
693
|
-
.then(function (res) {
|
|
694
|
-
if (!res.ok)
|
|
695
|
-
throw Error(errMsg(7, [res.status, res.statusText, url, parent].join(', ') ));
|
|
696
|
-
var contentType = res.headers.get('content-type');
|
|
697
|
-
if (!contentType || !jsContentTypeRegEx.test(contentType))
|
|
698
|
-
throw Error(errMsg(4, contentType ));
|
|
699
|
-
return res.text().then(function (source) {
|
|
700
|
-
if (source.indexOf('//# sourceURL=') < 0)
|
|
701
|
-
source += '\n//# sourceURL=' + url;
|
|
702
|
-
(0, eval)(source);
|
|
703
|
-
return loader.getRegister(url);
|
|
704
|
-
});
|
|
705
|
-
});
|
|
706
|
-
};
|
|
707
|
-
|
|
708
|
-
systemJSPrototype.resolve = function (id, parentUrl) {
|
|
709
|
-
parentUrl = parentUrl || !true || baseUrl;
|
|
710
|
-
return resolveImportMap(( importMap), resolveIfNotPlainOrUrl(id, parentUrl) || id, parentUrl) || throwUnresolved(id, parentUrl);
|
|
711
|
-
};
|
|
712
|
-
|
|
713
|
-
function throwUnresolved (id, parentUrl) {
|
|
714
|
-
throw Error(errMsg(8, [id, parentUrl].join(', ') ));
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
var systemInstantiate = systemJSPrototype.instantiate;
|
|
718
|
-
systemJSPrototype.instantiate = function (url, firstParentUrl) {
|
|
719
|
-
var preloads = ( importMap).depcache[url];
|
|
720
|
-
if (preloads) {
|
|
721
|
-
for (var i = 0; i < preloads.length; i++)
|
|
722
|
-
getOrCreateLoad(this, this.resolve(preloads[i], url), url);
|
|
723
|
-
}
|
|
724
|
-
return systemInstantiate.call(this, url, firstParentUrl);
|
|
725
|
-
};
|
|
726
|
-
|
|
727
|
-
/*
|
|
728
|
-
* Supports loading System.register in workers
|
|
729
|
-
*/
|
|
730
|
-
|
|
731
|
-
if (hasSelf && typeof importScripts === 'function') {
|
|
732
|
-
systemJSPrototype.instantiate = function (url) {
|
|
733
|
-
var loader = this;
|
|
734
|
-
return self.fetch(url, {
|
|
735
|
-
credentials: 'same-origin',
|
|
736
|
-
}).then(function (response) {
|
|
737
|
-
if (!response.ok) {
|
|
738
|
-
throw Error(errMsg(7, [response.status, response.statusText, url].join(', ') ));
|
|
739
|
-
}
|
|
740
|
-
return response.text()
|
|
741
|
-
}).then(function (source) {
|
|
742
|
-
if (source.indexOf('//# sourceURL=') < 0) source += '\n//# sourceURL=' + url;
|
|
743
|
-
(0, eval)(source);
|
|
744
|
-
return loader.getRegister(url);
|
|
745
|
-
})
|
|
746
|
-
};
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
}());
|
|
750
|
-
|
|
751
|
-
(function(){
|
|
752
|
-
var envGlobal = typeof self !== 'undefined' ? self : global;
|
|
753
|
-
var System = envGlobal.System;
|
|
754
|
-
|
|
755
|
-
var registerRegistry = Object.create(null)
|
|
756
|
-
var register = System.register;
|
|
757
|
-
System.registerRegistry = registerRegistry;
|
|
758
|
-
System.register = function (name, deps, declare) {
|
|
759
|
-
if (typeof name !== 'string') return register.apply(this, arguments);
|
|
760
|
-
var define = [deps, declare];
|
|
761
|
-
return System.prepareImport().then(function () {
|
|
762
|
-
var url = System.resolve(`./${name}`);
|
|
763
|
-
registerRegistry[url] = define;
|
|
764
|
-
return register.call(System, deps, declare, url);
|
|
765
|
-
})
|
|
766
|
-
};
|
|
767
|
-
|
|
768
|
-
var instantiate = System.instantiate;
|
|
769
|
-
System.instantiate = function (url, firstParentUrl) {
|
|
770
|
-
var result = registerRegistry[url];
|
|
771
|
-
|
|
772
|
-
if (result) {
|
|
773
|
-
registerRegistry[url] = null;
|
|
774
|
-
return result;
|
|
775
|
-
} else {
|
|
776
|
-
return instantiate.call(this, url, firstParentUrl);
|
|
777
|
-
}
|
|
778
|
-
};
|
|
779
|
-
|
|
780
|
-
var getRegister = System.getRegister;
|
|
781
|
-
System.getRegister = function (url) {
|
|
782
|
-
// Calling getRegister() because other extras need to know it was called so they can perform side effects
|
|
783
|
-
var register = getRegister.call(this, url);
|
|
784
|
-
var result = registerRegistry[url] || register;
|
|
785
|
-
return result;
|
|
786
|
-
};
|
|
787
|
-
}());
|
|
788
|
-
|
|
789
|
-
(function () {
|
|
790
|
-
// worker or service worker
|
|
791
|
-
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {
|
|
792
|
-
var importMapFromParentPromise = new Promise((resolve) => {
|
|
793
|
-
var importmapMessageCallback = function (e) {
|
|
794
|
-
if (e.data === "__importmap_init__") {
|
|
795
|
-
self.removeEventListener("message", importmapMessageCallback)
|
|
796
|
-
e.ports[0].onmessage = (message) => {
|
|
797
|
-
resolve(message.data)
|
|
798
|
-
}
|
|
799
|
-
e.ports[0].postMessage('__importmap_request__')
|
|
800
|
-
}
|
|
801
|
-
};
|
|
802
|
-
self.addEventListener("message", importmapMessageCallback)
|
|
803
|
-
})
|
|
804
|
-
// var prepareImport = System.prepareImport
|
|
805
|
-
System.prepareImport = function () {
|
|
806
|
-
return importMapFromParentPromise.then(function (importmap) {
|
|
807
|
-
System.extendImportMap(System.importMap, JSON.stringify(importmap), System.baseUrl)
|
|
808
|
-
})
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
// auto import first register
|
|
812
|
-
var messageEvents = []
|
|
813
|
-
var messageCallback = (event) => {
|
|
814
|
-
messageEvents.push(event)
|
|
815
|
-
}
|
|
816
|
-
self.addEventListener('message', messageCallback)
|
|
817
|
-
var register = System.register;
|
|
818
|
-
System.register = function(deps, declare) {
|
|
819
|
-
System.register = register;
|
|
820
|
-
System.registerRegistry[self.location.href] = [deps, declare];
|
|
821
|
-
return System.import(self.location.href).then((result) => {
|
|
822
|
-
self.removeEventListener('message', messageCallback)
|
|
823
|
-
messageEvents.forEach((messageEvent) => {
|
|
824
|
-
self.dispatchEvent(messageEvent)
|
|
825
|
-
})
|
|
826
|
-
messageEvents = null
|
|
827
|
-
return result
|
|
828
|
-
})
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
else if (typeof window === 'object') {
|
|
832
|
-
var WorkerConstructor = window.Worker;
|
|
833
|
-
if (typeof WorkerConstructor === 'function') {
|
|
834
|
-
window.Worker = function (url, options) {
|
|
835
|
-
var worker = new WorkerConstructor(url, options);
|
|
836
|
-
var importmapChannel = new MessageChannel();
|
|
837
|
-
importmapChannel.port1.onmessage = function (message) {
|
|
838
|
-
System.prepareImport().then(function (importmap) {
|
|
839
|
-
message.target.postMessage(importmap);
|
|
840
|
-
});
|
|
841
|
-
}
|
|
842
|
-
worker.postMessage('__importmap_init__', [importmapChannel.port2]);
|
|
843
|
-
return worker
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
var serviceWorker = navigator.serviceWorker;
|
|
848
|
-
if (serviceWorker) {
|
|
849
|
-
var register = serviceWorker.register;
|
|
850
|
-
serviceWorker.register = function(url, options) {
|
|
851
|
-
var registrationPromise = register.call(this, url, options);
|
|
852
|
-
registrationPromise.then(function(registration) {
|
|
853
|
-
var installing = registration.installing;
|
|
854
|
-
var waiting = registration.waiting;
|
|
855
|
-
var active = registration.active;
|
|
856
|
-
var worker = installing || waiting || active;
|
|
857
|
-
var importmapChannel = new MessageChannel();
|
|
858
|
-
importmapChannel.port1.onmessage = function (message) {
|
|
859
|
-
System.prepareImport().then(function (importmap) {
|
|
860
|
-
message.target.postMessage(importmap)
|
|
861
|
-
});
|
|
862
|
-
}
|
|
863
|
-
worker.postMessage('__importmap_init__', [importmapChannel.port2]);
|
|
864
|
-
})
|
|
865
|
-
return registrationPromise
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
}());</script>
|
|
870
|
-
</head>
|
|
871
|
-
|
|
872
|
-
<body>
|
|
873
|
-
<script>
|
|
874
|
-
window.readyPromise = new Promise((resolve) => {
|
|
875
|
-
window.resolveReadyPromise = resolve
|
|
876
|
-
})
|
|
877
|
-
</script>
|
|
878
|
-
<script type="systemjs-importmap">{
|
|
879
|
-
"imports": {}
|
|
880
|
-
}</script>
|
|
881
|
-
<script>System.register("compile_proxy.html__inline__20.js", [], function () {
|
|
882
|
-
'use strict';
|
|
883
|
-
|
|
884
|
-
return {
|
|
885
|
-
execute: function () {
|
|
886
|
-
var _defineProperty = function (obj, key, value) {
|
|
887
|
-
// Shortcircuit the slow defineProperty path when possible.
|
|
888
|
-
// We are trying to avoid issues where setters defined on the
|
|
889
|
-
// prototype cause side effects under the fast path of simple
|
|
890
|
-
// assignment. By checking for existence of the property with
|
|
891
|
-
// the in operator, we can optimize most of this overhead away.
|
|
892
|
-
if (key in obj) {
|
|
893
|
-
Object.defineProperty(obj, key, {
|
|
894
|
-
value: value,
|
|
895
|
-
enumerable: true,
|
|
896
|
-
configurable: true,
|
|
897
|
-
writable: true
|
|
898
|
-
});
|
|
899
|
-
} else {
|
|
900
|
-
obj[key] = value;
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
return obj;
|
|
904
|
-
}; // filters on symbol properties only. Returned string properties are always
|
|
905
|
-
// enumerable. It is good to use in objectSpread.
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
function ownKeys(object, enumerableOnly) {
|
|
909
|
-
var keys = Object.keys(object);
|
|
910
|
-
|
|
911
|
-
if (Object.getOwnPropertySymbols) {
|
|
912
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
913
|
-
|
|
914
|
-
if (enumerableOnly) {
|
|
915
|
-
symbols = symbols.filter(function (sym) {
|
|
916
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
917
|
-
});
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
keys.push.apply(keys, symbols);
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
return keys;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
function _objectSpread2(target) {
|
|
927
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
928
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
929
|
-
|
|
930
|
-
if (i % 2) {
|
|
931
|
-
ownKeys(Object(source), true).forEach(function (key) {
|
|
932
|
-
_defineProperty(target, key, source[key]);
|
|
933
|
-
});
|
|
934
|
-
} else if (Object.getOwnPropertyDescriptors) {
|
|
935
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
936
|
-
} else {
|
|
937
|
-
ownKeys(Object(source)).forEach(function (key) {
|
|
938
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
939
|
-
});
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
return target;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
var objectWithoutPropertiesLoose = function (source, excluded) {
|
|
947
|
-
if (source === null) return {};
|
|
948
|
-
var target = {};
|
|
949
|
-
var sourceKeys = Object.keys(source);
|
|
950
|
-
var key;
|
|
951
|
-
var i;
|
|
952
|
-
|
|
953
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
954
|
-
key = sourceKeys[i];
|
|
955
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
956
|
-
target[key] = source[key];
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
return target;
|
|
960
|
-
};
|
|
961
|
-
|
|
962
|
-
var _objectWithoutProperties = function (source, excluded) {
|
|
963
|
-
if (source === null) return {};
|
|
964
|
-
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
965
|
-
var key;
|
|
966
|
-
var i;
|
|
967
|
-
|
|
968
|
-
if (Object.getOwnPropertySymbols) {
|
|
969
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
970
|
-
|
|
971
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
972
|
-
key = sourceSymbolKeys[i];
|
|
973
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
974
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
975
|
-
target[key] = source[key];
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
return target;
|
|
980
|
-
};
|
|
981
|
-
|
|
982
|
-
var nativeTypeOf = function nativeTypeOf(obj) {
|
|
983
|
-
return typeof obj;
|
|
984
|
-
};
|
|
985
|
-
|
|
986
|
-
var customTypeOf = function customTypeOf(obj) {
|
|
987
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
988
|
-
};
|
|
989
|
-
|
|
990
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? nativeTypeOf : customTypeOf;
|
|
991
|
-
|
|
992
|
-
function _await$8(value, then, direct) {
|
|
993
|
-
if (direct) {
|
|
994
|
-
return then ? then(value) : value;
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
if (!value || !value.then) {
|
|
998
|
-
value = Promise.resolve(value);
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
return then ? value.then(then) : value;
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
function _async$7(f) {
|
|
1005
|
-
return function () {
|
|
1006
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1007
|
-
args[i] = arguments[i];
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
try {
|
|
1011
|
-
return Promise.resolve(f.apply(this, args));
|
|
1012
|
-
} catch (e) {
|
|
1013
|
-
return Promise.reject(e);
|
|
1014
|
-
}
|
|
1015
|
-
};
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
function _call$1(body, then, direct) {
|
|
1019
|
-
if (direct) {
|
|
1020
|
-
return then ? then(body()) : body();
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
try {
|
|
1024
|
-
var result = Promise.resolve(body());
|
|
1025
|
-
return then ? result.then(then) : result;
|
|
1026
|
-
} catch (e) {
|
|
1027
|
-
return Promise.reject(e);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
var fetchUsingXHR = _async$7(function (url) {
|
|
1032
|
-
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
1033
|
-
signal = _ref.signal,
|
|
1034
|
-
_ref$method = _ref.method,
|
|
1035
|
-
method = _ref$method === void 0 ? "GET" : _ref$method,
|
|
1036
|
-
_ref$credentials = _ref.credentials,
|
|
1037
|
-
credentials = _ref$credentials === void 0 ? "same-origin" : _ref$credentials,
|
|
1038
|
-
_ref$headers = _ref.headers,
|
|
1039
|
-
headers = _ref$headers === void 0 ? {} : _ref$headers,
|
|
1040
|
-
_ref$body = _ref.body,
|
|
1041
|
-
body = _ref$body === void 0 ? null : _ref$body;
|
|
1042
|
-
|
|
1043
|
-
var headersPromise = createPromiseAndHooks();
|
|
1044
|
-
var bodyPromise = createPromiseAndHooks();
|
|
1045
|
-
var xhr = new XMLHttpRequest();
|
|
1046
|
-
|
|
1047
|
-
var failure = function failure(error) {
|
|
1048
|
-
// if it was already resolved, we must reject the body promise
|
|
1049
|
-
if (headersPromise.settled) {
|
|
1050
|
-
bodyPromise.reject(error);
|
|
1051
|
-
} else {
|
|
1052
|
-
headersPromise.reject(error);
|
|
1053
|
-
}
|
|
1054
|
-
};
|
|
1055
|
-
|
|
1056
|
-
var cleanup = function cleanup() {
|
|
1057
|
-
xhr.ontimeout = null;
|
|
1058
|
-
xhr.onerror = null;
|
|
1059
|
-
xhr.onload = null;
|
|
1060
|
-
xhr.onreadystatechange = null;
|
|
1061
|
-
};
|
|
1062
|
-
|
|
1063
|
-
xhr.ontimeout = function () {
|
|
1064
|
-
cleanup();
|
|
1065
|
-
failure(new Error("xhr request timeout on ".concat(url, ".")));
|
|
1066
|
-
};
|
|
1067
|
-
|
|
1068
|
-
xhr.onerror = function (error) {
|
|
1069
|
-
cleanup(); // unfortunately with have no clue why it fails
|
|
1070
|
-
// might be cors for instance
|
|
1071
|
-
|
|
1072
|
-
failure(createRequestError(error, {
|
|
1073
|
-
url: url
|
|
1074
|
-
}));
|
|
1075
|
-
};
|
|
1076
|
-
|
|
1077
|
-
xhr.onload = function () {
|
|
1078
|
-
cleanup();
|
|
1079
|
-
bodyPromise.resolve();
|
|
1080
|
-
};
|
|
1081
|
-
|
|
1082
|
-
signal.addEventListener("abort", function () {
|
|
1083
|
-
xhr.abort();
|
|
1084
|
-
var abortError = new Error("aborted");
|
|
1085
|
-
abortError.name = "AbortError";
|
|
1086
|
-
failure(abortError);
|
|
1087
|
-
});
|
|
1088
|
-
|
|
1089
|
-
xhr.onreadystatechange = function () {
|
|
1090
|
-
// https://developer.mozilla.org/fr/docs/Web/API/XMLHttpRequest/readyState
|
|
1091
|
-
var readyState = xhr.readyState;
|
|
1092
|
-
|
|
1093
|
-
if (readyState === 2) {
|
|
1094
|
-
headersPromise.resolve();
|
|
1095
|
-
} else if (readyState === 4) {
|
|
1096
|
-
cleanup();
|
|
1097
|
-
bodyPromise.resolve();
|
|
1098
|
-
}
|
|
1099
|
-
};
|
|
1100
|
-
|
|
1101
|
-
xhr.open(method, url, true);
|
|
1102
|
-
Object.keys(headers).forEach(function (key) {
|
|
1103
|
-
xhr.setRequestHeader(key, headers[key]);
|
|
1104
|
-
});
|
|
1105
|
-
xhr.withCredentials = computeWithCredentials({
|
|
1106
|
-
credentials: credentials,
|
|
1107
|
-
url: url
|
|
1108
|
-
});
|
|
1109
|
-
|
|
1110
|
-
if ("responseType" in xhr && hasBlob) {
|
|
1111
|
-
xhr.responseType = "blob";
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
xhr.send(body);
|
|
1115
|
-
return _await$8(headersPromise, function () {
|
|
1116
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseURL
|
|
1117
|
-
var responseUrl = "responseURL" in xhr ? xhr.responseURL : headers["x-request-url"];
|
|
1118
|
-
var responseStatus = xhr.status;
|
|
1119
|
-
var responseStatusText = xhr.statusText;
|
|
1120
|
-
var responseHeaders = getHeadersFromXHR(xhr);
|
|
1121
|
-
|
|
1122
|
-
var readBody = function readBody() {
|
|
1123
|
-
return _await$8(bodyPromise, function () {
|
|
1124
|
-
var status = xhr.status; // in Chrome on file:/// URLs, status is 0
|
|
1125
|
-
|
|
1126
|
-
if (status === 0) {
|
|
1127
|
-
responseStatus = 200;
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
var body = "response" in xhr ? xhr.response : xhr.responseText;
|
|
1131
|
-
return {
|
|
1132
|
-
responseBody: body,
|
|
1133
|
-
responseBodyType: detectBodyType(body)
|
|
1134
|
-
};
|
|
1135
|
-
});
|
|
1136
|
-
};
|
|
1137
|
-
|
|
1138
|
-
var text = function text() {
|
|
1139
|
-
return _call$1(readBody, function (_ref2) {
|
|
1140
|
-
var responseBody = _ref2.responseBody,
|
|
1141
|
-
responseBodyType = _ref2.responseBodyType;
|
|
1142
|
-
|
|
1143
|
-
if (responseBodyType === "blob") {
|
|
1144
|
-
return blobToText(responseBody);
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
if (responseBodyType === "formData") {
|
|
1148
|
-
throw new Error("could not read FormData body as text");
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
return responseBodyType === "dataView" ? arrayBufferToText(responseBody.buffer) : responseBodyType === "arrayBuffer" ? arrayBufferToText(responseBody) : String(responseBody);
|
|
1152
|
-
});
|
|
1153
|
-
};
|
|
1154
|
-
|
|
1155
|
-
var json = function json() {
|
|
1156
|
-
return _call$1(text, JSON.parse);
|
|
1157
|
-
};
|
|
1158
|
-
|
|
1159
|
-
var blob = _async$7(function () {
|
|
1160
|
-
if (!hasBlob) {
|
|
1161
|
-
throw new Error("blob not supported");
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
return _call$1(readBody, function (_ref3) {
|
|
1165
|
-
var responseBody = _ref3.responseBody,
|
|
1166
|
-
responseBodyType = _ref3.responseBodyType;
|
|
1167
|
-
|
|
1168
|
-
if (responseBodyType === "blob") {
|
|
1169
|
-
return responseBody;
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
if (responseBodyType === "dataView") {
|
|
1173
|
-
return new Blob([cloneBuffer(responseBody.buffer)]);
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
if (responseBodyType === "arrayBuffer") {
|
|
1177
|
-
return new Blob([cloneBuffer(responseBody)]);
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
if (responseBodyType === "formData") {
|
|
1181
|
-
throw new Error("could not read FormData body as blob");
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
return new Blob([String(responseBody)]);
|
|
1185
|
-
});
|
|
1186
|
-
});
|
|
1187
|
-
|
|
1188
|
-
var arrayBuffer = function arrayBuffer() {
|
|
1189
|
-
return _call$1(readBody, function (_ref4) {
|
|
1190
|
-
var responseBody = _ref4.responseBody,
|
|
1191
|
-
responseBodyType = _ref4.responseBodyType;
|
|
1192
|
-
return responseBodyType === "arrayBuffer" ? cloneBuffer(responseBody) : _call$1(blob, blobToArrayBuffer);
|
|
1193
|
-
});
|
|
1194
|
-
};
|
|
1195
|
-
|
|
1196
|
-
var formData = _async$7(function () {
|
|
1197
|
-
if (!hasFormData) {
|
|
1198
|
-
throw new Error("formData not supported");
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
return _call$1(text, textToFormData);
|
|
1202
|
-
});
|
|
1203
|
-
|
|
1204
|
-
return {
|
|
1205
|
-
url: responseUrl,
|
|
1206
|
-
status: responseStatus,
|
|
1207
|
-
statusText: responseStatusText,
|
|
1208
|
-
headers: responseHeaders,
|
|
1209
|
-
text: text,
|
|
1210
|
-
json: json,
|
|
1211
|
-
blob: blob,
|
|
1212
|
-
arrayBuffer: arrayBuffer,
|
|
1213
|
-
formData: formData
|
|
1214
|
-
};
|
|
1215
|
-
});
|
|
1216
|
-
});
|
|
1217
|
-
|
|
1218
|
-
var canUseBlob = function canUseBlob() {
|
|
1219
|
-
if (typeof window.FileReader !== "function") return false;
|
|
1220
|
-
if (typeof window.Blob !== "function") return false;
|
|
1221
|
-
|
|
1222
|
-
try {
|
|
1223
|
-
// eslint-disable-next-line no-new
|
|
1224
|
-
new Blob();
|
|
1225
|
-
return true;
|
|
1226
|
-
} catch (e) {
|
|
1227
|
-
return false;
|
|
1228
|
-
}
|
|
1229
|
-
};
|
|
1230
|
-
|
|
1231
|
-
var hasBlob = canUseBlob();
|
|
1232
|
-
var hasFormData = typeof window.FormData === "function";
|
|
1233
|
-
var hasArrayBuffer = typeof window.ArrayBuffer === "function";
|
|
1234
|
-
var hasSearchParams = typeof window.URLSearchParams === "function";
|
|
1235
|
-
|
|
1236
|
-
var createRequestError = function createRequestError(error, _ref5) {
|
|
1237
|
-
var url = _ref5.url;
|
|
1238
|
-
return new Error("error during xhr request on ".concat(url, ".\n--- error stack ---\n").concat(error.stack));
|
|
1239
|
-
};
|
|
1240
|
-
|
|
1241
|
-
var createPromiseAndHooks = function createPromiseAndHooks() {
|
|
1242
|
-
var resolve;
|
|
1243
|
-
var reject;
|
|
1244
|
-
var promise = new Promise(function (res, rej) {
|
|
1245
|
-
resolve = function resolve(value) {
|
|
1246
|
-
promise.settled = true;
|
|
1247
|
-
res(value);
|
|
1248
|
-
};
|
|
1249
|
-
|
|
1250
|
-
reject = function reject(value) {
|
|
1251
|
-
promise.settled = true;
|
|
1252
|
-
rej(value);
|
|
1253
|
-
};
|
|
1254
|
-
});
|
|
1255
|
-
promise.resolve = resolve;
|
|
1256
|
-
promise.reject = reject;
|
|
1257
|
-
return promise;
|
|
1258
|
-
}; // https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
var computeWithCredentials = function computeWithCredentials(_ref6) {
|
|
1262
|
-
var credentials = _ref6.credentials,
|
|
1263
|
-
url = _ref6.url;
|
|
1264
|
-
|
|
1265
|
-
if (credentials === "same-origin") {
|
|
1266
|
-
return originSameAsGlobalOrigin(url);
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
return credentials === "include";
|
|
1270
|
-
};
|
|
1271
|
-
|
|
1272
|
-
var originSameAsGlobalOrigin = function originSameAsGlobalOrigin(url) {
|
|
1273
|
-
// if we cannot read globalOrigin from window.location.origin, let's consider it's ok
|
|
1274
|
-
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) !== "object") return true;
|
|
1275
|
-
if (_typeof(window.location) !== "object") return true;
|
|
1276
|
-
var globalOrigin = window.location.origin;
|
|
1277
|
-
if (globalOrigin === "null") return true;
|
|
1278
|
-
return hrefToOrigin(url) === globalOrigin;
|
|
1279
|
-
};
|
|
1280
|
-
|
|
1281
|
-
var detectBodyType = function detectBodyType(body) {
|
|
1282
|
-
if (!body) {
|
|
1283
|
-
return "";
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
if (typeof body === "string") {
|
|
1287
|
-
return "text";
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
if (hasBlob && Blob.prototype.isPrototypeOf(body)) {
|
|
1291
|
-
return "blob";
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
if (hasFormData && FormData.prototype.isPrototypeOf(body)) {
|
|
1295
|
-
return "formData";
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
if (hasArrayBuffer) {
|
|
1299
|
-
if (hasBlob && isDataView(body)) {
|
|
1300
|
-
return "dataView";
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
if (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body)) {
|
|
1304
|
-
return "arrayBuffer";
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
if (hasSearchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
|
1309
|
-
return "searchParams";
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
return "";
|
|
1313
|
-
}; // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders#Example
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
var getHeadersFromXHR = function getHeadersFromXHR(xhr) {
|
|
1317
|
-
var headerMap = {};
|
|
1318
|
-
var headersString = xhr.getAllResponseHeaders();
|
|
1319
|
-
if (headersString === "") return headerMap;
|
|
1320
|
-
var lines = headersString.trim().split(/[\r\n]+/);
|
|
1321
|
-
lines.forEach(function (line) {
|
|
1322
|
-
var parts = line.split(": ");
|
|
1323
|
-
var name = parts.shift();
|
|
1324
|
-
var value = parts.join(": ");
|
|
1325
|
-
headerMap[name.toLowerCase()] = value;
|
|
1326
|
-
});
|
|
1327
|
-
return headerMap;
|
|
1328
|
-
};
|
|
1329
|
-
|
|
1330
|
-
var hrefToOrigin = function hrefToOrigin(href) {
|
|
1331
|
-
var scheme = hrefToScheme(href);
|
|
1332
|
-
|
|
1333
|
-
if (scheme === "file") {
|
|
1334
|
-
return "file://";
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
|
-
if (scheme === "http" || scheme === "https") {
|
|
1338
|
-
var secondProtocolSlashIndex = scheme.length + "://".length;
|
|
1339
|
-
var pathnameSlashIndex = href.indexOf("/", secondProtocolSlashIndex);
|
|
1340
|
-
if (pathnameSlashIndex === -1) return href;
|
|
1341
|
-
return href.slice(0, pathnameSlashIndex);
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
return href.slice(0, scheme.length + 1);
|
|
1345
|
-
};
|
|
1346
|
-
|
|
1347
|
-
var hrefToScheme = function hrefToScheme(href) {
|
|
1348
|
-
var colonIndex = href.indexOf(":");
|
|
1349
|
-
if (colonIndex === -1) return "";
|
|
1350
|
-
return href.slice(0, colonIndex);
|
|
1351
|
-
};
|
|
1352
|
-
|
|
1353
|
-
var isDataView = function isDataView(obj) {
|
|
1354
|
-
return obj && DataView.prototype.isPrototypeOf(obj);
|
|
1355
|
-
};
|
|
1356
|
-
|
|
1357
|
-
var isArrayBufferView = ArrayBuffer.isView || function () {
|
|
1358
|
-
var viewClasses = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"];
|
|
1359
|
-
return function (value) {
|
|
1360
|
-
return value && viewClasses.includes(Object.prototype.toString.call(value));
|
|
1361
|
-
};
|
|
1362
|
-
}();
|
|
1363
|
-
|
|
1364
|
-
var textToFormData = function textToFormData(text) {
|
|
1365
|
-
var form = new FormData();
|
|
1366
|
-
text.trim().split("&").forEach(function (bytes) {
|
|
1367
|
-
if (bytes) {
|
|
1368
|
-
var split = bytes.split("=");
|
|
1369
|
-
var name = split.shift().replace(/\+/g, " ");
|
|
1370
|
-
var value = split.join("=").replace(/\+/g, " ");
|
|
1371
|
-
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
|
1372
|
-
}
|
|
1373
|
-
});
|
|
1374
|
-
return form;
|
|
1375
|
-
};
|
|
1376
|
-
|
|
1377
|
-
var blobToArrayBuffer = _async$7(function (blob) {
|
|
1378
|
-
var reader = new FileReader();
|
|
1379
|
-
var promise = fileReaderReady(reader);
|
|
1380
|
-
reader.readAsArrayBuffer(blob);
|
|
1381
|
-
return promise;
|
|
1382
|
-
});
|
|
1383
|
-
|
|
1384
|
-
var blobToText = function blobToText(blob) {
|
|
1385
|
-
var reader = new FileReader();
|
|
1386
|
-
var promise = fileReaderReady(reader);
|
|
1387
|
-
reader.readAsText(blob);
|
|
1388
|
-
return promise;
|
|
1389
|
-
};
|
|
1390
|
-
|
|
1391
|
-
var arrayBufferToText = function arrayBufferToText(arrayBuffer) {
|
|
1392
|
-
var view = new Uint8Array(arrayBuffer);
|
|
1393
|
-
var chars = new Array(view.length);
|
|
1394
|
-
var i = 0;
|
|
1395
|
-
|
|
1396
|
-
while (i < view.length) {
|
|
1397
|
-
chars[i] = String.fromCharCode(view[i]);
|
|
1398
|
-
i++;
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
return chars.join("");
|
|
1402
|
-
};
|
|
1403
|
-
|
|
1404
|
-
var fileReaderReady = function fileReaderReady(reader) {
|
|
1405
|
-
return new Promise(function (resolve, reject) {
|
|
1406
|
-
reader.onload = function () {
|
|
1407
|
-
resolve(reader.result);
|
|
1408
|
-
};
|
|
1409
|
-
|
|
1410
|
-
reader.onerror = function () {
|
|
1411
|
-
reject(reader.error);
|
|
1412
|
-
};
|
|
1413
|
-
});
|
|
1414
|
-
};
|
|
1415
|
-
|
|
1416
|
-
var cloneBuffer = function cloneBuffer(buffer) {
|
|
1417
|
-
if (buffer.slice) {
|
|
1418
|
-
return buffer.slice(0);
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
var view = new Uint8Array(buffer.byteLength);
|
|
1422
|
-
view.set(new Uint8Array(buffer));
|
|
1423
|
-
return view.buffer;
|
|
1424
|
-
};
|
|
1425
|
-
|
|
1426
|
-
var _excluded = ["mode"];
|
|
1427
|
-
|
|
1428
|
-
function _await$7(value, then, direct) {
|
|
1429
|
-
if (direct) {
|
|
1430
|
-
return then ? then(value) : value;
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1433
|
-
if (!value || !value.then) {
|
|
1434
|
-
value = Promise.resolve(value);
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
return then ? value.then(then) : value;
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
function _async$6(f) {
|
|
1441
|
-
return function () {
|
|
1442
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1443
|
-
args[i] = arguments[i];
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
try {
|
|
1447
|
-
return Promise.resolve(f.apply(this, args));
|
|
1448
|
-
} catch (e) {
|
|
1449
|
-
return Promise.reject(e);
|
|
1450
|
-
}
|
|
1451
|
-
};
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
var fetchNative = _async$6(function (url) {
|
|
1455
|
-
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1456
|
-
|
|
1457
|
-
var _ref$mode = _ref.mode,
|
|
1458
|
-
mode = _ref$mode === void 0 ? "cors" : _ref$mode,
|
|
1459
|
-
options = _objectWithoutProperties(_ref, _excluded);
|
|
1460
|
-
|
|
1461
|
-
return _await$7(window.fetch(url, _objectSpread2({
|
|
1462
|
-
mode: mode
|
|
1463
|
-
}, options)), function (response) {
|
|
1464
|
-
return {
|
|
1465
|
-
url: response.url,
|
|
1466
|
-
status: response.status,
|
|
1467
|
-
statusText: "",
|
|
1468
|
-
headers: responseToHeaders(response),
|
|
1469
|
-
text: function text() {
|
|
1470
|
-
return response.text();
|
|
1471
|
-
},
|
|
1472
|
-
json: function json() {
|
|
1473
|
-
return response.json();
|
|
1474
|
-
},
|
|
1475
|
-
blob: function blob() {
|
|
1476
|
-
return response.blob();
|
|
1477
|
-
},
|
|
1478
|
-
arrayBuffer: function arrayBuffer() {
|
|
1479
|
-
return response.arrayBuffer();
|
|
1480
|
-
},
|
|
1481
|
-
formData: function formData() {
|
|
1482
|
-
return response.formData();
|
|
1483
|
-
}
|
|
1484
|
-
};
|
|
1485
|
-
});
|
|
1486
|
-
});
|
|
1487
|
-
|
|
1488
|
-
var responseToHeaders = function responseToHeaders(response) {
|
|
1489
|
-
var headers = {};
|
|
1490
|
-
response.headers.forEach(function (value, name) {
|
|
1491
|
-
headers[name] = value;
|
|
1492
|
-
});
|
|
1493
|
-
return headers;
|
|
1494
|
-
};
|
|
1495
|
-
|
|
1496
|
-
var fetchUrl = typeof window.fetch === "function" && typeof window.AbortController === "function" ? fetchNative : fetchUsingXHR;
|
|
1497
|
-
|
|
1498
|
-
function _await$6(value, then, direct) {
|
|
1499
|
-
if (direct) {
|
|
1500
|
-
return then ? then(value) : value;
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
if (!value || !value.then) {
|
|
1504
|
-
value = Promise.resolve(value);
|
|
1505
|
-
}
|
|
1506
|
-
|
|
1507
|
-
return then ? value.then(then) : value;
|
|
1508
|
-
}
|
|
1509
|
-
|
|
1510
|
-
function _async$5(f) {
|
|
1511
|
-
return function () {
|
|
1512
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1513
|
-
args[i] = arguments[i];
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
try {
|
|
1517
|
-
return Promise.resolve(f.apply(this, args));
|
|
1518
|
-
} catch (e) {
|
|
1519
|
-
return Promise.reject(e);
|
|
1520
|
-
}
|
|
1521
|
-
};
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
var fetchJson = _async$5(function (url) {
|
|
1525
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1526
|
-
return _await$6(fetchUrl(url, options), function (response) {
|
|
1527
|
-
return _await$6(response.json());
|
|
1528
|
-
});
|
|
1529
|
-
});
|
|
1530
|
-
/*
|
|
1531
|
-
* Prefer window.navigator.userAgentData before resorting to
|
|
1532
|
-
* window.navigator.userAgent because of
|
|
1533
|
-
* https://blog.chromium.org/2021/09/user-agent-reduction-origin-trial-and-dates.html
|
|
1534
|
-
*/
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
var detectFromUserAgentData = function detectFromUserAgentData() {
|
|
1538
|
-
var userAgentData = window.navigator.userAgentData;
|
|
1539
|
-
|
|
1540
|
-
if (!userAgentData) {
|
|
1541
|
-
return null;
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
var brands = userAgentData.brands;
|
|
1545
|
-
var i = 0;
|
|
1546
|
-
|
|
1547
|
-
while (i < brands.length) {
|
|
1548
|
-
var _brands$i = brands[i],
|
|
1549
|
-
brand = _brands$i.brand,
|
|
1550
|
-
version = _brands$i.version;
|
|
1551
|
-
i++;
|
|
1552
|
-
|
|
1553
|
-
if (brand === "chromium" || brand === "Google Chrome") {
|
|
1554
|
-
return {
|
|
1555
|
-
name: "chrome",
|
|
1556
|
-
version: version
|
|
1557
|
-
};
|
|
1558
|
-
}
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
return null;
|
|
1562
|
-
};
|
|
1563
|
-
|
|
1564
|
-
var firstMatch = function firstMatch(regexp, string) {
|
|
1565
|
-
var match = string.match(regexp);
|
|
1566
|
-
return match && match.length > 0 ? match[1] || undefined : undefined;
|
|
1567
|
-
};
|
|
1568
|
-
|
|
1569
|
-
var secondMatch = function secondMatch(regexp, string) {
|
|
1570
|
-
var match = string.match(regexp);
|
|
1571
|
-
return match && match.length > 1 ? match[2] || undefined : undefined;
|
|
1572
|
-
};
|
|
1573
|
-
|
|
1574
|
-
var userAgentToVersion = function userAgentToVersion(userAgent) {
|
|
1575
|
-
return firstMatch(/version\/(\d+(\.?_?\d+)+)/i, userAgent) || undefined;
|
|
1576
|
-
};
|
|
1577
|
-
|
|
1578
|
-
var detectAndroid = function detectAndroid() {
|
|
1579
|
-
return navigatorToBrowser$1(window.navigator);
|
|
1580
|
-
};
|
|
1581
|
-
|
|
1582
|
-
var navigatorToBrowser$1 = function navigatorToBrowser(_ref) {
|
|
1583
|
-
var userAgent = _ref.userAgent,
|
|
1584
|
-
appVersion = _ref.appVersion;
|
|
1585
|
-
|
|
1586
|
-
if (/(android)/i.test(userAgent)) {
|
|
1587
|
-
return {
|
|
1588
|
-
name: "android",
|
|
1589
|
-
version: firstMatch(/Android (\d+(\.?_?\d+)+)/i, appVersion)
|
|
1590
|
-
};
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
return null;
|
|
1594
|
-
};
|
|
1595
|
-
|
|
1596
|
-
var detectInternetExplorer = function detectInternetExplorer() {
|
|
1597
|
-
return userAgentToBrowser$5(window.navigator.userAgent);
|
|
1598
|
-
};
|
|
1599
|
-
|
|
1600
|
-
var userAgentToBrowser$5 = function userAgentToBrowser(userAgent) {
|
|
1601
|
-
if (/msie|trident/i.test(userAgent)) {
|
|
1602
|
-
return {
|
|
1603
|
-
name: "ie",
|
|
1604
|
-
version: firstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i, userAgent)
|
|
1605
|
-
};
|
|
1606
|
-
}
|
|
1607
|
-
|
|
1608
|
-
return null;
|
|
1609
|
-
};
|
|
1610
|
-
|
|
1611
|
-
var detectOpera = function detectOpera() {
|
|
1612
|
-
return userAgentToBrowser$4(window.navigator.userAgent);
|
|
1613
|
-
};
|
|
1614
|
-
|
|
1615
|
-
var userAgentToBrowser$4 = function userAgentToBrowser(userAgent) {
|
|
1616
|
-
// opera below 13
|
|
1617
|
-
if (/opera/i.test(userAgent)) {
|
|
1618
|
-
return {
|
|
1619
|
-
name: "opera",
|
|
1620
|
-
version: userAgentToVersion(userAgent) || firstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i, userAgent)
|
|
1621
|
-
};
|
|
1622
|
-
} // opera above 13
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
if (/opr\/|opios/i.test(userAgent)) {
|
|
1626
|
-
return {
|
|
1627
|
-
name: "opera",
|
|
1628
|
-
version: firstMatch(/(?:opr|opios)[\s/](\S+)/i, userAgent) || userAgentToVersion(userAgent)
|
|
1629
|
-
};
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
return null;
|
|
1633
|
-
};
|
|
1634
|
-
|
|
1635
|
-
var detectEdge = function detectEdge() {
|
|
1636
|
-
return userAgentToBrowser$3(window.navigator.userAgent);
|
|
1637
|
-
};
|
|
1638
|
-
|
|
1639
|
-
var userAgentToBrowser$3 = function userAgentToBrowser(userAgent) {
|
|
1640
|
-
if (/edg([ea]|ios)/i.test(userAgent)) {
|
|
1641
|
-
return {
|
|
1642
|
-
name: "edge",
|
|
1643
|
-
version: secondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i, userAgent)
|
|
1644
|
-
};
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
|
-
return null;
|
|
1648
|
-
};
|
|
1649
|
-
|
|
1650
|
-
var detectFirefox = function detectFirefox() {
|
|
1651
|
-
return userAgentToBrowser$2(window.navigator.userAgent);
|
|
1652
|
-
};
|
|
1653
|
-
|
|
1654
|
-
var userAgentToBrowser$2 = function userAgentToBrowser(userAgent) {
|
|
1655
|
-
if (/firefox|iceweasel|fxios/i.test(userAgent)) {
|
|
1656
|
-
return {
|
|
1657
|
-
name: "firefox",
|
|
1658
|
-
version: firstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i, userAgent)
|
|
1659
|
-
};
|
|
1660
|
-
}
|
|
1661
|
-
|
|
1662
|
-
return null;
|
|
1663
|
-
};
|
|
1664
|
-
|
|
1665
|
-
var detectChrome = function detectChrome() {
|
|
1666
|
-
return userAgentToBrowser$1(window.navigator.userAgent);
|
|
1667
|
-
};
|
|
1668
|
-
|
|
1669
|
-
var userAgentToBrowser$1 = function userAgentToBrowser(userAgent) {
|
|
1670
|
-
if (/chromium/i.test(userAgent)) {
|
|
1671
|
-
return {
|
|
1672
|
-
name: "chrome",
|
|
1673
|
-
version: firstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i, userAgent) || userAgentToVersion(userAgent)
|
|
1674
|
-
};
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
if (/chrome|crios|crmo/i.test(userAgent)) {
|
|
1678
|
-
return {
|
|
1679
|
-
name: "chrome",
|
|
1680
|
-
version: firstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i, userAgent)
|
|
1681
|
-
};
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
return null;
|
|
1685
|
-
};
|
|
1686
|
-
|
|
1687
|
-
var detectSafari = function detectSafari() {
|
|
1688
|
-
return userAgentToBrowser(window.navigator.userAgent);
|
|
1689
|
-
};
|
|
1690
|
-
|
|
1691
|
-
var userAgentToBrowser = function userAgentToBrowser(userAgent) {
|
|
1692
|
-
if (/safari|applewebkit/i.test(userAgent)) {
|
|
1693
|
-
return {
|
|
1694
|
-
name: "safari",
|
|
1695
|
-
version: userAgentToVersion(userAgent)
|
|
1696
|
-
};
|
|
1697
|
-
}
|
|
1698
|
-
|
|
1699
|
-
return null;
|
|
1700
|
-
};
|
|
1701
|
-
|
|
1702
|
-
var detectElectron = function detectElectron() {
|
|
1703
|
-
return null;
|
|
1704
|
-
}; // TODO
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
var detectIOS = function detectIOS() {
|
|
1708
|
-
return navigatorToBrowser(window.navigator);
|
|
1709
|
-
};
|
|
1710
|
-
|
|
1711
|
-
var navigatorToBrowser = function navigatorToBrowser(_ref) {
|
|
1712
|
-
var userAgent = _ref.userAgent,
|
|
1713
|
-
appVersion = _ref.appVersion;
|
|
1714
|
-
|
|
1715
|
-
if (/iPhone;/.test(userAgent)) {
|
|
1716
|
-
return {
|
|
1717
|
-
name: "ios",
|
|
1718
|
-
version: firstMatch(/OS (\d+(\.?_?\d+)+)/i, appVersion)
|
|
1719
|
-
};
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
if (/iPad;/.test(userAgent)) {
|
|
1723
|
-
return {
|
|
1724
|
-
name: "ios",
|
|
1725
|
-
version: firstMatch(/OS (\d+(\.?_?\d+)+)/i, appVersion)
|
|
1726
|
-
};
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
return null;
|
|
1730
|
-
}; // https://github.com/Ahmdrza/detect-browser/blob/26254f85cf92795655a983bfd759d85f3de850c6/detect-browser.js#L1
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
var detectorCompose = function detectorCompose(detectors) {
|
|
1734
|
-
return function () {
|
|
1735
|
-
var i = 0;
|
|
1736
|
-
|
|
1737
|
-
while (i < detectors.length) {
|
|
1738
|
-
var _detector = detectors[i];
|
|
1739
|
-
i++;
|
|
1740
|
-
|
|
1741
|
-
var result = _detector();
|
|
1742
|
-
|
|
1743
|
-
if (result) {
|
|
1744
|
-
return result;
|
|
1745
|
-
}
|
|
1746
|
-
}
|
|
1747
|
-
|
|
1748
|
-
return null;
|
|
1749
|
-
};
|
|
1750
|
-
};
|
|
1751
|
-
|
|
1752
|
-
var detector = detectorCompose([detectFromUserAgentData, // keep this first
|
|
1753
|
-
detectOpera, detectInternetExplorer, detectEdge, detectFirefox, detectChrome, detectSafari, detectElectron, detectIOS, detectAndroid]);
|
|
1754
|
-
|
|
1755
|
-
var detectBrowser = function detectBrowser() {
|
|
1756
|
-
var _ref = detector() || {},
|
|
1757
|
-
_ref$name = _ref.name,
|
|
1758
|
-
name = _ref$name === void 0 ? "other" : _ref$name,
|
|
1759
|
-
_ref$version = _ref.version,
|
|
1760
|
-
version = _ref$version === void 0 ? "unknown" : _ref$version;
|
|
1761
|
-
|
|
1762
|
-
return {
|
|
1763
|
-
name: normalizeName(name),
|
|
1764
|
-
version: normalizeVersion(version)
|
|
1765
|
-
};
|
|
1766
|
-
};
|
|
1767
|
-
|
|
1768
|
-
var normalizeName = function normalizeName(name) {
|
|
1769
|
-
return name.toLowerCase();
|
|
1770
|
-
};
|
|
1771
|
-
|
|
1772
|
-
var normalizeVersion = function normalizeVersion(version) {
|
|
1773
|
-
if (version.indexOf(".") > -1) {
|
|
1774
|
-
var parts = version.split("."); // remove extraneous .
|
|
1775
|
-
|
|
1776
|
-
return parts.slice(0, 3).join(".");
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
if (version.indexOf("_") > -1) {
|
|
1780
|
-
var _parts = version.split("_"); // remove extraneous _
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
return _parts.slice(0, 3).join("_");
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1786
|
-
return version;
|
|
1787
|
-
};
|
|
1788
|
-
|
|
1789
|
-
var executeWithScriptModuleInjection = function executeWithScriptModuleInjection(code) {
|
|
1790
|
-
var scriptModule = document.createElement("script");
|
|
1791
|
-
scriptModule.type = "module";
|
|
1792
|
-
var loadPromise = new Promise(function (resolve, reject) {
|
|
1793
|
-
scriptModule.onload = function () {
|
|
1794
|
-
document.body.removeChild(scriptModule);
|
|
1795
|
-
resolve();
|
|
1796
|
-
};
|
|
1797
|
-
|
|
1798
|
-
scriptModule.onerror = function () {
|
|
1799
|
-
document.body.removeChild(scriptModule);
|
|
1800
|
-
reject();
|
|
1801
|
-
};
|
|
1802
|
-
|
|
1803
|
-
document.body.appendChild(scriptModule);
|
|
1804
|
-
});
|
|
1805
|
-
scriptModule.src = asBase64Url(code);
|
|
1806
|
-
return loadPromise;
|
|
1807
|
-
};
|
|
1808
|
-
|
|
1809
|
-
var asBase64Url = function asBase64Url(text) {
|
|
1810
|
-
var mimeType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "application/javascript";
|
|
1811
|
-
return "data:".concat(mimeType, ";base64,").concat(window.btoa(text));
|
|
1812
|
-
};
|
|
1813
|
-
|
|
1814
|
-
function _await$5(value, then, direct) {
|
|
1815
|
-
if (direct) {
|
|
1816
|
-
return then ? then(value) : value;
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
if (!value || !value.then) {
|
|
1820
|
-
value = Promise.resolve(value);
|
|
1821
|
-
}
|
|
1822
|
-
|
|
1823
|
-
return then ? value.then(then) : value;
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
function _catch$4(body, recover) {
|
|
1827
|
-
try {
|
|
1828
|
-
var result = body();
|
|
1829
|
-
} catch (e) {
|
|
1830
|
-
return recover(e);
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
if (result && result.then) {
|
|
1834
|
-
return result.then(void 0, recover);
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
return result;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
function _async$4(f) {
|
|
1841
|
-
return function () {
|
|
1842
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1843
|
-
args[i] = arguments[i];
|
|
1844
|
-
}
|
|
1845
|
-
|
|
1846
|
-
try {
|
|
1847
|
-
return Promise.resolve(f.apply(this, args));
|
|
1848
|
-
} catch (e) {
|
|
1849
|
-
return Promise.reject(e);
|
|
1850
|
-
}
|
|
1851
|
-
};
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
var supportsImportmap = _async$4(function () {
|
|
1855
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
1856
|
-
_ref$remote = _ref.remote,
|
|
1857
|
-
remote = _ref$remote === void 0 ? true : _ref$remote;
|
|
1858
|
-
|
|
1859
|
-
var specifier = asBase64Url("export default false");
|
|
1860
|
-
var importMap = {
|
|
1861
|
-
imports: _defineProperty({}, specifier, asBase64Url("export default true"))
|
|
1862
|
-
};
|
|
1863
|
-
var importmapScript = document.createElement("script");
|
|
1864
|
-
var importmapString = JSON.stringify(importMap, null, " ");
|
|
1865
|
-
importmapScript.type = "importmap";
|
|
1866
|
-
|
|
1867
|
-
if (remote) {
|
|
1868
|
-
importmapScript.src = "data:application/json;base64,".concat(window.btoa(importmapString));
|
|
1869
|
-
} else {
|
|
1870
|
-
importmapScript.textContent = importmapString;
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
document.body.appendChild(importmapScript);
|
|
1874
|
-
return _catch$4(function () {
|
|
1875
|
-
return _await$5(executeWithScriptModuleInjection("import supported from \"".concat(specifier, "\"; window.__jsenv_runtime_test_importmap__ = supported")), function () {
|
|
1876
|
-
document.body.removeChild(importmapScript);
|
|
1877
|
-
var supported = window.__jsenv_runtime_test_importmap__;
|
|
1878
|
-
delete window.__jsenv_runtime_test_importmap__;
|
|
1879
|
-
return supported;
|
|
1880
|
-
});
|
|
1881
|
-
}, function () {
|
|
1882
|
-
document.body.removeChild(importmapScript);
|
|
1883
|
-
return false;
|
|
1884
|
-
});
|
|
1885
|
-
});
|
|
1886
|
-
|
|
1887
|
-
function _await$4(value, then, direct) {
|
|
1888
|
-
if (direct) {
|
|
1889
|
-
return then ? then(value) : value;
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
if (!value || !value.then) {
|
|
1893
|
-
value = Promise.resolve(value);
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
return then ? value.then(then) : value;
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
function _catch$3(body, recover) {
|
|
1900
|
-
try {
|
|
1901
|
-
var result = body();
|
|
1902
|
-
} catch (e) {
|
|
1903
|
-
return recover(e);
|
|
1904
|
-
}
|
|
1905
|
-
|
|
1906
|
-
if (result && result.then) {
|
|
1907
|
-
return result.then(void 0, recover);
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
return result;
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1913
|
-
function _async$3(f) {
|
|
1914
|
-
return function () {
|
|
1915
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1916
|
-
args[i] = arguments[i];
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
try {
|
|
1920
|
-
return Promise.resolve(f.apply(this, args));
|
|
1921
|
-
} catch (e) {
|
|
1922
|
-
return Promise.reject(e);
|
|
1923
|
-
}
|
|
1924
|
-
};
|
|
1925
|
-
}
|
|
1926
|
-
|
|
1927
|
-
var supportsDynamicImport = _async$3(function () {
|
|
1928
|
-
var moduleSource = asBase64Url("export default 42");
|
|
1929
|
-
return _catch$3(function () {
|
|
1930
|
-
return _await$4(executeWithScriptModuleInjection("window.__jsenv_runtime_test_dynamic_import__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
1931
|
-
return _await$4(window.__jsenv_runtime_test_dynamic_import__, function (namespace) {
|
|
1932
|
-
delete window.__jsenv_runtime_test_dynamic_import__;
|
|
1933
|
-
return namespace.default === 42;
|
|
1934
|
-
});
|
|
1935
|
-
});
|
|
1936
|
-
}, function () {
|
|
1937
|
-
return false;
|
|
1938
|
-
});
|
|
1939
|
-
});
|
|
1940
|
-
|
|
1941
|
-
function _await$3(value, then, direct) {
|
|
1942
|
-
if (direct) {
|
|
1943
|
-
return then ? then(value) : value;
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
if (!value || !value.then) {
|
|
1947
|
-
value = Promise.resolve(value);
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
return then ? value.then(then) : value;
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
function _catch$2(body, recover) {
|
|
1954
|
-
try {
|
|
1955
|
-
var result = body();
|
|
1956
|
-
} catch (e) {
|
|
1957
|
-
return recover(e);
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
if (result && result.then) {
|
|
1961
|
-
return result.then(void 0, recover);
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
return result;
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
var supportsTopLevelAwait = function supportsTopLevelAwait() {
|
|
1968
|
-
return _await$3(_catch$2(function () {
|
|
1969
|
-
return _await$3(executeWithScriptModuleInjection("window.__jsenv_runtime_test_top_level_await__ = await Promise.resolve(42)"), function () {
|
|
1970
|
-
var supported = window.__jsenv_runtime_test_top_level_await__ === 42;
|
|
1971
|
-
delete window.__jsenv_runtime_test_top_level_await__;
|
|
1972
|
-
return supported;
|
|
1973
|
-
});
|
|
1974
|
-
}, function () {
|
|
1975
|
-
return false;
|
|
1976
|
-
}));
|
|
1977
|
-
};
|
|
1978
|
-
|
|
1979
|
-
function _await$2(value, then, direct) {
|
|
1980
|
-
if (direct) {
|
|
1981
|
-
return then ? then(value) : value;
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
|
-
if (!value || !value.then) {
|
|
1985
|
-
value = Promise.resolve(value);
|
|
1986
|
-
}
|
|
1987
|
-
|
|
1988
|
-
return then ? value.then(then) : value;
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
function _catch$1(body, recover) {
|
|
1992
|
-
try {
|
|
1993
|
-
var result = body();
|
|
1994
|
-
} catch (e) {
|
|
1995
|
-
return recover(e);
|
|
1996
|
-
}
|
|
1997
|
-
|
|
1998
|
-
if (result && result.then) {
|
|
1999
|
-
return result.then(void 0, recover);
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
return result;
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
function _async$2(f) {
|
|
2006
|
-
return function () {
|
|
2007
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
2008
|
-
args[i] = arguments[i];
|
|
2009
|
-
}
|
|
2010
|
-
|
|
2011
|
-
try {
|
|
2012
|
-
return Promise.resolve(f.apply(this, args));
|
|
2013
|
-
} catch (e) {
|
|
2014
|
-
return Promise.reject(e);
|
|
2015
|
-
}
|
|
2016
|
-
};
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
var supportsJsonImportAssertions = _async$2(function () {
|
|
2020
|
-
var jsonBase64Url = asBase64Url("42", "application/json");
|
|
2021
|
-
var moduleSource = asBase64Url("import data from \"".concat(jsonBase64Url, "\" assert { type: \"json\" }\n export default data"));
|
|
2022
|
-
return _catch$1(function () {
|
|
2023
|
-
return _await$2(executeWithScriptModuleInjection("window.__jsenv_runtime_test_json_import_assertion__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
2024
|
-
return _await$2(window.__jsenv_runtime_test_json_import_assertion__, function (namespace) {
|
|
2025
|
-
var supported = namespace.default === 42;
|
|
2026
|
-
delete window.__jsenv_runtime_test_json_import_assertion__;
|
|
2027
|
-
return supported;
|
|
2028
|
-
});
|
|
2029
|
-
});
|
|
2030
|
-
}, function () {
|
|
2031
|
-
return false;
|
|
2032
|
-
});
|
|
2033
|
-
});
|
|
2034
|
-
|
|
2035
|
-
function _await$1(value, then, direct) {
|
|
2036
|
-
if (direct) {
|
|
2037
|
-
return then ? then(value) : value;
|
|
2038
|
-
}
|
|
2039
|
-
|
|
2040
|
-
if (!value || !value.then) {
|
|
2041
|
-
value = Promise.resolve(value);
|
|
2042
|
-
}
|
|
2043
|
-
|
|
2044
|
-
return then ? value.then(then) : value;
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
function _catch(body, recover) {
|
|
2048
|
-
try {
|
|
2049
|
-
var result = body();
|
|
2050
|
-
} catch (e) {
|
|
2051
|
-
return recover(e);
|
|
2052
|
-
}
|
|
2053
|
-
|
|
2054
|
-
if (result && result.then) {
|
|
2055
|
-
return result.then(void 0, recover);
|
|
2056
|
-
}
|
|
2057
|
-
|
|
2058
|
-
return result;
|
|
2059
|
-
}
|
|
2060
|
-
|
|
2061
|
-
function _async$1(f) {
|
|
2062
|
-
return function () {
|
|
2063
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
2064
|
-
args[i] = arguments[i];
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
try {
|
|
2068
|
-
return Promise.resolve(f.apply(this, args));
|
|
2069
|
-
} catch (e) {
|
|
2070
|
-
return Promise.reject(e);
|
|
2071
|
-
}
|
|
2072
|
-
};
|
|
2073
|
-
}
|
|
2074
|
-
|
|
2075
|
-
var supportsCssImportAssertions = _async$1(function () {
|
|
2076
|
-
var cssBase64Url = asBase64Url("p { color: red; }", "text/css");
|
|
2077
|
-
var moduleSource = asBase64Url("import css from \"".concat(cssBase64Url, "\" assert { type: \"css\" }\n export default css"));
|
|
2078
|
-
return _catch(function () {
|
|
2079
|
-
return _await$1(executeWithScriptModuleInjection("window.__jsenv_runtime_test_css_import_assertion__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
2080
|
-
return _await$1(window.__jsenv_runtime_test_css_import_assertion__, function (namespace) {
|
|
2081
|
-
return namespace.default instanceof CSSStyleSheet;
|
|
2082
|
-
});
|
|
2083
|
-
});
|
|
2084
|
-
}, function () {
|
|
2085
|
-
return false;
|
|
2086
|
-
});
|
|
2087
|
-
});
|
|
2088
|
-
|
|
2089
|
-
var supportsNewStylesheet = function supportsNewStylesheet() {
|
|
2090
|
-
try {
|
|
2091
|
-
// eslint-disable-next-line no-new
|
|
2092
|
-
new CSSStyleSheet();
|
|
2093
|
-
return true;
|
|
2094
|
-
} catch (e) {
|
|
2095
|
-
return false;
|
|
2096
|
-
}
|
|
2097
|
-
};
|
|
2098
|
-
|
|
2099
|
-
function _await(value, then, direct) {
|
|
2100
|
-
if (direct) {
|
|
2101
|
-
return then ? then(value) : value;
|
|
2102
|
-
}
|
|
2103
|
-
|
|
2104
|
-
if (!value || !value.then) {
|
|
2105
|
-
value = Promise.resolve(value);
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
return then ? value.then(then) : value;
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
|
-
function _async(f) {
|
|
2112
|
-
return function () {
|
|
2113
|
-
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
2114
|
-
args[i] = arguments[i];
|
|
2115
|
-
}
|
|
2116
|
-
|
|
2117
|
-
try {
|
|
2118
|
-
return Promise.resolve(f.apply(this, args));
|
|
2119
|
-
} catch (e) {
|
|
2120
|
-
return Promise.reject(e);
|
|
2121
|
-
}
|
|
2122
|
-
};
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
function _call(body, then, direct) {
|
|
2126
|
-
if (direct) {
|
|
2127
|
-
return then ? then(body()) : body();
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
try {
|
|
2131
|
-
var result = Promise.resolve(body());
|
|
2132
|
-
return then ? result.then(then) : result;
|
|
2133
|
-
} catch (e) {
|
|
2134
|
-
return Promise.reject(e);
|
|
2135
|
-
}
|
|
2136
|
-
}
|
|
2137
|
-
|
|
2138
|
-
var scanBrowserRuntimeFeatures = _async(function () {
|
|
2139
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
2140
|
-
_ref$coverageHandledF = _ref.coverageHandledFromOutside,
|
|
2141
|
-
coverageHandledFromOutside = _ref$coverageHandledF === void 0 ? false : _ref$coverageHandledF,
|
|
2142
|
-
_ref$forceCompilation = _ref.forceCompilation,
|
|
2143
|
-
forceCompilation = _ref$forceCompilation === void 0 ? false : _ref$forceCompilation,
|
|
2144
|
-
_ref$forceSource = _ref.forceSource,
|
|
2145
|
-
forceSource = _ref$forceSource === void 0 ? false : _ref$forceSource;
|
|
2146
|
-
|
|
2147
|
-
var jsenvCompileProfileUrl = "/__jsenv_compile_profile__";
|
|
2148
|
-
return _await(fetchJson(jsenvCompileProfileUrl), function (_ref2) {
|
|
2149
|
-
var jsenvDirectoryRelativeUrl = _ref2.jsenvDirectoryRelativeUrl,
|
|
2150
|
-
inlineImportMapIntoHTML = _ref2.inlineImportMapIntoHTML,
|
|
2151
|
-
availableCompileIds = _ref2.availableCompileIds;
|
|
2152
|
-
|
|
2153
|
-
var _detectBrowser = detectBrowser(),
|
|
2154
|
-
name = _detectBrowser.name,
|
|
2155
|
-
version = _detectBrowser.version;
|
|
2156
|
-
|
|
2157
|
-
return _await(detectSupportedFeatures({
|
|
2158
|
-
coverageHandledFromOutside: coverageHandledFromOutside,
|
|
2159
|
-
inlineImportMapIntoHTML: inlineImportMapIntoHTML
|
|
2160
|
-
}), function (featuresReport) {
|
|
2161
|
-
var runtimeReport = {
|
|
2162
|
-
env: {
|
|
2163
|
-
browser: true
|
|
2164
|
-
},
|
|
2165
|
-
name: name,
|
|
2166
|
-
version: version,
|
|
2167
|
-
featuresReport: featuresReport,
|
|
2168
|
-
forceSource: forceSource,
|
|
2169
|
-
forceCompilation: forceCompilation
|
|
2170
|
-
};
|
|
2171
|
-
return _await(fetchJson(jsenvCompileProfileUrl, {
|
|
2172
|
-
method: "POST",
|
|
2173
|
-
headers: {
|
|
2174
|
-
"content-type": "application/json"
|
|
2175
|
-
},
|
|
2176
|
-
body: JSON.stringify(runtimeReport)
|
|
2177
|
-
}), function (_ref3) {
|
|
2178
|
-
var compileProfile = _ref3.compileProfile,
|
|
2179
|
-
compileId = _ref3.compileId;
|
|
2180
|
-
return {
|
|
2181
|
-
jsenvDirectoryRelativeUrl: jsenvDirectoryRelativeUrl,
|
|
2182
|
-
inlineImportMapIntoHTML: inlineImportMapIntoHTML,
|
|
2183
|
-
availableCompileIds: availableCompileIds,
|
|
2184
|
-
runtimeReport: runtimeReport,
|
|
2185
|
-
compileProfile: compileProfile,
|
|
2186
|
-
compileId: compileId
|
|
2187
|
-
};
|
|
2188
|
-
});
|
|
2189
|
-
});
|
|
2190
|
-
});
|
|
2191
|
-
});
|
|
2192
|
-
|
|
2193
|
-
var detectSupportedFeatures = _async(function (_ref4) {
|
|
2194
|
-
var coverageHandledFromOutside = _ref4.coverageHandledFromOutside,
|
|
2195
|
-
inlineImportMapIntoHTML = _ref4.inlineImportMapIntoHTML;
|
|
2196
|
-
var featuresReport = {};
|
|
2197
|
-
featuresReport["import_http"] = true;
|
|
2198
|
-
featuresReport["coverage_js"] = coverageHandledFromOutside; // new CSSStyleSheet
|
|
2199
|
-
|
|
2200
|
-
featuresReport["new_stylesheet"] = supportsNewStylesheet(); // importmap
|
|
2201
|
-
// start testing importmap support first and not in paralell
|
|
2202
|
-
// so that there is not module script loaded beore importmap is injected
|
|
2203
|
-
// it would log an error in chrome console and return undefined
|
|
2204
|
-
|
|
2205
|
-
return _await(supportsImportmap({
|
|
2206
|
-
// chrome supports inline but not remote importmap
|
|
2207
|
-
// https://github.com/WICG/import-maps/issues/235
|
|
2208
|
-
// at this stage we won't know if the html file will use
|
|
2209
|
-
// an importmap or not and if that importmap is inline or specified with an src
|
|
2210
|
-
// so we should test if browser support local and remote importmap.
|
|
2211
|
-
// But there exploring server can inline importmap by transforming html
|
|
2212
|
-
// and in that case we can test only the local importmap support
|
|
2213
|
-
// so we test importmap support and the remote one
|
|
2214
|
-
remote: !inlineImportMapIntoHTML
|
|
2215
|
-
}), function (_supportsImportmap) {
|
|
2216
|
-
featuresReport.importmap = _supportsImportmap; // dynamic import
|
|
2217
|
-
|
|
2218
|
-
return _call(supportsDynamicImport, function (_supportsDynamicImpor) {
|
|
2219
|
-
featuresReport["import_dynamic"] = _supportsDynamicImpor; // top level await
|
|
2220
|
-
|
|
2221
|
-
return _call(supportsTopLevelAwait, function (_supportsTopLevelAwai) {
|
|
2222
|
-
featuresReport["top_level_await"] = _supportsTopLevelAwai; // import assertions
|
|
2223
|
-
|
|
2224
|
-
return _call(supportsJsonImportAssertions, function (_supportsJsonImportAs) {
|
|
2225
|
-
featuresReport["import_assertion_type_json"] = _supportsJsonImportAs;
|
|
2226
|
-
return _call(supportsCssImportAssertions, function (_supportsCssImportAss) {
|
|
2227
|
-
featuresReport["import_assertion_type_css"] = _supportsCssImportAss;
|
|
2228
|
-
return featuresReport;
|
|
2229
|
-
});
|
|
2230
|
-
});
|
|
2231
|
-
});
|
|
2232
|
-
});
|
|
2233
|
-
});
|
|
2234
|
-
});
|
|
2235
|
-
|
|
2236
|
-
window.scanBrowserRuntimeFeatures = scanBrowserRuntimeFeatures;
|
|
2237
|
-
window.resolveReadyPromise();
|
|
2238
|
-
}
|
|
2239
|
-
};
|
|
2240
|
-
});
|
|
2241
|
-
|
|
2242
|
-
//# sourceMappingURL=compile_proxy.html__inline__20_651d1e7b.js.map</script>
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
</body></html>
|