From 72f881228236981b625ed765b928efb1786a1f55 Mon Sep 17 00:00:00 2001 From: Aleksey Kulikov Date: Wed, 3 Apr 2024 20:18:24 +0200 Subject: [PATCH] minor deps upgrade --- .../internal/download/download-artifact.js | 50 +- node_modules/@actions/artifact/package.json | 2 +- .../@octokit/openapi-types/package.json | 4 +- .../plugin-paginate-rest/dist-node/index.js | 4 +- .../generated/paginating-endpoints.js | 2 + .../plugin-paginate-rest/dist-src/version.js | 2 +- .../plugin-paginate-rest/dist-web/index.js | 4 +- .../plugin-paginate-rest/package.json | 16 +- .../dist-node/index.js | 67 +- .../dist-src/generated/endpoints.js | 65 +- .../dist-src/version.js | 2 +- .../dist-web/index.js | 67 +- .../plugin-rest-endpoint-methods/package.json | 14 +- .../@octokit/request/dist-node/index.js | 12 +- .../request/dist-src/fetch-wrapper.js | 14 +- .../@octokit/request/dist-src/index.js | 4 +- .../@octokit/request/dist-src/version.js | 2 +- .../request/dist-src/with-defaults.js | 2 +- .../@octokit/request/dist-web/index.js | 12 +- .../@octokit/request/package.json | 8 +- .../node_modules/@octokit/types/package.json | 10 +- .../@actions/http-client/lib/index.js | 10 +- .../@actions/http-client/package.json | 4 +- .../src => dist/browser}/AbortError.js | 0 .../src => dist/browser}/AbortSignalLike.js | 0 .../dist/browser}/index.js | 3 +- .../dist/browser/package.json | 3 + .../dist/{index.js => commonjs/AbortError.js} | 10 +- .../dist/commonjs/AbortSignalLike.js | 5 + .../abort-controller/dist/commonjs/index.js | 8 + .../dist/commonjs/package.json | 3 + .../src => dist/commonjs}/tsdoc-metadata.json | 2 +- .../abort-controller/dist/esm/AbortError.js | 27 + .../dist/esm/AbortSignalLike.js | 4 + .../@azure/abort-controller/dist/esm/index.js | 4 + .../abort-controller/dist/esm/package.json | 3 + .../dist/react-native/AbortError.js | 27 + .../dist/react-native/AbortSignalLike.js | 4 + .../dist/react-native/index.js | 4 + .../dist/react-native/package.json | 3 + .../@azure/abort-controller/package.json | 136 +- .../browser}/azureKeyCredential.js | 1 + .../browser}/azureNamedKeyCredential.js | 2 + .../browser}/azureSASCredential.js | 1 + .../{dist-esm/src => dist/browser}/index.js | 10 +- .../src => dist/browser}/keyCredential.js | 0 .../core-auth/dist/browser/package.json | 3 + .../src => dist/browser}/tokenCredential.js | 0 .../{dist-esm/src => dist/browser}/tracing.js | 0 .../dist/commonjs/azureKeyCredential.js | 43 + .../dist/commonjs/azureNamedKeyCredential.js | 69 + .../dist/commonjs/azureSASCredential.js | 56 + .../@azure/core-auth/dist/commonjs/index.js | 18 + .../core-auth/dist/commonjs/keyCredential.js | 16 + .../core-auth/dist/commonjs/package.json | 3 + .../dist/commonjs/tokenCredential.js | 23 + .../@azure/core-auth/dist/commonjs/tracing.js | 5 + .../dist/commonjs/tsdoc-metadata.json | 11 + .../core-auth/dist/esm/azureKeyCredential.js | 39 + .../dist/esm/azureNamedKeyCredential.js | 64 + .../core-auth/dist/esm/azureSASCredential.js | 51 + .../@azure/core-auth/dist/esm/index.js | 8 + .../core-auth/dist/esm/keyCredential.js | 12 + .../@azure/core-auth/dist/esm/package.json | 3 + .../core-auth/dist/esm/tokenCredential.js | 19 + .../@azure/core-auth/dist/esm/tracing.js | 4 + node_modules/@azure/core-auth/dist/index.js | 192 - .../dist/react-native/azureKeyCredential.js | 39 + .../react-native/azureNamedKeyCredential.js | 64 + .../dist/react-native/azureSASCredential.js | 51 + .../core-auth/dist/react-native/index.js | 8 + .../dist/react-native/keyCredential.js | 12 + .../core-auth/dist/react-native/package.json | 3 + .../dist/react-native/tokenCredential.js | 19 + .../core-auth/dist/react-native/tracing.js | 4 + node_modules/@azure/core-auth/package.json | 109 +- .../src => dist/browser}/http/models.js | 0 .../src => dist/browser}/http/operation.js | 40 +- .../src => dist/browser}/http/poller.js | 11 +- .../{dist-esm/src => dist/browser}/index.js | 8 +- .../dist/browser/legacy/lroEngine}/index.js | 2 +- .../browser}/legacy/lroEngine/lroEngine.js | 9 +- .../browser}/legacy/lroEngine/models.js | 0 .../browser}/legacy/lroEngine/operation.js | 32 +- .../src => dist/browser}/legacy/models.js | 0 .../browser}/legacy/pollOperation.js | 0 .../src => dist/browser}/legacy/poller.js | 18 +- .../{dist-esm/src => dist/browser}/logger.js | 0 .../@azure/core-lro/dist/browser/package.json | 3 + .../src => dist/browser}/poller/constants.js | 0 .../src => dist/browser}/poller/models.js | 0 .../src => dist/browser}/poller/operation.js | 20 +- .../src => dist/browser}/poller/poller.js | 14 +- .../core-lro/dist/commonjs/http/models.js | 5 + .../core-lro/dist/commonjs/http/operation.js | 293 + .../core-lro/dist/commonjs/http/poller.js | 53 + .../@azure/core-lro/dist/commonjs/index.js | 24 + .../dist/commonjs/legacy/lroEngine/index.js | 8 + .../commonjs/legacy/lroEngine/lroEngine.js | 34 + .../dist/commonjs/legacy/lroEngine/models.js | 5 + .../commonjs/legacy/lroEngine/operation.js | 98 + .../core-lro/dist/commonjs/legacy/models.js | 5 + .../dist/commonjs/legacy/pollOperation.js | 5 + .../core-lro/dist/commonjs/legacy/poller.js | 413 + .../@azure/core-lro/dist/commonjs/logger.js | 12 + .../core-lro/dist/commonjs/package.json | 3 + .../dist/commonjs/poller/constants.js | 14 + .../core-lro/dist/commonjs/poller/models.js | 5 + .../dist/commonjs/poller/operation.js | 172 + .../core-lro/dist/commonjs/poller/poller.js | 174 + .../dist/commonjs/tsdoc-metadata.json | 11 + .../src => core-lro/dist/esm/http}/models.js | 0 .../core-lro/dist/esm/http/operation.js | 280 + .../@azure/core-lro/dist/esm/http/poller.js | 49 + .../@azure/core-lro/dist/esm/index.js | 19 + .../esm}/legacy/lroEngine/index.js | 2 +- .../dist/esm/legacy/lroEngine/lroEngine.js | 30 + .../dist/esm/legacy/lroEngine/models.js | 4 + .../dist/esm/legacy/lroEngine/operation.js | 94 + .../@azure/core-lro/dist/esm/legacy/models.js | 4 + .../core-lro/dist/esm/legacy/pollOperation.js | 4 + .../@azure/core-lro/dist/esm/legacy/poller.js | 407 + .../@azure/core-lro/dist/esm/logger.js | 9 + .../@azure/core-lro/dist/esm/package.json | 3 + .../core-lro/dist/esm/poller/constants.js | 11 + .../@azure/core-lro/dist/esm/poller/models.js | 4 + .../core-lro/dist/esm/poller/operation.js | 166 + .../@azure/core-lro/dist/esm/poller/poller.js | 170 + node_modules/@azure/core-lro/dist/index.js | 1189 - .../core-lro/dist/react-native/http/models.js | 4 + .../dist/react-native/http/operation.js | 280 + .../core-lro/dist/react-native/http/poller.js | 49 + .../core-lro/dist/react-native/index.js | 19 + .../react-native/legacy/lroEngine/index.js | 4 + .../legacy/lroEngine/lroEngine.js | 30 + .../react-native/legacy/lroEngine/models.js | 4 + .../legacy/lroEngine/operation.js | 94 + .../dist/react-native/legacy/models.js | 4 + .../dist/react-native/legacy/pollOperation.js | 4 + .../dist/react-native/legacy/poller.js | 407 + .../core-lro/dist/react-native/logger.js | 9 + .../core-lro/dist/react-native/package.json | 3 + .../dist/react-native/poller/constants.js | 11 + .../dist/react-native/poller/models.js | 4 + .../dist/react-native/poller/operation.js | 166 + .../dist/react-native/poller/poller.js | 170 + node_modules/@azure/core-lro/package.json | 135 +- .../dist-esm/src/getPagedAsyncIterator.js | 98 - .../dist/browser/getPagedAsyncIterator.js | 72 + .../@azure/core-paging/dist/browser/index.js | 5 + .../@azure/core-paging/dist/browser/models.js | 4 + .../core-paging/dist/browser/package.json | 3 + .../dist/commonjs/getPagedAsyncIterator.js | 76 + .../@azure/core-paging/dist/commonjs/index.js | 8 + .../core-paging/dist/commonjs/models.js | 5 + .../core-paging/dist/commonjs/package.json | 3 + .../dist/commonjs/tsdoc-metadata.json | 11 + .../dist/esm/getPagedAsyncIterator.js | 72 + .../@azure/core-paging/dist/esm/index.js | 5 + .../@azure/core-paging/dist/esm/models.js | 4 + .../@azure/core-paging/dist/esm/package.json | 3 + node_modules/@azure/core-paging/dist/index.js | 104 - .../react-native/getPagedAsyncIterator.js | 72 + .../core-paging/dist/react-native/index.js | 5 + .../core-paging/dist/react-native/models.js | 4 + .../dist/react-native/package.json | 3 + node_modules/@azure/core-paging/package.json | 140 +- .../@azure/core-util/dist-esm/index.js | 14 - .../browser}/aborterUtils.js | 5 +- .../browser/bytesEncoding.js} | 2 +- .../browser}/checkEnvironment.js | 28 +- .../browser}/createAbortablePromise.js | 12 +- .../{dist-esm => dist/browser}/delay.js | 6 +- .../{dist-esm => dist/browser}/error.js | 2 +- .../@azure/core-util/dist/browser/index.js | 14 + .../{dist-esm => dist/browser}/object.js | 0 .../core-util/dist/browser/package.json | 3 + .../{dist-esm => dist/browser}/random.js | 0 .../browser/sha256.js} | 4 +- .../{dist-esm => dist/browser}/typeGuards.js | 0 .../browser/uuidUtils.common.js} | 5 +- .../browser/uuidUtils.js} | 7 +- .../core-util/dist/commonjs/aborterUtils.js | 24 + .../core-util/dist/commonjs/bytesEncoding.js | 26 + .../dist/commonjs/checkEnvironment.js | 43 + .../dist/commonjs/createAbortablePromise.js | 46 + .../@azure/core-util/dist/commonjs/delay.js | 26 + .../@azure/core-util/dist/commonjs/error.js | 47 + .../@azure/core-util/dist/commonjs/index.js | 38 + .../@azure/core-util/dist/commonjs/object.js | 18 + .../core-util/dist/commonjs/package.json | 3 + .../@azure/core-util/dist/commonjs/random.js | 25 + .../@azure/core-util/dist/commonjs/sha256.js | 27 + .../dist/commonjs/tsdoc-metadata.json | 11 + .../core-util/dist/commonjs/typeGuards.js | 40 + .../dist/commonjs/uuidUtils.common.js | 45 + .../core-util/dist/commonjs/uuidUtils.js | 20 + .../@azure/core-util/dist/esm/aborterUtils.js | 20 + .../{dist-esm => dist/esm}/bytesEncoding.js | 0 .../core-util/dist/esm/checkEnvironment.js | 40 + .../dist/esm/createAbortablePromise.js | 42 + .../@azure/core-util/dist/esm/delay.js | 22 + .../@azure/core-util/dist/esm/error.js | 42 + .../@azure/core-util/dist/esm/index.js | 14 + .../@azure/core-util/dist/esm/object.js | 14 + .../@azure/core-util/dist/esm/package.json | 3 + .../@azure/core-util/dist/esm/random.js | 21 + .../{dist-esm => dist/esm}/sha256.js | 0 .../@azure/core-util/dist/esm/typeGuards.js | 34 + .../core-util/dist/esm/uuidUtils.common.js | 40 + .../{dist-esm => dist/esm}/uuidUtils.js | 8 +- node_modules/@azure/core-util/dist/index.js | 359 - .../dist/react-native/aborterUtils.js | 20 + .../dist/react-native/bytesEncoding.js | 21 + .../dist/react-native/checkEnvironment.js | 40 + .../react-native/createAbortablePromise.js | 42 + .../core-util/dist/react-native/delay.js | 22 + .../core-util/dist/react-native/error.js | 42 + .../core-util/dist/react-native/index.js | 14 + .../core-util/dist/react-native/object.js | 14 + .../core-util/dist/react-native/package.json | 3 + .../core-util/dist/react-native/random.js | 21 + .../core-util/dist/react-native/sha256.js | 22 + .../core-util/dist/react-native/typeGuards.js | 34 + .../dist/react-native/uuidUtils.common.js | 40 + .../core-util/dist/react-native/uuidUtils.js | 4 + node_modules/@azure/core-util/package.json | 115 +- .../{dist-esm/src => dist/browser}/debug.js | 2 +- .../{dist-esm/src => dist/browser}/index.js | 2 +- .../log.browser.js => dist/browser/log.js} | 2 +- .../@azure/logger/dist/browser/package.json | 3 + .../@azure/logger/dist/commonjs/debug.js | 95 + .../@azure/logger/dist/commonjs/index.js | 105 + .../@azure/logger/dist/commonjs/log.js | 14 + .../@azure/logger/dist/commonjs/package.json | 3 + .../logger/dist/commonjs/tsdoc-metadata.json | 11 + node_modules/@azure/logger/dist/esm/debug.js | 93 + node_modules/@azure/logger/dist/esm/index.js | 98 + .../logger/{dist-esm/src => dist/esm}/log.js | 5 +- .../@azure/logger/dist/esm/package.json | 3 + node_modules/@azure/logger/dist/index.js | 208 - .../@azure/logger/dist/react-native/debug.js | 93 + .../@azure/logger/dist/react-native/index.js | 98 + .../@azure/logger/dist/react-native/log.js | 9 + .../logger/dist/react-native/package.json | 3 + node_modules/@azure/logger/package.json | 147 +- .../@fastify/busboy/deps/dicer/lib/Dicer.js | 12 +- .../@fastify/busboy/lib/types/multipart.js | 2 +- .../@fastify/busboy/lib/utils/decodeText.js | 2 +- node_modules/@fastify/busboy/package.json | 6 +- .../@octokit/openapi-types/package.json | 4 +- .../node_modules/@octokit/types/package.json | 10 +- .../api/build/esm/experimental/index.js | 17 + .../esm/experimental/trace/SugaredOptions.js | 17 + .../esm/experimental/trace/SugaredTracer.js | 92 + .../@opentelemetry/api/build/esm/version.js | 2 +- .../api/build/esnext/experimental/index.js | 17 + .../experimental/trace/SugaredOptions.js | 17 + .../experimental/trace/SugaredTracer.js | 88 + .../api/build/esnext/version.js | 2 +- .../api/build/src/experimental/index.js | 22 + .../src/experimental/trace/SugaredOptions.js | 18 + .../src/experimental/trace/SugaredTracer.js | 93 + .../@opentelemetry/api/build/src/version.js | 2 +- node_modules/@opentelemetry/api/package.json | 24 +- .../plugin-framework/package.json | 6 +- node_modules/@protobuf-ts/plugin/package.json | 12 +- node_modules/@protobuf-ts/protoc/package.json | 4 +- .../@protobuf-ts/runtime-rpc/package.json | 6 +- .../runtime/build/commonjs/message-type.js | 3 +- .../runtime/build/es2015/message-type.js | 3 +- .../@protobuf-ts/runtime/package.json | 4 +- node_modules/@types/node/package.json | 18 +- node_modules/agent-base/dist/index.js | 65 +- node_modules/agent-base/package.json | 2 +- node_modules/axe-core/LICENSE-3RD-PARTY.txt | 66 + node_modules/axe-core/axe.js | 21975 ++++++++-------- node_modules/axe-core/axe.min.js | 6 +- node_modules/axe-core/locales/_template.json | 18 +- node_modules/axe-core/locales/da.json | 4 +- node_modules/axe-core/locales/de.json | 238 +- node_modules/axe-core/locales/el.json | 1069 + node_modules/axe-core/locales/es.json | 4 +- node_modules/axe-core/locales/eu.json | 4 +- node_modules/axe-core/locales/fr.json | 4 +- node_modules/axe-core/locales/he.json | 4 +- node_modules/axe-core/locales/it.json | 1108 + node_modules/axe-core/locales/ja.json | 4 +- node_modules/axe-core/locales/ko.json | 4 +- node_modules/axe-core/locales/no_NB.json | 4 +- node_modules/axe-core/locales/pl.json | 4 +- node_modules/axe-core/locales/pt_BR.json | 4 +- node_modules/axe-core/locales/zh_CN.json | 1116 + node_modules/axe-core/locales/zh_TW.json | 1108 + node_modules/axe-core/package.json | 43 +- node_modules/axe-core/sri-history.json | 8 + node_modules/b4a/package.json | 6 +- node_modules/bare-events/index.js | 290 + node_modules/bare-events/lib/errors.js | 22 + node_modules/bare-events/package.json | 27 + node_modules/basic-ftp/dist/Client.js | 8 +- node_modules/basic-ftp/dist/FtpContext.js | 6 +- node_modules/basic-ftp/package.json | 6 +- node_modules/body-parser/lib/types/json.js | 19 +- node_modules/body-parser/package.json | 16 +- node_modules/call-bind/index.js | 13 +- node_modules/call-bind/package.json | 17 +- node_modules/cookie/index.js | 6 +- node_modules/cookie/package.json | 10 +- .../data-uri-to-buffer/dist/common.js | 54 + node_modules/data-uri-to-buffer/dist/index.js | 47 +- node_modules/data-uri-to-buffer/dist/node.js | 26 + node_modules/data-uri-to-buffer/package.json | 6 +- node_modules/define-data-property/index.js | 20 +- .../define-data-property/package.json | 59 +- .../es-define-property/.github/FUNDING.yml | 12 + node_modules/es-define-property/.nycrc | 9 + node_modules/es-define-property/index.js | 16 + node_modules/es-define-property/package.json | 81 + node_modules/es-errors/eval.js | 4 + node_modules/es-errors/index.js | 4 + node_modules/es-errors/package.json | 6 +- node_modules/es-errors/ref.js | 4 + node_modules/es-errors/uri.js | 4 + node_modules/escalade/package.json | 4 +- node_modules/express/lib/response.js | 15 +- node_modules/express/lib/router/index.js | 2 +- node_modules/express/lib/router/route.js | 9 +- node_modules/express/lib/utils.js | 7 +- node_modules/express/package.json | 13 +- node_modules/fs-extra/lib/copy-sync/index.js | 5 - .../lib/{copy-sync => copy}/copy-sync.js | 91 +- node_modules/fs-extra/lib/copy/copy.js | 295 +- node_modules/fs-extra/lib/copy/index.js | 5 +- node_modules/fs-extra/lib/empty/index.js | 31 +- node_modules/fs-extra/lib/ensure/file.js | 67 +- node_modules/fs-extra/lib/ensure/index.js | 30 +- node_modules/fs-extra/lib/ensure/link.js | 69 +- .../fs-extra/lib/ensure/symlink-paths.js | 116 +- .../fs-extra/lib/ensure/symlink-type.js | 31 +- node_modules/fs-extra/lib/ensure/symlink.js | 88 +- node_modules/fs-extra/lib/esm.mjs | 68 + node_modules/fs-extra/lib/fs/index.js | 61 +- node_modules/fs-extra/lib/index.js | 34 +- node_modules/fs-extra/lib/json/index.js | 2 +- node_modules/fs-extra/lib/json/jsonfile.js | 5 +- .../fs-extra/lib/json/output-json-sync.js | 14 +- node_modules/fs-extra/lib/json/output-json.js | 25 +- node_modules/fs-extra/lib/mkdirs/index.js | 18 +- node_modules/fs-extra/lib/mkdirs/make-dir.js | 27 + .../fs-extra/lib/mkdirs/mkdirs-sync.js | 54 - node_modules/fs-extra/lib/mkdirs/mkdirs.js | 63 - node_modules/fs-extra/lib/mkdirs/utils.js | 21 + node_modules/fs-extra/lib/mkdirs/win32.js | 25 - node_modules/fs-extra/lib/move-sync/index.js | 5 - node_modules/fs-extra/lib/move/index.js | 5 +- .../lib/{move-sync => move}/move-sync.js | 20 +- node_modules/fs-extra/lib/move/move.js | 86 +- .../fs-extra/lib/output-file/index.js | 31 + node_modules/fs-extra/lib/output/index.js | 40 - node_modules/fs-extra/lib/remove/index.js | 14 +- node_modules/fs-extra/lib/remove/rimraf.js | 314 - node_modules/fs-extra/lib/util/buffer.js | 12 - node_modules/fs-extra/lib/util/stat.js | 200 +- node_modules/fs-extra/lib/util/utimes.js | 83 +- node_modules/fs-extra/package.json | 36 +- node_modules/get-intrinsic/index.js | 12 +- node_modules/get-intrinsic/package.json | 4 +- node_modules/get-uri/package.json | 6 +- .../has-property-descriptors/index.js | 17 +- .../has-property-descriptors/package.json | 10 +- node_modules/has-proto/index.js | 6 +- node_modules/has-proto/package.json | 14 +- node_modules/hasown/index.js | 2 +- node_modules/hasown/package.json | 31 +- node_modules/http-link-header/lib/link.js | 8 +- node_modules/http-link-header/package.json | 9 +- node_modules/http-proxy-agent/dist/index.js | 5 +- node_modules/http-proxy-agent/package.json | 2 +- node_modules/ip-address/dist/address-error.js | 14 + node_modules/ip-address/dist/common.js | 26 + node_modules/ip-address/dist/ip-address.js | 35 + node_modules/ip-address/dist/ipv4.js | 326 + node_modules/ip-address/dist/ipv6.js | 998 + node_modules/ip-address/dist/v4/constants.js | 8 + node_modules/ip-address/dist/v6/constants.js | 76 + node_modules/ip-address/dist/v6/helpers.js | 48 + .../ip-address/dist/v6/regular-expressions.js | 96 + .../sprintf-js/dist/angular-sprintf.min.js | 3 + .../sprintf-js/dist/sprintf.min.js | 3 + .../node_modules/sprintf-js/package.json | 35 + .../sprintf-js/src/angular-sprintf.js | 24 + .../node_modules/sprintf-js/src/sprintf.js | 231 + node_modules/ip-address/package.json | 87 + node_modules/ip/lib/ip.js | 427 - node_modules/ip/package.json | 25 - node_modules/jsbn/example.html | 11 + node_modules/jsbn/example.js | 5 + node_modules/jsbn/index.js | 1361 + node_modules/jsbn/package.json | 21 + node_modules/jsonfile/index.js | 132 +- node_modules/jsonfile/package.json | 13 +- node_modules/jsonfile/utils.js | 14 + .../chrome-launcher/dist/flags.js | 4 +- .../node_modules/chrome-launcher/package.json | 2 +- .../https-proxy-agent/dist/index.js | 5 +- .../https-proxy-agent/package.json | 2 +- node_modules/pac-resolver/dist/ip.js | 50 + node_modules/pac-resolver/dist/myIpAddress.js | 4 +- node_modules/pac-resolver/package.json | 4 +- .../https-proxy-agent/dist/index.js | 5 +- .../https-proxy-agent/package.json | 2 +- node_modules/raw-body/index.js | 7 + node_modules/raw-body/package.json | 14 +- node_modules/set-function-length/env.js | 1 + node_modules/set-function-length/index.js | 6 +- node_modules/set-function-length/package.json | 27 +- node_modules/side-channel/index.js | 45 +- node_modules/side-channel/package.json | 55 +- node_modules/socks-proxy-agent/dist/index.js | 4 + node_modules/socks-proxy-agent/package.json | 4 +- .../socks/build/client/socksclient.js | 28 +- node_modules/socks/build/common/constants.js | 26 +- node_modules/socks/build/common/helpers.js | 36 +- node_modules/socks/node_modules/ip/lib/ip.js | 422 - .../socks/node_modules/ip/package.json | 25 - node_modules/socks/package.json | 22 +- node_modules/streamx/index.js | 82 +- node_modules/streamx/package.json | 5 +- .../third-party-web/dist/domain-map.csv | 10 +- .../dist/entities-httparchive-nostats.json | 2 +- .../dist/entities-httparchive.json | 2 +- .../dist/entities-nostats.json | 2 +- .../third-party-web/dist/entities.json | 2 +- node_modules/third-party-web/package.json | 2 +- .../tldts-core/dist/cjs/tsconfig.tsbuildinfo | 2 +- .../dist/es6/tsconfig.bundle.tsbuildinfo | 2 +- node_modules/tldts-core/package.json | 8 +- node_modules/tldts-icann/dist/cjs/index.js | 8 +- .../tldts-icann/dist/cjs/src/data/trie.js | 8 +- .../tldts-icann/dist/cjs/tsconfig.tsbuildinfo | 2 +- .../tldts-icann/dist/es6/src/data/trie.js | 8 +- .../dist/es6/tsconfig.bundle.tsbuildinfo | 2 +- .../tldts-icann/dist/index.cjs.min.js | 2 +- .../tldts-icann/dist/index.esm.min.js | 2 +- .../tldts-icann/dist/index.umd.min.js | 2 +- node_modules/tldts-icann/package.json | 12 +- node_modules/undici/lib/core/constants.js | 118 + node_modules/undici/lib/core/util.js | 11 + node_modules/undici/lib/fetch/index.js | 3 + node_modules/undici/lib/fetch/util.js | 143 +- .../undici/lib/handler/RedirectHandler.js | 17 +- node_modules/undici/package.json | 4 +- node_modules/universalify/index.js | 23 +- node_modules/universalify/package.json | 12 +- package.json | 6 +- yarn.lock | 525 +- 457 files changed, 30349 insertions(+), 16190 deletions(-) rename node_modules/@azure/abort-controller/{dist-esm/src => dist/browser}/AbortError.js (100%) rename node_modules/@azure/abort-controller/{dist-esm/src => dist/browser}/AbortSignalLike.js (100%) rename node_modules/@azure/{core-paging/dist-esm/src => abort-controller/dist/browser}/index.js (61%) create mode 100644 node_modules/@azure/abort-controller/dist/browser/package.json rename node_modules/@azure/abort-controller/dist/{index.js => commonjs/AbortError.js} (82%) create mode 100644 node_modules/@azure/abort-controller/dist/commonjs/AbortSignalLike.js create mode 100644 node_modules/@azure/abort-controller/dist/commonjs/index.js create mode 100644 node_modules/@azure/abort-controller/dist/commonjs/package.json rename node_modules/@azure/abort-controller/{types/src => dist/commonjs}/tsdoc-metadata.json (87%) create mode 100644 node_modules/@azure/abort-controller/dist/esm/AbortError.js create mode 100644 node_modules/@azure/abort-controller/dist/esm/AbortSignalLike.js create mode 100644 node_modules/@azure/abort-controller/dist/esm/index.js create mode 100644 node_modules/@azure/abort-controller/dist/esm/package.json create mode 100644 node_modules/@azure/abort-controller/dist/react-native/AbortError.js create mode 100644 node_modules/@azure/abort-controller/dist/react-native/AbortSignalLike.js create mode 100644 node_modules/@azure/abort-controller/dist/react-native/index.js create mode 100644 node_modules/@azure/abort-controller/dist/react-native/package.json rename node_modules/@azure/core-auth/{dist-esm/src => dist/browser}/azureKeyCredential.js (98%) rename node_modules/@azure/core-auth/{dist-esm/src => dist/browser}/azureNamedKeyCredential.js (98%) rename node_modules/@azure/core-auth/{dist-esm/src => dist/browser}/azureSASCredential.js (99%) rename node_modules/@azure/core-auth/{dist-esm/src => dist/browser}/index.js (51%) rename node_modules/@azure/core-auth/{dist-esm/src => dist/browser}/keyCredential.js (100%) create mode 100644 node_modules/@azure/core-auth/dist/browser/package.json rename node_modules/@azure/core-auth/{dist-esm/src => dist/browser}/tokenCredential.js (100%) rename node_modules/@azure/core-auth/{dist-esm/src => dist/browser}/tracing.js (100%) create mode 100644 node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js create mode 100644 node_modules/@azure/core-auth/dist/commonjs/azureNamedKeyCredential.js create mode 100644 node_modules/@azure/core-auth/dist/commonjs/azureSASCredential.js create mode 100644 node_modules/@azure/core-auth/dist/commonjs/index.js create mode 100644 node_modules/@azure/core-auth/dist/commonjs/keyCredential.js create mode 100644 node_modules/@azure/core-auth/dist/commonjs/package.json create mode 100644 node_modules/@azure/core-auth/dist/commonjs/tokenCredential.js create mode 100644 node_modules/@azure/core-auth/dist/commonjs/tracing.js create mode 100644 node_modules/@azure/core-auth/dist/commonjs/tsdoc-metadata.json create mode 100644 node_modules/@azure/core-auth/dist/esm/azureKeyCredential.js create mode 100644 node_modules/@azure/core-auth/dist/esm/azureNamedKeyCredential.js create mode 100644 node_modules/@azure/core-auth/dist/esm/azureSASCredential.js create mode 100644 node_modules/@azure/core-auth/dist/esm/index.js create mode 100644 node_modules/@azure/core-auth/dist/esm/keyCredential.js create mode 100644 node_modules/@azure/core-auth/dist/esm/package.json create mode 100644 node_modules/@azure/core-auth/dist/esm/tokenCredential.js create mode 100644 node_modules/@azure/core-auth/dist/esm/tracing.js delete mode 100644 node_modules/@azure/core-auth/dist/index.js create mode 100644 node_modules/@azure/core-auth/dist/react-native/azureKeyCredential.js create mode 100644 node_modules/@azure/core-auth/dist/react-native/azureNamedKeyCredential.js create mode 100644 node_modules/@azure/core-auth/dist/react-native/azureSASCredential.js create mode 100644 node_modules/@azure/core-auth/dist/react-native/index.js create mode 100644 node_modules/@azure/core-auth/dist/react-native/keyCredential.js create mode 100644 node_modules/@azure/core-auth/dist/react-native/package.json create mode 100644 node_modules/@azure/core-auth/dist/react-native/tokenCredential.js create mode 100644 node_modules/@azure/core-auth/dist/react-native/tracing.js rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/http/models.js (100%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/http/operation.js (83%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/http/poller.js (81%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/index.js (70%) rename node_modules/@azure/{abort-controller/dist-esm/src => core-lro/dist/browser/legacy/lroEngine}/index.js (71%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/legacy/lroEngine/lroEngine.js (82%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/legacy/lroEngine/models.js (100%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/legacy/lroEngine/operation.js (81%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/legacy/models.js (100%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/legacy/pollOperation.js (100%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/legacy/poller.js (97%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/logger.js (100%) create mode 100644 node_modules/@azure/core-lro/dist/browser/package.json rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/poller/constants.js (100%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/poller/models.js (100%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/poller/operation.js (83%) rename node_modules/@azure/core-lro/{dist-esm/src => dist/browser}/poller/poller.js (91%) create mode 100644 node_modules/@azure/core-lro/dist/commonjs/http/models.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/http/operation.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/http/poller.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/index.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/index.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/lroEngine.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/models.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/operation.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/legacy/models.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/legacy/pollOperation.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/legacy/poller.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/logger.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/package.json create mode 100644 node_modules/@azure/core-lro/dist/commonjs/poller/constants.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/poller/models.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/poller/operation.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/poller/poller.js create mode 100644 node_modules/@azure/core-lro/dist/commonjs/tsdoc-metadata.json rename node_modules/@azure/{core-paging/dist-esm/src => core-lro/dist/esm/http}/models.js (100%) create mode 100644 node_modules/@azure/core-lro/dist/esm/http/operation.js create mode 100644 node_modules/@azure/core-lro/dist/esm/http/poller.js create mode 100644 node_modules/@azure/core-lro/dist/esm/index.js rename node_modules/@azure/core-lro/{dist-esm/src => dist/esm}/legacy/lroEngine/index.js (71%) create mode 100644 node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/lroEngine.js create mode 100644 node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/models.js create mode 100644 node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/operation.js create mode 100644 node_modules/@azure/core-lro/dist/esm/legacy/models.js create mode 100644 node_modules/@azure/core-lro/dist/esm/legacy/pollOperation.js create mode 100644 node_modules/@azure/core-lro/dist/esm/legacy/poller.js create mode 100644 node_modules/@azure/core-lro/dist/esm/logger.js create mode 100644 node_modules/@azure/core-lro/dist/esm/package.json create mode 100644 node_modules/@azure/core-lro/dist/esm/poller/constants.js create mode 100644 node_modules/@azure/core-lro/dist/esm/poller/models.js create mode 100644 node_modules/@azure/core-lro/dist/esm/poller/operation.js create mode 100644 node_modules/@azure/core-lro/dist/esm/poller/poller.js delete mode 100644 node_modules/@azure/core-lro/dist/index.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/http/models.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/http/operation.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/http/poller.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/index.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/index.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/lroEngine.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/models.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/operation.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/legacy/models.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/legacy/pollOperation.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/legacy/poller.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/logger.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/package.json create mode 100644 node_modules/@azure/core-lro/dist/react-native/poller/constants.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/poller/models.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/poller/operation.js create mode 100644 node_modules/@azure/core-lro/dist/react-native/poller/poller.js delete mode 100644 node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js create mode 100644 node_modules/@azure/core-paging/dist/browser/getPagedAsyncIterator.js create mode 100644 node_modules/@azure/core-paging/dist/browser/index.js create mode 100644 node_modules/@azure/core-paging/dist/browser/models.js create mode 100644 node_modules/@azure/core-paging/dist/browser/package.json create mode 100644 node_modules/@azure/core-paging/dist/commonjs/getPagedAsyncIterator.js create mode 100644 node_modules/@azure/core-paging/dist/commonjs/index.js create mode 100644 node_modules/@azure/core-paging/dist/commonjs/models.js create mode 100644 node_modules/@azure/core-paging/dist/commonjs/package.json create mode 100644 node_modules/@azure/core-paging/dist/commonjs/tsdoc-metadata.json create mode 100644 node_modules/@azure/core-paging/dist/esm/getPagedAsyncIterator.js create mode 100644 node_modules/@azure/core-paging/dist/esm/index.js create mode 100644 node_modules/@azure/core-paging/dist/esm/models.js create mode 100644 node_modules/@azure/core-paging/dist/esm/package.json delete mode 100644 node_modules/@azure/core-paging/dist/index.js create mode 100644 node_modules/@azure/core-paging/dist/react-native/getPagedAsyncIterator.js create mode 100644 node_modules/@azure/core-paging/dist/react-native/index.js create mode 100644 node_modules/@azure/core-paging/dist/react-native/models.js create mode 100644 node_modules/@azure/core-paging/dist/react-native/package.json delete mode 100644 node_modules/@azure/core-util/dist-esm/index.js rename node_modules/@azure/core-util/{dist-esm => dist/browser}/aborterUtils.js (62%) rename node_modules/@azure/core-util/{dist-esm/bytesEncoding.browser.js => dist/browser/bytesEncoding.js} (98%) rename node_modules/@azure/core-util/{dist-esm => dist/browser}/checkEnvironment.js (66%) rename node_modules/@azure/core-util/{dist-esm => dist/browser}/createAbortablePromise.js (64%) rename node_modules/@azure/core-util/{dist-esm => dist/browser}/delay.js (77%) rename node_modules/@azure/core-util/{dist-esm => dist/browser}/error.js (96%) create mode 100644 node_modules/@azure/core-util/dist/browser/index.js rename node_modules/@azure/core-util/{dist-esm => dist/browser}/object.js (100%) create mode 100644 node_modules/@azure/core-util/dist/browser/package.json rename node_modules/@azure/core-util/{dist-esm => dist/browser}/random.js (100%) rename node_modules/@azure/core-util/{dist-esm/sha256.browser.js => dist/browser/sha256.js} (96%) rename node_modules/@azure/core-util/{dist-esm => dist/browser}/typeGuards.js (100%) rename node_modules/@azure/core-util/{dist-esm/uuidUtils.native.js => dist/browser/uuidUtils.common.js} (88%) rename node_modules/@azure/core-util/{dist-esm/uuidUtils.browser.js => dist/browser/uuidUtils.js} (56%) create mode 100644 node_modules/@azure/core-util/dist/commonjs/aborterUtils.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/createAbortablePromise.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/delay.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/error.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/index.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/object.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/package.json create mode 100644 node_modules/@azure/core-util/dist/commonjs/random.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/sha256.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/tsdoc-metadata.json create mode 100644 node_modules/@azure/core-util/dist/commonjs/typeGuards.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/uuidUtils.common.js create mode 100644 node_modules/@azure/core-util/dist/commonjs/uuidUtils.js create mode 100644 node_modules/@azure/core-util/dist/esm/aborterUtils.js rename node_modules/@azure/core-util/{dist-esm => dist/esm}/bytesEncoding.js (100%) create mode 100644 node_modules/@azure/core-util/dist/esm/checkEnvironment.js create mode 100644 node_modules/@azure/core-util/dist/esm/createAbortablePromise.js create mode 100644 node_modules/@azure/core-util/dist/esm/delay.js create mode 100644 node_modules/@azure/core-util/dist/esm/error.js create mode 100644 node_modules/@azure/core-util/dist/esm/index.js create mode 100644 node_modules/@azure/core-util/dist/esm/object.js create mode 100644 node_modules/@azure/core-util/dist/esm/package.json create mode 100644 node_modules/@azure/core-util/dist/esm/random.js rename node_modules/@azure/core-util/{dist-esm => dist/esm}/sha256.js (100%) create mode 100644 node_modules/@azure/core-util/dist/esm/typeGuards.js create mode 100644 node_modules/@azure/core-util/dist/esm/uuidUtils.common.js rename node_modules/@azure/core-util/{dist-esm => dist/esm}/uuidUtils.js (58%) delete mode 100644 node_modules/@azure/core-util/dist/index.js create mode 100644 node_modules/@azure/core-util/dist/react-native/aborterUtils.js create mode 100644 node_modules/@azure/core-util/dist/react-native/bytesEncoding.js create mode 100644 node_modules/@azure/core-util/dist/react-native/checkEnvironment.js create mode 100644 node_modules/@azure/core-util/dist/react-native/createAbortablePromise.js create mode 100644 node_modules/@azure/core-util/dist/react-native/delay.js create mode 100644 node_modules/@azure/core-util/dist/react-native/error.js create mode 100644 node_modules/@azure/core-util/dist/react-native/index.js create mode 100644 node_modules/@azure/core-util/dist/react-native/object.js create mode 100644 node_modules/@azure/core-util/dist/react-native/package.json create mode 100644 node_modules/@azure/core-util/dist/react-native/random.js create mode 100644 node_modules/@azure/core-util/dist/react-native/sha256.js create mode 100644 node_modules/@azure/core-util/dist/react-native/typeGuards.js create mode 100644 node_modules/@azure/core-util/dist/react-native/uuidUtils.common.js create mode 100644 node_modules/@azure/core-util/dist/react-native/uuidUtils.js rename node_modules/@azure/logger/{dist-esm/src => dist/browser}/debug.js (98%) rename node_modules/@azure/logger/{dist-esm/src => dist/browser}/index.js (99%) rename node_modules/@azure/logger/{dist-esm/src/log.browser.js => dist/browser/log.js} (93%) create mode 100644 node_modules/@azure/logger/dist/browser/package.json create mode 100644 node_modules/@azure/logger/dist/commonjs/debug.js create mode 100644 node_modules/@azure/logger/dist/commonjs/index.js create mode 100644 node_modules/@azure/logger/dist/commonjs/log.js create mode 100644 node_modules/@azure/logger/dist/commonjs/package.json create mode 100644 node_modules/@azure/logger/dist/commonjs/tsdoc-metadata.json create mode 100644 node_modules/@azure/logger/dist/esm/debug.js create mode 100644 node_modules/@azure/logger/dist/esm/index.js rename node_modules/@azure/logger/{dist-esm/src => dist/esm}/log.js (67%) create mode 100644 node_modules/@azure/logger/dist/esm/package.json delete mode 100644 node_modules/@azure/logger/dist/index.js create mode 100644 node_modules/@azure/logger/dist/react-native/debug.js create mode 100644 node_modules/@azure/logger/dist/react-native/index.js create mode 100644 node_modules/@azure/logger/dist/react-native/log.js create mode 100644 node_modules/@azure/logger/dist/react-native/package.json create mode 100644 node_modules/@opentelemetry/api/build/esm/experimental/index.js create mode 100644 node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.js create mode 100644 node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.js create mode 100644 node_modules/@opentelemetry/api/build/esnext/experimental/index.js create mode 100644 node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredOptions.js create mode 100644 node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredTracer.js create mode 100644 node_modules/@opentelemetry/api/build/src/experimental/index.js create mode 100644 node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredOptions.js create mode 100644 node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredTracer.js create mode 100644 node_modules/axe-core/LICENSE-3RD-PARTY.txt create mode 100644 node_modules/axe-core/locales/el.json create mode 100644 node_modules/axe-core/locales/it.json create mode 100644 node_modules/axe-core/locales/zh_CN.json create mode 100644 node_modules/axe-core/locales/zh_TW.json create mode 100644 node_modules/bare-events/index.js create mode 100644 node_modules/bare-events/lib/errors.js create mode 100644 node_modules/bare-events/package.json create mode 100644 node_modules/data-uri-to-buffer/dist/common.js create mode 100644 node_modules/data-uri-to-buffer/dist/node.js create mode 100644 node_modules/es-define-property/.github/FUNDING.yml create mode 100644 node_modules/es-define-property/.nycrc create mode 100644 node_modules/es-define-property/index.js create mode 100644 node_modules/es-define-property/package.json create mode 100644 node_modules/es-errors/eval.js create mode 100644 node_modules/es-errors/index.js create mode 100644 node_modules/es-errors/ref.js create mode 100644 node_modules/es-errors/uri.js delete mode 100644 node_modules/fs-extra/lib/copy-sync/index.js rename node_modules/fs-extra/lib/{copy-sync => copy}/copy-sync.js (64%) create mode 100644 node_modules/fs-extra/lib/esm.mjs create mode 100644 node_modules/fs-extra/lib/mkdirs/make-dir.js delete mode 100644 node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js delete mode 100644 node_modules/fs-extra/lib/mkdirs/mkdirs.js create mode 100644 node_modules/fs-extra/lib/mkdirs/utils.js delete mode 100644 node_modules/fs-extra/lib/mkdirs/win32.js delete mode 100644 node_modules/fs-extra/lib/move-sync/index.js rename node_modules/fs-extra/lib/{move-sync => move}/move-sync.js (62%) create mode 100644 node_modules/fs-extra/lib/output-file/index.js delete mode 100644 node_modules/fs-extra/lib/output/index.js delete mode 100644 node_modules/fs-extra/lib/remove/rimraf.js delete mode 100644 node_modules/fs-extra/lib/util/buffer.js create mode 100644 node_modules/ip-address/dist/address-error.js create mode 100644 node_modules/ip-address/dist/common.js create mode 100644 node_modules/ip-address/dist/ip-address.js create mode 100644 node_modules/ip-address/dist/ipv4.js create mode 100644 node_modules/ip-address/dist/ipv6.js create mode 100644 node_modules/ip-address/dist/v4/constants.js create mode 100644 node_modules/ip-address/dist/v6/constants.js create mode 100644 node_modules/ip-address/dist/v6/helpers.js create mode 100644 node_modules/ip-address/dist/v6/regular-expressions.js create mode 100644 node_modules/ip-address/node_modules/sprintf-js/dist/angular-sprintf.min.js create mode 100644 node_modules/ip-address/node_modules/sprintf-js/dist/sprintf.min.js create mode 100644 node_modules/ip-address/node_modules/sprintf-js/package.json create mode 100644 node_modules/ip-address/node_modules/sprintf-js/src/angular-sprintf.js create mode 100644 node_modules/ip-address/node_modules/sprintf-js/src/sprintf.js create mode 100644 node_modules/ip-address/package.json delete mode 100644 node_modules/ip/lib/ip.js delete mode 100644 node_modules/ip/package.json create mode 100644 node_modules/jsbn/example.html create mode 100644 node_modules/jsbn/example.js create mode 100644 node_modules/jsbn/index.js create mode 100644 node_modules/jsbn/package.json create mode 100644 node_modules/jsonfile/utils.js create mode 100644 node_modules/pac-resolver/dist/ip.js delete mode 100644 node_modules/socks/node_modules/ip/lib/ip.js delete mode 100644 node_modules/socks/node_modules/ip/package.json create mode 100644 node_modules/undici/lib/core/constants.js diff --git a/node_modules/@actions/artifact/lib/internal/download/download-artifact.js b/node_modules/@actions/artifact/lib/internal/download/download-artifact.js index 0a7535a1c..db82ab8fd 100644 --- a/node_modules/@actions/artifact/lib/internal/download/download-artifact.js +++ b/node_modules/@actions/artifact/lib/internal/download/download-artifact.js @@ -37,6 +37,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); exports.downloadArtifactInternal = exports.downloadArtifactPublic = exports.streamExtractExternal = void 0; const promises_1 = __importDefault(require("fs/promises")); +const stream = __importStar(require("stream")); +const fs_1 = require("fs"); +const path = __importStar(require("path")); const github = __importStar(require("@actions/github")); const core = __importStar(require("@actions/core")); const httpClient = __importStar(require("@actions/http-client")); @@ -77,6 +80,9 @@ function streamExtract(url, directory) { return; } catch (error) { + if (error.message.includes('Malformed extraction path')) { + throw new Error(`Artifact download failed with unretryable error: ${error.message}`); + } retryCount++; core.debug(`Failed to download artifact after ${retryCount} retries due to ${error.message}. Retrying in 5 seconds...`); // wait 5 seconds before retrying @@ -99,6 +105,8 @@ function streamExtractExternal(url, directory) { response.message.destroy(new Error(`Blob storage chunk did not respond in ${timeout}ms`)); }; const timer = setTimeout(timerFn, timeout); + const createdDirectories = new Set(); + createdDirectories.add(directory); response.message .on('data', () => { timer.refresh(); @@ -108,11 +116,47 @@ function streamExtractExternal(url, directory) { clearTimeout(timer); reject(error); }) - .pipe(unzip_stream_1.default.Extract({ path: directory })) - .on('close', () => { + .pipe(unzip_stream_1.default.Parse()) + .pipe(new stream.Transform({ + objectMode: true, + transform: (entry, _, callback) => __awaiter(this, void 0, void 0, function* () { + const fullPath = path.normalize(path.join(directory, entry.path)); + if (!directory.endsWith(path.sep)) { + directory += path.sep; + } + if (!fullPath.startsWith(directory)) { + reject(new Error(`Malformed extraction path: ${fullPath}`)); + } + if (entry.type === 'Directory') { + if (!createdDirectories.has(fullPath)) { + createdDirectories.add(fullPath); + yield resolveOrCreateDirectory(fullPath).then(() => { + entry.autodrain(); + callback(); + }); + } + else { + entry.autodrain(); + callback(); + } + } + else { + core.info(`Extracting artifact entry: ${fullPath}`); + if (!createdDirectories.has(path.dirname(fullPath))) { + createdDirectories.add(path.dirname(fullPath)); + yield resolveOrCreateDirectory(path.dirname(fullPath)); + } + const writeStream = (0, fs_1.createWriteStream)(fullPath); + writeStream.on('finish', callback); + writeStream.on('error', reject); + entry.pipe(writeStream); + } + }) + })) + .on('finish', () => __awaiter(this, void 0, void 0, function* () { clearTimeout(timer); resolve(); - }) + })) .on('error', (error) => { reject(error); }); diff --git a/node_modules/@actions/artifact/package.json b/node_modules/@actions/artifact/package.json index a5f6ad100..c15570813 100644 --- a/node_modules/@actions/artifact/package.json +++ b/node_modules/@actions/artifact/package.json @@ -1,6 +1,6 @@ { "name": "@actions/artifact", - "version": "2.1.1", + "version": "2.1.4", "preview": true, "description": "Actions artifact lib", "keywords": [ diff --git a/node_modules/@actions/github/node_modules/@octokit/openapi-types/package.json b/node_modules/@actions/github/node_modules/@octokit/openapi-types/package.json index f8ba9436b..ade207b2a 100644 --- a/node_modules/@actions/github/node_modules/@octokit/openapi-types/package.json +++ b/node_modules/@actions/github/node_modules/@octokit/openapi-types/package.json @@ -9,12 +9,12 @@ "publishConfig": { "access": "public" }, - "version": "19.1.0", + "version": "20.0.0", "main": "", "types": "types.d.ts", "author": "Gregor Martynus (https://twitter.com/gr2m)", "license": "MIT", "octokit": { - "openapi-version": "13.3.0" + "openapi-version": "14.0.0" } } diff --git a/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js b/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js index 5b0377cde..381a963a2 100644 --- a/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js +++ b/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js @@ -28,7 +28,7 @@ __export(dist_src_exports, { module.exports = __toCommonJS(dist_src_exports); // pkg/dist-src/version.js -var VERSION = "9.1.5"; +var VERSION = "9.2.1"; // pkg/dist-src/normalize-paginated-list-response.js function normalizePaginatedListResponse(response) { @@ -189,6 +189,8 @@ var paginatingEndpoints = [ "GET /orgs/{org}/members/{username}/codespaces", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", + "GET /orgs/{org}/organization-roles/{role_id}/teams", + "GET /orgs/{org}/organization-roles/{role_id}/users", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/packages", "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", diff --git a/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js b/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js index 8ad20fb84..38bddd312 100644 --- a/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js +++ b/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js @@ -53,6 +53,8 @@ const paginatingEndpoints = [ "GET /orgs/{org}/members/{username}/codespaces", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", + "GET /orgs/{org}/organization-roles/{role_id}/teams", + "GET /orgs/{org}/organization-roles/{role_id}/users", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/packages", "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", diff --git a/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js b/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js index 5d231b33c..7c346cd39 100644 --- a/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js +++ b/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js @@ -1,4 +1,4 @@ -const VERSION = "9.1.5"; +const VERSION = "9.2.1"; export { VERSION }; diff --git a/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js b/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js index 677e9c210..af4972087 100644 --- a/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js +++ b/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js @@ -1,5 +1,5 @@ // pkg/dist-src/version.js -var VERSION = "9.1.5"; +var VERSION = "9.2.1"; // pkg/dist-src/normalize-paginated-list-response.js function normalizePaginatedListResponse(response) { @@ -160,6 +160,8 @@ var paginatingEndpoints = [ "GET /orgs/{org}/members/{username}/codespaces", "GET /orgs/{org}/migrations", "GET /orgs/{org}/migrations/{migration_id}/repositories", + "GET /orgs/{org}/organization-roles/{role_id}/teams", + "GET /orgs/{org}/organization-roles/{role_id}/users", "GET /orgs/{org}/outside_collaborators", "GET /orgs/{org}/packages", "GET /orgs/{org}/packages/{package_type}/{package_name}/versions", diff --git a/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/package.json b/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/package.json index ee80c60d9..7a9b09efa 100644 --- a/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/package.json +++ b/node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/package.json @@ -3,7 +3,7 @@ "publishConfig": { "access": "public" }, - "version": "9.1.5", + "version": "9.2.1", "description": "Octokit plugin to paginate REST API endpoint responses", "repository": "github:octokit/plugin-paginate-rest.js", "keywords": [ @@ -14,25 +14,25 @@ ], "license": "MIT", "dependencies": { - "@octokit/types": "^12.4.0" + "@octokit/types": "^12.6.0" }, "peerDependencies": { - "@octokit/core": ">=5" + "@octokit/core": "5" }, "devDependencies": { - "@octokit/core": "^5.0.0", - "@octokit/plugin-rest-endpoint-methods": "^10.0.0", + "@octokit/core": "^5.1.0", + "@octokit/plugin-rest-endpoint-methods": "^10.4.0", "@octokit/tsconfig": "^2.0.0", "@types/fetch-mock": "^7.3.1", "@types/jest": "^29.0.0", "@types/node": "^20.0.0", - "esbuild": "^0.19.0", + "esbuild": "^0.20.0", "fetch-mock": "^9.0.0", "github-openapi-graphql-query": "^4.0.0", "glob": "^10.2.5", "jest": "^29.0.0", - "npm-run-all": "^4.1.5", - "prettier": "3.1.0", + "npm-run-all2": "^6.0.0", + "prettier": "3.2.5", "semantic-release-plugin-update-version-in-files": "^1.0.0", "ts-jest": "^29.0.0", "typescript": "^5.0.0" diff --git a/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js b/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js index bf4b8c4e6..379465fbc 100644 --- a/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js +++ b/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js @@ -26,7 +26,7 @@ __export(dist_src_exports, { module.exports = __toCommonJS(dist_src_exports); // pkg/dist-src/version.js -var VERSION = "10.2.0"; +var VERSION = "10.4.1"; // pkg/dist-src/generated/endpoints.js var Endpoints = { @@ -153,6 +153,9 @@ var Endpoints = { "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" ], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getCustomOidcSubClaimForRepo: [ + "GET /repos/{owner}/{repo}/actions/oidc/customization/sub" + ], getEnvironmentPublicKey: [ "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key" ], @@ -305,6 +308,9 @@ var Endpoints = { setCustomLabelsForSelfHostedRunnerForRepo: [ "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], + setCustomOidcSubClaimForRepo: [ + "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub" + ], setGithubActionsDefaultWorkflowPermissionsOrganization: [ "PUT /orgs/{org}/actions/permissions/workflow" ], @@ -374,6 +380,7 @@ var Endpoints = { listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], markNotificationsAsRead: ["PUT /notifications"], markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], + markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"], markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], setThreadSubscription: [ @@ -650,10 +657,10 @@ var Endpoints = { updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] }, copilot: { - addCopilotForBusinessSeatsForTeams: [ + addCopilotSeatsForTeams: [ "POST /orgs/{org}/copilot/billing/selected_teams" ], - addCopilotForBusinessSeatsForUsers: [ + addCopilotSeatsForUsers: [ "POST /orgs/{org}/copilot/billing/selected_users" ], cancelCopilotSeatAssignmentForTeams: [ @@ -966,10 +973,24 @@ var Endpoints = { } ] }, + oidc: { + getOidcCustomSubTemplateForOrg: [ + "GET /orgs/{org}/actions/oidc/customization/sub" + ], + updateOidcCustomSubTemplateForOrg: [ + "PUT /orgs/{org}/actions/oidc/customization/sub" + ] + }, orgs: { addSecurityManagerTeam: [ "PUT /orgs/{org}/security-managers/teams/{team_slug}" ], + assignTeamToOrgRole: [ + "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" + ], + assignUserToOrgRole: [ + "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}" + ], blockUser: ["PUT /orgs/{org}/blocks/{username}"], cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], @@ -978,6 +999,7 @@ var Endpoints = { convertMemberToOutsideCollaborator: [ "PUT /orgs/{org}/outside_collaborators/{username}" ], + createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"], createInvitation: ["POST /orgs/{org}/invitations"], createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"], createOrUpdateCustomPropertiesValuesForRepos: [ @@ -988,6 +1010,9 @@ var Endpoints = { ], createWebhook: ["POST /orgs/{org}/hooks"], delete: ["DELETE /orgs/{org}"], + deleteCustomOrganizationRole: [ + "DELETE /orgs/{org}/organization-roles/{role_id}" + ], deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], enableOrDisableSecurityProductOnAllOrgRepos: [ "POST /orgs/{org}/{security_product}/{enablement}" @@ -999,6 +1024,7 @@ var Endpoints = { ], getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], + getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], getWebhookDelivery: [ @@ -1014,6 +1040,12 @@ var Endpoints = { listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], listMembers: ["GET /orgs/{org}/members"], listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], + listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"], + listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"], + listOrgRoles: ["GET /orgs/{org}/organization-roles"], + listOrganizationFineGrainedPermissions: [ + "GET /orgs/{org}/organization-fine-grained-permissions" + ], listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listPatGrantRepositories: [ "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" @@ -1028,6 +1060,9 @@ var Endpoints = { listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"], listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /orgs/{org}/hooks"], + patchCustomOrganizationRole: [ + "PATCH /orgs/{org}/organization-roles/{role_id}" + ], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], redeliverWebhookDelivery: [ "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" @@ -1052,6 +1087,18 @@ var Endpoints = { reviewPatGrantRequestsInBulk: [ "POST /orgs/{org}/personal-access-token-requests" ], + revokeAllOrgRolesTeam: [ + "DELETE /orgs/{org}/organization-roles/teams/{team_slug}" + ], + revokeAllOrgRolesUser: [ + "DELETE /orgs/{org}/organization-roles/users/{username}" + ], + revokeOrgRoleTeam: [ + "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" + ], + revokeOrgRoleUser: [ + "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}" + ], setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], setPublicMembershipForAuthenticatedUser: [ "PUT /orgs/{org}/public_members/{username}" @@ -1342,6 +1389,9 @@ var Endpoints = { {}, { mapToData: "users" } ], + cancelPagesDeployment: [ + "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel" + ], checkAutomatedSecurityFixes: [ "GET /repos/{owner}/{repo}/automated-security-fixes" ], @@ -1377,12 +1427,15 @@ var Endpoints = { createForAuthenticatedUser: ["POST /user/repos"], createFork: ["POST /repos/{owner}/{repo}/forks"], createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateCustomPropertiesValues: [ + "PATCH /repos/{owner}/{repo}/properties/values" + ], createOrUpdateEnvironment: [ "PUT /repos/{owner}/{repo}/environments/{environment_name}" ], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createOrgRuleset: ["POST /orgs/{org}/rulesets"], - createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployment"], + createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"], createPagesSite: ["POST /repos/{owner}/{repo}/pages"], createRelease: ["POST /repos/{owner}/{repo}/releases"], createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], @@ -1535,6 +1588,9 @@ var Endpoints = { getOrgRulesets: ["GET /orgs/{org}/rulesets"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesDeployment: [ + "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}" + ], getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: [ @@ -1745,6 +1801,9 @@ var Endpoints = { ] }, securityAdvisories: { + createFork: [ + "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks" + ], createPrivateVulnerabilityReport: [ "POST /repos/{owner}/{repo}/security-advisories/reports" ], diff --git a/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js b/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js index 494b3ae49..5950ad3e6 100644 --- a/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +++ b/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js @@ -122,6 +122,9 @@ const Endpoints = { "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" ], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getCustomOidcSubClaimForRepo: [ + "GET /repos/{owner}/{repo}/actions/oidc/customization/sub" + ], getEnvironmentPublicKey: [ "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key" ], @@ -274,6 +277,9 @@ const Endpoints = { setCustomLabelsForSelfHostedRunnerForRepo: [ "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], + setCustomOidcSubClaimForRepo: [ + "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub" + ], setGithubActionsDefaultWorkflowPermissionsOrganization: [ "PUT /orgs/{org}/actions/permissions/workflow" ], @@ -343,6 +349,7 @@ const Endpoints = { listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], markNotificationsAsRead: ["PUT /notifications"], markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], + markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"], markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], setThreadSubscription: [ @@ -619,10 +626,10 @@ const Endpoints = { updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] }, copilot: { - addCopilotForBusinessSeatsForTeams: [ + addCopilotSeatsForTeams: [ "POST /orgs/{org}/copilot/billing/selected_teams" ], - addCopilotForBusinessSeatsForUsers: [ + addCopilotSeatsForUsers: [ "POST /orgs/{org}/copilot/billing/selected_users" ], cancelCopilotSeatAssignmentForTeams: [ @@ -935,10 +942,24 @@ const Endpoints = { } ] }, + oidc: { + getOidcCustomSubTemplateForOrg: [ + "GET /orgs/{org}/actions/oidc/customization/sub" + ], + updateOidcCustomSubTemplateForOrg: [ + "PUT /orgs/{org}/actions/oidc/customization/sub" + ] + }, orgs: { addSecurityManagerTeam: [ "PUT /orgs/{org}/security-managers/teams/{team_slug}" ], + assignTeamToOrgRole: [ + "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" + ], + assignUserToOrgRole: [ + "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}" + ], blockUser: ["PUT /orgs/{org}/blocks/{username}"], cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], @@ -947,6 +968,7 @@ const Endpoints = { convertMemberToOutsideCollaborator: [ "PUT /orgs/{org}/outside_collaborators/{username}" ], + createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"], createInvitation: ["POST /orgs/{org}/invitations"], createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"], createOrUpdateCustomPropertiesValuesForRepos: [ @@ -957,6 +979,9 @@ const Endpoints = { ], createWebhook: ["POST /orgs/{org}/hooks"], delete: ["DELETE /orgs/{org}"], + deleteCustomOrganizationRole: [ + "DELETE /orgs/{org}/organization-roles/{role_id}" + ], deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], enableOrDisableSecurityProductOnAllOrgRepos: [ "POST /orgs/{org}/{security_product}/{enablement}" @@ -968,6 +993,7 @@ const Endpoints = { ], getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], + getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], getWebhookDelivery: [ @@ -983,6 +1009,12 @@ const Endpoints = { listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], listMembers: ["GET /orgs/{org}/members"], listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], + listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"], + listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"], + listOrgRoles: ["GET /orgs/{org}/organization-roles"], + listOrganizationFineGrainedPermissions: [ + "GET /orgs/{org}/organization-fine-grained-permissions" + ], listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listPatGrantRepositories: [ "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" @@ -997,6 +1029,9 @@ const Endpoints = { listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"], listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /orgs/{org}/hooks"], + patchCustomOrganizationRole: [ + "PATCH /orgs/{org}/organization-roles/{role_id}" + ], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], redeliverWebhookDelivery: [ "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" @@ -1021,6 +1056,18 @@ const Endpoints = { reviewPatGrantRequestsInBulk: [ "POST /orgs/{org}/personal-access-token-requests" ], + revokeAllOrgRolesTeam: [ + "DELETE /orgs/{org}/organization-roles/teams/{team_slug}" + ], + revokeAllOrgRolesUser: [ + "DELETE /orgs/{org}/organization-roles/users/{username}" + ], + revokeOrgRoleTeam: [ + "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" + ], + revokeOrgRoleUser: [ + "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}" + ], setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], setPublicMembershipForAuthenticatedUser: [ "PUT /orgs/{org}/public_members/{username}" @@ -1311,6 +1358,9 @@ const Endpoints = { {}, { mapToData: "users" } ], + cancelPagesDeployment: [ + "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel" + ], checkAutomatedSecurityFixes: [ "GET /repos/{owner}/{repo}/automated-security-fixes" ], @@ -1346,12 +1396,15 @@ const Endpoints = { createForAuthenticatedUser: ["POST /user/repos"], createFork: ["POST /repos/{owner}/{repo}/forks"], createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateCustomPropertiesValues: [ + "PATCH /repos/{owner}/{repo}/properties/values" + ], createOrUpdateEnvironment: [ "PUT /repos/{owner}/{repo}/environments/{environment_name}" ], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createOrgRuleset: ["POST /orgs/{org}/rulesets"], - createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployment"], + createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"], createPagesSite: ["POST /repos/{owner}/{repo}/pages"], createRelease: ["POST /repos/{owner}/{repo}/releases"], createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], @@ -1504,6 +1557,9 @@ const Endpoints = { getOrgRulesets: ["GET /orgs/{org}/rulesets"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesDeployment: [ + "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}" + ], getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: [ @@ -1714,6 +1770,9 @@ const Endpoints = { ] }, securityAdvisories: { + createFork: [ + "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks" + ], createPrivateVulnerabilityReport: [ "POST /repos/{owner}/{repo}/security-advisories/reports" ], diff --git a/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js b/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js index 001de03f6..24785d8ca 100644 --- a/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +++ b/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js @@ -1,4 +1,4 @@ -const VERSION = "10.2.0"; +const VERSION = "10.4.1"; export { VERSION }; diff --git a/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js b/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js index 937af7d42..9036f4938 100644 --- a/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js +++ b/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js @@ -1,5 +1,5 @@ // pkg/dist-src/version.js -var VERSION = "10.2.0"; +var VERSION = "10.4.1"; // pkg/dist-src/generated/endpoints.js var Endpoints = { @@ -126,6 +126,9 @@ var Endpoints = { "GET /repos/{owner}/{repo}/actions/permissions/selected-actions" ], getArtifact: ["GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}"], + getCustomOidcSubClaimForRepo: [ + "GET /repos/{owner}/{repo}/actions/oidc/customization/sub" + ], getEnvironmentPublicKey: [ "GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key" ], @@ -278,6 +281,9 @@ var Endpoints = { setCustomLabelsForSelfHostedRunnerForRepo: [ "PUT /repos/{owner}/{repo}/actions/runners/{runner_id}/labels" ], + setCustomOidcSubClaimForRepo: [ + "PUT /repos/{owner}/{repo}/actions/oidc/customization/sub" + ], setGithubActionsDefaultWorkflowPermissionsOrganization: [ "PUT /orgs/{org}/actions/permissions/workflow" ], @@ -347,6 +353,7 @@ var Endpoints = { listWatchersForRepo: ["GET /repos/{owner}/{repo}/subscribers"], markNotificationsAsRead: ["PUT /notifications"], markRepoNotificationsAsRead: ["PUT /repos/{owner}/{repo}/notifications"], + markThreadAsDone: ["DELETE /notifications/threads/{thread_id}"], markThreadAsRead: ["PATCH /notifications/threads/{thread_id}"], setRepoSubscription: ["PUT /repos/{owner}/{repo}/subscription"], setThreadSubscription: [ @@ -623,10 +630,10 @@ var Endpoints = { updateForAuthenticatedUser: ["PATCH /user/codespaces/{codespace_name}"] }, copilot: { - addCopilotForBusinessSeatsForTeams: [ + addCopilotSeatsForTeams: [ "POST /orgs/{org}/copilot/billing/selected_teams" ], - addCopilotForBusinessSeatsForUsers: [ + addCopilotSeatsForUsers: [ "POST /orgs/{org}/copilot/billing/selected_users" ], cancelCopilotSeatAssignmentForTeams: [ @@ -939,10 +946,24 @@ var Endpoints = { } ] }, + oidc: { + getOidcCustomSubTemplateForOrg: [ + "GET /orgs/{org}/actions/oidc/customization/sub" + ], + updateOidcCustomSubTemplateForOrg: [ + "PUT /orgs/{org}/actions/oidc/customization/sub" + ] + }, orgs: { addSecurityManagerTeam: [ "PUT /orgs/{org}/security-managers/teams/{team_slug}" ], + assignTeamToOrgRole: [ + "PUT /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" + ], + assignUserToOrgRole: [ + "PUT /orgs/{org}/organization-roles/users/{username}/{role_id}" + ], blockUser: ["PUT /orgs/{org}/blocks/{username}"], cancelInvitation: ["DELETE /orgs/{org}/invitations/{invitation_id}"], checkBlockedUser: ["GET /orgs/{org}/blocks/{username}"], @@ -951,6 +972,7 @@ var Endpoints = { convertMemberToOutsideCollaborator: [ "PUT /orgs/{org}/outside_collaborators/{username}" ], + createCustomOrganizationRole: ["POST /orgs/{org}/organization-roles"], createInvitation: ["POST /orgs/{org}/invitations"], createOrUpdateCustomProperties: ["PATCH /orgs/{org}/properties/schema"], createOrUpdateCustomPropertiesValuesForRepos: [ @@ -961,6 +983,9 @@ var Endpoints = { ], createWebhook: ["POST /orgs/{org}/hooks"], delete: ["DELETE /orgs/{org}"], + deleteCustomOrganizationRole: [ + "DELETE /orgs/{org}/organization-roles/{role_id}" + ], deleteWebhook: ["DELETE /orgs/{org}/hooks/{hook_id}"], enableOrDisableSecurityProductOnAllOrgRepos: [ "POST /orgs/{org}/{security_product}/{enablement}" @@ -972,6 +997,7 @@ var Endpoints = { ], getMembershipForAuthenticatedUser: ["GET /user/memberships/orgs/{org}"], getMembershipForUser: ["GET /orgs/{org}/memberships/{username}"], + getOrgRole: ["GET /orgs/{org}/organization-roles/{role_id}"], getWebhook: ["GET /orgs/{org}/hooks/{hook_id}"], getWebhookConfigForOrg: ["GET /orgs/{org}/hooks/{hook_id}/config"], getWebhookDelivery: [ @@ -987,6 +1013,12 @@ var Endpoints = { listInvitationTeams: ["GET /orgs/{org}/invitations/{invitation_id}/teams"], listMembers: ["GET /orgs/{org}/members"], listMembershipsForAuthenticatedUser: ["GET /user/memberships/orgs"], + listOrgRoleTeams: ["GET /orgs/{org}/organization-roles/{role_id}/teams"], + listOrgRoleUsers: ["GET /orgs/{org}/organization-roles/{role_id}/users"], + listOrgRoles: ["GET /orgs/{org}/organization-roles"], + listOrganizationFineGrainedPermissions: [ + "GET /orgs/{org}/organization-fine-grained-permissions" + ], listOutsideCollaborators: ["GET /orgs/{org}/outside_collaborators"], listPatGrantRepositories: [ "GET /orgs/{org}/personal-access-tokens/{pat_id}/repositories" @@ -1001,6 +1033,9 @@ var Endpoints = { listSecurityManagerTeams: ["GET /orgs/{org}/security-managers"], listWebhookDeliveries: ["GET /orgs/{org}/hooks/{hook_id}/deliveries"], listWebhooks: ["GET /orgs/{org}/hooks"], + patchCustomOrganizationRole: [ + "PATCH /orgs/{org}/organization-roles/{role_id}" + ], pingWebhook: ["POST /orgs/{org}/hooks/{hook_id}/pings"], redeliverWebhookDelivery: [ "POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts" @@ -1025,6 +1060,18 @@ var Endpoints = { reviewPatGrantRequestsInBulk: [ "POST /orgs/{org}/personal-access-token-requests" ], + revokeAllOrgRolesTeam: [ + "DELETE /orgs/{org}/organization-roles/teams/{team_slug}" + ], + revokeAllOrgRolesUser: [ + "DELETE /orgs/{org}/organization-roles/users/{username}" + ], + revokeOrgRoleTeam: [ + "DELETE /orgs/{org}/organization-roles/teams/{team_slug}/{role_id}" + ], + revokeOrgRoleUser: [ + "DELETE /orgs/{org}/organization-roles/users/{username}/{role_id}" + ], setMembershipForUser: ["PUT /orgs/{org}/memberships/{username}"], setPublicMembershipForAuthenticatedUser: [ "PUT /orgs/{org}/public_members/{username}" @@ -1315,6 +1362,9 @@ var Endpoints = { {}, { mapToData: "users" } ], + cancelPagesDeployment: [ + "POST /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}/cancel" + ], checkAutomatedSecurityFixes: [ "GET /repos/{owner}/{repo}/automated-security-fixes" ], @@ -1350,12 +1400,15 @@ var Endpoints = { createForAuthenticatedUser: ["POST /user/repos"], createFork: ["POST /repos/{owner}/{repo}/forks"], createInOrg: ["POST /orgs/{org}/repos"], + createOrUpdateCustomPropertiesValues: [ + "PATCH /repos/{owner}/{repo}/properties/values" + ], createOrUpdateEnvironment: [ "PUT /repos/{owner}/{repo}/environments/{environment_name}" ], createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"], createOrgRuleset: ["POST /orgs/{org}/rulesets"], - createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployment"], + createPagesDeployment: ["POST /repos/{owner}/{repo}/pages/deployments"], createPagesSite: ["POST /repos/{owner}/{repo}/pages"], createRelease: ["POST /repos/{owner}/{repo}/releases"], createRepoRuleset: ["POST /repos/{owner}/{repo}/rulesets"], @@ -1508,6 +1561,9 @@ var Endpoints = { getOrgRulesets: ["GET /orgs/{org}/rulesets"], getPages: ["GET /repos/{owner}/{repo}/pages"], getPagesBuild: ["GET /repos/{owner}/{repo}/pages/builds/{build_id}"], + getPagesDeployment: [ + "GET /repos/{owner}/{repo}/pages/deployments/{pages_deployment_id}" + ], getPagesHealthCheck: ["GET /repos/{owner}/{repo}/pages/health"], getParticipationStats: ["GET /repos/{owner}/{repo}/stats/participation"], getPullRequestReviewProtection: [ @@ -1718,6 +1774,9 @@ var Endpoints = { ] }, securityAdvisories: { + createFork: [ + "POST /repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks" + ], createPrivateVulnerabilityReport: [ "POST /repos/{owner}/{repo}/security-advisories/reports" ], diff --git a/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/package.json b/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/package.json index a67d1d7da..ec873412b 100644 --- a/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/package.json +++ b/node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/package.json @@ -1,6 +1,6 @@ { "name": "@octokit/plugin-rest-endpoint-methods", - "version": "10.2.0", + "version": "10.4.1", "description": "Octokit plugin adding one method for all of api.github.com REST API endpoints", "repository": "github:octokit/plugin-rest-endpoint-methods.js", "keywords": [ @@ -12,7 +12,7 @@ "author": "Gregor Martynus (https://twitter.com/gr2m)", "license": "MIT", "dependencies": { - "@octokit/types": "^12.3.0" + "@octokit/types": "^12.6.0" }, "devDependencies": { "@octokit/core": "^5.0.0", @@ -21,17 +21,17 @@ "@types/jest": "^29.0.0", "@types/node": "^20.0.0", "@types/sinon": "^17.0.0", - "esbuild": "^0.19.0", + "esbuild": "^0.20.0", "fetch-mock": "npm:@gr2m/fetch-mock@^9.11.0-pull-request-644.1", - "github-openapi-graphql-query": "^4.0.0", + "github-openapi-graphql-query": "^4.3.1", "glob": "^10.2.6", "jest": "^29.0.0", "lodash.camelcase": "^4.3.0", "lodash.set": "^4.3.2", "lodash.upperfirst": "^4.3.1", "mustache": "^4.0.0", - "npm-run-all": "^4.1.5", - "prettier": "3.1.0", + "npm-run-all2": "^6.0.0", + "prettier": "3.2.5", "semantic-release-plugin-update-version-in-files": "^1.0.0", "sinon": "^17.0.0", "sort-keys": "^5.0.0", @@ -40,7 +40,7 @@ "typescript": "^5.0.0" }, "peerDependencies": { - "@octokit/core": ">=5" + "@octokit/core": "5" }, "publishConfig": { "access": "public" diff --git a/node_modules/@actions/github/node_modules/@octokit/request/dist-node/index.js b/node_modules/@actions/github/node_modules/@octokit/request/dist-node/index.js index e322feae9..144c8797c 100644 --- a/node_modules/@actions/github/node_modules/@octokit/request/dist-node/index.js +++ b/node_modules/@actions/github/node_modules/@octokit/request/dist-node/index.js @@ -27,7 +27,7 @@ var import_endpoint = require("@octokit/endpoint"); var import_universal_user_agent = require("universal-user-agent"); // pkg/dist-src/version.js -var VERSION = "8.1.6"; +var VERSION = "8.2.0"; // pkg/dist-src/is-plain-object.js function isPlainObject(value) { @@ -171,11 +171,17 @@ async function getResponseData(response) { function toErrorMessage(data) { if (typeof data === "string") return data; + let suffix; + if ("documentation_url" in data) { + suffix = ` - ${data.documentation_url}`; + } else { + suffix = ""; + } if ("message" in data) { if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; } - return data.message; + return `${data.message}${suffix}`; } return `Unknown error: ${JSON.stringify(data)}`; } diff --git a/node_modules/@actions/github/node_modules/@octokit/request/dist-src/fetch-wrapper.js b/node_modules/@actions/github/node_modules/@octokit/request/dist-src/fetch-wrapper.js index d63212267..6665716f9 100644 --- a/node_modules/@actions/github/node_modules/@octokit/request/dist-src/fetch-wrapper.js +++ b/node_modules/@actions/github/node_modules/@octokit/request/dist-src/fetch-wrapper.js @@ -1,6 +1,6 @@ -import { isPlainObject } from "./is-plain-object"; +import { isPlainObject } from "./is-plain-object.js"; import { RequestError } from "@octokit/request-error"; -import getBuffer from "./get-buffer-response"; +import getBuffer from "./get-buffer-response.js"; function fetchWrapper(requestOptions) { const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false; @@ -120,11 +120,17 @@ async function getResponseData(response) { function toErrorMessage(data) { if (typeof data === "string") return data; + let suffix; + if ("documentation_url" in data) { + suffix = ` - ${data.documentation_url}`; + } else { + suffix = ""; + } if ("message" in data) { if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; } - return data.message; + return `${data.message}${suffix}`; } return `Unknown error: ${JSON.stringify(data)}`; } diff --git a/node_modules/@actions/github/node_modules/@octokit/request/dist-src/index.js b/node_modules/@actions/github/node_modules/@octokit/request/dist-src/index.js index 1b3e12a92..3f8e1ae9a 100644 --- a/node_modules/@actions/github/node_modules/@octokit/request/dist-src/index.js +++ b/node_modules/@actions/github/node_modules/@octokit/request/dist-src/index.js @@ -1,7 +1,7 @@ import { endpoint } from "@octokit/endpoint"; import { getUserAgent } from "universal-user-agent"; -import { VERSION } from "./version"; -import withDefaults from "./with-defaults"; +import { VERSION } from "./version.js"; +import withDefaults from "./with-defaults.js"; const request = withDefaults(endpoint, { headers: { "user-agent": `octokit-request.js/${VERSION} ${getUserAgent()}` diff --git a/node_modules/@actions/github/node_modules/@octokit/request/dist-src/version.js b/node_modules/@actions/github/node_modules/@octokit/request/dist-src/version.js index 91c45b0b9..bba0caf95 100644 --- a/node_modules/@actions/github/node_modules/@octokit/request/dist-src/version.js +++ b/node_modules/@actions/github/node_modules/@octokit/request/dist-src/version.js @@ -1,4 +1,4 @@ -const VERSION = "8.1.6"; +const VERSION = "8.2.0"; export { VERSION }; diff --git a/node_modules/@actions/github/node_modules/@octokit/request/dist-src/with-defaults.js b/node_modules/@actions/github/node_modules/@octokit/request/dist-src/with-defaults.js index 0ee34b5c9..b2dd7ad6b 100644 --- a/node_modules/@actions/github/node_modules/@octokit/request/dist-src/with-defaults.js +++ b/node_modules/@actions/github/node_modules/@octokit/request/dist-src/with-defaults.js @@ -1,4 +1,4 @@ -import fetchWrapper from "./fetch-wrapper"; +import fetchWrapper from "./fetch-wrapper.js"; function withDefaults(oldEndpoint, newDefaults) { const endpoint = oldEndpoint.defaults(newDefaults); const newApi = function(route, parameters) { diff --git a/node_modules/@actions/github/node_modules/@octokit/request/dist-web/index.js b/node_modules/@actions/github/node_modules/@octokit/request/dist-web/index.js index cbc897d8d..7a04c65d7 100644 --- a/node_modules/@actions/github/node_modules/@octokit/request/dist-web/index.js +++ b/node_modules/@actions/github/node_modules/@octokit/request/dist-web/index.js @@ -3,7 +3,7 @@ import { endpoint } from "@octokit/endpoint"; import { getUserAgent } from "universal-user-agent"; // pkg/dist-src/version.js -var VERSION = "8.1.6"; +var VERSION = "8.2.0"; // pkg/dist-src/is-plain-object.js function isPlainObject(value) { @@ -146,11 +146,17 @@ async function getResponseData(response) { function toErrorMessage(data) { if (typeof data === "string") return data; + let suffix; + if ("documentation_url" in data) { + suffix = ` - ${data.documentation_url}`; + } else { + suffix = ""; + } if ("message" in data) { if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; } - return data.message; + return `${data.message}${suffix}`; } return `Unknown error: ${JSON.stringify(data)}`; } diff --git a/node_modules/@actions/github/node_modules/@octokit/request/package.json b/node_modules/@actions/github/node_modules/@octokit/request/package.json index c629d0bd9..66ce1a58e 100644 --- a/node_modules/@actions/github/node_modules/@octokit/request/package.json +++ b/node_modules/@actions/github/node_modules/@octokit/request/package.json @@ -1,6 +1,6 @@ { "name": "@octokit/request", - "version": "8.1.6", + "version": "8.2.0", "publishConfig": { "access": "public" }, @@ -28,12 +28,12 @@ "@types/lolex": "^5.1.0", "@types/node": "^20.0.0", "@types/once": "^1.4.0", - "esbuild": "^0.19.0", - "fetch-mock": "^9.3.1", + "esbuild": "^0.20.0", + "fetch-mock": "npm:@gr2m/fetch-mock@^9.11.0-pull-request-644.1", "glob": "^10.2.4", "jest": "^29.0.0", "lolex": "^6.0.0", - "prettier": "3.1.0", + "prettier": "3.2.5", "semantic-release-plugin-update-version-in-files": "^1.0.0", "string-to-arraybuffer": "^1.0.2", "ts-jest": "^29.0.0", diff --git a/node_modules/@actions/github/node_modules/@octokit/types/package.json b/node_modules/@actions/github/node_modules/@octokit/types/package.json index d5e074055..99959575e 100644 --- a/node_modules/@actions/github/node_modules/@octokit/types/package.json +++ b/node_modules/@actions/github/node_modules/@octokit/types/package.json @@ -1,12 +1,12 @@ { "name": "@octokit/types", - "version": "12.4.0", + "version": "12.6.0", "publishConfig": { "access": "public" }, "description": "Shared TypeScript definitions for Octokit projects", "dependencies": { - "@octokit/openapi-types": "^19.1.0" + "@octokit/openapi-types": "^20.0.0" }, "repository": "github:octokit/types.ts", "keywords": [ @@ -25,10 +25,10 @@ "handlebars": "^4.7.6", "json-schema-to-typescript": "^13.0.0", "lodash.set": "^4.3.2", - "npm-run-all": "^4.1.5", + "npm-run-all2": "^6.0.0", "pascal-case": "^3.1.1", "prettier": "^3.0.0", - "semantic-release": "^22.0.0", + "semantic-release": "^23.0.0", "semantic-release-plugin-update-version-in-files": "^1.0.0", "sort-keys": "^5.0.0", "string-to-jsdoc-comment": "^1.0.0", @@ -36,7 +36,7 @@ "typescript": "^5.0.0" }, "octokit": { - "openapi-version": "13.3.0" + "openapi-version": "14.0.0" }, "files": [ "dist-types/**" diff --git a/node_modules/@actions/http-client/lib/index.js b/node_modules/@actions/http-client/lib/index.js index 5a3cad337..f627c6a3e 100644 --- a/node_modules/@actions/http-client/lib/index.js +++ b/node_modules/@actions/http-client/lib/index.js @@ -502,7 +502,7 @@ class HttpClient { if (this._keepAlive && useProxy) { agent = this._proxyAgent; } - if (this._keepAlive && !useProxy) { + if (!useProxy) { agent = this._agent; } // if agent is already assigned use that agent. @@ -534,16 +534,12 @@ class HttpClient { agent = tunnelAgent(agentOptions); this._proxyAgent = agent; } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { + // if tunneling agent isn't assigned create a new agent + if (!agent) { const options = { keepAlive: this._keepAlive, maxSockets }; agent = usingSsl ? new https.Agent(options) : new http.Agent(options); this._agent = agent; } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options diff --git a/node_modules/@actions/http-client/package.json b/node_modules/@actions/http-client/package.json index ed1343724..0ae89c34b 100644 --- a/node_modules/@actions/http-client/package.json +++ b/node_modules/@actions/http-client/package.json @@ -1,6 +1,6 @@ { "name": "@actions/http-client", - "version": "2.2.0", + "version": "2.2.1", "description": "Actions Http Client", "keywords": [ "github", @@ -48,4 +48,4 @@ "tunnel": "^0.0.6", "undici": "^5.25.4" } -} +} \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist-esm/src/AbortError.js b/node_modules/@azure/abort-controller/dist/browser/AbortError.js similarity index 100% rename from node_modules/@azure/abort-controller/dist-esm/src/AbortError.js rename to node_modules/@azure/abort-controller/dist/browser/AbortError.js diff --git a/node_modules/@azure/abort-controller/dist-esm/src/AbortSignalLike.js b/node_modules/@azure/abort-controller/dist/browser/AbortSignalLike.js similarity index 100% rename from node_modules/@azure/abort-controller/dist-esm/src/AbortSignalLike.js rename to node_modules/@azure/abort-controller/dist/browser/AbortSignalLike.js diff --git a/node_modules/@azure/core-paging/dist-esm/src/index.js b/node_modules/@azure/abort-controller/dist/browser/index.js similarity index 61% rename from node_modules/@azure/core-paging/dist-esm/src/index.js rename to node_modules/@azure/abort-controller/dist/browser/index.js index 8af0a5d39..68c507cde 100644 --- a/node_modules/@azure/core-paging/dist-esm/src/index.js +++ b/node_modules/@azure/abort-controller/dist/browser/index.js @@ -1,5 +1,4 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export * from "./models"; -export * from "./getPagedAsyncIterator"; +export { AbortError } from "./AbortError.js"; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist/browser/package.json b/node_modules/@azure/abort-controller/dist/browser/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/browser/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/abort-controller/dist/index.js b/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js similarity index 82% rename from node_modules/@azure/abort-controller/dist/index.js rename to node_modules/@azure/abort-controller/dist/commonjs/AbortError.js index 7b782abbd..c7a07498c 100644 --- a/node_modules/@azure/abort-controller/dist/index.js +++ b/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js @@ -1,9 +1,8 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - +"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AbortError = void 0; /** * This error is thrown when an asynchronous operation has been aborted. * Check for this error by testing the `name` that the name property of the @@ -28,6 +27,5 @@ class AbortError extends Error { this.name = "AbortError"; } } - exports.AbortError = AbortError; -//# sourceMappingURL=index.js.map +//# sourceMappingURL=AbortError.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist/commonjs/AbortSignalLike.js b/node_modules/@azure/abort-controller/dist/commonjs/AbortSignalLike.js new file mode 100644 index 000000000..aa54840f0 --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/commonjs/AbortSignalLike.js @@ -0,0 +1,5 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=AbortSignalLike.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist/commonjs/index.js b/node_modules/@azure/abort-controller/dist/commonjs/index.js new file mode 100644 index 000000000..b589ef047 --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/commonjs/index.js @@ -0,0 +1,8 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AbortError = void 0; +var AbortError_js_1 = require("./AbortError.js"); +Object.defineProperty(exports, "AbortError", { enumerable: true, get: function () { return AbortError_js_1.AbortError; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist/commonjs/package.json b/node_modules/@azure/abort-controller/dist/commonjs/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/@azure/abort-controller/types/src/tsdoc-metadata.json b/node_modules/@azure/abort-controller/dist/commonjs/tsdoc-metadata.json similarity index 87% rename from node_modules/@azure/abort-controller/types/src/tsdoc-metadata.json rename to node_modules/@azure/abort-controller/dist/commonjs/tsdoc-metadata.json index 7833929c4..22735db17 100644 --- a/node_modules/@azure/abort-controller/types/src/tsdoc-metadata.json +++ b/node_modules/@azure/abort-controller/dist/commonjs/tsdoc-metadata.json @@ -5,7 +5,7 @@ "toolPackages": [ { "packageName": "@microsoft/api-extractor", - "packageVersion": "7.39.0" + "packageVersion": "7.42.3" } ] } diff --git a/node_modules/@azure/abort-controller/dist/esm/AbortError.js b/node_modules/@azure/abort-controller/dist/esm/AbortError.js new file mode 100644 index 000000000..3ae9745cf --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/esm/AbortError.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * This error is thrown when an asynchronous operation has been aborted. + * Check for this error by testing the `name` that the name property of the + * error matches `"AbortError"`. + * + * @example + * ```ts + * const controller = new AbortController(); + * controller.abort(); + * try { + * doAsyncWork(controller.signal) + * } catch (e) { + * if (e.name === 'AbortError') { + * // handle abort error here. + * } + * } + * ``` + */ +export class AbortError extends Error { + constructor(message) { + super(message); + this.name = "AbortError"; + } +} +//# sourceMappingURL=AbortError.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist/esm/AbortSignalLike.js b/node_modules/@azure/abort-controller/dist/esm/AbortSignalLike.js new file mode 100644 index 000000000..b6d9f47df --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/esm/AbortSignalLike.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=AbortSignalLike.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist/esm/index.js b/node_modules/@azure/abort-controller/dist/esm/index.js new file mode 100644 index 000000000..68c507cde --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/esm/index.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { AbortError } from "./AbortError.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist/esm/package.json b/node_modules/@azure/abort-controller/dist/esm/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/abort-controller/dist/react-native/AbortError.js b/node_modules/@azure/abort-controller/dist/react-native/AbortError.js new file mode 100644 index 000000000..3ae9745cf --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/react-native/AbortError.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * This error is thrown when an asynchronous operation has been aborted. + * Check for this error by testing the `name` that the name property of the + * error matches `"AbortError"`. + * + * @example + * ```ts + * const controller = new AbortController(); + * controller.abort(); + * try { + * doAsyncWork(controller.signal) + * } catch (e) { + * if (e.name === 'AbortError') { + * // handle abort error here. + * } + * } + * ``` + */ +export class AbortError extends Error { + constructor(message) { + super(message); + this.name = "AbortError"; + } +} +//# sourceMappingURL=AbortError.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist/react-native/AbortSignalLike.js b/node_modules/@azure/abort-controller/dist/react-native/AbortSignalLike.js new file mode 100644 index 000000000..b6d9f47df --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/react-native/AbortSignalLike.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=AbortSignalLike.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist/react-native/index.js b/node_modules/@azure/abort-controller/dist/react-native/index.js new file mode 100644 index 000000000..68c507cde --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/react-native/index.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { AbortError } from "./AbortError.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist/react-native/package.json b/node_modules/@azure/abort-controller/dist/react-native/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/abort-controller/dist/react-native/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/abort-controller/package.json b/node_modules/@azure/abort-controller/package.json index 4e9aff194..d8375e5ea 100644 --- a/node_modules/@azure/abort-controller/package.json +++ b/node_modules/@azure/abort-controller/package.json @@ -1,45 +1,49 @@ { "name": "@azure/abort-controller", "sdk-type": "client", - "version": "2.0.0", + "version": "2.1.1", "description": "Microsoft Azure SDK for JavaScript - Aborter", - "main": "./dist/index.js", - "module": "dist-esm/src/index.js", - "scripts": { - "build:samples": "echo Obsolete", - "build:test": "tsc -p . && dev-tool run bundle", - "build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local", - "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "clean": "rimraf dist dist-* temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "tsc -p . && api-extractor run --local", - "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "integration-test:browser": "echo skipped", - "integration-test:node": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint package.json api-extractor.json src test --ext .ts", - "pack": "npm pack 2>&1", - "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", - "test:node": "npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node", - "test": "npm run clean && tsc -p . && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", - "unit-test:browser": "karma start --single-run", - "unit-test:node": "dev-tool run test:node-ts-input --no-test-proxy=true", - "unit-test": "npm run unit-test:node && npm run unit-test:browser" + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/abort-controller/README.md", + "repository": "github:Azure/azure-sdk-for-js", + "sideEffects": false, + "type": "module", + "main": "./dist/commonjs/index.js", + "browser": "./dist/browser/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } }, - "types": "./types/src/index.d.ts", + "types": "./dist/commonjs/index.d.ts", "files": [ "dist/", - "dist-esm/src/", - "shims-public.d.ts", - "types/src", "README.md", "LICENSE" ], "engines": { "node": ">=18.0.0" }, - "repository": "github:Azure/azure-sdk-for-js", "keywords": [ "azure", "aborter", @@ -51,42 +55,62 @@ "browser", "cloud" ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" + "scripts": { + "build:samples": "echo Obsolete", + "build:test": "npm run clean && tshy && dev-tool run build-test", + "build": "npm run clean && tshy && api-extractor run --local", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,mjs,cjs,json}\"", + "clean": "rimraf --glob dist dist-* temp types *.tgz *.log", + "execute:samples": "echo skipped", + "extract-api": "tshy && api-extractor run --local", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,mjs,cjs,json}\"", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts", + "pack": "npm pack 2>&1", + "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser", + "unit-test:node": "dev-tool run test:vitest --no-test-proxy", + "unit-test": "npm run unit-test:node && npm run unit-test:browser" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/abort-controller/README.md", - "sideEffects": false, "dependencies": { - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "devDependencies": { "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", - "@microsoft/api-extractor": "^7.31.1", - "@types/chai": "^4.1.6", - "@types/mocha": "^10.0.0", + "@microsoft/api-extractor": "^7.40.3", "@types/node": "^18.0.0", - "chai": "^4.2.0", - "cross-env": "^7.0.2", - "eslint": "^8.0.0", - "karma": "^6.2.0", - "karma-chrome-launcher": "^3.0.0", - "karma-coverage": "^2.0.0", - "karma-env-preprocessor": "^0.1.1", - "karma-firefox-launcher": "^1.1.0", - "karma-junit-reporter": "^2.0.1", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-sourcemap-loader": "^0.3.8", - "mocha": "^10.0.0", - "c8": "^8.0.0", - "rimraf": "^3.0.0", - "ts-node": "^10.0.0", - "typescript": "~5.2.0" + "@vitest/browser": "^1.3.1", + "@vitest/coverage-istanbul": "^1.3.1", + "eslint": "^8.56.0", + "playwright": "^1.41.2", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "tshy": "^1.11.1", + "typescript": "~5.3.3", + "vitest": "^1.3.1" }, "//metadata": { "migrationDate": "2023-03-08T18:36:03.000Z" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false } } diff --git a/node_modules/@azure/core-auth/dist-esm/src/azureKeyCredential.js b/node_modules/@azure/core-auth/dist/browser/azureKeyCredential.js similarity index 98% rename from node_modules/@azure/core-auth/dist-esm/src/azureKeyCredential.js rename to node_modules/@azure/core-auth/dist/browser/azureKeyCredential.js index e1ec1af9f..050f0fdf4 100644 --- a/node_modules/@azure/core-auth/dist-esm/src/azureKeyCredential.js +++ b/node_modules/@azure/core-auth/dist/browser/azureKeyCredential.js @@ -5,6 +5,7 @@ * the underlying key value. */ export class AzureKeyCredential { + _key; /** * The value of the key to be used in authentication */ diff --git a/node_modules/@azure/core-auth/dist-esm/src/azureNamedKeyCredential.js b/node_modules/@azure/core-auth/dist/browser/azureNamedKeyCredential.js similarity index 98% rename from node_modules/@azure/core-auth/dist-esm/src/azureNamedKeyCredential.js rename to node_modules/@azure/core-auth/dist/browser/azureNamedKeyCredential.js index 3cd59bfa7..76088504b 100644 --- a/node_modules/@azure/core-auth/dist-esm/src/azureNamedKeyCredential.js +++ b/node_modules/@azure/core-auth/dist/browser/azureNamedKeyCredential.js @@ -6,6 +6,8 @@ import { isObjectWithProperties } from "@azure/core-util"; * the underlying name and key values. */ export class AzureNamedKeyCredential { + _key; + _name; /** * The value of the key to be used in authentication. */ diff --git a/node_modules/@azure/core-auth/dist-esm/src/azureSASCredential.js b/node_modules/@azure/core-auth/dist/browser/azureSASCredential.js similarity index 99% rename from node_modules/@azure/core-auth/dist-esm/src/azureSASCredential.js rename to node_modules/@azure/core-auth/dist/browser/azureSASCredential.js index d9d6e0b6b..a7da3b3d3 100644 --- a/node_modules/@azure/core-auth/dist-esm/src/azureSASCredential.js +++ b/node_modules/@azure/core-auth/dist/browser/azureSASCredential.js @@ -6,6 +6,7 @@ import { isObjectWithProperties } from "@azure/core-util"; * the underlying signature value. */ export class AzureSASCredential { + _signature; /** * The value of the shared access signature to be used in authentication */ diff --git a/node_modules/@azure/core-auth/dist-esm/src/index.js b/node_modules/@azure/core-auth/dist/browser/index.js similarity index 51% rename from node_modules/@azure/core-auth/dist-esm/src/index.js rename to node_modules/@azure/core-auth/dist/browser/index.js index 357c24ef2..38b66695e 100644 --- a/node_modules/@azure/core-auth/dist-esm/src/index.js +++ b/node_modules/@azure/core-auth/dist/browser/index.js @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export { AzureKeyCredential } from "./azureKeyCredential"; -export { isKeyCredential } from "./keyCredential"; -export { AzureNamedKeyCredential, isNamedKeyCredential, } from "./azureNamedKeyCredential"; -export { AzureSASCredential, isSASCredential } from "./azureSASCredential"; -export { isTokenCredential, } from "./tokenCredential"; +export { AzureKeyCredential } from "./azureKeyCredential.js"; +export { isKeyCredential } from "./keyCredential.js"; +export { AzureNamedKeyCredential, isNamedKeyCredential, } from "./azureNamedKeyCredential.js"; +export { AzureSASCredential, isSASCredential } from "./azureSASCredential.js"; +export { isTokenCredential, } from "./tokenCredential.js"; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist-esm/src/keyCredential.js b/node_modules/@azure/core-auth/dist/browser/keyCredential.js similarity index 100% rename from node_modules/@azure/core-auth/dist-esm/src/keyCredential.js rename to node_modules/@azure/core-auth/dist/browser/keyCredential.js diff --git a/node_modules/@azure/core-auth/dist/browser/package.json b/node_modules/@azure/core-auth/dist/browser/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/browser/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-auth/dist-esm/src/tokenCredential.js b/node_modules/@azure/core-auth/dist/browser/tokenCredential.js similarity index 100% rename from node_modules/@azure/core-auth/dist-esm/src/tokenCredential.js rename to node_modules/@azure/core-auth/dist/browser/tokenCredential.js diff --git a/node_modules/@azure/core-auth/dist-esm/src/tracing.js b/node_modules/@azure/core-auth/dist/browser/tracing.js similarity index 100% rename from node_modules/@azure/core-auth/dist-esm/src/tracing.js rename to node_modules/@azure/core-auth/dist/browser/tracing.js diff --git a/node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js b/node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js new file mode 100644 index 000000000..ea21c1d69 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js @@ -0,0 +1,43 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AzureKeyCredential = void 0; +/** + * A static-key-based credential that supports updating + * the underlying key value. + */ +class AzureKeyCredential { + _key; + /** + * The value of the key to be used in authentication + */ + get key() { + return this._key; + } + /** + * Create an instance of an AzureKeyCredential for use + * with a service client. + * + * @param key - The initial value of the key to use in authentication + */ + constructor(key) { + if (!key) { + throw new Error("key must be a non-empty string"); + } + this._key = key; + } + /** + * Change the value of the key. + * + * Updates will take effect upon the next request after + * updating the key value. + * + * @param newKey - The new key value to be used + */ + update(newKey) { + this._key = newKey; + } +} +exports.AzureKeyCredential = AzureKeyCredential; +//# sourceMappingURL=azureKeyCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/commonjs/azureNamedKeyCredential.js b/node_modules/@azure/core-auth/dist/commonjs/azureNamedKeyCredential.js new file mode 100644 index 000000000..e0b73fa05 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/commonjs/azureNamedKeyCredential.js @@ -0,0 +1,69 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isNamedKeyCredential = exports.AzureNamedKeyCredential = void 0; +const core_util_1 = require("@azure/core-util"); +/** + * A static name/key-based credential that supports updating + * the underlying name and key values. + */ +class AzureNamedKeyCredential { + _key; + _name; + /** + * The value of the key to be used in authentication. + */ + get key() { + return this._key; + } + /** + * The value of the name to be used in authentication. + */ + get name() { + return this._name; + } + /** + * Create an instance of an AzureNamedKeyCredential for use + * with a service client. + * + * @param name - The initial value of the name to use in authentication. + * @param key - The initial value of the key to use in authentication. + */ + constructor(name, key) { + if (!name || !key) { + throw new TypeError("name and key must be non-empty strings"); + } + this._name = name; + this._key = key; + } + /** + * Change the value of the key. + * + * Updates will take effect upon the next request after + * updating the key value. + * + * @param newName - The new name value to be used. + * @param newKey - The new key value to be used. + */ + update(newName, newKey) { + if (!newName || !newKey) { + throw new TypeError("newName and newKey must be non-empty strings"); + } + this._name = newName; + this._key = newKey; + } +} +exports.AzureNamedKeyCredential = AzureNamedKeyCredential; +/** + * Tests an object to determine whether it implements NamedKeyCredential. + * + * @param credential - The assumed NamedKeyCredential to be tested. + */ +function isNamedKeyCredential(credential) { + return ((0, core_util_1.isObjectWithProperties)(credential, ["name", "key"]) && + typeof credential.key === "string" && + typeof credential.name === "string"); +} +exports.isNamedKeyCredential = isNamedKeyCredential; +//# sourceMappingURL=azureNamedKeyCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/commonjs/azureSASCredential.js b/node_modules/@azure/core-auth/dist/commonjs/azureSASCredential.js new file mode 100644 index 000000000..1c29897cf --- /dev/null +++ b/node_modules/@azure/core-auth/dist/commonjs/azureSASCredential.js @@ -0,0 +1,56 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSASCredential = exports.AzureSASCredential = void 0; +const core_util_1 = require("@azure/core-util"); +/** + * A static-signature-based credential that supports updating + * the underlying signature value. + */ +class AzureSASCredential { + _signature; + /** + * The value of the shared access signature to be used in authentication + */ + get signature() { + return this._signature; + } + /** + * Create an instance of an AzureSASCredential for use + * with a service client. + * + * @param signature - The initial value of the shared access signature to use in authentication + */ + constructor(signature) { + if (!signature) { + throw new Error("shared access signature must be a non-empty string"); + } + this._signature = signature; + } + /** + * Change the value of the signature. + * + * Updates will take effect upon the next request after + * updating the signature value. + * + * @param newSignature - The new shared access signature value to be used + */ + update(newSignature) { + if (!newSignature) { + throw new Error("shared access signature must be a non-empty string"); + } + this._signature = newSignature; + } +} +exports.AzureSASCredential = AzureSASCredential; +/** + * Tests an object to determine whether it implements SASCredential. + * + * @param credential - The assumed SASCredential to be tested. + */ +function isSASCredential(credential) { + return ((0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"); +} +exports.isSASCredential = isSASCredential; +//# sourceMappingURL=azureSASCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/commonjs/index.js b/node_modules/@azure/core-auth/dist/commonjs/index.js new file mode 100644 index 000000000..5e9a66fb4 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/commonjs/index.js @@ -0,0 +1,18 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isTokenCredential = exports.isSASCredential = exports.AzureSASCredential = exports.isNamedKeyCredential = exports.AzureNamedKeyCredential = exports.isKeyCredential = exports.AzureKeyCredential = void 0; +var azureKeyCredential_js_1 = require("./azureKeyCredential.js"); +Object.defineProperty(exports, "AzureKeyCredential", { enumerable: true, get: function () { return azureKeyCredential_js_1.AzureKeyCredential; } }); +var keyCredential_js_1 = require("./keyCredential.js"); +Object.defineProperty(exports, "isKeyCredential", { enumerable: true, get: function () { return keyCredential_js_1.isKeyCredential; } }); +var azureNamedKeyCredential_js_1 = require("./azureNamedKeyCredential.js"); +Object.defineProperty(exports, "AzureNamedKeyCredential", { enumerable: true, get: function () { return azureNamedKeyCredential_js_1.AzureNamedKeyCredential; } }); +Object.defineProperty(exports, "isNamedKeyCredential", { enumerable: true, get: function () { return azureNamedKeyCredential_js_1.isNamedKeyCredential; } }); +var azureSASCredential_js_1 = require("./azureSASCredential.js"); +Object.defineProperty(exports, "AzureSASCredential", { enumerable: true, get: function () { return azureSASCredential_js_1.AzureSASCredential; } }); +Object.defineProperty(exports, "isSASCredential", { enumerable: true, get: function () { return azureSASCredential_js_1.isSASCredential; } }); +var tokenCredential_js_1 = require("./tokenCredential.js"); +Object.defineProperty(exports, "isTokenCredential", { enumerable: true, get: function () { return tokenCredential_js_1.isTokenCredential; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/commonjs/keyCredential.js b/node_modules/@azure/core-auth/dist/commonjs/keyCredential.js new file mode 100644 index 000000000..b21f3d22f --- /dev/null +++ b/node_modules/@azure/core-auth/dist/commonjs/keyCredential.js @@ -0,0 +1,16 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isKeyCredential = void 0; +const core_util_1 = require("@azure/core-util"); +/** + * Tests an object to determine whether it implements KeyCredential. + * + * @param credential - The assumed KeyCredential to be tested. + */ +function isKeyCredential(credential) { + return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; +} +exports.isKeyCredential = isKeyCredential; +//# sourceMappingURL=keyCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/commonjs/package.json b/node_modules/@azure/core-auth/dist/commonjs/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/node_modules/@azure/core-auth/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/@azure/core-auth/dist/commonjs/tokenCredential.js b/node_modules/@azure/core-auth/dist/commonjs/tokenCredential.js new file mode 100644 index 000000000..0a16ef974 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/commonjs/tokenCredential.js @@ -0,0 +1,23 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isTokenCredential = void 0; +/** + * Tests an object to determine whether it implements TokenCredential. + * + * @param credential - The assumed TokenCredential to be tested. + */ +function isTokenCredential(credential) { + // Check for an object with a 'getToken' function and possibly with + // a 'signRequest' function. We do this check to make sure that + // a ServiceClientCredentials implementor (like TokenClientCredentials + // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if + // it doesn't actually implement TokenCredential also. + const castCredential = credential; + return (castCredential && + typeof castCredential.getToken === "function" && + (castCredential.signRequest === undefined || castCredential.getToken.length > 0)); +} +exports.isTokenCredential = isTokenCredential; +//# sourceMappingURL=tokenCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/commonjs/tracing.js b/node_modules/@azure/core-auth/dist/commonjs/tracing.js new file mode 100644 index 000000000..faac44fa8 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/commonjs/tracing.js @@ -0,0 +1,5 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=tracing.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/commonjs/tsdoc-metadata.json b/node_modules/@azure/core-auth/dist/commonjs/tsdoc-metadata.json new file mode 100644 index 000000000..22735db17 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/commonjs/tsdoc-metadata.json @@ -0,0 +1,11 @@ +// This file is read by tools that parse documentation comments conforming to the TSDoc standard. +// It should be published with your NPM package. It should not be tracked by Git. +{ + "tsdocVersion": "0.12", + "toolPackages": [ + { + "packageName": "@microsoft/api-extractor", + "packageVersion": "7.42.3" + } + ] +} diff --git a/node_modules/@azure/core-auth/dist/esm/azureKeyCredential.js b/node_modules/@azure/core-auth/dist/esm/azureKeyCredential.js new file mode 100644 index 000000000..050f0fdf4 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/esm/azureKeyCredential.js @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * A static-key-based credential that supports updating + * the underlying key value. + */ +export class AzureKeyCredential { + _key; + /** + * The value of the key to be used in authentication + */ + get key() { + return this._key; + } + /** + * Create an instance of an AzureKeyCredential for use + * with a service client. + * + * @param key - The initial value of the key to use in authentication + */ + constructor(key) { + if (!key) { + throw new Error("key must be a non-empty string"); + } + this._key = key; + } + /** + * Change the value of the key. + * + * Updates will take effect upon the next request after + * updating the key value. + * + * @param newKey - The new key value to be used + */ + update(newKey) { + this._key = newKey; + } +} +//# sourceMappingURL=azureKeyCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/esm/azureNamedKeyCredential.js b/node_modules/@azure/core-auth/dist/esm/azureNamedKeyCredential.js new file mode 100644 index 000000000..76088504b --- /dev/null +++ b/node_modules/@azure/core-auth/dist/esm/azureNamedKeyCredential.js @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { isObjectWithProperties } from "@azure/core-util"; +/** + * A static name/key-based credential that supports updating + * the underlying name and key values. + */ +export class AzureNamedKeyCredential { + _key; + _name; + /** + * The value of the key to be used in authentication. + */ + get key() { + return this._key; + } + /** + * The value of the name to be used in authentication. + */ + get name() { + return this._name; + } + /** + * Create an instance of an AzureNamedKeyCredential for use + * with a service client. + * + * @param name - The initial value of the name to use in authentication. + * @param key - The initial value of the key to use in authentication. + */ + constructor(name, key) { + if (!name || !key) { + throw new TypeError("name and key must be non-empty strings"); + } + this._name = name; + this._key = key; + } + /** + * Change the value of the key. + * + * Updates will take effect upon the next request after + * updating the key value. + * + * @param newName - The new name value to be used. + * @param newKey - The new key value to be used. + */ + update(newName, newKey) { + if (!newName || !newKey) { + throw new TypeError("newName and newKey must be non-empty strings"); + } + this._name = newName; + this._key = newKey; + } +} +/** + * Tests an object to determine whether it implements NamedKeyCredential. + * + * @param credential - The assumed NamedKeyCredential to be tested. + */ +export function isNamedKeyCredential(credential) { + return (isObjectWithProperties(credential, ["name", "key"]) && + typeof credential.key === "string" && + typeof credential.name === "string"); +} +//# sourceMappingURL=azureNamedKeyCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/esm/azureSASCredential.js b/node_modules/@azure/core-auth/dist/esm/azureSASCredential.js new file mode 100644 index 000000000..a7da3b3d3 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/esm/azureSASCredential.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { isObjectWithProperties } from "@azure/core-util"; +/** + * A static-signature-based credential that supports updating + * the underlying signature value. + */ +export class AzureSASCredential { + _signature; + /** + * The value of the shared access signature to be used in authentication + */ + get signature() { + return this._signature; + } + /** + * Create an instance of an AzureSASCredential for use + * with a service client. + * + * @param signature - The initial value of the shared access signature to use in authentication + */ + constructor(signature) { + if (!signature) { + throw new Error("shared access signature must be a non-empty string"); + } + this._signature = signature; + } + /** + * Change the value of the signature. + * + * Updates will take effect upon the next request after + * updating the signature value. + * + * @param newSignature - The new shared access signature value to be used + */ + update(newSignature) { + if (!newSignature) { + throw new Error("shared access signature must be a non-empty string"); + } + this._signature = newSignature; + } +} +/** + * Tests an object to determine whether it implements SASCredential. + * + * @param credential - The assumed SASCredential to be tested. + */ +export function isSASCredential(credential) { + return (isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); +} +//# sourceMappingURL=azureSASCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/esm/index.js b/node_modules/@azure/core-auth/dist/esm/index.js new file mode 100644 index 000000000..38b66695e --- /dev/null +++ b/node_modules/@azure/core-auth/dist/esm/index.js @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { AzureKeyCredential } from "./azureKeyCredential.js"; +export { isKeyCredential } from "./keyCredential.js"; +export { AzureNamedKeyCredential, isNamedKeyCredential, } from "./azureNamedKeyCredential.js"; +export { AzureSASCredential, isSASCredential } from "./azureSASCredential.js"; +export { isTokenCredential, } from "./tokenCredential.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/esm/keyCredential.js b/node_modules/@azure/core-auth/dist/esm/keyCredential.js new file mode 100644 index 000000000..0e1d299d2 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/esm/keyCredential.js @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { isObjectWithProperties } from "@azure/core-util"; +/** + * Tests an object to determine whether it implements KeyCredential. + * + * @param credential - The assumed KeyCredential to be tested. + */ +export function isKeyCredential(credential) { + return isObjectWithProperties(credential, ["key"]) && typeof credential.key === "string"; +} +//# sourceMappingURL=keyCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/esm/package.json b/node_modules/@azure/core-auth/dist/esm/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-auth/dist/esm/tokenCredential.js b/node_modules/@azure/core-auth/dist/esm/tokenCredential.js new file mode 100644 index 000000000..5ca7f68d1 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/esm/tokenCredential.js @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Tests an object to determine whether it implements TokenCredential. + * + * @param credential - The assumed TokenCredential to be tested. + */ +export function isTokenCredential(credential) { + // Check for an object with a 'getToken' function and possibly with + // a 'signRequest' function. We do this check to make sure that + // a ServiceClientCredentials implementor (like TokenClientCredentials + // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if + // it doesn't actually implement TokenCredential also. + const castCredential = credential; + return (castCredential && + typeof castCredential.getToken === "function" && + (castCredential.signRequest === undefined || castCredential.getToken.length > 0)); +} +//# sourceMappingURL=tokenCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/esm/tracing.js b/node_modules/@azure/core-auth/dist/esm/tracing.js new file mode 100644 index 000000000..377718d17 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/esm/tracing.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=tracing.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/index.js b/node_modules/@azure/core-auth/dist/index.js deleted file mode 100644 index c189fec82..000000000 --- a/node_modules/@azure/core-auth/dist/index.js +++ /dev/null @@ -1,192 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var coreUtil = require('@azure/core-util'); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * A static-key-based credential that supports updating - * the underlying key value. - */ -class AzureKeyCredential { - /** - * The value of the key to be used in authentication - */ - get key() { - return this._key; - } - /** - * Create an instance of an AzureKeyCredential for use - * with a service client. - * - * @param key - The initial value of the key to use in authentication - */ - constructor(key) { - if (!key) { - throw new Error("key must be a non-empty string"); - } - this._key = key; - } - /** - * Change the value of the key. - * - * Updates will take effect upon the next request after - * updating the key value. - * - * @param newKey - The new key value to be used - */ - update(newKey) { - this._key = newKey; - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Tests an object to determine whether it implements KeyCredential. - * - * @param credential - The assumed KeyCredential to be tested. - */ -function isKeyCredential(credential) { - return coreUtil.isObjectWithProperties(credential, ["key"]) && typeof credential.key === "string"; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * A static name/key-based credential that supports updating - * the underlying name and key values. - */ -class AzureNamedKeyCredential { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; - } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; - } - /** - * Create an instance of an AzureNamedKeyCredential for use - * with a service client. - * - * @param name - The initial value of the name to use in authentication. - * @param key - The initial value of the key to use in authentication. - */ - constructor(name, key) { - if (!name || !key) { - throw new TypeError("name and key must be non-empty strings"); - } - this._name = name; - this._key = key; - } - /** - * Change the value of the key. - * - * Updates will take effect upon the next request after - * updating the key value. - * - * @param newName - The new name value to be used. - * @param newKey - The new key value to be used. - */ - update(newName, newKey) { - if (!newName || !newKey) { - throw new TypeError("newName and newKey must be non-empty strings"); - } - this._name = newName; - this._key = newKey; - } -} -/** - * Tests an object to determine whether it implements NamedKeyCredential. - * - * @param credential - The assumed NamedKeyCredential to be tested. - */ -function isNamedKeyCredential(credential) { - return (coreUtil.isObjectWithProperties(credential, ["name", "key"]) && - typeof credential.key === "string" && - typeof credential.name === "string"); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * A static-signature-based credential that supports updating - * the underlying signature value. - */ -class AzureSASCredential { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; - } - /** - * Create an instance of an AzureSASCredential for use - * with a service client. - * - * @param signature - The initial value of the shared access signature to use in authentication - */ - constructor(signature) { - if (!signature) { - throw new Error("shared access signature must be a non-empty string"); - } - this._signature = signature; - } - /** - * Change the value of the signature. - * - * Updates will take effect upon the next request after - * updating the signature value. - * - * @param newSignature - The new shared access signature value to be used - */ - update(newSignature) { - if (!newSignature) { - throw new Error("shared access signature must be a non-empty string"); - } - this._signature = newSignature; - } -} -/** - * Tests an object to determine whether it implements SASCredential. - * - * @param credential - The assumed SASCredential to be tested. - */ -function isSASCredential(credential) { - return (coreUtil.isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Tests an object to determine whether it implements TokenCredential. - * - * @param credential - The assumed TokenCredential to be tested. - */ -function isTokenCredential(credential) { - // Check for an object with a 'getToken' function and possibly with - // a 'signRequest' function. We do this check to make sure that - // a ServiceClientCredentials implementor (like TokenClientCredentials - // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if - // it doesn't actually implement TokenCredential also. - const castCredential = credential; - return (castCredential && - typeof castCredential.getToken === "function" && - (castCredential.signRequest === undefined || castCredential.getToken.length > 0)); -} - -exports.AzureKeyCredential = AzureKeyCredential; -exports.AzureNamedKeyCredential = AzureNamedKeyCredential; -exports.AzureSASCredential = AzureSASCredential; -exports.isKeyCredential = isKeyCredential; -exports.isNamedKeyCredential = isNamedKeyCredential; -exports.isSASCredential = isSASCredential; -exports.isTokenCredential = isTokenCredential; -//# sourceMappingURL=index.js.map diff --git a/node_modules/@azure/core-auth/dist/react-native/azureKeyCredential.js b/node_modules/@azure/core-auth/dist/react-native/azureKeyCredential.js new file mode 100644 index 000000000..050f0fdf4 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/react-native/azureKeyCredential.js @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * A static-key-based credential that supports updating + * the underlying key value. + */ +export class AzureKeyCredential { + _key; + /** + * The value of the key to be used in authentication + */ + get key() { + return this._key; + } + /** + * Create an instance of an AzureKeyCredential for use + * with a service client. + * + * @param key - The initial value of the key to use in authentication + */ + constructor(key) { + if (!key) { + throw new Error("key must be a non-empty string"); + } + this._key = key; + } + /** + * Change the value of the key. + * + * Updates will take effect upon the next request after + * updating the key value. + * + * @param newKey - The new key value to be used + */ + update(newKey) { + this._key = newKey; + } +} +//# sourceMappingURL=azureKeyCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/react-native/azureNamedKeyCredential.js b/node_modules/@azure/core-auth/dist/react-native/azureNamedKeyCredential.js new file mode 100644 index 000000000..76088504b --- /dev/null +++ b/node_modules/@azure/core-auth/dist/react-native/azureNamedKeyCredential.js @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { isObjectWithProperties } from "@azure/core-util"; +/** + * A static name/key-based credential that supports updating + * the underlying name and key values. + */ +export class AzureNamedKeyCredential { + _key; + _name; + /** + * The value of the key to be used in authentication. + */ + get key() { + return this._key; + } + /** + * The value of the name to be used in authentication. + */ + get name() { + return this._name; + } + /** + * Create an instance of an AzureNamedKeyCredential for use + * with a service client. + * + * @param name - The initial value of the name to use in authentication. + * @param key - The initial value of the key to use in authentication. + */ + constructor(name, key) { + if (!name || !key) { + throw new TypeError("name and key must be non-empty strings"); + } + this._name = name; + this._key = key; + } + /** + * Change the value of the key. + * + * Updates will take effect upon the next request after + * updating the key value. + * + * @param newName - The new name value to be used. + * @param newKey - The new key value to be used. + */ + update(newName, newKey) { + if (!newName || !newKey) { + throw new TypeError("newName and newKey must be non-empty strings"); + } + this._name = newName; + this._key = newKey; + } +} +/** + * Tests an object to determine whether it implements NamedKeyCredential. + * + * @param credential - The assumed NamedKeyCredential to be tested. + */ +export function isNamedKeyCredential(credential) { + return (isObjectWithProperties(credential, ["name", "key"]) && + typeof credential.key === "string" && + typeof credential.name === "string"); +} +//# sourceMappingURL=azureNamedKeyCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/react-native/azureSASCredential.js b/node_modules/@azure/core-auth/dist/react-native/azureSASCredential.js new file mode 100644 index 000000000..a7da3b3d3 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/react-native/azureSASCredential.js @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { isObjectWithProperties } from "@azure/core-util"; +/** + * A static-signature-based credential that supports updating + * the underlying signature value. + */ +export class AzureSASCredential { + _signature; + /** + * The value of the shared access signature to be used in authentication + */ + get signature() { + return this._signature; + } + /** + * Create an instance of an AzureSASCredential for use + * with a service client. + * + * @param signature - The initial value of the shared access signature to use in authentication + */ + constructor(signature) { + if (!signature) { + throw new Error("shared access signature must be a non-empty string"); + } + this._signature = signature; + } + /** + * Change the value of the signature. + * + * Updates will take effect upon the next request after + * updating the signature value. + * + * @param newSignature - The new shared access signature value to be used + */ + update(newSignature) { + if (!newSignature) { + throw new Error("shared access signature must be a non-empty string"); + } + this._signature = newSignature; + } +} +/** + * Tests an object to determine whether it implements SASCredential. + * + * @param credential - The assumed SASCredential to be tested. + */ +export function isSASCredential(credential) { + return (isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); +} +//# sourceMappingURL=azureSASCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/react-native/index.js b/node_modules/@azure/core-auth/dist/react-native/index.js new file mode 100644 index 000000000..38b66695e --- /dev/null +++ b/node_modules/@azure/core-auth/dist/react-native/index.js @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { AzureKeyCredential } from "./azureKeyCredential.js"; +export { isKeyCredential } from "./keyCredential.js"; +export { AzureNamedKeyCredential, isNamedKeyCredential, } from "./azureNamedKeyCredential.js"; +export { AzureSASCredential, isSASCredential } from "./azureSASCredential.js"; +export { isTokenCredential, } from "./tokenCredential.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/react-native/keyCredential.js b/node_modules/@azure/core-auth/dist/react-native/keyCredential.js new file mode 100644 index 000000000..0e1d299d2 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/react-native/keyCredential.js @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { isObjectWithProperties } from "@azure/core-util"; +/** + * Tests an object to determine whether it implements KeyCredential. + * + * @param credential - The assumed KeyCredential to be tested. + */ +export function isKeyCredential(credential) { + return isObjectWithProperties(credential, ["key"]) && typeof credential.key === "string"; +} +//# sourceMappingURL=keyCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/react-native/package.json b/node_modules/@azure/core-auth/dist/react-native/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/react-native/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-auth/dist/react-native/tokenCredential.js b/node_modules/@azure/core-auth/dist/react-native/tokenCredential.js new file mode 100644 index 000000000..5ca7f68d1 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/react-native/tokenCredential.js @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Tests an object to determine whether it implements TokenCredential. + * + * @param credential - The assumed TokenCredential to be tested. + */ +export function isTokenCredential(credential) { + // Check for an object with a 'getToken' function and possibly with + // a 'signRequest' function. We do this check to make sure that + // a ServiceClientCredentials implementor (like TokenClientCredentials + // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if + // it doesn't actually implement TokenCredential also. + const castCredential = credential; + return (castCredential && + typeof castCredential.getToken === "function" && + (castCredential.signRequest === undefined || castCredential.getToken.length > 0)); +} +//# sourceMappingURL=tokenCredential.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/dist/react-native/tracing.js b/node_modules/@azure/core-auth/dist/react-native/tracing.js new file mode 100644 index 000000000..377718d17 --- /dev/null +++ b/node_modules/@azure/core-auth/dist/react-native/tracing.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=tracing.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-auth/package.json b/node_modules/@azure/core-auth/package.json index 0debabe09..faf8695b3 100644 --- a/node_modules/@azure/core-auth/package.json +++ b/node_modules/@azure/core-auth/package.json @@ -1,37 +1,35 @@ { "name": "@azure/core-auth", - "version": "1.6.0", + "version": "1.7.1", "description": "Provides low-level interfaces and helper methods for authentication in Azure SDK", "sdk-type": "client", - "main": "dist/index.js", - "module": "dist-esm/src/index.js", - "types": "./types/latest/core-auth.d.ts", - "scripts": { - "build:samples": "echo Obsolete", - "build:test": "tsc -p . && dev-tool run bundle", - "build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local", - "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "clean": "rimraf dist dist-* temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "tsc -p . && api-extractor run --local", - "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "integration-test:browser": "echo skipped", - "integration-test:node": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint package.json api-extractor.json src test --ext .ts", - "pack": "npm pack 2>&1", - "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", - "test:node": "npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node", - "test": "npm run clean && tsc -p . && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", - "unit-test:browser": "echo skipped", - "unit-test:node": "dev-tool run test:node-ts-input --no-test-proxy=true", - "unit-test": "npm run unit-test:node && npm run unit-test:browser" + "type": "module", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "browser": "./dist/browser/index.js", "files": [ "dist/", - "dist-esm/src/", - "types/latest/core-auth.d.ts", "README.md", "LICENSE" ], @@ -51,29 +49,64 @@ }, "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-auth/README.md", "sideEffects": false, + "scripts": { + "build:samples": "echo Obsolete", + "build:test": "npm run clean && tshy && dev-tool run build-test", + "build": "npm run clean && tshy && api-extractor run --local", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "clean": "rimraf --glob dist dist-* temp types *.tgz *.log", + "execute:samples": "echo skipped", + "extract-api": "tshy && api-extractor run --local", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts", + "pack": "npm pack 2>&1", + "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser", + "unit-test:node": "dev-tool run test:vitest --no-test-proxy", + "unit-test": "npm run unit-test:node && npm run unit-test:browser" + }, "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-util": "^1.1.0", - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "devDependencies": { "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", - "@microsoft/api-extractor": "^7.31.1", - "@types/chai": "^4.1.6", - "@types/mocha": "^10.0.0", + "@microsoft/api-extractor": "^7.40.3", "@types/node": "^18.0.0", - "chai": "^4.2.0", - "cross-env": "^7.0.2", + "@vitest/browser": "^1.3.1", + "@vitest/coverage-istanbul": "^1.3.1", "eslint": "^8.0.0", - "inherits": "^2.0.3", - "mocha": "^10.0.0", - "rimraf": "^3.0.0", + "playwright": "^1.41.2", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "tshy": "^1.11.1", "typescript": "~5.3.3", - "util": "^0.12.1", - "ts-node": "^10.0.0" + "vitest": "^1.3.1" }, "//metadata": { "migrationDate": "2023-03-08T18:36:03.000Z" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false } } diff --git a/node_modules/@azure/core-lro/dist-esm/src/http/models.js b/node_modules/@azure/core-lro/dist/browser/http/models.js similarity index 100% rename from node_modules/@azure/core-lro/dist-esm/src/http/models.js rename to node_modules/@azure/core-lro/dist/browser/http/models.js diff --git a/node_modules/@azure/core-lro/dist-esm/src/http/operation.js b/node_modules/@azure/core-lro/dist/browser/http/operation.js similarity index 83% rename from node_modules/@azure/core-lro/dist-esm/src/http/operation.js rename to node_modules/@azure/core-lro/dist/browser/http/operation.js index 1faac8c99..038384478 100644 --- a/node_modules/@azure/core-lro/dist-esm/src/http/operation.js +++ b/node_modules/@azure/core-lro/dist/browser/http/operation.js @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { initOperation, pollOperation } from "../poller/operation"; -import { logger } from "../logger"; +import { initOperation, pollOperation } from "../poller/operation.js"; +import { logger } from "../logger.js"; function getOperationLocationPollingUrl(inputs) { const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; + return operationLocation ?? azureAsyncOperation; } function getLocationHeader(rawResponse) { return rawResponse.headers["location"]; @@ -16,7 +16,6 @@ function getAzureAsyncOperationHeader(rawResponse) { return rawResponse.headers["azure-asyncoperation"]; } function findResourceLocation(inputs) { - var _a; const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; switch (requestMethod) { case "PUT": { @@ -26,7 +25,7 @@ function findResourceLocation(inputs) { return undefined; } case "PATCH": { - return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + return getDefault() ?? requestPath; } default: { return getDefault(); @@ -53,7 +52,7 @@ export function inferLroMode(inputs) { const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse); const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation }); const location = getLocationHeader(rawResponse); - const normalizedRequestMethod = requestMethod === null || requestMethod === void 0 ? void 0 : requestMethod.toLocaleUpperCase(); + const normalizedRequestMethod = requestMethod?.toLocaleUpperCase(); if (pollingUrl !== undefined) { return { mode: "OperationLocation", @@ -87,7 +86,7 @@ function transformStatus(inputs) { if (typeof status !== "string" && status !== undefined) { throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`); } - switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) { + switch (status?.toLocaleLowerCase()) { case undefined: return toOperationStatus(statusCode); case "succeeded": @@ -110,14 +109,12 @@ function transformStatus(inputs) { } } function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + const { status } = rawResponse.body ?? {}; return transformStatus({ status, statusCode: rawResponse.statusCode }); } function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState; + const { properties, provisioningState } = rawResponse.body ?? {}; + const status = properties?.provisioningState ?? provisioningState; return transformStatus({ status, statusCode: rawResponse.statusCode }); } function toOperationStatus(statusCode) { @@ -165,8 +162,7 @@ function calculatePollingIntervalFromDate(retryAfterDate) { export function getStatusFromInitialResponse(inputs) { const { response, state, operationLocation } = inputs; function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + const mode = state.config.metadata?.["mode"]; switch (mode) { case undefined: return toOperationStatus(response.rawResponse.statusCode); @@ -193,7 +189,12 @@ export async function initHttpOperation(inputs) { requestMethod: lro.requestMethod, resourceLocationConfig, }); - return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {})); + return { + response, + operationLocation: config?.operationLocation, + resourceLocation: config?.resourceLocation, + ...(config?.mode ? { metadata: { mode: config.mode } } : {}), + }; }, stateProxy, processResult: processResult @@ -204,8 +205,7 @@ export async function initHttpOperation(inputs) { }); } export function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + const mode = state.config.metadata?.["mode"]; switch (mode) { case "OperationLocation": { return getOperationLocationPollingUrl({ @@ -223,8 +223,7 @@ export function getOperationLocation({ rawResponse }, state) { } } export function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + const mode = state.config.metadata?.["mode"]; switch (mode) { case "OperationLocation": { return getStatus(rawResponse); @@ -240,8 +239,7 @@ export function getOperationStatus({ rawResponse }, state) { } } function accessBodyProperty({ flatResponse, rawResponse }, prop) { - var _a, _b; - return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_b = rawResponse.body) === null || _b === void 0 ? void 0 : _b[prop]; + return flatResponse?.[prop] ?? rawResponse.body?.[prop]; } export function getResourceLocation(res, state) { const loc = accessBodyProperty(res, "resourceLocation"); diff --git a/node_modules/@azure/core-lro/dist-esm/src/http/poller.js b/node_modules/@azure/core-lro/dist/browser/http/poller.js similarity index 81% rename from node_modules/@azure/core-lro/dist-esm/src/http/poller.js rename to node_modules/@azure/core-lro/dist/browser/http/poller.js index b85518ca4..84379fdd7 100644 --- a/node_modules/@azure/core-lro/dist-esm/src/http/poller.js +++ b/node_modules/@azure/core-lro/dist/browser/http/poller.js @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { getErrorFromResponse, getOperationLocation, getOperationStatus, getResourceLocation, getStatusFromInitialResponse, inferLroMode, isOperationError, parseRetryAfter, } from "./operation"; -import { buildCreatePoller } from "../poller/poller"; +import { getErrorFromResponse, getOperationLocation, getOperationStatus, getResourceLocation, getStatusFromInitialResponse, inferLroMode, isOperationError, parseRetryAfter, } from "./operation.js"; +import { buildCreatePoller } from "../poller/poller.js"; /** * Creates a poller that can be used to poll a long-running operation. * @param lro - Description of the long-running operation @@ -28,7 +28,12 @@ export async function createHttpPoller(lro, options) { requestMethod: lro.requestMethod, resourceLocationConfig, }); - return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {})); + return { + response, + operationLocation: config?.operationLocation, + resourceLocation: config?.resourceLocation, + ...(config?.mode ? { metadata: { mode: config.mode } } : {}), + }; }, poll: lro.sendPollRequest, }, { diff --git a/node_modules/@azure/core-lro/dist-esm/src/index.js b/node_modules/@azure/core-lro/dist/browser/index.js similarity index 70% rename from node_modules/@azure/core-lro/dist-esm/src/index.js rename to node_modules/@azure/core-lro/dist/browser/index.js index 27ccadf6c..3952c2ad9 100644 --- a/node_modules/@azure/core-lro/dist-esm/src/index.js +++ b/node_modules/@azure/core-lro/dist/browser/index.js @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export { createHttpPoller } from "./http/poller"; +export { createHttpPoller } from "./http/poller.js"; /** * This can be uncommented to expose the protocol-agnostic poller */ @@ -13,7 +13,7 @@ export { createHttpPoller } from "./http/poller"; // } from "./poller/models"; // export { buildCreatePoller } from "./poller/poller"; /** legacy */ -export * from "./legacy/lroEngine"; -export * from "./legacy/poller"; -export * from "./legacy/pollOperation"; +export * from "./legacy/lroEngine/index.js"; +export * from "./legacy/poller.js"; +export * from "./legacy/pollOperation.js"; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/abort-controller/dist-esm/src/index.js b/node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/index.js similarity index 71% rename from node_modules/@azure/abort-controller/dist-esm/src/index.js rename to node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/index.js index bad70bef3..ec178056a 100644 --- a/node_modules/@azure/abort-controller/dist-esm/src/index.js +++ b/node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/index.js @@ -1,4 +1,4 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export { AbortError } from "./AbortError"; +export { LroEngine } from "./lroEngine.js"; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/lroEngine.js b/node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/lroEngine.js similarity index 82% rename from node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/lroEngine.js rename to node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/lroEngine.js index 50a614908..351691a7b 100644 --- a/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/lroEngine.js +++ b/node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/lroEngine.js @@ -1,13 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { GenericPollOperation } from "./operation"; -import { POLL_INTERVAL_IN_MS } from "../../poller/constants"; -import { Poller } from "../poller"; -import { deserializeState } from "../../poller/operation"; +import { GenericPollOperation } from "./operation.js"; +import { POLL_INTERVAL_IN_MS } from "../../poller/constants.js"; +import { Poller } from "../poller.js"; +import { deserializeState } from "../../poller/operation.js"; /** * The LRO Engine, a class that performs polling. */ export class LroEngine extends Poller { + config; constructor(lro, options) { const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {}; const state = resumeFrom diff --git a/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/models.js b/node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/models.js similarity index 100% rename from node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/models.js rename to node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/models.js diff --git a/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/operation.js b/node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/operation.js similarity index 81% rename from node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/operation.js rename to node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/operation.js index 8c95e9518..4051ad80d 100644 --- a/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/operation.js +++ b/node_modules/@azure/core-lro/dist/browser/legacy/lroEngine/operation.js @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { initHttpOperation, pollHttpOperation } from "../../http/operation"; -import { logger } from "../../logger"; +import { initHttpOperation, pollHttpOperation } from "../../http/operation.js"; +import { logger } from "../../logger.js"; const createStateProxy = () => ({ initState: (config) => ({ config, isStarted: true }), setCanceled: (state) => (state.isCancelled = true), @@ -20,6 +20,14 @@ const createStateProxy = () => ({ isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error), }); export class GenericPollOperation { + state; + lro; + setErrorAsResult; + lroResourceLocationConfig; + processResult; + updateState; + isDone; + pollerConfig; constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) { this.state = state; this.lro = lro; @@ -33,16 +41,18 @@ export class GenericPollOperation { this.pollerConfig = pollerConfig; } async update(options) { - var _a; const stateProxy = createStateProxy(); if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), (await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult, - }))); + this.state = { + ...this.state, + ...(await initHttpOperation({ + lro: this.lro, + stateProxy, + resourceLocationConfig: this.lroResourceLocationConfig, + processResult: this.processResult, + setErrorAsResult: this.setErrorAsResult, + })), + }; } const updateState = this.updateState; const isDone = this.isDone; @@ -65,7 +75,7 @@ export class GenericPollOperation { setErrorAsResult: this.setErrorAsResult, }); } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + options?.fireProgress?.(this.state); return this; } async cancel() { diff --git a/node_modules/@azure/core-lro/dist-esm/src/legacy/models.js b/node_modules/@azure/core-lro/dist/browser/legacy/models.js similarity index 100% rename from node_modules/@azure/core-lro/dist-esm/src/legacy/models.js rename to node_modules/@azure/core-lro/dist/browser/legacy/models.js diff --git a/node_modules/@azure/core-lro/dist-esm/src/legacy/pollOperation.js b/node_modules/@azure/core-lro/dist/browser/legacy/pollOperation.js similarity index 100% rename from node_modules/@azure/core-lro/dist-esm/src/legacy/pollOperation.js rename to node_modules/@azure/core-lro/dist/browser/legacy/pollOperation.js diff --git a/node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js b/node_modules/@azure/core-lro/dist/browser/legacy/poller.js similarity index 97% rename from node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js rename to node_modules/@azure/core-lro/dist/browser/legacy/poller.js index 4335b2fb1..de6f912e6 100644 --- a/node_modules/@azure/core-lro/dist-esm/src/legacy/poller.js +++ b/node_modules/@azure/core-lro/dist/browser/legacy/poller.js @@ -85,6 +85,20 @@ export class PollerCancelledError extends Error { */ // eslint-disable-next-line no-use-before-define export class Poller { + /** controls whether to throw an error if the operation failed or was canceled. */ + resolveOnUnsuccessful = false; + stopped = true; + resolve; + reject; + pollOncePromise; + cancelPromise; + promise; + pollProgressCallbacks = []; + /** + * The poller's operation is available in full to any of the methods of the Poller class + * and any class extending the Poller class. + */ + operation; /** * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * @@ -151,10 +165,6 @@ export class Poller { * @param operation - Must contain the basic properties of `PollOperation`. */ constructor(operation) { - /** controls whether to throw an error if the operation failed or was canceled. */ - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; this.operation = operation; this.promise = new Promise((resolve, reject) => { this.resolve = resolve; diff --git a/node_modules/@azure/core-lro/dist-esm/src/logger.js b/node_modules/@azure/core-lro/dist/browser/logger.js similarity index 100% rename from node_modules/@azure/core-lro/dist-esm/src/logger.js rename to node_modules/@azure/core-lro/dist/browser/logger.js diff --git a/node_modules/@azure/core-lro/dist/browser/package.json b/node_modules/@azure/core-lro/dist/browser/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/browser/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-lro/dist-esm/src/poller/constants.js b/node_modules/@azure/core-lro/dist/browser/poller/constants.js similarity index 100% rename from node_modules/@azure/core-lro/dist-esm/src/poller/constants.js rename to node_modules/@azure/core-lro/dist/browser/poller/constants.js diff --git a/node_modules/@azure/core-lro/dist-esm/src/poller/models.js b/node_modules/@azure/core-lro/dist/browser/poller/models.js similarity index 100% rename from node_modules/@azure/core-lro/dist-esm/src/poller/models.js rename to node_modules/@azure/core-lro/dist/browser/poller/models.js diff --git a/node_modules/@azure/core-lro/dist-esm/src/poller/operation.js b/node_modules/@azure/core-lro/dist/browser/poller/operation.js similarity index 83% rename from node_modules/@azure/core-lro/dist-esm/src/poller/operation.js rename to node_modules/@azure/core-lro/dist/browser/poller/operation.js index 0a498815c..869eaa528 100644 --- a/node_modules/@azure/core-lro/dist-esm/src/poller/operation.js +++ b/node_modules/@azure/core-lro/dist/browser/poller/operation.js @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { logger } from "../logger"; -import { terminalStates } from "./constants"; +import { logger } from "../logger.js"; +import { terminalStates } from "./constants.js"; /** * Deserializes the state */ @@ -52,7 +52,7 @@ function processOperationStatus(result) { break; } case "failed": { - const err = getError === null || getError === void 0 ? void 0 : getError(response); + const err = getError?.(response); let postfix = ""; if (err) { const { code, message } = simplifyError(err); @@ -69,7 +69,7 @@ function processOperationStatus(result) { break; } } - if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) || + if (isDone?.(response, state) || (isDone === undefined && ["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status))) { stateProxy.setResult(state, buildResult({ @@ -90,7 +90,7 @@ export async function initOperation(inputs) { const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs; const { operationLocation, resourceLocation, metadata, response } = await init(); if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); + withOperationLocation?.(operationLocation, false); const config = { metadata, operationLocation, @@ -148,19 +148,19 @@ export async function pollOperation(inputs) { setErrorAsResult, }); if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); + const intervalInMs = getPollingInterval?.(response); if (intervalInMs) setDelay(intervalInMs); - const location = getOperationLocation === null || getOperationLocation === void 0 ? void 0 : getOperationLocation(response, state); + const location = getOperationLocation?.(response, state); if (location !== undefined) { const isUpdated = operationLocation !== location; state.config.operationLocation = location; - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(location, isUpdated); + withOperationLocation?.(location, isUpdated); } else - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); + withOperationLocation?.(operationLocation, false); } - updateState === null || updateState === void 0 ? void 0 : updateState(state, response); + updateState?.(state, response); } } //# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist-esm/src/poller/poller.js b/node_modules/@azure/core-lro/dist/browser/poller/poller.js similarity index 91% rename from node_modules/@azure/core-lro/dist-esm/src/poller/poller.js rename to node_modules/@azure/core-lro/dist/browser/poller/poller.js index cd7fa791b..5fc9b09df 100644 --- a/node_modules/@azure/core-lro/dist-esm/src/poller/poller.js +++ b/node_modules/@azure/core-lro/dist/browser/poller/poller.js @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { deserializeState, initOperation, pollOperation } from "./operation"; -import { POLL_INTERVAL_IN_MS } from "./constants"; +import { deserializeState, initOperation, pollOperation } from "./operation.js"; +import { POLL_INTERVAL_IN_MS } from "./constants.js"; import { delay } from "@azure/core-util"; const createStateProxy = () => ({ /** @@ -75,18 +75,18 @@ export function buildCreatePoller(inputs) { handlers.set(s, callback); return () => handlers.delete(s); }, - pollUntilDone: (pollOptions) => (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => { + pollUntilDone: (pollOptions) => (resultPromise ??= (async () => { const { abortSignal: inputAbortSignal } = pollOptions || {}; // In the future we can use AbortSignal.any() instead function abortListener() { abortController.abort(); } const abortSignal = abortController.signal; - if (inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.aborted) { + if (inputAbortSignal?.aborted) { abortController.abort(); } else if (!abortSignal.aborted) { - inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, { once: true }); + inputAbortSignal?.addEventListener("abort", abortListener, { once: true }); } try { if (!poller.isDone()) { @@ -98,7 +98,7 @@ export function buildCreatePoller(inputs) { } } finally { - inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.removeEventListener("abort", abortListener); + inputAbortSignal?.removeEventListener("abort", abortListener); } if (resolveOnUnsuccessful) { return poller.getResult(); @@ -118,7 +118,7 @@ export function buildCreatePoller(inputs) { } })().finally(() => { resultPromise = undefined; - }))), + })), async poll(pollOptions) { if (resolveOnUnsuccessful) { if (poller.isDone()) diff --git a/node_modules/@azure/core-lro/dist/commonjs/http/models.js b/node_modules/@azure/core-lro/dist/commonjs/http/models.js new file mode 100644 index 000000000..783931f30 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/http/models.js @@ -0,0 +1,5 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/http/operation.js b/node_modules/@azure/core-lro/dist/commonjs/http/operation.js new file mode 100644 index 000000000..c3fc6eddb --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/http/operation.js @@ -0,0 +1,293 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.pollHttpOperation = exports.isOperationError = exports.getResourceLocation = exports.getOperationStatus = exports.getOperationLocation = exports.initHttpOperation = exports.getStatusFromInitialResponse = exports.getErrorFromResponse = exports.parseRetryAfter = exports.inferLroMode = void 0; +const operation_js_1 = require("../poller/operation.js"); +const logger_js_1 = require("../logger.js"); +function getOperationLocationPollingUrl(inputs) { + const { azureAsyncOperation, operationLocation } = inputs; + return operationLocation ?? azureAsyncOperation; +} +function getLocationHeader(rawResponse) { + return rawResponse.headers["location"]; +} +function getOperationLocationHeader(rawResponse) { + return rawResponse.headers["operation-location"]; +} +function getAzureAsyncOperationHeader(rawResponse) { + return rawResponse.headers["azure-asyncoperation"]; +} +function findResourceLocation(inputs) { + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; + } + case "DELETE": { + return undefined; + } + case "PATCH": { + return getDefault() ?? requestPath; + } + default: { + return getDefault(); + } + } + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return undefined; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; + } + } + } +} +function inferLroMode(inputs) { + const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs; + const operationLocation = getOperationLocationHeader(rawResponse); + const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse); + const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation }); + const location = getLocationHeader(rawResponse); + const normalizedRequestMethod = requestMethod?.toLocaleUpperCase(); + if (pollingUrl !== undefined) { + return { + mode: "OperationLocation", + operationLocation: pollingUrl, + resourceLocation: findResourceLocation({ + requestMethod: normalizedRequestMethod, + location, + requestPath, + resourceLocationConfig, + }), + }; + } + else if (location !== undefined) { + return { + mode: "ResourceLocation", + operationLocation: location, + }; + } + else if (normalizedRequestMethod === "PUT" && requestPath) { + return { + mode: "Body", + operationLocation: requestPath, + }; + } + else { + return undefined; + } +} +exports.inferLroMode = inferLroMode; +function transformStatus(inputs) { + const { status, statusCode } = inputs; + if (typeof status !== "string" && status !== undefined) { + throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`); + } + switch (status?.toLocaleLowerCase()) { + case undefined: + return toOperationStatus(statusCode); + case "succeeded": + return "succeeded"; + case "failed": + return "failed"; + case "running": + case "accepted": + case "started": + case "canceling": + case "cancelling": + return "running"; + case "canceled": + case "cancelled": + return "canceled"; + default: { + logger_js_1.logger.verbose(`LRO: unrecognized operation status: ${status}`); + return status; + } + } +} +function getStatus(rawResponse) { + const { status } = rawResponse.body ?? {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); +} +function getProvisioningState(rawResponse) { + const { properties, provisioningState } = rawResponse.body ?? {}; + const status = properties?.provisioningState ?? provisioningState; + return transformStatus({ status, statusCode: rawResponse.statusCode }); +} +function toOperationStatus(statusCode) { + if (statusCode === 202) { + return "running"; + } + else if (statusCode < 300) { + return "succeeded"; + } + else { + return "failed"; + } +} +function parseRetryAfter({ rawResponse }) { + const retryAfter = rawResponse.headers["retry-after"]; + if (retryAfter !== undefined) { + // Retry-After header value is either in HTTP date format, or in seconds + const retryAfterInSeconds = parseInt(retryAfter); + return isNaN(retryAfterInSeconds) + ? calculatePollingIntervalFromDate(new Date(retryAfter)) + : retryAfterInSeconds * 1000; + } + return undefined; +} +exports.parseRetryAfter = parseRetryAfter; +function getErrorFromResponse(response) { + const error = accessBodyProperty(response, "error"); + if (!error) { + logger_js_1.logger.warning(`The long-running operation failed but there is no error property in the response's body`); + return; + } + if (!error.code || !error.message) { + logger_js_1.logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); + return; + } + return error; +} +exports.getErrorFromResponse = getErrorFromResponse; +function calculatePollingIntervalFromDate(retryAfterDate) { + const timeNow = Math.floor(new Date().getTime()); + const retryAfterTime = retryAfterDate.getTime(); + if (timeNow < retryAfterTime) { + return retryAfterTime - timeNow; + } + return undefined; +} +function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { + const mode = state.config.metadata?.["mode"]; + switch (mode) { + case undefined: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; + } + } + const status = helper(); + return status === "running" && operationLocation === undefined ? "succeeded" : status; +} +exports.getStatusFromInitialResponse = getStatusFromInitialResponse; +/** + * Initiates the long-running operation. + */ +async function initHttpOperation(inputs) { + const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; + return (0, operation_js_1.initOperation)({ + init: async () => { + const response = await lro.sendInitialRequest(); + const config = inferLroMode({ + rawResponse: response.rawResponse, + requestPath: lro.requestPath, + requestMethod: lro.requestMethod, + resourceLocationConfig, + }); + return { + response, + operationLocation: config?.operationLocation, + resourceLocation: config?.resourceLocation, + ...(config?.mode ? { metadata: { mode: config.mode } } : {}), + }; + }, + stateProxy, + processResult: processResult + ? ({ flatResponse }, state) => processResult(flatResponse, state) + : ({ flatResponse }) => flatResponse, + getOperationStatus: getStatusFromInitialResponse, + setErrorAsResult, + }); +} +exports.initHttpOperation = initHttpOperation; +function getOperationLocation({ rawResponse }, state) { + const mode = state.config.metadata?.["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse), + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return undefined; + } + } +} +exports.getOperationLocation = getOperationLocation; +function getOperationStatus({ rawResponse }, state) { + const mode = state.config.metadata?.["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); + } + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); + } + case "Body": { + return getProvisioningState(rawResponse); + } + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + } +} +exports.getOperationStatus = getOperationStatus; +function accessBodyProperty({ flatResponse, rawResponse }, prop) { + return flatResponse?.[prop] ?? rawResponse.body?.[prop]; +} +function getResourceLocation(res, state) { + const loc = accessBodyProperty(res, "resourceLocation"); + if (loc && typeof loc === "string") { + state.config.resourceLocation = loc; + } + return state.config.resourceLocation; +} +exports.getResourceLocation = getResourceLocation; +function isOperationError(e) { + return e.name === "RestError"; +} +exports.isOperationError = isOperationError; +/** Polls the long-running operation. */ +async function pollHttpOperation(inputs) { + const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs; + return (0, operation_js_1.pollOperation)({ + state, + stateProxy, + setDelay, + processResult: processResult + ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState) + : ({ flatResponse }) => flatResponse, + getError: getErrorFromResponse, + updateState, + getPollingInterval: parseRetryAfter, + getOperationLocation, + getOperationStatus, + isOperationError, + getResourceLocation, + options, + /** + * The expansion here is intentional because `lro` could be an object that + * references an inner this, so we need to preserve a reference to it. + */ + poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), + setErrorAsResult, + }); +} +exports.pollHttpOperation = pollHttpOperation; +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/http/poller.js b/node_modules/@azure/core-lro/dist/commonjs/http/poller.js new file mode 100644 index 000000000..52d6606cb --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/http/poller.js @@ -0,0 +1,53 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createHttpPoller = void 0; +const operation_js_1 = require("./operation.js"); +const poller_js_1 = require("../poller/poller.js"); +/** + * Creates a poller that can be used to poll a long-running operation. + * @param lro - Description of the long-running operation + * @param options - options to configure the poller + * @returns an initialized poller + */ +async function createHttpPoller(lro, options) { + const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false, } = options || {}; + return (0, poller_js_1.buildCreatePoller)({ + getStatusFromInitialResponse: operation_js_1.getStatusFromInitialResponse, + getStatusFromPollResponse: operation_js_1.getOperationStatus, + isOperationError: operation_js_1.isOperationError, + getOperationLocation: operation_js_1.getOperationLocation, + getResourceLocation: operation_js_1.getResourceLocation, + getPollingInterval: operation_js_1.parseRetryAfter, + getError: operation_js_1.getErrorFromResponse, + resolveOnUnsuccessful, + })({ + init: async () => { + const response = await lro.sendInitialRequest(); + const config = (0, operation_js_1.inferLroMode)({ + rawResponse: response.rawResponse, + requestPath: lro.requestPath, + requestMethod: lro.requestMethod, + resourceLocationConfig, + }); + return { + response, + operationLocation: config?.operationLocation, + resourceLocation: config?.resourceLocation, + ...(config?.mode ? { metadata: { mode: config.mode } } : {}), + }; + }, + poll: lro.sendPollRequest, + }, { + intervalInMs, + withOperationLocation, + restoreFrom, + updateState, + processResult: processResult + ? ({ flatResponse }, state) => processResult(flatResponse, state) + : ({ flatResponse }) => flatResponse, + }); +} +exports.createHttpPoller = createHttpPoller; +//# sourceMappingURL=poller.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/index.js b/node_modules/@azure/core-lro/dist/commonjs/index.js new file mode 100644 index 000000000..ec5cd5302 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/index.js @@ -0,0 +1,24 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createHttpPoller = void 0; +const tslib_1 = require("tslib"); +var poller_js_1 = require("./http/poller.js"); +Object.defineProperty(exports, "createHttpPoller", { enumerable: true, get: function () { return poller_js_1.createHttpPoller; } }); +/** + * This can be uncommented to expose the protocol-agnostic poller + */ +// export { +// BuildCreatePollerOptions, +// Operation, +// CreatePollerOptions, +// OperationConfig, +// RestorableOperationState, +// } from "./poller/models"; +// export { buildCreatePoller } from "./poller/poller"; +/** legacy */ +tslib_1.__exportStar(require("./legacy/lroEngine/index.js"), exports); +tslib_1.__exportStar(require("./legacy/poller.js"), exports); +tslib_1.__exportStar(require("./legacy/pollOperation.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/index.js b/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/index.js new file mode 100644 index 000000000..a9e007993 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/index.js @@ -0,0 +1,8 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LroEngine = void 0; +var lroEngine_js_1 = require("./lroEngine.js"); +Object.defineProperty(exports, "LroEngine", { enumerable: true, get: function () { return lroEngine_js_1.LroEngine; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/lroEngine.js b/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/lroEngine.js new file mode 100644 index 000000000..ed5cd5709 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/lroEngine.js @@ -0,0 +1,34 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LroEngine = void 0; +const operation_js_1 = require("./operation.js"); +const constants_js_1 = require("../../poller/constants.js"); +const poller_js_1 = require("../poller.js"); +const operation_js_2 = require("../../poller/operation.js"); +/** + * The LRO Engine, a class that performs polling. + */ +class LroEngine extends poller_js_1.Poller { + config; + constructor(lro, options) { + const { intervalInMs = constants_js_1.POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {}; + const state = resumeFrom + ? (0, operation_js_2.deserializeState)(resumeFrom) + : {}; + const operation = new operation_js_1.GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); + super(operation); + this.resolveOnUnsuccessful = resolveOnUnsuccessful; + this.config = { intervalInMs: intervalInMs }; + operation.setPollerConfig(this.config); + } + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs)); + } +} +exports.LroEngine = LroEngine; +//# sourceMappingURL=lroEngine.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/models.js b/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/models.js new file mode 100644 index 000000000..783931f30 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/models.js @@ -0,0 +1,5 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/operation.js b/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/operation.js new file mode 100644 index 000000000..16b75c76c --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/legacy/lroEngine/operation.js @@ -0,0 +1,98 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GenericPollOperation = void 0; +const operation_js_1 = require("../../http/operation.js"); +const logger_js_1 = require("../../logger.js"); +const createStateProxy = () => ({ + initState: (config) => ({ config, isStarted: true }), + setCanceled: (state) => (state.isCancelled = true), + setError: (state, error) => (state.error = error), + setResult: (state, result) => (state.result = result), + setRunning: (state) => (state.isStarted = true), + setSucceeded: (state) => (state.isCompleted = true), + setFailed: () => { + /** empty body */ + }, + getError: (state) => state.error, + getResult: (state) => state.result, + isCanceled: (state) => !!state.isCancelled, + isFailed: (state) => !!state.error, + isRunning: (state) => !!state.isStarted, + isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error), +}); +class GenericPollOperation { + state; + lro; + setErrorAsResult; + lroResourceLocationConfig; + processResult; + updateState; + isDone; + pollerConfig; + constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) { + this.state = state; + this.lro = lro; + this.setErrorAsResult = setErrorAsResult; + this.lroResourceLocationConfig = lroResourceLocationConfig; + this.processResult = processResult; + this.updateState = updateState; + this.isDone = isDone; + } + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; + } + async update(options) { + const stateProxy = createStateProxy(); + if (!this.state.isStarted) { + this.state = { + ...this.state, + ...(await (0, operation_js_1.initHttpOperation)({ + lro: this.lro, + stateProxy, + resourceLocationConfig: this.lroResourceLocationConfig, + processResult: this.processResult, + setErrorAsResult: this.setErrorAsResult, + })), + }; + } + const updateState = this.updateState; + const isDone = this.isDone; + if (!this.state.isCompleted && this.state.error === undefined) { + await (0, operation_js_1.pollHttpOperation)({ + lro: this.lro, + state: this.state, + stateProxy, + processResult: this.processResult, + updateState: updateState + ? (state, { rawResponse }) => updateState(state, rawResponse) + : undefined, + isDone: isDone + ? ({ flatResponse }, state) => isDone(flatResponse, state) + : undefined, + options, + setDelay: (intervalInMs) => { + this.pollerConfig.intervalInMs = intervalInMs; + }, + setErrorAsResult: this.setErrorAsResult, + }); + } + options?.fireProgress?.(this.state); + return this; + } + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; + } + /** + * Serializes the Poller operation. + */ + toString() { + return JSON.stringify({ + state: this.state, + }); + } +} +exports.GenericPollOperation = GenericPollOperation; +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/legacy/models.js b/node_modules/@azure/core-lro/dist/commonjs/legacy/models.js new file mode 100644 index 000000000..783931f30 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/legacy/models.js @@ -0,0 +1,5 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/legacy/pollOperation.js b/node_modules/@azure/core-lro/dist/commonjs/legacy/pollOperation.js new file mode 100644 index 000000000..c082a05b4 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/legacy/pollOperation.js @@ -0,0 +1,5 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=pollOperation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/legacy/poller.js b/node_modules/@azure/core-lro/dist/commonjs/legacy/poller.js new file mode 100644 index 000000000..1e27a020e --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/legacy/poller.js @@ -0,0 +1,413 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Poller = exports.PollerCancelledError = exports.PollerStoppedError = void 0; +/** + * When a poller is manually stopped through the `stopPolling` method, + * the poller will be rejected with an instance of the PollerStoppedError. + */ +class PollerStoppedError extends Error { + constructor(message) { + super(message); + this.name = "PollerStoppedError"; + Object.setPrototypeOf(this, PollerStoppedError.prototype); + } +} +exports.PollerStoppedError = PollerStoppedError; +/** + * When the operation is cancelled, the poller will be rejected with an instance + * of the PollerCancelledError. + */ +class PollerCancelledError extends Error { + constructor(message) { + super(message); + this.name = "PollerCancelledError"; + Object.setPrototypeOf(this, PollerCancelledError.prototype); + } +} +exports.PollerCancelledError = PollerCancelledError; +/** + * A class that represents the definition of a program that polls through consecutive requests + * until it reaches a state of completion. + * + * A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed. + * It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes. + * Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation. + * + * ```ts + * const poller = new MyPoller(); + * + * // Polling just once: + * await poller.poll(); + * + * // We can try to cancel the request here, by calling: + * // + * // await poller.cancelOperation(); + * // + * + * // Getting the final result: + * const result = await poller.pollUntilDone(); + * ``` + * + * The Poller is defined by two types, a type representing the state of the poller, which + * must include a basic set of properties from `PollOperationState`, + * and a return type defined by `TResult`, which can be anything. + * + * The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having + * to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type. + * + * ```ts + * class Client { + * public async makePoller: PollerLike { + * const poller = new MyPoller({}); + * // It might be preferred to return the poller after the first request is made, + * // so that some information can be obtained right away. + * await poller.poll(); + * return poller; + * } + * } + * + * const poller: PollerLike = myClient.makePoller(); + * ``` + * + * A poller can be created through its constructor, then it can be polled until it's completed. + * At any point in time, the state of the poller can be obtained without delay through the getOperationState method. + * At any point in time, the intermediate forms of the result type can be requested without delay. + * Once the underlying operation is marked as completed, the poller will stop and the final value will be returned. + * + * ```ts + * const poller = myClient.makePoller(); + * const state: MyOperationState = poller.getOperationState(); + * + * // The intermediate result can be obtained at any time. + * const result: MyResult | undefined = poller.getResult(); + * + * // The final result can only be obtained after the poller finishes. + * const result: MyResult = await poller.pollUntilDone(); + * ``` + * + */ +// eslint-disable-next-line no-use-before-define +class Poller { + /** controls whether to throw an error if the operation failed or was canceled. */ + resolveOnUnsuccessful = false; + stopped = true; + resolve; + reject; + pollOncePromise; + cancelPromise; + promise; + pollProgressCallbacks = []; + /** + * The poller's operation is available in full to any of the methods of the Poller class + * and any class extending the Poller class. + */ + operation; + /** + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. + * + * When writing an implementation of a Poller, this implementation needs to deal with the initialization + * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's + * operation has already been defined, at least its basic properties. The code below shows how to approach + * the definition of the constructor of a new custom poller. + * + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; + * + * const operation = { + * state, + * update, + * cancel, + * toString + * } + * + * // Sending the operation to the parent's constructor. + * super(operation); + * + * // You can assign more local properties here. + * } + * } + * ``` + * + * Inside of this constructor, a new promise is created. This will be used to + * tell the user when the poller finishes (see `pollUntilDone()`). The promise's + * resolve and reject methods are also used internally to control when to resolve + * or reject anyone waiting for the poller to finish. + * + * The constructor of a custom implementation of a poller is where any serialized version of + * a previous poller's operation should be deserialized into the operation sent to the + * base constructor. For example: + * + * ```ts + * export class MyPoller extends Poller { + * constructor( + * baseOperation: string | undefined + * ) { + * let state: MyOperationState = {}; + * if (baseOperation) { + * state = { + * ...JSON.parse(baseOperation).state, + * ...state + * }; + * } + * const operation = { + * state, + * // ... + * } + * super(operation); + * } + * } + * ``` + * + * @param operation - Must contain the basic properties of `PollOperation`. + */ + constructor(operation) { + this.operation = operation; + this.promise = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + // This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown. + // The above warning would get thrown if `poller.poll` is called, it returns an error, + // and pullUntilDone did not have a .catch or await try/catch on it's return value. + this.promise.catch(() => { + /* intentionally blank */ + }); + } + /** + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. + */ + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } + } + /** + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * @param options - Optional properties passed to the operation's update method. + */ + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this), + }); + } + this.processUpdatedState(); + } + /** + * fireProgress calls the functions passed in via onProgress the method of the poller. + * + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. + * + * @param state - The current operation state. + */ + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } + } + /** + * Invokes the underlying operation's cancel method. + */ + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); + } + /** + * Returns a promise that will resolve once a single polling request finishes. + * It does this by calling the update method of the Poller's operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * @param options - Optional properties passed to the operation's update method. + */ + poll(options = {}) { + if (!this.pollOncePromise) { + this.pollOncePromise = this.pollOnce(options); + const clearPollOncePromise = () => { + this.pollOncePromise = undefined; + }; + this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject); + } + return this.pollOncePromise; + } + processUpdatedState() { + if (this.operation.state.error) { + this.stopped = true; + if (!this.resolveOnUnsuccessful) { + this.reject(this.operation.state.error); + throw this.operation.state.error; + } + } + if (this.operation.state.isCancelled) { + this.stopped = true; + if (!this.resolveOnUnsuccessful) { + const error = new PollerCancelledError("Operation was canceled"); + this.reject(error); + throw error; + } + } + if (this.isDone() && this.resolve) { + // If the poller has finished polling, this means we now have a result. + // However, it can be the case that TResult is instantiated to void, so + // we are not expecting a result anyway. To assert that we might not + // have a result eventually after finishing polling, we cast the result + // to TResult. + this.resolve(this.getResult()); + } + } + /** + * Returns a promise that will resolve once the underlying operation is completed. + */ + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + // This is needed because the state could have been updated by + // `cancelOperation`, e.g. the operation is canceled or an error occurred. + this.processUpdatedState(); + return this.promise; + } + /** + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. + * + * It returns a method that can be used to stop receiving updates on the given callback function. + */ + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; + } + /** + * Returns true if the poller has finished polling. + */ + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); + } + /** + * Stops the poller from continuing to poll. + */ + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } + } + /** + * Returns true if the poller is stopped. + */ + isStopped() { + return this.stopped; + } + /** + * Attempts to cancel the underlying operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * If it's called again before it finishes, it will throw an error. + * + * @param options - Optional properties passed to the operation's update method. + */ + cancelOperation(options = {}) { + if (!this.cancelPromise) { + this.cancelPromise = this.cancelOnce(options); + } + else if (options.abortSignal) { + throw new Error("A cancel request is currently pending"); + } + return this.cancelPromise; + } + /** + * Returns the state of the operation. + * + * Even though TState will be the same type inside any of the methods of any extension of the Poller class, + * implementations of the pollers can customize what's shared with the public by writing their own + * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller + * and a public type representing a safe to share subset of the properties of the internal state. + * Their definition of getOperationState can then return their public type. + * + * Example: + * + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } + * + * // To allow us to have a true separation of public and private state, we have to define another interface: + * interface PublicState extends PollOperationState { + * publicProperty?: string; + * } + * + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... + * + * public getOperationState(): PublicState { + * const state: PublicState = this.operation.state; + * return { + * // Properties from PollOperationState + * isStarted: state.isStarted, + * isCompleted: state.isCompleted, + * isCancelled: state.isCancelled, + * error: state.error, + * result: state.result, + * + * // The only other property needed by PublicState. + * publicProperty: state.publicProperty + * } + * } + * } + * ``` + * + * You can see this in the tests of this repository, go to the file: + * `../test/utils/testPoller.ts` + * and look for the getOperationState implementation. + */ + getOperationState() { + return this.operation.state; + } + /** + * Returns the result value of the operation, + * regardless of the state of the poller. + * It can return undefined or an incomplete form of the final TResult value + * depending on the implementation. + */ + getResult() { + const state = this.operation.state; + return state.result; + } + /** + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. + */ + toString() { + return this.operation.toString(); + } +} +exports.Poller = Poller; +//# sourceMappingURL=poller.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/logger.js b/node_modules/@azure/core-lro/dist/commonjs/logger.js new file mode 100644 index 000000000..3564ffa2e --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/logger.js @@ -0,0 +1,12 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.logger = void 0; +const logger_1 = require("@azure/logger"); +/** + * The `@azure/logger` configuration for this package. + * @internal + */ +exports.logger = (0, logger_1.createClientLogger)("core-lro"); +//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/package.json b/node_modules/@azure/core-lro/dist/commonjs/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/@azure/core-lro/dist/commonjs/poller/constants.js b/node_modules/@azure/core-lro/dist/commonjs/poller/constants.js new file mode 100644 index 000000000..c4698424e --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/poller/constants.js @@ -0,0 +1,14 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.terminalStates = exports.POLL_INTERVAL_IN_MS = void 0; +/** + * The default time interval to wait before sending the next polling request. + */ +exports.POLL_INTERVAL_IN_MS = 2000; +/** + * The closed set of terminal states. + */ +exports.terminalStates = ["succeeded", "canceled", "failed"]; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/poller/models.js b/node_modules/@azure/core-lro/dist/commonjs/poller/models.js new file mode 100644 index 000000000..783931f30 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/poller/models.js @@ -0,0 +1,5 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/poller/operation.js b/node_modules/@azure/core-lro/dist/commonjs/poller/operation.js new file mode 100644 index 000000000..d050c61e0 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/poller/operation.js @@ -0,0 +1,172 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.pollOperation = exports.initOperation = exports.deserializeState = void 0; +const logger_js_1 = require("../logger.js"); +const constants_js_1 = require("./constants.js"); +/** + * Deserializes the state + */ +function deserializeState(serializedState) { + try { + return JSON.parse(serializedState).state; + } + catch (e) { + throw new Error(`Unable to deserialize input state: ${serializedState}`); + } +} +exports.deserializeState = deserializeState; +function setStateError(inputs) { + const { state, stateProxy, isOperationError } = inputs; + return (error) => { + if (isOperationError(error)) { + stateProxy.setError(state, error); + stateProxy.setFailed(state); + } + throw error; + }; +} +function appendReadableErrorMessage(currentMessage, innerMessage) { + let message = currentMessage; + if (message.slice(-1) !== ".") { + message = message + "."; + } + return message + " " + innerMessage; +} +function simplifyError(err) { + let message = err.message; + let code = err.code; + let curErr = err; + while (curErr.innererror) { + curErr = curErr.innererror; + code = curErr.code; + message = appendReadableErrorMessage(message, curErr.message); + } + return { + code, + message, + }; +} +function processOperationStatus(result) { + const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; + switch (status) { + case "succeeded": { + stateProxy.setSucceeded(state); + break; + } + case "failed": { + const err = getError?.(response); + let postfix = ""; + if (err) { + const { code, message } = simplifyError(err); + postfix = `. ${code}. ${message}`; + } + const errStr = `The long-running operation has failed${postfix}`; + stateProxy.setError(state, new Error(errStr)); + stateProxy.setFailed(state); + logger_js_1.logger.warning(errStr); + break; + } + case "canceled": { + stateProxy.setCanceled(state); + break; + } + } + if (isDone?.(response, state) || + (isDone === undefined && + ["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status))) { + stateProxy.setResult(state, buildResult({ + response, + state, + processResult, + })); + } +} +function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; +} +/** + * Initiates the long-running operation. + */ +async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + if (operationLocation) + withOperationLocation?.(operationLocation, false); + const config = { + metadata, + operationLocation, + resourceLocation, + }; + logger_js_1.logger.verbose(`LRO: Operation description:`, config); + const state = stateProxy.initState(config); + const status = getOperationStatus({ response, state, operationLocation }); + processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); + return state; +} +exports.initOperation = initOperation; +async function pollOperationHelper(inputs) { + const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options, } = inputs; + const response = await poll(operationLocation, options).catch(setStateError({ + state, + stateProxy, + isOperationError, + })); + const status = getOperationStatus(response, state); + logger_js_1.logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${constants_js_1.terminalStates.includes(status) ? "Stopped" : "Running"}`); + if (status === "succeeded") { + const resourceLocation = getResourceLocation(response, state); + if (resourceLocation !== undefined) { + return { + response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })), + status, + }; + } + } + return { response, status }; +} +/** Polls the long-running operation. */ +async function pollOperation(inputs) { + const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs; + const { operationLocation } = state.config; + if (operationLocation !== undefined) { + const { response, status } = await pollOperationHelper({ + poll, + getOperationStatus, + state, + stateProxy, + operationLocation, + getResourceLocation, + isOperationError, + options, + }); + processOperationStatus({ + status, + response, + state, + stateProxy, + isDone, + processResult, + getError, + setErrorAsResult, + }); + if (!constants_js_1.terminalStates.includes(status)) { + const intervalInMs = getPollingInterval?.(response); + if (intervalInMs) + setDelay(intervalInMs); + const location = getOperationLocation?.(response, state); + if (location !== undefined) { + const isUpdated = operationLocation !== location; + state.config.operationLocation = location; + withOperationLocation?.(location, isUpdated); + } + else + withOperationLocation?.(operationLocation, false); + } + updateState?.(state, response); + } +} +exports.pollOperation = pollOperation; +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/poller/poller.js b/node_modules/@azure/core-lro/dist/commonjs/poller/poller.js new file mode 100644 index 000000000..8df8b88e5 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/poller/poller.js @@ -0,0 +1,174 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.buildCreatePoller = void 0; +const operation_js_1 = require("./operation.js"); +const constants_js_1 = require("./constants.js"); +const core_util_1 = require("@azure/core-util"); +const createStateProxy = () => ({ + /** + * The state at this point is created to be of type OperationState. + * It will be updated later to be of type TState when the + * customer-provided callback, `updateState`, is called during polling. + */ + initState: (config) => ({ status: "running", config }), + setCanceled: (state) => (state.status = "canceled"), + setError: (state, error) => (state.error = error), + setResult: (state, result) => (state.result = result), + setRunning: (state) => (state.status = "running"), + setSucceeded: (state) => (state.status = "succeeded"), + setFailed: (state) => (state.status = "failed"), + getError: (state) => state.error, + getResult: (state) => state.result, + isCanceled: (state) => state.status === "canceled", + isFailed: (state) => state.status === "failed", + isRunning: (state) => state.status === "running", + isSucceeded: (state) => state.status === "succeeded", +}); +/** + * Returns a poller factory. + */ +function buildCreatePoller(inputs) { + const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs; + return async ({ init, poll }, options) => { + const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = constants_js_1.POLL_INTERVAL_IN_MS, restoreFrom, } = options || {}; + const stateProxy = createStateProxy(); + const withOperationLocation = withOperationLocationCallback + ? (() => { + let called = false; + return (operationLocation, isUpdated) => { + if (isUpdated) + withOperationLocationCallback(operationLocation); + else if (!called) + withOperationLocationCallback(operationLocation); + called = true; + }; + })() + : undefined; + const state = restoreFrom + ? (0, operation_js_1.deserializeState)(restoreFrom) + : await (0, operation_js_1.initOperation)({ + init, + stateProxy, + processResult, + getOperationStatus: getStatusFromInitialResponse, + withOperationLocation, + setErrorAsResult: !resolveOnUnsuccessful, + }); + let resultPromise; + const abortController = new AbortController(); + const handlers = new Map(); + const handleProgressEvents = async () => handlers.forEach((h) => h(state)); + const cancelErrMsg = "Operation was canceled"; + let currentPollIntervalInMs = intervalInMs; + const poller = { + getOperationState: () => state, + getResult: () => state.result, + isDone: () => ["succeeded", "failed", "canceled"].includes(state.status), + isStopped: () => resultPromise === undefined, + stopPolling: () => { + abortController.abort(); + }, + toString: () => JSON.stringify({ + state, + }), + onProgress: (callback) => { + const s = Symbol(); + handlers.set(s, callback); + return () => handlers.delete(s); + }, + pollUntilDone: (pollOptions) => (resultPromise ??= (async () => { + const { abortSignal: inputAbortSignal } = pollOptions || {}; + // In the future we can use AbortSignal.any() instead + function abortListener() { + abortController.abort(); + } + const abortSignal = abortController.signal; + if (inputAbortSignal?.aborted) { + abortController.abort(); + } + else if (!abortSignal.aborted) { + inputAbortSignal?.addEventListener("abort", abortListener, { once: true }); + } + try { + if (!poller.isDone()) { + await poller.poll({ abortSignal }); + while (!poller.isDone()) { + await (0, core_util_1.delay)(currentPollIntervalInMs, { abortSignal }); + await poller.poll({ abortSignal }); + } + } + } + finally { + inputAbortSignal?.removeEventListener("abort", abortListener); + } + if (resolveOnUnsuccessful) { + return poller.getResult(); + } + else { + switch (state.status) { + case "succeeded": + return poller.getResult(); + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + case "notStarted": + case "running": + throw new Error(`Polling completed without succeeding or failing`); + } + } + })().finally(() => { + resultPromise = undefined; + })), + async poll(pollOptions) { + if (resolveOnUnsuccessful) { + if (poller.isDone()) + return; + } + else { + switch (state.status) { + case "succeeded": + return; + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + } + } + await (0, operation_js_1.pollOperation)({ + poll, + state, + stateProxy, + getOperationLocation, + isOperationError, + withOperationLocation, + getPollingInterval, + getOperationStatus: getStatusFromPollResponse, + getResourceLocation, + processResult, + getError, + updateState, + options: pollOptions, + setDelay: (pollIntervalInMs) => { + currentPollIntervalInMs = pollIntervalInMs; + }, + setErrorAsResult: !resolveOnUnsuccessful, + }); + await handleProgressEvents(); + if (!resolveOnUnsuccessful) { + switch (state.status) { + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + } + } + }, + }; + return poller; + }; +} +exports.buildCreatePoller = buildCreatePoller; +//# sourceMappingURL=poller.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/commonjs/tsdoc-metadata.json b/node_modules/@azure/core-lro/dist/commonjs/tsdoc-metadata.json new file mode 100644 index 000000000..22735db17 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/commonjs/tsdoc-metadata.json @@ -0,0 +1,11 @@ +// This file is read by tools that parse documentation comments conforming to the TSDoc standard. +// It should be published with your NPM package. It should not be tracked by Git. +{ + "tsdocVersion": "0.12", + "toolPackages": [ + { + "packageName": "@microsoft/api-extractor", + "packageVersion": "7.42.3" + } + ] +} diff --git a/node_modules/@azure/core-paging/dist-esm/src/models.js b/node_modules/@azure/core-lro/dist/esm/http/models.js similarity index 100% rename from node_modules/@azure/core-paging/dist-esm/src/models.js rename to node_modules/@azure/core-lro/dist/esm/http/models.js diff --git a/node_modules/@azure/core-lro/dist/esm/http/operation.js b/node_modules/@azure/core-lro/dist/esm/http/operation.js new file mode 100644 index 000000000..038384478 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/http/operation.js @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { initOperation, pollOperation } from "../poller/operation.js"; +import { logger } from "../logger.js"; +function getOperationLocationPollingUrl(inputs) { + const { azureAsyncOperation, operationLocation } = inputs; + return operationLocation ?? azureAsyncOperation; +} +function getLocationHeader(rawResponse) { + return rawResponse.headers["location"]; +} +function getOperationLocationHeader(rawResponse) { + return rawResponse.headers["operation-location"]; +} +function getAzureAsyncOperationHeader(rawResponse) { + return rawResponse.headers["azure-asyncoperation"]; +} +function findResourceLocation(inputs) { + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; + } + case "DELETE": { + return undefined; + } + case "PATCH": { + return getDefault() ?? requestPath; + } + default: { + return getDefault(); + } + } + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return undefined; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; + } + } + } +} +export function inferLroMode(inputs) { + const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs; + const operationLocation = getOperationLocationHeader(rawResponse); + const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse); + const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation }); + const location = getLocationHeader(rawResponse); + const normalizedRequestMethod = requestMethod?.toLocaleUpperCase(); + if (pollingUrl !== undefined) { + return { + mode: "OperationLocation", + operationLocation: pollingUrl, + resourceLocation: findResourceLocation({ + requestMethod: normalizedRequestMethod, + location, + requestPath, + resourceLocationConfig, + }), + }; + } + else if (location !== undefined) { + return { + mode: "ResourceLocation", + operationLocation: location, + }; + } + else if (normalizedRequestMethod === "PUT" && requestPath) { + return { + mode: "Body", + operationLocation: requestPath, + }; + } + else { + return undefined; + } +} +function transformStatus(inputs) { + const { status, statusCode } = inputs; + if (typeof status !== "string" && status !== undefined) { + throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`); + } + switch (status?.toLocaleLowerCase()) { + case undefined: + return toOperationStatus(statusCode); + case "succeeded": + return "succeeded"; + case "failed": + return "failed"; + case "running": + case "accepted": + case "started": + case "canceling": + case "cancelling": + return "running"; + case "canceled": + case "cancelled": + return "canceled"; + default: { + logger.verbose(`LRO: unrecognized operation status: ${status}`); + return status; + } + } +} +function getStatus(rawResponse) { + const { status } = rawResponse.body ?? {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); +} +function getProvisioningState(rawResponse) { + const { properties, provisioningState } = rawResponse.body ?? {}; + const status = properties?.provisioningState ?? provisioningState; + return transformStatus({ status, statusCode: rawResponse.statusCode }); +} +function toOperationStatus(statusCode) { + if (statusCode === 202) { + return "running"; + } + else if (statusCode < 300) { + return "succeeded"; + } + else { + return "failed"; + } +} +export function parseRetryAfter({ rawResponse }) { + const retryAfter = rawResponse.headers["retry-after"]; + if (retryAfter !== undefined) { + // Retry-After header value is either in HTTP date format, or in seconds + const retryAfterInSeconds = parseInt(retryAfter); + return isNaN(retryAfterInSeconds) + ? calculatePollingIntervalFromDate(new Date(retryAfter)) + : retryAfterInSeconds * 1000; + } + return undefined; +} +export function getErrorFromResponse(response) { + const error = accessBodyProperty(response, "error"); + if (!error) { + logger.warning(`The long-running operation failed but there is no error property in the response's body`); + return; + } + if (!error.code || !error.message) { + logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); + return; + } + return error; +} +function calculatePollingIntervalFromDate(retryAfterDate) { + const timeNow = Math.floor(new Date().getTime()); + const retryAfterTime = retryAfterDate.getTime(); + if (timeNow < retryAfterTime) { + return retryAfterTime - timeNow; + } + return undefined; +} +export function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { + const mode = state.config.metadata?.["mode"]; + switch (mode) { + case undefined: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; + } + } + const status = helper(); + return status === "running" && operationLocation === undefined ? "succeeded" : status; +} +/** + * Initiates the long-running operation. + */ +export async function initHttpOperation(inputs) { + const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; + return initOperation({ + init: async () => { + const response = await lro.sendInitialRequest(); + const config = inferLroMode({ + rawResponse: response.rawResponse, + requestPath: lro.requestPath, + requestMethod: lro.requestMethod, + resourceLocationConfig, + }); + return { + response, + operationLocation: config?.operationLocation, + resourceLocation: config?.resourceLocation, + ...(config?.mode ? { metadata: { mode: config.mode } } : {}), + }; + }, + stateProxy, + processResult: processResult + ? ({ flatResponse }, state) => processResult(flatResponse, state) + : ({ flatResponse }) => flatResponse, + getOperationStatus: getStatusFromInitialResponse, + setErrorAsResult, + }); +} +export function getOperationLocation({ rawResponse }, state) { + const mode = state.config.metadata?.["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse), + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return undefined; + } + } +} +export function getOperationStatus({ rawResponse }, state) { + const mode = state.config.metadata?.["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); + } + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); + } + case "Body": { + return getProvisioningState(rawResponse); + } + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + } +} +function accessBodyProperty({ flatResponse, rawResponse }, prop) { + return flatResponse?.[prop] ?? rawResponse.body?.[prop]; +} +export function getResourceLocation(res, state) { + const loc = accessBodyProperty(res, "resourceLocation"); + if (loc && typeof loc === "string") { + state.config.resourceLocation = loc; + } + return state.config.resourceLocation; +} +export function isOperationError(e) { + return e.name === "RestError"; +} +/** Polls the long-running operation. */ +export async function pollHttpOperation(inputs) { + const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs; + return pollOperation({ + state, + stateProxy, + setDelay, + processResult: processResult + ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState) + : ({ flatResponse }) => flatResponse, + getError: getErrorFromResponse, + updateState, + getPollingInterval: parseRetryAfter, + getOperationLocation, + getOperationStatus, + isOperationError, + getResourceLocation, + options, + /** + * The expansion here is intentional because `lro` could be an object that + * references an inner this, so we need to preserve a reference to it. + */ + poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), + setErrorAsResult, + }); +} +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/http/poller.js b/node_modules/@azure/core-lro/dist/esm/http/poller.js new file mode 100644 index 000000000..84379fdd7 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/http/poller.js @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { getErrorFromResponse, getOperationLocation, getOperationStatus, getResourceLocation, getStatusFromInitialResponse, inferLroMode, isOperationError, parseRetryAfter, } from "./operation.js"; +import { buildCreatePoller } from "../poller/poller.js"; +/** + * Creates a poller that can be used to poll a long-running operation. + * @param lro - Description of the long-running operation + * @param options - options to configure the poller + * @returns an initialized poller + */ +export async function createHttpPoller(lro, options) { + const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false, } = options || {}; + return buildCreatePoller({ + getStatusFromInitialResponse, + getStatusFromPollResponse: getOperationStatus, + isOperationError, + getOperationLocation, + getResourceLocation, + getPollingInterval: parseRetryAfter, + getError: getErrorFromResponse, + resolveOnUnsuccessful, + })({ + init: async () => { + const response = await lro.sendInitialRequest(); + const config = inferLroMode({ + rawResponse: response.rawResponse, + requestPath: lro.requestPath, + requestMethod: lro.requestMethod, + resourceLocationConfig, + }); + return { + response, + operationLocation: config?.operationLocation, + resourceLocation: config?.resourceLocation, + ...(config?.mode ? { metadata: { mode: config.mode } } : {}), + }; + }, + poll: lro.sendPollRequest, + }, { + intervalInMs, + withOperationLocation, + restoreFrom, + updateState, + processResult: processResult + ? ({ flatResponse }, state) => processResult(flatResponse, state) + : ({ flatResponse }) => flatResponse, + }); +} +//# sourceMappingURL=poller.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/index.js b/node_modules/@azure/core-lro/dist/esm/index.js new file mode 100644 index 000000000..3952c2ad9 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/index.js @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { createHttpPoller } from "./http/poller.js"; +/** + * This can be uncommented to expose the protocol-agnostic poller + */ +// export { +// BuildCreatePollerOptions, +// Operation, +// CreatePollerOptions, +// OperationConfig, +// RestorableOperationState, +// } from "./poller/models"; +// export { buildCreatePoller } from "./poller/poller"; +/** legacy */ +export * from "./legacy/lroEngine/index.js"; +export * from "./legacy/poller.js"; +export * from "./legacy/pollOperation.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js b/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/index.js similarity index 71% rename from node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js rename to node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/index.js index 9a5cd7d1d..ec178056a 100644 --- a/node_modules/@azure/core-lro/dist-esm/src/legacy/lroEngine/index.js +++ b/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/index.js @@ -1,4 +1,4 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export { LroEngine } from "./lroEngine"; +export { LroEngine } from "./lroEngine.js"; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/lroEngine.js b/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/lroEngine.js new file mode 100644 index 000000000..351691a7b --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/lroEngine.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { GenericPollOperation } from "./operation.js"; +import { POLL_INTERVAL_IN_MS } from "../../poller/constants.js"; +import { Poller } from "../poller.js"; +import { deserializeState } from "../../poller/operation.js"; +/** + * The LRO Engine, a class that performs polling. + */ +export class LroEngine extends Poller { + config; + constructor(lro, options) { + const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {}; + const state = resumeFrom + ? deserializeState(resumeFrom) + : {}; + const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); + super(operation); + this.resolveOnUnsuccessful = resolveOnUnsuccessful; + this.config = { intervalInMs: intervalInMs }; + operation.setPollerConfig(this.config); + } + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs)); + } +} +//# sourceMappingURL=lroEngine.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/models.js b/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/models.js new file mode 100644 index 000000000..63155a9f0 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/models.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/operation.js b/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/operation.js new file mode 100644 index 000000000..4051ad80d --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/legacy/lroEngine/operation.js @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { initHttpOperation, pollHttpOperation } from "../../http/operation.js"; +import { logger } from "../../logger.js"; +const createStateProxy = () => ({ + initState: (config) => ({ config, isStarted: true }), + setCanceled: (state) => (state.isCancelled = true), + setError: (state, error) => (state.error = error), + setResult: (state, result) => (state.result = result), + setRunning: (state) => (state.isStarted = true), + setSucceeded: (state) => (state.isCompleted = true), + setFailed: () => { + /** empty body */ + }, + getError: (state) => state.error, + getResult: (state) => state.result, + isCanceled: (state) => !!state.isCancelled, + isFailed: (state) => !!state.error, + isRunning: (state) => !!state.isStarted, + isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error), +}); +export class GenericPollOperation { + state; + lro; + setErrorAsResult; + lroResourceLocationConfig; + processResult; + updateState; + isDone; + pollerConfig; + constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) { + this.state = state; + this.lro = lro; + this.setErrorAsResult = setErrorAsResult; + this.lroResourceLocationConfig = lroResourceLocationConfig; + this.processResult = processResult; + this.updateState = updateState; + this.isDone = isDone; + } + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; + } + async update(options) { + const stateProxy = createStateProxy(); + if (!this.state.isStarted) { + this.state = { + ...this.state, + ...(await initHttpOperation({ + lro: this.lro, + stateProxy, + resourceLocationConfig: this.lroResourceLocationConfig, + processResult: this.processResult, + setErrorAsResult: this.setErrorAsResult, + })), + }; + } + const updateState = this.updateState; + const isDone = this.isDone; + if (!this.state.isCompleted && this.state.error === undefined) { + await pollHttpOperation({ + lro: this.lro, + state: this.state, + stateProxy, + processResult: this.processResult, + updateState: updateState + ? (state, { rawResponse }) => updateState(state, rawResponse) + : undefined, + isDone: isDone + ? ({ flatResponse }, state) => isDone(flatResponse, state) + : undefined, + options, + setDelay: (intervalInMs) => { + this.pollerConfig.intervalInMs = intervalInMs; + }, + setErrorAsResult: this.setErrorAsResult, + }); + } + options?.fireProgress?.(this.state); + return this; + } + async cancel() { + logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; + } + /** + * Serializes the Poller operation. + */ + toString() { + return JSON.stringify({ + state: this.state, + }); + } +} +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/legacy/models.js b/node_modules/@azure/core-lro/dist/esm/legacy/models.js new file mode 100644 index 000000000..63155a9f0 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/legacy/models.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/legacy/pollOperation.js b/node_modules/@azure/core-lro/dist/esm/legacy/pollOperation.js new file mode 100644 index 000000000..f8c1767df --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/legacy/pollOperation.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=pollOperation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/legacy/poller.js b/node_modules/@azure/core-lro/dist/esm/legacy/poller.js new file mode 100644 index 000000000..de6f912e6 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/legacy/poller.js @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * When a poller is manually stopped through the `stopPolling` method, + * the poller will be rejected with an instance of the PollerStoppedError. + */ +export class PollerStoppedError extends Error { + constructor(message) { + super(message); + this.name = "PollerStoppedError"; + Object.setPrototypeOf(this, PollerStoppedError.prototype); + } +} +/** + * When the operation is cancelled, the poller will be rejected with an instance + * of the PollerCancelledError. + */ +export class PollerCancelledError extends Error { + constructor(message) { + super(message); + this.name = "PollerCancelledError"; + Object.setPrototypeOf(this, PollerCancelledError.prototype); + } +} +/** + * A class that represents the definition of a program that polls through consecutive requests + * until it reaches a state of completion. + * + * A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed. + * It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes. + * Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation. + * + * ```ts + * const poller = new MyPoller(); + * + * // Polling just once: + * await poller.poll(); + * + * // We can try to cancel the request here, by calling: + * // + * // await poller.cancelOperation(); + * // + * + * // Getting the final result: + * const result = await poller.pollUntilDone(); + * ``` + * + * The Poller is defined by two types, a type representing the state of the poller, which + * must include a basic set of properties from `PollOperationState`, + * and a return type defined by `TResult`, which can be anything. + * + * The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having + * to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type. + * + * ```ts + * class Client { + * public async makePoller: PollerLike { + * const poller = new MyPoller({}); + * // It might be preferred to return the poller after the first request is made, + * // so that some information can be obtained right away. + * await poller.poll(); + * return poller; + * } + * } + * + * const poller: PollerLike = myClient.makePoller(); + * ``` + * + * A poller can be created through its constructor, then it can be polled until it's completed. + * At any point in time, the state of the poller can be obtained without delay through the getOperationState method. + * At any point in time, the intermediate forms of the result type can be requested without delay. + * Once the underlying operation is marked as completed, the poller will stop and the final value will be returned. + * + * ```ts + * const poller = myClient.makePoller(); + * const state: MyOperationState = poller.getOperationState(); + * + * // The intermediate result can be obtained at any time. + * const result: MyResult | undefined = poller.getResult(); + * + * // The final result can only be obtained after the poller finishes. + * const result: MyResult = await poller.pollUntilDone(); + * ``` + * + */ +// eslint-disable-next-line no-use-before-define +export class Poller { + /** controls whether to throw an error if the operation failed or was canceled. */ + resolveOnUnsuccessful = false; + stopped = true; + resolve; + reject; + pollOncePromise; + cancelPromise; + promise; + pollProgressCallbacks = []; + /** + * The poller's operation is available in full to any of the methods of the Poller class + * and any class extending the Poller class. + */ + operation; + /** + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. + * + * When writing an implementation of a Poller, this implementation needs to deal with the initialization + * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's + * operation has already been defined, at least its basic properties. The code below shows how to approach + * the definition of the constructor of a new custom poller. + * + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; + * + * const operation = { + * state, + * update, + * cancel, + * toString + * } + * + * // Sending the operation to the parent's constructor. + * super(operation); + * + * // You can assign more local properties here. + * } + * } + * ``` + * + * Inside of this constructor, a new promise is created. This will be used to + * tell the user when the poller finishes (see `pollUntilDone()`). The promise's + * resolve and reject methods are also used internally to control when to resolve + * or reject anyone waiting for the poller to finish. + * + * The constructor of a custom implementation of a poller is where any serialized version of + * a previous poller's operation should be deserialized into the operation sent to the + * base constructor. For example: + * + * ```ts + * export class MyPoller extends Poller { + * constructor( + * baseOperation: string | undefined + * ) { + * let state: MyOperationState = {}; + * if (baseOperation) { + * state = { + * ...JSON.parse(baseOperation).state, + * ...state + * }; + * } + * const operation = { + * state, + * // ... + * } + * super(operation); + * } + * } + * ``` + * + * @param operation - Must contain the basic properties of `PollOperation`. + */ + constructor(operation) { + this.operation = operation; + this.promise = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + // This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown. + // The above warning would get thrown if `poller.poll` is called, it returns an error, + // and pullUntilDone did not have a .catch or await try/catch on it's return value. + this.promise.catch(() => { + /* intentionally blank */ + }); + } + /** + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. + */ + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } + } + /** + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * @param options - Optional properties passed to the operation's update method. + */ + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this), + }); + } + this.processUpdatedState(); + } + /** + * fireProgress calls the functions passed in via onProgress the method of the poller. + * + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. + * + * @param state - The current operation state. + */ + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } + } + /** + * Invokes the underlying operation's cancel method. + */ + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); + } + /** + * Returns a promise that will resolve once a single polling request finishes. + * It does this by calling the update method of the Poller's operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * @param options - Optional properties passed to the operation's update method. + */ + poll(options = {}) { + if (!this.pollOncePromise) { + this.pollOncePromise = this.pollOnce(options); + const clearPollOncePromise = () => { + this.pollOncePromise = undefined; + }; + this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject); + } + return this.pollOncePromise; + } + processUpdatedState() { + if (this.operation.state.error) { + this.stopped = true; + if (!this.resolveOnUnsuccessful) { + this.reject(this.operation.state.error); + throw this.operation.state.error; + } + } + if (this.operation.state.isCancelled) { + this.stopped = true; + if (!this.resolveOnUnsuccessful) { + const error = new PollerCancelledError("Operation was canceled"); + this.reject(error); + throw error; + } + } + if (this.isDone() && this.resolve) { + // If the poller has finished polling, this means we now have a result. + // However, it can be the case that TResult is instantiated to void, so + // we are not expecting a result anyway. To assert that we might not + // have a result eventually after finishing polling, we cast the result + // to TResult. + this.resolve(this.getResult()); + } + } + /** + * Returns a promise that will resolve once the underlying operation is completed. + */ + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + // This is needed because the state could have been updated by + // `cancelOperation`, e.g. the operation is canceled or an error occurred. + this.processUpdatedState(); + return this.promise; + } + /** + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. + * + * It returns a method that can be used to stop receiving updates on the given callback function. + */ + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; + } + /** + * Returns true if the poller has finished polling. + */ + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); + } + /** + * Stops the poller from continuing to poll. + */ + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } + } + /** + * Returns true if the poller is stopped. + */ + isStopped() { + return this.stopped; + } + /** + * Attempts to cancel the underlying operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * If it's called again before it finishes, it will throw an error. + * + * @param options - Optional properties passed to the operation's update method. + */ + cancelOperation(options = {}) { + if (!this.cancelPromise) { + this.cancelPromise = this.cancelOnce(options); + } + else if (options.abortSignal) { + throw new Error("A cancel request is currently pending"); + } + return this.cancelPromise; + } + /** + * Returns the state of the operation. + * + * Even though TState will be the same type inside any of the methods of any extension of the Poller class, + * implementations of the pollers can customize what's shared with the public by writing their own + * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller + * and a public type representing a safe to share subset of the properties of the internal state. + * Their definition of getOperationState can then return their public type. + * + * Example: + * + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } + * + * // To allow us to have a true separation of public and private state, we have to define another interface: + * interface PublicState extends PollOperationState { + * publicProperty?: string; + * } + * + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... + * + * public getOperationState(): PublicState { + * const state: PublicState = this.operation.state; + * return { + * // Properties from PollOperationState + * isStarted: state.isStarted, + * isCompleted: state.isCompleted, + * isCancelled: state.isCancelled, + * error: state.error, + * result: state.result, + * + * // The only other property needed by PublicState. + * publicProperty: state.publicProperty + * } + * } + * } + * ``` + * + * You can see this in the tests of this repository, go to the file: + * `../test/utils/testPoller.ts` + * and look for the getOperationState implementation. + */ + getOperationState() { + return this.operation.state; + } + /** + * Returns the result value of the operation, + * regardless of the state of the poller. + * It can return undefined or an incomplete form of the final TResult value + * depending on the implementation. + */ + getResult() { + const state = this.operation.state; + return state.result; + } + /** + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. + */ + toString() { + return this.operation.toString(); + } +} +//# sourceMappingURL=poller.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/logger.js b/node_modules/@azure/core-lro/dist/esm/logger.js new file mode 100644 index 000000000..094bfe421 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/logger.js @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { createClientLogger } from "@azure/logger"; +/** + * The `@azure/logger` configuration for this package. + * @internal + */ +export const logger = createClientLogger("core-lro"); +//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/package.json b/node_modules/@azure/core-lro/dist/esm/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-lro/dist/esm/poller/constants.js b/node_modules/@azure/core-lro/dist/esm/poller/constants.js new file mode 100644 index 000000000..e35aad76b --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/poller/constants.js @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * The default time interval to wait before sending the next polling request. + */ +export const POLL_INTERVAL_IN_MS = 2000; +/** + * The closed set of terminal states. + */ +export const terminalStates = ["succeeded", "canceled", "failed"]; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/poller/models.js b/node_modules/@azure/core-lro/dist/esm/poller/models.js new file mode 100644 index 000000000..63155a9f0 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/poller/models.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/poller/operation.js b/node_modules/@azure/core-lro/dist/esm/poller/operation.js new file mode 100644 index 000000000..869eaa528 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/poller/operation.js @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { logger } from "../logger.js"; +import { terminalStates } from "./constants.js"; +/** + * Deserializes the state + */ +export function deserializeState(serializedState) { + try { + return JSON.parse(serializedState).state; + } + catch (e) { + throw new Error(`Unable to deserialize input state: ${serializedState}`); + } +} +function setStateError(inputs) { + const { state, stateProxy, isOperationError } = inputs; + return (error) => { + if (isOperationError(error)) { + stateProxy.setError(state, error); + stateProxy.setFailed(state); + } + throw error; + }; +} +function appendReadableErrorMessage(currentMessage, innerMessage) { + let message = currentMessage; + if (message.slice(-1) !== ".") { + message = message + "."; + } + return message + " " + innerMessage; +} +function simplifyError(err) { + let message = err.message; + let code = err.code; + let curErr = err; + while (curErr.innererror) { + curErr = curErr.innererror; + code = curErr.code; + message = appendReadableErrorMessage(message, curErr.message); + } + return { + code, + message, + }; +} +function processOperationStatus(result) { + const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; + switch (status) { + case "succeeded": { + stateProxy.setSucceeded(state); + break; + } + case "failed": { + const err = getError?.(response); + let postfix = ""; + if (err) { + const { code, message } = simplifyError(err); + postfix = `. ${code}. ${message}`; + } + const errStr = `The long-running operation has failed${postfix}`; + stateProxy.setError(state, new Error(errStr)); + stateProxy.setFailed(state); + logger.warning(errStr); + break; + } + case "canceled": { + stateProxy.setCanceled(state); + break; + } + } + if (isDone?.(response, state) || + (isDone === undefined && + ["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status))) { + stateProxy.setResult(state, buildResult({ + response, + state, + processResult, + })); + } +} +function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; +} +/** + * Initiates the long-running operation. + */ +export async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + if (operationLocation) + withOperationLocation?.(operationLocation, false); + const config = { + metadata, + operationLocation, + resourceLocation, + }; + logger.verbose(`LRO: Operation description:`, config); + const state = stateProxy.initState(config); + const status = getOperationStatus({ response, state, operationLocation }); + processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); + return state; +} +async function pollOperationHelper(inputs) { + const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options, } = inputs; + const response = await poll(operationLocation, options).catch(setStateError({ + state, + stateProxy, + isOperationError, + })); + const status = getOperationStatus(response, state); + logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); + if (status === "succeeded") { + const resourceLocation = getResourceLocation(response, state); + if (resourceLocation !== undefined) { + return { + response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })), + status, + }; + } + } + return { response, status }; +} +/** Polls the long-running operation. */ +export async function pollOperation(inputs) { + const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs; + const { operationLocation } = state.config; + if (operationLocation !== undefined) { + const { response, status } = await pollOperationHelper({ + poll, + getOperationStatus, + state, + stateProxy, + operationLocation, + getResourceLocation, + isOperationError, + options, + }); + processOperationStatus({ + status, + response, + state, + stateProxy, + isDone, + processResult, + getError, + setErrorAsResult, + }); + if (!terminalStates.includes(status)) { + const intervalInMs = getPollingInterval?.(response); + if (intervalInMs) + setDelay(intervalInMs); + const location = getOperationLocation?.(response, state); + if (location !== undefined) { + const isUpdated = operationLocation !== location; + state.config.operationLocation = location; + withOperationLocation?.(location, isUpdated); + } + else + withOperationLocation?.(operationLocation, false); + } + updateState?.(state, response); + } +} +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/esm/poller/poller.js b/node_modules/@azure/core-lro/dist/esm/poller/poller.js new file mode 100644 index 000000000..5fc9b09df --- /dev/null +++ b/node_modules/@azure/core-lro/dist/esm/poller/poller.js @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { deserializeState, initOperation, pollOperation } from "./operation.js"; +import { POLL_INTERVAL_IN_MS } from "./constants.js"; +import { delay } from "@azure/core-util"; +const createStateProxy = () => ({ + /** + * The state at this point is created to be of type OperationState. + * It will be updated later to be of type TState when the + * customer-provided callback, `updateState`, is called during polling. + */ + initState: (config) => ({ status: "running", config }), + setCanceled: (state) => (state.status = "canceled"), + setError: (state, error) => (state.error = error), + setResult: (state, result) => (state.result = result), + setRunning: (state) => (state.status = "running"), + setSucceeded: (state) => (state.status = "succeeded"), + setFailed: (state) => (state.status = "failed"), + getError: (state) => state.error, + getResult: (state) => state.result, + isCanceled: (state) => state.status === "canceled", + isFailed: (state) => state.status === "failed", + isRunning: (state) => state.status === "running", + isSucceeded: (state) => state.status === "succeeded", +}); +/** + * Returns a poller factory. + */ +export function buildCreatePoller(inputs) { + const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs; + return async ({ init, poll }, options) => { + const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {}; + const stateProxy = createStateProxy(); + const withOperationLocation = withOperationLocationCallback + ? (() => { + let called = false; + return (operationLocation, isUpdated) => { + if (isUpdated) + withOperationLocationCallback(operationLocation); + else if (!called) + withOperationLocationCallback(operationLocation); + called = true; + }; + })() + : undefined; + const state = restoreFrom + ? deserializeState(restoreFrom) + : await initOperation({ + init, + stateProxy, + processResult, + getOperationStatus: getStatusFromInitialResponse, + withOperationLocation, + setErrorAsResult: !resolveOnUnsuccessful, + }); + let resultPromise; + const abortController = new AbortController(); + const handlers = new Map(); + const handleProgressEvents = async () => handlers.forEach((h) => h(state)); + const cancelErrMsg = "Operation was canceled"; + let currentPollIntervalInMs = intervalInMs; + const poller = { + getOperationState: () => state, + getResult: () => state.result, + isDone: () => ["succeeded", "failed", "canceled"].includes(state.status), + isStopped: () => resultPromise === undefined, + stopPolling: () => { + abortController.abort(); + }, + toString: () => JSON.stringify({ + state, + }), + onProgress: (callback) => { + const s = Symbol(); + handlers.set(s, callback); + return () => handlers.delete(s); + }, + pollUntilDone: (pollOptions) => (resultPromise ??= (async () => { + const { abortSignal: inputAbortSignal } = pollOptions || {}; + // In the future we can use AbortSignal.any() instead + function abortListener() { + abortController.abort(); + } + const abortSignal = abortController.signal; + if (inputAbortSignal?.aborted) { + abortController.abort(); + } + else if (!abortSignal.aborted) { + inputAbortSignal?.addEventListener("abort", abortListener, { once: true }); + } + try { + if (!poller.isDone()) { + await poller.poll({ abortSignal }); + while (!poller.isDone()) { + await delay(currentPollIntervalInMs, { abortSignal }); + await poller.poll({ abortSignal }); + } + } + } + finally { + inputAbortSignal?.removeEventListener("abort", abortListener); + } + if (resolveOnUnsuccessful) { + return poller.getResult(); + } + else { + switch (state.status) { + case "succeeded": + return poller.getResult(); + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + case "notStarted": + case "running": + throw new Error(`Polling completed without succeeding or failing`); + } + } + })().finally(() => { + resultPromise = undefined; + })), + async poll(pollOptions) { + if (resolveOnUnsuccessful) { + if (poller.isDone()) + return; + } + else { + switch (state.status) { + case "succeeded": + return; + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + } + } + await pollOperation({ + poll, + state, + stateProxy, + getOperationLocation, + isOperationError, + withOperationLocation, + getPollingInterval, + getOperationStatus: getStatusFromPollResponse, + getResourceLocation, + processResult, + getError, + updateState, + options: pollOptions, + setDelay: (pollIntervalInMs) => { + currentPollIntervalInMs = pollIntervalInMs; + }, + setErrorAsResult: !resolveOnUnsuccessful, + }); + await handleProgressEvents(); + if (!resolveOnUnsuccessful) { + switch (state.status) { + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + } + } + }, + }; + return poller; + }; +} +//# sourceMappingURL=poller.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/index.js b/node_modules/@azure/core-lro/dist/index.js deleted file mode 100644 index cb6830f19..000000000 --- a/node_modules/@azure/core-lro/dist/index.js +++ /dev/null @@ -1,1189 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var logger$1 = require('@azure/logger'); -var coreUtil = require('@azure/core-util'); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * The `@azure/logger` configuration for this package. - * @internal - */ -const logger = logger$1.createClientLogger("core-lro"); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * The default time interval to wait before sending the next polling request. - */ -const POLL_INTERVAL_IN_MS = 2000; -/** - * The closed set of terminal states. - */ -const terminalStates = ["succeeded", "canceled", "failed"]; - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Deserializes the state - */ -function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } - catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } -} -function setStateError(inputs) { - const { state, stateProxy, isOperationError } = inputs; - return (error) => { - if (isOperationError(error)) { - stateProxy.setError(state, error); - stateProxy.setFailed(state); - } - throw error; - }; -} -function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; - } - return message + " " + innerMessage; -} -function simplifyError(err) { - let message = err.message; - let code = err.code; - let curErr = err; - while (curErr.innererror) { - curErr = curErr.innererror; - code = curErr.code; - message = appendReadableErrorMessage(message, curErr.message); - } - return { - code, - message, - }; -} -function processOperationStatus(result) { - const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; - switch (status) { - case "succeeded": { - stateProxy.setSucceeded(state); - break; - } - case "failed": { - const err = getError === null || getError === void 0 ? void 0 : getError(response); - let postfix = ""; - if (err) { - const { code, message } = simplifyError(err); - postfix = `. ${code}. ${message}`; - } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - logger.warning(errStr); - break; - } - case "canceled": { - stateProxy.setCanceled(state); - break; - } - } - if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) || - (isDone === undefined && - ["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status))) { - stateProxy.setResult(state, buildResult({ - response, - state, - processResult, - })); - } -} -function buildResult(inputs) { - const { processResult, response, state } = inputs; - return processResult ? processResult(response, state) : response; -} -/** - * Initiates the long-running operation. - */ -async function initOperation(inputs) { - const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation, - }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; -} -async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options, } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError, - })); - const status = getOperationStatus(response, state); - logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation(response, state); - if (resourceLocation !== undefined) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })), - status, - }; - } - } - return { response, status }; -} -/** Polls the long-running operation. */ -async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== undefined) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus, - state, - stateProxy, - operationLocation, - getResourceLocation, - isOperationError, - options, - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult, - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation === null || getOperationLocation === void 0 ? void 0 : getOperationLocation(response, state); - if (location !== undefined) { - const isUpdated = operationLocation !== location; - state.config.operationLocation = location; - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(location, isUpdated); - } - else - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - } - updateState === null || updateState === void 0 ? void 0 : updateState(state, response); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -function getOperationLocationPollingUrl(inputs) { - const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; -} -function getLocationHeader(rawResponse) { - return rawResponse.headers["location"]; -} -function getOperationLocationHeader(rawResponse) { - return rawResponse.headers["operation-location"]; -} -function getAzureAsyncOperationHeader(rawResponse) { - return rawResponse.headers["azure-asyncoperation"]; -} -function findResourceLocation(inputs) { - var _a; - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return undefined; - } - case "PATCH": { - return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; - } - default: { - return getDefault(); - } - } - function getDefault() { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return undefined; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } - } - } -} -function inferLroMode(inputs) { - const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs; - const operationLocation = getOperationLocationHeader(rawResponse); - const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse); - const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation }); - const location = getLocationHeader(rawResponse); - const normalizedRequestMethod = requestMethod === null || requestMethod === void 0 ? void 0 : requestMethod.toLocaleUpperCase(); - if (pollingUrl !== undefined) { - return { - mode: "OperationLocation", - operationLocation: pollingUrl, - resourceLocation: findResourceLocation({ - requestMethod: normalizedRequestMethod, - location, - requestPath, - resourceLocationConfig, - }), - }; - } - else if (location !== undefined) { - return { - mode: "ResourceLocation", - operationLocation: location, - }; - } - else if (normalizedRequestMethod === "PUT" && requestPath) { - return { - mode: "Body", - operationLocation: requestPath, - }; - } - else { - return undefined; - } -} -function transformStatus(inputs) { - const { status, statusCode } = inputs; - if (typeof status !== "string" && status !== undefined) { - throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`); - } - switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) { - case undefined: - return toOperationStatus(statusCode); - case "succeeded": - return "succeeded"; - case "failed": - return "failed"; - case "running": - case "accepted": - case "started": - case "canceling": - case "cancelling": - return "running"; - case "canceled": - case "cancelled": - return "canceled"; - default: { - logger.verbose(`LRO: unrecognized operation status: ${status}`); - return status; - } - } -} -function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); -} -function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState; - return transformStatus({ status, statusCode: rawResponse.statusCode }); -} -function toOperationStatus(statusCode) { - if (statusCode === 202) { - return "running"; - } - else if (statusCode < 300) { - return "succeeded"; - } - else { - return "failed"; - } -} -function parseRetryAfter({ rawResponse }) { - const retryAfter = rawResponse.headers["retry-after"]; - if (retryAfter !== undefined) { - // Retry-After header value is either in HTTP date format, or in seconds - const retryAfterInSeconds = parseInt(retryAfter); - return isNaN(retryAfterInSeconds) - ? calculatePollingIntervalFromDate(new Date(retryAfter)) - : retryAfterInSeconds * 1000; - } - return undefined; -} -function getErrorFromResponse(response) { - const error = accessBodyProperty(response, "error"); - if (!error) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error.code || !error.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; - } - return error; -} -function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor(new Date().getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; - } - return undefined; -} -function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case undefined: - return toOperationStatus(response.rawResponse.statusCode); - case "Body": - return getOperationStatus(response, state); - default: - return "running"; - } - } - const status = helper(); - return status === "running" && operationLocation === undefined ? "succeeded" : status; -} -/** - * Initiates the long-running operation. - */ -async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return initOperation({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig, - }); - return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {})); - }, - stateProxy, - processResult: processResult - ? ({ flatResponse }, state) => processResult(flatResponse, state) - : ({ flatResponse }) => flatResponse, - getOperationStatus: getStatusFromInitialResponse, - setErrorAsResult, - }); -} -function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse), - }); - } - case "ResourceLocation": { - return getLocationHeader(rawResponse); - } - case "Body": - default: { - return undefined; - } - } -} -function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); - } - case "Body": { - return getProvisioningState(rawResponse); - } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); - } -} -function accessBodyProperty({ flatResponse, rawResponse }, prop) { - var _a, _b; - return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_b = rawResponse.body) === null || _b === void 0 ? void 0 : _b[prop]; -} -function getResourceLocation(res, state) { - const loc = accessBodyProperty(res, "resourceLocation"); - if (loc && typeof loc === "string") { - state.config.resourceLocation = loc; - } - return state.config.resourceLocation; -} -function isOperationError(e) { - return e.name === "RestError"; -} -/** Polls the long-running operation. */ -async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs; - return pollOperation({ - state, - stateProxy, - setDelay, - processResult: processResult - ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState) - : ({ flatResponse }) => flatResponse, - getError: getErrorFromResponse, - updateState, - getPollingInterval: parseRetryAfter, - getOperationLocation, - getOperationStatus, - isOperationError, - getResourceLocation, - options, - /** - * The expansion here is intentional because `lro` could be an object that - * references an inner this, so we need to preserve a reference to it. - */ - poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), - setErrorAsResult, - }); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -const createStateProxy$1 = () => ({ - /** - * The state at this point is created to be of type OperationState. - * It will be updated later to be of type TState when the - * customer-provided callback, `updateState`, is called during polling. - */ - initState: (config) => ({ status: "running", config }), - setCanceled: (state) => (state.status = "canceled"), - setError: (state, error) => (state.error = error), - setResult: (state, result) => (state.result = result), - setRunning: (state) => (state.status = "running"), - setSucceeded: (state) => (state.status = "succeeded"), - setFailed: (state) => (state.status = "failed"), - getError: (state) => state.error, - getResult: (state) => state.result, - isCanceled: (state) => state.status === "canceled", - isFailed: (state) => state.status === "failed", - isRunning: (state) => state.status === "running", - isSucceeded: (state) => state.status === "succeeded", -}); -/** - * Returns a poller factory. - */ -function buildCreatePoller(inputs) { - const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {}; - const stateProxy = createStateProxy$1(); - const withOperationLocation = withOperationLocationCallback - ? (() => { - let called = false; - return (operationLocation, isUpdated) => { - if (isUpdated) - withOperationLocationCallback(operationLocation); - else if (!called) - withOperationLocationCallback(operationLocation); - called = true; - }; - })() - : undefined; - const state = restoreFrom - ? deserializeState(restoreFrom) - : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful, - }); - let resultPromise; - const abortController = new AbortController(); - const handlers = new Map(); - const handleProgressEvents = async () => handlers.forEach((h) => h(state)); - const cancelErrMsg = "Operation was canceled"; - let currentPollIntervalInMs = intervalInMs; - const poller = { - getOperationState: () => state, - getResult: () => state.result, - isDone: () => ["succeeded", "failed", "canceled"].includes(state.status), - isStopped: () => resultPromise === undefined, - stopPolling: () => { - abortController.abort(); - }, - toString: () => JSON.stringify({ - state, - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - // In the future we can use AbortSignal.any() instead - function abortListener() { - abortController.abort(); - } - const abortSignal = abortController.signal; - if (inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.aborted) { - abortController.abort(); - } - else if (!abortSignal.aborted) { - inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.addEventListener("abort", abortListener, { once: true }); - } - try { - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - } - finally { - inputAbortSignal === null || inputAbortSignal === void 0 ? void 0 : inputAbortSignal.removeEventListener("abort", abortListener); - } - if (resolveOnUnsuccessful) { - return poller.getResult(); - } - else { - switch (state.status) { - case "succeeded": - return poller.getResult(); - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - case "notStarted": - case "running": - throw new Error(`Polling completed without succeeding or failing`); - } - } - })().finally(() => { - resultPromise = undefined; - }))), - async poll(pollOptions) { - if (resolveOnUnsuccessful) { - if (poller.isDone()) - return; - } - else { - switch (state.status) { - case "succeeded": - return; - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - } - } - await pollOperation({ - poll, - state, - stateProxy, - getOperationLocation, - isOperationError, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation, - processResult, - getError, - updateState, - options: pollOptions, - setDelay: (pollIntervalInMs) => { - currentPollIntervalInMs = pollIntervalInMs; - }, - setErrorAsResult: !resolveOnUnsuccessful, - }); - await handleProgressEvents(); - if (!resolveOnUnsuccessful) { - switch (state.status) { - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - } - } - }, - }; - return poller; - }; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Creates a poller that can be used to poll a long-running operation. - * @param lro - Description of the long-running operation - * @param options - options to configure the poller - * @returns an initialized poller - */ -async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false, } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful, - })({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig, - }); - return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {})); - }, - poll: lro.sendPollRequest, - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult - ? ({ flatResponse }, state) => processResult(flatResponse, state) - : ({ flatResponse }) => flatResponse, - }); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -const createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => (state.isCancelled = true), - setError: (state, error) => (state.error = error), - setResult: (state, result) => (state.result = result), - setRunning: (state) => (state.isStarted = true), - setSucceeded: (state) => (state.isCompleted = true), - setFailed: () => { - /** empty body */ - }, - getError: (state) => state.error, - getResult: (state) => state.result, - isCanceled: (state) => !!state.isCancelled, - isFailed: (state) => !!state.error, - isRunning: (state) => !!state.isStarted, - isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error), -}); -class GenericPollOperation { - constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) { - this.state = state; - this.lro = lro; - this.setErrorAsResult = setErrorAsResult; - this.lroResourceLocationConfig = lroResourceLocationConfig; - this.processResult = processResult; - this.updateState = updateState; - this.isDone = isDone; - } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; - } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), (await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult, - }))); - } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === undefined) { - await pollHttpOperation({ - lro: this.lro, - state: this.state, - stateProxy, - processResult: this.processResult, - updateState: updateState - ? (state, { rawResponse }) => updateState(state, rawResponse) - : undefined, - isDone: isDone - ? ({ flatResponse }, state) => isDone(flatResponse, state) - : undefined, - options, - setDelay: (intervalInMs) => { - this.pollerConfig.intervalInMs = intervalInMs; - }, - setErrorAsResult: this.setErrorAsResult, - }); - } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; - } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; - } - /** - * Serializes the Poller operation. - */ - toString() { - return JSON.stringify({ - state: this.state, - }); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * When a poller is manually stopped through the `stopPolling` method, - * the poller will be rejected with an instance of the PollerStoppedError. - */ -class PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, PollerStoppedError.prototype); - } -} -/** - * When the operation is cancelled, the poller will be rejected with an instance - * of the PollerCancelledError. - */ -class PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, PollerCancelledError.prototype); - } -} -/** - * A class that represents the definition of a program that polls through consecutive requests - * until it reaches a state of completion. - * - * A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed. - * It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes. - * Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation. - * - * ```ts - * const poller = new MyPoller(); - * - * // Polling just once: - * await poller.poll(); - * - * // We can try to cancel the request here, by calling: - * // - * // await poller.cancelOperation(); - * // - * - * // Getting the final result: - * const result = await poller.pollUntilDone(); - * ``` - * - * The Poller is defined by two types, a type representing the state of the poller, which - * must include a basic set of properties from `PollOperationState`, - * and a return type defined by `TResult`, which can be anything. - * - * The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having - * to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type. - * - * ```ts - * class Client { - * public async makePoller: PollerLike { - * const poller = new MyPoller({}); - * // It might be preferred to return the poller after the first request is made, - * // so that some information can be obtained right away. - * await poller.poll(); - * return poller; - * } - * } - * - * const poller: PollerLike = myClient.makePoller(); - * ``` - * - * A poller can be created through its constructor, then it can be polled until it's completed. - * At any point in time, the state of the poller can be obtained without delay through the getOperationState method. - * At any point in time, the intermediate forms of the result type can be requested without delay. - * Once the underlying operation is marked as completed, the poller will stop and the final value will be returned. - * - * ```ts - * const poller = myClient.makePoller(); - * const state: MyOperationState = poller.getOperationState(); - * - * // The intermediate result can be obtained at any time. - * const result: MyResult | undefined = poller.getResult(); - * - * // The final result can only be obtained after the poller finishes. - * const result: MyResult = await poller.pollUntilDone(); - * ``` - * - */ -// eslint-disable-next-line no-use-before-define -class Poller { - /** - * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. - * - * When writing an implementation of a Poller, this implementation needs to deal with the initialization - * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's - * operation has already been defined, at least its basic properties. The code below shows how to approach - * the definition of the constructor of a new custom poller. - * - * ```ts - * export class MyPoller extends Poller { - * constructor({ - * // Anything you might need outside of the basics - * }) { - * let state: MyOperationState = { - * privateProperty: private, - * publicProperty: public, - * }; - * - * const operation = { - * state, - * update, - * cancel, - * toString - * } - * - * // Sending the operation to the parent's constructor. - * super(operation); - * - * // You can assign more local properties here. - * } - * } - * ``` - * - * Inside of this constructor, a new promise is created. This will be used to - * tell the user when the poller finishes (see `pollUntilDone()`). The promise's - * resolve and reject methods are also used internally to control when to resolve - * or reject anyone waiting for the poller to finish. - * - * The constructor of a custom implementation of a poller is where any serialized version of - * a previous poller's operation should be deserialized into the operation sent to the - * base constructor. For example: - * - * ```ts - * export class MyPoller extends Poller { - * constructor( - * baseOperation: string | undefined - * ) { - * let state: MyOperationState = {}; - * if (baseOperation) { - * state = { - * ...JSON.parse(baseOperation).state, - * ...state - * }; - * } - * const operation = { - * state, - * // ... - * } - * super(operation); - * } - * } - * ``` - * - * @param operation - Must contain the basic properties of `PollOperation`. - */ - constructor(operation) { - /** controls whether to throw an error if the operation failed or was canceled. */ - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve, reject) => { - this.resolve = resolve; - this.reject = reject; - }); - // This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown. - // The above warning would get thrown if `poller.poll` is called, it returns an error, - // and pullUntilDone did not have a .catch or await try/catch on it's return value. - this.promise.catch(() => { - /* intentionally blank */ - }); - } - /** - * Starts a loop that will break only if the poller is done - * or if the poller is stopped. - */ - async startPolling(pollOptions = {}) { - if (this.stopped) { - this.stopped = false; - } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); - } - } - /** - * pollOnce does one polling, by calling to the update method of the underlying - * poll operation to make any relevant change effective. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * @param options - Optional properties passed to the operation's update method. - */ - async pollOnce(options = {}) { - if (!this.isDone()) { - this.operation = await this.operation.update({ - abortSignal: options.abortSignal, - fireProgress: this.fireProgress.bind(this), - }); - } - this.processUpdatedState(); - } - /** - * fireProgress calls the functions passed in via onProgress the method of the poller. - * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. - * - * @param state - The current operation state. - */ - fireProgress(state) { - for (const callback of this.pollProgressCallbacks) { - callback(state); - } - } - /** - * Invokes the underlying operation's cancel method. - */ - async cancelOnce(options = {}) { - this.operation = await this.operation.cancel(options); - } - /** - * Returns a promise that will resolve once a single polling request finishes. - * It does this by calling the update method of the Poller's operation. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * @param options - Optional properties passed to the operation's update method. - */ - poll(options = {}) { - if (!this.pollOncePromise) { - this.pollOncePromise = this.pollOnce(options); - const clearPollOncePromise = () => { - this.pollOncePromise = undefined; - }; - this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject); - } - return this.pollOncePromise; - } - processUpdatedState() { - if (this.operation.state.error) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - this.reject(this.operation.state.error); - throw this.operation.state.error; - } - } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error = new PollerCancelledError("Operation was canceled"); - this.reject(error); - throw error; - } - } - if (this.isDone() && this.resolve) { - // If the poller has finished polling, this means we now have a result. - // However, it can be the case that TResult is instantiated to void, so - // we are not expecting a result anyway. To assert that we might not - // have a result eventually after finishing polling, we cast the result - // to TResult. - this.resolve(this.getResult()); - } - } - /** - * Returns a promise that will resolve once the underlying operation is completed. - */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); - } - // This is needed because the state could have been updated by - // `cancelOperation`, e.g. the operation is canceled or an error occurred. - this.processUpdatedState(); - return this.promise; - } - /** - * Invokes the provided callback after each polling is completed, - * sending the current state of the poller's operation. - * - * It returns a method that can be used to stop receiving updates on the given callback function. - */ - onProgress(callback) { - this.pollProgressCallbacks.push(callback); - return () => { - this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); - }; - } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); - } - /** - * Stops the poller from continuing to poll. - */ - stopPolling() { - if (!this.stopped) { - this.stopped = true; - if (this.reject) { - this.reject(new PollerStoppedError("This poller is already stopped")); - } - } - } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; - } - /** - * Attempts to cancel the underlying operation. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. - * - * If it's called again before it finishes, it will throw an error. - * - * @param options - Optional properties passed to the operation's update method. - */ - cancelOperation(options = {}) { - if (!this.cancelPromise) { - this.cancelPromise = this.cancelOnce(options); - } - else if (options.abortSignal) { - throw new Error("A cancel request is currently pending"); - } - return this.cancelPromise; - } - /** - * Returns the state of the operation. - * - * Even though TState will be the same type inside any of the methods of any extension of the Poller class, - * implementations of the pollers can customize what's shared with the public by writing their own - * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller - * and a public type representing a safe to share subset of the properties of the internal state. - * Their definition of getOperationState can then return their public type. - * - * Example: - * - * ```ts - * // Let's say we have our poller's operation state defined as: - * interface MyOperationState extends PollOperationState { - * privateProperty?: string; - * publicProperty?: string; - * } - * - * // To allow us to have a true separation of public and private state, we have to define another interface: - * interface PublicState extends PollOperationState { - * publicProperty?: string; - * } - * - * // Then, we define our Poller as follows: - * export class MyPoller extends Poller { - * // ... More content is needed here ... - * - * public getOperationState(): PublicState { - * const state: PublicState = this.operation.state; - * return { - * // Properties from PollOperationState - * isStarted: state.isStarted, - * isCompleted: state.isCompleted, - * isCancelled: state.isCancelled, - * error: state.error, - * result: state.result, - * - * // The only other property needed by PublicState. - * publicProperty: state.publicProperty - * } - * } - * } - * ``` - * - * You can see this in the tests of this repository, go to the file: - * `../test/utils/testPoller.ts` - * and look for the getOperationState implementation. - */ - getOperationState() { - return this.operation.state; - } - /** - * Returns the result value of the operation, - * regardless of the state of the poller. - * It can return undefined or an incomplete form of the final TResult value - * depending on the implementation. - */ - getResult() { - const state = this.operation.state; - return state.result; - } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * The LRO Engine, a class that performs polling. - */ -class LroEngine extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {}; - const state = resumeFrom - ? deserializeState(resumeFrom) - : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs: intervalInMs }; - operation.setPollerConfig(this.config); - } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs)); - } -} - -exports.LroEngine = LroEngine; -exports.Poller = Poller; -exports.PollerCancelledError = PollerCancelledError; -exports.PollerStoppedError = PollerStoppedError; -exports.createHttpPoller = createHttpPoller; -//# sourceMappingURL=index.js.map diff --git a/node_modules/@azure/core-lro/dist/react-native/http/models.js b/node_modules/@azure/core-lro/dist/react-native/http/models.js new file mode 100644 index 000000000..63155a9f0 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/http/models.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/http/operation.js b/node_modules/@azure/core-lro/dist/react-native/http/operation.js new file mode 100644 index 000000000..038384478 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/http/operation.js @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { initOperation, pollOperation } from "../poller/operation.js"; +import { logger } from "../logger.js"; +function getOperationLocationPollingUrl(inputs) { + const { azureAsyncOperation, operationLocation } = inputs; + return operationLocation ?? azureAsyncOperation; +} +function getLocationHeader(rawResponse) { + return rawResponse.headers["location"]; +} +function getOperationLocationHeader(rawResponse) { + return rawResponse.headers["operation-location"]; +} +function getAzureAsyncOperationHeader(rawResponse) { + return rawResponse.headers["azure-asyncoperation"]; +} +function findResourceLocation(inputs) { + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; + } + case "DELETE": { + return undefined; + } + case "PATCH": { + return getDefault() ?? requestPath; + } + default: { + return getDefault(); + } + } + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return undefined; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; + } + } + } +} +export function inferLroMode(inputs) { + const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs; + const operationLocation = getOperationLocationHeader(rawResponse); + const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse); + const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation }); + const location = getLocationHeader(rawResponse); + const normalizedRequestMethod = requestMethod?.toLocaleUpperCase(); + if (pollingUrl !== undefined) { + return { + mode: "OperationLocation", + operationLocation: pollingUrl, + resourceLocation: findResourceLocation({ + requestMethod: normalizedRequestMethod, + location, + requestPath, + resourceLocationConfig, + }), + }; + } + else if (location !== undefined) { + return { + mode: "ResourceLocation", + operationLocation: location, + }; + } + else if (normalizedRequestMethod === "PUT" && requestPath) { + return { + mode: "Body", + operationLocation: requestPath, + }; + } + else { + return undefined; + } +} +function transformStatus(inputs) { + const { status, statusCode } = inputs; + if (typeof status !== "string" && status !== undefined) { + throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`); + } + switch (status?.toLocaleLowerCase()) { + case undefined: + return toOperationStatus(statusCode); + case "succeeded": + return "succeeded"; + case "failed": + return "failed"; + case "running": + case "accepted": + case "started": + case "canceling": + case "cancelling": + return "running"; + case "canceled": + case "cancelled": + return "canceled"; + default: { + logger.verbose(`LRO: unrecognized operation status: ${status}`); + return status; + } + } +} +function getStatus(rawResponse) { + const { status } = rawResponse.body ?? {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); +} +function getProvisioningState(rawResponse) { + const { properties, provisioningState } = rawResponse.body ?? {}; + const status = properties?.provisioningState ?? provisioningState; + return transformStatus({ status, statusCode: rawResponse.statusCode }); +} +function toOperationStatus(statusCode) { + if (statusCode === 202) { + return "running"; + } + else if (statusCode < 300) { + return "succeeded"; + } + else { + return "failed"; + } +} +export function parseRetryAfter({ rawResponse }) { + const retryAfter = rawResponse.headers["retry-after"]; + if (retryAfter !== undefined) { + // Retry-After header value is either in HTTP date format, or in seconds + const retryAfterInSeconds = parseInt(retryAfter); + return isNaN(retryAfterInSeconds) + ? calculatePollingIntervalFromDate(new Date(retryAfter)) + : retryAfterInSeconds * 1000; + } + return undefined; +} +export function getErrorFromResponse(response) { + const error = accessBodyProperty(response, "error"); + if (!error) { + logger.warning(`The long-running operation failed but there is no error property in the response's body`); + return; + } + if (!error.code || !error.message) { + logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); + return; + } + return error; +} +function calculatePollingIntervalFromDate(retryAfterDate) { + const timeNow = Math.floor(new Date().getTime()); + const retryAfterTime = retryAfterDate.getTime(); + if (timeNow < retryAfterTime) { + return retryAfterTime - timeNow; + } + return undefined; +} +export function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { + const mode = state.config.metadata?.["mode"]; + switch (mode) { + case undefined: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; + } + } + const status = helper(); + return status === "running" && operationLocation === undefined ? "succeeded" : status; +} +/** + * Initiates the long-running operation. + */ +export async function initHttpOperation(inputs) { + const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; + return initOperation({ + init: async () => { + const response = await lro.sendInitialRequest(); + const config = inferLroMode({ + rawResponse: response.rawResponse, + requestPath: lro.requestPath, + requestMethod: lro.requestMethod, + resourceLocationConfig, + }); + return { + response, + operationLocation: config?.operationLocation, + resourceLocation: config?.resourceLocation, + ...(config?.mode ? { metadata: { mode: config.mode } } : {}), + }; + }, + stateProxy, + processResult: processResult + ? ({ flatResponse }, state) => processResult(flatResponse, state) + : ({ flatResponse }) => flatResponse, + getOperationStatus: getStatusFromInitialResponse, + setErrorAsResult, + }); +} +export function getOperationLocation({ rawResponse }, state) { + const mode = state.config.metadata?.["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse), + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return undefined; + } + } +} +export function getOperationStatus({ rawResponse }, state) { + const mode = state.config.metadata?.["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); + } + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); + } + case "Body": { + return getProvisioningState(rawResponse); + } + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + } +} +function accessBodyProperty({ flatResponse, rawResponse }, prop) { + return flatResponse?.[prop] ?? rawResponse.body?.[prop]; +} +export function getResourceLocation(res, state) { + const loc = accessBodyProperty(res, "resourceLocation"); + if (loc && typeof loc === "string") { + state.config.resourceLocation = loc; + } + return state.config.resourceLocation; +} +export function isOperationError(e) { + return e.name === "RestError"; +} +/** Polls the long-running operation. */ +export async function pollHttpOperation(inputs) { + const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs; + return pollOperation({ + state, + stateProxy, + setDelay, + processResult: processResult + ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState) + : ({ flatResponse }) => flatResponse, + getError: getErrorFromResponse, + updateState, + getPollingInterval: parseRetryAfter, + getOperationLocation, + getOperationStatus, + isOperationError, + getResourceLocation, + options, + /** + * The expansion here is intentional because `lro` could be an object that + * references an inner this, so we need to preserve a reference to it. + */ + poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions), + setErrorAsResult, + }); +} +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/http/poller.js b/node_modules/@azure/core-lro/dist/react-native/http/poller.js new file mode 100644 index 000000000..84379fdd7 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/http/poller.js @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { getErrorFromResponse, getOperationLocation, getOperationStatus, getResourceLocation, getStatusFromInitialResponse, inferLroMode, isOperationError, parseRetryAfter, } from "./operation.js"; +import { buildCreatePoller } from "../poller/poller.js"; +/** + * Creates a poller that can be used to poll a long-running operation. + * @param lro - Description of the long-running operation + * @param options - options to configure the poller + * @returns an initialized poller + */ +export async function createHttpPoller(lro, options) { + const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false, } = options || {}; + return buildCreatePoller({ + getStatusFromInitialResponse, + getStatusFromPollResponse: getOperationStatus, + isOperationError, + getOperationLocation, + getResourceLocation, + getPollingInterval: parseRetryAfter, + getError: getErrorFromResponse, + resolveOnUnsuccessful, + })({ + init: async () => { + const response = await lro.sendInitialRequest(); + const config = inferLroMode({ + rawResponse: response.rawResponse, + requestPath: lro.requestPath, + requestMethod: lro.requestMethod, + resourceLocationConfig, + }); + return { + response, + operationLocation: config?.operationLocation, + resourceLocation: config?.resourceLocation, + ...(config?.mode ? { metadata: { mode: config.mode } } : {}), + }; + }, + poll: lro.sendPollRequest, + }, { + intervalInMs, + withOperationLocation, + restoreFrom, + updateState, + processResult: processResult + ? ({ flatResponse }, state) => processResult(flatResponse, state) + : ({ flatResponse }) => flatResponse, + }); +} +//# sourceMappingURL=poller.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/index.js b/node_modules/@azure/core-lro/dist/react-native/index.js new file mode 100644 index 000000000..3952c2ad9 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/index.js @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { createHttpPoller } from "./http/poller.js"; +/** + * This can be uncommented to expose the protocol-agnostic poller + */ +// export { +// BuildCreatePollerOptions, +// Operation, +// CreatePollerOptions, +// OperationConfig, +// RestorableOperationState, +// } from "./poller/models"; +// export { buildCreatePoller } from "./poller/poller"; +/** legacy */ +export * from "./legacy/lroEngine/index.js"; +export * from "./legacy/poller.js"; +export * from "./legacy/pollOperation.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/index.js b/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/index.js new file mode 100644 index 000000000..ec178056a --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/index.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { LroEngine } from "./lroEngine.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/lroEngine.js b/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/lroEngine.js new file mode 100644 index 000000000..351691a7b --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/lroEngine.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { GenericPollOperation } from "./operation.js"; +import { POLL_INTERVAL_IN_MS } from "../../poller/constants.js"; +import { Poller } from "../poller.js"; +import { deserializeState } from "../../poller/operation.js"; +/** + * The LRO Engine, a class that performs polling. + */ +export class LroEngine extends Poller { + config; + constructor(lro, options) { + const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {}; + const state = resumeFrom + ? deserializeState(resumeFrom) + : {}; + const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); + super(operation); + this.resolveOnUnsuccessful = resolveOnUnsuccessful; + this.config = { intervalInMs: intervalInMs }; + operation.setPollerConfig(this.config); + } + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs)); + } +} +//# sourceMappingURL=lroEngine.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/models.js b/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/models.js new file mode 100644 index 000000000..63155a9f0 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/models.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/operation.js b/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/operation.js new file mode 100644 index 000000000..4051ad80d --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/legacy/lroEngine/operation.js @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { initHttpOperation, pollHttpOperation } from "../../http/operation.js"; +import { logger } from "../../logger.js"; +const createStateProxy = () => ({ + initState: (config) => ({ config, isStarted: true }), + setCanceled: (state) => (state.isCancelled = true), + setError: (state, error) => (state.error = error), + setResult: (state, result) => (state.result = result), + setRunning: (state) => (state.isStarted = true), + setSucceeded: (state) => (state.isCompleted = true), + setFailed: () => { + /** empty body */ + }, + getError: (state) => state.error, + getResult: (state) => state.result, + isCanceled: (state) => !!state.isCancelled, + isFailed: (state) => !!state.error, + isRunning: (state) => !!state.isStarted, + isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error), +}); +export class GenericPollOperation { + state; + lro; + setErrorAsResult; + lroResourceLocationConfig; + processResult; + updateState; + isDone; + pollerConfig; + constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) { + this.state = state; + this.lro = lro; + this.setErrorAsResult = setErrorAsResult; + this.lroResourceLocationConfig = lroResourceLocationConfig; + this.processResult = processResult; + this.updateState = updateState; + this.isDone = isDone; + } + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; + } + async update(options) { + const stateProxy = createStateProxy(); + if (!this.state.isStarted) { + this.state = { + ...this.state, + ...(await initHttpOperation({ + lro: this.lro, + stateProxy, + resourceLocationConfig: this.lroResourceLocationConfig, + processResult: this.processResult, + setErrorAsResult: this.setErrorAsResult, + })), + }; + } + const updateState = this.updateState; + const isDone = this.isDone; + if (!this.state.isCompleted && this.state.error === undefined) { + await pollHttpOperation({ + lro: this.lro, + state: this.state, + stateProxy, + processResult: this.processResult, + updateState: updateState + ? (state, { rawResponse }) => updateState(state, rawResponse) + : undefined, + isDone: isDone + ? ({ flatResponse }, state) => isDone(flatResponse, state) + : undefined, + options, + setDelay: (intervalInMs) => { + this.pollerConfig.intervalInMs = intervalInMs; + }, + setErrorAsResult: this.setErrorAsResult, + }); + } + options?.fireProgress?.(this.state); + return this; + } + async cancel() { + logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; + } + /** + * Serializes the Poller operation. + */ + toString() { + return JSON.stringify({ + state: this.state, + }); + } +} +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/legacy/models.js b/node_modules/@azure/core-lro/dist/react-native/legacy/models.js new file mode 100644 index 000000000..63155a9f0 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/legacy/models.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/legacy/pollOperation.js b/node_modules/@azure/core-lro/dist/react-native/legacy/pollOperation.js new file mode 100644 index 000000000..f8c1767df --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/legacy/pollOperation.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=pollOperation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/legacy/poller.js b/node_modules/@azure/core-lro/dist/react-native/legacy/poller.js new file mode 100644 index 000000000..de6f912e6 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/legacy/poller.js @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * When a poller is manually stopped through the `stopPolling` method, + * the poller will be rejected with an instance of the PollerStoppedError. + */ +export class PollerStoppedError extends Error { + constructor(message) { + super(message); + this.name = "PollerStoppedError"; + Object.setPrototypeOf(this, PollerStoppedError.prototype); + } +} +/** + * When the operation is cancelled, the poller will be rejected with an instance + * of the PollerCancelledError. + */ +export class PollerCancelledError extends Error { + constructor(message) { + super(message); + this.name = "PollerCancelledError"; + Object.setPrototypeOf(this, PollerCancelledError.prototype); + } +} +/** + * A class that represents the definition of a program that polls through consecutive requests + * until it reaches a state of completion. + * + * A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed. + * It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes. + * Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation. + * + * ```ts + * const poller = new MyPoller(); + * + * // Polling just once: + * await poller.poll(); + * + * // We can try to cancel the request here, by calling: + * // + * // await poller.cancelOperation(); + * // + * + * // Getting the final result: + * const result = await poller.pollUntilDone(); + * ``` + * + * The Poller is defined by two types, a type representing the state of the poller, which + * must include a basic set of properties from `PollOperationState`, + * and a return type defined by `TResult`, which can be anything. + * + * The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having + * to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type. + * + * ```ts + * class Client { + * public async makePoller: PollerLike { + * const poller = new MyPoller({}); + * // It might be preferred to return the poller after the first request is made, + * // so that some information can be obtained right away. + * await poller.poll(); + * return poller; + * } + * } + * + * const poller: PollerLike = myClient.makePoller(); + * ``` + * + * A poller can be created through its constructor, then it can be polled until it's completed. + * At any point in time, the state of the poller can be obtained without delay through the getOperationState method. + * At any point in time, the intermediate forms of the result type can be requested without delay. + * Once the underlying operation is marked as completed, the poller will stop and the final value will be returned. + * + * ```ts + * const poller = myClient.makePoller(); + * const state: MyOperationState = poller.getOperationState(); + * + * // The intermediate result can be obtained at any time. + * const result: MyResult | undefined = poller.getResult(); + * + * // The final result can only be obtained after the poller finishes. + * const result: MyResult = await poller.pollUntilDone(); + * ``` + * + */ +// eslint-disable-next-line no-use-before-define +export class Poller { + /** controls whether to throw an error if the operation failed or was canceled. */ + resolveOnUnsuccessful = false; + stopped = true; + resolve; + reject; + pollOncePromise; + cancelPromise; + promise; + pollProgressCallbacks = []; + /** + * The poller's operation is available in full to any of the methods of the Poller class + * and any class extending the Poller class. + */ + operation; + /** + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. + * + * When writing an implementation of a Poller, this implementation needs to deal with the initialization + * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's + * operation has already been defined, at least its basic properties. The code below shows how to approach + * the definition of the constructor of a new custom poller. + * + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; + * + * const operation = { + * state, + * update, + * cancel, + * toString + * } + * + * // Sending the operation to the parent's constructor. + * super(operation); + * + * // You can assign more local properties here. + * } + * } + * ``` + * + * Inside of this constructor, a new promise is created. This will be used to + * tell the user when the poller finishes (see `pollUntilDone()`). The promise's + * resolve and reject methods are also used internally to control when to resolve + * or reject anyone waiting for the poller to finish. + * + * The constructor of a custom implementation of a poller is where any serialized version of + * a previous poller's operation should be deserialized into the operation sent to the + * base constructor. For example: + * + * ```ts + * export class MyPoller extends Poller { + * constructor( + * baseOperation: string | undefined + * ) { + * let state: MyOperationState = {}; + * if (baseOperation) { + * state = { + * ...JSON.parse(baseOperation).state, + * ...state + * }; + * } + * const operation = { + * state, + * // ... + * } + * super(operation); + * } + * } + * ``` + * + * @param operation - Must contain the basic properties of `PollOperation`. + */ + constructor(operation) { + this.operation = operation; + this.promise = new Promise((resolve, reject) => { + this.resolve = resolve; + this.reject = reject; + }); + // This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown. + // The above warning would get thrown if `poller.poll` is called, it returns an error, + // and pullUntilDone did not have a .catch or await try/catch on it's return value. + this.promise.catch(() => { + /* intentionally blank */ + }); + } + /** + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. + */ + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } + } + /** + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * @param options - Optional properties passed to the operation's update method. + */ + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this), + }); + } + this.processUpdatedState(); + } + /** + * fireProgress calls the functions passed in via onProgress the method of the poller. + * + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. + * + * @param state - The current operation state. + */ + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } + } + /** + * Invokes the underlying operation's cancel method. + */ + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); + } + /** + * Returns a promise that will resolve once a single polling request finishes. + * It does this by calling the update method of the Poller's operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * @param options - Optional properties passed to the operation's update method. + */ + poll(options = {}) { + if (!this.pollOncePromise) { + this.pollOncePromise = this.pollOnce(options); + const clearPollOncePromise = () => { + this.pollOncePromise = undefined; + }; + this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject); + } + return this.pollOncePromise; + } + processUpdatedState() { + if (this.operation.state.error) { + this.stopped = true; + if (!this.resolveOnUnsuccessful) { + this.reject(this.operation.state.error); + throw this.operation.state.error; + } + } + if (this.operation.state.isCancelled) { + this.stopped = true; + if (!this.resolveOnUnsuccessful) { + const error = new PollerCancelledError("Operation was canceled"); + this.reject(error); + throw error; + } + } + if (this.isDone() && this.resolve) { + // If the poller has finished polling, this means we now have a result. + // However, it can be the case that TResult is instantiated to void, so + // we are not expecting a result anyway. To assert that we might not + // have a result eventually after finishing polling, we cast the result + // to TResult. + this.resolve(this.getResult()); + } + } + /** + * Returns a promise that will resolve once the underlying operation is completed. + */ + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + // This is needed because the state could have been updated by + // `cancelOperation`, e.g. the operation is canceled or an error occurred. + this.processUpdatedState(); + return this.promise; + } + /** + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. + * + * It returns a method that can be used to stop receiving updates on the given callback function. + */ + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; + } + /** + * Returns true if the poller has finished polling. + */ + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); + } + /** + * Stops the poller from continuing to poll. + */ + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } + } + /** + * Returns true if the poller is stopped. + */ + isStopped() { + return this.stopped; + } + /** + * Attempts to cancel the underlying operation. + * + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * + * If it's called again before it finishes, it will throw an error. + * + * @param options - Optional properties passed to the operation's update method. + */ + cancelOperation(options = {}) { + if (!this.cancelPromise) { + this.cancelPromise = this.cancelOnce(options); + } + else if (options.abortSignal) { + throw new Error("A cancel request is currently pending"); + } + return this.cancelPromise; + } + /** + * Returns the state of the operation. + * + * Even though TState will be the same type inside any of the methods of any extension of the Poller class, + * implementations of the pollers can customize what's shared with the public by writing their own + * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller + * and a public type representing a safe to share subset of the properties of the internal state. + * Their definition of getOperationState can then return their public type. + * + * Example: + * + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } + * + * // To allow us to have a true separation of public and private state, we have to define another interface: + * interface PublicState extends PollOperationState { + * publicProperty?: string; + * } + * + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... + * + * public getOperationState(): PublicState { + * const state: PublicState = this.operation.state; + * return { + * // Properties from PollOperationState + * isStarted: state.isStarted, + * isCompleted: state.isCompleted, + * isCancelled: state.isCancelled, + * error: state.error, + * result: state.result, + * + * // The only other property needed by PublicState. + * publicProperty: state.publicProperty + * } + * } + * } + * ``` + * + * You can see this in the tests of this repository, go to the file: + * `../test/utils/testPoller.ts` + * and look for the getOperationState implementation. + */ + getOperationState() { + return this.operation.state; + } + /** + * Returns the result value of the operation, + * regardless of the state of the poller. + * It can return undefined or an incomplete form of the final TResult value + * depending on the implementation. + */ + getResult() { + const state = this.operation.state; + return state.result; + } + /** + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. + */ + toString() { + return this.operation.toString(); + } +} +//# sourceMappingURL=poller.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/logger.js b/node_modules/@azure/core-lro/dist/react-native/logger.js new file mode 100644 index 000000000..094bfe421 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/logger.js @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { createClientLogger } from "@azure/logger"; +/** + * The `@azure/logger` configuration for this package. + * @internal + */ +export const logger = createClientLogger("core-lro"); +//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/package.json b/node_modules/@azure/core-lro/dist/react-native/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-lro/dist/react-native/poller/constants.js b/node_modules/@azure/core-lro/dist/react-native/poller/constants.js new file mode 100644 index 000000000..e35aad76b --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/poller/constants.js @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * The default time interval to wait before sending the next polling request. + */ +export const POLL_INTERVAL_IN_MS = 2000; +/** + * The closed set of terminal states. + */ +export const terminalStates = ["succeeded", "canceled", "failed"]; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/poller/models.js b/node_modules/@azure/core-lro/dist/react-native/poller/models.js new file mode 100644 index 000000000..63155a9f0 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/poller/models.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/poller/operation.js b/node_modules/@azure/core-lro/dist/react-native/poller/operation.js new file mode 100644 index 000000000..869eaa528 --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/poller/operation.js @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { logger } from "../logger.js"; +import { terminalStates } from "./constants.js"; +/** + * Deserializes the state + */ +export function deserializeState(serializedState) { + try { + return JSON.parse(serializedState).state; + } + catch (e) { + throw new Error(`Unable to deserialize input state: ${serializedState}`); + } +} +function setStateError(inputs) { + const { state, stateProxy, isOperationError } = inputs; + return (error) => { + if (isOperationError(error)) { + stateProxy.setError(state, error); + stateProxy.setFailed(state); + } + throw error; + }; +} +function appendReadableErrorMessage(currentMessage, innerMessage) { + let message = currentMessage; + if (message.slice(-1) !== ".") { + message = message + "."; + } + return message + " " + innerMessage; +} +function simplifyError(err) { + let message = err.message; + let code = err.code; + let curErr = err; + while (curErr.innererror) { + curErr = curErr.innererror; + code = curErr.code; + message = appendReadableErrorMessage(message, curErr.message); + } + return { + code, + message, + }; +} +function processOperationStatus(result) { + const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; + switch (status) { + case "succeeded": { + stateProxy.setSucceeded(state); + break; + } + case "failed": { + const err = getError?.(response); + let postfix = ""; + if (err) { + const { code, message } = simplifyError(err); + postfix = `. ${code}. ${message}`; + } + const errStr = `The long-running operation has failed${postfix}`; + stateProxy.setError(state, new Error(errStr)); + stateProxy.setFailed(state); + logger.warning(errStr); + break; + } + case "canceled": { + stateProxy.setCanceled(state); + break; + } + } + if (isDone?.(response, state) || + (isDone === undefined && + ["succeeded", "canceled"].concat(setErrorAsResult ? [] : ["failed"]).includes(status))) { + stateProxy.setResult(state, buildResult({ + response, + state, + processResult, + })); + } +} +function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; +} +/** + * Initiates the long-running operation. + */ +export async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + if (operationLocation) + withOperationLocation?.(operationLocation, false); + const config = { + metadata, + operationLocation, + resourceLocation, + }; + logger.verbose(`LRO: Operation description:`, config); + const state = stateProxy.initState(config); + const status = getOperationStatus({ response, state, operationLocation }); + processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); + return state; +} +async function pollOperationHelper(inputs) { + const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options, } = inputs; + const response = await poll(operationLocation, options).catch(setStateError({ + state, + stateProxy, + isOperationError, + })); + const status = getOperationStatus(response, state); + logger.verbose(`LRO: Status:\n\tPolling from: ${state.config.operationLocation}\n\tOperation status: ${status}\n\tPolling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); + if (status === "succeeded") { + const resourceLocation = getResourceLocation(response, state); + if (resourceLocation !== undefined) { + return { + response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })), + status, + }; + } + } + return { response, status }; +} +/** Polls the long-running operation. */ +export async function pollOperation(inputs) { + const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs; + const { operationLocation } = state.config; + if (operationLocation !== undefined) { + const { response, status } = await pollOperationHelper({ + poll, + getOperationStatus, + state, + stateProxy, + operationLocation, + getResourceLocation, + isOperationError, + options, + }); + processOperationStatus({ + status, + response, + state, + stateProxy, + isDone, + processResult, + getError, + setErrorAsResult, + }); + if (!terminalStates.includes(status)) { + const intervalInMs = getPollingInterval?.(response); + if (intervalInMs) + setDelay(intervalInMs); + const location = getOperationLocation?.(response, state); + if (location !== undefined) { + const isUpdated = operationLocation !== location; + state.config.operationLocation = location; + withOperationLocation?.(location, isUpdated); + } + else + withOperationLocation?.(operationLocation, false); + } + updateState?.(state, response); + } +} +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/dist/react-native/poller/poller.js b/node_modules/@azure/core-lro/dist/react-native/poller/poller.js new file mode 100644 index 000000000..5fc9b09df --- /dev/null +++ b/node_modules/@azure/core-lro/dist/react-native/poller/poller.js @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { deserializeState, initOperation, pollOperation } from "./operation.js"; +import { POLL_INTERVAL_IN_MS } from "./constants.js"; +import { delay } from "@azure/core-util"; +const createStateProxy = () => ({ + /** + * The state at this point is created to be of type OperationState. + * It will be updated later to be of type TState when the + * customer-provided callback, `updateState`, is called during polling. + */ + initState: (config) => ({ status: "running", config }), + setCanceled: (state) => (state.status = "canceled"), + setError: (state, error) => (state.error = error), + setResult: (state, result) => (state.result = result), + setRunning: (state) => (state.status = "running"), + setSucceeded: (state) => (state.status = "succeeded"), + setFailed: (state) => (state.status = "failed"), + getError: (state) => state.error, + getResult: (state) => state.result, + isCanceled: (state) => state.status === "canceled", + isFailed: (state) => state.status === "failed", + isRunning: (state) => state.status === "running", + isSucceeded: (state) => state.status === "succeeded", +}); +/** + * Returns a poller factory. + */ +export function buildCreatePoller(inputs) { + const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs; + return async ({ init, poll }, options) => { + const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {}; + const stateProxy = createStateProxy(); + const withOperationLocation = withOperationLocationCallback + ? (() => { + let called = false; + return (operationLocation, isUpdated) => { + if (isUpdated) + withOperationLocationCallback(operationLocation); + else if (!called) + withOperationLocationCallback(operationLocation); + called = true; + }; + })() + : undefined; + const state = restoreFrom + ? deserializeState(restoreFrom) + : await initOperation({ + init, + stateProxy, + processResult, + getOperationStatus: getStatusFromInitialResponse, + withOperationLocation, + setErrorAsResult: !resolveOnUnsuccessful, + }); + let resultPromise; + const abortController = new AbortController(); + const handlers = new Map(); + const handleProgressEvents = async () => handlers.forEach((h) => h(state)); + const cancelErrMsg = "Operation was canceled"; + let currentPollIntervalInMs = intervalInMs; + const poller = { + getOperationState: () => state, + getResult: () => state.result, + isDone: () => ["succeeded", "failed", "canceled"].includes(state.status), + isStopped: () => resultPromise === undefined, + stopPolling: () => { + abortController.abort(); + }, + toString: () => JSON.stringify({ + state, + }), + onProgress: (callback) => { + const s = Symbol(); + handlers.set(s, callback); + return () => handlers.delete(s); + }, + pollUntilDone: (pollOptions) => (resultPromise ??= (async () => { + const { abortSignal: inputAbortSignal } = pollOptions || {}; + // In the future we can use AbortSignal.any() instead + function abortListener() { + abortController.abort(); + } + const abortSignal = abortController.signal; + if (inputAbortSignal?.aborted) { + abortController.abort(); + } + else if (!abortSignal.aborted) { + inputAbortSignal?.addEventListener("abort", abortListener, { once: true }); + } + try { + if (!poller.isDone()) { + await poller.poll({ abortSignal }); + while (!poller.isDone()) { + await delay(currentPollIntervalInMs, { abortSignal }); + await poller.poll({ abortSignal }); + } + } + } + finally { + inputAbortSignal?.removeEventListener("abort", abortListener); + } + if (resolveOnUnsuccessful) { + return poller.getResult(); + } + else { + switch (state.status) { + case "succeeded": + return poller.getResult(); + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + case "notStarted": + case "running": + throw new Error(`Polling completed without succeeding or failing`); + } + } + })().finally(() => { + resultPromise = undefined; + })), + async poll(pollOptions) { + if (resolveOnUnsuccessful) { + if (poller.isDone()) + return; + } + else { + switch (state.status) { + case "succeeded": + return; + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + } + } + await pollOperation({ + poll, + state, + stateProxy, + getOperationLocation, + isOperationError, + withOperationLocation, + getPollingInterval, + getOperationStatus: getStatusFromPollResponse, + getResourceLocation, + processResult, + getError, + updateState, + options: pollOptions, + setDelay: (pollIntervalInMs) => { + currentPollIntervalInMs = pollIntervalInMs; + }, + setErrorAsResult: !resolveOnUnsuccessful, + }); + await handleProgressEvents(); + if (!resolveOnUnsuccessful) { + switch (state.status) { + case "canceled": + throw new Error(cancelErrMsg); + case "failed": + throw state.error; + } + } + }, + }; + return poller; + }; +} +//# sourceMappingURL=poller.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-lro/package.json b/node_modules/@azure/core-lro/package.json index 64b8e20eb..ac10fd5df 100644 --- a/node_modules/@azure/core-lro/package.json +++ b/node_modules/@azure/core-lro/package.json @@ -2,8 +2,38 @@ "name": "@azure/core-lro", "author": "Microsoft Corporation", "sdk-type": "client", - "version": "2.6.0", + "type": "module", + "version": "2.7.1", "description": "Isomorphic client library for supporting long-running operations in node.js and browser.", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "files": [ + "dist/", + "LICENSE", + "README.md" + ], + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "browser": "./dist/browser/index.js", "tags": [ "isomorphic", "browser", @@ -24,103 +54,76 @@ "azure", "cloud" ], - "main": "./dist/index.js", - "module": "dist-esm/src/index.js", - "types": "./types/core-lro.d.ts", - "files": [ - "types/core-lro.d.ts", - "dist-esm/src", - "dist/", - "README.md", - "LICENSE" - ], "engines": { "node": ">=18.0.0" }, - "browser": { - "os": false, - "process": false - }, - "react-native": { - "./dist/index.js": "./dist-esm/src/index.js" - }, "license": "MIT", "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/README.md", "repository": "github:Azure/azure-sdk-for-js", "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "nyc": { - "extension": [ - ".ts" - ], - "exclude": [ - "coverage/**/*", - "**/*.d.ts", - "**/*.js" - ], - "reporter": [ - "text", - "html", - "cobertura" - ], - "all": true - }, + "sideEffects": false, "scripts": { "build:samples": "echo Obsolete", - "build:test": "tsc -p . && dev-tool run bundle", - "build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local", - "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "clean": "rimraf dist dist-* types *.log browser statistics.html coverage src/**/*.js test/**/*.js", + "build:test": "npm run clean && tshy && dev-tool run build-test", + "build": "npm run clean && tshy && api-extractor run --local", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "clean": "rimraf --glob dist dist-* types *.log browser statistics.html coverage src/**/*.js test/**/*.js", "execute:samples": "echo skipped", - "extract-api": "tsc -p . && api-extractor run --local", - "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "extract-api": "tshy && api-extractor run --local", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint package.json api-extractor.json src test --ext .ts", + "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts", "pack": "npm pack 2>&1", "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", "test:node": "npm run build:test && npm run unit-test:node && npm run integration-test:node", "test": "npm run build:test && npm run unit-test", - "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "karma start --single-run", - "unit-test:node": "dev-tool run test:node-ts-input --no-test-proxy=true" + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser", + "unit-test:node": "dev-tool run test:vitest --no-test-proxy", + "unit-test": "npm run unit-test:node && npm run unit-test:browser" }, - "sideEffects": false, "dependencies": { "@azure/abort-controller": "^2.0.0", "@azure/core-util": "^1.2.0", "@azure/logger": "^1.0.0", - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "devDependencies": { "@azure/core-rest-pipeline": "^1.1.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/test-utils": "^1.0.0", - "@microsoft/api-extractor": "^7.31.1", - "@types/mocha": "^10.0.0", + "@microsoft/api-extractor": "^7.40.3", "@types/node": "^18.0.0", - "cross-env": "^7.0.2", - "eslint": "^8.0.0", - "karma": "^6.2.0", - "karma-chrome-launcher": "^3.0.0", - "karma-coverage": "^2.0.0", - "karma-env-preprocessor": "^0.1.1", - "karma-firefox-launcher": "^1.1.0", - "karma-junit-reporter": "^2.0.1", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-sourcemap-loader": "^0.3.8", - "mocha": "^10.0.0", - "c8": "^8.0.0", - "rimraf": "^3.0.0", - "ts-node": "^10.0.0", - "typescript": "~5.3.3" + "@vitest/browser": "^1.3.1", + "@vitest/coverage-istanbul": "^1.3.1", + "eslint": "^8.56.0", + "playwright": "^1.41.2", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "tshy": "^1.11.1", + "typescript": "~5.3.3", + "vitest": "^1.3.1" }, "//metadata": { "migrationDate": "2023-03-08T18:36:03.000Z" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false } } diff --git a/node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js b/node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js deleted file mode 100644 index bdcbbf7b5..000000000 --- a/node_modules/@azure/core-paging/dist-esm/src/getPagedAsyncIterator.js +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib"; -/** - * returns an async iterator that iterates over results. It also has a `byPage` - * method that returns pages of items at once. - * - * @param pagedResult - an object that specifies how to get pages. - * @returns a paged async iterator that iterates over results. - */ -export function getPagedAsyncIterator(pagedResult) { - var _a; - const iter = getItemAsyncIterator(pagedResult); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => { - const { continuationToken, maxPageSize } = settings !== null && settings !== void 0 ? settings : {}; - return getPageAsyncIterator(pagedResult, { - pageLink: continuationToken, - maxPageSize, - }); - }), - }; -} -function getItemAsyncIterator(pagedResult) { - return __asyncGenerator(this, arguments, function* getItemAsyncIterator_1() { - var e_1, _a, e_2, _b; - const pages = getPageAsyncIterator(pagedResult); - const firstVal = yield __await(pages.next()); - // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is - if (!Array.isArray(firstVal.value)) { - // can extract elements from this page - const { toElements } = pagedResult; - if (toElements) { - yield __await(yield* __asyncDelegator(__asyncValues(toElements(firstVal.value)))); - try { - for (var pages_1 = __asyncValues(pages), pages_1_1; pages_1_1 = yield __await(pages_1.next()), !pages_1_1.done;) { - const page = pages_1_1.value; - yield __await(yield* __asyncDelegator(__asyncValues(toElements(page)))); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (pages_1_1 && !pages_1_1.done && (_a = pages_1.return)) yield __await(_a.call(pages_1)); - } - finally { if (e_1) throw e_1.error; } - } - } - else { - yield yield __await(firstVal.value); - // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case - yield __await(yield* __asyncDelegator(__asyncValues(pages))); - } - } - else { - yield __await(yield* __asyncDelegator(__asyncValues(firstVal.value))); - try { - for (var pages_2 = __asyncValues(pages), pages_2_1; pages_2_1 = yield __await(pages_2.next()), !pages_2_1.done;) { - const page = pages_2_1.value; - // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch, - // it must be the case that `TPage = TElement[]` - yield __await(yield* __asyncDelegator(__asyncValues(page))); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (pages_2_1 && !pages_2_1.done && (_b = pages_2.return)) yield __await(_b.call(pages_2)); - } - finally { if (e_2) throw e_2.error; } - } - } - }); -} -function getPageAsyncIterator(pagedResult, options = {}) { - return __asyncGenerator(this, arguments, function* getPageAsyncIterator_1() { - const { pageLink, maxPageSize } = options; - let response = yield __await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink, maxPageSize)); - if (!response) { - return yield __await(void 0); - } - yield yield __await(response.page); - while (response.nextPageLink) { - response = yield __await(pagedResult.getPage(response.nextPageLink, maxPageSize)); - if (!response) { - return yield __await(void 0); - } - yield yield __await(response.page); - } - }); -} -//# sourceMappingURL=getPagedAsyncIterator.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/browser/getPagedAsyncIterator.js b/node_modules/@azure/core-paging/dist/browser/getPagedAsyncIterator.js new file mode 100644 index 000000000..d9db4b998 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/browser/getPagedAsyncIterator.js @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ +export function getPagedAsyncIterator(pagedResult) { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: pagedResult?.byPage ?? + ((settings) => { + const { continuationToken, maxPageSize } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + maxPageSize, + }); + }), + }; +} +async function* getItemAsyncIterator(pagedResult) { + const pages = getPageAsyncIterator(pagedResult); + const firstVal = await pages.next(); + // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is + if (!Array.isArray(firstVal.value)) { + // can extract elements from this page + const { toElements } = pagedResult; + if (toElements) { + yield* toElements(firstVal.value); + for await (const page of pages) { + yield* toElements(page); + } + } + else { + yield firstVal.value; + // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case + yield* pages; + } + } + else { + yield* firstVal.value; + for await (const page of pages) { + // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch, + // it must be the case that `TPage = TElement[]` + yield* page; + } + } +} +async function* getPageAsyncIterator(pagedResult, options = {}) { + const { pageLink, maxPageSize } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink, maxPageSize); + if (!response) { + return; + } + yield response.page; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink, maxPageSize); + if (!response) { + return; + } + yield response.page; + } +} +//# sourceMappingURL=getPagedAsyncIterator.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/browser/index.js b/node_modules/@azure/core-paging/dist/browser/index.js new file mode 100644 index 000000000..4dca636c8 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/browser/index.js @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export * from "./models.js"; +export * from "./getPagedAsyncIterator.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/browser/models.js b/node_modules/@azure/core-paging/dist/browser/models.js new file mode 100644 index 000000000..63155a9f0 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/browser/models.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/browser/package.json b/node_modules/@azure/core-paging/dist/browser/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/browser/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-paging/dist/commonjs/getPagedAsyncIterator.js b/node_modules/@azure/core-paging/dist/commonjs/getPagedAsyncIterator.js new file mode 100644 index 000000000..6e3c89752 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/commonjs/getPagedAsyncIterator.js @@ -0,0 +1,76 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getPagedAsyncIterator = void 0; +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ +function getPagedAsyncIterator(pagedResult) { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: pagedResult?.byPage ?? + ((settings) => { + const { continuationToken, maxPageSize } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + maxPageSize, + }); + }), + }; +} +exports.getPagedAsyncIterator = getPagedAsyncIterator; +async function* getItemAsyncIterator(pagedResult) { + const pages = getPageAsyncIterator(pagedResult); + const firstVal = await pages.next(); + // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is + if (!Array.isArray(firstVal.value)) { + // can extract elements from this page + const { toElements } = pagedResult; + if (toElements) { + yield* toElements(firstVal.value); + for await (const page of pages) { + yield* toElements(page); + } + } + else { + yield firstVal.value; + // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case + yield* pages; + } + } + else { + yield* firstVal.value; + for await (const page of pages) { + // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch, + // it must be the case that `TPage = TElement[]` + yield* page; + } + } +} +async function* getPageAsyncIterator(pagedResult, options = {}) { + const { pageLink, maxPageSize } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink, maxPageSize); + if (!response) { + return; + } + yield response.page; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink, maxPageSize); + if (!response) { + return; + } + yield response.page; + } +} +//# sourceMappingURL=getPagedAsyncIterator.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/commonjs/index.js b/node_modules/@azure/core-paging/dist/commonjs/index.js new file mode 100644 index 000000000..1b4002368 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/commonjs/index.js @@ -0,0 +1,8 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./models.js"), exports); +tslib_1.__exportStar(require("./getPagedAsyncIterator.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/commonjs/models.js b/node_modules/@azure/core-paging/dist/commonjs/models.js new file mode 100644 index 000000000..783931f30 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/commonjs/models.js @@ -0,0 +1,5 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/commonjs/package.json b/node_modules/@azure/core-paging/dist/commonjs/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/node_modules/@azure/core-paging/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/@azure/core-paging/dist/commonjs/tsdoc-metadata.json b/node_modules/@azure/core-paging/dist/commonjs/tsdoc-metadata.json new file mode 100644 index 000000000..22735db17 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/commonjs/tsdoc-metadata.json @@ -0,0 +1,11 @@ +// This file is read by tools that parse documentation comments conforming to the TSDoc standard. +// It should be published with your NPM package. It should not be tracked by Git. +{ + "tsdocVersion": "0.12", + "toolPackages": [ + { + "packageName": "@microsoft/api-extractor", + "packageVersion": "7.42.3" + } + ] +} diff --git a/node_modules/@azure/core-paging/dist/esm/getPagedAsyncIterator.js b/node_modules/@azure/core-paging/dist/esm/getPagedAsyncIterator.js new file mode 100644 index 000000000..d9db4b998 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/esm/getPagedAsyncIterator.js @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ +export function getPagedAsyncIterator(pagedResult) { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: pagedResult?.byPage ?? + ((settings) => { + const { continuationToken, maxPageSize } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + maxPageSize, + }); + }), + }; +} +async function* getItemAsyncIterator(pagedResult) { + const pages = getPageAsyncIterator(pagedResult); + const firstVal = await pages.next(); + // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is + if (!Array.isArray(firstVal.value)) { + // can extract elements from this page + const { toElements } = pagedResult; + if (toElements) { + yield* toElements(firstVal.value); + for await (const page of pages) { + yield* toElements(page); + } + } + else { + yield firstVal.value; + // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case + yield* pages; + } + } + else { + yield* firstVal.value; + for await (const page of pages) { + // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch, + // it must be the case that `TPage = TElement[]` + yield* page; + } + } +} +async function* getPageAsyncIterator(pagedResult, options = {}) { + const { pageLink, maxPageSize } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink, maxPageSize); + if (!response) { + return; + } + yield response.page; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink, maxPageSize); + if (!response) { + return; + } + yield response.page; + } +} +//# sourceMappingURL=getPagedAsyncIterator.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/esm/index.js b/node_modules/@azure/core-paging/dist/esm/index.js new file mode 100644 index 000000000..4dca636c8 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/esm/index.js @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export * from "./models.js"; +export * from "./getPagedAsyncIterator.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/esm/models.js b/node_modules/@azure/core-paging/dist/esm/models.js new file mode 100644 index 000000000..63155a9f0 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/esm/models.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/esm/package.json b/node_modules/@azure/core-paging/dist/esm/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-paging/dist/index.js b/node_modules/@azure/core-paging/dist/index.js deleted file mode 100644 index 7ccb62e02..000000000 --- a/node_modules/@azure/core-paging/dist/index.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var tslib = require('tslib'); - -// Copyright (c) Microsoft Corporation. -/** - * returns an async iterator that iterates over results. It also has a `byPage` - * method that returns pages of items at once. - * - * @param pagedResult - an object that specifies how to get pages. - * @returns a paged async iterator that iterates over results. - */ -function getPagedAsyncIterator(pagedResult) { - var _a; - const iter = getItemAsyncIterator(pagedResult); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => { - const { continuationToken, maxPageSize } = settings !== null && settings !== void 0 ? settings : {}; - return getPageAsyncIterator(pagedResult, { - pageLink: continuationToken, - maxPageSize, - }); - }), - }; -} -function getItemAsyncIterator(pagedResult) { - return tslib.__asyncGenerator(this, arguments, function* getItemAsyncIterator_1() { - var e_1, _a, e_2, _b; - const pages = getPageAsyncIterator(pagedResult); - const firstVal = yield tslib.__await(pages.next()); - // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is - if (!Array.isArray(firstVal.value)) { - // can extract elements from this page - const { toElements } = pagedResult; - if (toElements) { - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(toElements(firstVal.value)))); - try { - for (var pages_1 = tslib.__asyncValues(pages), pages_1_1; pages_1_1 = yield tslib.__await(pages_1.next()), !pages_1_1.done;) { - const page = pages_1_1.value; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(toElements(page)))); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (pages_1_1 && !pages_1_1.done && (_a = pages_1.return)) yield tslib.__await(_a.call(pages_1)); - } - finally { if (e_1) throw e_1.error; } - } - } - else { - yield yield tslib.__await(firstVal.value); - // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(pages))); - } - } - else { - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(firstVal.value))); - try { - for (var pages_2 = tslib.__asyncValues(pages), pages_2_1; pages_2_1 = yield tslib.__await(pages_2.next()), !pages_2_1.done;) { - const page = pages_2_1.value; - // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch, - // it must be the case that `TPage = TElement[]` - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page))); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (pages_2_1 && !pages_2_1.done && (_b = pages_2.return)) yield tslib.__await(_b.call(pages_2)); - } - finally { if (e_2) throw e_2.error; } - } - } - }); -} -function getPageAsyncIterator(pagedResult, options = {}) { - return tslib.__asyncGenerator(this, arguments, function* getPageAsyncIterator_1() { - const { pageLink, maxPageSize } = options; - let response = yield tslib.__await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink, maxPageSize)); - if (!response) { - return yield tslib.__await(void 0); - } - yield yield tslib.__await(response.page); - while (response.nextPageLink) { - response = yield tslib.__await(pagedResult.getPage(response.nextPageLink, maxPageSize)); - if (!response) { - return yield tslib.__await(void 0); - } - yield yield tslib.__await(response.page); - } - }); -} - -exports.getPagedAsyncIterator = getPagedAsyncIterator; -//# sourceMappingURL=index.js.map diff --git a/node_modules/@azure/core-paging/dist/react-native/getPagedAsyncIterator.js b/node_modules/@azure/core-paging/dist/react-native/getPagedAsyncIterator.js new file mode 100644 index 000000000..d9db4b998 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/react-native/getPagedAsyncIterator.js @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ +export function getPagedAsyncIterator(pagedResult) { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: pagedResult?.byPage ?? + ((settings) => { + const { continuationToken, maxPageSize } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + maxPageSize, + }); + }), + }; +} +async function* getItemAsyncIterator(pagedResult) { + const pages = getPageAsyncIterator(pagedResult); + const firstVal = await pages.next(); + // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is + if (!Array.isArray(firstVal.value)) { + // can extract elements from this page + const { toElements } = pagedResult; + if (toElements) { + yield* toElements(firstVal.value); + for await (const page of pages) { + yield* toElements(page); + } + } + else { + yield firstVal.value; + // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case + yield* pages; + } + } + else { + yield* firstVal.value; + for await (const page of pages) { + // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch, + // it must be the case that `TPage = TElement[]` + yield* page; + } + } +} +async function* getPageAsyncIterator(pagedResult, options = {}) { + const { pageLink, maxPageSize } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink, maxPageSize); + if (!response) { + return; + } + yield response.page; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink, maxPageSize); + if (!response) { + return; + } + yield response.page; + } +} +//# sourceMappingURL=getPagedAsyncIterator.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/react-native/index.js b/node_modules/@azure/core-paging/dist/react-native/index.js new file mode 100644 index 000000000..4dca636c8 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/react-native/index.js @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export * from "./models.js"; +export * from "./getPagedAsyncIterator.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/react-native/models.js b/node_modules/@azure/core-paging/dist/react-native/models.js new file mode 100644 index 000000000..63155a9f0 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/react-native/models.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export {}; +//# sourceMappingURL=models.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-paging/dist/react-native/package.json b/node_modules/@azure/core-paging/dist/react-native/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-paging/dist/react-native/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-paging/package.json b/node_modules/@azure/core-paging/package.json index b81bd9a9c..3ec4ece1e 100644 --- a/node_modules/@azure/core-paging/package.json +++ b/node_modules/@azure/core-paging/package.json @@ -2,8 +2,33 @@ "name": "@azure/core-paging", "author": "Microsoft Corporation", "sdk-type": "client", - "version": "1.5.0", + "version": "1.6.1", "description": "Core types for paging async iterable iterators", + "type": "module", + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "browser": "./dist/browser/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, "tags": [ "microsoft", "clientruntime" @@ -14,26 +39,13 @@ "azure", "cloud" ], - "main": "dist/index.js", - "module": "dist-esm/src/index.js", - "types": "./types/latest/core-paging.d.ts", - "typesVersions": { - "<3.6": { - "types/latest/*": [ - "types/3.1/*" - ] - } - }, "files": [ - "types/latest/core-paging.d.ts", - "types/3.1", "dist/", - "dist-esm/src/", "LICENSE", "README.md" ], "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" }, "license": "MIT", "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-paging/README.md", @@ -41,68 +53,72 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, + "sideEffects": true, + "private": false, "scripts": { - "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", "build:samples": "echo Obsolete", - "build:test": "echo skipped", - "build:types": "downlevel-dts types/latest/ types/3.1/", - "build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local && npm run build:types", - "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "clean": "rimraf dist dist-* temp *.tgz types *.log", + "build:test": "npm run clean && tshy && dev-tool run build-test", + "build": "npm run clean && tshy && api-extractor run --local", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "clean": "rimraf --glob dist dist-* temp *.tgz types *.log", "execute:samples": "echo skipped", - "extract-api": "tsc -p . && api-extractor run --local", - "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", + "extract-api": "tshy && api-extractor run --local", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"samples-dev/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint": "eslint package.json src --ext .ts", - "lint:fix": "eslint package.json src --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json src --ext .ts --ext .cts --ext .mts", + "lint:fix": "eslint package.json src --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]", "pack": "npm pack 2>&1", "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", - "test:node": "npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node", - "test": "npm run clean && tsc -p . && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", - "unit-test:browser": "karma start --single-run", - "unit-test:node": "mocha -r esm -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 50000 --full-trace --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\"", + "test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser", + "unit-test:node": "dev-tool run test:vitest --no-test-proxy", "unit-test": "npm run unit-test:node && npm run unit-test:browser" }, - "sideEffects": true, - "private": false, "dependencies": { - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "devDependencies": { "@azure/dev-tool": "^1.0.0", - "@microsoft/api-extractor": "^7.31.1", "@azure/eslint-plugin-azure-sdk": "^3.0.0", - "@types/chai": "^4.1.6", - "@types/mocha": "^7.0.2", - "@types/node": "^14.0.0", - "chai": "^4.2.0", - "downlevel-dts": "^0.10.0", - "eslint": "^8.0.0", - "karma": "^6.2.0", - "karma-chrome-launcher": "^3.0.0", - "karma-coverage": "^2.0.0", - "karma-edge-launcher": "^0.4.2", - "karma-env-preprocessor": "^0.1.1", - "karma-firefox-launcher": "^1.1.0", - "karma-ie-launcher": "^1.0.0", - "karma-junit-reporter": "^2.0.1", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-sourcemap-loader": "^0.3.8", - "mocha": "^7.1.1", - "mocha-junit-reporter": "^2.0.0", - "prettier": "^2.5.1", - "rimraf": "^3.0.0", - "typescript": "~4.8.0" + "@microsoft/api-extractor": "^7.40.3", + "@types/node": "^18.0.0", + "@vitest/browser": "^1.3.1", + "@vitest/coverage-istanbul": "^1.3.1", + "eslint": "^8.56.0", + "playwright": "^1.41.2", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "tshy": "^1.11.1", + "typescript": "~5.3.3", + "vitest": "^1.3.1" + }, + "//metadata": { + "sampleConfiguration": { + "skipFolder": true, + "disableDocsMs": true, + "productName": "Azure SDK Core", + "productSlugs": [ + "azure" + ] + }, + "migrationDate": "2023-03-08T18:36:03.000Z" }, - "//sampleConfiguration": { - "skipFolder": true, - "disableDocsMs": true, - "productName": "Azure SDK Core", - "productSlugs": [ - "azure" - ] + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false } } diff --git a/node_modules/@azure/core-util/dist-esm/index.js b/node_modules/@azure/core-util/dist-esm/index.js deleted file mode 100644 index 59c444f7a..000000000 --- a/node_modules/@azure/core-util/dist-esm/index.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -export { delay } from "./delay"; -export { cancelablePromiseRace, } from "./aborterUtils"; -export { createAbortablePromise, } from "./createAbortablePromise"; -export { getRandomIntegerInclusive } from "./random"; -export { isObject } from "./object"; -export { isError, getErrorMessage } from "./error"; -export { computeSha256Hash, computeSha256Hmac } from "./sha256"; -export { isDefined, isObjectWithProperties, objectHasProperty } from "./typeGuards"; -export { randomUUID } from "./uuidUtils"; -export { isBrowser, isBun, isNode, isDeno, isReactNative, isWebWorker } from "./checkEnvironment"; -export { uint8ArrayToString, stringToUint8Array } from "./bytesEncoding"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/aborterUtils.js b/node_modules/@azure/core-util/dist/browser/aborterUtils.js similarity index 62% rename from node_modules/@azure/core-util/dist-esm/aborterUtils.js rename to node_modules/@azure/core-util/dist/browser/aborterUtils.js index 3da2b2346..c34a95d10 100644 --- a/node_modules/@azure/core-util/dist-esm/aborterUtils.js +++ b/node_modules/@azure/core-util/dist/browser/aborterUtils.js @@ -4,18 +4,17 @@ * promise.race() wrapper that aborts rest of promises as soon as the first promise settles. */ export async function cancelablePromiseRace(abortablePromiseBuilders, options) { - var _a, _b; const aborter = new AbortController(); function abortHandler() { aborter.abort(); } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); + options?.abortSignal?.addEventListener("abort", abortHandler); try { return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); } finally { aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); + options?.abortSignal?.removeEventListener("abort", abortHandler); } } //# sourceMappingURL=aborterUtils.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/bytesEncoding.browser.js b/node_modules/@azure/core-util/dist/browser/bytesEncoding.js similarity index 98% rename from node_modules/@azure/core-util/dist-esm/bytesEncoding.browser.js rename to node_modules/@azure/core-util/dist/browser/bytesEncoding.js index a0f9c71d5..110dc7472 100644 --- a/node_modules/@azure/core-util/dist-esm/bytesEncoding.browser.js +++ b/node_modules/@azure/core-util/dist/browser/bytesEncoding.js @@ -107,4 +107,4 @@ export function hexStringToUint8Array(value) { } return bytes; } -//# sourceMappingURL=bytesEncoding.browser.js.map \ No newline at end of file +//# sourceMappingURL=bytesEncoding-browser.mjs.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/checkEnvironment.js b/node_modules/@azure/core-util/dist/browser/checkEnvironment.js similarity index 66% rename from node_modules/@azure/core-util/dist-esm/checkEnvironment.js rename to node_modules/@azure/core-util/dist/browser/checkEnvironment.js index d6e1d4542..53ba62e52 100644 --- a/node_modules/@azure/core-util/dist-esm/checkEnvironment.js +++ b/node_modules/@azure/core-util/dist/browser/checkEnvironment.js @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -var _a, _b, _c, _d; /** * A constant that indicates whether the environment the code is running is a Web Browser. */ @@ -10,31 +9,32 @@ export const isBrowser = typeof window !== "undefined" && typeof window.document * A constant that indicates whether the environment the code is running is a Web Worker. */ export const isWebWorker = typeof self === "object" && - typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" && - (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || - ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || - ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope"); + typeof self?.importScripts === "function" && + (self.constructor?.name === "DedicatedWorkerGlobalScope" || + self.constructor?.name === "ServiceWorkerGlobalScope" || + self.constructor?.name === "SharedWorkerGlobalScope"); /** * A constant that indicates whether the environment the code is running is Deno. */ export const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined"; -/** - * A constant that indicates whether the environment the code is running is Node.JS. - */ -export const isNode = typeof process !== "undefined" && - Boolean(process.version) && - Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node) && - // Deno thought it was a good idea to spoof process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions - !isDeno; /** * A constant that indicates whether the environment the code is running is Bun.sh. */ export const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is Node.JS. + */ +export const isNode = typeof globalThis.process !== "undefined" && + Boolean(globalThis.process.version) && + Boolean(globalThis.process.versions?.node) && + // Deno thought it was a good idea to spoof process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions + !isDeno && + !isBun; /** * A constant that indicates whether the environment the code is running is in React-Native. */ // https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js -export const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; +export const isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; //# sourceMappingURL=checkEnvironment.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/createAbortablePromise.js b/node_modules/@azure/core-util/dist/browser/createAbortablePromise.js similarity index 64% rename from node_modules/@azure/core-util/dist-esm/createAbortablePromise.js rename to node_modules/@azure/core-util/dist/browser/createAbortablePromise.js index 28c0d5aaa..fc54e7c74 100644 --- a/node_modules/@azure/core-util/dist-esm/createAbortablePromise.js +++ b/node_modules/@azure/core-util/dist/browser/createAbortablePromise.js @@ -8,20 +8,20 @@ import { AbortError } from "@azure/abort-controller"; * @returns A promise that can be aborted. */ export function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; + const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; return new Promise((resolve, reject) => { function rejectOnAbort() { - reject(new AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); + reject(new AbortError(abortErrorMsg ?? "The operation was aborted.")); } function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); + abortSignal?.removeEventListener("abort", onAbort); } function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); + cleanupBeforeAbort?.(); removeListeners(); rejectOnAbort(); } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { + if (abortSignal?.aborted) { return rejectOnAbort(); } try { @@ -36,7 +36,7 @@ export function createAbortablePromise(buildPromise, options) { catch (err) { reject(err); } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); + abortSignal?.addEventListener("abort", onAbort); }); } //# sourceMappingURL=createAbortablePromise.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/delay.js b/node_modules/@azure/core-util/dist/browser/delay.js similarity index 77% rename from node_modules/@azure/core-util/dist-esm/delay.js rename to node_modules/@azure/core-util/dist/browser/delay.js index 42003ee87..3e12ea5ed 100644 --- a/node_modules/@azure/core-util/dist-esm/delay.js +++ b/node_modules/@azure/core-util/dist/browser/delay.js @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { createAbortablePromise } from "./createAbortablePromise"; +import { createAbortablePromise } from "./createAbortablePromise.js"; const StandardAbortMessage = "The delay was aborted."; /** * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds. @@ -10,13 +10,13 @@ const StandardAbortMessage = "The delay was aborted."; */ export function delay(timeInMs, options) { let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; + const { abortSignal, abortErrorMsg } = options ?? {}; return createAbortablePromise((resolve) => { token = setTimeout(resolve, timeInMs); }, { cleanupBeforeAbort: () => clearTimeout(token), abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage, }); } //# sourceMappingURL=delay.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/error.js b/node_modules/@azure/core-util/dist/browser/error.js similarity index 96% rename from node_modules/@azure/core-util/dist-esm/error.js rename to node_modules/@azure/core-util/dist/browser/error.js index 55f18621d..8d107ebf6 100644 --- a/node_modules/@azure/core-util/dist-esm/error.js +++ b/node_modules/@azure/core-util/dist/browser/error.js @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { isObject } from "./object"; +import { isObject } from "./object.js"; /** * Typeguard for an error object shape (has name and message) * @param e - Something caught by a catch clause. diff --git a/node_modules/@azure/core-util/dist/browser/index.js b/node_modules/@azure/core-util/dist/browser/index.js new file mode 100644 index 000000000..64b7b80ac --- /dev/null +++ b/node_modules/@azure/core-util/dist/browser/index.js @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { delay } from "./delay.js"; +export { cancelablePromiseRace, } from "./aborterUtils.js"; +export { createAbortablePromise, } from "./createAbortablePromise.js"; +export { getRandomIntegerInclusive } from "./random.js"; +export { isObject } from "./object.js"; +export { isError, getErrorMessage } from "./error.js"; +export { computeSha256Hash, computeSha256Hmac } from "./sha256.js"; +export { isDefined, isObjectWithProperties, objectHasProperty } from "./typeGuards.js"; +export { randomUUID } from "./uuidUtils.js"; +export { isBrowser, isBun, isNode, isDeno, isReactNative, isWebWorker, } from "./checkEnvironment.js"; +export { uint8ArrayToString, stringToUint8Array } from "./bytesEncoding.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/object.js b/node_modules/@azure/core-util/dist/browser/object.js similarity index 100% rename from node_modules/@azure/core-util/dist-esm/object.js rename to node_modules/@azure/core-util/dist/browser/object.js diff --git a/node_modules/@azure/core-util/dist/browser/package.json b/node_modules/@azure/core-util/dist/browser/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-util/dist/browser/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-util/dist-esm/random.js b/node_modules/@azure/core-util/dist/browser/random.js similarity index 100% rename from node_modules/@azure/core-util/dist-esm/random.js rename to node_modules/@azure/core-util/dist/browser/random.js diff --git a/node_modules/@azure/core-util/dist-esm/sha256.browser.js b/node_modules/@azure/core-util/dist/browser/sha256.js similarity index 96% rename from node_modules/@azure/core-util/dist-esm/sha256.browser.js rename to node_modules/@azure/core-util/dist/browser/sha256.js index 872e4fb4c..646580241 100644 --- a/node_modules/@azure/core-util/dist-esm/sha256.browser.js +++ b/node_modules/@azure/core-util/dist/browser/sha256.js @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { stringToUint8Array, uint8ArrayToString } from "./bytesEncoding.browser"; +import { stringToUint8Array, uint8ArrayToString } from "./bytesEncoding.js"; let subtleCrypto; /** * Returns a cached reference to the Web API crypto.subtle object. @@ -46,4 +46,4 @@ export async function computeSha256Hash(content, encoding) { const digest = await getCrypto().digest({ name: "SHA-256" }, contentBytes); return uint8ArrayToString(new Uint8Array(digest), encoding); } -//# sourceMappingURL=sha256.browser.js.map \ No newline at end of file +//# sourceMappingURL=sha256-browser.mjs.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/typeGuards.js b/node_modules/@azure/core-util/dist/browser/typeGuards.js similarity index 100% rename from node_modules/@azure/core-util/dist-esm/typeGuards.js rename to node_modules/@azure/core-util/dist/browser/typeGuards.js diff --git a/node_modules/@azure/core-util/dist-esm/uuidUtils.native.js b/node_modules/@azure/core-util/dist/browser/uuidUtils.common.js similarity index 88% rename from node_modules/@azure/core-util/dist-esm/uuidUtils.native.js rename to node_modules/@azure/core-util/dist/browser/uuidUtils.common.js index 9e1e24d45..8484013e5 100644 --- a/node_modules/@azure/core-util/dist-esm/uuidUtils.native.js +++ b/node_modules/@azure/core-util/dist/browser/uuidUtils.common.js @@ -1,8 +1,5 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/* - * NOTE: When moving this file, please update "react-native" section in package.json. - */ /** * Generated Universally Unique Identifier * @@ -40,4 +37,4 @@ export function generateUUID() { export function randomUUID() { return generateUUID(); } -//# sourceMappingURL=uuidUtils.native.js.map \ No newline at end of file +//# sourceMappingURL=uuidUtils.common.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/uuidUtils.browser.js b/node_modules/@azure/core-util/dist/browser/uuidUtils.js similarity index 56% rename from node_modules/@azure/core-util/dist-esm/uuidUtils.browser.js rename to node_modules/@azure/core-util/dist/browser/uuidUtils.js index cc7abe1e1..d062906ce 100644 --- a/node_modules/@azure/core-util/dist-esm/uuidUtils.browser.js +++ b/node_modules/@azure/core-util/dist/browser/uuidUtils.js @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -var _a; -import { generateUUID } from "./uuidUtils.native"; +import { generateUUID } from "./uuidUtils.common.js"; // NOTE: This could be undefined if not used in a secure context -const uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" +const uuidFunction = typeof globalThis?.crypto?.randomUUID === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : generateUUID; /** @@ -14,4 +13,4 @@ const uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 export function randomUUID() { return uuidFunction(); } -//# sourceMappingURL=uuidUtils.browser.js.map \ No newline at end of file +//# sourceMappingURL=uuidUtils-browser.mjs.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/aborterUtils.js b/node_modules/@azure/core-util/dist/commonjs/aborterUtils.js new file mode 100644 index 000000000..d4b87c40a --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/aborterUtils.js @@ -0,0 +1,24 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.cancelablePromiseRace = void 0; +/** + * promise.race() wrapper that aborts rest of promises as soon as the first promise settles. + */ +async function cancelablePromiseRace(abortablePromiseBuilders, options) { + const aborter = new AbortController(); + function abortHandler() { + aborter.abort(); + } + options?.abortSignal?.addEventListener("abort", abortHandler); + try { + return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); + } + finally { + aborter.abort(); + options?.abortSignal?.removeEventListener("abort", abortHandler); + } +} +exports.cancelablePromiseRace = cancelablePromiseRace; +//# sourceMappingURL=aborterUtils.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js b/node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js new file mode 100644 index 000000000..f320d9adf --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js @@ -0,0 +1,26 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stringToUint8Array = exports.uint8ArrayToString = void 0; +/** + * The helper that transforms bytes with specific character encoding into string + * @param bytes - the uint8array bytes + * @param format - the format we use to encode the byte + * @returns a string of the encoded string + */ +function uint8ArrayToString(bytes, format) { + return Buffer.from(bytes).toString(format); +} +exports.uint8ArrayToString = uint8ArrayToString; +/** + * The helper that transforms string to specific character encoded bytes array. + * @param value - the string to be converted + * @param format - the format we use to decode the value + * @returns a uint8array + */ +function stringToUint8Array(value, format) { + return Buffer.from(value, format); +} +exports.stringToUint8Array = stringToUint8Array; +//# sourceMappingURL=bytesEncoding.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js b/node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js new file mode 100644 index 000000000..7cfd4f551 --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js @@ -0,0 +1,43 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isReactNative = exports.isNode = exports.isBun = exports.isDeno = exports.isWebWorker = exports.isBrowser = void 0; +/** + * A constant that indicates whether the environment the code is running is a Web Browser. + */ +// eslint-disable-next-line @azure/azure-sdk/ts-no-window +exports.isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is a Web Worker. + */ +exports.isWebWorker = typeof self === "object" && + typeof self?.importScripts === "function" && + (self.constructor?.name === "DedicatedWorkerGlobalScope" || + self.constructor?.name === "ServiceWorkerGlobalScope" || + self.constructor?.name === "SharedWorkerGlobalScope"); +/** + * A constant that indicates whether the environment the code is running is Deno. + */ +exports.isDeno = typeof Deno !== "undefined" && + typeof Deno.version !== "undefined" && + typeof Deno.version.deno !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is Bun.sh. + */ +exports.isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is Node.JS. + */ +exports.isNode = typeof globalThis.process !== "undefined" && + Boolean(globalThis.process.version) && + Boolean(globalThis.process.versions?.node) && + // Deno thought it was a good idea to spoof process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions + !exports.isDeno && + !exports.isBun; +/** + * A constant that indicates whether the environment the code is running is in React-Native. + */ +// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js +exports.isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; +//# sourceMappingURL=checkEnvironment.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/createAbortablePromise.js b/node_modules/@azure/core-util/dist/commonjs/createAbortablePromise.js new file mode 100644 index 000000000..a3fdf1d49 --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/createAbortablePromise.js @@ -0,0 +1,46 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createAbortablePromise = void 0; +const abort_controller_1 = require("@azure/abort-controller"); +/** + * Creates an abortable promise. + * @param buildPromise - A function that takes the resolve and reject functions as parameters. + * @param options - The options for the abortable promise. + * @returns A promise that can be aborted. + */ +function createAbortablePromise(buildPromise, options) { + const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; + return new Promise((resolve, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); + } + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); + } + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); + } + if (abortSignal?.aborted) { + return rejectOnAbort(); + } + try { + buildPromise((x) => { + removeListeners(); + resolve(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } + catch (err) { + reject(err); + } + abortSignal?.addEventListener("abort", onAbort); + }); +} +exports.createAbortablePromise = createAbortablePromise; +//# sourceMappingURL=createAbortablePromise.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/delay.js b/node_modules/@azure/core-util/dist/commonjs/delay.js new file mode 100644 index 000000000..0183ef621 --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/delay.js @@ -0,0 +1,26 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.delay = void 0; +const createAbortablePromise_js_1 = require("./createAbortablePromise.js"); +const StandardAbortMessage = "The delay was aborted."; +/** + * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds. + * @param timeInMs - The number of milliseconds to be delayed. + * @param options - The options for delay - currently abort options + * @returns Promise that is resolved after timeInMs + */ +function delay(timeInMs, options) { + let token; + const { abortSignal, abortErrorMsg } = options ?? {}; + return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve) => { + token = setTimeout(resolve, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage, + }); +} +exports.delay = delay; +//# sourceMappingURL=delay.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/error.js b/node_modules/@azure/core-util/dist/commonjs/error.js new file mode 100644 index 000000000..a88d53db4 --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/error.js @@ -0,0 +1,47 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getErrorMessage = exports.isError = void 0; +const object_js_1 = require("./object.js"); +/** + * Typeguard for an error object shape (has name and message) + * @param e - Something caught by a catch clause. + */ +function isError(e) { + if ((0, object_js_1.isObject)(e)) { + const hasName = typeof e.name === "string"; + const hasMessage = typeof e.message === "string"; + return hasName && hasMessage; + } + return false; +} +exports.isError = isError; +/** + * Given what is thought to be an error object, return the message if possible. + * If the message is missing, returns a stringified version of the input. + * @param e - Something thrown from a try block + * @returns The error message or a string of the input + */ +function getErrorMessage(e) { + if (isError(e)) { + return e.message; + } + else { + let stringified; + try { + if (typeof e === "object" && e) { + stringified = JSON.stringify(e); + } + else { + stringified = String(e); + } + } + catch (err) { + stringified = "[unable to stringify input]"; + } + return `Unknown error ${stringified}`; + } +} +exports.getErrorMessage = getErrorMessage; +//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/index.js b/node_modules/@azure/core-util/dist/commonjs/index.js new file mode 100644 index 000000000..11e2b23bc --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/index.js @@ -0,0 +1,38 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stringToUint8Array = exports.uint8ArrayToString = exports.isWebWorker = exports.isReactNative = exports.isDeno = exports.isNode = exports.isBun = exports.isBrowser = exports.randomUUID = exports.objectHasProperty = exports.isObjectWithProperties = exports.isDefined = exports.computeSha256Hmac = exports.computeSha256Hash = exports.getErrorMessage = exports.isError = exports.isObject = exports.getRandomIntegerInclusive = exports.createAbortablePromise = exports.cancelablePromiseRace = exports.delay = void 0; +var delay_js_1 = require("./delay.js"); +Object.defineProperty(exports, "delay", { enumerable: true, get: function () { return delay_js_1.delay; } }); +var aborterUtils_js_1 = require("./aborterUtils.js"); +Object.defineProperty(exports, "cancelablePromiseRace", { enumerable: true, get: function () { return aborterUtils_js_1.cancelablePromiseRace; } }); +var createAbortablePromise_js_1 = require("./createAbortablePromise.js"); +Object.defineProperty(exports, "createAbortablePromise", { enumerable: true, get: function () { return createAbortablePromise_js_1.createAbortablePromise; } }); +var random_js_1 = require("./random.js"); +Object.defineProperty(exports, "getRandomIntegerInclusive", { enumerable: true, get: function () { return random_js_1.getRandomIntegerInclusive; } }); +var object_js_1 = require("./object.js"); +Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return object_js_1.isObject; } }); +var error_js_1 = require("./error.js"); +Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return error_js_1.isError; } }); +Object.defineProperty(exports, "getErrorMessage", { enumerable: true, get: function () { return error_js_1.getErrorMessage; } }); +var sha256_js_1 = require("./sha256.js"); +Object.defineProperty(exports, "computeSha256Hash", { enumerable: true, get: function () { return sha256_js_1.computeSha256Hash; } }); +Object.defineProperty(exports, "computeSha256Hmac", { enumerable: true, get: function () { return sha256_js_1.computeSha256Hmac; } }); +var typeGuards_js_1 = require("./typeGuards.js"); +Object.defineProperty(exports, "isDefined", { enumerable: true, get: function () { return typeGuards_js_1.isDefined; } }); +Object.defineProperty(exports, "isObjectWithProperties", { enumerable: true, get: function () { return typeGuards_js_1.isObjectWithProperties; } }); +Object.defineProperty(exports, "objectHasProperty", { enumerable: true, get: function () { return typeGuards_js_1.objectHasProperty; } }); +var uuidUtils_js_1 = require("./uuidUtils.js"); +Object.defineProperty(exports, "randomUUID", { enumerable: true, get: function () { return uuidUtils_js_1.randomUUID; } }); +var checkEnvironment_js_1 = require("./checkEnvironment.js"); +Object.defineProperty(exports, "isBrowser", { enumerable: true, get: function () { return checkEnvironment_js_1.isBrowser; } }); +Object.defineProperty(exports, "isBun", { enumerable: true, get: function () { return checkEnvironment_js_1.isBun; } }); +Object.defineProperty(exports, "isNode", { enumerable: true, get: function () { return checkEnvironment_js_1.isNode; } }); +Object.defineProperty(exports, "isDeno", { enumerable: true, get: function () { return checkEnvironment_js_1.isDeno; } }); +Object.defineProperty(exports, "isReactNative", { enumerable: true, get: function () { return checkEnvironment_js_1.isReactNative; } }); +Object.defineProperty(exports, "isWebWorker", { enumerable: true, get: function () { return checkEnvironment_js_1.isWebWorker; } }); +var bytesEncoding_js_1 = require("./bytesEncoding.js"); +Object.defineProperty(exports, "uint8ArrayToString", { enumerable: true, get: function () { return bytesEncoding_js_1.uint8ArrayToString; } }); +Object.defineProperty(exports, "stringToUint8Array", { enumerable: true, get: function () { return bytesEncoding_js_1.stringToUint8Array; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/object.js b/node_modules/@azure/core-util/dist/commonjs/object.js new file mode 100644 index 000000000..a42af6762 --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/object.js @@ -0,0 +1,18 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isObject = void 0; +/** + * Helper to determine when an input is a generic JS object. + * @returns true when input is an object type that is not null, Array, RegExp, or Date. + */ +function isObject(input) { + return (typeof input === "object" && + input !== null && + !Array.isArray(input) && + !(input instanceof RegExp) && + !(input instanceof Date)); +} +exports.isObject = isObject; +//# sourceMappingURL=object.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/package.json b/node_modules/@azure/core-util/dist/commonjs/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/@azure/core-util/dist/commonjs/random.js b/node_modules/@azure/core-util/dist/commonjs/random.js new file mode 100644 index 000000000..5ec7e4d51 --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/random.js @@ -0,0 +1,25 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getRandomIntegerInclusive = void 0; +/** + * Returns a random integer value between a lower and upper bound, + * inclusive of both bounds. + * Note that this uses Math.random and isn't secure. If you need to use + * this for any kind of security purpose, find a better source of random. + * @param min - The smallest integer value allowed. + * @param max - The largest integer value allowed. + */ +function getRandomIntegerInclusive(min, max) { + // Make sure inputs are integers. + min = Math.ceil(min); + max = Math.floor(max); + // Pick a random offset from zero to the size of the range. + // Since Math.random() can never return 1, we have to make the range one larger + // in order to be inclusive of the maximum value after we take the floor. + const offset = Math.floor(Math.random() * (max - min + 1)); + return offset + min; +} +exports.getRandomIntegerInclusive = getRandomIntegerInclusive; +//# sourceMappingURL=random.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/sha256.js b/node_modules/@azure/core-util/dist/commonjs/sha256.js new file mode 100644 index 000000000..5d3a16083 --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/sha256.js @@ -0,0 +1,27 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.computeSha256Hash = exports.computeSha256Hmac = void 0; +const crypto_1 = require("crypto"); +/** + * Generates a SHA-256 HMAC signature. + * @param key - The HMAC key represented as a base64 string, used to generate the cryptographic HMAC hash. + * @param stringToSign - The data to be signed. + * @param encoding - The textual encoding to use for the returned HMAC digest. + */ +async function computeSha256Hmac(key, stringToSign, encoding) { + const decodedKey = Buffer.from(key, "base64"); + return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); +} +exports.computeSha256Hmac = computeSha256Hmac; +/** + * Generates a SHA-256 hash. + * @param content - The data to be included in the hash. + * @param encoding - The textual encoding to use for the returned hash. + */ +async function computeSha256Hash(content, encoding) { + return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); +} +exports.computeSha256Hash = computeSha256Hash; +//# sourceMappingURL=sha256.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/tsdoc-metadata.json b/node_modules/@azure/core-util/dist/commonjs/tsdoc-metadata.json new file mode 100644 index 000000000..22735db17 --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/tsdoc-metadata.json @@ -0,0 +1,11 @@ +// This file is read by tools that parse documentation comments conforming to the TSDoc standard. +// It should be published with your NPM package. It should not be tracked by Git. +{ + "tsdocVersion": "0.12", + "toolPackages": [ + { + "packageName": "@microsoft/api-extractor", + "packageVersion": "7.42.3" + } + ] +} diff --git a/node_modules/@azure/core-util/dist/commonjs/typeGuards.js b/node_modules/@azure/core-util/dist/commonjs/typeGuards.js new file mode 100644 index 000000000..31d998cd3 --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/typeGuards.js @@ -0,0 +1,40 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.objectHasProperty = exports.isObjectWithProperties = exports.isDefined = void 0; +/** + * Helper TypeGuard that checks if something is defined or not. + * @param thing - Anything + */ +function isDefined(thing) { + return typeof thing !== "undefined" && thing !== null; +} +exports.isDefined = isDefined; +/** + * Helper TypeGuard that checks if the input is an object with the specified properties. + * @param thing - Anything. + * @param properties - The name of the properties that should appear in the object. + */ +function isObjectWithProperties(thing, properties) { + if (!isDefined(thing) || typeof thing !== "object") { + return false; + } + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } + } + return true; +} +exports.isObjectWithProperties = isObjectWithProperties; +/** + * Helper TypeGuard that checks if the input is an object with the specified property. + * @param thing - Any object. + * @param property - The name of the property that should appear in the object. + */ +function objectHasProperty(thing, property) { + return (isDefined(thing) && typeof thing === "object" && property in thing); +} +exports.objectHasProperty = objectHasProperty; +//# sourceMappingURL=typeGuards.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/uuidUtils.common.js b/node_modules/@azure/core-util/dist/commonjs/uuidUtils.common.js new file mode 100644 index 000000000..63ea12e0a --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/uuidUtils.common.js @@ -0,0 +1,45 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.randomUUID = exports.generateUUID = void 0; +/** + * Generated Universally Unique Identifier + * + * @returns RFC4122 v4 UUID. + */ +function generateUUID() { + let uuid = ""; + for (let i = 0; i < 32; i++) { + // Generate a random number between 0 and 15 + const randomNumber = Math.floor(Math.random() * 16); + // Set the UUID version to 4 in the 13th position + if (i === 12) { + uuid += "4"; + } + else if (i === 16) { + // Set the UUID variant to "10" in the 17th position + uuid += (randomNumber & 0x3) | 0x8; + } + else { + // Add a random hexadecimal digit to the UUID string + uuid += randomNumber.toString(16); + } + // Add hyphens to the UUID string at the appropriate positions + if (i === 7 || i === 11 || i === 15 || i === 19) { + uuid += "-"; + } + } + return uuid; +} +exports.generateUUID = generateUUID; +/** + * Generated Universally Unique Identifier + * + * @returns RFC4122 v4 UUID. + */ +function randomUUID() { + return generateUUID(); +} +exports.randomUUID = randomUUID; +//# sourceMappingURL=uuidUtils.common.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/commonjs/uuidUtils.js b/node_modules/@azure/core-util/dist/commonjs/uuidUtils.js new file mode 100644 index 000000000..ae5f10689 --- /dev/null +++ b/node_modules/@azure/core-util/dist/commonjs/uuidUtils.js @@ -0,0 +1,20 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.randomUUID = void 0; +const crypto_1 = require("crypto"); +// NOTE: This is a workaround until we can use `globalThis.crypto.randomUUID` in Node.js 19+. +const uuidFunction = typeof globalThis?.crypto?.randomUUID === "function" + ? globalThis.crypto.randomUUID.bind(globalThis.crypto) + : crypto_1.randomUUID; +/** + * Generated Universally Unique Identifier + * + * @returns RFC4122 v4 UUID. + */ +function randomUUID() { + return uuidFunction(); +} +exports.randomUUID = randomUUID; +//# sourceMappingURL=uuidUtils.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/esm/aborterUtils.js b/node_modules/@azure/core-util/dist/esm/aborterUtils.js new file mode 100644 index 000000000..c34a95d10 --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/aborterUtils.js @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * promise.race() wrapper that aborts rest of promises as soon as the first promise settles. + */ +export async function cancelablePromiseRace(abortablePromiseBuilders, options) { + const aborter = new AbortController(); + function abortHandler() { + aborter.abort(); + } + options?.abortSignal?.addEventListener("abort", abortHandler); + try { + return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); + } + finally { + aborter.abort(); + options?.abortSignal?.removeEventListener("abort", abortHandler); + } +} +//# sourceMappingURL=aborterUtils.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/bytesEncoding.js b/node_modules/@azure/core-util/dist/esm/bytesEncoding.js similarity index 100% rename from node_modules/@azure/core-util/dist-esm/bytesEncoding.js rename to node_modules/@azure/core-util/dist/esm/bytesEncoding.js diff --git a/node_modules/@azure/core-util/dist/esm/checkEnvironment.js b/node_modules/@azure/core-util/dist/esm/checkEnvironment.js new file mode 100644 index 000000000..53ba62e52 --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/checkEnvironment.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * A constant that indicates whether the environment the code is running is a Web Browser. + */ +// eslint-disable-next-line @azure/azure-sdk/ts-no-window +export const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is a Web Worker. + */ +export const isWebWorker = typeof self === "object" && + typeof self?.importScripts === "function" && + (self.constructor?.name === "DedicatedWorkerGlobalScope" || + self.constructor?.name === "ServiceWorkerGlobalScope" || + self.constructor?.name === "SharedWorkerGlobalScope"); +/** + * A constant that indicates whether the environment the code is running is Deno. + */ +export const isDeno = typeof Deno !== "undefined" && + typeof Deno.version !== "undefined" && + typeof Deno.version.deno !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is Bun.sh. + */ +export const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is Node.JS. + */ +export const isNode = typeof globalThis.process !== "undefined" && + Boolean(globalThis.process.version) && + Boolean(globalThis.process.versions?.node) && + // Deno thought it was a good idea to spoof process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions + !isDeno && + !isBun; +/** + * A constant that indicates whether the environment the code is running is in React-Native. + */ +// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js +export const isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; +//# sourceMappingURL=checkEnvironment.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/esm/createAbortablePromise.js b/node_modules/@azure/core-util/dist/esm/createAbortablePromise.js new file mode 100644 index 000000000..fc54e7c74 --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/createAbortablePromise.js @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { AbortError } from "@azure/abort-controller"; +/** + * Creates an abortable promise. + * @param buildPromise - A function that takes the resolve and reject functions as parameters. + * @param options - The options for the abortable promise. + * @returns A promise that can be aborted. + */ +export function createAbortablePromise(buildPromise, options) { + const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; + return new Promise((resolve, reject) => { + function rejectOnAbort() { + reject(new AbortError(abortErrorMsg ?? "The operation was aborted.")); + } + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); + } + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); + } + if (abortSignal?.aborted) { + return rejectOnAbort(); + } + try { + buildPromise((x) => { + removeListeners(); + resolve(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } + catch (err) { + reject(err); + } + abortSignal?.addEventListener("abort", onAbort); + }); +} +//# sourceMappingURL=createAbortablePromise.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/esm/delay.js b/node_modules/@azure/core-util/dist/esm/delay.js new file mode 100644 index 000000000..3e12ea5ed --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/delay.js @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { createAbortablePromise } from "./createAbortablePromise.js"; +const StandardAbortMessage = "The delay was aborted."; +/** + * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds. + * @param timeInMs - The number of milliseconds to be delayed. + * @param options - The options for delay - currently abort options + * @returns Promise that is resolved after timeInMs + */ +export function delay(timeInMs, options) { + let token; + const { abortSignal, abortErrorMsg } = options ?? {}; + return createAbortablePromise((resolve) => { + token = setTimeout(resolve, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage, + }); +} +//# sourceMappingURL=delay.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/esm/error.js b/node_modules/@azure/core-util/dist/esm/error.js new file mode 100644 index 000000000..8d107ebf6 --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/error.js @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { isObject } from "./object.js"; +/** + * Typeguard for an error object shape (has name and message) + * @param e - Something caught by a catch clause. + */ +export function isError(e) { + if (isObject(e)) { + const hasName = typeof e.name === "string"; + const hasMessage = typeof e.message === "string"; + return hasName && hasMessage; + } + return false; +} +/** + * Given what is thought to be an error object, return the message if possible. + * If the message is missing, returns a stringified version of the input. + * @param e - Something thrown from a try block + * @returns The error message or a string of the input + */ +export function getErrorMessage(e) { + if (isError(e)) { + return e.message; + } + else { + let stringified; + try { + if (typeof e === "object" && e) { + stringified = JSON.stringify(e); + } + else { + stringified = String(e); + } + } + catch (err) { + stringified = "[unable to stringify input]"; + } + return `Unknown error ${stringified}`; + } +} +//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/esm/index.js b/node_modules/@azure/core-util/dist/esm/index.js new file mode 100644 index 000000000..64b7b80ac --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/index.js @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { delay } from "./delay.js"; +export { cancelablePromiseRace, } from "./aborterUtils.js"; +export { createAbortablePromise, } from "./createAbortablePromise.js"; +export { getRandomIntegerInclusive } from "./random.js"; +export { isObject } from "./object.js"; +export { isError, getErrorMessage } from "./error.js"; +export { computeSha256Hash, computeSha256Hmac } from "./sha256.js"; +export { isDefined, isObjectWithProperties, objectHasProperty } from "./typeGuards.js"; +export { randomUUID } from "./uuidUtils.js"; +export { isBrowser, isBun, isNode, isDeno, isReactNative, isWebWorker, } from "./checkEnvironment.js"; +export { uint8ArrayToString, stringToUint8Array } from "./bytesEncoding.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/esm/object.js b/node_modules/@azure/core-util/dist/esm/object.js new file mode 100644 index 000000000..ff04af859 --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/object.js @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Helper to determine when an input is a generic JS object. + * @returns true when input is an object type that is not null, Array, RegExp, or Date. + */ +export function isObject(input) { + return (typeof input === "object" && + input !== null && + !Array.isArray(input) && + !(input instanceof RegExp) && + !(input instanceof Date)); +} +//# sourceMappingURL=object.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/esm/package.json b/node_modules/@azure/core-util/dist/esm/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-util/dist/esm/random.js b/node_modules/@azure/core-util/dist/esm/random.js new file mode 100644 index 000000000..aef3288c2 --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/random.js @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Returns a random integer value between a lower and upper bound, + * inclusive of both bounds. + * Note that this uses Math.random and isn't secure. If you need to use + * this for any kind of security purpose, find a better source of random. + * @param min - The smallest integer value allowed. + * @param max - The largest integer value allowed. + */ +export function getRandomIntegerInclusive(min, max) { + // Make sure inputs are integers. + min = Math.ceil(min); + max = Math.floor(max); + // Pick a random offset from zero to the size of the range. + // Since Math.random() can never return 1, we have to make the range one larger + // in order to be inclusive of the maximum value after we take the floor. + const offset = Math.floor(Math.random() * (max - min + 1)); + return offset + min; +} +//# sourceMappingURL=random.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/sha256.js b/node_modules/@azure/core-util/dist/esm/sha256.js similarity index 100% rename from node_modules/@azure/core-util/dist-esm/sha256.js rename to node_modules/@azure/core-util/dist/esm/sha256.js diff --git a/node_modules/@azure/core-util/dist/esm/typeGuards.js b/node_modules/@azure/core-util/dist/esm/typeGuards.js new file mode 100644 index 000000000..f45852dbd --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/typeGuards.js @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Helper TypeGuard that checks if something is defined or not. + * @param thing - Anything + */ +export function isDefined(thing) { + return typeof thing !== "undefined" && thing !== null; +} +/** + * Helper TypeGuard that checks if the input is an object with the specified properties. + * @param thing - Anything. + * @param properties - The name of the properties that should appear in the object. + */ +export function isObjectWithProperties(thing, properties) { + if (!isDefined(thing) || typeof thing !== "object") { + return false; + } + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } + } + return true; +} +/** + * Helper TypeGuard that checks if the input is an object with the specified property. + * @param thing - Any object. + * @param property - The name of the property that should appear in the object. + */ +export function objectHasProperty(thing, property) { + return (isDefined(thing) && typeof thing === "object" && property in thing); +} +//# sourceMappingURL=typeGuards.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/esm/uuidUtils.common.js b/node_modules/@azure/core-util/dist/esm/uuidUtils.common.js new file mode 100644 index 000000000..8484013e5 --- /dev/null +++ b/node_modules/@azure/core-util/dist/esm/uuidUtils.common.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Generated Universally Unique Identifier + * + * @returns RFC4122 v4 UUID. + */ +export function generateUUID() { + let uuid = ""; + for (let i = 0; i < 32; i++) { + // Generate a random number between 0 and 15 + const randomNumber = Math.floor(Math.random() * 16); + // Set the UUID version to 4 in the 13th position + if (i === 12) { + uuid += "4"; + } + else if (i === 16) { + // Set the UUID variant to "10" in the 17th position + uuid += (randomNumber & 0x3) | 0x8; + } + else { + // Add a random hexadecimal digit to the UUID string + uuid += randomNumber.toString(16); + } + // Add hyphens to the UUID string at the appropriate positions + if (i === 7 || i === 11 || i === 15 || i === 19) { + uuid += "-"; + } + } + return uuid; +} +/** + * Generated Universally Unique Identifier + * + * @returns RFC4122 v4 UUID. + */ +export function randomUUID() { + return generateUUID(); +} +//# sourceMappingURL=uuidUtils.common.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist-esm/uuidUtils.js b/node_modules/@azure/core-util/dist/esm/uuidUtils.js similarity index 58% rename from node_modules/@azure/core-util/dist-esm/uuidUtils.js rename to node_modules/@azure/core-util/dist/esm/uuidUtils.js index 206a9f939..f20c10c60 100644 --- a/node_modules/@azure/core-util/dist-esm/uuidUtils.js +++ b/node_modules/@azure/core-util/dist/esm/uuidUtils.js @@ -1,16 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -var _a; import { randomUUID as v4RandomUUID } from "crypto"; -import { generateUUID } from "./uuidUtils.native"; // NOTE: This is a workaround until we can use `globalThis.crypto.randomUUID` in Node.js 19+. -let uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" +const uuidFunction = typeof globalThis?.crypto?.randomUUID === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : v4RandomUUID; -// Not defined in earlier versions of Node.js 14 -if (!uuidFunction) { - uuidFunction = generateUUID; -} /** * Generated Universally Unique Identifier * diff --git a/node_modules/@azure/core-util/dist/index.js b/node_modules/@azure/core-util/dist/index.js deleted file mode 100644 index 1053ae69c..000000000 --- a/node_modules/@azure/core-util/dist/index.js +++ /dev/null @@ -1,359 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var abortController = require('@azure/abort-controller'); -var crypto = require('crypto'); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Creates an abortable promise. - * @param buildPromise - A function that takes the resolve and reject functions as parameters. - * @param options - The options for the abortable promise. - * @returns A promise that can be aborted. - */ -function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve, reject) => { - function rejectOnAbort() { - reject(new abortController.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); - } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); - } - try { - buildPromise((x) => { - removeListeners(); - resolve(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } - catch (err) { - reject(err); - } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); - }); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -const StandardAbortMessage = "The delay was aborted."; -/** - * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds. - * @param timeInMs - The number of milliseconds to be delayed. - * @param options - The options for delay - currently abort options - * @returns Promise that is resolved after timeInMs - */ -function delay(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return createAbortablePromise((resolve) => { - token = setTimeout(resolve, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage, - }); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * promise.race() wrapper that aborts rest of promises as soon as the first promise settles. - */ -async function cancelablePromiseRace(abortablePromiseBuilders, options) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } - finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Returns a random integer value between a lower and upper bound, - * inclusive of both bounds. - * Note that this uses Math.random and isn't secure. If you need to use - * this for any kind of security purpose, find a better source of random. - * @param min - The smallest integer value allowed. - * @param max - The largest integer value allowed. - */ -function getRandomIntegerInclusive(min, max) { - // Make sure inputs are integers. - min = Math.ceil(min); - max = Math.floor(max); - // Pick a random offset from zero to the size of the range. - // Since Math.random() can never return 1, we have to make the range one larger - // in order to be inclusive of the maximum value after we take the floor. - const offset = Math.floor(Math.random() * (max - min + 1)); - return offset + min; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Helper to determine when an input is a generic JS object. - * @returns true when input is an object type that is not null, Array, RegExp, or Date. - */ -function isObject(input) { - return (typeof input === "object" && - input !== null && - !Array.isArray(input) && - !(input instanceof RegExp) && - !(input instanceof Date)); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Typeguard for an error object shape (has name and message) - * @param e - Something caught by a catch clause. - */ -function isError(e) { - if (isObject(e)) { - const hasName = typeof e.name === "string"; - const hasMessage = typeof e.message === "string"; - return hasName && hasMessage; - } - return false; -} -/** - * Given what is thought to be an error object, return the message if possible. - * If the message is missing, returns a stringified version of the input. - * @param e - Something thrown from a try block - * @returns The error message or a string of the input - */ -function getErrorMessage(e) { - if (isError(e)) { - return e.message; - } - else { - let stringified; - try { - if (typeof e === "object" && e) { - stringified = JSON.stringify(e); - } - else { - stringified = String(e); - } - } - catch (err) { - stringified = "[unable to stringify input]"; - } - return `Unknown error ${stringified}`; - } -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Generates a SHA-256 HMAC signature. - * @param key - The HMAC key represented as a base64 string, used to generate the cryptographic HMAC hash. - * @param stringToSign - The data to be signed. - * @param encoding - The textual encoding to use for the returned HMAC digest. - */ -async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return crypto.createHmac("sha256", decodedKey).update(stringToSign).digest(encoding); -} -/** - * Generates a SHA-256 hash. - * @param content - The data to be included in the hash. - * @param encoding - The textual encoding to use for the returned hash. - */ -async function computeSha256Hash(content, encoding) { - return crypto.createHash("sha256").update(content).digest(encoding); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Helper TypeGuard that checks if something is defined or not. - * @param thing - Anything - */ -function isDefined(thing) { - return typeof thing !== "undefined" && thing !== null; -} -/** - * Helper TypeGuard that checks if the input is an object with the specified properties. - * @param thing - Anything. - * @param properties - The name of the properties that should appear in the object. - */ -function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } - } - return true; -} -/** - * Helper TypeGuard that checks if the input is an object with the specified property. - * @param thing - Any object. - * @param property - The name of the property that should appear in the object. - */ -function objectHasProperty(thing, property) { - return (isDefined(thing) && typeof thing === "object" && property in thing); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/* - * NOTE: When moving this file, please update "react-native" section in package.json. - */ -/** - * Generated Universally Unique Identifier - * - * @returns RFC4122 v4 UUID. - */ -function generateUUID() { - let uuid = ""; - for (let i = 0; i < 32; i++) { - // Generate a random number between 0 and 15 - const randomNumber = Math.floor(Math.random() * 16); - // Set the UUID version to 4 in the 13th position - if (i === 12) { - uuid += "4"; - } - else if (i === 16) { - // Set the UUID variant to "10" in the 17th position - uuid += (randomNumber & 0x3) | 0x8; - } - else { - // Add a random hexadecimal digit to the UUID string - uuid += randomNumber.toString(16); - } - // Add hyphens to the UUID string at the appropriate positions - if (i === 7 || i === 11 || i === 15 || i === 19) { - uuid += "-"; - } - } - return uuid; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var _a$1; -// NOTE: This is a workaround until we can use `globalThis.crypto.randomUUID` in Node.js 19+. -let uuidFunction = typeof ((_a$1 = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a$1 === void 0 ? void 0 : _a$1.randomUUID) === "function" - ? globalThis.crypto.randomUUID.bind(globalThis.crypto) - : crypto.randomUUID; -// Not defined in earlier versions of Node.js 14 -if (!uuidFunction) { - uuidFunction = generateUUID; -} -/** - * Generated Universally Unique Identifier - * - * @returns RFC4122 v4 UUID. - */ -function randomUUID() { - return uuidFunction(); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var _a, _b, _c, _d; -/** - * A constant that indicates whether the environment the code is running is a Web Browser. - */ -// eslint-disable-next-line @azure/azure-sdk/ts-no-window -const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; -/** - * A constant that indicates whether the environment the code is running is a Web Worker. - */ -const isWebWorker = typeof self === "object" && - typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" && - (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || - ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || - ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope"); -/** - * A constant that indicates whether the environment the code is running is Deno. - */ -const isDeno = typeof Deno !== "undefined" && - typeof Deno.version !== "undefined" && - typeof Deno.version.deno !== "undefined"; -/** - * A constant that indicates whether the environment the code is running is Node.JS. - */ -const isNode = typeof process !== "undefined" && - Boolean(process.version) && - Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node) && - // Deno thought it was a good idea to spoof process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions - !isDeno; -/** - * A constant that indicates whether the environment the code is running is Bun.sh. - */ -const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; -/** - * A constant that indicates whether the environment the code is running is in React-Native. - */ -// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js -const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * The helper that transforms bytes with specific character encoding into string - * @param bytes - the uint8array bytes - * @param format - the format we use to encode the byte - * @returns a string of the encoded string - */ -function uint8ArrayToString(bytes, format) { - return Buffer.from(bytes).toString(format); -} -/** - * The helper that transforms string to specific character encoded bytes array. - * @param value - the string to be converted - * @param format - the format we use to decode the value - * @returns a uint8array - */ -function stringToUint8Array(value, format) { - return Buffer.from(value, format); -} - -exports.cancelablePromiseRace = cancelablePromiseRace; -exports.computeSha256Hash = computeSha256Hash; -exports.computeSha256Hmac = computeSha256Hmac; -exports.createAbortablePromise = createAbortablePromise; -exports.delay = delay; -exports.getErrorMessage = getErrorMessage; -exports.getRandomIntegerInclusive = getRandomIntegerInclusive; -exports.isBrowser = isBrowser; -exports.isBun = isBun; -exports.isDefined = isDefined; -exports.isDeno = isDeno; -exports.isError = isError; -exports.isNode = isNode; -exports.isObject = isObject; -exports.isObjectWithProperties = isObjectWithProperties; -exports.isReactNative = isReactNative; -exports.isWebWorker = isWebWorker; -exports.objectHasProperty = objectHasProperty; -exports.randomUUID = randomUUID; -exports.stringToUint8Array = stringToUint8Array; -exports.uint8ArrayToString = uint8ArrayToString; -//# sourceMappingURL=index.js.map diff --git a/node_modules/@azure/core-util/dist/react-native/aborterUtils.js b/node_modules/@azure/core-util/dist/react-native/aborterUtils.js new file mode 100644 index 000000000..c34a95d10 --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/aborterUtils.js @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * promise.race() wrapper that aborts rest of promises as soon as the first promise settles. + */ +export async function cancelablePromiseRace(abortablePromiseBuilders, options) { + const aborter = new AbortController(); + function abortHandler() { + aborter.abort(); + } + options?.abortSignal?.addEventListener("abort", abortHandler); + try { + return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); + } + finally { + aborter.abort(); + options?.abortSignal?.removeEventListener("abort", abortHandler); + } +} +//# sourceMappingURL=aborterUtils.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/bytesEncoding.js b/node_modules/@azure/core-util/dist/react-native/bytesEncoding.js new file mode 100644 index 000000000..a38cbeb9c --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/bytesEncoding.js @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * The helper that transforms bytes with specific character encoding into string + * @param bytes - the uint8array bytes + * @param format - the format we use to encode the byte + * @returns a string of the encoded string + */ +export function uint8ArrayToString(bytes, format) { + return Buffer.from(bytes).toString(format); +} +/** + * The helper that transforms string to specific character encoded bytes array. + * @param value - the string to be converted + * @param format - the format we use to decode the value + * @returns a uint8array + */ +export function stringToUint8Array(value, format) { + return Buffer.from(value, format); +} +//# sourceMappingURL=bytesEncoding.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/checkEnvironment.js b/node_modules/@azure/core-util/dist/react-native/checkEnvironment.js new file mode 100644 index 000000000..53ba62e52 --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/checkEnvironment.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * A constant that indicates whether the environment the code is running is a Web Browser. + */ +// eslint-disable-next-line @azure/azure-sdk/ts-no-window +export const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is a Web Worker. + */ +export const isWebWorker = typeof self === "object" && + typeof self?.importScripts === "function" && + (self.constructor?.name === "DedicatedWorkerGlobalScope" || + self.constructor?.name === "ServiceWorkerGlobalScope" || + self.constructor?.name === "SharedWorkerGlobalScope"); +/** + * A constant that indicates whether the environment the code is running is Deno. + */ +export const isDeno = typeof Deno !== "undefined" && + typeof Deno.version !== "undefined" && + typeof Deno.version.deno !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is Bun.sh. + */ +export const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined"; +/** + * A constant that indicates whether the environment the code is running is Node.JS. + */ +export const isNode = typeof globalThis.process !== "undefined" && + Boolean(globalThis.process.version) && + Boolean(globalThis.process.versions?.node) && + // Deno thought it was a good idea to spoof process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions + !isDeno && + !isBun; +/** + * A constant that indicates whether the environment the code is running is in React-Native. + */ +// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js +export const isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; +//# sourceMappingURL=checkEnvironment.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/createAbortablePromise.js b/node_modules/@azure/core-util/dist/react-native/createAbortablePromise.js new file mode 100644 index 000000000..fc54e7c74 --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/createAbortablePromise.js @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { AbortError } from "@azure/abort-controller"; +/** + * Creates an abortable promise. + * @param buildPromise - A function that takes the resolve and reject functions as parameters. + * @param options - The options for the abortable promise. + * @returns A promise that can be aborted. + */ +export function createAbortablePromise(buildPromise, options) { + const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; + return new Promise((resolve, reject) => { + function rejectOnAbort() { + reject(new AbortError(abortErrorMsg ?? "The operation was aborted.")); + } + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); + } + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); + } + if (abortSignal?.aborted) { + return rejectOnAbort(); + } + try { + buildPromise((x) => { + removeListeners(); + resolve(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } + catch (err) { + reject(err); + } + abortSignal?.addEventListener("abort", onAbort); + }); +} +//# sourceMappingURL=createAbortablePromise.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/delay.js b/node_modules/@azure/core-util/dist/react-native/delay.js new file mode 100644 index 000000000..3e12ea5ed --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/delay.js @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { createAbortablePromise } from "./createAbortablePromise.js"; +const StandardAbortMessage = "The delay was aborted."; +/** + * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds. + * @param timeInMs - The number of milliseconds to be delayed. + * @param options - The options for delay - currently abort options + * @returns Promise that is resolved after timeInMs + */ +export function delay(timeInMs, options) { + let token; + const { abortSignal, abortErrorMsg } = options ?? {}; + return createAbortablePromise((resolve) => { + token = setTimeout(resolve, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage, + }); +} +//# sourceMappingURL=delay.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/error.js b/node_modules/@azure/core-util/dist/react-native/error.js new file mode 100644 index 000000000..8d107ebf6 --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/error.js @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { isObject } from "./object.js"; +/** + * Typeguard for an error object shape (has name and message) + * @param e - Something caught by a catch clause. + */ +export function isError(e) { + if (isObject(e)) { + const hasName = typeof e.name === "string"; + const hasMessage = typeof e.message === "string"; + return hasName && hasMessage; + } + return false; +} +/** + * Given what is thought to be an error object, return the message if possible. + * If the message is missing, returns a stringified version of the input. + * @param e - Something thrown from a try block + * @returns The error message or a string of the input + */ +export function getErrorMessage(e) { + if (isError(e)) { + return e.message; + } + else { + let stringified; + try { + if (typeof e === "object" && e) { + stringified = JSON.stringify(e); + } + else { + stringified = String(e); + } + } + catch (err) { + stringified = "[unable to stringify input]"; + } + return `Unknown error ${stringified}`; + } +} +//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/index.js b/node_modules/@azure/core-util/dist/react-native/index.js new file mode 100644 index 000000000..64b7b80ac --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/index.js @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { delay } from "./delay.js"; +export { cancelablePromiseRace, } from "./aborterUtils.js"; +export { createAbortablePromise, } from "./createAbortablePromise.js"; +export { getRandomIntegerInclusive } from "./random.js"; +export { isObject } from "./object.js"; +export { isError, getErrorMessage } from "./error.js"; +export { computeSha256Hash, computeSha256Hmac } from "./sha256.js"; +export { isDefined, isObjectWithProperties, objectHasProperty } from "./typeGuards.js"; +export { randomUUID } from "./uuidUtils.js"; +export { isBrowser, isBun, isNode, isDeno, isReactNative, isWebWorker, } from "./checkEnvironment.js"; +export { uint8ArrayToString, stringToUint8Array } from "./bytesEncoding.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/object.js b/node_modules/@azure/core-util/dist/react-native/object.js new file mode 100644 index 000000000..ff04af859 --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/object.js @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Helper to determine when an input is a generic JS object. + * @returns true when input is an object type that is not null, Array, RegExp, or Date. + */ +export function isObject(input) { + return (typeof input === "object" && + input !== null && + !Array.isArray(input) && + !(input instanceof RegExp) && + !(input instanceof Date)); +} +//# sourceMappingURL=object.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/package.json b/node_modules/@azure/core-util/dist/react-native/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/core-util/dist/react-native/random.js b/node_modules/@azure/core-util/dist/react-native/random.js new file mode 100644 index 000000000..aef3288c2 --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/random.js @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Returns a random integer value between a lower and upper bound, + * inclusive of both bounds. + * Note that this uses Math.random and isn't secure. If you need to use + * this for any kind of security purpose, find a better source of random. + * @param min - The smallest integer value allowed. + * @param max - The largest integer value allowed. + */ +export function getRandomIntegerInclusive(min, max) { + // Make sure inputs are integers. + min = Math.ceil(min); + max = Math.floor(max); + // Pick a random offset from zero to the size of the range. + // Since Math.random() can never return 1, we have to make the range one larger + // in order to be inclusive of the maximum value after we take the floor. + const offset = Math.floor(Math.random() * (max - min + 1)); + return offset + min; +} +//# sourceMappingURL=random.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/sha256.js b/node_modules/@azure/core-util/dist/react-native/sha256.js new file mode 100644 index 000000000..6704d38d6 --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/sha256.js @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { createHash, createHmac } from "crypto"; +/** + * Generates a SHA-256 HMAC signature. + * @param key - The HMAC key represented as a base64 string, used to generate the cryptographic HMAC hash. + * @param stringToSign - The data to be signed. + * @param encoding - The textual encoding to use for the returned HMAC digest. + */ +export async function computeSha256Hmac(key, stringToSign, encoding) { + const decodedKey = Buffer.from(key, "base64"); + return createHmac("sha256", decodedKey).update(stringToSign).digest(encoding); +} +/** + * Generates a SHA-256 hash. + * @param content - The data to be included in the hash. + * @param encoding - The textual encoding to use for the returned hash. + */ +export async function computeSha256Hash(content, encoding) { + return createHash("sha256").update(content).digest(encoding); +} +//# sourceMappingURL=sha256.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/typeGuards.js b/node_modules/@azure/core-util/dist/react-native/typeGuards.js new file mode 100644 index 000000000..f45852dbd --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/typeGuards.js @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Helper TypeGuard that checks if something is defined or not. + * @param thing - Anything + */ +export function isDefined(thing) { + return typeof thing !== "undefined" && thing !== null; +} +/** + * Helper TypeGuard that checks if the input is an object with the specified properties. + * @param thing - Anything. + * @param properties - The name of the properties that should appear in the object. + */ +export function isObjectWithProperties(thing, properties) { + if (!isDefined(thing) || typeof thing !== "object") { + return false; + } + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } + } + return true; +} +/** + * Helper TypeGuard that checks if the input is an object with the specified property. + * @param thing - Any object. + * @param property - The name of the property that should appear in the object. + */ +export function objectHasProperty(thing, property) { + return (isDefined(thing) && typeof thing === "object" && property in thing); +} +//# sourceMappingURL=typeGuards.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/uuidUtils.common.js b/node_modules/@azure/core-util/dist/react-native/uuidUtils.common.js new file mode 100644 index 000000000..8484013e5 --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/uuidUtils.common.js @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Generated Universally Unique Identifier + * + * @returns RFC4122 v4 UUID. + */ +export function generateUUID() { + let uuid = ""; + for (let i = 0; i < 32; i++) { + // Generate a random number between 0 and 15 + const randomNumber = Math.floor(Math.random() * 16); + // Set the UUID version to 4 in the 13th position + if (i === 12) { + uuid += "4"; + } + else if (i === 16) { + // Set the UUID variant to "10" in the 17th position + uuid += (randomNumber & 0x3) | 0x8; + } + else { + // Add a random hexadecimal digit to the UUID string + uuid += randomNumber.toString(16); + } + // Add hyphens to the UUID string at the appropriate positions + if (i === 7 || i === 11 || i === 15 || i === 19) { + uuid += "-"; + } + } + return uuid; +} +/** + * Generated Universally Unique Identifier + * + * @returns RFC4122 v4 UUID. + */ +export function randomUUID() { + return generateUUID(); +} +//# sourceMappingURL=uuidUtils.common.js.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/dist/react-native/uuidUtils.js b/node_modules/@azure/core-util/dist/react-native/uuidUtils.js new file mode 100644 index 000000000..2207c731a --- /dev/null +++ b/node_modules/@azure/core-util/dist/react-native/uuidUtils.js @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +export { randomUUID } from "./uuidUtils.common.js"; +//# sourceMappingURL=uuidUtils-react-native.mjs.map \ No newline at end of file diff --git a/node_modules/@azure/core-util/package.json b/node_modules/@azure/core-util/package.json index 660bd8541..7edd6968e 100644 --- a/node_modules/@azure/core-util/package.json +++ b/node_modules/@azure/core-util/package.json @@ -1,46 +1,35 @@ { "name": "@azure/core-util", - "version": "1.7.0", + "version": "1.8.1", "description": "Core library for shared utility methods", "sdk-type": "client", - "main": "dist/index.js", - "module": "dist-esm/index.js", - "browser": { - "./dist-esm/sha256.js": "./dist-esm/sha256.browser.js", - "./dist-esm/uuidUtils.js": "./dist-esm/uuidUtils.browser.js", - "./dist-esm/bytesEncoding.js": "./dist-esm/bytesEncoding.browser.js" - }, - "react-native": { - "./dist/index.js": "./dist-esm/index.js", - "./dist-esm/uuidUtils.js": "./dist-esm/uuidUtils.native.js" - }, - "types": "types/latest/core-util.d.ts", - "scripts": { - "build:samples": "echo Obsolete", - "build:test": "echo Obsolete", - "build": "npm run clean && tsc -p . && dev-tool run bundle --browser-test false && api-extractor run --local", - "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "clean": "rimraf dist dist-* temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "tsc -p . && api-extractor run --local", - "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "integration-test:browser": "echo skipped", - "integration-test:node": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint package.json api-extractor.json src --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint package.json api-extractor.json src --ext .ts", - "pack": "npm pack 2>&1", - "test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser", - "test:node": "npm run unit-test:node && npm run integration-test:node", - "test": "npm run test:node && npm run test:browser", - "unit-test:browser": "dev-tool run test:vitest --no-test-proxy=true --browser=true", - "unit-test:node": "dev-tool run test:vitest --no-test-proxy=true", - "unit-test": "npm run unit-test:node && npm run unit-test:browser" + "type": "module", + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "browser": "./dist/browser/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } }, "files": [ "dist/", - "dist-esm/", - "types/latest/core-util.d.ts", "README.md", "LICENSE" ], @@ -60,24 +49,64 @@ "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-util/", "sideEffects": false, "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "scripts": { + "build:samples": "echo Obsolete", + "build:test": "npm run clean && tshy && dev-tool run build-test", + "build": "npm run clean && tshy && api-extractor run --local", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "clean": "rimraf --glob dist dist-* temp *.tgz *.log", + "execute:samples": "echo skipped", + "extract-api": "tshy && api-extractor run --local", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "lint:fix": "eslint package.json api-extractor.json src --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json api-extractor.json src --ext .ts --ext .cts --ext .mts", + "pack": "npm pack 2>&1", + "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser", + "unit-test:node": "dev-tool run test:vitest --no-test-proxy", + "unit-test": "npm run unit-test:node && npm run unit-test:browser" + }, "dependencies": { "@azure/abort-controller": "^2.0.0", - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "devDependencies": { "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure-tools/vite-plugin-browser-test-map": "^1.0.0", - "@microsoft/api-extractor": "^7.31.1", + "@microsoft/api-extractor": "^7.40.3", "@types/node": "^18.0.0", - "@vitest/browser": "^1.2.1", - "eslint": "^8.0.0", - "playwright": "^1.39.0", - "rimraf": "^3.0.0", + "@vitest/browser": "^1.3.1", + "@vitest/coverage-istanbul": "^1.3.1", + "eslint": "^8.56.0", + "playwright": "^1.41.2", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "tshy": "^1.11.1", "typescript": "~5.3.3", - "vitest": "^1.2.1" + "vitest": "^1.3.1" }, "//metadata": { "migrationDate": "2023-03-08T18:36:03.000Z" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false } } diff --git a/node_modules/@azure/logger/dist-esm/src/debug.js b/node_modules/@azure/logger/dist/browser/debug.js similarity index 98% rename from node_modules/@azure/logger/dist-esm/src/debug.js rename to node_modules/@azure/logger/dist/browser/debug.js index d20277911..cf49a6784 100644 --- a/node_modules/@azure/logger/dist-esm/src/debug.js +++ b/node_modules/@azure/logger/dist/browser/debug.js @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { log } from "./log"; +import { log } from "./log.js"; const debugEnvVariable = (typeof process !== "undefined" && process.env && process.env.DEBUG) || undefined; let enabledString; let enabledNamespaces = []; diff --git a/node_modules/@azure/logger/dist-esm/src/index.js b/node_modules/@azure/logger/dist/browser/index.js similarity index 99% rename from node_modules/@azure/logger/dist-esm/src/index.js rename to node_modules/@azure/logger/dist/browser/index.js index cc2572061..6e9ca26b3 100644 --- a/node_modules/@azure/logger/dist-esm/src/index.js +++ b/node_modules/@azure/logger/dist/browser/index.js @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import debug from "./debug"; +import debug from "./debug.js"; const registeredLoggers = new Set(); const logLevelFromEnv = (typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL) || undefined; let azureLogLevel; diff --git a/node_modules/@azure/logger/dist-esm/src/log.browser.js b/node_modules/@azure/logger/dist/browser/log.js similarity index 93% rename from node_modules/@azure/logger/dist-esm/src/log.browser.js rename to node_modules/@azure/logger/dist/browser/log.js index 3f69bb237..46c495019 100644 --- a/node_modules/@azure/logger/dist-esm/src/log.browser.js +++ b/node_modules/@azure/logger/dist/browser/log.js @@ -20,4 +20,4 @@ export function log(...args) { } } } -//# sourceMappingURL=log.browser.js.map \ No newline at end of file +//# sourceMappingURL=log-browser.mjs.map \ No newline at end of file diff --git a/node_modules/@azure/logger/dist/browser/package.json b/node_modules/@azure/logger/dist/browser/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/logger/dist/browser/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/logger/dist/commonjs/debug.js b/node_modules/@azure/logger/dist/commonjs/debug.js new file mode 100644 index 000000000..d43a88d8e --- /dev/null +++ b/node_modules/@azure/logger/dist/commonjs/debug.js @@ -0,0 +1,95 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +const log_js_1 = require("./log.js"); +const debugEnvVariable = (typeof process !== "undefined" && process.env && process.env.DEBUG) || undefined; +let enabledString; +let enabledNamespaces = []; +let skippedNamespaces = []; +const debuggers = []; +if (debugEnvVariable) { + enable(debugEnvVariable); +} +const debugObj = Object.assign((namespace) => { + return createDebugger(namespace); +}, { + enable, + enabled, + disable, + log: log_js_1.log, +}); +function enable(namespaces) { + enabledString = namespaces; + enabledNamespaces = []; + skippedNamespaces = []; + const wildcard = /\*/g; + const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); + for (const ns of namespaceList) { + if (ns.startsWith("-")) { + skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); + } + else { + enabledNamespaces.push(new RegExp(`^${ns}$`)); + } + } + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); + } +} +function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; + } + for (const skipped of skippedNamespaces) { + if (skipped.test(namespace)) { + return false; + } + } + for (const enabledNamespace of enabledNamespaces) { + if (enabledNamespace.test(namespace)) { + return true; + } + } + return false; +} +function disable() { + const result = enabledString || ""; + enable(""); + return result; +} +function createDebugger(namespace) { + const newDebugger = Object.assign(debug, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend, + }); + function debug(...args) { + if (!newDebugger.enabled) { + return; + } + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; + } + newDebugger.log(...args); + } + debuggers.push(newDebugger); + return newDebugger; +} +function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; + } + return false; +} +function extend(namespace) { + const newDebugger = createDebugger(`${this.namespace}:${namespace}`); + newDebugger.log = this.log; + return newDebugger; +} +exports.default = debugObj; +//# sourceMappingURL=debug.js.map \ No newline at end of file diff --git a/node_modules/@azure/logger/dist/commonjs/index.js b/node_modules/@azure/logger/dist/commonjs/index.js new file mode 100644 index 000000000..45db7e325 --- /dev/null +++ b/node_modules/@azure/logger/dist/commonjs/index.js @@ -0,0 +1,105 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createClientLogger = exports.getLogLevel = exports.setLogLevel = exports.AzureLogger = void 0; +const tslib_1 = require("tslib"); +const debug_js_1 = tslib_1.__importDefault(require("./debug.js")); +const registeredLoggers = new Set(); +const logLevelFromEnv = (typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL) || undefined; +let azureLogLevel; +/** + * The AzureLogger provides a mechanism for overriding where logs are output to. + * By default, logs are sent to stderr. + * Override the `log` method to redirect logs to another location. + */ +exports.AzureLogger = (0, debug_js_1.default)("azure"); +exports.AzureLogger.log = (...args) => { + debug_js_1.default.log(...args); +}; +const AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; +if (logLevelFromEnv) { + // avoid calling setLogLevel because we don't want a mis-set environment variable to crash + if (isAzureLogLevel(logLevelFromEnv)) { + setLogLevel(logLevelFromEnv); + } + else { + console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); + } +} +/** + * Immediately enables logging at the specified log level. If no level is specified, logging is disabled. + * @param level - The log level to enable for logging. + * Options from most verbose to least verbose are: + * - verbose + * - info + * - warning + * - error + */ +function setLogLevel(level) { + if (level && !isAzureLogLevel(level)) { + throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + } + azureLogLevel = level; + const enabledNamespaces = []; + for (const logger of registeredLoggers) { + if (shouldEnable(logger)) { + enabledNamespaces.push(logger.namespace); + } + } + debug_js_1.default.enable(enabledNamespaces.join(",")); +} +exports.setLogLevel = setLogLevel; +/** + * Retrieves the currently specified log level. + */ +function getLogLevel() { + return azureLogLevel; +} +exports.getLogLevel = getLogLevel; +const levelMap = { + verbose: 400, + info: 300, + warning: 200, + error: 100, +}; +/** + * Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`. + * @param namespace - The name of the SDK package. + * @hidden + */ +function createClientLogger(namespace) { + const clientRootLogger = exports.AzureLogger.extend(namespace); + patchLogMethod(exports.AzureLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose"), + }; +} +exports.createClientLogger = createClientLogger; +function patchLogMethod(parent, child) { + child.log = (...args) => { + parent.log(...args); + }; +} +function createLogger(parent, level) { + const logger = Object.assign(parent.extend(level), { + level, + }); + patchLogMethod(parent, logger); + if (shouldEnable(logger)) { + const enabledNamespaces = debug_js_1.default.disable(); + debug_js_1.default.enable(enabledNamespaces + "," + logger.namespace); + } + registeredLoggers.add(logger); + return logger; +} +function shouldEnable(logger) { + return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); +} +function isAzureLogLevel(logLevel) { + return AZURE_LOG_LEVELS.includes(logLevel); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/logger/dist/commonjs/log.js b/node_modules/@azure/logger/dist/commonjs/log.js new file mode 100644 index 000000000..581081c62 --- /dev/null +++ b/node_modules/@azure/logger/dist/commonjs/log.js @@ -0,0 +1,14 @@ +"use strict"; +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.log = void 0; +const tslib_1 = require("tslib"); +const node_os_1 = require("node:os"); +const node_util_1 = tslib_1.__importDefault(require("node:util")); +const process = tslib_1.__importStar(require("node:process")); +function log(message, ...args) { + process.stderr.write(`${node_util_1.default.format(message, ...args)}${node_os_1.EOL}`); +} +exports.log = log; +//# sourceMappingURL=log.js.map \ No newline at end of file diff --git a/node_modules/@azure/logger/dist/commonjs/package.json b/node_modules/@azure/logger/dist/commonjs/package.json new file mode 100644 index 000000000..5bbefffba --- /dev/null +++ b/node_modules/@azure/logger/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/node_modules/@azure/logger/dist/commonjs/tsdoc-metadata.json b/node_modules/@azure/logger/dist/commonjs/tsdoc-metadata.json new file mode 100644 index 000000000..22735db17 --- /dev/null +++ b/node_modules/@azure/logger/dist/commonjs/tsdoc-metadata.json @@ -0,0 +1,11 @@ +// This file is read by tools that parse documentation comments conforming to the TSDoc standard. +// It should be published with your NPM package. It should not be tracked by Git. +{ + "tsdocVersion": "0.12", + "toolPackages": [ + { + "packageName": "@microsoft/api-extractor", + "packageVersion": "7.42.3" + } + ] +} diff --git a/node_modules/@azure/logger/dist/esm/debug.js b/node_modules/@azure/logger/dist/esm/debug.js new file mode 100644 index 000000000..cf49a6784 --- /dev/null +++ b/node_modules/@azure/logger/dist/esm/debug.js @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { log } from "./log.js"; +const debugEnvVariable = (typeof process !== "undefined" && process.env && process.env.DEBUG) || undefined; +let enabledString; +let enabledNamespaces = []; +let skippedNamespaces = []; +const debuggers = []; +if (debugEnvVariable) { + enable(debugEnvVariable); +} +const debugObj = Object.assign((namespace) => { + return createDebugger(namespace); +}, { + enable, + enabled, + disable, + log, +}); +function enable(namespaces) { + enabledString = namespaces; + enabledNamespaces = []; + skippedNamespaces = []; + const wildcard = /\*/g; + const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); + for (const ns of namespaceList) { + if (ns.startsWith("-")) { + skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); + } + else { + enabledNamespaces.push(new RegExp(`^${ns}$`)); + } + } + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); + } +} +function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; + } + for (const skipped of skippedNamespaces) { + if (skipped.test(namespace)) { + return false; + } + } + for (const enabledNamespace of enabledNamespaces) { + if (enabledNamespace.test(namespace)) { + return true; + } + } + return false; +} +function disable() { + const result = enabledString || ""; + enable(""); + return result; +} +function createDebugger(namespace) { + const newDebugger = Object.assign(debug, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend, + }); + function debug(...args) { + if (!newDebugger.enabled) { + return; + } + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; + } + newDebugger.log(...args); + } + debuggers.push(newDebugger); + return newDebugger; +} +function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; + } + return false; +} +function extend(namespace) { + const newDebugger = createDebugger(`${this.namespace}:${namespace}`); + newDebugger.log = this.log; + return newDebugger; +} +export default debugObj; +//# sourceMappingURL=debug.js.map \ No newline at end of file diff --git a/node_modules/@azure/logger/dist/esm/index.js b/node_modules/@azure/logger/dist/esm/index.js new file mode 100644 index 000000000..6e9ca26b3 --- /dev/null +++ b/node_modules/@azure/logger/dist/esm/index.js @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import debug from "./debug.js"; +const registeredLoggers = new Set(); +const logLevelFromEnv = (typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL) || undefined; +let azureLogLevel; +/** + * The AzureLogger provides a mechanism for overriding where logs are output to. + * By default, logs are sent to stderr. + * Override the `log` method to redirect logs to another location. + */ +export const AzureLogger = debug("azure"); +AzureLogger.log = (...args) => { + debug.log(...args); +}; +const AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; +if (logLevelFromEnv) { + // avoid calling setLogLevel because we don't want a mis-set environment variable to crash + if (isAzureLogLevel(logLevelFromEnv)) { + setLogLevel(logLevelFromEnv); + } + else { + console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); + } +} +/** + * Immediately enables logging at the specified log level. If no level is specified, logging is disabled. + * @param level - The log level to enable for logging. + * Options from most verbose to least verbose are: + * - verbose + * - info + * - warning + * - error + */ +export function setLogLevel(level) { + if (level && !isAzureLogLevel(level)) { + throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + } + azureLogLevel = level; + const enabledNamespaces = []; + for (const logger of registeredLoggers) { + if (shouldEnable(logger)) { + enabledNamespaces.push(logger.namespace); + } + } + debug.enable(enabledNamespaces.join(",")); +} +/** + * Retrieves the currently specified log level. + */ +export function getLogLevel() { + return azureLogLevel; +} +const levelMap = { + verbose: 400, + info: 300, + warning: 200, + error: 100, +}; +/** + * Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`. + * @param namespace - The name of the SDK package. + * @hidden + */ +export function createClientLogger(namespace) { + const clientRootLogger = AzureLogger.extend(namespace); + patchLogMethod(AzureLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose"), + }; +} +function patchLogMethod(parent, child) { + child.log = (...args) => { + parent.log(...args); + }; +} +function createLogger(parent, level) { + const logger = Object.assign(parent.extend(level), { + level, + }); + patchLogMethod(parent, logger); + if (shouldEnable(logger)) { + const enabledNamespaces = debug.disable(); + debug.enable(enabledNamespaces + "," + logger.namespace); + } + registeredLoggers.add(logger); + return logger; +} +function shouldEnable(logger) { + return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); +} +function isAzureLogLevel(logLevel) { + return AZURE_LOG_LEVELS.includes(logLevel); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/logger/dist-esm/src/log.js b/node_modules/@azure/logger/dist/esm/log.js similarity index 67% rename from node_modules/@azure/logger/dist-esm/src/log.js rename to node_modules/@azure/logger/dist/esm/log.js index 74a1f11f5..ec432c99e 100644 --- a/node_modules/@azure/logger/dist-esm/src/log.js +++ b/node_modules/@azure/logger/dist/esm/log.js @@ -1,7 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { EOL } from "os"; -import util from "util"; +import { EOL } from "node:os"; +import util from "node:util"; +import * as process from "node:process"; export function log(message, ...args) { process.stderr.write(`${util.format(message, ...args)}${EOL}`); } diff --git a/node_modules/@azure/logger/dist/esm/package.json b/node_modules/@azure/logger/dist/esm/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/logger/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/logger/dist/index.js b/node_modules/@azure/logger/dist/index.js deleted file mode 100644 index 81e97c364..000000000 --- a/node_modules/@azure/logger/dist/index.js +++ /dev/null @@ -1,208 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var os = require('os'); -var util = require('util'); - -function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - -var util__default = /*#__PURE__*/_interopDefaultLegacy(util); - -// Copyright (c) Microsoft Corporation. -function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os.EOL}`); -} - -// Copyright (c) Microsoft Corporation. -const debugEnvVariable = (typeof process !== "undefined" && process.env && process.env.DEBUG) || undefined; -let enabledString; -let enabledNamespaces = []; -let skippedNamespaces = []; -const debuggers = []; -if (debugEnvVariable) { - enable(debugEnvVariable); -} -const debugObj = Object.assign((namespace) => { - return createDebugger(namespace); -}, { - enable, - enabled, - disable, - log, -}); -function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } - else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } - } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); - } -} -function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; - } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } - } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; - } - } - return false; -} -function disable() { - const result = enabledString || ""; - enable(""); - return result; -} -function createDebugger(namespace) { - const newDebugger = Object.assign(debug, { - enabled: enabled(namespace), - destroy, - log: debugObj.log, - namespace, - extend, - }); - function debug(...args) { - if (!newDebugger.enabled) { - return; - } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; - } - newDebugger.log(...args); - } - debuggers.push(newDebugger); - return newDebugger; -} -function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; - } - return false; -} -function extend(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; -} -var debug = debugObj; - -// Copyright (c) Microsoft Corporation. -const registeredLoggers = new Set(); -const logLevelFromEnv = (typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL) || undefined; -let azureLogLevel; -/** - * The AzureLogger provides a mechanism for overriding where logs are output to. - * By default, logs are sent to stderr. - * Override the `log` method to redirect logs to another location. - */ -const AzureLogger = debug("azure"); -AzureLogger.log = (...args) => { - debug.log(...args); -}; -const AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; -if (logLevelFromEnv) { - // avoid calling setLogLevel because we don't want a mis-set environment variable to crash - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } - else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } -} -/** - * Immediately enables logging at the specified log level. If no level is specified, logging is disabled. - * @param level - The log level to enable for logging. - * Options from most verbose to least verbose are: - * - verbose - * - info - * - warning - * - error - */ -function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); - } - azureLogLevel = level; - const enabledNamespaces = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces.push(logger.namespace); - } - } - debug.enable(enabledNamespaces.join(",")); -} -/** - * Retrieves the currently specified log level. - */ -function getLogLevel() { - return azureLogLevel; -} -const levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100, -}; -/** - * Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`. - * @param namespace - The name of the SDK package. - * @hidden - */ -function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose"), - }; -} -function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; -} -function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level, - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces = debug.disable(); - debug.enable(enabledNamespaces + "," + logger.namespace); - } - registeredLoggers.add(logger); - return logger; -} -function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); -} -function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); -} - -exports.AzureLogger = AzureLogger; -exports.createClientLogger = createClientLogger; -exports.getLogLevel = getLogLevel; -exports.setLogLevel = setLogLevel; -//# sourceMappingURL=index.js.map diff --git a/node_modules/@azure/logger/dist/react-native/debug.js b/node_modules/@azure/logger/dist/react-native/debug.js new file mode 100644 index 000000000..cf49a6784 --- /dev/null +++ b/node_modules/@azure/logger/dist/react-native/debug.js @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { log } from "./log.js"; +const debugEnvVariable = (typeof process !== "undefined" && process.env && process.env.DEBUG) || undefined; +let enabledString; +let enabledNamespaces = []; +let skippedNamespaces = []; +const debuggers = []; +if (debugEnvVariable) { + enable(debugEnvVariable); +} +const debugObj = Object.assign((namespace) => { + return createDebugger(namespace); +}, { + enable, + enabled, + disable, + log, +}); +function enable(namespaces) { + enabledString = namespaces; + enabledNamespaces = []; + skippedNamespaces = []; + const wildcard = /\*/g; + const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); + for (const ns of namespaceList) { + if (ns.startsWith("-")) { + skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); + } + else { + enabledNamespaces.push(new RegExp(`^${ns}$`)); + } + } + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); + } +} +function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; + } + for (const skipped of skippedNamespaces) { + if (skipped.test(namespace)) { + return false; + } + } + for (const enabledNamespace of enabledNamespaces) { + if (enabledNamespace.test(namespace)) { + return true; + } + } + return false; +} +function disable() { + const result = enabledString || ""; + enable(""); + return result; +} +function createDebugger(namespace) { + const newDebugger = Object.assign(debug, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend, + }); + function debug(...args) { + if (!newDebugger.enabled) { + return; + } + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; + } + newDebugger.log(...args); + } + debuggers.push(newDebugger); + return newDebugger; +} +function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; + } + return false; +} +function extend(namespace) { + const newDebugger = createDebugger(`${this.namespace}:${namespace}`); + newDebugger.log = this.log; + return newDebugger; +} +export default debugObj; +//# sourceMappingURL=debug.js.map \ No newline at end of file diff --git a/node_modules/@azure/logger/dist/react-native/index.js b/node_modules/@azure/logger/dist/react-native/index.js new file mode 100644 index 000000000..6e9ca26b3 --- /dev/null +++ b/node_modules/@azure/logger/dist/react-native/index.js @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import debug from "./debug.js"; +const registeredLoggers = new Set(); +const logLevelFromEnv = (typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL) || undefined; +let azureLogLevel; +/** + * The AzureLogger provides a mechanism for overriding where logs are output to. + * By default, logs are sent to stderr. + * Override the `log` method to redirect logs to another location. + */ +export const AzureLogger = debug("azure"); +AzureLogger.log = (...args) => { + debug.log(...args); +}; +const AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; +if (logLevelFromEnv) { + // avoid calling setLogLevel because we don't want a mis-set environment variable to crash + if (isAzureLogLevel(logLevelFromEnv)) { + setLogLevel(logLevelFromEnv); + } + else { + console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); + } +} +/** + * Immediately enables logging at the specified log level. If no level is specified, logging is disabled. + * @param level - The log level to enable for logging. + * Options from most verbose to least verbose are: + * - verbose + * - info + * - warning + * - error + */ +export function setLogLevel(level) { + if (level && !isAzureLogLevel(level)) { + throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + } + azureLogLevel = level; + const enabledNamespaces = []; + for (const logger of registeredLoggers) { + if (shouldEnable(logger)) { + enabledNamespaces.push(logger.namespace); + } + } + debug.enable(enabledNamespaces.join(",")); +} +/** + * Retrieves the currently specified log level. + */ +export function getLogLevel() { + return azureLogLevel; +} +const levelMap = { + verbose: 400, + info: 300, + warning: 200, + error: 100, +}; +/** + * Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`. + * @param namespace - The name of the SDK package. + * @hidden + */ +export function createClientLogger(namespace) { + const clientRootLogger = AzureLogger.extend(namespace); + patchLogMethod(AzureLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose"), + }; +} +function patchLogMethod(parent, child) { + child.log = (...args) => { + parent.log(...args); + }; +} +function createLogger(parent, level) { + const logger = Object.assign(parent.extend(level), { + level, + }); + patchLogMethod(parent, logger); + if (shouldEnable(logger)) { + const enabledNamespaces = debug.disable(); + debug.enable(enabledNamespaces + "," + logger.namespace); + } + registeredLoggers.add(logger); + return logger; +} +function shouldEnable(logger) { + return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); +} +function isAzureLogLevel(logLevel) { + return AZURE_LOG_LEVELS.includes(logLevel); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@azure/logger/dist/react-native/log.js b/node_modules/@azure/logger/dist/react-native/log.js new file mode 100644 index 000000000..ec432c99e --- /dev/null +++ b/node_modules/@azure/logger/dist/react-native/log.js @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { EOL } from "node:os"; +import util from "node:util"; +import * as process from "node:process"; +export function log(message, ...args) { + process.stderr.write(`${util.format(message, ...args)}${EOL}`); +} +//# sourceMappingURL=log.js.map \ No newline at end of file diff --git a/node_modules/@azure/logger/dist/react-native/package.json b/node_modules/@azure/logger/dist/react-native/package.json new file mode 100644 index 000000000..3dbc1ca59 --- /dev/null +++ b/node_modules/@azure/logger/dist/react-native/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/node_modules/@azure/logger/package.json b/node_modules/@azure/logger/package.json index ddb4e17e2..8a6059b6e 100644 --- a/node_modules/@azure/logger/package.json +++ b/node_modules/@azure/logger/package.json @@ -1,49 +1,38 @@ { "name": "@azure/logger", "sdk-type": "client", - "version": "1.0.4", + "version": "1.1.1", "description": "Microsoft Azure SDK for JavaScript - Logger", - "main": "./dist/index.js", - "module": "dist-esm/src/index.js", - "browser": { - "./dist-esm/src/log.js": "./dist-esm/src/log.browser.js", - "process": false - }, - "react-native": { - "./dist/index.js": "./dist-esm/src/index.js" + "type": "module", + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "browser": "./dist/browser/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "react-native": { + "types": "./dist/react-native/index.d.ts", + "default": "./dist/react-native/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" }, - "scripts": { - "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", - "build:samples": "echo Obsolete", - "build:test": "tsc -p . && dev-tool run bundle", - "build": "npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local --local", - "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "clean": "rimraf dist dist-* temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "tsc -p . && api-extractor run --local", - "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "integration-test:browser": "echo skipped", - "integration-test:node": "echo skipped", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint package.json api-extractor.json src test --ext .ts", - "pack": "npm pack 2>&1", - "pretest": "npm run build:test", - "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", - "test:node": "npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node", - "test": "npm run clean && tsc -p . && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test", - "unit-test:browser": "karma start --single-run", - "unit-test:node": "mocha -r esm -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\"", - "unit-test": "npm run unit-test:node && npm run unit-test:browser" - }, - "types": "./types/logger.d.ts", "files": [ "dist/", - "dist-esm/src/", - "types/logger.d.ts", "README.md", "LICENSE" ], @@ -66,40 +55,64 @@ }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger/README.md", "sideEffects": false, + "scripts": { + "build:samples": "echo Obsolete", + "build:test": "npm run clean && tshy && dev-tool run build-test", + "build": "npm run clean && tshy && api-extractor run --local", + "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "clean": "rimraf --glob dist dist-* temp *.tgz *.log", + "execute:samples": "echo skipped", + "extract-api": "tshy && api-extractor run --local", + "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts --fix --fix-type [problem,suggestion]", + "lint": "eslint package.json api-extractor.json src test --ext .ts --ext .cts --ext .mts", + "pack": "npm pack 2>&1", + "pretest": "npm run build:test", + "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", + "test:node": "npm run clean && tshy && npm run unit-test:node && npm run integration-test:node", + "test": "npm run clean && tshy && npm run unit-test:node && dev-tool run build-test && npm run unit-test:browser && npm run integration-test", + "unit-test:browser": "npm run build:test && dev-tool run test:vitest --no-test-proxy --browser", + "unit-test:node": "dev-tool run test:vitest --no-test-proxy", + "unit-test": "npm run unit-test:node && npm run unit-test:browser" + }, "dependencies": { - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "devDependencies": { "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", - "@microsoft/api-extractor": "^7.31.1", - "@types/chai": "^4.1.6", - "@types/mocha": "^7.0.2", - "@types/node": "^14.0.0", - "@types/sinon": "^9.0.4", - "chai": "^4.2.0", - "cross-env": "^7.0.2", - "dotenv": "^16.0.0", - "eslint": "^8.0.0", - "karma": "^6.2.0", - "karma-chrome-launcher": "^3.0.0", - "karma-coverage": "^2.0.0", - "karma-edge-launcher": "^0.4.2", - "karma-env-preprocessor": "^0.1.1", - "karma-firefox-launcher": "^1.1.0", - "karma-ie-launcher": "^1.0.0", - "karma-junit-reporter": "^2.0.1", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-sourcemap-loader": "^0.3.8", - "mocha": "^7.1.1", - "mocha-junit-reporter": "^2.0.0", - "nyc": "^15.0.0", - "prettier": "^2.5.1", - "puppeteer": "^19.2.2", - "rimraf": "^3.0.0", - "sinon": "^9.0.2", - "ts-node": "^10.0.0", - "typescript": "~4.8.0" + "@microsoft/api-extractor": "^7.40.3", + "@types/node": "^18.0.0", + "@vitest/browser": "^1.3.1", + "@vitest/coverage-istanbul": "^1.3.1", + "dotenv": "^16.3.1", + "eslint": "^8.56.0", + "playwright": "^1.41.2", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "tshy": "^1.11.1", + "typescript": "~5.3.3", + "vitest": "^1.3.1" + }, + "//metadata": { + "migrationDate": "2023-03-08T18:36:03.000Z" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false } } diff --git a/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js b/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js index 79da160c3..3c8c081a8 100644 --- a/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js +++ b/node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js @@ -78,7 +78,7 @@ Dicer.prototype._write = function (data, encoding, cb) { if (this._headerFirst && this._isPreamble) { if (!this._part) { this._part = new PartStream(this._partOpts) - if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() } + if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() } } const r = this._hparser.push(data) if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() } @@ -135,7 +135,7 @@ Dicer.prototype._oninfo = function (isMatch, data, start, end) { } } if (this._dashes === 2) { - if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) } + if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) } this.reset() this._finished = true // no more parts will be added @@ -153,7 +153,13 @@ Dicer.prototype._oninfo = function (isMatch, data, start, end) { this._part._read = function (n) { self._unpause() } - if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() } + if (this._isPreamble && this.listenerCount('preamble') !== 0) { + this.emit('preamble', this._part) + } else if (this._isPreamble !== true && this.listenerCount('part') !== 0) { + this.emit('part', this._part) + } else { + this._ignore() + } if (!this._isPreamble) { this._inHeader = true } } if (data && start < end && !this._ignoreData) { diff --git a/node_modules/@fastify/busboy/lib/types/multipart.js b/node_modules/@fastify/busboy/lib/types/multipart.js index ad242db27..d691eca37 100644 --- a/node_modules/@fastify/busboy/lib/types/multipart.js +++ b/node_modules/@fastify/busboy/lib/types/multipart.js @@ -163,7 +163,7 @@ function Multipart (boy, cfg) { ++nfiles - if (!boy._events.file) { + if (boy.listenerCount('file') === 0) { self.parser._ignore() return } diff --git a/node_modules/@fastify/busboy/lib/utils/decodeText.js b/node_modules/@fastify/busboy/lib/utils/decodeText.js index be35d6b10..eac7d35ef 100644 --- a/node_modules/@fastify/busboy/lib/utils/decodeText.js +++ b/node_modules/@fastify/busboy/lib/utils/decodeText.js @@ -96,7 +96,7 @@ const decoders = { if (textDecoders.has(this.toString())) { try { return textDecoders.get(this).decode(data) - } catch (e) { } + } catch {} } return typeof data === 'string' ? data diff --git a/node_modules/@fastify/busboy/package.json b/node_modules/@fastify/busboy/package.json index 4be895c10..83693acbd 100644 --- a/node_modules/@fastify/busboy/package.json +++ b/node_modules/@fastify/busboy/package.json @@ -1,6 +1,6 @@ { "name": "@fastify/busboy", - "version": "2.1.0", + "version": "2.1.1", "private": false, "author": "Brian White ", "contributors": [ @@ -43,7 +43,7 @@ "standard": "^17.0.0", "tap": "^16.3.8", "tinybench": "^2.5.1", - "tsd": "^0.29.0", + "tsd": "^0.30.0", "typescript": "^5.0.2" }, "keywords": [ @@ -55,7 +55,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/fastify/busboy.git" + "url": "git+https://github.com/fastify/busboy.git" }, "tsd": { "directory": "test/types", diff --git a/node_modules/@octokit/request-error/node_modules/@octokit/openapi-types/package.json b/node_modules/@octokit/request-error/node_modules/@octokit/openapi-types/package.json index f8ba9436b..ade207b2a 100644 --- a/node_modules/@octokit/request-error/node_modules/@octokit/openapi-types/package.json +++ b/node_modules/@octokit/request-error/node_modules/@octokit/openapi-types/package.json @@ -9,12 +9,12 @@ "publishConfig": { "access": "public" }, - "version": "19.1.0", + "version": "20.0.0", "main": "", "types": "types.d.ts", "author": "Gregor Martynus (https://twitter.com/gr2m)", "license": "MIT", "octokit": { - "openapi-version": "13.3.0" + "openapi-version": "14.0.0" } } diff --git a/node_modules/@octokit/request-error/node_modules/@octokit/types/package.json b/node_modules/@octokit/request-error/node_modules/@octokit/types/package.json index d5e074055..99959575e 100644 --- a/node_modules/@octokit/request-error/node_modules/@octokit/types/package.json +++ b/node_modules/@octokit/request-error/node_modules/@octokit/types/package.json @@ -1,12 +1,12 @@ { "name": "@octokit/types", - "version": "12.4.0", + "version": "12.6.0", "publishConfig": { "access": "public" }, "description": "Shared TypeScript definitions for Octokit projects", "dependencies": { - "@octokit/openapi-types": "^19.1.0" + "@octokit/openapi-types": "^20.0.0" }, "repository": "github:octokit/types.ts", "keywords": [ @@ -25,10 +25,10 @@ "handlebars": "^4.7.6", "json-schema-to-typescript": "^13.0.0", "lodash.set": "^4.3.2", - "npm-run-all": "^4.1.5", + "npm-run-all2": "^6.0.0", "pascal-case": "^3.1.1", "prettier": "^3.0.0", - "semantic-release": "^22.0.0", + "semantic-release": "^23.0.0", "semantic-release-plugin-update-version-in-files": "^1.0.0", "sort-keys": "^5.0.0", "string-to-jsdoc-comment": "^1.0.0", @@ -36,7 +36,7 @@ "typescript": "^5.0.0" }, "octokit": { - "openapi-version": "13.3.0" + "openapi-version": "14.0.0" }, "files": [ "dist-types/**" diff --git a/node_modules/@opentelemetry/api/build/esm/experimental/index.js b/node_modules/@opentelemetry/api/build/esm/experimental/index.js new file mode 100644 index 000000000..8400e49f5 --- /dev/null +++ b/node_modules/@opentelemetry/api/build/esm/experimental/index.js @@ -0,0 +1,17 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export { wrapTracer, SugaredTracer } from './trace/SugaredTracer'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.js b/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.js new file mode 100644 index 000000000..0c6a2bd4e --- /dev/null +++ b/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredOptions.js @@ -0,0 +1,17 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export {}; +//# sourceMappingURL=SugaredOptions.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.js b/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.js new file mode 100644 index 000000000..6fb98ded2 --- /dev/null +++ b/node_modules/@opentelemetry/api/build/esm/experimental/trace/SugaredTracer.js @@ -0,0 +1,92 @@ +import { context, SpanStatusCode } from '../../'; +var defaultOnException = function (e, span) { + span.recordException(e); + span.setStatus({ + code: SpanStatusCode.ERROR, + }); +}; +/** + * return a new SugaredTracer created from the supplied one + * @param tracer + */ +export function wrapTracer(tracer) { + return new SugaredTracer(tracer); +} +var SugaredTracer = /** @class */ (function () { + function SugaredTracer(tracer) { + this._tracer = tracer; + this.startSpan = tracer.startSpan.bind(this._tracer); + this.startActiveSpan = tracer.startActiveSpan.bind(this._tracer); + } + SugaredTracer.prototype.withActiveSpan = function (name, arg2, arg3, arg4) { + var _a = massageParams(arg2, arg3, arg4), opts = _a.opts, ctx = _a.ctx, fn = _a.fn; + return this._tracer.startActiveSpan(name, opts, ctx, function (span) { + return handleFn(span, opts, fn); + }); + }; + SugaredTracer.prototype.withSpan = function (name, arg2, arg3, arg4) { + var _a = massageParams(arg2, arg3, arg4), opts = _a.opts, ctx = _a.ctx, fn = _a.fn; + var span = this._tracer.startSpan(name, opts, ctx); + return handleFn(span, opts, fn); + }; + return SugaredTracer; +}()); +export { SugaredTracer }; +/** + * Massages parameters of withSpan and withActiveSpan to allow signature overwrites + * @param arg + * @param arg2 + * @param arg3 + */ +function massageParams(arg, arg2, arg3) { + var opts; + var ctx; + var fn; + if (!arg2 && !arg3) { + fn = arg; + } + else if (!arg3) { + opts = arg; + fn = arg2; + } + else { + opts = arg; + ctx = arg2; + fn = arg3; + } + opts = opts !== null && opts !== void 0 ? opts : {}; + ctx = ctx !== null && ctx !== void 0 ? ctx : context.active(); + return { opts: opts, ctx: ctx, fn: fn }; +} +/** + * Executes fn, returns results and runs onException in the case of exception to allow overwriting of error handling + * @param span + * @param opts + * @param fn + */ +function handleFn(span, opts, fn) { + var _a; + var onException = (_a = opts.onException) !== null && _a !== void 0 ? _a : defaultOnException; + var errorHandler = function (e) { + onException(e, span); + span.end(); + throw e; + }; + try { + var ret = fn(span); + // if fn is an async function, attach a recordException and spanEnd callback to the promise + if (typeof (ret === null || ret === void 0 ? void 0 : ret.then) === 'function') { + return ret.then(function (val) { + span.end(); + return val; + }, errorHandler); + } + span.end(); + return ret; + } + catch (e) { + // add throw to signal the compiler that this will throw in the inner scope + throw errorHandler(e); + } +} +//# sourceMappingURL=SugaredTracer.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/esm/version.js b/node_modules/@opentelemetry/api/build/esm/version.js index d6c4e596c..ba175da37 100644 --- a/node_modules/@opentelemetry/api/build/esm/version.js +++ b/node_modules/@opentelemetry/api/build/esm/version.js @@ -14,5 +14,5 @@ * limitations under the License. */ // this is autogenerated file, see scripts/version-update.js -export var VERSION = '1.7.0'; +export var VERSION = '1.8.0'; //# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/esnext/experimental/index.js b/node_modules/@opentelemetry/api/build/esnext/experimental/index.js new file mode 100644 index 000000000..8400e49f5 --- /dev/null +++ b/node_modules/@opentelemetry/api/build/esnext/experimental/index.js @@ -0,0 +1,17 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export { wrapTracer, SugaredTracer } from './trace/SugaredTracer'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredOptions.js b/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredOptions.js new file mode 100644 index 000000000..0c6a2bd4e --- /dev/null +++ b/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredOptions.js @@ -0,0 +1,17 @@ +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export {}; +//# sourceMappingURL=SugaredOptions.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredTracer.js b/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredTracer.js new file mode 100644 index 000000000..a1edc7f7e --- /dev/null +++ b/node_modules/@opentelemetry/api/build/esnext/experimental/trace/SugaredTracer.js @@ -0,0 +1,88 @@ +import { context, SpanStatusCode } from '../../'; +const defaultOnException = (e, span) => { + span.recordException(e); + span.setStatus({ + code: SpanStatusCode.ERROR, + }); +}; +/** + * return a new SugaredTracer created from the supplied one + * @param tracer + */ +export function wrapTracer(tracer) { + return new SugaredTracer(tracer); +} +export class SugaredTracer { + constructor(tracer) { + this._tracer = tracer; + this.startSpan = tracer.startSpan.bind(this._tracer); + this.startActiveSpan = tracer.startActiveSpan.bind(this._tracer); + } + withActiveSpan(name, arg2, arg3, arg4) { + const { opts, ctx, fn } = massageParams(arg2, arg3, arg4); + return this._tracer.startActiveSpan(name, opts, ctx, (span) => handleFn(span, opts, fn)); + } + withSpan(name, arg2, arg3, arg4) { + const { opts, ctx, fn } = massageParams(arg2, arg3, arg4); + const span = this._tracer.startSpan(name, opts, ctx); + return handleFn(span, opts, fn); + } +} +/** + * Massages parameters of withSpan and withActiveSpan to allow signature overwrites + * @param arg + * @param arg2 + * @param arg3 + */ +function massageParams(arg, arg2, arg3) { + let opts; + let ctx; + let fn; + if (!arg2 && !arg3) { + fn = arg; + } + else if (!arg3) { + opts = arg; + fn = arg2; + } + else { + opts = arg; + ctx = arg2; + fn = arg3; + } + opts = opts !== null && opts !== void 0 ? opts : {}; + ctx = ctx !== null && ctx !== void 0 ? ctx : context.active(); + return { opts, ctx, fn }; +} +/** + * Executes fn, returns results and runs onException in the case of exception to allow overwriting of error handling + * @param span + * @param opts + * @param fn + */ +function handleFn(span, opts, fn) { + var _a; + const onException = (_a = opts.onException) !== null && _a !== void 0 ? _a : defaultOnException; + const errorHandler = (e) => { + onException(e, span); + span.end(); + throw e; + }; + try { + const ret = fn(span); + // if fn is an async function, attach a recordException and spanEnd callback to the promise + if (typeof (ret === null || ret === void 0 ? void 0 : ret.then) === 'function') { + return ret.then(val => { + span.end(); + return val; + }, errorHandler); + } + span.end(); + return ret; + } + catch (e) { + // add throw to signal the compiler that this will throw in the inner scope + throw errorHandler(e); + } +} +//# sourceMappingURL=SugaredTracer.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/esnext/version.js b/node_modules/@opentelemetry/api/build/esnext/version.js index 4e273f1cf..77a98c416 100644 --- a/node_modules/@opentelemetry/api/build/esnext/version.js +++ b/node_modules/@opentelemetry/api/build/esnext/version.js @@ -14,5 +14,5 @@ * limitations under the License. */ // this is autogenerated file, see scripts/version-update.js -export const VERSION = '1.7.0'; +export const VERSION = '1.8.0'; //# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/src/experimental/index.js b/node_modules/@opentelemetry/api/build/src/experimental/index.js new file mode 100644 index 000000000..bd611ec0c --- /dev/null +++ b/node_modules/@opentelemetry/api/build/src/experimental/index.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SugaredTracer = exports.wrapTracer = void 0; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var SugaredTracer_1 = require("./trace/SugaredTracer"); +Object.defineProperty(exports, "wrapTracer", { enumerable: true, get: function () { return SugaredTracer_1.wrapTracer; } }); +Object.defineProperty(exports, "SugaredTracer", { enumerable: true, get: function () { return SugaredTracer_1.SugaredTracer; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredOptions.js b/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredOptions.js new file mode 100644 index 000000000..a18d65b22 --- /dev/null +++ b/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredOptions.js @@ -0,0 +1,18 @@ +"use strict"; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=SugaredOptions.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredTracer.js b/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredTracer.js new file mode 100644 index 000000000..aae624982 --- /dev/null +++ b/node_modules/@opentelemetry/api/build/src/experimental/trace/SugaredTracer.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SugaredTracer = exports.wrapTracer = void 0; +const __1 = require("../../"); +const defaultOnException = (e, span) => { + span.recordException(e); + span.setStatus({ + code: __1.SpanStatusCode.ERROR, + }); +}; +/** + * return a new SugaredTracer created from the supplied one + * @param tracer + */ +function wrapTracer(tracer) { + return new SugaredTracer(tracer); +} +exports.wrapTracer = wrapTracer; +class SugaredTracer { + constructor(tracer) { + this._tracer = tracer; + this.startSpan = tracer.startSpan.bind(this._tracer); + this.startActiveSpan = tracer.startActiveSpan.bind(this._tracer); + } + withActiveSpan(name, arg2, arg3, arg4) { + const { opts, ctx, fn } = massageParams(arg2, arg3, arg4); + return this._tracer.startActiveSpan(name, opts, ctx, (span) => handleFn(span, opts, fn)); + } + withSpan(name, arg2, arg3, arg4) { + const { opts, ctx, fn } = massageParams(arg2, arg3, arg4); + const span = this._tracer.startSpan(name, opts, ctx); + return handleFn(span, opts, fn); + } +} +exports.SugaredTracer = SugaredTracer; +/** + * Massages parameters of withSpan and withActiveSpan to allow signature overwrites + * @param arg + * @param arg2 + * @param arg3 + */ +function massageParams(arg, arg2, arg3) { + let opts; + let ctx; + let fn; + if (!arg2 && !arg3) { + fn = arg; + } + else if (!arg3) { + opts = arg; + fn = arg2; + } + else { + opts = arg; + ctx = arg2; + fn = arg3; + } + opts = opts !== null && opts !== void 0 ? opts : {}; + ctx = ctx !== null && ctx !== void 0 ? ctx : __1.context.active(); + return { opts, ctx, fn }; +} +/** + * Executes fn, returns results and runs onException in the case of exception to allow overwriting of error handling + * @param span + * @param opts + * @param fn + */ +function handleFn(span, opts, fn) { + var _a; + const onException = (_a = opts.onException) !== null && _a !== void 0 ? _a : defaultOnException; + const errorHandler = (e) => { + onException(e, span); + span.end(); + throw e; + }; + try { + const ret = fn(span); + // if fn is an async function, attach a recordException and spanEnd callback to the promise + if (typeof (ret === null || ret === void 0 ? void 0 : ret.then) === 'function') { + return ret.then(val => { + span.end(); + return val; + }, errorHandler); + } + span.end(); + return ret; + } + catch (e) { + // add throw to signal the compiler that this will throw in the inner scope + throw errorHandler(e); + } +} +//# sourceMappingURL=SugaredTracer.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/build/src/version.js b/node_modules/@opentelemetry/api/build/src/version.js index 2c4fa1f54..c36077498 100644 --- a/node_modules/@opentelemetry/api/build/src/version.js +++ b/node_modules/@opentelemetry/api/build/src/version.js @@ -17,5 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.VERSION = void 0; // this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.7.0'; +exports.VERSION = '1.8.0'; //# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/node_modules/@opentelemetry/api/package.json b/node_modules/@opentelemetry/api/package.json index a438059d0..081d2e02e 100644 --- a/node_modules/@opentelemetry/api/package.json +++ b/node_modules/@opentelemetry/api/package.json @@ -1,6 +1,6 @@ { "name": "@opentelemetry/api", - "version": "1.7.0", + "version": "1.8.0", "description": "Public API for OpenTelemetry", "main": "build/src/index.js", "module": "build/esm/index.js", @@ -12,6 +12,20 @@ "./build/esnext/platform/index.js": "./build/esnext/platform/browser/index.js", "./build/src/platform/index.js": "./build/src/platform/browser/index.js" }, + "exports": { + ".": { + "module": "./build/esm/index.js", + "esnext": "./build/esnext/index.js", + "types": "./build/src/index.d.ts", + "default": "./build/src/index.js" + }, + "./experimental": { + "module": "./build/esm/experimental/index.js", + "esnext": "./build/esnext/experimental/index.js", + "types": "./build/src/experimental/index.d.ts", + "default": "./build/src/experimental/index.js" + } + }, "repository": "open-telemetry/opentelemetry-js", "scripts": { "clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json", @@ -66,10 +80,10 @@ "access": "public" }, "devDependencies": { - "@types/mocha": "10.0.3", + "@types/mocha": "10.0.6", "@types/node": "18.6.5", "@types/sinon": "10.0.20", - "@types/webpack": "4.41.35", + "@types/webpack": "5.28.5", "@types/webpack-env": "1.16.3", "babel-plugin-istanbul": "6.1.1", "codecov": "3.8.3", @@ -91,9 +105,9 @@ "ts-mocha": "10.0.0", "typescript": "4.4.4", "unionfs": "4.5.1", - "webpack": "4.46.0" + "webpack": "5.89.0" }, "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/api", "sideEffects": false, - "gitHead": "73b446688f10fd8dc4cf403a085f0a39070df7b4" + "gitHead": "7be35c7845e206b27b682e8ce1cee850b09cec04" } diff --git a/node_modules/@protobuf-ts/plugin-framework/package.json b/node_modules/@protobuf-ts/plugin-framework/package.json index e70f3093b..f17989a22 100644 --- a/node_modules/@protobuf-ts/plugin-framework/package.json +++ b/node_modules/@protobuf-ts/plugin-framework/package.json @@ -1,6 +1,6 @@ { "name": "@protobuf-ts/plugin-framework", - "version": "2.9.3", + "version": "2.9.4", "description": "framework to create protoc plugins", "license": "(Apache-2.0 AND BSD-3-Clause)", "author": "Timo Stamm ", @@ -33,8 +33,8 @@ "tslib": ">=1.6.1" }, "dependencies": { - "@protobuf-ts/runtime": "^2.9.3", + "@protobuf-ts/runtime": "^2.9.4", "typescript": "^3.9" }, - "gitHead": "bbda0c30ecc8e826c07a41105e93e05dbb9638b2" + "gitHead": "1798e0d43c31eafb4b5877ef72f05abb87456823" } diff --git a/node_modules/@protobuf-ts/plugin/package.json b/node_modules/@protobuf-ts/plugin/package.json index 4006031fd..75c0532cb 100644 --- a/node_modules/@protobuf-ts/plugin/package.json +++ b/node_modules/@protobuf-ts/plugin/package.json @@ -1,6 +1,6 @@ { "name": "@protobuf-ts/plugin", - "version": "2.9.3", + "version": "2.9.4", "description": "The protocol buffer compiler plugin \"protobuf-ts\" generates TypeScript, gRPC-web, Twirp, and more.", "bin": { "protoc-gen-ts": "./bin/protoc-gen-ts", @@ -38,11 +38,11 @@ "tslib": ">=1.6.1" }, "dependencies": { - "@protobuf-ts/plugin-framework": "^2.9.3", - "@protobuf-ts/protoc": "^2.9.3", - "@protobuf-ts/runtime": "^2.9.3", - "@protobuf-ts/runtime-rpc": "^2.9.3", + "@protobuf-ts/plugin-framework": "^2.9.4", + "@protobuf-ts/protoc": "^2.9.4", + "@protobuf-ts/runtime": "^2.9.4", + "@protobuf-ts/runtime-rpc": "^2.9.4", "typescript": "^3.9" }, - "gitHead": "bbda0c30ecc8e826c07a41105e93e05dbb9638b2" + "gitHead": "1798e0d43c31eafb4b5877ef72f05abb87456823" } diff --git a/node_modules/@protobuf-ts/protoc/package.json b/node_modules/@protobuf-ts/protoc/package.json index 2c2919ed3..1f658ac2c 100644 --- a/node_modules/@protobuf-ts/protoc/package.json +++ b/node_modules/@protobuf-ts/protoc/package.json @@ -1,6 +1,6 @@ { "name": "@protobuf-ts/protoc", - "version": "2.9.3", + "version": "2.9.4", "description": "Installs the protocol buffer compiler \"protoc\" for you.", "license": "Apache-2.0", "author": "Timo Stamm ", @@ -22,5 +22,5 @@ "publishConfig": { "access": "public" }, - "gitHead": "bbda0c30ecc8e826c07a41105e93e05dbb9638b2" + "gitHead": "1798e0d43c31eafb4b5877ef72f05abb87456823" } diff --git a/node_modules/@protobuf-ts/runtime-rpc/package.json b/node_modules/@protobuf-ts/runtime-rpc/package.json index 3c4517300..e408248c7 100644 --- a/node_modules/@protobuf-ts/runtime-rpc/package.json +++ b/node_modules/@protobuf-ts/runtime-rpc/package.json @@ -1,6 +1,6 @@ { "name": "@protobuf-ts/runtime-rpc", - "version": "2.9.3", + "version": "2.9.4", "description": "Runtime library for RPC clients generated by the protoc plugin \"protobuf-ts\"", "license": "Apache-2.0", "author": "Timo Stamm ", @@ -36,7 +36,7 @@ "typescript": ">=3.8.3 <4" }, "dependencies": { - "@protobuf-ts/runtime": "^2.9.3" + "@protobuf-ts/runtime": "^2.9.4" }, - "gitHead": "bbda0c30ecc8e826c07a41105e93e05dbb9638b2" + "gitHead": "1798e0d43c31eafb4b5877ef72f05abb87456823" } diff --git a/node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js b/node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js index f787a4211..93e4b4ee0 100644 --- a/node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js +++ b/node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js @@ -15,6 +15,7 @@ const json_format_contract_1 = require("./json-format-contract"); const reflection_equals_1 = require("./reflection-equals"); const binary_writer_1 = require("./binary-writer"); const binary_reader_1 = require("./binary-reader"); +const baseDescriptors = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})); /** * This standard message type provides reflection-based * operations to work with a message. @@ -25,7 +26,7 @@ class MessageType { this.typeName = name; this.fields = fields.map(reflection_info_1.normalizeFieldInfo); this.options = options !== null && options !== void 0 ? options : {}; - this.messagePrototype = Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: this }); + this.messagePrototype = Object.create(null, Object.assign(Object.assign({}, baseDescriptors), { [message_type_contract_1.MESSAGE_TYPE]: { value: this } })); this.refTypeCheck = new reflection_type_check_1.ReflectionTypeCheck(this); this.refJsonReader = new reflection_json_reader_1.ReflectionJsonReader(this); this.refJsonWriter = new reflection_json_writer_1.ReflectionJsonWriter(this); diff --git a/node_modules/@protobuf-ts/runtime/build/es2015/message-type.js b/node_modules/@protobuf-ts/runtime/build/es2015/message-type.js index 2f3059372..79d442ac0 100644 --- a/node_modules/@protobuf-ts/runtime/build/es2015/message-type.js +++ b/node_modules/@protobuf-ts/runtime/build/es2015/message-type.js @@ -12,6 +12,7 @@ import { jsonReadOptions, jsonWriteOptions, } from "./json-format-contract"; import { reflectionEquals } from "./reflection-equals"; import { binaryWriteOptions } from "./binary-writer"; import { binaryReadOptions } from "./binary-reader"; +const baseDescriptors = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})); /** * This standard message type provides reflection-based * operations to work with a message. @@ -22,7 +23,7 @@ export class MessageType { this.typeName = name; this.fields = fields.map(normalizeFieldInfo); this.options = options !== null && options !== void 0 ? options : {}; - this.messagePrototype = Object.defineProperty({}, MESSAGE_TYPE, { value: this }); + this.messagePrototype = Object.create(null, Object.assign(Object.assign({}, baseDescriptors), { [MESSAGE_TYPE]: { value: this } })); this.refTypeCheck = new ReflectionTypeCheck(this); this.refJsonReader = new ReflectionJsonReader(this); this.refJsonWriter = new ReflectionJsonWriter(this); diff --git a/node_modules/@protobuf-ts/runtime/package.json b/node_modules/@protobuf-ts/runtime/package.json index 57794f246..b4c00a92c 100644 --- a/node_modules/@protobuf-ts/runtime/package.json +++ b/node_modules/@protobuf-ts/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@protobuf-ts/runtime", - "version": "2.9.3", + "version": "2.9.4", "description": "Runtime library for code generated by the protoc plugin \"protobuf-ts\"", "license": "(Apache-2.0 AND BSD-3-Clause)", "author": "Timo Stamm ", @@ -37,5 +37,5 @@ "tslib": ">=1.6.1", "typescript": ">=3.8.3 <4" }, - "gitHead": "bbda0c30ecc8e826c07a41105e93e05dbb9638b2" + "gitHead": "1798e0d43c31eafb4b5877ef72f05abb87456823" } diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json index e029dd0cd..fe06840a3 100644 --- a/node_modules/@types/node/package.json +++ b/node_modules/@types/node/package.json @@ -1,6 +1,6 @@ { "name": "@types/node", - "version": "20.11.16", + "version": "20.12.3", "description": "TypeScript definitions for node", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", "license": "MIT", @@ -85,11 +85,6 @@ "githubUsername": "mohsen1", "url": "https://github.com/mohsen1" }, - { - "name": "Nicolas Even", - "githubUsername": "n-e", - "url": "https://github.com/n-e" - }, { "name": "Nikita Galkin", "githubUsername": "galkin", @@ -208,13 +203,6 @@ ], "main": "", "types": "index.d.ts", - "typesVersions": { - "<=4.8": { - "*": [ - "ts4.8/*" - ] - } - }, "repository": { "type": "git", "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", @@ -224,6 +212,6 @@ "dependencies": { "undici-types": "~5.26.4" }, - "typesPublisherContentHash": "c74616c0dddd05b588f3fe3d0da870cc1928ca91bb661c07bccd1d41c3058b05", - "typeScriptVersion": "4.6" + "typesPublisherContentHash": "02d120a0066fb0a44108576dbebd52092ec7972656913aa42b204107e43f732a", + "typeScriptVersion": "4.7" } \ No newline at end of file diff --git a/node_modules/agent-base/dist/index.js b/node_modules/agent-base/dist/index.js index 7bafc8c68..69396356e 100644 --- a/node_modules/agent-base/dist/index.js +++ b/node_modules/agent-base/dist/index.js @@ -27,7 +27,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Agent = void 0; +const net = __importStar(require("net")); const http = __importStar(require("http")); +const https_1 = require("https"); __exportStar(require("./helpers"), exports); const INTERNAL = Symbol('AgentBaseInternalState'); class Agent extends http.Agent { @@ -64,14 +66,72 @@ class Agent extends http.Agent { .some((l) => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1); } + // In order to support async signatures in `connect()` and Node's native + // connection pooling in `http.Agent`, the array of sockets for each origin + // has to be updated synchronously. This is so the length of the array is + // accurate when `addRequest()` is next called. We achieve this by creating a + // fake socket and adding it to `sockets[origin]` and incrementing + // `totalSocketCount`. + incrementSockets(name) { + // If `maxSockets` and `maxTotalSockets` are both Infinity then there is no + // need to create a fake socket because Node.js native connection pooling + // will never be invoked. + if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) { + return null; + } + // All instances of `sockets` are expected TypeScript errors. The + // alternative is to add it as a private property of this class but that + // will break TypeScript subclassing. + if (!this.sockets[name]) { + // @ts-expect-error `sockets` is readonly in `@types/node` + this.sockets[name] = []; + } + const fakeSocket = new net.Socket({ writable: false }); + this.sockets[name].push(fakeSocket); + // @ts-expect-error `totalSocketCount` isn't defined in `@types/node` + this.totalSocketCount++; + return fakeSocket; + } + decrementSockets(name, socket) { + if (!this.sockets[name] || socket === null) { + return; + } + const sockets = this.sockets[name]; + const index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + // @ts-expect-error `totalSocketCount` isn't defined in `@types/node` + this.totalSocketCount--; + if (sockets.length === 0) { + // @ts-expect-error `sockets` is readonly in `@types/node` + delete this.sockets[name]; + } + } + } + // In order to properly update the socket pool, we need to call `getName()` on + // the core `https.Agent` if it is a secureEndpoint. + getName(options) { + const secureEndpoint = typeof options.secureEndpoint === 'boolean' + ? options.secureEndpoint + : this.isSecureEndpoint(options); + if (secureEndpoint) { + // @ts-expect-error `getName()` isn't defined in `@types/node` + return https_1.Agent.prototype.getName.call(this, options); + } + // @ts-expect-error `getName()` isn't defined in `@types/node` + return super.getName(options); + } createSocket(req, options, cb) { const connectOpts = { ...options, secureEndpoint: this.isSecureEndpoint(options), }; + const name = this.getName(connectOpts); + const fakeSocket = this.incrementSockets(name); Promise.resolve() .then(() => this.connect(req, connectOpts)) .then((socket) => { + this.decrementSockets(name, fakeSocket); if (socket instanceof http.Agent) { // @ts-expect-error `addRequest()` isn't defined in `@types/node` return socket.addRequest(req, connectOpts); @@ -79,7 +139,10 @@ class Agent extends http.Agent { this[INTERNAL].currentSocket = socket; // @ts-expect-error `createSocket()` isn't defined in `@types/node` super.createSocket(req, options, cb); - }, cb); + }, (err) => { + this.decrementSockets(name, fakeSocket); + cb(err); + }); } createConnection() { const socket = this[INTERNAL].currentSocket; diff --git a/node_modules/agent-base/package.json b/node_modules/agent-base/package.json index 7178f4983..8e9517170 100644 --- a/node_modules/agent-base/package.json +++ b/node_modules/agent-base/package.json @@ -1,6 +1,6 @@ { "name": "agent-base", - "version": "7.1.0", + "version": "7.1.1", "description": "Turn a function into an `http.Agent` instance", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/node_modules/axe-core/LICENSE-3RD-PARTY.txt b/node_modules/axe-core/LICENSE-3RD-PARTY.txt new file mode 100644 index 000000000..368c293be --- /dev/null +++ b/node_modules/axe-core/LICENSE-3RD-PARTY.txt @@ -0,0 +1,66 @@ +----------------------------------------------------------------------------- + MIT License + Applies to: + - colorjs.io; Copyright (c) 2021 Lea Verou, Chris Lilley + - core-js-pure; Copyright (c) 2014-2023 Denis Pushkarev + - css-selector-parser; Copyright (c) 2013 Dulin Marat + - doT.js; Copyright (c) 2011 Laura Doktorova + Software includes portions from jQote2 Copyright (c) 2010 aefxx, + http://aefxx.com/ licensed under the MIT license. + - emoji-regex; Copyright (c) Mathias Bynens + - es6-iterator; Copyright (c) 2013-2017 Mariusz Nowak (www.medikoo.com) + - es6-promise; + Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors + - event-emitter; Copyright (C) 2012-2015 Mariusz Nowak (www.medikoo.com) + - is-promise; Copyright (c) 2014 Forbes Lindesay + - lru-queue; Copyright (C) 2014 Mariusz Nowak (www.medikoo.com) + - typedarray; + Copyright (c) 2010, Linden Research, Inc. + Copyright (c) 2012, Joshua Bell + - weakmap-polyfill; Copyright (c) 2015-2021 polygonplanet +----------------------------------------------------------------------------- + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +----------------------------------------------------------------------------- + ISC License + Applies to: + - d; Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com + - es5-ext; Copyright (c) 2011-2022, Mariusz Nowak, @medikoo, medikoo.com + - es6-symbol; Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com + - es6-weak-map; Copyright (c) 2013-2018, Mariusz Nowak, @medikoo, medikoo.com + - ext; Copyright (c) 2011-2022, Mariusz Nowak, @medikoo, medikoo.com + - memoizee; Copyright (c) 2012-2018, Mariusz Nowak, @medikoo, medikoo.com + - next-tick; Copyright (c) 2012-2020, Mariusz Nowak, @medikoo, medikoo.com + - timers-ext; Copyright (c) 2013-2018, Mariusz Nowak, @medikoo, medikoo.com + - type; Copyright (c) 2019, Mariusz Nowak, @medikoo, medikoo.com +----------------------------------------------------------------------------- + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/axe-core/axe.js b/node_modules/axe-core/axe.js index 8a14926a6..784d214d2 100644 --- a/node_modules/axe-core/axe.js +++ b/node_modules/axe-core/axe.js @@ -1,5 +1,5 @@ -/*! axe v4.8.3 - * Copyright (c) 2015 - 2023 Deque Systems, Inc. +/*! axe v4.9.0 + * Copyright (c) 2015 - 2024 Deque Systems, Inc. * * Your use of this Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -13,16 +13,16 @@ var global = window; var document = window.document; 'use strict'; - function _typeof(obj) { + function _typeof(o) { '@babel/helpers - typeof'; - return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(obj) { - return typeof obj; - } : function(obj) { - return obj && 'function' == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }, _typeof(obj); + return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(o) { + return typeof o; + } : function(o) { + return o && 'function' == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? 'symbol' : typeof o; + }, _typeof(o); } var axe = axe || {}; - axe.version = '4.8.3'; + axe.version = '4.9.0'; if (typeof define === 'function' && define.amd) { define('axe-core', [], function() { return axe; @@ -67,60 +67,68 @@ } return obj; } - function _construct(Parent, args, Class) { - if (_isNativeReflectConstruct()) { - _construct = Reflect.construct.bind(); + function _classPrivateMethodInitSpec(obj, privateSet) { + _checkPrivateRedeclaration(obj, privateSet); + privateSet.add(obj); + } + function _classPrivateFieldInitSpec(obj, privateMap, value) { + _checkPrivateRedeclaration(obj, privateMap); + privateMap.set(obj, value); + } + function _checkPrivateRedeclaration(obj, privateCollection) { + if (privateCollection.has(obj)) { + throw new TypeError('Cannot initialize the same private elements twice on an object'); + } + } + function _classPrivateMethodGet(receiver, privateSet, fn) { + _assertClassBrand(privateSet, receiver); + return fn; + } + function _classPrivateFieldSet(receiver, privateMap, value) { + var descriptor = _classPrivateFieldGet2(privateMap, receiver); + _classApplyDescriptorSet(receiver, descriptor, value); + return value; + } + function _classApplyDescriptorSet(receiver, descriptor, value) { + if (descriptor.set) { + descriptor.set.call(receiver, value); } else { - _construct = function _construct(Parent, args, Class) { - var a = [ null ]; - a.push.apply(a, args); - var Constructor = Function.bind.apply(Parent, a); - var instance = new Constructor(); - if (Class) { - _setPrototypeOf(instance, Class.prototype); - } - return instance; - }; + if (!descriptor.writable) { + throw new TypeError('attempted to set read only private field'); + } + descriptor.value = value; } - return _construct.apply(null, arguments); } - function _inherits(subClass, superClass) { - if (typeof superClass !== 'function' && superClass !== null) { - throw new TypeError('Super expression must either be null or a function'); + function _classPrivateFieldGet(receiver, privateMap) { + var descriptor = _classPrivateFieldGet2(privateMap, receiver); + return _classApplyDescriptorGet(receiver, descriptor); + } + function _classPrivateFieldGet2(s, a) { + return s.get(_assertClassBrand(s, a)); + } + function _assertClassBrand(e, t, n) { + if ('function' == typeof e ? e === t : e.has(t)) { + return arguments.length < 3 ? t : n; } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - Object.defineProperty(subClass, 'prototype', { - writable: false - }); - if (superClass) { - _setPrototypeOf(subClass, superClass); + throw new TypeError('Private element is not present on this object'); + } + function _classApplyDescriptorGet(receiver, descriptor) { + if (descriptor.get) { + return descriptor.get.call(receiver); } + return descriptor.value; } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; - return _setPrototypeOf(o, p); + function _construct(t, e, r) { + if (_isNativeReflectConstruct()) { + return Reflect.construct.apply(null, arguments); + } + var o = [ null ]; + o.push.apply(o, e); + var p = new (t.bind.apply(t, o))(); + return r && _setPrototypeOf(p, r.prototype), p; } - function _createSuper(Derived) { - var hasNativeReflectConstruct = _isNativeReflectConstruct(); - return function _createSuperInternal() { - var Super = _getPrototypeOf(Derived), result; - if (hasNativeReflectConstruct) { - var NewTarget = _getPrototypeOf(this).constructor; - result = Reflect.construct(Super, arguments, NewTarget); - } else { - result = Super.apply(this, arguments); - } - return _possibleConstructorReturn(this, result); - }; + function _callSuper(t, o, e) { + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === 'object' || typeof call === 'function')) { @@ -137,21 +145,12 @@ return self; } function _isNativeReflectConstruct() { - if (typeof Reflect === 'undefined' || !Reflect.construct) { - return false; - } - if (Reflect.construct.sham) { - return false; - } - if (typeof Proxy === 'function') { - return true; - } try { - Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); - return true; - } catch (e) { - return false; - } + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); + } catch (t) {} + return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { + return !!t; + })(); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { @@ -159,56 +158,31 @@ }; return _getPrototypeOf(o); } - function _classPrivateFieldInitSpec(obj, privateMap, value) { - _checkPrivateRedeclaration(obj, privateMap); - privateMap.set(obj, value); - } - function _classPrivateMethodInitSpec(obj, privateSet) { - _checkPrivateRedeclaration(obj, privateSet); - privateSet.add(obj); - } - function _checkPrivateRedeclaration(obj, privateCollection) { - if (privateCollection.has(obj)) { - throw new TypeError('Cannot initialize the same private elements twice on an object'); - } - } - function _classPrivateFieldGet(receiver, privateMap) { - var descriptor = _classExtractFieldDescriptor(receiver, privateMap, 'get'); - return _classApplyDescriptorGet(receiver, descriptor); - } - function _classApplyDescriptorGet(receiver, descriptor) { - if (descriptor.get) { - return descriptor.get.call(receiver); - } - return descriptor.value; - } - function _classPrivateMethodGet(receiver, privateSet, fn) { - if (!privateSet.has(receiver)) { - throw new TypeError('attempted to get private field on non-instance'); - } - return fn; - } - function _classPrivateFieldSet(receiver, privateMap, value) { - var descriptor = _classExtractFieldDescriptor(receiver, privateMap, 'set'); - _classApplyDescriptorSet(receiver, descriptor, value); - return value; - } - function _classExtractFieldDescriptor(receiver, privateMap, action) { - if (!privateMap.has(receiver)) { - throw new TypeError('attempted to ' + action + ' private field on non-instance'); + function _inherits(subClass, superClass) { + if (typeof superClass !== 'function' && superClass !== null) { + throw new TypeError('Super expression must either be null or a function'); } - return privateMap.get(receiver); - } - function _classApplyDescriptorSet(receiver, descriptor, value) { - if (descriptor.set) { - descriptor.set.call(receiver, value); - } else { - if (!descriptor.writable) { - throw new TypeError('attempted to set read only private field'); + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true } - descriptor.value = value; + }); + Object.defineProperty(subClass, 'prototype', { + writable: false + }); + if (superClass) { + _setPrototypeOf(subClass, superClass); } } + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + return _setPrototypeOf(o, p); + } function _objectWithoutProperties(source, excluded) { if (source == null) { return {}; @@ -282,34 +256,33 @@ function _nonIterableRest() { throw new TypeError('Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); } - function _iterableToArrayLimit(arr, i) { - var _i = null == arr ? null : 'undefined' != typeof Symbol && arr[Symbol.iterator] || arr['@@iterator']; - if (null != _i) { - var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; + function _iterableToArrayLimit(r, l) { + var t = null == r ? null : 'undefined' != typeof Symbol && r[Symbol.iterator] || r['@@iterator']; + if (null != t) { + var e, n, i, u, a = [], f = !0, o = !1; try { - if (_x = (_i = _i.call(arr)).next, 0 === i) { - if (Object(_i) !== _i) { + if (i = (t = t.call(r)).next, 0 === l) { + if (Object(t) !== t) { return; } - _n = !1; + f = !1; } else { - for (;!(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { - } + for (;!(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) {} } - } catch (err) { - _d = !0, _e = err; + } catch (r) { + o = !0, n = r; } finally { try { - if (!_n && null != _i['return'] && (_r = _i['return'](), Object(_r) !== _r)) { + if (!f && null != t['return'] && (u = t['return'](), Object(u) !== u)) { return; } } finally { - if (_d) { - throw _e; + if (o) { + throw n; } } } - return _arr; + return a; } } function _arrayWithHoles(arr) { @@ -345,23 +318,23 @@ }); return Constructor; } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, 'string'); - return _typeof(key) === 'symbol' ? key : String(key); + function _toPropertyKey(t) { + var i = _toPrimitive(t, 'string'); + return 'symbol' == _typeof(i) ? i : String(i); } - function _toPrimitive(input, hint) { - if (_typeof(input) !== 'object' || input === null) { - return input; - } - var prim = input[Symbol.toPrimitive]; - if (prim !== undefined) { - var res = prim.call(input, hint || 'default'); - if (_typeof(res) !== 'object') { - return res; + function _toPrimitive(t, r) { + if ('object' != _typeof(t) || !t) { + return t; + } + var e = t[Symbol.toPrimitive]; + if (void 0 !== e) { + var i = e.call(t, r || 'default'); + if ('object' != _typeof(i)) { + return i; } throw new TypeError('@@toPrimitive must return a primitive value.'); } - return (hint === 'string' ? String : Number)(input); + return ('string' === r ? String : Number)(t); } function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== 'undefined' && o[Symbol.iterator] || o['@@iterator']; @@ -385,8 +358,8 @@ value: o[i++] }; }, - e: function e(_e2) { - throw _e2; + e: function e(_e) { + throw _e; }, f: F }; @@ -403,9 +376,9 @@ normalCompletion = step.done; return step; }, - e: function e(_e3) { + e: function e(_e2) { didErr = true; - err = _e3; + err = _e2; }, f: function f() { try { @@ -447,16 +420,15 @@ } return arr2; } - function _typeof(obj) { + function _typeof(o) { '@babel/helpers - typeof'; - return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(obj) { - return typeof obj; - } : function(obj) { - return obj && 'function' == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj; - }, _typeof(obj); + return _typeof = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function(o) { + return typeof o; + } : function(o) { + return o && 'function' == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? 'symbol' : typeof o; + }, _typeof(o); } - (function() { - var _processFormat, _path, _getPath, _space; + (function(_globalThis$process, _r, _g, _b, _red, _green, _blue, _add) { var __create = Object.create; var __defProp = Object.defineProperty; var __getProtoOf = Object.getPrototypeOf; @@ -4172,7 +4144,7 @@ var min = Math.min; var pow = Math.pow; var round = Math.round; - function clamp3(v, minimum, max2) { + function clamp4(v, minimum, max2) { return v < minimum ? minimum : v > max2 ? max2 : v; } var getOwnPropNames = Object.getOwnPropertyNames || function(o) { @@ -4572,8 +4544,8 @@ if (end < 0) { end = this.length + end; } - start = clamp3(start, 0, this.length); - end = clamp3(end, 0, this.length); + start = clamp4(start, 0, this.length); + end = clamp4(end, 0, this.length); var len = end - start; if (len < 0) { len = 0; @@ -4785,14 +4757,16 @@ })(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : exports); }); var require_global = __commonJS(function(exports, module) { + 'use strict'; var check = function check(it) { - return it && it.Math == Math && it; + return it && it.Math === Math && it; }; module.exports = check((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) == 'object' && globalThis) || check((typeof window === 'undefined' ? 'undefined' : _typeof(window)) == 'object' && window) || check((typeof self === 'undefined' ? 'undefined' : _typeof(self)) == 'object' && self) || check((typeof global === 'undefined' ? 'undefined' : _typeof(global)) == 'object' && global) || function() { return this; - }() || Function('return this')(); + }() || exports || Function('return this')(); }); var require_fails = __commonJS(function(exports, module) { + 'use strict'; module.exports = function(exec) { try { return !!exec(); @@ -4802,6 +4776,7 @@ }; }); var require_function_bind_native = __commonJS(function(exports, module) { + 'use strict'; var fails = require_fails(); module.exports = !fails(function() { var test = function() {}.bind(); @@ -4809,6 +4784,7 @@ }); }); var require_function_apply = __commonJS(function(exports, module) { + 'use strict'; var NATIVE_BIND = require_function_bind_native(); var FunctionPrototype = Function.prototype; var apply = FunctionPrototype.apply; @@ -4818,6 +4794,7 @@ }); }); var require_function_uncurry_this = __commonJS(function(exports, module) { + 'use strict'; var NATIVE_BIND = require_function_bind_native(); var FunctionPrototype = Function.prototype; var call = FunctionPrototype.call; @@ -4829,6 +4806,7 @@ }; }); var require_classof_raw = __commonJS(function(exports, module) { + 'use strict'; var uncurryThis = require_function_uncurry_this(); var toString = uncurryThis({}.toString); var stringSlice = uncurryThis(''.slice); @@ -4837,6 +4815,7 @@ }; }); var require_function_uncurry_this_clause = __commonJS(function(exports, module) { + 'use strict'; var classofRaw = require_classof_raw(); var uncurryThis = require_function_uncurry_this(); module.exports = function(fn) { @@ -4846,6 +4825,7 @@ }; }); var require_document_all = __commonJS(function(exports, module) { + 'use strict'; var documentAll = (typeof document === 'undefined' ? 'undefined' : _typeof(document)) == 'object' && document.all; var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== void 0; module.exports = { @@ -4854,6 +4834,7 @@ }; }); var require_is_callable2 = __commonJS(function(exports, module) { + 'use strict'; var $documentAll = require_document_all(); var documentAll = $documentAll.all; module.exports = $documentAll.IS_HTMLDDA ? function(argument) { @@ -4863,16 +4844,18 @@ }; }); var require_descriptors = __commonJS(function(exports, module) { + 'use strict'; var fails = require_fails(); module.exports = !fails(function() { return Object.defineProperty({}, 1, { get: function get() { return 7; } - })[1] != 7; + })[1] !== 7; }); }); var require_function_call = __commonJS(function(exports, module) { + 'use strict'; var NATIVE_BIND = require_function_bind_native(); var call = Function.prototype.call; module.exports = NATIVE_BIND ? call.bind(call) : function() { @@ -4892,6 +4875,7 @@ } : $propertyIsEnumerable; }); var require_create_property_descriptor = __commonJS(function(exports, module) { + 'use strict'; module.exports = function(bitmap, value) { return { enumerable: !(bitmap & 1), @@ -4902,6 +4886,7 @@ }; }); var require_indexed_object = __commonJS(function(exports, module) { + 'use strict'; var uncurryThis = require_function_uncurry_this(); var fails = require_fails(); var classof = require_classof_raw(); @@ -4910,25 +4895,28 @@ module.exports = fails(function() { return !$Object('z').propertyIsEnumerable(0); }) ? function(it) { - return classof(it) == 'String' ? split(it, '') : $Object(it); + return classof(it) === 'String' ? split(it, '') : $Object(it); } : $Object; }); var require_is_null_or_undefined = __commonJS(function(exports, module) { + 'use strict'; module.exports = function(it) { return it === null || it === void 0; }; }); var require_require_object_coercible = __commonJS(function(exports, module) { + 'use strict'; var isNullOrUndefined = require_is_null_or_undefined(); var $TypeError = TypeError; module.exports = function(it) { if (isNullOrUndefined(it)) { - throw $TypeError('Can\'t call method on ' + it); + throw new $TypeError('Can\'t call method on ' + it); } return it; }; }); var require_to_indexed_object = __commonJS(function(exports, module) { + 'use strict'; var IndexedObject = require_indexed_object(); var requireObjectCoercible = require_require_object_coercible(); module.exports = function(it) { @@ -4936,6 +4924,7 @@ }; }); var require_is_object2 = __commonJS(function(exports, module) { + 'use strict'; var isCallable = require_is_callable2(); var $documentAll = require_document_all(); var documentAll = $documentAll.all; @@ -4946,9 +4935,11 @@ }; }); var require_path = __commonJS(function(exports, module) { + 'use strict'; module.exports = {}; }); var require_get_built_in = __commonJS(function(exports, module) { + 'use strict'; var path = require_path(); var global2 = require_global(); var isCallable = require_is_callable2(); @@ -4960,14 +4951,16 @@ }; }); var require_object_is_prototype_of = __commonJS(function(exports, module) { + 'use strict'; var uncurryThis = require_function_uncurry_this(); module.exports = uncurryThis({}.isPrototypeOf); }); var require_engine_user_agent = __commonJS(function(exports, module) { - var getBuiltIn = require_get_built_in(); - module.exports = getBuiltIn('navigator', 'userAgent') || ''; + 'use strict'; + module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; }); var require_engine_v8_version = __commonJS(function(exports, module) { + 'use strict'; var global2 = require_global(); var userAgent = require_engine_user_agent(); var process2 = global2.process; @@ -4992,18 +4985,23 @@ module.exports = version; }); var require_symbol_constructor_detection = __commonJS(function(exports, module) { + 'use strict'; var V8_VERSION = require_engine_v8_version(); var fails = require_fails(); + var global2 = require_global(); + var $String = global2.String; module.exports = !!Object.getOwnPropertySymbols && !fails(function() { - var symbol = Symbol(); - return !String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41; + var symbol = Symbol('symbol detection'); + return !$String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41; }); }); var require_use_symbol_as_uid = __commonJS(function(exports, module) { + 'use strict'; var NATIVE_SYMBOL = require_symbol_constructor_detection(); module.exports = NATIVE_SYMBOL && !Symbol.sham && _typeof(Symbol.iterator) == 'symbol'; }); var require_is_symbol2 = __commonJS(function(exports, module) { + 'use strict'; var getBuiltIn = require_get_built_in(); var isCallable = require_is_callable2(); var isPrototypeOf = require_object_is_prototype_of(); @@ -5017,6 +5015,7 @@ }; }); var require_try_to_string = __commonJS(function(exports, module) { + 'use strict'; var $String = String; module.exports = function(argument) { try { @@ -5027,6 +5026,7 @@ }; }); var require_a_callable = __commonJS(function(exports, module) { + 'use strict'; var isCallable = require_is_callable2(); var tryToString = require_try_to_string(); var $TypeError = TypeError; @@ -5034,10 +5034,11 @@ if (isCallable(argument)) { return argument; } - throw $TypeError(tryToString(argument) + ' is not a function'); + throw new $TypeError(tryToString(argument) + ' is not a function'); }; }); var require_get_method = __commonJS(function(exports, module) { + 'use strict'; var aCallable = require_a_callable(); var isNullOrUndefined = require_is_null_or_undefined(); module.exports = function(V, P) { @@ -5046,6 +5047,7 @@ }; }); var require_ordinary_to_primitive = __commonJS(function(exports, module) { + 'use strict'; var call = require_function_call(); var isCallable = require_is_callable2(); var isObject = require_is_object2(); @@ -5061,13 +5063,15 @@ if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) { return val; } - throw $TypeError('Can\'t convert object to primitive value'); + throw new $TypeError('Can\'t convert object to primitive value'); }; }); var require_is_pure = __commonJS(function(exports, module) { + 'use strict'; module.exports = true; }); var require_define_global_property = __commonJS(function(exports, module) { + 'use strict'; var global2 = require_global(); var defineProperty = Object.defineProperty; module.exports = function(key, value) { @@ -5084,6 +5088,7 @@ }; }); var require_shared_store = __commonJS(function(exports, module) { + 'use strict'; var global2 = require_global(); var defineGlobalProperty = require_define_global_property(); var SHARED = '__core-js_shared__'; @@ -5091,19 +5096,21 @@ module.exports = store; }); var require_shared = __commonJS(function(exports, module) { + 'use strict'; var IS_PURE = require_is_pure(); var store = require_shared_store(); (module.exports = function(key, value) { return store[key] || (store[key] = value !== void 0 ? value : {}); })('versions', []).push({ - version: '3.26.1', + version: '3.33.0', mode: IS_PURE ? 'pure' : 'global', - copyright: '\xa9 2014-2022 Denis Pushkarev (zloirock.ru)', - license: 'https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE', + copyright: '\xa9 2014-2023 Denis Pushkarev (zloirock.ru)', + license: 'https://github.com/zloirock/core-js/blob/v3.33.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); }); var require_to_object = __commonJS(function(exports, module) { + 'use strict'; var requireObjectCoercible = require_require_object_coercible(); var $Object = Object; module.exports = function(argument) { @@ -5111,6 +5118,7 @@ }; }); var require_has_own_property = __commonJS(function(exports, module) { + 'use strict'; var uncurryThis = require_function_uncurry_this(); var toObject = require_to_object(); var hasOwnProperty2 = uncurryThis({}.hasOwnProperty); @@ -5119,6 +5127,7 @@ }; }); var require_uid = __commonJS(function(exports, module) { + 'use strict'; var uncurryThis = require_function_uncurry_this(); var id = 0; var postfix = Math.random(); @@ -5128,31 +5137,25 @@ }; }); var require_well_known_symbol = __commonJS(function(exports, module) { + 'use strict'; var global2 = require_global(); var shared = require_shared(); var hasOwn2 = require_has_own_property(); var uid = require_uid(); var NATIVE_SYMBOL = require_symbol_constructor_detection(); var USE_SYMBOL_AS_UID = require_use_symbol_as_uid(); - var WellKnownSymbolsStore = shared('wks'); var Symbol2 = global2.Symbol; - var symbolFor = Symbol2 && Symbol2['for']; - var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid; + var WellKnownSymbolsStore = shared('wks'); + var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2['for'] || Symbol2 : Symbol2 && Symbol2.withoutSetter || uid; module.exports = function(name) { - if (!hasOwn2(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) { - var description = 'Symbol.' + name; - if (NATIVE_SYMBOL && hasOwn2(Symbol2, name)) { - WellKnownSymbolsStore[name] = Symbol2[name]; - } else if (USE_SYMBOL_AS_UID && symbolFor) { - WellKnownSymbolsStore[name] = symbolFor(description); - } else { - WellKnownSymbolsStore[name] = createWellKnownSymbol(description); - } + if (!hasOwn2(WellKnownSymbolsStore, name)) { + WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn2(Symbol2, name) ? Symbol2[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; }); var require_to_primitive = __commonJS(function(exports, module) { + 'use strict'; var call = require_function_call(); var isObject = require_is_object2(); var isSymbol = require_is_symbol2(); @@ -5175,7 +5178,7 @@ if (!isObject(result) || isSymbol(result)) { return result; } - throw $TypeError('Can\'t convert object to primitive value'); + throw new $TypeError('Can\'t convert object to primitive value'); } if (pref === void 0) { pref = 'number'; @@ -5184,6 +5187,7 @@ }; }); var require_to_property_key = __commonJS(function(exports, module) { + 'use strict'; var toPrimitive = require_to_primitive(); var isSymbol = require_is_symbol2(); module.exports = function(argument) { @@ -5192,6 +5196,7 @@ }; }); var require_document_create_element = __commonJS(function(exports, module) { + 'use strict'; var global2 = require_global(); var isObject = require_is_object2(); var document2 = global2.document; @@ -5201,6 +5206,7 @@ }; }); var require_ie8_dom_define = __commonJS(function(exports, module) { + 'use strict'; var DESCRIPTORS = require_descriptors(); var fails = require_fails(); var createElement = require_document_create_element(); @@ -5209,10 +5215,11 @@ get: function get() { return 7; } - }).a != 7; + }).a !== 7; }); }); var require_object_get_own_property_descriptor = __commonJS(function(exports) { + 'use strict'; var DESCRIPTORS = require_descriptors(); var call = require_function_call(); var propertyIsEnumerableModule = require_object_property_is_enumerable(); @@ -5236,12 +5243,13 @@ }; }); var require_is_forced = __commonJS(function(exports, module) { + 'use strict'; var fails = require_fails(); var isCallable = require_is_callable2(); var replacement = /#|\.prototype\./; var isForced = function isForced(feature, detection) { var value = data[normalize(feature)]; - return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; + return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function(string) { return String(string).replace(replacement, '.').toLowerCase(); @@ -5252,6 +5260,7 @@ module.exports = isForced; }); var require_function_bind_context = __commonJS(function(exports, module) { + 'use strict'; var uncurryThis = require_function_uncurry_this_clause(); var aCallable = require_a_callable(); var NATIVE_BIND = require_function_bind_native(); @@ -5264,16 +5273,18 @@ }; }); var require_v8_prototype_define_bug = __commonJS(function(exports, module) { + 'use strict'; var DESCRIPTORS = require_descriptors(); var fails = require_fails(); module.exports = DESCRIPTORS && fails(function() { return Object.defineProperty(function() {}, 'prototype', { value: 42, writable: false - }).prototype != 42; + }).prototype !== 42; }); }); var require_an_object = __commonJS(function(exports, module) { + 'use strict'; var isObject = require_is_object2(); var $String = String; var $TypeError = TypeError; @@ -5281,10 +5292,11 @@ if (isObject(argument)) { return argument; } - throw $TypeError($String(argument) + ' is not an object'); + throw new $TypeError($String(argument) + ' is not an object'); }; }); var require_object_define_property = __commonJS(function(exports) { + 'use strict'; var DESCRIPTORS = require_descriptors(); var IE8_DOM_DEFINE = require_ie8_dom_define(); var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug(); @@ -5322,7 +5334,7 @@ } catch (error) {} } if ('get' in Attributes || 'set' in Attributes) { - throw $TypeError('Accessors not supported'); + throw new $TypeError('Accessors not supported'); } if ('value' in Attributes) { O[P] = Attributes.value; @@ -5331,6 +5343,7 @@ }; }); var require_create_non_enumerable_property = __commonJS(function(exports, module) { + 'use strict'; var DESCRIPTORS = require_descriptors(); var definePropertyModule = require_object_define_property(); var createPropertyDescriptor = require_create_property_descriptor(); @@ -5418,7 +5431,7 @@ createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {}); } createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty); - if (options.real && targetPrototype && !targetPrototype[key]) { + if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) { createNonEnumerableProperty(targetPrototype, key, sourceProperty); } } @@ -5426,6 +5439,7 @@ }; }); var require_es_object_has_own = __commonJS(function() { + 'use strict'; var $ = require_export(); var hasOwn2 = require_has_own_property(); $({ @@ -5436,19 +5450,63 @@ }); }); var require_has_own = __commonJS(function(exports, module) { + 'use strict'; require_es_object_has_own(); var path = require_path(); module.exports = path.Object.hasOwn; }); var require_has_own2 = __commonJS(function(exports, module) { + 'use strict'; var parent = require_has_own(); module.exports = parent; }); var require_has_own3 = __commonJS(function(exports, module) { + 'use strict'; var parent = require_has_own2(); module.exports = parent; }); + var require_shared_key = __commonJS(function(exports, module) { + 'use strict'; + var shared = require_shared(); + var uid = require_uid(); + var keys = shared('keys'); + module.exports = function(key) { + return keys[key] || (keys[key] = uid(key)); + }; + }); + var require_correct_prototype_getter = __commonJS(function(exports, module) { + 'use strict'; + var fails = require_fails(); + module.exports = !fails(function() { + function F() {} + F.prototype.constructor = null; + return Object.getPrototypeOf(new F()) !== F.prototype; + }); + }); + var require_object_get_prototype_of = __commonJS(function(exports, module) { + 'use strict'; + var hasOwn2 = require_has_own_property(); + var isCallable = require_is_callable2(); + var toObject = require_to_object(); + var sharedKey = require_shared_key(); + var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter(); + var IE_PROTO = sharedKey('IE_PROTO'); + var $Object = Object; + var ObjectPrototype = $Object.prototype; + module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function(O) { + var object = toObject(O); + if (hasOwn2(object, IE_PROTO)) { + return object[IE_PROTO]; + } + var constructor = object.constructor; + if (isCallable(constructor) && object instanceof constructor) { + return constructor.prototype; + } + return object instanceof $Object ? ObjectPrototype : null; + }; + }); var require_math_trunc = __commonJS(function(exports, module) { + 'use strict'; var ceil = Math.ceil; var floor = Math.floor; module.exports = Math.trunc || function trunc(x) { @@ -5457,6 +5515,7 @@ }; }); var require_to_integer_or_infinity = __commonJS(function(exports, module) { + 'use strict'; var trunc = require_math_trunc(); module.exports = function(argument) { var number = +argument; @@ -5464,6 +5523,7 @@ }; }); var require_to_absolute_index = __commonJS(function(exports, module) { + 'use strict'; var toIntegerOrInfinity = require_to_integer_or_infinity(); var max2 = Math.max; var min = Math.min; @@ -5473,6 +5533,7 @@ }; }); var require_to_length = __commonJS(function(exports, module) { + 'use strict'; var toIntegerOrInfinity = require_to_integer_or_infinity(); var min = Math.min; module.exports = function(argument) { @@ -5480,12 +5541,14 @@ }; }); var require_length_of_array_like = __commonJS(function(exports, module) { + 'use strict'; var toLength = require_to_length(); module.exports = function(obj) { return toLength(obj.length); }; }); var require_array_includes = __commonJS(function(exports, module) { + 'use strict'; var toIndexedObject = require_to_indexed_object(); var toAbsoluteIndex = require_to_absolute_index(); var lengthOfArrayLike = require_length_of_array_like(); @@ -5495,10 +5558,10 @@ var length = lengthOfArrayLike(O); var index = toAbsoluteIndex(fromIndex, length); var value; - if (IS_INCLUDES && el != el) { + if (IS_INCLUDES && el !== el) { while (length > index) { value = O[index++]; - if (value != value) { + if (value !== value) { return true; } } @@ -5518,9 +5581,11 @@ }; }); var require_hidden_keys = __commonJS(function(exports, module) { + 'use strict'; module.exports = {}; }); var require_object_keys_internal = __commonJS(function(exports, module) { + 'use strict'; var uncurryThis = require_function_uncurry_this(); var hasOwn2 = require_has_own_property(); var toIndexedObject = require_to_indexed_object(); @@ -5544,9 +5609,11 @@ }; }); var require_enum_bug_keys = __commonJS(function(exports, module) { + 'use strict'; module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; }); var require_object_keys = __commonJS(function(exports, module) { + 'use strict'; var internalObjectKeys = require_object_keys_internal(); var enumBugKeys = require_enum_bug_keys(); module.exports = Object.keys || function keys(O) { @@ -5554,24 +5621,33 @@ }; }); var require_object_to_array = __commonJS(function(exports, module) { + 'use strict'; var DESCRIPTORS = require_descriptors(); + var fails = require_fails(); var uncurryThis = require_function_uncurry_this(); + var objectGetPrototypeOf = require_object_get_prototype_of(); var objectKeys = require_object_keys(); var toIndexedObject = require_to_indexed_object(); var $propertyIsEnumerable = require_object_property_is_enumerable().f; var propertyIsEnumerable = uncurryThis($propertyIsEnumerable); var push = uncurryThis([].push); + var IE_BUG = DESCRIPTORS && fails(function() { + var O = Object.create(null); + O[2] = 2; + return !propertyIsEnumerable(O, 2); + }); var createMethod = function createMethod(TO_ENTRIES) { return function(it) { var O = toIndexedObject(it); var keys = objectKeys(O); + var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null; var length = keys.length; var i = 0; var result = []; var key; while (length > i) { key = keys[i++]; - if (!DESCRIPTORS || propertyIsEnumerable(O, key)) { + if (!DESCRIPTORS || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) { push(result, TO_ENTRIES ? [ key, O[key] ] : O[key]); } } @@ -5584,6 +5660,7 @@ }; }); var require_es_object_values = __commonJS(function() { + 'use strict'; var $ = require_export(); var $values = require_object_to_array().values; $({ @@ -5596,15 +5673,18 @@ }); }); var require_values = __commonJS(function(exports, module) { + 'use strict'; require_es_object_values(); var path = require_path(); module.exports = path.Object.values; }); var require_values2 = __commonJS(function(exports, module) { + 'use strict'; var parent = require_values(); module.exports = parent; }); var require_values3 = __commonJS(function(exports, module) { + 'use strict'; var parent = require_values2(); module.exports = parent; }); @@ -6520,7 +6600,7 @@ return generateSelector2(item.elm, options, item.doc); }); } - var ignoredAttributes = [ 'class', 'style', 'id', 'selected', 'checked', 'disabled', 'tabindex', 'aria-checked', 'aria-selected', 'aria-invalid', 'aria-activedescendant', 'aria-busy', 'aria-disabled', 'aria-expanded', 'aria-grabbed', 'aria-pressed', 'aria-valuenow' ]; + var ignoredAttributes = [ 'class', 'style', 'id', 'selected', 'checked', 'disabled', 'tabindex', 'aria-checked', 'aria-selected', 'aria-invalid', 'aria-activedescendant', 'aria-busy', 'aria-disabled', 'aria-expanded', 'aria-grabbed', 'aria-pressed', 'aria-valuenow', 'xmlns' ]; var MAXATTRIBUTELENGTH = 31; var attrCharsRegex = /([\\"])/g; var newlineChars = /(\r\n|\r|\n)/g; @@ -7830,8 +7910,8 @@ return nodeResults === null || nodeResults === void 0 ? void 0 : nodeResults.map(function(_ref7) { var node = _ref7.node, nodeResult = _objectWithoutProperties(_ref7, _excluded); nodeResult.node = nodeSerializer.dqElmToSpec(node); - for (var _i2 = 0, _arr2 = [ 'any', 'all', 'none' ]; _i2 < _arr2.length; _i2++) { - var type2 = _arr2[_i2]; + for (var _i2 = 0, _arr = [ 'any', 'all', 'none' ]; _i2 < _arr.length; _i2++) { + var type2 = _arr[_i2]; nodeResult[type2] = nodeResult[type2].map(function(_ref8) { var relatedNodes = _ref8.relatedNodes, checkResult = _objectWithoutProperties(_ref8, _excluded2); checkResult.relatedNodes = relatedNodes.map(nodeSerializer.dqElmToSpec); @@ -8693,9 +8773,17 @@ uniqueRects = uniqueRects.reduce(function(rects, inputRect) { return rects.concat(splitRect(inputRect, overlapRect)); }, []); - }; + if (uniqueRects.length > 4e3) { + return { + v: [] + }; + } + }, _ret; for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) { - _loop3(); + _ret = _loop3(); + if (_ret) { + return _ret.v; + } } } catch (err) { _iterator3.e(err); @@ -9052,10 +9140,10 @@ } } function _findNearbyElms(vNode) { - var _vNode$_grid2, _vNode$_grid2$cells; + var _vNode$_grid2; var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; _createGrid(); - if (!((_vNode$_grid2 = vNode._grid) !== null && _vNode$_grid2 !== void 0 && (_vNode$_grid2$cells = _vNode$_grid2.cells) !== null && _vNode$_grid2$cells !== void 0 && _vNode$_grid2$cells.length)) { + if (!((_vNode$_grid2 = vNode._grid) !== null && _vNode$_grid2 !== void 0 && (_vNode$_grid2 = _vNode$_grid2.cells) !== null && _vNode$_grid2 !== void 0 && _vNode$_grid2.length)) { return []; } var rect = vNode.boundingClientRect; @@ -12463,7 +12551,7 @@ return /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC38]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/g; } var emoji_regex_default = function emoji_regex_default() { - return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; + return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; }; function hasUnicode(str, options) { var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations; @@ -12864,7 +12952,7 @@ } clientRects.push.apply(clientRects, _toConsumableArray(filterHiddenRects(contentRects, overflowHiddenNodes))); }); - return clientRects.length ? clientRects : [ nodeRect ]; + return clientRects.length ? clientRects : filterHiddenRects([ nodeRect ], overflowHiddenNodes); }); var get_visible_child_text_rects_default = getVisibleChildTextRects; function getContentRects(node) { @@ -13133,7 +13221,7 @@ var stacks = points.map(function(point) { return Array.from(document.elementsFromPoint(point.x, point.y)); }); - var _loop4 = function _loop4(_i10) { + var _loop4 = function _loop4() { var modalElement = stacks[_i10].find(function(elm) { var style = window.getComputedStyle(elm); return parseInt(style.width, 10) >= percentWidth && parseInt(style.height, 10) >= percentHeight && style.getPropertyValue('pointer-events') !== 'none' && (style.position === 'absolute' || style.position === 'fixed'); @@ -13146,11 +13234,11 @@ v: true }; } - }; + }, _ret2; for (var _i10 = 0; _i10 < stacks.length; _i10++) { - var _ret = _loop4(_i10); - if (_typeof(_ret) === 'object') { - return _ret.v; + _ret2 = _loop4(); + if (_ret2) { + return _ret2.v; } } cache_default.set('isModalOpen', void 0); @@ -13547,17 +13635,37 @@ var str = Object.prototype.toString.call(o); return (str.match(/^\[object\s+(.*?)\]$/)[1] || '').toLowerCase(); } + function serializeNumber(n2, _ref39) { + var precision = _ref39.precision, unit = _ref39.unit; + if (isNone(n2)) { + return 'none'; + } + return toPrecision(n2, precision) + (unit !== null && unit !== void 0 ? unit : ''); + } + function isNone(n2) { + return Number.isNaN(n2) || n2 instanceof Number && (n2 === null || n2 === void 0 ? void 0 : n2.none); + } + function skipNone(n2) { + return isNone(n2) ? 0 : n2; + } function toPrecision(n2, precision) { - n2 = +n2; - precision = +precision; - var integerLength = (Math.floor(n2) + '').length; - if (precision > integerLength) { - return +n2.toFixed(precision - integerLength); - } else { - var p10 = Math.pow(10, integerLength - precision); - return Math.round(n2 / p10) * p10; + if (n2 === 0) { + return 0; + } + var integer = ~~n2; + var digits = 0; + if (integer && precision) { + digits = ~~Math.log10(Math.abs(integer)) + 1; } + var multiplier = Math.pow(10, precision - digits); + return Math.floor(n2 * multiplier + .5) / multiplier; } + var angleFactor = { + deg: 1, + grad: .9, + rad: 180 / Math.PI, + turn: 360 + }; function parseFunction(str) { if (!str) { return; @@ -13565,25 +13673,39 @@ str = str.trim(); var isFunctionRegex = /^([a-z]+)\((.+?)\)$/i; var isNumberRegex = /^-?[\d.]+$/; + var unitValueRegex = /%|deg|g?rad|turn$/; + var singleArgument = /\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g; var parts = str.match(isFunctionRegex); if (parts) { var args = []; - parts[2].replace(/\/?\s*([-\w.]+(?:%|deg)?)/g, function($0, arg) { - if (/%$/.test(arg)) { - arg = new Number(arg.slice(0, -1) / 100); - arg.type = ''; - } else if (/deg$/.test(arg)) { - arg = new Number(+arg.slice(0, -3)); - arg.type = ''; - arg.unit = 'deg'; + parts[2].replace(singleArgument, function($0, rawArg) { + var match = rawArg.match(unitValueRegex); + var arg = rawArg; + if (match) { + var unit = match[0]; + var unitlessArg = arg.slice(0, -unit.length); + if (unit === '%') { + arg = new Number(unitlessArg / 100); + arg.type = ''; + } else { + arg = new Number(unitlessArg * angleFactor[unit]); + arg.type = ''; + arg.unit = unit; + } } else if (isNumberRegex.test(arg)) { arg = new Number(arg); arg.type = ''; + } else if (arg === 'none') { + arg = new Number(NaN); + arg.none = true; } if ($0.startsWith('/')) { arg = arg instanceof Number ? arg : new Number(arg); arg.alpha = true; } + if (_typeof(arg) === 'object' && arg instanceof Number) { + arg.raw = rawArg; + } args.push(arg); }); return { @@ -13626,18 +13748,51 @@ }); }); } - var util = Object.freeze({ - __proto__: null, - isString: isString, - type: type, - toPrecision: toPrecision, - parseFunction: parseFunction, - last: last, + function clamp(min, val, max2) { + return Math.max(Math.min(max2, val), min); + } + function copySign(to2, from) { + return Math.sign(to2) === Math.sign(from) ? to2 : -to2; + } + function spow(base, exp) { + return copySign(Math.pow(Math.abs(base), exp), base); + } + function zdiv(n2, d2) { + return d2 === 0 ? 0 : n2 / d2; + } + function bisectLeft(arr, value) { + var lo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var hi = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : arr.length; + while (lo < hi) { + var mid = lo + hi >> 1; + if (arr[mid] < value) { + lo = mid + 1; + } else { + hi = mid; + } + } + return lo; + } + var util = Object.freeze({ + __proto__: null, + bisectLeft: bisectLeft, + clamp: clamp, + copySign: copySign, interpolate: interpolate, interpolateInv: interpolateInv, + isNone: isNone, + isString: isString, + last: last, mapRange: mapRange, + multiplyMatrices: multiplyMatrices, parseCoordGrammar: parseCoordGrammar, - multiplyMatrices: multiplyMatrices + parseFunction: parseFunction, + serializeNumber: serializeNumber, + skipNone: skipNone, + spow: spow, + toPrecision: toPrecision, + type: type, + zdiv: zdiv }); var Hooks = function() { function Hooks() { @@ -13672,9 +13827,16 @@ }(); var hooks = new Hooks(); var defaults = { - gamut_mapping: 'lch.c', + gamut_mapping: 'css', precision: 5, - deltaE: '76' + deltaE: '76', + verbose: (globalThis === null || globalThis === void 0 || (_globalThis$process = globalThis.process) === null || _globalThis$process === void 0 || (_globalThis$process = _globalThis$process.env) === null || _globalThis$process === void 0 || (_globalThis$process = _globalThis$process.NODE_ENV) === null || _globalThis$process === void 0 ? void 0 : _globalThis$process.toLowerCase()) !== 'test', + warn: function warn(msg) { + if (this.verbose) { + var _globalThis$console, _globalThis$console$w; + globalThis === null || globalThis === void 0 || (_globalThis$console = globalThis.console) === null || _globalThis$console === void 0 || (_globalThis$console$w = _globalThis$console.warn) === null || _globalThis$console$w === void 0 || _globalThis$console$w.call(_globalThis$console, msg); + } + } }; var WHITES = { D50: [ .3457 / .3585, 1, (1 - .3457 - .3585) / .3585 ], @@ -13686,7 +13848,7 @@ } return WHITES[name]; } - function adapt$1(W1, W2, XYZ) { + function adapt$2(W1, W2, XYZ) { var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; W1 = getWhite(W1); W2 = getWhite(W2); @@ -13705,9 +13867,9 @@ hooks.run('chromatic-adaptation-start', env); if (!env.M) { if (env.W1 === WHITES.D65 && env.W2 === WHITES.D50) { - env.M = [ [ 1.0479298208405488, .022946793341019088, -.05019222954313557 ], [ .029627815688159344, .990434484573249, -.01707382502938514 ], [ -.009243058152591178, .015055144896577895, .7518742899580008 ] ]; + env.M = [ [ 1.0479297925449969, .022946870601609652, -.05019226628920524 ], [ .02962780877005599, .9904344267538799, -.017073799063418826 ], [ -.009243040646204504, .015055191490298152, .7518742814281371 ] ]; } else if (env.W1 === WHITES.D50 && env.W2 === WHITES.D65) { - env.M = [ [ .9554734527042182, -.023098536874261423, .0632593086610217 ], [ -.028369706963208136, 1.0099954580058226, .021041398966943008 ], [ .012314001688319899, -.020507696433477912, 1.3303659366080753 ] ]; + env.M = [ [ .955473421488075, -.02309845494876471, .06325924320057072 ], [ -.0283697093338637, 1.0099953980813041, .021041441191917323 ], [ .012314014864481998, -.020507649298898964, 1.330365926242124 ] ]; } } hooks.run('chromatic-adaptation-end', env); @@ -13717,18 +13879,200 @@ throw new TypeError('Only Bradford CAT with white points D50 and D65 supported for now.'); } } - var \u03b5$4 = 75e-6; - var _ColorSpace = (_processFormat = new WeakSet(), _path = new WeakMap(), _getPath = new WeakSet(), - function() { + var noneTypes = new Set([ '', '', '' ]); + function coerceCoords(space, format, name, coords) { + var types = Object.entries(space.coords).map(function(_ref40, i) { + var _ref41 = _slicedToArray(_ref40, 2), id = _ref41[0], coordMeta = _ref41[1]; + var coordGrammar2 = format.coordGrammar[i]; + var arg = coords[i]; + var providedType = arg === null || arg === void 0 ? void 0 : arg.type; + var type2; + if (arg.none) { + type2 = coordGrammar2.find(function(c4) { + return noneTypes.has(c4); + }); + } else { + type2 = coordGrammar2.find(function(c4) { + return c4 == providedType; + }); + } + if (!type2) { + var coordName = coordMeta.name || id; + throw new TypeError(''.concat(providedType !== null && providedType !== void 0 ? providedType : arg.raw, ' not allowed for ').concat(coordName, ' in ').concat(name, '()')); + } + var fromRange = type2.range; + if (providedType === '') { + fromRange || (fromRange = [ 0, 1 ]); + } + var toRange = coordMeta.range || coordMeta.refRange; + if (fromRange && toRange) { + coords[i] = mapRange(fromRange, toRange, coords[i]); + } + return type2; + }); + return types; + } + function parse2(str) { + var _String; + var _ref42 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, meta = _ref42.meta; + var env = { + str: (_String = String(str)) === null || _String === void 0 ? void 0 : _String.trim() + }; + hooks.run('parse-start', env); + if (env.color) { + return env.color; + } + env.parsed = parseFunction(env.str); + if (env.parsed) { + var name = env.parsed.name; + if (name === 'color') { + var id = env.parsed.args.shift(); + var alternateId = id.startsWith('--') ? id.substring(2) : '--'.concat(id); + var ids = [ id, alternateId ]; + var alpha = env.parsed.rawArgs.indexOf('/') > 0 ? env.parsed.args.pop() : 1; + var _iterator7 = _createForOfIteratorHelper(ColorSpace.all), _step7; + try { + for (_iterator7.s(); !(_step7 = _iterator7.n()).done; ) { + var space = _step7.value; + var colorSpec = space.getFormat('color'); + if (colorSpec) { + var _colorSpec$ids; + if (ids.includes(colorSpec.id) || (_colorSpec$ids = colorSpec.ids) !== null && _colorSpec$ids !== void 0 && _colorSpec$ids.filter(function(specId) { + return ids.includes(specId); + }).length) { + var coords = Object.keys(space.coords).map(function(_, i) { + return env.parsed.args[i] || 0; + }); + var types = void 0; + if (colorSpec.coordGrammar) { + types = coerceCoords(space, colorSpec, 'color', coords); + } + if (meta) { + Object.assign(meta, { + formatId: 'color', + types: types + }); + } + if (colorSpec.id.startsWith('--') && !id.startsWith('--')) { + defaults.warn(''.concat(space.name, ' is a non-standard space and not currently supported in the CSS spec. Use prefixed color(').concat(colorSpec.id, ') instead of color(').concat(id, ').')); + } + if (id.startsWith('--') && !colorSpec.id.startsWith('--')) { + defaults.warn(''.concat(space.name, ' is a standard space and supported in the CSS spec. Use color(').concat(colorSpec.id, ') instead of prefixed color(').concat(id, ').')); + } + return { + spaceId: space.id, + coords: coords, + alpha: alpha + }; + } + } + } + } catch (err) { + _iterator7.e(err); + } finally { + _iterator7.f(); + } + var didYouMean = ''; + var registryId = id in ColorSpace.registry ? id : alternateId; + if (registryId in ColorSpace.registry) { + var _ColorSpace$registry$; + var cssId = (_ColorSpace$registry$ = ColorSpace.registry[registryId].formats) === null || _ColorSpace$registry$ === void 0 || (_ColorSpace$registry$ = _ColorSpace$registry$.color) === null || _ColorSpace$registry$ === void 0 ? void 0 : _ColorSpace$registry$.id; + if (cssId) { + didYouMean = 'Did you mean color('.concat(cssId, ')?'); + } + } + throw new TypeError('Cannot parse color('.concat(id, '). ') + (didYouMean || 'Missing a plugin?')); + } else { + var _iterator8 = _createForOfIteratorHelper(ColorSpace.all), _step8; + try { + for (_iterator8.s(); !(_step8 = _iterator8.n()).done; ) { + var _space = _step8.value; + var format = _space.getFormat(name); + if (format && format.type === 'function') { + var _alpha = 1; + if (format.lastAlpha || last(env.parsed.args).alpha) { + _alpha = env.parsed.args.pop(); + } + var _coords = env.parsed.args; + var _types = void 0; + if (format.coordGrammar) { + _types = coerceCoords(_space, format, name, _coords); + } + if (meta) { + Object.assign(meta, { + formatId: format.name, + types: _types + }); + } + return { + spaceId: _space.id, + coords: _coords, + alpha: _alpha + }; + } + } + } catch (err) { + _iterator8.e(err); + } finally { + _iterator8.f(); + } + } + } else { + var _iterator9 = _createForOfIteratorHelper(ColorSpace.all), _step9; + try { + for (_iterator9.s(); !(_step9 = _iterator9.n()).done; ) { + var _space2 = _step9.value; + for (var formatId in _space2.formats) { + var _format = _space2.formats[formatId]; + if (_format.type !== 'custom') { + continue; + } + if (_format.test && !_format.test(env.str)) { + continue; + } + var color = _format.parse(env.str); + if (color) { + var _color$alpha; + (_color$alpha = color.alpha) !== null && _color$alpha !== void 0 ? _color$alpha : color.alpha = 1; + if (meta) { + meta.formatId = formatId; + } + return color; + } + } + } + } catch (err) { + _iterator9.e(err); + } finally { + _iterator9.f(); + } + } + throw new TypeError('Could not parse '.concat(str, ' as a color. Missing a plugin?')); + } + function getColor(color) { + if (Array.isArray(color)) { + return color.map(getColor); + } + if (!color) { + throw new TypeError('Empty color reference'); + } + if (isString(color)) { + color = parse2(color); + } + var space = color.space || color.spaceId; + if (!(space instanceof ColorSpace)) { + color.space = ColorSpace.get(space); + } + if (color.alpha === void 0) { + color.alpha = 1; + } + return color; + } + var \u03b5$7 = 75e-6; + var _ColorSpace = function() { function _ColorSpace(options) { - var _options$coords, _ref39, _options$white, _options$formats, _this$formats$functio, _this$formats, _this$formats2; + var _options$coords, _ref43, _options$white, _options$formats, _this$formats$color; _classCallCheck(this, _ColorSpace); - _classPrivateMethodInitSpec(this, _getPath); - _classPrivateMethodInitSpec(this, _processFormat); - _classPrivateFieldInitSpec(this, _path, { - writable: true, - value: void 0 - }); this.id = options.id; this.name = options.name; this.base = options.base ? _ColorSpace.get(options.base) : null; @@ -13737,37 +14081,57 @@ this.fromBase = options.fromBase; this.toBase = options.toBase; } - var _coords = (_options$coords = options.coords) !== null && _options$coords !== void 0 ? _options$coords : this.base.coords; - this.coords = _coords; - var white2 = (_ref39 = (_options$white = options.white) !== null && _options$white !== void 0 ? _options$white : this.base.white) !== null && _ref39 !== void 0 ? _ref39 : 'D65'; + var coords = (_options$coords = options.coords) !== null && _options$coords !== void 0 ? _options$coords : this.base.coords; + for (var name in coords) { + if (!('name' in coords[name])) { + coords[name].name = name; + } + } + this.coords = coords; + var white2 = (_ref43 = (_options$white = options.white) !== null && _options$white !== void 0 ? _options$white : this.base.white) !== null && _ref43 !== void 0 ? _ref43 : 'D65'; this.white = getWhite(white2); this.formats = (_options$formats = options.formats) !== null && _options$formats !== void 0 ? _options$formats : {}; - for (var name in this.formats) { - var format = this.formats[name]; + for (var _name in this.formats) { + var format = this.formats[_name]; format.type || (format.type = 'function'); - format.name || (format.name = name); + format.name || (format.name = _name); } - if (options.cssId && !((_this$formats$functio = this.formats.functions) !== null && _this$formats$functio !== void 0 && _this$formats$functio.color)) { - this.formats.color = { - id: options.cssId - }; - Object.defineProperty(this, 'cssId', { - value: options.cssId + if (!((_this$formats$color = this.formats.color) !== null && _this$formats$color !== void 0 && _this$formats$color.id)) { + var _this$formats$color2; + this.formats.color = _extends({}, (_this$formats$color2 = this.formats.color) !== null && _this$formats$color2 !== void 0 ? _this$formats$color2 : {}, { + id: options.cssId || this.id }); - } else if ((_this$formats = this.formats) !== null && _this$formats !== void 0 && _this$formats.color && !((_this$formats2 = this.formats) !== null && _this$formats2 !== void 0 && _this$formats2.color.id)) { - this.formats.color.id = this.id; + } + if (options.gamutSpace) { + this.gamutSpace = options.gamutSpace === 'self' ? this : _ColorSpace.get(options.gamutSpace); + } else { + if (this.isPolar) { + this.gamutSpace = this.base; + } else { + this.gamutSpace = this; + } + } + if (this.gamutSpace.isUnbounded) { + this.inGamut = function(coords2, options2) { + return true; + }; } this.referred = options.referred; - _classPrivateFieldSet(this, _path, _classPrivateMethodGet(this, _getPath, _getPath2).call(this).reverse()); + Object.defineProperty(this, 'path', { + value: getPath(this).reverse(), + writable: false, + enumerable: true, + configurable: true + }); hooks.run('colorspace-init-end', this); } _createClass(_ColorSpace, [ { key: 'inGamut', value: function inGamut(coords) { - var _ref40 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref40$epsilon = _ref40.epsilon, epsilon = _ref40$epsilon === void 0 ? \u03b5$4 : _ref40$epsilon; - if (this.isPolar) { - coords = this.toBase(coords); - return this.base.inGamut(coords, { + var _ref44 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref44$epsilon = _ref44.epsilon, epsilon = _ref44$epsilon === void 0 ? \u03b5$7 : _ref44$epsilon; + if (!this.equals(this.gamutSpace)) { + coords = this.to(this.gamutSpace, coords); + return this.gamutSpace.inGamut(coords, { epsilon: epsilon }); } @@ -13784,11 +14148,18 @@ return true; }); } + }, { + key: 'isUnbounded', + get: function get() { + return Object.values(this.coords).every(function(coord) { + return !('range' in coord); + }); + } }, { key: 'cssId', get: function get() { - var _this$formats$functio2, _this$formats$functio3; - return ((_this$formats$functio2 = this.formats.functions) === null || _this$formats$functio2 === void 0 ? void 0 : (_this$formats$functio3 = _this$formats$functio2.color) === null || _this$formats$functio3 === void 0 ? void 0 : _this$formats$functio3.id) || this.id; + var _this$formats; + return ((_this$formats = this.formats) === null || _this$formats === void 0 || (_this$formats = _this$formats.color) === null || _this$formats === void 0 ? void 0 : _this$formats.id) || this.id; } }, { key: 'isPolar', @@ -13804,7 +14175,7 @@ key: 'getFormat', value: function getFormat(format) { if (_typeof(format) === 'object') { - format = _classPrivateMethodGet(this, _processFormat, _processFormat2).call(this, format); + format = processFormat(format, this); return format; } var ret; @@ -13814,31 +14185,40 @@ ret = this.formats[format]; } if (ret) { - ret = _classPrivateMethodGet(this, _processFormat, _processFormat2).call(this, ret); + ret = processFormat(ret, this); return ret; } return null; } + }, { + key: 'equals', + value: function equals(space) { + if (!space) { + return false; + } + return this === space || this.id === space || this.id === space.id; + } }, { key: 'to', value: function to(space, coords) { if (arguments.length === 1) { - var _ref41 = [ space.space, space.coords ]; - space = _ref41[0]; - coords = _ref41[1]; + var color = getColor(space); + var _ref45 = [ color.space, color.coords ]; + space = _ref45[0]; + coords = _ref45[1]; } space = _ColorSpace.get(space); - if (this === space) { + if (this.equals(space)) { return coords; } coords = coords.map(function(c4) { return Number.isNaN(c4) ? 0 : c4; }); - var myPath = _classPrivateFieldGet(this, _path); - var otherPath = _classPrivateFieldGet(space, _path); + var myPath = this.path; + var otherPath = space.path; var connectionSpace, connectionSpaceIndex; for (var _i12 = 0; _i12 < myPath.length; _i12++) { - if (myPath[_i12] === otherPath[_i12]) { + if (myPath[_i12].equals(otherPath[_i12])) { connectionSpace = myPath[_i12]; connectionSpaceIndex = _i12; } else { @@ -13860,9 +14240,10 @@ key: 'from', value: function from(space, coords) { if (arguments.length === 1) { - var _ref42 = [ space.space, space.coords ]; - space = _ref42[0]; - coords = _ref42[1]; + var color = getColor(space); + var _ref46 = [ color.space, color.coords ]; + space = _ref46[0]; + coords = _ref46[1]; } space = _ColorSpace.get(space); return space.to(this, coords); @@ -13902,16 +14283,16 @@ } this.registry[id] = space; if (arguments.length === 1 && space.aliases) { - var _iterator7 = _createForOfIteratorHelper(space.aliases), _step7; + var _iterator10 = _createForOfIteratorHelper(space.aliases), _step10; try { - for (_iterator7.s(); !(_step7 = _iterator7.n()).done; ) { - var alias = _step7.value; + for (_iterator10.s(); !(_step10 = _iterator10.n()).done; ) { + var alias = _step10.value; this.register(alias, space); } } catch (err) { - _iterator7.e(err); + _iterator10.e(err); } finally { - _iterator7.f(); + _iterator10.f(); } } return space; @@ -13954,9 +14335,9 @@ coord = ref; } } else if (Array.isArray(ref)) { - var _ref43 = _slicedToArray(ref, 2); - space = _ref43[0]; - coord = _ref43[1]; + var _ref47 = _slicedToArray(ref, 2); + space = _ref47[0]; + coord = _ref47[1]; } else { space = ref.space; coord = ref.coordId; @@ -13998,14 +14379,28 @@ } } ]); return _ColorSpace; - }()); - function _processFormat2(format) { + }(); + var ColorSpace = _ColorSpace; + __publicField(ColorSpace, 'registry', {}); + __publicField(ColorSpace, 'DEFAULT_FORMAT', { + type: 'functions', + name: 'color' + }); + function getPath(space) { + var ret = [ space ]; + for (var s = space; s = s.base; ) { + ret.push(s); + } + return ret; + } + function processFormat(format) { + var _ref48 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, coords = _ref48.coords; if (format.coords && !format.coordGrammar) { format.type || (format.type = 'function'); format.name || (format.name = 'color'); format.coordGrammar = parseCoordGrammar(format.coords); - var coordFormats = Object.entries(this.coords).map(function(_ref151, i) { - var _ref152 = _slicedToArray(_ref151, 2), id = _ref152[0], coordMeta = _ref152[1]; + var coordFormats = Object.entries(coords).map(function(_ref49, i) { + var _ref50 = _slicedToArray(_ref49, 2), id = _ref50[0], coordMeta = _ref50[1]; var outputType = format.coordGrammar[i][0]; var fromRange = coordMeta.range || coordMeta.refRange; var toRange = outputType.range, suffix = ''; @@ -14021,36 +14416,23 @@ suffix: suffix }; }); - format.serializeCoords = function(coords, precision) { - return coords.map(function(c4, i) { + format.serializeCoords = function(coords2, precision) { + return coords2.map(function(c4, i) { var _coordFormats$i = coordFormats[i], fromRange = _coordFormats$i.fromRange, toRange = _coordFormats$i.toRange, suffix = _coordFormats$i.suffix; if (fromRange && toRange) { c4 = mapRange(fromRange, toRange, c4); } - c4 = toPrecision(c4, precision); - if (suffix) { - c4 += suffix; - } + c4 = serializeNumber(c4, { + precision: precision, + unit: suffix + }); return c4; }); }; } return format; } - function _getPath2() { - var ret = [ this ]; - for (var _space2 = this; _space2 = _space2.base; ) { - ret.push(_space2); - } - return ret; - } - var ColorSpace = _ColorSpace; - __publicField(ColorSpace, 'registry', {}); - __publicField(ColorSpace, 'DEFAULT_FORMAT', { - type: 'functions', - name: 'color' - }); - var XYZ_D65 = new ColorSpace({ + var xyz_d65 = new ColorSpace({ id: 'xyz-d65', name: 'XYZ D65', coords: { @@ -14074,7 +14456,6 @@ }); var RGBColorSpace = function(_ColorSpace2) { _inherits(RGBColorSpace, _ColorSpace2); - var _super = _createSuper(RGBColorSpace); function RGBColorSpace(options) { var _options$referred; var _this; @@ -14096,208 +14477,48 @@ }; } if (!options.base) { - options.base = XYZ_D65; + options.base = xyz_d65; } if (options.toXYZ_M && options.fromXYZ_M) { var _options$toBase, _options$fromBase; (_options$toBase = options.toBase) !== null && _options$toBase !== void 0 ? _options$toBase : options.toBase = function(rgb) { var xyz = multiplyMatrices(options.toXYZ_M, rgb); if (_this.white !== _this.base.white) { - xyz = adapt$1(_this.white, _this.base.white, xyz); + xyz = adapt$2(_this.white, _this.base.white, xyz); } return xyz; }; (_options$fromBase = options.fromBase) !== null && _options$fromBase !== void 0 ? _options$fromBase : options.fromBase = function(xyz) { - xyz = adapt$1(_this.base.white, _this.white, xyz); + xyz = adapt$2(_this.base.white, _this.white, xyz); return multiplyMatrices(options.fromXYZ_M, xyz); }; } (_options$referred = options.referred) !== null && _options$referred !== void 0 ? _options$referred : options.referred = 'display'; - return _this = _super.call(this, options); + return _this = _callSuper(this, RGBColorSpace, [ options ]); } return _createClass(RGBColorSpace); }(ColorSpace); - function parse2(str) { - var _String; - var env = { - str: (_String = String(str)) === null || _String === void 0 ? void 0 : _String.trim() - }; - hooks.run('parse-start', env); - if (env.color) { - return env.color; - } - env.parsed = parseFunction(env.str); - if (env.parsed) { - var _ret2 = function() { - var name = env.parsed.name; - if (name === 'color') { - var id = env.parsed.args.shift(); - var alpha = env.parsed.rawArgs.indexOf('/') > 0 ? env.parsed.args.pop() : 1; - var _iterator8 = _createForOfIteratorHelper(ColorSpace.all), _step8; - try { - for (_iterator8.s(); !(_step8 = _iterator8.n()).done; ) { - var space = _step8.value; - var colorSpec = space.getFormat('color'); - if (colorSpec) { - var _colorSpec$ids; - if (id === colorSpec.id || (_colorSpec$ids = colorSpec.ids) !== null && _colorSpec$ids !== void 0 && _colorSpec$ids.includes(id)) { - var _ret3 = function() { - var argCount = Object.keys(space.coords).length; - var coords = Array(argCount).fill(0); - coords.forEach(function(_, i) { - return coords[i] = env.parsed.args[i] || 0; - }); - return { - v: { - v: { - spaceId: space.id, - coords: coords, - alpha: alpha - } - } - }; - }(); - if (_typeof(_ret3) === 'object') { - return _ret3.v; - } - } - } - } - } catch (err) { - _iterator8.e(err); - } finally { - _iterator8.f(); - } - var didYouMean = ''; - if (id in ColorSpace.registry) { - var _ColorSpace$registry$, _ColorSpace$registry$2, _ColorSpace$registry$3; - var cssId = (_ColorSpace$registry$ = ColorSpace.registry[id].formats) === null || _ColorSpace$registry$ === void 0 ? void 0 : (_ColorSpace$registry$2 = _ColorSpace$registry$.functions) === null || _ColorSpace$registry$2 === void 0 ? void 0 : (_ColorSpace$registry$3 = _ColorSpace$registry$2.color) === null || _ColorSpace$registry$3 === void 0 ? void 0 : _ColorSpace$registry$3.id; - if (cssId) { - didYouMean = 'Did you mean color('.concat(cssId, ')?'); - } - } - throw new TypeError('Cannot parse color('.concat(id, '). ') + (didYouMean || 'Missing a plugin?')); - } else { - var _iterator9 = _createForOfIteratorHelper(ColorSpace.all), _step9; - try { - var _loop5 = function _loop5() { - var space = _step9.value; - var format = space.getFormat(name); - if (format && format.type === 'function') { - var _alpha = 1; - if (format.lastAlpha || last(env.parsed.args).alpha) { - _alpha = env.parsed.args.pop(); - } - var coords = env.parsed.args; - if (format.coordGrammar) { - Object.entries(space.coords).forEach(function(_ref44, i) { - var _coords$i; - var _ref45 = _slicedToArray(_ref44, 2), id = _ref45[0], coordMeta = _ref45[1]; - var coordGrammar2 = format.coordGrammar[i]; - var providedType = (_coords$i = coords[i]) === null || _coords$i === void 0 ? void 0 : _coords$i.type; - coordGrammar2 = coordGrammar2.find(function(c4) { - return c4 == providedType; - }); - if (!coordGrammar2) { - var coordName = coordMeta.name || id; - throw new TypeError(''.concat(providedType, ' not allowed for ').concat(coordName, ' in ').concat(name, '()')); - } - var fromRange = coordGrammar2.range; - if (providedType === '') { - fromRange || (fromRange = [ 0, 1 ]); - } - var toRange = coordMeta.range || coordMeta.refRange; - if (fromRange && toRange) { - coords[i] = mapRange(fromRange, toRange, coords[i]); - } - }); - } - return { - v: { - v: { - spaceId: space.id, - coords: coords, - alpha: _alpha - } - } - }; - } - }; - for (_iterator9.s(); !(_step9 = _iterator9.n()).done; ) { - var _ret4 = _loop5(); - if (_typeof(_ret4) === 'object') { - return _ret4.v; - } - } - } catch (err) { - _iterator9.e(err); - } finally { - _iterator9.f(); - } - } - }(); - if (_typeof(_ret2) === 'object') { - return _ret2.v; - } - } else { - var _iterator10 = _createForOfIteratorHelper(ColorSpace.all), _step10; - try { - for (_iterator10.s(); !(_step10 = _iterator10.n()).done; ) { - var space = _step10.value; - for (var formatId in space.formats) { - var format = space.formats[formatId]; - if (format.type !== 'custom') { - continue; - } - if (format.test && !format.test(env.str)) { - continue; - } - var color = format.parse(env.str); - if (color) { - var _color$alpha; - (_color$alpha = color.alpha) !== null && _color$alpha !== void 0 ? _color$alpha : color.alpha = 1; - return color; - } - } - } - } catch (err) { - _iterator10.e(err); - } finally { - _iterator10.f(); - } - } - throw new TypeError('Could not parse '.concat(str, ' as a color. Missing a plugin?')); - } - function getColor(color) { - if (!color) { - throw new TypeError('Empty color reference'); - } - if (isString(color)) { - color = parse2(color); - } - var space = color.space || color.spaceId; - if (!(space instanceof ColorSpace)) { - color.space = ColorSpace.get(space); - } - if (color.alpha === void 0) { - color.alpha = 1; - } - return color; - } function getAll(color, space) { + color = getColor(color); + if (!space || color.space.equals(space)) { + return color.coords.slice(); + } space = ColorSpace.get(space); return space.from(color); } function get(color, prop) { + color = getColor(color); var _ColorSpace$resolveCo = ColorSpace.resolveCoord(prop, color.space), space = _ColorSpace$resolveCo.space, index = _ColorSpace$resolveCo.index; var coords = getAll(color, space); return coords[index]; } function setAll(color, space, coords) { + color = getColor(color); space = ColorSpace.get(space); color.coords = space.to(color.space, coords); return color; } + setAll.returns = 'color'; function set(color, prop, value) { color = getColor(color); if (arguments.length === 2 && type(arguments[1]) === 'object') { @@ -14316,32 +14537,30 @@ } return color; } + set.returns = 'color'; var XYZ_D50 = new ColorSpace({ id: 'xyz-d50', name: 'XYZ D50', white: 'D50', - base: XYZ_D65, + base: xyz_d65, fromBase: function fromBase(coords) { - return adapt$1(XYZ_D65.white, 'D50', coords); + return adapt$2(xyz_d65.white, 'D50', coords); }, toBase: function toBase(coords) { - return adapt$1('D50', XYZ_D65.white, coords); - }, - formats: { - color: {} + return adapt$2('D50', xyz_d65.white, coords); } }); - var \u03b5$3 = 216 / 24389; + var \u03b5$6 = 216 / 24389; var \u03b53$1 = 24 / 116; - var \u03ba$1 = 24389 / 27; - var white$1 = WHITES.D50; + var \u03ba$4 = 24389 / 27; + var white$4 = WHITES.D50; var lab = new ColorSpace({ id: 'lab', name: 'Lab', coords: { l: { refRange: [ 0, 100 ], - name: 'L' + name: 'Lightness' }, a: { refRange: [ -125, 125 ] @@ -14350,14 +14569,14 @@ refRange: [ -125, 125 ] } }, - white: white$1, + white: white$4, base: XYZ_D50, fromBase: function fromBase(XYZ) { var xyz = XYZ.map(function(value, i) { - return value / white$1[i]; + return value / white$4[i]; }); var f = xyz.map(function(value) { - return value > \u03b5$3 ? Math.cbrt(value) : (\u03ba$1 * value + 16) / 116; + return value > \u03b5$6 ? Math.cbrt(value) : (\u03ba$4 * value + 16) / 116; }); return [ 116 * f[1] - 16, 500 * (f[0] - f[1]), 200 * (f[1] - f[2]) ]; }, @@ -14366,14 +14585,14 @@ f[1] = (Lab[0] + 16) / 116; f[0] = Lab[1] / 500 + f[1]; f[2] = f[1] - Lab[2] / 200; - var xyz = [ f[0] > \u03b53$1 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03ba$1, Lab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03ba$1, f[2] > \u03b53$1 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03ba$1 ]; + var xyz = [ f[0] > \u03b53$1 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03ba$4, Lab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03ba$4, f[2] > \u03b53$1 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03ba$4 ]; return xyz.map(function(value, i) { - return value * white$1[i]; + return value * white$4[i]; }); }, formats: { lab: { - coords: [ ' | ', '', '' ] + coords: [ ' | ', ' | [-1,1]', ' | [-1,1]' ] } } }); @@ -14397,9 +14616,9 @@ } else if (arc === 'longer') { if (-180 < angleDiff && angleDiff < 180) { if (angleDiff > 0) { - a2 += 360; - } else { a1 += 360; + } else { + a2 += 360; } } } else if (arc === 'shorter') { @@ -14453,7 +14672,7 @@ }, formats: { lch: { - coords: [ ' | ', '', ' | ' ] + coords: [ ' | ', ' | ', ' | ' ] } } }); @@ -14461,8 +14680,17 @@ var \u03c0$1 = Math.PI; var r2d = 180 / \u03c0$1; var d2r$1 = \u03c0$1 / 180; + function pow7(x) { + var x2 = x * x; + var x7 = x2 * x2 * x2 * x; + return x7; + } function deltaE2000(color, sample) { - var _ref46 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref46$kL = _ref46.kL, kL = _ref46$kL === void 0 ? 1 : _ref46$kL, _ref46$kC = _ref46.kC, kC = _ref46$kC === void 0 ? 1 : _ref46$kC, _ref46$kH = _ref46.kH, kH = _ref46$kH === void 0 ? 1 : _ref46$kH; + var _ref51 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref51$kL = _ref51.kL, kL = _ref51$kL === void 0 ? 1 : _ref51$kL, _ref51$kC = _ref51.kC, kC = _ref51$kC === void 0 ? 1 : _ref51$kC, _ref51$kH = _ref51.kH, kH = _ref51$kH === void 0 ? 1 : _ref51$kH; + var _getColor = getColor([ color, sample ]); + var _getColor2 = _slicedToArray(_getColor, 2); + color = _getColor2[0]; + sample = _getColor2[1]; var _lab$from = lab.from(color), _lab$from2 = _slicedToArray(_lab$from, 3), L1 = _lab$from2[0], a1 = _lab$from2[1], b1 = _lab$from2[2]; var C1 = lch.from(lab, [ L1, a1, b1 ])[1]; var _lab$from3 = lab.from(sample), _lab$from4 = _slicedToArray(_lab$from3, 3), L2 = _lab$from4[0], a2 = _lab$from4[1], b2 = _lab$from4[2]; @@ -14474,7 +14702,7 @@ C2 = 0; } var Cbar = (C1 + C2) / 2; - var C7 = Math.pow(Cbar, 7); + var C7 = pow7(Cbar); var G = .5 * (1 - Math.sqrt(C7 / (C7 + Gfactor))); var adash1 = (1 + G) * a1; var adash2 = (1 + G) * a2; @@ -14505,12 +14733,12 @@ } else if (hdiff < -180) { \u0394h = hdiff + 360; } else { - console.log('the unthinkable has happened'); + defaults.warn('the unthinkable has happened'); } var \u0394H = 2 * Math.sqrt(Cdash2 * Cdash1) * Math.sin(\u0394h * d2r$1 / 2); var Ldash = (L1 + L2) / 2; var Cdash = (Cdash1 + Cdash2) / 2; - var Cdash7 = Math.pow(Cdash, 7); + var Cdash7 = pow7(Cdash); var hdash; if (Cdash1 * Cdash2 === 0) { hdash = hsum; @@ -14539,14 +14767,69 @@ dE += RT * (\u0394C / (kC * SC)) * (\u0394H / (kH * SH)); return Math.sqrt(dE); } - var \u03b5$2 = 75e-6; - function inGamut(color) { - var space = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : color.space; - var _ref47 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref47$epsilon = _ref47.epsilon, epsilon = _ref47$epsilon === void 0 ? \u03b5$2 : _ref47$epsilon; - color = getColor(color); - space = ColorSpace.get(space); - var coords = color.coords; - if (space !== color.space) { + var XYZtoLMS_M$1 = [ [ .819022437996703, .3619062600528904, -.1288737815209879 ], [ .0329836539323885, .9292868615863434, .0361446663506424 ], [ .0481771893596242, .2642395317527308, .6335478284694309 ] ]; + var LMStoXYZ_M$1 = [ [ 1.2268798758459243, -.5578149944602171, .2813910456659647 ], [ -.0405757452148008, 1.112286803280317, -.0717110580655164 ], [ -.0763729366746601, -.4214933324022432, 1.5869240198367816 ] ]; + var LMStoLab_M = [ [ .210454268309314, .7936177747023054, -.0040720430116193 ], [ 1.9779985324311684, -2.42859224204858, .450593709617411 ], [ .0259040424655478, .7827717124575296, -.8086757549230774 ] ]; + var LabtoLMS_M = [ [ 1, .3963377773761749, .2158037573099136 ], [ 1, -.1055613458156586, -.0638541728258133 ], [ 1, -.0894841775298119, -1.2914855480194092 ] ]; + var OKLab = new ColorSpace({ + id: 'oklab', + name: 'Oklab', + coords: { + l: { + refRange: [ 0, 1 ], + name: 'Lightness' + }, + a: { + refRange: [ -.4, .4 ] + }, + b: { + refRange: [ -.4, .4 ] + } + }, + white: 'D65', + base: xyz_d65, + fromBase: function fromBase(XYZ) { + var LMS = multiplyMatrices(XYZtoLMS_M$1, XYZ); + var LMSg = LMS.map(function(val) { + return Math.cbrt(val); + }); + return multiplyMatrices(LMStoLab_M, LMSg); + }, + toBase: function toBase(OKLab2) { + var LMSg = multiplyMatrices(LabtoLMS_M, OKLab2); + var LMS = LMSg.map(function(val) { + return Math.pow(val, 3); + }); + return multiplyMatrices(LMStoXYZ_M$1, LMS); + }, + formats: { + oklab: { + coords: [ ' | ', ' | [-1,1]', ' | [-1,1]' ] + } + } + }); + function deltaEOK(color, sample) { + var _getColor3 = getColor([ color, sample ]); + var _getColor4 = _slicedToArray(_getColor3, 2); + color = _getColor4[0]; + sample = _getColor4[1]; + var _OKLab$from = OKLab.from(color), _OKLab$from2 = _slicedToArray(_OKLab$from, 3), L1 = _OKLab$from2[0], a1 = _OKLab$from2[1], b1 = _OKLab$from2[2]; + var _OKLab$from3 = OKLab.from(sample), _OKLab$from4 = _slicedToArray(_OKLab$from3, 3), L2 = _OKLab$from4[0], a2 = _OKLab$from4[1], b2 = _OKLab$from4[2]; + var \u0394L = L1 - L2; + var \u0394a = a1 - a2; + var \u0394b = b1 - b2; + return Math.sqrt(Math.pow(\u0394L, 2) + Math.pow(\u0394a, 2) + Math.pow(\u0394b, 2)); + } + var \u03b5$5 = 75e-6; + function inGamut(color, space) { + var _ref52 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref52$epsilon = _ref52.epsilon, epsilon = _ref52$epsilon === void 0 ? \u03b5$5 : _ref52$epsilon; + color = getColor(color); + if (!space) { + space = color.space; + } + space = ColorSpace.get(space); + var coords = color.coords; + if (space !== color.space) { coords = space.from(color); } return space.inGamut(coords, { @@ -14560,4861 +14843,6125 @@ alpha: color.alpha }; } - function toGamut(color) { - var _ref48 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref48$method = _ref48.method, method = _ref48$method === void 0 ? defaults.gamut_mapping : _ref48$method, _ref48$space = _ref48.space, space = _ref48$space === void 0 ? color.space : _ref48$space; - if (isString(arguments[1])) { - space = arguments[1]; - } + function distance(color1, color2) { + var space = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'lab'; space = ColorSpace.get(space); - if (inGamut(color, space, { - epsilon: 0 - })) { - return color; - } - var spaceColor = to(color, space); - if (method !== 'clip' && !inGamut(color, space)) { - var clipped = toGamut(clone2(spaceColor), { - method: 'clip', - space: space - }); - if (deltaE2000(color, clipped) > 2) { - var coordMeta = ColorSpace.resolveCoord(method); - var mapSpace = coordMeta.space; - var coordId = coordMeta.id; - var mappedColor = to(spaceColor, mapSpace); - var bounds = coordMeta.range || coordMeta.refRange; - var min = bounds[0]; - var \u03b52 = .01; - var low = min; - var high = get(mappedColor, coordId); - while (high - low > \u03b52) { - var clipped2 = clone2(mappedColor); - clipped2 = toGamut(clipped2, { - space: space, - method: 'clip' - }); - var deltaE2 = deltaE2000(mappedColor, clipped2); - if (deltaE2 - 2 < \u03b52) { - low = get(mappedColor, coordId); - } else { - high = get(mappedColor, coordId); - } - set(mappedColor, coordId, (low + high) / 2); - } - spaceColor = to(mappedColor, space); - } else { - spaceColor = clipped; + var coords1 = space.from(color1); + var coords2 = space.from(color2); + return Math.sqrt(coords1.reduce(function(acc, c12, i) { + var c22 = coords2[i]; + if (isNaN(c12) || isNaN(c22)) { + return acc; } + return acc + Math.pow(c22 - c12, 2); + }, 0)); + } + function deltaE76(color, sample) { + return distance(color, sample, 'lab'); + } + var \u03c0 = Math.PI; + var d2r = \u03c0 / 180; + function deltaECMC(color, sample) { + var _ref53 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref53$l = _ref53.l, l = _ref53$l === void 0 ? 2 : _ref53$l, _ref53$c = _ref53.c, c4 = _ref53$c === void 0 ? 1 : _ref53$c; + var _getColor5 = getColor([ color, sample ]); + var _getColor6 = _slicedToArray(_getColor5, 2); + color = _getColor6[0]; + sample = _getColor6[1]; + var _lab$from5 = lab.from(color), _lab$from6 = _slicedToArray(_lab$from5, 3), L1 = _lab$from6[0], a1 = _lab$from6[1], b1 = _lab$from6[2]; + var _lch$from = lch.from(lab, [ L1, a1, b1 ]), _lch$from2 = _slicedToArray(_lch$from, 3), C1 = _lch$from2[1], H1 = _lch$from2[2]; + var _lab$from7 = lab.from(sample), _lab$from8 = _slicedToArray(_lab$from7, 3), L2 = _lab$from8[0], a2 = _lab$from8[1], b2 = _lab$from8[2]; + var C2 = lch.from(lab, [ L2, a2, b2 ])[1]; + if (C1 < 0) { + C1 = 0; } - if (method === 'clip' || !inGamut(spaceColor, space, { - epsilon: 0 - })) { - var _bounds = Object.values(space.coords).map(function(c4) { - return c4.range || []; - }); - spaceColor.coords = spaceColor.coords.map(function(c4, i) { - var _bounds$i = _slicedToArray(_bounds[i], 2), min = _bounds$i[0], max2 = _bounds$i[1]; - if (min !== void 0) { - c4 = Math.max(min, c4); - } - if (max2 !== void 0) { - c4 = Math.min(c4, max2); - } - return c4; - }); - } - if (space !== color.space) { - spaceColor = to(spaceColor, color.space); + if (C2 < 0) { + C2 = 0; } - color.coords = spaceColor.coords; - return color; - } - toGamut.returns = 'color'; - function to(color, space) { - var _ref49 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, inGamut2 = _ref49.inGamut; - color = getColor(color); - space = ColorSpace.get(space); - var coords = space.from(color); - var ret = { - space: space, - coords: coords, - alpha: color.alpha - }; - if (inGamut2) { - ret = toGamut(ret); + var \u0394L = L1 - L2; + var \u0394C = C1 - C2; + var \u0394a = a1 - a2; + var \u0394b = b1 - b2; + var H2 = Math.pow(\u0394a, 2) + Math.pow(\u0394b, 2) - Math.pow(\u0394C, 2); + var SL = .511; + if (L1 >= 16) { + SL = .040975 * L1 / (1 + .01765 * L1); } - return ret; - } - to.returns = 'color'; - function serialize(color) { - var _ref51, _color$space$getForma; - var _ref50 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var _ref50$precision = _ref50.precision, precision = _ref50$precision === void 0 ? defaults.precision : _ref50$precision, _ref50$format = _ref50.format, format = _ref50$format === void 0 ? 'default' : _ref50$format, _ref50$inGamut = _ref50.inGamut, inGamut$1 = _ref50$inGamut === void 0 ? true : _ref50$inGamut, customOptions = _objectWithoutProperties(_ref50, _excluded9); - var ret; - color = getColor(color); - var formatId = format; - format = (_ref51 = (_color$space$getForma = color.space.getFormat(format)) !== null && _color$space$getForma !== void 0 ? _color$space$getForma : color.space.getFormat('default')) !== null && _ref51 !== void 0 ? _ref51 : ColorSpace.DEFAULT_FORMAT; - inGamut$1 || (inGamut$1 = format.toGamut); - var coords = color.coords; - coords = coords.map(function(c4) { - return c4 ? c4 : 0; - }); - if (inGamut$1 && !inGamut(color)) { - coords = toGamut(clone2(color), inGamut$1 === true ? void 0 : inGamut$1).coords; + var SC = .0638 * C1 / (1 + .0131 * C1) + .638; + var T; + if (Number.isNaN(H1)) { + H1 = 0; } - if (format.type === 'custom') { - customOptions.precision = precision; - if (format.serialize) { - ret = format.serialize(coords, color.alpha, customOptions); - } else { - throw new TypeError('format '.concat(formatId, ' can only be used to parse colors, not for serialization')); - } + if (H1 >= 164 && H1 <= 345) { + T = .56 + Math.abs(.2 * Math.cos((H1 + 168) * d2r)); } else { - var name = format.name || 'color'; - if (format.serializeCoords) { - coords = format.serializeCoords(coords, precision); - } else { - if (precision !== null) { - coords = coords.map(function(c4) { - return toPrecision(c4, precision); - }); - } - } - var args = _toConsumableArray(coords); - if (name === 'color') { - var _format$ids; - var cssId = format.id || ((_format$ids = format.ids) === null || _format$ids === void 0 ? void 0 : _format$ids[0]) || color.space.id; - args.unshift(cssId); - } - var alpha = color.alpha; - if (precision !== null) { - alpha = toPrecision(alpha, precision); - } - var strAlpha = color.alpha < 1 && !format.noAlpha ? ''.concat(format.commas ? ',' : ' /', ' ').concat(alpha) : ''; - ret = ''.concat(name, '(').concat(args.join(format.commas ? ', ' : ' ')).concat(strAlpha, ')'); + T = .36 + Math.abs(.4 * Math.cos((H1 + 35) * d2r)); } - return ret; + var C4 = Math.pow(C1, 4); + var F = Math.sqrt(C4 / (C4 + 1900)); + var SH = SC * (F * T + 1 - F); + var dE = Math.pow(\u0394L / (l * SL), 2); + dE += Math.pow(\u0394C / (c4 * SC), 2); + dE += H2 / Math.pow(SH, 2); + return Math.sqrt(dE); } - var toXYZ_M$5 = [ [ .6369580483012914, .14461690358620832, .1688809751641721 ], [ .2627002120112671, .6779980715188708, .05930171646986196 ], [ 0, .028072693049087428, 1.060985057710791 ] ]; - var fromXYZ_M$5 = [ [ 1.716651187971268, -.355670783776392, -.25336628137366 ], [ -.666684351832489, 1.616481236634939, .0157685458139111 ], [ .017639857445311, -.042770613257809, .942103121235474 ] ]; - var REC2020Linear = new RGBColorSpace({ - id: 'rec2020-linear', - name: 'Linear REC.2020', - white: 'D65', - toXYZ_M: toXYZ_M$5, - fromXYZ_M: fromXYZ_M$5, - formats: { - color: {} - } - }); - var \u03b1 = 1.09929682680944; - var \u03b2 = .018053968510807; - var REC2020 = new RGBColorSpace({ - id: 'rec2020', - name: 'REC.2020', - base: REC2020Linear, - toBase: function toBase(RGB) { - return RGB.map(function(val) { - if (val < \u03b2 * 4.5) { - return val / 4.5; - } - return Math.pow((val + \u03b1 - 1) / \u03b1, 1 / .45); - }); + var Yw$1 = 203; + var XYZ_Abs_D65 = new ColorSpace({ + id: 'xyz-abs-d65', + cssId: '--xyz-abs-d65', + name: 'Absolute XYZ D65', + coords: { + x: { + refRange: [ 0, 9504.7 ], + name: 'Xa' + }, + y: { + refRange: [ 0, 1e4 ], + name: 'Ya' + }, + z: { + refRange: [ 0, 10888.3 ], + name: 'Za' + } }, - fromBase: function fromBase(RGB) { - return RGB.map(function(val) { - if (val >= \u03b2) { - return \u03b1 * Math.pow(val, .45) - (\u03b1 - 1); - } - return 4.5 * val; + base: xyz_d65, + fromBase: function fromBase(XYZ) { + return XYZ.map(function(v) { + return Math.max(v * Yw$1, 0); }); }, - formats: { - color: {} - } - }); - var toXYZ_M$4 = [ [ .4865709486482162, .26566769316909306, .1982172852343625 ], [ .2289745640697488, .6917385218365064, .079286914093745 ], [ 0, .04511338185890264, 1.043944368900976 ] ]; - var fromXYZ_M$4 = [ [ 2.493496911941425, -.9313836179191239, -.40271078445071684 ], [ -.8294889695615747, 1.7626640603183463, .023624685841943577 ], [ .03584583024378447, -.07617238926804182, .9568845240076872 ] ]; - var P3Linear = new RGBColorSpace({ - id: 'p3-linear', - name: 'Linear P3', - white: 'D65', - toXYZ_M: toXYZ_M$4, - fromXYZ_M: fromXYZ_M$4 - }); - var toXYZ_M$3 = [ [ .41239079926595934, .357584339383878, .1804807884018343 ], [ .21263900587151027, .715168678767756, .07219231536073371 ], [ .01933081871559182, .11919477979462598, .9505321522496607 ] ]; - var fromXYZ_M$3 = [ [ 3.2409699419045226, -1.537383177570094, -.4986107602930034 ], [ -.9692436362808796, 1.8759675015077202, .04155505740717559 ], [ .05563007969699366, -.20397695888897652, 1.0569715142428786 ] ]; - var sRGBLinear = new RGBColorSpace({ - id: 'srgb-linear', - name: 'Linear sRGB', - white: 'D65', - toXYZ_M: toXYZ_M$3, - fromXYZ_M: fromXYZ_M$3, - formats: { - color: {} + toBase: function toBase(AbsXYZ) { + return AbsXYZ.map(function(v) { + return Math.max(v / Yw$1, 0); + }); } }); - var KEYWORDS = { - aliceblue: [ 240 / 255, 248 / 255, 1 ], - antiquewhite: [ 250 / 255, 235 / 255, 215 / 255 ], - aqua: [ 0, 1, 1 ], - aquamarine: [ 127 / 255, 1, 212 / 255 ], - azure: [ 240 / 255, 1, 1 ], - beige: [ 245 / 255, 245 / 255, 220 / 255 ], - bisque: [ 1, 228 / 255, 196 / 255 ], - black: [ 0, 0, 0 ], - blanchedalmond: [ 1, 235 / 255, 205 / 255 ], - blue: [ 0, 0, 1 ], - blueviolet: [ 138 / 255, 43 / 255, 226 / 255 ], - brown: [ 165 / 255, 42 / 255, 42 / 255 ], - burlywood: [ 222 / 255, 184 / 255, 135 / 255 ], - cadetblue: [ 95 / 255, 158 / 255, 160 / 255 ], - chartreuse: [ 127 / 255, 1, 0 ], - chocolate: [ 210 / 255, 105 / 255, 30 / 255 ], - coral: [ 1, 127 / 255, 80 / 255 ], - cornflowerblue: [ 100 / 255, 149 / 255, 237 / 255 ], - cornsilk: [ 1, 248 / 255, 220 / 255 ], - crimson: [ 220 / 255, 20 / 255, 60 / 255 ], - cyan: [ 0, 1, 1 ], - darkblue: [ 0, 0, 139 / 255 ], - darkcyan: [ 0, 139 / 255, 139 / 255 ], - darkgoldenrod: [ 184 / 255, 134 / 255, 11 / 255 ], - darkgray: [ 169 / 255, 169 / 255, 169 / 255 ], - darkgreen: [ 0, 100 / 255, 0 ], - darkgrey: [ 169 / 255, 169 / 255, 169 / 255 ], - darkkhaki: [ 189 / 255, 183 / 255, 107 / 255 ], - darkmagenta: [ 139 / 255, 0, 139 / 255 ], - darkolivegreen: [ 85 / 255, 107 / 255, 47 / 255 ], - darkorange: [ 1, 140 / 255, 0 ], - darkorchid: [ 153 / 255, 50 / 255, 204 / 255 ], - darkred: [ 139 / 255, 0, 0 ], - darksalmon: [ 233 / 255, 150 / 255, 122 / 255 ], - darkseagreen: [ 143 / 255, 188 / 255, 143 / 255 ], - darkslateblue: [ 72 / 255, 61 / 255, 139 / 255 ], - darkslategray: [ 47 / 255, 79 / 255, 79 / 255 ], - darkslategrey: [ 47 / 255, 79 / 255, 79 / 255 ], - darkturquoise: [ 0, 206 / 255, 209 / 255 ], - darkviolet: [ 148 / 255, 0, 211 / 255 ], - deeppink: [ 1, 20 / 255, 147 / 255 ], - deepskyblue: [ 0, 191 / 255, 1 ], - dimgray: [ 105 / 255, 105 / 255, 105 / 255 ], - dimgrey: [ 105 / 255, 105 / 255, 105 / 255 ], - dodgerblue: [ 30 / 255, 144 / 255, 1 ], - firebrick: [ 178 / 255, 34 / 255, 34 / 255 ], - floralwhite: [ 1, 250 / 255, 240 / 255 ], - forestgreen: [ 34 / 255, 139 / 255, 34 / 255 ], - fuchsia: [ 1, 0, 1 ], - gainsboro: [ 220 / 255, 220 / 255, 220 / 255 ], - ghostwhite: [ 248 / 255, 248 / 255, 1 ], - gold: [ 1, 215 / 255, 0 ], - goldenrod: [ 218 / 255, 165 / 255, 32 / 255 ], - gray: [ 128 / 255, 128 / 255, 128 / 255 ], - green: [ 0, 128 / 255, 0 ], - greenyellow: [ 173 / 255, 1, 47 / 255 ], - grey: [ 128 / 255, 128 / 255, 128 / 255 ], - honeydew: [ 240 / 255, 1, 240 / 255 ], - hotpink: [ 1, 105 / 255, 180 / 255 ], - indianred: [ 205 / 255, 92 / 255, 92 / 255 ], - indigo: [ 75 / 255, 0, 130 / 255 ], - ivory: [ 1, 1, 240 / 255 ], - khaki: [ 240 / 255, 230 / 255, 140 / 255 ], - lavender: [ 230 / 255, 230 / 255, 250 / 255 ], - lavenderblush: [ 1, 240 / 255, 245 / 255 ], - lawngreen: [ 124 / 255, 252 / 255, 0 ], - lemonchiffon: [ 1, 250 / 255, 205 / 255 ], - lightblue: [ 173 / 255, 216 / 255, 230 / 255 ], - lightcoral: [ 240 / 255, 128 / 255, 128 / 255 ], - lightcyan: [ 224 / 255, 1, 1 ], - lightgoldenrodyellow: [ 250 / 255, 250 / 255, 210 / 255 ], - lightgray: [ 211 / 255, 211 / 255, 211 / 255 ], - lightgreen: [ 144 / 255, 238 / 255, 144 / 255 ], - lightgrey: [ 211 / 255, 211 / 255, 211 / 255 ], - lightpink: [ 1, 182 / 255, 193 / 255 ], - lightsalmon: [ 1, 160 / 255, 122 / 255 ], - lightseagreen: [ 32 / 255, 178 / 255, 170 / 255 ], - lightskyblue: [ 135 / 255, 206 / 255, 250 / 255 ], - lightslategray: [ 119 / 255, 136 / 255, 153 / 255 ], - lightslategrey: [ 119 / 255, 136 / 255, 153 / 255 ], - lightsteelblue: [ 176 / 255, 196 / 255, 222 / 255 ], - lightyellow: [ 1, 1, 224 / 255 ], - lime: [ 0, 1, 0 ], - limegreen: [ 50 / 255, 205 / 255, 50 / 255 ], - linen: [ 250 / 255, 240 / 255, 230 / 255 ], - magenta: [ 1, 0, 1 ], - maroon: [ 128 / 255, 0, 0 ], - mediumaquamarine: [ 102 / 255, 205 / 255, 170 / 255 ], - mediumblue: [ 0, 0, 205 / 255 ], - mediumorchid: [ 186 / 255, 85 / 255, 211 / 255 ], - mediumpurple: [ 147 / 255, 112 / 255, 219 / 255 ], - mediumseagreen: [ 60 / 255, 179 / 255, 113 / 255 ], - mediumslateblue: [ 123 / 255, 104 / 255, 238 / 255 ], - mediumspringgreen: [ 0, 250 / 255, 154 / 255 ], - mediumturquoise: [ 72 / 255, 209 / 255, 204 / 255 ], - mediumvioletred: [ 199 / 255, 21 / 255, 133 / 255 ], - midnightblue: [ 25 / 255, 25 / 255, 112 / 255 ], - mintcream: [ 245 / 255, 1, 250 / 255 ], - mistyrose: [ 1, 228 / 255, 225 / 255 ], - moccasin: [ 1, 228 / 255, 181 / 255 ], - navajowhite: [ 1, 222 / 255, 173 / 255 ], - navy: [ 0, 0, 128 / 255 ], - oldlace: [ 253 / 255, 245 / 255, 230 / 255 ], - olive: [ 128 / 255, 128 / 255, 0 ], - olivedrab: [ 107 / 255, 142 / 255, 35 / 255 ], - orange: [ 1, 165 / 255, 0 ], - orangered: [ 1, 69 / 255, 0 ], - orchid: [ 218 / 255, 112 / 255, 214 / 255 ], - palegoldenrod: [ 238 / 255, 232 / 255, 170 / 255 ], - palegreen: [ 152 / 255, 251 / 255, 152 / 255 ], - paleturquoise: [ 175 / 255, 238 / 255, 238 / 255 ], - palevioletred: [ 219 / 255, 112 / 255, 147 / 255 ], - papayawhip: [ 1, 239 / 255, 213 / 255 ], - peachpuff: [ 1, 218 / 255, 185 / 255 ], - peru: [ 205 / 255, 133 / 255, 63 / 255 ], - pink: [ 1, 192 / 255, 203 / 255 ], - plum: [ 221 / 255, 160 / 255, 221 / 255 ], - powderblue: [ 176 / 255, 224 / 255, 230 / 255 ], - purple: [ 128 / 255, 0, 128 / 255 ], - rebeccapurple: [ 102 / 255, 51 / 255, 153 / 255 ], - red: [ 1, 0, 0 ], - rosybrown: [ 188 / 255, 143 / 255, 143 / 255 ], - royalblue: [ 65 / 255, 105 / 255, 225 / 255 ], - saddlebrown: [ 139 / 255, 69 / 255, 19 / 255 ], - salmon: [ 250 / 255, 128 / 255, 114 / 255 ], - sandybrown: [ 244 / 255, 164 / 255, 96 / 255 ], - seagreen: [ 46 / 255, 139 / 255, 87 / 255 ], - seashell: [ 1, 245 / 255, 238 / 255 ], - sienna: [ 160 / 255, 82 / 255, 45 / 255 ], - silver: [ 192 / 255, 192 / 255, 192 / 255 ], - skyblue: [ 135 / 255, 206 / 255, 235 / 255 ], - slateblue: [ 106 / 255, 90 / 255, 205 / 255 ], - slategray: [ 112 / 255, 128 / 255, 144 / 255 ], - slategrey: [ 112 / 255, 128 / 255, 144 / 255 ], - snow: [ 1, 250 / 255, 250 / 255 ], - springgreen: [ 0, 1, 127 / 255 ], - steelblue: [ 70 / 255, 130 / 255, 180 / 255 ], - tan: [ 210 / 255, 180 / 255, 140 / 255 ], - teal: [ 0, 128 / 255, 128 / 255 ], - thistle: [ 216 / 255, 191 / 255, 216 / 255 ], - tomato: [ 1, 99 / 255, 71 / 255 ], - turquoise: [ 64 / 255, 224 / 255, 208 / 255 ], - violet: [ 238 / 255, 130 / 255, 238 / 255 ], - wheat: [ 245 / 255, 222 / 255, 179 / 255 ], - white: [ 1, 1, 1 ], - whitesmoke: [ 245 / 255, 245 / 255, 245 / 255 ], - yellow: [ 1, 1, 0 ], - yellowgreen: [ 154 / 255, 205 / 255, 50 / 255 ] - }; - var coordGrammar = Array(3).fill(' | [0, 255]'); - var coordGrammarNumber = Array(3).fill('[0, 255]'); - var sRGB = new RGBColorSpace({ - id: 'srgb', - name: 'sRGB', - base: sRGBLinear, - fromBase: function fromBase(rgb) { - return rgb.map(function(val) { - var sign = val < 0 ? -1 : 1; - var abs = val * sign; - if (abs > .0031308) { - return sign * (1.055 * Math.pow(abs, 1 / 2.4) - .055); - } - return 12.92 * val; + var b$1 = 1.15; + var g = .66; + var n$1 = 2610 / Math.pow(2, 14); + var ninv$1 = Math.pow(2, 14) / 2610; + var c1$2 = 3424 / Math.pow(2, 12); + var c2$2 = 2413 / Math.pow(2, 7); + var c3$2 = 2392 / Math.pow(2, 7); + var p = 1.7 * 2523 / Math.pow(2, 5); + var pinv = Math.pow(2, 5) / (1.7 * 2523); + var d = -.56; + var d0 = 16295499532821565e-27; + var XYZtoCone_M = [ [ .41478972, .579999, .014648 ], [ -.20151, 1.120649, .0531008 ], [ -.0166008, .2648, .6684799 ] ]; + var ConetoXYZ_M = [ [ 1.9242264357876067, -1.0047923125953657, .037651404030618 ], [ .35031676209499907, .7264811939316552, -.06538442294808501 ], [ -.09098281098284752, -.3127282905230739, 1.5227665613052603 ] ]; + var ConetoIab_M = [ [ .5, .5, 0 ], [ 3.524, -4.066708, .542708 ], [ .199076, 1.096799, -1.295875 ] ]; + var IabtoCone_M = [ [ 1, .1386050432715393, .05804731615611886 ], [ .9999999999999999, -.1386050432715393, -.05804731615611886 ], [ .9999999999999998, -.09601924202631895, -.8118918960560388 ] ]; + var Jzazbz = new ColorSpace({ + id: 'jzazbz', + name: 'Jzazbz', + coords: { + jz: { + refRange: [ 0, 1 ], + name: 'Jz' + }, + az: { + refRange: [ -.5, .5 ] + }, + bz: { + refRange: [ -.5, .5 ] + } + }, + base: XYZ_Abs_D65, + fromBase: function fromBase(XYZ) { + var _XYZ = _slicedToArray(XYZ, 3), Xa = _XYZ[0], Ya = _XYZ[1], Za = _XYZ[2]; + var Xm = b$1 * Xa - (b$1 - 1) * Za; + var Ym = g * Ya - (g - 1) * Xa; + var LMS = multiplyMatrices(XYZtoCone_M, [ Xm, Ym, Za ]); + var PQLMS = LMS.map(function(val) { + var num = c1$2 + c2$2 * Math.pow(val / 1e4, n$1); + var denom = 1 + c3$2 * Math.pow(val / 1e4, n$1); + return Math.pow(num / denom, p); }); + var _multiplyMatrices = multiplyMatrices(ConetoIab_M, PQLMS), _multiplyMatrices2 = _slicedToArray(_multiplyMatrices, 3), Iz = _multiplyMatrices2[0], az = _multiplyMatrices2[1], bz = _multiplyMatrices2[2]; + var Jz = (1 + d) * Iz / (1 + d * Iz) - d0; + return [ Jz, az, bz ]; }, - toBase: function toBase(rgb) { - return rgb.map(function(val) { - var sign = val < 0 ? -1 : 1; - var abs = val * sign; - if (abs < .04045) { - return val / 12.92; - } - return sign * Math.pow((abs + .055) / 1.055, 2.4); + toBase: function toBase(Jzazbz2) { + var _Jzazbz = _slicedToArray(Jzazbz2, 3), Jz = _Jzazbz[0], az = _Jzazbz[1], bz = _Jzazbz[2]; + var Iz = (Jz + d0) / (1 + d - d * (Jz + d0)); + var PQLMS = multiplyMatrices(IabtoCone_M, [ Iz, az, bz ]); + var LMS = PQLMS.map(function(val) { + var num = c1$2 - Math.pow(val, pinv); + var denom = c3$2 * Math.pow(val, pinv) - c2$2; + var x = 1e4 * Math.pow(num / denom, ninv$1); + return x; }); + var _multiplyMatrices3 = multiplyMatrices(ConetoXYZ_M, LMS), _multiplyMatrices4 = _slicedToArray(_multiplyMatrices3, 3), Xm = _multiplyMatrices4[0], Ym = _multiplyMatrices4[1], Za = _multiplyMatrices4[2]; + var Xa = (Xm + (b$1 - 1) * Za) / b$1; + var Ya = (Ym + (g - 1) * Xa) / g; + return [ Xa, Ya, Za ]; }, formats: { - rgb: { - coords: coordGrammar - }, - rgb_number: { - name: 'rgb', - commas: true, - coords: coordGrammarNumber, - noAlpha: true - }, - color: {}, - rgba: { - coords: coordGrammar, - commas: true, - lastAlpha: true + color: { + coords: [ ' | ', ' | [-1,1]', ' | [-1,1]' ] + } + } + }); + var jzczhz = new ColorSpace({ + id: 'jzczhz', + name: 'JzCzHz', + coords: { + jz: { + refRange: [ 0, 1 ], + name: 'Jz' }, - rgba_number: { - name: 'rgba', - commas: true, - coords: coordGrammarNumber + cz: { + refRange: [ 0, 1 ], + name: 'Chroma' }, - hex: { - type: 'custom', - toGamut: true, - test: function test(str) { - return /^#([a-f0-9]{3,4}){1,2}$/i.test(str); - }, - parse: function parse(str) { - if (str.length <= 5) { - str = str.replace(/[a-f0-9]/gi, '$&$&'); - } - var rgba = []; - str.replace(/[a-f0-9]{2}/gi, function(component) { - rgba.push(parseInt(component, 16) / 255); - }); - return { - spaceId: 'srgb', - coords: rgba.slice(0, 3), - alpha: rgba.slice(3)[0] - }; - }, - serialize: function serialize(coords, alpha) { - var _ref52 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref52$collapse = _ref52.collapse, collapse = _ref52$collapse === void 0 ? true : _ref52$collapse; - if (alpha < 1) { - coords.push(alpha); - } - coords = coords.map(function(c4) { - return Math.round(c4 * 255); - }); - var collapsible = collapse && coords.every(function(c4) { - return c4 % 17 === 0; - }); - var hex = coords.map(function(c4) { - if (collapsible) { - return (c4 / 17).toString(16); - } - return c4.toString(16).padStart(2, '0'); - }).join(''); - return '#' + hex; - } - }, - keyword: { - type: 'custom', - test: function test(str) { - return /^[a-z]+$/i.test(str); - }, - parse: function parse(str) { - str = str.toLowerCase(); - var ret = { - spaceId: 'srgb', - coords: null, - alpha: 1 - }; - if (str === 'transparent') { - ret.coords = KEYWORDS.black; - ret.alpha = 0; - } else { - ret.coords = KEYWORDS[str]; - } - if (ret.coords) { - return ret; - } - } + hz: { + refRange: [ 0, 360 ], + type: 'angle', + name: 'Hue' } - } - }); - var P3 = new RGBColorSpace({ - id: 'p3', - name: 'P3', - base: P3Linear, - fromBase: sRGB.fromBase, - toBase: sRGB.toBase, - formats: { - color: { - id: 'display-p3' + }, + base: Jzazbz, + fromBase: function fromBase(jzazbz) { + var _jzazbz = _slicedToArray(jzazbz, 3), Jz = _jzazbz[0], az = _jzazbz[1], bz = _jzazbz[2]; + var hue; + var \u03b52 = 2e-4; + if (Math.abs(az) < \u03b52 && Math.abs(bz) < \u03b52) { + hue = NaN; + } else { + hue = Math.atan2(bz, az) * 180 / Math.PI; } + return [ Jz, Math.sqrt(Math.pow(az, 2) + Math.pow(bz, 2)), constrain(hue) ]; + }, + toBase: function toBase(jzczhz2) { + return [ jzczhz2[0], jzczhz2[1] * Math.cos(jzczhz2[2] * Math.PI / 180), jzczhz2[1] * Math.sin(jzczhz2[2] * Math.PI / 180) ]; } }); - defaults.display_space = sRGB; - if (typeof CSS !== 'undefined' && CSS.supports) { - for (var _i15 = 0, _arr3 = [ lab, REC2020, P3 ]; _i15 < _arr3.length; _i15++) { - var space = _arr3[_i15]; - var coords = space.getMinCoords(); - var color = { - space: space, - coords: coords, - alpha: 1 - }; - var str = serialize(color); - if (CSS.supports('color', str)) { - defaults.display_space = space; - break; - } - } - } - function _display(color) { - var _ref53 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var _ref53$space = _ref53.space, space = _ref53$space === void 0 ? defaults.display_space : _ref53$space, options = _objectWithoutProperties(_ref53, _excluded10); - var ret = serialize(color, options); - if (typeof CSS === 'undefined' || CSS.supports('color', ret) || !defaults.display_space) { - ret = new String(ret); - ret.color = color; - } else { - var fallbackColor = to(color, space); - ret = new String(serialize(fallbackColor, options)); - ret.color = fallbackColor; + function deltaEJz(color, sample) { + var _getColor7 = getColor([ color, sample ]); + var _getColor8 = _slicedToArray(_getColor7, 2); + color = _getColor8[0]; + sample = _getColor8[1]; + var _jzczhz$from = jzczhz.from(color), _jzczhz$from2 = _slicedToArray(_jzczhz$from, 3), Jz1 = _jzczhz$from2[0], Cz1 = _jzczhz$from2[1], Hz1 = _jzczhz$from2[2]; + var _jzczhz$from3 = jzczhz.from(sample), _jzczhz$from4 = _slicedToArray(_jzczhz$from3, 3), Jz2 = _jzczhz$from4[0], Cz2 = _jzczhz$from4[1], Hz2 = _jzczhz$from4[2]; + var \u0394J = Jz1 - Jz2; + var \u0394C = Cz1 - Cz2; + if (Number.isNaN(Hz1) && Number.isNaN(Hz2)) { + Hz1 = 0; + Hz2 = 0; + } else if (Number.isNaN(Hz1)) { + Hz1 = Hz2; + } else if (Number.isNaN(Hz2)) { + Hz2 = Hz1; } - return ret; + var \u0394h = Hz1 - Hz2; + var \u0394H = 2 * Math.sqrt(Cz1 * Cz2) * Math.sin(\u0394h / 2 * (Math.PI / 180)); + return Math.sqrt(Math.pow(\u0394J, 2) + Math.pow(\u0394C, 2) + Math.pow(\u0394H, 2)); } - function distance(color1, color2) { - var space = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'lab'; - space = ColorSpace.get(space); - var coords1 = space.from(color1); - var coords2 = space.from(color2); - return Math.sqrt(coords1.reduce(function(acc, c12, i) { - var c22 = coords2[i]; - if (isNaN(c12) || isNaN(c22)) { - return acc; + var c1$1 = 3424 / 4096; + var c2$1 = 2413 / 128; + var c3$1 = 2392 / 128; + var m1$1 = 2610 / 16384; + var m2 = 2523 / 32; + var im1 = 16384 / 2610; + var im2 = 32 / 2523; + var XYZtoLMS_M = [ [ .3592832590121217, .6976051147779502, -.035891593232029 ], [ -.1920808463704993, 1.100476797037432, .0753748658519118 ], [ .0070797844607479, .0748396662186362, .8433265453898765 ] ]; + var LMStoIPT_M = [ [ 2048 / 4096, 2048 / 4096, 0 ], [ 6610 / 4096, -13613 / 4096, 7003 / 4096 ], [ 17933 / 4096, -17390 / 4096, -543 / 4096 ] ]; + var IPTtoLMS_M = [ [ .9999999999999998, .0086090370379328, .111029625003026 ], [ .9999999999999998, -.0086090370379328, -.1110296250030259 ], [ .9999999999999998, .5600313357106791, -.3206271749873188 ] ]; + var LMStoXYZ_M = [ [ 2.0701522183894223, -1.3263473389671563, .2066510476294053 ], [ .3647385209748072, .6805660249472273, -.0453045459220347 ], [ -.0497472075358123, -.0492609666966131, 1.1880659249923042 ] ]; + var ictcp = new ColorSpace({ + id: 'ictcp', + name: 'ICTCP', + coords: { + i: { + refRange: [ 0, 1 ], + name: 'I' + }, + ct: { + refRange: [ -.5, .5 ], + name: 'CT' + }, + cp: { + refRange: [ -.5, .5 ], + name: 'CP' } - return acc + Math.pow(c22 - c12, 2); - }, 0)); + }, + base: XYZ_Abs_D65, + fromBase: function fromBase(XYZ) { + var LMS = multiplyMatrices(XYZtoLMS_M, XYZ); + return LMStoICtCp(LMS); + }, + toBase: function toBase(ICtCp) { + var LMS = ICtCptoLMS(ICtCp); + return multiplyMatrices(LMStoXYZ_M, LMS); + } + }); + function LMStoICtCp(LMS) { + var PQLMS = LMS.map(function(val) { + var num = c1$1 + c2$1 * Math.pow(val / 1e4, m1$1); + var denom = 1 + c3$1 * Math.pow(val / 1e4, m1$1); + return Math.pow(num / denom, m2); + }); + return multiplyMatrices(LMStoIPT_M, PQLMS); } - function equals(color1, color2) { - color1 = getColor(color1); - color2 = getColor(color2); - return color1.space === color2.space && color1.alpha === color2.alpha && color1.coords.every(function(c4, i) { - return c4 === color2.coords[i]; + function ICtCptoLMS(ICtCp) { + var PQLMS = multiplyMatrices(IPTtoLMS_M, ICtCp); + var LMS = PQLMS.map(function(val) { + var num = Math.max(Math.pow(val, im2) - c1$1, 0); + var denom = c2$1 - c3$1 * Math.pow(val, im2); + return 1e4 * Math.pow(num / denom, im1); }); + return LMS; } - function getLuminance(color) { - return get(color, [ XYZ_D65, 'y' ]); + function deltaEITP(color, sample) { + var _getColor9 = getColor([ color, sample ]); + var _getColor10 = _slicedToArray(_getColor9, 2); + color = _getColor10[0]; + sample = _getColor10[1]; + var _ictcp$from = ictcp.from(color), _ictcp$from2 = _slicedToArray(_ictcp$from, 3), I1 = _ictcp$from2[0], T1 = _ictcp$from2[1], P1 = _ictcp$from2[2]; + var _ictcp$from3 = ictcp.from(sample), _ictcp$from4 = _slicedToArray(_ictcp$from3, 3), I2 = _ictcp$from4[0], T2 = _ictcp$from4[1], P2 = _ictcp$from4[2]; + return 720 * Math.sqrt(Math.pow(I1 - I2, 2) + .25 * Math.pow(T1 - T2, 2) + Math.pow(P1 - P2, 2)); } - function setLuminance(color, value) { - set(color, [ XYZ_D65, 'y' ], value); + var white$3 = WHITES.D65; + var adaptedCoef = .42; + var adaptedCoefInv = 1 / adaptedCoef; + var tau = 2 * Math.PI; + var cat16 = [ [ .401288, .650173, -.051461 ], [ -.250268, 1.204414, .045854 ], [ -.002079, .048952, .953127 ] ]; + var cat16Inv = [ [ 1.8620678550872327, -1.0112546305316843, .14918677544445175 ], [ .38752654323613717, .6214474419314753, -.008973985167612518 ], [ -.015841498849333856, -.03412293802851557, 1.0499644368778496 ] ]; + var m1 = [ [ 460, 451, 288 ], [ 460, -891, -261 ], [ 460, -220, -6300 ] ]; + var surroundMap = { + dark: [ .8, .525, .8 ], + dim: [ .9, .59, .9 ], + average: [ 1, .69, 1 ] + }; + var hueQuadMap = { + h: [ 20.14, 90, 164.25, 237.53, 380.14 ], + e: [ .8, .7, 1, 1.2, .8 ], + H: [ 0, 100, 200, 300, 400 ] + }; + var rad2deg = 180 / Math.PI; + var deg2rad$1 = Math.PI / 180; + function adapt$1(coords, fl) { + var temp = coords.map(function(c4) { + var x = spow(fl * Math.abs(c4) * .01, adaptedCoef); + return 400 * copySign(x, c4) / (x + 27.13); + }); + return temp; + } + function unadapt(adapted, fl) { + var constant = 100 / fl * Math.pow(27.13, adaptedCoefInv); + return adapted.map(function(c4) { + var cabs = Math.abs(c4); + return copySign(constant * spow(cabs / (400 - cabs), adaptedCoefInv), c4); + }); + } + function hueQuadrature(h) { + var hp = constrain(h); + if (hp <= hueQuadMap.h[0]) { + hp += 360; + } + var i = bisectLeft(hueQuadMap.h, hp) - 1; + var _hueQuadMap$h$slice = hueQuadMap.h.slice(i, i + 2), _hueQuadMap$h$slice2 = _slicedToArray(_hueQuadMap$h$slice, 2), hi = _hueQuadMap$h$slice2[0], hii = _hueQuadMap$h$slice2[1]; + var _hueQuadMap$e$slice = hueQuadMap.e.slice(i, i + 2), _hueQuadMap$e$slice2 = _slicedToArray(_hueQuadMap$e$slice, 2), ei = _hueQuadMap$e$slice2[0], eii = _hueQuadMap$e$slice2[1]; + var Hi = hueQuadMap.H[i]; + var t = (hp - hi) / ei; + return Hi + 100 * t / (t + (hii - hp) / eii); + } + function invHueQuadrature(H) { + var Hp = (H % 400 + 400) % 400; + var i = Math.floor(.01 * Hp); + Hp = Hp % 100; + var _hueQuadMap$h$slice3 = hueQuadMap.h.slice(i, i + 2), _hueQuadMap$h$slice4 = _slicedToArray(_hueQuadMap$h$slice3, 2), hi = _hueQuadMap$h$slice4[0], hii = _hueQuadMap$h$slice4[1]; + var _hueQuadMap$e$slice3 = hueQuadMap.e.slice(i, i + 2), _hueQuadMap$e$slice4 = _slicedToArray(_hueQuadMap$e$slice3, 2), ei = _hueQuadMap$e$slice4[0], eii = _hueQuadMap$e$slice4[1]; + return constrain((Hp * (eii * hi - ei * hii) - 100 * hi * eii) / (Hp * (eii - ei) - 100 * eii)); + } + function environment(refWhite, adaptingLuminance, backgroundLuminance, surround, discounting) { + var env = {}; + env.discounting = discounting; + env.refWhite = refWhite; + env.surround = surround; + var xyzW = refWhite.map(function(c4) { + return c4 * 100; + }); + env.la = adaptingLuminance; + env.yb = backgroundLuminance; + var yw = xyzW[1]; + var rgbW = multiplyMatrices(cat16, xyzW); + surround = surroundMap[env.surround]; + var f = surround[0]; + env.c = surround[1]; + env.nc = surround[2]; + var k = 1 / (5 * env.la + 1); + var k4 = Math.pow(k, 4); + env.fl = k4 * env.la + .1 * (1 - k4) * (1 - k4) * Math.cbrt(5 * env.la); + env.flRoot = Math.pow(env.fl, .25); + env.n = env.yb / yw; + env.z = 1.48 + Math.sqrt(env.n); + env.nbb = .725 * Math.pow(env.n, -.2); + env.ncb = env.nbb; + var d2 = discounting ? 1 : Math.max(Math.min(f * (1 - 1 / 3.6 * Math.exp((-env.la - 42) / 92)), 1), 0); + env.dRgb = rgbW.map(function(c4) { + return interpolate(1, yw / c4, d2); + }); + env.dRgbInv = env.dRgb.map(function(c4) { + return 1 / c4; + }); + var rgbCW = rgbW.map(function(c4, i) { + return c4 * env.dRgb[i]; + }); + var rgbAW = adapt$1(rgbCW, env.fl); + env.aW = env.nbb * (2 * rgbAW[0] + rgbAW[1] + .05 * rgbAW[2]); + return env; + } + var viewingConditions$1 = environment(white$3, 64 / Math.PI * .2, 20, 'average', false); + function fromCam16(cam162, env) { + if (!(cam162.J !== void 0 ^ cam162.Q !== void 0)) { + throw new Error('Conversion requires one and only one: \'J\' or \'Q\''); + } + if (!(cam162.C !== void 0 ^ cam162.M !== void 0 ^ cam162.s !== void 0)) { + throw new Error('Conversion requires one and only one: \'C\', \'M\' or \'s\''); + } + if (!(cam162.h !== void 0 ^ cam162.H !== void 0)) { + throw new Error('Conversion requires one and only one: \'h\' or \'H\''); + } + if (cam162.J === 0 || cam162.Q === 0) { + return [ 0, 0, 0 ]; + } + var hRad = 0; + if (cam162.h !== void 0) { + hRad = constrain(cam162.h) * deg2rad$1; + } else { + hRad = invHueQuadrature(cam162.H) * deg2rad$1; + } + var cosh = Math.cos(hRad); + var sinh = Math.sin(hRad); + var Jroot = 0; + if (cam162.J !== void 0) { + Jroot = spow(cam162.J, 1 / 2) * .1; + } else if (cam162.Q !== void 0) { + Jroot = .25 * env.c * cam162.Q / ((env.aW + 4) * env.flRoot); + } + var alpha = 0; + if (cam162.C !== void 0) { + alpha = cam162.C / Jroot; + } else if (cam162.M !== void 0) { + alpha = cam162.M / env.flRoot / Jroot; + } else if (cam162.s !== void 0) { + alpha = 4e-4 * Math.pow(cam162.s, 2) * (env.aW + 4) / env.c; + } + var t = spow(alpha * Math.pow(1.64 - Math.pow(.29, env.n), -.73), 10 / 9); + var et = .25 * (Math.cos(hRad + 2) + 3.8); + var A = env.aW * spow(Jroot, 2 / env.c / env.z); + var p1 = 5e4 / 13 * env.nc * env.ncb * et; + var p2 = A / env.nbb; + var r = 23 * (p2 + .305) * zdiv(t, 23 * p1 + t * (11 * cosh + 108 * sinh)); + var a2 = r * cosh; + var b2 = r * sinh; + var rgb_c = unadapt(multiplyMatrices(m1, [ p2, a2, b2 ]).map(function(c4) { + return c4 * 1 / 1403; + }), env.fl); + return multiplyMatrices(cat16Inv, rgb_c.map(function(c4, i) { + return c4 * env.dRgbInv[i]; + })).map(function(c4) { + return c4 / 100; + }); + } + function toCam16(xyzd65, env) { + var xyz100 = xyzd65.map(function(c4) { + return c4 * 100; + }); + var rgbA = adapt$1(multiplyMatrices(cat16, xyz100).map(function(c4, i) { + return c4 * env.dRgb[i]; + }), env.fl); + var a2 = rgbA[0] + (-12 * rgbA[1] + rgbA[2]) / 11; + var b2 = (rgbA[0] + rgbA[1] - 2 * rgbA[2]) / 9; + var hRad = (Math.atan2(b2, a2) % tau + tau) % tau; + var et = .25 * (Math.cos(hRad + 2) + 3.8); + var t = 5e4 / 13 * env.nc * env.ncb * zdiv(et * Math.sqrt(Math.pow(a2, 2) + Math.pow(b2, 2)), rgbA[0] + rgbA[1] + 1.05 * rgbA[2] + .305); + var alpha = spow(t, .9) * Math.pow(1.64 - Math.pow(.29, env.n), .73); + var A = env.nbb * (2 * rgbA[0] + rgbA[1] + .05 * rgbA[2]); + var Jroot = spow(A / env.aW, .5 * env.c * env.z); + var J = 100 * spow(Jroot, 2); + var Q = 4 / env.c * Jroot * (env.aW + 4) * env.flRoot; + var C = alpha * Jroot; + var M = C * env.flRoot; + var h = constrain(hRad * rad2deg); + var H = hueQuadrature(h); + var s = 50 * spow(env.c * alpha / (env.aW + 4), 1 / 2); + return { + J: J, + C: C, + h: h, + s: s, + Q: Q, + M: M, + H: H + }; } - function register$2(Color3) { - Object.defineProperty(Color3.prototype, 'luminance', { - get: function get() { - return getLuminance(this); + var cam16 = new ColorSpace({ + id: 'cam16-jmh', + cssId: '--cam16-jmh', + name: 'CAM16-JMh', + coords: { + j: { + refRange: [ 0, 100 ], + name: 'J' }, - set: function set(value) { - setLuminance(this, value); + m: { + refRange: [ 0, 105 ], + name: 'Colorfulness' + }, + h: { + refRange: [ 0, 360 ], + type: 'angle', + name: 'Hue' } - }); - } - var luminance = Object.freeze({ - __proto__: null, - getLuminance: getLuminance, - setLuminance: setLuminance, - register: register$2 + }, + base: xyz_d65, + fromBase: function fromBase(xyz) { + var cam162 = toCam16(xyz, viewingConditions$1); + return [ cam162.J, cam162.M, cam162.h ]; + }, + toBase: function toBase(cam162) { + return fromCam16({ + J: cam162[0], + M: cam162[1], + h: cam162[2] + }, viewingConditions$1); + } }); - function contrastWCAG21(color1, color2) { - color1 = getColor(color1); - color2 = getColor(color2); - var Y1 = Math.max(getLuminance(color1), 0); - var Y2 = Math.max(getLuminance(color2), 0); - if (Y2 > Y1) { - var _ref54 = [ Y2, Y1 ]; - Y1 = _ref54[0]; - Y2 = _ref54[1]; + var white$2 = WHITES.D65; + var \u03b5$4 = 216 / 24389; + var \u03ba$3 = 24389 / 27; + function toLstar(y) { + var fy = y > \u03b5$4 ? Math.cbrt(y) : (\u03ba$3 * y + 16) / 116; + return 116 * fy - 16; + } + function fromLstar(lstar) { + return lstar > 8 ? Math.pow((lstar + 16) / 116, 3) : lstar / \u03ba$3; + } + function fromHct(coords, env) { + var _coords2 = _slicedToArray(coords, 3), h = _coords2[0], c4 = _coords2[1], t = _coords2[2]; + var xyz = []; + var j = 0; + if (t === 0) { + return [ 0, 0, 0 ]; + } + var y = fromLstar(t); + if (t > 0) { + j = .00379058511492914 * Math.pow(t, 2) + .608983189401032 * t + .9155088574762233; + } else { + j = 9514440756550361e-21 * Math.pow(t, 2) + .08693057439788597 * t - 21.928975842194614; + } + var threshold = 2e-12; + var max_attempts = 15; + var attempt = 0; + var last2 = Infinity; + while (attempt <= max_attempts) { + xyz = fromCam16({ + J: j, + C: c4, + h: h + }, env); + var delta = Math.abs(xyz[1] - y); + if (delta < last2) { + if (delta <= threshold) { + return xyz; + } + last2 = delta; + } + j = j - (xyz[1] - y) * j / (2 * xyz[1]); + attempt += 1; } - return (Y1 + .05) / (Y2 + .05); + return fromCam16({ + J: j, + C: c4, + h: h + }, env); } - var normBG = .56; - var normTXT = .57; - var revTXT = .62; - var revBG = .65; - var blkThrs = .022; - var blkClmp = 1.414; - var loClip = .1; - var deltaYmin = 5e-4; - var scaleBoW = 1.14; - var loBoWoffset = .027; - var scaleWoB = 1.14; - function fclamp(Y) { - if (Y >= blkThrs) { - return Y; + function toHct(xyz, env) { + var t = toLstar(xyz[1]); + if (t === 0) { + return [ 0, 0, 0 ]; } - return Y + Math.pow(blkThrs - Y, blkClmp); - } - function linearize(val) { - var sign = val < 0 ? -1 : 1; - var abs = Math.abs(val); - return sign * Math.pow(abs, 2.4); + var cam162 = toCam16(xyz, viewingConditions); + return [ constrain(cam162.h), cam162.C, t ]; } - function contrastAPCA(background, foreground) { - foreground = getColor(foreground); - background = getColor(background); - var S; - var C; - var Sapc; - var R, G, B; - foreground = to(foreground, 'srgb'); - var _foreground$coords = _slicedToArray(foreground.coords, 3); - R = _foreground$coords[0]; - G = _foreground$coords[1]; - B = _foreground$coords[2]; - var lumTxt = linearize(R) * .2126729 + linearize(G) * .7151522 + linearize(B) * .072175; - background = to(background, 'srgb'); - var _background$coords = _slicedToArray(background.coords, 3); - R = _background$coords[0]; - G = _background$coords[1]; - B = _background$coords[2]; - var lumBg = linearize(R) * .2126729 + linearize(G) * .7151522 + linearize(B) * .072175; - var Ytxt = fclamp(lumTxt); - var Ybg = fclamp(lumBg); - var BoW = Ybg > Ytxt; - if (Math.abs(Ybg - Ytxt) < deltaYmin) { - C = 0; - } else { - if (BoW) { - S = Math.pow(Ybg, normBG) - Math.pow(Ytxt, normTXT); - C = S * scaleBoW; - } else { - S = Math.pow(Ybg, revBG) - Math.pow(Ytxt, revTXT); - C = S * scaleWoB; - } - } - if (Math.abs(C) < loClip) { - Sapc = 0; - } else if (C > 0) { - Sapc = C - loBoWoffset; - } else { - Sapc = C + loBoWoffset; - } - return Sapc * 100; - } - function contrastMichelson(color1, color2) { - color1 = getColor(color1); - color2 = getColor(color2); - var Y1 = Math.max(getLuminance(color1), 0); - var Y2 = Math.max(getLuminance(color2), 0); - if (Y2 > Y1) { - var _ref55 = [ Y2, Y1 ]; - Y1 = _ref55[0]; - Y2 = _ref55[1]; - } - var denom = Y1 + Y2; - return denom === 0 ? 0 : (Y1 - Y2) / denom; - } - var max = 5e4; - function contrastWeber(color1, color2) { - color1 = getColor(color1); - color2 = getColor(color2); - var Y1 = Math.max(getLuminance(color1), 0); - var Y2 = Math.max(getLuminance(color2), 0); - if (Y2 > Y1) { - var _ref56 = [ Y2, Y1 ]; - Y1 = _ref56[0]; - Y2 = _ref56[1]; - } - return Y2 === 0 ? max : (Y1 - Y2) / Y2; - } - function contrastLstar(color1, color2) { - color1 = getColor(color1); - color2 = getColor(color2); - var L1 = get(color1, [ lab, 'l' ]); - var L2 = get(color2, [ lab, 'l' ]); - return Math.abs(L1 - L2); - } - var \u03b5$1 = 216 / 24389; - var \u03b53 = 24 / 116; - var \u03ba = 24389 / 27; - var white = WHITES.D65; - var lab_d65 = new ColorSpace({ - id: 'lab-d65', - name: 'Lab D65', + var viewingConditions = environment(white$2, 200 / Math.PI * fromLstar(50), fromLstar(50) * 100, 'average', false); + var hct = new ColorSpace({ + id: 'hct', + name: 'HCT', coords: { - l: { - refRange: [ 0, 100 ], - name: 'L' + h: { + refRange: [ 0, 360 ], + type: 'angle', + name: 'Hue' }, - a: { - refRange: [ -125, 125 ] + c: { + refRange: [ 0, 145 ], + name: 'Colorfulness' }, - b: { - refRange: [ -125, 125 ] + t: { + refRange: [ 0, 100 ], + name: 'Tone' } }, - white: white, - base: XYZ_D65, - fromBase: function fromBase(XYZ) { - var xyz = XYZ.map(function(value, i) { - return value / white[i]; - }); - var f = xyz.map(function(value) { - return value > \u03b5$1 ? Math.cbrt(value) : (\u03ba * value + 16) / 116; - }); - return [ 116 * f[1] - 16, 500 * (f[0] - f[1]), 200 * (f[1] - f[2]) ]; + base: xyz_d65, + fromBase: function fromBase(xyz) { + return toHct(xyz); }, - toBase: function toBase(Lab) { - var f = []; - f[1] = (Lab[0] + 16) / 116; - f[0] = Lab[1] / 500 + f[1]; - f[2] = f[1] - Lab[2] / 200; - var xyz = [ f[0] > \u03b53 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03ba, Lab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03ba, f[2] > \u03b53 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03ba ]; - return xyz.map(function(value, i) { - return value * white[i]; - }); + toBase: function toBase(hct2) { + return fromHct(hct2, viewingConditions); }, formats: { - 'lab-d65': { - coords: [ ' | ', '', '' ] + color: { + id: '--hct', + coords: [ ' | ', ' | ', ' | ' ] } } }); - var phi = Math.pow(5, .5) * .5 + .5; - function contrastDeltaPhi(color1, color2) { - color1 = getColor(color1); - color2 = getColor(color2); - var Lstr1 = get(color1, [ lab_d65, 'l' ]); - var Lstr2 = get(color2, [ lab_d65, 'l' ]); - var deltaPhiStar = Math.abs(Math.pow(Lstr1, phi) - Math.pow(Lstr2, phi)); - var contrast2 = Math.pow(deltaPhiStar, 1 / phi) * Math.SQRT2 - 40; - return contrast2 < 7.5 ? 0 : contrast2; - } - var contrastMethods = Object.freeze({ - __proto__: null, - contrastWCAG21: contrastWCAG21, - contrastAPCA: contrastAPCA, - contrastMichelson: contrastMichelson, - contrastWeber: contrastWeber, - contrastLstar: contrastLstar, - contrastDeltaPhi: contrastDeltaPhi - }); - function contrast(background, foreground) { - var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - if (isString(o)) { - o = { - algorithm: o - }; + var deg2rad = Math.PI / 180; + var ucsCoeff = [ 1, .007, .0228 ]; + function convertUcsAb(coords) { + if (coords[1] < 0) { + coords = hct.fromBase(hct.toBase(coords)); + } + var M = Math.log(Math.max(1 + ucsCoeff[2] * coords[1] * viewingConditions.flRoot, 1)) / ucsCoeff[2]; + var hrad = coords[0] * deg2rad; + var a2 = M * Math.cos(hrad); + var b2 = M * Math.sin(hrad); + return [ coords[2], a2, b2 ]; + } + function deltaEHCT(color, sample) { + var _getColor11 = getColor([ color, sample ]); + var _getColor12 = _slicedToArray(_getColor11, 2); + color = _getColor12[0]; + sample = _getColor12[1]; + var _convertUcsAb = convertUcsAb(hct.from(color)), _convertUcsAb2 = _slicedToArray(_convertUcsAb, 3), t1 = _convertUcsAb2[0], a1 = _convertUcsAb2[1], b1 = _convertUcsAb2[2]; + var _convertUcsAb3 = convertUcsAb(hct.from(sample)), _convertUcsAb4 = _slicedToArray(_convertUcsAb3, 3), t2 = _convertUcsAb4[0], a2 = _convertUcsAb4[1], b2 = _convertUcsAb4[2]; + return Math.sqrt(Math.pow(t1 - t2, 2) + Math.pow(a1 - a2, 2) + Math.pow(b1 - b2, 2)); + } + var deltaEMethods = { + deltaE76: deltaE76, + deltaECMC: deltaECMC, + deltaE2000: deltaE2000, + deltaEJz: deltaEJz, + deltaEITP: deltaEITP, + deltaEOK: deltaEOK, + deltaEHCT: deltaEHCT + }; + function calcEpsilon(jnd) { + var order = !jnd ? 0 : Math.floor(Math.log10(Math.abs(jnd))); + return Math.max(parseFloat('1e'.concat(order - 2)), 1e-6); + } + var GMAPPRESET = { + hct: { + method: 'hct.c', + jnd: 2, + deltaEMethod: 'hct', + blackWhiteClamp: {} + }, + 'hct-tonal': { + method: 'hct.c', + jnd: 0, + deltaEMethod: 'hct', + blackWhiteClamp: { + channel: 'hct.t', + min: 0, + max: 100 + } } - var _o = o, algorithm = _o.algorithm, rest = _objectWithoutProperties(_o, _excluded11); - if (!algorithm) { - var algorithms = Object.keys(contrastMethods).map(function(a2) { - return a2.replace(/^contrast/, ''); - }).join(', '); - throw new TypeError('contrast() function needs a contrast algorithm. Please specify one of: '.concat(algorithms)); + }; + function toGamut(color) { + var _ref54 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref54$method = _ref54.method, method = _ref54$method === void 0 ? defaults.gamut_mapping : _ref54$method, _ref54$space = _ref54.space, space = _ref54$space === void 0 ? void 0 : _ref54$space, _ref54$deltaEMethod = _ref54.deltaEMethod, deltaEMethod = _ref54$deltaEMethod === void 0 ? '' : _ref54$deltaEMethod, _ref54$jnd = _ref54.jnd, jnd = _ref54$jnd === void 0 ? 2 : _ref54$jnd, _ref54$blackWhiteClam = _ref54.blackWhiteClamp, blackWhiteClamp = _ref54$blackWhiteClam === void 0 ? {} : _ref54$blackWhiteClam; + color = getColor(color); + if (isString(arguments[1])) { + space = arguments[1]; + } else if (!space) { + space = color.space; } - background = getColor(background); - foreground = getColor(foreground); - for (var a2 in contrastMethods) { - if ('contrast' + algorithm.toLowerCase() === a2.toLowerCase()) { - return contrastMethods[a2](background, foreground, rest); - } + space = ColorSpace.get(space); + if (inGamut(color, space, { + epsilon: 0 + })) { + return color; } - throw new TypeError('Unknown contrast algorithm: '.concat(algorithm)); - } - function uv(color) { - var _getAll = getAll(color, XYZ_D65), _getAll2 = _slicedToArray(_getAll, 3), X = _getAll2[0], Y = _getAll2[1], Z = _getAll2[2]; - var denom = X + 15 * Y + 3 * Z; - return [ 4 * X / denom, 9 * Y / denom ]; - } - function xy(color) { - var _getAll3 = getAll(color, XYZ_D65), _getAll4 = _slicedToArray(_getAll3, 3), X = _getAll4[0], Y = _getAll4[1], Z = _getAll4[2]; - var sum = X + Y + Z; - return [ X / sum, Y / sum ]; - } - function register$1(Color3) { - Object.defineProperty(Color3.prototype, 'uv', { - get: function get() { - return uv(this); + var spaceColor; + if (method === 'css') { + spaceColor = toGamutCSS(color, { + space: space + }); + } else { + if (method !== 'clip' && !inGamut(color, space)) { + if (Object.prototype.hasOwnProperty.call(GMAPPRESET, method)) { + var _GMAPPRESET$method = GMAPPRESET[method]; + method = _GMAPPRESET$method.method; + jnd = _GMAPPRESET$method.jnd; + deltaEMethod = _GMAPPRESET$method.deltaEMethod; + blackWhiteClamp = _GMAPPRESET$method.blackWhiteClamp; + } + var de = deltaE2000; + if (deltaEMethod !== '') { + for (var m3 in deltaEMethods) { + if ('deltae' + deltaEMethod.toLowerCase() === m3.toLowerCase()) { + de = deltaEMethods[m3]; + break; + } + } + } + var clipped = toGamut(to(color, space), { + method: 'clip', + space: space + }); + if (de(color, clipped) > jnd) { + if (Object.keys(blackWhiteClamp).length === 3) { + var channelMeta = ColorSpace.resolveCoord(blackWhiteClamp.channel); + var channel = get(to(color, channelMeta.space), channelMeta.id); + if (isNone(channel)) { + channel = 0; + } + if (channel >= blackWhiteClamp.max) { + return to({ + space: 'xyz-d65', + coords: WHITES['D65'] + }, color.space); + } else if (channel <= blackWhiteClamp.min) { + return to({ + space: 'xyz-d65', + coords: [ 0, 0, 0 ] + }, color.space); + } + } + var coordMeta = ColorSpace.resolveCoord(method); + var mapSpace = coordMeta.space; + var coordId = coordMeta.id; + var mappedColor = to(color, mapSpace); + mappedColor.coords.forEach(function(c4, i) { + if (isNone(c4)) { + mappedColor.coords[i] = 0; + } + }); + var bounds = coordMeta.range || coordMeta.refRange; + var min = bounds[0]; + var \u03b52 = calcEpsilon(jnd); + var low = min; + var high = get(mappedColor, coordId); + while (high - low > \u03b52) { + var clipped2 = clone2(mappedColor); + clipped2 = toGamut(clipped2, { + space: space, + method: 'clip' + }); + var deltaE2 = de(mappedColor, clipped2); + if (deltaE2 - jnd < \u03b52) { + low = get(mappedColor, coordId); + } else { + high = get(mappedColor, coordId); + } + set(mappedColor, coordId, (low + high) / 2); + } + spaceColor = to(mappedColor, space); + } else { + spaceColor = clipped; + } + } else { + spaceColor = to(color, space); } - }); - Object.defineProperty(Color3.prototype, 'xy', { - get: function get() { - return xy(this); + if (method === 'clip' || !inGamut(spaceColor, space, { + epsilon: 0 + })) { + var _bounds = Object.values(space.coords).map(function(c4) { + return c4.range || []; + }); + spaceColor.coords = spaceColor.coords.map(function(c4, i) { + var _bounds$i = _slicedToArray(_bounds[i], 2), min = _bounds$i[0], max2 = _bounds$i[1]; + if (min !== void 0) { + c4 = Math.max(min, c4); + } + if (max2 !== void 0) { + c4 = Math.min(c4, max2); + } + return c4; + }); } - }); - } - var chromaticity = Object.freeze({ - __proto__: null, - uv: uv, - xy: xy, - register: register$1 - }); - function deltaE76(color, sample) { - return distance(color, sample, 'lab'); - } - var \u03c0 = Math.PI; - var d2r = \u03c0 / 180; - function deltaECMC(color, sample) { - var _ref57 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref57$l = _ref57.l, l = _ref57$l === void 0 ? 2 : _ref57$l, _ref57$c = _ref57.c, c4 = _ref57$c === void 0 ? 1 : _ref57$c; - var _lab$from5 = lab.from(color), _lab$from6 = _slicedToArray(_lab$from5, 3), L1 = _lab$from6[0], a1 = _lab$from6[1], b1 = _lab$from6[2]; - var _lch$from = lch.from(lab, [ L1, a1, b1 ]), _lch$from2 = _slicedToArray(_lch$from, 3), C1 = _lch$from2[1], H1 = _lch$from2[2]; - var _lab$from7 = lab.from(sample), _lab$from8 = _slicedToArray(_lab$from7, 3), L2 = _lab$from8[0], a2 = _lab$from8[1], b2 = _lab$from8[2]; - var C2 = lch.from(lab, [ L2, a2, b2 ])[1]; - if (C1 < 0) { - C1 = 0; } - if (C2 < 0) { - C2 = 0; + if (space !== color.space) { + spaceColor = to(spaceColor, color.space); } - var \u0394L = L1 - L2; - var \u0394C = C1 - C2; - var \u0394a = a1 - a2; - var \u0394b = b1 - b2; - var H2 = Math.pow(\u0394a, 2) + Math.pow(\u0394b, 2) - Math.pow(\u0394C, 2); - var SL = .511; - if (L1 >= 16) { - SL = .040975 * L1 / (1 + .01765 * L1); + color.coords = spaceColor.coords; + return color; + } + toGamut.returns = 'color'; + var COLORS = { + WHITE: { + space: OKLab, + coords: [ 1, 0, 0 ] + }, + BLACK: { + space: OKLab, + coords: [ 0, 0, 0 ] } - var SC = .0638 * C1 / (1 + .0131 * C1) + .638; - var T; - if (Number.isNaN(H1)) { - H1 = 0; + }; + function toGamutCSS(origin) { + var _ref55 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, space = _ref55.space; + var JND = .02; + var \u03b52 = 1e-4; + origin = getColor(origin); + if (!space) { + space = origin.space; } - if (H1 >= 164 && H1 <= 345) { - T = .56 + Math.abs(.2 * Math.cos((H1 + 168) * d2r)); - } else { - T = .36 + Math.abs(.4 * Math.cos((H1 + 35) * d2r)); + space = ColorSpace.get(space); + var oklchSpace = ColorSpace.get('oklch'); + if (space.isUnbounded) { + return to(origin, space); + } + var origin_OKLCH = to(origin, oklchSpace); + var L = origin_OKLCH.coords[0]; + if (L >= 1) { + var white2 = to(COLORS.WHITE, space); + white2.alpha = origin.alpha; + return to(white2, space); + } + if (L <= 0) { + var black = to(COLORS.BLACK, space); + black.alpha = origin.alpha; + return to(black, space); + } + if (inGamut(origin_OKLCH, space, { + epsilon: 0 + })) { + return to(origin_OKLCH, space); } - var C4 = Math.pow(C1, 4); - var F = Math.sqrt(C4 / (C4 + 1900)); - var SH = SC * (F * T + 1 - F); - var dE = Math.pow(\u0394L / (l * SL), 2); - dE += Math.pow(\u0394C / (c4 * SC), 2); - dE += H2 / Math.pow(SH, 2); - return Math.sqrt(dE); + function clip(_color) { + var destColor = to(_color, space); + var spaceCoords = Object.values(space.coords); + destColor.coords = destColor.coords.map(function(coord, index) { + if ('range' in spaceCoords[index]) { + var _spaceCoords$index$ra = _slicedToArray(spaceCoords[index].range, 2), min2 = _spaceCoords$index$ra[0], max3 = _spaceCoords$index$ra[1]; + return clamp(min2, coord, max3); + } + return coord; + }); + return destColor; + } + var min = 0; + var max2 = origin_OKLCH.coords[1]; + var min_inGamut = true; + var current = clone2(origin_OKLCH); + var clipped = clip(current); + var E = deltaEOK(clipped, current); + if (E < JND) { + return clipped; + } + while (max2 - min > \u03b52) { + var chroma = (min + max2) / 2; + current.coords[1] = chroma; + if (min_inGamut && inGamut(current, space, { + epsilon: 0 + })) { + min = chroma; + } else { + clipped = clip(current); + E = deltaEOK(clipped, current); + if (E < JND) { + if (JND - E < \u03b52) { + break; + } else { + min_inGamut = false; + min = chroma; + } + } else { + max2 = chroma; + } + } + } + return clipped; } - var Yw$1 = 203; - var XYZ_Abs_D65 = new ColorSpace({ - id: 'xyz-abs-d65', - name: 'Absolute XYZ D65', - coords: { - x: { - refRange: [ 0, 9504.7 ], - name: 'Xa' - }, - y: { - refRange: [ 0, 1e4 ], - name: 'Ya' - }, - z: { - refRange: [ 0, 10888.3 ], - name: 'Za' - } - }, - base: XYZ_D65, - fromBase: function fromBase(XYZ) { - return XYZ.map(function(v) { - return Math.max(v * Yw$1, 0); - }); - }, - toBase: function toBase(AbsXYZ) { - return AbsXYZ.map(function(v) { - return Math.max(v / Yw$1, 0); - }); + function to(color, space) { + var _ref56 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, inGamut2 = _ref56.inGamut; + color = getColor(color); + space = ColorSpace.get(space); + var coords = space.from(color); + var ret = { + space: space, + coords: coords, + alpha: color.alpha + }; + if (inGamut2) { + ret = toGamut(ret, inGamut2 === true ? void 0 : inGamut2); } - }); - var b$1 = 1.15; - var g = .66; - var n$1 = 2610 / Math.pow(2, 14); - var ninv$1 = Math.pow(2, 14) / 2610; - var c1$2 = 3424 / Math.pow(2, 12); - var c2$2 = 2413 / Math.pow(2, 7); - var c3$2 = 2392 / Math.pow(2, 7); - var p = 1.7 * 2523 / Math.pow(2, 5); - var pinv = Math.pow(2, 5) / (1.7 * 2523); - var d = -.56; - var d0 = 16295499532821565e-27; - var XYZtoCone_M = [ [ .41478972, .579999, .014648 ], [ -.20151, 1.120649, .0531008 ], [ -.0166008, .2648, .6684799 ] ]; - var ConetoXYZ_M = [ [ 1.9242264357876067, -1.0047923125953657, .037651404030618 ], [ .35031676209499907, .7264811939316552, -.06538442294808501 ], [ -.09098281098284752, -.3127282905230739, 1.5227665613052603 ] ]; - var ConetoIab_M = [ [ .5, .5, 0 ], [ 3.524, -4.066708, .542708 ], [ .199076, 1.096799, -1.295875 ] ]; - var IabtoCone_M = [ [ 1, .1386050432715393, .05804731615611886 ], [ .9999999999999999, -.1386050432715393, -.05804731615611886 ], [ .9999999999999998, -.09601924202631895, -.8118918960560388 ] ]; - var Jzazbz = new ColorSpace({ - id: 'jzazbz', - name: 'Jzazbz', - coords: { - jz: { - refRange: [ 0, 1 ], - name: 'Jz' - }, - az: { - refRange: [ -.5, .5 ] - }, - bz: { - refRange: [ -.5, .5 ] - } - }, - base: XYZ_Abs_D65, - fromBase: function fromBase(XYZ) { - var _XYZ = _slicedToArray(XYZ, 3), Xa = _XYZ[0], Ya = _XYZ[1], Za = _XYZ[2]; - var Xm = b$1 * Xa - (b$1 - 1) * Za; - var Ym = g * Ya - (g - 1) * Xa; - var LMS = multiplyMatrices(XYZtoCone_M, [ Xm, Ym, Za ]); - var PQLMS = LMS.map(function(val) { - var num = c1$2 + c2$2 * Math.pow(val / 1e4, n$1); - var denom = 1 + c3$2 * Math.pow(val / 1e4, n$1); - return Math.pow(num / denom, p); - }); - var _multiplyMatrices = multiplyMatrices(ConetoIab_M, PQLMS), _multiplyMatrices2 = _slicedToArray(_multiplyMatrices, 3), Iz = _multiplyMatrices2[0], az = _multiplyMatrices2[1], bz = _multiplyMatrices2[2]; - var Jz = (1 + d) * Iz / (1 + d * Iz) - d0; - return [ Jz, az, bz ]; - }, - toBase: function toBase(Jzazbz2) { - var _Jzazbz = _slicedToArray(Jzazbz2, 3), Jz = _Jzazbz[0], az = _Jzazbz[1], bz = _Jzazbz[2]; - var Iz = (Jz + d0) / (1 + d - d * (Jz + d0)); - var PQLMS = multiplyMatrices(IabtoCone_M, [ Iz, az, bz ]); - var LMS = PQLMS.map(function(val) { - var num = c1$2 - Math.pow(val, pinv); - var denom = c3$2 * Math.pow(val, pinv) - c2$2; - var x = 1e4 * Math.pow(num / denom, ninv$1); - return x; - }); - var _multiplyMatrices3 = multiplyMatrices(ConetoXYZ_M, LMS), _multiplyMatrices4 = _slicedToArray(_multiplyMatrices3, 3), Xm = _multiplyMatrices4[0], Ym = _multiplyMatrices4[1], Za = _multiplyMatrices4[2]; - var Xa = (Xm + (b$1 - 1) * Za) / b$1; - var Ya = (Ym + (g - 1) * Xa) / g; - return [ Xa, Ya, Za ]; - }, - formats: { - color: {} + return ret; + } + to.returns = 'color'; + function serialize(color) { + var _ref58, _color$space$getForma; + var _ref57 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var _ref57$precision = _ref57.precision, precision = _ref57$precision === void 0 ? defaults.precision : _ref57$precision, _ref57$format = _ref57.format, format = _ref57$format === void 0 ? 'default' : _ref57$format, _ref57$inGamut = _ref57.inGamut, inGamut$1 = _ref57$inGamut === void 0 ? true : _ref57$inGamut, customOptions = _objectWithoutProperties(_ref57, _excluded9); + var ret; + color = getColor(color); + var formatId = format; + format = (_ref58 = (_color$space$getForma = color.space.getFormat(format)) !== null && _color$space$getForma !== void 0 ? _color$space$getForma : color.space.getFormat('default')) !== null && _ref58 !== void 0 ? _ref58 : ColorSpace.DEFAULT_FORMAT; + var coords = color.coords.slice(); + inGamut$1 || (inGamut$1 = format.toGamut); + if (inGamut$1 && !inGamut(color)) { + coords = toGamut(clone2(color), inGamut$1 === true ? void 0 : inGamut$1).coords; } - }); - var jzczhz = new ColorSpace({ - id: 'jzczhz', - name: 'JzCzHz', - coords: { - jz: { - refRange: [ 0, 1 ], - name: 'Jz' - }, - cz: { - refRange: [ 0, 1 ], - name: 'Chroma' - }, - hz: { - refRange: [ 0, 360 ], - type: 'angle', - name: 'Hue' + if (format.type === 'custom') { + customOptions.precision = precision; + if (format.serialize) { + ret = format.serialize(coords, color.alpha, customOptions); + } else { + throw new TypeError('format '.concat(formatId, ' can only be used to parse colors, not for serialization')); } - }, - base: Jzazbz, - fromBase: function fromBase(jzazbz) { - var _jzazbz = _slicedToArray(jzazbz, 3), Jz = _jzazbz[0], az = _jzazbz[1], bz = _jzazbz[2]; - var hue; - var \u03b52 = 2e-4; - if (Math.abs(az) < \u03b52 && Math.abs(bz) < \u03b52) { - hue = NaN; + } else { + var name = format.name || 'color'; + if (format.serializeCoords) { + coords = format.serializeCoords(coords, precision); } else { - hue = Math.atan2(bz, az) * 180 / Math.PI; + if (precision !== null) { + coords = coords.map(function(c4) { + return serializeNumber(c4, { + precision: precision + }); + }); + } } - return [ Jz, Math.sqrt(Math.pow(az, 2) + Math.pow(bz, 2)), constrain(hue) ]; - }, - toBase: function toBase(jzczhz2) { - return [ jzczhz2[0], jzczhz2[1] * Math.cos(jzczhz2[2] * Math.PI / 180), jzczhz2[1] * Math.sin(jzczhz2[2] * Math.PI / 180) ]; - }, - formats: { - color: {} - } - }); - function deltaEJz(color, sample) { - var _jzczhz$from = jzczhz.from(color), _jzczhz$from2 = _slicedToArray(_jzczhz$from, 3), Jz1 = _jzczhz$from2[0], Cz1 = _jzczhz$from2[1], Hz1 = _jzczhz$from2[2]; - var _jzczhz$from3 = jzczhz.from(sample), _jzczhz$from4 = _slicedToArray(_jzczhz$from3, 3), Jz2 = _jzczhz$from4[0], Cz2 = _jzczhz$from4[1], Hz2 = _jzczhz$from4[2]; - var \u0394J = Jz1 - Jz2; - var \u0394C = Cz1 - Cz2; - if (Number.isNaN(Hz1) && Number.isNaN(Hz2)) { - Hz1 = 0; - Hz2 = 0; - } else if (Number.isNaN(Hz1)) { - Hz1 = Hz2; - } else if (Number.isNaN(Hz2)) { - Hz2 = Hz1; + var args = _toConsumableArray(coords); + if (name === 'color') { + var _format$ids; + var cssId = format.id || ((_format$ids = format.ids) === null || _format$ids === void 0 ? void 0 : _format$ids[0]) || color.space.id; + args.unshift(cssId); + } + var alpha = color.alpha; + if (precision !== null) { + alpha = serializeNumber(alpha, { + precision: precision + }); + } + var strAlpha = color.alpha >= 1 || format.noAlpha ? '' : ''.concat(format.commas ? ',' : ' /', ' ').concat(alpha); + ret = ''.concat(name, '(').concat(args.join(format.commas ? ', ' : ' ')).concat(strAlpha, ')'); } - var \u0394h = Hz1 - Hz2; - var \u0394H = 2 * Math.sqrt(Cz1 * Cz2) * Math.sin(\u0394h / 2 * (Math.PI / 180)); - return Math.sqrt(Math.pow(\u0394J, 2) + Math.pow(\u0394C, 2) + Math.pow(\u0394H, 2)); + return ret; } - var c1$1 = 3424 / 4096; - var c2$1 = 2413 / 128; - var c3$1 = 2392 / 128; - var m1 = 2610 / 16384; - var m2 = 2523 / 32; - var im1 = 16384 / 2610; - var im2 = 32 / 2523; - var XYZtoLMS_M$1 = [ [ .3592, .6976, -.0358 ], [ -.1922, 1.1004, .0755 ], [ .007, .0749, .8434 ] ]; - var LMStoIPT_M = [ [ 2048 / 4096, 2048 / 4096, 0 ], [ 6610 / 4096, -13613 / 4096, 7003 / 4096 ], [ 17933 / 4096, -17390 / 4096, -543 / 4096 ] ]; - var IPTtoLMS_M = [ [ .9999888965628402, .008605050147287059, .11103437159861648 ], [ 1.00001110343716, -.008605050147287059, -.11103437159861648 ], [ 1.0000320633910054, .56004913547279, -.3206339100541203 ] ]; - var LMStoXYZ_M$1 = [ [ 2.0701800566956137, -1.326456876103021, .20661600684785517 ], [ .3649882500326575, .6804673628522352, -.04542175307585323 ], [ -.04959554223893211, -.04942116118675749, 1.1879959417328034 ] ]; - var ictcp = new ColorSpace({ - id: 'ictcp', - name: 'ICTCP', - coords: { - i: { - refRange: [ 0, 1 ], - name: 'I' - }, - ct: { - refRange: [ -.5, .5 ], - name: 'CT' - }, - cp: { - refRange: [ -.5, .5 ], - name: 'CP' - } - }, - base: XYZ_Abs_D65, - fromBase: function fromBase(XYZ) { - var LMS = multiplyMatrices(XYZtoLMS_M$1, XYZ); - return LMStoICtCp(LMS); - }, - toBase: function toBase(ICtCp) { - var LMS = ICtCptoLMS(ICtCp); - return multiplyMatrices(LMStoXYZ_M$1, LMS); + var toXYZ_M$5 = [ [ .6369580483012914, .14461690358620832, .1688809751641721 ], [ .2627002120112671, .6779980715188708, .05930171646986196 ], [ 0, .028072693049087428, 1.060985057710791 ] ]; + var fromXYZ_M$5 = [ [ 1.716651187971268, -.355670783776392, -.25336628137366 ], [ -.666684351832489, 1.616481236634939, .0157685458139111 ], [ .017639857445311, -.042770613257809, .942103121235474 ] ]; + var REC2020Linear = new RGBColorSpace({ + id: 'rec2020-linear', + cssId: '--rec2020-linear', + name: 'Linear REC.2020', + white: 'D65', + toXYZ_M: toXYZ_M$5, + fromXYZ_M: fromXYZ_M$5 + }); + var \u03b1 = 1.09929682680944; + var \u03b2 = .018053968510807; + var REC2020 = new RGBColorSpace({ + id: 'rec2020', + name: 'REC.2020', + base: REC2020Linear, + toBase: function toBase(RGB) { + return RGB.map(function(val) { + if (val < \u03b2 * 4.5) { + return val / 4.5; + } + return Math.pow((val + \u03b1 - 1) / \u03b1, 1 / .45); + }); }, - formats: { - color: {} + fromBase: function fromBase(RGB) { + return RGB.map(function(val) { + if (val >= \u03b2) { + return \u03b1 * Math.pow(val, .45) - (\u03b1 - 1); + } + return 4.5 * val; + }); } }); - function LMStoICtCp(LMS) { - var PQLMS = LMS.map(function(val) { - var num = c1$1 + c2$1 * Math.pow(val / 1e4, m1); - var denom = 1 + c3$1 * Math.pow(val / 1e4, m1); - return Math.pow(num / denom, m2); - }); - return multiplyMatrices(LMStoIPT_M, PQLMS); - } - function ICtCptoLMS(ICtCp) { - var PQLMS = multiplyMatrices(IPTtoLMS_M, ICtCp); - var LMS = PQLMS.map(function(val) { - var num = Math.max(Math.pow(val, im2) - c1$1, 0); - var denom = c2$1 - c3$1 * Math.pow(val, im2); - return 1e4 * Math.pow(num / denom, im1); - }); - return LMS; - } - function deltaEITP(color, sample) { - var _ictcp$from = ictcp.from(color), _ictcp$from2 = _slicedToArray(_ictcp$from, 3), I1 = _ictcp$from2[0], T1 = _ictcp$from2[1], P1 = _ictcp$from2[2]; - var _ictcp$from3 = ictcp.from(sample), _ictcp$from4 = _slicedToArray(_ictcp$from3, 3), I2 = _ictcp$from4[0], T2 = _ictcp$from4[1], P2 = _ictcp$from4[2]; - return 720 * Math.sqrt(Math.pow(I1 - I2, 2) + .25 * Math.pow(T1 - T2, 2) + Math.pow(P1 - P2, 2)); - } - var XYZtoLMS_M = [ [ .8190224432164319, .3619062562801221, -.12887378261216414 ], [ .0329836671980271, .9292868468965546, .03614466816999844 ], [ .048177199566046255, .26423952494422764, .6335478258136937 ] ]; - var LMStoXYZ_M = [ [ 1.2268798733741557, -.5578149965554813, .28139105017721583 ], [ -.04057576262431372, 1.1122868293970594, -.07171106666151701 ], [ -.07637294974672142, -.4214933239627914, 1.5869240244272418 ] ]; - var LMStoLab_M = [ [ .2104542553, .793617785, -.0040720468 ], [ 1.9779984951, -2.428592205, .4505937099 ], [ .0259040371, .7827717662, -.808675766 ] ]; - var LabtoLMS_M = [ [ .9999999984505198, .39633779217376786, .2158037580607588 ], [ 1.0000000088817609, -.10556134232365635, -.06385417477170591 ], [ 1.0000000546724108, -.08948418209496575, -1.2914855378640917 ] ]; - var OKLab = new ColorSpace({ - id: 'oklab', - name: 'OKLab', - coords: { - l: { - refRange: [ 0, 1 ], - name: 'L' - }, - a: { - refRange: [ -.4, .4 ] - }, - b: { - refRange: [ -.4, .4 ] - } - }, + var toXYZ_M$4 = [ [ .4865709486482162, .26566769316909306, .1982172852343625 ], [ .2289745640697488, .6917385218365064, .079286914093745 ], [ 0, .04511338185890264, 1.043944368900976 ] ]; + var fromXYZ_M$4 = [ [ 2.493496911941425, -.9313836179191239, -.40271078445071684 ], [ -.8294889695615747, 1.7626640603183463, .023624685841943577 ], [ .03584583024378447, -.07617238926804182, .9568845240076872 ] ]; + var P3Linear = new RGBColorSpace({ + id: 'p3-linear', + cssId: '--display-p3-linear', + name: 'Linear P3', white: 'D65', - base: XYZ_D65, - fromBase: function fromBase(XYZ) { - var LMS = multiplyMatrices(XYZtoLMS_M, XYZ); - var LMSg = LMS.map(function(val) { - return Math.cbrt(val); + toXYZ_M: toXYZ_M$4, + fromXYZ_M: fromXYZ_M$4 + }); + var toXYZ_M$3 = [ [ .41239079926595934, .357584339383878, .1804807884018343 ], [ .21263900587151027, .715168678767756, .07219231536073371 ], [ .01933081871559182, .11919477979462598, .9505321522496607 ] ]; + var fromXYZ_M$3 = [ [ 3.2409699419045226, -1.537383177570094, -.4986107602930034 ], [ -.9692436362808796, 1.8759675015077202, .04155505740717559 ], [ .05563007969699366, -.20397695888897652, 1.0569715142428786 ] ]; + var sRGBLinear = new RGBColorSpace({ + id: 'srgb-linear', + name: 'Linear sRGB', + white: 'D65', + toXYZ_M: toXYZ_M$3, + fromXYZ_M: fromXYZ_M$3 + }); + var KEYWORDS = { + aliceblue: [ 240 / 255, 248 / 255, 1 ], + antiquewhite: [ 250 / 255, 235 / 255, 215 / 255 ], + aqua: [ 0, 1, 1 ], + aquamarine: [ 127 / 255, 1, 212 / 255 ], + azure: [ 240 / 255, 1, 1 ], + beige: [ 245 / 255, 245 / 255, 220 / 255 ], + bisque: [ 1, 228 / 255, 196 / 255 ], + black: [ 0, 0, 0 ], + blanchedalmond: [ 1, 235 / 255, 205 / 255 ], + blue: [ 0, 0, 1 ], + blueviolet: [ 138 / 255, 43 / 255, 226 / 255 ], + brown: [ 165 / 255, 42 / 255, 42 / 255 ], + burlywood: [ 222 / 255, 184 / 255, 135 / 255 ], + cadetblue: [ 95 / 255, 158 / 255, 160 / 255 ], + chartreuse: [ 127 / 255, 1, 0 ], + chocolate: [ 210 / 255, 105 / 255, 30 / 255 ], + coral: [ 1, 127 / 255, 80 / 255 ], + cornflowerblue: [ 100 / 255, 149 / 255, 237 / 255 ], + cornsilk: [ 1, 248 / 255, 220 / 255 ], + crimson: [ 220 / 255, 20 / 255, 60 / 255 ], + cyan: [ 0, 1, 1 ], + darkblue: [ 0, 0, 139 / 255 ], + darkcyan: [ 0, 139 / 255, 139 / 255 ], + darkgoldenrod: [ 184 / 255, 134 / 255, 11 / 255 ], + darkgray: [ 169 / 255, 169 / 255, 169 / 255 ], + darkgreen: [ 0, 100 / 255, 0 ], + darkgrey: [ 169 / 255, 169 / 255, 169 / 255 ], + darkkhaki: [ 189 / 255, 183 / 255, 107 / 255 ], + darkmagenta: [ 139 / 255, 0, 139 / 255 ], + darkolivegreen: [ 85 / 255, 107 / 255, 47 / 255 ], + darkorange: [ 1, 140 / 255, 0 ], + darkorchid: [ 153 / 255, 50 / 255, 204 / 255 ], + darkred: [ 139 / 255, 0, 0 ], + darksalmon: [ 233 / 255, 150 / 255, 122 / 255 ], + darkseagreen: [ 143 / 255, 188 / 255, 143 / 255 ], + darkslateblue: [ 72 / 255, 61 / 255, 139 / 255 ], + darkslategray: [ 47 / 255, 79 / 255, 79 / 255 ], + darkslategrey: [ 47 / 255, 79 / 255, 79 / 255 ], + darkturquoise: [ 0, 206 / 255, 209 / 255 ], + darkviolet: [ 148 / 255, 0, 211 / 255 ], + deeppink: [ 1, 20 / 255, 147 / 255 ], + deepskyblue: [ 0, 191 / 255, 1 ], + dimgray: [ 105 / 255, 105 / 255, 105 / 255 ], + dimgrey: [ 105 / 255, 105 / 255, 105 / 255 ], + dodgerblue: [ 30 / 255, 144 / 255, 1 ], + firebrick: [ 178 / 255, 34 / 255, 34 / 255 ], + floralwhite: [ 1, 250 / 255, 240 / 255 ], + forestgreen: [ 34 / 255, 139 / 255, 34 / 255 ], + fuchsia: [ 1, 0, 1 ], + gainsboro: [ 220 / 255, 220 / 255, 220 / 255 ], + ghostwhite: [ 248 / 255, 248 / 255, 1 ], + gold: [ 1, 215 / 255, 0 ], + goldenrod: [ 218 / 255, 165 / 255, 32 / 255 ], + gray: [ 128 / 255, 128 / 255, 128 / 255 ], + green: [ 0, 128 / 255, 0 ], + greenyellow: [ 173 / 255, 1, 47 / 255 ], + grey: [ 128 / 255, 128 / 255, 128 / 255 ], + honeydew: [ 240 / 255, 1, 240 / 255 ], + hotpink: [ 1, 105 / 255, 180 / 255 ], + indianred: [ 205 / 255, 92 / 255, 92 / 255 ], + indigo: [ 75 / 255, 0, 130 / 255 ], + ivory: [ 1, 1, 240 / 255 ], + khaki: [ 240 / 255, 230 / 255, 140 / 255 ], + lavender: [ 230 / 255, 230 / 255, 250 / 255 ], + lavenderblush: [ 1, 240 / 255, 245 / 255 ], + lawngreen: [ 124 / 255, 252 / 255, 0 ], + lemonchiffon: [ 1, 250 / 255, 205 / 255 ], + lightblue: [ 173 / 255, 216 / 255, 230 / 255 ], + lightcoral: [ 240 / 255, 128 / 255, 128 / 255 ], + lightcyan: [ 224 / 255, 1, 1 ], + lightgoldenrodyellow: [ 250 / 255, 250 / 255, 210 / 255 ], + lightgray: [ 211 / 255, 211 / 255, 211 / 255 ], + lightgreen: [ 144 / 255, 238 / 255, 144 / 255 ], + lightgrey: [ 211 / 255, 211 / 255, 211 / 255 ], + lightpink: [ 1, 182 / 255, 193 / 255 ], + lightsalmon: [ 1, 160 / 255, 122 / 255 ], + lightseagreen: [ 32 / 255, 178 / 255, 170 / 255 ], + lightskyblue: [ 135 / 255, 206 / 255, 250 / 255 ], + lightslategray: [ 119 / 255, 136 / 255, 153 / 255 ], + lightslategrey: [ 119 / 255, 136 / 255, 153 / 255 ], + lightsteelblue: [ 176 / 255, 196 / 255, 222 / 255 ], + lightyellow: [ 1, 1, 224 / 255 ], + lime: [ 0, 1, 0 ], + limegreen: [ 50 / 255, 205 / 255, 50 / 255 ], + linen: [ 250 / 255, 240 / 255, 230 / 255 ], + magenta: [ 1, 0, 1 ], + maroon: [ 128 / 255, 0, 0 ], + mediumaquamarine: [ 102 / 255, 205 / 255, 170 / 255 ], + mediumblue: [ 0, 0, 205 / 255 ], + mediumorchid: [ 186 / 255, 85 / 255, 211 / 255 ], + mediumpurple: [ 147 / 255, 112 / 255, 219 / 255 ], + mediumseagreen: [ 60 / 255, 179 / 255, 113 / 255 ], + mediumslateblue: [ 123 / 255, 104 / 255, 238 / 255 ], + mediumspringgreen: [ 0, 250 / 255, 154 / 255 ], + mediumturquoise: [ 72 / 255, 209 / 255, 204 / 255 ], + mediumvioletred: [ 199 / 255, 21 / 255, 133 / 255 ], + midnightblue: [ 25 / 255, 25 / 255, 112 / 255 ], + mintcream: [ 245 / 255, 1, 250 / 255 ], + mistyrose: [ 1, 228 / 255, 225 / 255 ], + moccasin: [ 1, 228 / 255, 181 / 255 ], + navajowhite: [ 1, 222 / 255, 173 / 255 ], + navy: [ 0, 0, 128 / 255 ], + oldlace: [ 253 / 255, 245 / 255, 230 / 255 ], + olive: [ 128 / 255, 128 / 255, 0 ], + olivedrab: [ 107 / 255, 142 / 255, 35 / 255 ], + orange: [ 1, 165 / 255, 0 ], + orangered: [ 1, 69 / 255, 0 ], + orchid: [ 218 / 255, 112 / 255, 214 / 255 ], + palegoldenrod: [ 238 / 255, 232 / 255, 170 / 255 ], + palegreen: [ 152 / 255, 251 / 255, 152 / 255 ], + paleturquoise: [ 175 / 255, 238 / 255, 238 / 255 ], + palevioletred: [ 219 / 255, 112 / 255, 147 / 255 ], + papayawhip: [ 1, 239 / 255, 213 / 255 ], + peachpuff: [ 1, 218 / 255, 185 / 255 ], + peru: [ 205 / 255, 133 / 255, 63 / 255 ], + pink: [ 1, 192 / 255, 203 / 255 ], + plum: [ 221 / 255, 160 / 255, 221 / 255 ], + powderblue: [ 176 / 255, 224 / 255, 230 / 255 ], + purple: [ 128 / 255, 0, 128 / 255 ], + rebeccapurple: [ 102 / 255, 51 / 255, 153 / 255 ], + red: [ 1, 0, 0 ], + rosybrown: [ 188 / 255, 143 / 255, 143 / 255 ], + royalblue: [ 65 / 255, 105 / 255, 225 / 255 ], + saddlebrown: [ 139 / 255, 69 / 255, 19 / 255 ], + salmon: [ 250 / 255, 128 / 255, 114 / 255 ], + sandybrown: [ 244 / 255, 164 / 255, 96 / 255 ], + seagreen: [ 46 / 255, 139 / 255, 87 / 255 ], + seashell: [ 1, 245 / 255, 238 / 255 ], + sienna: [ 160 / 255, 82 / 255, 45 / 255 ], + silver: [ 192 / 255, 192 / 255, 192 / 255 ], + skyblue: [ 135 / 255, 206 / 255, 235 / 255 ], + slateblue: [ 106 / 255, 90 / 255, 205 / 255 ], + slategray: [ 112 / 255, 128 / 255, 144 / 255 ], + slategrey: [ 112 / 255, 128 / 255, 144 / 255 ], + snow: [ 1, 250 / 255, 250 / 255 ], + springgreen: [ 0, 1, 127 / 255 ], + steelblue: [ 70 / 255, 130 / 255, 180 / 255 ], + tan: [ 210 / 255, 180 / 255, 140 / 255 ], + teal: [ 0, 128 / 255, 128 / 255 ], + thistle: [ 216 / 255, 191 / 255, 216 / 255 ], + tomato: [ 1, 99 / 255, 71 / 255 ], + turquoise: [ 64 / 255, 224 / 255, 208 / 255 ], + violet: [ 238 / 255, 130 / 255, 238 / 255 ], + wheat: [ 245 / 255, 222 / 255, 179 / 255 ], + white: [ 1, 1, 1 ], + whitesmoke: [ 245 / 255, 245 / 255, 245 / 255 ], + yellow: [ 1, 1, 0 ], + yellowgreen: [ 154 / 255, 205 / 255, 50 / 255 ] + }; + var coordGrammar = Array(3).fill(' | [0, 255]'); + var coordGrammarNumber = Array(3).fill('[0, 255]'); + var sRGB = new RGBColorSpace({ + id: 'srgb', + name: 'sRGB', + base: sRGBLinear, + fromBase: function fromBase(rgb) { + return rgb.map(function(val) { + var sign = val < 0 ? -1 : 1; + var abs = val * sign; + if (abs > .0031308) { + return sign * (1.055 * Math.pow(abs, 1 / 2.4) - .055); + } + return 12.92 * val; }); - return multiplyMatrices(LMStoLab_M, LMSg); }, - toBase: function toBase(OKLab2) { - var LMSg = multiplyMatrices(LabtoLMS_M, OKLab2); - var LMS = LMSg.map(function(val) { - return Math.pow(val, 3); + toBase: function toBase(rgb) { + return rgb.map(function(val) { + var sign = val < 0 ? -1 : 1; + var abs = val * sign; + if (abs <= .04045) { + return val / 12.92; + } + return sign * Math.pow((abs + .055) / 1.055, 2.4); }); - return multiplyMatrices(LMStoXYZ_M, LMS); }, formats: { - oklab: { - coords: [ ' | ', '', '' ] - } - } - }); - function deltaEOK(color, sample) { - var _OKLab$from = OKLab.from(color), _OKLab$from2 = _slicedToArray(_OKLab$from, 3), L1 = _OKLab$from2[0], a1 = _OKLab$from2[1], b1 = _OKLab$from2[2]; - var _OKLab$from3 = OKLab.from(sample), _OKLab$from4 = _slicedToArray(_OKLab$from3, 3), L2 = _OKLab$from4[0], a2 = _OKLab$from4[1], b2 = _OKLab$from4[2]; - var \u0394L = L1 - L2; - var \u0394a = a1 - a2; - var \u0394b = b1 - b2; - return Math.sqrt(Math.pow(\u0394L, 2) + Math.pow(\u0394a, 2) + Math.pow(\u0394b, 2)); - } - var deltaEMethods = Object.freeze({ - __proto__: null, - deltaE76: deltaE76, - deltaECMC: deltaECMC, - deltaE2000: deltaE2000, - deltaEJz: deltaEJz, - deltaEITP: deltaEITP, - deltaEOK: deltaEOK - }); - function deltaE(c12, c22) { - var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - if (isString(o)) { - o = { - method: o - }; - } - var _o2 = o, _o2$method = _o2.method, method = _o2$method === void 0 ? defaults.deltaE : _o2$method, rest = _objectWithoutProperties(_o2, _excluded12); - c12 = getColor(c12); - c22 = getColor(c22); - for (var m3 in deltaEMethods) { - if ('deltae' + method.toLowerCase() === m3.toLowerCase()) { - return deltaEMethods[m3](c12, c22, rest); - } - } - throw new TypeError('Unknown deltaE method: '.concat(method)); - } - function lighten(color) { - var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .25; - var space = ColorSpace.get('oklch', 'lch'); - var lightness = [ space, 'l' ]; - return set(color, lightness, function(l) { - return l * (1 + amount); - }); - } - function darken(color) { - var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .25; - var space = ColorSpace.get('oklch', 'lch'); - var lightness = [ space, 'l' ]; - return set(color, lightness, function(l) { - return l * (1 - amount); - }); - } - var variations = Object.freeze({ - __proto__: null, - lighten: lighten, - darken: darken + rgb: { + coords: coordGrammar + }, + rgb_number: { + name: 'rgb', + commas: true, + coords: coordGrammarNumber, + noAlpha: true + }, + color: {}, + rgba: { + coords: coordGrammar, + commas: true, + lastAlpha: true + }, + rgba_number: { + name: 'rgba', + commas: true, + coords: coordGrammarNumber + }, + hex: { + type: 'custom', + toGamut: true, + test: function test(str) { + return /^#([a-f0-9]{3,4}){1,2}$/i.test(str); + }, + parse: function parse(str) { + if (str.length <= 5) { + str = str.replace(/[a-f0-9]/gi, '$&$&'); + } + var rgba = []; + str.replace(/[a-f0-9]{2}/gi, function(component) { + rgba.push(parseInt(component, 16) / 255); + }); + return { + spaceId: 'srgb', + coords: rgba.slice(0, 3), + alpha: rgba.slice(3)[0] + }; + }, + serialize: function serialize(coords, alpha) { + var _ref59 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, _ref59$collapse = _ref59.collapse, collapse = _ref59$collapse === void 0 ? true : _ref59$collapse; + if (alpha < 1) { + coords.push(alpha); + } + coords = coords.map(function(c4) { + return Math.round(c4 * 255); + }); + var collapsible = collapse && coords.every(function(c4) { + return c4 % 17 === 0; + }); + var hex = coords.map(function(c4) { + if (collapsible) { + return (c4 / 17).toString(16); + } + return c4.toString(16).padStart(2, '0'); + }).join(''); + return '#' + hex; + } + }, + keyword: { + type: 'custom', + test: function test(str) { + return /^[a-z]+$/i.test(str); + }, + parse: function parse(str) { + str = str.toLowerCase(); + var ret = { + spaceId: 'srgb', + coords: null, + alpha: 1 + }; + if (str === 'transparent') { + ret.coords = KEYWORDS.black; + ret.alpha = 0; + } else { + ret.coords = KEYWORDS[str]; + } + if (ret.coords) { + return ret; + } + } + } + } }); - function mix(c12, c22) { - var p2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .5; - var o = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - var _ref58 = [ getColor(c12), getColor(c22) ]; - c12 = _ref58[0]; - c22 = _ref58[1]; - if (type(p2) === 'object') { - var _ref59 = [ .5, p2 ]; - p2 = _ref59[0]; - o = _ref59[1]; + var P3 = new RGBColorSpace({ + id: 'p3', + cssId: 'display-p3', + name: 'P3', + base: P3Linear, + fromBase: sRGB.fromBase, + toBase: sRGB.toBase + }); + defaults.display_space = sRGB; + var supportsNone; + if (typeof CSS !== 'undefined' && CSS.supports) { + for (var _i15 = 0, _arr2 = [ lab, REC2020, P3 ]; _i15 < _arr2.length; _i15++) { + var space = _arr2[_i15]; + var coords = space.getMinCoords(); + var color = { + space: space, + coords: coords, + alpha: 1 + }; + var str = serialize(color); + if (CSS.supports('color', str)) { + defaults.display_space = space; + break; + } } - var _o3 = o, space = _o3.space, outputSpace = _o3.outputSpace, premultiplied = _o3.premultiplied; - var r = range(c12, c22, { - space: space, - outputSpace: outputSpace, - premultiplied: premultiplied - }); - return r(p2); } - function steps(c12, c22) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var colorRange; - if (isRange(c12)) { - colorRange = c12; - options = c22; - var _colorRange$rangeArgs = _slicedToArray(colorRange.rangeArgs.colors, 2); - c12 = _colorRange$rangeArgs[0]; - c22 = _colorRange$rangeArgs[1]; - } - var _options = options, maxDeltaE = _options.maxDeltaE, deltaEMethod = _options.deltaEMethod, _options$steps = _options.steps, steps2 = _options$steps === void 0 ? 2 : _options$steps, _options$maxSteps = _options.maxSteps, maxSteps = _options$maxSteps === void 0 ? 1e3 : _options$maxSteps, rangeOptions = _objectWithoutProperties(_options, _excluded13); - if (!colorRange) { - var _ref60 = [ getColor(c12), getColor(c22) ]; - c12 = _ref60[0]; - c22 = _ref60[1]; - colorRange = range(c12, c22, rangeOptions); - } - var totalDelta = deltaE(c12, c22); - var actualSteps = maxDeltaE > 0 ? Math.max(steps2, Math.ceil(totalDelta / maxDeltaE) + 1) : steps2; - var ret = []; - if (maxSteps !== void 0) { - actualSteps = Math.min(actualSteps, maxSteps); - } - if (actualSteps === 1) { - ret = [ { - p: .5, - color: colorRange(.5) - } ]; + function _display(color) { + var _ref60 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var _ref60$space = _ref60.space, space = _ref60$space === void 0 ? defaults.display_space : _ref60$space, options = _objectWithoutProperties(_ref60, _excluded10); + var ret = serialize(color, options); + if (typeof CSS === 'undefined' || CSS.supports('color', ret) || !defaults.display_space) { + ret = new String(ret); + ret.color = color; } else { - var step = 1 / (actualSteps - 1); - ret = Array.from({ - length: actualSteps - }, function(_, i) { - var p2 = i * step; - return { - p: p2, - color: colorRange(p2) - }; - }); - } - if (maxDeltaE > 0) { - var maxDelta = ret.reduce(function(acc, cur, i) { - if (i === 0) { - return 0; - } - var \u0394\u0395 = deltaE(cur.color, ret[i - 1].color, deltaEMethod); - return Math.max(acc, \u0394\u0395); - }, 0); - while (maxDelta > maxDeltaE) { - maxDelta = 0; - for (var _i16 = 1; _i16 < ret.length && ret.length < maxSteps; _i16++) { - var prev = ret[_i16 - 1]; - var cur = ret[_i16]; - var p2 = (cur.p + prev.p) / 2; - var _color = colorRange(p2); - maxDelta = Math.max(maxDelta, deltaE(_color, prev.color), deltaE(_color, cur.color)); - ret.splice(_i16, 0, { - p: p2, - color: colorRange(p2) - }); - _i16++; + var fallbackColor = color; + var hasNone = color.coords.some(isNone) || isNone(color.alpha); + if (hasNone) { + var _supportsNone; + if (!((_supportsNone = supportsNone) !== null && _supportsNone !== void 0 ? _supportsNone : supportsNone = CSS.supports('color', 'hsl(none 50% 50%)'))) { + fallbackColor = clone2(color); + fallbackColor.coords = fallbackColor.coords.map(skipNone); + fallbackColor.alpha = skipNone(fallbackColor.alpha); + ret = serialize(fallbackColor, options); + if (CSS.supports('color', ret)) { + ret = new String(ret); + ret.color = fallbackColor; + return ret; + } } } + fallbackColor = to(fallbackColor, space); + ret = new String(serialize(fallbackColor, options)); + ret.color = fallbackColor; } - ret = ret.map(function(a2) { - return a2.color; - }); return ret; } - function range(color1, color2) { - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - if (isRange(color1)) { - var r = color1, options2 = color2; - return range.apply(void 0, _toConsumableArray(r.rangeArgs.colors).concat([ _extends({}, r.rangeArgs.options, options2) ])); - } - var space = options.space, outputSpace = options.outputSpace, progression = options.progression, premultiplied = options.premultiplied; + function equals(color1, color2) { color1 = getColor(color1); color2 = getColor(color2); - color1 = clone2(color1); - color2 = clone2(color2); - var rangeArgs = { - colors: [ color1, color2 ], - options: options - }; - if (space) { - space = ColorSpace.get(space); - } else { - space = ColorSpace.registry[defaults.interpolationSpace] || color1.space; - } - outputSpace = outputSpace ? ColorSpace.get(outputSpace) : space; - color1 = to(color1, space); - color2 = to(color2, space); - color1 = toGamut(color1); - color2 = toGamut(color2); - if (space.coords.h && space.coords.h.type === 'angle') { - var arc = options.hue = options.hue || 'shorter'; - var hue = [ space, 'h' ]; - var _ref61 = [ get(color1, hue), get(color2, hue) ], \u03b81 = _ref61[0], \u03b82 = _ref61[1]; - var _adjust = adjust(arc, [ \u03b81, \u03b82 ]); - var _adjust2 = _slicedToArray(_adjust, 2); - \u03b81 = _adjust2[0]; - \u03b82 = _adjust2[1]; - set(color1, hue, \u03b81); - set(color2, hue, \u03b82); - } - if (premultiplied) { - color1.coords = color1.coords.map(function(c4) { - return c4 * color1.alpha; - }); - color2.coords = color2.coords.map(function(c4) { - return c4 * color2.alpha; - }); - } - return Object.assign(function(p2) { - p2 = progression ? progression(p2) : p2; - var coords = color1.coords.map(function(start, i) { - var end = color2.coords[i]; - return interpolate(start, end, p2); - }); - var alpha = interpolate(color1.alpha, color2.alpha, p2); - var ret = { - space: space, - coords: coords, - alpha: alpha - }; - if (premultiplied) { - ret.coords = ret.coords.map(function(c4) { - return c4 / alpha; - }); - } - if (outputSpace !== space) { - ret = to(ret, outputSpace); - } - return ret; - }, { - rangeArgs: rangeArgs + return color1.space === color2.space && color1.alpha === color2.alpha && color1.coords.every(function(c4, i) { + return c4 === color2.coords[i]; }); } - function isRange(val) { - return type(val) === 'function' && !!val.rangeArgs; + function getLuminance(color) { + return get(color, [ xyz_d65, 'y' ]); } - defaults.interpolationSpace = 'lab'; - function register(Color3) { - Color3.defineFunction('mix', mix, { - returns: 'color' - }); - Color3.defineFunction('range', range, { - returns: 'function' - }); - Color3.defineFunction('steps', steps, { - returns: 'array' + function setLuminance(color, value) { + set(color, [ xyz_d65, 'y' ], value); + } + function register$2(Color3) { + Object.defineProperty(Color3.prototype, 'luminance', { + get: function get() { + return getLuminance(this); + }, + set: function set(value) { + setLuminance(this, value); + } }); } - var interpolation = Object.freeze({ + var luminance = Object.freeze({ __proto__: null, - mix: mix, - steps: steps, - range: range, - isRange: isRange, - register: register + getLuminance: getLuminance, + register: register$2, + setLuminance: setLuminance }); - var HSL = new ColorSpace({ - id: 'hsl', - name: 'HSL', - coords: { - h: { - refRange: [ 0, 360 ], - type: 'angle', - name: 'Hue' - }, - s: { - range: [ 0, 100 ], - name: 'Saturation' - }, - l: { - range: [ 0, 100 ], - name: 'Lightness' - } - }, - base: sRGB, - fromBase: function fromBase(rgb) { - var max2 = Math.max.apply(Math, _toConsumableArray(rgb)); - var min = Math.min.apply(Math, _toConsumableArray(rgb)); - var _rgb = _slicedToArray(rgb, 3), r = _rgb[0], g2 = _rgb[1], b2 = _rgb[2]; - var h = NaN, s = 0, l = (min + max2) / 2; - var d2 = max2 - min; - if (d2 !== 0) { - s = l === 0 || l === 1 ? 0 : (max2 - l) / Math.min(l, 1 - l); - switch (max2) { - case r: - h = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0); - break; - - case g2: - h = (b2 - r) / d2 + 2; - break; - - case b2: - h = (r - g2) / d2 + 4; - } - h = h * 60; - } - return [ h, s * 100, l * 100 ]; - }, - toBase: function toBase(hsl) { - var _hsl = _slicedToArray(hsl, 3), h = _hsl[0], s = _hsl[1], l = _hsl[2]; - h = h % 360; - if (h < 0) { - h += 360; - } - s /= 100; - l /= 100; - function f(n2) { - var k = (n2 + h / 30) % 12; - var a2 = s * Math.min(l, 1 - l); - return l - a2 * Math.max(-1, Math.min(k - 3, 9 - k, 1)); - } - return [ f(0), f(8), f(4) ]; - }, - formats: { - hsl: { - toGamut: true, - coords: [ ' | ', '', '' ] - }, - hsla: { - coords: [ ' | ', '', '' ], - commas: true, - lastAlpha: true + function contrastWCAG21(color1, color2) { + color1 = getColor(color1); + color2 = getColor(color2); + var Y1 = Math.max(getLuminance(color1), 0); + var Y2 = Math.max(getLuminance(color2), 0); + if (Y2 > Y1) { + var _ref61 = [ Y2, Y1 ]; + Y1 = _ref61[0]; + Y2 = _ref61[1]; + } + return (Y1 + .05) / (Y2 + .05); + } + var normBG = .56; + var normTXT = .57; + var revTXT = .62; + var revBG = .65; + var blkThrs = .022; + var blkClmp = 1.414; + var loClip = .1; + var deltaYmin = 5e-4; + var scaleBoW = 1.14; + var loBoWoffset = .027; + var scaleWoB = 1.14; + function fclamp(Y) { + if (Y >= blkThrs) { + return Y; + } + return Y + Math.pow(blkThrs - Y, blkClmp); + } + function linearize(val) { + var sign = val < 0 ? -1 : 1; + var abs = Math.abs(val); + return sign * Math.pow(abs, 2.4); + } + function contrastAPCA(background, foreground) { + foreground = getColor(foreground); + background = getColor(background); + var S; + var C; + var Sapc; + var R, G, B; + foreground = to(foreground, 'srgb'); + var _foreground$coords = _slicedToArray(foreground.coords, 3); + R = _foreground$coords[0]; + G = _foreground$coords[1]; + B = _foreground$coords[2]; + var lumTxt = linearize(R) * .2126729 + linearize(G) * .7151522 + linearize(B) * .072175; + background = to(background, 'srgb'); + var _background$coords = _slicedToArray(background.coords, 3); + R = _background$coords[0]; + G = _background$coords[1]; + B = _background$coords[2]; + var lumBg = linearize(R) * .2126729 + linearize(G) * .7151522 + linearize(B) * .072175; + var Ytxt = fclamp(lumTxt); + var Ybg = fclamp(lumBg); + var BoW = Ybg > Ytxt; + if (Math.abs(Ybg - Ytxt) < deltaYmin) { + C = 0; + } else { + if (BoW) { + S = Math.pow(Ybg, normBG) - Math.pow(Ytxt, normTXT); + C = S * scaleBoW; + } else { + S = Math.pow(Ybg, revBG) - Math.pow(Ytxt, revTXT); + C = S * scaleWoB; } } - }); - var HSV = new ColorSpace({ - id: 'hsv', - name: 'HSV', + if (Math.abs(C) < loClip) { + Sapc = 0; + } else if (C > 0) { + Sapc = C - loBoWoffset; + } else { + Sapc = C + loBoWoffset; + } + return Sapc * 100; + } + function contrastMichelson(color1, color2) { + color1 = getColor(color1); + color2 = getColor(color2); + var Y1 = Math.max(getLuminance(color1), 0); + var Y2 = Math.max(getLuminance(color2), 0); + if (Y2 > Y1) { + var _ref62 = [ Y2, Y1 ]; + Y1 = _ref62[0]; + Y2 = _ref62[1]; + } + var denom = Y1 + Y2; + return denom === 0 ? 0 : (Y1 - Y2) / denom; + } + var max = 5e4; + function contrastWeber(color1, color2) { + color1 = getColor(color1); + color2 = getColor(color2); + var Y1 = Math.max(getLuminance(color1), 0); + var Y2 = Math.max(getLuminance(color2), 0); + if (Y2 > Y1) { + var _ref63 = [ Y2, Y1 ]; + Y1 = _ref63[0]; + Y2 = _ref63[1]; + } + return Y2 === 0 ? max : (Y1 - Y2) / Y2; + } + function contrastLstar(color1, color2) { + color1 = getColor(color1); + color2 = getColor(color2); + var L1 = get(color1, [ lab, 'l' ]); + var L2 = get(color2, [ lab, 'l' ]); + return Math.abs(L1 - L2); + } + var \u03b5$3 = 216 / 24389; + var \u03b53 = 24 / 116; + var \u03ba$2 = 24389 / 27; + var white$1 = WHITES.D65; + var lab_d65 = new ColorSpace({ + id: 'lab-d65', + name: 'Lab D65', coords: { - h: { - refRange: [ 0, 360 ], - type: 'angle', - name: 'Hue' + l: { + refRange: [ 0, 100 ], + name: 'Lightness' }, - s: { - range: [ 0, 100 ], - name: 'Saturation' + a: { + refRange: [ -125, 125 ] }, - v: { - range: [ 0, 100 ], - name: 'Value' + b: { + refRange: [ -125, 125 ] } }, - base: HSL, - fromBase: function fromBase(hsl) { - var _hsl2 = _slicedToArray(hsl, 3), h = _hsl2[0], s = _hsl2[1], l = _hsl2[2]; - s /= 100; - l /= 100; - var v = l + s * Math.min(l, 1 - l); - return [ h, v === 0 ? 0 : 200 * (1 - l / v), 100 * v ]; + white: white$1, + base: xyz_d65, + fromBase: function fromBase(XYZ) { + var xyz = XYZ.map(function(value, i) { + return value / white$1[i]; + }); + var f = xyz.map(function(value) { + return value > \u03b5$3 ? Math.cbrt(value) : (\u03ba$2 * value + 16) / 116; + }); + return [ 116 * f[1] - 16, 500 * (f[0] - f[1]), 200 * (f[1] - f[2]) ]; }, - toBase: function toBase(hsv) { - var _hsv = _slicedToArray(hsv, 3), h = _hsv[0], s = _hsv[1], v = _hsv[2]; - s /= 100; - v /= 100; - var l = v * (1 - s / 2); - return [ h, l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l) * 100, l * 100 ]; + toBase: function toBase(Lab) { + var f = []; + f[1] = (Lab[0] + 16) / 116; + f[0] = Lab[1] / 500 + f[1]; + f[2] = f[1] - Lab[2] / 200; + var xyz = [ f[0] > \u03b53 ? Math.pow(f[0], 3) : (116 * f[0] - 16) / \u03ba$2, Lab[0] > 8 ? Math.pow((Lab[0] + 16) / 116, 3) : Lab[0] / \u03ba$2, f[2] > \u03b53 ? Math.pow(f[2], 3) : (116 * f[2] - 16) / \u03ba$2 ]; + return xyz.map(function(value, i) { + return value * white$1[i]; + }); }, formats: { - color: { - toGamut: true + 'lab-d65': { + coords: [ ' | ', ' | [-1,1]', ' | [-1,1]' ] } } }); - var hwb = new ColorSpace({ - id: 'hwb', - name: 'HWB', - coords: { - h: { - refRange: [ 0, 360 ], - type: 'angle', - name: 'Hue' - }, - w: { - range: [ 0, 100 ], - name: 'Whiteness' - }, - b: { - range: [ 0, 100 ], - name: 'Blackness' - } - }, - base: HSV, - fromBase: function fromBase(hsv) { - var _hsv2 = _slicedToArray(hsv, 3), h = _hsv2[0], s = _hsv2[1], v = _hsv2[2]; - return [ h, v * (100 - s) / 100, 100 - v ]; - }, - toBase: function toBase(hwb2) { - var _hwb = _slicedToArray(hwb2, 3), h = _hwb[0], w = _hwb[1], b2 = _hwb[2]; - w /= 100; - b2 /= 100; - var sum = w + b2; - if (sum >= 1) { - var gray = w / sum; - return [ h, 0, gray * 100 ]; - } - var v = 1 - b2; - var s = v === 0 ? 0 : 1 - w / v; - return [ h, s * 100, v * 100 ]; - }, - formats: { - hwb: { - toGamut: true, - coords: [ ' | ', '', '' ] - } - } - }); - var toXYZ_M$2 = [ [ .5766690429101305, .1855582379065463, .1882286462349947 ], [ .29734497525053605, .6273635662554661, .07529145849399788 ], [ .02703136138641234, .07068885253582723, .9913375368376388 ] ]; - var fromXYZ_M$2 = [ [ 2.0415879038107465, -.5650069742788596, -.34473135077832956 ], [ -.9692436362808795, 1.8759675015077202, .04155505740717557 ], [ .013444280632031142, -.11836239223101838, 1.0151749943912054 ] ]; - var A98Linear = new RGBColorSpace({ - id: 'a98rgb-linear', - name: 'Linear Adobe\xae 98 RGB compatible', - white: 'D65', - toXYZ_M: toXYZ_M$2, - fromXYZ_M: fromXYZ_M$2 + var phi = Math.pow(5, .5) * .5 + .5; + function contrastDeltaPhi(color1, color2) { + color1 = getColor(color1); + color2 = getColor(color2); + var Lstr1 = get(color1, [ lab_d65, 'l' ]); + var Lstr2 = get(color2, [ lab_d65, 'l' ]); + var deltaPhiStar = Math.abs(Math.pow(Lstr1, phi) - Math.pow(Lstr2, phi)); + var contrast2 = Math.pow(deltaPhiStar, 1 / phi) * Math.SQRT2 - 40; + return contrast2 < 7.5 ? 0 : contrast2; + } + var contrastMethods = Object.freeze({ + __proto__: null, + contrastAPCA: contrastAPCA, + contrastDeltaPhi: contrastDeltaPhi, + contrastLstar: contrastLstar, + contrastMichelson: contrastMichelson, + contrastWCAG21: contrastWCAG21, + contrastWeber: contrastWeber }); - var a98rgb = new RGBColorSpace({ - id: 'a98rgb', - name: 'Adobe\xae 98 RGB compatible', - base: A98Linear, - toBase: function toBase(RGB) { - return RGB.map(function(val) { - return Math.pow(Math.abs(val), 563 / 256) * Math.sign(val); - }); - }, - fromBase: function fromBase(RGB) { - return RGB.map(function(val) { - return Math.pow(Math.abs(val), 256 / 563) * Math.sign(val); - }); - }, - formats: { - color: { - id: 'a98-rgb' - } + function contrast(background, foreground) { + var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (isString(o)) { + o = { + algorithm: o + }; } - }); - var toXYZ_M$1 = [ [ .7977604896723027, .13518583717574031, .0313493495815248 ], [ .2880711282292934, .7118432178101014, 8565396060525902e-20 ], [ 0, 0, .8251046025104601 ] ]; - var fromXYZ_M$1 = [ [ 1.3457989731028281, -.25558010007997534, -.05110628506753401 ], [ -.5446224939028347, 1.5082327413132781, .02053603239147973 ], [ 0, 0, 1.2119675456389454 ] ]; - var ProPhotoLinear = new RGBColorSpace({ - id: 'prophoto-linear', - name: 'Linear ProPhoto', - white: 'D50', - base: XYZ_D50, - toXYZ_M: toXYZ_M$1, - fromXYZ_M: fromXYZ_M$1 - }); - var Et = 1 / 512; - var Et2 = 16 / 512; - var prophoto = new RGBColorSpace({ - id: 'prophoto', - name: 'ProPhoto', - base: ProPhotoLinear, - toBase: function toBase(RGB) { - return RGB.map(function(v) { - return v < Et2 ? v / 16 : Math.pow(v, 1.8); - }); - }, - fromBase: function fromBase(RGB) { - return RGB.map(function(v) { - return v >= Et ? Math.pow(v, 1 / 1.8) : 16 * v; - }); - }, - formats: { - color: { - id: 'prophoto-rgb' - } + var _o = o, algorithm = _o.algorithm, rest = _objectWithoutProperties(_o, _excluded11); + if (!algorithm) { + var algorithms = Object.keys(contrastMethods).map(function(a2) { + return a2.replace(/^contrast/, ''); + }).join(', '); + throw new TypeError('contrast() function needs a contrast algorithm. Please specify one of: '.concat(algorithms)); } - }); - var oklch = new ColorSpace({ - id: 'oklch', - name: 'OKLCh', - coords: { - l: { - refRange: [ 0, 1 ], - name: 'Lightness' - }, - c: { - refRange: [ 0, .4 ], - name: 'Chroma' - }, - h: { - refRange: [ 0, 360 ], - type: 'angle', - name: 'Hue' - } - }, - white: 'D65', - base: OKLab, - fromBase: function fromBase(oklab) { - var _oklab = _slicedToArray(oklab, 3), L = _oklab[0], a2 = _oklab[1], b2 = _oklab[2]; - var h; - var \u03b52 = 2e-4; - if (Math.abs(a2) < \u03b52 && Math.abs(b2) < \u03b52) { - h = NaN; - } else { - h = Math.atan2(b2, a2) * 180 / Math.PI; + background = getColor(background); + foreground = getColor(foreground); + for (var a2 in contrastMethods) { + if ('contrast' + algorithm.toLowerCase() === a2.toLowerCase()) { + return contrastMethods[a2](background, foreground, rest); } - return [ L, Math.sqrt(Math.pow(a2, 2) + Math.pow(b2, 2)), constrain(h) ]; - }, - toBase: function toBase(oklch2) { - var _oklch = _slicedToArray(oklch2, 3), L = _oklch[0], C = _oklch[1], h = _oklch[2]; - var a2, b2; - if (isNaN(h)) { - a2 = 0; - b2 = 0; - } else { - a2 = C * Math.cos(h * Math.PI / 180); - b2 = C * Math.sin(h * Math.PI / 180); + } + throw new TypeError('Unknown contrast algorithm: '.concat(algorithm)); + } + function uv(color) { + var _getAll = getAll(color, xyz_d65), _getAll2 = _slicedToArray(_getAll, 3), X = _getAll2[0], Y = _getAll2[1], Z = _getAll2[2]; + var denom = X + 15 * Y + 3 * Z; + return [ 4 * X / denom, 9 * Y / denom ]; + } + function xy(color) { + var _getAll3 = getAll(color, xyz_d65), _getAll4 = _slicedToArray(_getAll3, 3), X = _getAll4[0], Y = _getAll4[1], Z = _getAll4[2]; + var sum = X + Y + Z; + return [ X / sum, Y / sum ]; + } + function register$1(Color3) { + Object.defineProperty(Color3.prototype, 'uv', { + get: function get() { + return uv(this); } - return [ L, a2, b2 ]; - }, - formats: { - oklch: { - coords: [ ' | ', '', ' | ' ] + }); + Object.defineProperty(Color3.prototype, 'xy', { + get: function get() { + return xy(this); } - } + }); + } + var chromaticity = Object.freeze({ + __proto__: null, + register: register$1, + uv: uv, + xy: xy }); - var Yw = 203; - var n = 2610 / Math.pow(2, 14); - var ninv = Math.pow(2, 14) / 2610; - var m = 2523 / Math.pow(2, 5); - var minv = Math.pow(2, 5) / 2523; - var c1 = 3424 / Math.pow(2, 12); - var c2 = 2413 / Math.pow(2, 7); - var c3 = 2392 / Math.pow(2, 7); - var rec2100Pq = new RGBColorSpace({ - id: 'rec2100pq', - name: 'REC.2100-PQ', - base: REC2020Linear, - toBase: function toBase(RGB) { - return RGB.map(function(val) { - var x = Math.pow(Math.max(Math.pow(val, minv) - c1, 0) / (c2 - c3 * Math.pow(val, minv)), ninv); - return x * 1e4 / Yw; - }); - }, - fromBase: function fromBase(RGB) { - return RGB.map(function(val) { - var x = Math.max(val * Yw / 1e4, 0); - var num = c1 + c2 * Math.pow(x, n); - var denom = 1 + c3 * Math.pow(x, n); - return Math.pow(num / denom, m); - }); - }, - formats: { - color: { - id: 'rec2100-pq' + function deltaE(c12, c22) { + var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (isString(o)) { + o = { + method: o + }; + } + var _o2 = o, _o2$method = _o2.method, method = _o2$method === void 0 ? defaults.deltaE : _o2$method, rest = _objectWithoutProperties(_o2, _excluded12); + for (var m3 in deltaEMethods) { + if ('deltae' + method.toLowerCase() === m3.toLowerCase()) { + return deltaEMethods[m3](c12, c22, rest); } } + throw new TypeError('Unknown deltaE method: '.concat(method)); + } + function lighten(color) { + var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .25; + var space = ColorSpace.get('oklch', 'lch'); + var lightness = [ space, 'l' ]; + return set(color, lightness, function(l) { + return l * (1 + amount); + }); + } + function darken(color) { + var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .25; + var space = ColorSpace.get('oklch', 'lch'); + var lightness = [ space, 'l' ]; + return set(color, lightness, function(l) { + return l * (1 - amount); + }); + } + var variations = Object.freeze({ + __proto__: null, + darken: darken, + lighten: lighten }); - var a = .17883277; - var b = .28466892; - var c = .55991073; - var scale = 3.7743; - var rec2100Hlg = new RGBColorSpace({ - id: 'rec2100hlg', - cssid: 'rec2100-hlg', - name: 'REC.2100-HLG', - referred: 'scene', - base: REC2020Linear, - toBase: function toBase(RGB) { - return RGB.map(function(val) { - if (val <= .5) { - return Math.pow(val, 2) / 3 * scale; - } - return Math.exp((val - c) / a + b) / 12 * scale; + function mix(c12, c22) { + var p2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .5; + var o = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var _ref64 = [ getColor(c12), getColor(c22) ]; + c12 = _ref64[0]; + c22 = _ref64[1]; + if (type(p2) === 'object') { + var _ref65 = [ .5, p2 ]; + p2 = _ref65[0]; + o = _ref65[1]; + } + var r = range(c12, c22, o); + return r(p2); + } + function steps(c12, c22) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var colorRange; + if (isRange(c12)) { + colorRange = c12; + options = c22; + var _colorRange$rangeArgs = _slicedToArray(colorRange.rangeArgs.colors, 2); + c12 = _colorRange$rangeArgs[0]; + c22 = _colorRange$rangeArgs[1]; + } + var _options = options, maxDeltaE = _options.maxDeltaE, deltaEMethod = _options.deltaEMethod, _options$steps = _options.steps, steps2 = _options$steps === void 0 ? 2 : _options$steps, _options$maxSteps = _options.maxSteps, maxSteps = _options$maxSteps === void 0 ? 1e3 : _options$maxSteps, rangeOptions = _objectWithoutProperties(_options, _excluded13); + if (!colorRange) { + var _ref66 = [ getColor(c12), getColor(c22) ]; + c12 = _ref66[0]; + c22 = _ref66[1]; + colorRange = range(c12, c22, rangeOptions); + } + var totalDelta = deltaE(c12, c22); + var actualSteps = maxDeltaE > 0 ? Math.max(steps2, Math.ceil(totalDelta / maxDeltaE) + 1) : steps2; + var ret = []; + if (maxSteps !== void 0) { + actualSteps = Math.min(actualSteps, maxSteps); + } + if (actualSteps === 1) { + ret = [ { + p: .5, + color: colorRange(.5) + } ]; + } else { + var step = 1 / (actualSteps - 1); + ret = Array.from({ + length: actualSteps + }, function(_, i) { + var p2 = i * step; + return { + p: p2, + color: colorRange(p2) + }; }); - }, - fromBase: function fromBase(RGB) { - return RGB.map(function(val) { - val /= scale; - if (val <= 1 / 12) { - return Math.sqrt(3 * val); + } + if (maxDeltaE > 0) { + var maxDelta = ret.reduce(function(acc, cur, i) { + if (i === 0) { + return 0; + } + var \u0394\u0395 = deltaE(cur.color, ret[i - 1].color, deltaEMethod); + return Math.max(acc, \u0394\u0395); + }, 0); + while (maxDelta > maxDeltaE) { + maxDelta = 0; + for (var _i16 = 1; _i16 < ret.length && ret.length < maxSteps; _i16++) { + var prev = ret[_i16 - 1]; + var cur = ret[_i16]; + var p2 = (cur.p + prev.p) / 2; + var _color2 = colorRange(p2); + maxDelta = Math.max(maxDelta, deltaE(_color2, prev.color), deltaE(_color2, cur.color)); + ret.splice(_i16, 0, { + p: p2, + color: colorRange(p2) + }); + _i16++; } - return a * Math.log(12 * val - b) + c; - }); - }, - formats: { - color: { - id: 'rec2100-hlg' } } - }); - var CATs = {}; - hooks.add('chromatic-adaptation-start', function(env) { - if (env.options.method) { - env.M = adapt(env.W1, env.W2, env.options.method); + ret = ret.map(function(a2) { + return a2.color; + }); + return ret; + } + function range(color1, color2) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (isRange(color1)) { + var r = color1, options2 = color2; + return range.apply(void 0, _toConsumableArray(r.rangeArgs.colors).concat([ _extends({}, r.rangeArgs.options, options2) ])); } - }); - hooks.add('chromatic-adaptation-end', function(env) { - if (!env.M) { - env.M = adapt(env.W1, env.W2, env.options.method); + var space = options.space, outputSpace = options.outputSpace, progression = options.progression, premultiplied = options.premultiplied; + color1 = getColor(color1); + color2 = getColor(color2); + color1 = clone2(color1); + color2 = clone2(color2); + var rangeArgs = { + colors: [ color1, color2 ], + options: options + }; + if (space) { + space = ColorSpace.get(space); + } else { + space = ColorSpace.registry[defaults.interpolationSpace] || color1.space; } - }); - function defineCAT(_ref62) { - var id = _ref62.id, toCone_M = _ref62.toCone_M, fromCone_M = _ref62.fromCone_M; - CATs[id] = arguments[0]; + outputSpace = outputSpace ? ColorSpace.get(outputSpace) : space; + color1 = to(color1, space); + color2 = to(color2, space); + color1 = toGamut(color1); + color2 = toGamut(color2); + if (space.coords.h && space.coords.h.type === 'angle') { + var arc = options.hue = options.hue || 'shorter'; + var hue = [ space, 'h' ]; + var _ref67 = [ get(color1, hue), get(color2, hue) ], \u03b81 = _ref67[0], \u03b82 = _ref67[1]; + if (isNaN(\u03b81) && !isNaN(\u03b82)) { + \u03b81 = \u03b82; + } else if (isNaN(\u03b82) && !isNaN(\u03b81)) { + \u03b82 = \u03b81; + } + var _adjust = adjust(arc, [ \u03b81, \u03b82 ]); + var _adjust2 = _slicedToArray(_adjust, 2); + \u03b81 = _adjust2[0]; + \u03b82 = _adjust2[1]; + set(color1, hue, \u03b81); + set(color2, hue, \u03b82); + } + if (premultiplied) { + color1.coords = color1.coords.map(function(c4) { + return c4 * color1.alpha; + }); + color2.coords = color2.coords.map(function(c4) { + return c4 * color2.alpha; + }); + } + return Object.assign(function(p2) { + p2 = progression ? progression(p2) : p2; + var coords = color1.coords.map(function(start, i) { + var end = color2.coords[i]; + return interpolate(start, end, p2); + }); + var alpha = interpolate(color1.alpha, color2.alpha, p2); + var ret = { + space: space, + coords: coords, + alpha: alpha + }; + if (premultiplied) { + ret.coords = ret.coords.map(function(c4) { + return c4 / alpha; + }); + } + if (outputSpace !== space) { + ret = to(ret, outputSpace); + } + return ret; + }, { + rangeArgs: rangeArgs + }); } - function adapt(W1, W2) { - var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Bradford'; - var method = CATs[id]; - var _multiplyMatrices5 = multiplyMatrices(method.toCone_M, W1), _multiplyMatrices6 = _slicedToArray(_multiplyMatrices5, 3), \u03c1s = _multiplyMatrices6[0], \u03b3s = _multiplyMatrices6[1], \u03b2s = _multiplyMatrices6[2]; - var _multiplyMatrices7 = multiplyMatrices(method.toCone_M, W2), _multiplyMatrices8 = _slicedToArray(_multiplyMatrices7, 3), \u03c1d = _multiplyMatrices8[0], \u03b3d = _multiplyMatrices8[1], \u03b2d = _multiplyMatrices8[2]; - var scale2 = [ [ \u03c1d / \u03c1s, 0, 0 ], [ 0, \u03b3d / \u03b3s, 0 ], [ 0, 0, \u03b2d / \u03b2s ] ]; - var scaled_cone_M = multiplyMatrices(scale2, method.toCone_M); - var adapt_M = multiplyMatrices(method.fromCone_M, scaled_cone_M); - return adapt_M; + function isRange(val) { + return type(val) === 'function' && !!val.rangeArgs; } - defineCAT({ - id: 'von Kries', - toCone_M: [ [ .40024, .7076, -.08081 ], [ -.2263, 1.16532, .0457 ], [ 0, 0, .91822 ] ], - fromCone_M: [ [ 1.8599364, -1.1293816, .2198974 ], [ .3611914, .6388125, -64e-7 ], [ 0, 0, 1.0890636 ] ] - }); - defineCAT({ - id: 'Bradford', - toCone_M: [ [ .8951, .2664, -.1614 ], [ -.7502, 1.7135, .0367 ], [ .0389, -.0685, 1.0296 ] ], - fromCone_M: [ [ .9869929, -.1470543, .1599627 ], [ .4323053, .5183603, .0492912 ], [ -.0085287, .0400428, .9684867 ] ] - }); - defineCAT({ - id: 'CAT02', - toCone_M: [ [ .7328, .4296, -.1624 ], [ -.7036, 1.6975, .0061 ], [ .003, .0136, .9834 ] ], - fromCone_M: [ [ 1.0961238, -.278869, .1827452 ], [ .454369, .4735332, .0720978 ], [ -.0096276, -.005698, 1.0153256 ] ] - }); - defineCAT({ - id: 'CAT16', - toCone_M: [ [ .401288, .650173, -.051461 ], [ -.250268, 1.204414, .045854 ], [ -.002079, .048952, .953127 ] ], - fromCone_M: [ [ 1.862067855087233, -1.011254630531685, .1491867754444518 ], [ .3875265432361372, .6214474419314753, -.008973985167612518 ], [ -.01584149884933386, -.03412293802851557, 1.04996443687785 ] ] - }); - Object.assign(WHITES, { - A: [ 1.0985, 1, .35585 ], - C: [ .98074, 1, 1.18232 ], - D55: [ .95682, 1, .92149 ], - D75: [ .94972, 1, 1.22638 ], - E: [ 1, 1, 1 ], - F2: [ .99186, 1, .67393 ], - F7: [ .95041, 1, 1.08747 ], - F11: [ 1.00962, 1, .6435 ] + defaults.interpolationSpace = 'lab'; + function register(Color3) { + Color3.defineFunction('mix', mix, { + returns: 'color' + }); + Color3.defineFunction('range', range, { + returns: 'function' + }); + Color3.defineFunction('steps', steps, { + returns: 'array' + }); + } + var interpolation = Object.freeze({ + __proto__: null, + isRange: isRange, + mix: mix, + range: range, + register: register, + steps: steps }); - WHITES.ACES = [ .32168 / .33767, 1, (1 - .32168 - .33767) / .33767 ]; - var toXYZ_M = [ [ .6624541811085053, .13400420645643313, .1561876870049078 ], [ .27222871678091454, .6740817658111484, .05368951740793705 ], [ -.005574649490394108, .004060733528982826, 1.0103391003129971 ] ]; - var fromXYZ_M = [ [ 1.6410233796943257, -.32480329418479, -.23642469523761225 ], [ -.6636628587229829, 1.6153315916573379, .016756347685530137 ], [ .011721894328375376, -.008284441996237409, .9883948585390215 ] ]; - var ACEScg = new RGBColorSpace({ - id: 'acescg', - name: 'ACEScg', + var HSL = new ColorSpace({ + id: 'hsl', + name: 'HSL', coords: { - r: { - range: [ 0, 65504 ], - name: 'Red' + h: { + refRange: [ 0, 360 ], + type: 'angle', + name: 'Hue' }, - g: { - range: [ 0, 65504 ], - name: 'Green' + s: { + range: [ 0, 100 ], + name: 'Saturation' }, - b: { - range: [ 0, 65504 ], - name: 'Blue' + l: { + range: [ 0, 100 ], + name: 'Lightness' } }, - referred: 'scene', - white: WHITES.ACES, - toXYZ_M: toXYZ_M, - fromXYZ_M: fromXYZ_M, - formats: { - color: {} - } - }); - var \u03b5 = Math.pow(2, -16); - var ACES_min_nonzero = -.35828683; - var ACES_cc_max = (Math.log2(65504) + 9.72) / 17.52; - var acescc = new RGBColorSpace({ - id: 'acescc', - name: 'ACEScc', + base: sRGB, + fromBase: function fromBase(rgb) { + var max2 = Math.max.apply(Math, _toConsumableArray(rgb)); + var min = Math.min.apply(Math, _toConsumableArray(rgb)); + var _rgb = _slicedToArray(rgb, 3), r = _rgb[0], g2 = _rgb[1], b2 = _rgb[2]; + var h = NaN, s = 0, l = (min + max2) / 2; + var d2 = max2 - min; + if (d2 !== 0) { + s = l === 0 || l === 1 ? 0 : (max2 - l) / Math.min(l, 1 - l); + switch (max2) { + case r: + h = (g2 - b2) / d2 + (g2 < b2 ? 6 : 0); + break; + + case g2: + h = (b2 - r) / d2 + 2; + break; + + case b2: + h = (r - g2) / d2 + 4; + } + h = h * 60; + } + if (s < 0) { + h += 180; + s = Math.abs(s); + } + if (h >= 360) { + h -= 360; + } + return [ h, s * 100, l * 100 ]; + }, + toBase: function toBase(hsl) { + var _hsl = _slicedToArray(hsl, 3), h = _hsl[0], s = _hsl[1], l = _hsl[2]; + h = h % 360; + if (h < 0) { + h += 360; + } + s /= 100; + l /= 100; + function f(n2) { + var k = (n2 + h / 30) % 12; + var a2 = s * Math.min(l, 1 - l); + return l - a2 * Math.max(-1, Math.min(k - 3, 9 - k, 1)); + } + return [ f(0), f(8), f(4) ]; + }, + formats: { + hsl: { + coords: [ ' | ', '', '' ] + }, + hsla: { + coords: [ ' | ', '', '' ], + commas: true, + lastAlpha: true + } + } + }); + var HSV = new ColorSpace({ + id: 'hsv', + name: 'HSV', coords: { - r: { - range: [ ACES_min_nonzero, ACES_cc_max ], - name: 'Red' + h: { + refRange: [ 0, 360 ], + type: 'angle', + name: 'Hue' }, - g: { - range: [ ACES_min_nonzero, ACES_cc_max ], - name: 'Green' + s: { + range: [ 0, 100 ], + name: 'Saturation' + }, + v: { + range: [ 0, 100 ], + name: 'Value' + } + }, + base: HSL, + fromBase: function fromBase(hsl) { + var _hsl2 = _slicedToArray(hsl, 3), h = _hsl2[0], s = _hsl2[1], l = _hsl2[2]; + s /= 100; + l /= 100; + var v = l + s * Math.min(l, 1 - l); + return [ h, v === 0 ? 0 : 200 * (1 - l / v), 100 * v ]; + }, + toBase: function toBase(hsv) { + var _hsv = _slicedToArray(hsv, 3), h = _hsv[0], s = _hsv[1], v = _hsv[2]; + s /= 100; + v /= 100; + var l = v * (1 - s / 2); + return [ h, l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l) * 100, l * 100 ]; + }, + formats: { + color: { + id: '--hsv', + coords: [ ' | ', ' | ', ' | ' ] + } + } + }); + var hwb = new ColorSpace({ + id: 'hwb', + name: 'HWB', + coords: { + h: { + refRange: [ 0, 360 ], + type: 'angle', + name: 'Hue' + }, + w: { + range: [ 0, 100 ], + name: 'Whiteness' }, b: { - range: [ ACES_min_nonzero, ACES_cc_max ], - name: 'Blue' + range: [ 0, 100 ], + name: 'Blackness' } }, - referred: 'scene', - base: ACEScg, + base: HSV, + fromBase: function fromBase(hsv) { + var _hsv2 = _slicedToArray(hsv, 3), h = _hsv2[0], s = _hsv2[1], v = _hsv2[2]; + return [ h, v * (100 - s) / 100, 100 - v ]; + }, + toBase: function toBase(hwb2) { + var _hwb = _slicedToArray(hwb2, 3), h = _hwb[0], w = _hwb[1], b2 = _hwb[2]; + w /= 100; + b2 /= 100; + var sum = w + b2; + if (sum >= 1) { + var gray = w / sum; + return [ h, 0, gray * 100 ]; + } + var v = 1 - b2; + var s = v === 0 ? 0 : 1 - w / v; + return [ h, s * 100, v * 100 ]; + }, + formats: { + hwb: { + coords: [ ' | ', ' | ', ' | ' ] + } + } + }); + var toXYZ_M$2 = [ [ .5766690429101305, .1855582379065463, .1882286462349947 ], [ .29734497525053605, .6273635662554661, .07529145849399788 ], [ .02703136138641234, .07068885253582723, .9913375368376388 ] ]; + var fromXYZ_M$2 = [ [ 2.0415879038107465, -.5650069742788596, -.34473135077832956 ], [ -.9692436362808795, 1.8759675015077202, .04155505740717557 ], [ .013444280632031142, -.11836239223101838, 1.0151749943912054 ] ]; + var A98Linear = new RGBColorSpace({ + id: 'a98rgb-linear', + cssId: '--a98-rgb-linear', + name: 'Linear Adobe\xae 98 RGB compatible', + white: 'D65', + toXYZ_M: toXYZ_M$2, + fromXYZ_M: fromXYZ_M$2 + }); + var a98rgb = new RGBColorSpace({ + id: 'a98rgb', + cssId: 'a98-rgb', + name: 'Adobe\xae 98 RGB compatible', + base: A98Linear, toBase: function toBase(RGB) { - var low = (9.72 - 15) / 17.52; return RGB.map(function(val) { - if (val <= low) { - return (Math.pow(2, val * 17.52 - 9.72) - \u03b5) * 2; - } else if (val < ACES_cc_max) { - return Math.pow(2, val * 17.52 - 9.72); - } else { - return 65504; - } + return Math.pow(Math.abs(val), 563 / 256) * Math.sign(val); }); }, fromBase: function fromBase(RGB) { return RGB.map(function(val) { - if (val <= 0) { - return (Math.log2(\u03b5) + 9.72) / 17.52; - } else if (val < \u03b5) { - return (Math.log2(\u03b5 + val * .5) + 9.72) / 17.52; - } else { - return (Math.log2(val) + 9.72) / 17.52; - } + return Math.pow(Math.abs(val), 256 / 563) * Math.sign(val); }); - }, - formats: { - color: {} } }); - var spaces = Object.freeze({ - __proto__: null, - XYZ_D65: XYZ_D65, - XYZ_D50: XYZ_D50, - XYZ_ABS_D65: XYZ_Abs_D65, - Lab_D65: lab_d65, - Lab: lab, - LCH: lch, - sRGB_Linear: sRGBLinear, - sRGB: sRGB, - HSL: HSL, - HWB: hwb, - HSV: HSV, - P3_Linear: P3Linear, - P3: P3, - A98RGB_Linear: A98Linear, - A98RGB: a98rgb, - ProPhoto_Linear: ProPhotoLinear, - ProPhoto: prophoto, - REC_2020_Linear: REC2020Linear, - REC_2020: REC2020, - OKLab: OKLab, - OKLCH: oklch, - Jzazbz: Jzazbz, - JzCzHz: jzczhz, - ICTCP: ictcp, - REC_2100_PQ: rec2100Pq, - REC_2100_HLG: rec2100Hlg, - ACEScg: ACEScg, - ACEScc: acescc + var toXYZ_M$1 = [ [ .7977666449006423, .13518129740053308, .0313477341283922 ], [ .2880748288194013, .711835234241873, 8993693872564e-17 ], [ 0, 0, .8251046025104602 ] ]; + var fromXYZ_M$1 = [ [ 1.3457868816471583, -.25557208737979464, -.05110186497554526 ], [ -.5446307051249019, 1.5082477428451468, .02052744743642139 ], [ 0, 0, 1.2119675456389452 ] ]; + var ProPhotoLinear = new RGBColorSpace({ + id: 'prophoto-linear', + cssId: '--prophoto-rgb-linear', + name: 'Linear ProPhoto', + white: 'D50', + base: XYZ_D50, + toXYZ_M: toXYZ_M$1, + fromXYZ_M: fromXYZ_M$1 }); - var Color = (_space = new WeakMap(), function() { - function Color() { - var _this2 = this; - _classCallCheck(this, Color); - _classPrivateFieldInitSpec(this, _space, { - writable: true, - value: void 0 + var Et = 1 / 512; + var Et2 = 16 / 512; + var prophoto = new RGBColorSpace({ + id: 'prophoto', + cssId: 'prophoto-rgb', + name: 'ProPhoto', + base: ProPhotoLinear, + toBase: function toBase(RGB) { + return RGB.map(function(v) { + return v < Et2 ? v / 16 : Math.pow(v, 1.8); }); - var color; - for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { - args[_key3] = arguments[_key3]; + }, + fromBase: function fromBase(RGB) { + return RGB.map(function(v) { + return v >= Et ? Math.pow(v, 1 / 1.8) : 16 * v; + }); + } + }); + var oklch = new ColorSpace({ + id: 'oklch', + name: 'Oklch', + coords: { + l: { + refRange: [ 0, 1 ], + name: 'Lightness' + }, + c: { + refRange: [ 0, .4 ], + name: 'Chroma' + }, + h: { + refRange: [ 0, 360 ], + type: 'angle', + name: 'Hue' } - if (args.length === 1) { - color = getColor(args[0]); + }, + white: 'D65', + base: OKLab, + fromBase: function fromBase(oklab) { + var _oklab = _slicedToArray(oklab, 3), L = _oklab[0], a2 = _oklab[1], b2 = _oklab[2]; + var h; + var \u03b52 = 2e-4; + if (Math.abs(a2) < \u03b52 && Math.abs(b2) < \u03b52) { + h = NaN; + } else { + h = Math.atan2(b2, a2) * 180 / Math.PI; } - var space, coords, alpha; - if (color) { - space = color.space || color.spaceId; - coords = color.coords; - alpha = color.alpha; + return [ L, Math.sqrt(Math.pow(a2, 2) + Math.pow(b2, 2)), constrain(h) ]; + }, + toBase: function toBase(oklch2) { + var _oklch = _slicedToArray(oklch2, 3), L = _oklch[0], C = _oklch[1], h = _oklch[2]; + var a2, b2; + if (isNaN(h)) { + a2 = 0; + b2 = 0; } else { - space = args[0]; - coords = args[1]; - alpha = args[2]; + a2 = C * Math.cos(h * Math.PI / 180); + b2 = C * Math.sin(h * Math.PI / 180); } - _classPrivateFieldSet(this, _space, ColorSpace.get(space)); - this.coords = coords ? coords.slice() : [ 0, 0, 0 ]; - this.alpha = alpha < 1 ? alpha : 1; - for (var _i17 = 0; _i17 < this.coords.length; _i17++) { - if (this.coords[_i17] === 'NaN') { - this.coords[_i17] = NaN; - } + return [ L, a2, b2 ]; + }, + formats: { + oklch: { + coords: [ ' | ', ' | [0,1]', ' | ' ] } - var _loop6 = function _loop6(id) { - Object.defineProperty(_this2, id, { - get: function get() { - return _this2.get(id); - }, - set: function set(value) { - return _this2.set(id, value); - } - }); - }; - for (var id in _classPrivateFieldGet(this, _space).coords) { - _loop6(id); + } + }); + var white = WHITES.D65; + var \u03b5$2 = 216 / 24389; + var \u03ba$1 = 24389 / 27; + var _uv = uv({ + space: xyz_d65, + coords: white + }), _uv2 = _slicedToArray(_uv, 2), U_PRIME_WHITE = _uv2[0], V_PRIME_WHITE = _uv2[1]; + var Luv = new ColorSpace({ + id: 'luv', + name: 'Luv', + coords: { + l: { + refRange: [ 0, 100 ], + name: 'Lightness' + }, + u: { + refRange: [ -215, 215 ] + }, + v: { + refRange: [ -215, 215 ] + } + }, + white: white, + base: xyz_d65, + fromBase: function fromBase(XYZ) { + var xyz = [ skipNone(XYZ[0]), skipNone(XYZ[1]), skipNone(XYZ[2]) ]; + var y = xyz[1]; + var _uv3 = uv({ + space: xyz_d65, + coords: xyz + }), _uv4 = _slicedToArray(_uv3, 2), up = _uv4[0], vp = _uv4[1]; + if (!Number.isFinite(up) || !Number.isFinite(vp)) { + return [ 0, 0, 0 ]; + } + var L = y <= \u03b5$2 ? \u03ba$1 * y : 116 * Math.cbrt(y) - 16; + return [ L, 13 * L * (up - U_PRIME_WHITE), 13 * L * (vp - V_PRIME_WHITE) ]; + }, + toBase: function toBase(Luv2) { + var _Luv = _slicedToArray(Luv2, 3), L = _Luv[0], u = _Luv[1], v = _Luv[2]; + if (L === 0 || isNone(L)) { + return [ 0, 0, 0 ]; + } + u = skipNone(u); + v = skipNone(v); + var up = u / (13 * L) + U_PRIME_WHITE; + var vp = v / (13 * L) + V_PRIME_WHITE; + var y = L <= 8 ? L / \u03ba$1 : Math.pow((L + 16) / 116, 3); + return [ y * (9 * up / (4 * vp)), y, y * ((12 - 3 * up - 20 * vp) / (4 * vp)) ]; + }, + formats: { + color: { + id: '--luv', + coords: [ ' | ', ' | [-1,1]', ' | [-1,1]' ] } } - _createClass(Color, [ { - key: 'space', - get: function get() { - return _classPrivateFieldGet(this, _space); + }); + var LCHuv = new ColorSpace({ + id: 'lchuv', + name: 'LChuv', + coords: { + l: { + refRange: [ 0, 100 ], + name: 'Lightness' + }, + c: { + refRange: [ 0, 220 ], + name: 'Chroma' + }, + h: { + refRange: [ 0, 360 ], + type: 'angle', + name: 'Hue' } - }, { - key: 'spaceId', - get: function get() { - return _classPrivateFieldGet(this, _space).id; + }, + base: Luv, + fromBase: function fromBase(Luv2) { + var _Luv2 = _slicedToArray(Luv2, 3), L = _Luv2[0], u = _Luv2[1], v = _Luv2[2]; + var hue; + var \u03b52 = .02; + if (Math.abs(u) < \u03b52 && Math.abs(v) < \u03b52) { + hue = NaN; + } else { + hue = Math.atan2(v, u) * 180 / Math.PI; } - }, { - key: 'clone', - value: function clone() { - return new Color(this.space, this.coords, this.alpha); + return [ L, Math.sqrt(Math.pow(u, 2) + Math.pow(v, 2)), constrain(hue) ]; + }, + toBase: function toBase(LCH) { + var _LCH2 = _slicedToArray(LCH, 3), Lightness = _LCH2[0], Chroma = _LCH2[1], Hue = _LCH2[2]; + if (Chroma < 0) { + Chroma = 0; } - }, { - key: 'toJSON', - value: function toJSON() { - return { - spaceId: this.spaceId, - coords: this.coords, - alpha: this.alpha - }; + if (isNaN(Hue)) { + Hue = 0; } - }, { - key: 'display', - value: function display() { - for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { - args[_key4] = arguments[_key4]; - } - var ret = _display.apply(void 0, [ this ].concat(args)); - ret.color = new Color(ret.color); - return ret; + return [ Lightness, Chroma * Math.cos(Hue * Math.PI / 180), Chroma * Math.sin(Hue * Math.PI / 180) ]; + }, + formats: { + color: { + id: '--lchuv', + coords: [ ' | ', ' | ', ' | ' ] } - } ], [ { - key: 'get', - value: function get(color) { - if (color instanceof Color) { - return color; - } - for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { - args[_key5 - 1] = arguments[_key5]; - } - return _construct(Color, [ color ].concat(args)); + } + }); + var \u03b5$1 = 216 / 24389; + var \u03ba = 24389 / 27; + var m_r0 = fromXYZ_M$3[0][0]; + var m_r1 = fromXYZ_M$3[0][1]; + var m_r2 = fromXYZ_M$3[0][2]; + var m_g0 = fromXYZ_M$3[1][0]; + var m_g1 = fromXYZ_M$3[1][1]; + var m_g2 = fromXYZ_M$3[1][2]; + var m_b0 = fromXYZ_M$3[2][0]; + var m_b1 = fromXYZ_M$3[2][1]; + var m_b2 = fromXYZ_M$3[2][2]; + function distanceFromOriginAngle(slope, intercept, angle) { + var d2 = intercept / (Math.sin(angle) - slope * Math.cos(angle)); + return d2 < 0 ? Infinity : d2; + } + function calculateBoundingLines(l) { + var sub1 = Math.pow(l + 16, 3) / 1560896; + var sub2 = sub1 > \u03b5$1 ? sub1 : l / \u03ba; + var s1r = sub2 * (284517 * m_r0 - 94839 * m_r2); + var s2r = sub2 * (838422 * m_r2 + 769860 * m_r1 + 731718 * m_r0); + var s3r = sub2 * (632260 * m_r2 - 126452 * m_r1); + var s1g = sub2 * (284517 * m_g0 - 94839 * m_g2); + var s2g = sub2 * (838422 * m_g2 + 769860 * m_g1 + 731718 * m_g0); + var s3g = sub2 * (632260 * m_g2 - 126452 * m_g1); + var s1b = sub2 * (284517 * m_b0 - 94839 * m_b2); + var s2b = sub2 * (838422 * m_b2 + 769860 * m_b1 + 731718 * m_b0); + var s3b = sub2 * (632260 * m_b2 - 126452 * m_b1); + return { + r0s: s1r / s3r, + r0i: s2r * l / s3r, + r1s: s1r / (s3r + 126452), + r1i: (s2r - 769860) * l / (s3r + 126452), + g0s: s1g / s3g, + g0i: s2g * l / s3g, + g1s: s1g / (s3g + 126452), + g1i: (s2g - 769860) * l / (s3g + 126452), + b0s: s1b / s3b, + b0i: s2b * l / s3b, + b1s: s1b / (s3b + 126452), + b1i: (s2b - 769860) * l / (s3b + 126452) + }; + } + function calcMaxChromaHsluv(lines, h) { + var hueRad = h / 360 * Math.PI * 2; + var r0 = distanceFromOriginAngle(lines.r0s, lines.r0i, hueRad); + var r1 = distanceFromOriginAngle(lines.r1s, lines.r1i, hueRad); + var g0 = distanceFromOriginAngle(lines.g0s, lines.g0i, hueRad); + var g1 = distanceFromOriginAngle(lines.g1s, lines.g1i, hueRad); + var b0 = distanceFromOriginAngle(lines.b0s, lines.b0i, hueRad); + var b1 = distanceFromOriginAngle(lines.b1s, lines.b1i, hueRad); + return Math.min(r0, r1, g0, g1, b0, b1); + } + var hsluv = new ColorSpace({ + id: 'hsluv', + name: 'HSLuv', + coords: { + h: { + refRange: [ 0, 360 ], + type: 'angle', + name: 'Hue' + }, + s: { + range: [ 0, 100 ], + name: 'Saturation' + }, + l: { + range: [ 0, 100 ], + name: 'Lightness' } - }, { - key: 'defineFunction', - value: function defineFunction(name, code) { - var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : code; - var _o$instance = o.instance, instance = _o$instance === void 0 ? true : _o$instance, returns = o.returns; - var func = function func() { - var ret = code.apply(void 0, arguments); - if (returns === 'color') { - ret = Color.get(ret); - } else if (returns === 'function') { - var f = ret; - ret = function ret() { - var ret2 = f.apply(void 0, arguments); - return Color.get(ret2); - }; - Object.assign(ret, f); - } else if (returns === 'array') { - ret = ret.map(function(c4) { - return Color.get(c4); - }); - } - return ret; - }; - if (!(name in Color)) { - Color[name] = func; - } - if (instance) { - Color.prototype[name] = function() { - for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { - args[_key6] = arguments[_key6]; - } - return func.apply(void 0, [ this ].concat(args)); - }; - } + }, + base: LCHuv, + gamutSpace: sRGB, + fromBase: function fromBase(lch2) { + var _ref68 = [ skipNone(lch2[0]), skipNone(lch2[1]), skipNone(lch2[2]) ], l = _ref68[0], c4 = _ref68[1], h = _ref68[2]; + var s; + if (l > 99.9999999) { + s = 0; + l = 100; + } else if (l < 1e-8) { + s = 0; + l = 0; + } else { + var lines = calculateBoundingLines(l); + var max2 = calcMaxChromaHsluv(lines, h); + s = c4 / max2 * 100; } - }, { - key: 'defineFunctions', - value: function defineFunctions(o) { - for (var name in o) { - Color.defineFunction(name, o[name], o[name]); - } + return [ h, s, l ]; + }, + toBase: function toBase(hsl) { + var _ref69 = [ skipNone(hsl[0]), skipNone(hsl[1]), skipNone(hsl[2]) ], h = _ref69[0], s = _ref69[1], l = _ref69[2]; + var c4; + if (l > 99.9999999) { + l = 100; + c4 = 0; + } else if (l < 1e-8) { + l = 0; + c4 = 0; + } else { + var lines = calculateBoundingLines(l); + var max2 = calcMaxChromaHsluv(lines, h); + c4 = max2 / 100 * s; } - }, { - key: 'extend', - value: function extend(exports) { - if (exports.register) { - exports.register(Color); - } else { - for (var name in exports) { - Color.defineFunction(name, exports[name]); - } - } + return [ l, c4, h ]; + }, + formats: { + color: { + id: '--hsluv', + coords: [ ' | ', ' | ', ' | ' ] } - } ]); - return Color; - }()); - Color.defineFunctions({ - get: get, - getAll: getAll, - set: set, - setAll: setAll, - to: to, - equals: equals, - inGamut: inGamut, - toGamut: toGamut, - distance: distance, - toString: serialize + } }); - Object.assign(Color, { - util: util, - hooks: hooks, - WHITES: WHITES, - Space: ColorSpace, - spaces: ColorSpace.registry, - parse: parse2, - defaults: defaults + fromXYZ_M$3[0][0]; + fromXYZ_M$3[0][1]; + fromXYZ_M$3[0][2]; + fromXYZ_M$3[1][0]; + fromXYZ_M$3[1][1]; + fromXYZ_M$3[1][2]; + fromXYZ_M$3[2][0]; + fromXYZ_M$3[2][1]; + fromXYZ_M$3[2][2]; + function distanceFromOrigin(slope, intercept) { + return Math.abs(intercept) / Math.sqrt(Math.pow(slope, 2) + 1); + } + function calcMaxChromaHpluv(lines) { + var r0 = distanceFromOrigin(lines.r0s, lines.r0i); + var r1 = distanceFromOrigin(lines.r1s, lines.r1i); + var g0 = distanceFromOrigin(lines.g0s, lines.g0i); + var g1 = distanceFromOrigin(lines.g1s, lines.g1i); + var b0 = distanceFromOrigin(lines.b0s, lines.b0i); + var b1 = distanceFromOrigin(lines.b1s, lines.b1i); + return Math.min(r0, r1, g0, g1, b0, b1); + } + var hpluv = new ColorSpace({ + id: 'hpluv', + name: 'HPLuv', + coords: { + h: { + refRange: [ 0, 360 ], + type: 'angle', + name: 'Hue' + }, + s: { + range: [ 0, 100 ], + name: 'Saturation' + }, + l: { + range: [ 0, 100 ], + name: 'Lightness' + } + }, + base: LCHuv, + gamutSpace: 'self', + fromBase: function fromBase(lch2) { + var _ref70 = [ skipNone(lch2[0]), skipNone(lch2[1]), skipNone(lch2[2]) ], l = _ref70[0], c4 = _ref70[1], h = _ref70[2]; + var s; + if (l > 99.9999999) { + s = 0; + l = 100; + } else if (l < 1e-8) { + s = 0; + l = 0; + } else { + var lines = calculateBoundingLines(l); + var max2 = calcMaxChromaHpluv(lines); + s = c4 / max2 * 100; + } + return [ h, s, l ]; + }, + toBase: function toBase(hsl) { + var _ref71 = [ skipNone(hsl[0]), skipNone(hsl[1]), skipNone(hsl[2]) ], h = _ref71[0], s = _ref71[1], l = _ref71[2]; + var c4; + if (l > 99.9999999) { + l = 100; + c4 = 0; + } else if (l < 1e-8) { + l = 0; + c4 = 0; + } else { + var lines = calculateBoundingLines(l); + var max2 = calcMaxChromaHpluv(lines); + c4 = max2 / 100 * s; + } + return [ l, c4, h ]; + }, + formats: { + color: { + id: '--hpluv', + coords: [ ' | ', ' | ', ' | ' ] + } + } }); - for (var _i18 = 0, _Object$keys2 = Object.keys(spaces); _i18 < _Object$keys2.length; _i18++) { - var key = _Object$keys2[_i18]; - ColorSpace.register(spaces[key]); - } - for (var id in ColorSpace.registry) { - addSpaceAccessors(id, ColorSpace.registry[id]); - } - hooks.add('colorspace-init-end', function(space) { - var _space$aliases; - addSpaceAccessors(space.id, space); - (_space$aliases = space.aliases) === null || _space$aliases === void 0 ? void 0 : _space$aliases.forEach(function(alias) { - addSpaceAccessors(alias, space); - }); - }); - function addSpaceAccessors(id, space) { - Object.keys(space.coords); - Object.values(space.coords).map(function(c4) { - return c4.name; - }); - var propId = id.replace(/-/g, '_'); - Object.defineProperty(Color.prototype, propId, { - get: function get() { - var _this3 = this; - var ret = this.getAll(id); - if (typeof Proxy === 'undefined') { - return ret; - } - return new Proxy(ret, { - has: function has(obj, property) { - try { - ColorSpace.resolveCoord([ space, property ]); - return true; - } catch (e) {} - return Reflect.has(obj, property); - }, - get: function get(obj, property, receiver) { - if (property && _typeof(property) !== 'symbol' && !(property in obj)) { - var _ColorSpace$resolveCo3 = ColorSpace.resolveCoord([ space, property ]), index = _ColorSpace$resolveCo3.index; - if (index >= 0) { - return obj[index]; - } - } - return Reflect.get(obj, property, receiver); - }, - set: function set(obj, property, value, receiver) { - if (property && _typeof(property) !== 'symbol' && !(property in obj) || property >= 0) { - var _ColorSpace$resolveCo4 = ColorSpace.resolveCoord([ space, property ]), index = _ColorSpace$resolveCo4.index; - if (index >= 0) { - obj[index] = value; - _this3.setAll(id, obj); - return true; - } - } - return Reflect.set(obj, property, value, receiver); - } - }); - }, - set: function set(coords) { - this.setAll(id, coords); - }, - configurable: true, - enumerable: true - }); - } - Color.extend(deltaEMethods); - Color.extend({ - deltaE: deltaE - }); - Color.extend(variations); - Color.extend({ - contrast: contrast - }); - Color.extend(chromaticity); - Color.extend(luminance); - Color.extend(interpolation); - Color.extend(contrastMethods); - import_dot['default'].templateSettings.strip = false; - var hexRegex = /^#[0-9a-f]{3,8}$/i; - var hslRegex = /hsl\(\s*([\d.]+)(rad|turn)/; - var Color2 = function() { - function Color2(red, green, blue) { - var alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; - _classCallCheck(this, Color2); - this.red = red; - this.green = green; - this.blue = blue; - this.alpha = alpha; + var Yw = 203; + var n = 2610 / Math.pow(2, 14); + var ninv = Math.pow(2, 14) / 2610; + var m = 2523 / Math.pow(2, 5); + var minv = Math.pow(2, 5) / 2523; + var c1 = 3424 / Math.pow(2, 12); + var c2 = 2413 / Math.pow(2, 7); + var c3 = 2392 / Math.pow(2, 7); + var rec2100Pq = new RGBColorSpace({ + id: 'rec2100pq', + cssId: 'rec2100-pq', + name: 'REC.2100-PQ', + base: REC2020Linear, + toBase: function toBase(RGB) { + return RGB.map(function(val) { + var x = Math.pow(Math.max(Math.pow(val, minv) - c1, 0) / (c2 - c3 * Math.pow(val, minv)), ninv); + return x * 1e4 / Yw; + }); + }, + fromBase: function fromBase(RGB) { + return RGB.map(function(val) { + var x = Math.max(val * Yw / 1e4, 0); + var num = c1 + c2 * Math.pow(x, n); + var denom = 1 + c3 * Math.pow(x, n); + return Math.pow(num / denom, m); + }); } - _createClass(Color2, [ { - key: 'toHexString', - value: function toHexString() { - var redString = Math.round(this.red).toString(16); - var greenString = Math.round(this.green).toString(16); - var blueString = Math.round(this.blue).toString(16); - return '#' + (this.red > 15.5 ? redString : '0' + redString) + (this.green > 15.5 ? greenString : '0' + greenString) + (this.blue > 15.5 ? blueString : '0' + blueString); - } - }, { - key: 'toJSON', - value: function toJSON() { - var red = this.red, green = this.green, blue = this.blue, alpha = this.alpha; - return { - red: red, - green: green, - blue: blue, - alpha: alpha - }; - } - }, { - key: 'parseString', - value: function parseString(colorString) { - colorString = colorString.replace(hslRegex, function(match, angle, unit) { - var value = angle + unit; - switch (unit) { - case 'rad': - return match.replace(value, radToDeg(angle)); - - case 'turn': - return match.replace(value, turnToDeg(angle)); - } - }); - try { - var _color2 = new Color(colorString).to('srgb'); - this.red = Math.round(clamp(_color2.r, 0, 1) * 255); - this.green = Math.round(clamp(_color2.g, 0, 1) * 255); - this.blue = Math.round(clamp(_color2.b, 0, 1) * 255); - this.alpha = +_color2.alpha; - } catch (err2) { - throw new Error('Unable to parse color "'.concat(colorString, '"')); + }); + var a = .17883277; + var b = .28466892; + var c = .55991073; + var scale = 3.7743; + var rec2100Hlg = new RGBColorSpace({ + id: 'rec2100hlg', + cssId: 'rec2100-hlg', + name: 'REC.2100-HLG', + referred: 'scene', + base: REC2020Linear, + toBase: function toBase(RGB) { + return RGB.map(function(val) { + if (val <= .5) { + return Math.pow(val, 2) / 3 * scale; } - return this; - } - }, { - key: 'parseRgbString', - value: function parseRgbString(colorString) { - this.parseString(colorString); - } - }, { - key: 'parseHexString', - value: function parseHexString(colorString) { - if (!colorString.match(hexRegex) || [ 6, 8 ].includes(colorString.length)) { - return; + return (Math.exp((val - c) / a) + b) / 12 * scale; + }); + }, + fromBase: function fromBase(RGB) { + return RGB.map(function(val) { + val /= scale; + if (val <= 1 / 12) { + return Math.sqrt(3 * val); } - this.parseString(colorString); - } - }, { - key: 'parseColorFnString', - value: function parseColorFnString(colorString) { - this.parseString(colorString); - } - }, { - key: 'getRelativeLuminance', - value: function getRelativeLuminance() { - var rSRGB = this.red / 255; - var gSRGB = this.green / 255; - var bSRGB = this.blue / 255; - var r = rSRGB <= .03928 ? rSRGB / 12.92 : Math.pow((rSRGB + .055) / 1.055, 2.4); - var g2 = gSRGB <= .03928 ? gSRGB / 12.92 : Math.pow((gSRGB + .055) / 1.055, 2.4); - var b2 = bSRGB <= .03928 ? bSRGB / 12.92 : Math.pow((bSRGB + .055) / 1.055, 2.4); - return .2126 * r + .7152 * g2 + .0722 * b2; - } - } ]); - return Color2; - }(); - var color_default = Color2; - function clamp(value, min, max2) { - return Math.min(Math.max(min, value), max2); - } - function radToDeg(rad) { - return rad * 180 / Math.PI; - } - function turnToDeg(turn) { - return turn * 360; - } - function getOwnBackgroundColor(elmStyle) { - var bgColor = new color_default(); - bgColor.parseString(elmStyle.getPropertyValue('background-color')); - if (bgColor.alpha !== 0) { - var opacity = elmStyle.getPropertyValue('opacity'); - bgColor.alpha = bgColor.alpha * opacity; - } - return bgColor; - } - var get_own_background_color_default = getOwnBackgroundColor; - function isOpaque(node) { - var style = window.getComputedStyle(node); - return element_has_image_default(node, style) || get_own_background_color_default(style).alpha === 1; - } - var is_opaque_default = isOpaque; - function _isSkipLink(element) { - if (!element.href) { - return false; - } - var firstPageLink = cache_default.get('firstPageLink', generateFirstPageLink); - if (!firstPageLink) { - return true; - } - return element.compareDocumentPosition(firstPageLink.actualNode) === element.DOCUMENT_POSITION_FOLLOWING; - } - function generateFirstPageLink() { - var firstPageLink; - if (!window.location.origin) { - firstPageLink = query_selector_all_default(axe._tree, 'a:not([href^="#"]):not([href^="/#"]):not([href^="javascript:"])')[0]; - } else { - firstPageLink = query_selector_all_default(axe._tree, 'a[href]:not([href^="javascript:"])').find(function(link) { - return !_isCurrentPageLink(link.actualNode); + return a * Math.log(12 * val - b) + c; }); } - return firstPageLink || null; - } - var clipRegex2 = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/; - var clipPathRegex2 = /(\w+)\((\d+)/; - function isClipped(style) { - var matchesClip = style.getPropertyValue('clip').match(clipRegex2); - var matchesClipPath = style.getPropertyValue('clip-path').match(clipPathRegex2); - if (matchesClip && matchesClip.length === 5) { - var position = style.getPropertyValue('position'); - if ([ 'fixed', 'absolute' ].includes(position)) { - return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0; - } + }); + var CATs = {}; + hooks.add('chromatic-adaptation-start', function(env) { + if (env.options.method) { + env.M = adapt(env.W1, env.W2, env.options.method); } - if (matchesClipPath) { - var type2 = matchesClipPath[1]; - var value = parseInt(matchesClipPath[2], 10); - switch (type2) { - case 'inset': - return value >= 50; - - case 'circle': - return value === 0; - - default: - } + }); + hooks.add('chromatic-adaptation-end', function(env) { + if (!env.M) { + env.M = adapt(env.W1, env.W2, env.options.method); } - return false; + }); + function defineCAT(_ref72) { + var id = _ref72.id, toCone_M = _ref72.toCone_M, fromCone_M = _ref72.fromCone_M; + CATs[id] = arguments[0]; } - function isAreaVisible(el, screenReader, recursed) { - var mapEl = find_up_default(el, 'map'); - if (!mapEl) { - return false; - } - var mapElName = mapEl.getAttribute('name'); - if (!mapElName) { - return false; - } - var mapElRootNode = get_root_node_default2(el); - if (!mapElRootNode || mapElRootNode.nodeType !== 9) { - return false; - } - var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]')); - if (!refs || !refs.length) { - return false; - } - return refs.some(function(_ref63) { - var actualNode = _ref63.actualNode; - return isVisible(actualNode, screenReader, recursed); - }); + function adapt(W1, W2) { + var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Bradford'; + var method = CATs[id]; + var _multiplyMatrices5 = multiplyMatrices(method.toCone_M, W1), _multiplyMatrices6 = _slicedToArray(_multiplyMatrices5, 3), \u03c1s = _multiplyMatrices6[0], \u03b3s = _multiplyMatrices6[1], \u03b2s = _multiplyMatrices6[2]; + var _multiplyMatrices7 = multiplyMatrices(method.toCone_M, W2), _multiplyMatrices8 = _slicedToArray(_multiplyMatrices7, 3), \u03c1d = _multiplyMatrices8[0], \u03b3d = _multiplyMatrices8[1], \u03b2d = _multiplyMatrices8[2]; + var scale2 = [ [ \u03c1d / \u03c1s, 0, 0 ], [ 0, \u03b3d / \u03b3s, 0 ], [ 0, 0, \u03b2d / \u03b2s ] ]; + var scaled_cone_M = multiplyMatrices(scale2, method.toCone_M); + var adapt_M = multiplyMatrices(method.fromCone_M, scaled_cone_M); + return adapt_M; } - function isVisible(el, screenReader, recursed) { - var _window$Node2; - if (!el) { - throw new TypeError('Cannot determine if element is visible for non-DOM nodes'); - } - var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el); - el = vNode ? vNode.actualNode : el; - var cacheName = '_isVisible' + (screenReader ? 'ScreenReader' : ''); - var _ref64 = (_window$Node2 = window.Node) !== null && _window$Node2 !== void 0 ? _window$Node2 : {}, DOCUMENT_NODE = _ref64.DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE = _ref64.DOCUMENT_FRAGMENT_NODE; - var nodeType = vNode ? vNode.props.nodeType : el.nodeType; - var nodeName2 = vNode ? vNode.props.nodeName : el.nodeName.toLowerCase(); - if (vNode && typeof vNode[cacheName] !== 'undefined') { - return vNode[cacheName]; - } - if (nodeType === DOCUMENT_NODE) { - return true; - } - if ([ 'style', 'script', 'noscript', 'template' ].includes(nodeName2)) { - return false; - } - if (el && nodeType === DOCUMENT_FRAGMENT_NODE) { - el = el.host; - } - if (screenReader) { - var ariaHiddenValue = vNode ? vNode.attr('aria-hidden') : el.getAttribute('aria-hidden'); - if (ariaHiddenValue === 'true') { - return false; - } - } - if (!el) { - var parent2 = vNode.parent; - var visible3 = true; - if (parent2) { - visible3 = isVisible(parent2, screenReader, true); + defineCAT({ + id: 'von Kries', + toCone_M: [ [ .40024, .7076, -.08081 ], [ -.2263, 1.16532, .0457 ], [ 0, 0, .91822 ] ], + fromCone_M: [ [ 1.8599363874558397, -1.1293816185800916, .21989740959619328 ], [ .3611914362417676, .6388124632850422, -6370596838649899e-21 ], [ 0, 0, 1.0890636230968613 ] ] + }); + defineCAT({ + id: 'Bradford', + toCone_M: [ [ .8951, .2664, -.1614 ], [ -.7502, 1.7135, .0367 ], [ .0389, -.0685, 1.0296 ] ], + fromCone_M: [ [ .9869929054667121, -.14705425642099013, .15996265166373122 ], [ .4323052697233945, .5183602715367774, .049291228212855594 ], [ -.00852866457517732, .04004282165408486, .96848669578755 ] ] + }); + defineCAT({ + id: 'CAT02', + toCone_M: [ [ .7328, .4296, -.1624 ], [ -.7036, 1.6975, .0061 ], [ .003, .0136, .9834 ] ], + fromCone_M: [ [ 1.0961238208355142, -.27886900021828726, .18274517938277307 ], [ .4543690419753592, .4735331543074117, .07209780371722911 ], [ -.009627608738429355, -.00569803121611342, 1.0153256399545427 ] ] + }); + defineCAT({ + id: 'CAT16', + toCone_M: [ [ .401288, .650173, -.051461 ], [ -.250268, 1.204414, .045854 ], [ -.002079, .048952, .953127 ] ], + fromCone_M: [ [ 1.862067855087233, -1.0112546305316845, .14918677544445172 ], [ .3875265432361372, .6214474419314753, -.008973985167612521 ], [ -.01584149884933386, -.03412293802851557, 1.0499644368778496 ] ] + }); + Object.assign(WHITES, { + A: [ 1.0985, 1, .35585 ], + C: [ .98074, 1, 1.18232 ], + D55: [ .95682, 1, .92149 ], + D75: [ .94972, 1, 1.22638 ], + E: [ 1, 1, 1 ], + F2: [ .99186, 1, .67393 ], + F7: [ .95041, 1, 1.08747 ], + F11: [ 1.00962, 1, .6435 ] + }); + WHITES.ACES = [ .32168 / .33767, 1, (1 - .32168 - .33767) / .33767 ]; + var toXYZ_M = [ [ .6624541811085053, .13400420645643313, .1561876870049078 ], [ .27222871678091454, .6740817658111484, .05368951740793705 ], [ -.005574649490394108, .004060733528982826, 1.0103391003129971 ] ]; + var fromXYZ_M = [ [ 1.6410233796943257, -.32480329418479, -.23642469523761225 ], [ -.6636628587229829, 1.6153315916573379, .016756347685530137 ], [ .011721894328375376, -.008284441996237409, .9883948585390215 ] ]; + var ACEScg = new RGBColorSpace({ + id: 'acescg', + cssId: '--acescg', + name: 'ACEScg', + coords: { + r: { + range: [ 0, 65504 ], + name: 'Red' + }, + g: { + range: [ 0, 65504 ], + name: 'Green' + }, + b: { + range: [ 0, 65504 ], + name: 'Blue' } - if (vNode) { - vNode[cacheName] = visible3; + }, + referred: 'scene', + white: WHITES.ACES, + toXYZ_M: toXYZ_M, + fromXYZ_M: fromXYZ_M + }); + var \u03b5 = Math.pow(2, -16); + var ACES_min_nonzero = -.35828683; + var ACES_cc_max = (Math.log2(65504) + 9.72) / 17.52; + var acescc = new RGBColorSpace({ + id: 'acescc', + cssId: '--acescc', + name: 'ACEScc', + coords: { + r: { + range: [ ACES_min_nonzero, ACES_cc_max ], + name: 'Red' + }, + g: { + range: [ ACES_min_nonzero, ACES_cc_max ], + name: 'Green' + }, + b: { + range: [ ACES_min_nonzero, ACES_cc_max ], + name: 'Blue' } - return visible3; - } - var style = window.getComputedStyle(el, null); - if (style === null) { - return false; - } - if (nodeName2 === 'area') { - return isAreaVisible(el, screenReader, recursed); - } - if (style.getPropertyValue('display') === 'none') { - return false; - } - var elHeight = parseInt(style.getPropertyValue('height')); - var elWidth = parseInt(style.getPropertyValue('width')); - var scroll = get_scroll_default(el); - var scrollableWithZeroHeight = scroll && elHeight === 0; - var scrollableWithZeroWidth = scroll && elWidth === 0; - var posAbsoluteOverflowHiddenAndSmall = style.getPropertyValue('position') === 'absolute' && (elHeight < 2 || elWidth < 2) && style.getPropertyValue('overflow') === 'hidden'; - if (!screenReader && (isClipped(style) || style.getPropertyValue('opacity') === '0' || scrollableWithZeroHeight || scrollableWithZeroWidth || posAbsoluteOverflowHiddenAndSmall)) { - return false; - } - if (!recursed && (style.getPropertyValue('visibility') === 'hidden' || !screenReader && is_offscreen_default(el))) { - return false; - } - var parent = el.assignedSlot ? el.assignedSlot : el.parentNode; - var visible2 = false; - if (parent) { - visible2 = isVisible(parent, screenReader, true); - } - if (vNode) { - vNode[cacheName] = visible2; + }, + referred: 'scene', + base: ACEScg, + toBase: function toBase(RGB) { + var low = (9.72 - 15) / 17.52; + return RGB.map(function(val) { + if (val <= low) { + return (Math.pow(2, val * 17.52 - 9.72) - \u03b5) * 2; + } else if (val < ACES_cc_max) { + return Math.pow(2, val * 17.52 - 9.72); + } else { + return 65504; + } + }); + }, + fromBase: function fromBase(RGB) { + return RGB.map(function(val) { + if (val <= 0) { + return (Math.log2(\u03b5) + 9.72) / 17.52; + } else if (val < \u03b5) { + return (Math.log2(\u03b5 + val * .5) + 9.72) / 17.52; + } else { + return (Math.log2(val) + 9.72) / 17.52; + } + }); } - return visible2; - } - var is_visible_default = isVisible; - function reduceToElementsBelowFloating(elements, targetNode) { - var floatingPositions = [ 'fixed', 'sticky' ]; - var finalElements = []; - var targetFound = false; - for (var index = 0; index < elements.length; ++index) { - var currentNode = elements[index]; - if (currentNode === targetNode) { - targetFound = true; + }); + var spaces = Object.freeze({ + __proto__: null, + A98RGB: a98rgb, + A98RGB_Linear: A98Linear, + ACEScc: acescc, + ACEScg: ACEScg, + CAM16_JMh: cam16, + HCT: hct, + HPLuv: hpluv, + HSL: HSL, + HSLuv: hsluv, + HSV: HSV, + HWB: hwb, + ICTCP: ictcp, + JzCzHz: jzczhz, + Jzazbz: Jzazbz, + LCH: lch, + LCHuv: LCHuv, + Lab: lab, + Lab_D65: lab_d65, + Luv: Luv, + OKLCH: oklch, + OKLab: OKLab, + P3: P3, + P3_Linear: P3Linear, + ProPhoto: prophoto, + ProPhoto_Linear: ProPhotoLinear, + REC_2020: REC2020, + REC_2020_Linear: REC2020Linear, + REC_2100_HLG: rec2100Hlg, + REC_2100_PQ: rec2100Pq, + XYZ_ABS_D65: XYZ_Abs_D65, + XYZ_D50: XYZ_D50, + XYZ_D65: xyz_d65, + sRGB: sRGB, + sRGB_Linear: sRGBLinear + }); + var Color = function() { + function Color() { + var _this2 = this; + _classCallCheck(this, Color); + var color; + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; } - var style = window.getComputedStyle(currentNode); - if (!targetFound && floatingPositions.indexOf(style.position) !== -1) { - finalElements = []; - continue; + if (args.length === 1) { + color = getColor(args[0]); } - finalElements.push(currentNode); - } - return finalElements; - } - var reduce_to_elements_below_floating_default = reduceToElementsBelowFloating; - function _visuallyContains(node, parent) { - var parentScrollAncestor = getScrollAncestor(parent); - do { - var nextScrollAncestor = getScrollAncestor(node); - if (nextScrollAncestor === parentScrollAncestor || nextScrollAncestor === parent) { - return contains2(node, parent); + var space, coords, alpha; + if (color) { + space = color.space || color.spaceId; + coords = color.coords; + alpha = color.alpha; + } else { + space = args[0]; + coords = args[1]; + alpha = args[2]; } - node = nextScrollAncestor; - } while (node); - return false; - } - function getScrollAncestor(node) { - var vNode = get_node_from_tree_default(node); - var ancestor = vNode.parent; - while (ancestor) { - if (get_scroll_default(ancestor.actualNode)) { - return ancestor.actualNode; - } - ancestor = ancestor.parent; - } - } - function contains2(node, parent) { - var style = window.getComputedStyle(parent); - var overflow = style.getPropertyValue('overflow'); - if (style.getPropertyValue('display') === 'inline') { - return true; - } - var clientRects = Array.from(node.getClientRects()); - var boundingRect = parent.getBoundingClientRect(); - var rect = { - left: boundingRect.left, - top: boundingRect.top, - width: boundingRect.width, - height: boundingRect.height - }; - if ([ 'scroll', 'auto' ].includes(overflow) || parent instanceof window.HTMLHtmlElement) { - rect.width = parent.scrollWidth; - rect.height = parent.scrollHeight; - } - if (clientRects.length === 1 && overflow === 'hidden' && style.getPropertyValue('white-space') === 'nowrap') { - clientRects[0] = rect; - } - return clientRects.some(function(clientRect) { - return !(Math.ceil(clientRect.left) < Math.floor(rect.left) || Math.ceil(clientRect.top) < Math.floor(rect.top) || Math.floor(clientRect.left + clientRect.width) > Math.ceil(rect.left + rect.width) || Math.floor(clientRect.top + clientRect.height) > Math.ceil(rect.top + rect.height)); - }); - } - function shadowElementsFromPoint(nodeX, nodeY) { - var root = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document; - var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - if (i > 999) { - throw new Error('Infinite loop detected'); - } - return Array.from(root.elementsFromPoint(nodeX, nodeY) || []).filter(function(nodes) { - return get_root_node_default2(nodes) === root; - }).reduce(function(stack, elm) { - if (is_shadow_root_default(elm)) { - var shadowStack = shadowElementsFromPoint(nodeX, nodeY, elm.shadowRoot, i + 1); - stack = stack.concat(shadowStack); - if (stack.length && _visuallyContains(stack[0], elm)) { - stack.push(elm); + Object.defineProperty(this, 'space', { + value: ColorSpace.get(space), + writable: false, + enumerable: true, + configurable: true + }); + this.coords = coords ? coords.slice() : [ 0, 0, 0 ]; + this.alpha = alpha > 1 || alpha === void 0 ? 1 : alpha < 0 ? 0 : alpha; + for (var _i17 = 0; _i17 < this.coords.length; _i17++) { + if (this.coords[_i17] === 'NaN') { + this.coords[_i17] = NaN; } - } else { - stack.push(elm); } - return stack; - }, []); - } - var shadow_elements_from_point_default = shadowElementsFromPoint; - function urlPropsFromAttribute(node, attribute) { - if (!node.hasAttribute(attribute)) { - return void 0; - } - var nodeName2 = node.nodeName.toUpperCase(); - var parser2 = node; - if (![ 'A', 'AREA' ].includes(nodeName2) || node.ownerSVGElement) { - parser2 = document.createElement('a'); - parser2.href = node.getAttribute(attribute); - } - var protocol = [ 'https:', 'ftps:' ].includes(parser2.protocol) ? parser2.protocol.replace(/s:$/, ':') : parser2.protocol; - var parserPathname = /^\//.test(parser2.pathname) ? parser2.pathname : '/'.concat(parser2.pathname); - var _getPathnameOrFilenam = getPathnameOrFilename(parserPathname), pathname = _getPathnameOrFilenam.pathname, filename = _getPathnameOrFilenam.filename; - return { - protocol: protocol, - hostname: parser2.hostname, - port: getPort(parser2.port), - pathname: /\/$/.test(pathname) ? pathname : ''.concat(pathname, '/'), - search: getSearchPairs(parser2.search), - hash: getHashRoute(parser2.hash), - filename: filename - }; - } - function getPort(port) { - var excludePorts = [ '443', '80' ]; - return !excludePorts.includes(port) ? port : ''; - } - function getPathnameOrFilename(pathname) { - var filename = pathname.split('/').pop(); - if (!filename || filename.indexOf('.') === -1) { - return { - pathname: pathname, - filename: '' + var _loop5 = function _loop5(id) { + Object.defineProperty(_this2, id, { + get: function get() { + return _this2.get(id); + }, + set: function set(value) { + return _this2.set(id, value); + } + }); }; - } - return { - pathname: pathname.replace(filename, ''), - filename: /index./.test(filename) ? '' : filename - }; - } - function getSearchPairs(searchStr) { - var query = {}; - if (!searchStr || !searchStr.length) { - return query; - } - var pairs = searchStr.substring(1).split('&'); - if (!pairs || !pairs.length) { - return query; - } - for (var index = 0; index < pairs.length; index++) { - var pair = pairs[index]; - var _pair$split = pair.split('='), _pair$split2 = _slicedToArray(_pair$split, 2), _key7 = _pair$split2[0], _pair$split2$ = _pair$split2[1], value = _pair$split2$ === void 0 ? '' : _pair$split2$; - query[decodeURIComponent(_key7)] = decodeURIComponent(value); - } - return query; - } - function getHashRoute(hash) { - if (!hash) { - return ''; - } - var hashRegex = /#!?\/?/g; - var hasMatch = hash.match(hashRegex); - if (!hasMatch) { - return ''; - } - var _hasMatch = _slicedToArray(hasMatch, 1), matchedStr = _hasMatch[0]; - if (matchedStr === '#') { - return ''; - } - return hash; - } - var url_props_from_attribute_default = urlPropsFromAttribute; - function visuallyOverlaps(rect, parent) { - var parentRect = parent.getBoundingClientRect(); - var parentTop = parentRect.top; - var parentLeft = parentRect.left; - var parentScrollArea = { - top: parentTop - parent.scrollTop, - bottom: parentTop - parent.scrollTop + parent.scrollHeight, - left: parentLeft - parent.scrollLeft, - right: parentLeft - parent.scrollLeft + parent.scrollWidth - }; - if (rect.left > parentScrollArea.right && rect.left > parentRect.right || rect.top > parentScrollArea.bottom && rect.top > parentRect.bottom || rect.right < parentScrollArea.left && rect.right < parentRect.left || rect.bottom < parentScrollArea.top && rect.bottom < parentRect.top) { - return false; - } - var style = window.getComputedStyle(parent); - if (rect.left > parentRect.right || rect.top > parentRect.bottom) { - return style.overflow === 'scroll' || style.overflow === 'auto' || parent instanceof window.HTMLBodyElement || parent instanceof window.HTMLHtmlElement; - } - return true; - } - var visually_overlaps_default = visuallyOverlaps; - var nodeIndex2 = 0; - var VirtualNode = function(_abstract_virtual_nod) { - _inherits(VirtualNode, _abstract_virtual_nod); - var _super2 = _createSuper(VirtualNode); - function VirtualNode(node, parent, shadowId) { - var _this4; - _classCallCheck(this, VirtualNode); - _this4 = _super2.call(this); - _this4.shadowId = shadowId; - _this4.children = []; - _this4.actualNode = node; - _this4.parent = parent; - if (!parent) { - nodeIndex2 = 0; - } - _this4.nodeIndex = nodeIndex2++; - _this4._isHidden = null; - _this4._cache = {}; - _this4._isXHTML = is_xhtml_default(node.ownerDocument); - if (node.nodeName.toLowerCase() === 'input') { - var type2 = node.getAttribute('type'); - type2 = _this4._isXHTML ? type2 : (type2 || '').toLowerCase(); - if (!valid_input_type_default().includes(type2)) { - type2 = 'text'; - } - _this4._type = type2; + for (var id in this.space.coords) { + _loop5(id); } - if (cache_default.get('nodeMap')) { - cache_default.get('nodeMap').set(node, _assertThisInitialized(_this4)); - } - return _this4; } - _createClass(VirtualNode, [ { - key: 'props', + _createClass(Color, [ { + key: 'spaceId', get: function get() { - if (!this._cache.hasOwnProperty('props')) { - var _this$actualNode = this.actualNode, nodeType = _this$actualNode.nodeType, nodeName2 = _this$actualNode.nodeName, _id = _this$actualNode.id, multiple = _this$actualNode.multiple, nodeValue = _this$actualNode.nodeValue, value = _this$actualNode.value, selected = _this$actualNode.selected, checked = _this$actualNode.checked, indeterminate = _this$actualNode.indeterminate; - this._cache.props = { - nodeType: nodeType, - nodeName: this._isXHTML ? nodeName2 : nodeName2.toLowerCase(), - id: _id, - type: this._type, - multiple: multiple, - nodeValue: nodeValue, - value: value, - selected: selected, - checked: checked, - indeterminate: indeterminate - }; - } - return this._cache.props; + return this.space.id; } }, { - key: 'attr', - value: function attr(attrName) { - if (typeof this.actualNode.getAttribute !== 'function') { - return null; - } - return this.actualNode.getAttribute(attrName); + key: 'clone', + value: function clone() { + return new Color(this.space, this.coords, this.alpha); } }, { - key: 'hasAttr', - value: function hasAttr(attrName) { - if (typeof this.actualNode.hasAttribute !== 'function') { - return false; - } - return this.actualNode.hasAttribute(attrName); + key: 'toJSON', + value: function toJSON() { + return { + spaceId: this.spaceId, + coords: this.coords, + alpha: this.alpha + }; } }, { - key: 'attrNames', - get: function get() { - if (!this._cache.hasOwnProperty('attrNames')) { - var attrs; - if (this.actualNode.attributes instanceof window.NamedNodeMap) { - attrs = this.actualNode.attributes; - } else { - attrs = this.actualNode.cloneNode(false).attributes; - } - this._cache.attrNames = Array.from(attrs).map(function(attr) { - return attr.name; - }); + key: 'display', + value: function display() { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; } - return this._cache.attrNames; + var ret = _display.apply(void 0, [ this ].concat(args)); + ret.color = new Color(ret.color); + return ret; + } + } ], [ { + key: 'get', + value: function get(color) { + if (color instanceof Color) { + return color; + } + for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { + args[_key5 - 1] = arguments[_key5]; + } + return _construct(Color, [ color ].concat(args)); } }, { - key: 'getComputedStylePropertyValue', - value: function getComputedStylePropertyValue(property) { - var key = 'computedStyle_' + property; - if (!this._cache.hasOwnProperty(key)) { - if (!this._cache.hasOwnProperty('computedStyle')) { - this._cache.computedStyle = window.getComputedStyle(this.actualNode); + key: 'defineFunction', + value: function defineFunction(name, code) { + var o = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : code; + var _o$instance = o.instance, instance = _o$instance === void 0 ? true : _o$instance, returns = o.returns; + var func = function func() { + var ret = code.apply(void 0, arguments); + if (returns === 'color') { + ret = Color.get(ret); + } else if (returns === 'function') { + var f = ret; + ret = function ret() { + var ret2 = f.apply(void 0, arguments); + return Color.get(ret2); + }; + Object.assign(ret, f); + } else if (returns === 'array') { + ret = ret.map(function(c4) { + return Color.get(c4); + }); } - this._cache[key] = this._cache.computedStyle.getPropertyValue(property); - } - return this._cache[key]; - } - }, { - key: 'isFocusable', - get: function get() { - if (!this._cache.hasOwnProperty('isFocusable')) { - this._cache.isFocusable = _isFocusable(this.actualNode); + return ret; + }; + if (!(name in Color)) { + Color[name] = func; } - return this._cache.isFocusable; - } - }, { - key: 'tabbableElements', - get: function get() { - if (!this._cache.hasOwnProperty('tabbableElements')) { - this._cache.tabbableElements = get_tabbable_elements_default(this); + if (instance) { + Color.prototype[name] = function() { + for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { + args[_key6] = arguments[_key6]; + } + return func.apply(void 0, [ this ].concat(args)); + }; } - return this._cache.tabbableElements; } }, { - key: 'clientRects', - get: function get() { - if (!this._cache.hasOwnProperty('clientRects')) { - this._cache.clientRects = Array.from(this.actualNode.getClientRects()).filter(function(rect) { - return rect.width > 0; - }); + key: 'defineFunctions', + value: function defineFunctions(o) { + for (var name in o) { + Color.defineFunction(name, o[name], o[name]); } - return this._cache.clientRects; } }, { - key: 'boundingClientRect', - get: function get() { - if (!this._cache.hasOwnProperty('boundingClientRect')) { - this._cache.boundingClientRect = this.actualNode.getBoundingClientRect(); + key: 'extend', + value: function extend(exports) { + if (exports.register) { + exports.register(Color); + } else { + for (var name in exports) { + Color.defineFunction(name, exports[name]); + } } - return this._cache.boundingClientRect; } } ]); - return VirtualNode; - }(abstract_virtual_node_default); - var virtual_node_default = VirtualNode; - function tokenList(str) { - return (str || '').trim().replace(/\s{2,}/g, ' ').split(' '); + return Color; + }(); + Color.defineFunctions({ + get: get, + getAll: getAll, + set: set, + setAll: setAll, + to: to, + equals: equals, + inGamut: inGamut, + toGamut: toGamut, + distance: distance, + toString: serialize + }); + Object.assign(Color, { + util: util, + hooks: hooks, + WHITES: WHITES, + Space: ColorSpace, + spaces: ColorSpace.registry, + parse: parse2, + defaults: defaults + }); + for (var _i18 = 0, _Object$keys2 = Object.keys(spaces); _i18 < _Object$keys2.length; _i18++) { + var key = _Object$keys2[_i18]; + ColorSpace.register(spaces[key]); } - var token_list_default = tokenList; - var idsKey = ' [idsMap]'; - function getNodesMatchingExpression(domTree, expressions, filter) { - var selectorMap = domTree[0]._selectorMap; - if (!selectorMap) { - return; - } - var shadowId = domTree[0].shadowId; - for (var _i19 = 0; _i19 < expressions.length; _i19++) { - if (expressions[_i19].length > 1 && expressions[_i19].some(function(expression) { - return isGlobalSelector(expression); - })) { - return; - } - } - var nodeSet = new Set(); - expressions.forEach(function(expression) { - var _matchingNodes$nodes; - var matchingNodes = findMatchingNodes(expression, selectorMap, shadowId); - matchingNodes === null || matchingNodes === void 0 ? void 0 : (_matchingNodes$nodes = matchingNodes.nodes) === null || _matchingNodes$nodes === void 0 ? void 0 : _matchingNodes$nodes.forEach(function(node) { - if (matchingNodes.isComplexSelector && !_matchesExpression(node, expression)) { - return; - } - nodeSet.add(node); - }); - }); - var matchedNodes = []; - nodeSet.forEach(function(node) { - return matchedNodes.push(node); - }); - if (filter) { - matchedNodes = matchedNodes.filter(filter); - } - return matchedNodes.sort(function(a2, b2) { - return a2.nodeIndex - b2.nodeIndex; - }); + for (var id in ColorSpace.registry) { + addSpaceAccessors(id, ColorSpace.registry[id]); } - function findMatchingNodes(expression, selectorMap, shadowId) { - var exp = expression[expression.length - 1]; - var nodes = null; - var isComplexSelector = expression.length > 1 || !!exp.pseudos || !!exp.classes; - if (isGlobalSelector(exp)) { - nodes = selectorMap['*']; - } else { - if (exp.id) { - var _selectorMap$idsKey$e; - if (!selectorMap[idsKey] || !Object.hasOwn(selectorMap[idsKey], exp.id) || !((_selectorMap$idsKey$e = selectorMap[idsKey][exp.id]) !== null && _selectorMap$idsKey$e !== void 0 && _selectorMap$idsKey$e.length)) { - return; - } - nodes = selectorMap[idsKey][exp.id].filter(function(node) { - return node.shadowId === shadowId; - }); - } - if (exp.tag && exp.tag !== '*') { - var _selectorMap$exp$tag; - if (!((_selectorMap$exp$tag = selectorMap[exp.tag]) !== null && _selectorMap$exp$tag !== void 0 && _selectorMap$exp$tag.length)) { - return; - } - var cachedNodes = selectorMap[exp.tag]; - nodes = nodes ? getSharedValues(cachedNodes, nodes) : cachedNodes; - } - if (exp.classes) { - var _selectorMap$Class; - if (!((_selectorMap$Class = selectorMap['[class]']) !== null && _selectorMap$Class !== void 0 && _selectorMap$Class.length)) { - return; + hooks.add('colorspace-init-end', function(space) { + var _space$aliases; + addSpaceAccessors(space.id, space); + (_space$aliases = space.aliases) === null || _space$aliases === void 0 || _space$aliases.forEach(function(alias) { + addSpaceAccessors(alias, space); + }); + }); + function addSpaceAccessors(id, space) { + var propId = id.replace(/-/g, '_'); + Object.defineProperty(Color.prototype, propId, { + get: function get() { + var _this3 = this; + var ret = this.getAll(id); + if (typeof Proxy === 'undefined') { + return ret; } - var _cachedNodes = selectorMap['[class]']; - nodes = nodes ? getSharedValues(_cachedNodes, nodes) : _cachedNodes; - } - if (exp.attributes) { - for (var _i20 = 0; _i20 < exp.attributes.length; _i20++) { - var _selectorMap; - var attr = exp.attributes[_i20]; - if (attr.type === 'attrValue') { - isComplexSelector = true; - } - if (!((_selectorMap = selectorMap['['.concat(attr.key, ']')]) !== null && _selectorMap !== void 0 && _selectorMap.length)) { - return; + return new Proxy(ret, { + has: function has(obj, property) { + try { + ColorSpace.resolveCoord([ space, property ]); + return true; + } catch (e) {} + return Reflect.has(obj, property); + }, + get: function get(obj, property, receiver) { + if (property && _typeof(property) !== 'symbol' && !(property in obj)) { + var _ColorSpace$resolveCo3 = ColorSpace.resolveCoord([ space, property ]), index = _ColorSpace$resolveCo3.index; + if (index >= 0) { + return obj[index]; + } + } + return Reflect.get(obj, property, receiver); + }, + set: function set(obj, property, value, receiver) { + if (property && _typeof(property) !== 'symbol' && !(property in obj) || property >= 0) { + var _ColorSpace$resolveCo4 = ColorSpace.resolveCoord([ space, property ]), index = _ColorSpace$resolveCo4.index; + if (index >= 0) { + obj[index] = value; + _this3.setAll(id, obj); + return true; + } + } + return Reflect.set(obj, property, value, receiver); } - var _cachedNodes2 = selectorMap['['.concat(attr.key, ']')]; - nodes = nodes ? getSharedValues(_cachedNodes2, nodes) : _cachedNodes2; - } - } - } - return { - nodes: nodes, - isComplexSelector: isComplexSelector - }; - } - function isGlobalSelector(expression) { - return expression.tag === '*' && !expression.attributes && !expression.id && !expression.classes; - } - function getSharedValues(a2, b2) { - return a2.filter(function(node) { - return b2.includes(node); + }); + }, + set: function set(coords) { + this.setAll(id, coords); + }, + configurable: true, + enumerable: true }); } - function cacheSelector(key, vNode, map) { - if (!Object.hasOwn(map, key)) { - map[key] = []; - } - map[key].push(vNode); - } - function cacheNodeSelectors(vNode, selectorMap) { - if (vNode.props.nodeType !== 1) { - return; - } - cacheSelector(vNode.props.nodeName, vNode, selectorMap); - cacheSelector('*', vNode, selectorMap); - vNode.attrNames.forEach(function(attrName) { - if (attrName === 'id') { - selectorMap[idsKey] = selectorMap[idsKey] || {}; - token_list_default(vNode.attr(attrName)).forEach(function(value) { - cacheSelector(value, vNode, selectorMap[idsKey]); - }); + Color.extend(deltaEMethods); + Color.extend({ + deltaE: deltaE + }); + Object.assign(Color, { + deltaEMethods: deltaEMethods + }); + Color.extend(variations); + Color.extend({ + contrast: contrast + }); + Color.extend(chromaticity); + Color.extend(luminance); + Color.extend(interpolation); + Color.extend(contrastMethods); + import_dot['default'].templateSettings.strip = false; + var hexRegex = /^#[0-9a-f]{3,8}$/i; + var Color2 = (_r = new WeakMap(), _g = new WeakMap(), _b = new WeakMap(), _red = new WeakMap(), + _green = new WeakMap(), _blue = new WeakMap(), _add = new WeakSet(), function() { + function Color2(red, green, blue) { + var alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + _classCallCheck(this, Color2); + _classPrivateMethodInitSpec(this, _add); + _classPrivateFieldInitSpec(this, _r, { + writable: true, + value: void 0 + }); + _classPrivateFieldInitSpec(this, _g, { + writable: true, + value: void 0 + }); + _classPrivateFieldInitSpec(this, _b, { + writable: true, + value: void 0 + }); + _classPrivateFieldInitSpec(this, _red, { + writable: true, + value: void 0 + }); + _classPrivateFieldInitSpec(this, _green, { + writable: true, + value: void 0 + }); + _classPrivateFieldInitSpec(this, _blue, { + writable: true, + value: void 0 + }); + if (red instanceof Color2) { + var r = red.r, g2 = red.g, b2 = red.b; + this.r = r; + this.g = g2; + this.b = b2; + this.alpha = red.alpha; + return; } - cacheSelector('['.concat(attrName, ']'), vNode, selectorMap); - }); - } - var hasShadowRoot; - function _getFlattenedTree() { - var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement; - var shadowId = arguments.length > 1 ? arguments[1] : undefined; - hasShadowRoot = false; - var selectorMap = {}; - cache_default.set('nodeMap', new WeakMap()); - cache_default.set('selectorMap', selectorMap); - var tree = flattenTree(node, shadowId, null); - tree[0]._selectorMap = selectorMap; - tree[0]._hasShadowRoot = hasShadowRoot; - return tree; - } - function getSlotChildren(node) { - var retVal = []; - node = node.firstChild; - while (node) { - retVal.push(node); - node = node.nextSibling; + this.red = red; + this.green = green; + this.blue = blue; + this.alpha = alpha; } - return retVal; - } - function createNode(node, parent, shadowId) { - var vNode = new virtual_node_default(node, parent, shadowId); - cacheNodeSelectors(vNode, cache_default.get('selectorMap')); - return vNode; - } - function flattenTree(node, shadowId, parent) { - var retVal, realArray, nodeName2; - function reduceShadowDOM(res, child, parentVNode) { - var replacements = flattenTree(child, shadowId, parentVNode); - if (replacements) { - res = res.concat(replacements); + _createClass(Color2, [ { + key: 'r', + get: function get() { + return _classPrivateFieldGet(this, _r); + }, + set: function set(value) { + _classPrivateFieldSet(this, _r, value); + _classPrivateFieldSet(this, _red, Math.round(clamp2(value, 0, 1) * 255)); } - return res; - } - if (node.documentElement) { - node = node.documentElement; - } - nodeName2 = node.nodeName.toLowerCase(); - if (is_shadow_root_default(node)) { - hasShadowRoot = true; - retVal = createNode(node, parent, shadowId); - shadowId = 'a' + Math.random().toString().substring(2); - realArray = Array.from(node.shadowRoot.childNodes); - retVal.children = realArray.reduce(function(res, child) { - return reduceShadowDOM(res, child, retVal); - }, []); - return [ retVal ]; - } else { - if (nodeName2 === 'content' && typeof node.getDistributedNodes === 'function') { - realArray = Array.from(node.getDistributedNodes()); - return realArray.reduce(function(res, child) { - return reduceShadowDOM(res, child, parent); - }, []); - } else if (nodeName2 === 'slot' && typeof node.assignedNodes === 'function') { - realArray = Array.from(node.assignedNodes()); - if (!realArray.length) { - realArray = getSlotChildren(node); + }, { + key: 'g', + get: function get() { + return _classPrivateFieldGet(this, _g); + }, + set: function set(value) { + _classPrivateFieldSet(this, _g, value); + _classPrivateFieldSet(this, _green, Math.round(clamp2(value, 0, 1) * 255)); + } + }, { + key: 'b', + get: function get() { + return _classPrivateFieldGet(this, _b); + }, + set: function set(value) { + _classPrivateFieldSet(this, _b, value); + _classPrivateFieldSet(this, _blue, Math.round(clamp2(value, 0, 1) * 255)); + } + }, { + key: 'red', + get: function get() { + return _classPrivateFieldGet(this, _red); + }, + set: function set(value) { + _classPrivateFieldSet(this, _r, value / 255); + _classPrivateFieldSet(this, _red, clamp2(value, 0, 255)); + } + }, { + key: 'green', + get: function get() { + return _classPrivateFieldGet(this, _green); + }, + set: function set(value) { + _classPrivateFieldSet(this, _g, value / 255); + _classPrivateFieldSet(this, _green, clamp2(value, 0, 255)); + } + }, { + key: 'blue', + get: function get() { + return _classPrivateFieldGet(this, _blue); + }, + set: function set(value) { + _classPrivateFieldSet(this, _b, value / 255); + _classPrivateFieldSet(this, _blue, clamp2(value, 0, 255)); + } + }, { + key: 'toHexString', + value: function toHexString() { + var redString = Math.round(this.red).toString(16); + var greenString = Math.round(this.green).toString(16); + var blueString = Math.round(this.blue).toString(16); + return '#' + (this.red > 15.5 ? redString : '0' + redString) + (this.green > 15.5 ? greenString : '0' + greenString) + (this.blue > 15.5 ? blueString : '0' + blueString); + } + }, { + key: 'toJSON', + value: function toJSON() { + var red = this.red, green = this.green, blue = this.blue, alpha = this.alpha; + return { + red: red, + green: green, + blue: blue, + alpha: alpha + }; + } + }, { + key: 'parseString', + value: function parseString(colorString) { + try { + var _color3 = new Color(colorString).to('srgb'); + this.r = _color3.r; + this.g = _color3.g; + this.b = _color3.b; + this.alpha = +_color3.alpha; + } catch (err2) { + throw new Error('Unable to parse color "'.concat(colorString, '"')); } - var styl = window.getComputedStyle(node); - if (false) { - retVal = createNode(node, parent, shadowId); - retVal.children = realArray.reduce(function(res, child) { - return reduceShadowDOM(res, child, retVal); - }, []); - return [ retVal ]; - } else { - return realArray.reduce(function(res, child) { - return reduceShadowDOM(res, child, parent); - }, []); + return this; + } + }, { + key: 'parseRgbString', + value: function parseRgbString(colorString) { + this.parseString(colorString); + } + }, { + key: 'parseHexString', + value: function parseHexString(colorString) { + if (!colorString.match(hexRegex) || [ 6, 8 ].includes(colorString.length)) { + return; } - } else { - if (node.nodeType === 1) { - retVal = createNode(node, parent, shadowId); - realArray = Array.from(node.childNodes); - retVal.children = realArray.reduce(function(res, child) { - return reduceShadowDOM(res, child, retVal); - }, []); - return [ retVal ]; - } else if (node.nodeType === 3) { - return [ createNode(node, parent) ]; + this.parseString(colorString); + } + }, { + key: 'parseColorFnString', + value: function parseColorFnString(colorString) { + this.parseString(colorString); + } + }, { + key: 'getRelativeLuminance', + value: function getRelativeLuminance() { + var rSRGB = this.r, gSRGB = this.g, bSRGB = this.b; + var r = rSRGB <= .03928 ? rSRGB / 12.92 : Math.pow((rSRGB + .055) / 1.055, 2.4); + var g2 = gSRGB <= .03928 ? gSRGB / 12.92 : Math.pow((gSRGB + .055) / 1.055, 2.4); + var b2 = bSRGB <= .03928 ? bSRGB / 12.92 : Math.pow((bSRGB + .055) / 1.055, 2.4); + return .2126 * r + .7152 * g2 + .0722 * b2; + } + }, { + key: 'getLuminosity', + value: function getLuminosity() { + return .3 * this.r + .59 * this.g + .11 * this.b; + } + }, { + key: 'setLuminosity', + value: function setLuminosity(L) { + var d2 = L - this.getLuminosity(); + return _classPrivateMethodGet(this, _add, _add2).call(this, d2).clip(); + } + }, { + key: 'getSaturation', + value: function getSaturation() { + return Math.max(this.r, this.g, this.b) - Math.min(this.r, this.g, this.b); + } + }, { + key: 'setSaturation', + value: function setSaturation(s) { + var C = new Color2(this); + var colorEntires = [ { + name: 'r', + value: C.r + }, { + name: 'g', + value: C.g + }, { + name: 'b', + value: C.b + } ]; + var _colorEntires$sort = colorEntires.sort(function(a2, b2) { + return a2.value - b2.value; + }), _colorEntires$sort2 = _slicedToArray(_colorEntires$sort, 3), Cmin = _colorEntires$sort2[0], Cmid = _colorEntires$sort2[1], Cmax = _colorEntires$sort2[2]; + if (Cmax.value > Cmin.value) { + Cmid.value = (Cmid.value - Cmin.value) * s / (Cmax.value - Cmin.value); + Cmax.value = s; + } else { + Cmid.value = Cmax.value = 0; } - return void 0; + Cmin.value = 0; + C[Cmax.name] = Cmax.value; + C[Cmin.name] = Cmin.value; + C[Cmid.name] = Cmid.value; + return C; } - } + }, { + key: 'clip', + value: function clip() { + var C = new Color2(this); + var L = C.getLuminosity(); + var n2 = Math.min(C.r, C.g, C.b); + var x = Math.max(C.r, C.g, C.b); + if (n2 < 0) { + C.r = L + (C.r - L) * L / (L - n2); + C.g = L + (C.g - L) * L / (L - n2); + C.b = L + (C.b - L) * L / (L - n2); + } + if (x > 1) { + C.r = L + (C.r - L) * (1 - L) / (x - L); + C.g = L + (C.g - L) * (1 - L) / (x - L); + C.b = L + (C.b - L) * (1 - L) / (x - L); + } + return C; + } + } ]); + return Color2; + }()); + function _add2(value) { + var C = new Color2(this); + C.r += value; + C.g += value; + C.b += value; + return C; } - function getBaseLang(lang) { - if (!lang) { - return ''; + var color_default = Color2; + function clamp2(value, min, max2) { + return Math.min(Math.max(min, value), max2); + } + function getOwnBackgroundColor(elmStyle) { + var bgColor = new color_default(); + bgColor.parseString(elmStyle.getPropertyValue('background-color')); + if (bgColor.alpha !== 0) { + var opacity = elmStyle.getPropertyValue('opacity'); + bgColor.alpha = bgColor.alpha * opacity; } - return lang.trim().split('-')[0].toLowerCase(); + return bgColor; } - var get_base_lang_default = getBaseLang; - function failureSummary(nodeData) { - var failingChecks = {}; - failingChecks.none = nodeData.none.concat(nodeData.all); - failingChecks.any = nodeData.any; - return Object.keys(failingChecks).map(function(key) { - if (!failingChecks[key].length) { - return; - } - var sum = axe._audit.data.failureSummaries[key]; - if (sum && typeof sum.failureMessage === 'function') { - return sum.failureMessage(failingChecks[key].map(function(check) { - return check.message || ''; - })); - } - }).filter(function(i) { - return i !== void 0; - }).join('\n\n'); + var get_own_background_color_default = getOwnBackgroundColor; + function isOpaque(node) { + var style = window.getComputedStyle(node); + return element_has_image_default(node, style) || get_own_background_color_default(style).alpha === 1; } - var failure_summary_default = failureSummary; - function incompleteFallbackMessage() { - var message = axe._audit.data.incompleteFallbackMessage; - if (typeof message === 'function') { - message = message(); + var is_opaque_default = isOpaque; + function _isSkipLink(element) { + if (!element.href) { + return false; } - if (typeof message !== 'string') { - return ''; + var firstPageLink = cache_default.get('firstPageLink', generateFirstPageLink); + if (!firstPageLink) { + return true; } - return message; + return element.compareDocumentPosition(firstPageLink.actualNode) === element.DOCUMENT_POSITION_FOLLOWING; } - var resultKeys = constants_default.resultGroups; - function processAggregate(results, options) { - var resultObject = axe.utils.aggregateResult(results); - resultKeys.forEach(function(key) { - if (options.resultTypes && !options.resultTypes.includes(key)) { - (resultObject[key] || []).forEach(function(ruleResult) { - if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) { - ruleResult.nodes = [ ruleResult.nodes[0] ]; - } - }); - } - resultObject[key] = (resultObject[key] || []).map(function(ruleResult) { - ruleResult = Object.assign({}, ruleResult); - if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) { - ruleResult.nodes = ruleResult.nodes.map(function(subResult) { - if (_typeof(subResult.node) === 'object') { - var serialElm = trimElementSpec(subResult.node, options); - Object.assign(subResult, serialElm); - } - delete subResult.result; - delete subResult.node; - normalizeRelatedNodes(subResult, options); - return subResult; - }); - } - resultKeys.forEach(function(resultKey) { - return delete ruleResult[resultKey]; - }); - delete ruleResult.pageLevel; - delete ruleResult.result; - return ruleResult; + function generateFirstPageLink() { + var firstPageLink; + if (!window.location.origin) { + firstPageLink = query_selector_all_default(axe._tree, 'a:not([href^="#"]):not([href^="/#"]):not([href^="javascript:"])')[0]; + } else { + firstPageLink = query_selector_all_default(axe._tree, 'a[href]:not([href^="javascript:"])').find(function(link) { + return !_isCurrentPageLink(link.actualNode); }); - }); - return resultObject; + } + return firstPageLink || null; } - function normalizeRelatedNodes(node, options) { - [ 'any', 'all', 'none' ].forEach(function(type2) { - if (!Array.isArray(node[type2])) { - return; + var clipRegex2 = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/; + var clipPathRegex2 = /(\w+)\((\d+)/; + function isClipped(style) { + var matchesClip = style.getPropertyValue('clip').match(clipRegex2); + var matchesClipPath = style.getPropertyValue('clip-path').match(clipPathRegex2); + if (matchesClip && matchesClip.length === 5) { + var position = style.getPropertyValue('position'); + if ([ 'fixed', 'absolute' ].includes(position)) { + return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0; } - node[type2].filter(function(checkRes) { - return Array.isArray(checkRes.relatedNodes); - }).forEach(function(checkRes) { - checkRes.relatedNodes = checkRes.relatedNodes.map(function(relatedNode) { - return trimElementSpec(relatedNode, options); - }); - }); - }); - } - function trimElementSpec() { - var elmSpec = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var runOptions = arguments.length > 1 ? arguments[1] : undefined; - elmSpec = node_serializer_default.dqElmToSpec(elmSpec, runOptions); - var serialElm = {}; - if (axe._audit.noHtml) { - serialElm.html = null; - } else { - var _elmSpec$source; - serialElm.html = (_elmSpec$source = elmSpec.source) !== null && _elmSpec$source !== void 0 ? _elmSpec$source : 'Undefined'; - } - if (runOptions.elementRef && !elmSpec.fromFrame) { - var _elmSpec$element; - serialElm.element = (_elmSpec$element = elmSpec.element) !== null && _elmSpec$element !== void 0 ? _elmSpec$element : null; - } - if (runOptions.selectors !== false || elmSpec.fromFrame) { - var _elmSpec$selector; - serialElm.target = (_elmSpec$selector = elmSpec.selector) !== null && _elmSpec$selector !== void 0 ? _elmSpec$selector : [ ':root' ]; - } - if (runOptions.ancestry) { - var _elmSpec$ancestry; - serialElm.ancestry = (_elmSpec$ancestry = elmSpec.ancestry) !== null && _elmSpec$ancestry !== void 0 ? _elmSpec$ancestry : [ ':root' ]; } - if (runOptions.xpath) { - var _elmSpec$xpath; - serialElm.xpath = (_elmSpec$xpath = elmSpec.xpath) !== null && _elmSpec$xpath !== void 0 ? _elmSpec$xpath : [ '/' ]; + if (matchesClipPath) { + var type2 = matchesClipPath[1]; + var value = parseInt(matchesClipPath[2], 10); + switch (type2) { + case 'inset': + return value >= 50; + + case 'circle': + return value === 0; + + default: + } } - return serialElm; + return false; } - var dataRegex = /\$\{\s?data\s?\}/g; - function substitute(str, data) { - if (typeof data === 'string') { - return str.replace(dataRegex, data); + function isAreaVisible(el, screenReader, recursed) { + var mapEl = find_up_default(el, 'map'); + if (!mapEl) { + return false; } - for (var prop in data) { - if (data.hasOwnProperty(prop)) { - var regex = new RegExp('\\${\\s?data\\.' + prop + '\\s?}', 'g'); - var replace = typeof data[prop] === 'undefined' ? '' : String(data[prop]); - str = str.replace(regex, replace); - } + var mapElName = mapEl.getAttribute('name'); + if (!mapElName) { + return false; } - return str; - } - function processMessage(message, data) { - if (!message) { - return; + var mapElRootNode = get_root_node_default2(el); + if (!mapElRootNode || mapElRootNode.nodeType !== 9) { + return false; } - if (Array.isArray(data)) { - data.values = data.join(', '); - if (typeof message.singular === 'string' && typeof message.plural === 'string') { - var str2 = data.length === 1 ? message.singular : message.plural; - return substitute(str2, data); - } - return substitute(message, data); + var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]')); + if (!refs || !refs.length) { + return false; } - if (typeof message === 'string') { - return substitute(message, data); + return refs.some(function(_ref73) { + var actualNode = _ref73.actualNode; + return isVisible(actualNode, screenReader, recursed); + }); + } + function isVisible(el, screenReader, recursed) { + var _window$Node2; + if (!el) { + throw new TypeError('Cannot determine if element is visible for non-DOM nodes'); } - if (typeof data === 'string') { - var _str = message[data]; - return substitute(_str, data); + var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el); + el = vNode ? vNode.actualNode : el; + var cacheName = '_isVisible' + (screenReader ? 'ScreenReader' : ''); + var _ref74 = (_window$Node2 = window.Node) !== null && _window$Node2 !== void 0 ? _window$Node2 : {}, DOCUMENT_NODE = _ref74.DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE = _ref74.DOCUMENT_FRAGMENT_NODE; + var nodeType = vNode ? vNode.props.nodeType : el.nodeType; + var nodeName2 = vNode ? vNode.props.nodeName : el.nodeName.toLowerCase(); + if (vNode && typeof vNode[cacheName] !== 'undefined') { + return vNode[cacheName]; } - var str = message['default'] || incompleteFallbackMessage(); - if (data && data.messageKey && message[data.messageKey]) { - str = message[data.messageKey]; + if (nodeType === DOCUMENT_NODE) { + return true; } - return processMessage(str, data); - } - var process_message_default = processMessage; - function getCheckMessage(checkId, type2, data) { - var check = axe._audit.data.checks[checkId]; - if (!check) { - throw new Error('Cannot get message for unknown check: '.concat(checkId, '.')); + if ([ 'style', 'script', 'noscript', 'template' ].includes(nodeName2)) { + return false; } - if (!check.messages[type2]) { - throw new Error('Check "'.concat(checkId, '"" does not have a "').concat(type2, '" message.')); + if (el && nodeType === DOCUMENT_FRAGMENT_NODE) { + el = el.host; } - return process_message_default(check.messages[type2], data); - } - var get_check_message_default = getCheckMessage; - function getCheckOption(check, ruleID, options) { - var ruleCheckOption = ((options.rules && options.rules[ruleID] || {}).checks || {})[check.id]; - var checkOption = (options.checks || {})[check.id]; - var enabled = check.enabled; - var opts = check.options; - if (checkOption) { - if (checkOption.hasOwnProperty('enabled')) { - enabled = checkOption.enabled; - } - if (checkOption.hasOwnProperty('options')) { - opts = checkOption.options; + if (screenReader) { + var ariaHiddenValue = vNode ? vNode.attr('aria-hidden') : el.getAttribute('aria-hidden'); + if (ariaHiddenValue === 'true') { + return false; } } - if (ruleCheckOption) { - if (ruleCheckOption.hasOwnProperty('enabled')) { - enabled = ruleCheckOption.enabled; + if (!el) { + var parent2 = vNode.parent; + var visible3 = true; + if (parent2) { + visible3 = isVisible(parent2, screenReader, true); } - if (ruleCheckOption.hasOwnProperty('options')) { - opts = ruleCheckOption.options; + if (vNode) { + vNode[cacheName] = visible3; } + return visible3; } - return { - enabled: enabled, - options: opts, - absolutePaths: options.absolutePaths - }; - } - var get_check_option_default = getCheckOption; - function _getEnvironmentData() { - var _win$location; - var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var win = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window; - if (metadata && _typeof(metadata) === 'object') { - return metadata; - } else if (_typeof(win) !== 'object') { - return {}; + var style = window.getComputedStyle(el, null); + if (style === null) { + return false; } - return { - testEngine: { - name: 'axe-core', - version: axe.version - }, - testRunner: { - name: axe._audit.brand - }, - testEnvironment: getTestEnvironment(win), - timestamp: new Date().toISOString(), - url: (_win$location = win.location) === null || _win$location === void 0 ? void 0 : _win$location.href - }; + if (nodeName2 === 'area') { + return isAreaVisible(el, screenReader, recursed); + } + if (style.getPropertyValue('display') === 'none') { + return false; + } + var elHeight = parseInt(style.getPropertyValue('height')); + var elWidth = parseInt(style.getPropertyValue('width')); + var scroll = get_scroll_default(el); + var scrollableWithZeroHeight = scroll && elHeight === 0; + var scrollableWithZeroWidth = scroll && elWidth === 0; + var posAbsoluteOverflowHiddenAndSmall = style.getPropertyValue('position') === 'absolute' && (elHeight < 2 || elWidth < 2) && style.getPropertyValue('overflow') === 'hidden'; + if (!screenReader && (isClipped(style) || style.getPropertyValue('opacity') === '0' || scrollableWithZeroHeight || scrollableWithZeroWidth || posAbsoluteOverflowHiddenAndSmall)) { + return false; + } + if (!recursed && (style.getPropertyValue('visibility') === 'hidden' || !screenReader && is_offscreen_default(el))) { + return false; + } + var parent = el.assignedSlot ? el.assignedSlot : el.parentNode; + var visible2 = false; + if (parent) { + visible2 = isVisible(parent, screenReader, true); + } + if (vNode) { + vNode[cacheName] = visible2; + } + return visible2; } - function getTestEnvironment(win) { - if (!win.navigator || _typeof(win.navigator) !== 'object') { - return {}; + var is_visible_default = isVisible; + function reduceToElementsBelowFloating(elements, targetNode) { + var floatingPositions = [ 'fixed', 'sticky' ]; + var finalElements = []; + var targetFound = false; + for (var index = 0; index < elements.length; ++index) { + var currentNode = elements[index]; + if (currentNode === targetNode) { + targetFound = true; + } + var style = window.getComputedStyle(currentNode); + if (!targetFound && floatingPositions.indexOf(style.position) !== -1) { + finalElements = []; + continue; + } + finalElements.push(currentNode); } - var navigator = win.navigator, innerHeight = win.innerHeight, innerWidth = win.innerWidth; - var _ref65 = getOrientation(win) || {}, angle = _ref65.angle, type2 = _ref65.type; - return { - userAgent: navigator.userAgent, - windowWidth: innerWidth, - windowHeight: innerHeight, - orientationAngle: angle, - orientationType: type2 - }; + return finalElements; } - function getOrientation(_ref66) { - var screen = _ref66.screen; - return screen.orientation || screen.msOrientation || screen.mozOrientation; + var reduce_to_elements_below_floating_default = reduceToElementsBelowFloating; + function _visuallyContains(node, parent) { + var parentScrollAncestor = getScrollAncestor(parent); + do { + var nextScrollAncestor = getScrollAncestor(node); + if (nextScrollAncestor === parentScrollAncestor || nextScrollAncestor === parent) { + return contains2(node, parent); + } + node = nextScrollAncestor; + } while (node); + return false; } - function createFrameContext(frame, _ref67) { - var focusable = _ref67.focusable, page = _ref67.page; - return { - node: frame, - include: [], - exclude: [], - initiator: false, - focusable: focusable && frameFocusable(frame), - size: getBoundingSize(frame), - page: page - }; + function getScrollAncestor(node) { + var vNode = get_node_from_tree_default(node); + var ancestor = vNode.parent; + while (ancestor) { + if (get_scroll_default(ancestor.actualNode)) { + return ancestor.actualNode; + } + ancestor = ancestor.parent; + } } - function frameFocusable(frame) { - var tabIndex = frame.getAttribute('tabindex'); - if (!tabIndex) { + function contains2(node, parent) { + var style = window.getComputedStyle(parent); + var overflow = style.getPropertyValue('overflow'); + if (style.getPropertyValue('display') === 'inline') { return true; } - var _int = parseInt(tabIndex, 10); - return isNaN(_int) || _int >= 0; + var clientRects = Array.from(node.getClientRects()); + var boundingRect = parent.getBoundingClientRect(); + var rect = { + left: boundingRect.left, + top: boundingRect.top, + width: boundingRect.width, + height: boundingRect.height + }; + if ([ 'scroll', 'auto' ].includes(overflow) || parent instanceof window.HTMLHtmlElement) { + rect.width = parent.scrollWidth; + rect.height = parent.scrollHeight; + } + if (clientRects.length === 1 && overflow === 'hidden' && style.getPropertyValue('white-space') === 'nowrap') { + clientRects[0] = rect; + } + return clientRects.some(function(clientRect) { + return !(Math.ceil(clientRect.left) < Math.floor(rect.left) || Math.ceil(clientRect.top) < Math.floor(rect.top) || Math.floor(clientRect.left + clientRect.width) > Math.ceil(rect.left + rect.width) || Math.floor(clientRect.top + clientRect.height) > Math.ceil(rect.top + rect.height)); + }); } - function getBoundingSize(domNode) { - var width = parseInt(domNode.getAttribute('width'), 10); - var height = parseInt(domNode.getAttribute('height'), 10); - if (isNaN(width) || isNaN(height)) { - var rect = domNode.getBoundingClientRect(); - width = isNaN(width) ? rect.width : width; - height = isNaN(height) ? rect.height : height; + function shadowElementsFromPoint(nodeX, nodeY) { + var root = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document; + var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + if (i > 999) { + throw new Error('Infinite loop detected'); + } + return Array.from(root.elementsFromPoint(nodeX, nodeY) || []).filter(function(nodes) { + return get_root_node_default2(nodes) === root; + }).reduce(function(stack, elm) { + if (is_shadow_root_default(elm)) { + var shadowStack = shadowElementsFromPoint(nodeX, nodeY, elm.shadowRoot, i + 1); + stack = stack.concat(shadowStack); + if (stack.length && _visuallyContains(stack[0], elm)) { + stack.push(elm); + } + } else { + stack.push(elm); + } + return stack; + }, []); + } + var shadow_elements_from_point_default = shadowElementsFromPoint; + function urlPropsFromAttribute(node, attribute) { + if (!node.hasAttribute(attribute)) { + return void 0; + } + var nodeName2 = node.nodeName.toUpperCase(); + var parser2 = node; + if (![ 'A', 'AREA' ].includes(nodeName2) || node.ownerSVGElement) { + parser2 = document.createElement('a'); + parser2.href = node.getAttribute(attribute); } + var protocol = [ 'https:', 'ftps:' ].includes(parser2.protocol) ? parser2.protocol.replace(/s:$/, ':') : parser2.protocol; + var parserPathname = /^\//.test(parser2.pathname) ? parser2.pathname : '/'.concat(parser2.pathname); + var _getPathnameOrFilenam = getPathnameOrFilename(parserPathname), pathname = _getPathnameOrFilenam.pathname, filename = _getPathnameOrFilenam.filename; return { - width: width, - height: height + protocol: protocol, + hostname: parser2.hostname, + port: getPort(parser2.port), + pathname: /\/$/.test(pathname) ? pathname : ''.concat(pathname, '/'), + search: getSearchPairs(parser2.search), + hash: getHashRoute(parser2.hash), + filename: filename }; } - function normalizeContext(contextSpec) { - if (isContextObject(contextSpec)) { - var msg = ' must be used inside include or exclude. It should not be on the same object.'; - assert2(!objectHasOwn(contextSpec, 'fromFrames'), 'fromFrames' + msg); - assert2(!objectHasOwn(contextSpec, 'fromShadowDom'), 'fromShadowDom' + msg); - } else if (isContextProp(contextSpec)) { - contextSpec = { - include: contextSpec, - exclude: [] - }; - } else { + function getPort(port) { + var excludePorts = [ '443', '80' ]; + return !excludePorts.includes(port) ? port : ''; + } + function getPathnameOrFilename(pathname) { + var filename = pathname.split('/').pop(); + if (!filename || filename.indexOf('.') === -1) { return { - include: [ document ], - exclude: [] + pathname: pathname, + filename: '' }; } - var include = normalizeContextList(contextSpec.include); - if (include.length === 0) { - include.push(document); - } - var exclude = normalizeContextList(contextSpec.exclude); return { - include: include, - exclude: exclude + pathname: pathname.replace(filename, ''), + filename: /index./.test(filename) ? '' : filename }; } - function isContextSpec(contextSpec) { - return isContextObject(contextSpec) || isContextProp(contextSpec); - } - function normalizeContextList() { - var selectorList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var normalizedList = []; - if (!isArrayLike(selectorList)) { - selectorList = [ selectorList ]; + function getSearchPairs(searchStr) { + var query = {}; + if (!searchStr || !searchStr.length) { + return query; } - for (var _i21 = 0; _i21 < selectorList.length; _i21++) { - var normalizedSelector = normalizeContextSelector(selectorList[_i21]); - if (normalizedSelector) { - normalizedList.push(normalizedSelector); - } + var pairs = searchStr.substring(1).split('&'); + if (!pairs || !pairs.length) { + return query; } - return normalizedList; + for (var index = 0; index < pairs.length; index++) { + var pair = pairs[index]; + var _pair$split = pair.split('='), _pair$split2 = _slicedToArray(_pair$split, 2), _key7 = _pair$split2[0], _pair$split2$ = _pair$split2[1], value = _pair$split2$ === void 0 ? '' : _pair$split2$; + query[decodeURIComponent(_key7)] = decodeURIComponent(value); + } + return query; } - function normalizeContextSelector(selector) { - if (selector instanceof window.Node) { - return selector; + function getHashRoute(hash) { + if (!hash) { + return ''; } - if (typeof selector === 'string') { - return [ selector ]; + var hashRegex = /#!?\/?/g; + var hasMatch = hash.match(hashRegex); + if (!hasMatch) { + return ''; } - if (isLabelledFramesSelector(selector)) { - assertLabelledFrameSelector(selector); - selector = selector.fromFrames; - } else if (isLabelledShadowDomSelector(selector)) { - selector = [ selector ]; + var _hasMatch = _slicedToArray(hasMatch, 1), matchedStr = _hasMatch[0]; + if (matchedStr === '#') { + return ''; } - return normalizeFrameSelectors(selector); + return hash; } - function normalizeFrameSelectors(frameSelectors) { - if (!Array.isArray(frameSelectors)) { - return; - } - var normalizedSelectors = []; - var _iterator11 = _createForOfIteratorHelper(frameSelectors), _step11; - try { - for (_iterator11.s(); !(_step11 = _iterator11.n()).done; ) { - var selector = _step11.value; - if (isLabelledShadowDomSelector(selector)) { - assertLabelledShadowDomSelector(selector); - selector = selector.fromShadowDom; - } - if (typeof selector !== 'string' && !isShadowSelector(selector)) { - return; - } - normalizedSelectors.push(selector); - } - } catch (err) { - _iterator11.e(err); - } finally { - _iterator11.f(); - } - return normalizedSelectors; - } - function isContextObject(contextSpec) { - return [ 'include', 'exclude' ].some(function(prop) { - return objectHasOwn(contextSpec, prop) && isContextProp(contextSpec[prop]); - }); - } - function isContextProp(contextList) { - return typeof contextList === 'string' || contextList instanceof window.Node || isLabelledFramesSelector(contextList) || isLabelledShadowDomSelector(contextList) || isArrayLike(contextList); - } - function isLabelledFramesSelector(selector) { - return objectHasOwn(selector, 'fromFrames'); - } - function isLabelledShadowDomSelector(selector) { - return objectHasOwn(selector, 'fromShadowDom'); - } - function assertLabelledFrameSelector(selector) { - assert2(Array.isArray(selector.fromFrames), 'fromFrames property must be an array'); - assert2(selector.fromFrames.every(function(fromFrameSelector) { - return !objectHasOwn(fromFrameSelector, 'fromFrames'); - }), 'Invalid context; fromFrames selector must be appended, rather than nested'); - assert2(!objectHasOwn(selector, 'fromShadowDom'), 'fromFrames and fromShadowDom cannot be used on the same object'); - } - function assertLabelledShadowDomSelector(selector) { - assert2(Array.isArray(selector.fromShadowDom), 'fromShadowDom property must be an array'); - assert2(selector.fromShadowDom.every(function(fromShadowDomSelector) { - return !objectHasOwn(fromShadowDomSelector, 'fromFrames'); - }), 'shadow selector must be inside fromFrame instead'); - assert2(selector.fromShadowDom.every(function(fromShadowDomSelector) { - return !objectHasOwn(fromShadowDomSelector, 'fromShadowDom'); - }), 'fromShadowDom selector must be appended, rather than nested'); - } - function isShadowSelector(selector) { - return Array.isArray(selector) && selector.every(function(str) { - return typeof str === 'string'; - }); - } - function isArrayLike(arr) { - return arr && _typeof(arr) === 'object' && typeof arr.length === 'number' && arr instanceof window.Node === false; - } - function assert2(bool, str) { - assert_default(bool, 'Invalid context; '.concat(str, '\nSee: https://github.com/dequelabs/axe-core/blob/master/doc/context.md')); - } - function objectHasOwn(obj, prop) { - if (!obj || _typeof(obj) !== 'object') { + var url_props_from_attribute_default = urlPropsFromAttribute; + function visuallyOverlaps(rect, parent) { + var parentRect = parent.getBoundingClientRect(); + var parentTop = parentRect.top; + var parentLeft = parentRect.left; + var parentScrollArea = { + top: parentTop - parent.scrollTop, + bottom: parentTop - parent.scrollTop + parent.scrollHeight, + left: parentLeft - parent.scrollLeft, + right: parentLeft - parent.scrollLeft + parent.scrollWidth + }; + if (rect.left > parentScrollArea.right && rect.left > parentRect.right || rect.top > parentScrollArea.bottom && rect.top > parentRect.bottom || rect.right < parentScrollArea.left && rect.right < parentRect.left || rect.bottom < parentScrollArea.top && rect.bottom < parentRect.top) { return false; } - return Object.prototype.hasOwnProperty.call(obj, prop); + var style = window.getComputedStyle(parent); + if (rect.left > parentRect.right || rect.top > parentRect.bottom) { + return style.overflow === 'scroll' || style.overflow === 'auto' || parent instanceof window.HTMLBodyElement || parent instanceof window.HTMLHtmlElement; + } + return true; } - function parseSelectorArray(context, type2) { - var result = []; - for (var _i22 = 0, l = context[type2].length; _i22 < l; _i22++) { - var item = context[type2][_i22]; - if (item instanceof window.Node) { - if (item.documentElement instanceof window.Node) { - result.push(context.flatTree[0]); - } else { - result.push(get_node_from_tree_default(item)); - } - } else if (item && item.length) { - if (item.length > 1) { - pushUniqueFrameSelector(context, type2, item); - } else { - var nodeList = _shadowSelectAll(item[0]); - result.push.apply(result, _toConsumableArray(nodeList.map(function(node) { - return get_node_from_tree_default(node); - }))); + var visually_overlaps_default = visuallyOverlaps; + var nodeIndex2 = 0; + var VirtualNode = function(_abstract_virtual_nod) { + _inherits(VirtualNode, _abstract_virtual_nod); + function VirtualNode(node, parent, shadowId) { + var _this4; + _classCallCheck(this, VirtualNode); + _this4 = _callSuper(this, VirtualNode); + _this4.shadowId = shadowId; + _this4.children = []; + _this4.actualNode = node; + _this4.parent = parent; + if (!parent) { + nodeIndex2 = 0; + } + _this4.nodeIndex = nodeIndex2++; + _this4._isHidden = null; + _this4._cache = {}; + _this4._isXHTML = is_xhtml_default(node.ownerDocument); + if (node.nodeName.toLowerCase() === 'input') { + var type2 = node.getAttribute('type'); + type2 = _this4._isXHTML ? type2 : (type2 || '').toLowerCase(); + if (!valid_input_type_default().includes(type2)) { + type2 = 'text'; } + _this4._type = type2; + } + if (cache_default.get('nodeMap')) { + cache_default.get('nodeMap').set(node, _assertThisInitialized(_this4)); } + return _this4; } - return result.filter(function(r) { - return r; - }); - } - function pushUniqueFrameSelector(context, type2, selectorArray) { - context.frames = context.frames || []; - var frameSelector = selectorArray.shift(); - var frames = _shadowSelectAll(frameSelector); - frames.forEach(function(frame) { - var frameContext = context.frames.find(function(result) { - return result.node === frame; - }); - if (!frameContext) { - frameContext = createFrameContext(frame, context); - context.frames.push(frameContext); + _createClass(VirtualNode, [ { + key: 'props', + get: function get() { + if (!this._cache.hasOwnProperty('props')) { + var _this$actualNode = this.actualNode, nodeType = _this$actualNode.nodeType, nodeName2 = _this$actualNode.nodeName, _id = _this$actualNode.id, nodeValue = _this$actualNode.nodeValue; + this._cache.props = { + nodeType: nodeType, + nodeName: this._isXHTML ? nodeName2 : nodeName2.toLowerCase(), + id: _id, + type: this._type, + nodeValue: nodeValue + }; + if (nodeType === 1) { + this._cache.props.multiple = this.actualNode.multiple; + this._cache.props.value = this.actualNode.value; + this._cache.props.selected = this.actualNode.selected; + this._cache.props.checked = this.actualNode.checked; + this._cache.props.indeterminate = this.actualNode.indeterminate; + } + } + return this._cache.props; } - frameContext[type2].push(selectorArray); - }); - } - function Context(spec, flatTree) { - var _spec, _spec2, _spec3, _spec4, _this5 = this; - spec = _clone(spec); - this.frames = []; - this.page = typeof ((_spec = spec) === null || _spec === void 0 ? void 0 : _spec.page) === 'boolean' ? spec.page : void 0; - this.initiator = typeof ((_spec2 = spec) === null || _spec2 === void 0 ? void 0 : _spec2.initiator) === 'boolean' ? spec.initiator : true; - this.focusable = typeof ((_spec3 = spec) === null || _spec3 === void 0 ? void 0 : _spec3.focusable) === 'boolean' ? spec.focusable : true; - this.size = _typeof((_spec4 = spec) === null || _spec4 === void 0 ? void 0 : _spec4.size) === 'object' ? spec.size : {}; - spec = normalizeContext(spec); - this.flatTree = flatTree !== null && flatTree !== void 0 ? flatTree : _getFlattenedTree(getRootNode2(spec)); - this.exclude = spec.exclude; - this.include = spec.include; - this.include = parseSelectorArray(this, 'include'); - this.exclude = parseSelectorArray(this, 'exclude'); - _select('frame, iframe', this).forEach(function(frame) { - if (_isNodeInContext(frame, _this5)) { - pushUniqueFrame(_this5, frame.actualNode); + }, { + key: 'attr', + value: function attr(attrName) { + if (typeof this.actualNode.getAttribute !== 'function') { + return null; + } + return this.actualNode.getAttribute(attrName); } - }); - if (typeof this.page === 'undefined') { - this.page = isPageContext(this); - this.frames.forEach(function(frame) { - frame.page = _this5.page; - }); - } - validateContext(this); - if (!Array.isArray(this.include)) { - this.include = Array.from(this.include); - } - this.include.sort(node_sorter_default); - } - function pushUniqueFrame(context, frame) { - if (!_isVisibleToScreenReaders(frame) || find_by_default(context.frames, 'node', frame)) { - return; - } - context.frames.push(createFrameContext(frame, context)); - } - function isPageContext(_ref68) { - var include = _ref68.include; - return include.length === 1 && include[0].actualNode === document.documentElement; - } - function validateContext(context) { - if (context.include.length === 0 && context.frames.length === 0) { - var env = _respondable.isInFrame() ? 'frame' : 'page'; - throw new Error('No elements found for include in ' + env + ' Context'); - } - } - function getRootNode2(_ref69) { - var include = _ref69.include, exclude = _ref69.exclude; - var selectors = Array.from(include).concat(Array.from(exclude)); - for (var _i23 = 0; _i23 < selectors.length; _i23++) { - var item = selectors[_i23]; - if (item instanceof window.Element) { - return item.ownerDocument.documentElement; + }, { + key: 'hasAttr', + value: function hasAttr(attrName) { + if (typeof this.actualNode.hasAttribute !== 'function') { + return false; + } + return this.actualNode.hasAttribute(attrName); } - if (item instanceof window.Document) { - return item.documentElement; + }, { + key: 'attrNames', + get: function get() { + if (!this._cache.hasOwnProperty('attrNames')) { + var attrs; + if (this.actualNode.attributes instanceof window.NamedNodeMap) { + attrs = this.actualNode.attributes; + } else { + attrs = this.actualNode.cloneNode(false).attributes; + } + this._cache.attrNames = Array.from(attrs).map(function(attr) { + return attr.name; + }); + } + return this._cache.attrNames; } - } - return document.documentElement; - } - function _getFrameContexts(context) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (options.iframes === false) { - return []; - } - var _Context = new Context(context), frames = _Context.frames; - return frames.map(function(_ref70) { - var node = _ref70.node, frameContext = _objectWithoutProperties(_ref70, _excluded14); - frameContext.initiator = false; - var frameSelector = _getAncestry(node); - return { - frameSelector: frameSelector, - frameContext: frameContext - }; - }); - } - function _getRule(ruleId) { - var rule = axe._audit.rules.find(function(_ref71) { - var id = _ref71.id; - return id === ruleId; - }); - if (!rule) { - throw new Error('Cannot find rule by id: '.concat(ruleId)); - } - return rule; + }, { + key: 'getComputedStylePropertyValue', + value: function getComputedStylePropertyValue(property) { + var key = 'computedStyle_' + property; + if (!this._cache.hasOwnProperty(key)) { + if (!this._cache.hasOwnProperty('computedStyle')) { + this._cache.computedStyle = window.getComputedStyle(this.actualNode); + } + this._cache[key] = this._cache.computedStyle.getPropertyValue(property); + } + return this._cache[key]; + } + }, { + key: 'isFocusable', + get: function get() { + if (!this._cache.hasOwnProperty('isFocusable')) { + this._cache.isFocusable = _isFocusable(this.actualNode); + } + return this._cache.isFocusable; + } + }, { + key: 'tabbableElements', + get: function get() { + if (!this._cache.hasOwnProperty('tabbableElements')) { + this._cache.tabbableElements = get_tabbable_elements_default(this); + } + return this._cache.tabbableElements; + } + }, { + key: 'clientRects', + get: function get() { + if (!this._cache.hasOwnProperty('clientRects')) { + this._cache.clientRects = Array.from(this.actualNode.getClientRects()).filter(function(rect) { + return rect.width > 0; + }); + } + return this._cache.clientRects; + } + }, { + key: 'boundingClientRect', + get: function get() { + if (!this._cache.hasOwnProperty('boundingClientRect')) { + this._cache.boundingClientRect = this.actualNode.getBoundingClientRect(); + } + return this._cache.boundingClientRect; + } + } ]); + return VirtualNode; + }(abstract_virtual_node_default); + var virtual_node_default = VirtualNode; + function tokenList(str) { + return (str || '').trim().replace(/\s{2,}/g, ' ').split(' '); } - function getScroll(elm) { - var buffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var overflowX = elm.scrollWidth > elm.clientWidth + buffer; - var overflowY = elm.scrollHeight > elm.clientHeight + buffer; - if (!(overflowX || overflowY)) { + var token_list_default = tokenList; + var idsKey = ' [idsMap]'; + function getNodesMatchingExpression(domTree, expressions, filter) { + var selectorMap = domTree[0]._selectorMap; + if (!selectorMap) { return; } - var style = window.getComputedStyle(elm); - var scrollableX = isScrollable(style, 'overflow-x'); - var scrollableY = isScrollable(style, 'overflow-y'); - if (overflowX && scrollableX || overflowY && scrollableY) { - return { - elm: elm, - top: elm.scrollTop, - left: elm.scrollLeft - }; + var shadowId = domTree[0].shadowId; + for (var _i19 = 0; _i19 < expressions.length; _i19++) { + if (expressions[_i19].length > 1 && expressions[_i19].some(function(expression) { + return isGlobalSelector(expression); + })) { + return; + } } + var nodeSet = new Set(); + expressions.forEach(function(expression) { + var _matchingNodes$nodes; + var matchingNodes = findMatchingNodes(expression, selectorMap, shadowId); + matchingNodes === null || matchingNodes === void 0 || (_matchingNodes$nodes = matchingNodes.nodes) === null || _matchingNodes$nodes === void 0 || _matchingNodes$nodes.forEach(function(node) { + if (matchingNodes.isComplexSelector && !_matchesExpression(node, expression)) { + return; + } + nodeSet.add(node); + }); + }); + var matchedNodes = []; + nodeSet.forEach(function(node) { + return matchedNodes.push(node); + }); + if (filter) { + matchedNodes = matchedNodes.filter(filter); + } + return matchedNodes.sort(function(a2, b2) { + return a2.nodeIndex - b2.nodeIndex; + }); } - function isScrollable(style, prop) { - var overflowProp = style.getPropertyValue(prop); - return [ 'scroll', 'auto' ].includes(overflowProp); - } - var get_scroll_default = memoize_default(getScroll); - function getElmScrollRecursive(root) { - return Array.from(root.children || root.childNodes || []).reduce(function(scrolls, elm) { - var scroll = get_scroll_default(elm); - if (scroll) { - scrolls.push(scroll); + function findMatchingNodes(expression, selectorMap, shadowId) { + var exp = expression[expression.length - 1]; + var nodes = null; + var isComplexSelector = expression.length > 1 || !!exp.pseudos || !!exp.classes; + if (isGlobalSelector(exp)) { + nodes = selectorMap['*']; + } else { + if (exp.id) { + var _selectorMap$idsKey$e; + if (!selectorMap[idsKey] || !Object.hasOwn(selectorMap[idsKey], exp.id) || !((_selectorMap$idsKey$e = selectorMap[idsKey][exp.id]) !== null && _selectorMap$idsKey$e !== void 0 && _selectorMap$idsKey$e.length)) { + return; + } + nodes = selectorMap[idsKey][exp.id].filter(function(node) { + return node.shadowId === shadowId; + }); } - return scrolls.concat(getElmScrollRecursive(elm)); - }, []); + if (exp.tag && exp.tag !== '*') { + var _selectorMap$exp$tag; + if (!((_selectorMap$exp$tag = selectorMap[exp.tag]) !== null && _selectorMap$exp$tag !== void 0 && _selectorMap$exp$tag.length)) { + return; + } + var cachedNodes = selectorMap[exp.tag]; + nodes = nodes ? getSharedValues(cachedNodes, nodes) : cachedNodes; + } + if (exp.classes) { + var _selectorMap$Class; + if (!((_selectorMap$Class = selectorMap['[class]']) !== null && _selectorMap$Class !== void 0 && _selectorMap$Class.length)) { + return; + } + var _cachedNodes = selectorMap['[class]']; + nodes = nodes ? getSharedValues(_cachedNodes, nodes) : _cachedNodes; + } + if (exp.attributes) { + for (var _i20 = 0; _i20 < exp.attributes.length; _i20++) { + var _selectorMap; + var attr = exp.attributes[_i20]; + if (attr.type === 'attrValue') { + isComplexSelector = true; + } + if (!((_selectorMap = selectorMap['['.concat(attr.key, ']')]) !== null && _selectorMap !== void 0 && _selectorMap.length)) { + return; + } + var _cachedNodes2 = selectorMap['['.concat(attr.key, ']')]; + nodes = nodes ? getSharedValues(_cachedNodes2, nodes) : _cachedNodes2; + } + } + } + return { + nodes: nodes, + isComplexSelector: isComplexSelector + }; } - function getScrollState() { - var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window; - var root = win.document.documentElement; - var windowScroll = [ win.pageXOffset !== void 0 ? { - elm: win, - top: win.pageYOffset, - left: win.pageXOffset - } : { - elm: root, - top: root.scrollTop, - left: root.scrollLeft - } ]; - return windowScroll.concat(getElmScrollRecursive(document.body)); + function isGlobalSelector(expression) { + return expression.tag === '*' && !expression.attributes && !expression.id && !expression.classes; } - var get_scroll_state_default = getScrollState; - function _getStandards() { - return _clone(standards_default); + function getSharedValues(a2, b2) { + return a2.filter(function(node) { + return b2.includes(node); + }); } - function getStyleSheetFactory(dynamicDoc) { - if (!dynamicDoc) { - throw new Error('axe.utils.getStyleSheetFactory should be invoked with an argument'); + function cacheSelector(key, vNode, map) { + if (!Object.hasOwn(map, key)) { + map[key] = []; } - return function(options) { - var data = options.data, _options$isCrossOrigi = options.isCrossOrigin, isCrossOrigin = _options$isCrossOrigi === void 0 ? false : _options$isCrossOrigi, shadowId = options.shadowId, root = options.root, priority = options.priority, _options$isLink = options.isLink, isLink = _options$isLink === void 0 ? false : _options$isLink; - var style = dynamicDoc.createElement('style'); - if (isLink) { - var text = dynamicDoc.createTextNode('@import "'.concat(data.href, '"')); - style.appendChild(text); - } else { - style.appendChild(dynamicDoc.createTextNode(data)); - } - dynamicDoc.head.appendChild(style); - return { - sheet: style.sheet, - isCrossOrigin: isCrossOrigin, - shadowId: shadowId, - root: root, - priority: priority - }; - }; + map[key].push(vNode); } - var get_stylesheet_factory_default = getStyleSheetFactory; - var styleSheet; - function injectStyle(style) { - if (styleSheet && styleSheet.parentNode) { - if (styleSheet.styleSheet === void 0) { - styleSheet.appendChild(document.createTextNode(style)); - } else { - styleSheet.styleSheet.cssText += style; - } - return styleSheet; - } - if (!style) { + function cacheNodeSelectors(vNode, selectorMap) { + if (vNode.props.nodeType !== 1) { return; } - var head = document.head || document.getElementsByTagName('head')[0]; - styleSheet = document.createElement('style'); - styleSheet.type = 'text/css'; - if (styleSheet.styleSheet === void 0) { - styleSheet.appendChild(document.createTextNode(style)); - } else { - styleSheet.styleSheet.cssText = style; - } - head.appendChild(styleSheet); - return styleSheet; + cacheSelector(vNode.props.nodeName, vNode, selectorMap); + cacheSelector('*', vNode, selectorMap); + vNode.attrNames.forEach(function(attrName) { + if (attrName === 'id') { + selectorMap[idsKey] = selectorMap[idsKey] || {}; + token_list_default(vNode.attr(attrName)).forEach(function(value) { + cacheSelector(value, vNode, selectorMap[idsKey]); + }); + } + cacheSelector('['.concat(attrName, ']'), vNode, selectorMap); + }); } - var inject_style_default = injectStyle; - function isHidden(el, recursed) { - var node = get_node_from_tree_default(el); - if (el.nodeType === 9) { - return false; - } - if (el.nodeType === 11) { - el = el.host; - } - if (node && node._isHidden !== null) { - return node._isHidden; - } - var style = window.getComputedStyle(el, null); - if (!style || !el.parentNode || style.getPropertyValue('display') === 'none' || !recursed && style.getPropertyValue('visibility') === 'hidden' || el.getAttribute('aria-hidden') === 'true') { - return true; - } - var parent = el.assignedSlot ? el.assignedSlot : el.parentNode; - var hidden = isHidden(parent, true); - if (node) { - node._isHidden = hidden; - } - return hidden; + var hasShadowRoot; + function _getFlattenedTree() { + var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement; + var shadowId = arguments.length > 1 ? arguments[1] : undefined; + hasShadowRoot = false; + var selectorMap = {}; + cache_default.set('nodeMap', new WeakMap()); + cache_default.set('selectorMap', selectorMap); + var tree = flattenTree(node, shadowId, null); + tree[0]._selectorMap = selectorMap; + tree[0]._hasShadowRoot = hasShadowRoot; + return tree; } - var is_hidden_default = isHidden; - function isHtmlElement(node) { - var _node$props$nodeName, _node$props; - var nodeName2 = (_node$props$nodeName = (_node$props = node.props) === null || _node$props === void 0 ? void 0 : _node$props.nodeName) !== null && _node$props$nodeName !== void 0 ? _node$props$nodeName : node.nodeName.toLowerCase(); - if (node.namespaceURI === 'http://www.w3.org/2000/svg') { - return false; + function getSlotChildren(node) { + var retVal = []; + node = node.firstChild; + while (node) { + retVal.push(node); + node = node.nextSibling; } - return !!standards_default.htmlElms[nodeName2]; + return retVal; } - var is_html_element_default = isHtmlElement; - function _isNodeInContext(node, _ref72) { - var _ref72$include = _ref72.include, include = _ref72$include === void 0 ? [] : _ref72$include, _ref72$exclude = _ref72.exclude, exclude = _ref72$exclude === void 0 ? [] : _ref72$exclude; - var filterInclude = include.filter(function(candidate) { - return _contains(candidate, node); - }); - if (filterInclude.length === 0) { - return false; + function createNode(node, parent, shadowId) { + var vNode = new virtual_node_default(node, parent, shadowId); + cacheNodeSelectors(vNode, cache_default.get('selectorMap')); + return vNode; + } + function flattenTree(node, shadowId, parent) { + var retVal, realArray, nodeName2; + function reduceShadowDOM(res, child, parentVNode) { + var replacements = flattenTree(child, shadowId, parentVNode); + if (replacements) { + res = res.concat(replacements); + } + return res; } - var filterExcluded = exclude.filter(function(candidate) { - return _contains(candidate, node); - }); - if (filterExcluded.length === 0) { - return true; + if (node.documentElement) { + node = node.documentElement; } - var deepestInclude = getDeepest(filterInclude); - var deepestExclude = getDeepest(filterExcluded); - return _contains(deepestExclude, deepestInclude); - } - function getDeepest(collection) { - var deepest; - var _iterator12 = _createForOfIteratorHelper(collection), _step12; - try { - for (_iterator12.s(); !(_step12 = _iterator12.n()).done; ) { - var node = _step12.value; - if (!deepest || !_contains(node, deepest)) { - deepest = node; + nodeName2 = node.nodeName.toLowerCase(); + if (is_shadow_root_default(node)) { + hasShadowRoot = true; + retVal = createNode(node, parent, shadowId); + shadowId = 'a' + Math.random().toString().substring(2); + realArray = Array.from(node.shadowRoot.childNodes); + retVal.children = realArray.reduce(function(res, child) { + return reduceShadowDOM(res, child, retVal); + }, []); + return [ retVal ]; + } else { + if (nodeName2 === 'content' && typeof node.getDistributedNodes === 'function') { + realArray = Array.from(node.getDistributedNodes()); + return realArray.reduce(function(res, child) { + return reduceShadowDOM(res, child, parent); + }, []); + } else if (nodeName2 === 'slot' && typeof node.assignedNodes === 'function') { + realArray = Array.from(node.assignedNodes()); + if (!realArray.length) { + realArray = getSlotChildren(node); + } + var styl = window.getComputedStyle(node); + if (false) { + retVal = createNode(node, parent, shadowId); + retVal.children = realArray.reduce(function(res, child) { + return reduceShadowDOM(res, child, retVal); + }, []); + return [ retVal ]; + } else { + return realArray.reduce(function(res, child) { + return reduceShadowDOM(res, child, parent); + }, []); + } + } else { + if (node.nodeType === 1) { + retVal = createNode(node, parent, shadowId); + realArray = Array.from(node.childNodes); + retVal.children = realArray.reduce(function(res, child) { + return reduceShadowDOM(res, child, retVal); + }, []); + return [ retVal ]; + } else if (node.nodeType === 3) { + return [ createNode(node, parent) ]; } + return void 0; } - } catch (err) { - _iterator12.e(err); - } finally { - _iterator12.f(); } - return deepest; } - function _matchAncestry(ancestryA, ancestryB) { - if (ancestryA.length !== ancestryB.length) { - return false; + function getBaseLang(lang) { + if (!lang) { + return ''; } - return ancestryA.every(function(selectorA, ancestorIndex) { - var selectorB = ancestryB[ancestorIndex]; - if (!Array.isArray(selectorA)) { - return selectorA === selectorB; + return lang.trim().split('-')[0].toLowerCase(); + } + var get_base_lang_default = getBaseLang; + function failureSummary(nodeData) { + var failingChecks = {}; + failingChecks.none = nodeData.none.concat(nodeData.all); + failingChecks.any = nodeData.any; + return Object.keys(failingChecks).map(function(key) { + if (!failingChecks[key].length) { + return; } - if (selectorA.length !== selectorB.length) { - return false; + var sum = axe._audit.data.failureSummaries[key]; + if (sum && typeof sum.failureMessage === 'function') { + return sum.failureMessage(failingChecks[key].map(function(check) { + return check.message || ''; + })); } - return selectorA.every(function(str, selectorIndex) { - return selectorB[selectorIndex] === str; - }); - }); + }).filter(function(i) { + return i !== void 0; + }).join('\n\n'); } - function nodeSorter(nodeA, nodeB) { - nodeA = nodeA.actualNode || nodeA; - nodeB = nodeB.actualNode || nodeB; - if (nodeA === nodeB) { - return 0; - } - if (nodeA.compareDocumentPosition(nodeB) & 4) { - return -1; - } else { - return 1; + var failure_summary_default = failureSummary; + function incompleteFallbackMessage() { + var message = axe._audit.data.incompleteFallbackMessage; + if (typeof message === 'function') { + message = message(); } - } - var node_sorter_default = nodeSorter; - function _nodeLookup(node) { - if (node instanceof abstract_virtual_node_default) { - return { - vNode: node, - domNode: node.actualNode - }; + if (typeof message !== 'string') { + return ''; } - return { - vNode: get_node_from_tree_default(node), - domNode: node - }; + return message; } - function parseSameOriginStylesheet(sheet, options, priority, importedUrls) { - var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - var rules = Array.from(sheet.cssRules); - if (!rules) { - return Promise.resolve(); - } - var cssImportRules = rules.filter(function(r) { - return r.type === 3; + var resultKeys = constants_default.resultGroups; + function processAggregate(results, options) { + var resultObject = axe.utils.aggregateResult(results); + resultKeys.forEach(function(key) { + if (options.resultTypes && !options.resultTypes.includes(key)) { + (resultObject[key] || []).forEach(function(ruleResult) { + if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) { + ruleResult.nodes = [ ruleResult.nodes[0] ]; + } + }); + } + resultObject[key] = (resultObject[key] || []).map(function(ruleResult) { + ruleResult = Object.assign({}, ruleResult); + if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) { + ruleResult.nodes = ruleResult.nodes.map(function(subResult) { + if (_typeof(subResult.node) === 'object') { + var serialElm = trimElementSpec(subResult.node, options); + Object.assign(subResult, serialElm); + } + delete subResult.result; + delete subResult.node; + normalizeRelatedNodes(subResult, options); + return subResult; + }); + } + resultKeys.forEach(function(resultKey) { + return delete ruleResult[resultKey]; + }); + delete ruleResult.pageLevel; + delete ruleResult.result; + return ruleResult; + }); }); - if (!cssImportRules.length) { - return Promise.resolve({ - isCrossOrigin: isCrossOrigin, - priority: priority, - root: options.rootNode, - shadowId: options.shadowId, - sheet: sheet + return resultObject; + } + function normalizeRelatedNodes(node, options) { + [ 'any', 'all', 'none' ].forEach(function(type2) { + if (!Array.isArray(node[type2])) { + return; + } + node[type2].filter(function(checkRes) { + return Array.isArray(checkRes.relatedNodes); + }).forEach(function(checkRes) { + checkRes.relatedNodes = checkRes.relatedNodes.map(function(relatedNode) { + return trimElementSpec(relatedNode, options); + }); }); - } - var cssImportUrlsNotAlreadyImported = cssImportRules.filter(function(rule) { - return rule.href; - }).map(function(rule) { - return rule.href; - }).filter(function(url) { - return !importedUrls.includes(url); }); - var promises = cssImportUrlsNotAlreadyImported.map(function(importUrl, cssRuleIndex) { - var newPriority = [].concat(_toConsumableArray(priority), [ cssRuleIndex ]); - var isCrossOriginRequest = /^https?:\/\/|^\/\//i.test(importUrl); - return parse_crossorigin_stylesheet_default(importUrl, options, newPriority, importedUrls, isCrossOriginRequest); - }); - var nonImportCSSRules = rules.filter(function(r) { - return r.type !== 3; - }); - if (!nonImportCSSRules.length) { - return Promise.all(promises); - } - promises.push(Promise.resolve(options.convertDataToStylesheet({ - data: nonImportCSSRules.map(function(rule) { - return rule.cssText; - }).join(), - isCrossOrigin: isCrossOrigin, - priority: priority, - root: options.rootNode, - shadowId: options.shadowId - }))); - return Promise.all(promises); } - var parse_sameorigin_stylesheet_default = parseSameOriginStylesheet; - function parseStylesheet(sheet, options, priority, importedUrls) { - var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - var isSameOrigin = isSameOriginStylesheet(sheet); - if (isSameOrigin) { - return parse_sameorigin_stylesheet_default(sheet, options, priority, importedUrls, isCrossOrigin); + function trimElementSpec() { + var elmSpec = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var runOptions = arguments.length > 1 ? arguments[1] : undefined; + elmSpec = node_serializer_default.dqElmToSpec(elmSpec, runOptions); + var serialElm = {}; + if (axe._audit.noHtml) { + serialElm.html = null; + } else { + var _elmSpec$source; + serialElm.html = (_elmSpec$source = elmSpec.source) !== null && _elmSpec$source !== void 0 ? _elmSpec$source : 'Undefined'; } - return parse_crossorigin_stylesheet_default(sheet.href, options, priority, importedUrls, true); + if (runOptions.elementRef && !elmSpec.fromFrame) { + var _elmSpec$element; + serialElm.element = (_elmSpec$element = elmSpec.element) !== null && _elmSpec$element !== void 0 ? _elmSpec$element : null; + } + if (runOptions.selectors !== false || elmSpec.fromFrame) { + var _elmSpec$selector; + serialElm.target = (_elmSpec$selector = elmSpec.selector) !== null && _elmSpec$selector !== void 0 ? _elmSpec$selector : [ ':root' ]; + } + if (runOptions.ancestry) { + var _elmSpec$ancestry; + serialElm.ancestry = (_elmSpec$ancestry = elmSpec.ancestry) !== null && _elmSpec$ancestry !== void 0 ? _elmSpec$ancestry : [ ':root' ]; + } + if (runOptions.xpath) { + var _elmSpec$xpath; + serialElm.xpath = (_elmSpec$xpath = elmSpec.xpath) !== null && _elmSpec$xpath !== void 0 ? _elmSpec$xpath : [ '/' ]; + } + return serialElm; } - function isSameOriginStylesheet(sheet) { - try { - var rules = sheet.cssRules; - if (!rules && sheet.href) { - return false; + var dataRegex = /\$\{\s?data\s?\}/g; + function substitute(str, data) { + if (typeof data === 'string') { + return str.replace(dataRegex, data); + } + for (var prop in data) { + if (data.hasOwnProperty(prop)) { + var regex = new RegExp('\\${\\s?data\\.' + prop + '\\s?}', 'g'); + var replace = typeof data[prop] === 'undefined' ? '' : String(data[prop]); + str = str.replace(regex, replace); } - return true; - } catch (e) { - return false; } + return str; } - var parse_stylesheet_default = parseStylesheet; - function parseCrossOriginStylesheet(url, options, priority, importedUrls, isCrossOrigin) { - importedUrls.push(url); - return new Promise(function(resolve, reject) { - var request = new window.XMLHttpRequest(); - request.open('GET', url); - request.timeout = constants_default.preload.timeout; - request.addEventListener('error', reject); - request.addEventListener('timeout', reject); - request.addEventListener('loadend', function(event) { - if (event.loaded && request.responseText) { - return resolve(request.responseText); - } - reject(request.responseText); - }); - request.send(); - }).then(function(data) { - var result = options.convertDataToStylesheet({ - data: data, - isCrossOrigin: isCrossOrigin, - priority: priority, - root: options.rootNode, - shadowId: options.shadowId - }); - return parse_stylesheet_default(result.sheet, options, priority, importedUrls, result.isCrossOrigin); - }); - } - var parse_crossorigin_stylesheet_default = parseCrossOriginStylesheet; - var performanceTimer = function() { - function now() { - if (window.performance && window.performance) { - return window.performance.now(); - } + function processMessage(message, data) { + if (!message) { + return; } - var originalTime = null; - var lastRecordedTime = now(); - return { - start: function start() { - this.mark('mark_axe_start'); - }, - end: function end() { - this.mark('mark_axe_end'); - this.measure('axe', 'mark_axe_start', 'mark_axe_end'); - this.logMeasures('axe'); - }, - auditStart: function auditStart() { - this.mark('mark_audit_start'); - }, - auditEnd: function auditEnd() { - this.mark('mark_audit_end'); - this.measure('audit_start_to_end', 'mark_audit_start', 'mark_audit_end'); - this.logMeasures(); - }, - mark: function mark(markName) { - if (window.performance && window.performance.mark !== void 0) { - window.performance.mark(markName); - } - }, - measure: function measure(measureName, startMark, endMark) { - if (window.performance && window.performance.measure !== void 0) { - window.performance.measure(measureName, startMark, endMark); - } - }, - logMeasures: function logMeasures(measureName) { - function logMeasure(req2) { - log_default('Measure ' + req2.name + ' took ' + req2.duration + 'ms'); - } - if (window.performance && window.performance.getEntriesByType !== void 0) { - var axeStart = window.performance.getEntriesByName('mark_axe_start')[0]; - var measures = window.performance.getEntriesByType('measure').filter(function(measure) { - return measure.startTime >= axeStart.startTime; - }); - for (var i = 0; i < measures.length; ++i) { - var req = measures[i]; - if (req.name === measureName) { - logMeasure(req); - return; - } - logMeasure(req); - } - } - }, - timeElapsed: function timeElapsed() { - return now() - lastRecordedTime; - }, - reset: function reset() { - if (!originalTime) { - originalTime = now(); - } - lastRecordedTime = now(); + if (Array.isArray(data)) { + data.values = data.join(', '); + if (typeof message.singular === 'string' && typeof message.plural === 'string') { + var str2 = data.length === 1 ? message.singular : message.plural; + return substitute(str2, data); } - }; - }(); - var performance_timer_default = performanceTimer; - function _pollyfillElementsFromPoint() { - if (document.elementsFromPoint) { - return document.elementsFromPoint; + return substitute(message, data); } - if (document.msElementsFromPoint) { - return document.msElementsFromPoint; + if (typeof message === 'string') { + return substitute(message, data); } - var usePointer = function() { - var element = document.createElement('x'); - element.style.cssText = 'pointer-events:auto'; - return element.style.pointerEvents === 'auto'; - }(); - var cssProp = usePointer ? 'pointer-events' : 'visibility'; - var cssDisableVal = usePointer ? 'none' : 'hidden'; - var style = document.createElement('style'); - style.innerHTML = usePointer ? '* { pointer-events: all }' : '* { visibility: visible }'; - return function(x, y) { - var current, i, d2; - var elements = []; - var previousPointerEvents = []; - document.head.appendChild(style); - while ((current = document.elementFromPoint(x, y)) && elements.indexOf(current) === -1) { - elements.push(current); - previousPointerEvents.push({ - value: current.style.getPropertyValue(cssProp), - priority: current.style.getPropertyPriority(cssProp) - }); - current.style.setProperty(cssProp, cssDisableVal, 'important'); + if (typeof data === 'string') { + var _str = message[data]; + return substitute(_str, data); + } + var str = message['default'] || incompleteFallbackMessage(); + if (data && data.messageKey && message[data.messageKey]) { + str = message[data.messageKey]; + } + return processMessage(str, data); + } + var process_message_default = processMessage; + function getCheckMessage(checkId, type2, data) { + var check = axe._audit.data.checks[checkId]; + if (!check) { + throw new Error('Cannot get message for unknown check: '.concat(checkId, '.')); + } + if (!check.messages[type2]) { + throw new Error('Check "'.concat(checkId, '"" does not have a "').concat(type2, '" message.')); + } + return process_message_default(check.messages[type2], data); + } + var get_check_message_default = getCheckMessage; + function getCheckOption(check, ruleID, options) { + var ruleCheckOption = ((options.rules && options.rules[ruleID] || {}).checks || {})[check.id]; + var checkOption = (options.checks || {})[check.id]; + var enabled = check.enabled; + var opts = check.options; + if (checkOption) { + if (checkOption.hasOwnProperty('enabled')) { + enabled = checkOption.enabled; } - if (elements.indexOf(document.documentElement) < elements.length - 1) { - elements.splice(elements.indexOf(document.documentElement), 1); - elements.push(document.documentElement); + if (checkOption.hasOwnProperty('options')) { + opts = checkOption.options; } - for (i = previousPointerEvents.length; !!(d2 = previousPointerEvents[--i]); ) { - elements[i].style.setProperty(cssProp, d2.value ? d2.value : '', d2.priority); + } + if (ruleCheckOption) { + if (ruleCheckOption.hasOwnProperty('enabled')) { + enabled = ruleCheckOption.enabled; } - document.head.removeChild(style); - return elements; + if (ruleCheckOption.hasOwnProperty('options')) { + opts = ruleCheckOption.options; + } + } + return { + enabled: enabled, + options: opts, + absolutePaths: options.absolutePaths }; } - if (typeof window.addEventListener === 'function') { - document.elementsFromPoint = _pollyfillElementsFromPoint(); - } - function uniqueArray(arr1, arr2) { - return arr1.concat(arr2).filter(function(elem, pos, arr) { - return arr.indexOf(elem) === pos; - }); - } - var unique_array_default = uniqueArray; - function createLocalVariables(vNodes, anyLevel, thisLevel, parentShadowId, recycledLocalVariable) { - var retVal = recycledLocalVariable || {}; - retVal.vNodes = vNodes; - retVal.vNodesIndex = 0; - retVal.anyLevel = anyLevel; - retVal.thisLevel = thisLevel; - retVal.parentShadowId = parentShadowId; - return retVal; - } - function matchExpressions(domTree, expressions, filter) { - var recycledLocalVariables = cache_default.get('qsa.recycledLocalVariables', function() { - return []; - }); - var stack = []; - var vNodes = Array.isArray(domTree) ? domTree : [ domTree ]; - var currentLevel = createLocalVariables(vNodes, expressions, null, domTree[0].shadowId, recycledLocalVariables.pop()); - var result = []; - while (currentLevel.vNodesIndex < currentLevel.vNodes.length) { - var _currentLevel$anyLeve, _currentLevel$thisLev; - var vNode = currentLevel.vNodes[currentLevel.vNodesIndex++]; - var childOnly = null; - var childAny = null; - var combinedLength = (((_currentLevel$anyLeve = currentLevel.anyLevel) === null || _currentLevel$anyLeve === void 0 ? void 0 : _currentLevel$anyLeve.length) || 0) + (((_currentLevel$thisLev = currentLevel.thisLevel) === null || _currentLevel$thisLev === void 0 ? void 0 : _currentLevel$thisLev.length) || 0); - var added = false; - for (var _i24 = 0; _i24 < combinedLength; _i24++) { - var _currentLevel$anyLeve2, _currentLevel$anyLeve3, _currentLevel$anyLeve4; - var exp = _i24 < (((_currentLevel$anyLeve2 = currentLevel.anyLevel) === null || _currentLevel$anyLeve2 === void 0 ? void 0 : _currentLevel$anyLeve2.length) || 0) ? currentLevel.anyLevel[_i24] : currentLevel.thisLevel[_i24 - (((_currentLevel$anyLeve3 = currentLevel.anyLevel) === null || _currentLevel$anyLeve3 === void 0 ? void 0 : _currentLevel$anyLeve3.length) || 0)]; - if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && _matchesExpression(vNode, exp[0])) { - if (exp.length === 1) { - if (!added && (!filter || filter(vNode))) { - result.push(vNode); - added = true; - } - } else { - var rest = exp.slice(1); - if ([ ' ', '>' ].includes(rest[0].combinator) === false) { - throw new Error('axe.utils.querySelectorAll does not support the combinator: ' + exp[1].combinator); - } - if (rest[0].combinator === '>') { - (childOnly = childOnly || []).push(rest); - } else { - (childAny = childAny || []).push(rest); - } - } - } - if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && (_currentLevel$anyLeve4 = currentLevel.anyLevel) !== null && _currentLevel$anyLeve4 !== void 0 && _currentLevel$anyLeve4.includes(exp)) { - (childAny = childAny || []).push(exp); - } - } - if (vNode.children && vNode.children.length) { - stack.push(currentLevel); - currentLevel = createLocalVariables(vNode.children, childAny, childOnly, vNode.shadowId, recycledLocalVariables.pop()); - } - while (currentLevel.vNodesIndex === currentLevel.vNodes.length && stack.length) { - recycledLocalVariables.push(currentLevel); - currentLevel = stack.pop(); - } + var get_check_option_default = getCheckOption; + function _getEnvironmentData() { + var _win$location; + var metadata = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + var win = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window; + if (metadata && _typeof(metadata) === 'object') { + return metadata; + } else if (_typeof(win) !== 'object') { + return {}; } - return result; + return { + testEngine: { + name: 'axe-core', + version: axe.version + }, + testRunner: { + name: axe._audit.brand + }, + testEnvironment: getTestEnvironment(win), + timestamp: new Date().toISOString(), + url: (_win$location = win.location) === null || _win$location === void 0 ? void 0 : _win$location.href + }; } - function querySelectorAllFilter(domTree, selector, filter) { - domTree = Array.isArray(domTree) ? domTree : [ domTree ]; - var expressions = _convertSelector(selector); - var nodes = getNodesMatchingExpression(domTree, expressions, filter); - if (nodes) { - return nodes; + function getTestEnvironment(win) { + if (!win.navigator || _typeof(win.navigator) !== 'object') { + return {}; } - return matchExpressions(domTree, expressions, filter); + var navigator2 = win.navigator, innerHeight = win.innerHeight, innerWidth = win.innerWidth; + var _ref75 = getOrientation(win) || {}, angle = _ref75.angle, type2 = _ref75.type; + return { + userAgent: navigator2.userAgent, + windowWidth: innerWidth, + windowHeight: innerHeight, + orientationAngle: angle, + orientationType: type2 + }; } - var query_selector_all_filter_default = querySelectorAllFilter; - function preloadCssom(_ref73) { - var _ref73$treeRoot = _ref73.treeRoot, treeRoot = _ref73$treeRoot === void 0 ? axe._tree[0] : _ref73$treeRoot; - var rootNodes = getAllRootNodesInTree(treeRoot); - if (!rootNodes.length) { - return Promise.resolve(); - } - var dynamicDoc = document.implementation.createHTMLDocument('Dynamic document for loading cssom'); - var convertDataToStylesheet = get_stylesheet_factory_default(dynamicDoc); - return getCssomForAllRootNodes(rootNodes, convertDataToStylesheet).then(function(assets) { - return flattenAssets(assets); - }); + function getOrientation(_ref76) { + var screen = _ref76.screen; + return screen.orientation || screen.msOrientation || screen.mozOrientation; } - var preload_cssom_default = preloadCssom; - function getAllRootNodesInTree(tree) { - var ids = []; - var rootNodes = query_selector_all_filter_default(tree, '*', function(node) { - if (ids.includes(node.shadowId)) { - return false; - } - ids.push(node.shadowId); - return true; - }).map(function(node) { - return { - shadowId: node.shadowId, - rootNode: get_root_node_default(node.actualNode) - }; - }); - return unique_array_default(rootNodes, []); + function createFrameContext(frame, _ref77) { + var focusable = _ref77.focusable, page = _ref77.page; + return { + node: frame, + include: [], + exclude: [], + initiator: false, + focusable: focusable && frameFocusable(frame), + size: getBoundingSize(frame), + page: page + }; } - function getCssomForAllRootNodes(rootNodes, convertDataToStylesheet) { - var promises = []; - rootNodes.forEach(function(_ref74, index) { - var rootNode = _ref74.rootNode, shadowId = _ref74.shadowId; - var sheets = getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet); - if (!sheets) { - return Promise.all(promises); - } - var rootIndex = index + 1; - var parseOptions = { - rootNode: rootNode, - shadowId: shadowId, - convertDataToStylesheet: convertDataToStylesheet, - rootIndex: rootIndex - }; - var importedUrls = []; - var p2 = Promise.all(sheets.map(function(sheet, sheetIndex) { - var priority = [ rootIndex, sheetIndex ]; - return parse_stylesheet_default(sheet, parseOptions, priority, importedUrls); - })); - promises.push(p2); - }); - return Promise.all(promises); + function frameFocusable(frame) { + var tabIndex = frame.getAttribute('tabindex'); + if (!tabIndex) { + return true; + } + var _int = parseInt(tabIndex, 10); + return isNaN(_int) || _int >= 0; } - function flattenAssets(assets) { - return assets.reduce(function(acc, val) { - return Array.isArray(val) ? acc.concat(flattenAssets(val)) : acc.concat(val); - }, []); + function getBoundingSize(domNode) { + var width = parseInt(domNode.getAttribute('width'), 10); + var height = parseInt(domNode.getAttribute('height'), 10); + if (isNaN(width) || isNaN(height)) { + var rect = domNode.getBoundingClientRect(); + width = isNaN(width) ? rect.width : width; + height = isNaN(height) ? rect.height : height; + } + return { + width: width, + height: height + }; } - function getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet) { - var sheets; - if (rootNode.nodeType === 11 && shadowId) { - sheets = getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet); + function normalizeContext(contextSpec) { + if (isContextObject(contextSpec)) { + var msg = ' must be used inside include or exclude. It should not be on the same object.'; + assert2(!objectHasOwn(contextSpec, 'fromFrames'), 'fromFrames' + msg); + assert2(!objectHasOwn(contextSpec, 'fromShadowDom'), 'fromShadowDom' + msg); + } else if (isContextProp(contextSpec)) { + contextSpec = { + include: contextSpec, + exclude: [] + }; } else { - sheets = getStylesheetsFromDocument(rootNode); + return { + include: [ document ], + exclude: [] + }; } - return filterStylesheetsWithSameHref(sheets); + var include = normalizeContextList(contextSpec.include); + if (include.length === 0) { + include.push(document); + } + var exclude = normalizeContextList(contextSpec.exclude); + return { + include: include, + exclude: exclude + }; } - function getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet) { - return Array.from(rootNode.children).filter(filerStyleAndLinkAttributesInDocumentFragment).reduce(function(out, node) { - var nodeName2 = node.nodeName.toUpperCase(); - var data = nodeName2 === 'STYLE' ? node.textContent : node; - var isLink = nodeName2 === 'LINK'; - var stylesheet = convertDataToStylesheet({ - data: data, - isLink: isLink, - root: rootNode - }); - if (stylesheet.sheet) { - out.push(stylesheet.sheet); - } - return out; - }, []); + function isContextSpec(contextSpec) { + return isContextObject(contextSpec) || isContextProp(contextSpec); } - function getStylesheetsFromDocument(rootNode) { - return Array.from(rootNode.styleSheets).filter(function(sheet) { - if (!sheet.media) { - return false; + function normalizeContextList() { + var selectorList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var normalizedList = []; + if (!isArrayLike(selectorList)) { + selectorList = [ selectorList ]; + } + for (var _i21 = 0; _i21 < selectorList.length; _i21++) { + var normalizedSelector = normalizeContextSelector(selectorList[_i21]); + if (normalizedSelector) { + normalizedList.push(normalizedSelector); } - return filterMediaIsPrint(sheet.media.mediaText); - }); - } - function filerStyleAndLinkAttributesInDocumentFragment(node) { - var nodeName2 = node.nodeName.toUpperCase(); - var linkHref = node.getAttribute('href'); - var linkRel = node.getAttribute('rel'); - var isLink = nodeName2 === 'LINK' && linkHref && linkRel && node.rel.toUpperCase().includes('STYLESHEET'); - var isStyle = nodeName2 === 'STYLE'; - return isStyle || isLink && filterMediaIsPrint(node.media); - } - function filterMediaIsPrint(media) { - if (!media) { - return true; } - return !media.toUpperCase().includes('PRINT'); + return normalizedList; } - function filterStylesheetsWithSameHref(sheets) { - var hrefs = []; - return sheets.filter(function(sheet) { - if (!sheet.href) { - return true; - } - if (hrefs.includes(sheet.href)) { - return false; - } - hrefs.push(sheet.href); - return true; - }); + function normalizeContextSelector(selector) { + if (selector instanceof window.Node) { + return selector; + } + if (typeof selector === 'string') { + return [ selector ]; + } + if (isLabelledFramesSelector(selector)) { + assertLabelledFrameSelector(selector); + selector = selector.fromFrames; + } else if (isLabelledShadowDomSelector(selector)) { + selector = [ selector ]; + } + return normalizeFrameSelectors(selector); } - function preloadMedia(_ref75) { - var _ref75$treeRoot = _ref75.treeRoot, treeRoot = _ref75$treeRoot === void 0 ? axe._tree[0] : _ref75$treeRoot; - var mediaVirtualNodes = query_selector_all_filter_default(treeRoot, 'video, audio', function(_ref76) { - var actualNode = _ref76.actualNode; - if (actualNode.hasAttribute('src')) { - return !!actualNode.getAttribute('src'); - } - var sourceWithSrc = Array.from(actualNode.getElementsByTagName('source')).filter(function(source) { - return !!source.getAttribute('src'); - }); - if (sourceWithSrc.length <= 0) { - return false; + function normalizeFrameSelectors(frameSelectors) { + if (!Array.isArray(frameSelectors)) { + return; + } + var normalizedSelectors = []; + var _iterator11 = _createForOfIteratorHelper(frameSelectors), _step11; + try { + for (_iterator11.s(); !(_step11 = _iterator11.n()).done; ) { + var selector = _step11.value; + if (isLabelledShadowDomSelector(selector)) { + assertLabelledShadowDomSelector(selector); + selector = selector.fromShadowDom; + } + if (typeof selector !== 'string' && !isShadowSelector(selector)) { + return; + } + normalizedSelectors.push(selector); } - return true; - }); - return Promise.all(mediaVirtualNodes.map(function(_ref77) { - var actualNode = _ref77.actualNode; - return isMediaElementReady(actualNode); - })); + } catch (err) { + _iterator11.e(err); + } finally { + _iterator11.f(); + } + return normalizedSelectors; } - var preload_media_default = preloadMedia; - function isMediaElementReady(elm) { - return new Promise(function(resolve) { - if (elm.readyState > 0) { - resolve(elm); - } - function onMediaReady() { - elm.removeEventListener('loadedmetadata', onMediaReady); - resolve(elm); - } - elm.addEventListener('loadedmetadata', onMediaReady); + function isContextObject(contextSpec) { + return [ 'include', 'exclude' ].some(function(prop) { + return objectHasOwn(contextSpec, prop) && isContextProp(contextSpec[prop]); }); } - function _preload(options) { - var preloadFunctionsMap = { - cssom: preload_cssom_default, - media: preload_media_default - }; - if (!_shouldPreload(options)) { - return Promise.resolve(); - } - return new Promise(function(resolve, reject) { - var _getPreloadConfig2 = _getPreloadConfig(options), assets = _getPreloadConfig2.assets, timeout = _getPreloadConfig2.timeout; - var preloadTimeout = setTimeout(function() { - return reject(new Error('Preload assets timed out.')); - }, timeout); - Promise.all(assets.map(function(asset) { - return preloadFunctionsMap[asset](options).then(function(results) { - return _defineProperty({}, asset, results); - }); - })).then(function(results) { - var preloadAssets = results.reduce(function(out, result) { - return _extends({}, out, result); - }, {}); - clearTimeout(preloadTimeout); - resolve(preloadAssets); - })['catch'](function(err2) { - clearTimeout(preloadTimeout); - reject(err2); - }); - }); + function isContextProp(contextList) { + return typeof contextList === 'string' || contextList instanceof window.Node || isLabelledFramesSelector(contextList) || isLabelledShadowDomSelector(contextList) || isArrayLike(contextList); } - function isValidPreloadObject(preloadObj) { - return _typeof(preloadObj) === 'object' && Array.isArray(preloadObj.assets); + function isLabelledFramesSelector(selector) { + return objectHasOwn(selector, 'fromFrames'); } - function _shouldPreload(options) { - if (!options || options.preload === void 0 || options.preload === null) { - return true; - } - if (typeof options.preload === 'boolean') { - return options.preload; - } - return isValidPreloadObject(options.preload); + function isLabelledShadowDomSelector(selector) { + return objectHasOwn(selector, 'fromShadowDom'); } - function _getPreloadConfig(options) { - var _constants_default$pr = constants_default.preload, assets = _constants_default$pr.assets, timeout = _constants_default$pr.timeout; - var config = { - assets: assets, - timeout: timeout - }; - if (!options.preload) { - return config; - } - if (typeof options.preload === 'boolean') { - return config; - } - var areRequestedAssetsValid = options.preload.assets.every(function(a2) { - return assets.includes(a2.toLowerCase()); - }); - if (!areRequestedAssetsValid) { - throw new Error('Requested assets, not supported. Supported assets are: '.concat(assets.join(', '), '.')); - } - config.assets = unique_array_default(options.preload.assets.map(function(a2) { - return a2.toLowerCase(); - }), []); - if (options.preload.timeout && typeof options.preload.timeout === 'number' && !isNaN(options.preload.timeout)) { - config.timeout = options.preload.timeout; - } - return config; + function assertLabelledFrameSelector(selector) { + assert2(Array.isArray(selector.fromFrames), 'fromFrames property must be an array'); + assert2(selector.fromFrames.every(function(fromFrameSelector) { + return !objectHasOwn(fromFrameSelector, 'fromFrames'); + }), 'Invalid context; fromFrames selector must be appended, rather than nested'); + assert2(!objectHasOwn(selector, 'fromShadowDom'), 'fromFrames and fromShadowDom cannot be used on the same object'); } - function _publishMetaData(ruleResult) { - var checksData = axe._audit.data.checks || {}; - var rulesData = axe._audit.data.rules || {}; - var rule = find_by_default(axe._audit.rules, 'id', ruleResult.id) || {}; - ruleResult.tags = _clone(rule.tags || []); - var shouldBeTrue = extender(checksData, true, rule); - var shouldBeFalse = extender(checksData, false, rule); - ruleResult.nodes.forEach(function(detail) { - detail.any.forEach(shouldBeTrue); - detail.all.forEach(shouldBeTrue); - detail.none.forEach(shouldBeFalse); + function assertLabelledShadowDomSelector(selector) { + assert2(Array.isArray(selector.fromShadowDom), 'fromShadowDom property must be an array'); + assert2(selector.fromShadowDom.every(function(fromShadowDomSelector) { + return !objectHasOwn(fromShadowDomSelector, 'fromFrames'); + }), 'shadow selector must be inside fromFrame instead'); + assert2(selector.fromShadowDom.every(function(fromShadowDomSelector) { + return !objectHasOwn(fromShadowDomSelector, 'fromShadowDom'); + }), 'fromShadowDom selector must be appended, rather than nested'); + } + function isShadowSelector(selector) { + return Array.isArray(selector) && selector.every(function(str) { + return typeof str === 'string'; }); - extend_meta_data_default(ruleResult, _clone(rulesData[ruleResult.id] || {})); } - function getIncompleteReason(checkData, messages) { - function getDefaultMsg(message) { - if (message.incomplete && message.incomplete['default']) { - return message.incomplete['default']; - } else { - return incompleteFallbackMessage(); - } + function isArrayLike(arr) { + return arr && _typeof(arr) === 'object' && typeof arr.length === 'number' && arr instanceof window.Node === false; + } + function assert2(bool, str) { + assert_default(bool, 'Invalid context; '.concat(str, '\nSee: https://github.com/dequelabs/axe-core/blob/master/doc/context.md')); + } + function objectHasOwn(obj, prop) { + if (!obj || _typeof(obj) !== 'object') { + return false; } - if (checkData && checkData.missingData) { - try { - var msg = messages.incomplete[checkData.missingData[0].reason]; - if (!msg) { - throw new Error(); + return Object.prototype.hasOwnProperty.call(obj, prop); + } + function parseSelectorArray(context, type2) { + var result = []; + for (var _i22 = 0, l = context[type2].length; _i22 < l; _i22++) { + var item = context[type2][_i22]; + if (item instanceof window.Node) { + if (item.documentElement instanceof window.Node) { + result.push(context.flatTree[0]); + } else { + result.push(get_node_from_tree_default(item)); } - return msg; - } catch (e) { - if (typeof checkData.missingData === 'string') { - return messages.incomplete[checkData.missingData]; + } else if (item && item.length) { + if (item.length > 1) { + pushUniqueFrameSelector(context, type2, item); } else { - return getDefaultMsg(messages); + var nodeList = _shadowSelectAll(item[0]); + result.push.apply(result, _toConsumableArray(nodeList.map(function(node) { + return get_node_from_tree_default(node); + }))); } } - } else if (checkData && checkData.messageKey) { - return messages.incomplete[checkData.messageKey]; - } else { - return getDefaultMsg(messages); } + return result.filter(function(r) { + return r; + }); } - function extender(checksData, shouldBeTrue, rule) { - return function(check) { - var sourceData = checksData[check.id] || {}; - var messages = sourceData.messages || {}; - var data = Object.assign({}, sourceData); - delete data.messages; - if (!rule.reviewOnFail && check.result === void 0) { - if (_typeof(messages.incomplete) === 'object' && !Array.isArray(check.data)) { - data.message = getIncompleteReason(check.data, messages); - } - if (!data.message) { - data.message = messages.incomplete; - } - } else { - data.message = check.result === shouldBeTrue ? messages.pass : messages.fail; - } - if (typeof data.message !== 'function') { - data.message = process_message_default(data.message, check.data); + function pushUniqueFrameSelector(context, type2, selectorArray) { + context.frames = context.frames || []; + var frameSelector = selectorArray.shift(); + var frames = _shadowSelectAll(frameSelector); + frames.forEach(function(frame) { + var frameContext = context.frames.find(function(result) { + return result.node === frame; + }); + if (!frameContext) { + frameContext = createFrameContext(frame, context); + context.frames.push(frameContext); } - extend_meta_data_default(check, data); - }; - } - function querySelectorAll(domTree, selector) { - return query_selector_all_filter_default(domTree, selector); + frameContext[type2].push(selectorArray); + }); } - var query_selector_all_default = querySelectorAll; - function matchTags(rule, runOnly) { - var include, exclude, matching; - var defaultExclude = axe._audit && axe._audit.tagExclude ? axe._audit.tagExclude : []; - if (runOnly.hasOwnProperty('include') || runOnly.hasOwnProperty('exclude')) { - include = runOnly.include || []; - include = Array.isArray(include) ? include : [ include ]; - exclude = runOnly.exclude || []; - exclude = Array.isArray(exclude) ? exclude : [ exclude ]; - exclude = exclude.concat(defaultExclude.filter(function(tag) { - return include.indexOf(tag) === -1; - })); - } else { - include = Array.isArray(runOnly) ? runOnly : [ runOnly ]; - exclude = defaultExclude.filter(function(tag) { - return include.indexOf(tag) === -1; - }); - } - matching = include.some(function(tag) { - return rule.tags.indexOf(tag) !== -1; + function Context(spec, flatTree) { + var _spec, _spec2, _spec3, _spec4, _this5 = this; + spec = _clone(spec); + this.frames = []; + this.page = typeof ((_spec = spec) === null || _spec === void 0 ? void 0 : _spec.page) === 'boolean' ? spec.page : void 0; + this.initiator = typeof ((_spec2 = spec) === null || _spec2 === void 0 ? void 0 : _spec2.initiator) === 'boolean' ? spec.initiator : true; + this.focusable = typeof ((_spec3 = spec) === null || _spec3 === void 0 ? void 0 : _spec3.focusable) === 'boolean' ? spec.focusable : true; + this.size = _typeof((_spec4 = spec) === null || _spec4 === void 0 ? void 0 : _spec4.size) === 'object' ? spec.size : {}; + spec = normalizeContext(spec); + this.flatTree = flatTree !== null && flatTree !== void 0 ? flatTree : _getFlattenedTree(getRootNode2(spec)); + this.exclude = spec.exclude; + this.include = spec.include; + this.include = parseSelectorArray(this, 'include'); + this.exclude = parseSelectorArray(this, 'exclude'); + _select('frame, iframe', this).forEach(function(frame) { + if (_isNodeInContext(frame, _this5)) { + pushUniqueFrame(_this5, frame.actualNode); + } }); - if (matching || include.length === 0 && rule.enabled !== false) { - return exclude.every(function(tag) { - return rule.tags.indexOf(tag) === -1; + if (typeof this.page === 'undefined') { + this.page = isPageContext(this); + this.frames.forEach(function(frame) { + frame.page = _this5.page; }); - } else { - return false; } + validateContext(this); + if (!Array.isArray(this.include)) { + this.include = Array.from(this.include); + } + this.include.sort(node_sorter_default); } - function ruleShouldRun(rule, context, options) { - var runOnly = options.runOnly || {}; - var ruleOptions = (options.rules || {})[rule.id]; - if (rule.pageLevel && !context.page) { - return false; - } else if (runOnly.type === 'rule') { - return runOnly.values.indexOf(rule.id) !== -1; - } else if (ruleOptions && typeof ruleOptions.enabled === 'boolean') { - return ruleOptions.enabled; - } else if (runOnly.type === 'tag' && runOnly.values) { - return matchTags(rule, runOnly.values); - } else { - return matchTags(rule, []); + function pushUniqueFrame(context, frame) { + if (!_isVisibleToScreenReaders(frame) || find_by_default(context.frames, 'node', frame)) { + return; } + context.frames.push(createFrameContext(frame, context)); } - var rule_should_run_default = ruleShouldRun; - function _filterHtmlAttrs(element, filterAttrs) { - if (!filterAttrs) { - return element; + function isPageContext(_ref78) { + var include = _ref78.include; + return include.length === 1 && include[0].actualNode === document.documentElement; + } + function validateContext(context) { + if (context.include.length === 0 && context.frames.length === 0) { + var env = _respondable.isInFrame() ? 'frame' : 'page'; + throw new Error('No elements found for include in ' + env + ' Context'); } - var node = element.cloneNode(false); - var attributes2 = get_node_attributes_default(node); - if (node.nodeType === 1) { - var outerHTML = node.outerHTML; - node = cache_default.get(outerHTML, function() { - return setNodeAttributes(node, attributes2, element, filterAttrs); - }); - } else { - node = setNodeAttributes(node, attributes2, element, filterAttrs); + } + function getRootNode2(_ref79) { + var include = _ref79.include, exclude = _ref79.exclude; + var selectors = Array.from(include).concat(Array.from(exclude)); + for (var _i23 = 0; _i23 < selectors.length; _i23++) { + var item = selectors[_i23]; + if (item instanceof window.Element) { + return item.ownerDocument.documentElement; + } + if (item instanceof window.Document) { + return item.documentElement; + } } - Array.from(element.childNodes).forEach(function(child) { - node.appendChild(_filterHtmlAttrs(child, filterAttrs)); - }); - return node; + return document.documentElement; } - function setNodeAttributes(node, attributes2, element, filterAttrs) { - if (!attributes2) { - return node; + function _getFrameContexts(context) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + if (options.iframes === false) { + return []; } - node = document.createElement(node.nodeName); - Array.from(attributes2).forEach(function(attr) { - if (!attributeMatches(element, attr.name, filterAttrs)) { - node.setAttribute(attr.name, attr.value); - } + var _Context = new Context(context), frames = _Context.frames; + return frames.map(function(_ref80) { + var node = _ref80.node, frameContext = _objectWithoutProperties(_ref80, _excluded14); + frameContext.initiator = false; + var frameSelector = _getAncestry(node); + return { + frameSelector: frameSelector, + frameContext: frameContext + }; }); - return node; } - function attributeMatches(node, attrName, filterAttrs) { - if (typeof filterAttrs[attrName] === 'undefined') { - return false; - } - if (filterAttrs[attrName] === true) { - return true; + function _getRule(ruleId) { + var rule = axe._audit.rules.find(function(_ref81) { + var id = _ref81.id; + return id === ruleId; + }); + if (!rule) { + throw new Error('Cannot find rule by id: '.concat(ruleId)); } - return element_matches_default(node, filterAttrs[attrName]); + return rule; } - function _select(selector, context) { - var result = []; - var candidate; - if (axe._selectCache) { - for (var j = 0, l = axe._selectCache.length; j < l; j++) { - var item = axe._selectCache[j]; - if (item.selector === selector) { - return item.result; - } - } - } - var outerIncludes = getOuterIncludes(context.include); - var isInContext = getContextFilter(context); - for (var _i25 = 0; _i25 < outerIncludes.length; _i25++) { - candidate = outerIncludes[_i25]; - var nodes = query_selector_all_filter_default(candidate, selector, isInContext); - result = mergeArrayUniques(result, nodes); + function getScroll(elm) { + var buffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var overflowX = elm.scrollWidth > elm.clientWidth + buffer; + var overflowY = elm.scrollHeight > elm.clientHeight + buffer; + if (!(overflowX || overflowY)) { + return; } - if (axe._selectCache) { - axe._selectCache.push({ - selector: selector, - result: result - }); + var style = window.getComputedStyle(elm); + var scrollableX = isScrollable(style, 'overflow-x'); + var scrollableY = isScrollable(style, 'overflow-y'); + if (overflowX && scrollableX || overflowY && scrollableY) { + return { + elm: elm, + top: elm.scrollTop, + left: elm.scrollLeft + }; } - return result; } - function getOuterIncludes(includes) { - return includes.reduce(function(res, el) { - if (!res.length || !_contains(res[res.length - 1], el)) { - res.push(el); + function isScrollable(style, prop) { + var overflowProp = style.getPropertyValue(prop); + return [ 'scroll', 'auto' ].includes(overflowProp); + } + var get_scroll_default = memoize_default(getScroll); + function getElmScrollRecursive(root) { + return Array.from(root.children || root.childNodes || []).reduce(function(scrolls, elm) { + var scroll = get_scroll_default(elm); + if (scroll) { + scrolls.push(scroll); } - return res; + return scrolls.concat(getElmScrollRecursive(elm)); }, []); } - function getContextFilter(context) { - if (!context.exclude || context.exclude.length === 0) { - return null; - } - return function(node) { - return _isNodeInContext(node, context); - }; + function getScrollState() { + var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window; + var root = win.document.documentElement; + var windowScroll = [ win.pageXOffset !== void 0 ? { + elm: win, + top: win.pageYOffset, + left: win.pageXOffset + } : { + elm: root, + top: root.scrollTop, + left: root.scrollLeft + } ]; + return windowScroll.concat(getElmScrollRecursive(document.body)); } - function mergeArrayUniques(arr1, arr2) { - if (arr1.length === 0) { - return arr2; - } - if (arr1.length < arr2.length) { - var temp = arr1; - arr1 = arr2; - arr2 = temp; + var get_scroll_state_default = getScrollState; + function _getStandards() { + return _clone(standards_default); + } + function getStyleSheetFactory(dynamicDoc) { + if (!dynamicDoc) { + throw new Error('axe.utils.getStyleSheetFactory should be invoked with an argument'); } - for (var _i26 = 0, l = arr2.length; _i26 < l; _i26++) { - if (!arr1.includes(arr2[_i26])) { - arr1.push(arr2[_i26]); + return function(options) { + var data = options.data, _options$isCrossOrigi = options.isCrossOrigin, isCrossOrigin = _options$isCrossOrigi === void 0 ? false : _options$isCrossOrigi, shadowId = options.shadowId, root = options.root, priority = options.priority, _options$isLink = options.isLink, isLink = _options$isLink === void 0 ? false : _options$isLink; + var style = dynamicDoc.createElement('style'); + if (isLink) { + var text = dynamicDoc.createTextNode('@import "'.concat(data.href, '"')); + style.appendChild(text); + } else { + style.appendChild(dynamicDoc.createTextNode(data)); } - } - return arr1; + dynamicDoc.head.appendChild(style); + return { + sheet: style.sheet, + isCrossOrigin: isCrossOrigin, + shadowId: shadowId, + root: root, + priority: priority + }; + }; } - function setScroll(elm, top, left) { - if (elm === window) { - return elm.scroll(left, top); - } else { - elm.scrollTop = top; - elm.scrollLeft = left; + var get_stylesheet_factory_default = getStyleSheetFactory; + var styleSheet; + function injectStyle(style) { + if (styleSheet && styleSheet.parentNode) { + if (styleSheet.styleSheet === void 0) { + styleSheet.appendChild(document.createTextNode(style)); + } else { + styleSheet.styleSheet.cssText += style; + } + return styleSheet; } + if (!style) { + return; + } + var head = document.head || document.getElementsByTagName('head')[0]; + styleSheet = document.createElement('style'); + styleSheet.type = 'text/css'; + if (styleSheet.styleSheet === void 0) { + styleSheet.appendChild(document.createTextNode(style)); + } else { + styleSheet.styleSheet.cssText = style; + } + head.appendChild(styleSheet); + return styleSheet; } - function setScrollState(scrollState) { - scrollState.forEach(function(_ref79) { - var elm = _ref79.elm, top = _ref79.top, left = _ref79.left; - return setScroll(elm, top, left); - }); - } - var set_scroll_state_default = setScrollState; - function _shadowSelect(selectors) { - var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ]; - return selectRecursive(selectorArr, document); - } - function selectRecursive(selectors, doc) { - var selectorStr = selectors.shift(); - var elm = selectorStr ? doc.querySelector(selectorStr) : null; - if (selectors.length === 0) { - return elm; + var inject_style_default = injectStyle; + function isHidden(el, recursed) { + var node = get_node_from_tree_default(el); + if (el.nodeType === 9) { + return false; } - if (!(elm !== null && elm !== void 0 && elm.shadowRoot)) { - return null; + if (el.nodeType === 11) { + el = el.host; } - return selectRecursive(selectors, elm.shadowRoot); + if (node && node._isHidden !== null) { + return node._isHidden; + } + var style = window.getComputedStyle(el, null); + if (!style || !el.parentNode || style.getPropertyValue('display') === 'none' || !recursed && style.getPropertyValue('visibility') === 'hidden' || el.getAttribute('aria-hidden') === 'true') { + return true; + } + var parent = el.assignedSlot ? el.assignedSlot : el.parentNode; + var hidden = isHidden(parent, true); + if (node) { + node._isHidden = hidden; + } + return hidden; } - function _shadowSelectAll(selectors) { - var doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; - var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ]; - if (selectors.length === 0) { - return []; + var is_hidden_default = isHidden; + function isHtmlElement(node) { + var _node$props$nodeName, _node$props; + var nodeName2 = (_node$props$nodeName = (_node$props = node.props) === null || _node$props === void 0 ? void 0 : _node$props.nodeName) !== null && _node$props$nodeName !== void 0 ? _node$props$nodeName : node.nodeName.toLowerCase(); + if (node.namespaceURI === 'http://www.w3.org/2000/svg') { + return false; } - return selectAllRecursive(selectorArr, doc); + return !!standards_default.htmlElms[nodeName2]; } - function selectAllRecursive(_ref80, doc) { - var _ref81 = _toArray(_ref80), selectorStr = _ref81[0], restSelector = _ref81.slice(1); - var elms = doc.querySelectorAll(selectorStr); - if (restSelector.length === 0) { - return Array.from(elms); + var is_html_element_default = isHtmlElement; + function _isNodeInContext(node, _ref82) { + var _ref82$include = _ref82.include, include = _ref82$include === void 0 ? [] : _ref82$include, _ref82$exclude = _ref82.exclude, exclude = _ref82$exclude === void 0 ? [] : _ref82$exclude; + var filterInclude = include.filter(function(candidate) { + return _contains(candidate, node); + }); + if (filterInclude.length === 0) { + return false; } - var selected = []; - var _iterator13 = _createForOfIteratorHelper(elms), _step13; + var filterExcluded = exclude.filter(function(candidate) { + return _contains(candidate, node); + }); + if (filterExcluded.length === 0) { + return true; + } + var deepestInclude = getDeepest(filterInclude); + var deepestExclude = getDeepest(filterExcluded); + return _contains(deepestExclude, deepestInclude); + } + function getDeepest(collection) { + var deepest; + var _iterator12 = _createForOfIteratorHelper(collection), _step12; try { - for (_iterator13.s(); !(_step13 = _iterator13.n()).done; ) { - var elm = _step13.value; - if (elm !== null && elm !== void 0 && elm.shadowRoot) { - selected.push.apply(selected, _toConsumableArray(selectAllRecursive(restSelector, elm.shadowRoot))); + for (_iterator12.s(); !(_step12 = _iterator12.n()).done; ) { + var node = _step12.value; + if (!deepest || !_contains(node, deepest)) { + deepest = node; } } } catch (err) { - _iterator13.e(err); + _iterator12.e(err); } finally { - _iterator13.f(); + _iterator12.f(); } - return selected; - } - function validInputTypes() { - return [ 'hidden', 'text', 'search', 'tel', 'url', 'email', 'password', 'date', 'month', 'week', 'time', 'datetime-local', 'number', 'range', 'color', 'checkbox', 'radio', 'file', 'submit', 'image', 'reset', 'button' ]; + return deepest; } - var valid_input_type_default = validInputTypes; - var langs = [ , [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , , , , , 1, 1, 1, 1, , , 1, 1, 1, , 1, , 1, , 1, 1 ], [ 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, 1, 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , , , , 1, , 1, , , , 1, 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, , , 1, , , , , 1, 1, 1, , 1, , 1, , 1, , , , , , 1 ], [ 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, , 1, , 1, , , , , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , 1, , 1, , , , 1, 1, 1, , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, 1, 1, , , , , 1, , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, , 1, 1, 1, , 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, , , 1, 1, , , , , , 1, 1 ], [ 1, 1, 1, , , , , 1, , , , 1, 1, , 1, , , , , , 1, , , , , 1 ], [ , 1, , , 1, , , 1, , , , , , 1 ], [ , 1, , 1, , , , 1, , , , 1 ], [ 1, , 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, , , 1, , 1, 1, , 1, , 1, , , , , 1, , 1 ], [ , 1, , , , 1, , , 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, , , 1, , , 1 ], [ , 1, 1, , , , , , 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, , 1, , , , , 1, 1, , 1, , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, , , , 1, 1, 1, , 1, 1, , , 1, 1, , 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, , 1, 1, 1, , 1, , , , , 1, 1, 1, , , 1, , 1, , , 1, 1 ], [ , , , , 1, , , , , , , , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, , 1, 1, 1, , 1, 1, , , , 1, 1, 1, 1, 1, , , 1, 1, 1, , , , , 1 ], [ 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , , , , , 1, , , , , , , 1 ], [ , 1, 1, , 1, 1, , 1, , , , , , , , , , , , , 1 ], , [ 1, 1, 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , 1, , , 1, , , 1, 1, , , , , 1 ] ], [ , [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , , , 1, , , , , , , , , , , , , , , 1 ], [ , 1, , , 1, 1, , 1, , 1, 1, , , , 1, 1, , , 1, 1, , , , 1 ], [ 1, , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , 1, , , , 1 ], , [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, , , 1, 1, 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, , , 1, , 1, , , 1, 1, 1, 1, , , 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, , , 1, , , 1, , 1 ], [ , 1, , , , , , , , , , 1, 1, , , , , , 1, 1, , , , , 1 ], [ , , , , , , , 1, , , , 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, , , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , 1, 1, 1, , , 1, 1, , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, , 1, 1, , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , , , , , , 1 ], , [ , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, , 1 ], [ , , 1, , , 1, , , 1, 1, , , 1, , 1, 1, , 1 ], [ , 1, 1, , 1, , , , 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1 ], [ , 1, , , , , , , , , , 1, 1, , , , , , 1, 1, , 1, , 1, , 1, 1 ], , [ , 1, 1, , 1, , , 1, , 1, , , , 1, 1, 1, , , , , , 1, , , , 1 ], [ 1, 1, , , 1, 1, , 1, , , , , 1, , 1 ] ], [ , [ , 1 ], [ , , , 1, , , , 1, , , , 1, , , , 1, , , 1, , , 1 ], [ , , , , , , , , , , , , , , , , , , 1, 1, , , , , , 1 ], , [ 1, , , , , 1 ], [ , 1, , , , 1, , , , 1 ], [ , 1, , , , , , , , , , , 1, , , 1, , , , , , , , , 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , 1, , , , 1, , 1 ], [ , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, , 1, 1, , 1, , , , , , , 1 ], [ 1, , , , , 1, , , 1, 1, , 1, , 1, , 1, 1, , , , , 1, , , 1 ], [ , 1, 1, , , 1, , 1, , 1, , 1, , 1, 1, 1, 1, , , 1, , 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, , 1, , , , 1, 1, 1, 1, , 1, 1, , , 1, 1, 1, 1 ], [ 1, , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , 1 ], , [ , 1, , , , , , 1, 1, 1, , 1, , , , 1, , , 1, 1, 1, , , 1 ], [ 1, , , , , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, , 1, , 1, , 1, , , 1, 1 ], [ 1, , 1, 1, , , , , 1, , , , , , 1, 1, , , 1, 1, 1, 1, , , 1, , 1 ], [ 1, , , , , , , , , , , , , , , , , 1 ], [ , , , , , 1, , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , , 1 ], [ , 1, , , , 1 ] ], [ , [ 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, , , 1, 1, 1 ], [ , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], , [ , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , , , , , , , 1, , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], , [ 1, 1, , , , 1, 1, , , , , , 1, , , , 1, , 1, , 1, 1, , 1 ], [ 1 ], [ , , , , , , , , , , , 1, , , , , , , , , , , 1 ], [ , 1, , , , , , , 1, 1, , , 1, , 1, , , , 1, , , , , , , 1 ], [ , , , , , , , , , , , , , , , , 1, , , , , 1 ], [ , , 1, , , , , 1, , 1 ], [ 1, , , , 1, , , , , 1, , , , 1, 1, , , , 1, 1, , , , , 1 ], [ , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , 1, 1, , , , , , , 1, , 1, , 1, 1, 1, 1, 1, 1 ], [ , , , , , 1, , , , , , , 1, , , , , , , 1 ], , [ , , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, , , 1, 1, , 1, 1, 1, , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , 1 ], , [ 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, , , , , , 1, , 1, , , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1, , , 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , 1, , , , , , , , , 1, , , , 1 ], [ , 1, 1, , 1, 1, , 1, , , , 1, 1, , 1, 1, , , 1, , 1, 1, , 1 ], [ , 1, , 1, , 1, , , 1, , , 1, 1, , 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , , , , , , , , , 1, , 1, , 1, 1, , , , 1, , , 1 ], [ , 1, , , 1, 1, , , , , , , , , 1, 1, 1, , , , , 1 ], [ 1, , , 1, 1, , , , 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, , , , 1, 1, 1, , , 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1 ], [ , 1, , , , , , , , 1, , , , , 1, , , , 1, , , 1 ], [ , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , 1, , 1, , , , , 1, 1, 1, 1, 1, , , 1, , , , 1 ], [ , 1, , , , , , , , 1, , , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, , 1, , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , 1, 1, , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1, 1, , , , 1, , 1, 1, , 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , 1, 1, 1, 1, , 1, , , 1, 1, 1, 1, , , 1, , , , , , , 1 ], [ , 1, , , , , , , , 1, , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , , , , , , , , 1, 1, , , , , , 1 ], [ , 1, , , , , , , 1 ], [ , , , , , , , , , , , , , , 1, , , , , 1, , , , , , 1 ], [ 1, 1, , , 1, , , 1, 1, 1, , , , 1 ], , [ , , , , , , , , , , , , , 1, , , , , , , , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , 1, , , , , , , 1 ], [ 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, , , 1, , 1, , , 1, 1 ], [ , , , , , , , , , 1 ], [ , 1, , , , 1, , , , , , 1, , , 1, , , , , 1 ], [ , 1, 1, , 1, 1, , , , , , , , , , , , , , , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, 1, 1, 1, , , , 1, 1, , , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1 ], [ , , , , , , , , , , , , , , , 1, , , , 1 ], , [ 1, 1, , 1, , 1, , , , , , 1, , 1, , 1, 1, , 1, , 1, 1, , 1, 1, , 1 ], [ , , 1, , , , , , 1, , , , 1, , 1, , , , , 1 ], [ 1, , , , , , , , , 1, , , , , , 1, , , , 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, , 1, , , , , , 1, , , 1, , , , , , , , 1 ], [ , 1, , 1, , , , , , , , , , , , 1 ], , [ 1, 1, , , , , , , , , , , , , , , , , , , , , , 1, 1 ], [ 1 ] ], [ , [ 1, , , , , , , , , 1, , , , , 1, , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, 1, , , 1, 1, 1, , , , 1, , , 1, , , , 1 ], [ , 1, , , , , , , 1, , , , 1, , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , , , 1, , , , , , , , , 1, 1, 1, 1 ], [ 1 ], [ , 1, 1, , , 1, 1, , , , , 1, , 1, , , , , , , , 1, , , , 1 ], [ 1, , 1, , , 1, , 1, , , , , 1, 1, 1, 1, , , , 1, , , , 1 ], [ , , 1, , , , , , , 1, , , , , , , 1, , , , , , , 1 ], [ 1, , , , , , , , , , , , , , 1, , , , 1 ], [ , , , 1, , 1, , , , , 1, , , , 1, 1, , , , 1 ], [ 1, , , , , 1, , , , 1, , 1, 1, , , 1, 1, , 1, 1, 1, , 1, 1, 1, , 1 ], [ , 1, 1, , , , , 1, , 1, , 1, 1, 1, , 1, 1, , , 1, , 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , , 1, , 1, 1, , , 1, 1, , , , , , 1 ], [ 1, , 1, 1, , 1, , 1, 1, , 1, , 1, 1, 1, 1, 1, , , 1, 1, , , , , , 1 ], [ 1, , , , , , , , , , , , , , , , , , 1, , , 1, , 1 ], [ , , , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , , 1, , 1 ], [ , 1, , , , 1, , , 1, 1, , 1, , , 1, 1, , , 1, , , 1, , , 1, 1 ], [ 1, 1, , 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, , 1, 1 ], [ 1, , 1, 1, 1, 1, , , , 1, , 1, 1, 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, , , , , , , , , , , , , 1 ], [ , , 1, , , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , , , , , , , , , 1, , 1, , 1, , , , 1 ], [ , , , 1, , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , , 1, , , , , , , , , 1 ], [ , , , , , , , , 1, 1, , , , , , , , , 1, , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , , , , , 1, , , , 1, 1, 1, , , 1, 1, , , 1, , 1, 1, , 1 ], [ , , , , , , , , , , , , , , , , , , , 1, 1 ], [ , 1, , , , , , 1, , , , , , , , , , , , , 1 ], [ , , 1, , , 1, , 1, 1, 1, , 1, 1, , 1, , , , 1, , 1, 1 ], , [ , , 1, , , 1, , , , , , 1, , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, , 1, , 1, , , 1, 1, 1, , , 1 ], [ , , , , , 1, , , , , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , 1, , 1, 1, , 1, , , 1 ], [ , , , , , 1, , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, 1, , , , , 1, , , 1, , 1, , , , 1, 1, , , , 1, 1 ], [ , 1, , , 1, , , 1, , 1, 1, , 1, , , , , , , 1 ], [ , , 1, , 1, , , 1, , , , , , , , , , , 1, 1, , , , 1 ], [ , 1, , , , , , , , , , , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , , , , , , , , , , , , , , , 1, , 1, 1 ], [ , , , , , , , , , , , , 1 ], , [ , 1, 1, 1, 1, , , , 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, , 1 ], [ 1, , , , 1, , , , , , , , , , 1 ], [ 1, , , , , , , , , 1 ], , [ , 1, , , , 1, , , , , , , , , , , , , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, , 1, , , , 1, 1, , , 1, 1, , 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ 1, 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, , 1, 1, , , , , 1 ], [ , 1, , , , , , , 1, 1, , , 1, 1, 1, , 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , , 1, , , , 1, , , , , , , 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, , , 1, 1, 1, 1, , 1, 1, 1, 1, , , , 1, , 1, , 1, , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1, 1, , , , , , , , , 1 ], , [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , , 1, , 1, , 1, , , , 1 ], [ , 1, , , 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , , 1 ], [ 1, , , 1, , , , 1, 1, 1, , , , , 1, 1, , , , 1, , 1 ], [ 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, , , , , , , , 1, , 1, , , , , , , , 1, , 1 ], [ , 1, , , , 1, , 1, 1, , , , 1, 1, , 1, , , , 1, 1, 1, , 1 ], , [ , 1, , , , , , 1, , , , , , , 1 ], [ , , , , , , , , 1, , , , 1, , 1, , , , , , , , , , , , 1 ] ], [ , [ , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, , , , , , , , 1, , , , , , 1, , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , , 1, , 1, 1, , , , 1, , 1, , , 1, 1 ], [ , , , , , , , 1, , , , 1, 1, 1, 1, 1, , 1, , , , , , , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, , 1, , 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , 1, 1, , 1, , 1, 1, 1, , 1, , 1, 1, , 1, 1, , 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , , , , , , 1, , , , , 1, , 1 ], [ , 1, 1, 1, , 1, , 1, , 1, , , , 1, , 1, , , 1, , , , , , 1, 1 ], [ , 1, , , 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, , , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , , , 1, , 1, , 1, , , , , , 1, , 1, , , , 1, 1 ] ], [ , [ , 1, , 1, , , , , , , , , , , , , , , 1, , , , 1 ], [ , , , , , , , , , 1, , 1, 1, 1, , 1, , , 1, , 1, 1 ], [ 1, 1, , , , , , , 1, , , , , , , 1, , , , , , 1 ], [ , 1, , , , , , , , , , 1, , , , , , , , , 1, 1 ], , [ , , , , , , , , , , , , , , , 1, , , , 1, , 1 ], [ , , 1, 1, , 1, , 1, , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , 1, 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ 1, , 1, 1, , , , 1, , , , , , , , , 1, , , 1, , , 1, 1 ], [ , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, 1, , , , , , 1, , 1, , 1, , , 1, , 1, 1 ], [ 1, 1, 1, 1, , 1, , 1, , 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, , , 1, , 1, , 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, , 1, 1 ], [ , , , , 1, , , 1, , , , , , , 1, , , , 1, 1 ], [ , 1, , , , , , , , , , 1, , 1, , 1, , , , , 1, , , , , 1 ], , [ 1, 1, , 1, , 1, , 1, 1, , , , , , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, , , , , , 1, , , , , , 1, 1, , , , 1, 1, , , 1 ], [ , 1, 1, , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, , , 1, , , , 1, , , , 1, 1 ], [ , , , , 1 ], [ , , , , , , , , , 1, , , 1 ], , [ , , 1, , 1, , , , , , , , , 1, , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, , 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , , , , 1 ], [ , 1, , 1, , , , , , 1, , , , , 1, 1, , , , , 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , , 1, , 1, 1, 1 ], [ , 1, , , , 1, , , , , , , 1 ], [ , 1, , , 1, , , 1, , 1, , 1, 1, , 1, , , , , 1, , 1, , , , 1, 1 ], [ , 1, , , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, , , , 1, 1, , , , , , 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , 1, , , , , , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1 ], [ 1, 1, , , , , , , 1, 1, , , , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], , [ , 1, 1, , , , , 1, , 1, , , , 1, 1, 1, , , 1, , , , , 1 ], [ , , , , , , , , , , , , , 1 ], [ , , , , , 1, , , , , , , , 1, 1, , , , , 1, , 1, , , 1, 1 ], [ , , , , , , , , , , , , , , 1 ] ], [ , [ , 1 ], , , , , , , , , , , , , , , , , , , , [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, , , , 1, , 1, 1 ], [ , 1, , 1, , 1, , , 1, , , , , 1, , , , , , 1, 1 ], [ , 1, , 1, , , , , 1, , , , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, , , , , , , , , , , , , , , 1 ] ], [ , [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , , , , , , , 1, 1, , , , 1 ], [ , , , , , , 1 ], [ , , 1 ], [ , 1, 1, , , 1, , 1, , 1, 1, , 1, 1, 1, , , , 1, 1, 1, , , , , 1 ], , [ , 1, , , , 1, , , , , , 1, , , 1, , , , 1, 1, , 1 ], [ , , , , , , , 1, , , , , , , , , 1 ], [ , 1, , , , 1, 1, , , , , , 1, 1, 1, , , , 1, , 1, 1 ], [ , , , , , , , 1, , 1, , , , , , , , , , 1 ], [ , 1, 1, , , , , , 1, 1, , , , 1, , , , , , , 1, , , 1 ], , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , , 1, , , 1, , , , , 1, , 1, , 1, , 1, , , , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , , , 1, 1, , 1, 1, , 1, , , 1, , 1 ], [ , , , , , , , , , , , , , , 1, , , , , , 1 ], , [ , , , , , , , , , 1, , , , , , 1, , , , , 1 ], [ , , 1, , , , , , , 1, , , 1, 1 ], [ , , , 1, , , , , 1, , , , , 1, , , , , , 1, , , , 1 ], [ 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, , , , 1, 1, 1, , , 1, 1, , , , 1, 1 ], , [ 1, 1, , , , , , , , , , 1, , 1, , 1, , , 1 ], [ , , , , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , 1, , , , , 1, , 1 ], [ , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , , 1, , , 1, , , , , , , , 1, , , , , , 1, , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, , 1, , , , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, , , , , , , 1, , 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, , , , , , 1, , 1, , , , , 1, 1, , , , , 1 ], [ 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, , 1, , 1, , , , 1, 1, 1, 1, 1, , , 1, 1, , 1, , 1 ], [ , 1, 1, 1, 1, , , , , 1, , 1, 1, 1, 1, 1, , , 1, 1, , , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , , , , 1, , 1, , 1, , , 1, , , 1, 1, , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , 1, , , , , 1, 1, , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , 1, , 1, 1, , 1, 1, 1, 1, 1, , , 1, , 1, , 1 ], [ 1, 1, 1, , 1, 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , , , , , , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , , , , , 1, 1, 1, 1, 1, , , , 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, , 1, , 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1 ], [ 1, 1, , , , 1, , , 1, 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, , 1 ], [ , 1, , , , , , , 1, , 1, , 1, 1, 1, 1, , , , , , , , , 1 ] ], [ , [ , , , , , , , , , , , , , 1, 1, , , , 1 ], [ , 1, , , , , , , , 1, , , 1, , , , , , 1, , , 1, , , , 1 ], , [ , 1, , , , 1, , 1, , 1, 1, , 1, 1, , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , 1 ], [ 1, 1, 1, , , 1, , , , , , , , , 1, 1, , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1, , , 1 ], [ , , , , , , , , , 1 ], [ 1, 1, , , , , , 1, 1, 1, , 1, 1, , , , 1, 1, , 1, , 1, 1, 1, , 1 ], [ , 1, 1, 1, , 1, 1, , , 1, , 1, 1, 1, 1, , , , , , , 1, , 1 ], [ , 1, 1, 1, 1, , , 1, , 1, , , , 1, 1, 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , 1, 1, , 1, , 1, , , 1, , , 1, , 1 ], [ , , , , , , , , , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , , , , , 1 ], , [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , 1, 1, , 1, , , , , 1, , , 1, , 1 ], [ , 1, , , , 1, , , 1, , , , , , , , 1, , 1, , , 1 ], [ , , , , , , , , , , , , , 1, 1, , , , 1, , , 1 ], [ , , , , , 1, , , 1, , , , 1 ], [ , 1 ], , [ , 1 ], [ 1, , , , , , , , , , , , , , 1, , , , , 1 ] ], [ , [ , 1, , , , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, , , 1 ], [ , , 1, , , , , , , , , 1 ], , , [ 1, , , 1, 1, , , , , , , , 1, 1, , 1, 1, , 1 ], , [ , , , , , , , , , , , , , , , , , , 1, , 1 ], , [ 1, , , 1, 1, , 1, 1, , , , , 1, , 1, , , , , 1, 1, , 1 ], , [ , 1, , , , , , , , 1, 1, 1, 1, 1, , 1, 1, , , , 1, 1 ], [ , , , , , , , , , , , , , , , , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , 1, , 1, , , 1 ], [ 1, , , , , , , , , , , , , , , , , , 1, , 1 ], , , [ , 1, , , , , , , , , , , , , , 1, , , , 1, 1 ], [ , , , , , , , , , 1, , , 1, , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , 1, 1, , , , , , 1 ], , [ , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , 1, 1, , 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, , , , , , , , 1 ], [ , , , , 1, , , 1, , , 1, 1, , , , , , , , , , 1, , , , 1 ], [ , 1, , 1, 1, , , 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , , , , , , , 1 ], [ , 1, 1, , , , , 1, , 1, , , , , , 1, , , , , , 1, , 1, , 1 ], [ , 1, , , , , , 1, , , , 1, , , , , , , , , , 1 ], [ , , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, , , , , , , , 1 ], [ , 1, 1, , 1, , , , , , , , 1, , , , , , 1, , , 1, , 1, , 1 ], [ , 1, , 1, , 1, , 1, 1, 1, , 1, 1, 1, , 1, , , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, , , , 1, 1, 1, , , , 1, 1, , , 1, 1 ], [ , , 1, 1, 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, , , , , 1, , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, , , 1, 1, , , , 1, , 1 ], [ , , , 1 ], , [ , 1, 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , 1, , , , , , , 1, 1, , 1, 1 ], [ , , , , , , 1, , 1, 1, , 1, , 1, , , , , , , , , , 1 ], [ , 1, 1, , 1, , , , 1, , , , 1, 1, 1, , , , 1, , 1, 1, 1, , 1, 1 ], , [ , 1, 1, , , , , , , , , , , , , 1, , , 1, , , , , 1 ], [ , 1, , , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , , , , , , 1, , , , 1, , , , , 1, , , , , , , 1 ] ], [ , [ , 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, , 1, , 1, 1, , , 1, 1, 1, 1, , 1, , , , , 1, 1, 1 ], [ , , 1, 1, , 1, , 1, 1, , , , 1, 1, 1, 1, , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, , 1, , , , , , , , 1, , 1, , 1, , , , , , , , , , 1 ], [ , , 1, , 1, , , 1, , , , , 1, 1, , , 1, , 1, 1, 1, 1 ], [ , 1 ], [ , 1, 1, , 1, , 1, 1, , 1, , , 1, 1, 1, , , , 1, , , 1, , 1 ], [ 1, 1, , 1, 1, 1, , , , , , , , , , , , , 1, , 1, 1, 1 ], [ , 1, 1, , , , , , , 1, , , 1, , 1, , 1, , 1, 1, , , 1, , , 1 ], [ , , 1, , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , 1, , , , , 1, 1, 1, , , 1, , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , 1, 1, 1, , 1, , 1, 1, 1, , , 1, 1, 1, 1, , , , 1, 1 ], [ , , , 1, 1, , , 1, , 1, , 1, , 1, 1, 1, 1, , 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , 1, 1, , 1, , 1, , , , 1, 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, , 1, , , 1, , , 1, , 1, 1, 1, 1, 1, , 1, , 1, 1 ], [ , , , , , 1, , , , 1, , , , , 1, 1, , , , 1 ], [ , 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, , , 1, , 1, , , 1 ], [ , , 1, , , , , , , , , 1, , 1, , , , , 1, , 1 ], [ , 1, 1, , , , , , , , 1, 1, 1, , , , , , , , 1, , , , , 1 ], [ , , , , , , , , 1, , , , , 1, , , 1 ] ], [ , [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, , , , , , , , , 1, 1 ], [ , , , , , , , , 1, , , , 1, , 1, , 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , , , , , , , 1 ], [ , 1, , 1, , 1, , , , 1, 1, , 1, , 1, , , , 1, 1, 1, 1, 1, , , 1 ], , [ , 1, , , , , , , , 1, , , 1, 1, , , 1, , 1, 1, , 1, , 1 ], [ , 1, , , 1, , , , , , , , 1, , , , , , , 1 ], [ 1, 1, , , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], , [ , 1, , , , , , 1, , 1, , 1, 1, 1, 1, 1, , , 1, , 1, 1, , , , 1 ], [ , 1, 1, , , 1, , 1, , 1, , , 1, 1, 1, 1, , , 1, , , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1 ], [ , 1, , , 1, 1, , 1, 1, , , 1, 1, , 1, 1, , 1, , 1, , 1 ], [ 1, , 1, , , , , 1, , 1, , 1, 1, 1, 1, , , , , 1, 1, , , , 1, 1 ], [ , 1, 1, , , , , 1, 1, , , 1, , 1, 1, 1, 1, , , , , , , , , , 1 ], , [ , 1, 1, , , 1, , , , 1, , 1, 1, 1, 1, 1, , , , 1, , , , 1, , 1 ], [ , , , 1, 1, , , 1, , , , , 1, , 1, 1, 1, , 1, 1, , , , , , 1 ], [ , 1, , , , , , , , , , , 1, , , , 1, , , , , , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , , , 1, , , , , 1, , 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, , , , , , 1, , , , , 1, 1, , , , , , , , 1, , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1, , , 1, , , , , 1 ], [ , , , , , , , 1, , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, , , , , , , 1, , , , , , , , 1, , , 1 ], [ , 1, , , , , , , 1 ], [ , , , , , , , , , , 1 ], [ , 1, , , , , , 1, 1, , , , , , 1 ], , [ , 1, 1, , , , , , 1, , , , , 1, 1, , , , 1 ], [ 1, , 1, , 1, , , , , 1, , , , , 1, , , , , , , , , 1, 1 ], [ , 1, 1, , , , , , , , , 1, 1, 1, 1, , , , 1, , , , , 1, , , 1 ], , [ , 1, 1, , 1, , , 1, 1, , , 1, , , 1, 1, 1, , 1, , 1, 1, 1, , , , 1 ], [ , , , , , 1, , , , , 1, , , 1, 1, , , 1, , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , , , , , , , 1 ], [ , , , 1, , , , , 1, , , , , 1, , 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , 1 ], [ , 1, , , , , , 1, , , , , , , 1, 1, 1, , , 1 ], [ , 1, , , , , , , , , , 1, 1, 1, , , , , 1, , , 1 ], [ , , , , , 1, , 1, , , , , 1, 1, 1, , 1, 1, , 1, 1, 1, , , 1, 1 ], [ 1, 1, , , , , , , 1, , , , , 1, 1, , , , , , , , , , , 1 ], , [ , 1 ], [ , , , , , , , , , , , , , , , , , , , , , , , , 1 ], [ , , 1, , , , , 1, , , 1, , , , 1, , 1 ], [ , 1, , , , , , , , , 1 ] ] ]; - function isValidLang(lang) { - var array = langs; - while (lang.length < 3) { - lang += '`'; + function _matchAncestry(ancestryA, ancestryB) { + if (ancestryA.length !== ancestryB.length) { + return false; } - for (var _i27 = 0; _i27 <= lang.length - 1; _i27++) { - var index = lang.charCodeAt(_i27) - 96; - array = array[index]; - if (!array) { - return false; + return ancestryA.every(function(selectorA, ancestorIndex) { + var selectorB = ancestryB[ancestorIndex]; + if (!Array.isArray(selectorA)) { + return selectorA === selectorB; } - } - return true; - } - function _validLangs(langArray) { - langArray = Array.isArray(langArray) ? langArray : langs; - var codes = []; - langArray.forEach(function(lang, index) { - var _char3 = String.fromCharCode(index + 96).replace('`', ''); - if (Array.isArray(lang)) { - codes = codes.concat(_validLangs(lang).map(function(newLang) { - return _char3 + newLang; - })); - } else { - codes.push(_char3); + if (selectorA.length !== selectorB.length) { + return false; } + return selectorA.every(function(str, selectorIndex) { + return selectorB[selectorIndex] === str; + }); }); - return codes; } - var valid_langs_default = isValidLang; - var SerialVirtualNode = function(_abstract_virtual_nod2) { - _inherits(SerialVirtualNode, _abstract_virtual_nod2); - var _super3 = _createSuper(SerialVirtualNode); - function SerialVirtualNode(serialNode) { - var _this6; - _classCallCheck(this, SerialVirtualNode); - _this6 = _super3.call(this); - _this6._props = normaliseProps(serialNode); - _this6._attrs = normaliseAttrs(serialNode); - return _this6; - } - _createClass(SerialVirtualNode, [ { - key: 'props', - get: function get() { - return this._props; - } - }, { - key: 'attr', - value: function attr(attrName) { - var _this$_attrs$attrName; - return (_this$_attrs$attrName = this._attrs[attrName]) !== null && _this$_attrs$attrName !== void 0 ? _this$_attrs$attrName : null; - } - }, { - key: 'hasAttr', - value: function hasAttr(attrName) { - return this._attrs[attrName] !== void 0; - } - }, { - key: 'attrNames', - get: function get() { - return Object.keys(this._attrs); - } - } ]); - return SerialVirtualNode; - }(abstract_virtual_node_default); - var nodeNamesToTypes = { - '#cdata-section': 2, - '#text': 3, - '#comment': 8, - '#document': 9, - '#document-fragment': 11 - }; - var nodeTypeToName = {}; - var nodeNames = Object.keys(nodeNamesToTypes); - nodeNames.forEach(function(nodeName2) { - nodeTypeToName[nodeNamesToTypes[nodeName2]] = nodeName2; - }); - function normaliseProps(serialNode) { - var _serialNode$nodeName, _ref82, _serialNode$nodeType; - var nodeName2 = (_serialNode$nodeName = serialNode.nodeName) !== null && _serialNode$nodeName !== void 0 ? _serialNode$nodeName : nodeTypeToName[serialNode.nodeType]; - var nodeType = (_ref82 = (_serialNode$nodeType = serialNode.nodeType) !== null && _serialNode$nodeType !== void 0 ? _serialNode$nodeType : nodeNamesToTypes[serialNode.nodeName]) !== null && _ref82 !== void 0 ? _ref82 : 1; - assert_default(typeof nodeType === 'number', 'nodeType has to be a number, got \''.concat(nodeType, '\'')); - assert_default(typeof nodeName2 === 'string', 'nodeName has to be a string, got \''.concat(nodeName2, '\'')); - nodeName2 = nodeName2.toLowerCase(); - var type2 = null; - if (nodeName2 === 'input') { - type2 = (serialNode.type || serialNode.attributes && serialNode.attributes.type || '').toLowerCase(); - if (!valid_input_type_default().includes(type2)) { - type2 = 'text'; - } + function nodeSorter(nodeA, nodeB) { + nodeA = nodeA.actualNode || nodeA; + nodeB = nodeB.actualNode || nodeB; + if (nodeA === nodeB) { + return 0; } - var props = _extends({}, serialNode, { - nodeType: nodeType, - nodeName: nodeName2 - }); - if (type2) { - props.type = type2; + if (nodeA.compareDocumentPosition(nodeB) & 4) { + return -1; + } else { + return 1; } - delete props.attributes; - return Object.freeze(props); } - function normaliseAttrs(_ref83) { - var _ref83$attributes = _ref83.attributes, attributes2 = _ref83$attributes === void 0 ? {} : _ref83$attributes; - var attrMap = { - htmlFor: 'for', - className: 'class' + var node_sorter_default = nodeSorter; + function _nodeLookup(node) { + if (node instanceof abstract_virtual_node_default) { + return { + vNode: node, + domNode: node.actualNode + }; + } + return { + vNode: get_node_from_tree_default(node), + domNode: node }; - return Object.keys(attributes2).reduce(function(attrs, attrName) { - var value = attributes2[attrName]; - assert_default(_typeof(value) !== 'object' || value === null, 'expects attributes not to be an object, \''.concat(attrName, '\' was')); - if (value !== void 0) { - var mappedName = attrMap[attrName] || attrName; - attrs[mappedName] = value !== null ? String(value) : null; - } - return attrs; - }, {}); } - var serial_virtual_node_default = SerialVirtualNode; - function cleanup(resolve, reject) { - resolve = resolve || function res() {}; - reject = reject || axe.log; - if (!axe._audit) { - throw new Error('No audit configured'); + function parseSameOriginStylesheet(sheet, options, priority, importedUrls) { + var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + var rules = Array.from(sheet.cssRules); + if (!rules) { + return Promise.resolve(); } - var q = axe.utils.queue(); - var cleanupErrors = []; - Object.keys(axe.plugins).forEach(function(key) { - q.defer(function(res) { - var rej = function rej2(err2) { - cleanupErrors.push(err2); - res(); - }; - try { - axe.plugins[key].cleanup(res, rej); - } catch (err2) { - rej(err2); - } - }); + var cssImportRules = rules.filter(function(r) { + return r.type === 3; }); - var flattenedTree = axe.utils.getFlattenedTree(document.body); - axe.utils.querySelectorAll(flattenedTree, 'iframe, frame').forEach(function(node) { - q.defer(function(res, rej) { - return axe.utils.sendCommandToFrame(node.actualNode, { - command: 'cleanup-plugin' - }, res, rej); + if (!cssImportRules.length) { + return Promise.resolve({ + isCrossOrigin: isCrossOrigin, + priority: priority, + root: options.rootNode, + shadowId: options.shadowId, + sheet: sheet }); - }); - q.then(function(results) { - if (cleanupErrors.length === 0) { - resolve(results); - } else { - reject(cleanupErrors); - } - })['catch'](reject); - } - var cleanup_default = cleanup; - var reporters = {}; - var defaultReporter; - function hasReporter(reporterName) { - return reporters.hasOwnProperty(reporterName); - } - function getReporter(reporter) { - if (typeof reporter === 'string' && reporters[reporter]) { - return reporters[reporter]; } - if (typeof reporter === 'function') { - return reporter; + var cssImportUrlsNotAlreadyImported = cssImportRules.filter(function(rule) { + return rule.href; + }).map(function(rule) { + return rule.href; + }).filter(function(url) { + return !importedUrls.includes(url); + }); + var promises = cssImportUrlsNotAlreadyImported.map(function(importUrl, cssRuleIndex) { + var newPriority = [].concat(_toConsumableArray(priority), [ cssRuleIndex ]); + var isCrossOriginRequest = /^https?:\/\/|^\/\//i.test(importUrl); + return parse_crossorigin_stylesheet_default(importUrl, options, newPriority, importedUrls, isCrossOriginRequest); + }); + var nonImportCSSRules = rules.filter(function(r) { + return r.type !== 3; + }); + if (!nonImportCSSRules.length) { + return Promise.all(promises); } - return defaultReporter; + promises.push(Promise.resolve(options.convertDataToStylesheet({ + data: nonImportCSSRules.map(function(rule) { + return rule.cssText; + }).join(), + isCrossOrigin: isCrossOrigin, + priority: priority, + root: options.rootNode, + shadowId: options.shadowId + }))); + return Promise.all(promises); } - function addReporter(name, cb, isDefault) { - reporters[name] = cb; - if (isDefault) { - defaultReporter = cb; + var parse_sameorigin_stylesheet_default = parseSameOriginStylesheet; + function parseStylesheet(sheet, options, priority, importedUrls) { + var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + var isSameOrigin = isSameOriginStylesheet(sheet); + if (isSameOrigin) { + return parse_sameorigin_stylesheet_default(sheet, options, priority, importedUrls, isCrossOrigin); } + return parse_crossorigin_stylesheet_default(sheet.href, options, priority, importedUrls, true); } - function configure(spec) { - var audit; - audit = axe._audit; - if (!audit) { - throw new Error('No audit configured'); - } - if (spec.axeVersion || spec.ver) { - var specVersion = spec.axeVersion || spec.ver; - if (!/^\d+\.\d+\.\d+(-canary)?/.test(specVersion)) { - throw new Error('Invalid configured version '.concat(specVersion)); - } - var _specVersion$split = specVersion.split('-'), _specVersion$split2 = _slicedToArray(_specVersion$split, 2), version = _specVersion$split2[0], canary = _specVersion$split2[1]; - var _version$split$map = version.split('.').map(Number), _version$split$map2 = _slicedToArray(_version$split$map, 3), major = _version$split$map2[0], minor = _version$split$map2[1], patch = _version$split$map2[2]; - var _axe$version$split = axe.version.split('-'), _axe$version$split2 = _slicedToArray(_axe$version$split, 2), axeVersion = _axe$version$split2[0], axeCanary = _axe$version$split2[1]; - var _axeVersion$split$map = axeVersion.split('.').map(Number), _axeVersion$split$map2 = _slicedToArray(_axeVersion$split$map, 3), axeMajor = _axeVersion$split$map2[0], axeMinor = _axeVersion$split$map2[1], axePatch = _axeVersion$split$map2[2]; - if (major !== axeMajor || axeMinor < minor || axeMinor === minor && axePatch < patch || major === axeMajor && minor === axeMinor && patch === axePatch && canary && canary !== axeCanary) { - throw new Error('Configured version '.concat(specVersion, ' is not compatible with current axe version ').concat(axe.version)); + function isSameOriginStylesheet(sheet) { + try { + var rules = sheet.cssRules; + if (!rules && sheet.href) { + return false; } + return true; + } catch (e) { + return false; } - if (spec.reporter && (typeof spec.reporter === 'function' || hasReporter(spec.reporter))) { - audit.reporter = spec.reporter; - } - if (spec.checks) { - if (!Array.isArray(spec.checks)) { - throw new TypeError('Checks property must be an array'); - } - spec.checks.forEach(function(check) { - if (!check.id) { - throw new TypeError('Configured check '.concat(JSON.stringify(check), ' is invalid. Checks must be an object with at least an id property')); + } + var parse_stylesheet_default = parseStylesheet; + function parseCrossOriginStylesheet(url, options, priority, importedUrls, isCrossOrigin) { + importedUrls.push(url); + return new Promise(function(resolve, reject) { + var request = new window.XMLHttpRequest(); + request.open('GET', url); + request.timeout = constants_default.preload.timeout; + request.addEventListener('error', reject); + request.addEventListener('timeout', reject); + request.addEventListener('loadend', function(event) { + if (event.loaded && request.responseText) { + return resolve(request.responseText); } - audit.addCheck(check); + reject(request.responseText); }); - } - var modifiedRules = []; - if (spec.rules) { - if (!Array.isArray(spec.rules)) { - throw new TypeError('Rules property must be an array'); - } - spec.rules.forEach(function(rule) { - if (!rule.id) { - throw new TypeError('Configured rule '.concat(JSON.stringify(rule), ' is invalid. Rules must be an object with at least an id property')); - } - modifiedRules.push(rule.id); - audit.addRule(rule); + request.send(); + }).then(function(data) { + var result = options.convertDataToStylesheet({ + data: data, + isCrossOrigin: isCrossOrigin, + priority: priority, + root: options.rootNode, + shadowId: options.shadowId }); + return parse_stylesheet_default(result.sheet, options, priority, importedUrls, result.isCrossOrigin); + }); + } + var parse_crossorigin_stylesheet_default = parseCrossOriginStylesheet; + var performanceTimer = function() { + function now() { + if (window.performance && window.performance) { + return window.performance.now(); + } } - if (spec.disableOtherRules) { - audit.rules.forEach(function(rule) { - if (modifiedRules.includes(rule.id) === false) { - rule.enabled = false; + var originalTime = null; + var lastRecordedTime = now(); + return { + start: function start() { + this.mark('mark_axe_start'); + }, + end: function end() { + this.mark('mark_axe_end'); + this.measure('axe', 'mark_axe_start', 'mark_axe_end'); + this.logMeasures('axe'); + }, + auditStart: function auditStart() { + this.mark('mark_audit_start'); + }, + auditEnd: function auditEnd() { + this.mark('mark_audit_end'); + this.measure('audit_start_to_end', 'mark_audit_start', 'mark_audit_end'); + this.logMeasures(); + }, + mark: function mark(markName) { + if (window.performance && window.performance.mark !== void 0) { + window.performance.mark(markName); } - }); - } - if (typeof spec.branding !== 'undefined') { - audit.setBranding(spec.branding); - } else { - audit._constructHelpUrls(); - } - if (spec.tagExclude) { - audit.tagExclude = spec.tagExclude; - } - if (spec.locale) { - audit.applyLocale(spec.locale); + }, + measure: function measure(measureName, startMark, endMark) { + if (window.performance && window.performance.measure !== void 0) { + window.performance.measure(measureName, startMark, endMark); + } + }, + logMeasures: function logMeasures(measureName) { + function logMeasure(req2) { + log_default('Measure ' + req2.name + ' took ' + req2.duration + 'ms'); + } + if (window.performance && window.performance.getEntriesByType !== void 0) { + var axeStart = window.performance.getEntriesByName('mark_axe_start')[0]; + var measures = window.performance.getEntriesByType('measure').filter(function(measure) { + return measure.startTime >= axeStart.startTime; + }); + for (var i = 0; i < measures.length; ++i) { + var req = measures[i]; + if (req.name === measureName) { + logMeasure(req); + return; + } + logMeasure(req); + } + } + }, + timeElapsed: function timeElapsed() { + return now() - lastRecordedTime; + }, + reset: function reset() { + if (!originalTime) { + originalTime = now(); + } + lastRecordedTime = now(); + } + }; + }(); + var performance_timer_default = performanceTimer; + function _pollyfillElementsFromPoint() { + if (document.elementsFromPoint) { + return document.elementsFromPoint; } - if (spec.standards) { - configureStandards(spec.standards); + if (document.msElementsFromPoint) { + return document.msElementsFromPoint; } - if (spec.noHtml) { - audit.noHtml = true; - } - if (spec.allowedOrigins) { - if (!Array.isArray(spec.allowedOrigins)) { - throw new TypeError('Allowed origins property must be an array'); + var usePointer = function() { + var element = document.createElement('x'); + element.style.cssText = 'pointer-events:auto'; + return element.style.pointerEvents === 'auto'; + }(); + var cssProp = usePointer ? 'pointer-events' : 'visibility'; + var cssDisableVal = usePointer ? 'none' : 'hidden'; + var style = document.createElement('style'); + style.innerHTML = usePointer ? '* { pointer-events: all }' : '* { visibility: visible }'; + return function(x, y) { + var current, i, d2; + var elements = []; + var previousPointerEvents = []; + document.head.appendChild(style); + while ((current = document.elementFromPoint(x, y)) && elements.indexOf(current) === -1) { + elements.push(current); + previousPointerEvents.push({ + value: current.style.getPropertyValue(cssProp), + priority: current.style.getPropertyPriority(cssProp) + }); + current.style.setProperty(cssProp, cssDisableVal, 'important'); } - if (spec.allowedOrigins.includes('*')) { - throw new Error('"*" is not allowed. Use "'.concat(constants_default.allOrigins, '" instead')); + if (elements.indexOf(document.documentElement) < elements.length - 1) { + elements.splice(elements.indexOf(document.documentElement), 1); + elements.push(document.documentElement); } - audit.setAllowedOrigins(spec.allowedOrigins); - } + for (i = previousPointerEvents.length; !!(d2 = previousPointerEvents[--i]); ) { + elements[i].style.setProperty(cssProp, d2.value ? d2.value : '', d2.priority); + } + document.head.removeChild(style); + return elements; + }; } - var configure_default = configure; - function frameMessenger2(frameHandler) { - _respondable.updateMessenger(frameHandler); + if (typeof window.addEventListener === 'function') { + document.elementsFromPoint = _pollyfillElementsFromPoint(); } - function getRules(tags) { - tags = tags || []; - var matchingRules = !tags.length ? axe._audit.rules : axe._audit.rules.filter(function(item) { - return !!tags.filter(function(tag) { - return item.tags.indexOf(tag) !== -1; - }).length; - }); - var ruleData = axe._audit.data.rules || {}; - return matchingRules.map(function(matchingRule) { - var rd = ruleData[matchingRule.id] || {}; - return { - ruleId: matchingRule.id, - description: rd.description, - help: rd.help, - helpUrl: rd.helpUrl, - tags: matchingRule.tags, - actIds: matchingRule.actIds - }; + function uniqueArray(arr1, arr2) { + return arr1.concat(arr2).filter(function(elem, pos, arr) { + return arr.indexOf(elem) === pos; }); } - var get_rules_default = getRules; - var aria_exports = {}; - __export(aria_exports, { - allowedAttr: function allowedAttr() { - return allowed_attr_default; - }, - arialabelText: function arialabelText() { - return _arialabelText; - }, - arialabelledbyText: function arialabelledbyText() { - return arialabelledby_text_default; - }, - getAccessibleRefs: function getAccessibleRefs() { - return get_accessible_refs_default; - }, - getElementUnallowedRoles: function getElementUnallowedRoles() { - return get_element_unallowed_roles_default; - }, - getExplicitRole: function getExplicitRole() { - return get_explicit_role_default; - }, - getImplicitRole: function getImplicitRole() { - return implicit_role_default; - }, - getOwnedVirtual: function getOwnedVirtual() { - return get_owned_virtual_default; - }, - getRole: function getRole() { - return get_role_default; - }, - getRoleType: function getRoleType() { - return get_role_type_default; - }, - getRolesByType: function getRolesByType() { - return get_roles_by_type_default; - }, - getRolesWithNameFromContents: function getRolesWithNameFromContents() { - return get_roles_with_name_from_contents_default; - }, - implicitNodes: function implicitNodes() { - return implicit_nodes_default; - }, - implicitRole: function implicitRole() { - return implicit_role_default; - }, - isAccessibleRef: function isAccessibleRef() { - return is_accessible_ref_default; - }, - isAriaRoleAllowedOnElement: function isAriaRoleAllowedOnElement() { - return is_aria_role_allowed_on_element_default; - }, - isComboboxPopup: function isComboboxPopup() { - return _isComboboxPopup; - }, - isUnsupportedRole: function isUnsupportedRole() { - return is_unsupported_role_default; - }, - isValidRole: function isValidRole() { - return is_valid_role_default; - }, - label: function label() { - return label_default2; - }, - labelVirtual: function labelVirtual() { - return label_virtual_default; - }, - lookupTable: function lookupTable() { - return lookup_table_default; - }, - namedFromContents: function namedFromContents() { - return named_from_contents_default; - }, - requiredAttr: function requiredAttr() { - return required_attr_default; - }, - requiredContext: function requiredContext() { - return required_context_default; - }, - requiredOwned: function requiredOwned() { - return required_owned_default; - }, - validateAttr: function validateAttr() { - return validate_attr_default; - }, - validateAttrValue: function validateAttrValue() { - return validate_attr_value_default; - } - }); - function allowedAttr(role) { - var roleDef = standards_default.ariaRoles[role]; - var attrs = _toConsumableArray(get_global_aria_attrs_default()); - if (!roleDef) { - return attrs; - } - if (roleDef.allowedAttrs) { - attrs.push.apply(attrs, _toConsumableArray(roleDef.allowedAttrs)); - } - if (roleDef.requiredAttrs) { - attrs.push.apply(attrs, _toConsumableArray(roleDef.requiredAttrs)); - } - return attrs; + var unique_array_default = uniqueArray; + function createLocalVariables(vNodes, anyLevel, thisLevel, parentShadowId, recycledLocalVariable) { + var retVal = recycledLocalVariable || {}; + retVal.vNodes = vNodes; + retVal.vNodesIndex = 0; + retVal.anyLevel = anyLevel; + retVal.thisLevel = thisLevel; + retVal.parentShadowId = parentShadowId; + return retVal; } - var allowed_attr_default = allowedAttr; - var idRefsRegex = /^idrefs?$/; - function cacheIdRefs(node, idRefs, refAttrs) { - if (node.hasAttribute) { - if (node.nodeName.toUpperCase() === 'LABEL' && node.hasAttribute('for')) { - var _id2 = node.getAttribute('for'); - if (!idRefs.has(_id2)) { - idRefs.set(_id2, [ node ]); - } else { - idRefs.get(_id2).push(node); - } - } - for (var _i28 = 0; _i28 < refAttrs.length; ++_i28) { - var attr = refAttrs[_i28]; - var attrValue = sanitize_default(node.getAttribute(attr) || ''); - if (!attrValue) { - continue; - } - var _iterator14 = _createForOfIteratorHelper(token_list_default(attrValue)), _step14; - try { - for (_iterator14.s(); !(_step14 = _iterator14.n()).done; ) { - var token = _step14.value; - if (!idRefs.has(token)) { - idRefs.set(token, [ node ]); + function matchExpressions(domTree, expressions, filter) { + var recycledLocalVariables = cache_default.get('qsa.recycledLocalVariables', function() { + return []; + }); + var stack = []; + var vNodes = Array.isArray(domTree) ? domTree : [ domTree ]; + var currentLevel = createLocalVariables(vNodes, expressions, null, domTree[0].shadowId, recycledLocalVariables.pop()); + var result = []; + while (currentLevel.vNodesIndex < currentLevel.vNodes.length) { + var _currentLevel$anyLeve, _currentLevel$thisLev; + var vNode = currentLevel.vNodes[currentLevel.vNodesIndex++]; + var childOnly = null; + var childAny = null; + var combinedLength = (((_currentLevel$anyLeve = currentLevel.anyLevel) === null || _currentLevel$anyLeve === void 0 ? void 0 : _currentLevel$anyLeve.length) || 0) + (((_currentLevel$thisLev = currentLevel.thisLevel) === null || _currentLevel$thisLev === void 0 ? void 0 : _currentLevel$thisLev.length) || 0); + var added = false; + for (var _i24 = 0; _i24 < combinedLength; _i24++) { + var _currentLevel$anyLeve2, _currentLevel$anyLeve3, _currentLevel$anyLeve4; + var exp = _i24 < (((_currentLevel$anyLeve2 = currentLevel.anyLevel) === null || _currentLevel$anyLeve2 === void 0 ? void 0 : _currentLevel$anyLeve2.length) || 0) ? currentLevel.anyLevel[_i24] : currentLevel.thisLevel[_i24 - (((_currentLevel$anyLeve3 = currentLevel.anyLevel) === null || _currentLevel$anyLeve3 === void 0 ? void 0 : _currentLevel$anyLeve3.length) || 0)]; + if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && _matchesExpression(vNode, exp[0])) { + if (exp.length === 1) { + if (!added && (!filter || filter(vNode))) { + result.push(vNode); + added = true; + } + } else { + var rest = exp.slice(1); + if ([ ' ', '>' ].includes(rest[0].combinator) === false) { + throw new Error('axe.utils.querySelectorAll does not support the combinator: ' + exp[1].combinator); + } + if (rest[0].combinator === '>') { + (childOnly = childOnly || []).push(rest); } else { - idRefs.get(token).push(node); + (childAny = childAny || []).push(rest); } } - } catch (err) { - _iterator14.e(err); - } finally { - _iterator14.f(); + } + if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && (_currentLevel$anyLeve4 = currentLevel.anyLevel) !== null && _currentLevel$anyLeve4 !== void 0 && _currentLevel$anyLeve4.includes(exp)) { + (childAny = childAny || []).push(exp); } } - } - for (var _i29 = 0; _i29 < node.childNodes.length; _i29++) { - if (node.childNodes[_i29].nodeType === 1) { - cacheIdRefs(node.childNodes[_i29], idRefs, refAttrs); + if (vNode.children && vNode.children.length) { + stack.push(currentLevel); + currentLevel = createLocalVariables(vNode.children, childAny, childOnly, vNode.shadowId, recycledLocalVariables.pop()); + } + while (currentLevel.vNodesIndex === currentLevel.vNodes.length && stack.length) { + recycledLocalVariables.push(currentLevel); + currentLevel = stack.pop(); } } + return result; } - function getAccessibleRefs(node) { - var _idRefs$get; - node = node.actualNode || node; - var root = get_root_node_default2(node); - root = root.documentElement || root; - var idRefsByRoot = cache_default.get('idRefsByRoot', function() { - return new Map(); - }); - var idRefs = idRefsByRoot.get(root); - if (!idRefs) { - idRefs = new Map(); - idRefsByRoot.set(root, idRefs); - var refAttrs = Object.keys(standards_default.ariaAttrs).filter(function(attr) { - var type2 = standards_default.ariaAttrs[attr].type; - return idRefsRegex.test(type2); - }); - cacheIdRefs(root, idRefs, refAttrs); + function querySelectorAllFilter(domTree, selector, filter) { + domTree = Array.isArray(domTree) ? domTree : [ domTree ]; + var expressions = _convertSelector(selector); + var nodes = getNodesMatchingExpression(domTree, expressions, filter); + if (nodes) { + return nodes; } - return (_idRefs$get = idRefs.get(node.id)) !== null && _idRefs$get !== void 0 ? _idRefs$get : []; + return matchExpressions(domTree, expressions, filter); } - var get_accessible_refs_default = getAccessibleRefs; - function isAriaRoleAllowedOnElement(node, role) { - var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node); - var implicitRole3 = implicit_role_default(vNode); - var spec = get_element_spec_default(vNode); - if (Array.isArray(spec.allowedRoles)) { - return spec.allowedRoles.includes(role); - } - if (role === implicitRole3) { - return false; + var query_selector_all_filter_default = querySelectorAllFilter; + function preloadCssom(_ref83) { + var _ref83$treeRoot = _ref83.treeRoot, treeRoot = _ref83$treeRoot === void 0 ? axe._tree[0] : _ref83$treeRoot; + var rootNodes = getAllRootNodesInTree(treeRoot); + if (!rootNodes.length) { + return Promise.resolve(); } - return !!spec.allowedRoles; + var dynamicDoc = document.implementation.createHTMLDocument('Dynamic document for loading cssom'); + var convertDataToStylesheet = get_stylesheet_factory_default(dynamicDoc); + return getCssomForAllRootNodes(rootNodes, convertDataToStylesheet).then(function(assets) { + return flattenAssets(assets); + }); } - var is_aria_role_allowed_on_element_default = isAriaRoleAllowedOnElement; - var dpubRoles2 = [ 'doc-backlink', 'doc-biblioentry', 'doc-biblioref', 'doc-cover', 'doc-endnote', 'doc-glossref', 'doc-noteref' ]; - var landmarkRoles = { - header: 'banner', - footer: 'contentinfo' - }; - function getRoleSegments(vNode) { - var roles = []; - if (!vNode) { - return roles; - } - if (vNode.hasAttr('role')) { - var nodeRoles = token_list_default(vNode.attr('role').toLowerCase()); - roles = roles.concat(nodeRoles); - } - return roles.filter(function(role) { - return is_valid_role_default(role); + var preload_cssom_default = preloadCssom; + function getAllRootNodesInTree(tree) { + var ids = []; + var rootNodes = query_selector_all_filter_default(tree, '*', function(node) { + if (ids.includes(node.shadowId)) { + return false; + } + ids.push(node.shadowId); + return true; + }).map(function(node) { + return { + shadowId: node.shadowId, + rootNode: get_root_node_default(node.actualNode) + }; }); + return unique_array_default(rootNodes, []); } - function getElementUnallowedRoles(node) { - var allowImplicit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - var _nodeLookup21 = _nodeLookup(node), vNode = _nodeLookup21.vNode; - if (!is_html_element_default(vNode)) { - return []; + function getCssomForAllRootNodes(rootNodes, convertDataToStylesheet) { + var promises = []; + rootNodes.forEach(function(_ref84, index) { + var rootNode = _ref84.rootNode, shadowId = _ref84.shadowId; + var sheets = getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet); + if (!sheets) { + return Promise.all(promises); + } + var rootIndex = index + 1; + var parseOptions = { + rootNode: rootNode, + shadowId: shadowId, + convertDataToStylesheet: convertDataToStylesheet, + rootIndex: rootIndex + }; + var importedUrls = []; + var p2 = Promise.all(sheets.map(function(sheet, sheetIndex) { + var priority = [ rootIndex, sheetIndex ]; + return parse_stylesheet_default(sheet, parseOptions, priority, importedUrls); + })); + promises.push(p2); + }); + return Promise.all(promises); + } + function flattenAssets(assets) { + return assets.reduce(function(acc, val) { + return Array.isArray(val) ? acc.concat(flattenAssets(val)) : acc.concat(val); + }, []); + } + function getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet) { + var sheets; + if (rootNode.nodeType === 11 && shadowId) { + sheets = getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet); + } else { + sheets = getStylesheetsFromDocument(rootNode); } - var nodeName2 = vNode.props.nodeName; - var implicitRole3 = implicit_role_default(vNode) || landmarkRoles[nodeName2]; - var roleSegments = getRoleSegments(vNode); - return roleSegments.filter(function(role) { - return !roleIsAllowed(role, vNode, allowImplicit, implicitRole3); + return filterStylesheetsWithSameHref(sheets); + } + function getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet) { + return Array.from(rootNode.children).filter(filerStyleAndLinkAttributesInDocumentFragment).reduce(function(out, node) { + var nodeName2 = node.nodeName.toUpperCase(); + var data = nodeName2 === 'STYLE' ? node.textContent : node; + var isLink = nodeName2 === 'LINK'; + var stylesheet = convertDataToStylesheet({ + data: data, + isLink: isLink, + root: rootNode + }); + if (stylesheet.sheet) { + out.push(stylesheet.sheet); + } + return out; + }, []); + } + function getStylesheetsFromDocument(rootNode) { + return Array.from(rootNode.styleSheets).filter(function(sheet) { + if (!sheet.media) { + return false; + } + return filterMediaIsPrint(sheet.media.mediaText); }); } - function roleIsAllowed(role, vNode, allowImplicit, implicitRole3) { - if (allowImplicit && role === implicitRole3) { + function filerStyleAndLinkAttributesInDocumentFragment(node) { + var nodeName2 = node.nodeName.toUpperCase(); + var linkHref = node.getAttribute('href'); + var linkRel = node.getAttribute('rel'); + var isLink = nodeName2 === 'LINK' && linkHref && linkRel && node.rel.toUpperCase().includes('STYLESHEET'); + var isStyle = nodeName2 === 'STYLE'; + return isStyle || isLink && filterMediaIsPrint(node.media); + } + function filterMediaIsPrint(media) { + if (!media) { return true; } - if (dpubRoles2.includes(role) && get_role_type_default(role) !== implicitRole3) { - return false; - } - return is_aria_role_allowed_on_element_default(vNode, role); + return !media.toUpperCase().includes('PRINT'); } - var get_element_unallowed_roles_default = getElementUnallowedRoles; - function getAriaRolesByType(type2) { - return Object.keys(standards_default.ariaRoles).filter(function(roleName) { - return standards_default.ariaRoles[roleName].type === type2; + function filterStylesheetsWithSameHref(sheets) { + var hrefs = []; + return sheets.filter(function(sheet) { + if (!sheet.href) { + return true; + } + if (hrefs.includes(sheet.href)) { + return false; + } + hrefs.push(sheet.href); + return true; }); } - var get_aria_roles_by_type_default = getAriaRolesByType; - function getRolesByType(roleType) { - return get_aria_roles_by_type_default(roleType); + function preloadMedia(_ref85) { + var _ref85$treeRoot = _ref85.treeRoot, treeRoot = _ref85$treeRoot === void 0 ? axe._tree[0] : _ref85$treeRoot; + var mediaVirtualNodes = query_selector_all_filter_default(treeRoot, 'video, audio', function(_ref86) { + var actualNode = _ref86.actualNode; + if (actualNode.hasAttribute('src')) { + return !!actualNode.getAttribute('src'); + } + var sourceWithSrc = Array.from(actualNode.getElementsByTagName('source')).filter(function(source) { + return !!source.getAttribute('src'); + }); + if (sourceWithSrc.length <= 0) { + return false; + } + return true; + }); + return Promise.all(mediaVirtualNodes.map(function(_ref87) { + var actualNode = _ref87.actualNode; + return isMediaElementReady(actualNode); + })); } - var get_roles_by_type_default = getRolesByType; - function getAriaRolesSupportingNameFromContent() { - return cache_default.get('ariaRolesNameFromContent', function() { - return Object.keys(standards_default.ariaRoles).filter(function(roleName) { - return standards_default.ariaRoles[roleName].nameFromContent; + var preload_media_default = preloadMedia; + function isMediaElementReady(elm) { + return new Promise(function(resolve) { + if (elm.readyState > 0) { + resolve(elm); + } + function onMediaReady() { + elm.removeEventListener('loadedmetadata', onMediaReady); + resolve(elm); + } + elm.addEventListener('loadedmetadata', onMediaReady); + }); + } + function _preload(options) { + var preloadFunctionsMap = { + cssom: preload_cssom_default, + media: preload_media_default + }; + if (!_shouldPreload(options)) { + return Promise.resolve(); + } + return new Promise(function(resolve, reject) { + var _getPreloadConfig2 = _getPreloadConfig(options), assets = _getPreloadConfig2.assets, timeout = _getPreloadConfig2.timeout; + var preloadTimeout = setTimeout(function() { + return reject(new Error('Preload assets timed out.')); + }, timeout); + Promise.all(assets.map(function(asset) { + return preloadFunctionsMap[asset](options).then(function(results) { + return _defineProperty({}, asset, results); + }); + })).then(function(results) { + var preloadAssets = results.reduce(function(out, result) { + return _extends({}, out, result); + }, {}); + clearTimeout(preloadTimeout); + resolve(preloadAssets); + })['catch'](function(err2) { + clearTimeout(preloadTimeout); + reject(err2); }); }); } - var get_aria_roles_supporting_name_from_content_default = getAriaRolesSupportingNameFromContent; - function getRolesWithNameFromContents() { - return get_aria_roles_supporting_name_from_content_default(); + function isValidPreloadObject(preloadObj) { + return _typeof(preloadObj) === 'object' && Array.isArray(preloadObj.assets); } - var get_roles_with_name_from_contents_default = getRolesWithNameFromContents; - var isNull = function isNull(value) { - return value === null; - }; - var isNotNull = function isNotNull(value) { - return value !== null; - }; - var lookupTable = {}; - lookupTable.attributes = { - 'aria-activedescendant': { - type: 'idref', - allowEmpty: true, - unsupported: false - }, - 'aria-atomic': { - type: 'boolean', - values: [ 'true', 'false' ], - unsupported: false - }, - 'aria-autocomplete': { - type: 'nmtoken', - values: [ 'inline', 'list', 'both', 'none' ], - unsupported: false - }, + function _shouldPreload(options) { + if (!options || options.preload === void 0 || options.preload === null) { + return true; + } + if (typeof options.preload === 'boolean') { + return options.preload; + } + return isValidPreloadObject(options.preload); + } + function _getPreloadConfig(options) { + var _constants_default$pr = constants_default.preload, assets = _constants_default$pr.assets, timeout = _constants_default$pr.timeout; + var config = { + assets: assets, + timeout: timeout + }; + if (!options.preload) { + return config; + } + if (typeof options.preload === 'boolean') { + return config; + } + var areRequestedAssetsValid = options.preload.assets.every(function(a2) { + return assets.includes(a2.toLowerCase()); + }); + if (!areRequestedAssetsValid) { + throw new Error('Requested assets, not supported. Supported assets are: '.concat(assets.join(', '), '.')); + } + config.assets = unique_array_default(options.preload.assets.map(function(a2) { + return a2.toLowerCase(); + }), []); + if (options.preload.timeout && typeof options.preload.timeout === 'number' && !isNaN(options.preload.timeout)) { + config.timeout = options.preload.timeout; + } + return config; + } + function _publishMetaData(ruleResult) { + var checksData = axe._audit.data.checks || {}; + var rulesData = axe._audit.data.rules || {}; + var rule = find_by_default(axe._audit.rules, 'id', ruleResult.id) || {}; + ruleResult.tags = _clone(rule.tags || []); + var shouldBeTrue = extender(checksData, true, rule); + var shouldBeFalse = extender(checksData, false, rule); + ruleResult.nodes.forEach(function(detail) { + detail.any.forEach(shouldBeTrue); + detail.all.forEach(shouldBeTrue); + detail.none.forEach(shouldBeFalse); + }); + extend_meta_data_default(ruleResult, _clone(rulesData[ruleResult.id] || {})); + } + function getIncompleteReason(checkData, messages) { + function getDefaultMsg(message) { + if (message.incomplete && message.incomplete['default']) { + return message.incomplete['default']; + } else { + return incompleteFallbackMessage(); + } + } + if (checkData && checkData.missingData) { + try { + var msg = messages.incomplete[checkData.missingData[0].reason]; + if (!msg) { + throw new Error(); + } + return msg; + } catch (e) { + if (typeof checkData.missingData === 'string') { + return messages.incomplete[checkData.missingData]; + } else { + return getDefaultMsg(messages); + } + } + } else if (checkData && checkData.messageKey) { + return messages.incomplete[checkData.messageKey]; + } else { + return getDefaultMsg(messages); + } + } + function extender(checksData, shouldBeTrue, rule) { + return function(check) { + var sourceData = checksData[check.id] || {}; + var messages = sourceData.messages || {}; + var data = Object.assign({}, sourceData); + delete data.messages; + if (!rule.reviewOnFail && check.result === void 0) { + if (_typeof(messages.incomplete) === 'object' && !Array.isArray(check.data)) { + data.message = getIncompleteReason(check.data, messages); + } + if (!data.message) { + data.message = messages.incomplete; + } + } else { + data.message = check.result === shouldBeTrue ? messages.pass : messages.fail; + } + if (typeof data.message !== 'function') { + data.message = process_message_default(data.message, check.data); + } + extend_meta_data_default(check, data); + }; + } + function querySelectorAll(domTree, selector) { + return query_selector_all_filter_default(domTree, selector); + } + var query_selector_all_default = querySelectorAll; + function matchTags(rule, runOnly) { + var include, exclude, matching; + var defaultExclude = axe._audit && axe._audit.tagExclude ? axe._audit.tagExclude : []; + if (runOnly.hasOwnProperty('include') || runOnly.hasOwnProperty('exclude')) { + include = runOnly.include || []; + include = Array.isArray(include) ? include : [ include ]; + exclude = runOnly.exclude || []; + exclude = Array.isArray(exclude) ? exclude : [ exclude ]; + exclude = exclude.concat(defaultExclude.filter(function(tag) { + return include.indexOf(tag) === -1; + })); + } else { + include = Array.isArray(runOnly) ? runOnly : [ runOnly ]; + exclude = defaultExclude.filter(function(tag) { + return include.indexOf(tag) === -1; + }); + } + matching = include.some(function(tag) { + return rule.tags.indexOf(tag) !== -1; + }); + if (matching || include.length === 0 && rule.enabled !== false) { + return exclude.every(function(tag) { + return rule.tags.indexOf(tag) === -1; + }); + } else { + return false; + } + } + function ruleShouldRun(rule, context, options) { + var runOnly = options.runOnly || {}; + var ruleOptions = (options.rules || {})[rule.id]; + if (rule.pageLevel && !context.page) { + return false; + } else if (runOnly.type === 'rule') { + return runOnly.values.indexOf(rule.id) !== -1; + } else if (ruleOptions && typeof ruleOptions.enabled === 'boolean') { + return ruleOptions.enabled; + } else if (runOnly.type === 'tag' && runOnly.values) { + return matchTags(rule, runOnly.values); + } else { + return matchTags(rule, []); + } + } + var rule_should_run_default = ruleShouldRun; + function _filterHtmlAttrs(element, filterAttrs) { + if (!filterAttrs) { + return element; + } + var node = element.cloneNode(false); + var attributes2 = get_node_attributes_default(node); + if (node.nodeType === 1) { + var outerHTML = node.outerHTML; + node = cache_default.get(outerHTML, function() { + return setNodeAttributes(node, attributes2, element, filterAttrs); + }); + } else { + node = setNodeAttributes(node, attributes2, element, filterAttrs); + } + Array.from(element.childNodes).forEach(function(child) { + node.appendChild(_filterHtmlAttrs(child, filterAttrs)); + }); + return node; + } + function setNodeAttributes(node, attributes2, element, filterAttrs) { + if (!attributes2) { + return node; + } + node = document.createElement(node.nodeName); + Array.from(attributes2).forEach(function(attr) { + if (!attributeMatches(element, attr.name, filterAttrs)) { + node.setAttribute(attr.name, attr.value); + } + }); + return node; + } + function attributeMatches(node, attrName, filterAttrs) { + if (typeof filterAttrs[attrName] === 'undefined') { + return false; + } + if (filterAttrs[attrName] === true) { + return true; + } + return element_matches_default(node, filterAttrs[attrName]); + } + function _select(selector, context) { + var result = []; + var candidate; + if (axe._selectCache) { + for (var j = 0, l = axe._selectCache.length; j < l; j++) { + var item = axe._selectCache[j]; + if (item.selector === selector) { + return item.result; + } + } + } + var outerIncludes = getOuterIncludes(context.include); + var isInContext = getContextFilter(context); + for (var _i25 = 0; _i25 < outerIncludes.length; _i25++) { + candidate = outerIncludes[_i25]; + var nodes = query_selector_all_filter_default(candidate, selector, isInContext); + result = mergeArrayUniques(result, nodes); + } + if (axe._selectCache) { + axe._selectCache.push({ + selector: selector, + result: result + }); + } + return result; + } + function getOuterIncludes(includes) { + return includes.reduce(function(res, el) { + if (!res.length || !_contains(res[res.length - 1], el)) { + res.push(el); + } + return res; + }, []); + } + function getContextFilter(context) { + if (!context.exclude || context.exclude.length === 0) { + return null; + } + return function(node) { + return _isNodeInContext(node, context); + }; + } + function mergeArrayUniques(arr1, arr2) { + if (arr1.length === 0) { + return arr2; + } + if (arr1.length < arr2.length) { + var temp = arr1; + arr1 = arr2; + arr2 = temp; + } + for (var _i26 = 0, l = arr2.length; _i26 < l; _i26++) { + if (!arr1.includes(arr2[_i26])) { + arr1.push(arr2[_i26]); + } + } + return arr1; + } + function setScroll(elm, top, left) { + if (elm === window) { + return elm.scroll(left, top); + } else { + elm.scrollTop = top; + elm.scrollLeft = left; + } + } + function setScrollState(scrollState) { + scrollState.forEach(function(_ref89) { + var elm = _ref89.elm, top = _ref89.top, left = _ref89.left; + return setScroll(elm, top, left); + }); + } + var set_scroll_state_default = setScrollState; + function _shadowSelect(selectors) { + var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ]; + return selectRecursive(selectorArr, document); + } + function selectRecursive(selectors, doc) { + var selectorStr = selectors.shift(); + var elm = selectorStr ? doc.querySelector(selectorStr) : null; + if (selectors.length === 0) { + return elm; + } + if (!(elm !== null && elm !== void 0 && elm.shadowRoot)) { + return null; + } + return selectRecursive(selectors, elm.shadowRoot); + } + function _shadowSelectAll(selectors) { + var doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; + var selectorArr = Array.isArray(selectors) ? _toConsumableArray(selectors) : [ selectors ]; + if (selectors.length === 0) { + return []; + } + return selectAllRecursive(selectorArr, doc); + } + function selectAllRecursive(_ref90, doc) { + var _ref91 = _toArray(_ref90), selectorStr = _ref91[0], restSelector = _ref91.slice(1); + var elms = doc.querySelectorAll(selectorStr); + if (restSelector.length === 0) { + return Array.from(elms); + } + var selected = []; + var _iterator13 = _createForOfIteratorHelper(elms), _step13; + try { + for (_iterator13.s(); !(_step13 = _iterator13.n()).done; ) { + var elm = _step13.value; + if (elm !== null && elm !== void 0 && elm.shadowRoot) { + selected.push.apply(selected, _toConsumableArray(selectAllRecursive(restSelector, elm.shadowRoot))); + } + } + } catch (err) { + _iterator13.e(err); + } finally { + _iterator13.f(); + } + return selected; + } + function validInputTypes() { + return [ 'hidden', 'text', 'search', 'tel', 'url', 'email', 'password', 'date', 'month', 'week', 'time', 'datetime-local', 'number', 'range', 'color', 'checkbox', 'radio', 'file', 'submit', 'image', 'reset', 'button' ]; + } + var valid_input_type_default = validInputTypes; + var langs = [ , [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , , , , , 1, 1, 1, 1, , , 1, 1, 1, , 1, , 1, , 1, 1 ], [ 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, 1, 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , , , , 1, , 1, , , , 1, 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, , , 1, , , , , 1, 1, 1, , 1, , 1, , 1, , , , , , 1 ], [ 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, , 1, , 1, , , , , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , 1, , 1, , , , 1, 1, 1, , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, 1, 1, , , , , 1, , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, , 1, 1, 1, , 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, , , 1, 1, , , , , , 1, 1 ], [ 1, 1, 1, , , , , 1, , , , 1, 1, , 1, , , , , , 1, , , , , 1 ], [ , 1, , , 1, , , 1, , , , , , 1 ], [ , 1, , 1, , , , 1, , , , 1 ], [ 1, , 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, , , 1, , 1, 1, , 1, , 1, , , , , 1, , 1 ], [ , 1, , , , 1, , , 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, , , 1, , , 1 ], [ , 1, 1, , , , , , 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, , 1, , , , , 1, 1, , 1, , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, , , , 1, 1, 1, , 1, 1, , , 1, 1, , 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, , 1, 1, 1, , 1, , , , , 1, 1, 1, , , 1, , 1, , , 1, 1 ], [ , , , , 1, , , , , , , , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, , 1, 1, 1, , 1, 1, , , , 1, 1, 1, 1, 1, , , 1, 1, 1, , , , , 1 ], [ 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , , , , , 1, , , , , , , 1 ], [ , 1, 1, , 1, 1, , 1, , , , , , , , , , , , , 1 ], , [ 1, 1, 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , 1, , , 1, , , 1, 1, , , , , 1 ] ], [ , [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , , , 1, , , , , , , , , , , , , , , 1 ], [ , 1, , , 1, 1, , 1, , 1, 1, , , , 1, 1, , , 1, 1, , , , 1 ], [ 1, , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , 1, , , , 1 ], , [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, , , 1, 1, 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, , , 1, , 1, , , 1, 1, 1, 1, , , 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, , , 1, , , 1, , 1 ], [ , 1, , , , , , , , , , 1, 1, , , , , , 1, 1, , , , , 1 ], [ , , , , , , , 1, , , , 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, , , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , 1, 1, 1, , , 1, 1, , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, , 1, 1, , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , , , , , , 1 ], , [ , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, , 1 ], [ , , 1, , , 1, , , 1, 1, , , 1, , 1, 1, , 1 ], [ , 1, 1, , 1, , , , 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1 ], [ , 1, , , , , , , , , , 1, 1, , , , , , 1, 1, , 1, , 1, , 1, 1 ], , [ , 1, 1, , 1, , , 1, , 1, , , , 1, 1, 1, , , , , , 1, , , , 1 ], [ 1, 1, , , 1, 1, , 1, , , , , 1, , 1 ] ], [ , [ , 1 ], [ , , , 1, , , , 1, , , , 1, , , , 1, , , 1, , , 1 ], [ , , , , , , , , , , , , , , , , , , 1, 1, , , , , , 1 ], , [ 1, , , , , 1 ], [ , 1, , , , 1, , , , 1 ], [ , 1, , , , , , , , , , , 1, , , 1, , , , , , , , , 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , 1, , , , 1, , 1 ], [ , 1 ], [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, , 1, 1, , 1, , , , , , , 1 ], [ 1, , , , , 1, , , 1, 1, , 1, , 1, , 1, 1, , , , , 1, , , 1 ], [ , 1, 1, , , 1, , 1, , 1, , 1, , 1, 1, 1, 1, , , 1, , 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, , 1, , , , 1, 1, 1, 1, , 1, 1, , , 1, 1, 1, 1 ], [ 1, , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , 1 ], , [ , 1, , , , , , 1, 1, 1, , 1, , , , 1, , , 1, 1, 1, , , 1 ], [ 1, , , , , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, , 1, , 1, , 1, , , 1, 1 ], [ 1, , 1, 1, , , , , 1, , , , , , 1, 1, , , 1, 1, 1, 1, , , 1, , 1 ], [ 1, , , , , , , , , , , , , , , , , 1 ], [ , , , , , 1, , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , , 1 ], [ , 1, , , , 1 ] ], [ , [ 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, , , 1, 1, 1 ], [ , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], , [ , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , , , , , , , 1, , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], , [ 1, 1, , , , 1, 1, , , , , , 1, , , , 1, , 1, , 1, 1, , 1 ], [ 1 ], [ , , , , , , , , , , , 1, , , , , , , , , , , 1 ], [ , 1, , , , , , , 1, 1, , , 1, , 1, , , , 1, , , , , , , 1 ], [ , , , , , , , , , , , , , , , , 1, , , , , 1 ], [ , , 1, , , , , 1, , 1 ], [ 1, , , , 1, , , , , 1, , , , 1, 1, , , , 1, 1, , , , , 1 ], [ , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , 1, 1, , , , , , , 1, , 1, , 1, 1, 1, 1, 1, 1 ], [ , , , , , 1, , , , , , , 1, , , , , , , 1 ], , [ , , 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, , , 1, 1, , 1, 1, 1, , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , 1 ], , [ 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, , , , , , 1, , 1, , , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1, , , 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , 1, , , , , , , , , 1, , , , 1 ], [ , 1, 1, , 1, 1, , 1, , , , 1, 1, , 1, 1, , , 1, , 1, 1, , 1 ], [ , 1, , 1, , 1, , , 1, , , 1, 1, , 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , , , , , , , , , 1, , 1, , 1, 1, , , , 1, , , 1 ], [ , 1, , , 1, 1, , , , , , , , , 1, 1, 1, , , , , 1 ], [ 1, , , 1, 1, , , , 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, , , , 1, 1, 1, , , 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1 ], [ , 1, , , , , , , , 1, , , , , 1, , , , 1, , , 1 ], [ , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , 1, , 1, , , , , 1, 1, 1, 1, 1, , , 1, , , , 1 ], [ , 1, , , , , , , , 1, , , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, , 1, , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , 1, 1, , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1, 1, , , , 1, , 1, 1, , 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , 1, 1, 1, 1, , 1, , , 1, 1, 1, 1, , , 1, , , , , , , 1 ], [ , 1, , , , , , , , 1, , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , , , , , , , , 1, 1, , , , , , 1 ], [ , 1, , , , , , , 1 ], [ , , , , , , , , , , , , , , 1, , , , , 1, , , , , , 1 ], [ 1, 1, , , 1, , , 1, 1, 1, , , , 1 ], , [ , , , , , , , , , , , , , 1, , , , , , , , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , 1, , , , , , , 1 ], [ 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, , , 1, , 1, , , 1, 1 ], [ , , , , , , , , , 1 ], [ , 1, , , , 1, , , , , , 1, , , 1, , , , , 1 ], [ , 1, 1, , 1, 1, , , , , , , , , , , , , , , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, 1, 1, 1, , , , 1, 1, , , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1 ], [ , , , , , , , , , , , , , , , 1, , , , 1 ], , [ 1, 1, , 1, , 1, , , , , , 1, , 1, , 1, 1, , 1, , 1, 1, , 1, 1, , 1 ], [ , , 1, , , , , , 1, , , , 1, , 1, , , , , 1 ], [ 1, , , , , , , , , 1, , , , , , 1, , , , 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, , 1, , , , , , 1, , , 1, , , , , , , , 1 ], [ , 1, , 1, , , , , , , , , , , , 1 ], , [ 1, 1, , , , , , , , , , , , , , , , , , , , , , 1, 1 ], [ 1 ] ], [ , [ 1, , , , , , , , , 1, , , , , 1, , 1, , 1 ], [ , 1, 1, , 1, 1, , 1, 1, 1, , , 1, 1, 1, , , , 1, , , 1, , , , 1 ], [ , 1, , , , , , , 1, , , , 1, , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , , , 1, , , , , , , , , 1, 1, 1, 1 ], [ 1 ], [ , 1, 1, , , 1, 1, , , , , 1, , 1, , , , , , , , 1, , , , 1 ], [ 1, , 1, , , 1, , 1, , , , , 1, 1, 1, 1, , , , 1, , , , 1 ], [ , , 1, , , , , , , 1, , , , , , , 1, , , , , , , 1 ], [ 1, , , , , , , , , , , , , , 1, , , , 1 ], [ , , , 1, , 1, , , , , 1, , , , 1, 1, , , , 1 ], [ 1, , , , , 1, , , , 1, , 1, 1, , , 1, 1, , 1, 1, 1, , 1, 1, 1, , 1 ], [ , 1, 1, , , , , 1, , 1, , 1, 1, 1, , 1, 1, , , 1, , 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , , 1, , 1, 1, , , 1, 1, , , , , , 1 ], [ 1, , 1, 1, , 1, , 1, 1, , 1, , 1, 1, 1, 1, 1, , , 1, 1, , , , , , 1 ], [ 1, , , , , , , , , , , , , , , , , , 1, , , 1, , 1 ], [ , , , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , , 1, , 1 ], [ , 1, , , , 1, , , 1, 1, , 1, , , 1, 1, , , 1, , , 1, , , 1, 1 ], [ 1, 1, , 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, , 1, 1 ], [ 1, , 1, 1, 1, 1, , , , 1, , 1, 1, 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, , , , , , , , , , , , , 1 ], [ , , 1, , , , , , , , , , , , , , , , , , , , 1 ], [ 1, , , , , , , , , , , 1, , 1, , 1, , , , 1 ], [ , , , 1, , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , , 1, , , , , , , , , 1 ], [ , , , , , , , , 1, 1, , , , , , , , , 1, , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , , , , , 1, , , , 1, 1, 1, , , 1, 1, , , 1, , 1, 1, , 1 ], [ , , , , , , , , , , , , , , , , , , , 1, 1 ], [ , 1, , , , , , 1, , , , , , , , , , , , , 1 ], [ , , 1, , , 1, , 1, 1, 1, , 1, 1, , 1, , , , 1, , 1, 1 ], , [ , , 1, , , 1, , , , , , 1, , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , , 1, 1, , 1, , 1, , , 1, 1, 1, , , 1 ], [ , , , , , 1, , , , , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , 1, , 1, 1, , 1, , , 1 ], [ , , , , , 1, , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, 1, , , , , 1, , , 1, , 1, , , , 1, 1, , , , 1, 1 ], [ , 1, , , 1, , , 1, , 1, 1, , 1, , , , , , , 1 ], [ , , 1, , 1, , , 1, , , , , , , , , , , 1, 1, , , , 1 ], [ , 1, , , , , , , , , , , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , , , , , , , , , , , , , , , 1, , 1, 1 ], [ , , , , , , , , , , , , 1 ], , [ , 1, 1, 1, 1, , , , 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, , 1 ], [ 1, , , , 1, , , , , , , , , , 1 ], [ 1, , , , , , , , , 1 ], , [ , 1, , , , 1, , , , , , , , , , , , , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, , 1, , , , 1, 1, , , 1, 1, , 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ 1, 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, , 1, 1, , , , , 1 ], [ , 1, , , , , , , 1, 1, , , 1, 1, 1, , 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , , 1, , , , 1, , , , , , , 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, , , 1, 1, 1, 1, , 1, 1, 1, 1, , , , 1, , 1, , 1, , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , , 1, 1, , , , , , , , , 1 ], , [ , 1, , 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , , 1, , 1, , 1, , , , 1 ], [ , 1, , , 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , , 1 ], [ 1, , , 1, , , , 1, 1, 1, , , , , 1, 1, , , , 1, , 1 ], [ 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, , , , , , , , 1, , 1, , , , , , , , 1, , 1 ], [ , 1, , , , 1, , 1, 1, , , , 1, 1, , 1, , , , 1, 1, 1, , 1 ], , [ , 1, , , , , , 1, , , , , , , 1 ], [ , , , , , , , , 1, , , , 1, , 1, , , , , , , , , , , , 1 ] ], [ , [ , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, , , , , , , , 1, , , , , , 1, , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , , 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , , 1, , 1, 1, , , , 1, , 1, , , 1, 1 ], [ , , , , , , , 1, , , , 1, 1, 1, 1, 1, , 1, , , , , , , , 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, , 1, , 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , 1, 1, , 1, , 1, 1, 1, , 1, , 1, 1, , 1, 1, , 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , , , , , , 1, , , , , 1, , 1 ], [ , 1, 1, 1, , 1, , 1, , 1, , , , 1, , 1, , , 1, , , , , , 1, 1 ], [ , 1, , , 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, , , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , , , 1, , 1, , 1, , , , , , 1, , 1, , , , 1, 1 ] ], [ , [ , 1, , 1, , , , , , , , , , , , , , , 1, , , , 1 ], [ , , , , , , , , , 1, , 1, 1, 1, , 1, , , 1, , 1, 1 ], [ 1, 1, , , , , , , 1, , , , , , , 1, , , , , , 1 ], [ , 1, , , , , , , , , , 1, , , , , , , , , 1, 1 ], , [ , , , , , , , , , , , , , , , 1, , , , 1, , 1 ], [ , , 1, 1, , 1, , 1, , , , , , , , 1, , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , , 1, 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ 1, , 1, 1, , , , 1, , , , , , , , , 1, , , 1, , , 1, 1 ], [ , 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, 1, , , , , , 1, , 1, , 1, , , 1, , 1, 1 ], [ 1, 1, 1, 1, , 1, , 1, , 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, , , 1, , 1, , 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, , 1, 1 ], [ , , , , 1, , , 1, , , , , , , 1, , , , 1, 1 ], [ , 1, , , , , , , , , , 1, , 1, , 1, , , , , 1, , , , , 1 ], , [ 1, 1, , 1, , 1, , 1, 1, , , , , , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, , , , , , 1, , , , , , 1, 1, , , , 1, 1, , , 1 ], [ , 1, 1, , 1, 1, , , , 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, , , 1, , , , 1, , , , 1, 1 ], [ , , , , 1 ], [ , , , , , , , , , 1, , , 1 ], , [ , , 1, , 1, , , , , , , , , 1, , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, , 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , , , , 1 ], [ , 1, , 1, , , , , , 1, , , , , 1, 1, , , , , 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , , 1, , 1, 1, 1 ], [ , 1, , , , 1, , , , , , , 1 ], [ , 1, , , 1, , , 1, , 1, , 1, 1, , 1, , , , , 1, , 1, , , , 1, 1 ], [ , 1, , , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, , , , 1, 1, , , , , , 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , 1, , , , , , , , 1, , , , , , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1 ], [ 1, 1, , , , , , , 1, 1, , , , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], , [ , 1, 1, , , , , 1, , 1, , , , 1, 1, 1, , , 1, , , , , 1 ], [ , , , , , , , , , , , , , 1 ], [ , , , , , 1, , , , , , , , 1, 1, , , , , 1, , 1, , , 1, 1 ], [ , , , , , , , , , , , , , , 1 ] ], [ , [ , 1 ], , , , , , , , , , , , , , , , , , , , [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, , , , 1, , 1, 1 ], [ , 1, , 1, , 1, , , 1, , , , , 1, , , , , , 1, 1 ], [ , 1, , 1, , , , , 1, , , , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, , , , , , , , , , , , , , , 1 ] ], [ , [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , , , , , , , 1, 1, , , , 1 ], [ , , , , , , 1 ], [ , , 1 ], [ , 1, 1, , , 1, , 1, , 1, 1, , 1, 1, 1, , , , 1, 1, 1, , , , , 1 ], , [ , 1, , , , 1, , , , , , 1, , , 1, , , , 1, 1, , 1 ], [ , , , , , , , 1, , , , , , , , , 1 ], [ , 1, , , , 1, 1, , , , , , 1, 1, 1, , , , 1, , 1, 1 ], [ , , , , , , , 1, , 1, , , , , , , , , , 1 ], [ , 1, 1, , , , , , 1, 1, , , , 1, , , , , , , 1, , , 1 ], , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , , 1, , , 1, , , , , 1, , 1, , 1, , 1, , , , , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , , , 1, 1, , 1, 1, , 1, , , 1, , 1 ], [ , , , , , , , , , , , , , , 1, , , , , , 1 ], , [ , , , , , , , , , 1, , , , , , 1, , , , , 1 ], [ , , 1, , , , , , , 1, , , 1, 1 ], [ , , , 1, , , , , 1, , , , , 1, , , , , , 1, , , , 1 ], [ 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, , , , 1, 1, 1, , , 1, 1, , , , 1, 1 ], , [ 1, 1, , , , , , , , , , 1, , 1, , 1, , , 1 ], [ , , , , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , 1, , , , , 1, , 1 ], [ , , , , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , , 1, , , 1, , , , , , , , 1, , , , , , 1, , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, , 1, , , , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, , , , , , , 1, , 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, , , , , , 1, , 1, , , , , 1, 1, , , , , 1 ], [ 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, 1, , 1, , 1, , , , 1, 1, 1, 1, 1, , , 1, 1, , 1, , 1 ], [ , 1, 1, 1, 1, , , , , 1, , 1, 1, 1, 1, 1, , , 1, 1, , , , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , , , , 1, , 1, , 1, , , 1, , , 1, 1, , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , 1, , , , , 1, 1, , , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , , 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , 1, , 1, 1, , 1, 1, 1, 1, 1, , , 1, , 1, , 1 ], [ 1, 1, 1, , 1, 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , , , , , , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , , , , , 1, 1, 1, 1, 1, , , , 1, 1, 1, , 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, , 1, , 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, , , 1, 1 ], [ 1, 1, , , , 1, , , 1, 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, 1, , 1, , 1 ], [ , 1, , , , , , , 1, , 1, , 1, 1, 1, 1, , , , , , , , , 1 ] ], [ , [ , , , , , , , , , , , , , 1, 1, , , , 1 ], [ , 1, , , , , , , , 1, , , 1, , , , , , 1, , , 1, , , , 1 ], , [ , 1, , , , 1, , 1, , 1, 1, , 1, 1, , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , 1 ], [ 1, 1, 1, , , 1, , , , , , , , , 1, 1, , , , , , , , , , 1 ], [ , 1, , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , , , , , 1, , , 1 ], [ , , , , , , , , , 1 ], [ 1, 1, , , , , , 1, 1, 1, , 1, 1, , , , 1, 1, , 1, , 1, 1, 1, , 1 ], [ , 1, 1, 1, , 1, 1, , , 1, , 1, 1, 1, 1, , , , , , , 1, , 1 ], [ , 1, 1, 1, 1, , , 1, , 1, , , , 1, 1, 1, 1, , 1, 1, , 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , 1, 1, , 1, , 1, , , 1, , , 1, , 1 ], [ , , , , , , , , , , , 1 ], [ , , , , , , , , , 1, , , , , , , , , , , , , 1 ], , [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , 1, 1, , 1, , , , , 1, , , 1, , 1 ], [ , 1, , , , 1, , , 1, , , , , , , , 1, , 1, , , 1 ], [ , , , , , , , , , , , , , 1, 1, , , , 1, , , 1 ], [ , , , , , 1, , , 1, , , , 1 ], [ , 1 ], , [ , 1 ], [ 1, , , , , , , , , , , , , , 1, , , , , 1 ] ], [ , [ , 1, , , , 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, , 1, 1, , , 1 ], [ , , 1, , , , , , , , , 1 ], , , [ 1, , , 1, 1, , , , , , , , 1, 1, , 1, 1, , 1 ], , [ , , , , , , , , , , , , , , , , , , 1, , 1 ], , [ 1, , , 1, 1, , 1, 1, , , , , 1, , 1, , , , , 1, 1, , 1 ], , [ , 1, , , , , , , , 1, 1, 1, 1, 1, , 1, 1, , , , 1, 1 ], [ , , , , , , , , , , , , , , , , 1, , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , , , , , , , , , , , 1, , 1, , , 1 ], [ 1, , , , , , , , , , , , , , , , , , 1, , 1 ], , , [ , 1, , , , , , , , , , , , , , 1, , , , 1, 1 ], [ , , , , , , , , , 1, , , 1, , , , , , , , , , 1 ], [ , , , , , , , , , , , , , , , 1 ], [ , , , , , , , , , , , , , 1, 1, , , , , , 1 ], , [ , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , 1, 1, , 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, , , , , , , , 1 ], [ , , , , 1, , , 1, , , 1, 1, , , , , , , , , , 1, , , , 1 ], [ , 1, , 1, 1, , , 1, 1, 1, , , , 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , , , , , , , 1 ], [ , 1, 1, , , , , 1, , 1, , , , , , 1, , , , , , 1, , 1, , 1 ], [ , 1, , , , , , 1, , , , 1, , , , , , , , , , 1 ], [ , , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, , , , , , , , 1 ], [ , 1, 1, , 1, , , , , , , , 1, , , , , , 1, , , 1, , 1, , 1 ], [ , 1, , 1, , 1, , 1, 1, 1, , 1, 1, 1, , 1, , , 1, 1, , 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, , , , 1, 1, 1, , , , 1, 1, , , 1, 1 ], [ , , 1, 1, 1, 1, , 1, , 1, , 1, , 1, 1, 1, 1, , , , , 1, , 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, , 1, 1, 1, , , 1, 1, , , , 1, , 1 ], [ , , , 1 ], , [ , 1, 1, , 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , 1, , , , , , , 1, 1, , 1, 1 ], [ , , , , , , 1, , 1, 1, , 1, , 1, , , , , , , , , , 1 ], [ , 1, 1, , 1, , , , 1, , , , 1, 1, 1, , , , 1, , 1, 1, 1, , 1, 1 ], , [ , 1, 1, , , , , , , , , , , , , 1, , , 1, , , , , 1 ], [ , 1, , , , , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , , , , , , 1, , , , 1, , , , , 1, , , , , , , 1 ] ], [ , [ , 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, , 1, , 1, 1, , , 1, 1, 1, 1, , 1, , , , , 1, 1, 1 ], [ , , 1, 1, , 1, , 1, 1, , , , 1, 1, 1, 1, , , 1, , 1, 1, 1, 1, , 1 ], [ , 1, , 1, , , , , , , , 1, , 1, , 1, , , , , , , , , , 1 ], [ , , 1, , 1, , , 1, , , , , 1, 1, , , 1, , 1, 1, 1, 1 ], [ , 1 ], [ , 1, 1, , 1, , 1, 1, , 1, , , 1, 1, 1, , , , 1, , , 1, , 1 ], [ 1, 1, , 1, 1, 1, , , , , , , , , , , , , 1, , 1, 1, 1 ], [ , 1, 1, , , , , , , 1, , , 1, , 1, , 1, , 1, 1, , , 1, , , 1 ], [ , , 1, , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, , 1, , , , , 1, 1, 1, , , 1, , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , 1, 1, 1, , 1, , 1, 1, 1, , , 1, 1, 1, 1, , , , 1, 1 ], [ , , , 1, 1, , , 1, , 1, , 1, , 1, 1, 1, 1, , 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , 1, 1, , 1, 1, , 1, , 1, , , , 1, 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, , 1, , , 1, , , 1, , 1, 1, 1, 1, 1, , 1, , 1, 1 ], [ , , , , , 1, , , , 1, , , , , 1, 1, , , , 1 ], [ , 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, , , 1, , 1, , , 1 ], [ , , 1, , , , , , , , , 1, , 1, , , , , 1, , 1 ], [ , 1, 1, , , , , , , , 1, 1, 1, , , , , , , , 1, , , , , 1 ], [ , , , , , , , , 1, , , , , 1, , , 1 ] ], [ , [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, , , , , , , , , 1, 1 ], [ , , , , , , , , 1, , , , 1, , 1, , 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , , , , , , , 1 ], [ , 1, , 1, , 1, , , , 1, 1, , 1, , 1, , , , 1, 1, 1, 1, 1, , , 1 ], , [ , 1, , , , , , , , 1, , , 1, 1, , , 1, , 1, 1, , 1, , 1 ], [ , 1, , , 1, , , , , , , , 1, , , , , , , 1 ], [ 1, 1, , , , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], , [ , 1, , , , , , 1, , 1, , 1, 1, 1, 1, 1, , , 1, , 1, 1, , , , 1 ], [ , 1, 1, , , 1, , 1, , 1, , , 1, 1, 1, 1, , , 1, , , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, , 1 ], [ , 1, , , 1, 1, , 1, 1, , , 1, 1, , 1, 1, , 1, , 1, , 1 ], [ 1, , 1, , , , , 1, , 1, , 1, 1, 1, 1, , , , , 1, 1, , , , 1, 1 ], [ , 1, 1, , , , , 1, 1, , , 1, , 1, 1, 1, 1, , , , , , , , , , 1 ], , [ , 1, 1, , , 1, , , , 1, , 1, 1, 1, 1, 1, , , , 1, , , , 1, , 1 ], [ , , , 1, 1, , , 1, , , , , 1, , 1, 1, 1, , 1, 1, , , , , , 1 ], [ , 1, , , , , , , , , , , 1, , , , 1, , , , , , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1 ], [ , 1, , , , , , , , , , , , , , , , , , , 1 ], [ , 1, , , , , , 1, , , , , 1, , 1, , , 1, 1, , 1, 1, , 1 ], [ , 1, , , , , , 1, , , , , 1, 1, , , , , , , , 1, , , , 1 ], [ , , , , , , , , , , , , , , , , , , 1, , , 1, , , , , 1 ], [ , , , , , , , 1, , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, , 1, , , , , , , 1, , , , , , , , 1, , , 1 ], [ , 1, , , , , , , 1 ], [ , , , , , , , , , , 1 ], [ , 1, , , , , , 1, 1, , , , , , 1 ], , [ , 1, 1, , , , , , 1, , , , , 1, 1, , , , 1 ], [ 1, , 1, , 1, , , , , 1, , , , , 1, , , , , , , , , 1, 1 ], [ , 1, 1, , , , , , , , , 1, 1, 1, 1, , , , 1, , , , , 1, , , 1 ], , [ , 1, 1, , 1, , , 1, 1, , , 1, , , 1, 1, 1, , 1, , 1, 1, 1, , , , 1 ], [ , , , , , 1, , , , , 1, , , 1, 1, , , 1, , 1, , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , , 1, 1, , 1, , , , 1, , , , , , , , 1 ], [ , , , 1, , , , , 1, , , , , 1, , 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , , , , 1 ], [ , 1, , , , , , 1, , , , , , , 1, 1, 1, , , 1 ], [ , 1, , , , , , , , , , 1, 1, 1, , , , , 1, , , 1 ], [ , , , , , 1, , 1, , , , , 1, 1, 1, , 1, 1, , 1, 1, 1, , , 1, 1 ], [ 1, 1, , , , , , , 1, , , , , 1, 1, , , , , , , , , , , 1 ], , [ , 1 ], [ , , , , , , , , , , , , , , , , , , , , , , , , 1 ], [ , , 1, , , , , 1, , , 1, , , , 1, , 1 ], [ , 1, , , , , , , , , 1 ] ] ]; + function isValidLang(lang) { + var array = langs; + while (lang.length < 3) { + lang += '`'; + } + for (var _i27 = 0; _i27 <= lang.length - 1; _i27++) { + var index = lang.charCodeAt(_i27) - 96; + array = array[index]; + if (!array) { + return false; + } + } + return true; + } + function _validLangs(langArray) { + langArray = Array.isArray(langArray) ? langArray : langs; + var codes = []; + langArray.forEach(function(lang, index) { + var _char3 = String.fromCharCode(index + 96).replace('`', ''); + if (Array.isArray(lang)) { + codes = codes.concat(_validLangs(lang).map(function(newLang) { + return _char3 + newLang; + })); + } else { + codes.push(_char3); + } + }); + return codes; + } + var valid_langs_default = isValidLang; + var SerialVirtualNode = function(_abstract_virtual_nod2) { + _inherits(SerialVirtualNode, _abstract_virtual_nod2); + function SerialVirtualNode(serialNode) { + var _this6; + _classCallCheck(this, SerialVirtualNode); + _this6 = _callSuper(this, SerialVirtualNode); + _this6._props = normaliseProps(serialNode); + _this6._attrs = normaliseAttrs(serialNode); + return _this6; + } + _createClass(SerialVirtualNode, [ { + key: 'props', + get: function get() { + return this._props; + } + }, { + key: 'attr', + value: function attr(attrName) { + var _this$_attrs$attrName; + return (_this$_attrs$attrName = this._attrs[attrName]) !== null && _this$_attrs$attrName !== void 0 ? _this$_attrs$attrName : null; + } + }, { + key: 'hasAttr', + value: function hasAttr(attrName) { + return this._attrs[attrName] !== void 0; + } + }, { + key: 'attrNames', + get: function get() { + return Object.keys(this._attrs); + } + } ]); + return SerialVirtualNode; + }(abstract_virtual_node_default); + var nodeNamesToTypes = { + '#cdata-section': 2, + '#text': 3, + '#comment': 8, + '#document': 9, + '#document-fragment': 11 + }; + var nodeTypeToName = {}; + var nodeNames = Object.keys(nodeNamesToTypes); + nodeNames.forEach(function(nodeName2) { + nodeTypeToName[nodeNamesToTypes[nodeName2]] = nodeName2; + }); + function normaliseProps(serialNode) { + var _serialNode$nodeName, _ref92, _serialNode$nodeType; + var nodeName2 = (_serialNode$nodeName = serialNode.nodeName) !== null && _serialNode$nodeName !== void 0 ? _serialNode$nodeName : nodeTypeToName[serialNode.nodeType]; + var nodeType = (_ref92 = (_serialNode$nodeType = serialNode.nodeType) !== null && _serialNode$nodeType !== void 0 ? _serialNode$nodeType : nodeNamesToTypes[serialNode.nodeName]) !== null && _ref92 !== void 0 ? _ref92 : 1; + assert_default(typeof nodeType === 'number', 'nodeType has to be a number, got \''.concat(nodeType, '\'')); + assert_default(typeof nodeName2 === 'string', 'nodeName has to be a string, got \''.concat(nodeName2, '\'')); + nodeName2 = nodeName2.toLowerCase(); + var type2 = null; + if (nodeName2 === 'input') { + type2 = (serialNode.type || serialNode.attributes && serialNode.attributes.type || '').toLowerCase(); + if (!valid_input_type_default().includes(type2)) { + type2 = 'text'; + } + } + var props = _extends({}, serialNode, { + nodeType: nodeType, + nodeName: nodeName2 + }); + if (type2) { + props.type = type2; + } + delete props.attributes; + return Object.freeze(props); + } + function normaliseAttrs(_ref93) { + var _ref93$attributes = _ref93.attributes, attributes2 = _ref93$attributes === void 0 ? {} : _ref93$attributes; + var attrMap = { + htmlFor: 'for', + className: 'class' + }; + return Object.keys(attributes2).reduce(function(attrs, attrName) { + var value = attributes2[attrName]; + assert_default(_typeof(value) !== 'object' || value === null, 'expects attributes not to be an object, \''.concat(attrName, '\' was')); + if (value !== void 0) { + var mappedName = attrMap[attrName] || attrName; + attrs[mappedName] = value !== null ? String(value) : null; + } + return attrs; + }, {}); + } + var serial_virtual_node_default = SerialVirtualNode; + function cleanup(resolve, reject) { + resolve = resolve || function res() {}; + reject = reject || axe.log; + if (!axe._audit) { + throw new Error('No audit configured'); + } + var q = axe.utils.queue(); + var cleanupErrors = []; + Object.keys(axe.plugins).forEach(function(key) { + q.defer(function(res) { + var rej = function rej2(err2) { + cleanupErrors.push(err2); + res(); + }; + try { + axe.plugins[key].cleanup(res, rej); + } catch (err2) { + rej(err2); + } + }); + }); + var flattenedTree = axe.utils.getFlattenedTree(document.body); + axe.utils.querySelectorAll(flattenedTree, 'iframe, frame').forEach(function(node) { + q.defer(function(res, rej) { + return axe.utils.sendCommandToFrame(node.actualNode, { + command: 'cleanup-plugin' + }, res, rej); + }); + }); + q.then(function(results) { + if (cleanupErrors.length === 0) { + resolve(results); + } else { + reject(cleanupErrors); + } + })['catch'](reject); + } + var cleanup_default = cleanup; + var reporters = {}; + var defaultReporter; + function hasReporter(reporterName) { + return reporters.hasOwnProperty(reporterName); + } + function getReporter(reporter) { + if (typeof reporter === 'string' && reporters[reporter]) { + return reporters[reporter]; + } + if (typeof reporter === 'function') { + return reporter; + } + return defaultReporter; + } + function addReporter(name, cb, isDefault) { + reporters[name] = cb; + if (isDefault) { + defaultReporter = cb; + } + } + function configure(spec) { + var audit; + audit = axe._audit; + if (!audit) { + throw new Error('No audit configured'); + } + if (spec.axeVersion || spec.ver) { + var specVersion = spec.axeVersion || spec.ver; + if (!/^\d+\.\d+\.\d+(-canary)?/.test(specVersion)) { + throw new Error('Invalid configured version '.concat(specVersion)); + } + var _specVersion$split = specVersion.split('-'), _specVersion$split2 = _slicedToArray(_specVersion$split, 2), version = _specVersion$split2[0], canary = _specVersion$split2[1]; + var _version$split$map = version.split('.').map(Number), _version$split$map2 = _slicedToArray(_version$split$map, 3), major = _version$split$map2[0], minor = _version$split$map2[1], patch = _version$split$map2[2]; + var _axe$version$split = axe.version.split('-'), _axe$version$split2 = _slicedToArray(_axe$version$split, 2), axeVersion = _axe$version$split2[0], axeCanary = _axe$version$split2[1]; + var _axeVersion$split$map = axeVersion.split('.').map(Number), _axeVersion$split$map2 = _slicedToArray(_axeVersion$split$map, 3), axeMajor = _axeVersion$split$map2[0], axeMinor = _axeVersion$split$map2[1], axePatch = _axeVersion$split$map2[2]; + if (major !== axeMajor || axeMinor < minor || axeMinor === minor && axePatch < patch || major === axeMajor && minor === axeMinor && patch === axePatch && canary && canary !== axeCanary) { + throw new Error('Configured version '.concat(specVersion, ' is not compatible with current axe version ').concat(axe.version)); + } + } + if (spec.reporter && (typeof spec.reporter === 'function' || hasReporter(spec.reporter))) { + audit.reporter = spec.reporter; + } + if (spec.checks) { + if (!Array.isArray(spec.checks)) { + throw new TypeError('Checks property must be an array'); + } + spec.checks.forEach(function(check) { + if (!check.id) { + throw new TypeError('Configured check '.concat(JSON.stringify(check), ' is invalid. Checks must be an object with at least an id property')); + } + audit.addCheck(check); + }); + } + var modifiedRules = []; + if (spec.rules) { + if (!Array.isArray(spec.rules)) { + throw new TypeError('Rules property must be an array'); + } + spec.rules.forEach(function(rule) { + if (!rule.id) { + throw new TypeError('Configured rule '.concat(JSON.stringify(rule), ' is invalid. Rules must be an object with at least an id property')); + } + modifiedRules.push(rule.id); + audit.addRule(rule); + }); + } + if (spec.disableOtherRules) { + audit.rules.forEach(function(rule) { + if (modifiedRules.includes(rule.id) === false) { + rule.enabled = false; + } + }); + } + if (typeof spec.branding !== 'undefined') { + audit.setBranding(spec.branding); + } else { + audit._constructHelpUrls(); + } + if (spec.tagExclude) { + audit.tagExclude = spec.tagExclude; + } + if (spec.locale) { + audit.applyLocale(spec.locale); + } + if (spec.standards) { + configureStandards(spec.standards); + } + if (spec.noHtml) { + audit.noHtml = true; + } + if (spec.allowedOrigins) { + if (!Array.isArray(spec.allowedOrigins)) { + throw new TypeError('Allowed origins property must be an array'); + } + if (spec.allowedOrigins.includes('*')) { + throw new Error('"*" is not allowed. Use "'.concat(constants_default.allOrigins, '" instead')); + } + audit.setAllowedOrigins(spec.allowedOrigins); + } + } + var configure_default = configure; + function frameMessenger2(frameHandler) { + _respondable.updateMessenger(frameHandler); + } + function getRules(tags) { + tags = tags || []; + var matchingRules = !tags.length ? axe._audit.rules : axe._audit.rules.filter(function(item) { + return !!tags.filter(function(tag) { + return item.tags.indexOf(tag) !== -1; + }).length; + }); + var ruleData = axe._audit.data.rules || {}; + return matchingRules.map(function(matchingRule) { + var rd = ruleData[matchingRule.id] || {}; + return { + ruleId: matchingRule.id, + description: rd.description, + help: rd.help, + helpUrl: rd.helpUrl, + tags: matchingRule.tags, + actIds: matchingRule.actIds + }; + }); + } + var get_rules_default = getRules; + function hiddenContentEvaluate(node, options, virtualNode) { + var allowlist = [ 'SCRIPT', 'HEAD', 'TITLE', 'NOSCRIPT', 'STYLE', 'TEMPLATE' ]; + if (!allowlist.includes(node.nodeName.toUpperCase()) && has_content_virtual_default(virtualNode)) { + var styles = window.getComputedStyle(node); + if (styles.getPropertyValue('display') === 'none') { + return void 0; + } else if (styles.getPropertyValue('visibility') === 'hidden') { + var parent = get_composed_parent_default(node); + var parentStyle = parent && window.getComputedStyle(parent); + if (!parentStyle || parentStyle.getPropertyValue('visibility') !== 'hidden') { + return void 0; + } + } + } + return true; + } + var hidden_content_evaluate_default = hiddenContentEvaluate; + var table_exports = {}; + __export(table_exports, { + getAllCells: function getAllCells() { + return get_all_cells_default; + }, + getCellPosition: function getCellPosition() { + return get_cell_position_default; + }, + getHeaders: function getHeaders() { + return get_headers_default; + }, + getScope: function getScope() { + return _getScope; + }, + isColumnHeader: function isColumnHeader() { + return is_column_header_default; + }, + isDataCell: function isDataCell() { + return is_data_cell_default; + }, + isDataTable: function isDataTable() { + return is_data_table_default; + }, + isHeader: function isHeader() { + return is_header_default; + }, + isRowHeader: function isRowHeader() { + return is_row_header_default; + }, + toArray: function toArray() { + return to_grid_default; + }, + toGrid: function toGrid() { + return to_grid_default; + }, + traverse: function traverse() { + return traverse_default; + } + }); + function getAllCells(tableElm) { + var rowIndex, cellIndex, rowLength, cellLength; + var cells = []; + for (rowIndex = 0, rowLength = tableElm.rows.length; rowIndex < rowLength; rowIndex++) { + for (cellIndex = 0, cellLength = tableElm.rows[rowIndex].cells.length; cellIndex < cellLength; cellIndex++) { + cells.push(tableElm.rows[rowIndex].cells[cellIndex]); + } + } + return cells; + } + var get_all_cells_default = getAllCells; + function traverseForHeaders(headerType, position, tableGrid) { + var property = headerType === 'row' ? '_rowHeaders' : '_colHeaders'; + var predicate = headerType === 'row' ? is_row_header_default : is_column_header_default; + var startCell = tableGrid[position.y][position.x]; + var colspan = startCell.colSpan - 1; + var rowspanAttr = startCell.getAttribute('rowspan'); + var rowspanValue = parseInt(rowspanAttr) === 0 || startCell.rowspan === 0 ? tableGrid.length : startCell.rowSpan; + var rowspan = rowspanValue - 1; + var rowStart = position.y + rowspan; + var colStart = position.x + colspan; + var rowEnd = headerType === 'row' ? position.y : 0; + var colEnd = headerType === 'row' ? 0 : position.x; + var headers; + var cells = []; + for (var row = rowStart; row >= rowEnd && !headers; row--) { + for (var col = colStart; col >= colEnd; col--) { + var cell = tableGrid[row] ? tableGrid[row][col] : void 0; + if (!cell) { + continue; + } + var vNode = axe.utils.getNodeFromTree(cell); + if (vNode[property]) { + headers = vNode[property]; + break; + } + cells.push(cell); + } + } + headers = (headers || []).concat(cells.filter(predicate)); + cells.forEach(function(tableCell) { + var vNode = axe.utils.getNodeFromTree(tableCell); + vNode[property] = headers; + }); + return headers; + } + function getHeaders(cell, tableGrid) { + if (cell.getAttribute('headers')) { + var headers = idrefs_default(cell, 'headers'); + if (headers.filter(function(header) { + return header; + }).length) { + return headers; + } + } + if (!tableGrid) { + tableGrid = to_grid_default(find_up_default(cell, 'table')); + } + var position = get_cell_position_default(cell, tableGrid); + var rowHeaders = traverseForHeaders('row', position, tableGrid); + var colHeaders = traverseForHeaders('col', position, tableGrid); + return [].concat(rowHeaders, colHeaders).reverse(); + } + var get_headers_default = getHeaders; + function isDataCell(cell) { + if (!cell.children.length && !cell.textContent.trim()) { + return false; + } + var role = cell.getAttribute('role'); + if (is_valid_role_default(role)) { + return [ 'cell', 'gridcell' ].includes(role); + } else { + return cell.nodeName.toUpperCase() === 'TD'; + } + } + var is_data_cell_default = isDataCell; + function isDataTable(node) { + var role = (node.getAttribute('role') || '').toLowerCase(); + if ((role === 'presentation' || role === 'none') && !_isFocusable(node)) { + return false; + } + if (node.getAttribute('contenteditable') === 'true' || find_up_default(node, '[contenteditable="true"]')) { + return true; + } + if (role === 'grid' || role === 'treegrid' || role === 'table') { + return true; + } + if (get_role_type_default(role) === 'landmark') { + return true; + } + if (node.getAttribute('datatable') === '0') { + return false; + } + if (node.getAttribute('summary')) { + return true; + } + if (node.tHead || node.tFoot || node.caption) { + return true; + } + for (var childIndex = 0, childLength = node.children.length; childIndex < childLength; childIndex++) { + if (node.children[childIndex].nodeName.toUpperCase() === 'COLGROUP') { + return true; + } + } + var cells = 0; + var rowLength = node.rows.length; + var row, cell; + var hasBorder = false; + for (var rowIndex = 0; rowIndex < rowLength; rowIndex++) { + row = node.rows[rowIndex]; + for (var cellIndex = 0, cellLength = row.cells.length; cellIndex < cellLength; cellIndex++) { + cell = row.cells[cellIndex]; + if (cell.nodeName.toUpperCase() === 'TH') { + return true; + } + if (!hasBorder && (cell.offsetWidth !== cell.clientWidth || cell.offsetHeight !== cell.clientHeight)) { + hasBorder = true; + } + if (cell.getAttribute('scope') || cell.getAttribute('headers') || cell.getAttribute('abbr')) { + return true; + } + if ([ 'columnheader', 'rowheader' ].includes((cell.getAttribute('role') || '').toLowerCase())) { + return true; + } + if (cell.children.length === 1 && cell.children[0].nodeName.toUpperCase() === 'ABBR') { + return true; + } + cells++; + } + } + if (node.getElementsByTagName('table').length) { + return false; + } + if (rowLength < 2) { + return false; + } + var sampleRow = node.rows[Math.ceil(rowLength / 2)]; + if (sampleRow.cells.length === 1 && sampleRow.cells[0].colSpan === 1) { + return false; + } + if (sampleRow.cells.length >= 5) { + return true; + } + if (hasBorder) { + return true; + } + var bgColor, bgImage; + for (rowIndex = 0; rowIndex < rowLength; rowIndex++) { + row = node.rows[rowIndex]; + if (bgColor && bgColor !== window.getComputedStyle(row).getPropertyValue('background-color')) { + return true; + } else { + bgColor = window.getComputedStyle(row).getPropertyValue('background-color'); + } + if (bgImage && bgImage !== window.getComputedStyle(row).getPropertyValue('background-image')) { + return true; + } else { + bgImage = window.getComputedStyle(row).getPropertyValue('background-image'); + } + } + if (rowLength >= 20) { + return true; + } + if (get_element_coordinates_default(node).width > get_viewport_size_default(window).width * .95) { + return false; + } + if (cells < 10) { + return false; + } + if (node.querySelector('object, embed, iframe, applet')) { + return false; + } + return true; + } + var is_data_table_default = isDataTable; + function isHeader(cell) { + if (is_column_header_default(cell) || is_row_header_default(cell)) { + return true; + } + if (cell.getAttribute('id')) { + var _id2 = escape_selector_default(cell.getAttribute('id')); + return !!document.querySelector('[headers~="'.concat(_id2, '"]')); + } + return false; + } + var is_header_default = isHeader; + function traverseTable(dir, position, tableGrid, callback) { + var result; + var cell = tableGrid[position.y] ? tableGrid[position.y][position.x] : void 0; + if (!cell) { + return []; + } + if (typeof callback === 'function') { + result = callback(cell, position, tableGrid); + if (result === true) { + return [ cell ]; + } + } + result = traverseTable(dir, { + x: position.x + dir.x, + y: position.y + dir.y + }, tableGrid, callback); + result.unshift(cell); + return result; + } + function traverse(dir, startPos, tableGrid, callback) { + if (Array.isArray(startPos)) { + callback = tableGrid; + tableGrid = startPos; + startPos = { + x: 0, + y: 0 + }; + } + if (typeof dir === 'string') { + switch (dir) { + case 'left': + dir = { + x: -1, + y: 0 + }; + break; + + case 'up': + dir = { + x: 0, + y: -1 + }; + break; + + case 'right': + dir = { + x: 1, + y: 0 + }; + break; + + case 'down': + dir = { + x: 0, + y: 1 + }; + break; + } + } + return traverseTable(dir, { + x: startPos.x + dir.x, + y: startPos.y + dir.y + }, tableGrid, callback); + } + var traverse_default = traverse; + function thHasDataCellsEvaluate(node) { + var cells = get_all_cells_default(node); + var checkResult = this; + var reffedHeaders = []; + cells.forEach(function(cell) { + var headers2 = cell.getAttribute('headers'); + if (headers2) { + reffedHeaders = reffedHeaders.concat(headers2.split(/\s+/)); + } + var ariaLabel = cell.getAttribute('aria-labelledby'); + if (ariaLabel) { + reffedHeaders = reffedHeaders.concat(ariaLabel.split(/\s+/)); + } + }); + var headers = cells.filter(function(cell) { + if (sanitize_default(cell.textContent) === '') { + return false; + } + return cell.nodeName.toUpperCase() === 'TH' || [ 'rowheader', 'columnheader' ].indexOf(cell.getAttribute('role')) !== -1; + }); + var tableGrid = to_grid_default(node); + var out = true; + headers.forEach(function(header) { + if (header.getAttribute('id') && reffedHeaders.includes(header.getAttribute('id'))) { + return; + } + var pos = get_cell_position_default(header, tableGrid); + var hasCell = false; + if (is_column_header_default(header)) { + hasCell = traverse_default('down', pos, tableGrid).find(function(cell) { + return !is_column_header_default(cell) && get_headers_default(cell, tableGrid).includes(header); + }); + } + if (!hasCell && is_row_header_default(header)) { + hasCell = traverse_default('right', pos, tableGrid).find(function(cell) { + return !is_row_header_default(cell) && get_headers_default(cell, tableGrid).includes(header); + }); + } + if (!hasCell) { + checkResult.relatedNodes(header); + } + out = out && hasCell; + }); + return out ? true : void 0; + } + var th_has_data_cells_evaluate_default = thHasDataCellsEvaluate; + function tdHeadersAttrEvaluate(node) { + var cells = []; + var reviewCells = []; + var badCells = []; + for (var rowIndex = 0; rowIndex < node.rows.length; rowIndex++) { + var row = node.rows[rowIndex]; + for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) { + cells.push(row.cells[cellIndex]); + } + } + var ids = cells.filter(function(cell) { + return cell.getAttribute('id'); + }).map(function(cell) { + return cell.getAttribute('id'); + }); + cells.forEach(function(cell) { + var isSelf = false; + var notOfTable = false; + if (!cell.hasAttribute('headers') || !_isVisibleToScreenReaders(cell)) { + return; + } + var headersAttr = cell.getAttribute('headers').trim(); + if (!headersAttr) { + return reviewCells.push(cell); + } + var headers = token_list_default(headersAttr); + if (headers.length !== 0) { + if (cell.getAttribute('id')) { + isSelf = headers.indexOf(cell.getAttribute('id').trim()) !== -1; + } + notOfTable = headers.some(function(header) { + return !ids.includes(header); + }); + if (isSelf || notOfTable) { + badCells.push(cell); + } + } + }); + if (badCells.length > 0) { + this.relatedNodes(badCells); + return false; + } + if (reviewCells.length) { + this.relatedNodes(reviewCells); + return void 0; + } + return true; + } + var aria_exports = {}; + __export(aria_exports, { + allowedAttr: function allowedAttr() { + return allowed_attr_default; + }, + arialabelText: function arialabelText() { + return _arialabelText; + }, + arialabelledbyText: function arialabelledbyText() { + return arialabelledby_text_default; + }, + getAccessibleRefs: function getAccessibleRefs() { + return get_accessible_refs_default; + }, + getElementUnallowedRoles: function getElementUnallowedRoles() { + return get_element_unallowed_roles_default; + }, + getExplicitRole: function getExplicitRole() { + return get_explicit_role_default; + }, + getImplicitRole: function getImplicitRole() { + return implicit_role_default; + }, + getOwnedVirtual: function getOwnedVirtual() { + return get_owned_virtual_default; + }, + getRole: function getRole() { + return get_role_default; + }, + getRoleType: function getRoleType() { + return get_role_type_default; + }, + getRolesByType: function getRolesByType() { + return get_roles_by_type_default; + }, + getRolesWithNameFromContents: function getRolesWithNameFromContents() { + return get_roles_with_name_from_contents_default; + }, + implicitNodes: function implicitNodes() { + return implicit_nodes_default; + }, + implicitRole: function implicitRole() { + return implicit_role_default; + }, + isAccessibleRef: function isAccessibleRef() { + return is_accessible_ref_default; + }, + isAriaRoleAllowedOnElement: function isAriaRoleAllowedOnElement() { + return is_aria_role_allowed_on_element_default; + }, + isComboboxPopup: function isComboboxPopup() { + return _isComboboxPopup; + }, + isUnsupportedRole: function isUnsupportedRole() { + return is_unsupported_role_default; + }, + isValidRole: function isValidRole() { + return is_valid_role_default; + }, + label: function label() { + return label_default2; + }, + labelVirtual: function labelVirtual() { + return label_virtual_default; + }, + lookupTable: function lookupTable() { + return lookup_table_default; + }, + namedFromContents: function namedFromContents() { + return named_from_contents_default; + }, + requiredAttr: function requiredAttr() { + return required_attr_default; + }, + requiredContext: function requiredContext() { + return required_context_default; + }, + requiredOwned: function requiredOwned() { + return required_owned_default; + }, + validateAttr: function validateAttr() { + return validate_attr_default; + }, + validateAttrValue: function validateAttrValue() { + return validate_attr_value_default; + } + }); + function allowedAttr(role) { + var roleDef = standards_default.ariaRoles[role]; + var attrs = _toConsumableArray(get_global_aria_attrs_default()); + if (!roleDef) { + return attrs; + } + if (roleDef.allowedAttrs) { + attrs.push.apply(attrs, _toConsumableArray(roleDef.allowedAttrs)); + } + if (roleDef.requiredAttrs) { + attrs.push.apply(attrs, _toConsumableArray(roleDef.requiredAttrs)); + } + return attrs; + } + var allowed_attr_default = allowedAttr; + var idRefsRegex = /^idrefs?$/; + function cacheIdRefs(node, idRefs, refAttrs) { + if (node.hasAttribute) { + if (node.nodeName.toUpperCase() === 'LABEL' && node.hasAttribute('for')) { + var _id3 = node.getAttribute('for'); + if (!idRefs.has(_id3)) { + idRefs.set(_id3, [ node ]); + } else { + idRefs.get(_id3).push(node); + } + } + for (var _i28 = 0; _i28 < refAttrs.length; ++_i28) { + var attr = refAttrs[_i28]; + var attrValue = sanitize_default(node.getAttribute(attr) || ''); + if (!attrValue) { + continue; + } + var _iterator14 = _createForOfIteratorHelper(token_list_default(attrValue)), _step14; + try { + for (_iterator14.s(); !(_step14 = _iterator14.n()).done; ) { + var token = _step14.value; + if (!idRefs.has(token)) { + idRefs.set(token, [ node ]); + } else { + idRefs.get(token).push(node); + } + } + } catch (err) { + _iterator14.e(err); + } finally { + _iterator14.f(); + } + } + } + for (var _i29 = 0; _i29 < node.childNodes.length; _i29++) { + if (node.childNodes[_i29].nodeType === 1) { + cacheIdRefs(node.childNodes[_i29], idRefs, refAttrs); + } + } + } + function getAccessibleRefs(node) { + var _idRefs$get; + node = node.actualNode || node; + var root = get_root_node_default2(node); + root = root.documentElement || root; + var idRefsByRoot = cache_default.get('idRefsByRoot', function() { + return new Map(); + }); + var idRefs = idRefsByRoot.get(root); + if (!idRefs) { + idRefs = new Map(); + idRefsByRoot.set(root, idRefs); + var refAttrs = Object.keys(standards_default.ariaAttrs).filter(function(attr) { + var type2 = standards_default.ariaAttrs[attr].type; + return idRefsRegex.test(type2); + }); + cacheIdRefs(root, idRefs, refAttrs); + } + return (_idRefs$get = idRefs.get(node.id)) !== null && _idRefs$get !== void 0 ? _idRefs$get : []; + } + var get_accessible_refs_default = getAccessibleRefs; + function isAriaRoleAllowedOnElement(node, role) { + var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node); + var implicitRole3 = implicit_role_default(vNode); + var spec = get_element_spec_default(vNode); + if (Array.isArray(spec.allowedRoles)) { + return spec.allowedRoles.includes(role); + } + if (role === implicitRole3) { + return false; + } + return !!spec.allowedRoles; + } + var is_aria_role_allowed_on_element_default = isAriaRoleAllowedOnElement; + var dpubRoles2 = [ 'doc-backlink', 'doc-biblioentry', 'doc-biblioref', 'doc-cover', 'doc-endnote', 'doc-glossref', 'doc-noteref' ]; + var landmarkRoles = { + header: 'banner', + footer: 'contentinfo' + }; + function getRoleSegments(vNode) { + var roles = []; + if (!vNode) { + return roles; + } + if (vNode.hasAttr('role')) { + var nodeRoles = token_list_default(vNode.attr('role').toLowerCase()); + roles = roles.concat(nodeRoles); + } + return roles.filter(function(role) { + return is_valid_role_default(role); + }); + } + function getElementUnallowedRoles(node) { + var allowImplicit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + var _nodeLookup21 = _nodeLookup(node), vNode = _nodeLookup21.vNode; + if (!is_html_element_default(vNode)) { + return []; + } + var nodeName2 = vNode.props.nodeName; + var implicitRole3 = implicit_role_default(vNode) || landmarkRoles[nodeName2]; + var roleSegments = getRoleSegments(vNode); + return roleSegments.filter(function(role) { + return !roleIsAllowed(role, vNode, allowImplicit, implicitRole3); + }); + } + function roleIsAllowed(role, vNode, allowImplicit, implicitRole3) { + if (allowImplicit && role === implicitRole3) { + return true; + } + if (dpubRoles2.includes(role) && get_role_type_default(role) !== implicitRole3) { + return false; + } + return is_aria_role_allowed_on_element_default(vNode, role); + } + var get_element_unallowed_roles_default = getElementUnallowedRoles; + function getAriaRolesByType(type2) { + return Object.keys(standards_default.ariaRoles).filter(function(roleName) { + return standards_default.ariaRoles[roleName].type === type2; + }); + } + var get_aria_roles_by_type_default = getAriaRolesByType; + function getRolesByType(roleType) { + return get_aria_roles_by_type_default(roleType); + } + var get_roles_by_type_default = getRolesByType; + function getAriaRolesSupportingNameFromContent() { + return cache_default.get('ariaRolesNameFromContent', function() { + return Object.keys(standards_default.ariaRoles).filter(function(roleName) { + return standards_default.ariaRoles[roleName].nameFromContent; + }); + }); + } + var get_aria_roles_supporting_name_from_content_default = getAriaRolesSupportingNameFromContent; + function getRolesWithNameFromContents() { + return get_aria_roles_supporting_name_from_content_default(); + } + var get_roles_with_name_from_contents_default = getRolesWithNameFromContents; + var isNull = function isNull(value) { + return value === null; + }; + var isNotNull = function isNotNull(value) { + return value !== null; + }; + var lookupTable = {}; + lookupTable.attributes = { + 'aria-activedescendant': { + type: 'idref', + allowEmpty: true, + unsupported: false + }, + 'aria-atomic': { + type: 'boolean', + values: [ 'true', 'false' ], + unsupported: false + }, + 'aria-autocomplete': { + type: 'nmtoken', + values: [ 'inline', 'list', 'both', 'none' ], + unsupported: false + }, 'aria-busy': { type: 'boolean', values: [ 'true', 'false' ], @@ -19512,4391 +21059,4132 @@ 'aria-keyshortcuts': { type: 'string', allowEmpty: true, - unsupported: false - }, - 'aria-label': { - type: 'string', - allowEmpty: true, - unsupported: false - }, - 'aria-labelledby': { - type: 'idrefs', - allowEmpty: true, - unsupported: false - }, - 'aria-level': { - type: 'int', - unsupported: false - }, - 'aria-live': { - type: 'nmtoken', - values: [ 'off', 'polite', 'assertive' ], - unsupported: false - }, - 'aria-modal': { - type: 'boolean', - values: [ 'true', 'false' ], - unsupported: false - }, - 'aria-multiline': { - type: 'boolean', - values: [ 'true', 'false' ], - unsupported: false - }, - 'aria-multiselectable': { - type: 'boolean', - values: [ 'true', 'false' ], - unsupported: false - }, - 'aria-orientation': { - type: 'nmtoken', - values: [ 'horizontal', 'vertical' ], - unsupported: false - }, - 'aria-owns': { - type: 'idrefs', - allowEmpty: true, - unsupported: false - }, - 'aria-placeholder': { - type: 'string', - allowEmpty: true, - unsupported: false - }, - 'aria-posinset': { - type: 'int', - unsupported: false - }, - 'aria-pressed': { - type: 'nmtoken', - values: [ 'true', 'false', 'mixed', 'undefined' ], - unsupported: false - }, - 'aria-readonly': { - type: 'boolean', - values: [ 'true', 'false' ], - unsupported: false - }, - 'aria-relevant': { - type: 'nmtokens', - values: [ 'additions', 'removals', 'text', 'all' ], - unsupported: false - }, - 'aria-required': { - type: 'boolean', - values: [ 'true', 'false' ], - unsupported: false - }, - 'aria-roledescription': { - type: 'string', - allowEmpty: true, - unsupported: false - }, - 'aria-rowcount': { - type: 'int', - unsupported: false - }, - 'aria-rowindex': { - type: 'int', - unsupported: false - }, - 'aria-rowspan': { - type: 'int', - unsupported: false - }, - 'aria-selected': { - type: 'nmtoken', - values: [ 'true', 'false', 'undefined' ], - unsupported: false - }, - 'aria-setsize': { - type: 'int', - unsupported: false - }, - 'aria-sort': { - type: 'nmtoken', - values: [ 'ascending', 'descending', 'other', 'none' ], - unsupported: false - }, - 'aria-valuemax': { - type: 'decimal', - unsupported: false - }, - 'aria-valuemin': { - type: 'decimal', - unsupported: false - }, - 'aria-valuenow': { - type: 'decimal', - unsupported: false - }, - 'aria-valuetext': { - type: 'string', - unsupported: false - } - }; - lookupTable.globalAttributes = [ 'aria-atomic', 'aria-busy', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-live', 'aria-owns', 'aria-relevant', 'aria-roledescription' ]; - lookupTable.role = { - alert: { - type: 'widget', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] - }, - alertdialog: { - type: 'widget', - attributes: { - allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'dialog', 'section' ] - }, - application: { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage', 'aria-activedescendant' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'article', 'audio', 'embed', 'iframe', 'object', 'section', 'svg', 'video' ] - }, - article: { - type: 'structure', - attributes: { - allowed: [ 'aria-expanded', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - implicit: [ 'article' ], - unsupported: false - }, - banner: { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - implicit: [ 'header' ], - unsupported: false, - allowedElements: [ 'section' ] - }, - button: { - type: 'widget', - attributes: { - allowed: [ 'aria-expanded', 'aria-pressed', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author', 'contents' ], - context: null, - implicit: [ 'button', 'input[type="button"]', 'input[type="image"]', 'input[type="reset"]', 'input[type="submit"]', 'summary' ], - unsupported: false, - allowedElements: [ { - nodeName: 'a', - attributes: { - href: isNotNull - } - } ] - }, - cell: { - type: 'structure', - attributes: { - allowed: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author', 'contents' ], - context: [ 'row' ], - implicit: [ 'td', 'th' ], - unsupported: false - }, - checkbox: { - type: 'widget', - attributes: { - allowed: [ 'aria-checked', 'aria-required', 'aria-readonly', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author', 'contents' ], - context: null, - implicit: [ 'input[type="checkbox"]' ], - unsupported: false, - allowedElements: [ 'button' ] + unsupported: false }, - columnheader: { - type: 'structure', - attributes: { - allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author', 'contents' ], - context: [ 'row' ], - implicit: [ 'th' ], + 'aria-label': { + type: 'string', + allowEmpty: true, unsupported: false }, - combobox: { - type: 'composite', - attributes: { - allowed: [ 'aria-autocomplete', 'aria-required', 'aria-activedescendant', 'aria-orientation', 'aria-errormessage' ], - required: [ 'aria-expanded' ] - }, - owned: { - all: [ 'listbox', 'tree', 'grid', 'dialog', 'textbox' ] - }, - nameFrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ { - nodeName: 'input', - properties: { - type: [ 'text', 'search', 'tel', 'url', 'email' ] - } - } ] + 'aria-labelledby': { + type: 'idrefs', + allowEmpty: true, + unsupported: false }, - command: { - nameFrom: [ 'author' ], - type: 'abstract', + 'aria-level': { + type: 'int', unsupported: false }, - complementary: { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - implicit: [ 'aside' ], - unsupported: false, - allowedElements: [ 'section' ] + 'aria-live': { + type: 'nmtoken', + values: [ 'off', 'polite', 'assertive' ], + unsupported: false }, - composite: { - nameFrom: [ 'author' ], - type: 'abstract', + 'aria-modal': { + type: 'boolean', + values: [ 'true', 'false' ], unsupported: false }, - contentinfo: { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - implicit: [ 'footer' ], - unsupported: false, - allowedElements: [ 'section' ] + 'aria-multiline': { + type: 'boolean', + values: [ 'true', 'false' ], + unsupported: false }, - definition: { - type: 'structure', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - implicit: [ 'dd', 'dfn' ], + 'aria-multiselectable': { + type: 'boolean', + values: [ 'true', 'false' ], unsupported: false }, - dialog: { - type: 'widget', - attributes: { - allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - implicit: [ 'dialog' ], - unsupported: false, - allowedElements: [ 'section' ] + 'aria-orientation': { + type: 'nmtoken', + values: [ 'horizontal', 'vertical' ], + unsupported: false }, - directory: { - type: 'structure', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author', 'contents' ], - context: null, - unsupported: false, - allowedElements: [ 'ol', 'ul' ] + 'aria-owns': { + type: 'idrefs', + allowEmpty: true, + unsupported: false }, - document: { - type: 'structure', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - implicit: [ 'body' ], - unsupported: false, - allowedElements: [ 'article', 'embed', 'iframe', 'object', 'section', 'svg' ] + 'aria-placeholder': { + type: 'string', + allowEmpty: true, + unsupported: false }, - 'doc-abstract': { - type: 'section', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + 'aria-posinset': { + type: 'int', + unsupported: false }, - 'doc-acknowledgments': { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + 'aria-pressed': { + type: 'nmtoken', + values: [ 'true', 'false', 'mixed', 'undefined' ], + unsupported: false }, - 'doc-afterword': { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + 'aria-readonly': { + type: 'boolean', + values: [ 'true', 'false' ], + unsupported: false }, - 'doc-appendix': { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + 'aria-relevant': { + type: 'nmtokens', + values: [ 'additions', 'removals', 'text', 'all' ], + unsupported: false }, - 'doc-backlink': { - type: 'link', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author', 'contents' ], - context: null, - unsupported: false, - allowedElements: [ { - nodeName: 'a', - attributes: { - href: isNotNull - } - } ] + 'aria-required': { + type: 'boolean', + values: [ 'true', 'false' ], + unsupported: false }, - 'doc-biblioentry': { - type: 'listitem', - attributes: { - allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: [ 'doc-bibliography' ], - unsupported: false, - allowedElements: [ 'li' ] + 'aria-roledescription': { + type: 'string', + allowEmpty: true, + unsupported: false }, - 'doc-bibliography': { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: { - one: [ 'doc-biblioentry' ] - }, - nameFrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + 'aria-rowcount': { + type: 'int', + unsupported: false }, - 'doc-biblioref': { - type: 'link', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author', 'contents' ], - context: null, - unsupported: false, - allowedElements: [ { - nodeName: 'a', - attributes: { - href: isNotNull - } - } ] + 'aria-rowindex': { + type: 'int', + unsupported: false + }, + 'aria-rowspan': { + type: 'int', + unsupported: false }, - 'doc-chapter': { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - namefrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + 'aria-selected': { + type: 'nmtoken', + values: [ 'true', 'false', 'undefined' ], + unsupported: false }, - 'doc-colophon': { - type: 'section', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - namefrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + 'aria-setsize': { + type: 'int', + unsupported: false }, - 'doc-conclusion': { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - namefrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + 'aria-sort': { + type: 'nmtoken', + values: [ 'ascending', 'descending', 'other', 'none' ], + unsupported: false }, - 'doc-cover': { - type: 'img', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - namefrom: [ 'author' ], - context: null, + 'aria-valuemax': { + type: 'decimal', unsupported: false }, - 'doc-credit': { - type: 'section', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - namefrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + 'aria-valuemin': { + type: 'decimal', + unsupported: false }, - 'doc-credits': { - type: 'landmark', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - namefrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + 'aria-valuenow': { + type: 'decimal', + unsupported: false }, - 'doc-dedication': { - type: 'section', + 'aria-valuetext': { + type: 'string', + unsupported: false + } + }; + lookupTable.globalAttributes = [ 'aria-atomic', 'aria-busy', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-live', 'aria-owns', 'aria-relevant', 'aria-roledescription' ]; + lookupTable.role = { + alert: { + type: 'widget', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, unsupported: false, allowedElements: [ 'section' ] }, - 'doc-endnote': { - type: 'listitem', + alertdialog: { + type: 'widget', attributes: { - allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], - context: [ 'doc-endnotes' ], + nameFrom: [ 'author' ], + context: null, unsupported: false, - allowedElements: [ 'li' ] + allowedElements: [ 'dialog', 'section' ] }, - 'doc-endnotes': { + application: { type: 'landmark', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: { - one: [ 'doc-endnote' ] + allowed: [ 'aria-expanded', 'aria-errormessage', 'aria-activedescendant' ] }, - namefrom: [ 'author' ], + owned: null, + nameFrom: [ 'author' ], context: null, unsupported: false, - allowedElements: [ 'section' ] + allowedElements: [ 'article', 'audio', 'embed', 'iframe', 'object', 'section', 'svg', 'video' ] }, - 'doc-epigraph': { - type: 'section', + article: { + type: 'structure', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, + implicit: [ 'article' ], unsupported: false }, - 'doc-epilogue': { + banner: { type: 'landmark', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, + implicit: [ 'header' ], unsupported: false, allowedElements: [ 'section' ] }, - 'doc-errata': { - type: 'landmark', + button: { + type: 'widget', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-pressed', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author', 'contents' ], context: null, + implicit: [ 'button', 'input[type="button"]', 'input[type="image"]', 'input[type="reset"]', 'input[type="submit"]', 'summary' ], unsupported: false, - allowedElements: [ 'section' ] + allowedElements: [ { + nodeName: 'a', + attributes: { + href: isNotNull + } + } ] }, - 'doc-example': { - type: 'section', + cell: { + type: 'structure', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'aside', 'section' ] + nameFrom: [ 'author', 'contents' ], + context: [ 'row' ], + implicit: [ 'td', 'th' ], + unsupported: false }, - 'doc-footnote': { - type: 'section', + checkbox: { + type: 'widget', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-checked', 'aria-required', 'aria-readonly', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author', 'contents' ], context: null, + implicit: [ 'input[type="checkbox"]' ], unsupported: false, - allowedElements: [ 'aside', 'footer', 'header' ] + allowedElements: [ 'button' ] }, - 'doc-foreword': { - type: 'landmark', + columnheader: { + type: 'structure', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] + nameFrom: [ 'author', 'contents' ], + context: [ 'row' ], + implicit: [ 'th' ], + unsupported: false }, - 'doc-glossary': { - type: 'landmark', + combobox: { + type: 'composite', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-autocomplete', 'aria-required', 'aria-activedescendant', 'aria-orientation', 'aria-errormessage' ], + required: [ 'aria-expanded' ] }, - owned: [ 'term', 'definition' ], - namefrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'dl' ] - }, - 'doc-glossref': { - type: 'link', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + owned: { + all: [ 'listbox', 'tree', 'grid', 'dialog', 'textbox' ] }, - owned: null, - namefrom: [ 'author', 'contents' ], + nameFrom: [ 'author' ], context: null, unsupported: false, allowedElements: [ { - nodeName: 'a', - attributes: { - href: isNotNull + nodeName: 'input', + properties: { + type: [ 'text', 'search', 'tel', 'url', 'email' ] } } ] }, - 'doc-index': { - type: 'navigation', + command: { + nameFrom: [ 'author' ], + type: 'abstract', + unsupported: false + }, + complementary: { + type: 'landmark', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, + implicit: [ 'aside' ], unsupported: false, - allowedElements: [ 'nav', 'section' ] + allowedElements: [ 'section' ] }, - 'doc-introduction': { + composite: { + nameFrom: [ 'author' ], + type: 'abstract', + unsupported: false + }, + contentinfo: { type: 'landmark', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, + implicit: [ 'footer' ], unsupported: false, allowedElements: [ 'section' ] }, - 'doc-noteref': { - type: 'link', + definition: { + type: 'structure', attributes: { - allowed: [ 'aria-expanded' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author', 'contents' ], + nameFrom: [ 'author' ], context: null, - unsupported: false, - allowedElements: [ { - nodeName: 'a', - attributes: { - href: isNotNull - } - } ] - }, - 'doc-notice': { - type: 'note', + implicit: [ 'dd', 'dfn' ], + unsupported: false + }, + dialog: { + type: 'widget', attributes: { - allowed: [ 'aria-expanded' ] + allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, + implicit: [ 'dialog' ], unsupported: false, allowedElements: [ 'section' ] }, - 'doc-pagebreak': { - type: 'separator', + directory: { + type: 'structure', attributes: { - allowed: [ 'aria-expanded' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author', 'contents' ], context: null, unsupported: false, - allowedElements: [ 'hr' ] + allowedElements: [ 'ol', 'ul' ] }, - 'doc-pagelist': { - type: 'navigation', + document: { + type: 'structure', attributes: { - allowed: [ 'aria-expanded' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, + implicit: [ 'body' ], unsupported: false, - allowedElements: [ 'nav', 'section' ] + allowedElements: [ 'article', 'embed', 'iframe', 'object', 'section', 'svg' ] }, - 'doc-part': { - type: 'landmark', + 'doc-abstract': { + type: 'section', attributes: { - allowed: [ 'aria-expanded' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, unsupported: false, allowedElements: [ 'section' ] }, - 'doc-preface': { + 'doc-acknowledgments': { type: 'landmark', attributes: { - allowed: [ 'aria-expanded' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, unsupported: false, allowedElements: [ 'section' ] }, - 'doc-prologue': { + 'doc-afterword': { type: 'landmark', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, unsupported: false, allowedElements: [ 'section' ] }, - 'doc-pullquote': { - type: 'none', + 'doc-appendix': { + type: 'landmark', attributes: { - allowed: [ 'aria-expanded' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author' ], context: null, unsupported: false, - allowedElements: [ 'aside', 'section' ] + allowedElements: [ 'section' ] }, - 'doc-qna': { - type: 'section', + 'doc-backlink': { + type: 'link', attributes: { - allowed: [ 'aria-expanded' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author', 'contents' ], context: null, unsupported: false, - allowedElements: [ 'section' ] + allowedElements: [ { + nodeName: 'a', + attributes: { + href: isNotNull + } + } ] }, - 'doc-subtitle': { - type: 'sectionhead', + 'doc-biblioentry': { + type: 'listitem', attributes: { - allowed: [ 'aria-expanded' ] + allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], - context: null, + nameFrom: [ 'author' ], + context: [ 'doc-bibliography' ], unsupported: false, - allowedElements: { - nodeName: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ] - } + allowedElements: [ 'li' ] }, - 'doc-tip': { - type: 'note', + 'doc-bibliography': { + type: 'landmark', attributes: { - allowed: [ 'aria-expanded' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, - owned: null, - namefrom: [ 'author' ], + owned: { + one: [ 'doc-biblioentry' ] + }, + nameFrom: [ 'author' ], context: null, unsupported: false, - allowedElements: [ 'aside' ] + allowedElements: [ 'section' ] }, - 'doc-toc': { - type: 'navigation', + 'doc-biblioref': { + type: 'link', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - namefrom: [ 'author' ], + nameFrom: [ 'author', 'contents' ], context: null, unsupported: false, - allowedElements: [ 'nav', 'section' ] + allowedElements: [ { + nodeName: 'a', + attributes: { + href: isNotNull + } + } ] }, - feed: { - type: 'structure', + 'doc-chapter': { + type: 'landmark', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, - owned: { - one: [ 'article' ] - }, - nameFrom: [ 'author' ], + owned: null, + namefrom: [ 'author' ], context: null, unsupported: false, - allowedElements: [ 'article', 'aside', 'section' ] + allowedElements: [ 'section' ] }, - figure: { - type: 'structure', + 'doc-colophon': { + type: 'section', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'figure' ], - unsupported: false + unsupported: false, + allowedElements: [ 'section' ] }, - form: { + 'doc-conclusion': { type: 'landmark', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author' ], - context: null, - implicit: [ 'form' ], - unsupported: false - }, - grid: { - type: 'composite', - attributes: { - allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-colcount', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-rowcount', 'aria-errormessage' ] - }, - owned: { - one: [ 'rowgroup', 'row' ] - }, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'table' ], - unsupported: false + unsupported: false, + allowedElements: [ 'section' ] }, - gridcell: { - type: 'widget', + 'doc-cover': { + type: 'img', attributes: { - allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-readonly', 'aria-required', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], - context: [ 'row' ], - implicit: [ 'td', 'th' ], + namefrom: [ 'author' ], + context: null, unsupported: false }, - group: { - type: 'structure', + 'doc-credit': { + type: 'section', attributes: { - allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'details', 'optgroup' ], unsupported: false, - allowedElements: [ 'dl', 'figcaption', 'fieldset', 'figure', 'footer', 'header', 'ol', 'ul' ] + allowedElements: [ 'section' ] }, - heading: { - type: 'structure', + 'doc-credits': { + type: 'landmark', attributes: { - required: [ 'aria-level' ], allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ], - unsupported: false + unsupported: false, + allowedElements: [ 'section' ] }, - img: { - type: 'structure', + 'doc-dedication': { + type: 'section', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'img' ], unsupported: false, - allowedElements: [ 'embed', 'iframe', 'object', 'svg' ] - }, - input: { - nameFrom: [ 'author' ], - type: 'abstract', - unsupported: false - }, - landmark: { - nameFrom: [ 'author' ], - type: 'abstract', - unsupported: false + allowedElements: [ 'section' ] }, - link: { - type: 'widget', + 'doc-endnote': { + type: 'listitem', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], - context: null, - implicit: [ 'a[href]', 'area[href]' ], + namefrom: [ 'author' ], + context: [ 'doc-endnotes' ], unsupported: false, - allowedElements: [ 'button', { - nodeName: 'input', - properties: { - type: [ 'image', 'button' ] - } - } ] + allowedElements: [ 'li' ] }, - list: { - type: 'structure', + 'doc-endnotes': { + type: 'landmark', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: { - all: [ 'listitem' ] - }, - nameFrom: [ 'author' ], - context: null, - implicit: [ 'ol', 'ul', 'dl' ], - unsupported: false - }, - listbox: { - type: 'composite', - attributes: { - allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ] - }, - owned: { - all: [ 'option' ] + one: [ 'doc-endnote' ] }, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'select' ], unsupported: false, - allowedElements: [ 'ol', 'ul' ] + allowedElements: [ 'section' ] }, - listitem: { - type: 'structure', + 'doc-epigraph': { + type: 'section', attributes: { - allowed: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], - context: [ 'list' ], - implicit: [ 'li', 'dt' ], + namefrom: [ 'author' ], + context: null, unsupported: false }, - log: { - type: 'widget', + 'doc-epilogue': { + type: 'landmark', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, unsupported: false, allowedElements: [ 'section' ] }, - main: { + 'doc-errata': { type: 'landmark', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'main' ], unsupported: false, - allowedElements: [ 'article', 'section' ] + allowedElements: [ 'section' ] }, - marquee: { - type: 'widget', + 'doc-example': { + type: 'section', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, unsupported: false, - allowedElements: [ 'section' ] + allowedElements: [ 'aside', 'section' ] }, - math: { - type: 'structure', + 'doc-footnote': { + type: 'section', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'math' ], - unsupported: false + unsupported: false, + allowedElements: [ 'aside', 'footer', 'header' ] }, - menu: { - type: 'composite', + 'doc-foreword': { + type: 'landmark', attributes: { - allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ] - }, - owned: { - one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, - nameFrom: [ 'author' ], + owned: null, + namefrom: [ 'author' ], context: null, - implicit: [ 'menu[type="context"]' ], unsupported: false, - allowedElements: [ 'ol', 'ul' ] + allowedElements: [ 'section' ] }, - menubar: { - type: 'composite', + 'doc-glossary': { + type: 'landmark', attributes: { - allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ] - }, - owned: { - one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, - nameFrom: [ 'author' ], + owned: [ 'term', 'definition' ], + namefrom: [ 'author' ], context: null, unsupported: false, - allowedElements: [ 'ol', 'ul' ] + allowedElements: [ 'dl' ] }, - menuitem: { - type: 'widget', + 'doc-glossref': { + type: 'link', attributes: { - allowed: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], - context: [ 'menu', 'menubar' ], - implicit: [ 'menuitem[type="command"]' ], + namefrom: [ 'author', 'contents' ], + context: null, unsupported: false, - allowedElements: [ 'button', 'li', { - nodeName: 'iput', - properties: { - type: [ 'image', 'button' ] - } - }, { + allowedElements: [ { nodeName: 'a', attributes: { href: isNotNull } } ] }, - menuitemcheckbox: { - type: 'widget', + 'doc-index': { + type: 'navigation', attributes: { - allowed: [ 'aria-checked', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], - context: [ 'menu', 'menubar' ], - implicit: [ 'menuitem[type="checkbox"]' ], + namefrom: [ 'author' ], + context: null, unsupported: false, - allowedElements: [ { - nodeName: [ 'button', 'li' ] - }, { - nodeName: 'input', - properties: { - type: [ 'checkbox', 'image', 'button' ] - } - }, { - nodeName: 'a', - attributes: { - href: isNotNull - } - } ] + allowedElements: [ 'nav', 'section' ] }, - menuitemradio: { - type: 'widget', + 'doc-introduction': { + type: 'landmark', attributes: { - allowed: [ 'aria-checked', 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], - context: [ 'menu', 'menubar' ], - implicit: [ 'menuitem[type="radio"]' ], + namefrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: [ 'section' ] + }, + 'doc-noteref': { + type: 'link', + attributes: { + allowed: [ 'aria-expanded' ] + }, + owned: null, + namefrom: [ 'author', 'contents' ], + context: null, unsupported: false, allowedElements: [ { - nodeName: [ 'button', 'li' ] - }, { - nodeName: 'input', - properties: { - type: [ 'image', 'button', 'radio' ] - } - }, { nodeName: 'a', attributes: { href: isNotNull } } ] }, - navigation: { - type: 'landmark', + 'doc-notice': { + type: 'note', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded' ] }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'nav' ], unsupported: false, allowedElements: [ 'section' ] }, - none: { - type: 'structure', - attributes: null, + 'doc-pagebreak': { + type: 'separator', + attributes: { + allowed: [ 'aria-expanded' ] + }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, unsupported: false, - allowedElements: [ { - nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ] - }, { - nodeName: 'img', - attributes: { - alt: isNotNull - } - } ] + allowedElements: [ 'hr' ] }, - note: { - type: 'structure', + 'doc-pagelist': { + type: 'navigation', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded' ] }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, unsupported: false, - allowedElements: [ 'aside' ] + allowedElements: [ 'nav', 'section' ] }, - option: { - type: 'widget', + 'doc-part': { + type: 'landmark', attributes: { - allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-checked', 'aria-errormessage' ] + allowed: [ 'aria-expanded' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], - context: [ 'listbox' ], - implicit: [ 'option' ], + namefrom: [ 'author' ], + context: null, unsupported: false, - allowedElements: [ { - nodeName: [ 'button', 'li' ] - }, { - nodeName: 'input', - properties: { - type: [ 'checkbox', 'button' ] - } - }, { - nodeName: 'a', - attributes: { - href: isNotNull - } - } ] + allowedElements: [ 'section' ] }, - presentation: { - type: 'structure', - attributes: null, + 'doc-preface': { + type: 'landmark', + attributes: { + allowed: [ 'aria-expanded' ] + }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, unsupported: false, - allowedElements: [ { - nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ] - }, { - nodeName: 'img', - attributes: { - alt: isNotNull - } - } ] + allowedElements: [ 'section' ] }, - progressbar: { - type: 'widget', + 'doc-prologue': { + type: 'landmark', attributes: { - allowed: [ 'aria-valuetext', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'progress' ], - unsupported: false + unsupported: false, + allowedElements: [ 'section' ] }, - radio: { - type: 'widget', + 'doc-pullquote': { + type: 'none', attributes: { - allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-required', 'aria-errormessage', 'aria-checked' ] + allowed: [ 'aria-expanded' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'input[type="radio"]' ], unsupported: false, - allowedElements: [ { - nodeName: [ 'button', 'li' ] - }, { - nodeName: 'input', - properties: { - type: [ 'image', 'button' ] - } - } ] + allowedElements: [ 'aside', 'section' ] + }, + 'doc-qna': { + type: 'section', + attributes: { + allowed: [ 'aria-expanded' ] + }, + owned: null, + namefrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: [ 'section' ] }, - radiogroup: { - type: 'composite', + 'doc-subtitle': { + type: 'sectionhead', attributes: { - allowed: [ 'aria-activedescendant', 'aria-required', 'aria-expanded', 'aria-readonly', 'aria-errormessage', 'aria-orientation' ] - }, - owned: { - all: [ 'radio' ] + allowed: [ 'aria-expanded' ] }, - nameFrom: [ 'author' ], + owned: null, + namefrom: [ 'author' ], context: null, unsupported: false, allowedElements: { - nodeName: [ 'ol', 'ul', 'fieldset' ] + nodeName: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ] } }, - range: { - nameFrom: [ 'author' ], - type: 'abstract', - unsupported: false - }, - region: { - type: 'landmark', + 'doc-tip': { + type: 'note', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded' ] }, owned: null, - nameFrom: [ 'author' ], + namefrom: [ 'author' ], context: null, - implicit: [ 'section[aria-label]', 'section[aria-labelledby]', 'section[title]' ], unsupported: false, - allowedElements: { - nodeName: [ 'article', 'aside' ] - } - }, - roletype: { - type: 'abstract', - unsupported: false + allowedElements: [ 'aside' ] }, - row: { - type: 'structure', + 'doc-toc': { + type: 'navigation', attributes: { - allowed: [ 'aria-activedescendant', 'aria-colindex', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowindex', 'aria-errormessage' ] - }, - owned: { - one: [ 'cell', 'columnheader', 'rowheader', 'gridcell' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, - nameFrom: [ 'author', 'contents' ], - context: [ 'rowgroup', 'grid', 'treegrid', 'table' ], - implicit: [ 'tr' ], - unsupported: false + owned: null, + namefrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: [ 'nav', 'section' ] }, - rowgroup: { + feed: { type: 'structure', attributes: { - allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: { - all: [ 'row' ] + one: [ 'article' ] }, - nameFrom: [ 'author', 'contents' ], - context: [ 'grid', 'table', 'treegrid' ], - implicit: [ 'tbody', 'thead', 'tfoot' ], - unsupported: false + nameFrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: [ 'article', 'aside', 'section' ] }, - rowheader: { + figure: { type: 'structure', attributes: { - allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, nameFrom: [ 'author', 'contents' ], - context: [ 'row' ], - implicit: [ 'th' ], + context: null, + implicit: [ 'figure' ], unsupported: false }, - scrollbar: { - type: 'widget', + form: { + type: 'landmark', attributes: { - required: [ 'aria-controls', 'aria-valuenow' ], - allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, nameFrom: [ 'author' ], context: null, + implicit: [ 'form' ], unsupported: false }, - search: { - type: 'landmark', + grid: { + type: 'composite', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-colcount', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-rowcount', 'aria-errormessage' ] + }, + owned: { + one: [ 'rowgroup', 'row' ] }, - owned: null, nameFrom: [ 'author' ], context: null, - unsupported: false, - allowedElements: { - nodeName: [ 'aside', 'form', 'section' ] - } + implicit: [ 'table' ], + unsupported: false }, - searchbox: { + gridcell: { type: 'widget', attributes: { - allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ] + allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-readonly', 'aria-required', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author' ], - context: null, - implicit: [ 'input[type="search"]' ], - unsupported: false, - allowedElements: { - nodeName: 'input', - properties: { - type: 'text' - } - } - }, - section: { nameFrom: [ 'author', 'contents' ], - type: 'abstract', - unsupported: false - }, - sectionhead: { - nameFrom: [ 'author', 'contents' ], - type: 'abstract', - unsupported: false - }, - select: { - nameFrom: [ 'author' ], - type: 'abstract', + context: [ 'row' ], + implicit: [ 'td', 'th' ], unsupported: false }, - separator: { + group: { type: 'structure', attributes: { - allowed: [ 'aria-expanded', 'aria-orientation', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext', 'aria-errormessage' ] + allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ] }, owned: null, nameFrom: [ 'author' ], context: null, - implicit: [ 'hr' ], + implicit: [ 'details', 'optgroup' ], unsupported: false, - allowedElements: [ 'li' ] + allowedElements: [ 'dl', 'figcaption', 'fieldset', 'figure', 'footer', 'header', 'ol', 'ul' ] }, - slider: { - type: 'widget', + heading: { + type: 'structure', attributes: { - allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ], - required: [ 'aria-valuenow' ] + required: [ 'aria-level' ], + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author' ], + nameFrom: [ 'author', 'contents' ], context: null, - implicit: [ 'input[type="range"]' ], + implicit: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ], unsupported: false }, - spinbutton: { - type: 'widget', + img: { + type: 'structure', attributes: { - allowed: [ 'aria-valuetext', 'aria-required', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ], - required: [ 'aria-valuenow' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, nameFrom: [ 'author' ], context: null, - implicit: [ 'input[type="number"]' ], + implicit: [ 'img' ], unsupported: false, - allowedElements: { - nodeName: 'input', - properties: { - type: [ 'text', 'tel' ] - } - } + allowedElements: [ 'embed', 'iframe', 'object', 'svg' ] }, - status: { - type: 'widget', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, + input: { nameFrom: [ 'author' ], - context: null, - implicit: [ 'output' ], - unsupported: false, - allowedElements: [ 'section' ] + type: 'abstract', + unsupported: false }, - structure: { + landmark: { + nameFrom: [ 'author' ], type: 'abstract', unsupported: false }, - switch: { + link: { type: 'widget', attributes: { - allowed: [ 'aria-errormessage' ], - required: [ 'aria-checked' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, nameFrom: [ 'author', 'contents' ], context: null, + implicit: [ 'a[href]', 'area[href]' ], unsupported: false, allowedElements: [ 'button', { nodeName: 'input', properties: { - type: [ 'checkbox', 'image', 'button' ] - } - }, { - nodeName: 'a', - attributes: { - href: isNotNull - } - } ] - }, - tab: { - type: 'widget', - attributes: { - allowed: [ 'aria-selected', 'aria-expanded', 'aria-setsize', 'aria-posinset', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author', 'contents' ], - context: [ 'tablist' ], - unsupported: false, - allowedElements: [ { - nodeName: [ 'button', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li' ] - }, { - nodeName: 'input', - properties: { - type: 'button' - } - }, { - nodeName: 'a', - attributes: { - href: isNotNull + type: [ 'image', 'button' ] } } ] }, - table: { + list: { type: 'structure', attributes: { - allowed: [ 'aria-colcount', 'aria-rowcount', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: { - one: [ 'rowgroup', 'row' ] + all: [ 'listitem' ] }, - nameFrom: [ 'author', 'contents' ], + nameFrom: [ 'author' ], context: null, - implicit: [ 'table' ], + implicit: [ 'ol', 'ul', 'dl' ], unsupported: false }, - tablist: { + listbox: { type: 'composite', attributes: { - allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-errormessage' ] + allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ] }, owned: { - all: [ 'tab' ] + all: [ 'option' ] }, nameFrom: [ 'author' ], context: null, + implicit: [ 'select' ], unsupported: false, allowedElements: [ 'ol', 'ul' ] }, - tabpanel: { - type: 'widget', - attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] - }, - owned: null, - nameFrom: [ 'author' ], - context: null, - unsupported: false, - allowedElements: [ 'section' ] - }, - term: { + listitem: { type: 'structure', attributes: { - allowed: [ 'aria-expanded', 'aria-errormessage' ] + allowed: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ] }, owned: null, nameFrom: [ 'author', 'contents' ], - context: null, - implicit: [ 'dt' ], + context: [ 'list' ], + implicit: [ 'li', 'dt' ], unsupported: false }, - textbox: { + log: { type: 'widget', attributes: { - allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, nameFrom: [ 'author' ], context: null, - implicit: [ 'input[type="text"]', 'input[type="email"]', 'input[type="password"]', 'input[type="tel"]', 'input[type="url"]', 'input:not([type])', 'textarea' ], - unsupported: false + unsupported: false, + allowedElements: [ 'section' ] }, - timer: { - type: 'widget', + main: { + type: 'landmark', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, nameFrom: [ 'author' ], context: null, - unsupported: false + implicit: [ 'main' ], + unsupported: false, + allowedElements: [ 'article', 'section' ] }, - toolbar: { - type: 'structure', + marquee: { + type: 'widget', attributes: { - allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ] + allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, nameFrom: [ 'author' ], context: null, - implicit: [ 'menu[type="toolbar"]' ], unsupported: false, - allowedElements: [ 'ol', 'ul' ] + allowedElements: [ 'section' ] }, - tooltip: { + math: { type: 'structure', attributes: { allowed: [ 'aria-expanded', 'aria-errormessage' ] }, owned: null, - nameFrom: [ 'author', 'contents' ], + nameFrom: [ 'author' ], context: null, + implicit: [ 'math' ], unsupported: false }, - tree: { + menu: { type: 'composite', attributes: { - allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ] + allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ] }, owned: { - all: [ 'treeitem' ] + one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ] }, nameFrom: [ 'author' ], context: null, + implicit: [ 'menu[type="context"]' ], unsupported: false, allowedElements: [ 'ol', 'ul' ] }, - treegrid: { + menubar: { type: 'composite', attributes: { - allowed: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-rowcount', 'aria-orientation', 'aria-errormessage' ] + allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ] }, owned: { - one: [ 'rowgroup', 'row' ] + one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ] }, nameFrom: [ 'author' ], context: null, - unsupported: false + unsupported: false, + allowedElements: [ 'ol', 'ul' ] }, - treeitem: { + menuitem: { type: 'widget', attributes: { - allowed: [ 'aria-checked', 'aria-selected', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] + allowed: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ] }, owned: null, nameFrom: [ 'author', 'contents' ], - context: [ 'group', 'tree' ], + context: [ 'menu', 'menubar' ], + implicit: [ 'menuitem[type="command"]' ], unsupported: false, - allowedElements: [ 'li', { + allowedElements: [ 'button', 'li', { + nodeName: 'iput', + properties: { + type: [ 'image', 'button' ] + } + }, { nodeName: 'a', attributes: { href: isNotNull } } ] }, - widget: { - type: 'abstract', - unsupported: false - }, - window: { - nameFrom: [ 'author' ], - type: 'abstract', - unsupported: false - } - }; - lookupTable.implicitHtmlRole = implicit_html_roles_default; - lookupTable.elementsAllowedNoRole = [ { - nodeName: [ 'base', 'body', 'caption', 'col', 'colgroup', 'datalist', 'dd', 'details', 'dt', 'head', 'html', 'keygen', 'label', 'legend', 'main', 'map', 'math', 'meta', 'meter', 'noscript', 'optgroup', 'param', 'picture', 'progress', 'script', 'source', 'style', 'template', 'textarea', 'title', 'track' ] - }, { - nodeName: 'area', - attributes: { - href: isNotNull - } - }, { - nodeName: 'input', - properties: { - type: [ 'color', 'data', 'datatime', 'file', 'hidden', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ] - } - }, { - nodeName: 'link', - attributes: { - href: isNotNull - } - }, { - nodeName: 'menu', - attributes: { - type: 'context' - } - }, { - nodeName: 'menuitem', - attributes: { - type: [ 'command', 'checkbox', 'radio' ] - } - }, { - nodeName: 'select', - condition: function condition(vNode) { - if (!(vNode instanceof axe.AbstractVirtualNode)) { - vNode = axe.utils.getNodeFromTree(vNode); - } - return Number(vNode.attr('size')) > 1; - }, - properties: { - multiple: true - } - }, { - nodeName: [ 'clippath', 'cursor', 'defs', 'desc', 'feblend', 'fecolormatrix', 'fecomponenttransfer', 'fecomposite', 'feconvolvematrix', 'fediffuselighting', 'fedisplacementmap', 'fedistantlight', 'fedropshadow', 'feflood', 'fefunca', 'fefuncb', 'fefuncg', 'fefuncr', 'fegaussianblur', 'feimage', 'femerge', 'femergenode', 'femorphology', 'feoffset', 'fepointlight', 'fespecularlighting', 'fespotlight', 'fetile', 'feturbulence', 'filter', 'hatch', 'hatchpath', 'lineargradient', 'marker', 'mask', 'meshgradient', 'meshpatch', 'meshrow', 'metadata', 'mpath', 'pattern', 'radialgradient', 'solidcolor', 'stop', 'switch', 'view' ] - } ]; - lookupTable.elementsAllowedAnyRole = [ { - nodeName: 'a', - attributes: { - href: isNull - } - }, { - nodeName: 'img', - attributes: { - alt: isNull - } - }, { - nodeName: [ 'abbr', 'address', 'canvas', 'div', 'p', 'pre', 'blockquote', 'ins', 'del', 'output', 'span', 'table', 'tbody', 'thead', 'tfoot', 'td', 'em', 'strong', 'small', 's', 'cite', 'q', 'dfn', 'abbr', 'time', 'code', 'var', 'samp', 'kbd', 'sub', 'sup', 'i', 'b', 'u', 'mark', 'ruby', 'rt', 'rp', 'bdi', 'bdo', 'br', 'wbr', 'th', 'tr' ] - } ]; - lookupTable.evaluateRoleForElement = { - A: function A(_ref84) { - var node = _ref84.node, out = _ref84.out; - if (node.namespaceURI === 'http://www.w3.org/2000/svg') { - return true; - } - if (node.href.length) { - return out; - } - return true; - }, - AREA: function AREA(_ref85) { - var node = _ref85.node; - return !node.href; + menuitemcheckbox: { + type: 'widget', + attributes: { + allowed: [ 'aria-checked', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author', 'contents' ], + context: [ 'menu', 'menubar' ], + implicit: [ 'menuitem[type="checkbox"]' ], + unsupported: false, + allowedElements: [ { + nodeName: [ 'button', 'li' ] + }, { + nodeName: 'input', + properties: { + type: [ 'checkbox', 'image', 'button' ] + } + }, { + nodeName: 'a', + attributes: { + href: isNotNull + } + } ] }, - BUTTON: function BUTTON(_ref86) { - var node = _ref86.node, role = _ref86.role, out = _ref86.out; - if (node.getAttribute('type') === 'menu') { - return role === 'menuitem'; - } - return out; + menuitemradio: { + type: 'widget', + attributes: { + allowed: [ 'aria-checked', 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author', 'contents' ], + context: [ 'menu', 'menubar' ], + implicit: [ 'menuitem[type="radio"]' ], + unsupported: false, + allowedElements: [ { + nodeName: [ 'button', 'li' ] + }, { + nodeName: 'input', + properties: { + type: [ 'image', 'button', 'radio' ] + } + }, { + nodeName: 'a', + attributes: { + href: isNotNull + } + } ] }, - IMG: function IMG(_ref87) { - var node = _ref87.node, role = _ref87.role, out = _ref87.out; - switch (node.alt) { - case null: - return out; - - case '': - return role === 'presentation' || role === 'none'; - - default: - return role !== 'presentation' && role !== 'none'; - } + navigation: { + type: 'landmark', + attributes: { + allowed: [ 'aria-expanded', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + implicit: [ 'nav' ], + unsupported: false, + allowedElements: [ 'section' ] }, - INPUT: function INPUT(_ref88) { - var node = _ref88.node, role = _ref88.role, out = _ref88.out; - switch (node.type) { - case 'button': - case 'image': - return out; - - case 'checkbox': - if (role === 'button' && node.hasAttribute('aria-pressed')) { - return true; + none: { + type: 'structure', + attributes: null, + owned: null, + nameFrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: [ { + nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ] + }, { + nodeName: 'img', + attributes: { + alt: isNotNull } - return out; - - case 'radio': - return role === 'menuitemradio'; - - case 'text': - return role === 'combobox' || role === 'searchbox' || role === 'spinbutton'; - - case 'tel': - return role === 'combobox' || role === 'spinbutton'; - - case 'url': - case 'search': - case 'email': - return role === 'combobox'; - - default: - return false; - } + } ] }, - LI: function LI(_ref89) { - var node = _ref89.node, out = _ref89.out; - var hasImplicitListitemRole = axe.utils.matchesSelector(node, 'ol li, ul li'); - if (hasImplicitListitemRole) { - return out; - } - return true; + note: { + type: 'structure', + attributes: { + allowed: [ 'aria-expanded', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: [ 'aside' ] }, - MENU: function MENU(_ref90) { - var node = _ref90.node; - if (node.getAttribute('type') === 'context') { - return false; - } - return true; + option: { + type: 'widget', + attributes: { + allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-checked', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author', 'contents' ], + context: [ 'listbox' ], + implicit: [ 'option' ], + unsupported: false, + allowedElements: [ { + nodeName: [ 'button', 'li' ] + }, { + nodeName: 'input', + properties: { + type: [ 'checkbox', 'button' ] + } + }, { + nodeName: 'a', + attributes: { + href: isNotNull + } + } ] }, - OPTION: function OPTION(_ref91) { - var node = _ref91.node; - var withinOptionList = axe.utils.matchesSelector(node, 'select > option, datalist > option, optgroup > option'); - return !withinOptionList; + presentation: { + type: 'structure', + attributes: null, + owned: null, + nameFrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: [ { + nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ] + }, { + nodeName: 'img', + attributes: { + alt: isNotNull + } + } ] }, - SELECT: function SELECT(_ref92) { - var node = _ref92.node, role = _ref92.role; - return !node.multiple && node.size <= 1 && role === 'menu'; + progressbar: { + type: 'widget', + attributes: { + allowed: [ 'aria-valuetext', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-expanded', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + implicit: [ 'progress' ], + unsupported: false }, - SVG: function SVG(_ref93) { - var node = _ref93.node, out = _ref93.out; - if (node.parentNode && node.parentNode.namespaceURI === 'http://www.w3.org/2000/svg') { - return true; - } - return out; - } - }; - lookupTable.rolesOfType = { - widget: [ 'button', 'checkbox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'scrollbar', 'searchbox', 'slider', 'spinbutton', 'status', 'switch', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'tree', 'treeitem' ] - }; - var lookup_table_default = lookupTable; - function implicitNodes(role) { - var implicit = null; - var roles = lookup_table_default.role[role]; - if (roles && roles.implicit) { - implicit = _clone(roles.implicit); - } - return implicit; - } - var implicit_nodes_default = implicitNodes; - function isAccessibleRef(node) { - return !!get_accessible_refs_default(node).length; - } - var is_accessible_ref_default = isAccessibleRef; - function _isComboboxPopup(virtualNode) { - var _popupRoles; - var _ref94 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, popupRoles = _ref94.popupRoles; - var role = get_role_default(virtualNode); - (_popupRoles = popupRoles) !== null && _popupRoles !== void 0 ? _popupRoles : popupRoles = aria_attrs_default['aria-haspopup'].values; - if (!popupRoles.includes(role)) { - return false; - } - var vParent = nearestParentWithRole(virtualNode); - if (isCombobox(vParent)) { - return true; - } - var id = virtualNode.props.id; - if (!id) { - return false; - } - if (!virtualNode.actualNode) { - throw new Error('Unable to determine combobox popup without an actualNode'); - } - var root = get_root_node_default(virtualNode.actualNode); - var ownedCombobox = root.querySelectorAll('[aria-owns~="'.concat(id, '"][role~="combobox"]:not(select),\n [aria-controls~="').concat(id, '"][role~="combobox"]:not(select)')); - return Array.from(ownedCombobox).some(isCombobox); - } - var isCombobox = function isCombobox(node) { - return node && get_role_default(node) === 'combobox'; - }; - function nearestParentWithRole(vNode) { - while (vNode = vNode.parent) { - if (get_role_default(vNode, { - noPresentational: true - }) !== null) { - return vNode; - } - } - return null; - } - function label2(node) { - node = get_node_from_tree_default(node); - return label_virtual_default(node); - } - var label_default2 = label2; - function requiredAttr(role) { - var roleDef = standards_default.ariaRoles[role]; - if (!roleDef || !Array.isArray(roleDef.requiredAttrs)) { - return []; - } - return _toConsumableArray(roleDef.requiredAttrs); - } - var required_attr_default = requiredAttr; - function requiredContext(role) { - var roleDef = standards_default.ariaRoles[role]; - if (!roleDef || !Array.isArray(roleDef.requiredContext)) { - return null; - } - return _toConsumableArray(roleDef.requiredContext); - } - var required_context_default = requiredContext; - function requiredOwned(role) { - var roleDef = standards_default.ariaRoles[role]; - if (!roleDef || !Array.isArray(roleDef.requiredOwned)) { - return null; - } - return _toConsumableArray(roleDef.requiredOwned); - } - var required_owned_default = requiredOwned; - function validateAttrValue(vNode, attr) { - vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode); - var matches4; - var list; - var value = vNode.attr(attr); - var attrInfo = standards_default.ariaAttrs[attr]; - if (!attrInfo) { - return true; - } - if (attrInfo.allowEmpty && (!value || value.trim() === '')) { - return true; - } - switch (attrInfo.type) { - case 'boolean': - return [ 'true', 'false' ].includes(value.toLowerCase()); - - case 'nmtoken': - return typeof value === 'string' && attrInfo.values.includes(value.toLowerCase()); - - case 'nmtokens': - list = token_list_default(value); - return list.reduce(function(result, token) { - return result && attrInfo.values.includes(token); - }, list.length !== 0); - - case 'idref': - try { - var doc = get_root_node_default2(vNode.actualNode); - return !!(value && doc.getElementById(value)); - } catch (e) { - throw new TypeError('Cannot resolve id references for partial DOM'); - } - - case 'idrefs': - return idrefs_default(vNode, attr).some(function(node) { - return !!node; - }); - - case 'string': - return value.trim() !== ''; - - case 'decimal': - matches4 = value.match(/^[-+]?([0-9]*)\.?([0-9]*)$/); - return !!(matches4 && (matches4[1] || matches4[2])); - - case 'int': - var minValue = typeof attrInfo.minValue !== 'undefined' ? attrInfo.minValue : -Infinity; - return /^[-+]?[0-9]+$/.test(value) && parseInt(value) >= minValue; - } - } - var validate_attr_value_default = validateAttrValue; - function validateAttr(att) { - var attrDefinition = standards_default.ariaAttrs[att]; - return !!attrDefinition; - } - var validate_attr_default = validateAttr; - function abstractroleEvaluate(node, options, virtualNode) { - var abstractRoles = token_list_default(virtualNode.attr('role')).filter(function(role) { - return get_role_type_default(role) === 'abstract'; - }); - if (abstractRoles.length > 0) { - this.data(abstractRoles); - return true; - } - return false; - } - var abstractrole_evaluate_default = abstractroleEvaluate; - function ariaAllowedAttrEvaluate(node, options, virtualNode) { - var invalid = []; - var role = get_role_default(virtualNode); - var allowed = allowed_attr_default(role); - if (Array.isArray(options[role])) { - allowed = unique_array_default(options[role].concat(allowed)); - } - var _iterator15 = _createForOfIteratorHelper(virtualNode.attrNames), _step15; - try { - for (_iterator15.s(); !(_step15 = _iterator15.n()).done; ) { - var attrName = _step15.value; - if (validate_attr_default(attrName) && !allowed.includes(attrName)) { - invalid.push(attrName); + radio: { + type: 'widget', + attributes: { + allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-required', 'aria-errormessage', 'aria-checked' ] + }, + owned: null, + nameFrom: [ 'author', 'contents' ], + context: null, + implicit: [ 'input[type="radio"]' ], + unsupported: false, + allowedElements: [ { + nodeName: [ 'button', 'li' ] + }, { + nodeName: 'input', + properties: { + type: [ 'image', 'button' ] } + } ] + }, + radiogroup: { + type: 'composite', + attributes: { + allowed: [ 'aria-activedescendant', 'aria-required', 'aria-expanded', 'aria-readonly', 'aria-errormessage', 'aria-orientation' ] + }, + owned: { + all: [ 'radio' ] + }, + nameFrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: { + nodeName: [ 'ol', 'ul', 'fieldset' ] } - } catch (err) { - _iterator15.e(err); - } finally { - _iterator15.f(); - } - if (!invalid.length) { - return true; - } - this.data(invalid.map(function(attrName) { - return attrName + '="' + virtualNode.attr(attrName) + '"'; - })); - if (!role && !is_html_element_default(virtualNode) && !_isFocusable(virtualNode)) { - return void 0; - } - return false; - } - function ariaAllowedRoleEvaluate(node) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var virtualNode = arguments.length > 2 ? arguments[2] : undefined; - var _options$allowImplici = options.allowImplicit, allowImplicit = _options$allowImplici === void 0 ? true : _options$allowImplici, _options$ignoredTags = options.ignoredTags, ignoredTags = _options$ignoredTags === void 0 ? [] : _options$ignoredTags; - var nodeName2 = virtualNode.props.nodeName; - if (ignoredTags.map(function(tag) { - return tag.toLowerCase(); - }).includes(nodeName2)) { - return true; - } - var unallowedRoles = get_element_unallowed_roles_default(virtualNode, allowImplicit); - if (unallowedRoles.length) { - this.data(unallowedRoles); - if (!_isVisibleToScreenReaders(virtualNode)) { - return void 0; + }, + range: { + nameFrom: [ 'author' ], + type: 'abstract', + unsupported: false + }, + region: { + type: 'landmark', + attributes: { + allowed: [ 'aria-expanded', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + implicit: [ 'section[aria-label]', 'section[aria-labelledby]', 'section[title]' ], + unsupported: false, + allowedElements: { + nodeName: [ 'article', 'aside' ] } - return false; - } - return true; - } - var aria_allowed_role_evaluate_default = ariaAllowedRoleEvaluate; - function ariaBusyEvaluate(node, options, virtualNode) { - return virtualNode.attr('aria-busy') === 'true'; - } - function ariaConditionalCheckboxAttr(node, options, virtualNode) { - var _virtualNode$props = virtualNode.props, nodeName2 = _virtualNode$props.nodeName, type2 = _virtualNode$props.type; - var ariaChecked = normalizeAriaChecked(virtualNode.attr('aria-checked')); - if (nodeName2 !== 'input' || type2 !== 'checkbox' || !ariaChecked) { - return true; - } - var checkState = getCheckState(virtualNode); - if (ariaChecked === checkState) { - return true; - } - this.data({ - messageKey: 'checkbox', - checkState: checkState - }); - return false; - } - function getCheckState(vNode) { - if (vNode.props.indeterminate) { - return 'mixed'; - } - return vNode.props.checked ? 'true' : 'false'; - } - function normalizeAriaChecked(ariaCheckedVal) { - if (!ariaCheckedVal) { - return ''; - } - ariaCheckedVal = ariaCheckedVal.toLowerCase(); - if ([ 'mixed', 'true' ].includes(ariaCheckedVal)) { - return ariaCheckedVal; - } - return 'false'; - } - function ariaConditionalRowAttr(node) { - var _invalidTableRowAttrs, _invalidTableRowAttrs2; - var _ref95 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, invalidTableRowAttrs = _ref95.invalidTableRowAttrs; - var virtualNode = arguments.length > 2 ? arguments[2] : undefined; - var invalidAttrs = (_invalidTableRowAttrs = invalidTableRowAttrs === null || invalidTableRowAttrs === void 0 ? void 0 : (_invalidTableRowAttrs2 = invalidTableRowAttrs.filter) === null || _invalidTableRowAttrs2 === void 0 ? void 0 : _invalidTableRowAttrs2.call(invalidTableRowAttrs, function(invalidAttr) { - return virtualNode.hasAttr(invalidAttr); - })) !== null && _invalidTableRowAttrs !== void 0 ? _invalidTableRowAttrs : []; - if (invalidAttrs.length === 0) { - return true; - } - var owner = getRowOwner(virtualNode); - var ownerRole = owner && get_role_default(owner); - if (!ownerRole || ownerRole === 'treegrid') { - return true; - } - var messageKey = 'row'.concat(invalidAttrs.length > 1 ? 'Plural' : 'Singular'); - this.data({ - messageKey: messageKey, - invalidAttrs: invalidAttrs, - ownerRole: ownerRole - }); - return false; - } - function getRowOwner(virtualNode) { - if (!virtualNode.parent) { - return; - } - var rowOwnerQuery = 'table:not([role]), [role~="treegrid"], [role~="table"], [role~="grid"]'; - return closest_default(virtualNode, rowOwnerQuery); - } - var conditionalRoleMap = { - row: ariaConditionalRowAttr, - checkbox: ariaConditionalCheckboxAttr - }; - function ariaConditionalAttrEvaluate(node, options, virtualNode) { - var role = get_role_default(virtualNode); - if (!conditionalRoleMap[role]) { - return true; - } - return conditionalRoleMap[role].call(this, node, options, virtualNode); - } - function ariaErrormessageEvaluate(node, options, virtualNode) { - options = Array.isArray(options) ? options : []; - var errorMessageAttr = virtualNode.attr('aria-errormessage'); - var hasAttr = virtualNode.hasAttr('aria-errormessage'); - var invaid = virtualNode.attr('aria-invalid'); - var hasInvallid = virtualNode.hasAttr('aria-invalid'); - if (!hasInvallid || invaid === 'false') { - return true; - } - function validateAttrValue2(attr) { - if (attr.trim() === '') { - return standards_default.ariaAttrs['aria-errormessage'].allowEmpty; + }, + roletype: { + type: 'abstract', + unsupported: false + }, + row: { + type: 'structure', + attributes: { + allowed: [ 'aria-activedescendant', 'aria-colindex', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowindex', 'aria-errormessage' ] + }, + owned: { + one: [ 'cell', 'columnheader', 'rowheader', 'gridcell' ] + }, + nameFrom: [ 'author', 'contents' ], + context: [ 'rowgroup', 'grid', 'treegrid', 'table' ], + implicit: [ 'tr' ], + unsupported: false + }, + rowgroup: { + type: 'structure', + attributes: { + allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ] + }, + owned: { + all: [ 'row' ] + }, + nameFrom: [ 'author', 'contents' ], + context: [ 'grid', 'table', 'treegrid' ], + implicit: [ 'tbody', 'thead', 'tfoot' ], + unsupported: false + }, + rowheader: { + type: 'structure', + attributes: { + allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author', 'contents' ], + context: [ 'row' ], + implicit: [ 'th' ], + unsupported: false + }, + scrollbar: { + type: 'widget', + attributes: { + required: [ 'aria-controls', 'aria-valuenow' ], + allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + unsupported: false + }, + search: { + type: 'landmark', + attributes: { + allowed: [ 'aria-expanded', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: { + nodeName: [ 'aside', 'form', 'section' ] } - var idref; - try { - idref = attr && idrefs_default(virtualNode, 'aria-errormessage')[0]; - } catch (e) { - this.data({ - messageKey: 'idrefs', - values: token_list_default(attr) - }); - return void 0; + }, + searchbox: { + type: 'widget', + attributes: { + allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + implicit: [ 'input[type="search"]' ], + unsupported: false, + allowedElements: { + nodeName: 'input', + properties: { + type: 'text' + } } - if (idref) { - if (!_isVisibleToScreenReaders(idref)) { - this.data({ - messageKey: 'hidden', - values: token_list_default(attr) - }); - return false; + }, + section: { + nameFrom: [ 'author', 'contents' ], + type: 'abstract', + unsupported: false + }, + sectionhead: { + nameFrom: [ 'author', 'contents' ], + type: 'abstract', + unsupported: false + }, + select: { + nameFrom: [ 'author' ], + type: 'abstract', + unsupported: false + }, + separator: { + type: 'structure', + attributes: { + allowed: [ 'aria-expanded', 'aria-orientation', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + implicit: [ 'hr' ], + unsupported: false, + allowedElements: [ 'li' ] + }, + slider: { + type: 'widget', + attributes: { + allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ], + required: [ 'aria-valuenow' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + implicit: [ 'input[type="range"]' ], + unsupported: false + }, + spinbutton: { + type: 'widget', + attributes: { + allowed: [ 'aria-valuetext', 'aria-required', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ], + required: [ 'aria-valuenow' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + implicit: [ 'input[type="number"]' ], + unsupported: false, + allowedElements: { + nodeName: 'input', + properties: { + type: [ 'text', 'tel' ] } - return idref.getAttribute('role') === 'alert' || idref.getAttribute('aria-live') === 'assertive' || idref.getAttribute('aria-live') === 'polite' || token_list_default(virtualNode.attr('aria-describedby')).indexOf(attr) > -1; - } - return; - } - if (options.indexOf(errorMessageAttr) === -1 && hasAttr) { - this.data(token_list_default(errorMessageAttr)); - return validateAttrValue2.call(this, errorMessageAttr); - } - return true; - } - function ariaHiddenBodyEvaluate(node, options, virtualNode) { - return virtualNode.attr('aria-hidden') !== 'true'; - } - var aria_hidden_body_evaluate_default = ariaHiddenBodyEvaluate; - function ariaLevelEvaluate(node, options, virtualNode) { - var ariaHeadingLevel = virtualNode.attr('aria-level'); - var ariaLevel = parseInt(ariaHeadingLevel, 10); - if (ariaLevel > 6) { - return void 0; - } - return true; - } - var aria_level_evaluate_default = ariaLevelEvaluate; - function ariaProhibitedAttrEvaluate(node) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var virtualNode = arguments.length > 2 ? arguments[2] : undefined; - var elementsAllowedAriaLabel = (options === null || options === void 0 ? void 0 : options.elementsAllowedAriaLabel) || []; - var nodeName2 = virtualNode.props.nodeName; - var role = get_role_default(virtualNode, { - chromium: true - }); - var prohibitedList = listProhibitedAttrs(role, nodeName2, elementsAllowedAriaLabel); - var prohibited = prohibitedList.filter(function(attrName) { - if (!virtualNode.attrNames.includes(attrName)) { - return false; } - return sanitize_default(virtualNode.attr(attrName)) !== ''; - }); - if (prohibited.length === 0) { - return false; - } - var messageKey = virtualNode.hasAttr('role') ? 'hasRole' : 'noRole'; - messageKey += prohibited.length > 1 ? 'Plural' : 'Singular'; - this.data({ - role: role, - nodeName: nodeName2, - messageKey: messageKey, - prohibited: prohibited - }); - var textContent = subtree_text_default(virtualNode, { - subtreeDescendant: true - }); - if (sanitize_default(textContent) !== '') { - return void 0; - } - return true; - } - function listProhibitedAttrs(role, nodeName2, elementsAllowedAriaLabel) { - var roleSpec = standards_default.ariaRoles[role]; - if (roleSpec) { - return roleSpec.prohibitedAttrs || []; - } - if (!!role || elementsAllowedAriaLabel.includes(nodeName2)) { - return []; - } - return [ 'aria-label', 'aria-labelledby' ]; - } - var standards_exports = {}; - __export(standards_exports, { - getAriaRolesByType: function getAriaRolesByType() { - return get_aria_roles_by_type_default; }, - getAriaRolesSupportingNameFromContent: function getAriaRolesSupportingNameFromContent() { - return get_aria_roles_supporting_name_from_content_default; + status: { + type: 'widget', + attributes: { + allowed: [ 'aria-expanded', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + implicit: [ 'output' ], + unsupported: false, + allowedElements: [ 'section' ] + }, + structure: { + type: 'abstract', + unsupported: false + }, + switch: { + type: 'widget', + attributes: { + allowed: [ 'aria-errormessage' ], + required: [ 'aria-checked' ] + }, + owned: null, + nameFrom: [ 'author', 'contents' ], + context: null, + unsupported: false, + allowedElements: [ 'button', { + nodeName: 'input', + properties: { + type: [ 'checkbox', 'image', 'button' ] + } + }, { + nodeName: 'a', + attributes: { + href: isNotNull + } + } ] + }, + tab: { + type: 'widget', + attributes: { + allowed: [ 'aria-selected', 'aria-expanded', 'aria-setsize', 'aria-posinset', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author', 'contents' ], + context: [ 'tablist' ], + unsupported: false, + allowedElements: [ { + nodeName: [ 'button', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li' ] + }, { + nodeName: 'input', + properties: { + type: 'button' + } + }, { + nodeName: 'a', + attributes: { + href: isNotNull + } + } ] + }, + table: { + type: 'structure', + attributes: { + allowed: [ 'aria-colcount', 'aria-rowcount', 'aria-errormessage' ] + }, + owned: { + one: [ 'rowgroup', 'row' ] + }, + nameFrom: [ 'author', 'contents' ], + context: null, + implicit: [ 'table' ], + unsupported: false + }, + tablist: { + type: 'composite', + attributes: { + allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-errormessage' ] + }, + owned: { + all: [ 'tab' ] + }, + nameFrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: [ 'ol', 'ul' ] + }, + tabpanel: { + type: 'widget', + attributes: { + allowed: [ 'aria-expanded', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: [ 'section' ] + }, + term: { + type: 'structure', + attributes: { + allowed: [ 'aria-expanded', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author', 'contents' ], + context: null, + implicit: [ 'dt' ], + unsupported: false + }, + textbox: { + type: 'widget', + attributes: { + allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + implicit: [ 'input[type="text"]', 'input[type="email"]', 'input[type="password"]', 'input[type="tel"]', 'input[type="url"]', 'input:not([type])', 'textarea' ], + unsupported: false + }, + timer: { + type: 'widget', + attributes: { + allowed: [ 'aria-expanded', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + unsupported: false + }, + toolbar: { + type: 'structure', + attributes: { + allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author' ], + context: null, + implicit: [ 'menu[type="toolbar"]' ], + unsupported: false, + allowedElements: [ 'ol', 'ul' ] + }, + tooltip: { + type: 'structure', + attributes: { + allowed: [ 'aria-expanded', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author', 'contents' ], + context: null, + unsupported: false + }, + tree: { + type: 'composite', + attributes: { + allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ] + }, + owned: { + all: [ 'treeitem' ] + }, + nameFrom: [ 'author' ], + context: null, + unsupported: false, + allowedElements: [ 'ol', 'ul' ] }, - getElementSpec: function getElementSpec() { - return get_element_spec_default; + treegrid: { + type: 'composite', + attributes: { + allowed: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-rowcount', 'aria-orientation', 'aria-errormessage' ] + }, + owned: { + one: [ 'rowgroup', 'row' ] + }, + nameFrom: [ 'author' ], + context: null, + unsupported: false }, - getElementsByContentType: function getElementsByContentType() { - return get_elements_by_content_type_default; + treeitem: { + type: 'widget', + attributes: { + allowed: [ 'aria-checked', 'aria-selected', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ] + }, + owned: null, + nameFrom: [ 'author', 'contents' ], + context: [ 'group', 'tree' ], + unsupported: false, + allowedElements: [ 'li', { + nodeName: 'a', + attributes: { + href: isNotNull + } + } ] }, - getGlobalAriaAttrs: function getGlobalAriaAttrs() { - return get_global_aria_attrs_default; + widget: { + type: 'abstract', + unsupported: false }, - implicitHtmlRoles: function implicitHtmlRoles() { - return implicit_html_roles_default; - } - }); - function ariaRequiredAttrEvaluate(node) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var virtualNode = arguments.length > 2 ? arguments[2] : undefined; - var role = get_explicit_role_default(virtualNode); - var attrs = virtualNode.attrNames; - var requiredAttrs = required_attr_default(role); - if (Array.isArray(options[role])) { - requiredAttrs = unique_array_default(options[role], requiredAttrs); - } - if (!role || !attrs.length || !requiredAttrs.length) { - return true; - } - if (isStaticSeparator(virtualNode, role) || isClosedCombobox(virtualNode, role)) { - return true; - } - var elmSpec = get_element_spec_default(virtualNode); - var missingAttrs = requiredAttrs.filter(function(requiredAttr2) { - return !virtualNode.attr(requiredAttr2) && !hasImplicitAttr(elmSpec, requiredAttr2); - }); - if (missingAttrs.length) { - this.data(missingAttrs); - return false; - } - return true; - } - function isStaticSeparator(vNode, role) { - return role === 'separator' && !_isFocusable(vNode); - } - function hasImplicitAttr(elmSpec, attr) { - var _elmSpec$implicitAttr; - return ((_elmSpec$implicitAttr = elmSpec.implicitAttrs) === null || _elmSpec$implicitAttr === void 0 ? void 0 : _elmSpec$implicitAttr[attr]) !== void 0; - } - function isClosedCombobox(vNode, role) { - return role === 'combobox' && vNode.attr('aria-expanded') === 'false'; - } - function ariaRequiredChildrenEvaluate(node, options, virtualNode) { - var reviewEmpty = options && Array.isArray(options.reviewEmpty) ? options.reviewEmpty : []; - var explicitRole2 = get_explicit_role_default(virtualNode, { - dpub: true - }); - var required = required_owned_default(explicitRole2); - if (required === null) { - return true; - } - var ownedRoles = getOwnedRoles(virtualNode, required); - var unallowed = ownedRoles.filter(function(_ref96) { - var role = _ref96.role, vNode = _ref96.vNode; - return vNode.props.nodeType === 1 && !required.includes(role); - }); - if (unallowed.length) { - this.relatedNodes(unallowed.map(function(_ref97) { - var vNode = _ref97.vNode; - return vNode; - })); - this.data({ - messageKey: 'unallowed', - values: unallowed.map(function(_ref98) { - var vNode = _ref98.vNode, attr = _ref98.attr; - return getUnallowedSelector(vNode, attr); - }).filter(function(selector, index, array) { - return array.indexOf(selector) === index; - }).join(', ') - }); - return false; - } - if (hasRequiredChildren(required, ownedRoles)) { - return true; - } - this.data(required); - if (reviewEmpty.includes(explicitRole2) && !ownedRoles.some(isContent)) { - return void 0; - } - return false; - } - function getOwnedRoles(virtualNode, required) { - var vNode; - var ownedRoles = []; - var ownedVirtual = get_owned_virtual_default(virtualNode); - var _loop7 = function _loop7() { - if (vNode.props.nodeType === 3) { - ownedRoles.push({ - vNode: vNode, - role: null - }); - } - if (vNode.props.nodeType !== 1 || !_isVisibleToScreenReaders(vNode)) { - return 'continue'; - } - var role = get_role_default(vNode, { - noPresentational: true - }); - var globalAriaAttr = getGlobalAriaAttr(vNode); - var hasGlobalAriaOrFocusable = !!globalAriaAttr || _isFocusable(vNode); - if (!role && !hasGlobalAriaOrFocusable || [ 'group', 'rowgroup' ].includes(role) && required.some(function(requiredRole) { - return requiredRole === role; - })) { - ownedVirtual.push.apply(ownedVirtual, _toConsumableArray(vNode.children)); - } else if (role || hasGlobalAriaOrFocusable) { - var attr = globalAriaAttr || 'tabindex'; - ownedRoles.push({ - role: role, - attr: attr, - vNode: vNode - }); - } - }; - while (vNode = ownedVirtual.shift()) { - var _ret5 = _loop7(); - if (_ret5 === 'continue') { - continue; - } - } - return ownedRoles; - } - function hasRequiredChildren(required, ownedRoles) { - return ownedRoles.some(function(_ref99) { - var role = _ref99.role; - return role && required.includes(role); - }); - } - function getGlobalAriaAttr(vNode) { - return get_global_aria_attrs_default().find(function(attr) { - return vNode.hasAttr(attr); - }); - } - function getUnallowedSelector(vNode, attr) { - var _vNode$props = vNode.props, nodeName2 = _vNode$props.nodeName, nodeType = _vNode$props.nodeType; - if (nodeType === 3) { - return '#text'; - } - var role = get_explicit_role_default(vNode, { - dpub: true - }); - if (role) { - return '[role='.concat(role, ']'); - } - if (attr) { - return nodeName2 + '['.concat(attr, ']'); - } - return nodeName2; - } - function isContent(_ref100) { - var vNode = _ref100.vNode; - if (vNode.props.nodeType === 3) { - return vNode.props.nodeValue.trim().length > 0; - } - return has_content_virtual_default(vNode, false, true); - } - function getMissingContext(virtualNode, ownGroupRoles, reqContext, includeElement) { - var explicitRole2 = get_explicit_role_default(virtualNode); - if (!reqContext) { - reqContext = required_context_default(explicitRole2); + window: { + nameFrom: [ 'author' ], + type: 'abstract', + unsupported: false } - if (!reqContext) { - return null; + }; + lookupTable.implicitHtmlRole = implicit_html_roles_default; + lookupTable.elementsAllowedNoRole = [ { + nodeName: [ 'base', 'body', 'caption', 'col', 'colgroup', 'datalist', 'dd', 'details', 'dt', 'head', 'html', 'keygen', 'label', 'legend', 'main', 'map', 'math', 'meta', 'meter', 'noscript', 'optgroup', 'param', 'picture', 'progress', 'script', 'source', 'style', 'template', 'textarea', 'title', 'track' ] + }, { + nodeName: 'area', + attributes: { + href: isNotNull } - var allowsGroup = reqContext.includes('group'); - var vNode = includeElement ? virtualNode : virtualNode.parent; - while (vNode) { - var role = get_role_default(vNode, { - noPresentational: true - }); - if (!role) { - vNode = vNode.parent; - } else if (role === 'group' && allowsGroup) { - if (ownGroupRoles.includes(explicitRole2)) { - reqContext.push(explicitRole2); - } - reqContext = reqContext.filter(function(r) { - return r !== 'group'; - }); - vNode = vNode.parent; - } else if (reqContext.includes(role)) { - return null; - } else { - return reqContext; - } + }, { + nodeName: 'input', + properties: { + type: [ 'color', 'data', 'datatime', 'file', 'hidden', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ] } - return reqContext; - } - function getAriaOwners(element) { - var owners = [], o = null; - while (element) { - if (element.getAttribute('id')) { - var _id3 = escape_selector_default(element.getAttribute('id')); - var doc = get_root_node_default2(element); - o = doc.querySelector('[aria-owns~='.concat(_id3, ']')); - if (o) { - owners.push(o); - } - } - element = element.parentElement; + }, { + nodeName: 'link', + attributes: { + href: isNotNull } - return owners.length ? owners : null; - } - function ariaRequiredParentEvaluate(node, options, virtualNode) { - var ownGroupRoles = options && Array.isArray(options.ownGroupRoles) ? options.ownGroupRoles : []; - var missingParents = getMissingContext(virtualNode, ownGroupRoles); - if (!missingParents) { - return true; + }, { + nodeName: 'menu', + attributes: { + type: 'context' } - var owners = getAriaOwners(node); - if (owners) { - for (var _i30 = 0, l = owners.length; _i30 < l; _i30++) { - missingParents = getMissingContext(get_node_from_tree_default(owners[_i30]), ownGroupRoles, missingParents, true); - if (!missingParents) { - return true; - } + }, { + nodeName: 'menuitem', + attributes: { + type: [ 'command', 'checkbox', 'radio' ] + } + }, { + nodeName: 'select', + condition: function condition(vNode) { + if (!(vNode instanceof axe.AbstractVirtualNode)) { + vNode = axe.utils.getNodeFromTree(vNode); } + return Number(vNode.attr('size')) > 1; + }, + properties: { + multiple: true } - this.data(missingParents); - return false; - } - var aria_required_parent_evaluate_default = ariaRequiredParentEvaluate; - function ariaRoledescriptionEvaluate(node) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var virtualNode = arguments.length > 2 ? arguments[2] : undefined; - var role = get_role_default(virtualNode); - var supportedRoles = options.supportedRoles || []; - if (supportedRoles.includes(role)) { - return true; + }, { + nodeName: [ 'clippath', 'cursor', 'defs', 'desc', 'feblend', 'fecolormatrix', 'fecomponenttransfer', 'fecomposite', 'feconvolvematrix', 'fediffuselighting', 'fedisplacementmap', 'fedistantlight', 'fedropshadow', 'feflood', 'fefunca', 'fefuncb', 'fefuncg', 'fefuncr', 'fegaussianblur', 'feimage', 'femerge', 'femergenode', 'femorphology', 'feoffset', 'fepointlight', 'fespecularlighting', 'fespotlight', 'fetile', 'feturbulence', 'filter', 'hatch', 'hatchpath', 'lineargradient', 'marker', 'mask', 'meshgradient', 'meshpatch', 'meshrow', 'metadata', 'mpath', 'pattern', 'radialgradient', 'solidcolor', 'stop', 'switch', 'view' ] + } ]; + lookupTable.elementsAllowedAnyRole = [ { + nodeName: 'a', + attributes: { + href: isNull } - if (role && role !== 'presentation' && role !== 'none') { - return void 0; + }, { + nodeName: 'img', + attributes: { + alt: isNull } - return false; - } - var aria_roledescription_evaluate_default = ariaRoledescriptionEvaluate; - function ariaUnsupportedAttrEvaluate(node, options, virtualNode) { - var unsupportedAttrs = virtualNode.attrNames.filter(function(name) { - var attribute = standards_default.ariaAttrs[name]; - if (!validate_attr_default(name)) { - return false; + }, { + nodeName: [ 'abbr', 'address', 'canvas', 'div', 'p', 'pre', 'blockquote', 'ins', 'del', 'output', 'span', 'table', 'tbody', 'thead', 'tfoot', 'td', 'em', 'strong', 'small', 's', 'cite', 'q', 'dfn', 'abbr', 'time', 'code', 'var', 'samp', 'kbd', 'sub', 'sup', 'i', 'b', 'u', 'mark', 'ruby', 'rt', 'rp', 'bdi', 'bdo', 'br', 'wbr', 'th', 'tr' ] + } ]; + lookupTable.evaluateRoleForElement = { + A: function A(_ref94) { + var node = _ref94.node, out = _ref94.out; + if (node.namespaceURI === 'http://www.w3.org/2000/svg') { + return true; } - var unsupported = attribute.unsupported; - if (_typeof(unsupported) !== 'object') { - return !!unsupported; + if (node.href.length) { + return out; } - return !matches_default2(node, unsupported.exceptions); - }); - if (unsupportedAttrs.length) { - this.data(unsupportedAttrs); return true; - } - return false; - } - var aria_unsupported_attr_evaluate_default = ariaUnsupportedAttrEvaluate; - function ariaValidAttrEvaluate(node, options, virtualNode) { - options = Array.isArray(options.value) ? options.value : []; - var invalid = []; - var aria = /^aria-/; - virtualNode.attrNames.forEach(function(attr) { - if (options.indexOf(attr) === -1 && aria.test(attr) && !validate_attr_default(attr)) { - invalid.push(attr); + }, + AREA: function AREA(_ref95) { + var node = _ref95.node; + return !node.href; + }, + BUTTON: function BUTTON(_ref96) { + var node = _ref96.node, role = _ref96.role, out = _ref96.out; + if (node.getAttribute('type') === 'menu') { + return role === 'menuitem'; } - }); - if (invalid.length) { - this.data(invalid); - return false; - } - return true; - } - var aria_valid_attr_evaluate_default = ariaValidAttrEvaluate; - function ariaValidAttrValueEvaluate(node, options, virtualNode) { - options = Array.isArray(options.value) ? options.value : []; - var needsReview = ''; - var messageKey = ''; - var invalid = []; - var aria = /^aria-/; - var skipAttrs = [ 'aria-errormessage' ]; - var preChecks = { - 'aria-controls': function ariaControls() { - return virtualNode.attr('aria-expanded') !== 'false' && virtualNode.attr('aria-selected') !== 'false'; - }, - 'aria-current': function ariaCurrent(validValue) { - if (!validValue) { - needsReview = 'aria-current="'.concat(virtualNode.attr('aria-current'), '"'); - messageKey = 'ariaCurrent'; - } - return; - }, - 'aria-owns': function ariaOwns() { - return virtualNode.attr('aria-expanded') !== 'false'; - }, - 'aria-describedby': function ariaDescribedby(validValue) { - if (!validValue) { - needsReview = 'aria-describedby="'.concat(virtualNode.attr('aria-describedby'), '"'); - messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId'; - } - return; - }, - 'aria-labelledby': function ariaLabelledby(validValue) { - if (!validValue) { - needsReview = 'aria-labelledby="'.concat(virtualNode.attr('aria-labelledby'), '"'); - messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId'; + return out; + }, + IMG: function IMG(_ref97) { + var node = _ref97.node, role = _ref97.role, out = _ref97.out; + switch (node.alt) { + case null: + return out; + + case '': + return role === 'presentation' || role === 'none'; + + default: + return role !== 'presentation' && role !== 'none'; + } + }, + INPUT: function INPUT(_ref98) { + var node = _ref98.node, role = _ref98.role, out = _ref98.out; + switch (node.type) { + case 'button': + case 'image': + return out; + + case 'checkbox': + if (role === 'button' && node.hasAttribute('aria-pressed')) { + return true; } + return out; + + case 'radio': + return role === 'menuitemradio'; + + case 'text': + return role === 'combobox' || role === 'searchbox' || role === 'spinbutton'; + + case 'tel': + return role === 'combobox' || role === 'spinbutton'; + + case 'url': + case 'search': + case 'email': + return role === 'combobox'; + + default: + return false; } - }; - virtualNode.attrNames.forEach(function(attrName) { - if (skipAttrs.includes(attrName) || options.includes(attrName) || !aria.test(attrName)) { - return; + }, + LI: function LI(_ref99) { + var node = _ref99.node, out = _ref99.out; + var hasImplicitListitemRole = axe.utils.matchesSelector(node, 'ol li, ul li'); + if (hasImplicitListitemRole) { + return out; } - var validValue; - var attrValue = virtualNode.attr(attrName); - try { - validValue = validate_attr_value_default(virtualNode, attrName); - } catch (e) { - needsReview = ''.concat(attrName, '="').concat(attrValue, '"'); - messageKey = 'idrefs'; - return; + return true; + }, + MENU: function MENU(_ref100) { + var node = _ref100.node; + if (node.getAttribute('type') === 'context') { + return false; } - if ((preChecks[attrName] ? preChecks[attrName](validValue) : true) && !validValue) { - if (attrValue === '' && !isStringType(attrName)) { - needsReview = attrName; - messageKey = 'empty'; - } else { - invalid.push(''.concat(attrName, '="').concat(attrValue, '"')); - } + return true; + }, + OPTION: function OPTION(_ref101) { + var node = _ref101.node; + var withinOptionList = axe.utils.matchesSelector(node, 'select > option, datalist > option, optgroup > option'); + return !withinOptionList; + }, + SELECT: function SELECT(_ref102) { + var node = _ref102.node, role = _ref102.role; + return !node.multiple && node.size <= 1 && role === 'menu'; + }, + SVG: function SVG(_ref103) { + var node = _ref103.node, out = _ref103.out; + if (node.parentNode && node.parentNode.namespaceURI === 'http://www.w3.org/2000/svg') { + return true; } - }); - if (invalid.length) { - this.data(invalid); + return out; + } + }; + lookupTable.rolesOfType = { + widget: [ 'button', 'checkbox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'scrollbar', 'searchbox', 'slider', 'spinbutton', 'status', 'switch', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'tree', 'treeitem' ] + }; + var lookup_table_default = lookupTable; + function implicitNodes(role) { + var implicit = null; + var roles = lookup_table_default.role[role]; + if (roles && roles.implicit) { + implicit = _clone(roles.implicit); + } + return implicit; + } + var implicit_nodes_default = implicitNodes; + function isAccessibleRef(node) { + return !!get_accessible_refs_default(node).length; + } + var is_accessible_ref_default = isAccessibleRef; + function _isComboboxPopup(virtualNode) { + var _popupRoles; + var _ref104 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, popupRoles = _ref104.popupRoles; + var role = get_role_default(virtualNode); + (_popupRoles = popupRoles) !== null && _popupRoles !== void 0 ? _popupRoles : popupRoles = aria_attrs_default['aria-haspopup'].values; + if (!popupRoles.includes(role)) { return false; } - if (needsReview) { - this.data({ - messageKey: messageKey, - needsReview: needsReview - }); - return void 0; + var vParent = nearestParentWithRole(virtualNode); + if (isCombobox(vParent)) { + return true; + } + var id = virtualNode.props.id; + if (!id) { + return false; + } + if (!virtualNode.actualNode) { + throw new Error('Unable to determine combobox popup without an actualNode'); + } + var root = get_root_node_default(virtualNode.actualNode); + var ownedCombobox = root.querySelectorAll('[aria-owns~="'.concat(id, '"][role~="combobox"]:not(select),\n [aria-controls~="').concat(id, '"][role~="combobox"]:not(select)')); + return Array.from(ownedCombobox).some(isCombobox); + } + var isCombobox = function isCombobox(node) { + return node && get_role_default(node) === 'combobox'; + }; + function nearestParentWithRole(vNode) { + while (vNode = vNode.parent) { + if (get_role_default(vNode, { + noPresentational: true + }) !== null) { + return vNode; + } } - return true; + return null; } - function isStringType(attrName) { - var _standards_default$ar; - return ((_standards_default$ar = standards_default.ariaAttrs[attrName]) === null || _standards_default$ar === void 0 ? void 0 : _standards_default$ar.type) === 'string'; + function label2(node) { + node = get_node_from_tree_default(node); + return label_virtual_default(node); } - function brailleLabelEquivalentEvaluate(node, options, virtualNode) { - var _virtualNode$attr; - var brailleLabel = (_virtualNode$attr = virtualNode.attr('aria-braillelabel')) !== null && _virtualNode$attr !== void 0 ? _virtualNode$attr : ''; - if (!brailleLabel.trim()) { - return true; + var label_default2 = label2; + function requiredAttr(role) { + var roleDef = standards_default.ariaRoles[role]; + if (!roleDef || !Array.isArray(roleDef.requiredAttrs)) { + return []; } - try { - return sanitize_default(_accessibleTextVirtual(virtualNode)) !== ''; - } catch (_unused) { - return void 0; + return _toConsumableArray(roleDef.requiredAttrs); + } + var required_attr_default = requiredAttr; + function requiredContext(role) { + var roleDef = standards_default.ariaRoles[role]; + if (!roleDef || !Array.isArray(roleDef.requiredContext)) { + return null; } + return _toConsumableArray(roleDef.requiredContext); } - function brailleRoleDescriptionEquivalentEvaluate(node, options, virtualNode) { - var _virtualNode$attr2; - var brailleRoleDesc = (_virtualNode$attr2 = virtualNode.attr('aria-brailleroledescription')) !== null && _virtualNode$attr2 !== void 0 ? _virtualNode$attr2 : ''; - if (sanitize_default(brailleRoleDesc) === '') { + var required_context_default = requiredContext; + function requiredOwned(role) { + var roleDef = standards_default.ariaRoles[role]; + if (!roleDef || !Array.isArray(roleDef.requiredOwned)) { + return null; + } + return _toConsumableArray(roleDef.requiredOwned); + } + var required_owned_default = requiredOwned; + function validateAttrValue(vNode, attr) { + vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode); + var matches4; + var list; + var value = vNode.attr(attr); + var attrInfo = standards_default.ariaAttrs[attr]; + if (!attrInfo) { return true; } - var roleDesc = virtualNode.attr('aria-roledescription'); - if (typeof roleDesc !== 'string') { - this.data({ - messageKey: 'noRoleDescription' - }); - return false; + if (attrInfo.allowEmpty && (!value || value.trim() === '')) { + return true; } - if (sanitize_default(roleDesc) === '') { - this.data({ - messageKey: 'emptyRoleDescription' + switch (attrInfo.type) { + case 'boolean': + return [ 'true', 'false' ].includes(value.toLowerCase()); + + case 'nmtoken': + return typeof value === 'string' && attrInfo.values.includes(value.toLowerCase()); + + case 'nmtokens': + list = token_list_default(value); + return list.reduce(function(result, token) { + return result && attrInfo.values.includes(token); + }, list.length !== 0); + + case 'idref': + try { + var doc = get_root_node_default2(vNode.actualNode); + return !!(value && doc.getElementById(value)); + } catch (e) { + throw new TypeError('Cannot resolve id references for partial DOM'); + } + + case 'idrefs': + return idrefs_default(vNode, attr).some(function(node) { + return !!node; }); - return false; + + case 'string': + return value.trim() !== ''; + + case 'decimal': + matches4 = value.match(/^[-+]?([0-9]*)\.?([0-9]*)$/); + return !!(matches4 && (matches4[1] || matches4[2])); + + case 'int': + var minValue = typeof attrInfo.minValue !== 'undefined' ? attrInfo.minValue : -Infinity; + return /^[-+]?[0-9]+$/.test(value) && parseInt(value) >= minValue; } - return true; } - function deprecatedroleEvaluate(node, options, virtualNode) { - var role = get_role_default(virtualNode, { - dpub: true, - fallback: true + var validate_attr_value_default = validateAttrValue; + function validateAttr(att) { + var attrDefinition = standards_default.ariaAttrs[att]; + return !!attrDefinition; + } + var validate_attr_default = validateAttr; + function tdHasHeaderEvaluate(node) { + var badCells = []; + var cells = get_all_cells_default(node); + var tableGrid = to_grid_default(node); + cells.forEach(function(cell) { + if (has_content_default(cell) && is_data_cell_default(cell) && !label_default2(cell)) { + var hasHeaders = get_headers_default(cell, tableGrid).some(function(header) { + return header !== null && !!has_content_default(header); + }); + if (!hasHeaders) { + badCells.push(cell); + } + } }); - var roleDefinition = standards_default.ariaRoles[role]; - if (!(roleDefinition !== null && roleDefinition !== void 0 && roleDefinition.deprecated)) { + if (badCells.length) { + this.relatedNodes(badCells); return false; } - this.data(role); return true; } - function nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) { - var hasImplicitRole = implicit_role_default(virtualNode); - return !hasImplicitRole && explicitRoles.length === 2 && explicitRoles.includes('none') && explicitRoles.includes('presentation'); + var td_has_header_evaluate_default = tdHasHeaderEvaluate; + function scopeValueEvaluate(node, options) { + var value = node.getAttribute('scope').toLowerCase(); + return options.values.indexOf(value) !== -1; } - function fallbackroleEvaluate(node, options, virtualNode) { - var explicitRoles = token_list_default(virtualNode.attr('role')); - if (explicitRoles.length <= 1) { + var scope_value_evaluate_default = scopeValueEvaluate; + var same_caption_summary_evaluate_default = sameCaptionSummaryEvaluate; + function sameCaptionSummaryEvaluate(node, options, virtualNode) { + if (virtualNode.children === void 0) { + return void 0; + } + var summary = virtualNode.attr('summary'); + var captionNode = virtualNode.children.find(isCaptionNode); + var caption = captionNode ? sanitize_default(subtree_text_default(captionNode)) : false; + if (!caption || !summary) { return false; } - return nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) ? void 0 : true; + return sanitize_default(summary).toLowerCase() === sanitize_default(caption).toLowerCase(); } - var fallbackrole_evaluate_default = fallbackroleEvaluate; - function hasGlobalAriaAttributeEvaluate(node, options, virtualNode) { - var globalAttrs = get_global_aria_attrs_default().filter(function(attr) { - return virtualNode.hasAttr(attr); - }); - this.data(globalAttrs); - return globalAttrs.length > 0; + function isCaptionNode(virtualNode) { + return virtualNode.props.nodeName === 'caption'; } - var has_global_aria_attribute_evaluate_default = hasGlobalAriaAttributeEvaluate; - function hasWidgetRoleEvaluate(node) { - var role = node.getAttribute('role'); - if (role === null) { - return false; + function html5ScopeEvaluate(node) { + if (!is_html5_default(document)) { + return true; } - var roleType = get_role_type_default(role); - return roleType === 'widget' || roleType === 'composite'; + return node.nodeName.toUpperCase() === 'TH'; } - var has_widget_role_evaluate_default = hasWidgetRoleEvaluate; - function invalidroleEvaluate(node, options, virtualNode) { - var allRoles = token_list_default(virtualNode.attr('role')); - var allInvalid = allRoles.every(function(role) { - return !is_valid_role_default(role, { - allowAbstract: true - }); - }); - if (allInvalid) { - this.data(allRoles); + var html5_scope_evaluate_default = html5ScopeEvaluate; + function captionFakedEvaluate(node) { + var table = to_grid_default(node); + var firstRow = table[0]; + if (table.length <= 1 || firstRow.length <= 1 || node.rows.length <= 1) { return true; } - return false; - } - var invalidrole_evaluate_default = invalidroleEvaluate; - function isElementFocusableEvaluate(node, options, virtualNode) { - return _isFocusable(virtualNode); + return firstRow.reduce(function(out, curr, i) { + return out || curr !== firstRow[i + 1] && firstRow[i + 1] !== void 0; + }, false); } - var is_element_focusable_evaluate_default = isElementFocusableEvaluate; - function noImplicitExplicitLabelEvaluate(node, options, virtualNode) { - var role = get_role_default(virtualNode, { - noImplicit: true - }); - this.data(role); - var label3; - var accText; - try { - label3 = sanitize_default(label_text_default(virtualNode)).toLowerCase(); - accText = sanitize_default(_accessibleTextVirtual(virtualNode)).toLowerCase(); - } catch (e) { - return void 0; - } - if (!accText && !label3) { - return false; - } - if (!accText && label3) { - return void 0; - } - if (!accText.includes(label3)) { + var caption_faked_evaluate_default = captionFakedEvaluate; + function svgNonEmptyTitleEvaluate(node, options, virtualNode) { + if (!virtualNode.children) { return void 0; } - return false; - } - var no_implicit_explicit_label_evaluate_default = noImplicitExplicitLabelEvaluate; - function unsupportedroleEvaluate(node, options, virtualNode) { - var role = get_role_default(virtualNode, { - dpub: true, - fallback: true - }); - var isUnsupported = is_unsupported_role_default(role); - if (isUnsupported) { - this.data(role); - } - return isUnsupported; - } - var unsupportedrole_evaluate_default = unsupportedroleEvaluate; - var VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS = { - ARTICLE: true, - ASIDE: true, - NAV: true, - SECTION: true - }; - var VALID_ROLES_FOR_SCROLLABLE_REGIONS = { - application: true, - article: true, - banner: false, - complementary: true, - contentinfo: true, - form: true, - main: true, - navigation: true, - region: true, - search: false - }; - function validScrollableTagName(node) { - var nodeName2 = node.nodeName.toUpperCase(); - return VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS[nodeName2] || false; - } - function validScrollableRole(node, options) { - var role = get_explicit_role_default(node); - if (!role) { + var titleNode = virtualNode.children.find(function(_ref105) { + var props = _ref105.props; + return props.nodeName === 'title'; + }); + if (!titleNode) { + this.data({ + messageKey: 'noTitle' + }); return false; } - return VALID_ROLES_FOR_SCROLLABLE_REGIONS[role] || options.roles.includes(role) || false; - } - function validScrollableSemanticsEvaluate(node, options) { - return validScrollableRole(node, options) || validScrollableTagName(node); + try { + var titleText2 = subtree_text_default(titleNode, { + includeHidden: true + }).trim(); + if (titleText2 === '') { + this.data({ + messageKey: 'emptyTitle' + }); + return false; + } + } catch (e) { + return void 0; + } + return true; } - var valid_scrollable_semantics_evaluate_default = validScrollableSemanticsEvaluate; - var color_exports = {}; - __export(color_exports, { - Color: function Color() { - return color_default; - }, - centerPointOfRect: function centerPointOfRect() { - return center_point_of_rect_default; - }, - elementHasImage: function elementHasImage() { - return element_has_image_default; - }, - elementIsDistinct: function elementIsDistinct() { - return element_is_distinct_default; - }, - filteredRectStack: function filteredRectStack() { - return filtered_rect_stack_default; - }, - flattenColors: function flattenColors() { - return flatten_colors_default; - }, - flattenShadowColors: function flattenShadowColors() { - return _flattenShadowColors; - }, - getBackgroundColor: function getBackgroundColor() { - return _getBackgroundColor2; - }, - getBackgroundStack: function getBackgroundStack() { - return _getBackgroundStack; - }, - getContrast: function getContrast() { - return get_contrast_default; - }, - getForegroundColor: function getForegroundColor() { - return _getForegroundColor; - }, - getOwnBackgroundColor: function getOwnBackgroundColor() { - return get_own_background_color_default; - }, - getRectStack: function getRectStack() { - return get_rect_stack_default; - }, - getStackingContext: function getStackingContext() { - return _getStackingContext; - }, - getStrokeColorsFromShadows: function getStrokeColorsFromShadows() { - return _getStrokeColorsFromShadows; + var svg_non_empty_title_evaluate_default = svgNonEmptyTitleEvaluate; + var standards_exports = {}; + __export(standards_exports, { + getAriaRolesByType: function getAriaRolesByType() { + return get_aria_roles_by_type_default; }, - getTextShadowColors: function getTextShadowColors() { - return _getTextShadowColors; + getAriaRolesSupportingNameFromContent: function getAriaRolesSupportingNameFromContent() { + return get_aria_roles_supporting_name_from_content_default; }, - hasValidContrastRatio: function hasValidContrastRatio() { - return has_valid_contrast_ratio_default; + getElementSpec: function getElementSpec() { + return get_element_spec_default; }, - incompleteData: function incompleteData() { - return incomplete_data_default; + getElementsByContentType: function getElementsByContentType() { + return get_elements_by_content_type_default; }, - parseTextShadows: function parseTextShadows() { - return _parseTextShadows; + getGlobalAriaAttrs: function getGlobalAriaAttrs() { + return get_global_aria_attrs_default; }, - stackingContextToColor: function stackingContextToColor() { - return _stackingContextToColor; + implicitHtmlRoles: function implicitHtmlRoles() { + return implicit_html_roles_default; } }); - function centerPointOfRect(rect) { - if (rect.left > window.innerWidth) { - return void 0; + function presentationalRoleEvaluate(node, options, virtualNode) { + var explicitRole2 = get_explicit_role_default(virtualNode); + if ([ 'presentation', 'none' ].includes(explicitRole2) && [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) && virtualNode.hasAttr('title')) { + this.data({ + messageKey: 'iframe', + nodeName: virtualNode.props.nodeName + }); + return false; } - if (rect.top > window.innerHeight) { - return void 0; + var role = get_role_default(virtualNode); + if ([ 'presentation', 'none' ].includes(role)) { + this.data({ + role: role + }); + return true; } - var x = Math.min(Math.ceil(rect.left + rect.width / 2), window.innerWidth - 1); - var y = Math.min(Math.ceil(rect.top + rect.height / 2), window.innerHeight - 1); - return { - x: x, - y: y - }; - } - var center_point_of_rect_default = centerPointOfRect; - function _getFonts(style) { - return style.getPropertyValue('font-family').split(/[,;]/g).map(function(font) { - return font.trim().toLowerCase(); + if (![ 'presentation', 'none' ].includes(explicitRole2)) { + return false; + } + var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) { + return virtualNode.hasAttr(attr); + }); + var focusable = _isFocusable(virtualNode); + var messageKey; + if (hasGlobalAria && !focusable) { + messageKey = 'globalAria'; + } else if (!hasGlobalAria && focusable) { + messageKey = 'focusable'; + } else { + messageKey = 'both'; + } + this.data({ + messageKey: messageKey, + role: role }); + return false; } - function elementIsDistinct(node, ancestorNode) { - var nodeStyle = window.getComputedStyle(node); - if (nodeStyle.getPropertyValue('background-image') !== 'none') { - return true; + function nonEmptyIfPresentEvaluate(node, options, virtualNode) { + var nodeName2 = virtualNode.props.nodeName; + var type2 = (virtualNode.attr('type') || '').toLowerCase(); + var label3 = virtualNode.attr('value'); + if (label3) { + this.data({ + messageKey: 'has-label' + }); } - var hasBorder = [ 'border-bottom', 'border-top', 'outline' ].reduce(function(result, edge) { - var borderClr = new color_default(); - borderClr.parseString(nodeStyle.getPropertyValue(edge + '-color')); - return result || nodeStyle.getPropertyValue(edge + '-style') !== 'none' && parseFloat(nodeStyle.getPropertyValue(edge + '-width')) > 0 && borderClr.alpha !== 0; - }, false); - if (hasBorder) { - return true; + if (nodeName2 === 'input' && [ 'submit', 'reset' ].includes(type2)) { + return label3 === null; } - var parentStyle = window.getComputedStyle(ancestorNode); - if (_getFonts(nodeStyle)[0] !== _getFonts(parentStyle)[0]) { + return false; + } + var non_empty_if_present_evaluate_default = nonEmptyIfPresentEvaluate; + function isOnScreenEvaluate(node) { + return _isVisibleOnScreen(node); + } + var is_on_screen_evaluate_default = isOnScreenEvaluate; + function inlineStyleProperty(node, options) { + var cssProperty = options.cssProperty, absoluteValues = options.absoluteValues, minValue = options.minValue, maxValue = options.maxValue, _options$normalValue = options.normalValue, normalValue = _options$normalValue === void 0 ? 0 : _options$normalValue, noImportant = options.noImportant, multiLineOnly = options.multiLineOnly; + if (!noImportant && node.style.getPropertyPriority(cssProperty) !== 'important' || multiLineOnly && !_isMultiline(node)) { return true; } - var hasStyle = [ 'text-decoration-line', 'text-decoration-style', 'font-weight', 'font-style', 'font-size' ].reduce(function(result, cssProp) { - return result || nodeStyle.getPropertyValue(cssProp) !== parentStyle.getPropertyValue(cssProp); - }, false); - var tDec = nodeStyle.getPropertyValue('text-decoration'); - if (tDec.split(' ').length < 3) { - hasStyle = hasStyle || tDec !== parentStyle.getPropertyValue('text-decoration'); + var data = {}; + if (typeof minValue === 'number') { + data.minValue = minValue; } - return hasStyle; - } - var element_is_distinct_default = elementIsDistinct; - function getRectStack2(elm) { - var boundingStack = get_element_stack_default(elm); - var filteredArr = get_text_element_stack_default(elm); - if (!filteredArr || filteredArr.length <= 1) { - return [ boundingStack ]; + if (typeof maxValue === 'number') { + data.maxValue = maxValue; } - if (filteredArr.some(function(stack) { - return stack === void 0; - })) { - return null; + var declaredPropValue = node.style.getPropertyValue(cssProperty); + if ([ 'inherit', 'unset', 'revert', 'revert-layer' ].includes(declaredPropValue)) { + this.data(_extends({ + value: declaredPropValue + }, data)); + return true; } - filteredArr.splice(0, 0, boundingStack); - return filteredArr; + var value = getNumberValue(node, { + absoluteValues: absoluteValues, + cssProperty: cssProperty, + normalValue: normalValue + }); + this.data(_extends({ + value: value + }, data)); + if (typeof value !== 'number') { + return void 0; + } + if ((typeof minValue !== 'number' || value >= minValue) && (typeof maxValue !== 'number' || value <= maxValue)) { + return true; + } + return false; } - var get_rect_stack_default = getRectStack2; - function filteredRectStack(elm) { - var rectStack = get_rect_stack_default(elm); - if (rectStack && rectStack.length === 1) { - return rectStack[0]; + function getNumberValue(domNode, _ref106) { + var cssProperty = _ref106.cssProperty, absoluteValues = _ref106.absoluteValues, normalValue = _ref106.normalValue; + var computedStyle = window.getComputedStyle(domNode); + var cssPropValue = computedStyle.getPropertyValue(cssProperty); + if (cssPropValue === 'normal') { + return normalValue; } - if (rectStack && rectStack.length > 1) { - var boundingStack = rectStack.shift(); - var isSame; - rectStack.forEach(function(rectList, index) { - if (index === 0) { - return; - } - var rectA = rectStack[index - 1], rectB = rectStack[index]; - isSame = rectA.every(function(element, elementIndex) { - return element === rectB[elementIndex]; - }) || boundingStack.includes(elm); - }); - if (!isSame) { - incomplete_data_default.set('bgColor', 'elmPartiallyObscuring'); - return null; - } - return rectStack[0]; + var parsedValue = parseFloat(cssPropValue); + if (absoluteValues) { + return parsedValue; + } + var fontSize = parseFloat(computedStyle.getPropertyValue('font-size')); + var value = Math.round(parsedValue / fontSize * 100) / 100; + if (isNaN(value)) { + return cssPropValue; } - incomplete_data_default.set('bgColor', 'outsideViewport'); - return null; - } - var filtered_rect_stack_default = filteredRectStack; - function clamp2(value, min, max2) { - return Math.min(Math.max(min, value), max2); + return value; } - var blendFunctions = { - normal: function normal(Cb, Cs) { - return Cs; - }, - multiply: function multiply(Cb, Cs) { - return Cs * Cb; - }, - screen: function screen(Cb, Cs) { - return Cb + Cs - Cb * Cs; - }, - overlay: function overlay(Cb, Cs) { - return this['hard-light'](Cs, Cb); - }, - darken: function darken(Cb, Cs) { - return Math.min(Cb, Cs); - }, - lighten: function lighten(Cb, Cs) { - return Math.max(Cb, Cs); - }, - 'color-dodge': function colorDodge(Cb, Cs) { - return Cb === 0 ? 0 : Cs === 1 ? 1 : Math.min(1, Cb / (1 - Cs)); - }, - 'color-burn': function colorBurn(Cb, Cs) { - return Cb === 1 ? 1 : Cs === 0 ? 0 : 1 - Math.min(1, (1 - Cb) / Cs); - }, - 'hard-light': function hardLight(Cb, Cs) { - return Cs <= .5 ? this.multiply(Cb, 2 * Cs) : this.screen(Cb, 2 * Cs - 1); - }, - 'soft-light': function softLight(Cb, Cs) { - if (Cs <= .5) { - return Cb - (1 - 2 * Cs) * Cb * (1 - Cb); - } else { - var D = Cb <= .25 ? ((16 * Cb - 12) * Cb + 4) * Cb : Math.sqrt(Cb); - return Cb + (2 * Cs - 1) * (D - Cb); - } - }, - difference: function difference(Cb, Cs) { - return Math.abs(Cb - Cs); - }, - exclusion: function exclusion(Cb, Cs) { - return Cb + Cs - 2 * Cb * Cs; + function hasAltEvaluate(node, options, virtualNode) { + var nodeName2 = virtualNode.props.nodeName; + if (![ 'img', 'input', 'area' ].includes(nodeName2)) { + return false; } - }; - function simpleAlphaCompositing(Cs, \u03b1s, Cb, \u03b1b, blendMode) { - return \u03b1s * (1 - \u03b1b) * Cs + \u03b1s * \u03b1b * blendFunctions[blendMode](Cb / 255, Cs / 255) * 255 + (1 - \u03b1s) * \u03b1b * Cb; + return virtualNode.hasAttr('alt'); } - function flattenColors(sourceColor, backdrop) { - var blendMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'normal'; - var r = simpleAlphaCompositing(sourceColor.red, sourceColor.alpha, backdrop.red, backdrop.alpha, blendMode); - var g2 = simpleAlphaCompositing(sourceColor.green, sourceColor.alpha, backdrop.green, backdrop.alpha, blendMode); - var b2 = simpleAlphaCompositing(sourceColor.blue, sourceColor.alpha, backdrop.blue, backdrop.alpha, blendMode); - var \u03b1o = clamp2(sourceColor.alpha + backdrop.alpha * (1 - sourceColor.alpha), 0, 1); - if (\u03b1o === 0) { - return new color_default(r, g2, b2, \u03b1o); - } - var Cr = Math.round(r / \u03b1o); - var Cg = Math.round(g2 / \u03b1o); - var Cb = Math.round(b2 / \u03b1o); - return new color_default(Cr, Cg, Cb, \u03b1o); + var has_alt_evaluate_default = hasAltEvaluate; + function existsEvaluate() { + return void 0; } - var flatten_colors_default = flattenColors; - function _flattenShadowColors(fgColor, bgColor) { - var alpha = fgColor.alpha; - var r = (1 - alpha) * bgColor.red + alpha * fgColor.red; - var g2 = (1 - alpha) * bgColor.green + alpha * fgColor.green; - var b2 = (1 - alpha) * bgColor.blue + alpha * fgColor.blue; - var a2 = fgColor.alpha + bgColor.alpha * (1 - fgColor.alpha); - return new color_default(r, g2, b2, a2); + var exists_evaluate_default = existsEvaluate; + function docHasTitleEvaluate() { + var title = document.title; + return !!sanitize_default(title); } - function _getBackgroundStack(node) { - var stacks = get_text_element_stack_default(node).map(function(stack) { - stack = reduce_to_elements_below_floating_default(stack, node); - stack = sortPageBackground(stack); - return stack; - }); - for (var index = 0; index < stacks.length; index++) { - var stack = stacks[index]; - if (stack[0] !== node) { - incomplete_data_default.set('bgColor', 'bgOverlap'); - return null; - } - if (index !== 0 && !shallowArraysEqual(stack, stacks[0])) { - incomplete_data_default.set('bgColor', 'elmPartiallyObscuring'); - return null; + var doc_has_title_evaluate_default = docHasTitleEvaluate; + function avoidInlineSpacingEvaluate(node, options) { + var overriddenProperties = options.cssProperties.filter(function(property) { + if (node.style.getPropertyPriority(property) === 'important') { + return property; } + }); + if (overriddenProperties.length > 0) { + this.data(overriddenProperties); + return false; } - return stacks[0] || null; + return true; } - function sortPageBackground(elmStack) { - var bodyIndex = elmStack.indexOf(document.body); - var bgNodes = elmStack; - var htmlBgColor = get_own_background_color_default(window.getComputedStyle(document.documentElement)); - if (bodyIndex > 1 && htmlBgColor.alpha === 0 && !element_has_image_default(document.documentElement)) { - if (bodyIndex > 1) { - bgNodes.splice(bodyIndex, 1); - bgNodes.push(document.body); - } - var htmlIndex = bgNodes.indexOf(document.documentElement); - if (htmlIndex > 0) { - bgNodes.splice(htmlIndex, 1); - bgNodes.push(document.documentElement); - } + var avoid_inline_spacing_evaluate_default = avoidInlineSpacingEvaluate; + function ariaLabelledbyEvaluate(node, options, virtualNode) { + try { + return !!sanitize_default(arialabelledby_text_default(virtualNode)); + } catch (e) { + return void 0; } - return bgNodes; } - function shallowArraysEqual(a2, b2) { - if (a2 === b2) { + var aria_labelledby_evaluate_default = ariaLabelledbyEvaluate; + function ariaLabelEvaluate(node, options, virtualNode) { + return !!sanitize_default(_arialabelText(virtualNode)); + } + var aria_label_evaluate_default = ariaLabelEvaluate; + function duplicateIdEvaluate(node) { + var id = node.getAttribute('id').trim(); + if (!id) { return true; } - if (a2 === null || b2 === null) { - return false; - } - if (a2.length !== b2.length) { - return false; + var root = get_root_node_default2(node); + var matchingNodes = Array.from(root.querySelectorAll('[id="'.concat(escape_selector_default(id), '"]'))).filter(function(foundNode) { + return foundNode !== node; + }); + if (matchingNodes.length) { + this.relatedNodes(matchingNodes); } - for (var i = 0; i < a2.length; ++i) { - if (a2[i] !== b2[i]) { - return false; + this.data(id); + return matchingNodes.length === 0; + } + var duplicate_id_evaluate_default = duplicateIdEvaluate; + function duplicateIdAfter(results) { + var uniqueIds = []; + return results.filter(function(r) { + if (uniqueIds.indexOf(r.data) === -1) { + uniqueIds.push(r.data); + return true; } - } + return false; + }); + } + var duplicate_id_after_default = duplicateIdAfter; + function uniqueFrameTitleEvaluate(node, options, vNode) { + var title = sanitize_default(vNode.attr('title')).toLowerCase(); + this.data(title); return true; } - var SHADOW_STROKE_ALPHA = .54; - var VISIBLE_SHADOW_MIN_PX = .5; - var OPAQUE_STROKE_OFFSET_MIN_PX = 1.5; - var edges = [ 'top', 'right', 'bottom', 'left' ]; - function _getStrokeColorsFromShadows(parsedShadows) { - var _ref101 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref101$ignoreEdgeCou = _ref101.ignoreEdgeCount, ignoreEdgeCount = _ref101$ignoreEdgeCou === void 0 ? false : _ref101$ignoreEdgeCou; - var shadowMap = getShadowColorsMap(parsedShadows); - var shadowsByColor = Object.entries(shadowMap).map(function(_ref102) { - var _ref103 = _slicedToArray(_ref102, 2), colorStr = _ref103[0], sides = _ref103[1]; - var edgeCount = edges.filter(function(side) { - return sides[side].length !== 0; - }).length; - return { - colorStr: colorStr, - sides: sides, - edgeCount: edgeCount - }; + var unique_frame_title_evaluate_default = uniqueFrameTitleEvaluate; + function uniqueFrameTitleAfter(results) { + var titles = {}; + results.forEach(function(r) { + titles[r.data] = titles[r.data] !== void 0 ? ++titles[r.data] : 0; }); - if (!ignoreEdgeCount && shadowsByColor.some(function(_ref104) { - var edgeCount = _ref104.edgeCount; - return edgeCount > 1 && edgeCount < 4; - })) { - return null; + results.forEach(function(r) { + r.result = !!titles[r.data]; + }); + return results; + } + var unique_frame_title_after_default = uniqueFrameTitleAfter; + function skipLinkEvaluate(node) { + var target = get_element_by_reference_default(node, 'href'); + if (target) { + return _isVisibleToScreenReaders(target) || void 0; } - return shadowsByColor.map(shadowGroupToColor).filter(function(shadow) { - return shadow !== null; + return false; + } + var skip_link_evaluate_default = skipLinkEvaluate; + var implicitAriaLiveRoles = [ 'alert', 'log', 'status' ]; + function regionEvaluate(node, options, virtualNode) { + this.data({ + isIframe: [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) + }); + var regionlessNodes = cache_default.get('regionlessNodes', function() { + return getRegionlessNodes(options); }); + return !regionlessNodes.includes(virtualNode); } - function getShadowColorsMap(parsedShadows) { - var colorMap = {}; - var _iterator16 = _createForOfIteratorHelper(parsedShadows), _step16; - try { - for (_iterator16.s(); !(_step16 = _iterator16.n()).done; ) { - var _colorMap$colorStr; - var _step16$value = _step16.value, colorStr = _step16$value.colorStr, pixels = _step16$value.pixels; - (_colorMap$colorStr = colorMap[colorStr]) !== null && _colorMap$colorStr !== void 0 ? _colorMap$colorStr : colorMap[colorStr] = { - top: [], - right: [], - bottom: [], - left: [] - }; - var borders = colorMap[colorStr]; - var _pixels = _slicedToArray(pixels, 2), offsetX = _pixels[0], offsetY = _pixels[1]; - if (offsetX > VISIBLE_SHADOW_MIN_PX) { - borders.right.push(offsetX); - } else if (-offsetX > VISIBLE_SHADOW_MIN_PX) { - borders.left.push(-offsetX); - } - if (offsetY > VISIBLE_SHADOW_MIN_PX) { - borders.bottom.push(offsetY); - } else if (-offsetY > VISIBLE_SHADOW_MIN_PX) { - borders.top.push(-offsetY); - } + function getRegionlessNodes(options) { + var regionlessNodes = findRegionlessElms(axe._tree[0], options).map(function(vNode) { + while (vNode.parent && !vNode.parent._hasRegionDescendant && vNode.parent.actualNode !== document.body) { + vNode = vNode.parent; + } + return vNode; + }).filter(function(vNode, index, array) { + return array.indexOf(vNode) === index; + }); + return regionlessNodes; + } + function findRegionlessElms(virtualNode, options) { + var node = virtualNode.actualNode; + if (get_role_default(virtualNode) === 'button' || isRegion(virtualNode, options) || [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) || _isSkipLink(virtualNode.actualNode) && get_element_by_reference_default(virtualNode.actualNode, 'href') || !_isVisibleToScreenReaders(node)) { + var vNode = virtualNode; + while (vNode) { + vNode._hasRegionDescendant = true; + vNode = vNode.parent; + } + if ([ 'iframe', 'frame' ].includes(virtualNode.props.nodeName)) { + return [ virtualNode ]; } - } catch (err) { - _iterator16.e(err); - } finally { - _iterator16.f(); + return []; + } else if (node !== document.body && has_content_default(node, true)) { + return [ virtualNode ]; + } else { + return virtualNode.children.filter(function(_ref107) { + var actualNode = _ref107.actualNode; + return actualNode.nodeType === 1; + }).map(function(vNode) { + return findRegionlessElms(vNode, options); + }).reduce(function(a2, b2) { + return a2.concat(b2); + }, []); } - return colorMap; } - function shadowGroupToColor(_ref105) { - var colorStr = _ref105.colorStr, sides = _ref105.sides, edgeCount = _ref105.edgeCount; - if (edgeCount !== 4) { - return null; - } - var strokeColor = new color_default(); - strokeColor.parseString(colorStr); - var density = 0; - var isSolid = true; - edges.forEach(function(edge) { - density += sides[edge].length / 4; - isSolid && (isSolid = sides[edge].every(function(offset) { - return offset > OPAQUE_STROKE_OFFSET_MIN_PX; - })); - }); - if (!isSolid) { - strokeColor.alpha = 1 - Math.pow(SHADOW_STROKE_ALPHA, density); + function isRegion(virtualNode, options) { + var node = virtualNode.actualNode; + var role = get_role_default(virtualNode); + var ariaLive = (node.getAttribute('aria-live') || '').toLowerCase().trim(); + var landmarkRoles2 = get_aria_roles_by_type_default('landmark'); + if ([ 'assertive', 'polite' ].includes(ariaLive) || implicitAriaLiveRoles.includes(role)) { + return true; } - return strokeColor; - } - function _parseTextShadows(textShadow) { - var current = { - pixels: [] - }; - var str = textShadow.trim(); - var shadows = [ current ]; - if (!str) { - return []; + if (landmarkRoles2.includes(role)) { + return true; } - while (str) { - var colorMatch = str.match(/^[a-z]+(\([^)]+\))?/i) || str.match(/^#[0-9a-f]+/i); - var pixelMatch = str.match(/^([0-9.-]+)px/i) || str.match(/^(0)/); - if (colorMatch) { - assert_default(!current.colorStr, 'Multiple colors identified in text-shadow: '.concat(textShadow)); - str = str.replace(colorMatch[0], '').trim(); - current.colorStr = colorMatch[0]; - } else if (pixelMatch) { - assert_default(current.pixels.length < 3, 'Too many pixel units in text-shadow: '.concat(textShadow)); - str = str.replace(pixelMatch[0], '').trim(); - var pixelUnit = parseFloat((pixelMatch[1][0] === '.' ? '0' : '') + pixelMatch[1]); - current.pixels.push(pixelUnit); - } else if (str[0] === ',') { - assert_default(current.pixels.length >= 2, 'Missing pixel value in text-shadow: '.concat(textShadow)); - current = { - pixels: [] - }; - shadows.push(current); - str = str.substr(1).trim(); - } else { - throw new Error('Unable to process text-shadows: '.concat(str)); - } + if (options.regionMatcher && matches_default2(virtualNode, options.regionMatcher)) { + return true; } - shadows.forEach(function(_ref106) { - var pixels = _ref106.pixels; - if (pixels.length === 2) { - pixels.push(0); - } - }); - return shadows; + return false; } - function _getTextShadowColors(node) { - var _ref107 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, minRatio = _ref107.minRatio, maxRatio = _ref107.maxRatio, ignoreEdgeCount = _ref107.ignoreEdgeCount; - var shadowColors = []; - var style = window.getComputedStyle(node); - var textShadow = style.getPropertyValue('text-shadow'); - if (textShadow === 'none') { - return shadowColors; - } - var fontSizeStr = style.getPropertyValue('font-size'); - var fontSize = parseInt(fontSizeStr); - assert_default(isNaN(fontSize) === false, 'Unable to determine font-size value '.concat(fontSizeStr)); - var thinShadows = []; - var shadows = _parseTextShadows(textShadow); - var _iterator17 = _createForOfIteratorHelper(shadows), _step17; - try { - for (_iterator17.s(); !(_step17 = _iterator17.n()).done; ) { - var shadow = _step17.value; - var colorStr = shadow.colorStr || style.getPropertyValue('color'); - var _shadow$pixels = _slicedToArray(shadow.pixels, 3), offsetX = _shadow$pixels[0], offsetY = _shadow$pixels[1], _shadow$pixels$ = _shadow$pixels[2], blurRadius = _shadow$pixels$ === void 0 ? 0 : _shadow$pixels$; - if (maxRatio && blurRadius >= fontSize * maxRatio) { - continue; - } - if (minRatio && blurRadius < fontSize * minRatio) { - thinShadows.push({ - colorStr: colorStr, - pixels: shadow.pixels - }); - continue; - } - if (thinShadows.length > 0) { - var _strokeColors = _getStrokeColorsFromShadows(thinShadows, { - ignoreEdgeCount: ignoreEdgeCount - }); - if (_strokeColors === null) { - return null; + function regionAfter(results) { + var iframeResults = results.filter(function(r) { + return r.data.isIframe; + }); + results.forEach(function(r) { + if (r.result || r.node.ancestry.length === 1) { + return; + } + var frameAncestry = r.node.ancestry.slice(0, -1); + var _iterator15 = _createForOfIteratorHelper(iframeResults), _step15; + try { + for (_iterator15.s(); !(_step15 = _iterator15.n()).done; ) { + var iframeResult = _step15.value; + if (_matchAncestry(frameAncestry, iframeResult.node.ancestry)) { + r.result = iframeResult.result; + break; } - shadowColors.push.apply(shadowColors, _toConsumableArray(_strokeColors)); - thinShadows.splice(0, thinShadows.length); } - var _color3 = textShadowColor({ - colorStr: colorStr, - offsetX: offsetX, - offsetY: offsetY, - blurRadius: blurRadius, - fontSize: fontSize - }); - shadowColors.push(_color3); + } catch (err) { + _iterator15.e(err); + } finally { + _iterator15.f(); } - } catch (err) { - _iterator17.e(err); - } finally { - _iterator17.f(); + }); + iframeResults.forEach(function(r) { + if (!r.result) { + r.result = true; + } + }); + return results; + } + var region_after_default = regionAfter; + function normalizeFontWeight(weight) { + switch (weight) { + case 'lighter': + return 100; + + case 'normal': + return 400; + + case 'bold': + return 700; + + case 'bolder': + return 900; } - if (thinShadows.length > 0) { - var strokeColors = _getStrokeColorsFromShadows(thinShadows, { - ignoreEdgeCount: ignoreEdgeCount - }); - if (strokeColors === null) { - return null; + weight = parseInt(weight); + return !isNaN(weight) ? weight : 400; + } + function getTextContainer(elm) { + var nextNode = elm; + var outerText = elm.textContent.trim(); + var innerText = outerText; + while (innerText === outerText && nextNode !== void 0) { + var _i30 = -1; + elm = nextNode; + if (elm.children.length === 0) { + return elm; } - shadowColors.push.apply(shadowColors, _toConsumableArray(strokeColors)); + do { + _i30++; + innerText = elm.children[_i30].textContent.trim(); + } while (innerText === '' && _i30 + 1 < elm.children.length); + nextNode = elm.children[_i30]; } - return shadowColors; + return elm; } - function textShadowColor(_ref108) { - var colorStr = _ref108.colorStr, offsetX = _ref108.offsetX, offsetY = _ref108.offsetY, blurRadius = _ref108.blurRadius, fontSize = _ref108.fontSize; - if (offsetX > blurRadius || offsetY > blurRadius) { - return new color_default(0, 0, 0, 0); + function getStyleValues(node) { + var style = window.getComputedStyle(getTextContainer(node)); + return { + fontWeight: normalizeFontWeight(style.getPropertyValue('font-weight')), + fontSize: parseInt(style.getPropertyValue('font-size')), + isItalic: style.getPropertyValue('font-style') === 'italic' + }; + } + function isHeaderStyle(styleA, styleB, margins) { + return margins.reduce(function(out, margin) { + return out || (!margin.size || styleA.fontSize / margin.size > styleB.fontSize) && (!margin.weight || styleA.fontWeight - margin.weight > styleB.fontWeight) && (!margin.italic || styleA.isItalic && !styleB.isItalic); + }, false); + } + function pAsHeadingEvaluate(node, options, virtualNode) { + var siblings = Array.from(node.parentNode.children); + var currentIndex = siblings.indexOf(node); + options = options || {}; + var margins = options.margins || []; + var nextSibling = siblings.slice(currentIndex + 1).find(function(elm) { + return elm.nodeName.toUpperCase() === 'P'; + }); + var prevSibling = siblings.slice(0, currentIndex).reverse().find(function(elm) { + return elm.nodeName.toUpperCase() === 'P'; + }); + var currStyle = getStyleValues(node); + var nextStyle = nextSibling ? getStyleValues(nextSibling) : null; + var prevStyle = prevSibling ? getStyleValues(prevSibling) : null; + var optionsPassLength = options.passLength; + var optionsFailLength = options.failLength; + var headingLength = node.textContent.trim().length; + var paragraphLength = nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.textContent.trim().length; + if (headingLength > paragraphLength * optionsPassLength) { + return true; } - var shadowColor = new color_default(); - shadowColor.parseString(colorStr); - shadowColor.alpha *= blurRadiusToAlpha(blurRadius, fontSize); - return shadowColor; + if (!nextStyle || !isHeaderStyle(currStyle, nextStyle, margins)) { + return true; + } + var blockquote = find_up_virtual_default(virtualNode, 'blockquote'); + if (blockquote && blockquote.nodeName.toUpperCase() === 'BLOCKQUOTE') { + return void 0; + } + if (prevStyle && !isHeaderStyle(currStyle, prevStyle, margins)) { + return void 0; + } + if (headingLength > paragraphLength * optionsFailLength) { + return void 0; + } + return false; } - function blurRadiusToAlpha(blurRadius, fontSize) { - if (blurRadius === 0) { - return 1; + var p_as_heading_evaluate_default = pAsHeadingEvaluate; + var separatorRegex = /[;,\s]/; + var validRedirectNumRegex = /^[0-9.]+$/; + function metaRefreshEvaluate(node, options, virtualNode) { + var _ref108 = options || {}, minDelay = _ref108.minDelay, maxDelay = _ref108.maxDelay; + var content = (virtualNode.attr('content') || '').trim(); + var _content$split = content.split(separatorRegex), _content$split2 = _slicedToArray(_content$split, 1), redirectStr = _content$split2[0]; + if (!redirectStr.match(validRedirectNumRegex)) { + return true; + } + var redirectDelay = parseFloat(redirectStr); + this.data({ + redirectDelay: redirectDelay + }); + if (typeof minDelay === 'number' && redirectDelay <= options.minDelay) { + return true; + } + if (typeof maxDelay === 'number' && redirectDelay > options.maxDelay) { + return true; } - var relativeBlur = blurRadius / fontSize; - return .185 / (relativeBlur + .4); + return false; } - function _getStackingContext(elm, elmStack) { - var _elmStack; - var virtualNode = get_node_from_tree_default(elm); - if (virtualNode._stackingContext) { - return virtualNode._stackingContext; - } - var stackingContext = []; - var contextMap = new Map(); - elmStack = (_elmStack = elmStack) !== null && _elmStack !== void 0 ? _elmStack : _getBackgroundStack(elm); - elmStack.forEach(function(bgElm) { - var _stackingOrder2; - var bgVNode = get_node_from_tree_default(bgElm); - var bgColor = getOwnBackgroundColor2(bgVNode); - var stackingOrder = bgVNode._stackingOrder.filter(function(_ref109) { - var vNode = _ref109.vNode; - return !!vNode; - }); - stackingOrder.forEach(function(_ref110, index) { - var _stackingOrder; - var vNode = _ref110.vNode; - var ancestorVNode2 = (_stackingOrder = stackingOrder[index - 1]) === null || _stackingOrder === void 0 ? void 0 : _stackingOrder.vNode; - var context2 = addToStackingContext(contextMap, vNode, ancestorVNode2); - if (index === 0 && !contextMap.get(vNode)) { - stackingContext.unshift(context2); - } - contextMap.set(vNode, context2); - }); - var ancestorVNode = (_stackingOrder2 = stackingOrder[stackingOrder.length - 1]) === null || _stackingOrder2 === void 0 ? void 0 : _stackingOrder2.vNode; - var context = addToStackingContext(contextMap, bgVNode, ancestorVNode); - if (!stackingOrder.length) { - stackingContext.unshift(context); - } - context.bgColor = bgColor; + function internalLinkPresentEvaluate(node, options, virtualNode) { + var links = query_selector_all_default(virtualNode, 'a[href]'); + return links.some(function(vLink) { + return /^#[^/!]/.test(vLink.attr('href')); }); - virtualNode._stackingContext = stackingContext; - return stackingContext; } - function _stackingContextToColor(context) { - var _context$descendants; - if (!((_context$descendants = context.descendants) !== null && _context$descendants !== void 0 && _context$descendants.length)) { - var color2 = context.bgColor; - color2.alpha *= context.opacity; - return { - color: color2, - blendMode: context.blendMode - }; + var internal_link_present_evaluate_default = internalLinkPresentEvaluate; + var commons_exports = {}; + __export(commons_exports, { + aria: function aria() { + return aria_exports; + }, + color: function color() { + return color_exports; + }, + dom: function dom() { + return dom_exports; + }, + forms: function forms() { + return forms_exports; + }, + matches: function matches() { + return matches_default2; + }, + math: function math() { + return math_exports; + }, + standards: function standards() { + return standards_exports; + }, + table: function table() { + return table_exports; + }, + text: function text() { + return text_exports; + }, + utils: function utils() { + return utils_exports; } - var sourceColor = context.descendants.reduce(reduceToColor, createStackingContext2()); - var color = flatten_colors_default(sourceColor, context.bgColor, context.descendants[0].blendMode); - color.alpha *= context.opacity; - return { - color: color, - blendMode: context.blendMode - }; - } - function reduceToColor(backdropContext, sourceContext) { - var backdrop; - if (backdropContext instanceof color_default) { - backdrop = backdropContext; - } else { - backdrop = _stackingContextToColor(backdropContext).color; + }); + var color_exports = {}; + __export(color_exports, { + Color: function Color() { + return color_default; + }, + centerPointOfRect: function centerPointOfRect() { + return center_point_of_rect_default; + }, + elementHasImage: function elementHasImage() { + return element_has_image_default; + }, + elementIsDistinct: function elementIsDistinct() { + return element_is_distinct_default; + }, + filteredRectStack: function filteredRectStack() { + return filtered_rect_stack_default; + }, + flattenColors: function flattenColors() { + return _flattenColors; + }, + flattenShadowColors: function flattenShadowColors() { + return _flattenShadowColors; + }, + getBackgroundColor: function getBackgroundColor() { + return _getBackgroundColor2; + }, + getBackgroundStack: function getBackgroundStack() { + return _getBackgroundStack; + }, + getContrast: function getContrast() { + return get_contrast_default; + }, + getForegroundColor: function getForegroundColor() { + return _getForegroundColor; + }, + getOwnBackgroundColor: function getOwnBackgroundColor() { + return get_own_background_color_default; + }, + getRectStack: function getRectStack() { + return get_rect_stack_default; + }, + getStackingContext: function getStackingContext() { + return _getStackingContext; + }, + getStrokeColorsFromShadows: function getStrokeColorsFromShadows() { + return _getStrokeColorsFromShadows; + }, + getTextShadowColors: function getTextShadowColors() { + return _getTextShadowColors; + }, + hasValidContrastRatio: function hasValidContrastRatio() { + return has_valid_contrast_ratio_default; + }, + incompleteData: function incompleteData() { + return incomplete_data_default; + }, + parseTextShadows: function parseTextShadows() { + return _parseTextShadows; + }, + stackingContextToColor: function stackingContextToColor() { + return _stackingContextToColor; } - var sourceColor = _stackingContextToColor(sourceContext).color; - return flatten_colors_default(sourceColor, backdrop, sourceContext.blendMode); - } - function createStackingContext2(vNode, ancestorContext) { - var _vNode$getComputedSty; + }); + function centerPointOfRect(rect) { + if (rect.left > window.innerWidth) { + return void 0; + } + if (rect.top > window.innerHeight) { + return void 0; + } + var x = Math.min(Math.ceil(rect.left + rect.width / 2), window.innerWidth - 1); + var y = Math.min(Math.ceil(rect.top + rect.height / 2), window.innerHeight - 1); return { - vNode: vNode, - ancestor: ancestorContext, - opacity: parseFloat((_vNode$getComputedSty = vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('opacity')) !== null && _vNode$getComputedSty !== void 0 ? _vNode$getComputedSty : 1), - bgColor: new color_default(0, 0, 0, 0), - blendMode: normalizeBlendMode(vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('mix-blend-mode')), - descendants: [] + x: x, + y: y }; } - function normalizeBlendMode(blendmode) { - return !!blendmode ? blendmode : void 0; + var center_point_of_rect_default = centerPointOfRect; + function _getFonts(style) { + return style.getPropertyValue('font-family').split(/[,;]/g).map(function(font) { + return font.trim().toLowerCase(); + }); } - function addToStackingContext(contextMap, vNode, ancestorVNode) { - var _contextMap$get; - var ancestorContext = contextMap.get(ancestorVNode); - var context = (_contextMap$get = contextMap.get(vNode)) !== null && _contextMap$get !== void 0 ? _contextMap$get : createStackingContext2(vNode, ancestorContext); - if (ancestorContext && ancestorVNode !== vNode && !ancestorContext.descendants.includes(context)) { - ancestorContext.descendants.unshift(context); + function elementIsDistinct(node, ancestorNode) { + var nodeStyle = window.getComputedStyle(node); + if (nodeStyle.getPropertyValue('background-image') !== 'none') { + return true; } - return context; - } - function getOwnBackgroundColor2(vNode) { - var bgColor = new color_default(); - bgColor.parseString(vNode.getComputedStylePropertyValue('background-color')); - return bgColor; - } - function _getBackgroundColor2(elm) { - var bgElms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - var shadowOutlineEmMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .1; - var vNode = get_node_from_tree_default(elm); - var bgColorCache = vNode._cache.getBackgroundColor; - if (bgColorCache) { - bgElms.push.apply(bgElms, _toConsumableArray(bgColorCache.bgElms)); - incomplete_data_default.set('bgColor', bgColorCache.incompleteData); - return bgColorCache.bgColor; + var hasBorder = [ 'border-bottom', 'border-top', 'outline' ].reduce(function(result, edge) { + var borderClr = new color_default(); + borderClr.parseString(nodeStyle.getPropertyValue(edge + '-color')); + return result || nodeStyle.getPropertyValue(edge + '-style') !== 'none' && parseFloat(nodeStyle.getPropertyValue(edge + '-width')) > 0 && borderClr.alpha !== 0; + }, false); + if (hasBorder) { + return true; } - var bgColor = _getBackgroundColor(elm, bgElms, shadowOutlineEmMax); - vNode._cache.getBackgroundColor = { - bgColor: bgColor, - bgElms: bgElms, - incompleteData: incomplete_data_default.get('bgColor') - }; - return bgColor; - } - function _getBackgroundColor(elm, bgElms, shadowOutlineEmMax) { - var _getTextShadowColors2, _bgColors; - var elmStack = _getBackgroundStack(elm); - if (!elmStack) { - return null; + var parentStyle = window.getComputedStyle(ancestorNode); + if (_getFonts(nodeStyle)[0] !== _getFonts(parentStyle)[0]) { + return true; } - var textRects = get_visible_child_text_rects_default(elm); - var bgColors = (_getTextShadowColors2 = _getTextShadowColors(elm, { - minRatio: shadowOutlineEmMax, - ignoreEdgeCount: true - })) !== null && _getTextShadowColors2 !== void 0 ? _getTextShadowColors2 : []; - if (bgColors.length) { - bgColors = [ { - color: bgColors.reduce(_flattenShadowColors) - } ]; + var hasStyle = [ 'text-decoration-line', 'text-decoration-style', 'font-weight', 'font-style', 'font-size' ].reduce(function(result, cssProp) { + return result || nodeStyle.getPropertyValue(cssProp) !== parentStyle.getPropertyValue(cssProp); + }, false); + var tDec = nodeStyle.getPropertyValue('text-decoration'); + if (tDec.split(' ').length < 3) { + hasStyle = hasStyle || tDec !== parentStyle.getPropertyValue('text-decoration'); + } + return hasStyle; + } + var element_is_distinct_default = elementIsDistinct; + function getRectStack2(elm) { + var boundingStack = get_element_stack_default(elm); + var filteredArr = get_text_element_stack_default(elm); + if (!filteredArr || filteredArr.length <= 1) { + return [ boundingStack ]; } - for (var _i31 = 0; _i31 < elmStack.length; _i31++) { - var bgElm = elmStack[_i31]; - var bgElmStyle = window.getComputedStyle(bgElm); - if (element_has_image_default(bgElm, bgElmStyle)) { - bgElms.push(bgElm); - return null; - } - var bgColor = get_own_background_color_default(bgElmStyle); - if (bgColor.alpha === 0) { - continue; - } - if (bgElmStyle.getPropertyValue('display') !== 'inline' && !fullyEncompasses(bgElm, textRects)) { - bgElms.push(bgElm); - incomplete_data_default.set('bgColor', 'elmPartiallyObscured'); + if (filteredArr.some(function(stack) { + return stack === void 0; + })) { + return null; + } + filteredArr.splice(0, 0, boundingStack); + return filteredArr; + } + var get_rect_stack_default = getRectStack2; + function filteredRectStack(elm) { + var rectStack = get_rect_stack_default(elm); + if (rectStack && rectStack.length === 1) { + return rectStack[0]; + } + if (rectStack && rectStack.length > 1) { + var boundingStack = rectStack.shift(); + var isSame; + rectStack.forEach(function(rectList, index) { + if (index === 0) { + return; + } + var rectA = rectStack[index - 1], rectB = rectStack[index]; + isSame = rectA.every(function(element, elementIndex) { + return element === rectB[elementIndex]; + }) || boundingStack.includes(elm); + }); + if (!isSame) { + incomplete_data_default.set('bgColor', 'elmPartiallyObscuring'); return null; } - bgElms.push(bgElm); - if (bgColor.alpha === 1) { - break; + return rectStack[0]; + } + incomplete_data_default.set('bgColor', 'outsideViewport'); + return null; + } + var filtered_rect_stack_default = filteredRectStack; + var nonSeparableBlendModes = [ 'hue', 'saturation', 'color', 'luminosity' ]; + var blendFunctions = { + normal: function normal(Cb, Cs) { + return Cs; + }, + multiply: function multiply(Cb, Cs) { + return Cs * Cb; + }, + screen: function screen(Cb, Cs) { + return Cb + Cs - Cb * Cs; + }, + overlay: function overlay(Cb, Cs) { + return this['hard-light'](Cs, Cb); + }, + darken: function darken(Cb, Cs) { + return Math.min(Cb, Cs); + }, + lighten: function lighten(Cb, Cs) { + return Math.max(Cb, Cs); + }, + 'color-dodge': function colorDodge(Cb, Cs) { + return Cb === 0 ? 0 : Cs === 1 ? 1 : Math.min(1, Cb / (1 - Cs)); + }, + 'color-burn': function colorBurn(Cb, Cs) { + return Cb === 1 ? 1 : Cs === 0 ? 0 : 1 - Math.min(1, (1 - Cb) / Cs); + }, + 'hard-light': function hardLight(Cb, Cs) { + return Cs <= .5 ? this.multiply(Cb, 2 * Cs) : this.screen(Cb, 2 * Cs - 1); + }, + 'soft-light': function softLight(Cb, Cs) { + if (Cs <= .5) { + return Cb - (1 - 2 * Cs) * Cb * (1 - Cb); + } else { + var D = Cb <= .25 ? ((16 * Cb - 12) * Cb + 4) * Cb : Math.sqrt(Cb); + return Cb + (2 * Cs - 1) * (D - Cb); } + }, + difference: function difference(Cb, Cs) { + return Math.abs(Cb - Cs); + }, + exclusion: function exclusion(Cb, Cs) { + return Cb + Cs - 2 * Cb * Cs; + }, + hue: function hue(Cb, Cs) { + return Cs.setSaturation(Cb.getSaturation()).setLuminosity(Cb.getLuminosity()); + }, + saturation: function saturation(Cb, Cs) { + return Cb.setSaturation(Cs.getSaturation()).setLuminosity(Cb.getLuminosity()); + }, + color: function color(Cb, Cs) { + return Cs.setLuminosity(Cb.getLuminosity()); + }, + luminosity: function luminosity(Cb, Cs) { + return Cb.setLuminosity(Cs.getLuminosity()); } - var stackingContext = _getStackingContext(elm, elmStack); - bgColors = stackingContext.map(_stackingContextToColor).concat(bgColors); - var pageBgs = getPageBackgroundColors(elm, elmStack.includes(document.body)); - (_bgColors = bgColors).unshift.apply(_bgColors, _toConsumableArray(pageBgs)); - if (bgColors.length === 0) { - return new color_default(255, 255, 255, 1); + }; + function _flattenColors(sourceColor, backdrop) { + var blendMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'normal'; + var blendingResult = blend(backdrop, sourceColor, blendMode); + var r = simpleAlphaCompositing(sourceColor.red, sourceColor.alpha, backdrop.red, backdrop.alpha, blendingResult.r * 255); + var g2 = simpleAlphaCompositing(sourceColor.green, sourceColor.alpha, backdrop.green, backdrop.alpha, blendingResult.g * 255); + var b2 = simpleAlphaCompositing(sourceColor.blue, sourceColor.alpha, backdrop.blue, backdrop.alpha, blendingResult.b * 255); + var \u03b1o = clamp3(sourceColor.alpha + backdrop.alpha * (1 - sourceColor.alpha), 0, 1); + if (\u03b1o === 0) { + return new color_default(r, g2, b2, \u03b1o); } - var blendedColor = bgColors.reduce(function(bgColor, fgColor) { - return flatten_colors_default(fgColor.color, bgColor.color instanceof color_default ? bgColor.color : bgColor, fgColor.blendMode); - }); - return flatten_colors_default(blendedColor.color instanceof color_default ? blendedColor.color : blendedColor, new color_default(255, 255, 255, 1)); + var Cr = Math.round(r / \u03b1o); + var Cg = Math.round(g2 / \u03b1o); + var Cb = Math.round(b2 / \u03b1o); + return new color_default(Cr, Cg, Cb, \u03b1o); } - function fullyEncompasses(node, rects) { - rects = Array.isArray(rects) ? rects : [ rects ]; - var nodeRect = node.getBoundingClientRect(); - var right = nodeRect.right, bottom = nodeRect.bottom; - var style = window.getComputedStyle(node); - var overflow = style.getPropertyValue('overflow'); - if ([ 'scroll', 'auto' ].includes(overflow) || node instanceof window.HTMLHtmlElement) { - right = nodeRect.left + node.scrollWidth; - bottom = nodeRect.top + node.scrollHeight; + function simpleAlphaCompositing(Cs, \u03b1s, Cb, \u03b1b, blendingResult) { + return \u03b1s * (1 - \u03b1b) * Cs + \u03b1s * \u03b1b * blendingResult + (1 - \u03b1s) * \u03b1b * Cb; + } + function clamp3(value, min, max2) { + return Math.min(Math.max(min, value), max2); + } + function blend(Cb, Cs, blendMode) { + if (nonSeparableBlendModes.includes(blendMode)) { + return blendFunctions[blendMode](Cb, Cs); } - return rects.every(function(rect) { - return rect.top >= nodeRect.top && rect.bottom <= bottom && rect.left >= nodeRect.left && rect.right <= right; + var C = new color_default(); + [ 'r', 'g', 'b' ].forEach(function(channel) { + C[channel] = blendFunctions[blendMode](Cb[channel], Cs[channel]); }); + return C; } - function normalizeBlendMode2(blendmode) { - return !!blendmode ? blendmode : void 0; + function _flattenShadowColors(fgColor, bgColor) { + var alpha = fgColor.alpha; + var r = (1 - alpha) * bgColor.red + alpha * fgColor.red; + var g2 = (1 - alpha) * bgColor.green + alpha * fgColor.green; + var b2 = (1 - alpha) * bgColor.blue + alpha * fgColor.blue; + var a2 = fgColor.alpha + bgColor.alpha * (1 - fgColor.alpha); + return new color_default(r, g2, b2, a2); } - function getPageBackgroundColors(elm, stackContainsBody) { - var pageColors = []; - if (!stackContainsBody) { - var html = document.documentElement; - var body = document.body; - var htmlStyle = window.getComputedStyle(html); - var bodyStyle = window.getComputedStyle(body); - var htmlBgColor = get_own_background_color_default(htmlStyle); - var bodyBgColor = get_own_background_color_default(bodyStyle); - var bodyBgColorApplies = bodyBgColor.alpha !== 0 && fullyEncompasses(body, elm.getBoundingClientRect()); - if (bodyBgColor.alpha !== 0 && htmlBgColor.alpha === 0 || bodyBgColorApplies && bodyBgColor.alpha !== 1) { - pageColors.unshift({ - color: bodyBgColor, - blendMode: normalizeBlendMode2(bodyStyle.getPropertyValue('mix-blend-mode')) - }); + function _getBackgroundStack(node) { + var stacks = get_text_element_stack_default(node).map(function(stack) { + stack = reduce_to_elements_below_floating_default(stack, node); + stack = sortPageBackground(stack); + return stack; + }); + for (var index = 0; index < stacks.length; index++) { + var stack = stacks[index]; + if (stack[0] !== node) { + incomplete_data_default.set('bgColor', 'bgOverlap'); + return null; } - if (htmlBgColor.alpha !== 0 && (!bodyBgColorApplies || bodyBgColorApplies && bodyBgColor.alpha !== 1)) { - pageColors.unshift({ - color: htmlBgColor, - blendMode: normalizeBlendMode2(htmlStyle.getPropertyValue('mix-blend-mode')) - }); + if (index !== 0 && !shallowArraysEqual(stack, stacks[0])) { + incomplete_data_default.set('bgColor', 'elmPartiallyObscuring'); + return null; } } - return pageColors; - } - function getContrast(bgColor, fgColor) { - if (!fgColor || !bgColor) { - return null; - } - if (fgColor.alpha < 1) { - fgColor = flatten_colors_default(fgColor, bgColor); - } - var bL = bgColor.getRelativeLuminance(); - var fL = fgColor.getRelativeLuminance(); - return (Math.max(fL, bL) + .05) / (Math.min(fL, bL) + .05); + return stacks[0] || null; } - var get_contrast_default = getContrast; - function _getForegroundColor(node, _, bgColor) { - var _bgColor; - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; - var nodeStyle = window.getComputedStyle(node); - var colorStack = [ function() { - return getStrokeColor(nodeStyle, options); - }, function() { - return getTextColor(nodeStyle); - }, function() { - return _getTextShadowColors(node, { - minRatio: 0 - }); - } ]; - var fgColors = []; - for (var _i32 = 0, _colorStack = colorStack; _i32 < _colorStack.length; _i32++) { - var colorFn = _colorStack[_i32]; - var _color4 = colorFn(); - if (!_color4) { - continue; + function sortPageBackground(elmStack) { + var bodyIndex = elmStack.indexOf(document.body); + var bgNodes = elmStack; + var htmlBgColor = get_own_background_color_default(window.getComputedStyle(document.documentElement)); + if (bodyIndex > 1 && htmlBgColor.alpha === 0 && !element_has_image_default(document.documentElement)) { + if (bodyIndex > 1) { + bgNodes.splice(bodyIndex, 1); + bgNodes.push(document.body); } - fgColors = fgColors.concat(_color4); - if (_color4.alpha === 1) { - break; + var htmlIndex = bgNodes.indexOf(document.documentElement); + if (htmlIndex > 0) { + bgNodes.splice(htmlIndex, 1); + bgNodes.push(document.documentElement); } } - var fgColor = fgColors.reduce(function(source, backdrop) { - return flatten_colors_default(source, backdrop); - }); - (_bgColor = bgColor) !== null && _bgColor !== void 0 ? _bgColor : bgColor = _getBackgroundColor2(node, []); - if (bgColor === null) { - var reason = incomplete_data_default.get('bgColor'); - incomplete_data_default.set('fgColor', reason); - return null; - } - var stackingContexts = _getStackingContext(node); - var context = findNodeInContexts(stackingContexts, node); - return flatten_colors_default(calculateBlendedForegroundColor(fgColor, context, stackingContexts), new color_default(255, 255, 255, 1)); - } - function getTextColor(nodeStyle) { - return new color_default().parseString(nodeStyle.getPropertyValue('-webkit-text-fill-color') || nodeStyle.getPropertyValue('color')); + return bgNodes; } - function getStrokeColor(nodeStyle, _ref111) { - var _ref111$textStrokeEmM = _ref111.textStrokeEmMin, textStrokeEmMin = _ref111$textStrokeEmM === void 0 ? 0 : _ref111$textStrokeEmM; - var strokeWidth = parseFloat(nodeStyle.getPropertyValue('-webkit-text-stroke-width')); - if (strokeWidth === 0) { - return null; + function shallowArraysEqual(a2, b2) { + if (a2 === b2) { + return true; } - var fontSize = nodeStyle.getPropertyValue('font-size'); - var relativeStrokeWidth = strokeWidth / parseFloat(fontSize); - if (isNaN(relativeStrokeWidth) || relativeStrokeWidth < textStrokeEmMin) { - return null; + if (a2 === null || b2 === null) { + return false; } - var strokeColor = nodeStyle.getPropertyValue('-webkit-text-stroke-color'); - return new color_default().parseString(strokeColor); - } - function calculateBlendedForegroundColor(fgColor, context, stackingContexts) { - while (context) { - var _context$ancestor; - if (context.opacity === 1 && context.ancestor) { - context = context.ancestor; - continue; - } - fgColor.alpha *= context.opacity; - var stack = ((_context$ancestor = context.ancestor) === null || _context$ancestor === void 0 ? void 0 : _context$ancestor.descendants) || stackingContexts; - if (context.opacity !== 1) { - stack = stack.slice(0, stack.indexOf(context)); - } - var bgColors = stack.map(_stackingContextToColor); - if (!bgColors.length) { - context = context.ancestor; - continue; + if (a2.length !== b2.length) { + return false; + } + for (var i = 0; i < a2.length; ++i) { + if (a2[i] !== b2[i]) { + return false; } - var bgColor = bgColors.reduce(function(backdrop, source) { - return flatten_colors_default(source.color, backdrop.color instanceof color_default ? backdrop.color : backdrop); - }, { - color: new color_default(0, 0, 0, 0), - blendMode: 'normal' - }); - fgColor = flatten_colors_default(fgColor, bgColor); - context = context.ancestor; } - return fgColor; + return true; } - function findNodeInContexts(contexts, node) { - var _iterator18 = _createForOfIteratorHelper(contexts), _step18; + var SHADOW_STROKE_ALPHA = .54; + var VISIBLE_SHADOW_MIN_PX = .5; + var OPAQUE_STROKE_OFFSET_MIN_PX = 1.5; + var edges = [ 'top', 'right', 'bottom', 'left' ]; + function _getStrokeColorsFromShadows(parsedShadows) { + var _ref109 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref109$ignoreEdgeCou = _ref109.ignoreEdgeCount, ignoreEdgeCount = _ref109$ignoreEdgeCou === void 0 ? false : _ref109$ignoreEdgeCou; + var shadowMap = getShadowColorsMap(parsedShadows); + var shadowsByColor = Object.entries(shadowMap).map(function(_ref110) { + var _ref111 = _slicedToArray(_ref110, 2), colorStr = _ref111[0], sides = _ref111[1]; + var edgeCount = edges.filter(function(side) { + return sides[side].length !== 0; + }).length; + return { + colorStr: colorStr, + sides: sides, + edgeCount: edgeCount + }; + }); + if (!ignoreEdgeCount && shadowsByColor.some(function(_ref112) { + var edgeCount = _ref112.edgeCount; + return edgeCount > 1 && edgeCount < 4; + })) { + return null; + } + return shadowsByColor.map(shadowGroupToColor).filter(function(shadow) { + return shadow !== null; + }); + } + function getShadowColorsMap(parsedShadows) { + var colorMap = {}; + var _iterator16 = _createForOfIteratorHelper(parsedShadows), _step16; try { - for (_iterator18.s(); !(_step18 = _iterator18.n()).done; ) { - var _context$vNode; - var context = _step18.value; - if (((_context$vNode = context.vNode) === null || _context$vNode === void 0 ? void 0 : _context$vNode.actualNode) === node) { - return context; + for (_iterator16.s(); !(_step16 = _iterator16.n()).done; ) { + var _colorMap$colorStr; + var _step16$value = _step16.value, colorStr = _step16$value.colorStr, pixels = _step16$value.pixels; + (_colorMap$colorStr = colorMap[colorStr]) !== null && _colorMap$colorStr !== void 0 ? _colorMap$colorStr : colorMap[colorStr] = { + top: [], + right: [], + bottom: [], + left: [] + }; + var borders = colorMap[colorStr]; + var _pixels = _slicedToArray(pixels, 2), offsetX = _pixels[0], offsetY = _pixels[1]; + if (offsetX > VISIBLE_SHADOW_MIN_PX) { + borders.right.push(offsetX); + } else if (-offsetX > VISIBLE_SHADOW_MIN_PX) { + borders.left.push(-offsetX); } - var found = findNodeInContexts(context.descendants, node); - if (found) { - return found; + if (offsetY > VISIBLE_SHADOW_MIN_PX) { + borders.bottom.push(offsetY); + } else if (-offsetY > VISIBLE_SHADOW_MIN_PX) { + borders.top.push(-offsetY); } } } catch (err) { - _iterator18.e(err); + _iterator16.e(err); } finally { - _iterator18.f(); + _iterator16.f(); } + return colorMap; } - function hasValidContrastRatio(bg, fg, fontSize, isBold) { - var contrast2 = get_contrast_default(bg, fg); - var isSmallFont = isBold && Math.ceil(fontSize * 72) / 96 < 14 || !isBold && Math.ceil(fontSize * 72) / 96 < 18; - var expectedContrastRatio = isSmallFont ? 4.5 : 3; - return { - isValid: contrast2 > expectedContrastRatio, - contrastRatio: contrast2, - expectedContrastRatio: expectedContrastRatio - }; - } - var has_valid_contrast_ratio_default = hasValidContrastRatio; - function colorContrastEvaluate(node, options, virtualNode) { - var ignoreUnicode = options.ignoreUnicode, ignoreLength = options.ignoreLength, ignorePseudo = options.ignorePseudo, boldValue = options.boldValue, boldTextPt = options.boldTextPt, largeTextPt = options.largeTextPt, contrastRatio = options.contrastRatio, shadowOutlineEmMax = options.shadowOutlineEmMax, pseudoSizeThreshold = options.pseudoSizeThreshold; - if (!_isVisibleOnScreen(node)) { - this.data({ - messageKey: 'hidden' - }); - return true; - } - var visibleText = visible_virtual_default(virtualNode, false, true); - if (ignoreUnicode && textIsEmojis(visibleText)) { - this.data({ - messageKey: 'nonBmp' - }); - return void 0; + function shadowGroupToColor(_ref113) { + var colorStr = _ref113.colorStr, sides = _ref113.sides, edgeCount = _ref113.edgeCount; + if (edgeCount !== 4) { + return null; } - var nodeStyle = window.getComputedStyle(node); - var fontSize = parseFloat(nodeStyle.getPropertyValue('font-size')); - var fontWeight = nodeStyle.getPropertyValue('font-weight'); - var bold = parseFloat(fontWeight) >= boldValue || fontWeight === 'bold'; - var ptSize = Math.ceil(fontSize * 72) / 96; - var isSmallFont = bold && ptSize < boldTextPt || !bold && ptSize < largeTextPt; - var _ref112 = isSmallFont ? contrastRatio.normal : contrastRatio.large, expected = _ref112.expected, minThreshold = _ref112.minThreshold, maxThreshold = _ref112.maxThreshold; - var pseudoElm = findPseudoElement(virtualNode, { - ignorePseudo: ignorePseudo, - pseudoSizeThreshold: pseudoSizeThreshold + var strokeColor = new color_default(); + strokeColor.parseString(colorStr); + var density = 0; + var isSolid = true; + edges.forEach(function(edge) { + density += sides[edge].length / 4; + isSolid && (isSolid = sides[edge].every(function(offset) { + return offset > OPAQUE_STROKE_OFFSET_MIN_PX; + })); }); - if (pseudoElm) { - this.data({ - fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'), - fontWeight: bold ? 'bold' : 'normal', - messageKey: 'pseudoContent', - expectedContrastRatio: expected + ':1' - }); - this.relatedNodes(pseudoElm.actualNode); - return void 0; + if (!isSolid) { + strokeColor.alpha = 1 - Math.pow(SHADOW_STROKE_ALPHA, density); } - var shadowColors = _getTextShadowColors(node, { - minRatio: .001, - maxRatio: shadowOutlineEmMax - }); - if (shadowColors === null) { - this.data({ - messageKey: 'complexTextShadows' - }); - return void 0; + return strokeColor; + } + function _parseTextShadows(textShadow) { + var current = { + pixels: [] + }; + var str = textShadow.trim(); + var shadows = [ current ]; + if (!str) { + return []; } - var bgNodes = []; - var bgColor = _getBackgroundColor2(node, bgNodes, shadowOutlineEmMax); - var fgColor = _getForegroundColor(node, false, bgColor, options); - var contrast2 = null; - var contrastContributor = null; - var shadowColor = null; - if (shadowColors.length === 0) { - contrast2 = get_contrast_default(bgColor, fgColor); - } else if (fgColor && bgColor) { - shadowColor = [].concat(_toConsumableArray(shadowColors), [ bgColor ]).reduce(_flattenShadowColors); - var fgBgContrast = get_contrast_default(bgColor, fgColor); - var bgShContrast = get_contrast_default(bgColor, shadowColor); - var fgShContrast = get_contrast_default(shadowColor, fgColor); - contrast2 = Math.max(fgBgContrast, bgShContrast, fgShContrast); - if (contrast2 !== fgBgContrast) { - contrastContributor = bgShContrast > fgShContrast ? 'shadowOnBgColor' : 'fgOnShadowColor'; + while (str) { + var colorMatch = str.match(/^[a-z]+(\([^)]+\))?/i) || str.match(/^#[0-9a-f]+/i); + var pixelMatch = str.match(/^([0-9.-]+)px/i) || str.match(/^(0)/); + if (colorMatch) { + assert_default(!current.colorStr, 'Multiple colors identified in text-shadow: '.concat(textShadow)); + str = str.replace(colorMatch[0], '').trim(); + current.colorStr = colorMatch[0]; + } else if (pixelMatch) { + assert_default(current.pixels.length < 3, 'Too many pixel units in text-shadow: '.concat(textShadow)); + str = str.replace(pixelMatch[0], '').trim(); + var pixelUnit = parseFloat((pixelMatch[1][0] === '.' ? '0' : '') + pixelMatch[1]); + current.pixels.push(pixelUnit); + } else if (str[0] === ',') { + assert_default(current.pixels.length >= 2, 'Missing pixel value in text-shadow: '.concat(textShadow)); + current = { + pixels: [] + }; + shadows.push(current); + str = str.substr(1).trim(); + } else { + throw new Error('Unable to process text-shadows: '.concat(str)); } } - var isValid = contrast2 > expected; - if (typeof minThreshold === 'number' && (typeof contrast2 !== 'number' || contrast2 < minThreshold) || typeof maxThreshold === 'number' && (typeof contrast2 !== 'number' || contrast2 > maxThreshold)) { - this.data({ - contrastRatio: contrast2 - }); - return true; - } - var truncatedResult = Math.floor(contrast2 * 100) / 100; - var missing; - if (bgColor === null) { - missing = incomplete_data_default.get('bgColor'); - } else if (!isValid) { - missing = contrastContributor; - } - var equalRatio = truncatedResult === 1; - var shortTextContent = visibleText.length === 1; - if (equalRatio) { - missing = incomplete_data_default.set('bgColor', 'equalRatio'); - } else if (!isValid && shortTextContent && !ignoreLength) { - missing = 'shortTextContent'; - } - this.data({ - fgColor: fgColor ? fgColor.toHexString() : void 0, - bgColor: bgColor ? bgColor.toHexString() : void 0, - contrastRatio: truncatedResult, - fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'), - fontWeight: bold ? 'bold' : 'normal', - messageKey: missing, - expectedContrastRatio: expected + ':1', - shadowColor: shadowColor ? shadowColor.toHexString() : void 0 + shadows.forEach(function(_ref114) { + var pixels = _ref114.pixels; + if (pixels.length === 2) { + pixels.push(0); + } }); - if (fgColor === null || bgColor === null || equalRatio || shortTextContent && !ignoreLength && !isValid) { - missing = null; - incomplete_data_default.clear(); - this.relatedNodes(bgNodes); - return void 0; + return shadows; + } + function _getTextShadowColors(node) { + var _ref115 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, minRatio = _ref115.minRatio, maxRatio = _ref115.maxRatio, ignoreEdgeCount = _ref115.ignoreEdgeCount; + var shadowColors = []; + var style = window.getComputedStyle(node); + var textShadow = style.getPropertyValue('text-shadow'); + if (textShadow === 'none') { + return shadowColors; + } + var fontSizeStr = style.getPropertyValue('font-size'); + var fontSize = parseInt(fontSizeStr); + assert_default(isNaN(fontSize) === false, 'Unable to determine font-size value '.concat(fontSizeStr)); + var thinShadows = []; + var shadows = _parseTextShadows(textShadow); + var _iterator17 = _createForOfIteratorHelper(shadows), _step17; + try { + for (_iterator17.s(); !(_step17 = _iterator17.n()).done; ) { + var shadow = _step17.value; + var colorStr = shadow.colorStr || style.getPropertyValue('color'); + var _shadow$pixels = _slicedToArray(shadow.pixels, 3), offsetX = _shadow$pixels[0], offsetY = _shadow$pixels[1], _shadow$pixels$ = _shadow$pixels[2], blurRadius = _shadow$pixels$ === void 0 ? 0 : _shadow$pixels$; + if (maxRatio && blurRadius >= fontSize * maxRatio) { + continue; + } + if (minRatio && blurRadius < fontSize * minRatio) { + thinShadows.push({ + colorStr: colorStr, + pixels: shadow.pixels + }); + continue; + } + if (thinShadows.length > 0) { + var _strokeColors = _getStrokeColorsFromShadows(thinShadows, { + ignoreEdgeCount: ignoreEdgeCount + }); + if (_strokeColors === null) { + return null; + } + shadowColors.push.apply(shadowColors, _toConsumableArray(_strokeColors)); + thinShadows.splice(0, thinShadows.length); + } + var _color4 = textShadowColor({ + colorStr: colorStr, + offsetX: offsetX, + offsetY: offsetY, + blurRadius: blurRadius, + fontSize: fontSize + }); + shadowColors.push(_color4); + } + } catch (err) { + _iterator17.e(err); + } finally { + _iterator17.f(); } - if (!isValid) { - this.relatedNodes(bgNodes); + if (thinShadows.length > 0) { + var strokeColors = _getStrokeColorsFromShadows(thinShadows, { + ignoreEdgeCount: ignoreEdgeCount + }); + if (strokeColors === null) { + return null; + } + shadowColors.push.apply(shadowColors, _toConsumableArray(strokeColors)); } - return isValid; + return shadowColors; } - function findPseudoElement(vNode, _ref113) { - var _ref113$pseudoSizeThr = _ref113.pseudoSizeThreshold, pseudoSizeThreshold = _ref113$pseudoSizeThr === void 0 ? .25 : _ref113$pseudoSizeThr, _ref113$ignorePseudo = _ref113.ignorePseudo, ignorePseudo = _ref113$ignorePseudo === void 0 ? false : _ref113$ignorePseudo; - if (ignorePseudo) { - return; + function textShadowColor(_ref116) { + var colorStr = _ref116.colorStr, offsetX = _ref116.offsetX, offsetY = _ref116.offsetY, blurRadius = _ref116.blurRadius, fontSize = _ref116.fontSize; + if (offsetX > blurRadius || offsetY > blurRadius) { + return new color_default(0, 0, 0, 0); } - var rect = vNode.boundingClientRect; - var minimumSize = rect.width * rect.height * pseudoSizeThreshold; - do { - var beforeSize = getPseudoElementArea(vNode.actualNode, ':before'); - var afterSize = getPseudoElementArea(vNode.actualNode, ':after'); - if (beforeSize + afterSize > minimumSize) { - return vNode; - } - } while (vNode = vNode.parent); + var shadowColor = new color_default(); + shadowColor.parseString(colorStr); + shadowColor.alpha *= blurRadiusToAlpha(blurRadius, fontSize); + return shadowColor; } - var getPseudoElementArea = memoize_default(function getPseudoElementArea2(node, pseudo) { - var style = window.getComputedStyle(node, pseudo); - var matchPseudoStyle = function matchPseudoStyle(prop, value) { - return style.getPropertyValue(prop) === value; - }; - if (matchPseudoStyle('content', 'none') || matchPseudoStyle('display', 'none') || matchPseudoStyle('visibility', 'hidden') || matchPseudoStyle('position', 'absolute') === false) { - return 0; + function blurRadiusToAlpha(blurRadius, fontSize) { + if (blurRadius === 0) { + return 1; } - if (get_own_background_color_default(style).alpha === 0 && matchPseudoStyle('background-image', 'none')) { - return 0; + var relativeBlur = blurRadius / fontSize; + return .185 / (relativeBlur + .4); + } + function _getStackingContext(elm, elmStack) { + var _elmStack; + var virtualNode = get_node_from_tree_default(elm); + if (virtualNode._stackingContext) { + return virtualNode._stackingContext; } - var pseudoWidth = parseUnit(style.getPropertyValue('width')); - var pseudoHeight = parseUnit(style.getPropertyValue('height')); - if (pseudoWidth.unit !== 'px' || pseudoHeight.unit !== 'px') { - return pseudoWidth.value === 0 || pseudoHeight.value === 0 ? 0 : Infinity; + var stackingContext = []; + var contextMap = new Map(); + elmStack = (_elmStack = elmStack) !== null && _elmStack !== void 0 ? _elmStack : _getBackgroundStack(elm); + elmStack.forEach(function(bgElm) { + var _stackingOrder2; + var bgVNode = get_node_from_tree_default(bgElm); + var bgColor = getOwnBackgroundColor2(bgVNode); + var stackingOrder = bgVNode._stackingOrder.filter(function(_ref117) { + var vNode = _ref117.vNode; + return !!vNode; + }); + stackingOrder.forEach(function(_ref118, index) { + var _stackingOrder; + var vNode = _ref118.vNode; + var ancestorVNode2 = (_stackingOrder = stackingOrder[index - 1]) === null || _stackingOrder === void 0 ? void 0 : _stackingOrder.vNode; + var context2 = addToStackingContext(contextMap, vNode, ancestorVNode2); + if (index === 0 && !contextMap.get(vNode)) { + stackingContext.unshift(context2); + } + contextMap.set(vNode, context2); + }); + var ancestorVNode = (_stackingOrder2 = stackingOrder[stackingOrder.length - 1]) === null || _stackingOrder2 === void 0 ? void 0 : _stackingOrder2.vNode; + var context = addToStackingContext(contextMap, bgVNode, ancestorVNode); + if (!stackingOrder.length) { + stackingContext.unshift(context); + } + context.bgColor = bgColor; + }); + virtualNode._stackingContext = stackingContext; + return stackingContext; + } + function _stackingContextToColor(context) { + var _context$descendants; + if (!((_context$descendants = context.descendants) !== null && _context$descendants !== void 0 && _context$descendants.length)) { + var color2 = context.bgColor; + color2.alpha *= context.opacity; + return { + color: color2, + blendMode: context.blendMode + }; } - return pseudoWidth.value * pseudoHeight.value; - }); - function textIsEmojis(visibleText) { - var options = { - nonBmp: true + var sourceColor = context.descendants.reduce(reduceToColor, createStackingContext2()); + var color = _flattenColors(sourceColor, context.bgColor, context.descendants[0].blendMode); + color.alpha *= context.opacity; + return { + color: color, + blendMode: context.blendMode }; - var hasUnicodeChars = has_unicode_default(visibleText, options); - var hasNonUnicodeChars = sanitize_default(remove_unicode_default(visibleText, options)) === ''; - return hasUnicodeChars && hasNonUnicodeChars; } - function parseUnit(str) { - var unitRegex = /^([0-9.]+)([a-z]+)$/i; - var _ref114 = str.match(unitRegex) || [], _ref115 = _slicedToArray(_ref114, 3), _ref115$ = _ref115[1], value = _ref115$ === void 0 ? '' : _ref115$, _ref115$2 = _ref115[2], unit = _ref115$2 === void 0 ? '' : _ref115$2; + function reduceToColor(backdropContext, sourceContext) { + var backdrop; + if (backdropContext instanceof color_default) { + backdrop = backdropContext; + } else { + backdrop = _stackingContextToColor(backdropContext).color; + } + var sourceColor = _stackingContextToColor(sourceContext).color; + return _flattenColors(sourceColor, backdrop, sourceContext.blendMode); + } + function createStackingContext2(vNode, ancestorContext) { + var _vNode$getComputedSty; return { - value: parseFloat(value), - unit: unit.toLowerCase() + vNode: vNode, + ancestor: ancestorContext, + opacity: parseFloat((_vNode$getComputedSty = vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('opacity')) !== null && _vNode$getComputedSty !== void 0 ? _vNode$getComputedSty : 1), + bgColor: new color_default(0, 0, 0, 0), + blendMode: normalizeBlendMode(vNode === null || vNode === void 0 ? void 0 : vNode.getComputedStylePropertyValue('mix-blend-mode')), + descendants: [] }; } - function getContrast2(color1, color2) { - var c1lum = color1.getRelativeLuminance(); - var c2lum = color2.getRelativeLuminance(); - return (Math.max(c1lum, c2lum) + .05) / (Math.min(c1lum, c2lum) + .05); - } - var blockLike2 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ]; - function isBlock2(elm) { - var display2 = window.getComputedStyle(elm).getPropertyValue('display'); - return blockLike2.indexOf(display2) !== -1 || display2.substr(0, 6) === 'table-'; + function normalizeBlendMode(blendmode) { + return !!blendmode ? blendmode : void 0; } - function linkInTextBlockEvaluate(node, options) { - var requiredContrastRatio = options.requiredContrastRatio, allowSameColor = options.allowSameColor; - if (isBlock2(node)) { - return false; + function addToStackingContext(contextMap, vNode, ancestorVNode) { + var _contextMap$get; + var ancestorContext = contextMap.get(ancestorVNode); + var context = (_contextMap$get = contextMap.get(vNode)) !== null && _contextMap$get !== void 0 ? _contextMap$get : createStackingContext2(vNode, ancestorContext); + if (ancestorContext && ancestorVNode !== vNode && !ancestorContext.descendants.includes(context)) { + ancestorContext.descendants.unshift(context); } - var parentBlock = get_composed_parent_default(node); - while (parentBlock && parentBlock.nodeType === 1 && !isBlock2(parentBlock)) { - parentBlock = get_composed_parent_default(parentBlock); + return context; + } + function getOwnBackgroundColor2(vNode) { + var bgColor = new color_default(); + bgColor.parseString(vNode.getComputedStylePropertyValue('background-color')); + return bgColor; + } + function _getBackgroundColor2(elm) { + var bgElms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var shadowOutlineEmMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .1; + var vNode = get_node_from_tree_default(elm); + var bgColorCache = vNode._cache.getBackgroundColor; + if (bgColorCache) { + bgElms.push.apply(bgElms, _toConsumableArray(bgColorCache.bgElms)); + incomplete_data_default.set('bgColor', bgColorCache.incompleteData); + return bgColorCache.bgColor; } - if (!parentBlock) { - return void 0; + var bgColor = _getBackgroundColor(elm, bgElms, shadowOutlineEmMax); + vNode._cache.getBackgroundColor = { + bgColor: bgColor, + bgElms: bgElms, + incompleteData: incomplete_data_default.get('bgColor') + }; + return bgColor; + } + function _getBackgroundColor(elm, bgElms, shadowOutlineEmMax) { + var _getTextShadowColors2, _bgColors; + var elmStack = _getBackgroundStack(elm); + if (!elmStack) { + return null; } - this.relatedNodes([ parentBlock ]); - var nodeColor = _getForegroundColor(node); - var parentColor = _getForegroundColor(parentBlock); - var nodeBackgroundColor = _getBackgroundColor2(node); - var parentBackgroundColor = _getBackgroundColor2(parentBlock); - var textContrast = nodeColor && parentColor ? getContrast2(nodeColor, parentColor) : void 0; - if (textContrast) { - textContrast = Math.floor(textContrast * 100) / 100; + var textRects = get_visible_child_text_rects_default(elm); + var bgColors = (_getTextShadowColors2 = _getTextShadowColors(elm, { + minRatio: shadowOutlineEmMax, + ignoreEdgeCount: true + })) !== null && _getTextShadowColors2 !== void 0 ? _getTextShadowColors2 : []; + if (bgColors.length) { + bgColors = [ { + color: bgColors.reduce(_flattenShadowColors) + } ]; } - if (textContrast && textContrast >= requiredContrastRatio) { - return true; + for (var _i31 = 0; _i31 < elmStack.length; _i31++) { + var bgElm = elmStack[_i31]; + var bgElmStyle = window.getComputedStyle(bgElm); + if (element_has_image_default(bgElm, bgElmStyle)) { + bgElms.push(bgElm); + return null; + } + var bgColor = get_own_background_color_default(bgElmStyle); + if (bgColor.alpha === 0) { + continue; + } + if (bgElmStyle.getPropertyValue('display') !== 'inline' && !fullyEncompasses(bgElm, textRects)) { + bgElms.push(bgElm); + incomplete_data_default.set('bgColor', 'elmPartiallyObscured'); + return null; + } + bgElms.push(bgElm); + if (bgColor.alpha === 1) { + break; + } } - var backgroundContrast = nodeBackgroundColor && parentBackgroundColor ? getContrast2(nodeBackgroundColor, parentBackgroundColor) : void 0; - if (backgroundContrast) { - backgroundContrast = Math.floor(backgroundContrast * 100) / 100; + var stackingContext = _getStackingContext(elm, elmStack); + bgColors = stackingContext.map(_stackingContextToColor).concat(bgColors); + var pageBgs = getPageBackgroundColors(elm, elmStack.includes(document.body)); + (_bgColors = bgColors).unshift.apply(_bgColors, _toConsumableArray(pageBgs)); + if (bgColors.length === 0) { + return new color_default(255, 255, 255, 1); } - if (backgroundContrast && backgroundContrast >= requiredContrastRatio) { - return true; + var blendedColor = bgColors.reduce(function(bgColor, fgColor) { + return _flattenColors(fgColor.color, bgColor.color instanceof color_default ? bgColor.color : bgColor, fgColor.blendMode); + }); + return _flattenColors(blendedColor.color instanceof color_default ? blendedColor.color : blendedColor, new color_default(255, 255, 255, 1)); + } + function fullyEncompasses(node, rects) { + rects = Array.isArray(rects) ? rects : [ rects ]; + var nodeRect = node.getBoundingClientRect(); + var right = nodeRect.right, bottom = nodeRect.bottom; + var style = window.getComputedStyle(node); + var overflow = style.getPropertyValue('overflow'); + if ([ 'scroll', 'auto' ].includes(overflow) || node instanceof window.HTMLHtmlElement) { + right = nodeRect.left + node.scrollWidth; + bottom = nodeRect.top + node.scrollHeight; } - if (!backgroundContrast) { - var _incomplete_data_defa; - var reason = (_incomplete_data_defa = incomplete_data_default.get('bgColor')) !== null && _incomplete_data_defa !== void 0 ? _incomplete_data_defa : 'bgContrast'; - this.data({ - messageKey: reason - }); - incomplete_data_default.clear(); - return void 0; + return rects.every(function(rect) { + return rect.top >= nodeRect.top && rect.bottom <= bottom && rect.left >= nodeRect.left && rect.right <= right; + }); + } + function normalizeBlendMode2(blendmode) { + return !!blendmode ? blendmode : void 0; + } + function getPageBackgroundColors(elm, stackContainsBody) { + var pageColors = []; + if (!stackContainsBody) { + var html = document.documentElement; + var body = document.body; + var htmlStyle = window.getComputedStyle(html); + var bodyStyle = window.getComputedStyle(body); + var htmlBgColor = get_own_background_color_default(htmlStyle); + var bodyBgColor = get_own_background_color_default(bodyStyle); + var bodyBgColorApplies = bodyBgColor.alpha !== 0 && fullyEncompasses(body, elm.getBoundingClientRect()); + if (bodyBgColor.alpha !== 0 && htmlBgColor.alpha === 0 || bodyBgColorApplies && bodyBgColor.alpha !== 1) { + pageColors.unshift({ + color: bodyBgColor, + blendMode: normalizeBlendMode2(bodyStyle.getPropertyValue('mix-blend-mode')) + }); + } + if (htmlBgColor.alpha !== 0 && (!bodyBgColorApplies || bodyBgColorApplies && bodyBgColor.alpha !== 1)) { + pageColors.unshift({ + color: htmlBgColor, + blendMode: normalizeBlendMode2(htmlStyle.getPropertyValue('mix-blend-mode')) + }); + } } - if (!textContrast) { - return void 0; + return pageColors; + } + function getContrast(bgColor, fgColor) { + if (!fgColor || !bgColor) { + return null; } - if (allowSameColor && textContrast === 1 && backgroundContrast === 1) { - return true; + if (fgColor.alpha < 1) { + fgColor = _flattenColors(fgColor, bgColor); } - if (textContrast === 1 && backgroundContrast > 1) { - this.data({ - messageKey: 'bgContrast', - contrastRatio: backgroundContrast, - requiredContrastRatio: requiredContrastRatio, - nodeBackgroundColor: nodeBackgroundColor ? nodeBackgroundColor.toHexString() : void 0, - parentBackgroundColor: parentBackgroundColor ? parentBackgroundColor.toHexString() : void 0 + var bL = bgColor.getRelativeLuminance(); + var fL = fgColor.getRelativeLuminance(); + return (Math.max(fL, bL) + .05) / (Math.min(fL, bL) + .05); + } + var get_contrast_default = getContrast; + function _getForegroundColor(node, _, bgColor) { + var _bgColor; + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var nodeStyle = window.getComputedStyle(node); + var colorStack = [ function() { + return getStrokeColor(nodeStyle, options); + }, function() { + return getTextColor(nodeStyle); + }, function() { + return _getTextShadowColors(node, { + minRatio: 0 }); - return false; + } ]; + var fgColors = []; + for (var _i32 = 0, _colorStack = colorStack; _i32 < _colorStack.length; _i32++) { + var colorFn = _colorStack[_i32]; + var _color5 = colorFn(); + if (!_color5) { + continue; + } + fgColors = fgColors.concat(_color5); + if (_color5.alpha === 1) { + break; + } } - this.data({ - messageKey: 'fgContrast', - contrastRatio: textContrast, - requiredContrastRatio: requiredContrastRatio, - nodeColor: nodeColor ? nodeColor.toHexString() : void 0, - parentColor: parentColor ? parentColor.toHexString() : void 0 + var fgColor = fgColors.reduce(function(source, backdrop) { + return _flattenColors(source, backdrop); }); - return false; - } - var link_in_text_block_evaluate_default = linkInTextBlockEvaluate; - var blockLike3 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ]; - function linkInTextBlockStyleEvaluate(node) { - if (isBlock3(node)) { - return false; - } - var parentBlock = get_composed_parent_default(node); - while (parentBlock && parentBlock.nodeType === 1 && !isBlock3(parentBlock)) { - parentBlock = get_composed_parent_default(parentBlock); + (_bgColor = bgColor) !== null && _bgColor !== void 0 ? _bgColor : bgColor = _getBackgroundColor2(node, []); + if (bgColor === null) { + var reason = incomplete_data_default.get('bgColor'); + incomplete_data_default.set('fgColor', reason); + return null; } - if (!parentBlock) { - return void 0; + var stackingContexts = _getStackingContext(node); + var context = findNodeInContexts(stackingContexts, node); + return _flattenColors(calculateBlendedForegroundColor(fgColor, context, stackingContexts), new color_default(255, 255, 255, 1)); + } + function getTextColor(nodeStyle) { + return new color_default().parseString(nodeStyle.getPropertyValue('-webkit-text-fill-color') || nodeStyle.getPropertyValue('color')); + } + function getStrokeColor(nodeStyle, _ref119) { + var _ref119$textStrokeEmM = _ref119.textStrokeEmMin, textStrokeEmMin = _ref119$textStrokeEmM === void 0 ? 0 : _ref119$textStrokeEmM; + var strokeWidth = parseFloat(nodeStyle.getPropertyValue('-webkit-text-stroke-width')); + if (strokeWidth === 0) { + return null; } - this.relatedNodes([ parentBlock ]); - if (element_is_distinct_default(node, parentBlock)) { - return true; + var fontSize = nodeStyle.getPropertyValue('font-size'); + var relativeStrokeWidth = strokeWidth / parseFloat(fontSize); + if (isNaN(relativeStrokeWidth) || relativeStrokeWidth < textStrokeEmMin) { + return null; } - if (hasPseudoContent(node)) { - this.data({ - messageKey: 'pseudoContent' + var strokeColor = nodeStyle.getPropertyValue('-webkit-text-stroke-color'); + return new color_default().parseString(strokeColor); + } + function calculateBlendedForegroundColor(fgColor, context, stackingContexts) { + while (context) { + var _context$ancestor; + if (context.opacity === 1 && context.ancestor) { + context = context.ancestor; + continue; + } + fgColor.alpha *= context.opacity; + var stack = ((_context$ancestor = context.ancestor) === null || _context$ancestor === void 0 ? void 0 : _context$ancestor.descendants) || stackingContexts; + if (context.opacity !== 1) { + stack = stack.slice(0, stack.indexOf(context)); + } + var bgColors = stack.map(_stackingContextToColor); + if (!bgColors.length) { + context = context.ancestor; + continue; + } + var bgColor = bgColors.reduce(function(backdrop, source) { + return _flattenColors(source.color, backdrop.color instanceof color_default ? backdrop.color : backdrop); + }, { + color: new color_default(0, 0, 0, 0), + blendMode: 'normal' }); - return void 0; + fgColor = _flattenColors(fgColor, bgColor); + context = context.ancestor; } - return false; - } - function isBlock3(elm) { - var display2 = window.getComputedStyle(elm).getPropertyValue('display'); - return blockLike3.indexOf(display2) !== -1 || display2.substr(0, 6) === 'table-'; + return fgColor; } - function hasPseudoContent(node) { - for (var _i33 = 0, _arr4 = [ 'before', 'after' ]; _i33 < _arr4.length; _i33++) { - var pseudo = _arr4[_i33]; - var style = window.getComputedStyle(node, ':'.concat(pseudo)); - var content = style.getPropertyValue('content'); - if (content !== 'none') { - return true; + function findNodeInContexts(contexts, node) { + var _iterator18 = _createForOfIteratorHelper(contexts), _step18; + try { + for (_iterator18.s(); !(_step18 = _iterator18.n()).done; ) { + var _context$vNode; + var context = _step18.value; + if (((_context$vNode = context.vNode) === null || _context$vNode === void 0 ? void 0 : _context$vNode.actualNode) === node) { + return context; + } + var found = findNodeInContexts(context.descendants, node); + if (found) { + return found; + } } + } catch (err) { + _iterator18.e(err); + } finally { + _iterator18.f(); } - return false; } - function autocompleteAppropriateEvaluate(node, options, virtualNode) { - if (virtualNode.props.nodeName !== 'input') { - return true; - } - var number = [ 'text', 'search', 'number', 'tel' ]; - var url = [ 'text', 'search', 'url' ]; - var allowedTypesMap = { - bday: [ 'text', 'search', 'date' ], - email: [ 'text', 'search', 'email' ], - username: [ 'text', 'search', 'email' ], - 'street-address': [ 'text' ], - tel: [ 'text', 'search', 'tel' ], - 'tel-country-code': [ 'text', 'search', 'tel' ], - 'tel-national': [ 'text', 'search', 'tel' ], - 'tel-area-code': [ 'text', 'search', 'tel' ], - 'tel-local': [ 'text', 'search', 'tel' ], - 'tel-local-prefix': [ 'text', 'search', 'tel' ], - 'tel-local-suffix': [ 'text', 'search', 'tel' ], - 'tel-extension': [ 'text', 'search', 'tel' ], - 'cc-number': number, - 'cc-exp': [ 'text', 'search', 'month', 'tel' ], - 'cc-exp-month': number, - 'cc-exp-year': number, - 'cc-csc': number, - 'transaction-amount': number, - 'bday-day': number, - 'bday-month': number, - 'bday-year': number, - 'new-password': [ 'text', 'search', 'password' ], - 'current-password': [ 'text', 'search', 'password' ], - url: url, - photo: url, - impp: url + function hasValidContrastRatio(bg, fg, fontSize, isBold) { + var contrast2 = get_contrast_default(bg, fg); + var isSmallFont = isBold && Math.ceil(fontSize * 72) / 96 < 14 || !isBold && Math.ceil(fontSize * 72) / 96 < 18; + var expectedContrastRatio = isSmallFont ? 4.5 : 3; + return { + isValid: contrast2 > expectedContrastRatio, + contrastRatio: contrast2, + expectedContrastRatio: expectedContrastRatio }; - if (_typeof(options) === 'object') { - Object.keys(options).forEach(function(key) { - if (!allowedTypesMap[key]) { - allowedTypesMap[key] = []; - } - allowedTypesMap[key] = allowedTypesMap[key].concat(options[key]); - }); - } - var autocompleteAttr = virtualNode.attr('autocomplete'); - var autocompleteTerms = autocompleteAttr.split(/\s+/g).map(function(term) { - return term.toLowerCase(); - }); - var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1]; - if (_autocomplete.stateTerms.includes(purposeTerm)) { - return true; + } + var has_valid_contrast_ratio_default = hasValidContrastRatio; + var forms_exports = {}; + __export(forms_exports, { + isAriaCombobox: function isAriaCombobox() { + return is_aria_combobox_default; + }, + isAriaListbox: function isAriaListbox() { + return is_aria_listbox_default; + }, + isAriaRange: function isAriaRange() { + return is_aria_range_default; + }, + isAriaTextbox: function isAriaTextbox() { + return is_aria_textbox_default; + }, + isDisabled: function isDisabled() { + return is_disabled_default; + }, + isNativeSelect: function isNativeSelect() { + return is_native_select_default; + }, + isNativeTextbox: function isNativeTextbox() { + return is_native_textbox_default; } - var allowedTypes = allowedTypesMap[purposeTerm]; - var type2 = virtualNode.hasAttr('type') ? sanitize_default(virtualNode.attr('type')).toLowerCase() : 'text'; - type2 = valid_input_type_default().includes(type2) ? type2 : 'text'; - if (typeof allowedTypes === 'undefined') { - return type2 === 'text'; + }); + var disabledNodeNames = [ 'fieldset', 'button', 'select', 'input', 'textarea' ]; + function isDisabled(virtualNode) { + var disabledState = virtualNode._isDisabled; + if (typeof disabledState === 'boolean') { + return disabledState; } - return allowedTypes.includes(type2); - } - var autocomplete_appropriate_evaluate_default = autocompleteAppropriateEvaluate; - function autocompleteValidEvaluate(node, options, virtualNode) { - var autocomplete2 = virtualNode.attr('autocomplete') || ''; - return is_valid_autocomplete_default(autocomplete2, options); + var nodeName2 = virtualNode.props.nodeName; + var ariaDisabled = virtualNode.attr('aria-disabled'); + if (disabledNodeNames.includes(nodeName2) && virtualNode.hasAttr('disabled')) { + disabledState = true; + } else if (ariaDisabled) { + disabledState = ariaDisabled.toLowerCase() === 'true'; + } else if (virtualNode.parent) { + disabledState = isDisabled(virtualNode.parent); + } else { + disabledState = false; + } + virtualNode._isDisabled = disabledState; + return disabledState; } - var autocomplete_valid_evaluate_default = autocompleteValidEvaluate; - function attrNonSpaceContentEvaluate(node) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var vNode = arguments.length > 2 ? arguments[2] : undefined; - if (!options.attribute || typeof options.attribute !== 'string') { - throw new TypeError('attr-non-space-content requires options.attribute to be a string'); + var is_disabled_default = isDisabled; + function identicalLinksSamePurposeEvaluate(node, options, virtualNode) { + var accText = text_exports.accessibleTextVirtual(virtualNode); + var name = text_exports.sanitize(text_exports.removeUnicode(accText, { + emoji: true, + nonBmp: true, + punctuations: true + })).toLowerCase(); + if (!name) { + return void 0; } - if (!vNode.hasAttr(options.attribute)) { - this.data({ - messageKey: 'noAttr' - }); + var afterData = { + name: name, + urlProps: dom_exports.urlPropsFromAttribute(node, 'href') + }; + this.data(afterData); + this.relatedNodes([ node ]); + return true; + } + var identical_links_same_purpose_evaluate_default = identicalLinksSamePurposeEvaluate; + function isIdenticalObject(a2, b2) { + if (!a2 || !b2) { return false; } - var attribute = vNode.attr(options.attribute); - var attributeIsEmpty = !sanitize_default(attribute); - if (attributeIsEmpty) { - this.data({ - messageKey: 'emptyAttr' - }); + var aProps = Object.getOwnPropertyNames(a2); + var bProps = Object.getOwnPropertyNames(b2); + if (aProps.length !== bProps.length) { return false; } - return true; + var result = aProps.every(function(propName) { + var aValue = a2[propName]; + var bValue = b2[propName]; + if (_typeof(aValue) !== _typeof(bValue)) { + return false; + } + if (_typeof(aValue) === 'object' || _typeof(bValue) === 'object') { + return isIdenticalObject(aValue, bValue); + } + return aValue === bValue; + }); + return result; } - var attr_non_space_content_evaluate_default = attrNonSpaceContentEvaluate; - function pageHasElmAfter(results) { - var elmUsedAnywhere = results.some(function(frameResult) { - return frameResult.result === true; + function identicalLinksSamePurposeAfter(results) { + if (results.length < 2) { + return results; + } + var incompleteResults = results.filter(function(_ref120) { + var result = _ref120.result; + return result !== void 0; }); - if (elmUsedAnywhere) { - results.forEach(function(result) { - result.result = true; + var uniqueResults = []; + var nameMap = {}; + var _loop6 = function _loop6(index) { + var _currentResult$relate; + var currentResult = incompleteResults[index]; + var _currentResult$data = currentResult.data, name = _currentResult$data.name, urlProps = _currentResult$data.urlProps; + if (nameMap[name]) { + return 1; + } + var sameNameResults = incompleteResults.filter(function(_ref121, resultNum) { + var data = _ref121.data; + return data.name === name && resultNum !== index; + }); + var isSameUrl = sameNameResults.every(function(_ref122) { + var data = _ref122.data; + return isIdenticalObject(data.urlProps, urlProps); }); + if (sameNameResults.length && !isSameUrl) { + currentResult.result = void 0; + } + currentResult.relatedNodes = []; + (_currentResult$relate = currentResult.relatedNodes).push.apply(_currentResult$relate, _toConsumableArray(sameNameResults.map(function(node) { + return node.relatedNodes[0]; + }))); + nameMap[name] = sameNameResults; + uniqueResults.push(currentResult); + }; + for (var index = 0; index < incompleteResults.length; index++) { + if (_loop6(index)) { + continue; + } } - return results; + return uniqueResults; } - var has_descendant_after_default = pageHasElmAfter; - function hasDescendant(node, options, virtualNode) { - if (!options || !options.selector || typeof options.selector !== 'string') { - throw new TypeError('has-descendant requires options.selector to be a string'); + var identical_links_same_purpose_after_default = identicalLinksSamePurposeAfter; + function getLevel(vNode) { + var role = get_role_default(vNode); + var headingRole = role && role.includes('heading'); + var ariaHeadingLevel = vNode.attr('aria-level'); + var ariaLevel = parseInt(ariaHeadingLevel, 10); + var _ref123 = vNode.props.nodeName.match(/h(\d)/) || [], _ref124 = _slicedToArray(_ref123, 2), headingLevel = _ref124[1]; + if (!headingRole) { + return -1; } - if (options.passForModal && is_modal_open_default()) { - return true; + if (headingLevel && !ariaHeadingLevel) { + return parseInt(headingLevel, 10); } - var matchingElms = query_selector_all_filter_default(virtualNode, options.selector, function(vNode) { - return _isVisibleToScreenReaders(vNode); - }); - this.relatedNodes(matchingElms.map(function(vNode) { - return vNode.actualNode; - })); - return matchingElms.length > 0; - } - var has_descendant_evaluate_default = hasDescendant; - function hasTextContentEvaluate(node, options, virtualNode) { - try { - return sanitize_default(subtree_text_default(virtualNode)) !== ''; - } catch (e) { - return void 0; + if (isNaN(ariaLevel) || ariaLevel < 1) { + if (headingLevel) { + return parseInt(headingLevel, 10); + } + return 2; } + if (ariaLevel) { + return ariaLevel; + } + return -1; } - function matchesDefinitionEvaluate(_, options, virtualNode) { - return matches_default2(virtualNode, options.matcher); - } - var matches_definition_evaluate_default = matchesDefinitionEvaluate; - function pageNoDuplicateAfter(results) { - return results.filter(function(checkResult) { - return checkResult.data !== 'ignored'; + function headingOrderEvaluate() { + var headingOrder = cache_default.get('headingOrder'); + if (headingOrder) { + return true; + } + var selector = 'h1, h2, h3, h4, h5, h6, [role=heading], iframe, frame'; + var vNodes = query_selector_all_filter_default(axe._tree[0], selector, _isVisibleToScreenReaders); + headingOrder = vNodes.map(function(vNode) { + return { + ancestry: [ _getAncestry(vNode.actualNode) ], + level: getLevel(vNode) + }; }); + this.data({ + headingOrder: headingOrder + }); + cache_default.set('headingOrder', vNodes); + return true; } - var page_no_duplicate_after_default = pageNoDuplicateAfter; - function pageNoDuplicateEvaluate(node, options, virtualNode) { - if (!options || !options.selector || typeof options.selector !== 'string') { - throw new TypeError('page-no-duplicate requires options.selector to be a string'); - } - var key = 'page-no-duplicate;' + options.selector; - if (cache_default.get(key)) { - this.data('ignored'); - return; - } - cache_default.set(key, true); - var elms = query_selector_all_filter_default(axe._tree[0], options.selector, function(elm) { - return _isVisibleToScreenReaders(elm); + var heading_order_evaluate_default = headingOrderEvaluate; + function headingOrderAfter(results) { + var headingOrder = getHeadingOrder(results); + results.forEach(function(result) { + result.result = getHeadingOrderOutcome(result, headingOrder); }); - if (typeof options.nativeScopeFilter === 'string') { - elms = elms.filter(function(elm) { - return elm.actualNode.hasAttribute('role') || !find_up_virtual_default(elm, options.nativeScopeFilter); - }); + return results; + } + function getHeadingOrderOutcome(result, headingOrder) { + var _headingOrder$index$l, _headingOrder$index, _headingOrder$level, _headingOrder; + var index = findHeadingOrderIndex(headingOrder, result.node.ancestry); + var currLevel = (_headingOrder$index$l = (_headingOrder$index = headingOrder[index]) === null || _headingOrder$index === void 0 ? void 0 : _headingOrder$index.level) !== null && _headingOrder$index$l !== void 0 ? _headingOrder$index$l : -1; + var prevLevel = (_headingOrder$level = (_headingOrder = headingOrder[index - 1]) === null || _headingOrder === void 0 ? void 0 : _headingOrder.level) !== null && _headingOrder$level !== void 0 ? _headingOrder$level : -1; + if (index === 0) { + return true; } - if (typeof options.role === 'string') { - elms = elms.filter(function(elm) { - return get_role_default(elm) === options.role; - }); + if (currLevel === -1) { + return void 0; } - this.relatedNodes(elms.filter(function(elm) { - return elm !== virtualNode; - }).map(function(elm) { - return elm.actualNode; - })); - return elms.length <= 1; + return currLevel - prevLevel <= 1; } - var page_no_duplicate_evaluate_default = pageNoDuplicateEvaluate; - function accesskeysAfter(results) { - var seen = {}; - return results.filter(function(r) { - if (!r.data) { - return false; - } - var key = r.data.toUpperCase(); - if (!seen[key]) { - seen[key] = r; - r.relatedNodes = []; - return true; - } - seen[key].relatedNodes.push(r.relatedNodes[0]); - return false; - }).map(function(r) { - r.result = !!r.relatedNodes.length; - return r; + function getHeadingOrder(results) { + results = _toConsumableArray(results); + results.sort(function(_ref125, _ref126) { + var nodeA = _ref125.node; + var nodeB = _ref126.node; + return nodeA.ancestry.length - nodeB.ancestry.length; + }); + var headingOrder = results.reduce(mergeHeadingOrder, []); + return headingOrder.filter(function(_ref127) { + var level = _ref127.level; + return level !== -1; }); } - var accesskeys_after_default = accesskeysAfter; - function accesskeysEvaluate(node, options, vNode) { - if (!_isHiddenForEveryone(vNode)) { - this.data(vNode.attr('accesskey')); - this.relatedNodes([ node ]); + function mergeHeadingOrder(mergedHeadingOrder, result) { + var _result$data; + var frameHeadingOrder = (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.headingOrder; + var frameAncestry = shortenArray(result.node.ancestry, 1); + if (!frameHeadingOrder) { + return mergedHeadingOrder; } - return true; + var normalizedHeadingOrder = frameHeadingOrder.map(function(heading) { + return addFrameToHeadingAncestry(heading, frameAncestry); + }); + var index = getFrameIndex(mergedHeadingOrder, frameAncestry); + if (index === -1) { + mergedHeadingOrder.push.apply(mergedHeadingOrder, _toConsumableArray(normalizedHeadingOrder)); + } else { + mergedHeadingOrder.splice.apply(mergedHeadingOrder, [ index, 0 ].concat(_toConsumableArray(normalizedHeadingOrder))); + } + return mergedHeadingOrder; } - var accesskeys_evaluate_default = accesskeysEvaluate; - function focusableContentEvaluate(node, options, virtualNode) { - var tabbableElements = virtualNode.tabbableElements; - if (!tabbableElements) { - return false; + function getFrameIndex(headingOrder, frameAncestry) { + while (frameAncestry.length) { + var index = findHeadingOrderIndex(headingOrder, frameAncestry); + if (index !== -1) { + return index; + } + frameAncestry = shortenArray(frameAncestry, 1); } - var tabbableContentElements = tabbableElements.filter(function(el) { - return el !== virtualNode; + return -1; + } + function findHeadingOrderIndex(headingOrder, ancestry) { + return headingOrder.findIndex(function(heading) { + return _matchAncestry(heading.ancestry, ancestry); }); - return tabbableContentElements.length > 0; } - var focusable_content_evaluate_default = focusableContentEvaluate; - function focusableDisabledEvaluate(node, options, virtualNode) { - var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ]; - var tabbableElements = virtualNode.tabbableElements; - if (!tabbableElements || !tabbableElements.length) { - return true; - } - var relatedNodes = tabbableElements.filter(function(vNode) { - return elementsThatCanBeDisabled.includes(vNode.props.nodeName); + function addFrameToHeadingAncestry(heading, frameAncestry) { + var ancestry = frameAncestry.concat(heading.ancestry); + return _extends({}, heading, { + ancestry: ancestry }); - this.relatedNodes(relatedNodes.map(function(vNode) { - return vNode.actualNode; - })); - if (relatedNodes.length === 0 || is_modal_open_default()) { + } + function shortenArray(arr, spliceLength) { + return arr.slice(0, arr.length - spliceLength); + } + function targetSizeEvaluate(node, options, vNode) { + var minSize = (options === null || options === void 0 ? void 0 : options.minSize) || 24; + var nodeRect = vNode.boundingClientRect; + if (_rectHasMinimumSize(minSize * 10, nodeRect)) { + this.data({ + messageKey: 'large', + minSize: minSize + }); return true; } - return relatedNodes.every(function(vNode) { - var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events'); - var width = parseInt(vNode.getComputedStylePropertyValue('width')); - var height = parseInt(vNode.getComputedStylePropertyValue('height')); - return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none'; - }) ? void 0 : false; - } - var focusable_disabled_evaluate_default = focusableDisabledEvaluate; - function focusableElementEvaluate(node, options, virtualNode) { - if (virtualNode.hasAttr('contenteditable') && isContenteditable(virtualNode)) { + var hasMinimumSize = _rectHasMinimumSize.bind(null, minSize); + var nearbyElms = _findNearbyElms(vNode); + var overflowingContent = filterOverflowingContent(vNode, nearbyElms); + var _filterByElmsOverlap = filterByElmsOverlap(vNode, nearbyElms), fullyObscuringElms = _filterByElmsOverlap.fullyObscuringElms, partialObscuringElms = _filterByElmsOverlap.partialObscuringElms; + if (overflowingContent.length && (fullyObscuringElms.length || !hasMinimumSize(nodeRect))) { + this.data({ + minSize: minSize, + messageKey: 'contentOverflow' + }); + this.relatedNodes(mapActualNodes(overflowingContent)); + return void 0; + } + if (fullyObscuringElms.length) { + this.relatedNodes(mapActualNodes(fullyObscuringElms)); + this.data({ + messageKey: 'obscured' + }); return true; } - return _isInTabOrder(virtualNode); - function isContenteditable(vNode) { - var contenteditable = vNode.attr('contenteditable'); - if (contenteditable === 'true' || contenteditable === '') { - return true; - } - if (contenteditable === 'false') { - return false; - } - var ancestor = closest_default(virtualNode.parent, '[contenteditable]'); - if (!ancestor) { - return false; - } - return isContenteditable(ancestor); + var negativeOutcome = _isInTabOrder(vNode) ? false : void 0; + if (!hasMinimumSize(nodeRect)) { + this.data(_extends({ + minSize: minSize + }, toDecimalSize(nodeRect))); + return negativeOutcome; } - } - var focusable_element_evaluate_default = focusableElementEvaluate; - function focusableModalOpenEvaluate(node, options, virtualNode) { - var tabbableElements = virtualNode.tabbableElements.map(function(_ref116) { - var actualNode = _ref116.actualNode; - return actualNode; - }); - if (!tabbableElements || !tabbableElements.length) { + var obscuredWidgets = filterFocusableWidgets(partialObscuringElms); + if (!obscuredWidgets.length) { + this.data(_extends({ + minSize: minSize + }, toDecimalSize(nodeRect))); return true; } - if (is_modal_open_default()) { - this.relatedNodes(tabbableElements); + var largestInnerRect = getLargestUnobscuredArea(vNode, obscuredWidgets); + if (!largestInnerRect) { + this.data({ + minSize: minSize, + messageKey: 'tooManyRects' + }); return void 0; } + if (!hasMinimumSize(largestInnerRect)) { + if (overflowingContent.length) { + this.data({ + minSize: minSize, + messageKey: 'contentOverflow' + }); + this.relatedNodes(mapActualNodes(overflowingContent)); + return void 0; + } + var allTabbable = obscuredWidgets.every(_isInTabOrder); + var messageKey = 'partiallyObscured'.concat(allTabbable ? '' : 'NonTabbable'); + this.data(_extends({ + messageKey: messageKey, + minSize: minSize + }, toDecimalSize(largestInnerRect))); + this.relatedNodes(mapActualNodes(obscuredWidgets)); + return allTabbable ? negativeOutcome : void 0; + } + this.data(_extends({ + minSize: minSize + }, toDecimalSize(largestInnerRect || nodeRect))); + this.relatedNodes(mapActualNodes(obscuredWidgets)); return true; } - var focusable_modal_open_evaluate_default = focusableModalOpenEvaluate; - function focusableNoNameEvaluate(node, options, virtualNode) { - var tabIndex = virtualNode.attr('tabindex'); - var inFocusOrder = _isFocusable(virtualNode) && tabIndex > -1; - if (!inFocusOrder) { - return false; - } + function filterOverflowingContent(vNode, nearbyElms) { + return nearbyElms.filter(function(nearbyElm) { + return !isEnclosedRect2(nearbyElm, vNode) && isDescendantNotInTabOrder2(vNode, nearbyElm); + }); + } + function filterByElmsOverlap(vNode, nearbyElms) { + var fullyObscuringElms = []; + var partialObscuringElms = []; + var _iterator19 = _createForOfIteratorHelper(nearbyElms), _step19; try { - return !_accessibleTextVirtual(virtualNode); - } catch (e) { - return void 0; + for (_iterator19.s(); !(_step19 = _iterator19.n()).done; ) { + var vNeighbor = _step19.value; + if (!isDescendantNotInTabOrder2(vNode, vNeighbor) && _hasVisualOverlap(vNode, vNeighbor) && getCssPointerEvents(vNeighbor) !== 'none') { + if (isEnclosedRect2(vNode, vNeighbor)) { + fullyObscuringElms.push(vNeighbor); + } else { + partialObscuringElms.push(vNeighbor); + } + } + } + } catch (err) { + _iterator19.e(err); + } finally { + _iterator19.f(); } + return { + fullyObscuringElms: fullyObscuringElms, + partialObscuringElms: partialObscuringElms + }; } - var focusable_no_name_evaluate_default = focusableNoNameEvaluate; - function focusableNotTabbableEvaluate(node, options, virtualNode) { - var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ]; - var tabbableElements = virtualNode.tabbableElements; - if (!tabbableElements || !tabbableElements.length) { - return true; - } - var relatedNodes = tabbableElements.filter(function(vNode) { - return !elementsThatCanBeDisabled.includes(vNode.props.nodeName); + function getLargestUnobscuredArea(vNode, obscuredNodes) { + var nodeRect = vNode.boundingClientRect; + var obscuringRects = obscuredNodes.map(function(_ref128) { + var rect = _ref128.boundingClientRect; + return rect; }); - this.relatedNodes(relatedNodes.map(function(vNode) { - return vNode.actualNode; - })); - if (relatedNodes.length === 0 || is_modal_open_default()) { - return true; + var unobscuredRects = _splitRects(nodeRect, obscuringRects); + if (unobscuredRects.length === 0) { + return null; } - return relatedNodes.every(function(vNode) { - var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events'); - var width = parseInt(vNode.getComputedStylePropertyValue('width')); - var height = parseInt(vNode.getComputedStylePropertyValue('height')); - return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none'; - }) ? void 0 : false; + return getLargestRect2(unobscuredRects); } - var focusable_not_tabbable_evaluate_default = focusableNotTabbableEvaluate; - function frameFocusableContentEvaluate(node, options, virtualNode) { - if (!virtualNode.children) { - return void 0; + function getLargestRect2(rects, minSize) { + return rects.reduce(function(rectA, rectB) { + var rectAisMinimum = _rectHasMinimumSize(minSize, rectA); + var rectBisMinimum = _rectHasMinimumSize(minSize, rectB); + if (rectAisMinimum !== rectBisMinimum) { + return rectAisMinimum ? rectA : rectB; + } + var areaA = rectA.width * rectA.height; + var areaB = rectB.width * rectB.height; + return areaA > areaB ? rectA : rectB; + }); + } + function filterFocusableWidgets(vNodes) { + return vNodes.filter(function(vNode) { + return get_role_type_default(vNode) === 'widget' && _isFocusable(vNode); + }); + } + function isEnclosedRect2(vNodeA, vNodeB) { + var rectA = vNodeA.boundingClientRect; + var rectB = vNodeB.boundingClientRect; + return rectA.top >= rectB.top && rectA.left >= rectB.left && rectA.bottom <= rectB.bottom && rectA.right <= rectB.right; + } + function getCssPointerEvents(vNode) { + return vNode.getComputedStylePropertyValue('pointer-events'); + } + function toDecimalSize(rect) { + return { + width: Math.round(rect.width * 10) / 10, + height: Math.round(rect.height * 10) / 10 + }; + } + function isDescendantNotInTabOrder2(vAncestor, vNode) { + return vAncestor.actualNode.contains(vNode.actualNode) && !_isInTabOrder(vNode); + } + function mapActualNodes(vNodes) { + return vNodes.map(function(_ref129) { + var actualNode = _ref129.actualNode; + return actualNode; + }); + } + var roundingMargin2 = .05; + function targetOffsetEvaluate(node, options, vNode) { + var minOffset = (options === null || options === void 0 ? void 0 : options.minOffset) || 24; + if (_rectHasMinimumSize(minOffset * 10, vNode.boundingClientRect)) { + this.data({ + messageKey: 'large', + minOffset: minOffset + }); + return true; } + var closeNeighbors = []; + var closestOffset = minOffset; + var _iterator20 = _createForOfIteratorHelper(_findNearbyElms(vNode, minOffset)), _step20; try { - return !virtualNode.children.some(function(child) { - return focusableDescendants(child); - }); - } catch (e) { - return void 0; + for (_iterator20.s(); !(_step20 = _iterator20.n()).done; ) { + var vNeighbor = _step20.value; + if (get_role_type_default(vNeighbor) !== 'widget' || !_isFocusable(vNeighbor)) { + continue; + } + var offset = roundToSingleDecimal(_getOffset(vNode, vNeighbor, minOffset / 2)) * 2; + if (offset + roundingMargin2 >= minOffset) { + continue; + } + closestOffset = Math.min(closestOffset, offset); + closeNeighbors.push(vNeighbor); + } + } catch (err) { + _iterator20.e(err); + } finally { + _iterator20.f(); } - } - function focusableDescendants(vNode) { - if (_isInTabOrder(vNode)) { + if (closeNeighbors.length === 0) { + this.data({ + closestOffset: closestOffset, + minOffset: minOffset + }); return true; } - if (!vNode.children) { - if (vNode.props.nodeType === 1) { - throw new Error('Cannot determine children'); - } - return false; + this.relatedNodes(closeNeighbors.map(function(_ref130) { + var actualNode = _ref130.actualNode; + return actualNode; + })); + if (!closeNeighbors.some(_isInTabOrder)) { + this.data({ + messageKey: 'nonTabbableNeighbor', + closestOffset: closestOffset, + minOffset: minOffset + }); + return void 0; } - return vNode.children.some(function(child) { - return focusableDescendants(child); - }); - } - function landmarkIsTopLevelEvaluate(node) { - var landmarks = get_aria_roles_by_type_default('landmark'); - var parent = get_composed_parent_default(node); - var nodeRole = get_role_default(node); this.data({ - role: nodeRole + closestOffset: closestOffset, + minOffset: minOffset }); - while (parent) { - var role = parent.getAttribute('role'); - if (!role && parent.nodeName.toUpperCase() !== 'FORM') { - role = implicit_role_default(parent); - } - if (role && landmarks.includes(role) && !(role === 'main' && nodeRole === 'complementary')) { - return false; - } - parent = get_composed_parent_default(parent); - } - return true; + return _isInTabOrder(vNode) ? false : void 0; } - var landmark_is_top_level_evaluate_default = landmarkIsTopLevelEvaluate; - function noFocusableContentEvaluate(node, options, virtualNode) { - if (!virtualNode.children) { - return void 0; + function roundToSingleDecimal(num) { + return Math.round(num * 10) / 10; + } + function metaViewportScaleEvaluate(node, options, virtualNode) { + var _ref131 = options || {}, _ref131$scaleMinimum = _ref131.scaleMinimum, scaleMinimum = _ref131$scaleMinimum === void 0 ? 2 : _ref131$scaleMinimum, _ref131$lowerBound = _ref131.lowerBound, lowerBound = _ref131$lowerBound === void 0 ? false : _ref131$lowerBound; + var content = virtualNode.attr('content') || ''; + if (!content) { + return true; } - try { - var focusableDescendants2 = getFocusableDescendants(virtualNode); - if (!focusableDescendants2.length) { - return true; + var result = content.split(/[;,]/).reduce(function(out, item) { + var contentValue = item.trim(); + if (!contentValue) { + return out; } - var notHiddenElements = focusableDescendants2.filter(usesUnreliableHidingStrategy); - if (notHiddenElements.length > 0) { - this.data({ - messageKey: 'notHidden' - }); - this.relatedNodes(notHiddenElements); - } else { - this.relatedNodes(focusableDescendants2); + var _contentValue$split = contentValue.split('='), _contentValue$split2 = _slicedToArray(_contentValue$split, 2), key = _contentValue$split2[0], value = _contentValue$split2[1]; + if (!key || !value) { + return out; } - return false; - } catch (e) { - return void 0; - } - } - function getFocusableDescendants(vNode) { - if (!vNode.children) { - if (vNode.props.nodeType === 1) { - throw new Error('Cannot determine children'); + var curatedKey = key.toLowerCase().trim(); + var curatedValue = value.toLowerCase().trim(); + if (curatedKey === 'maximum-scale' && curatedValue === 'yes') { + curatedValue = 1; } - return []; - } - var retVal = []; - vNode.children.forEach(function(child) { - if (get_role_type_default(child) === 'widget' && _isFocusable(child)) { - retVal.push(child); - } else { - retVal.push.apply(retVal, _toConsumableArray(getFocusableDescendants(child))); + if (curatedKey === 'maximum-scale' && parseFloat(curatedValue) < 0) { + return out; } - }); - return retVal; - } - function usesUnreliableHidingStrategy(vNode) { - var tabIndex = parseInt(vNode.attr('tabindex'), 10); - return !isNaN(tabIndex) && tabIndex < 0; - } - function tabindexEvaluate(node, options, virtualNode) { - var tabIndex = parseInt(virtualNode.attr('tabindex'), 10); - return isNaN(tabIndex) ? true : tabIndex <= 0; - } - var tabindex_evaluate_default = tabindexEvaluate; - function altSpaceValueEvaluate(node, options, virtualNode) { - var alt = virtualNode.attr('alt'); - var isOnlySpace = /^\s+$/; - return typeof alt === 'string' && isOnlySpace.test(alt); - } - var alt_space_value_evaluate_default = altSpaceValueEvaluate; - function duplicateImgLabelEvaluate(node, options, virtualNode) { - if ([ 'none', 'presentation' ].includes(get_role_default(virtualNode))) { - return false; + out[curatedKey] = curatedValue; + return out; + }, {}); + if (lowerBound && result['maximum-scale'] && parseFloat(result['maximum-scale']) < lowerBound) { + return true; } - var parentVNode = closest_default(virtualNode, options.parentSelector); - if (!parentVNode) { + if (!lowerBound && result['user-scalable'] === 'no') { + this.data('user-scalable=no'); return false; } - var visibleText = visible_virtual_default(parentVNode, true).toLowerCase(); - if (visibleText === '') { + var userScalableAsFloat = parseFloat(result['user-scalable']); + if (!lowerBound && result['user-scalable'] && (userScalableAsFloat || userScalableAsFloat === 0) && userScalableAsFloat > -1 && userScalableAsFloat < 1) { + this.data('user-scalable'); return false; } - return visibleText === _accessibleTextVirtual(virtualNode).toLowerCase(); - } - var duplicate_img_label_evaluate_default = duplicateImgLabelEvaluate; - function explicitEvaluate(node, options, virtualNode) { - var _this7 = this; - if (!virtualNode.attr('id')) { + if (result['maximum-scale'] && parseFloat(result['maximum-scale']) < scaleMinimum) { + this.data('maximum-scale'); return false; } - if (!virtualNode.actualNode) { + return true; + } + var meta_viewport_scale_evaluate_default = metaViewportScaleEvaluate; + function cssOrientationLockEvaluate(node, options, virtualNode, context) { + var _ref132 = context || {}, _ref132$cssom = _ref132.cssom, cssom = _ref132$cssom === void 0 ? void 0 : _ref132$cssom; + var _ref133 = options || {}, _ref133$degreeThresho = _ref133.degreeThreshold, degreeThreshold = _ref133$degreeThresho === void 0 ? 0 : _ref133$degreeThresho; + if (!cssom || !cssom.length) { return void 0; } - var root = get_root_node_default2(virtualNode.actualNode); - var id = escape_selector_default(virtualNode.attr('id')); - var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]'))); - this.relatedNodes(labels); - if (!labels.length) { - return false; + var isLocked = false; + var relatedElements = []; + var rulesGroupByDocumentFragment = groupCssomByDocument(cssom); + var _loop7 = function _loop7() { + var key = _Object$keys3[_i33]; + var _rulesGroupByDocument = rulesGroupByDocumentFragment[key], root = _rulesGroupByDocument.root, rules = _rulesGroupByDocument.rules; + var orientationRules = rules.filter(isMediaRuleWithOrientation); + if (!orientationRules.length) { + return 1; + } + orientationRules.forEach(function(_ref134) { + var cssRules = _ref134.cssRules; + Array.from(cssRules).forEach(function(cssRule) { + var locked = getIsOrientationLocked(cssRule); + if (locked && cssRule.selectorText.toUpperCase() !== 'HTML') { + var elms = Array.from(root.querySelectorAll(cssRule.selectorText)) || []; + relatedElements = relatedElements.concat(elms); + } + isLocked = isLocked || locked; + }); + }); + }; + for (var _i33 = 0, _Object$keys3 = Object.keys(rulesGroupByDocumentFragment); _i33 < _Object$keys3.length; _i33++) { + if (_loop7()) { + continue; + } } - try { - return labels.some(function(label3) { - if (!_isVisibleOnScreen(label3)) { - return true; - } else { - var explicitLabel = sanitize_default(accessible_text_default(label3, { - inControlContext: true, - startNode: virtualNode - })); - _this7.data({ - explicitLabel: explicitLabel - }); - return !!explicitLabel; + if (!isLocked) { + return true; + } + if (relatedElements.length) { + this.relatedNodes(relatedElements); + } + return false; + function groupCssomByDocument(cssObjectModel) { + return cssObjectModel.reduce(function(out, _ref135) { + var sheet = _ref135.sheet, root = _ref135.root, shadowId = _ref135.shadowId; + var key = shadowId ? shadowId : 'topDocument'; + if (!out[key]) { + out[key] = { + root: root, + rules: [] + }; } - }); - } catch (e) { - return void 0; + if (!sheet || !sheet.cssRules) { + return out; + } + var rules = Array.from(sheet.cssRules); + out[key].rules = out[key].rules.concat(rules); + return out; + }, {}); + } + function isMediaRuleWithOrientation(_ref136) { + var type2 = _ref136.type, cssText = _ref136.cssText; + if (type2 !== 4) { + return false; + } + return /orientation:\s*landscape/i.test(cssText) || /orientation:\s*portrait/i.test(cssText); + } + function getIsOrientationLocked(_ref137) { + var selectorText = _ref137.selectorText, style = _ref137.style; + if (!selectorText || style.length <= 0) { + return false; + } + var transformStyle = style.transform || style.webkitTransform || style.msTransform || false; + if (!transformStyle && !style.rotate) { + return false; + } + var transformDegrees = getTransformDegrees(transformStyle); + var rotateDegrees = getRotationInDegrees('rotate', style.rotate); + var degrees = transformDegrees + rotateDegrees; + if (!degrees) { + return false; + } + degrees = Math.abs(degrees); + if (Math.abs(degrees - 180) % 180 <= degreeThreshold) { + return false; + } + return Math.abs(degrees - 90) % 90 <= degreeThreshold; } - } - var explicit_evaluate_default = explicitEvaluate; - function helpSameAsLabelEvaluate(node, options, virtualNode) { - var labelText2 = label_virtual_default2(virtualNode), check = node.getAttribute('title'); - if (!labelText2) { - return false; + function getTransformDegrees(transformStyle) { + if (!transformStyle) { + return 0; + } + var matches4 = transformStyle.match(/(rotate|rotateZ|rotate3d|matrix|matrix3d)\(([^)]+)\)(?!.*(rotate|rotateZ|rotate3d|matrix|matrix3d))/); + if (!matches4) { + return 0; + } + var _matches2 = _slicedToArray(matches4, 3), transformFn = _matches2[1], transformFnValue = _matches2[2]; + return getRotationInDegrees(transformFn, transformFnValue); } - if (!check) { - check = ''; - if (node.getAttribute('aria-describedby')) { - var ref = idrefs_default(node, 'aria-describedby'); - check = ref.map(function(thing) { - return thing ? accessible_text_default(thing) : ''; - }).join(''); + function getRotationInDegrees(transformFunction, transformFnValue) { + switch (transformFunction) { + case 'rotate': + case 'rotateZ': + return getAngleInDegrees(transformFnValue); + + case 'rotate3d': + var _transformFnValue$spl = transformFnValue.split(',').map(function(value) { + return value.trim(); + }), _transformFnValue$spl2 = _slicedToArray(_transformFnValue$spl, 4), z = _transformFnValue$spl2[2], angleWithUnit = _transformFnValue$spl2[3]; + if (parseInt(z) === 0) { + return; + } + return getAngleInDegrees(angleWithUnit); + + case 'matrix': + case 'matrix3d': + return getAngleInDegreesFromMatrixTransform(transformFnValue); + + default: + return 0; } } - return sanitize_default(check) === sanitize_default(labelText2); - } - var help_same_as_label_evaluate_default = helpSameAsLabelEvaluate; - function hiddenExplicitLabelEvaluate(node, options, virtualNode) { - if (virtualNode.hasAttr('id')) { - if (!virtualNode.actualNode) { - return void 0; + function getAngleInDegrees(angleWithUnit) { + var _ref138 = angleWithUnit.match(/(deg|grad|rad|turn)/) || [], _ref139 = _slicedToArray(_ref138, 1), unit = _ref139[0]; + if (!unit) { + return 0; } - var root = get_root_node_default2(node); - var _id4 = escape_selector_default(node.getAttribute('id')); - var label3 = root.querySelector('label[for="'.concat(_id4, '"]')); - if (label3 && !_isVisibleToScreenReaders(label3)) { - var name; - try { - name = _accessibleTextVirtual(virtualNode).trim(); - } catch (e) { - return void 0; - } - var isNameEmpty = name === ''; - return isNameEmpty; + var angle = parseFloat(angleWithUnit.replace(unit, '')); + switch (unit) { + case 'rad': + return convertRadToDeg(angle); + + case 'grad': + return convertGradToDeg(angle); + + case 'turn': + return convertTurnToDeg(angle); + + case 'deg': + default: + return parseInt(angle); } } - return false; - } - var hidden_explicit_label_evaluate_default = hiddenExplicitLabelEvaluate; - function implicitEvaluate(node, options, virtualNode) { - try { - var label3 = closest_default(virtualNode, 'label'); - if (label3) { - var implicitLabel = sanitize_default(_accessibleTextVirtual(label3, { - inControlContext: true, - startNode: virtualNode - })); - if (label3.actualNode) { - this.relatedNodes([ label3.actualNode ]); - } - this.data({ - implicitLabel: implicitLabel - }); - return !!implicitLabel; + function getAngleInDegreesFromMatrixTransform(transformFnValue) { + var values2 = transformFnValue.split(','); + if (values2.length <= 6) { + var _values = _slicedToArray(values2, 2), a2 = _values[0], b3 = _values[1]; + var radians = Math.atan2(parseFloat(b3), parseFloat(a2)); + return convertRadToDeg(radians); } - return false; - } catch (e) { - return void 0; + var sinB = parseFloat(values2[8]); + var b2 = Math.asin(sinB); + var cosB = Math.cos(b2); + var rotateZRadians = Math.acos(parseFloat(values2[0]) / cosB); + return convertRadToDeg(rotateZRadians); } - } - var implicit_evaluate_default = implicitEvaluate; - function isStringContained(compare, compareWith) { - var curatedCompareWith = curateString(compareWith); - var curatedCompare = curateString(compare); - if (!curatedCompareWith || !curatedCompare) { - return false; + function convertRadToDeg(radians) { + return Math.round(radians * (180 / Math.PI)); + } + function convertGradToDeg(grad) { + grad = grad % 400; + if (grad < 0) { + grad += 400; + } + return Math.round(grad / 400 * 360); + } + function convertTurnToDeg(turn) { + return Math.round(360 / (1 / turn)); } - return curatedCompareWith.includes(curatedCompare); - } - function curateString(str) { - var noUnicodeStr = remove_unicode_default(str, { - emoji: true, - nonBmp: true, - punctuations: true - }); - return sanitize_default(noUnicodeStr); } - function labelContentNameMismatchEvaluate(node, options, virtualNode) { - var _options$occurrenceTh; - var pixelThreshold = options === null || options === void 0 ? void 0 : options.pixelThreshold; - var occurrenceThreshold = (_options$occurrenceTh = options === null || options === void 0 ? void 0 : options.occurrenceThreshold) !== null && _options$occurrenceTh !== void 0 ? _options$occurrenceTh : options === null || options === void 0 ? void 0 : options.occuranceThreshold; - var accText = accessible_text_default(node).toLowerCase(); - if (is_human_interpretable_default(accText) < 1) { + var css_orientation_lock_evaluate_default = cssOrientationLockEvaluate; + function noAutoplayAudioEvaluate(node, options) { + if (!node.duration) { + console.warn('axe.utils.preloadMedia did not load metadata'); return void 0; } - var visibleText = sanitize_default(subtree_text_default(virtualNode, { - subtreeDescendant: true, - ignoreIconLigature: true, - pixelThreshold: pixelThreshold, - occurrenceThreshold: occurrenceThreshold - })).toLowerCase(); - if (!visibleText) { + var _options$allowedDurat = options.allowedDuration, allowedDuration = _options$allowedDurat === void 0 ? 3 : _options$allowedDurat; + var playableDuration = getPlayableDuration(node); + if (playableDuration <= allowedDuration && !node.hasAttribute('loop')) { return true; } - if (is_human_interpretable_default(visibleText) < 1) { - if (isStringContained(visibleText, accText)) { - return true; - } - return void 0; - } - return isStringContained(visibleText, accText); - } - var label_content_name_mismatch_evaluate_default = labelContentNameMismatchEvaluate; - function multipleLabelEvaluate(node) { - var id = escape_selector_default(node.getAttribute('id')); - var parent = node.parentNode; - var root = get_root_node_default2(node); - root = root.documentElement || root; - var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]'))); - if (labels.length) { - labels = labels.filter(function(label3) { - return !_isHiddenForEveryone(label3); - }); + if (!node.hasAttribute('controls')) { + return false; } - while (parent) { - if (parent.nodeName.toUpperCase() === 'LABEL' && labels.indexOf(parent) === -1) { - labels.push(parent); + return true; + function getPlayableDuration(elm) { + if (!elm.currentSrc) { + return 0; } - parent = parent.parentNode; + var playbackRange = getPlaybackRange(elm.currentSrc); + if (!playbackRange) { + return Math.abs(elm.duration - (elm.currentTime || 0)); + } + if (playbackRange.length === 1) { + return Math.abs(elm.duration - playbackRange[0]); + } + return Math.abs(playbackRange[1] - playbackRange[0]); } - this.relatedNodes(labels); - if (labels.length > 1) { - var ATVisibleLabels = labels.filter(function(label3) { - return _isVisibleToScreenReaders(label3); + function getPlaybackRange(src) { + var match = src.match(/#t=(.*)/); + if (!match) { + return; + } + var _match = _slicedToArray(match, 2), value = _match[1]; + var ranges = value.split(','); + return ranges.map(function(range2) { + if (/:/.test(range2)) { + return convertHourMinSecToSeconds(range2); + } + return parseFloat(range2); }); - if (ATVisibleLabels.length > 1) { - return void 0; + } + function convertHourMinSecToSeconds(hhMmSs) { + var parts = hhMmSs.split(':'); + var secs = 0; + var mins = 1; + while (parts.length > 0) { + secs += mins * parseInt(parts.pop(), 10); + mins *= 60; } - var labelledby = idrefs_default(node, 'aria-labelledby'); - return !labelledby.includes(ATVisibleLabels[0]) ? void 0 : false; + return parseFloat(secs); } - return false; } - var multiple_label_evaluate_default = multipleLabelEvaluate; - function titleOnlyEvaluate(node, options, virtualNode) { - var labelText2 = label_virtual_default2(virtualNode); - var title = title_text_default(virtualNode); - var ariaDescribedBy = virtualNode.attr('aria-describedby'); - return !labelText2 && !!(title || ariaDescribedBy); + var no_autoplay_audio_evaluate_default = noAutoplayAudioEvaluate; + function frameTestedEvaluate(node, options) { + return options.isViolation ? false : void 0; } - var title_only_evaluate_default = titleOnlyEvaluate; - function landmarkIsUniqueAfter(results) { - var uniqueLandmarks = []; - return results.filter(function(currentResult) { - var findMatch = function findMatch(someResult) { - return currentResult.data.role === someResult.data.role && currentResult.data.accessibleText === someResult.data.accessibleText; - }; - var matchedResult = uniqueLandmarks.find(findMatch); - if (matchedResult) { - matchedResult.result = false; - matchedResult.relatedNodes.push(currentResult.relatedNodes[0]); - return false; + var frame_tested_evaluate_default = frameTestedEvaluate; + var joinStr = ' > '; + function frameTestedAfter(results) { + var iframes = {}; + return results.filter(function(result) { + var frameResult = result.node.ancestry[result.node.ancestry.length - 1] !== 'html'; + if (frameResult) { + var ancestry2 = result.node.ancestry.flat(Infinity).join(joinStr); + iframes[ancestry2] = result; + return true; } - uniqueLandmarks.push(currentResult); - currentResult.relatedNodes = []; - return true; + var ancestry = result.node.ancestry.slice(0, result.node.ancestry.length - 1).flat(Infinity).join(joinStr); + if (iframes[ancestry]) { + iframes[ancestry].result = true; + } + return false; }); } - var landmark_is_unique_after_default = landmarkIsUniqueAfter; - function landmarkIsUniqueEvaluate(node, options, virtualNode) { - var role = get_role_default(node); - var accessibleText2 = _accessibleTextVirtual(virtualNode); - accessibleText2 = accessibleText2 ? accessibleText2.toLowerCase() : null; - this.data({ - role: role, - accessibleText: accessibleText2 + var frame_tested_after_default = frameTestedAfter; + function captionEvaluate(node, options, virtualNode) { + var tracks = query_selector_all_default(virtualNode, 'track'); + var hasCaptions = tracks.some(function(vNode) { + return (vNode.attr('kind') || '').toLowerCase() === 'captions'; }); - this.relatedNodes([ node ]); - return true; - } - var landmark_is_unique_evaluate_default = landmarkIsUniqueEvaluate; - function hasValue(value) { - return (value || '').trim() !== ''; + return hasCaptions ? false : void 0; } - function hasLangEvaluate(node, options, virtualNode) { - var xhtml = typeof document !== 'undefined' ? is_xhtml_default(document) : false; - if (options.attributes.includes('xml:lang') && options.attributes.includes('lang') && hasValue(virtualNode.attr('xml:lang')) && !hasValue(virtualNode.attr('lang')) && !xhtml) { - this.data({ - messageKey: 'noXHTML' - }); + var caption_evaluate_default = captionEvaluate; + function structuredDlitemsEvaluate(node, options, virtualNode) { + var children = virtualNode.children; + if (!children || !children.length) { return false; } - var hasLang = options.attributes.some(function(name) { - return hasValue(virtualNode.attr(name)); - }); - if (!hasLang) { - this.data({ - messageKey: 'noLang' - }); - return false; + var hasDt = false, hasDd = false, nodeName2; + for (var i = 0; i < children.length; i++) { + nodeName2 = children[i].props.nodeName.toUpperCase(); + if (nodeName2 === 'DT') { + hasDt = true; + } + if (hasDt && nodeName2 === 'DD') { + return false; + } + if (nodeName2 === 'DD') { + hasDd = true; + } } - return true; + return hasDt || hasDd; } - var has_lang_evaluate_default = hasLangEvaluate; - function validLangEvaluate(node, options, virtualNode) { - var invalid = []; - options.attributes.forEach(function(langAttr) { - var langVal = virtualNode.attr(langAttr); - if (typeof langVal !== 'string') { + var structured_dlitems_evaluate_default = structuredDlitemsEvaluate; + function onlyListitemsEvaluate(node, options, virtualNode) { + var hasNonEmptyTextNode = false; + var atLeastOneListitem = false; + var isEmpty = true; + var badNodes = []; + var badRoleNodes = []; + var badRoles = []; + virtualNode.children.forEach(function(vNode) { + var actualNode = vNode.actualNode; + if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') { + hasNonEmptyTextNode = true; return; } - var baselangVal = get_base_lang_default(langVal); - var invalidLang = options.value ? !options.value.map(get_base_lang_default).includes(baselangVal) : !valid_langs_default(baselangVal); - if (baselangVal !== '' && invalidLang || langVal !== '' && !sanitize_default(langVal)) { - invalid.push(langAttr + '="' + virtualNode.attr(langAttr) + '"'); + if (actualNode.nodeType !== 1 || !_isVisibleToScreenReaders(actualNode)) { + return; + } + isEmpty = false; + var isLi = actualNode.nodeName.toUpperCase() === 'LI'; + var role = get_role_default(vNode); + var isListItemRole = role === 'listitem'; + if (!isLi && !isListItemRole) { + badNodes.push(actualNode); + } + if (isLi && !isListItemRole) { + badRoleNodes.push(actualNode); + if (!badRoles.includes(role)) { + badRoles.push(role); + } + } + if (isListItemRole) { + atLeastOneListitem = true; } }); - if (!invalid.length) { - return false; + if (hasNonEmptyTextNode || badNodes.length) { + this.relatedNodes(badNodes); + return true; } - if (virtualNode.props.nodeName !== 'html' && !_hasLangText(virtualNode)) { + if (isEmpty || atLeastOneListitem) { return false; } - this.data(invalid); + this.relatedNodes(badRoleNodes); + this.data({ + messageKey: 'roleNotValid', + roles: badRoles.join(', ') + }); return true; } - var valid_lang_evaluate_default = validLangEvaluate; - function xmlLangMismatchEvaluate(node, options, vNode) { - var primaryLangValue = get_base_lang_default(vNode.attr('lang')); - var primaryXmlLangValue = get_base_lang_default(vNode.attr('xml:lang')); - return primaryLangValue === primaryXmlLangValue; + var only_listitems_evaluate_default = onlyListitemsEvaluate; + function onlyDlitemsEvaluate(node, options, virtualNode) { + var ALLOWED_ROLES = [ 'definition', 'term', 'list' ]; + var base = { + badNodes: [], + hasNonEmptyTextNode: false + }; + var content = virtualNode.children.reduce(function(vNodes, child) { + var actualNode = child.actualNode; + if (actualNode.nodeName.toUpperCase() === 'DIV' && get_role_default(actualNode) === null) { + return vNodes.concat(child.children); + } + return vNodes.concat(child); + }, []); + var result = content.reduce(function(out, childNode) { + var actualNode = childNode.actualNode; + var tagName = actualNode.nodeName.toUpperCase(); + if (actualNode.nodeType === 1 && _isVisibleToScreenReaders(actualNode)) { + var explicitRole2 = get_explicit_role_default(actualNode); + if (tagName !== 'DT' && tagName !== 'DD' || explicitRole2) { + if (!ALLOWED_ROLES.includes(explicitRole2)) { + out.badNodes.push(actualNode); + } + } + } else if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') { + out.hasNonEmptyTextNode = true; + } + return out; + }, base); + if (result.badNodes.length) { + this.relatedNodes(result.badNodes); + } + return !!result.badNodes.length || result.hasNonEmptyTextNode; } - var xml_lang_mismatch_evaluate_default = xmlLangMismatchEvaluate; - function dlitemEvaluate(node) { - var parent = get_composed_parent_default(node); - var parentTagName = parent.nodeName.toUpperCase(); + function listitemEvaluate(node, options, virtualNode) { + var parent = virtualNode.parent; + if (!parent) { + return void 0; + } + var parentNodeName = parent.props.nodeName; var parentRole = get_explicit_role_default(parent); - if (parentTagName === 'DIV' && [ 'presentation', 'none', null ].includes(parentRole)) { - parent = get_composed_parent_default(parent); - parentTagName = parent.nodeName.toUpperCase(); - parentRole = get_explicit_role_default(parent); + if ([ 'presentation', 'none', 'list' ].includes(parentRole)) { + return true; } - if (parentTagName !== 'DL') { + if (parentRole && is_valid_role_default(parentRole)) { + this.data({ + messageKey: 'roleNotValid' + }); return false; } - if (!parentRole || [ 'presentation', 'none', 'list' ].includes(parentRole)) { - return true; - } - return false; + return [ 'ul', 'ol', 'menu' ].includes(parentNodeName); } - var dlitem_evaluate_default = dlitemEvaluate; function invalidChildrenEvaluate(node) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var virtualNode = arguments.length > 2 ? arguments[2] : undefined; @@ -23924,7 +25212,7 @@ if (!issues.includes(issue)) { issues.push(issue); } - if ((vChild === null || vChild === void 0 ? void 0 : (_vChild$actualNode = vChild.actualNode) === null || _vChild$actualNode === void 0 ? void 0 : _vChild$actualNode.nodeType) === 1) { + if ((vChild === null || vChild === void 0 || (_vChild$actualNode = vChild.actualNode) === null || _vChild$actualNode === void 0 ? void 0 : _vChild$actualNode.nodeType) === 1) { relatedNodes.push(vChild.actualNode); } } @@ -23937,8 +25225,8 @@ this.relatedNodes(relatedNodes); return true; } - function getInvalidSelector(vChild, nested, _ref117) { - var _ref117$validRoles = _ref117.validRoles, validRoles = _ref117$validRoles === void 0 ? [] : _ref117$validRoles, _ref117$validNodeName = _ref117.validNodeNames, validNodeNames = _ref117$validNodeName === void 0 ? [] : _ref117$validNodeName; + function getInvalidSelector(vChild, nested, _ref140) { + var _ref140$validRoles = _ref140.validRoles, validRoles = _ref140$validRoles === void 0 ? [] : _ref140$validRoles, _ref140$validNodeName = _ref140.validNodeNames, validNodeNames = _ref140$validNodeName === void 0 ? [] : _ref140$validNodeName; var _vChild$props = vChild.props, nodeName2 = _vChild$props.nodeName, nodeType = _vChild$props.nodeType, nodeValue = _vChild$props.nodeValue; var selector = nested ? 'div > ' : ''; if (nodeType === 3 && nodeValue.trim() !== '') { @@ -23966,1883 +25254,2041 @@ }; }); } - function listitemEvaluate(node, options, virtualNode) { - var parent = virtualNode.parent; - if (!parent) { - return void 0; - } - var parentNodeName = parent.props.nodeName; + function dlitemEvaluate(node) { + var parent = get_composed_parent_default(node); + var parentTagName = parent.nodeName.toUpperCase(); var parentRole = get_explicit_role_default(parent); - if ([ 'presentation', 'none', 'list' ].includes(parentRole)) { - return true; + if (parentTagName === 'DIV' && [ 'presentation', 'none', null ].includes(parentRole)) { + parent = get_composed_parent_default(parent); + parentTagName = parent.nodeName.toUpperCase(); + parentRole = get_explicit_role_default(parent); } - if (parentRole && is_valid_role_default(parentRole)) { - this.data({ - messageKey: 'roleNotValid' - }); + if (parentTagName !== 'DL') { return false; } - return [ 'ul', 'ol', 'menu' ].includes(parentNodeName); - } - function onlyDlitemsEvaluate(node, options, virtualNode) { - var ALLOWED_ROLES = [ 'definition', 'term', 'list' ]; - var base = { - badNodes: [], - hasNonEmptyTextNode: false - }; - var content = virtualNode.children.reduce(function(vNodes, child) { - var actualNode = child.actualNode; - if (actualNode.nodeName.toUpperCase() === 'DIV' && get_role_default(actualNode) === null) { - return vNodes.concat(child.children); - } - return vNodes.concat(child); - }, []); - var result = content.reduce(function(out, childNode) { - var actualNode = childNode.actualNode; - var tagName = actualNode.nodeName.toUpperCase(); - if (actualNode.nodeType === 1 && _isVisibleToScreenReaders(actualNode)) { - var explicitRole2 = get_explicit_role_default(actualNode); - if (tagName !== 'DT' && tagName !== 'DD' || explicitRole2) { - if (!ALLOWED_ROLES.includes(explicitRole2)) { - out.badNodes.push(actualNode); - } - } - } else if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') { - out.hasNonEmptyTextNode = true; - } - return out; - }, base); - if (result.badNodes.length) { - this.relatedNodes(result.badNodes); - } - return !!result.badNodes.length || result.hasNonEmptyTextNode; - } - function onlyListitemsEvaluate(node, options, virtualNode) { - var hasNonEmptyTextNode = false; - var atLeastOneListitem = false; - var isEmpty = true; - var badNodes = []; - var badRoleNodes = []; - var badRoles = []; - virtualNode.children.forEach(function(vNode) { - var actualNode = vNode.actualNode; - if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') { - hasNonEmptyTextNode = true; - return; - } - if (actualNode.nodeType !== 1 || !_isVisibleToScreenReaders(actualNode)) { + if (!parentRole || [ 'presentation', 'none', 'list' ].includes(parentRole)) { + return true; + } + return false; + } + var dlitem_evaluate_default = dlitemEvaluate; + function xmlLangMismatchEvaluate(node, options, vNode) { + var primaryLangValue = get_base_lang_default(vNode.attr('lang')); + var primaryXmlLangValue = get_base_lang_default(vNode.attr('xml:lang')); + return primaryLangValue === primaryXmlLangValue; + } + var xml_lang_mismatch_evaluate_default = xmlLangMismatchEvaluate; + function validLangEvaluate(node, options, virtualNode) { + var invalid = []; + options.attributes.forEach(function(langAttr) { + var langVal = virtualNode.attr(langAttr); + if (typeof langVal !== 'string') { return; } - isEmpty = false; - var isLi = actualNode.nodeName.toUpperCase() === 'LI'; - var role = get_role_default(vNode); - var isListItemRole = role === 'listitem'; - if (!isLi && !isListItemRole) { - badNodes.push(actualNode); - } - if (isLi && !isListItemRole) { - badRoleNodes.push(actualNode); - if (!badRoles.includes(role)) { - badRoles.push(role); - } - } - if (isListItemRole) { - atLeastOneListitem = true; + var baselangVal = get_base_lang_default(langVal); + var invalidLang = options.value ? !options.value.map(get_base_lang_default).includes(baselangVal) : !valid_langs_default(baselangVal); + if (baselangVal !== '' && invalidLang || langVal !== '' && !sanitize_default(langVal)) { + invalid.push(langAttr + '="' + virtualNode.attr(langAttr) + '"'); } }); - if (hasNonEmptyTextNode || badNodes.length) { - this.relatedNodes(badNodes); - return true; + if (!invalid.length) { + return false; } - if (isEmpty || atLeastOneListitem) { + if (virtualNode.props.nodeName !== 'html' && !_hasLangText(virtualNode)) { return false; } - this.relatedNodes(badRoleNodes); - this.data({ - messageKey: 'roleNotValid', - roles: badRoles.join(', ') - }); + this.data(invalid); return true; } - var only_listitems_evaluate_default = onlyListitemsEvaluate; - function structuredDlitemsEvaluate(node, options, virtualNode) { - var children = virtualNode.children; - if (!children || !children.length) { + var valid_lang_evaluate_default = validLangEvaluate; + function hasValue(value) { + return (value || '').trim() !== ''; + } + function hasLangEvaluate(node, options, virtualNode) { + var xhtml = typeof document !== 'undefined' ? is_xhtml_default(document) : false; + if (options.attributes.includes('xml:lang') && options.attributes.includes('lang') && hasValue(virtualNode.attr('xml:lang')) && !hasValue(virtualNode.attr('lang')) && !xhtml) { + this.data({ + messageKey: 'noXHTML' + }); return false; } - var hasDt = false, hasDd = false, nodeName2; - for (var i = 0; i < children.length; i++) { - nodeName2 = children[i].props.nodeName.toUpperCase(); - if (nodeName2 === 'DT') { - hasDt = true; - } - if (hasDt && nodeName2 === 'DD') { - return false; - } - if (nodeName2 === 'DD') { - hasDd = true; - } + var hasLang = options.attributes.some(function(name) { + return hasValue(virtualNode.attr(name)); + }); + if (!hasLang) { + this.data({ + messageKey: 'noLang' + }); + return false; } - return hasDt || hasDd; + return true; } - var structured_dlitems_evaluate_default = structuredDlitemsEvaluate; - function captionEvaluate(node, options, virtualNode) { - var tracks = query_selector_all_default(virtualNode, 'track'); - var hasCaptions = tracks.some(function(vNode) { - return (vNode.attr('kind') || '').toLowerCase() === 'captions'; + var has_lang_evaluate_default = hasLangEvaluate; + function landmarkIsUniqueEvaluate(node, options, virtualNode) { + var role = get_role_default(node); + var accessibleText2 = _accessibleTextVirtual(virtualNode); + accessibleText2 = accessibleText2 ? accessibleText2.toLowerCase() : null; + this.data({ + role: role, + accessibleText: accessibleText2 }); - return hasCaptions ? false : void 0; + this.relatedNodes([ node ]); + return true; } - var caption_evaluate_default = captionEvaluate; - var joinStr = ' > '; - function frameTestedAfter(results) { - var iframes = {}; - return results.filter(function(result) { - var frameResult = result.node.ancestry[result.node.ancestry.length - 1] !== 'html'; - if (frameResult) { - var ancestry2 = result.node.ancestry.flat(Infinity).join(joinStr); - iframes[ancestry2] = result; - return true; + var landmark_is_unique_evaluate_default = landmarkIsUniqueEvaluate; + function landmarkIsUniqueAfter(results) { + var uniqueLandmarks = []; + return results.filter(function(currentResult) { + var findMatch = function findMatch(someResult) { + return currentResult.data.role === someResult.data.role && currentResult.data.accessibleText === someResult.data.accessibleText; + }; + var matchedResult = uniqueLandmarks.find(findMatch); + if (matchedResult) { + matchedResult.result = false; + matchedResult.relatedNodes.push(currentResult.relatedNodes[0]); + return false; } - var ancestry = result.node.ancestry.slice(0, result.node.ancestry.length - 1).flat(Infinity).join(joinStr); - if (iframes[ancestry]) { - iframes[ancestry].result = true; + uniqueLandmarks.push(currentResult); + currentResult.relatedNodes = []; + return true; + }); + } + var landmark_is_unique_after_default = landmarkIsUniqueAfter; + function titleOnlyEvaluate(node, options, virtualNode) { + var labelText2 = label_virtual_default2(virtualNode); + var title = title_text_default(virtualNode); + var ariaDescribedBy = virtualNode.attr('aria-describedby'); + return !labelText2 && !!(title || ariaDescribedBy); + } + var title_only_evaluate_default = titleOnlyEvaluate; + function multipleLabelEvaluate(node) { + var id = escape_selector_default(node.getAttribute('id')); + var parent = node.parentNode; + var root = get_root_node_default2(node); + root = root.documentElement || root; + var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]'))); + if (labels.length) { + labels = labels.filter(function(label3) { + return !_isHiddenForEveryone(label3); + }); + } + while (parent) { + if (parent.nodeName.toUpperCase() === 'LABEL' && labels.indexOf(parent) === -1) { + labels.push(parent); + } + parent = parent.parentNode; + } + this.relatedNodes(labels); + if (labels.length > 1) { + var ATVisibleLabels = labels.filter(function(label3) { + return _isVisibleToScreenReaders(label3); + }); + if (ATVisibleLabels.length > 1) { + return void 0; } + var labelledby = idrefs_default(node, 'aria-labelledby'); + return !labelledby.includes(ATVisibleLabels[0]) ? void 0 : false; + } + return false; + } + var multiple_label_evaluate_default = multipleLabelEvaluate; + function isStringContained(compare, compareWith) { + var curatedCompareWith = curateString(compareWith); + var curatedCompare = curateString(compare); + if (!curatedCompareWith || !curatedCompare) { return false; - }); + } + return curatedCompareWith.includes(curatedCompare); } - var frame_tested_after_default = frameTestedAfter; - function frameTestedEvaluate(node, options) { - return options.isViolation ? false : void 0; + function curateString(str) { + var noUnicodeStr = remove_unicode_default(str, { + emoji: true, + nonBmp: true, + punctuations: true + }); + return sanitize_default(noUnicodeStr); } - var frame_tested_evaluate_default = frameTestedEvaluate; - function noAutoplayAudioEvaluate(node, options) { - if (!node.duration) { - console.warn('axe.utils.preloadMedia did not load metadata'); + function labelContentNameMismatchEvaluate(node, options, virtualNode) { + var _options$occurrenceTh; + var pixelThreshold = options === null || options === void 0 ? void 0 : options.pixelThreshold; + var occurrenceThreshold = (_options$occurrenceTh = options === null || options === void 0 ? void 0 : options.occurrenceThreshold) !== null && _options$occurrenceTh !== void 0 ? _options$occurrenceTh : options === null || options === void 0 ? void 0 : options.occuranceThreshold; + var accText = accessible_text_default(node).toLowerCase(); + if (is_human_interpretable_default(accText) < 1) { return void 0; } - var _options$allowedDurat = options.allowedDuration, allowedDuration = _options$allowedDurat === void 0 ? 3 : _options$allowedDurat; - var playableDuration = getPlayableDuration(node); - if (playableDuration <= allowedDuration && !node.hasAttribute('loop')) { + var visibleText = sanitize_default(subtree_text_default(virtualNode, { + subtreeDescendant: true, + ignoreIconLigature: true, + pixelThreshold: pixelThreshold, + occurrenceThreshold: occurrenceThreshold + })).toLowerCase(); + if (!visibleText) { return true; } - if (!node.hasAttribute('controls')) { - return false; + if (is_human_interpretable_default(visibleText) < 1) { + if (isStringContained(visibleText, accText)) { + return true; + } + return void 0; } - return true; - function getPlayableDuration(elm) { - if (!elm.currentSrc) { - return 0; + return isStringContained(visibleText, accText); + } + var label_content_name_mismatch_evaluate_default = labelContentNameMismatchEvaluate; + function implicitEvaluate(node, options, virtualNode) { + try { + var label3 = closest_default(virtualNode, 'label'); + if (label3) { + var implicitLabel = sanitize_default(_accessibleTextVirtual(label3, { + inControlContext: true, + startNode: virtualNode + })); + if (label3.actualNode) { + this.relatedNodes([ label3.actualNode ]); + } + this.data({ + implicitLabel: implicitLabel + }); + return !!implicitLabel; } - var playbackRange = getPlaybackRange(elm.currentSrc); - if (!playbackRange) { - return Math.abs(elm.duration - (elm.currentTime || 0)); + return false; + } catch (e) { + return void 0; + } + } + var implicit_evaluate_default = implicitEvaluate; + function hiddenExplicitLabelEvaluate(node, options, virtualNode) { + if (virtualNode.hasAttr('id')) { + if (!virtualNode.actualNode) { + return void 0; } - if (playbackRange.length === 1) { - return Math.abs(elm.duration - playbackRange[0]); + var root = get_root_node_default2(node); + var _id4 = escape_selector_default(node.getAttribute('id')); + var label3 = root.querySelector('label[for="'.concat(_id4, '"]')); + if (label3 && !_isVisibleToScreenReaders(label3)) { + var name; + try { + name = _accessibleTextVirtual(virtualNode).trim(); + } catch (e) { + return void 0; + } + var isNameEmpty = name === ''; + return isNameEmpty; } - return Math.abs(playbackRange[1] - playbackRange[0]); } - function getPlaybackRange(src) { - var match = src.match(/#t=(.*)/); - if (!match) { - return; - } - var _match = _slicedToArray(match, 2), value = _match[1]; - var ranges = value.split(','); - return ranges.map(function(range2) { - if (/:/.test(range2)) { - return convertHourMinSecToSeconds(range2); - } - return parseFloat(range2); - }); + return false; + } + var hidden_explicit_label_evaluate_default = hiddenExplicitLabelEvaluate; + function helpSameAsLabelEvaluate(node, options, virtualNode) { + var labelText2 = label_virtual_default2(virtualNode), check = node.getAttribute('title'); + if (!labelText2) { + return false; } - function convertHourMinSecToSeconds(hhMmSs) { - var parts = hhMmSs.split(':'); - var secs = 0; - var mins = 1; - while (parts.length > 0) { - secs += mins * parseInt(parts.pop(), 10); - mins *= 60; + if (!check) { + check = ''; + if (node.getAttribute('aria-describedby')) { + var ref = idrefs_default(node, 'aria-describedby'); + check = ref.map(function(thing) { + return thing ? accessible_text_default(thing) : ''; + }).join(''); } - return parseFloat(secs); } + return sanitize_default(check) === sanitize_default(labelText2); } - var no_autoplay_audio_evaluate_default = noAutoplayAudioEvaluate; - function cssOrientationLockEvaluate(node, options, virtualNode, context) { - var _ref118 = context || {}, _ref118$cssom = _ref118.cssom, cssom = _ref118$cssom === void 0 ? void 0 : _ref118$cssom; - var _ref119 = options || {}, _ref119$degreeThresho = _ref119.degreeThreshold, degreeThreshold = _ref119$degreeThresho === void 0 ? 0 : _ref119$degreeThresho; - if (!cssom || !cssom.length) { + var help_same_as_label_evaluate_default = helpSameAsLabelEvaluate; + function explicitEvaluate(node, options, virtualNode) { + var _this7 = this; + if (!virtualNode.attr('id')) { + return false; + } + if (!virtualNode.actualNode) { return void 0; } - var isLocked = false; - var relatedElements = []; - var rulesGroupByDocumentFragment = groupCssomByDocument(cssom); - var _loop8 = function _loop8() { - var key = _Object$keys3[_i34]; - var _rulesGroupByDocument = rulesGroupByDocumentFragment[key], root = _rulesGroupByDocument.root, rules = _rulesGroupByDocument.rules; - var orientationRules = rules.filter(isMediaRuleWithOrientation); - if (!orientationRules.length) { - return 'continue'; - } - orientationRules.forEach(function(_ref120) { - var cssRules = _ref120.cssRules; - Array.from(cssRules).forEach(function(cssRule) { - var locked = getIsOrientationLocked(cssRule); - if (locked && cssRule.selectorText.toUpperCase() !== 'HTML') { - var elms = Array.from(root.querySelectorAll(cssRule.selectorText)) || []; - relatedElements = relatedElements.concat(elms); - } - isLocked = isLocked || locked; - }); - }); - }; - for (var _i34 = 0, _Object$keys3 = Object.keys(rulesGroupByDocumentFragment); _i34 < _Object$keys3.length; _i34++) { - var _ret6 = _loop8(); - if (_ret6 === 'continue') { - continue; - } + var root = get_root_node_default2(virtualNode.actualNode); + var id = escape_selector_default(virtualNode.attr('id')); + var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]'))); + this.relatedNodes(labels); + if (!labels.length) { + return false; } - if (!isLocked) { - return true; + try { + return labels.some(function(label3) { + if (!_isVisibleOnScreen(label3)) { + return true; + } else { + var explicitLabel = sanitize_default(accessible_text_default(label3, { + inControlContext: true, + startNode: virtualNode + })); + _this7.data({ + explicitLabel: explicitLabel + }); + return !!explicitLabel; + } + }); + } catch (e) { + return void 0; } - if (relatedElements.length) { - this.relatedNodes(relatedElements); + } + var explicit_evaluate_default = explicitEvaluate; + function duplicateImgLabelEvaluate(node, options, virtualNode) { + if ([ 'none', 'presentation' ].includes(get_role_default(virtualNode))) { + return false; } - return false; - function groupCssomByDocument(cssObjectModel) { - return cssObjectModel.reduce(function(out, _ref121) { - var sheet = _ref121.sheet, root = _ref121.root, shadowId = _ref121.shadowId; - var key = shadowId ? shadowId : 'topDocument'; - if (!out[key]) { - out[key] = { - root: root, - rules: [] - }; - } - if (!sheet || !sheet.cssRules) { - return out; - } - var rules = Array.from(sheet.cssRules); - out[key].rules = out[key].rules.concat(rules); - return out; - }, {}); + var parentVNode = closest_default(virtualNode, options.parentSelector); + if (!parentVNode) { + return false; } - function isMediaRuleWithOrientation(_ref122) { - var type2 = _ref122.type, cssText = _ref122.cssText; - if (type2 !== 4) { - return false; - } - return /orientation:\s*landscape/i.test(cssText) || /orientation:\s*portrait/i.test(cssText); + var visibleText = visible_virtual_default(parentVNode, true).toLowerCase(); + if (visibleText === '') { + return false; } - function getIsOrientationLocked(_ref123) { - var selectorText = _ref123.selectorText, style = _ref123.style; - if (!selectorText || style.length <= 0) { - return false; - } - var transformStyle = style.transform || style.webkitTransform || style.msTransform || false; - if (!transformStyle && !style.rotate) { - return false; - } - var transformDegrees = getTransformDegrees(transformStyle); - var rotateDegrees = getRotationInDegrees('rotate', style.rotate); - var degrees = transformDegrees + rotateDegrees; - if (!degrees) { - return false; - } - degrees = Math.abs(degrees); - if (Math.abs(degrees - 180) % 180 <= degreeThreshold) { - return false; - } - return Math.abs(degrees - 90) % 90 <= degreeThreshold; + return visibleText === _accessibleTextVirtual(virtualNode).toLowerCase(); + } + var duplicate_img_label_evaluate_default = duplicateImgLabelEvaluate; + function altSpaceValueEvaluate(node, options, virtualNode) { + var alt = virtualNode.attr('alt'); + var isOnlySpace = /^\s+$/; + return typeof alt === 'string' && isOnlySpace.test(alt); + } + var alt_space_value_evaluate_default = altSpaceValueEvaluate; + function tabindexEvaluate(node, options, virtualNode) { + var tabIndex = parseInt(virtualNode.attr('tabindex'), 10); + return isNaN(tabIndex) ? true : tabIndex <= 0; + } + var tabindex_evaluate_default = tabindexEvaluate; + function noFocusableContentEvaluate(node, options, virtualNode) { + if (!virtualNode.children) { + return void 0; } - function getTransformDegrees(transformStyle) { - if (!transformStyle) { - return 0; + try { + var focusableDescendants2 = getFocusableDescendants(virtualNode); + if (!focusableDescendants2.length) { + return true; } - var matches4 = transformStyle.match(/(rotate|rotateZ|rotate3d|matrix|matrix3d)\(([^)]+)\)(?!.*(rotate|rotateZ|rotate3d|matrix|matrix3d))/); - if (!matches4) { - return 0; + var notHiddenElements = focusableDescendants2.filter(usesUnreliableHidingStrategy); + if (notHiddenElements.length > 0) { + this.data({ + messageKey: 'notHidden' + }); + this.relatedNodes(notHiddenElements); + } else { + this.relatedNodes(focusableDescendants2); } - var _matches2 = _slicedToArray(matches4, 3), transformFn = _matches2[1], transformFnValue = _matches2[2]; - return getRotationInDegrees(transformFn, transformFnValue); + return false; + } catch (e) { + return void 0; } - function getRotationInDegrees(transformFunction, transformFnValue) { - switch (transformFunction) { - case 'rotate': - case 'rotateZ': - return getAngleInDegrees(transformFnValue); - - case 'rotate3d': - var _transformFnValue$spl = transformFnValue.split(',').map(function(value) { - return value.trim(); - }), _transformFnValue$spl2 = _slicedToArray(_transformFnValue$spl, 4), z = _transformFnValue$spl2[2], angleWithUnit = _transformFnValue$spl2[3]; - if (parseInt(z) === 0) { - return; - } - return getAngleInDegrees(angleWithUnit); - - case 'matrix': - case 'matrix3d': - return getAngleInDegreesFromMatrixTransform(transformFnValue); - - default: - return 0; + } + function getFocusableDescendants(vNode) { + if (!vNode.children) { + if (vNode.props.nodeType === 1) { + throw new Error('Cannot determine children'); } + return []; } - function getAngleInDegrees(angleWithUnit) { - var _ref124 = angleWithUnit.match(/(deg|grad|rad|turn)/) || [], _ref125 = _slicedToArray(_ref124, 1), unit = _ref125[0]; - if (!unit) { - return 0; + var retVal = []; + vNode.children.forEach(function(child) { + if (get_role_type_default(child) === 'widget' && _isFocusable(child)) { + retVal.push(child); + } else { + retVal.push.apply(retVal, _toConsumableArray(getFocusableDescendants(child))); } - var angle = parseFloat(angleWithUnit.replace(unit, '')); - switch (unit) { - case 'rad': - return convertRadToDeg(angle); - - case 'grad': - return convertGradToDeg(angle); - - case 'turn': - return convertTurnToDeg(angle); - - case 'deg': - default: - return parseInt(angle); + }); + return retVal; + } + function usesUnreliableHidingStrategy(vNode) { + var tabIndex = parseInt(vNode.attr('tabindex'), 10); + return !isNaN(tabIndex) && tabIndex < 0; + } + function landmarkIsTopLevelEvaluate(node) { + var landmarks = get_aria_roles_by_type_default('landmark'); + var parent = get_composed_parent_default(node); + var nodeRole = get_role_default(node); + this.data({ + role: nodeRole + }); + while (parent) { + var role = parent.getAttribute('role'); + if (!role && parent.nodeName.toUpperCase() !== 'FORM') { + role = implicit_role_default(parent); } - } - function getAngleInDegreesFromMatrixTransform(transformFnValue) { - var values2 = transformFnValue.split(','); - if (values2.length <= 6) { - var _values = _slicedToArray(values2, 2), a2 = _values[0], b3 = _values[1]; - var radians = Math.atan2(parseFloat(b3), parseFloat(a2)); - return convertRadToDeg(radians); + if (role && landmarks.includes(role) && !(role === 'main' && nodeRole === 'complementary')) { + return false; } - var sinB = parseFloat(values2[8]); - var b2 = Math.asin(sinB); - var cosB = Math.cos(b2); - var rotateZRadians = Math.acos(parseFloat(values2[0]) / cosB); - return convertRadToDeg(rotateZRadians); - } - function convertRadToDeg(radians) { - return Math.round(radians * (180 / Math.PI)); + parent = get_composed_parent_default(parent); } - function convertGradToDeg(grad) { - grad = grad % 400; - if (grad < 0) { - grad += 400; - } - return Math.round(grad / 400 * 360); + return true; + } + var landmark_is_top_level_evaluate_default = landmarkIsTopLevelEvaluate; + function frameFocusableContentEvaluate(node, options, virtualNode) { + if (!virtualNode.children) { + return void 0; } - function convertTurnToDeg(turn) { - return Math.round(360 / (1 / turn)); + try { + return !virtualNode.children.some(function(child) { + return focusableDescendants(child); + }); + } catch (e) { + return void 0; } } - var css_orientation_lock_evaluate_default = cssOrientationLockEvaluate; - function metaViewportScaleEvaluate(node, options, virtualNode) { - var _ref126 = options || {}, _ref126$scaleMinimum = _ref126.scaleMinimum, scaleMinimum = _ref126$scaleMinimum === void 0 ? 2 : _ref126$scaleMinimum, _ref126$lowerBound = _ref126.lowerBound, lowerBound = _ref126$lowerBound === void 0 ? false : _ref126$lowerBound; - var content = virtualNode.attr('content') || ''; - if (!content) { + function focusableDescendants(vNode) { + if (_isInTabOrder(vNode)) { return true; } - var result = content.split(/[;,]/).reduce(function(out, item) { - var contentValue = item.trim(); - if (!contentValue) { - return out; - } - var _contentValue$split = contentValue.split('='), _contentValue$split2 = _slicedToArray(_contentValue$split, 2), key = _contentValue$split2[0], value = _contentValue$split2[1]; - if (!key || !value) { - return out; - } - var curatedKey = key.toLowerCase().trim(); - var curatedValue = value.toLowerCase().trim(); - if (curatedKey === 'maximum-scale' && curatedValue === 'yes') { - curatedValue = 1; - } - if (curatedKey === 'maximum-scale' && parseFloat(curatedValue) < 0) { - return out; + if (!vNode.children) { + if (vNode.props.nodeType === 1) { + throw new Error('Cannot determine children'); } - out[curatedKey] = curatedValue; - return out; - }, {}); - if (lowerBound && result['maximum-scale'] && parseFloat(result['maximum-scale']) < lowerBound) { + return false; + } + return vNode.children.some(function(child) { + return focusableDescendants(child); + }); + } + function focusableNotTabbableEvaluate(node, options, virtualNode) { + var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ]; + var tabbableElements = virtualNode.tabbableElements; + if (!tabbableElements || !tabbableElements.length) { return true; } - if (!lowerBound && result['user-scalable'] === 'no') { - this.data('user-scalable=no'); - return false; + var relatedNodes = tabbableElements.filter(function(vNode) { + return !elementsThatCanBeDisabled.includes(vNode.props.nodeName); + }); + this.relatedNodes(relatedNodes.map(function(vNode) { + return vNode.actualNode; + })); + if (relatedNodes.length === 0 || is_modal_open_default()) { + return true; } - var userScalableAsFloat = parseFloat(result['user-scalable']); - if (!lowerBound && result['user-scalable'] && (userScalableAsFloat || userScalableAsFloat === 0) && userScalableAsFloat > -1 && userScalableAsFloat < 1) { - this.data('user-scalable'); + return relatedNodes.every(function(vNode) { + var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events'); + var width = parseInt(vNode.getComputedStylePropertyValue('width')); + var height = parseInt(vNode.getComputedStylePropertyValue('height')); + return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none'; + }) ? void 0 : false; + } + var focusable_not_tabbable_evaluate_default = focusableNotTabbableEvaluate; + function focusableNoNameEvaluate(node, options, virtualNode) { + var tabIndex = virtualNode.attr('tabindex'); + var inFocusOrder = _isFocusable(virtualNode) && tabIndex > -1; + if (!inFocusOrder) { return false; } - if (result['maximum-scale'] && parseFloat(result['maximum-scale']) < scaleMinimum) { - this.data('maximum-scale'); - return false; + try { + return !_accessibleTextVirtual(virtualNode); + } catch (e) { + return void 0; + } + } + var focusable_no_name_evaluate_default = focusableNoNameEvaluate; + function focusableModalOpenEvaluate(node, options, virtualNode) { + var tabbableElements = virtualNode.tabbableElements.map(function(_ref141) { + var actualNode = _ref141.actualNode; + return actualNode; + }); + if (!tabbableElements || !tabbableElements.length) { + return true; + } + if (is_modal_open_default()) { + this.relatedNodes(tabbableElements); + return void 0; } return true; } - var meta_viewport_scale_evaluate_default = metaViewportScaleEvaluate; - var roundingMargin2 = .05; - function targetOffsetEvaluate(node, options, vNode) { - var minOffset = (options === null || options === void 0 ? void 0 : options.minOffset) || 24; - var closeNeighbors = []; - var closestOffset = minOffset; - var _iterator19 = _createForOfIteratorHelper(_findNearbyElms(vNode, minOffset)), _step19; - try { - for (_iterator19.s(); !(_step19 = _iterator19.n()).done; ) { - var vNeighbor = _step19.value; - if (get_role_type_default(vNeighbor) !== 'widget' || !_isFocusable(vNeighbor)) { - continue; - } - var offset = roundToSingleDecimal(_getOffset(vNode, vNeighbor, minOffset / 2)) * 2; - if (offset + roundingMargin2 >= minOffset) { - continue; - } - closestOffset = Math.min(closestOffset, offset); - closeNeighbors.push(vNeighbor); + var focusable_modal_open_evaluate_default = focusableModalOpenEvaluate; + function focusableElementEvaluate(node, options, virtualNode) { + if (virtualNode.hasAttr('contenteditable') && isContenteditable(virtualNode)) { + return true; + } + return _isInTabOrder(virtualNode); + function isContenteditable(vNode) { + var contenteditable = vNode.attr('contenteditable'); + if (contenteditable === 'true' || contenteditable === '') { + return true; } - } catch (err) { - _iterator19.e(err); - } finally { - _iterator19.f(); + if (contenteditable === 'false') { + return false; + } + var ancestor = closest_default(virtualNode.parent, '[contenteditable]'); + if (!ancestor) { + return false; + } + return isContenteditable(ancestor); } - if (closeNeighbors.length === 0) { - this.data({ - closestOffset: closestOffset, - minOffset: minOffset - }); + } + var focusable_element_evaluate_default = focusableElementEvaluate; + function focusableDisabledEvaluate(node, options, virtualNode) { + var elementsThatCanBeDisabled = [ 'button', 'fieldset', 'input', 'select', 'textarea' ]; + var tabbableElements = virtualNode.tabbableElements; + if (!tabbableElements || !tabbableElements.length) { return true; } - this.relatedNodes(closeNeighbors.map(function(_ref127) { - var actualNode = _ref127.actualNode; - return actualNode; + var relatedNodes = tabbableElements.filter(function(vNode) { + return elementsThatCanBeDisabled.includes(vNode.props.nodeName); + }); + this.relatedNodes(relatedNodes.map(function(vNode) { + return vNode.actualNode; })); - if (!closeNeighbors.some(_isInTabOrder)) { - this.data({ - messageKey: 'nonTabbableNeighbor', - closestOffset: closestOffset, - minOffset: minOffset - }); - return void 0; + if (relatedNodes.length === 0 || is_modal_open_default()) { + return true; } - this.data({ - closestOffset: closestOffset, - minOffset: minOffset - }); - return _isInTabOrder(vNode) ? false : void 0; + return relatedNodes.every(function(vNode) { + var pointerEvents = vNode.getComputedStylePropertyValue('pointer-events'); + var width = parseInt(vNode.getComputedStylePropertyValue('width')); + var height = parseInt(vNode.getComputedStylePropertyValue('height')); + return vNode.actualNode.onfocus || (width === 0 || height === 0) && pointerEvents === 'none'; + }) ? void 0 : false; } - function roundToSingleDecimal(num) { - return Math.round(num * 10) / 10; + var focusable_disabled_evaluate_default = focusableDisabledEvaluate; + function focusableContentEvaluate(node, options, virtualNode) { + var tabbableElements = virtualNode.tabbableElements; + if (!tabbableElements) { + return false; + } + var tabbableContentElements = tabbableElements.filter(function(el) { + return el !== virtualNode; + }); + return tabbableContentElements.length > 0; } - function targetSize(node, options, vNode) { - var minSize = (options === null || options === void 0 ? void 0 : options.minSize) || 24; - var nodeRect = vNode.boundingClientRect; - var hasMinimumSize = _rectHasMinimumSize.bind(null, minSize); - var nearbyElms = _findNearbyElms(vNode); - var overflowingContent = filterOverflowingContent(vNode, nearbyElms); - var _filterByElmsOverlap = filterByElmsOverlap(vNode, nearbyElms), fullyObscuringElms = _filterByElmsOverlap.fullyObscuringElms, partialObscuringElms = _filterByElmsOverlap.partialObscuringElms; - if (fullyObscuringElms.length && !overflowingContent.length) { - this.relatedNodes(mapActualNodes(fullyObscuringElms)); - this.data({ - messageKey: 'obscured' - }); - return true; + var focusable_content_evaluate_default = focusableContentEvaluate; + function accesskeysEvaluate(node, options, vNode) { + if (!_isHiddenForEveryone(vNode)) { + this.data(vNode.attr('accesskey')); + this.relatedNodes([ node ]); } - var negativeOutcome = _isInTabOrder(vNode) ? false : void 0; - if (!hasMinimumSize(nodeRect) && !overflowingContent.length) { - this.data(_extends({ - minSize: minSize - }, toDecimalSize(nodeRect))); - return negativeOutcome; + return true; + } + var accesskeys_evaluate_default = accesskeysEvaluate; + function accesskeysAfter(results) { + var seen = {}; + return results.filter(function(r) { + if (!r.data) { + return false; + } + var key = r.data.toUpperCase(); + if (!seen[key]) { + seen[key] = r; + r.relatedNodes = []; + return true; + } + seen[key].relatedNodes.push(r.relatedNodes[0]); + return false; + }).map(function(r) { + r.result = !!r.relatedNodes.length; + return r; + }); + } + var accesskeys_after_default = accesskeysAfter; + function pageNoDuplicateEvaluate(node, options, virtualNode) { + if (!options || !options.selector || typeof options.selector !== 'string') { + throw new TypeError('page-no-duplicate requires options.selector to be a string'); } - var obscuredWidgets = filterFocusableWidgets(partialObscuringElms); - var largestInnerRect = getLargestUnobscuredArea(vNode, obscuredWidgets); - if (overflowingContent.length) { - if (fullyObscuringElms.length || !hasMinimumSize(largestInnerRect || nodeRect)) { - this.data({ - minSize: minSize, - messageKey: 'contentOverflow' - }); - this.relatedNodes(mapActualNodes(overflowingContent)); - return void 0; - } + var key = 'page-no-duplicate;' + options.selector; + if (cache_default.get(key)) { + this.data('ignored'); + return; } - if (obscuredWidgets.length !== 0 && !hasMinimumSize(largestInnerRect)) { - var allTabbable = obscuredWidgets.every(_isInTabOrder); - var messageKey = 'partiallyObscured'.concat(allTabbable ? '' : 'NonTabbable'); - this.data(_extends({ - messageKey: messageKey, - minSize: minSize - }, toDecimalSize(largestInnerRect))); - this.relatedNodes(mapActualNodes(obscuredWidgets)); - return allTabbable ? negativeOutcome : void 0; + cache_default.set(key, true); + var elms = query_selector_all_filter_default(axe._tree[0], options.selector, function(elm) { + return _isVisibleToScreenReaders(elm); + }); + if (typeof options.nativeScopeFilter === 'string') { + elms = elms.filter(function(elm) { + return elm.actualNode.hasAttribute('role') || !find_up_virtual_default(elm, options.nativeScopeFilter); + }); } - this.data(_extends({ - minSize: minSize - }, toDecimalSize(largestInnerRect || nodeRect))); - this.relatedNodes(mapActualNodes(obscuredWidgets)); - return true; + if (typeof options.role === 'string') { + elms = elms.filter(function(elm) { + return get_role_default(elm) === options.role; + }); + } + this.relatedNodes(elms.filter(function(elm) { + return elm !== virtualNode; + }).map(function(elm) { + return elm.actualNode; + })); + return elms.length <= 1; } - function filterOverflowingContent(vNode, nearbyElms) { - return nearbyElms.filter(function(nearbyElm) { - return !isEnclosedRect2(nearbyElm, vNode) && isDescendantNotInTabOrder2(vNode, nearbyElm); + var page_no_duplicate_evaluate_default = pageNoDuplicateEvaluate; + function pageNoDuplicateAfter(results) { + return results.filter(function(checkResult) { + return checkResult.data !== 'ignored'; }); } - function filterByElmsOverlap(vNode, nearbyElms) { - var fullyObscuringElms = []; - var partialObscuringElms = []; - var _iterator20 = _createForOfIteratorHelper(nearbyElms), _step20; + var page_no_duplicate_after_default = pageNoDuplicateAfter; + function matchesDefinitionEvaluate(_, options, virtualNode) { + return matches_default2(virtualNode, options.matcher); + } + var matches_definition_evaluate_default = matchesDefinitionEvaluate; + function hasTextContentEvaluate(node, options, virtualNode) { try { - for (_iterator20.s(); !(_step20 = _iterator20.n()).done; ) { - var vNeighbor = _step20.value; - if (!isDescendantNotInTabOrder2(vNode, vNeighbor) && _hasVisualOverlap(vNode, vNeighbor) && getCssPointerEvents(vNeighbor) !== 'none') { - if (isEnclosedRect2(vNode, vNeighbor)) { - fullyObscuringElms.push(vNeighbor); - } else { - partialObscuringElms.push(vNeighbor); - } - } - } - } catch (err) { - _iterator20.e(err); - } finally { - _iterator20.f(); + return sanitize_default(subtree_text_default(virtualNode)) !== ''; + } catch (e) { + return void 0; } - return { - fullyObscuringElms: fullyObscuringElms, - partialObscuringElms: partialObscuringElms - }; } - function getLargestUnobscuredArea(vNode, obscuredNodes) { - var nodeRect = vNode.boundingClientRect; - if (obscuredNodes.length === 0) { - return null; + function hasDescendant(node, options, virtualNode) { + if (!options || !options.selector || typeof options.selector !== 'string') { + throw new TypeError('has-descendant requires options.selector to be a string'); } - var obscuringRects = obscuredNodes.map(function(_ref128) { - var rect = _ref128.boundingClientRect; - return rect; - }); - var unobscuredRects = _splitRects(nodeRect, obscuringRects); - return getLargestRect2(unobscuredRects); - } - function getLargestRect2(rects, minSize) { - return rects.reduce(function(rectA, rectB) { - var rectAisMinimum = _rectHasMinimumSize(minSize, rectA); - var rectBisMinimum = _rectHasMinimumSize(minSize, rectB); - if (rectAisMinimum !== rectBisMinimum) { - return rectAisMinimum ? rectA : rectB; - } - var areaA = rectA.width * rectA.height; - var areaB = rectB.width * rectB.height; - return areaA > areaB ? rectA : rectB; + if (options.passForModal && is_modal_open_default()) { + return true; + } + var matchingElms = query_selector_all_filter_default(virtualNode, options.selector, function(vNode) { + return _isVisibleToScreenReaders(vNode); }); + this.relatedNodes(matchingElms.map(function(vNode) { + return vNode.actualNode; + })); + return matchingElms.length > 0; } - function filterFocusableWidgets(vNodes) { - return vNodes.filter(function(vNode) { - return get_role_type_default(vNode) === 'widget' && _isFocusable(vNode); + var has_descendant_evaluate_default = hasDescendant; + function pageHasElmAfter(results) { + var elmUsedAnywhere = results.some(function(frameResult) { + return frameResult.result === true; }); + if (elmUsedAnywhere) { + results.forEach(function(result) { + result.result = true; + }); + } + return results; } - function isEnclosedRect2(vNodeA, vNodeB) { - var rectA = vNodeA.boundingClientRect; - var rectB = vNodeB.boundingClientRect; - return rectA.top >= rectB.top && rectA.left >= rectB.left && rectA.bottom <= rectB.bottom && rectA.right <= rectB.right; + var has_descendant_after_default = pageHasElmAfter; + function attrNonSpaceContentEvaluate(node) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var vNode = arguments.length > 2 ? arguments[2] : undefined; + if (!options.attribute || typeof options.attribute !== 'string') { + throw new TypeError('attr-non-space-content requires options.attribute to be a string'); + } + if (!vNode.hasAttr(options.attribute)) { + this.data({ + messageKey: 'noAttr' + }); + return false; + } + var attribute = vNode.attr(options.attribute); + var attributeIsEmpty = !sanitize_default(attribute); + if (attributeIsEmpty) { + this.data({ + messageKey: 'emptyAttr' + }); + return false; + } + return true; } - function getCssPointerEvents(vNode) { - return vNode.getComputedStylePropertyValue('pointer-events'); + var attr_non_space_content_evaluate_default = attrNonSpaceContentEvaluate; + function autocompleteValidEvaluate(node, options, virtualNode) { + var autocomplete2 = virtualNode.attr('autocomplete') || ''; + return is_valid_autocomplete_default(autocomplete2, options); } - function toDecimalSize(rect) { - return { - width: Math.round(rect.width * 10) / 10, - height: Math.round(rect.height * 10) / 10 + var autocomplete_valid_evaluate_default = autocompleteValidEvaluate; + function autocompleteAppropriateEvaluate(node, options, virtualNode) { + if (virtualNode.props.nodeName !== 'input') { + return true; + } + var number = [ 'text', 'search', 'number', 'tel' ]; + var url = [ 'text', 'search', 'url' ]; + var allowedTypesMap = { + bday: [ 'text', 'search', 'date' ], + email: [ 'text', 'search', 'email' ], + username: [ 'text', 'search', 'email' ], + 'street-address': [ 'text' ], + tel: [ 'text', 'search', 'tel' ], + 'tel-country-code': [ 'text', 'search', 'tel' ], + 'tel-national': [ 'text', 'search', 'tel' ], + 'tel-area-code': [ 'text', 'search', 'tel' ], + 'tel-local': [ 'text', 'search', 'tel' ], + 'tel-local-prefix': [ 'text', 'search', 'tel' ], + 'tel-local-suffix': [ 'text', 'search', 'tel' ], + 'tel-extension': [ 'text', 'search', 'tel' ], + 'cc-number': number, + 'cc-exp': [ 'text', 'search', 'month', 'tel' ], + 'cc-exp-month': number, + 'cc-exp-year': number, + 'cc-csc': number, + 'transaction-amount': number, + 'bday-day': number, + 'bday-month': number, + 'bday-year': number, + 'new-password': [ 'text', 'search', 'password' ], + 'current-password': [ 'text', 'search', 'password' ], + url: url, + photo: url, + impp: url }; - } - function isDescendantNotInTabOrder2(vAncestor, vNode) { - return vAncestor.actualNode.contains(vNode.actualNode) && !_isInTabOrder(vNode); - } - function mapActualNodes(vNodes) { - return vNodes.map(function(_ref129) { - var actualNode = _ref129.actualNode; - return actualNode; - }); - } - function headingOrderAfter(results) { - var headingOrder = getHeadingOrder(results); - results.forEach(function(result) { - result.result = getHeadingOrderOutcome(result, headingOrder); + if (_typeof(options) === 'object') { + Object.keys(options).forEach(function(key) { + if (!allowedTypesMap[key]) { + allowedTypesMap[key] = []; + } + allowedTypesMap[key] = allowedTypesMap[key].concat(options[key]); + }); + } + var autocompleteAttr = virtualNode.attr('autocomplete'); + var autocompleteTerms = autocompleteAttr.split(/\s+/g).map(function(term) { + return term.toLowerCase(); }); - return results; + var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1]; + if (_autocomplete.stateTerms.includes(purposeTerm)) { + return true; + } + var allowedTypes = allowedTypesMap[purposeTerm]; + var type2 = virtualNode.hasAttr('type') ? sanitize_default(virtualNode.attr('type')).toLowerCase() : 'text'; + type2 = valid_input_type_default().includes(type2) ? type2 : 'text'; + if (typeof allowedTypes === 'undefined') { + return type2 === 'text'; + } + return allowedTypes.includes(type2); } - function getHeadingOrderOutcome(result, headingOrder) { - var _headingOrder$index$l, _headingOrder$index, _headingOrder$level, _headingOrder; - var index = findHeadingOrderIndex(headingOrder, result.node.ancestry); - var currLevel = (_headingOrder$index$l = (_headingOrder$index = headingOrder[index]) === null || _headingOrder$index === void 0 ? void 0 : _headingOrder$index.level) !== null && _headingOrder$index$l !== void 0 ? _headingOrder$index$l : -1; - var prevLevel = (_headingOrder$level = (_headingOrder = headingOrder[index - 1]) === null || _headingOrder === void 0 ? void 0 : _headingOrder.level) !== null && _headingOrder$level !== void 0 ? _headingOrder$level : -1; - if (index === 0) { + var autocomplete_appropriate_evaluate_default = autocompleteAppropriateEvaluate; + var blockLike2 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ]; + function linkInTextBlockStyleEvaluate(node) { + if (isBlock2(node)) { + return false; + } + var parentBlock = get_composed_parent_default(node); + while (parentBlock && parentBlock.nodeType === 1 && !isBlock2(parentBlock)) { + parentBlock = get_composed_parent_default(parentBlock); + } + if (!parentBlock) { + return void 0; + } + this.relatedNodes([ parentBlock ]); + if (element_is_distinct_default(node, parentBlock)) { return true; } - if (currLevel === -1) { + if (hasPseudoContent(node)) { + this.data({ + messageKey: 'pseudoContent' + }); return void 0; } - return currLevel - prevLevel <= 1; - } - function getHeadingOrder(results) { - results = _toConsumableArray(results); - results.sort(function(_ref130, _ref131) { - var nodeA = _ref130.node; - var nodeB = _ref131.node; - return nodeA.ancestry.length - nodeB.ancestry.length; - }); - var headingOrder = results.reduce(mergeHeadingOrder, []); - return headingOrder.filter(function(_ref132) { - var level = _ref132.level; - return level !== -1; - }); + return false; } - function mergeHeadingOrder(mergedHeadingOrder, result) { - var _result$data; - var frameHeadingOrder = (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.headingOrder; - var frameAncestry = shortenArray(result.node.ancestry, 1); - if (!frameHeadingOrder) { - return mergedHeadingOrder; - } - var normalizedHeadingOrder = frameHeadingOrder.map(function(heading) { - return addFrameToHeadingAncestry(heading, frameAncestry); - }); - var index = getFrameIndex(mergedHeadingOrder, frameAncestry); - if (index === -1) { - mergedHeadingOrder.push.apply(mergedHeadingOrder, _toConsumableArray(normalizedHeadingOrder)); - } else { - mergedHeadingOrder.splice.apply(mergedHeadingOrder, [ index, 0 ].concat(_toConsumableArray(normalizedHeadingOrder))); - } - return mergedHeadingOrder; + function isBlock2(elm) { + var display2 = window.getComputedStyle(elm).getPropertyValue('display'); + return blockLike2.indexOf(display2) !== -1 || display2.substr(0, 6) === 'table-'; } - function getFrameIndex(headingOrder, frameAncestry) { - while (frameAncestry.length) { - var index = findHeadingOrderIndex(headingOrder, frameAncestry); - if (index !== -1) { - return index; + function hasPseudoContent(node) { + for (var _i34 = 0, _arr3 = [ 'before', 'after' ]; _i34 < _arr3.length; _i34++) { + var pseudo = _arr3[_i34]; + var style = window.getComputedStyle(node, ':'.concat(pseudo)); + var content = style.getPropertyValue('content'); + if (content !== 'none') { + return true; } - frameAncestry = shortenArray(frameAncestry, 1); } - return -1; - } - function findHeadingOrderIndex(headingOrder, ancestry) { - return headingOrder.findIndex(function(heading) { - return _matchAncestry(heading.ancestry, ancestry); - }); + return false; } - function addFrameToHeadingAncestry(heading, frameAncestry) { - var ancestry = frameAncestry.concat(heading.ancestry); - return _extends({}, heading, { - ancestry: ancestry - }); + function getContrast2(color1, color2) { + var c1lum = color1.getRelativeLuminance(); + var c2lum = color2.getRelativeLuminance(); + return (Math.max(c1lum, c2lum) + .05) / (Math.min(c1lum, c2lum) + .05); } - function shortenArray(arr, spliceLength) { - return arr.slice(0, arr.length - spliceLength); + var blockLike3 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ]; + function isBlock3(elm) { + var display2 = window.getComputedStyle(elm).getPropertyValue('display'); + return blockLike3.indexOf(display2) !== -1 || display2.substr(0, 6) === 'table-'; } - function getLevel(vNode) { - var role = get_role_default(vNode); - var headingRole = role && role.includes('heading'); - var ariaHeadingLevel = vNode.attr('aria-level'); - var ariaLevel = parseInt(ariaHeadingLevel, 10); - var _ref133 = vNode.props.nodeName.match(/h(\d)/) || [], _ref134 = _slicedToArray(_ref133, 2), headingLevel = _ref134[1]; - if (!headingRole) { - return -1; + function linkInTextBlockEvaluate(node, options) { + var requiredContrastRatio = options.requiredContrastRatio, allowSameColor = options.allowSameColor; + if (isBlock3(node)) { + return false; } - if (headingLevel && !ariaHeadingLevel) { - return parseInt(headingLevel, 10); + var parentBlock = get_composed_parent_default(node); + while (parentBlock && parentBlock.nodeType === 1 && !isBlock3(parentBlock)) { + parentBlock = get_composed_parent_default(parentBlock); } - if (isNaN(ariaLevel) || ariaLevel < 1) { - if (headingLevel) { - return parseInt(headingLevel, 10); - } - return 2; + if (!parentBlock) { + return void 0; } - if (ariaLevel) { - return ariaLevel; + this.relatedNodes([ parentBlock ]); + var nodeColor = _getForegroundColor(node); + var parentColor = _getForegroundColor(parentBlock); + var nodeBackgroundColor = _getBackgroundColor2(node); + var parentBackgroundColor = _getBackgroundColor2(parentBlock); + var textContrast = nodeColor && parentColor ? getContrast2(nodeColor, parentColor) : void 0; + if (textContrast) { + textContrast = Math.floor(textContrast * 100) / 100; } - return -1; + if (textContrast && textContrast >= requiredContrastRatio) { + return true; + } + var backgroundContrast = nodeBackgroundColor && parentBackgroundColor ? getContrast2(nodeBackgroundColor, parentBackgroundColor) : void 0; + if (backgroundContrast) { + backgroundContrast = Math.floor(backgroundContrast * 100) / 100; + } + if (backgroundContrast && backgroundContrast >= requiredContrastRatio) { + return true; + } + if (!backgroundContrast) { + var _incomplete_data_defa; + var reason = (_incomplete_data_defa = incomplete_data_default.get('bgColor')) !== null && _incomplete_data_defa !== void 0 ? _incomplete_data_defa : 'bgContrast'; + this.data({ + messageKey: reason + }); + incomplete_data_default.clear(); + return void 0; + } + if (!textContrast) { + return void 0; + } + if (allowSameColor && textContrast === 1 && backgroundContrast === 1) { + return true; + } + if (textContrast === 1 && backgroundContrast > 1) { + this.data({ + messageKey: 'bgContrast', + contrastRatio: backgroundContrast, + requiredContrastRatio: requiredContrastRatio, + nodeBackgroundColor: nodeBackgroundColor ? nodeBackgroundColor.toHexString() : void 0, + parentBackgroundColor: parentBackgroundColor ? parentBackgroundColor.toHexString() : void 0 + }); + return false; + } + this.data({ + messageKey: 'fgContrast', + contrastRatio: textContrast, + requiredContrastRatio: requiredContrastRatio, + nodeColor: nodeColor ? nodeColor.toHexString() : void 0, + parentColor: parentColor ? parentColor.toHexString() : void 0 + }); + return false; } - function headingOrderEvaluate() { - var headingOrder = cache_default.get('headingOrder'); - if (headingOrder) { + var link_in_text_block_evaluate_default = linkInTextBlockEvaluate; + function colorContrastEvaluate(node, options, virtualNode) { + var ignoreUnicode = options.ignoreUnicode, ignoreLength = options.ignoreLength, ignorePseudo = options.ignorePseudo, boldValue = options.boldValue, boldTextPt = options.boldTextPt, largeTextPt = options.largeTextPt, contrastRatio = options.contrastRatio, shadowOutlineEmMax = options.shadowOutlineEmMax, pseudoSizeThreshold = options.pseudoSizeThreshold; + if (!_isVisibleOnScreen(node)) { + this.data({ + messageKey: 'hidden' + }); return true; } - var selector = 'h1, h2, h3, h4, h5, h6, [role=heading], iframe, frame'; - var vNodes = query_selector_all_filter_default(axe._tree[0], selector, _isVisibleToScreenReaders); - headingOrder = vNodes.map(function(vNode) { - return { - ancestry: [ _getAncestry(vNode.actualNode) ], - level: getLevel(vNode) - }; + var visibleText = visible_virtual_default(virtualNode, false, true); + if (ignoreUnicode && textIsEmojis(visibleText)) { + this.data({ + messageKey: 'nonBmp' + }); + return void 0; + } + var nodeStyle = window.getComputedStyle(node); + var fontSize = parseFloat(nodeStyle.getPropertyValue('font-size')); + var fontWeight = nodeStyle.getPropertyValue('font-weight'); + var bold = parseFloat(fontWeight) >= boldValue || fontWeight === 'bold'; + var ptSize = Math.ceil(fontSize * 72) / 96; + var isSmallFont = bold && ptSize < boldTextPt || !bold && ptSize < largeTextPt; + var _ref142 = isSmallFont ? contrastRatio.normal : contrastRatio.large, expected = _ref142.expected, minThreshold = _ref142.minThreshold, maxThreshold = _ref142.maxThreshold; + var pseudoElm = findPseudoElement(virtualNode, { + ignorePseudo: ignorePseudo, + pseudoSizeThreshold: pseudoSizeThreshold + }); + if (pseudoElm) { + this.data({ + fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'), + fontWeight: bold ? 'bold' : 'normal', + messageKey: 'pseudoContent', + expectedContrastRatio: expected + ':1' + }); + this.relatedNodes(pseudoElm.actualNode); + return void 0; + } + var shadowColors = _getTextShadowColors(node, { + minRatio: .001, + maxRatio: shadowOutlineEmMax }); + if (shadowColors === null) { + this.data({ + messageKey: 'complexTextShadows' + }); + return void 0; + } + var bgNodes = []; + var bgColor = _getBackgroundColor2(node, bgNodes, shadowOutlineEmMax); + var fgColor = _getForegroundColor(node, false, bgColor, options); + var contrast2 = null; + var contrastContributor = null; + var shadowColor = null; + if (shadowColors.length === 0) { + contrast2 = get_contrast_default(bgColor, fgColor); + } else if (fgColor && bgColor) { + shadowColor = [].concat(_toConsumableArray(shadowColors), [ bgColor ]).reduce(_flattenShadowColors); + var fgBgContrast = get_contrast_default(bgColor, fgColor); + var bgShContrast = get_contrast_default(bgColor, shadowColor); + var fgShContrast = get_contrast_default(shadowColor, fgColor); + contrast2 = Math.max(fgBgContrast, bgShContrast, fgShContrast); + if (contrast2 !== fgBgContrast) { + contrastContributor = bgShContrast > fgShContrast ? 'shadowOnBgColor' : 'fgOnShadowColor'; + } + } + var isValid = contrast2 > expected; + if (typeof minThreshold === 'number' && (typeof contrast2 !== 'number' || contrast2 < minThreshold) || typeof maxThreshold === 'number' && (typeof contrast2 !== 'number' || contrast2 > maxThreshold)) { + this.data({ + contrastRatio: contrast2 + }); + return true; + } + var truncatedResult = Math.floor(contrast2 * 100) / 100; + var missing; + if (bgColor === null) { + missing = incomplete_data_default.get('bgColor'); + } else if (!isValid) { + missing = contrastContributor; + } + var equalRatio = truncatedResult === 1; + var shortTextContent = visibleText.length === 1; + if (equalRatio) { + missing = incomplete_data_default.set('bgColor', 'equalRatio'); + } else if (!isValid && shortTextContent && !ignoreLength) { + missing = 'shortTextContent'; + } this.data({ - headingOrder: headingOrder + fgColor: fgColor ? fgColor.toHexString() : void 0, + bgColor: bgColor ? bgColor.toHexString() : void 0, + contrastRatio: truncatedResult, + fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'), + fontWeight: bold ? 'bold' : 'normal', + messageKey: missing, + expectedContrastRatio: expected + ':1', + shadowColor: shadowColor ? shadowColor.toHexString() : void 0 }); - cache_default.set('headingOrder', vNodes); - return true; - } - var heading_order_evaluate_default = headingOrderEvaluate; - function isIdenticalObject(a2, b2) { - if (!a2 || !b2) { - return false; + if (fgColor === null || bgColor === null || equalRatio || shortTextContent && !ignoreLength && !isValid) { + missing = null; + incomplete_data_default.clear(); + this.relatedNodes(bgNodes); + return void 0; } - var aProps = Object.getOwnPropertyNames(a2); - var bProps = Object.getOwnPropertyNames(b2); - if (aProps.length !== bProps.length) { - return false; + if (!isValid) { + this.relatedNodes(bgNodes); } - var result = aProps.every(function(propName) { - var aValue = a2[propName]; - var bValue = b2[propName]; - if (_typeof(aValue) !== _typeof(bValue)) { - return false; - } - if (_typeof(aValue) === 'object' || _typeof(bValue) === 'object') { - return isIdenticalObject(aValue, bValue); - } - return aValue === bValue; - }); - return result; + return isValid; } - function identicalLinksSamePurposeAfter(results) { - if (results.length < 2) { - return results; + function findPseudoElement(vNode, _ref143) { + var _ref143$pseudoSizeThr = _ref143.pseudoSizeThreshold, pseudoSizeThreshold = _ref143$pseudoSizeThr === void 0 ? .25 : _ref143$pseudoSizeThr, _ref143$ignorePseudo = _ref143.ignorePseudo, ignorePseudo = _ref143$ignorePseudo === void 0 ? false : _ref143$ignorePseudo; + if (ignorePseudo) { + return; } - var incompleteResults = results.filter(function(_ref135) { - var result = _ref135.result; - return result !== void 0; - }); - var uniqueResults = []; - var nameMap = {}; - var _loop9 = function _loop9(index) { - var _currentResult$relate; - var currentResult = incompleteResults[index]; - var _currentResult$data = currentResult.data, name = _currentResult$data.name, urlProps = _currentResult$data.urlProps; - if (nameMap[name]) { - return 'continue'; - } - var sameNameResults = incompleteResults.filter(function(_ref136, resultNum) { - var data = _ref136.data; - return data.name === name && resultNum !== index; - }); - var isSameUrl = sameNameResults.every(function(_ref137) { - var data = _ref137.data; - return isIdenticalObject(data.urlProps, urlProps); - }); - if (sameNameResults.length && !isSameUrl) { - currentResult.result = void 0; + var rect = vNode.boundingClientRect; + var minimumSize = rect.width * rect.height * pseudoSizeThreshold; + do { + var beforeSize = getPseudoElementArea(vNode.actualNode, ':before'); + var afterSize = getPseudoElementArea(vNode.actualNode, ':after'); + if (beforeSize + afterSize > minimumSize) { + return vNode; } - currentResult.relatedNodes = []; - (_currentResult$relate = currentResult.relatedNodes).push.apply(_currentResult$relate, _toConsumableArray(sameNameResults.map(function(node) { - return node.relatedNodes[0]; - }))); - nameMap[name] = sameNameResults; - uniqueResults.push(currentResult); + } while (vNode = vNode.parent); + } + var getPseudoElementArea = memoize_default(function getPseudoElementArea2(node, pseudo) { + var style = window.getComputedStyle(node, pseudo); + var matchPseudoStyle = function matchPseudoStyle(prop, value) { + return style.getPropertyValue(prop) === value; }; - for (var index = 0; index < incompleteResults.length; index++) { - var _ret7 = _loop9(index); - if (_ret7 === 'continue') { - continue; - } + if (matchPseudoStyle('content', 'none') || matchPseudoStyle('display', 'none') || matchPseudoStyle('visibility', 'hidden') || matchPseudoStyle('position', 'absolute') === false) { + return 0; } - return uniqueResults; - } - var identical_links_same_purpose_after_default = identicalLinksSamePurposeAfter; - var commons_exports = {}; - __export(commons_exports, { - aria: function aria() { - return aria_exports; - }, - color: function color() { - return color_exports; - }, - dom: function dom() { - return dom_exports; - }, - forms: function forms() { - return forms_exports; - }, - matches: function matches() { - return matches_default2; - }, - math: function math() { - return math_exports; - }, - standards: function standards() { - return standards_exports; - }, - table: function table() { - return table_exports; - }, - text: function text() { - return text_exports; - }, - utils: function utils() { - return utils_exports; + if (get_own_background_color_default(style).alpha === 0 && matchPseudoStyle('background-image', 'none')) { + return 0; } - }); - var forms_exports = {}; - __export(forms_exports, { - isAriaCombobox: function isAriaCombobox() { - return is_aria_combobox_default; - }, - isAriaListbox: function isAriaListbox() { - return is_aria_listbox_default; - }, - isAriaRange: function isAriaRange() { - return is_aria_range_default; - }, - isAriaTextbox: function isAriaTextbox() { - return is_aria_textbox_default; - }, - isDisabled: function isDisabled() { - return is_disabled_default; - }, - isNativeSelect: function isNativeSelect() { - return is_native_select_default; - }, - isNativeTextbox: function isNativeTextbox() { - return is_native_textbox_default; + var pseudoWidth = parseUnit(style.getPropertyValue('width')); + var pseudoHeight = parseUnit(style.getPropertyValue('height')); + if (pseudoWidth.unit !== 'px' || pseudoHeight.unit !== 'px') { + return pseudoWidth.value === 0 || pseudoHeight.value === 0 ? 0 : Infinity; } + return pseudoWidth.value * pseudoHeight.value; }); - var disabledNodeNames = [ 'fieldset', 'button', 'select', 'input', 'textarea' ]; - function isDisabled(virtualNode) { - var disabledState = virtualNode._isDisabled; - if (typeof disabledState === 'boolean') { - return disabledState; - } - var nodeName2 = virtualNode.props.nodeName; - var ariaDisabled = virtualNode.attr('aria-disabled'); - if (disabledNodeNames.includes(nodeName2) && virtualNode.hasAttr('disabled')) { - disabledState = true; - } else if (ariaDisabled) { - disabledState = ariaDisabled.toLowerCase() === 'true'; - } else if (virtualNode.parent) { - disabledState = isDisabled(virtualNode.parent); - } else { - disabledState = false; - } - virtualNode._isDisabled = disabledState; - return disabledState; + function textIsEmojis(visibleText) { + var options = { + nonBmp: true + }; + var hasUnicodeChars = has_unicode_default(visibleText, options); + var hasNonUnicodeChars = sanitize_default(remove_unicode_default(visibleText, options)) === ''; + return hasUnicodeChars && hasNonUnicodeChars; } - var is_disabled_default = isDisabled; - var table_exports = {}; - __export(table_exports, { - getAllCells: function getAllCells() { - return get_all_cells_default; - }, - getCellPosition: function getCellPosition() { - return get_cell_position_default; - }, - getHeaders: function getHeaders() { - return get_headers_default; - }, - getScope: function getScope() { - return _getScope; - }, - isColumnHeader: function isColumnHeader() { - return is_column_header_default; - }, - isDataCell: function isDataCell() { - return is_data_cell_default; - }, - isDataTable: function isDataTable() { - return is_data_table_default; - }, - isHeader: function isHeader() { - return is_header_default; - }, - isRowHeader: function isRowHeader() { - return is_row_header_default; - }, - toArray: function toArray() { - return to_grid_default; - }, - toGrid: function toGrid() { - return to_grid_default; - }, - traverse: function traverse() { - return traverse_default; - } - }); - function getAllCells(tableElm) { - var rowIndex, cellIndex, rowLength, cellLength; - var cells = []; - for (rowIndex = 0, rowLength = tableElm.rows.length; rowIndex < rowLength; rowIndex++) { - for (cellIndex = 0, cellLength = tableElm.rows[rowIndex].cells.length; cellIndex < cellLength; cellIndex++) { - cells.push(tableElm.rows[rowIndex].cells[cellIndex]); - } - } - return cells; + function parseUnit(str) { + var unitRegex = /^([0-9.]+)([a-z]+)$/i; + var _ref144 = str.match(unitRegex) || [], _ref145 = _slicedToArray(_ref144, 3), _ref145$ = _ref145[1], value = _ref145$ === void 0 ? '' : _ref145$, _ref145$2 = _ref145[2], unit = _ref145$2 === void 0 ? '' : _ref145$2; + return { + value: parseFloat(value), + unit: unit.toLowerCase() + }; } - var get_all_cells_default = getAllCells; - function traverseForHeaders(headerType, position, tableGrid) { - var property = headerType === 'row' ? '_rowHeaders' : '_colHeaders'; - var predicate = headerType === 'row' ? is_row_header_default : is_column_header_default; - var startCell = tableGrid[position.y][position.x]; - var colspan = startCell.colSpan - 1; - var rowspanAttr = startCell.getAttribute('rowspan'); - var rowspanValue = parseInt(rowspanAttr) === 0 || startCell.rowspan === 0 ? tableGrid.length : startCell.rowSpan; - var rowspan = rowspanValue - 1; - var rowStart = position.y + rowspan; - var colStart = position.x + colspan; - var rowEnd = headerType === 'row' ? position.y : 0; - var colEnd = headerType === 'row' ? 0 : position.x; - var headers; - var cells = []; - for (var row = rowStart; row >= rowEnd && !headers; row--) { - for (var col = colStart; col >= colEnd; col--) { - var cell = tableGrid[row] ? tableGrid[row][col] : void 0; - if (!cell) { - continue; - } - var vNode = axe.utils.getNodeFromTree(cell); - if (vNode[property]) { - headers = vNode[property]; - break; - } - cells.push(cell); - } - } - headers = (headers || []).concat(cells.filter(predicate)); - cells.forEach(function(tableCell) { - var vNode = axe.utils.getNodeFromTree(tableCell); - vNode[property] = headers; - }); - return headers; + var VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS = { + ARTICLE: true, + ASIDE: true, + NAV: true, + SECTION: true + }; + var VALID_ROLES_FOR_SCROLLABLE_REGIONS = { + application: true, + article: true, + banner: false, + complementary: true, + contentinfo: true, + form: true, + main: true, + navigation: true, + region: true, + search: false + }; + function validScrollableTagName(node) { + var nodeName2 = node.nodeName.toUpperCase(); + return VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS[nodeName2] || false; } - function getHeaders(cell, tableGrid) { - if (cell.getAttribute('headers')) { - var headers = idrefs_default(cell, 'headers'); - if (headers.filter(function(header) { - return header; - }).length) { - return headers; - } + function validScrollableRole(node, options) { + var role = get_explicit_role_default(node); + if (!role) { + return false; } - if (!tableGrid) { - tableGrid = to_grid_default(find_up_default(cell, 'table')); + return VALID_ROLES_FOR_SCROLLABLE_REGIONS[role] || options.roles.includes(role) || false; + } + function validScrollableSemanticsEvaluate(node, options) { + return validScrollableRole(node, options) || validScrollableTagName(node); + } + var valid_scrollable_semantics_evaluate_default = validScrollableSemanticsEvaluate; + function unsupportedroleEvaluate(node, options, virtualNode) { + var role = get_role_default(virtualNode, { + dpub: true, + fallback: true + }); + var isUnsupported = is_unsupported_role_default(role); + if (isUnsupported) { + this.data(role); } - var position = get_cell_position_default(cell, tableGrid); - var rowHeaders = traverseForHeaders('row', position, tableGrid); - var colHeaders = traverseForHeaders('col', position, tableGrid); - return [].concat(rowHeaders, colHeaders).reverse(); + return isUnsupported; } - var get_headers_default = getHeaders; - function isDataCell(cell) { - if (!cell.children.length && !cell.textContent.trim()) { + var unsupportedrole_evaluate_default = unsupportedroleEvaluate; + function noImplicitExplicitLabelEvaluate(node, options, virtualNode) { + var role = get_role_default(virtualNode, { + noImplicit: true + }); + this.data(role); + var label3; + var accText; + try { + label3 = sanitize_default(label_text_default(virtualNode)).toLowerCase(); + accText = sanitize_default(_accessibleTextVirtual(virtualNode)).toLowerCase(); + } catch (e) { + return void 0; + } + if (!accText && !label3) { return false; } - var role = cell.getAttribute('role'); - if (is_valid_role_default(role)) { - return [ 'cell', 'gridcell' ].includes(role); - } else { - return cell.nodeName.toUpperCase() === 'TD'; + if (!accText && label3) { + return void 0; + } + if (!accText.includes(label3)) { + return void 0; } + return false; } - var is_data_cell_default = isDataCell; - function isDataTable(node) { - var role = (node.getAttribute('role') || '').toLowerCase(); - if ((role === 'presentation' || role === 'none') && !_isFocusable(node)) { + var no_implicit_explicit_label_evaluate_default = noImplicitExplicitLabelEvaluate; + function isElementFocusableEvaluate(node, options, virtualNode) { + return _isFocusable(virtualNode); + } + var is_element_focusable_evaluate_default = isElementFocusableEvaluate; + function invalidroleEvaluate(node, options, virtualNode) { + var allRoles = token_list_default(virtualNode.attr('role')); + var allInvalid = allRoles.every(function(role) { + return !is_valid_role_default(role, { + allowAbstract: true + }); + }); + if (allInvalid) { + this.data(allRoles); + return true; + } + return false; + } + var invalidrole_evaluate_default = invalidroleEvaluate; + function hasWidgetRoleEvaluate(node) { + var role = node.getAttribute('role'); + if (role === null) { return false; } - if (node.getAttribute('contenteditable') === 'true' || find_up_default(node, '[contenteditable="true"]')) { - return true; + var roleType = get_role_type_default(role); + return roleType === 'widget' || roleType === 'composite'; + } + var has_widget_role_evaluate_default = hasWidgetRoleEvaluate; + function hasGlobalAriaAttributeEvaluate(node, options, virtualNode) { + var globalAttrs = get_global_aria_attrs_default().filter(function(attr) { + return virtualNode.hasAttr(attr); + }); + this.data(globalAttrs); + return globalAttrs.length > 0; + } + var has_global_aria_attribute_evaluate_default = hasGlobalAriaAttributeEvaluate; + function nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) { + var hasImplicitRole = implicit_role_default(virtualNode); + return !hasImplicitRole && explicitRoles.length === 2 && explicitRoles.includes('none') && explicitRoles.includes('presentation'); + } + function fallbackroleEvaluate(node, options, virtualNode) { + var explicitRoles = token_list_default(virtualNode.attr('role')); + if (explicitRoles.length <= 1) { + return false; } - if (role === 'grid' || role === 'treegrid' || role === 'table') { - return true; + return nonePresentationOnElementWithNoImplicitRole(virtualNode, explicitRoles) ? void 0 : true; + } + var fallbackrole_evaluate_default = fallbackroleEvaluate; + function deprecatedroleEvaluate(node, options, virtualNode) { + var role = get_role_default(virtualNode, { + dpub: true, + fallback: true + }); + var roleDefinition = standards_default.ariaRoles[role]; + if (!(roleDefinition !== null && roleDefinition !== void 0 && roleDefinition.deprecated)) { + return false; } - if (get_role_type_default(role) === 'landmark') { + this.data(role); + return true; + } + function brailleRoleDescriptionEquivalentEvaluate(node, options, virtualNode) { + var _virtualNode$attr; + var brailleRoleDesc = (_virtualNode$attr = virtualNode.attr('aria-brailleroledescription')) !== null && _virtualNode$attr !== void 0 ? _virtualNode$attr : ''; + if (sanitize_default(brailleRoleDesc) === '') { return true; } - if (node.getAttribute('datatable') === '0') { + var roleDesc = virtualNode.attr('aria-roledescription'); + if (typeof roleDesc !== 'string') { + this.data({ + messageKey: 'noRoleDescription' + }); return false; } - if (node.getAttribute('summary')) { - return true; + if (sanitize_default(roleDesc) === '') { + this.data({ + messageKey: 'emptyRoleDescription' + }); + return false; } - if (node.tHead || node.tFoot || node.caption) { + return true; + } + function brailleLabelEquivalentEvaluate(node, options, virtualNode) { + var _virtualNode$attr2; + var brailleLabel = (_virtualNode$attr2 = virtualNode.attr('aria-braillelabel')) !== null && _virtualNode$attr2 !== void 0 ? _virtualNode$attr2 : ''; + if (!brailleLabel.trim()) { return true; } - for (var childIndex = 0, childLength = node.children.length; childIndex < childLength; childIndex++) { - if (node.children[childIndex].nodeName.toUpperCase() === 'COLGROUP') { - return true; - } + try { + return sanitize_default(_accessibleTextVirtual(virtualNode)) !== ''; + } catch (_unused) { + return void 0; } - var cells = 0; - var rowLength = node.rows.length; - var row, cell; - var hasBorder = false; - for (var rowIndex = 0; rowIndex < rowLength; rowIndex++) { - row = node.rows[rowIndex]; - for (var cellIndex = 0, cellLength = row.cells.length; cellIndex < cellLength; cellIndex++) { - cell = row.cells[cellIndex]; - if (cell.nodeName.toUpperCase() === 'TH') { - return true; - } - if (!hasBorder && (cell.offsetWidth !== cell.clientWidth || cell.offsetHeight !== cell.clientHeight)) { - hasBorder = true; - } - if (cell.getAttribute('scope') || cell.getAttribute('headers') || cell.getAttribute('abbr')) { - return true; + } + function ariaValidAttrValueEvaluate(node, options, virtualNode) { + options = Array.isArray(options.value) ? options.value : []; + var needsReview = ''; + var messageKey = ''; + var invalid = []; + var aria = /^aria-/; + var skipAttrs = [ 'aria-errormessage' ]; + var preChecks = { + 'aria-controls': function ariaControls() { + return virtualNode.attr('aria-expanded') !== 'false' && virtualNode.attr('aria-selected') !== 'false'; + }, + 'aria-current': function ariaCurrent(validValue) { + if (!validValue) { + needsReview = 'aria-current="'.concat(virtualNode.attr('aria-current'), '"'); + messageKey = 'ariaCurrent'; } - if ([ 'columnheader', 'rowheader' ].includes((cell.getAttribute('role') || '').toLowerCase())) { - return true; + return; + }, + 'aria-owns': function ariaOwns() { + return virtualNode.attr('aria-expanded') !== 'false'; + }, + 'aria-describedby': function ariaDescribedby(validValue) { + if (!validValue) { + needsReview = 'aria-describedby="'.concat(virtualNode.attr('aria-describedby'), '"'); + messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId'; } - if (cell.children.length === 1 && cell.children[0].nodeName.toUpperCase() === 'ABBR') { - return true; + return; + }, + 'aria-labelledby': function ariaLabelledby(validValue) { + if (!validValue) { + needsReview = 'aria-labelledby="'.concat(virtualNode.attr('aria-labelledby'), '"'); + messageKey = axe._tree && axe._tree[0]._hasShadowRoot ? 'noIdShadow' : 'noId'; } - cells++; } - } - if (node.getElementsByTagName('table').length) { - return false; - } - if (rowLength < 2) { - return false; - } - var sampleRow = node.rows[Math.ceil(rowLength / 2)]; - if (sampleRow.cells.length === 1 && sampleRow.cells[0].colSpan === 1) { - return false; - } - if (sampleRow.cells.length >= 5) { - return true; - } - if (hasBorder) { - return true; - } - var bgColor, bgImage; - for (rowIndex = 0; rowIndex < rowLength; rowIndex++) { - row = node.rows[rowIndex]; - if (bgColor && bgColor !== window.getComputedStyle(row).getPropertyValue('background-color')) { - return true; - } else { - bgColor = window.getComputedStyle(row).getPropertyValue('background-color'); + }; + virtualNode.attrNames.forEach(function(attrName) { + if (skipAttrs.includes(attrName) || options.includes(attrName) || !aria.test(attrName)) { + return; + } + var validValue; + var attrValue = virtualNode.attr(attrName); + try { + validValue = validate_attr_value_default(virtualNode, attrName); + } catch (e) { + needsReview = ''.concat(attrName, '="').concat(attrValue, '"'); + messageKey = 'idrefs'; + return; } - if (bgImage && bgImage !== window.getComputedStyle(row).getPropertyValue('background-image')) { - return true; - } else { - bgImage = window.getComputedStyle(row).getPropertyValue('background-image'); + if ((preChecks[attrName] ? preChecks[attrName](validValue) : true) && !validValue) { + if (attrValue === '' && !isStringType(attrName)) { + needsReview = attrName; + messageKey = 'empty'; + } else { + invalid.push(''.concat(attrName, '="').concat(attrValue, '"')); + } } - } - if (rowLength >= 20) { - return true; - } - if (get_element_coordinates_default(node).width > get_viewport_size_default(window).width * .95) { - return false; - } - if (cells < 10) { + }); + if (invalid.length) { + this.data(invalid); return false; } - if (node.querySelector('object, embed, iframe, applet')) { - return false; + if (needsReview) { + this.data({ + messageKey: messageKey, + needsReview: needsReview + }); + return void 0; } return true; } - var is_data_table_default = isDataTable; - function isHeader(cell) { - if (is_column_header_default(cell) || is_row_header_default(cell)) { - return true; - } - if (cell.getAttribute('id')) { - var _id5 = escape_selector_default(cell.getAttribute('id')); - return !!document.querySelector('[headers~="'.concat(_id5, '"]')); - } - return false; - } - var is_header_default = isHeader; - function traverseTable(dir, position, tableGrid, callback) { - var result; - var cell = tableGrid[position.y] ? tableGrid[position.y][position.x] : void 0; - if (!cell) { - return []; - } - if (typeof callback === 'function') { - result = callback(cell, position, tableGrid); - if (result === true) { - return [ cell ]; - } - } - result = traverseTable(dir, { - x: position.x + dir.x, - y: position.y + dir.y - }, tableGrid, callback); - result.unshift(cell); - return result; + function isStringType(attrName) { + var _standards_default$ar; + return ((_standards_default$ar = standards_default.ariaAttrs[attrName]) === null || _standards_default$ar === void 0 ? void 0 : _standards_default$ar.type) === 'string'; } - function traverse(dir, startPos, tableGrid, callback) { - if (Array.isArray(startPos)) { - callback = tableGrid; - tableGrid = startPos; - startPos = { - x: 0, - y: 0 - }; - } - if (typeof dir === 'string') { - switch (dir) { - case 'left': - dir = { - x: -1, - y: 0 - }; - break; - - case 'up': - dir = { - x: 0, - y: -1 - }; - break; - - case 'right': - dir = { - x: 1, - y: 0 - }; - break; - - case 'down': - dir = { - x: 0, - y: 1 - }; - break; + function ariaValidAttrEvaluate(node, options, virtualNode) { + options = Array.isArray(options.value) ? options.value : []; + var invalid = []; + var aria = /^aria-/; + virtualNode.attrNames.forEach(function(attr) { + if (options.indexOf(attr) === -1 && aria.test(attr) && !validate_attr_default(attr)) { + invalid.push(attr); } + }); + if (invalid.length) { + this.data(invalid); + return false; } - return traverseTable(dir, { - x: startPos.x + dir.x, - y: startPos.y + dir.y - }, tableGrid, callback); - } - var traverse_default = traverse; - function identicalLinksSamePurposeEvaluate(node, options, virtualNode) { - var accText = text_exports.accessibleTextVirtual(virtualNode); - var name = text_exports.sanitize(text_exports.removeUnicode(accText, { - emoji: true, - nonBmp: true, - punctuations: true - })).toLowerCase(); - if (!name) { - return void 0; - } - var afterData = { - name: name, - urlProps: dom_exports.urlPropsFromAttribute(node, 'href') - }; - this.data(afterData); - this.relatedNodes([ node ]); return true; } - var identical_links_same_purpose_evaluate_default = identicalLinksSamePurposeEvaluate; - function internalLinkPresentEvaluate(node, options, virtualNode) { - var links = query_selector_all_default(virtualNode, 'a[href]'); - return links.some(function(vLink) { - return /^#[^/!]/.test(vLink.attr('href')); + var aria_valid_attr_evaluate_default = ariaValidAttrEvaluate; + function ariaUnsupportedAttrEvaluate(node, options, virtualNode) { + var unsupportedAttrs = virtualNode.attrNames.filter(function(name) { + var attribute = standards_default.ariaAttrs[name]; + if (!validate_attr_default(name)) { + return false; + } + var unsupported = attribute.unsupported; + if (_typeof(unsupported) !== 'object') { + return !!unsupported; + } + return !matches_default2(node, unsupported.exceptions); }); - } - var internal_link_present_evaluate_default = internalLinkPresentEvaluate; - var separatorRegex = /[;,\s]/; - var validRedirectNumRegex = /^[0-9.]+$/; - function metaRefreshEvaluate(node, options, virtualNode) { - var _ref138 = options || {}, minDelay = _ref138.minDelay, maxDelay = _ref138.maxDelay; - var content = (virtualNode.attr('content') || '').trim(); - var _content$split = content.split(separatorRegex), _content$split2 = _slicedToArray(_content$split, 1), redirectStr = _content$split2[0]; - if (!redirectStr.match(validRedirectNumRegex)) { + if (unsupportedAttrs.length) { + this.data(unsupportedAttrs); return true; } - var redirectDelay = parseFloat(redirectStr); - this.data({ - redirectDelay: redirectDelay - }); - if (typeof minDelay === 'number' && redirectDelay <= options.minDelay) { + return false; + } + var aria_unsupported_attr_evaluate_default = ariaUnsupportedAttrEvaluate; + function ariaRoledescriptionEvaluate(node) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var virtualNode = arguments.length > 2 ? arguments[2] : undefined; + var role = get_role_default(virtualNode); + var supportedRoles = options.supportedRoles || []; + if (supportedRoles.includes(role)) { return true; } - if (typeof maxDelay === 'number' && redirectDelay > options.maxDelay) { - return true; + if (role && role !== 'presentation' && role !== 'none') { + return void 0; } return false; } - function normalizeFontWeight(weight) { - switch (weight) { - case 'lighter': - return 100; - - case 'normal': - return 400; - - case 'bold': - return 700; - - case 'bolder': - return 900; + var aria_roledescription_evaluate_default = ariaRoledescriptionEvaluate; + function getMissingContext(virtualNode, ownGroupRoles, reqContext, includeElement) { + var explicitRole2 = get_explicit_role_default(virtualNode); + if (!reqContext) { + reqContext = required_context_default(explicitRole2); } - weight = parseInt(weight); - return !isNaN(weight) ? weight : 400; - } - function getTextContainer(elm) { - var nextNode = elm; - var outerText = elm.textContent.trim(); - var innerText = outerText; - while (innerText === outerText && nextNode !== void 0) { - var _i35 = -1; - elm = nextNode; - if (elm.children.length === 0) { - return elm; + if (!reqContext) { + return null; + } + var allowsGroup = reqContext.includes('group'); + var vNode = includeElement ? virtualNode : virtualNode.parent; + while (vNode) { + var role = get_role_default(vNode, { + noPresentational: true + }); + if (!role) { + vNode = vNode.parent; + } else if (role === 'group' && allowsGroup) { + if (ownGroupRoles.includes(explicitRole2)) { + reqContext.push(explicitRole2); + } + reqContext = reqContext.filter(function(r) { + return r !== 'group'; + }); + vNode = vNode.parent; + } else if (reqContext.includes(role)) { + return null; + } else { + return reqContext; } - do { - _i35++; - innerText = elm.children[_i35].textContent.trim(); - } while (innerText === '' && _i35 + 1 < elm.children.length); - nextNode = elm.children[_i35]; } - return elm; + return reqContext; } - function getStyleValues(node) { - var style = window.getComputedStyle(getTextContainer(node)); - return { - fontWeight: normalizeFontWeight(style.getPropertyValue('font-weight')), - fontSize: parseInt(style.getPropertyValue('font-size')), - isItalic: style.getPropertyValue('font-style') === 'italic' - }; + function getAriaOwners(element) { + var owners = [], o = null; + while (element) { + if (element.getAttribute('id')) { + var _id5 = escape_selector_default(element.getAttribute('id')); + var doc = get_root_node_default2(element); + o = doc.querySelector('[aria-owns~='.concat(_id5, ']')); + if (o) { + owners.push(o); + } + } + element = element.parentElement; + } + return owners.length ? owners : null; } - function isHeaderStyle(styleA, styleB, margins) { - return margins.reduce(function(out, margin) { - return out || (!margin.size || styleA.fontSize / margin.size > styleB.fontSize) && (!margin.weight || styleA.fontWeight - margin.weight > styleB.fontWeight) && (!margin.italic || styleA.isItalic && !styleB.isItalic); - }, false); + function ariaRequiredParentEvaluate(node, options, virtualNode) { + var ownGroupRoles = options && Array.isArray(options.ownGroupRoles) ? options.ownGroupRoles : []; + var missingParents = getMissingContext(virtualNode, ownGroupRoles); + if (!missingParents) { + return true; + } + var owners = getAriaOwners(node); + if (owners) { + for (var _i35 = 0, l = owners.length; _i35 < l; _i35++) { + missingParents = getMissingContext(get_node_from_tree_default(owners[_i35]), ownGroupRoles, missingParents, true); + if (!missingParents) { + return true; + } + } + } + this.data(missingParents); + return false; } - function pAsHeadingEvaluate(node, options, virtualNode) { - var siblings = Array.from(node.parentNode.children); - var currentIndex = siblings.indexOf(node); - options = options || {}; - var margins = options.margins || []; - var nextSibling = siblings.slice(currentIndex + 1).find(function(elm) { - return elm.nodeName.toUpperCase() === 'P'; - }); - var prevSibling = siblings.slice(0, currentIndex).reverse().find(function(elm) { - return elm.nodeName.toUpperCase() === 'P'; + var aria_required_parent_evaluate_default = ariaRequiredParentEvaluate; + function ariaRequiredChildrenEvaluate(node, options, virtualNode) { + var reviewEmpty = options && Array.isArray(options.reviewEmpty) ? options.reviewEmpty : []; + var explicitRole2 = get_explicit_role_default(virtualNode, { + dpub: true }); - var currStyle = getStyleValues(node); - var nextStyle = nextSibling ? getStyleValues(nextSibling) : null; - var prevStyle = prevSibling ? getStyleValues(prevSibling) : null; - var optionsPassLength = options.passLength; - var optionsFailLength = options.failLength; - var headingLength = node.textContent.trim().length; - var paragraphLength = nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.textContent.trim().length; - if (headingLength > paragraphLength * optionsPassLength) { + var required = required_owned_default(explicitRole2); + if (required === null) { return true; } - if (!nextStyle || !isHeaderStyle(currStyle, nextStyle, margins)) { - return true; + var ownedRoles = getOwnedRoles(virtualNode, required); + var unallowed = ownedRoles.filter(function(_ref146) { + var role = _ref146.role, vNode = _ref146.vNode; + return vNode.props.nodeType === 1 && !required.includes(role); + }); + if (unallowed.length) { + this.relatedNodes(unallowed.map(function(_ref147) { + var vNode = _ref147.vNode; + return vNode; + })); + this.data({ + messageKey: 'unallowed', + values: unallowed.map(function(_ref148) { + var vNode = _ref148.vNode, attr = _ref148.attr; + return getUnallowedSelector(vNode, attr); + }).filter(function(selector, index, array) { + return array.indexOf(selector) === index; + }).join(', ') + }); + return false; } - var blockquote = find_up_virtual_default(virtualNode, 'blockquote'); - if (blockquote && blockquote.nodeName.toUpperCase() === 'BLOCKQUOTE') { - return void 0; + if (hasRequiredChildren(required, ownedRoles)) { + return true; } - if (prevStyle && !isHeaderStyle(currStyle, prevStyle, margins)) { - return void 0; + if (virtualNode.attr('aria-busy') === 'true') { + this.data({ + messageKey: 'aria-busy' + }); + return true; } - if (headingLength > paragraphLength * optionsFailLength) { + this.data(required); + if (reviewEmpty.includes(explicitRole2) && !ownedRoles.some(isContent)) { return void 0; } return false; } - var p_as_heading_evaluate_default = pAsHeadingEvaluate; - function regionAfter(results) { - var iframeResults = results.filter(function(r) { - return r.data.isIframe; - }); - results.forEach(function(r) { - if (r.result || r.node.ancestry.length === 1) { - return; + function getOwnedRoles(virtualNode, required) { + var vNode; + var ownedRoles = []; + var ownedVirtual = get_owned_virtual_default(virtualNode); + var _loop8 = function _loop8() { + if (vNode.props.nodeType === 3) { + ownedRoles.push({ + vNode: vNode, + role: null + }); } - var frameAncestry = r.node.ancestry.slice(0, -1); - var _iterator21 = _createForOfIteratorHelper(iframeResults), _step21; - try { - for (_iterator21.s(); !(_step21 = _iterator21.n()).done; ) { - var iframeResult = _step21.value; - if (_matchAncestry(frameAncestry, iframeResult.node.ancestry)) { - r.result = iframeResult.result; - break; - } - } - } catch (err) { - _iterator21.e(err); - } finally { - _iterator21.f(); + if (vNode.props.nodeType !== 1 || !_isVisibleToScreenReaders(vNode)) { + return 1; } - }); - iframeResults.forEach(function(r) { - if (!r.result) { - r.result = true; + var role = get_role_default(vNode, { + noPresentational: true + }); + var globalAriaAttr = getGlobalAriaAttr(vNode); + var hasGlobalAriaOrFocusable = !!globalAriaAttr || _isFocusable(vNode); + if (!role && !hasGlobalAriaOrFocusable || [ 'group', 'rowgroup' ].includes(role) && required.some(function(requiredRole) { + return requiredRole === role; + })) { + ownedVirtual.push.apply(ownedVirtual, _toConsumableArray(vNode.children)); + } else if (role || hasGlobalAriaOrFocusable) { + var attr = globalAriaAttr || 'tabindex'; + ownedRoles.push({ + role: role, + attr: attr, + vNode: vNode + }); } - }); - return results; + }; + while (vNode = ownedVirtual.shift()) { + if (_loop8()) { + continue; + } + } + return ownedRoles; } - var region_after_default = regionAfter; - var implicitAriaLiveRoles = [ 'alert', 'log', 'status' ]; - function regionEvaluate(node, options, virtualNode) { - this.data({ - isIframe: [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) + function hasRequiredChildren(required, ownedRoles) { + return ownedRoles.some(function(_ref149) { + var role = _ref149.role; + return role && required.includes(role); }); - var regionlessNodes = cache_default.get('regionlessNodes', function() { - return getRegionlessNodes(options); + } + function getGlobalAriaAttr(vNode) { + return get_global_aria_attrs_default().find(function(attr) { + return vNode.hasAttr(attr); }); - return !regionlessNodes.includes(virtualNode); } - function getRegionlessNodes(options) { - var regionlessNodes = findRegionlessElms(axe._tree[0], options).map(function(vNode) { - while (vNode.parent && !vNode.parent._hasRegionDescendant && vNode.parent.actualNode !== document.body) { - vNode = vNode.parent; - } - return vNode; - }).filter(function(vNode, index, array) { - return array.indexOf(vNode) === index; + function getUnallowedSelector(vNode, attr) { + var _vNode$props = vNode.props, nodeName2 = _vNode$props.nodeName, nodeType = _vNode$props.nodeType; + if (nodeType === 3) { + return '#text'; + } + var role = get_explicit_role_default(vNode, { + dpub: true }); - return regionlessNodes; + if (role) { + return '[role='.concat(role, ']'); + } + if (attr) { + return nodeName2 + '['.concat(attr, ']'); + } + return nodeName2; } - function findRegionlessElms(virtualNode, options) { - var node = virtualNode.actualNode; - if (get_role_default(virtualNode) === 'button' || isRegion(virtualNode, options) || [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) || _isSkipLink(virtualNode.actualNode) && get_element_by_reference_default(virtualNode.actualNode, 'href') || !_isVisibleToScreenReaders(node)) { - var vNode = virtualNode; - while (vNode) { - vNode._hasRegionDescendant = true; - vNode = vNode.parent; - } - if ([ 'iframe', 'frame' ].includes(virtualNode.props.nodeName)) { - return [ virtualNode ]; - } - return []; - } else if (node !== document.body && has_content_default(node, true)) { - return [ virtualNode ]; - } else { - return virtualNode.children.filter(function(_ref139) { - var actualNode = _ref139.actualNode; - return actualNode.nodeType === 1; - }).map(function(vNode) { - return findRegionlessElms(vNode, options); - }).reduce(function(a2, b2) { - return a2.concat(b2); - }, []); + function isContent(_ref150) { + var vNode = _ref150.vNode; + if (vNode.props.nodeType === 3) { + return vNode.props.nodeValue.trim().length > 0; } + return has_content_virtual_default(vNode, false, true); } - function isRegion(virtualNode, options) { - var node = virtualNode.actualNode; - var role = get_role_default(virtualNode); - var ariaLive = (node.getAttribute('aria-live') || '').toLowerCase().trim(); - var landmarkRoles2 = get_aria_roles_by_type_default('landmark'); - if ([ 'assertive', 'polite' ].includes(ariaLive) || implicitAriaLiveRoles.includes(role)) { - return true; + function ariaRequiredAttrEvaluate(node) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var virtualNode = arguments.length > 2 ? arguments[2] : undefined; + var role = get_explicit_role_default(virtualNode); + var attrs = virtualNode.attrNames; + var requiredAttrs = required_attr_default(role); + if (Array.isArray(options[role])) { + requiredAttrs = unique_array_default(options[role], requiredAttrs); } - if (landmarkRoles2.includes(role)) { + if (!role || !attrs.length || !requiredAttrs.length) { return true; } - if (options.regionMatcher && matches_default2(virtualNode, options.regionMatcher)) { + if (isStaticSeparator(virtualNode, role) || isClosedCombobox(virtualNode, role)) { return true; } - return false; - } - function skipLinkEvaluate(node) { - var target = get_element_by_reference_default(node, 'href'); - if (target) { - return _isVisibleToScreenReaders(target) || void 0; + var elmSpec = get_element_spec_default(virtualNode); + var missingAttrs = requiredAttrs.filter(function(requiredAttr2) { + return !virtualNode.attr(requiredAttr2) && !hasImplicitAttr(elmSpec, requiredAttr2); + }); + if (missingAttrs.length) { + this.data(missingAttrs); + return false; } - return false; + return true; } - var skip_link_evaluate_default = skipLinkEvaluate; - function uniqueFrameTitleAfter(results) { - var titles = {}; - results.forEach(function(r) { - titles[r.data] = titles[r.data] !== void 0 ? ++titles[r.data] : 0; - }); - results.forEach(function(r) { - r.result = !!titles[r.data]; - }); - return results; + function isStaticSeparator(vNode, role) { + return role === 'separator' && !_isFocusable(vNode); } - var unique_frame_title_after_default = uniqueFrameTitleAfter; - function uniqueFrameTitleEvaluate(node, options, vNode) { - var title = sanitize_default(vNode.attr('title')).toLowerCase(); - this.data(title); - return true; + function hasImplicitAttr(elmSpec, attr) { + var _elmSpec$implicitAttr; + return ((_elmSpec$implicitAttr = elmSpec.implicitAttrs) === null || _elmSpec$implicitAttr === void 0 ? void 0 : _elmSpec$implicitAttr[attr]) !== void 0; } - var unique_frame_title_evaluate_default = uniqueFrameTitleEvaluate; - function duplicateIdAfter(results) { - var uniqueIds = []; - return results.filter(function(r) { - if (uniqueIds.indexOf(r.data) === -1) { - uniqueIds.push(r.data); - return true; + function isClosedCombobox(vNode, role) { + return role === 'combobox' && vNode.attr('aria-expanded') === 'false'; + } + function ariaProhibitedAttrEvaluate(node) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var virtualNode = arguments.length > 2 ? arguments[2] : undefined; + var elementsAllowedAriaLabel = (options === null || options === void 0 ? void 0 : options.elementsAllowedAriaLabel) || []; + var nodeName2 = virtualNode.props.nodeName; + var role = get_role_default(virtualNode, { + chromium: true + }); + var prohibitedList = listProhibitedAttrs(role, nodeName2, elementsAllowedAriaLabel); + var prohibited = prohibitedList.filter(function(attrName) { + if (!virtualNode.attrNames.includes(attrName)) { + return false; } - return false; + return sanitize_default(virtualNode.attr(attrName)) !== ''; }); - } - var duplicate_id_after_default = duplicateIdAfter; - function duplicateIdEvaluate(node) { - var id = node.getAttribute('id').trim(); - if (!id) { - return true; + if (prohibited.length === 0) { + return false; } - var root = get_root_node_default2(node); - var matchingNodes = Array.from(root.querySelectorAll('[id="'.concat(escape_selector_default(id), '"]'))).filter(function(foundNode) { - return foundNode !== node; + var messageKey = virtualNode.hasAttr('role') ? 'hasRole' : 'noRole'; + messageKey += prohibited.length > 1 ? 'Plural' : 'Singular'; + this.data({ + role: role, + nodeName: nodeName2, + messageKey: messageKey, + prohibited: prohibited }); - if (matchingNodes.length) { - this.relatedNodes(matchingNodes); + var textContent = subtree_text_default(virtualNode, { + subtreeDescendant: true + }); + if (sanitize_default(textContent) !== '') { + return void 0; } - this.data(id); - return matchingNodes.length === 0; + return true; } - var duplicate_id_evaluate_default = duplicateIdEvaluate; - function ariaLabelEvaluate(node, options, virtualNode) { - return !!sanitize_default(_arialabelText(virtualNode)); + function listProhibitedAttrs(role, nodeName2, elementsAllowedAriaLabel) { + var roleSpec = standards_default.ariaRoles[role]; + if (roleSpec) { + return roleSpec.prohibitedAttrs || []; + } + if (!!role || elementsAllowedAriaLabel.includes(nodeName2)) { + return []; + } + return [ 'aria-label', 'aria-labelledby' ]; } - var aria_label_evaluate_default = ariaLabelEvaluate; - function ariaLabelledbyEvaluate(node, options, virtualNode) { - try { - return !!sanitize_default(arialabelledby_text_default(virtualNode)); - } catch (e) { + function ariaLevelEvaluate(node, options, virtualNode) { + var ariaHeadingLevel = virtualNode.attr('aria-level'); + var ariaLevel = parseInt(ariaHeadingLevel, 10); + if (ariaLevel > 6) { return void 0; } + return true; } - var aria_labelledby_evaluate_default = ariaLabelledbyEvaluate; - function avoidInlineSpacingEvaluate(node, options) { - var overriddenProperties = options.cssProperties.filter(function(property) { - if (node.style.getPropertyPriority(property) === 'important') { - return property; + var aria_level_evaluate_default = ariaLevelEvaluate; + function ariaHiddenBodyEvaluate(node, options, virtualNode) { + return virtualNode.attr('aria-hidden') !== 'true'; + } + var aria_hidden_body_evaluate_default = ariaHiddenBodyEvaluate; + function ariaErrormessageEvaluate(node, options, virtualNode) { + options = Array.isArray(options) ? options : []; + var errorMessageAttr = virtualNode.attr('aria-errormessage'); + var hasAttr = virtualNode.hasAttr('aria-errormessage'); + var invaid = virtualNode.attr('aria-invalid'); + var hasInvallid = virtualNode.hasAttr('aria-invalid'); + if (!hasInvallid || invaid === 'false') { + return true; + } + function validateAttrValue2(attr) { + if (attr.trim() === '') { + return standards_default.ariaAttrs['aria-errormessage'].allowEmpty; } - }); - if (overriddenProperties.length > 0) { - this.data(overriddenProperties); - return false; + var idref; + try { + idref = attr && idrefs_default(virtualNode, 'aria-errormessage')[0]; + } catch (e) { + this.data({ + messageKey: 'idrefs', + values: token_list_default(attr) + }); + return void 0; + } + if (idref) { + if (!_isVisibleToScreenReaders(idref)) { + this.data({ + messageKey: 'hidden', + values: token_list_default(attr) + }); + return false; + } + return idref.getAttribute('role') === 'alert' || idref.getAttribute('aria-live') === 'assertive' || idref.getAttribute('aria-live') === 'polite' || token_list_default(virtualNode.attr('aria-describedby')).indexOf(attr) > -1; + } + return; + } + if (options.indexOf(errorMessageAttr) === -1 && hasAttr) { + this.data(token_list_default(errorMessageAttr)); + return validateAttrValue2.call(this, errorMessageAttr); } return true; } - var avoid_inline_spacing_evaluate_default = avoidInlineSpacingEvaluate; - function docHasTitleEvaluate() { - var title = document.title; - return !!sanitize_default(title); - } - var doc_has_title_evaluate_default = docHasTitleEvaluate; - function existsEvaluate() { - return void 0; - } - var exists_evaluate_default = existsEvaluate; - function hasAltEvaluate(node, options, virtualNode) { - var nodeName2 = virtualNode.props.nodeName; - if (![ 'img', 'input', 'area' ].includes(nodeName2)) { - return false; + function ariaConditionalRowAttr(node) { + var _invalidTableRowAttrs, _invalidTableRowAttrs2; + var _ref151 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, invalidTableRowAttrs = _ref151.invalidTableRowAttrs; + var virtualNode = arguments.length > 2 ? arguments[2] : undefined; + var invalidAttrs = (_invalidTableRowAttrs = invalidTableRowAttrs === null || invalidTableRowAttrs === void 0 || (_invalidTableRowAttrs2 = invalidTableRowAttrs.filter) === null || _invalidTableRowAttrs2 === void 0 ? void 0 : _invalidTableRowAttrs2.call(invalidTableRowAttrs, function(invalidAttr) { + return virtualNode.hasAttr(invalidAttr); + })) !== null && _invalidTableRowAttrs !== void 0 ? _invalidTableRowAttrs : []; + if (invalidAttrs.length === 0) { + return true; } - return virtualNode.hasAttr('alt'); - } - var has_alt_evaluate_default = hasAltEvaluate; - function inlineStyleProperty(node, options) { - var cssProperty = options.cssProperty, absoluteValues = options.absoluteValues, minValue = options.minValue, maxValue = options.maxValue, _options$normalValue = options.normalValue, normalValue = _options$normalValue === void 0 ? 0 : _options$normalValue, noImportant = options.noImportant, multiLineOnly = options.multiLineOnly; - if (!noImportant && node.style.getPropertyPriority(cssProperty) !== 'important' || multiLineOnly && !_isMultiline(node)) { + var owner = getRowOwner(virtualNode); + var ownerRole = owner && get_role_default(owner); + if (!ownerRole || ownerRole === 'treegrid') { return true; } - var data = {}; - if (typeof minValue === 'number') { - data.minValue = minValue; + var messageKey = 'row'.concat(invalidAttrs.length > 1 ? 'Plural' : 'Singular'); + this.data({ + messageKey: messageKey, + invalidAttrs: invalidAttrs, + ownerRole: ownerRole + }); + return false; + } + function getRowOwner(virtualNode) { + if (!virtualNode.parent) { + return; } - if (typeof maxValue === 'number') { - data.maxValue = maxValue; + var rowOwnerQuery = 'table:not([role]), [role~="treegrid"], [role~="table"], [role~="grid"]'; + return closest_default(virtualNode, rowOwnerQuery); + } + function ariaConditionalCheckboxAttr(node, options, virtualNode) { + var _virtualNode$props = virtualNode.props, nodeName2 = _virtualNode$props.nodeName, type2 = _virtualNode$props.type; + var ariaChecked = normalizeAriaChecked(virtualNode.attr('aria-checked')); + if (nodeName2 !== 'input' || type2 !== 'checkbox' || !ariaChecked) { + return true; } - var declaredPropValue = node.style.getPropertyValue(cssProperty); - if ([ 'inherit', 'unset', 'revert', 'revert-layer' ].includes(declaredPropValue)) { - this.data(_extends({ - value: declaredPropValue - }, data)); + var checkState = getCheckState(virtualNode); + if (ariaChecked === checkState) { return true; } - var value = getNumberValue(node, { - absoluteValues: absoluteValues, - cssProperty: cssProperty, - normalValue: normalValue + this.data({ + messageKey: 'checkbox', + checkState: checkState }); - this.data(_extends({ - value: value - }, data)); - if (typeof value !== 'number') { - return void 0; + return false; + } + function getCheckState(vNode) { + if (vNode.props.indeterminate) { + return 'mixed'; } - if ((typeof minValue !== 'number' || value >= minValue) && (typeof maxValue !== 'number' || value <= maxValue)) { + return vNode.props.checked ? 'true' : 'false'; + } + function normalizeAriaChecked(ariaCheckedVal) { + if (!ariaCheckedVal) { + return ''; + } + ariaCheckedVal = ariaCheckedVal.toLowerCase(); + if ([ 'mixed', 'true' ].includes(ariaCheckedVal)) { + return ariaCheckedVal; + } + return 'false'; + } + var conditionalRoleMap = { + row: ariaConditionalRowAttr, + checkbox: ariaConditionalCheckboxAttr + }; + function ariaConditionalAttrEvaluate(node, options, virtualNode) { + var role = get_role_default(virtualNode); + if (!conditionalRoleMap[role]) { return true; } - return false; + return conditionalRoleMap[role].call(this, node, options, virtualNode); } - function getNumberValue(domNode, _ref140) { - var cssProperty = _ref140.cssProperty, absoluteValues = _ref140.absoluteValues, normalValue = _ref140.normalValue; - var computedStyle = window.getComputedStyle(domNode); - var cssPropValue = computedStyle.getPropertyValue(cssProperty); - if (cssPropValue === 'normal') { - return normalValue; + function ariaBusyEvaluate(node, options, virtualNode) { + return virtualNode.attr('aria-busy') === 'true'; + } + function ariaAllowedRoleEvaluate(node) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var virtualNode = arguments.length > 2 ? arguments[2] : undefined; + var _options$allowImplici = options.allowImplicit, allowImplicit = _options$allowImplici === void 0 ? true : _options$allowImplici, _options$ignoredTags = options.ignoredTags, ignoredTags = _options$ignoredTags === void 0 ? [] : _options$ignoredTags; + var nodeName2 = virtualNode.props.nodeName; + if (ignoredTags.map(function(tag) { + return tag.toLowerCase(); + }).includes(nodeName2)) { + return true; } - var parsedValue = parseFloat(cssPropValue); - if (absoluteValues) { - return parsedValue; + var unallowedRoles = get_element_unallowed_roles_default(virtualNode, allowImplicit); + if (unallowedRoles.length) { + this.data(unallowedRoles); + if (!_isVisibleToScreenReaders(virtualNode)) { + return void 0; + } + return false; } - var fontSize = parseFloat(computedStyle.getPropertyValue('font-size')); - var value = Math.round(parsedValue / fontSize * 100) / 100; - if (isNaN(value)) { - return cssPropValue; + return true; + } + var aria_allowed_role_evaluate_default = ariaAllowedRoleEvaluate; + function ariaAllowedAttrEvaluate(node, options, virtualNode) { + var invalid = []; + var role = get_role_default(virtualNode); + var allowed = allowed_attr_default(role); + if (Array.isArray(options[role])) { + allowed = unique_array_default(options[role].concat(allowed)); + } + var _iterator21 = _createForOfIteratorHelper(virtualNode.attrNames), _step21; + try { + for (_iterator21.s(); !(_step21 = _iterator21.n()).done; ) { + var attrName = _step21.value; + if (validate_attr_default(attrName) && !allowed.includes(attrName)) { + invalid.push(attrName); + } + } + } catch (err) { + _iterator21.e(err); + } finally { + _iterator21.f(); } - return value; - } - function isOnScreenEvaluate(node) { - return _isVisibleOnScreen(node); - } - var is_on_screen_evaluate_default = isOnScreenEvaluate; - function nonEmptyIfPresentEvaluate(node, options, virtualNode) { - var nodeName2 = virtualNode.props.nodeName; - var type2 = (virtualNode.attr('type') || '').toLowerCase(); - var label3 = virtualNode.attr('value'); - if (label3) { - this.data({ - messageKey: 'has-label' - }); + if (!invalid.length) { + return true; } - if (nodeName2 === 'input' && [ 'submit', 'reset' ].includes(type2)) { - return label3 === null; + this.data(invalid.map(function(attrName) { + return attrName + '="' + virtualNode.attr(attrName) + '"'; + })); + if (!role && !is_html_element_default(virtualNode) && !_isFocusable(virtualNode)) { + return void 0; } return false; } - var non_empty_if_present_evaluate_default = nonEmptyIfPresentEvaluate; - function presentationalRoleEvaluate(node, options, virtualNode) { - var explicitRole2 = get_explicit_role_default(virtualNode); - if ([ 'presentation', 'none' ].includes(explicitRole2) && [ 'iframe', 'frame' ].includes(virtualNode.props.nodeName) && virtualNode.hasAttr('title')) { - this.data({ - messageKey: 'iframe', - nodeName: virtualNode.props.nodeName - }); - return false; - } - var role = get_role_default(virtualNode); - if ([ 'presentation', 'none' ].includes(role)) { - this.data({ - role: role - }); + function abstractroleEvaluate(node, options, virtualNode) { + var abstractRoles = token_list_default(virtualNode.attr('role')).filter(function(role) { + return get_role_type_default(role) === 'abstract'; + }); + if (abstractRoles.length > 0) { + this.data(abstractRoles); return true; } - if (![ 'presentation', 'none' ].includes(explicitRole2)) { + return false; + } + var abstractrole_evaluate_default = abstractroleEvaluate; + function xmlLangMismatchMatches(node) { + var primaryLangValue = get_base_lang_default(node.getAttribute('lang')); + var primaryXmlLangValue = get_base_lang_default(node.getAttribute('xml:lang')); + return valid_langs_default(primaryLangValue) && valid_langs_default(primaryXmlLangValue); + } + var xml_lang_mismatch_matches_default = xmlLangMismatchMatches; + function windowIsTopMatches(node) { + return node.ownerDocument.defaultView.self === node.ownerDocument.defaultView.top; + } + var window_is_top_matches_default = windowIsTopMatches; + function svgNamespaceMatches(node, virtualNode) { + try { + var nodeName2 = virtualNode.props.nodeName; + if (nodeName2 === 'svg') { + return true; + } + return !!closest_default(virtualNode, 'svg'); + } catch (e) { return false; } - var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) { - return virtualNode.hasAttr(attr); + } + var svg_namespace_matches_default = svgNamespaceMatches; + function widgetNotInline(node, vNode) { + return matchesFns.every(function(fn) { + return fn(node, vNode); }); - var focusable = _isFocusable(virtualNode); - var messageKey; - if (hasGlobalAria && !focusable) { - messageKey = 'globalAria'; - } else if (!hasGlobalAria && focusable) { - messageKey = 'focusable'; - } else { - messageKey = 'both'; - } - this.data({ - messageKey: messageKey, - role: role + } + var matchesFns = [ function(node, vNode) { + return isWidgetType(vNode); + }, function(node, vNode) { + return isNotAreaElement(vNode); + }, function(node, vNode) { + return !svg_namespace_matches_default(node, vNode); + }, function(node, vNode) { + return _isFocusable(vNode); + }, function(node, vNode) { + return _isInTabOrder(vNode) || !hasWidgetAncestorInTabOrder(vNode); + }, function(node) { + return !is_in_text_block_default(node, { + noLengthCompare: true }); - return false; + } ]; + function isWidgetType(vNode) { + return get_role_type_default(vNode) === 'widget'; } - function svgNonEmptyTitleEvaluate(node, options, virtualNode) { - if (!virtualNode.children) { - return void 0; + function isNotAreaElement(vNode) { + return vNode.props.nodeName !== 'area'; + } + var hasWidgetAncestorInTabOrder = memoize_default(function hasWidgetAncestorInTabOrderMemoized(vNode) { + if (!(vNode !== null && vNode !== void 0 && vNode.parent)) { + return false; } - var titleNode = virtualNode.children.find(function(_ref141) { - var props = _ref141.props; - return props.nodeName === 'title'; + if (isWidgetType(vNode.parent) && _isInTabOrder(vNode.parent)) { + return true; + } + return hasWidgetAncestorInTabOrderMemoized(vNode.parent); + }); + function tableOrGridRoleMatches(_, vNode) { + var role = get_role_default(vNode); + return [ 'treegrid', 'grid', 'table' ].includes(role); + } + function skipLinkMatches(node) { + return _isSkipLink(node) && is_offscreen_default(node); + } + var skip_link_matches_default = skipLinkMatches; + function scrollableRegionFocusableMatches(node, virtualNode) { + return get_scroll_default(node, 13) !== void 0 && _isComboboxPopup(virtualNode) === false && isNoneEmptyElement(virtualNode); + } + function isNoneEmptyElement(vNode) { + return query_selector_all_default(vNode, '*').some(function(elm) { + return has_content_virtual_default(elm, true, true); }); - if (!titleNode) { - this.data({ - messageKey: 'noTitle' - }); + } + function presentationRoleConflictMatches(node, virtualNode) { + return implicit_role_default(virtualNode, { + chromiumRoles: true + }) !== null; + } + var presentation_role_conflict_matches_default = presentationRoleConflictMatches; + function pAsHeadingMatches(node) { + var children = Array.from(node.parentNode.childNodes); + var nodeText = node.textContent.trim(); + var isSentence = /[.!?:;](?![.!?:;])/g; + if (nodeText.length === 0 || (nodeText.match(isSentence) || []).length >= 2) { return false; } - try { - var titleText2 = subtree_text_default(titleNode, { - includeHidden: true - }).trim(); - if (titleText2 === '') { - this.data({ - messageKey: 'emptyTitle' - }); - return false; - } - } catch (e) { - return void 0; - } - return true; + var siblingsAfter = children.slice(children.indexOf(node) + 1).filter(function(elm) { + return elm.nodeName.toUpperCase() === 'P' && elm.textContent.trim() !== ''; + }); + return siblingsAfter.length !== 0; } - var svg_non_empty_title_evaluate_default = svgNonEmptyTitleEvaluate; - function captionFakedEvaluate(node) { - var table = to_grid_default(node); - var firstRow = table[0]; - if (table.length <= 1 || firstRow.length <= 1 || node.rows.length <= 1) { + var p_as_heading_matches_default = pAsHeadingMatches; + function noExplicitNameRequired(node, virtualNode) { + var role = get_explicit_role_default(virtualNode); + if (!role || [ 'none', 'presentation' ].includes(role)) { return true; } - return firstRow.reduce(function(out, curr, i) { - return out || curr !== firstRow[i + 1] && firstRow[i + 1] !== void 0; - }, false); - } - var caption_faked_evaluate_default = captionFakedEvaluate; - function html5ScopeEvaluate(node) { - if (!is_html5_default(document)) { + var _ref152 = aria_roles_default[role] || {}, accessibleNameRequired = _ref152.accessibleNameRequired; + if (accessibleNameRequired || _isFocusable(virtualNode)) { return true; } - return node.nodeName.toUpperCase() === 'TH'; + return false; } - var html5_scope_evaluate_default = html5ScopeEvaluate; - var same_caption_summary_evaluate_default = sameCaptionSummaryEvaluate; - function sameCaptionSummaryEvaluate(node, options, virtualNode) { - if (virtualNode.children === void 0) { - return void 0; - } - var summary = virtualNode.attr('summary'); - var captionNode = virtualNode.children.find(isCaptionNode); - var caption = captionNode ? sanitize_default(subtree_text_default(captionNode)) : false; - if (!caption || !summary) { - return false; + var no_explicit_name_required_matches_default = noExplicitNameRequired; + var object_is_loaded_matches_default = function object_is_loaded_matches_default(node, vNode) { + return [ no_explicit_name_required_matches_default, objectHasLoaded ].every(function(fn) { + return fn(node, vNode); + }); + }; + function objectHasLoaded(node) { + var _node$ownerDocument; + if (!(node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.createRange)) { + return true; } - return sanitize_default(summary).toLowerCase() === sanitize_default(caption).toLowerCase(); + var range2 = node.ownerDocument.createRange(); + range2.setStart(node, 0); + range2.setEnd(node, node.childNodes.length); + return range2.getClientRects().length === 0; } - function isCaptionNode(virtualNode) { - return virtualNode.props.nodeName === 'caption'; + function notHtmlMatches(node, virtualNode) { + return virtualNode.props.nodeName !== 'html'; } - function scopeValueEvaluate(node, options) { - var value = node.getAttribute('scope').toLowerCase(); - return options.values.indexOf(value) !== -1; + var not_html_matches_default = notHtmlMatches; + function noRoleMatches(node, vNode) { + return !vNode.attr('role'); } - var scope_value_evaluate_default = scopeValueEvaluate; - function tdHasHeaderEvaluate(node) { - var badCells = []; - var cells = get_all_cells_default(node); - var tableGrid = to_grid_default(node); - cells.forEach(function(cell) { - if (has_content_default(cell) && is_data_cell_default(cell) && !label_default2(cell)) { - var hasHeaders = get_headers_default(cell, tableGrid).some(function(header) { - return header !== null && !!has_content_default(header); - }); - if (!hasHeaders) { - badCells.push(cell); - } - } - }); - if (badCells.length) { - this.relatedNodes(badCells); + var no_role_matches_default = noRoleMatches; + function noNegativeTabindexMatches(node, virtualNode) { + var tabindex = parseInt(virtualNode.attr('tabindex'), 10); + return isNaN(tabindex) || tabindex >= 0; + } + var no_negative_tabindex_matches_default = noNegativeTabindexMatches; + function noNamingMethodMatches(node, virtualNode) { + var _get_element_spec_def3 = get_element_spec_default(virtualNode), namingMethods = _get_element_spec_def3.namingMethods; + if (namingMethods && namingMethods.length !== 0) { + return false; + } + if (get_explicit_role_default(virtualNode) === 'combobox' && query_selector_all_default(virtualNode, 'input:not([type="hidden"])').length) { + return false; + } + if (_isComboboxPopup(virtualNode, { + popupRoles: [ 'listbox' ] + })) { return false; } return true; } - var td_has_header_evaluate_default = tdHasHeaderEvaluate; - function tdHeadersAttrEvaluate(node) { - var cells = []; - var reviewCells = []; - var badCells = []; - for (var rowIndex = 0; rowIndex < node.rows.length; rowIndex++) { - var row = node.rows[rowIndex]; - for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) { - cells.push(row.cells[cellIndex]); - } - } - var ids = cells.filter(function(cell) { - return cell.getAttribute('id'); - }).map(function(cell) { - return cell.getAttribute('id'); - }); - cells.forEach(function(cell) { - var isSelf = false; - var notOfTable = false; - if (!cell.hasAttribute('headers') || !_isVisibleToScreenReaders(cell)) { - return; - } - var headersAttr = cell.getAttribute('headers').trim(); - if (!headersAttr) { - return reviewCells.push(cell); - } - var headers = token_list_default(headersAttr); - if (headers.length !== 0) { - if (cell.getAttribute('id')) { - isSelf = headers.indexOf(cell.getAttribute('id').trim()) !== -1; - } - notOfTable = headers.some(function(header) { - return !ids.includes(header); - }); - if (isSelf || notOfTable) { - badCells.push(cell); - } - } - }); - if (badCells.length > 0) { - this.relatedNodes(badCells); + var no_naming_method_matches_default = noNamingMethodMatches; + function noEmptyRoleMatches(node, virtualNode) { + if (!virtualNode.hasAttr('role')) { return false; } - if (reviewCells.length) { - this.relatedNodes(reviewCells); - return void 0; + if (!virtualNode.attr('role').trim()) { + return false; } return true; } - function thHasDataCellsEvaluate(node) { - var cells = get_all_cells_default(node); - var checkResult = this; - var reffedHeaders = []; - cells.forEach(function(cell) { - var headers2 = cell.getAttribute('headers'); - if (headers2) { - reffedHeaders = reffedHeaders.concat(headers2.split(/\s+/)); - } - var ariaLabel = cell.getAttribute('aria-labelledby'); - if (ariaLabel) { - reffedHeaders = reffedHeaders.concat(ariaLabel.split(/\s+/)); - } - }); - var headers = cells.filter(function(cell) { - if (sanitize_default(cell.textContent) === '') { - return false; - } - return cell.nodeName.toUpperCase() === 'TH' || [ 'rowheader', 'columnheader' ].indexOf(cell.getAttribute('role')) !== -1; - }); - var tableGrid = to_grid_default(node); - var out = true; - headers.forEach(function(header) { - if (header.getAttribute('id') && reffedHeaders.includes(header.getAttribute('id'))) { - return; - } - var pos = get_cell_position_default(header, tableGrid); - var hasCell = false; - if (is_column_header_default(header)) { - hasCell = traverse_default('down', pos, tableGrid).find(function(cell) { - return !is_column_header_default(cell) && get_headers_default(cell, tableGrid).includes(header); - }); - } - if (!hasCell && is_row_header_default(header)) { - hasCell = traverse_default('right', pos, tableGrid).find(function(cell) { - return !is_row_header_default(cell) && get_headers_default(cell, tableGrid).includes(header); - }); - } - if (!hasCell) { - checkResult.relatedNodes(header); - } - out = out && hasCell; - }); - return out ? true : void 0; - } - var th_has_data_cells_evaluate_default = thHasDataCellsEvaluate; - function hiddenContentEvaluate(node, options, virtualNode) { - var allowlist = [ 'SCRIPT', 'HEAD', 'TITLE', 'NOSCRIPT', 'STYLE', 'TEMPLATE' ]; - if (!allowlist.includes(node.nodeName.toUpperCase()) && has_content_virtual_default(virtualNode)) { - var styles = window.getComputedStyle(node); - if (styles.getPropertyValue('display') === 'none') { - return void 0; - } else if (styles.getPropertyValue('visibility') === 'hidden') { - var parent = get_composed_parent_default(node); - var parentStyle = parent && window.getComputedStyle(parent); - if (!parentStyle || parentStyle.getPropertyValue('visibility') !== 'hidden') { - return void 0; - } - } + var no_empty_role_matches_default = noEmptyRoleMatches; + function noAutoplayAudioMatches(node) { + if (!node.currentSrc) { + return false; + } + if (node.hasAttribute('paused') || node.hasAttribute('muted')) { + return false; } return true; } - var hidden_content_evaluate_default = hiddenContentEvaluate; - function ariaAllowedAttrMatches(node, virtualNode) { - var aria = /^aria-/; - var attrs = virtualNode.attrNames; - if (attrs.length) { - for (var _i36 = 0, l = attrs.length; _i36 < l; _i36++) { - if (aria.test(attrs[_i36])) { - return true; - } - } + var no_autoplay_audio_matches_default = noAutoplayAudioMatches; + function nestedInteractiveMatches(node, virtualNode) { + var role = get_role_default(virtualNode); + if (!role) { + return false; } - return false; + return !!standards_default.ariaRoles[role].childrenPresentational; } - var aria_allowed_attr_matches_default = ariaAllowedAttrMatches; - function ariaAllowedRoleMatches(node, virtualNode) { - return get_explicit_role_default(virtualNode, { - dpub: true, - fallback: true - }) !== null; + var nested_interactive_matches_default = nestedInteractiveMatches; + function linkInTextBlockMatches(node) { + var text = sanitize_default(node.innerText); + var role = node.getAttribute('role'); + if (role && role !== 'link') { + return false; + } + if (!text) { + return false; + } + if (!_isVisibleOnScreen(node)) { + return false; + } + return is_in_text_block_default(node); } - var aria_allowed_role_matches_default = ariaAllowedRoleMatches; - function ariaHasAttrMatches(node, virtualNode) { - var aria = /^aria-/; - return virtualNode.attrNames.some(function(attr) { - return aria.test(attr); - }); + var link_in_text_block_matches_default = linkInTextBlockMatches; + function dataTableMatches(node) { + return !is_data_table_default(node) && !_isFocusable(node); } - var aria_has_attr_matches_default = ariaHasAttrMatches; - function shouldMatchElement(el) { - if (!el) { - return true; - } - if (el.getAttribute('aria-hidden') === 'true') { + var layout_table_matches_default = dataTableMatches; + var excludedParentsForHeaderFooterLandmarks = [ 'article', 'aside', 'main', 'nav', 'section' ].join(','); + function landmarkUniqueMatches(node, virtualNode) { + return isLandmarkVirtual(virtualNode) && _isVisibleToScreenReaders(virtualNode); + } + function isLandmarkVirtual(vNode) { + var landmarkRoles2 = get_aria_roles_by_type_default('landmark'); + var role = get_role_default(vNode); + if (!role) { return false; } - return shouldMatchElement(get_composed_parent_default(el)); + var nodeName2 = vNode.props.nodeName; + if (nodeName2 === 'header' || nodeName2 === 'footer') { + return isHeaderFooterLandmark(vNode); + } + if (nodeName2 === 'section' || nodeName2 === 'form') { + var accessibleText2 = _accessibleTextVirtual(vNode); + return !!accessibleText2; + } + return landmarkRoles2.indexOf(role) >= 0 || role === 'region'; } - function ariaHiddenFocusMatches(node) { - return shouldMatchElement(get_composed_parent_default(node)); + function isHeaderFooterLandmark(headerFooterElement) { + return !closest_default(headerFooterElement, excludedParentsForHeaderFooterLandmarks); } - var aria_hidden_focus_matches_default = ariaHiddenFocusMatches; - function ariaRequiredChildrenMatches(node, virtualNode) { - var role = get_explicit_role_default(virtualNode, { - dpub: true - }); - return !!required_owned_default(role); + function landmarkHasBodyContextMatches(node, virtualNode) { + var nativeScopeFilter = 'article, aside, main, nav, section'; + return node.hasAttribute('role') || !find_up_virtual_default(virtualNode, nativeScopeFilter); } - var aria_required_children_matches_default = ariaRequiredChildrenMatches; - function ariaRequiredParentMatches(node, virtualNode) { - var role = get_explicit_role_default(virtualNode); - return !!required_context_default(role); + var landmark_has_body_context_matches_default = landmarkHasBodyContextMatches; + function labelMatches(node, virtualNode) { + if (virtualNode.props.nodeName !== 'input' || virtualNode.hasAttr('type') === false) { + return true; + } + var type2 = virtualNode.attr('type').toLowerCase(); + return [ 'hidden', 'image', 'button', 'submit', 'reset' ].includes(type2) === false; } - var aria_required_parent_matches_default = ariaRequiredParentMatches; - function autocompleteMatches(node, virtualNode) { - var autocomplete2 = virtualNode.attr('autocomplete'); - if (!autocomplete2 || sanitize_default(autocomplete2) === '') { + var label_matches_default = labelMatches; + function labelContentNameMismatchMatches(node, virtualNode) { + var role = get_role_default(node); + if (!role) { return false; } - var nodeName2 = virtualNode.props.nodeName; - if ([ 'textarea', 'input', 'select' ].includes(nodeName2) === false) { + var widgetRoles = get_aria_roles_by_type_default('widget'); + var isWidgetType2 = widgetRoles.includes(role); + if (!isWidgetType2) { return false; } - var excludedInputTypes = [ 'submit', 'reset', 'button', 'hidden' ]; - if (nodeName2 === 'input' && excludedInputTypes.includes(virtualNode.props.type)) { + var rolesWithNameFromContents = get_aria_roles_supporting_name_from_content_default(); + if (!rolesWithNameFromContents.includes(role)) { return false; } - var ariaDisabled = virtualNode.attr('aria-disabled') || 'false'; - if (virtualNode.hasAttr('disabled') || ariaDisabled.toLowerCase() === 'true') { + if (!sanitize_default(_arialabelText(virtualNode)) && !sanitize_default(arialabelledby_text_default(node))) { return false; } - var role = virtualNode.attr('role'); - var tabIndex = virtualNode.attr('tabindex'); - if (tabIndex === '-1' && role) { - var roleDef = standards_default.ariaRoles[role]; - if (roleDef === void 0 || roleDef.type !== 'widget') { - return false; - } + if (!sanitize_default(visible_virtual_default(virtualNode))) { + return false; + } + return true; + } + var label_content_name_mismatch_matches_default = labelContentNameMismatchMatches; + function isVisibleOnScreenMatches(node, virtualNode) { + return _isVisibleOnScreen(virtualNode); + } + function hasVisibleTextMatches(node) { + return _isVisibleOnScreen(node); + } + function isInitiatorMatches(node, virtualNode, context) { + return context.initiator; + } + var is_initiator_matches_default = isInitiatorMatches; + function insertedIntoFocusOrderMatches(node) { + return inserted_into_focus_order_default(node); + } + var inserted_into_focus_order_matches_default = insertedIntoFocusOrderMatches; + function identicalLinksSamePurposeMatches(node, virtualNode) { + var hasAccName = !!_accessibleTextVirtual(virtualNode); + if (!hasAccName) { + return false; } - if (tabIndex === '-1' && virtualNode.actualNode && !_isVisibleOnScreen(virtualNode) && !_isVisibleToScreenReaders(virtualNode)) { + var role = get_role_default(node); + if (role && role !== 'link') { return false; } return true; } - var autocomplete_matches_default = autocompleteMatches; - function isInitiatorMatches(node, virtualNode, context) { - return context.initiator; + var identical_links_same_purpose_matches_default = identicalLinksSamePurposeMatches; + function htmlNamespaceMatches(node, virtualNode) { + return !svg_namespace_matches_default(node, virtualNode); } - var is_initiator_matches_default = isInitiatorMatches; - function bypassMatches(node, virtualNode, context) { - if (is_initiator_matches_default(node, virtualNode, context)) { - return !!node.querySelector('a[href]'); + var html_namespace_matches_default = htmlNamespaceMatches; + function headingMatches(node, virtualNode) { + return get_role_default(virtualNode) === 'heading'; + } + function hasImplicitChromiumRoleMatches(node, virtualNode) { + return implicit_role_default(virtualNode, { + chromium: true + }) !== null; + } + var has_implicit_chromium_role_matches_default = hasImplicitChromiumRoleMatches; + function frameTitleHasTextMatches(node) { + var title = node.getAttribute('title'); + return !!sanitize_default(title); + } + var frame_title_has_text_matches_default = frameTitleHasTextMatches; + function frameFocusableContentMatches(node, virtualNode, context) { + var _context$size, _context$size2; + return !context.initiator && !context.focusable && ((_context$size = context.size) === null || _context$size === void 0 ? void 0 : _context$size.width) * ((_context$size2 = context.size) === null || _context$size2 === void 0 ? void 0 : _context$size2.height) > 1; + } + var frame_focusable_content_matches_default = frameFocusableContentMatches; + function duplicateIdMiscMatches(node) { + var id = node.getAttribute('id').trim(); + var idSelector = '*[id="'.concat(escape_selector_default(id), '"]'); + var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector)); + return !is_accessible_ref_default(node) && idMatchingElms.every(function(elm) { + return !_isFocusable(elm); + }); + } + var duplicate_id_misc_matches_default = duplicateIdMiscMatches; + function duplicateIdAriaMatches(node) { + return is_accessible_ref_default(node); + } + var duplicate_id_aria_matches_default = duplicateIdAriaMatches; + function duplicateIdActiveMatches(node) { + var id = node.getAttribute('id').trim(); + var idSelector = '*[id="'.concat(escape_selector_default(id), '"]'); + var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector)); + return !is_accessible_ref_default(node) && idMatchingElms.some(_isFocusable); + } + var duplicate_id_active_matches_default = duplicateIdActiveMatches; + function dataTableMatches2(node) { + return is_data_table_default(node); + } + var data_table_matches_default = dataTableMatches2; + function dataTableLargeMatches(node) { + if (is_data_table_default(node)) { + var tableArray = to_grid_default(node); + return tableArray.length >= 3 && tableArray[0].length >= 3 && tableArray[1].length >= 3 && tableArray[2].length >= 3; } - return true; + return false; } - var bypass_matches_default = bypassMatches; + var data_table_large_matches_default = dataTableLargeMatches; function colorContrastMatches(node, virtualNode) { var _virtualNode$props2 = virtualNode.props, nodeName2 = _virtualNode$props2.nodeName, inputType = _virtualNode$props2.type; if (nodeName2 === 'option') { @@ -25894,387 +27340,151 @@ return false; } } - var ariaLabelledbyControls = []; - var ancestorNode = virtualNode; - while (ancestorNode) { - if (ancestorNode.props.id) { - var virtualControls = get_accessible_refs_default(ancestorNode).filter(function(control) { - return token_list_default(control.getAttribute('aria-labelledby') || '').includes(ancestorNode.props.id); - }).map(function(control) { - return get_node_from_tree_default(control); - }); - ariaLabelledbyControls.push.apply(ariaLabelledbyControls, _toConsumableArray(virtualControls)); - } - ancestorNode = ancestorNode.parent; - } - if (ariaLabelledbyControls.length > 0 && ariaLabelledbyControls.every(is_disabled_default)) { - return false; - } - if (!hasRealTextChildren(virtualNode)) { - return false; - } - var range2 = document.createRange(); - var childNodes = virtualNode.children; - for (var index = 0; index < childNodes.length; index++) { - var child = childNodes[index]; - if (child.actualNode.nodeType === 3 && sanitize_default(child.actualNode.nodeValue) !== '') { - range2.selectNodeContents(child.actualNode); - } - } - var rects = range2.getClientRects(); - for (var _index2 = 0; _index2 < rects.length; _index2++) { - if (visually_overlaps_default(rects[_index2], node)) { - return true; - } - } - return false; - } - var color_contrast_matches_default = colorContrastMatches; - var removeUnicodeOptions = { - emoji: true, - nonBmp: false, - punctuations: true - }; - function hasRealTextChildren(virtualNode) { - var visibleText = visible_virtual_default(virtualNode, false, true); - if (visibleText === '' || remove_unicode_default(visibleText, removeUnicodeOptions) === '') { - return false; - } - return virtualNode.children.some(function(vChild) { - return vChild.props.nodeName === '#text' && !_isIconLigature(vChild); - }); - } - function dataTableLargeMatches(node) { - if (is_data_table_default(node)) { - var tableArray = to_grid_default(node); - return tableArray.length >= 3 && tableArray[0].length >= 3 && tableArray[1].length >= 3 && tableArray[2].length >= 3; - } - return false; - } - var data_table_large_matches_default = dataTableLargeMatches; - function dataTableMatches(node) { - return is_data_table_default(node); - } - var data_table_matches_default = dataTableMatches; - function duplicateIdActiveMatches(node) { - var id = node.getAttribute('id').trim(); - var idSelector = '*[id="'.concat(escape_selector_default(id), '"]'); - var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector)); - return !is_accessible_ref_default(node) && idMatchingElms.some(_isFocusable); - } - var duplicate_id_active_matches_default = duplicateIdActiveMatches; - function duplicateIdAriaMatches(node) { - return is_accessible_ref_default(node); - } - var duplicate_id_aria_matches_default = duplicateIdAriaMatches; - function duplicateIdMiscMatches(node) { - var id = node.getAttribute('id').trim(); - var idSelector = '*[id="'.concat(escape_selector_default(id), '"]'); - var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector)); - return !is_accessible_ref_default(node) && idMatchingElms.every(function(elm) { - return !_isFocusable(elm); - }); - } - var duplicate_id_misc_matches_default = duplicateIdMiscMatches; - function frameFocusableContentMatches(node, virtualNode, context) { - var _context$size, _context$size2; - return !context.initiator && !context.focusable && ((_context$size = context.size) === null || _context$size === void 0 ? void 0 : _context$size.width) * ((_context$size2 = context.size) === null || _context$size2 === void 0 ? void 0 : _context$size2.height) > 1; - } - var frame_focusable_content_matches_default = frameFocusableContentMatches; - function frameTitleHasTextMatches(node) { - var title = node.getAttribute('title'); - return !!sanitize_default(title); - } - var frame_title_has_text_matches_default = frameTitleHasTextMatches; - function hasImplicitChromiumRoleMatches(node, virtualNode) { - return implicit_role_default(virtualNode, { - chromium: true - }) !== null; - } - var has_implicit_chromium_role_matches_default = hasImplicitChromiumRoleMatches; - function headingMatches(node, virtualNode) { - return get_role_default(virtualNode) === 'heading'; - } - function svgNamespaceMatches(node, virtualNode) { - try { - var nodeName2 = virtualNode.props.nodeName; - if (nodeName2 === 'svg') { - return true; - } - return !!closest_default(virtualNode, 'svg'); - } catch (e) { - return false; - } - } - var svg_namespace_matches_default = svgNamespaceMatches; - function htmlNamespaceMatches(node, virtualNode) { - return !svg_namespace_matches_default(node, virtualNode); - } - var html_namespace_matches_default = htmlNamespaceMatches; - function identicalLinksSamePurposeMatches(node, virtualNode) { - var hasAccName = !!_accessibleTextVirtual(virtualNode); - if (!hasAccName) { - return false; - } - var role = get_role_default(node); - if (role && role !== 'link') { - return false; - } - return true; - } - var identical_links_same_purpose_matches_default = identicalLinksSamePurposeMatches; - function insertedIntoFocusOrderMatches(node) { - return inserted_into_focus_order_default(node); - } - var inserted_into_focus_order_matches_default = insertedIntoFocusOrderMatches; - function hasVisibleTextMatches(node) { - return _isVisibleOnScreen(node); - } - function isVisibleOnScreenMatches(node, virtualNode) { - return _isVisibleOnScreen(virtualNode); - } - function labelContentNameMismatchMatches(node, virtualNode) { - var role = get_role_default(node); - if (!role) { - return false; - } - var widgetRoles = get_aria_roles_by_type_default('widget'); - var isWidgetType2 = widgetRoles.includes(role); - if (!isWidgetType2) { - return false; - } - var rolesWithNameFromContents = get_aria_roles_supporting_name_from_content_default(); - if (!rolesWithNameFromContents.includes(role)) { - return false; - } - if (!sanitize_default(_arialabelText(virtualNode)) && !sanitize_default(arialabelledby_text_default(node))) { - return false; - } - if (!sanitize_default(visible_virtual_default(virtualNode))) { - return false; - } - return true; - } - var label_content_name_mismatch_matches_default = labelContentNameMismatchMatches; - function labelMatches(node, virtualNode) { - if (virtualNode.props.nodeName !== 'input' || virtualNode.hasAttr('type') === false) { - return true; - } - var type2 = virtualNode.attr('type').toLowerCase(); - return [ 'hidden', 'image', 'button', 'submit', 'reset' ].includes(type2) === false; - } - var label_matches_default = labelMatches; - function landmarkHasBodyContextMatches(node, virtualNode) { - var nativeScopeFilter = 'article, aside, main, nav, section'; - return node.hasAttribute('role') || !find_up_virtual_default(virtualNode, nativeScopeFilter); - } - var landmark_has_body_context_matches_default = landmarkHasBodyContextMatches; - var excludedParentsForHeaderFooterLandmarks = [ 'article', 'aside', 'main', 'nav', 'section' ].join(','); - function landmarkUniqueMatches(node, virtualNode) { - return isLandmarkVirtual(virtualNode) && _isVisibleToScreenReaders(virtualNode); - } - function isLandmarkVirtual(vNode) { - var landmarkRoles2 = get_aria_roles_by_type_default('landmark'); - var role = get_role_default(vNode); - if (!role) { - return false; - } - var nodeName2 = vNode.props.nodeName; - if (nodeName2 === 'header' || nodeName2 === 'footer') { - return isHeaderFooterLandmark(vNode); - } - if (nodeName2 === 'section' || nodeName2 === 'form') { - var accessibleText2 = _accessibleTextVirtual(vNode); - return !!accessibleText2; + var ariaLabelledbyControls = []; + var ancestorNode = virtualNode; + while (ancestorNode) { + if (ancestorNode.props.id) { + var virtualControls = get_accessible_refs_default(ancestorNode).filter(function(control) { + return token_list_default(control.getAttribute('aria-labelledby') || '').includes(ancestorNode.props.id); + }).map(function(control) { + return get_node_from_tree_default(control); + }); + ariaLabelledbyControls.push.apply(ariaLabelledbyControls, _toConsumableArray(virtualControls)); + } + ancestorNode = ancestorNode.parent; } - return landmarkRoles2.indexOf(role) >= 0 || role === 'region'; - } - function isHeaderFooterLandmark(headerFooterElement) { - return !closest_default(headerFooterElement, excludedParentsForHeaderFooterLandmarks); - } - function dataTableMatches2(node) { - return !is_data_table_default(node) && !_isFocusable(node); - } - var layout_table_matches_default = dataTableMatches2; - function linkInTextBlockMatches(node) { - var text = sanitize_default(node.innerText); - var role = node.getAttribute('role'); - if (role && role !== 'link') { + if (ariaLabelledbyControls.length > 0 && ariaLabelledbyControls.every(is_disabled_default)) { return false; } - if (!text) { + if (!hasRealTextChildren(virtualNode)) { return false; } - if (!_isVisibleOnScreen(node)) { - return false; + var range2 = document.createRange(); + var childNodes = virtualNode.children; + for (var index = 0; index < childNodes.length; index++) { + var child = childNodes[index]; + if (child.actualNode.nodeType === 3 && sanitize_default(child.actualNode.nodeValue) !== '') { + range2.selectNodeContents(child.actualNode); + } } - return is_in_text_block_default(node); + var rects = Array.from(range2.getClientRects()); + var clippingAncestors = get_overflow_hidden_ancestors_default(virtualNode); + return rects.some(function(rect) { + var overlaps = visually_overlaps_default(rect, node); + if (!clippingAncestors.length) { + return overlaps; + } + var withinOverflow = clippingAncestors.some(function(overflowNode) { + return _rectsOverlap(rect, overflowNode.boundingClientRect); + }); + return overlaps && withinOverflow; + }); } - var link_in_text_block_matches_default = linkInTextBlockMatches; - function nestedInteractiveMatches(node, virtualNode) { - var role = get_role_default(virtualNode); - if (!role) { + var color_contrast_matches_default = colorContrastMatches; + var removeUnicodeOptions = { + emoji: true, + nonBmp: false, + punctuations: true + }; + function hasRealTextChildren(virtualNode) { + var visibleText = visible_virtual_default(virtualNode, false, true); + if (visibleText === '' || remove_unicode_default(visibleText, removeUnicodeOptions) === '') { return false; } - return !!standards_default.ariaRoles[role].childrenPresentational; + return virtualNode.children.some(function(vChild) { + return vChild.props.nodeName === '#text' && !_isIconLigature(vChild); + }); } - var nested_interactive_matches_default = nestedInteractiveMatches; - function noAutoplayAudioMatches(node) { - if (!node.currentSrc) { - return false; - } - if (node.hasAttribute('paused') || node.hasAttribute('muted')) { - return false; + function bypassMatches(node, virtualNode, context) { + if (is_initiator_matches_default(node, virtualNode, context)) { + return !!node.querySelector('a[href]'); } return true; } - var no_autoplay_audio_matches_default = noAutoplayAudioMatches; - function noEmptyRoleMatches(node, virtualNode) { - if (!virtualNode.hasAttr('role')) { + var bypass_matches_default = bypassMatches; + function autocompleteMatches(node, virtualNode) { + var autocomplete2 = virtualNode.attr('autocomplete'); + if (!autocomplete2 || sanitize_default(autocomplete2) === '') { return false; } - if (!virtualNode.attr('role').trim()) { + var nodeName2 = virtualNode.props.nodeName; + if ([ 'textarea', 'input', 'select' ].includes(nodeName2) === false) { return false; } - return true; - } - var no_empty_role_matches_default = noEmptyRoleMatches; - function noExplicitNameRequired(node, virtualNode) { - var role = get_explicit_role_default(virtualNode); - if (!role || [ 'none', 'presentation' ].includes(role)) { - return true; - } - var _ref142 = aria_roles_default[role] || {}, accessibleNameRequired = _ref142.accessibleNameRequired; - if (accessibleNameRequired || _isFocusable(virtualNode)) { - return true; - } - return false; - } - var no_explicit_name_required_matches_default = noExplicitNameRequired; - function noNamingMethodMatches(node, virtualNode) { - var _get_element_spec_def3 = get_element_spec_default(virtualNode), namingMethods = _get_element_spec_def3.namingMethods; - if (namingMethods && namingMethods.length !== 0) { + var excludedInputTypes = [ 'submit', 'reset', 'button', 'hidden' ]; + if (nodeName2 === 'input' && excludedInputTypes.includes(virtualNode.props.type)) { return false; } - if (get_explicit_role_default(virtualNode) === 'combobox' && query_selector_all_default(virtualNode, 'input:not([type="hidden"])').length) { + var ariaDisabled = virtualNode.attr('aria-disabled') || 'false'; + if (virtualNode.hasAttr('disabled') || ariaDisabled.toLowerCase() === 'true') { return false; } - if (_isComboboxPopup(virtualNode, { - popupRoles: [ 'listbox' ] - })) { + var role = virtualNode.attr('role'); + var tabIndex = virtualNode.attr('tabindex'); + if (tabIndex === '-1' && role) { + var roleDef = standards_default.ariaRoles[role]; + if (roleDef === void 0 || roleDef.type !== 'widget') { + return false; + } + } + if (tabIndex === '-1' && virtualNode.actualNode && !_isVisibleOnScreen(virtualNode) && !_isVisibleToScreenReaders(virtualNode)) { return false; } return true; } - var no_naming_method_matches_default = noNamingMethodMatches; - function noNegativeTabindexMatches(node, virtualNode) { - var tabindex = parseInt(virtualNode.attr('tabindex'), 10); - return isNaN(tabindex) || tabindex >= 0; - } - var no_negative_tabindex_matches_default = noNegativeTabindexMatches; - function noRoleMatches(node, vNode) { - return !vNode.attr('role'); - } - var no_role_matches_default = noRoleMatches; - function notHtmlMatches(node, virtualNode) { - return virtualNode.props.nodeName !== 'html'; + var autocomplete_matches_default = autocompleteMatches; + function ariaRequiredParentMatches(node, virtualNode) { + var role = get_explicit_role_default(virtualNode); + return !!required_context_default(role); } - var not_html_matches_default = notHtmlMatches; - var object_is_loaded_matches_default = function object_is_loaded_matches_default(node, vNode) { - return [ no_explicit_name_required_matches_default, objectHasLoaded ].every(function(fn) { - return fn(node, vNode); + var aria_required_parent_matches_default = ariaRequiredParentMatches; + function ariaRequiredChildrenMatches(node, virtualNode) { + var role = get_explicit_role_default(virtualNode, { + dpub: true }); - }; - function objectHasLoaded(node) { - var _node$ownerDocument; - if (!(node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.createRange)) { + return !!required_owned_default(role); + } + var aria_required_children_matches_default = ariaRequiredChildrenMatches; + function shouldMatchElement(el) { + if (!el) { return true; } - var range2 = node.ownerDocument.createRange(); - range2.setStart(node, 0); - range2.setEnd(node, node.childNodes.length); - return range2.getClientRects().length === 0; - } - function pAsHeadingMatches(node) { - var children = Array.from(node.parentNode.childNodes); - var nodeText = node.textContent.trim(); - var isSentence = /[.!?:;](?![.!?:;])/g; - if (nodeText.length === 0 || (nodeText.match(isSentence) || []).length >= 2) { + if (el.getAttribute('aria-hidden') === 'true') { return false; } - var siblingsAfter = children.slice(children.indexOf(node) + 1).filter(function(elm) { - return elm.nodeName.toUpperCase() === 'P' && elm.textContent.trim() !== ''; - }); - return siblingsAfter.length !== 0; - } - var p_as_heading_matches_default = pAsHeadingMatches; - function presentationRoleConflictMatches(node, virtualNode) { - return implicit_role_default(virtualNode, { - chromiumRoles: true - }) !== null; - } - var presentation_role_conflict_matches_default = presentationRoleConflictMatches; - function scrollableRegionFocusableMatches(node, virtualNode) { - return get_scroll_default(node, 13) !== void 0 && _isComboboxPopup(virtualNode) === false && isNoneEmptyElement(virtualNode); - } - function isNoneEmptyElement(vNode) { - return query_selector_all_default(vNode, '*').some(function(elm) { - return has_content_virtual_default(elm, true, true); - }); - } - function skipLinkMatches(node) { - return _isSkipLink(node) && is_offscreen_default(node); - } - var skip_link_matches_default = skipLinkMatches; - function tableOrGridRoleMatches(_, vNode) { - var role = get_role_default(vNode); - return [ 'treegrid', 'grid', 'table' ].includes(role); + return shouldMatchElement(get_composed_parent_default(el)); } - function widgetNotInline(node, vNode) { - return matchesFns.every(function(fn) { - return fn(node, vNode); - }); + function ariaHiddenFocusMatches(node) { + return shouldMatchElement(get_composed_parent_default(node)); } - var matchesFns = [ function(node, vNode) { - return isWidgetType(vNode); - }, function(node, vNode) { - return isNotAreaElement(vNode); - }, function(node, vNode) { - return !svg_namespace_matches_default(node, vNode); - }, function(node, vNode) { - return _isFocusable(vNode); - }, function(node, vNode) { - return _isInTabOrder(vNode) || !hasWidgetAncestorInTabOrder(vNode); - }, function(node) { - return !is_in_text_block_default(node, { - noLengthCompare: true + var aria_hidden_focus_matches_default = ariaHiddenFocusMatches; + function ariaHasAttrMatches(node, virtualNode) { + var aria = /^aria-/; + return virtualNode.attrNames.some(function(attr) { + return aria.test(attr); }); - } ]; - function isWidgetType(vNode) { - return get_role_type_default(vNode) === 'widget'; } - function isNotAreaElement(vNode) { - return vNode.props.nodeName !== 'area'; + var aria_has_attr_matches_default = ariaHasAttrMatches; + function ariaAllowedRoleMatches(node, virtualNode) { + return get_explicit_role_default(virtualNode, { + dpub: true, + fallback: true + }) !== null; } - var hasWidgetAncestorInTabOrder = memoize_default(function hasWidgetAncestorInTabOrderMemoized(vNode) { - if (!(vNode !== null && vNode !== void 0 && vNode.parent)) { - return false; - } - if (isWidgetType(vNode.parent) && _isInTabOrder(vNode.parent)) { - return true; + var aria_allowed_role_matches_default = ariaAllowedRoleMatches; + function ariaAllowedAttrMatches(node, virtualNode) { + var aria = /^aria-/; + var attrs = virtualNode.attrNames; + if (attrs.length) { + for (var _i36 = 0, l = attrs.length; _i36 < l; _i36++) { + if (aria.test(attrs[_i36])) { + return true; + } + } } - return hasWidgetAncestorInTabOrderMemoized(vNode.parent); - }); - function windowIsTopMatches(node) { - return node.ownerDocument.defaultView.self === node.ownerDocument.defaultView.top; - } - var window_is_top_matches_default = windowIsTopMatches; - function xmlLangMismatchMatches(node) { - var primaryLangValue = get_base_lang_default(node.getAttribute('lang')); - var primaryXmlLangValue = get_base_lang_default(node.getAttribute('xml:lang')); - return valid_langs_default(primaryLangValue) && valid_langs_default(primaryXmlLangValue); + return false; } - var xml_lang_mismatch_matches_default = xmlLangMismatchMatches; + var aria_allowed_attr_matches_default = ariaAllowedAttrMatches; var metadataFunctionMap = { 'abstractrole-evaluate': abstractrole_evaluate_default, 'accesskeys-after': accesskeys_after_default, @@ -26424,7 +27634,7 @@ 'tabindex-evaluate': tabindex_evaluate_default, 'table-or-grid-role-matches': tableOrGridRoleMatches, 'target-offset-evaluate': targetOffsetEvaluate, - 'target-size-evaluate': targetSize, + 'target-size-evaluate': targetSizeEvaluate, 'td-has-header-evaluate': td_has_header_evaluate_default, 'td-headers-attr-evaluate': tdHeadersAttrEvaluate, 'th-has-data-cells-evaluate': th_has_data_cells_evaluate_default, @@ -27458,8 +28668,8 @@ }); }; } - function getHelpUrl(_ref143, ruleId, version) { - var brand = _ref143.brand, application = _ref143.application, lang = _ref143.lang; + function getHelpUrl(_ref153, ruleId, version) { + var brand = _ref153.brand, application = _ref153.application, lang = _ref153.lang; return constants_default.helpUrlBase + brand + '/' + (version || axe.version.substring(0, axe.version.lastIndexOf('.'))) + '/' + ruleId + '?application=' + encodeURIComponent(application) + (lang && lang !== 'en' ? '&lang=' + encodeURIComponent(lang) : ''); } function setupGlobals(context) { @@ -27673,9 +28883,9 @@ toolOptions: options }); } - function normalizeRunParams(_ref144) { - var _ref146, _options$reporter, _axe$_audit; - var _ref145 = _slicedToArray(_ref144, 3), context = _ref145[0], options = _ref145[1], callback = _ref145[2]; + function normalizeRunParams(_ref154) { + var _ref156, _options$reporter, _axe$_audit; + var _ref155 = _slicedToArray(_ref154, 3), context = _ref155[0], options = _ref155[1], callback = _ref155[2]; var typeErr = new TypeError('axe.run arguments are invalid'); if (!isContextSpec(context)) { if (callback !== void 0) { @@ -27696,7 +28906,7 @@ throw typeErr; } options = _clone(options); - options.reporter = (_ref146 = (_options$reporter = options.reporter) !== null && _options$reporter !== void 0 ? _options$reporter : (_axe$_audit = axe._audit) === null || _axe$_audit === void 0 ? void 0 : _axe$_audit.reporter) !== null && _ref146 !== void 0 ? _ref146 : 'v1'; + options.reporter = (_ref156 = (_options$reporter = options.reporter) !== null && _options$reporter !== void 0 ? _options$reporter : (_axe$_audit = axe._audit) === null || _axe$_audit === void 0 ? void 0 : _axe$_audit.reporter) !== null && _ref156 !== void 0 ? _ref156 : 'v1'; return { context: context, options: options, @@ -27811,8 +29021,8 @@ axe._audit.run(contextObj, options, res, rej); }).then(function(results) { results = node_serializer_default.mapRawResults(results); - var frames = contextObj.frames.map(function(_ref147) { - var node = _ref147.node; + var frames = contextObj.frames.map(function(_ref157) { + var node = _ref157.node; return node_serializer_default.toSpec(node); }); var environmentData; @@ -27833,14 +29043,14 @@ }); } function finishRun(partialResults) { - var _ref149, _options$reporter2, _axe$_audit2; + var _ref159, _options$reporter2, _axe$_audit2; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; options = _clone(options); - var _ref148 = partialResults.find(function(r) { + var _ref158 = partialResults.find(function(r) { return r.environmentData; - }) || {}, environmentData = _ref148.environmentData; + }) || {}, environmentData = _ref158.environmentData; axe._audit.normalizeOptions(options); - options.reporter = (_ref149 = (_options$reporter2 = options.reporter) !== null && _options$reporter2 !== void 0 ? _options$reporter2 : (_axe$_audit2 = axe._audit) === null || _axe$_audit2 === void 0 ? void 0 : _axe$_audit2.reporter) !== null && _ref149 !== void 0 ? _ref149 : 'v1'; + options.reporter = (_ref159 = (_options$reporter2 = options.reporter) !== null && _options$reporter2 !== void 0 ? _options$reporter2 : (_axe$_audit2 = axe._audit) === null || _axe$_audit2 === void 0 ? void 0 : _axe$_audit2.reporter) !== null && _ref159 !== void 0 ? _ref159 : 'v1'; setFrameSpec(partialResults); var results = merge_results_default(partialResults); results = axe._audit.after(results, options); @@ -27870,8 +29080,8 @@ _iterator23.f(); } } - function getMergedFrameSpecs(_ref150) { - var childFrameSpecs = _ref150.frames, parentFrameSpec = _ref150.frameSpec; + function getMergedFrameSpecs(_ref160) { + var childFrameSpecs = _ref160.frames, parentFrameSpec = _ref160.frameSpec; if (!parentFrameSpec) { return childFrameSpecs; } @@ -27935,8 +29145,8 @@ var transformedResults = results.map(function(result) { var transformedResult = _extends({}, result); var types = [ 'passes', 'violations', 'incomplete', 'inapplicable' ]; - for (var _i43 = 0, _types = types; _i43 < _types.length; _i43++) { - var type2 = _types[_i43]; + for (var _i43 = 0, _types2 = types; _i43 < _types2.length; _i43++) { + var type2 = _types2[_i43]; transformedResult[type2] = node_serializer_default.mapRawNodeResults(transformedResult[type2]); } return transformedResult; @@ -28599,7 +29809,10 @@ 'aria-required-children': { impact: 'critical', messages: { - pass: 'Required ARIA children are present', + pass: { + default: 'Required ARIA children are present', + 'aria-busy': 'Element has an aria-busy attribute, so it is allowed to omit required children' + }, fail: { singular: 'Required ARIA child role not present: ${data.values}', plural: 'Required ARIA children role not present: ${data.values}', @@ -29080,7 +30293,7 @@ pass: 'List item has a
    ,
      or role="list" parent element', fail: { default: 'List item does not have a
        ,
          parent element', - roleNotValid: 'List item does not have a
            ,
              parent element without a role, or a role="list"' + roleNotValid: 'List item parent element has a role that is not role="list"' } } }, @@ -29153,7 +30366,10 @@ 'target-offset': { impact: 'serious', messages: { - pass: 'Target has sufficient space from its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px which is at least ${data.minOffset}px.', + pass: { + default: 'Target has sufficient space from its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px which is at least ${data.minOffset}px.', + large: 'Target far exceeds the minimum size of ${data.minOffset}px.' + }, fail: 'Target has insufficient space to its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px instead of at least ${data.minOffset}px.', incomplete: { default: 'Element with negative tabindex has insufficient space to its closest neighbors. Safe clickable space has a diameter of ${data.closestOffset}px instead of at least ${data.minOffset}px. Is this a target?', @@ -29166,7 +30382,8 @@ messages: { pass: { default: 'Control has sufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)', - obscured: 'Control is ignored because it is fully obscured and thus not clickable' + obscured: 'Control is ignored because it is fully obscured and thus not clickable', + large: 'Target far exceeds the minimum size of ${data.minSize}px.' }, fail: { default: 'Target has insufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px)', @@ -29176,7 +30393,8 @@ default: 'Element with negative tabindex has insufficient size (${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is this a target?', contentOverflow: 'Element size could not be accurately determined due to overflow content', partiallyObscured: 'Element with negative tabindex has insufficient size because it is partially obscured (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is this a target?', - partiallyObscuredNonTabbable: 'Target has insufficient size because it is partially obscured by a neighbor with negative tabindex (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is the neighbor a target?' + partiallyObscuredNonTabbable: 'Target has insufficient size because it is partially obscured by a neighbor with negative tabindex (smallest space is ${data.width}px by ${data.height}px, should be at least ${data.minSize}px by ${data.minSize}px). Is the neighbor a target?', + tooManyRects: 'Could not get the target size because there are too many overlapping elements' } } }, @@ -29679,7 +30897,7 @@ selector: 'body', excludeHidden: false, matches: 'is-initiator-matches', - tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'EN-301-549', 'EN-9.4.1.2' ], + tags: [ 'cat.aria', 'wcag2a', 'wcag131', 'wcag412', 'EN-301-549', 'EN-9.1.3.1', 'EN-9.4.1.2' ], all: [], any: [ 'aria-hidden-body' ], none: [] @@ -29773,7 +30991,7 @@ reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'menu', 'menubar', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ] }, id: 'aria-required-children' - }, 'aria-busy' ], + } ], none: [] }, { id: 'aria-required-parent', @@ -30785,7 +32003,7 @@ impact: 'serious', selector: '*:not(select,textarea)', matches: 'scrollable-region-focusable-matches', - tags: [ 'cat.keyboard', 'wcag2a', 'wcag211', 'TTv5', 'TT4.a', 'EN-301-549', 'EN-9.2.1.1' ], + tags: [ 'cat.keyboard', 'wcag2a', 'wcag211', 'wcag213', 'TTv5', 'TT4.a', 'EN-301-549', 'EN-9.2.1.1', 'EN-9.2.1.3' ], actIds: [ '0ssw9k' ], all: [], any: [ 'focusable-content', 'focusable-element' ], @@ -30952,7 +32170,8 @@ } }, { id: 'aria-busy', - evaluate: 'aria-busy-evaluate' + evaluate: 'aria-busy-evaluate', + deprecated: true }, { id: 'aria-conditional-attr', evaluate: 'aria-conditional-attr-evaluate', diff --git a/node_modules/axe-core/axe.min.js b/node_modules/axe-core/axe.min.js index ae837ada8..87393bb95 100644 --- a/node_modules/axe-core/axe.min.js +++ b/node_modules/axe-core/axe.min.js @@ -1,5 +1,5 @@ -/*! axe v4.8.3 - * Copyright (c) 2015 - 2023 Deque Systems, Inc. +/*! axe v4.9.0 + * Copyright (c) 2015 - 2024 Deque Systems, Inc. * * Your use of this Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -9,4 +9,4 @@ * distribute or in any file that contains substantial portions of this source * code. */ -!function o(window){var q=window,document=window.document;function te(e){return(te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var axe=axe||{};function M(e){this.name="SupportError",this.cause=e.cause,this.message="`".concat(e.cause,"` - feature unsupported in your environment."),e.ruleId&&(this.ruleId=e.ruleId,this.message+=" Skipping ".concat(this.ruleId," rule.")),this.stack=(new Error).stack}axe.version="4.8.3","function"==typeof define&&define.amd&&define("axe-core",[],function(){return axe}),"object"===("undefined"==typeof module?"undefined":te(module))&&module.exports&&"function"==typeof o.toString&&(axe.source="("+o.toString()+')(typeof window === "object" ? window : this);',module.exports=axe),"function"==typeof window.getComputedStyle&&(window.axe=axe),(M.prototype=Object.create(Error.prototype)).constructor=M;var i=["node"],P=["relatedNodes"],I=["node"],B=["variant"],j=["matches"],L=["chromium"],z=["noImplicit"],V=["noPresentational"],$=["precision","format","inGamut"],H=["space"],U=["algorithm"],G=["method"],W=["maxDeltaE","deltaEMethod","steps","maxSteps"],Y=["node"],K=["environmentData"],X=["environmentData"],Z=["environmentData"],J=["environmentData"],Q=["environmentData"];function ee(e){return ve(e)||ge(e)||Ee(e)||be()}function ne(e,t,n){return(ne=le()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);t=new(Function.bind.apply(e,r));return n&&ae(t,n.prototype),t}).apply(null,arguments)}function re(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ae(e,t)}function ae(e,t){return(ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function oe(n){var r=le();return function(){var e,t=se(n),t=(e=r?(e=se(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(e&&("object"===te(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ie(t)}}function ie(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function le(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function se(e){return(se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ue(e,t,n){de(e,t),t.set(e,n)}function ce(e,t){de(e,t),t.add(e)}function de(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pe(e,t){t=he(e,t,"get");return t.get?t.get.call(e):t.value}function fe(e,t,n){if(t.has(e))return n;throw new TypeError("attempted to get private field on non-instance")}function me(e,t,n){t=he(e,t,"set");if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function he(e,t,n){if(t.has(e))return t.get(e);throw new TypeError("attempted to "+n+" private field on non-instance")}function b(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ee(e,t){var n;if(e)return"string"==typeof e?Fe(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fe(e,t):void 0}function Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"}}}),an=e(function(e,t){"use strict";var n=rn(),r=/[\n\r\u2028\u2029]/g;t.exports=function(e){e=n(e);return e=(e=100":!0,"?":!0,"@":!0,"[":!0,"\\":!0,"]":!0,"^":!0,"`":!0,"{":!0,"|":!0,"}":!0,"~":!0},i.strReplacementsRev={"\n":"\\n","\r":"\\r","\t":"\\t","\f":"\\f","\v":"\\v"},i.singleQuoteEscapeChars={n:"\n",r:"\r",t:"\t",f:"\f","\\":"\\","'":"'"},i.doubleQuotesEscapeChars={n:"\n",r:"\r",t:"\t",f:"\f","\\":"\\",'"':'"'}}),bn=e(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var b=gn();e.parseCssSelector=function(o,i,l,s,a,u){var c=o.length,d="";function p(e,t){var n="";for(i++,d=o.charAt(i);i>0},ToUint32:function(e){return e>>>0}}),f=Math.LN2,m=Math.abs,h=Math.floor,g=Math.log,b=Math.min,v=Math.pow,I=Math.round;function a(e,t,n){return er)throw new RangeError("Array too large for polyfill");for(var e=0;e>t}function A(e,t){t=32-t;return e<>>t}function j(e){return[255&e]}function L(e){return C(e[0],8)}function q(e){return[255&e]}function k(e){return A(e[0],8)}function z(e){return[(e=I(Number(e)))<0?0:255>8&255,255&e]}function $(e){return C(e[0]<<8|e[1],16)}function H(e){return[e>>8&255,255&e]}function U(e){return A(e[0]<<8|e[1],16)}function G(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}function W(e){return C(e[0]<<24|e[1]<<16|e[2]<<8|e[3],32)}function Y(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}function K(e){return A(e[0]<<24|e[1]<<16|e[2]<<8|e[3],32)}function N(e,t,n){var r,a,o,i,l,s,u,c=(1<=v(2,1-c)?(a=b(h(g(e)/f),1023),2<=(o=d(e/v(2,a)*v(2,n)))/v(2,n)&&(a+=1,o=1),c>=1;return u.reverse(),s=u.join(""),o=(1<this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=p.ToUint32(n),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else for(this.length=p.ToUint32((a=e).length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new R(this.byteLength),o=this.byteOffset=0;o=this.length)){for(var t=[],n=0,r=this.byteOffset+e*this.BYTES_PER_ELEMENT;nthis.length)throw new RangeError("Offset plus length of array is out of range");if(u=this.byteOffset+a*this.BYTES_PER_ELEMENT,c=n.length*this.BYTES_PER_ELEMENT,n.buffer===this.buffer){for(d=[],i=0,l=n.byteOffset;ithis.length)throw new RangeError("Offset plus length of array is out of range");for(i=0;ithis.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteLength=arguments.length<3?this.buffer.byteLength-this.byteOffset:p.ToUint32(n),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");F(this)}function M(o){return function(e,t){if((e=p.ToUint32(e))+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");e+=this.byteOffset;for(var n=new l.Uint8Array(this.buffer,e,o.BYTES_PER_ELEMENT),r=[],a=0;athis.byteLength)throw new RangeError("Array index out of range");for(var t=new i([t]),r=new l.Uint8Array(t.buffer),a=[],o=0;oa;)!i(r,n=t[a++])||~s(o,n)||c(o,n);return o}}),_r=e(function(e,t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),Or=e(function(e,t){var n=Rr(),r=_r();t.exports=Object.keys||function(e){return n(e,r)}}),Sr=e(function(e,t){function n(l){return function(e){for(var t,n=c(e),r=u(n),a=r.length,o=0,i=[];o":">",'"':""","'":"'","/":"/"},n=e?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(e){return e?e.toString().replace(n,function(e){return t[e]||e}):""}},void 0!==t&&t.exports?t.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):globalThis.doT=l;var s={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},u=/$^/;function c(e){return e.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}l.template=function(e,t,n){var r,a,o=(t=t||l.templateSettings).append?s.append:s.split,i=0,n=t.use||t.define?function n(a,e,o){return("string"==typeof e?e:e.toString()).replace(a.define||u,function(e,r,t,n){return(r=0===r.indexOf("def.")?r.substring(4):r)in o||(":"===t?(a.defineParams&&n.replace(a.defineParams,function(e,t,n){o[r]={arg:t,text:n}}),r in o||(o[r]=n)):new Function("def","def['"+r+"']="+n)(o)),""}).replace(a.use||u,function(e,t){return a.useParams&&(t=t.replace(a.useParams,function(e,t,n,r){var a;if(o[n]&&o[n].arg&&r)return a=(n+":"+r).replace(/'|\\/g,"_"),o.__exp=o.__exp||{},o.__exp[a]=o[n].text.replace(new RegExp("(^|[^\\w$])"+o[n].arg+"([^\\w$])","g"),"$1"+r+"$2"),t+"def.__exp['"+a+"']"})),(t=new Function("def","return "+t)(o))&&n(a,t,o)})}(t,e,n||{}):e,n=("var out='"+(t.strip?n.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):n).replace(/'|\\/g,"\\$&").replace(t.interpolate||u,function(e,t){return o.start+c(t)+o.end}).replace(t.encode||u,function(e,t){return r=!0,o.startencode+c(t)+o.end}).replace(t.conditional||u,function(e,t,n){return t?n?"';}else if("+c(n)+"){out+='":"';}else{out+='":n?"';if("+c(n)+"){out+='":"';}out+='"}).replace(t.iterate||u,function(e,t,n,r){return t?(i+=1,a=r||"i"+i,t=c(t),"';var arr"+i+"="+t+";if(arr"+i+"){var "+n+","+a+"=-1,l"+i+"=arr"+i+".length-1;while("+a+"",sameOrigin:""},f=([{name:"NA",value:"inapplicable",priority:0,group:"inapplicable"},{name:"PASS",value:"passed",priority:1,group:"passes"},{name:"CANTTELL",value:"cantTell",priority:2,group:"incomplete"},{name:"FAIL",value:"failed",priority:3,group:"violations"}].forEach(function(e){var t=e.name,n=e.value,r=e.priority,e=e.group;jr[t]=n,jr[t+"_PRIO"]=r,jr[t+"_GROUP"]=e,jr.results[r]=n,jr.resultGroups[r]=e,jr.resultGroupMap[n]=e}),Object.freeze(jr.results),Object.freeze(jr.resultGroups),Object.freeze(jr.resultGroupMap),Object.freeze(jr),jr),Lr=function(){"object"===("undefined"==typeof console?"undefined":te(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},qr=/[\t\r\n\f]/g;function zr(){ye(this,zr),this.parent=void 0}De(zr,[{key:"props",get:function(){throw new Error('VirtualNode class must have a "props" object consisting of "nodeType" and "nodeName" properties')}},{key:"attrNames",get:function(){throw new Error('VirtualNode class must have an "attrNames" property')}},{key:"attr",value:function(){throw new Error('VirtualNode class must have an "attr" function')}},{key:"hasAttr",value:function(){throw new Error('VirtualNode class must have a "hasAttr" function')}},{key:"hasClass",value:function(e){var t=this.attr("class");return!!t&&(e=" "+e+" ",0<=(" "+t+" ").replace(qr," ").indexOf(e))}}]);var p=zr,Vr={},$r=(Ce(Vr,{DqElement:function(){return Ra},aggregate:function(){return $r},aggregateChecks:function(){return Kr},aggregateNodeResults:function(){return Zr},aggregateResult:function(){return Qr},areStylesSet:function(){return ea},assert:function(){return F},checkHelper:function(){return _a},clone:function(){return Oa},closest:function(){return Va},collectResultsFromFrames:function(){return Bo},contains:function(){return jo},convertSelector:function(){return qa},cssParser:function(){return Sa},deepMerge:function(){return Lo},escapeSelector:function(){return m},extendMetaData:function(){return qo},filterHtmlAttrs:function(){return Ip},finalizeRuleResult:function(){return Xr},findBy:function(){return Mo},getAllChecks:function(){return So},getAncestry:function(){return Ca},getBaseLang:function(){return Rd},getCheckMessage:function(){return Ld},getCheckOption:function(){return qd},getEnvironmentData:function(){return zd},getFlattenedTree:function(){return kd},getFrameContexts:function(){return Qd},getFriendlyUriEnd:function(){return oa},getNodeAttributes:function(){return ia},getNodeFromTree:function(){return g},getPreloadConfig:function(){return Rp},getRootNode:function(){return Ho},getRule:function(){return ep},getScroll:function(){return np},getScrollState:function(){return rp},getSelector:function(){return Ea},getSelectorData:function(){return ya},getShadowSelector:function(){return ca},getStandards:function(){return ap},getStyleSheetFactory:function(){return ip},getXpath:function(){return Aa},injectStyle:function(){return lp},isHidden:function(){return sp},isHtmlElement:function(){return up},isNodeInContext:function(){return cp},isShadowRoot:function(){return Vo},isValidLang:function(){return Gp},isXHTML:function(){return ua},matchAncestry:function(){return pp},matches:function(){return Ma},matchesExpression:function(){return za},matchesSelector:function(){return la},memoize:function(){return n},mergeResults:function(){return Io},nodeLookup:function(){return l},nodeSerializer:function(){return Oo},nodeSorter:function(){return fp},parseCrossOriginStylesheet:function(){return vp},parseSameOriginStylesheet:function(){return gp},parseStylesheet:function(){return bp},performanceTimer:function(){return S},pollyfillElementsFromPoint:function(){return wp},preload:function(){return Np},preloadCssom:function(){return Fp},preloadMedia:function(){return kp},processMessage:function(){return jd},publishMetaData:function(){return _p},querySelectorAll:function(){return Sp},querySelectorAllFilter:function(){return Ep},queue:function(){return Ya},respondable:function(){return Co},ruleShouldRun:function(){return Pp},select:function(){return jp},sendCommandToFrame:function(){return ko},setScrollState:function(){return Lp},shadowSelect:function(){return qp},shadowSelectAll:function(){return zp},shouldPreload:function(){return Tp},toArray:function(){return ta},tokenList:function(){return wd},uniqueArray:function(){return Dp},uuid:function(){return io},validInputTypes:function(){return Vp},validLangs:function(){return Hp}}),function(t,e,n){return e=e.slice(),n&&e.push(n),n=e.map(function(e){return t.indexOf(e)}).sort(),t[n.pop()]}),Hr=f.CANTTELL_PRIO,Ur=f.FAIL_PRIO,Gr=[],Wr=(Gr[f.PASS_PRIO]=!0,Gr[f.CANTTELL_PRIO]=null,Gr[f.FAIL_PRIO]=!1,["any","all","none"]);function Yr(n,r){Wr.reduce(function(e,t){return e[t]=(n[t]||[]).map(function(e){return r(e,t)}),e},{})}var Kr=function(e){var n=Object.assign({},e),r=(Yr(n,function(e,t){var n=void 0===e.result?-1:Gr.indexOf(e.result);e.priority=-1!==n?n:f.CANTTELL_PRIO,"none"===t&&(e.priority===f.PASS_PRIO?e.priority=f.FAIL_PRIO:e.priority===f.FAIL_PRIO&&(e.priority=f.PASS_PRIO))}),{all:n.all.reduce(function(e,t){return Math.max(e,t.priority)},0),none:n.none.reduce(function(e,t){return Math.max(e,t.priority)},0),any:n.any.reduce(function(e,t){return Math.min(e,t.priority)},4)%4}),a=(n.priority=Math.max(r.all,r.none,r.any),[]);return Wr.forEach(function(t){n[t]=n[t].filter(function(e){return e.priority===n.priority&&e.priority===r[t]}),n[t].forEach(function(e){return a.push(e.impact)})}),[Hr,Ur].includes(n.priority)?n.impact=$r(f.impact,a):n.impact=null,Yr(n,function(e){delete e.result,delete e.priority}),n.result=f.results[n.priority],delete n.priority,n};function Xr(t){var n=axe._audit.rules.find(function(e){return e.id===t.id});return n&&n.impact&&t.nodes.forEach(function(t){["any","all","none"].forEach(function(e){(t[e]||[]).forEach(function(e){e.impact=n.impact})})}),Object.assign(t,Zr(t.nodes)),delete t.nodes,t}var Zr=function(e){var n={},t=((e=e.map(function(e){if(e.any&&e.all&&e.none)return Kr(e);if(Array.isArray(e.node))return Xr(e);throw new TypeError("Invalid Result type")}))&&e.length?(t=e.map(function(e){return e.result}),n.result=$r(f.results,t,n.result)):n.result="inapplicable",f.resultGroups.forEach(function(e){return n[e]=[]}),e.forEach(function(e){var t=f.resultGroupMap[e.result];n[t].push(e)}),f.FAIL_GROUP);return 0===n[t].length&&(t=f.CANTTELL_GROUP),0=t.length/2}(l)?ra(l):void 0},ia=function(e){return(e.attributes instanceof window.NamedNodeMap?e:e.cloneNode(!1)).attributes},la=function(e,t){return!!e[aa=aa&&e[aa]?aa:function(e){for(var t,n=["matches","matchesSelector","mozMatchesSelector","webkitMatchesSelector","msMatchesSelector"],r=n.length,a=0;a "+r:i,a=a?a.filter(function(e){return la(e,r)}):Array.from(n.querySelectorAll(r)),e=e.parentElement}while((1 ")?":root"+r.substring(r.indexOf(" > ")):":root"}function Ea(e,t){return ca(xa,e,t)}function Fa(e){var t,n=e.nodeName.toLowerCase(),r=e.parentElement;return r?(t="","head"!==n&&"body"!==n&&1 "+n+t):n}function Ca(e,t){return ca(Fa,e,t)}var Aa=function(e){return function e(t,n){var r,a,o,i;if(!t)return[];if(!n&&9===t.nodeType)return n=[{str:"html"}];if(n=n||[],t.parentNode&&t.parentNode!==t&&(n=e(t.parentNode,n)),t.previousSibling){for(a=1,r=t.previousSibling;1===r.nodeType&&r.nodeName===t.nodeName&&a++,r=r.previousSibling;);1===a&&(a=null)}else if(t.nextSibling)for(r=t.nextSibling;r=1===r.nodeType&&r.nodeName===t.nodeName?(a=1,null):(a=null,r.previousSibling););return 1===t.nodeType&&((o={}).str=t.nodeName.toLowerCase(),(i=t.getAttribute&&m(t.getAttribute("id")))&&1===t.ownerDocument.querySelectorAll("#"+i).length&&(o.id=t.getAttribute("id")),1(n=n||300)&&(n=r.indexOf(">"),r=r.substring(0,n+1)),r):"")}Ta.prototype={get selector(){return this.spec.selector||[Ea(this.element,this._options)]},get ancestry(){return this.spec.ancestry||[Ca(this.element)]},get xpath(){return this.spec.xpath||[Aa(this.element)]},get element(){return this._element},toJSON:function(){var e={selector:this.selector,source:this.source,xpath:this.xpath,ancestry:this.ancestry,nodeIndexes:this.nodeIndexes,fromFrame:this.fromFrame};return this._includeElementInJson&&(e.element=this._element),e}},Ta.fromFrame=function(e,t,n){e=Ta.mergeSpecs(e,n);return new Ta(n.element,t,e)},Ta.mergeSpecs=function(e,t){return h({},e,{selector:[].concat(D(t.selector),D(e.selector)),ancestry:[].concat(D(t.ancestry),D(e.ancestry)),xpath:[].concat(D(t.xpath),D(e.xpath)),nodeIndexes:[].concat(D(t.nodeIndexes),D(e.nodeIndexes)),fromFrame:!0})},Ta.setRunOptions=function(e){var t=e.elementRef,e=e.absolutePaths;v.set(Na,{elementRef:t,absolutePaths:e})};var Ra=Ta,_a=function(t,e,n,r){return{isAsync:!1,async:function(){return this.isAsync=!0,function(e){e instanceof Error==!1?(t.result=e,n(t)):r(e)}},data:function(e){t.data=e},relatedNodes:function(e){window.Node&&(e=e instanceof window.Node||e instanceof p?[e]:ta(e),t.relatedNodes=[],e.forEach(function(e){(e=e instanceof p?e.actualNode:e)instanceof window.Node&&(e=new Ra(e),t.relatedNodes.push(e))}))}}};function Oa(e){return function t(e,n){var r;if(null===e||"object"!==te(e))return e;if(null!=(r=window)&&r.Node&&e instanceof window.Node||null!=(r=window)&&r.HTMLCollection&&e instanceof window.HTMLCollection||"nodeName"in e&&"nodeType"in e&&"ownerDocument"in e)return e;if(n.has(e))return n.get(e);{var a;if(Array.isArray(e))return a=[],n.set(e,a),e.forEach(function(e){a.push(t(e,n))}),a}var o={};n.set(e,o);for(var i in e)o[i]=t(e[i],n);return o}(e,new Map)}(a=new(ke(yn()).CssSelectorParser)).registerSelectorPseudos("not"),a.registerSelectorPseudos("is"),a.registerNestingOperators(">"),a.registerAttrEqualityMods("^","$","*","~");var Sa=a;function Ma(t,e){return qa(e).some(function(e){return za(t,e)})}function Pa(e,t){return i=t,1===(o=e).props.nodeType&&("*"===i.tag||o.props.nodeName===i.tag)&&(a=e,!(o=t).classes||o.classes.every(function(e){return a.hasClass(e.value)}))&&(r=e,!(i=t).attributes||i.attributes.every(function(e){var t=r.attr(e.key);return null!==t&&e.test(t)}))&&(o=e,!(i=t).id||o.props.id===i.id)&&(n=e,!((o=t).pseudos&&!o.pseudos.every(function(e){if("not"===e.name)return!e.expressions.some(function(e){return za(n,e)});if("is"===e.name)return e.expressions.some(function(e){return za(n,e)});throw new Error("the pseudo selector "+e.name+" has not yet been implemented")})));var n,r,a,o,i}Ia=/(?=[\-\[\]{}()*+?.\\\^$|,#\s])/g;var Ia,Ba=function(e){return e.replace(Ia,"\\")},ja=/\\/g;function La(e){return e.map(function(e){for(var t=[],n=e.rule;n;)t.push({tag:n.tagName?n.tagName.toLowerCase():"*",combinator:n.nestingOperator||" ",id:n.id,attributes:function(e){if(e)return e.map(function(e){var t,n,r=e.name.replace(ja,""),a=(e.value||"").replace(ja,"");switch(e.operator){case"^=":n=new RegExp("^"+Ba(a));break;case"$=":n=new RegExp(Ba(a)+"$");break;case"~=":n=new RegExp("(^|\\s)"+Ba(a)+"(\\s|$)");break;case"|=":n=new RegExp("^"+Ba(a)+"(-|$)");break;case"=":t=function(e){return a===e};break;case"*=":t=function(e){return e&&e.includes(a)};break;case"!=":t=function(e){return a!==e};break;default:t=function(e){return null!==e}}return""===a&&/^[*$^]=$/.test(e.operator)&&(t=function(){return!1}),{key:r,value:a,type:void 0===e.value?"attrExist":"attrValue",test:t=t||function(e){return e&&n.test(e)}}})}(n.attrs),classes:function(e){if(e)return e.map(function(e){return{value:e=e.replace(ja,""),regexp:new RegExp("(^|\\s)"+Ba(e)+"(\\s|$)")}})}(n.classNames),pseudos:function(e){if(e)return e.map(function(e){var t;return["is","not"].includes(e.name)&&(t=La(t=(t=e.value).selectors||[t])),{name:e.name,expressions:t,value:e.value}})}(n.pseudos)}),n=n.rule;return t})}function qa(e){e=Sa.parse(e);return La(e.selectors||[e])}function za(e,t,n){return function e(t,n,r,a){if(!t)return!1;for(var o=Array.isArray(n)?n[r]:n,i=Pa(t,o);!i&&a&&t.parent;)i=Pa(t=t.parent,o);if(0"].includes(o.combinator))throw new Error("axe.utils.matchesExpression does not support the combinator: "+o.combinator);i=i&&e(t.parent,n,r-1," "===o.combinator)}return i}(e,t,t.length-1,n)}var Va=function(e,t){for(;e;){if(Ma(e,t))return e;if(void 0===e.parent)throw new TypeError("Cannot resolve parent for non-DOM nodes");e=e.parent}return null};function $a(){}function Ha(e){if("function"!=typeof e)throw new TypeError("Queue methods require functions as arguments")}for(var Ua,Ga,Wa,Ya=function(){function t(e){r=e,setTimeout(function(){null!=r&&Lr("Uncaught error (of queue)",r)},1)}var r,a=[],n=0,o=0,i=$a,l=!1,s=t;function u(e){return i=$a,s(e),a}function c(){for(var e=a.length;n>>((3&t)<<3)&255;return Wa}),"function"==typeof window.Buffer?window.Buffer:Array),r=[],Za={},Ja=0;Ja<256;Ja++)r[Ja]=(Ja+256).toString(16).substr(1),Za[r[Ja]]=Ja;function Qa(e,t){t=t||0;return r[e[t++]]+r[e[t++]]+r[e[t++]]+r[e[t++]]+"-"+r[e[t++]]+r[e[t++]]+"-"+r[e[t++]]+r[e[t++]]+"-"+r[e[t++]]+r[e[t++]]+"-"+r[e[t++]]+r[e[t++]]+r[e[t++]]+r[e[t++]]+r[e[t++]]+r[e[+t]]}var eo=[1|(a=Ua())[0],a[1],a[2],a[3],a[4],a[5]],to=16383&(a[6]<<8|a[7]),no=0,ro=0;function ao(e,t,n){var r=t&&n||0,a=t||[],n=null!=(e=e||{}).clockseq?e.clockseq:to,o=null!=e.msecs?e.msecs:(new Date).getTime(),i=null!=e.nsecs?e.nsecs:ro+1,l=o-no+(i-ro)/1e4;if(l<0&&null==e.clockseq&&(n=n+1&16383),1e4<=(i=(l<0||no>>24&255,a[r++]=l>>>16&255,a[r++]=l>>>8&255,a[r++]=255&l,o/4294967296*1e4&268435455),s=(a[r++]=i>>>8&255,a[r++]=255&i,a[r++]=i>>>24&15|16,a[r++]=i>>>16&255,a[r++]=n>>>8|128,a[r++]=255&n,e.node||eo),u=0;u<6;u++)a[r+u]=s[u];return t||Qa(a)}function oo(e,t,n){var r=t&&n||0,a=("string"==typeof e&&(t="binary"==e?new Xa(16):null,e=null),(e=e||{}).random||(e.rng||Ua)());if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var o=0;o<16;o++)t[r+o]=a[o];return t||Qa(a)}(a=oo).v1=ao,a.v4=oo,a.parse=function(e,t,n){var r=t&&n||0,a=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){a<16&&(t[r+a++]=Za[e])});a<16;)t[r+a++]=0;return t},a.unparse=Qa,a.BufferClass=Xa,axe._uuid=ao();var io=oo,lo=Object.freeze(["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);function so(e){var t,n,r,a;try{t=JSON.parse(e)}catch(e){return}if(null!==(e=t)&&"object"===te(e)&&"string"==typeof e.channelId&&e.source===uo())return n=(e=t).topic,r=e.channelId,a=e.messageId,e=e.keepalive,{topic:n,message:"object"===te(t.error)?function(e){var t=e.message||"Unknown error occurred",n=lo.includes(e.name)?e.name:"Error",n=window[n]||Error;e.stack&&(t+="\n"+e.stack.replace(e.message,""));return new n(t)}(t.error):t.payload,messageId:a,channelId:r,keepalive:!!e}}function uo(){var e="axeAPI",t="";return(e=void 0!==axe&&axe._audit&&axe._audit.application?axe._audit.application:e)+"."+(t=void 0!==axe?axe.version:t)}function co(e){fo(e),F(window.parent===e,"Source of the response must be the parent window.")}function po(e){fo(e),F(e.parent===window,"Respondable target must be a frame in the current window")}function fo(e){F(window!==e,"Messages can not be sent to the same window.")}var mo={},ho=[];function go(){var e="".concat(oo(),":").concat(oo());return ho.includes(e)?go():(ho.push(e),e)}function bo(n,e,t,r){var a,o,i,l,s;return(t?co:po)(n),e.message instanceof Error&&!t?(axe.log(e.message),!1):(o=h({messageId:go()},e),s=o.topic,i=o.channelId,l=o.message,i={channelId:i,topic:s,messageId:o.messageId,keepalive:!!o.keepalive,source:uo()},l instanceof Error?i.error={name:l.name,message:l.message,stack:l.stack}:i.payload=l,a=JSON.stringify(i),!(!(s=axe._audit.allowedOrigins)||!s.length||("function"==typeof r&&function(e,t,n){var r=!(2(0|t.left)&&(0|e.top)<(0|t.bottom)&&(0|e.bottom)>(0|t.top)}var Ko=n(function(e){var t=[];return e?("hidden"===e.getComputedStylePropertyValue("overflow")&&t.push(e),t.concat(Ko(e.parent))):t}),Xo=Ko,Zo=/rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/,Jo=/(\w+)\((\d+)/;function Qo(e){return["style","script","noscript","template"].includes(e.props.nodeName)}function ei(e){return"area"!==e.props.nodeName&&"none"===e.getComputedStylePropertyValue("display")}function ti(e){return!(1=t)return!0;return!1}},vi=[ai,oi,ii,li,bi];function yi(e){return e=l(e).vNode,wi(e)}var wi=n(function(t,n){return t.actualNode&&"area"===t.props.nodeName?!si(t,wi):!(di(t,{skipAncestors:!0,isAncestor:n})||t.actualNode&&vi.some(function(e){return e(t,{isAncestor:n})}))&&(!t.parent||wi(t.parent,!0))});function Di(e,t){var n=Math.min(e.top,t.top),r=Math.max(e.right,t.right),a=Math.max(e.bottom,t.bottom),e=Math.min(e.left,t.left);return new window.DOMRect(e,n,r-e,a-n)}function xi(e,t){var n=e.x,e=e.y,r=t.top,a=t.right,o=t.bottom,t=t.left;return r<=e&&n<=a&&e<=o&&t<=n}var Ei={};function Fi(e,t){var n=Math.max(e.left,t.left),r=Math.min(e.right,t.right),a=Math.max(e.top,t.top),e=Math.min(e.bottom,t.bottom);return r<=n||e<=a?null:new window.DOMRect(n,a,r-n,e-a)}function Ci(e){var t=e.left,n=e.top,r=e.width,e=e.height;return new window.DOMPoint(t+r/2,n+e/2)}Ce(Ei,{getBoundingRect:function(){return Di},getIntersectionRect:function(){return Fi},getOffset:function(){return Ni},getRectCenter:function(){return Ci},hasVisualOverlap:function(){return Ri},isPointInRect:function(){return xi},rectHasMinimumSize:function(){return ki},rectsOverlap:function(){return Yo},splitRects:function(){return _i}});var Ai=.05;function ki(e,t){var n=t.width,t=t.height;return e<=n+Ai&&e<=t+Ai}function Ni(e,t){var n=2t.right?t.right:e.x;t=e.yt.bottom?t.bottom:e.y;return{x:n,y:t}}(i,u)),l=Math.min(l,c)}}catch(e){s.e(e)}finally{s.f()}return ki(2*n,fl(t))?l:(r=Ti(i,Ci(a.reduce(Di)))-n,Math.max(0,Math.min(l,r)))}function Ti(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Ri(e,t){var n=e.boundingClientRect,r=t.boundingClientRect;return!(n.left>=r.right||n.right<=r.left||n.top>=r.bottom||n.bottom<=r.top)&&0t.top,l=rt.left,s=[];Oi(t.top,n,a)&&l&&s.push({top:n,left:r,bottom:t.top,right:o});Oi(t.right,r,o)&&i&&s.push({top:n,left:t.right,bottom:a,right:o});Oi(t.bottom,n,a)&&l&&s.push({top:t.bottom,right:o,bottom:a,left:r});Oi(t.left,r,o)&&i&&s.push({top:n,left:r,bottom:a,right:t.left});if(0===s.length){if(function(e,t){return e.top>=t.top&&e.left>=t.left&&e.bottom<=t.bottom&&e.right<=t.right}(e,t))return[];s.push(e)}return s.map(Si)}(t,n))},[])}for(n.s();!(r=n.n()).done;)o()}catch(e){n.e(e)}finally{n.f()}return a}var Oi=function(e,t,n){return te._stackingOrder[r].stackLevel)return 1;if(t._stackingOrder[r].stackLevel=Math.floor(t)&&l=Math.floor(n)})}),o=e.container;return o&&(a=ll(o._grid,o.boundingClientRect,!0).concat(a)),a=r?a:a.sort(ol).map(function(e){return e.actualNode}).concat(document.documentElement).filter(function(e,t,n){return n.indexOf(e)===t})}var sl=function(e){Li();var t=(e=g(e))._grid;return t?ll(t,e.boundingClientRect):[]},ul=function(e){return Sp(e,"*").filter(function(e){var t=e.isFocusable,e=e.actualNode.getAttribute("tabindex");return(e=e&&!isNaN(parseInt(e,10))?parseInt(e):null)?t&&0<=e:t})},cl=function(e){var t=l(e).vNode;if(t&&!el(t))switch(t.props.nodeName){case"a":case"area":if(t.hasAttr("href"))return!0;break;case"input":return"hidden"!==t.props.type;case"textarea":case"select":case"summary":case"button":return!0;case"details":return!Sp(t,"summary").length}return!1};function w(e){var e=l(e).vNode;return 1===e.props.nodeType&&!(el(e)||!cl(e)&&(!(e=e.attr("tabindex"))||isNaN(parseInt(e,10))))}function dl(e){e=l(e).vNode;return 1===e.props.nodeType&&!(parseInt(e.attr("tabindex",10))<=-1)&&w(e)}var pl=n(function(t){var e=t.boundingClientRect,n=Wi(t).filter(function(e){return Ri(t,e)&&"none"!==e.getComputedStylePropertyValue("pointer-events")&&(e=e,!(t.actualNode.contains(e.actualNode)&&!dl(e)))});return n.length?(n=n.map(function(e){return e.boundingClientRect}),_i(e,n)):[e]}),fl=n(function(e,t){return function(e,r){return e.reduce(function(e,t){var n=ki(r,e);return n!==ki(r,t)?n?e:t:(n=e.width*e.height,t.width*t.height?@\[\]^_`{|}~\xb1]/g}function Rs(){return/[\uDB80-\uDBBF][\uDC00-\uDFFF]/g}function _s(){return/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC38]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/g}function Os(){return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}var Ss=function(e,t){var n=t.emoji,r=t.nonBmp,t=t.punctuations,a=!1;return n&&(a=a||Os().test(e)),r&&(a=a||Ns().test(e)||Rs().test(e)||_s().test(e)),a=t?a||Ts().test(e):a};function Ms(e){var t=1=n){if(i.numLigatures/i.occurrences==1)return!0;if(0===i.numLigatures)return!1}i.occurrences++;var n=30,s="".concat(n,"px ").concat(l),u=(a.font=s,r.charAt(0)),c=a.measureText(u).width;if(0===c)return i.numLigatures++,!0;c<30&&(c*=d=30/c,s="".concat(n*=d,"px ").concat(l)),o.width=c,o.height=n,a.font=s,a.textAlign="left",a.textBaseline="top",a.fillText(u,0,0);var d=new Uint32Array(a.getImageData(0,0,c,n).data.buffer);if(!d.some(function(e){return e}))return i.numLigatures++,!0;a.clearRect(0,0,c,n),a.fillText(r,0,0);var p=new Uint32Array(a.getImageData(0,0,c,n).data.buffer),l=d.reduce(function(e,t,n){return 0===t&&0===p[n]||0!==t&&0!==p[n]?e:++e},0),o=r.split("").reduce(function(e,t){return e+a.measureText(t).width},0),s=a.measureText(r).width;return t<=l/d.length&&t<=1-s/o&&(i.numLigatures++,!0)}function s(n){var e,t,r,a,o,i=function(e,t){t.startNode||(t=h({startNode:e},t));1===e.props.nodeType&&t.inLabelledByContext&&void 0===t.includeHidden&&(t=h({includeHidden:!k(e)},t));return t}(n,1a.length))},cu=function(e){if(e=(e=e||{}).modalPercent||.75,v.get("isModalOpen"))return v.get("isModalOpen");if(Ep(axe._tree[0],"dialog, [role=dialog], [aria-modal=true]",yi).length)return v.set("isModalOpen",!0),!0;for(var t=gi(window),n=t.width*e,r=t.height*e,e=(t.width-n)/2,a=(t.height-r)/2,o=[{x:e,y:a},{x:t.width-e,y:a},{x:t.width/2,y:t.height/2},{x:e,y:t.height-a},{x:t.width-e,y:t.height-a}].map(function(e){return Array.from(document.elementsFromPoint(e.x,e.y))}),i=0;i=n&&parseInt(e.height,10)>=r&&"none"!==e.getPropertyValue("pointer-events")&&("absolute"===e.position||"fixed"===e.position)});if(t&&o.every(function(e){return e.includes(t)}))return v.set("isModalOpen",!0),{v:!0}}(i);if("object"===te(l))return l.v}v.set("isModalOpen",void 0)};function du(e){var t,n=1l.top+n)a=Math.max(a,l.bottom);else{if(0!==o)return!0;a=l.bottom,o++}}}catch(e){i.e(e)}finally{i.f()}return!1}var pu,fu,mu=function(e){return e instanceof window.Node},hu="color.incompleteData",N={set:function(e,t){if("string"!=typeof e)throw new Error("Incomplete data: key must be a string");var n=v.get(hu,function(){return{}});return t&&(n[e]=t),n[e]},get:function(e){var t=v.get(hu);return null==t?void 0:t[e]},clear:function(){v.set(hu,{})}},gu=function(e,t){var n=e.nodeName.toUpperCase();return["IMG","CANVAS","OBJECT","IFRAME","VIDEO","SVG"].includes(n)?(N.set("bgColor","imgNode"),!0):((e="none"!==(n=(t=t||window.getComputedStyle(e)).getPropertyValue("background-image")))&&(t=/gradient/.test(n),N.set("bgColor",t?"bgGradient":"bgImage")),e)},Dl=(Ce(a={},{Colorjs:function(){return H1},CssSelectorParser:function(){return yu.CssSelectorParser},doT:function(){return wu.default},emojiRegexText:function(){return Os},memoize:function(){return Du.default}}),ke(wn())),wn=ke(Dn()),Dn=(ke(xn()),ke(xr())),xn=ke(t());function bu(e){return"function"==typeof e||"[object Function]"===pu.call(e)}function vu(e){return e=function(e){e=Number(e);return isNaN(e)?0:0!==e&&isFinite(e)?(0>>0,a=arguments[1],o=0;o>>0,o=0;o>>0,r=2<=arguments.length?arguments[1]:void 0,a=0;athis.length)&&-1!==this.indexOf(e,t)}),Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function n(){var r=isNaN(arguments[0])?1:Number(arguments[0]);return r?Array.prototype.reduce.call(this,function(e,t){return Array.isArray(t)?e.push.apply(e,n.call(t,r-1)):e.push(t),e},[]):Array.prototype.slice.call(this)},writable:!0}),!window.Node||"isConnected"in window.Node.prototype||Object.defineProperty(window.Node.prototype,"isConnected",{get:function(){return!(this.ownerDocument&&this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}});var yu=ke(yn()),wu=ke(Br()),Du=ke(hn());function T(e,n){var t=e.length,r=(Array.isArray(e[0])||(e=[e]),(n=Array.isArray(n[0])?n:n.map(function(e){return[e]}))[0].length),a=n[0].map(function(e,t){return n.map(function(e){return e[t]})}),e=e.map(function(i){return a.map(function(e){var t=0;if(Array.isArray(i))for(var n=0;n)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);return n?((t=new String(n[1])).range=[+n[2],+n[3]],t):e})})}function _u(){ye(this,_u)}xr=Object.freeze({__proto__:null,isString:xu,type:Eu,toPrecision:Fu,parseFunction:Cu,last:Au,interpolate:ku,interpolateInv:Nu,mapRange:Tu,parseCoordGrammar:Ru,multiplyMatrices:T}),De(_u,[{key:"add",value:function(e,t,n){if("string"!=typeof arguments[0])for(var e in arguments[0])this.add(e,arguments[0][e],t);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?"unshift":"push"](t)},this)}},{key:"run",value:function(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}}]);var Ou=new _u,Su={gamut_mapping:"lch.c",precision:5,deltaE:"76"},Mu={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function Pu(e){return Array.isArray(e)?e:Mu[e]}function Iu(e,t,n,r){var a=3"==t?(n=[0,100],r="%"):""==t&&(r="deg"),{fromRange:e,toRange:n,suffix:r}}),a.serializeCoords=function(e,a){return e.map(function(e,t){var t=o[t],n=t.fromRange,r=t.toRange,t=t.suffix;return e=Fu(e=n&&r?Tu(n,r,e):e,a),t&&(e+=t),e})}),a}function Lu(){for(var e=[this],t=this;t=t.base;)e.push(t);return e}Te=new WeakSet,Re=new WeakMap,_e=new WeakSet,De(Bu,[{key:"inGamut",value:function(e){var r,t=(1"===a?n||[0,1]:n)&&o&&(i[t]=Tu(n,o,i[t]))}),{v:{v:{spaceId:t.id,coords:i,alpha:e}}}}();if("object"===te(f))return f.v}}catch(e){p.e(e)}finally{p.f()}}();if("object"===te(t))return t.v}else{var n,r=E(R.all);try{for(r.s();!(n=r.n()).done;){var a,o=n.value;for(a in o.formats){var i=o.formats[a];if("custom"===i.type&&(!i.test||i.test(m.str))){var l=i.parse(m.str);if(l)return null==l.alpha&&(l.alpha=1),l}}}}catch(e){r.e(e)}finally{r.f()}}throw new TypeError("Could not parse ".concat(e," as a color. Missing a plugin?"))}function _(e){var t;if(e)return(t=(e=xu(e)?$u(e):e).space||e.spaceId)instanceof R||(e.space=R.get(t)),void 0===e.alpha&&(e.alpha=1),e;throw new TypeError("Empty color reference")}function Hu(e,t){return(t=R.get(t)).from(e)}function Uu(e,t){var t=R.resolveCoord(t,e.space),n=t.space,t=t.index;return Hu(e,n)[t]}function Gu(e,t,n){return t=R.get(t),e.coords=t.to(e.space,n),e}function Wu(e,t,n){if(e=_(e),2===arguments.length&&"object"===Eu(t)){var r,a=t;for(r in a)Wu(e,r,a[r])}else{"function"==typeof n&&(n=n(Uu(e,t)));var o=R.resolveCoord(t,e.space),i=o.space,o=o.index,l=Hu(e,i);l[o]=n,Gu(e,i,l)}return e}var Dn=new R({id:"xyz-d50",name:"XYZ D50",white:"D50",base:zu,fromBase:function(e){return Iu(zu.white,"D50",e)},toBase:function(e){return Iu("D50",zu.white,e)},formats:{color:{}}}),Yu=24389/27,Ku=Mu.D50,Xu=new R({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"L"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Ku,base:Dn,fromBase:function(e){e=e.map(function(e,t){return e/Ku[t]}).map(function(e){return 216/24389 | ","",""]}}});function Zu(e){return(e%360+360)%360}var Ju=new R({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Xu,fromBase:function(e){var e=x(e,3),t=e[0],n=e[1],e=e[2],r=Math.abs(n)<.02&&Math.abs(e)<.02?NaN:180*Math.atan2(e,n)/Math.PI;return[t,Math.sqrt(Math.pow(n,2)+Math.pow(e,2)),Zu(r)]},toBase:function(e){var e=x(e,3),t=e[0],n=e[1],e=e[2];return n<0&&(n=0),isNaN(e)&&(e=0),[t,n*Math.cos(e*Math.PI/180),n*Math.sin(e*Math.PI/180)]},formats:{lch:{coords:[" | ",""," | "]}}}),Qu=Math.pow(25,7),ec=Math.PI,tc=180/ec,nc=ec/180;function rc(e,t){var n=2 | [0, 255]"),fc=Array(3).fill("[0, 255]"),hn=new t({id:"srgb",name:"sRGB",base:yn,fromBase:function(e){return e.map(function(e){var t=e<0?-1:1,n=e*t;return.0031308 | ","",""]}}}),Tc=.5*Math.pow(5,.5)+.5,Rc=Object.freeze({__proto__:null,contrastWCAG21:function(e,t){e=_(e),t=_(t);var n,e=Math.max(yc(e),0),t=Math.max(yc(t),0);return e | ","",""]}}}),l1=Object.freeze({__proto__:null,deltaE76:function(e,t){return vc(e,t,"lab")},deltaECMC:function(e,t){var n=void 0===(n=(r=2"}),e.defineFunction("steps",d1,{returns:"array"})}}),h1=new R({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:hn,fromBase:function(e){var t=Math.max.apply(Math,D(e)),n=Math.min.apply(Math,D(e)),e=x(e,3),r=e[0],a=e[1],o=e[2],i=NaN,e=0,l=(n+t)/2,s=t-n;if(0!=s){switch(e=0==l||1==l?0:(t-l)/Math.min(l,1-l),t){case r:i=(a-o)/s+(a | ","",""]},hsla:{coords:[" | ","",""],commas:!0,lastAlpha:!0}}}),g1=new R({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:h1,fromBase:function(e){var e=x(e,3),t=e[0],n=e[1],e=e[2],n=(e/=100)+(n/=100)*Math.min(e,1-e);return[t,0==n?0:200*(1-e/n),100*n]},toBase:function(e){var e=x(e,3),t=e[0],n=e[1],e=e[2],n=(e/=100)*(1-(n/=100)/2);return[t,0==n||1==n?0:(e-n)/Math.min(n,1-n)*100,100*n]},formats:{color:{toGamut:!0}}}),b1=new R({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:g1,fromBase:function(e){var e=x(e,3),t=e[0],n=e[1],e=e[2];return[t,e*(100-n)/100,100-e]},toBase:function(e){var e=x(e,3),t=e[0],n=e[1],e=e[2],r=(n/=100)+(e/=100);return 1<=r?[t,0,100*(n/r)]:[t,100*(0==(r=1-e)?0:1-n/r),100*r]},formats:{hwb:{toGamut:!0,coords:[" | ","",""]}}}),v1=new t({id:"a98rgb-linear",name:"Linear Adobe® 98 RGB compatible",white:"D65",toXYZ_M:[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],fromXYZ_M:[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]]}),y1=new t({id:"a98rgb",name:"Adobe® 98 RGB compatible",base:v1,toBase:function(e){return e.map(function(e){return Math.pow(Math.abs(e),563/256)*Math.sign(e)})},fromBase:function(e){return e.map(function(e){return Math.pow(Math.abs(e),256/563)*Math.sign(e)})},formats:{color:{id:"a98-rgb"}}}),w1=new t({id:"prophoto-linear",name:"Linear ProPhoto",white:"D50",base:Dn,toXYZ_M:[[.7977604896723027,.13518583717574031,.0313493495815248],[.2880711282292934,.7118432178101014,8565396060525902e-20],[0,0,.8251046025104601]],fromXYZ_M:[[1.3457989731028281,-.25558010007997534,-.05110628506753401],[-.5446224939028347,1.5082327413132781,.02053603239147973],[0,0,1.2119675456389454]]}),D1=new t({id:"prophoto",name:"ProPhoto",base:w1,toBase:function(e){return e.map(function(e){return e<.03125?e/16:Math.pow(e,1.8)})},fromBase:function(e){return e.map(function(e){return 1/512<=e?Math.pow(e,1/1.8):16*e})},formats:{color:{id:"prophoto-rgb"}}}),x1=new R({id:"oklch",name:"OKLCh",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:i1,fromBase:function(e){var e=x(e,3),t=e[0],n=e[1],e=e[2],r=Math.abs(n)<2e-4&&Math.abs(e)<2e-4?NaN:180*Math.atan2(e,n)/Math.PI;return[t,Math.sqrt(Math.pow(n,2)+Math.pow(e,2)),Zu(r)]},toBase:function(e){var t,e=x(e,3),n=e[0],r=e[1],e=e[2],r=isNaN(e)?t=0:(t=r*Math.cos(e*Math.PI/180),r*Math.sin(e*Math.PI/180));return[n,t,r]},formats:{oklch:{coords:[" | ",""," | "]}}}),E1=2610/Math.pow(2,14),F1=Math.pow(2,14)/2610,C1=2523/Math.pow(2,5),A1=Math.pow(2,5)/2523,k1=3424/Math.pow(2,12),N1=2413/Math.pow(2,7),T1=2392/Math.pow(2,7),R1=new t({id:"rec2100pq",name:"REC.2100-PQ",base:xn,toBase:function(e){return e.map(function(e){return 1e4*Math.pow(Math.max(Math.pow(e,A1)-k1,0)/(N1-T1*Math.pow(e,A1)),F1)/203})},fromBase:function(e){return e.map(function(e){var e=Math.max(203*e/1e4,0),t=k1+N1*Math.pow(e,E1),e=1+T1*Math.pow(e,E1);return Math.pow(t/e,C1)})},formats:{color:{id:"rec2100-pq"}}}),_1=.17883277,O1=.28466892,S1=.55991073,M1=3.7743,P1=new t({id:"rec2100hlg",cssid:"rec2100-hlg",name:"REC.2100-HLG",referred:"scene",base:xn,toBase:function(e){return e.map(function(e){return e<=.5?Math.pow(e,2)/3*M1:Math.exp((e-S1)/_1+O1)/12*M1})},fromBase:function(e){return e.map(function(e){return(e/=M1)<=1/12?Math.sqrt(3*e):_1*Math.log(12*e-O1)+S1})},formats:{color:{id:"rec2100-hlg"}}}),I1={};function B1(e){var t=e.id;e.toCone_M,e.fromCone_M;I1[t]=e}function j1(e,t,n){var r=I1[2"===o?(t=e,e=function(){var e=t.apply(void 0,arguments);return U1.get(e)},Object.assign(e,t)):"array"===o&&(e=e.map(function(e){return U1.get(e)})),e}var t=2Math.ceil(s.left+s.width)||Math.floor(e.top+e.height)>Math.ceil(s.top+s.height))}))}while(e=u);return!1}function dd(e){for(var t=g(e).parent;t;){if(np(t.actualNode))return t.actualNode;t=t.parent}}var pd,fd=function r(a,o){var t=2a&&e.left>n.right||e.top>r&&e.top>n.bottom||e.rightn.right||e.top>n.bottom)||"scroll"===a.overflow||"auto"===a.overflow||t instanceof window.HTMLBodyElement||t instanceof window.HTMLHtmlElement)},gd=0;function bd(e,t,n){var r;return ye(this,bd),(r=pd.call(this)).shadowId=n,r.children=[],r.actualNode=e,(r.parent=t)||(gd=0),r.nodeIndex=gd++,r._isHidden=null,r._cache={},r._isXHTML=ua(e.ownerDocument),"input"===e.nodeName.toLowerCase()&&(n=e.getAttribute("type"),n=r._isXHTML?n:(n||"").toLowerCase(),Vp().includes(n)||(n="text"),r._type=n),v.get("nodeMap")&&v.get("nodeMap").set(e,ie(r)),r}re(bd,p),pd=oe(bd),De(bd,[{key:"props",get:function(){var e,t,n,r,a,o,i,l,s;return this._cache.hasOwnProperty("props")||(e=(s=this.actualNode).nodeType,t=s.nodeName,n=s.id,r=s.multiple,a=s.nodeValue,o=s.value,i=s.selected,l=s.checked,s=s.indeterminate,this._cache.props={nodeType:e,nodeName:this._isXHTML?t:t.toLowerCase(),id:n,type:this._type,multiple:r,nodeValue:a,value:o,selected:i,checked:l,indeterminate:s}),this._cache.props}},{key:"attr",value:function(e){return"function"!=typeof this.actualNode.getAttribute?null:this.actualNode.getAttribute(e)}},{key:"hasAttr",value:function(e){return"function"==typeof this.actualNode.hasAttribute&&this.actualNode.hasAttribute(e)}},{key:"attrNames",get:function(){var e;return this._cache.hasOwnProperty("attrNames")||(e=(this.actualNode.attributes instanceof window.NamedNodeMap?this.actualNode:this.actualNode.cloneNode(!1)).attributes,this._cache.attrNames=Array.from(e).map(function(e){return e.name})),this._cache.attrNames}},{key:"getComputedStylePropertyValue",value:function(e){var t="computedStyle_"+e;return this._cache.hasOwnProperty(t)||(this._cache.hasOwnProperty("computedStyle")||(this._cache.computedStyle=window.getComputedStyle(this.actualNode)),this._cache[t]=this._cache.computedStyle.getPropertyValue(e)),this._cache[t]}},{key:"isFocusable",get:function(){return this._cache.hasOwnProperty("isFocusable")||(this._cache.isFocusable=w(this.actualNode)),this._cache.isFocusable}},{key:"tabbableElements",get:function(){return this._cache.hasOwnProperty("tabbableElements")||(this._cache.tabbableElements=ul(this)),this._cache.tabbableElements}},{key:"clientRects",get:function(){return this._cache.hasOwnProperty("clientRects")||(this._cache.clientRects=Array.from(this.actualNode.getClientRects()).filter(function(e){return 0e.clientWidth+r,r=e.scrollHeight>e.clientHeight+r;if(a||r)return t=tp(n=window.getComputedStyle(e),"overflow-x"),n=tp(n,"overflow-y"),a&&t||r&&n?{elm:e,top:e.scrollTop,left:e.scrollLeft}:void 0}),rp=function(){var e=0=n.startTime}),a=0;a"].includes(b[0].combinator))throw new Error("axe.utils.querySelectorAll does not support the combinator: "+g[1].combinator);(">"===b[0].combinator?d=d||[]:p=p||[]).push(b)}g[0].id&&c.shadowId!==l.parentShadowId||null==(b=l.anyLevel)||!b.includes(g)||(p=p||[]).push(g)}for(c.children&&c.children.length&&(i.push(l),l=xp(c.children,p,d,c.shadowId,o.pop()));l.vNodesIndex===l.vNodes.length&&i.length;)o.push(l),l=i.pop()}return s},Fp=function(e){var t,n,l,s,e=void 0===(e=e.treeRoot)?axe._tree[0]:e;return t=[],e=Ep(e=e,"*",function(e){return!t.includes(e.shadowId)&&(t.push(e.shadowId),!0)}).map(function(e){return{shadowId:e.shadowId,rootNode:Ho(e.actualNode)}}),(e=Dp(e,[])).length?(n=document.implementation.createHTMLDocument("Dynamic document for loading cssom"),n=ip(n),l=n,s=[],e.forEach(function(e,t){var n=e.rootNode,e=e.shadowId,r=function(e,t,n){t=11===e.nodeType&&t?function(r,a){return Array.from(r.children).filter(Cp).reduce(function(e,t){var n=t.nodeName.toUpperCase(),t="STYLE"===n?t.textContent:t,t=a({data:t,isLink:"LINK"===n,root:r});return t.sheet&&e.push(t.sheet),e},[])}(e,n):function(e){return Array.from(e.styleSheets).filter(function(e){return!!e.media&&Ap(e.media.mediaText)})}(e);return function(e){var t=[];return e.filter(function(e){if(e.href){if(t.includes(e.href))return!1;t.push(e.href)}return!0})}(t)}(n,e,l);if(!r)return Promise.all(s);var a=t+1,o={rootNode:n,shadowId:e,convertDataToStylesheet:l,rootIndex:a},i=[],t=Promise.all(r.map(function(e,t){return bp(e,o,[a,t],i)}));s.push(t)}),Promise.all(s).then(function n(e){return e.reduce(function(e,t){return Array.isArray(t)?e.concat(n(t)):e.concat(t)},[])})):Promise.resolve()};function Cp(e){var t=e.nodeName.toUpperCase(),n=e.getAttribute("href"),r=e.getAttribute("rel"),n="LINK"===t&&n&&r&&e.rel.toUpperCase().includes("STYLESHEET");return"STYLE"===t||n&&Ap(e.media)}function Ap(e){return!e||!e.toUpperCase().includes("PRINT")}var kp=function(e){return e=void 0===(e=e.treeRoot)?axe._tree[0]:e,e=Ep(e,"video, audio",function(e){e=e.actualNode;return e.hasAttribute("src")?!!e.getAttribute("src"):!(Array.from(e.getElementsByTagName("source")).filter(function(e){return!!e.getAttribute("src")}).length<=0)}),Promise.all(e.map(function(e){var n,e=e.actualNode;return n=e,new Promise(function(t){0 option, datalist > option, optgroup > option")},SELECT:function(e){var t=e.node,e=e.role;return!t.multiple&&t.size<=1&&"menu"===e},SVG:function(e){var t=e.node,e=e.out;return!(!t.parentNode||"http://www.w3.org/2000/svg"!==t.parentNode.namespaceURI)||e}},Dn.rolesOfType={widget:["button","checkbox","dialog","gridcell","link","log","marquee","menuitem","menuitemcheckbox","menuitemradio","option","progressbar","radio","scrollbar","searchbox","slider","spinbutton","status","switch","tab","tabpanel","textbox","timer","tooltip","tree","treeitem"]},Dn),wf=function(e){var t=null,e=yf.role[e];return t=e&&e.implicit?Oa(e.implicit):t},Df=function(e){return!!sf(e).length};function xf(e){var t=(1=o}},Tf=function(e){return!!C.ariaAttrs[e]};function Rf(e,t,n){return 0<(n=wd(n.attr("role")).filter(function(e){return"abstract"===iu(e)})).length&&(this.data(n),!0)}function _f(e){var t=1window.innerWidth||e.top>window.innerHeight))return{x:Math.min(Math.ceil(e.left+e.width/2),window.innerWidth-1),y:Math.min(Math.ceil(e.top+e.height/2),window.innerHeight-1)}});function nm(e){return e.getPropertyValue("font-family").split(/[,;]/g).map(function(e){return e.trim().toLowerCase()})}var rm=function(e,t){var n,r=window.getComputedStyle(e);return"none"!==r.getPropertyValue("background-image")||!!["border-bottom","border-top","outline"].reduce(function(e,t){var n=new O;return n.parseString(r.getPropertyValue(t+"-color")),e||"none"!==r.getPropertyValue(t+"-style")&&0=n.top&&e.bottom<=a&&e.left>=n.left&&e.right<=r})}function Am(e){return e||void 0}var km=function(e,t){return t&&e?(t.alpha<1&&(t=sm(t,e)),e=e.getRelativeLuminance(),t=t.getRelativeLuminance(),(Math.max(t,e)+.05)/(Math.min(t,e)+.05)):null};function Nm(e,t,n){for(var a=3 "),n[t]=e,!0):(t=e.node.ancestry.slice(0,e.node.ancestry.length-1).flat(1/0).join(" > "),n[t]&&(n[t].result=!0),!1)})}function Ah(e,t){return!t.isViolation&&void 0}function kh(e,t){var n,r;if(e.duration)return t=void 0===(t=t.allowedDuration)?3:t,((n=e).currentSrc?(r=function(e){e=e.match(/#t=(.*)/);if(e)return x(e,2)[1].split(",").map(function(e){if(/:/.test(e)){for(var t=e.split(":"),n=0,r=1;0=t.top&&e.left>=t.left&&e.bottom<=t.bottom&&e.right<=t.right}function _h(e){return{width:Math.round(10*e.width)/10,height:Math.round(10*e.height)/10}}function Oh(e,t){return e.actualNode.contains(t.actualNode)&&!dl(t)}function Sh(e){return e.map(function(e){return e.actualNode})}function Mh(e,t){var n=null==(n=t.data)?void 0:n.headingOrder,r=Ih(t.node.ancestry,1);return n&&(t=n.map(function(e){var t=r;return t=r.concat(e.ancestry),h({},e,{ancestry:t})}),-1===(n=function(e,t){for(;t.length;){var n=Ph(e,t);if(-1!==n)return n;t=Ih(t,1)}return-1}(e,r))?e.push.apply(e,D(t)):e.splice.apply(e,[n,0].concat(D(t)))),e}function Ph(e,t){return e.findIndex(function(e){return pp(e.ancestry,t)})}function Ih(e,t){return e.slice(0,e.length-t)}function Bh(){var e,t=v.get("headingOrder");return t||(t=(e=Ep(axe._tree[0],"h1, h2, h3, h4, h5, h6, [role=heading], iframe, frame",k)).map(function(e){return{ancestry:[Ca(e.actualNode)],level:(t=(t=d(e=e))&&t.includes("heading"),n=e.attr("aria-level"),r=parseInt(n,10),e=x(e.props.nodeName.match(/h(\d)/)||[],2)[1],t?e&&!n?parseInt(e,10):isNaN(r)||r<1?e?parseInt(e,10):2:r||-1:-1)};var t,n,r}),this.data({headingOrder:t}),v.set("headingOrder",e)),!0}function jh(e){if(e.length<2)return e;function t(n){var e=i[n],t=e.data,r=t.name,a=t.urlProps;if(s[r])return"continue";var o=(t=i.filter(function(e,t){return e.data.name===r&&t!==n})).every(function(e){return function n(r,a){var e,t;return!(!r||!a)&&(e=Object.getOwnPropertyNames(r),t=Object.getOwnPropertyNames(a),e.length===t.length)&&e.every(function(e){var t=r[e],e=a[e];return te(t)===te(e)&&("object"===te(t)||"object"===te(e)?n(t,e):t===e)})}(e.data.urlProps,a)});t.length&&!o&&(e.result=void 0),e.relatedNodes=[],(o=e.relatedNodes).push.apply(o,D(t.map(function(e){return e.relatedNodes[0]}))),s[r]=t,l.push(e)}for(var i=e.filter(function(e){return void 0!==e.result}),l=[],s={},n=0;n.95*gi(window).width||l<10||e.querySelector("object, embed, iframe, applet"))},Yh=function(e){return!(!_l(e)&&!Ol(e))||!!e.getAttribute("id")&&(e=m(e.getAttribute("id")),!!document.querySelector('[headers~="'.concat(e,'"]')))},Kh=function(e,t,n,r){if(Array.isArray(t)&&(r=n,n=t,t={x:0,y:0}),"string"==typeof e)switch(e){case"left":e={x:-1,y:0};break;case"up":e={x:0,y:-1};break;case"right":e={x:1,y:0};break;case"down":e={x:0,y:1}}return function e(t,n,r,a){var o,i=r[n.y]?r[n.y][n.x]:void 0;return i?"function"==typeof a&&!0===(o=a(i,n,r))?[i]:((o=e(t,{x:n.x+t.x,y:n.y+t.y},r,a)).unshift(i),o):[]}(e,{x:t.x+e.x,y:t.y+e.y},n,r)};function Xh(e,t,n){var n=ml.accessibleTextVirtual(n);if(n=ml.sanitize(ml.removeUnicode(n,{emoji:!0,nonBmp:!0,punctuations:!0})).toLowerCase())return n={name:n,urlProps:$o.urlPropsFromAttribute(e,"href")},this.data(n),this.relatedNodes([e]),!0}function Zh(e,t,n){return Sp(n,"a[href]").some(function(e){return/^#[^/!]/.test(e.attr("href"))})}var Jh=/[;,\s]/,Qh=/^[0-9.]+$/;function eg(e){e=window.getComputedStyle(function(e){for(var t=e,n=e.textContent.trim(),r=n;r===n&&void 0!==t;){var a=-1;if(0===(e=t).children.length)return e;for(;a++,""===(r=e.children[a].textContent.trim())&&a+1r.fontSize)&&(!t.weight||n.fontWeight-t.weight>r.fontWeight)&&(!t.italic||n.isItalic&&!r.isItalic)},!1)}function ng(e,t,n){var r=(i=Array.from(e.parentNode.children)).indexOf(e),a=(t=t||{}).margins||[],o=i.slice(r+1).find(function(e){return"P"===e.nodeName.toUpperCase()}),i=i.slice(0,r).reverse().find(function(e){return"P"===e.nodeName.toUpperCase()}),r=eg(e),l=o?eg(o):null,i=i?eg(i):null,s=t.passLength,t=t.failLength,e=e.textContent.trim().length;return(o=null==o?void 0:o.textContent.trim().length)*s=i||"bold"===r,r=Math.ceil(72*m)/96,l=i&&r ":"";if(3===i&&""!==a.trim())return t+"#text";if(1!==i||!k(e))return!1;a=c(e);return a?!r.includes(a)&&t+"[role=".concat(a,"]"):!n.includes(o)&&t+o}(l,i,t);s&&(a.includes(s)||a.push(s),1===(null==l||null==(i=l.actualNode)?void 0:i.nodeType))&&r.push(l.actualNode)}}return 0===a.length?!1:(this.data({values:a.join(", ")}),this.relatedNodes(r),!0)}},"invalidrole-evaluate":Wf,"is-element-focusable-evaluate":Yf,"is-initiator-matches":Mg,"is-on-screen-evaluate":yn,"is-visible-matches":yi,"is-visible-on-screen-matches":function(e,t){return yi(t)},"label-content-name-mismatch-evaluate":dh,"label-content-name-mismatch-matches":Xg,"label-matches":Zg,"landmark-has-body-context-matches":Jg,"landmark-is-top-level-evaluate":eh,"landmark-is-unique-after":mh,"landmark-is-unique-evaluate":hh,"landmark-unique-matches":function(e,t){return n=t,a=ff("landmark"),!!(o=d(n))&&("header"!==(r=n.props.nodeName)&&"footer"!==r?"section"!==r&&"form"!==r?0<=a.indexOf(o)||"region"===o:!!s(n):!Va(n,Qg))&&k(t);var n,r,a,o},"layout-table-matches":eb,"link-in-text-block-evaluate":Pm,"link-in-text-block-matches":tb,"link-in-text-block-style-evaluate":function(e){if(Bm(e))return!1;for(var t=u(e);t&&1===t.nodeType&&!Bm(t);)t=u(t);return t?(this.relatedNodes([t]),!!rm(e,t)||!!function(e){for(var t=0,n=["before","after"];tt.maxDelay},"meta-viewport-scale-evaluate":Th,"multiple-label-evaluate":ph,"nested-interactive-matches":nb,"no-autoplay-audio-evaluate":kh,"no-autoplay-audio-matches":rb,"no-empty-role-matches":ab,"no-explicit-name-required-matches":ob,"no-focusable-content-evaluate":function(e,t,n){if(n.children)try{var r,a=function t(e){if(!e.children){if(1===e.props.nodeType)throw new Error("Cannot determine children");return[]}var n=[];e.children.forEach(function(e){"widget"===iu(e)&&w(e)?n.push(e):n.push.apply(n,D(t(e)))});return n}(n);return a.length?(0<(r=a.filter(th)).length?(this.data({messageKey:"notHidden"}),this.relatedNodes(r)):this.relatedNodes(a),!1):!0}catch(e){}},"no-implicit-explicit-label-evaluate":Kf,"no-naming-method-matches":ib,"no-negative-tabindex-matches":lb,"no-role-matches":sb,"non-empty-if-present-evaluate":bg,"not-html-matches":ub,"object-is-loaded-matches":function(t,n){return[ob,function(e){var t;return null==e||null==(t=e.ownerDocument)||!t.createRange||((t=e.ownerDocument.createRange()).setStart(e,0),t.setEnd(e,e.childNodes.length),0===t.getClientRects().length)}].every(function(e){return e(t,n)})},"only-dlitems-evaluate":function(e,t,n){var a=["definition","term","list"];return(n=n.children.reduce(function(e,t){var n=t.actualNode;return"DIV"===n.nodeName.toUpperCase()&&null===d(n)?e.concat(t.children):e.concat(t)},[]).reduce(function(e,t){var n,t=t.actualNode,r=t.nodeName.toUpperCase();return 1===t.nodeType&&k(t)?(n=c(t),("DT"!==r&&"DD"!==r||n)&&!a.includes(n)&&e.badNodes.push(t)):3===t.nodeType&&""!==t.nodeValue.trim()&&(e.hasNonEmptyTextNode=!0),e},{badNodes:[],hasNonEmptyTextNode:!1})).badNodes.length&&this.relatedNodes(n.badNodes),!!n.badNodes.length||n.hasNonEmptyTextNode},"only-listitems-evaluate":xh,"p-as-heading-evaluate":ng,"p-as-heading-matches":cb,"page-no-duplicate-after":Hm,"page-no-duplicate-evaluate":Um,"presentation-role-conflict-matches":db,"presentational-role-evaluate":function(e,t,n){var r=c(n);if(["presentation","none"].includes(r)&&["iframe","frame"].includes(n.props.nodeName)&&n.hasAttr("title"))this.data({messageKey:"iframe",nodeName:n.props.nodeName});else{var a,o=d(n);if(["presentation","none"].includes(o))return this.data({role:o}),!0;["presentation","none"].includes(r)&&(r=kl().some(function(e){return n.hasAttr(e)}),a=w(n),this.data({messageKey:r&&!a?"globalAria":!r&&a?"focusable":"both",role:o}))}return!1},"region-after":rg,"region-evaluate":function(e,t,n){return this.data({isIframe:["iframe","frame"].includes(n.props.nodeName)}),!v.get("regionlessNodes",function(){return function t(e,n){var r=e.actualNode;{if("button"===d(e)||og(e,n)||["iframe","frame"].includes(e.props.nodeName)||rd(e.actualNode)&&al(e.actualNode,"href")||!k(r)){for(var a=e;a;)a._hasRegionDescendant=!0,a=a.parent;return["iframe","frame"].includes(e.props.nodeName)?[e]:[]}return r!==document.body&&Qs(r,!0)?[e]:e.children.filter(function(e){e=e.actualNode;return 1===e.nodeType}).map(function(e){return t(e,n)}).reduce(function(e,t){return e.concat(t)},[])}}(axe._tree[0],t).map(function(e){for(;e.parent&&!e.parent._hasRegionDescendant&&e.parent.actualNode!==document.body;)e=e.parent;return e}).filter(function(e,t,n){return n.indexOf(e)===t})}).includes(n)},"same-caption-summary-evaluate":Dg,"scope-value-evaluate":Eg,"scrollable-region-focusable-matches":function(e,t){return void 0!==np(e,13)&&!1===xf(t)&&Sp(t,"*").some(function(e){return Js(e,!0,!0)})},"skip-link-evaluate":ig,"skip-link-matches":pb,"structured-dlitems-evaluate":Eh,"svg-namespace-matches":Gg,"svg-non-empty-title-evaluate":vg,"tabindex-evaluate":nh,"table-or-grid-role-matches":function(e,t){return t=d(t),["treegrid","grid","table"].includes(t)},"target-offset-evaluate":function(e,t,n){var r,a,o=(null==t?void 0:t.minOffset)||24,i=[],l=o,s=E(Wi(n,o));try{for(s.s();!(r=s.n()).done;){var u,c=r.value;"widget"===iu(c)&&w(c)&&(o<=.05+(u=2*(a=Ni(n,c,o/2),Math.round(10*a)/10))||(l=Math.min(l,u),i.push(c)))}}catch(e){s.e(e)}finally{s.f()}return 0===i.length?(this.data({closestOffset:l,minOffset:o}),!0):(this.relatedNodes(i.map(function(e){return e.actualNode})),i.some(dl)?(this.data({closestOffset:l,minOffset:o}),!dl(n)&&void 0):void this.data({messageKey:"nonTabbableNeighbor",closestOffset:l,minOffset:o}))},"target-size-evaluate":function(e,t,n){var r,a,t=(null==t?void 0:t.minSize)||24,o=n.boundingClientRect,i=ki.bind(null,t),l=Wi(n),s=(r=n,l.filter(function(e){return!Rh(e,r)&&Oh(r,e)})),u=(l=function(e,t){var n,r=[],a=[],o=E(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;!Oh(e,i)&&Ri(e,i)&&"none"!==i.getComputedStylePropertyValue("pointer-events")&&(Rh(e,i)?r:a).push(i)}}catch(e){o.e(e)}finally{o.f()}return{fullyObscuringElms:r,partialObscuringElms:a}}(n,l)).fullyObscuringElms,l=l.partialObscuringElms;return u.length&&!s.length?(this.relatedNodes(Sh(u)),this.data({messageKey:"obscured"}),!0):(a=!dl(n)&&void 0,i(o)||s.length?(l=function(e,t){e=e.boundingClientRect;if(0===t.length)return null;t=t.map(function(e){return e.boundingClientRect});return function(e,r){return e.reduce(function(e,t){var n=ki(r,e);return n!==ki(r,t)?n?e:t:(n=e.width*e.height,t.width*t.height elements of image maps have alternate text",help:"Active elements must have alternate text"},"aria-allowed-attr":{description:"Ensures an element's role supports its ARIA attributes",help:"Elements must only use supported ARIA attributes"},"aria-allowed-role":{description:"Ensures role attribute has an appropriate value for the element",help:"ARIA role should be appropriate for the element"},"aria-braille-equivalent":{description:"Ensure aria-braillelabel and aria-brailleroledescription have a non-braille equivalent",help:"aria-braille attributes must have a non-braille equivalent"},"aria-command-name":{description:"Ensures every ARIA button, link and menuitem has an accessible name",help:"ARIA commands must have an accessible name"},"aria-conditional-attr":{description:"Ensures ARIA attributes are used as described in the specification of the element's role",help:"ARIA attributes must be used as specified for the element's role"},"aria-deprecated-role":{description:"Ensures elements do not use deprecated roles",help:"Deprecated ARIA roles must not be used"},"aria-dialog-name":{description:"Ensures every ARIA dialog and alertdialog node has an accessible name",help:"ARIA dialog and alertdialog nodes should have an accessible name"},"aria-hidden-body":{description:'Ensures aria-hidden="true" is not present on the document body.',help:'aria-hidden="true" must not be present on the document body'},"aria-hidden-focus":{description:"Ensures aria-hidden elements are not focusable nor contain focusable elements",help:"ARIA hidden element must not be focusable or contain focusable elements"},"aria-input-field-name":{description:"Ensures every ARIA input field has an accessible name",help:"ARIA input fields must have an accessible name"},"aria-meter-name":{description:"Ensures every ARIA meter node has an accessible name",help:"ARIA meter nodes must have an accessible name"},"aria-progressbar-name":{description:"Ensures every ARIA progressbar node has an accessible name",help:"ARIA progressbar nodes must have an accessible name"},"aria-prohibited-attr":{description:"Ensures ARIA attributes are not prohibited for an element's role",help:"Elements must only use permitted ARIA attributes"},"aria-required-attr":{description:"Ensures elements with ARIA roles have all required ARIA attributes",help:"Required ARIA attributes must be provided"},"aria-required-children":{description:"Ensures elements with an ARIA role that require child roles contain them",help:"Certain ARIA roles must contain particular children"},"aria-required-parent":{description:"Ensures elements with an ARIA role that require parent roles are contained by them",help:"Certain ARIA roles must be contained by particular parents"},"aria-roledescription":{description:"Ensure aria-roledescription is only used on elements with an implicit or explicit role",help:"aria-roledescription must be on elements with a semantic role"},"aria-roles":{description:"Ensures all elements with a role attribute use a valid value",help:"ARIA roles used must conform to valid values"},"aria-text":{description:'Ensures role="text" is used on elements with no focusable descendants',help:'"role=text" should have no focusable descendants'},"aria-toggle-field-name":{description:"Ensures every ARIA toggle field has an accessible name",help:"ARIA toggle fields must have an accessible name"},"aria-tooltip-name":{description:"Ensures every ARIA tooltip node has an accessible name",help:"ARIA tooltip nodes must have an accessible name"},"aria-treeitem-name":{description:"Ensures every ARIA treeitem node has an accessible name",help:"ARIA treeitem nodes should have an accessible name"},"aria-valid-attr-value":{description:"Ensures all ARIA attributes have valid values",help:"ARIA attributes must conform to valid values"},"aria-valid-attr":{description:"Ensures attributes that begin with aria- are valid ARIA attributes",help:"ARIA attributes must conform to valid names"},"audio-caption":{description:"Ensures