From ca041f2e0de6c447470cfc50e859c6bf2d117521 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 20 Dec 2020 19:05:31 +1100 Subject: [PATCH 01/13] Bump ini from 1.3.5 to 1.3.7 (#2044) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9063369d..f1d253f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5927,9 +5927,9 @@ inherits@2.0.3: integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + version "1.3.7" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" + integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== inquirer@^7.0.0: version "7.1.0" From 6a6fb8d41a7af7f386f9dcb2b660d51c49076304 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sun, 20 Dec 2020 20:10:37 +1100 Subject: [PATCH 02/13] chore: package updates --- package.json | 17 +- yarn.lock | 573 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 440 insertions(+), 150 deletions(-) diff --git a/package.json b/package.json index eb6a4df2..8549d67a 100644 --- a/package.json +++ b/package.json @@ -42,9 +42,10 @@ "@sampotts/eslint-config": "1.1.5", "ansi-colors": "^4.1.1", "autoprefixer": "^10.0.2", - "aws-sdk": "^2.773.0", - "@babel/core": "^7.12.3", - "@babel/preset-env": "^7.12.1", + "aws-sdk": "^2.814.0", + "@babel/core": "^7.12.10", + "@babel/preset-env": "^7.12.11", + "@babel/plugin-proposal-class-properties": "^7.12.1", "babel-eslint": "^10.1.0", "browser-sync": "^2.26.13", "del": "^6.0.0", @@ -69,19 +70,19 @@ "gulp-size": "^3.0.0", "gulp-sourcemaps": "^3.0.0", "gulp-svgstore": "^7.0.1", - "gulp-terser": "^1.4.1", + "gulp-terser": "^2.0.0", "postcss": "^8.1.7", "postcss-clean": "^1.1.0", "postcss-custom-properties": "^10.0.0", - "prettier-eslint": "^11.0.0", + "prettier-eslint": "^12.0.0", "prettier-stylelint": "^0.4.2", "remark-cli": "^9.0.0", "remark-validate-links": "^10.0.2", - "rollup": "^2.33.1", + "rollup": "^2.35.1", "rollup-plugin-babel": "^4.4.0", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-node-resolve": "^5.2.0", - "stylelint": "^13.7.2", + "stylelint": "^13.8.0", "stylelint-config-prettier": "^8.0.2", "stylelint-config-recommended": "^3.0.0", "stylelint-config-sass-guidelines": "^7.1.0", @@ -91,7 +92,7 @@ "through2": "^4.0.2" }, "dependencies": { - "core-js": "^3.7.0", + "core-js": "^3.8.1", "custom-event-polyfill": "^1.0.7", "loadjs": "^4.2.0", "rangetouch": "^2.0.1", diff --git a/yarn.lock b/yarn.lock index f1d253f9..431b40ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16,10 +16,10 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/compat-data@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.12.1.tgz#d7386a689aa0ddf06255005b4b991988021101a0" - integrity sha512-725AQupWJZ8ba0jbKceeFblZTY90McUBWMwHhkFQ9q1zKPJ95GUktljFcgcsIVwRnTnRKlcYzfiNImg5G9m6ZQ== +"@babel/compat-data@^7.12.5", "@babel/compat-data@^7.12.7": + version "7.12.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.12.7.tgz#9329b4782a7d6bbd7eef57e11addf91ee3ef1e41" + integrity sha512-YaxPMGs/XIWtYqrdEOZOCPsVWfEoriXopnsz3/i7apYPXQ3698UFhS6dVT1KN5qOsWmVgw/FOrmQgpRaZayGsw== "@babel/core@>=7.9.0": version "7.9.0" @@ -43,25 +43,24 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.12.3": - version "7.12.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.3.tgz#1b436884e1e3bff6fb1328dc02b208759de92ad8" - integrity sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g== +"@babel/core@^7.12.10": + version "7.12.10" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.10.tgz#b79a2e1b9f70ed3d84bbfb6d8c4ef825f606bccd" + integrity sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w== dependencies: "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.1" + "@babel/generator" "^7.12.10" "@babel/helper-module-transforms" "^7.12.1" - "@babel/helpers" "^7.12.1" - "@babel/parser" "^7.12.3" - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.12.1" - "@babel/types" "^7.12.1" + "@babel/helpers" "^7.12.5" + "@babel/parser" "^7.12.10" + "@babel/template" "^7.12.7" + "@babel/traverse" "^7.12.10" + "@babel/types" "^7.12.10" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.1" json5 "^2.1.2" lodash "^4.17.19" - resolve "^1.3.2" semver "^5.4.1" source-map "^0.5.0" @@ -83,6 +82,15 @@ jsesc "^2.5.1" source-map "^0.5.0" +"@babel/generator@^7.12.10": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.11.tgz#98a7df7b8c358c9a37ab07a24056853016aba3af" + integrity sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA== + dependencies: + "@babel/types" "^7.12.11" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/generator@^7.9.0", "@babel/generator@^7.9.5": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.9.5.tgz#27f0917741acc41e6eaaced6d68f96c3fa9afaf9" @@ -115,14 +123,14 @@ "@babel/helper-explode-assignable-expression" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/helper-compilation-targets@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.1.tgz#310e352888fbdbdd8577be8dfdd2afb9e7adcf50" - integrity sha512-jtBEif7jsPwP27GPHs06v4WBV0KrE8a/P7n0N0sSvHn2hwUCYnolP/CLmz51IzAW4NlN+HuoBtb9QcwnRo9F/g== +"@babel/helper-compilation-targets@^7.12.5": + version "7.12.5" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.5.tgz#cb470c76198db6a24e9dbc8987275631e5d29831" + integrity sha512-+qH6NrscMolUlzOYngSBMIOQpKUGPPsc61Bu5W10mg84LxZ7cmvnBHzARKbDoFxVvqqAbj6Tg6N7bSrWSPXMyw== dependencies: - "@babel/compat-data" "^7.12.1" + "@babel/compat-data" "^7.12.5" "@babel/helper-validator-option" "^7.12.1" - browserslist "^4.12.0" + browserslist "^4.14.5" semver "^5.5.0" "@babel/helper-create-class-features-plugin@^7.12.1": @@ -237,6 +245,13 @@ dependencies: "@babel/types" "^7.12.1" +"@babel/helper-module-imports@^7.12.5": + version "7.12.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz#1bfc0229f794988f76ed0a4d4e90860850b54dfb" + integrity sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA== + dependencies: + "@babel/types" "^7.12.5" + "@babel/helper-module-transforms@^7.12.1": version "7.12.1" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz#7954fec71f5b32c48e4b303b437c34453fd7247c" @@ -373,6 +388,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== +"@babel/helper-validator-identifier@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed" + integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== + "@babel/helper-validator-identifier@^7.9.0", "@babel/helper-validator-identifier@^7.9.5": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz#90977a8e6fbf6b431a7dc31752eee233bf052d80" @@ -383,6 +403,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.1.tgz#175567380c3e77d60ff98a54bb015fe78f2178d9" integrity sha512-YpJabsXlJVWP0USHjnC/AQDTLlZERbON577YUVO/wLpqyj6HAtVYnWaQaN0iUN+1/tWn3c+uKKXjRut5115Y2A== +"@babel/helper-validator-option@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.11.tgz#d66cb8b7a3e7fe4c6962b32020a131ecf0847f4f" + integrity sha512-TBFCyj939mFSdeX7U7DDj32WtzYY7fDcalgq8v3fBZMNOJQNn7nOYzMaUCiPxPYfCup69mtIpqlKgMZLvQ8Xhw== + "@babel/helper-wrap-function@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.10.4.tgz#8a6f701eab0ff39f765b5a1cfef409990e624b87" @@ -393,14 +418,14 @@ "@babel/traverse" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/helpers@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.12.1.tgz#8a8261c1d438ec18cb890434df4ec768734c1e79" - integrity sha512-9JoDSBGoWtmbay98efmT2+mySkwjzeFeAL9BuWNoVQpkPFQF8SIIFUfY5os9u8wVzglzoiPRSW7cuJmBDUt43g== +"@babel/helpers@^7.12.5": + version "7.12.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.12.5.tgz#1a1ba4a768d9b58310eda516c449913fe647116e" + integrity sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA== dependencies: "@babel/template" "^7.10.4" - "@babel/traverse" "^7.12.1" - "@babel/types" "^7.12.1" + "@babel/traverse" "^7.12.5" + "@babel/types" "^7.12.5" "@babel/helpers@^7.9.0": version "7.9.2" @@ -434,11 +459,16 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.4.tgz#6fa1a118b8b0d80d0267b719213dc947e88cc0ca" integrity sha512-MggwidiH+E9j5Sh8pbrX5sJvMcsqS5o+7iB42M9/k0CD63MjYbdP4nhSh7uB5wnv2/RVzTZFTxzF/kIa5mrCqA== -"@babel/parser@^7.12.1", "@babel/parser@^7.12.3": +"@babel/parser@^7.12.1": version "7.12.3" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.3.tgz#a305415ebe7a6c7023b40b5122a0662d928334cd" integrity sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw== +"@babel/parser@^7.12.10", "@babel/parser@^7.12.7": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.11.tgz#9ce3595bcd74bc5c466905e86c535b8b25011e79" + integrity sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg== + "@babel/parser@^7.7.0", "@babel/parser@^7.8.6", "@babel/parser@^7.9.0": version "7.9.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.9.4.tgz#68a35e6b0319bbc014465be43828300113f2f2e8" @@ -501,10 +531,10 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.0" -"@babel/plugin-proposal-numeric-separator@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.1.tgz#0e2c6774c4ce48be412119b4d693ac777f7685a6" - integrity sha512-MR7Ok+Af3OhNTCxYVjJZHS0t97ydnJZt/DbR4WISO39iDnhiD8XHrY12xuSJ90FFEGjir0Fzyyn7g/zY6hxbxA== +"@babel/plugin-proposal-numeric-separator@^7.12.7": + version "7.12.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.12.7.tgz#8bf253de8139099fea193b297d23a9d406ef056b" + integrity sha512-8c+uy0qmnRTeukiGsjLGy6uVs/TFjJchGXUeBqlG4VWYOdJWkhhVPdQ3uHwbmalfJwv2JsV0qffXP4asRfL2SQ== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-numeric-separator" "^7.10.4" @@ -526,10 +556,10 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/plugin-syntax-optional-catch-binding" "^7.8.0" -"@babel/plugin-proposal-optional-chaining@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.1.tgz#cce122203fc8a32794296fc377c6dedaf4363797" - integrity sha512-c2uRpY6WzaVDzynVY9liyykS+kVU+WRZPMPYpkelXH8KBt1oXoI89kPbZKKG/jDT5UK92FTW2fZkZaJhdiBabw== +"@babel/plugin-proposal-optional-chaining@^7.12.7": + version "7.12.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.7.tgz#e02f0ea1b5dc59d401ec16fb824679f683d3303c" + integrity sha512-4ovylXZ0PWmwoOvhU2vhnzVNnm88/Sm9nx7V8BPgMvAzn5zDou3/Awy0EjglyubVHasJj+XCEkr/r1X3P5elCA== dependencies: "@babel/helper-plugin-utils" "^7.10.4" "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" @@ -666,10 +696,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-block-scoping@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.1.tgz#f0ee727874b42a208a48a586b84c3d222c2bbef1" - integrity sha512-zJyAC9sZdE60r1nVQHblcfCj29Dh2Y0DOvlMkcqSo0ckqjiCwNiUezUKw+RjOCwGfpLRwnAeQ2XlLpsnGkvv9w== +"@babel/plugin-transform-block-scoping@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.12.11.tgz#83ae92a104dbb93a7d6c6dd1844f351083c46b4f" + integrity sha512-atR1Rxc3hM+VPg/NvNvfYw0npQEAcHuJ+MGZnFn6h3bo+1U3BWXMdFMlvVRApBTWKQMX7SOwRJZA5FBF/JQbvA== dependencies: "@babel/helper-plugin-utils" "^7.10.4" @@ -864,13 +894,12 @@ "@babel/helper-plugin-utils" "^7.10.4" "@babel/helper-skip-transparent-expression-wrappers" "^7.12.1" -"@babel/plugin-transform-sticky-regex@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.1.tgz#5c24cf50de396d30e99afc8d1c700e8bce0f5caf" - integrity sha512-CiUgKQ3AGVk7kveIaPEET1jNDhZZEl1RPMWdTBE1799bdz++SwqDHStmxfCtDfBhQgCl38YRiSnrMuUMZIWSUQ== +"@babel/plugin-transform-sticky-regex@^7.12.7": + version "7.12.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.12.7.tgz#560224613ab23987453948ed21d0b0b193fa7fad" + integrity sha512-VEiqZL5N/QvDbdjfYQBhruN0HYjSPjC4XkeqW4ny/jNtH9gcbgaqBIXYEZCNnESMAGs0/K/R7oFGMhOyu/eIxg== dependencies: "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-regex" "^7.10.4" "@babel/plugin-transform-template-literals@^7.12.1": version "7.12.1" @@ -879,10 +908,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-transform-typeof-symbol@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.1.tgz#9ca6be343d42512fbc2e68236a82ae64bc7af78a" - integrity sha512-EPGgpGy+O5Kg5pJFNDKuxt9RdmTgj5sgrus2XVeMp/ZIbOESadgILUbm50SNpghOh3/6yrbsH+NB5+WJTmsA7Q== +"@babel/plugin-transform-typeof-symbol@^7.12.10": + version "7.12.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.12.10.tgz#de01c4c8f96580bd00f183072b0d0ecdcf0dec4b" + integrity sha512-JQ6H8Rnsogh//ijxspCjc21YPd3VLVoYtAwv3zQmqAt8YGYUtdo5usNhdl4b9/Vir2kPFZl6n1h0PfUz4hJhaA== dependencies: "@babel/helper-plugin-utils" "^7.10.4" @@ -901,16 +930,16 @@ "@babel/helper-create-regexp-features-plugin" "^7.12.1" "@babel/helper-plugin-utils" "^7.10.4" -"@babel/preset-env@^7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.12.1.tgz#9c7e5ca82a19efc865384bb4989148d2ee5d7ac2" - integrity sha512-H8kxXmtPaAGT7TyBvSSkoSTUK6RHh61So05SyEbpmr0MCZrsNYn7mGMzzeYoOUCdHzww61k8XBft2TaES+xPLg== +"@babel/preset-env@^7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.12.11.tgz#55d5f7981487365c93dbbc84507b1c7215e857f9" + integrity sha512-j8Tb+KKIXKYlDBQyIOy4BLxzv1NUOwlHfZ74rvW+Z0Gp4/cI2IMDPBWAgWceGcE7aep9oL/0K9mlzlMGxA8yNw== dependencies: - "@babel/compat-data" "^7.12.1" - "@babel/helper-compilation-targets" "^7.12.1" - "@babel/helper-module-imports" "^7.12.1" + "@babel/compat-data" "^7.12.7" + "@babel/helper-compilation-targets" "^7.12.5" + "@babel/helper-module-imports" "^7.12.5" "@babel/helper-plugin-utils" "^7.10.4" - "@babel/helper-validator-option" "^7.12.1" + "@babel/helper-validator-option" "^7.12.11" "@babel/plugin-proposal-async-generator-functions" "^7.12.1" "@babel/plugin-proposal-class-properties" "^7.12.1" "@babel/plugin-proposal-dynamic-import" "^7.12.1" @@ -918,10 +947,10 @@ "@babel/plugin-proposal-json-strings" "^7.12.1" "@babel/plugin-proposal-logical-assignment-operators" "^7.12.1" "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" - "@babel/plugin-proposal-numeric-separator" "^7.12.1" + "@babel/plugin-proposal-numeric-separator" "^7.12.7" "@babel/plugin-proposal-object-rest-spread" "^7.12.1" "@babel/plugin-proposal-optional-catch-binding" "^7.12.1" - "@babel/plugin-proposal-optional-chaining" "^7.12.1" + "@babel/plugin-proposal-optional-chaining" "^7.12.7" "@babel/plugin-proposal-private-methods" "^7.12.1" "@babel/plugin-proposal-unicode-property-regex" "^7.12.1" "@babel/plugin-syntax-async-generators" "^7.8.0" @@ -939,7 +968,7 @@ "@babel/plugin-transform-arrow-functions" "^7.12.1" "@babel/plugin-transform-async-to-generator" "^7.12.1" "@babel/plugin-transform-block-scoped-functions" "^7.12.1" - "@babel/plugin-transform-block-scoping" "^7.12.1" + "@babel/plugin-transform-block-scoping" "^7.12.11" "@babel/plugin-transform-classes" "^7.12.1" "@babel/plugin-transform-computed-properties" "^7.12.1" "@babel/plugin-transform-destructuring" "^7.12.1" @@ -963,14 +992,14 @@ "@babel/plugin-transform-reserved-words" "^7.12.1" "@babel/plugin-transform-shorthand-properties" "^7.12.1" "@babel/plugin-transform-spread" "^7.12.1" - "@babel/plugin-transform-sticky-regex" "^7.12.1" + "@babel/plugin-transform-sticky-regex" "^7.12.7" "@babel/plugin-transform-template-literals" "^7.12.1" - "@babel/plugin-transform-typeof-symbol" "^7.12.1" + "@babel/plugin-transform-typeof-symbol" "^7.12.10" "@babel/plugin-transform-unicode-escapes" "^7.12.1" "@babel/plugin-transform-unicode-regex" "^7.12.1" "@babel/preset-modules" "^0.1.3" - "@babel/types" "^7.12.1" - core-js-compat "^3.6.2" + "@babel/types" "^7.12.11" + core-js-compat "^3.8.0" semver "^5.5.0" "@babel/preset-modules@^0.1.3": @@ -1015,6 +1044,15 @@ "@babel/parser" "^7.10.4" "@babel/types" "^7.10.4" +"@babel/template@^7.12.7": + version "7.12.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.12.7.tgz#c817233696018e39fbb6c491d2fb684e05ed43bc" + integrity sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/parser" "^7.12.7" + "@babel/types" "^7.12.7" + "@babel/template@^7.8.3", "@babel/template@^7.8.6": version "7.8.6" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b" @@ -1054,6 +1092,21 @@ globals "^11.1.0" lodash "^4.17.19" +"@babel/traverse@^7.12.10", "@babel/traverse@^7.12.5": + version "7.12.10" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.12.10.tgz#2d1f4041e8bf42ea099e5b2dc48d6a594c00017a" + integrity sha512-6aEtf0IeRgbYWzta29lePeYSk+YAFIC3kyqESeft8o5CkFlYIMX+EQDDWEiAQ9LHOA3d0oHdgrSsID/CKqXJlg== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/generator" "^7.12.10" + "@babel/helper-function-name" "^7.10.4" + "@babel/helper-split-export-declaration" "^7.11.0" + "@babel/parser" "^7.12.10" + "@babel/types" "^7.12.10" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.19" + "@babel/traverse@^7.7.0", "@babel/traverse@^7.8.6", "@babel/traverse@^7.9.0": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.9.5.tgz#6e7c56b44e2ac7011a948c21e283ddd9d9db97a2" @@ -1087,6 +1140,15 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" +"@babel/types@^7.12.10", "@babel/types@^7.12.11", "@babel/types@^7.12.5", "@babel/types@^7.12.7": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.12.11.tgz#a86e4d71e30a9b6ee102590446c98662589283ce" + integrity sha512-ukA9SQtKThINm++CX1CwmliMrE54J6nIYB5XTwL5f/CLFW9owfls+YSU8tVW15RQ2w+a3fSbPjC6HdQNtWZkiA== + dependencies: + "@babel/helper-validator-identifier" "^7.12.11" + lodash "^4.17.19" + to-fast-properties "^2.0.0" + "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.8.3", "@babel/types@^7.8.6", "@babel/types@^7.9.0", "@babel/types@^7.9.5": version "7.9.5" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.9.5.tgz#89231f82915a8a566a703b3b20133f73da6b9444" @@ -1096,6 +1158,22 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@eslint/eslintrc@^0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.2.2.tgz#d01fc791e2fc33e88a29d6f3dc7e93d0cd784b76" + integrity sha512-EfB5OHNYp1F4px/LI/FEnGylop7nOqkQ1LRzCM0KccA2U8tvV8w01KBv37LbO7nW4H+YhKyo2LcJhRwjjV17QQ== + dependencies: + ajv "^6.12.4" + debug "^4.1.1" + espree "^7.3.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.2.1" + js-yaml "^3.13.1" + lodash "^4.17.19" + minimatch "^3.0.4" + strip-json-comments "^3.1.1" + "@gulp-sourcemaps/identity-map@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz#a6e8b1abec8f790ec6be2b8c500e6e68037c0019" @@ -1182,6 +1260,14 @@ remark "^12.0.0" unist-util-find-all-after "^3.0.1" +"@stylelint/postcss-markdown@^0.36.2": + version "0.36.2" + resolved "https://registry.yarnpkg.com/@stylelint/postcss-markdown/-/postcss-markdown-0.36.2.tgz#0a540c4692f8dcdfc13c8e352c17e7bfee2bb391" + integrity sha512-2kGbqUVJUGE8dM+bMzXG/PYUWKkjLIkRLWNh39OaADkiabDRdw8ATFCgbMz5xdIcvwspPAluSL7uY+ZiTWdWmQ== + dependencies: + remark "^13.0.0" + unist-util-find-all-after "^3.0.2" + "@types/color-name@^1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" @@ -1348,6 +1434,11 @@ acorn-jsx@^5.2.0: resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe" integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ== +acorn-jsx@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" + integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + acorn@^6.4.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" @@ -1881,10 +1972,10 @@ aws-sdk@^2.389.0: uuid "3.3.2" xml2js "0.4.19" -aws-sdk@^2.773.0: - version "2.773.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.773.0.tgz#a8cc51eb0ee0a0fab00d2d9b61acccf4a54ad51b" - integrity sha512-bwqEm/x3HMUd/xfcUeTjCQFi904oSNcwl2ZNz3mwAdEIqt3sQ9aE3GYoZQxKXw/XHQlF7hPiKO07GDGmS6x4AQ== +aws-sdk@^2.814.0: + version "2.814.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.814.0.tgz#7a1c36006e0b5826f14bd2511b1d229ef6814bb0" + integrity sha512-empd1m/J/MAkL6d9OeRpmg9thobULu0wk4v8W3JToaxGi2TD7PIdvE6yliZKyOVAdJINhBWEBhxR4OUIHhcGbQ== dependencies: buffer "4.9.2" events "1.1.1" @@ -2234,7 +2325,7 @@ browserslist@^2.11.3: caniuse-lite "^1.0.30000792" electron-to-chromium "^1.3.30" -browserslist@^4.11.1, browserslist@^4.8.5: +browserslist@^4.11.1: version "4.12.0" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.12.0.tgz#06c6d5715a1ede6c51fc39ff67fd647f740b656d" integrity sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg== @@ -2254,6 +2345,17 @@ browserslist@^4.12.0: escalade "^3.0.2" node-releases "^1.1.60" +browserslist@^4.14.5, browserslist@^4.15.0: + version "4.16.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.0.tgz#410277627500be3cb28a1bfe037586fbedf9488b" + integrity sha512-/j6k8R0p3nxOC6kx5JGAxsnhc9ixaWJfYc+TNTzxg6+ARaESAvQGV7h0uNOB4t+pLQJZWzcrMxXOxjgsCj3dqQ== + dependencies: + caniuse-lite "^1.0.30001165" + colorette "^1.2.1" + electron-to-chromium "^1.3.621" + escalade "^3.1.1" + node-releases "^1.1.67" + browserslist@^4.14.7: version "4.14.7" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.14.7.tgz#c071c1b3622c1c2e790799a37bb09473a4351cb6" @@ -2470,6 +2572,11 @@ caniuse-lite@^1.0.30001157: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001157.tgz#2d11aaeb239b340bc1aa730eca18a37fdb07a9ab" integrity sha512-gOerH9Wz2IRZ2ZPdMfBvyOi3cjaz4O4dgNwPGzx8EhqAs4+2IL/O+fJsbt+znSigujoZG8bVcIAUM/I/E5K3MA== +caniuse-lite@^1.0.30001165: + version "1.0.30001170" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001170.tgz#0088bfecc6a14694969e391cc29d7eb6362ca6a7" + integrity sha512-Dd4d/+0tsK0UNLrZs3CvNukqalnVTRrxb5mcQm8rHL49t7V5ZaTygwXkrq+FB+dVDf++4ri8eJnFEJAB8332PA== + capture-stack-trace@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz#a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d" @@ -2995,12 +3102,12 @@ copy-props@^2.0.1: each-props "^1.3.0" is-plain-object "^2.0.1" -core-js-compat@^3.6.2: - version "3.6.5" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.6.5.tgz#2a51d9a4e25dfd6e690251aa81f99e3c05481f1c" - integrity sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng== +core-js-compat@^3.8.0: + version "3.8.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.8.1.tgz#8d1ddd341d660ba6194cbe0ce60f4c794c87a36e" + integrity sha512-a16TLmy9NVD1rkjUGbwuyWkiDoN0FDpAwrfLONvHFQx0D9k7J9y0srwMT8QP/Z6HE3MIFaVynEeYwZwPX1o5RQ== dependencies: - browserslist "^4.8.5" + browserslist "^4.15.0" semver "7.0.0" core-js-pure@^3.0.0: @@ -3008,10 +3115,10 @@ core-js-pure@^3.0.0: resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.5.tgz#c79e75f5e38dbc85a662d91eea52b8256d53b813" integrity sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA== -core-js@^3.7.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.7.0.tgz#b0a761a02488577afbf97179e4681bf49568520f" - integrity sha512-NwS7fI5M5B85EwpWuIwJN4i/fbisQUwLwiSNUWeXlkAZ0sbBjLEvLvFLf1uzAUV66PcEPt4xCGCmOZSxVf3xzA== +core-js@^3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.8.1.tgz#f51523668ac8a294d1285c3b9db44025fda66d47" + integrity sha512-9Id2xHY1W7m8hCl8NkhQn5CufmF/WuR30BTRewvCXc1aZd3kMECwNZ69ndLbekKfakw9Rf2Xyc+QR6E7Gg+obg== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -3258,6 +3365,13 @@ debug@=3.1.0, debug@~3.1.0: dependencies: ms "2.0.0" +debug@^4.2.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + dependencies: + ms "2.1.2" + decamelize-keys@^1.0.0, decamelize-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" @@ -3660,6 +3774,11 @@ electron-to-chromium@^1.3.591: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.595.tgz#e8a9e7c6919963419f892ea981d7b3438ccb834d" integrity sha512-JpaBIhdBkF9FLG7x06ONfe0f5bxPrxRcq0X+Sc8vsCt+OPWIzxOD+qM71NEHLGbDfN9Q6hbtHRv4/dnvcOxo6g== +electron-to-chromium@^1.3.621: + version "1.3.629" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.629.tgz#a08d13b64d90e3c77ec5b9bffa3efbc5b4a00969" + integrity sha512-iSPPJtPvHrMAvYOt+9cdbDmTasPqwnwz4lkP8Dn200gDNUBQOLQ96xUsWXBwXslAo5XxdoXAoQQ3RAy4uao9IQ== + "emoji-regex@>=6.0.0 <=6.1.1": version "6.1.1" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" @@ -4029,6 +4148,14 @@ eslint-scope@^5.1.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + eslint-utils@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" @@ -4053,6 +4180,11 @@ eslint-visitor-keys@^1.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== +eslint-visitor-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8" + integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ== + eslint@^6.8.0: version "6.8.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb" @@ -4138,6 +4270,49 @@ eslint@^7.3.1: text-table "^0.2.0" v8-compile-cache "^2.0.3" +eslint@^7.9.0: + version "7.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.16.0.tgz#a761605bf9a7b32d24bb7cde59aeb0fd76f06092" + integrity sha512-iVWPS785RuDA4dWuhhgXTNrGxHHK3a8HLSMBgbbU59ruJDubUraXN8N5rn7kb8tG6sjg74eE0RA3YWT51eusEw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@eslint/eslintrc" "^0.2.2" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.0.1" + doctrine "^3.0.0" + enquirer "^2.3.5" + eslint-scope "^5.1.1" + eslint-utils "^2.1.0" + eslint-visitor-keys "^2.0.0" + espree "^7.3.1" + esquery "^1.2.0" + esutils "^2.0.2" + file-entry-cache "^6.0.0" + functional-red-black-tree "^1.0.1" + glob-parent "^5.0.0" + globals "^12.1.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash "^4.17.19" + minimatch "^3.0.4" + natural-compare "^1.4.0" + optionator "^0.9.1" + progress "^2.0.0" + regexpp "^3.1.0" + semver "^7.2.1" + strip-ansi "^6.0.0" + strip-json-comments "^3.1.0" + table "^6.0.4" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + espree@^6.1.2, espree@^6.2.1: version "6.2.1" resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a" @@ -4156,6 +4331,15 @@ espree@^7.2.0: acorn-jsx "^5.2.0" eslint-visitor-keys "^1.3.0" +espree@^7.3.0, espree@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" + integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== + dependencies: + acorn "^7.4.0" + acorn-jsx "^5.3.1" + eslint-visitor-keys "^1.3.0" + esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" @@ -4175,6 +4359,13 @@ esrecurse@^4.1.0: dependencies: estraverse "^4.1.0" +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + estraverse@^4.1.0, estraverse@^4.1.1: version "4.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" @@ -4185,6 +4376,11 @@ estraverse@^5.1.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.1.0.tgz#374309d39fd935ae500e7b92e8a6b4c720e59642" integrity sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw== +estraverse@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + estree-walker@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" @@ -4521,6 +4717,13 @@ file-entry-cache@^5.0.1: dependencies: flat-cache "^2.0.1" +file-entry-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.0.tgz#7921a89c391c6d93efec2169ac6bf300c527ea0a" + integrity sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA== + dependencies: + flat-cache "^3.0.4" + file-type@5.2.0, file-type@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-5.2.0.tgz#2ddbea7c73ffe36368dfae49dc338c058c2b8ad6" @@ -4713,11 +4916,24 @@ flat-cache@^2.0.1: rimraf "2.6.3" write "1.0.3" +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + flatted@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== +flatted@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.0.tgz#a5d06b4a8b01e3a63771daa5cb7a1903e2e57067" + integrity sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA== + flush-write-stream@^1.0.2: version "1.1.1" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" @@ -5495,14 +5711,13 @@ gulp-svgstore@^7.0.1: plugin-error "^0.1.2" vinyl "^2.1.0" -gulp-terser@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/gulp-terser/-/gulp-terser-1.4.1.tgz#06b30023889b149bdbbdd49fada31b233fe737df" - integrity sha512-VUoKrk24G0ojr7fXqlZ7vA8qDFHRloYAM6doNRyKdJ/LFkj+X3P04f+7LlOp7j05WtdOCEg65oG6nGjSf//78A== +gulp-terser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/gulp-terser/-/gulp-terser-2.0.0.tgz#07f95ef9121fe9d4970c3c4ee775c9cd658d0474" + integrity sha512-8KxzgUpNeLsSujUCrNKUiSI1ioO5TfW4ODhbM+wzNTWgYp7yCIl1c/5EeOI+SOXaNLi+BzzMqrbb0eYMIThFCQ== dependencies: - is-promise "^4.0.0" plugin-error "^1.0.1" - terser ">=4" + terser "5.4.0" through2 "^4.0.2" vinyl-sourcemaps-apply "^0.2.1" @@ -5662,6 +5877,13 @@ hosted-git-info@^3.0.0: dependencies: lru-cache "^5.1.1" +hosted-git-info@^3.0.6: + version "3.0.7" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-3.0.7.tgz#a30727385ea85acfcee94e0aad9e368c792e036c" + integrity sha512-fWqc0IcuXs+BmE9orLDyVykAG9GJtGLGuZAAqgcckPgv5xad4AcXGIv8galtQvlwutxSlaMcdw7BUtq2EIvqCQ== + dependencies: + lru-cache "^6.0.0" + html-comment-regex@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7" @@ -6347,11 +6569,6 @@ is-promise@^2.1: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== -is-promise@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-4.0.0.tgz#42ff9f84206c1991d26debf520dd5c01042dd2f3" - integrity sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ== - is-redirect@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" @@ -6683,10 +6900,10 @@ known-css-properties@^0.18.0: resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.18.0.tgz#d6e00b56ee1d5b0d171fd86df1583cfb012c521f" integrity sha512-69AgJ1rQa7VvUsd2kpvVq+VeObDuo3zrj0CzM5Slmf6yduQFAI2kXPDQJR2IE/u6MSAUOJrwSzjg5vlz8qcMiw== -known-css-properties@^0.19.0: - version "0.19.0" - resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.19.0.tgz#5d92b7fa16c72d971bda9b7fe295bdf61836ee5b" - integrity sha512-eYboRV94Vco725nKMlpkn3nV2+96p9c3gKXRsYqAJSswSENvBhN7n5L+uDhY58xQa0UukWsDMTGELzmD8Q+wTA== +known-css-properties@^0.20.0: + version "0.20.0" + resolved "https://registry.yarnpkg.com/known-css-properties/-/known-css-properties-0.20.0.tgz#0570831661b47dd835293218381166090ff60e96" + integrity sha512-URvsjaA9ypfreqJ2/ylDr5MUERhJZ+DhguoWRr2xgS5C7aGCalXo+ewL+GixgKBfhT2vuL02nbIgNGqVWgTOYw== known-css-properties@^0.5.0: version "0.5.0" @@ -7102,6 +7319,13 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + lru-queue@0.1: version "0.1.0" resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" @@ -7324,22 +7548,22 @@ meow@^6.1.0: type-fest "^0.8.1" yargs-parser "^18.1.1" -meow@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/meow/-/meow-7.1.1.tgz#7c01595e3d337fcb0ec4e8eed1666ea95903d306" - integrity sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA== +meow@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-8.0.0.tgz#1aa10ee61046719e334ffdc038bb5069250ec99a" + integrity sha512-nbsTRz2fwniJBFgUkcdISq8y/q9n9VbiHYbfwklFh5V4V2uAcxtKQkDc0yCLPM/kP0d+inZBewn3zJqewHE7kg== dependencies: "@types/minimist" "^1.2.0" camelcase-keys "^6.2.2" decamelize-keys "^1.1.0" hard-rejection "^2.1.0" minimist-options "4.1.0" - normalize-package-data "^2.5.0" + normalize-package-data "^3.0.0" read-pkg-up "^7.0.1" redent "^3.0.0" trim-newlines "^3.0.0" - type-fest "^0.13.1" - yargs-parser "^18.1.3" + type-fest "^0.18.0" + yargs-parser "^20.2.3" merge-stream@^2.0.0: version "2.0.0" @@ -7508,7 +7732,7 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@^2.1.1: +ms@2.1.2, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== @@ -7626,6 +7850,11 @@ node-releases@^1.1.66: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.66.tgz#609bd0dc069381015cd982300bae51ab4f1b1814" integrity sha512-JHEQ1iWPGK+38VLB2H9ef2otU4l8s3yAMt9Xf934r6+ojCYDMHPMqvCc9TnzfeFSP1QEOeU6YZEd3+De0LTCgg== +node-releases@^1.1.67: + version "1.1.67" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.67.tgz#28ebfcccd0baa6aad8e8d4d8fe4cbc49ae239c12" + integrity sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg== + node-sass@^4.8.3: version "4.14.0" resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.14.0.tgz#a8e9d7720f8e15b4a1072719dcf04006f5648eeb" @@ -7666,6 +7895,16 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package- semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" +normalize-package-data@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.0.tgz#1f8a7c423b3d2e85eb36985eaf81de381d01301a" + integrity sha512-6lUjEI0d3v6kFrtgA/lOx4zHCWULXsFNIjHolnZCKCTLA6m/G625cdn3O7eNmT0iD3jfo6HZ9cdImGZwf21prw== + dependencies: + hosted-git-info "^3.0.6" + resolve "^1.17.0" + semver "^7.3.2" + validate-npm-package-license "^3.0.1" + normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -8612,6 +8851,16 @@ postcss-selector-parser@^6.0.2: indexes-of "^1.0.1" uniq "^1.0.1" +postcss-selector-parser@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.4.tgz#56075a1380a04604c38b063ea7767a129af5c2b3" + integrity sha512-gjMeXBempyInaBqpp8gODmwZ52WaYsVOsfr4L4lDQ7n3ncD6mEyySiDtgzCT+NYC0mmeOLvtsF8iaEf0YT6dBw== + dependencies: + cssesc "^3.0.0" + indexes-of "^1.0.1" + uniq "^1.0.1" + util-deprecate "^1.0.2" + postcss-sorting@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/postcss-sorting/-/postcss-sorting-5.0.1.tgz#10d5d0059eea8334dacc820c0121864035bc3f11" @@ -8677,7 +8926,7 @@ postcss@^6.0.14, postcss@^6.0.17, postcss@^6.0.23, postcss@^6.0.6, postcss@^6.0. source-map "^0.6.1" supports-color "^5.4.0" -postcss@^7.0.16: +postcss@^7.0.16, postcss@^7.0.35: version "7.0.35" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.35.tgz#d2be00b998f7f211d8a276974079f2e92b970e24" integrity sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg== @@ -8748,6 +8997,24 @@ prettier-eslint@^11.0.0: typescript "^3.9.3" vue-eslint-parser "~7.1.0" +prettier-eslint@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/prettier-eslint/-/prettier-eslint-12.0.0.tgz#b4dab5111aad1c0dca062eb7f92a69d5fb1ac1d3" + integrity sha512-N8SGGQwAosISXTNl1E57sBbtnqUGlyRWjcfIUxyD3HF4ynehA9GZ8IfJgiep/OfYvCof/JEpy9ZqSl250Wia7A== + dependencies: + "@typescript-eslint/parser" "^3.0.0" + common-tags "^1.4.0" + dlv "^1.1.0" + eslint "^7.9.0" + indent-string "^4.0.0" + lodash.merge "^4.6.0" + loglevel-colored-level-prefix "^1.0.0" + prettier "^2.0.0" + pretty-format "^23.0.1" + require-relative "^0.8.7" + typescript "^3.9.3" + vue-eslint-parser "~7.1.0" + prettier-linter-helpers@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" @@ -9630,10 +9897,10 @@ rollup-pluginutils@^2.8.1: dependencies: estree-walker "^0.6.1" -rollup@^2.33.1: - version "2.33.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.33.1.tgz#802795164164ee63cd47769d8879c33ec8ae0c40" - integrity sha512-uY4O/IoL9oNW8MMcbA5hcOaz6tZTMIh7qJHx/tzIJm+n1wLoY38BLn6fuy7DhR57oNFLMbDQtDeJoFURt5933w== +rollup@^2.35.1: + version "2.35.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.35.1.tgz#e6bc8d10893556a638066f89e8c97f422d03968c" + integrity sha512-q5KxEyWpprAIcainhVy6HfRttD9kutQpHbeqDTWnqAFNJotiojetK6uqmcydNMymBEtC4I8bCYR+J3mTMqeaUA== optionalDependencies: fsevents "~2.1.2" @@ -10063,7 +10330,7 @@ source-map-resolve@^0.6.0: atob "^2.1.2" decode-uri-component "^0.2.0" -source-map-support@~0.5.12: +source-map-support@~0.5.19: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== @@ -10088,11 +10355,16 @@ source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.6: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +source-map@~0.7.2: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + sourcemap-codec@^1.4.4: version "1.4.8" resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" @@ -10452,7 +10724,7 @@ strip-json-comments@^3.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.0.tgz#7638d31422129ecf4457440009fba03f9f9ac180" integrity sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w== -strip-json-comments@^3.1.0: +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -10585,22 +10857,22 @@ stylelint@>=3.0.2: v8-compile-cache "^2.1.0" write-file-atomic "^3.0.3" -stylelint@^13.7.2: - version "13.7.2" - resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.7.2.tgz#6f3c58eea4077680ed0ceb0d064b22b100970486" - integrity sha512-mmieorkfmO+ZA6CNDu1ic9qpt4tFvH2QUB7vqXgrMVHe5ENU69q7YDq0YUg/UHLuCsZOWhUAvcMcLzLDIERzSg== +stylelint@^13.8.0: + version "13.8.0" + resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-13.8.0.tgz#446765dbe25e3617f819a0165956faf2563ddc23" + integrity sha512-iHH3dv3UI23SLDrH4zMQDjLT9/dDIz/IpoFeuNxZmEx86KtfpjDOscxLTFioQyv+2vQjPlRZnK0UoJtfxLICXQ== dependencies: "@stylelint/postcss-css-in-js" "^0.37.2" - "@stylelint/postcss-markdown" "^0.36.1" + "@stylelint/postcss-markdown" "^0.36.2" autoprefixer "^9.8.6" balanced-match "^1.0.0" chalk "^4.1.0" cosmiconfig "^7.0.0" - debug "^4.1.1" + debug "^4.2.0" execall "^2.0.0" fast-glob "^3.2.4" fastest-levenshtein "^1.0.12" - file-entry-cache "^5.0.1" + file-entry-cache "^6.0.0" get-stdin "^8.0.0" global-modules "^2.0.0" globby "^11.0.1" @@ -10609,14 +10881,14 @@ stylelint@^13.7.2: ignore "^5.1.8" import-lazy "^4.0.0" imurmurhash "^0.1.4" - known-css-properties "^0.19.0" + known-css-properties "^0.20.0" lodash "^4.17.20" log-symbols "^4.0.0" mathml-tag-names "^2.1.3" - meow "^7.1.1" + meow "^8.0.0" micromatch "^4.0.2" normalize-selector "^0.2.0" - postcss "^7.0.32" + postcss "^7.0.35" postcss-html "^0.36.0" postcss-less "^3.1.4" postcss-media-query-parser "^0.2.3" @@ -10624,7 +10896,7 @@ stylelint@^13.7.2: postcss-safe-parser "^4.0.2" postcss-sass "^0.4.4" postcss-scss "^2.1.1" - postcss-selector-parser "^6.0.2" + postcss-selector-parser "^6.0.4" postcss-syntax "^0.36.2" postcss-value-parser "^4.1.0" resolve-from "^5.0.0" @@ -10635,8 +10907,8 @@ stylelint@^13.7.2: style-search "^0.1.0" sugarss "^2.0.0" svg-tags "^1.0.0" - table "^6.0.1" - v8-compile-cache "^2.1.1" + table "^6.0.3" + v8-compile-cache "^2.2.0" write-file-atomic "^3.0.3" stylelint@^8.1.1: @@ -10790,10 +11062,10 @@ table@^5.2.3, table@^5.4.6: slice-ansi "^2.1.0" string-width "^3.0.0" -table@^6.0.1: - version "6.0.3" - resolved "https://registry.yarnpkg.com/table/-/table-6.0.3.tgz#e5b8a834e37e27ad06de2e0fda42b55cfd8a0123" - integrity sha512-8321ZMcf1B9HvVX/btKv8mMZahCjn2aYrDlpqHaBFCfnox64edeH9kEid0vTLTRR8gWR2A20aDgeuTTea4sVtw== +table@^6.0.3, table@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/table/-/table-6.0.4.tgz#c523dd182177e926c723eb20e1b341238188aa0d" + integrity sha512-sBT4xRLdALd+NFBvwOz8bw4b15htyythha+q+DVZqy2RS08PPC8O2sZFgJYEY7bJvbCFKccs+WIZ/cd+xxTWCw== dependencies: ajv "^6.12.4" lodash "^4.17.20" @@ -10872,14 +11144,14 @@ ternary-stream@^3.0.0: merge-stream "^2.0.0" through2 "^3.0.1" -terser@>=4: - version "5.2.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.2.1.tgz#40b971b8d28b4fe98c9e8c0d073ab48e7bb96cd8" - integrity sha512-/AOtjRtAMNGO0fIF6m8HfcvXTw/2AKpsOzDn36tA5RfhRdeXyb4RvHxJ5Pah7iL6dFkLk+gOnCaNHGwJPl6TrQ== +terser@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.4.0.tgz#9815c0839072d5c894e22c6fc508fbe9f5e7d7e8" + integrity sha512-3dZunFLbCJis9TAF2VnX+VrQLctRUmt1p3W2kCsJuZE4ZgWqh//+1MZ62EanewrqKoUf4zIaDGZAvml4UDc0OQ== dependencies: commander "^2.20.0" - source-map "~0.6.1" - source-map-support "~0.5.12" + source-map "~0.7.2" + source-map-support "~0.5.19" text-table@^0.2.0: version "0.2.0" @@ -11151,10 +11423,10 @@ type-fest@^0.11.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1" integrity sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ== -type-fest@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934" - integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg== +type-fest@^0.18.0: + version "0.18.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" + integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== type-fest@^0.6.0: version "0.6.0" @@ -11391,6 +11663,13 @@ unist-util-find-all-after@^3.0.1: dependencies: unist-util-is "^4.0.0" +unist-util-find-all-after@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/unist-util-find-all-after/-/unist-util-find-all-after-3.0.2.tgz#fdfecd14c5b7aea5e9ef38d5e0d5f774eeb561f6" + integrity sha512-xaTC/AGZ0rIM2gM28YVRAFPIZpzbpDtU3dRmp7EXlNVA8ziQc4hY3H7BHXM1J49nEmiqc3svnqMReW+PGqbZKQ== + dependencies: + unist-util-is "^4.0.0" + unist-util-inspect@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/unist-util-inspect/-/unist-util-inspect-5.0.1.tgz#168c8770a99902318ca268f8c391e294bcf44540" @@ -11575,7 +11854,7 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== -util-deprecate@^1.0.1, util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= @@ -11610,10 +11889,10 @@ v8-compile-cache@^2.0.3, v8-compile-cache@^2.1.0: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== -v8-compile-cache@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz#54bc3cdd43317bca91e35dcaf305b1a7237de745" - integrity sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ== +v8-compile-cache@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" + integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== v8flags@^3.0.1: version "3.1.3" @@ -11955,6 +12234,11 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yaml@^1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.0.tgz#3b593add944876077d4d683fee01081bd9fff31e" @@ -11975,7 +12259,7 @@ yargs-parser@^13.1.1: camelcase "^5.0.0" decamelize "^1.2.0" -yargs-parser@^18.1.1, yargs-parser@^18.1.2, yargs-parser@^18.1.3: +yargs-parser@^18.1.1, yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== @@ -11983,6 +12267,11 @@ yargs-parser@^18.1.1, yargs-parser@^18.1.2, yargs-parser@^18.1.3: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^20.2.3: + version "20.2.4" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + yargs-parser@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" From d7195d5276becbf21bbad8781d91b955aef39eb1 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sun, 20 Dec 2020 20:10:52 +1100 Subject: [PATCH 03/13] chore: add @babel/plugin-proposal-class-properties --- tasks/build.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/build.js b/tasks/build.js index 271545d9..2bc2a698 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -118,6 +118,7 @@ Object.entries(build.js).forEach(([filename, entry]) => { }, ], ], + plugins: ['@babel/plugin-proposal-class-properties'], babelrc: false, exclude: [/\/core-js\//], }), From ba09bc32d3bcd8002abe1ae4f629fc11ff55a7fc Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sun, 20 Dec 2020 20:11:41 +1100 Subject: [PATCH 04/13] fix: use bound arrow functions in classes --- src/js/fullscreen.js | 30 ++++----- src/js/listeners.js | 32 +++++----- src/js/plugins/ads.js | 76 +++++++++++------------ src/js/plugins/preview-thumbnails.js | 92 ++++++++++++++-------------- src/js/plyr.js | 64 ++++++++++--------- src/js/storage.js | 8 +-- 6 files changed, 151 insertions(+), 151 deletions(-) diff --git a/src/js/fullscreen.js b/src/js/fullscreen.js index 7bb22391..76acbd06 100644 --- a/src/js/fullscreen.js +++ b/src/js/fullscreen.js @@ -57,6 +57,8 @@ class Fullscreen { // Update the UI this.update(); + + // this.toggle = this.toggle.bind(this); } // Determine if native supported @@ -134,7 +136,7 @@ class Fullscreen { : this.player.elements.fullscreen || this.player.elements.container; } - onChange() { + onChange = () => { if (!this.enabled) { return; } @@ -149,9 +151,9 @@ class Fullscreen { const target = this.target === this.player.media ? this.target : this.player.elements.container; // Trigger an event triggerEvent.call(this.player, target, this.active ? 'enterfullscreen' : 'exitfullscreen', true); - } + }; - toggleFallback(toggle = false) { + toggleFallback = (toggle = false) => { // Store or restore scroll position if (toggle) { this.scrollPosition = { @@ -198,10 +200,10 @@ class Fullscreen { // Toggle button and fire events this.onChange(); - } + }; // Trap focus inside container - trapFocus(event) { + trapFocus = (event) => { // Bail if iOS, not active, not the tab key if (browser.isIos || !this.active || event.key !== 'Tab' || event.keyCode !== 9) { return; @@ -222,10 +224,10 @@ class Fullscreen { last.focus(); event.preventDefault(); } - } + }; // Update UI - update() { + update = () => { if (this.enabled) { let mode; @@ -244,10 +246,10 @@ class Fullscreen { // Add styling hook to show button toggleClass(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.enabled); - } + }; // Make an element fullscreen - enter() { + enter = () => { if (!this.enabled) { return; } @@ -262,10 +264,10 @@ class Fullscreen { } else if (!is.empty(this.prefix)) { this.target[`${this.prefix}Request${this.property}`](); } - } + }; // Bail from fullscreen - exit() { + exit = () => { if (!this.enabled) { return; } @@ -282,16 +284,16 @@ class Fullscreen { const action = this.prefix === 'moz' ? 'Cancel' : 'Exit'; document[`${this.prefix}${action}${this.property}`](); } - } + }; // Toggle state - toggle() { + toggle = () => { if (!this.active) { this.enter(); } else { this.exit(); } - } + }; } export default Fullscreen; diff --git a/src/js/listeners.js b/src/js/listeners.js index 48734bcf..3d1f8ef0 100644 --- a/src/js/listeners.js +++ b/src/js/listeners.js @@ -183,7 +183,7 @@ class Listeners { } // Device is touch enabled - firstTouch() { + firstTouch = () => { const { player } = this; const { elements } = player; @@ -191,9 +191,9 @@ class Listeners { // Add touch class toggleClass(elements.container, player.config.classNames.isTouch, true); - } + }; - setTabFocus(event) { + setTabFocus = (event) => { const { player } = this; const { elements } = player; @@ -241,10 +241,10 @@ class Listeners { toggleClass(document.activeElement, player.config.classNames.tabFocus, true); }, 10); } - } + }; // Global window & document listeners - global(toggle = true) { + global = (toggle = true) => { const { player } = this; // Keyboard shortcuts @@ -260,10 +260,10 @@ class Listeners { // Tab focus detection toggleListener.call(player, document.body, 'keydown focus blur focusout', this.setTabFocus, toggle, false, true); - } + }; // Container listeners - container() { + container = () => { const { player } = this; const { config, elements, timers } = player; @@ -370,10 +370,10 @@ class Listeners { } } }); - } + }; // Listen for media events - media() { + media = () => { const { player } = this; const { elements } = player; @@ -514,10 +514,10 @@ class Listeners { triggerEvent.call(player, elements.container, event.type, true, detail); }); - } + }; // Run default and custom handlers - proxy(event, defaultHandler, customHandlerKey) { + proxy = (event, defaultHandler, customHandlerKey) => { const { player } = this; const customHandler = player.config.listeners[customHandlerKey]; const hasCustomHandler = is.function(customHandler); @@ -532,10 +532,10 @@ class Listeners { if (returned !== false && is.function(defaultHandler)) { defaultHandler.call(player, event); } - } + }; // Trigger custom and default handlers - bind(element, type, defaultHandler, customHandlerKey, passive = true) { + bind = (element, type, defaultHandler, customHandlerKey, passive = true) => { const { player } = this; const customHandler = player.config.listeners[customHandlerKey]; const hasCustomHandler = is.function(customHandler); @@ -547,10 +547,10 @@ class Listeners { (event) => this.proxy(event, defaultHandler, customHandlerKey), passive && !hasCustomHandler, ); - } + }; // Listen for control events - controls() { + controls = () => { const { player } = this; const { elements } = player; // IE doesn't support input event, so we fallback to change @@ -905,7 +905,7 @@ class Listeners { 'volume', false, ); - } + }; } export default Listeners; diff --git a/src/js/plugins/ads.js b/src/js/plugins/ads.js index 12b5cc31..5d9406d1 100644 --- a/src/js/plugins/ads.js +++ b/src/js/plugins/ads.js @@ -77,7 +77,7 @@ class Ads { /** * Load the IMA SDK */ - load() { + load = () => { if (!this.enabled) { return; } @@ -95,12 +95,12 @@ class Ads { } else { this.ready(); } - } + }; /** * Get the ads instance ready */ - ready() { + ready = () => { // Double check we're enabled if (!this.enabled) { destroy(this); @@ -120,7 +120,7 @@ class Ads { // Setup the IMA SDK this.setupIMA(); - } + }; // Build the tag URL get tagUrl() { @@ -153,7 +153,7 @@ class Ads { * properly place mid-rolls. After we create the ad display container, we initialize it. On * mobile devices, this initialization is done as the result of a user action. */ - setupIMA() { + setupIMA = () => { // Create the container for our advertisements this.elements.container = createElement('div', { class: this.player.config.classNames.ads, @@ -186,12 +186,12 @@ class Ads { // Request video ads to be pre-loaded this.requestAds(); - } + }; /** * Request advertisements */ - requestAds() { + requestAds = () => { const { container } = this.player.elements; try { @@ -216,13 +216,13 @@ class Ads { } catch (e) { this.onAdError(e); } - } + }; /** * Update the ad countdown * @param {Boolean} start */ - pollCountdown(start = false) { + pollCountdown = (start = false) => { if (!start) { clearInterval(this.countdownTimer); this.elements.container.removeAttribute('data-badge-text'); @@ -236,13 +236,13 @@ class Ads { }; this.countdownTimer = setInterval(update, 100); - } + }; /** * This method is called whenever the ads are ready inside the AdDisplayContainer * @param {Event} adsManagerLoadedEvent */ - onAdsManagerLoaded(event) { + onAdsManagerLoaded = (event) => { // Load could occur after a source change (race condition) if (!this.enabled) { return; @@ -273,9 +273,9 @@ class Ads { // Resolve our adsManager this.trigger('loaded'); - } + }; - addCuePoints() { + addCuePoints = () => { // Add advertisement cue's within the time line if available if (!is.empty(this.cuePoints)) { this.cuePoints.forEach((cuePoint) => { @@ -294,7 +294,7 @@ class Ads { } }); } - } + }; /** * This is where all the event handling takes place. Retrieve the ad from the event. Some @@ -302,7 +302,7 @@ class Ads { * https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdEvent.Type * @param {Event} event */ - onAdEvent(event) { + onAdEvent = (event) => { const { container } = this.player.elements; // Retrieve the ad from the event. Some events (e.g. ALL_ADS_COMPLETED) // don't have ad object associated @@ -410,23 +410,23 @@ class Ads { default: break; } - } + }; /** * Any ad error handling comes through here * @param {Event} event */ - onAdError(event) { + onAdError = (event) => { this.cancel(); this.player.debug.warn('Ads error', event); - } + }; /** * Setup hooks for Plyr and window events. This ensures * the mid- and post-roll launch at the correct time. And * resize the advertisement when the player resizes */ - listeners() { + listeners = () => { const { container } = this.player.elements; let time; @@ -464,12 +464,12 @@ class Ads { this.manager.resize(container.offsetWidth, container.offsetHeight, google.ima.ViewMode.NORMAL); } }); - } + }; /** * Initialize the adsManager and start playing advertisements */ - play() { + play = () => { const { container } = this.player.elements; if (!this.managerPromise) { @@ -503,12 +503,12 @@ class Ads { } }) .catch(() => {}); - } + }; /** * Resume our video */ - resumeContent() { + resumeContent = () => { // Hide the advertisement container this.elements.container.style.zIndex = ''; @@ -517,12 +517,12 @@ class Ads { // Play video silencePromise(this.player.media.play()); - } + }; /** * Pause our video */ - pauseContent() { + pauseContent = () => { // Show the advertisement container this.elements.container.style.zIndex = 3; @@ -531,7 +531,7 @@ class Ads { // Pause our video. this.player.media.pause(); - } + }; /** * Destroy the adsManager so we can grab new ads after this. If we don't then we're not @@ -539,7 +539,7 @@ class Ads { * video requests. https://developers.google.com/interactive- * media-ads/docs/sdks/android/faq#8 */ - cancel() { + cancel = () => { // Pause our video if (this.initialized) { this.resumeContent(); @@ -550,12 +550,12 @@ class Ads { // Re-create our adsManager this.loadAds(); - } + }; /** * Re-create our adsManager */ - loadAds() { + loadAds = () => { // Tell our adsManager to go bye bye this.managerPromise .then(() => { @@ -576,13 +576,13 @@ class Ads { this.requestAds(); }) .catch(() => {}); - } + }; /** * Handles callbacks after an ad event was invoked * @param {String} event - Event type */ - trigger(event, ...args) { + trigger = (event, ...args) => { const handlers = this.events[event]; if (is.array(handlers)) { @@ -592,7 +592,7 @@ class Ads { } }); } - } + }; /** * Add event listeners @@ -600,7 +600,7 @@ class Ads { * @param {Function} callback - Callback for when event occurs * @return {Ads} */ - on(event, callback) { + on = (event, callback) => { if (!is.array(this.events[event])) { this.events[event] = []; } @@ -608,7 +608,7 @@ class Ads { this.events[event].push(callback); return this; - } + }; /** * Setup a safety timer for when the ad network doesn't respond for whatever reason. @@ -618,27 +618,27 @@ class Ads { * @param {Number} time * @param {String} from */ - startSafetyTimer(time, from) { + startSafetyTimer = (time, from) => { this.player.debug.log(`Safety timer invoked from: ${from}`); this.safetyTimer = setTimeout(() => { this.cancel(); this.clearSafetyTimer('startSafetyTimer()'); }, time); - } + }; /** * Clear our safety timer(s) * @param {String} from */ - clearSafetyTimer(from) { + clearSafetyTimer = (from) => { if (!is.nullOrUndefined(this.safetyTimer)) { this.player.debug.log(`Safety timer cleared from: ${from}`); clearTimeout(this.safetyTimer); this.safetyTimer = null; } - } + }; } export default Ads; diff --git a/src/js/plugins/preview-thumbnails.js b/src/js/plugins/preview-thumbnails.js index 16167247..80e8cd4a 100644 --- a/src/js/plugins/preview-thumbnails.js +++ b/src/js/plugins/preview-thumbnails.js @@ -103,7 +103,7 @@ class PreviewThumbnails { return this.player.isHTML5 && this.player.isVideo && this.player.config.previewThumbnails.enabled; } - load() { + load = () => { // Toggle the regular seek tooltip if (this.player.elements.display.seekTooltip) { this.player.elements.display.seekTooltip.hidden = this.enabled; @@ -126,10 +126,10 @@ class PreviewThumbnails { this.loaded = true; }); - } + }; // Download VTT files and parse them - getThumbnails() { + getThumbnails = () => { return new Promise((resolve) => { const { src } = this.player.config.previewThumbnails; @@ -164,10 +164,10 @@ class PreviewThumbnails { Promise.all(promises).then(sortAndResolve); } }); - } + }; // Process individual VTT file - getThumbnail(url) { + getThumbnail = (url) => { return new Promise((resolve) => { fetch(url).then((response) => { const thumbnail = { @@ -202,9 +202,9 @@ class PreviewThumbnails { tempImage.src = thumbnail.urlPrefix + thumbnail.frames[0].text; }); }); - } + }; - startMove(event) { + startMove = (event) => { if (!this.loaded) { return; } @@ -245,13 +245,13 @@ class PreviewThumbnails { // Download and show image this.showImageAtCurrentTime(); - } + }; - endMove() { + endMove = () => { this.toggleThumbContainer(false, true); - } + }; - startScrubbing(event) { + startScrubbing = (event) => { // Only act on left mouse button (0), or touch device (event.button does not exist or is false) if (is.nullOrUndefined(event.button) || event.button === false || event.button === 0) { this.mouseDown = true; @@ -265,9 +265,9 @@ class PreviewThumbnails { this.showImageAtCurrentTime(); } } - } + }; - endScrubbing() { + endScrubbing = () => { this.mouseDown = false; // Hide scrubbing preview. But wait until the video has successfully seeked before hiding the scrubbing preview @@ -283,12 +283,12 @@ class PreviewThumbnails { } }); } - } + }; /** * Setup hooks for Plyr and window events */ - listeners() { + listeners = () => { // Hide thumbnail preview - on mouse click, mouse leave (in listeners.js for now), and video play/seek. All four are required, e.g., for buffering this.player.on('play', () => { this.toggleThumbContainer(false, true); @@ -301,12 +301,12 @@ class PreviewThumbnails { this.player.on('timeupdate', () => { this.lastTime = this.player.media.currentTime; }); - } + }; /** * Create HTML elements for image containers */ - render() { + render = () => { // Create HTML element: plyr__preview-thumbnail-container this.elements.thumb.container = createElement('div', { class: this.player.config.classNames.previewThumbnails.thumbContainer, @@ -339,18 +339,18 @@ class PreviewThumbnails { }); this.player.elements.wrapper.appendChild(this.elements.scrubbing.container); - } + }; - destroy() { + destroy = () => { if (this.elements.thumb.container) { this.elements.thumb.container.remove(); } if (this.elements.scrubbing.container) { this.elements.scrubbing.container.remove(); } - } + }; - showImageAtCurrentTime() { + showImageAtCurrentTime = () => { if (this.mouseDown) { this.setScrubbingContainerSize(); } else { @@ -387,10 +387,10 @@ class PreviewThumbnails { this.showingThumb = thumbNum; this.loadImage(qualityIndex); } - } + }; // Show the image that's currently specified in this.showingThumb - loadImage(qualityIndex = 0) { + loadImage = (qualityIndex = 0) => { const thumbNum = this.showingThumb; const thumbnail = this.thumbnails[qualityIndex]; const { urlPrefix } = thumbnail; @@ -426,9 +426,9 @@ class PreviewThumbnails { this.currentImageElement.dataset.index = thumbNum; this.removeOldImages(this.currentImageElement); } - } + }; - showImage(previewImage, frame, qualityIndex, thumbNum, thumbFilename, newImage = true) { + showImage = (previewImage, frame, qualityIndex, thumbNum, thumbFilename, newImage = true) => { this.player.debug.log( `Showing thumb: ${thumbFilename}. num: ${thumbNum}. qual: ${qualityIndex}. newimg: ${newImage}`, ); @@ -449,10 +449,10 @@ class PreviewThumbnails { this.preloadNearby(thumbNum, true) .then(this.preloadNearby(thumbNum, false)) .then(this.getHigherQuality(qualityIndex, previewImage, frame, thumbFilename)); - } + }; // Remove all preview images that aren't the designated current image - removeOldImages(currentImage) { + removeOldImages = (currentImage) => { // Get a list of all images, convert it from a DOM list to an array Array.from(this.currentImageContainer.children).forEach((image) => { if (image.tagName.toLowerCase() !== 'img') { @@ -476,11 +476,11 @@ class PreviewThumbnails { }, removeDelay); } }); - } + }; // Preload images before and after the current one. Only if the user is still hovering/seeking the same frame // This will only preload the lowest quality - preloadNearby(thumbNum, forward = true) { + preloadNearby = (thumbNum, forward = true) => { return new Promise((resolve) => { setTimeout(() => { const oldThumbFilename = this.thumbnails[0].frames[thumbNum].text; @@ -527,10 +527,10 @@ class PreviewThumbnails { } }, 300); }); - } + }; // If user has been hovering current image for half a second, look for a higher quality one - getHigherQuality(currentQualityIndex, previewImage, frame, thumbFilename) { + getHigherQuality = (currentQualityIndex, previewImage, frame, thumbFilename) => { if (currentQualityIndex < this.thumbnails.length - 1) { // Only use the higher quality version if it's going to look any better - if the current thumb is of a lower pixel density than the thumbnail container let previewImageHeight = previewImage.naturalHeight; @@ -550,7 +550,7 @@ class PreviewThumbnails { }, 300); } } - } + }; get currentImageContainer() { if (this.mouseDown) { @@ -605,7 +605,7 @@ class PreviewThumbnails { } } - toggleThumbContainer(toggle = false, clearShowing = false) { + toggleThumbContainer = (toggle = false, clearShowing = false) => { const className = this.player.config.classNames.previewThumbnails.thumbContainerShown; this.elements.thumb.container.classList.toggle(className, toggle); @@ -613,9 +613,9 @@ class PreviewThumbnails { this.showingThumb = null; this.showingThumbFilename = null; } - } + }; - toggleScrubbingContainer(toggle = false) { + toggleScrubbingContainer = (toggle = false) => { const className = this.player.config.classNames.previewThumbnails.scrubbingContainerShown; this.elements.scrubbing.container.classList.toggle(className, toggle); @@ -623,17 +623,17 @@ class PreviewThumbnails { this.showingThumb = null; this.showingThumbFilename = null; } - } + }; - determineContainerAutoSizing() { + determineContainerAutoSizing = () => { if (this.elements.thumb.imageContainer.clientHeight > 20 || this.elements.thumb.imageContainer.clientWidth > 20) { // This will prevent auto sizing in this.setThumbContainerSizeAndPos() this.sizeSpecifiedInCSS = true; } - } + }; // Set the size to be about a quarter of the size of video. Unless option dynamicSize === false, in which case it needs to be set in CSS - setThumbContainerSizeAndPos() { + setThumbContainerSizeAndPos = () => { if (!this.sizeSpecifiedInCSS) { const thumbWidth = Math.floor(this.thumbContainerHeight * this.thumbAspectRatio); this.elements.thumb.imageContainer.style.height = `${this.thumbContainerHeight}px`; @@ -653,9 +653,9 @@ class PreviewThumbnails { } this.setThumbContainerPos(); - } + }; - setThumbContainerPos() { + setThumbContainerPos = () => { const seekbarRect = this.player.elements.progress.getBoundingClientRect(); const plyrRect = this.player.elements.container.getBoundingClientRect(); const { container } = this.elements.thumb; @@ -674,20 +674,20 @@ class PreviewThumbnails { } container.style.left = `${previewPos}px`; - } + }; // Can't use 100% width, in case the video is a different aspect ratio to the video container - setScrubbingContainerSize() { + setScrubbingContainerSize = () => { const { width, height } = fitRatio(this.thumbAspectRatio, { width: this.player.media.clientWidth, height: this.player.media.clientHeight, }); this.elements.scrubbing.container.style.width = `${width}px`; this.elements.scrubbing.container.style.height = `${height}px`; - } + }; // Sprites need to be offset to the correct location - setImageSizeAndOffset(previewImage, frame) { + setImageSizeAndOffset = (previewImage, frame) => { if (!this.usingSprites) { return; } @@ -703,7 +703,7 @@ class PreviewThumbnails { previewImage.style.left = `-${frame.x * multiplier}px`; // eslint-disable-next-line no-param-reassign previewImage.style.top = `-${frame.y * multiplier}px`; - } + }; } export default PreviewThumbnails; diff --git a/src/js/plyr.js b/src/js/plyr.js index 6c507893..b37893bc 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -355,7 +355,7 @@ class Plyr { /** * Play the media, or play the advertisement (if they are not blocked) */ - play() { + play = () => { if (!is.function(this.media.play)) { return null; } @@ -367,18 +367,18 @@ class Plyr { // Return the promise (for HTML5) return this.media.play(); - } + }; /** * Pause the media */ - pause() { + pause = () => { if (!this.playing || !is.function(this.media.pause)) { return null; } return this.media.pause(); - } + }; /** * Get playing state @@ -412,7 +412,7 @@ class Plyr { * Toggle playback based on current status * @param {Boolean} input */ - togglePlay(input) { + togglePlay = (input) => { // Toggle based on current state if nothing passed const toggle = is.boolean(input) ? input : !this.playing; @@ -421,42 +421,42 @@ class Plyr { } return this.pause(); - } + }; /** * Stop playback */ - stop() { + stop = () => { if (this.isHTML5) { this.pause(); this.restart(); } else if (is.function(this.media.stop)) { this.media.stop(); } - } + }; /** * Restart playback */ - restart() { + restart = () => { this.currentTime = 0; - } + }; /** * Rewind * @param {Number} seekTime - how far to rewind in seconds. Defaults to the config.seekTime */ - rewind(seekTime) { + rewind = (seekTime) => { this.currentTime -= is.number(seekTime) ? seekTime : this.config.seekTime; - } + }; /** * Fast forward * @param {Number} seekTime - how far to fast forward in seconds. Defaults to the config.seekTime */ - forward(seekTime) { + forward = (seekTime) => { this.currentTime += is.number(seekTime) ? seekTime : this.config.seekTime; - } + }; /** * Seek to a time @@ -582,18 +582,18 @@ class Plyr { * Increase volume * @param {Boolean} step - How much to decrease by (between 0 and 1) */ - increaseVolume(step) { + increaseVolume = (step) => { const volume = this.media.muted ? 0 : this.volume; this.volume = volume + (is.number(step) ? step : 0); - } + }; /** * Decrease volume * @param {Boolean} step - How much to decrease by (between 0 and 1) */ - decreaseVolume(step) { + decreaseVolume = (step) => { this.increaseVolume(-step); - } + }; /** * Set muted state @@ -1033,18 +1033,18 @@ class Plyr { * Trigger the airplay dialog * TODO: update player with state, support, enabled */ - airplay() { + airplay = () => { // Show dialog if supported if (support.airplay) { this.media.webkitShowPlaybackTargetPicker(); } - } + }; /** * Toggle the player controls * @param {Boolean} [toggle] - Whether to show the controls */ - toggleControls(toggle) { + toggleControls = (toggle) => { // Don't toggle if missing UI support or if it's audio if (this.supported.ui && !this.isAudio) { // Get state before change @@ -1074,34 +1074,34 @@ class Plyr { } return false; - } + }; /** * Add event listeners * @param {String} event - Event type * @param {Function} callback - Callback for when event occurs */ - on(event, callback) { + on = (event, callback) => { on.call(this, this.elements.container, event, callback); - } + }; /** * Add event listeners once * @param {String} event - Event type * @param {Function} callback - Callback for when event occurs */ - once(event, callback) { + once = (event, callback) => { once.call(this, this.elements.container, event, callback); - } + }; /** * Remove event listeners * @param {String} event - Event type * @param {Function} callback - Callback for when event occurs */ - off(event, callback) { + off = (event, callback) => { off(this.elements.container, event, callback); - } + }; /** * Destroy an instance @@ -1110,7 +1110,7 @@ class Plyr { * @param {Function} callback - Callback for when destroy is complete * @param {Boolean} soft - Whether it's a soft destroy (for source changes etc) */ - destroy(callback, soft = false) { + destroy = (callback, soft = false) => { if (!this.ready) { return; } @@ -1208,15 +1208,13 @@ class Plyr { // Vimeo does not always return setTimeout(done, 200); } - } + }; /** * Check for support for a mime type (HTML5 only) * @param {String} type - Mime type */ - supports(type) { - return support.mime.call(this, type); - } + supports = (type) => support.mime.call(this, type); /** * Check for support diff --git a/src/js/storage.js b/src/js/storage.js index 85b5e2b5..323a6d25 100644 --- a/src/js/storage.js +++ b/src/js/storage.js @@ -31,7 +31,7 @@ class Storage { } } - get(key) { + get = (key) => { if (!Storage.supported || !this.enabled) { return null; } @@ -45,9 +45,9 @@ class Storage { const json = JSON.parse(store); return is.string(key) && key.length ? json[key] : json; - } + }; - set(object) { + set = (object) => { // Bail if we don't have localStorage support or it's disabled if (!Storage.supported || !this.enabled) { return; @@ -71,7 +71,7 @@ class Storage { // Update storage window.localStorage.setItem(this.key, JSON.stringify(storage)); - } + }; } export default Storage; From aa3378fd7303c42059728155719ff57952bb0fcc Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 29 Jan 2021 23:14:02 +1100 Subject: [PATCH 05/13] v3.6.4 (#2089) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * force fullscreen events to trigger on plyr element (media element in iOS) and not fullscreen container * Fixing "missing code in detail" for PlyrEvent type When using typescript and listening for youtube statechange event, it is missing the code property definition inside the event (even though it is provided in the code). By making events a map of key-value, we can add easily custom event type for specific event name. Since YouTube "statechange" event differs from the basic PlyrEvent, I added a new Event Type "PlyrStateChangeEvent" having a code property corresponding to a YoutubeState enum defined by the YouTube API documentation. This pattern follows how addEventListener in the lib.dom.d.ts is defined. * Update link to working dash.js demo (was broken) * Fix PreviewThumbnailsOptions type According to the docs, the `src` should also accept an array of strings. * fix issue #1872 * Check if key is a string before attempt --plyr checking * Fix for Slow loading videos not autoplaying * Fix for Slow loading videos not autoplaying * Network requests are not cancelled after the player is destroyed * Fix for apect ratio problem when using Vimeo player on mobile devices (issue #1940) * chore: update packages and linting * Invoke custom listener on triggering fullscreen via double-click * Fix volume when unmuting from volume 0 * adding a nice Svelte plugin that I found * Add missing unit to calc in media query * Assigning player's lastSeekTime on rewind/fast forward to prevent immediate controls hide on mobile * Fix youtube not working when player is inside shadow dom * v3.6.2 * ESLint to use common config * add BitChute to users list * Fix aspect ratio issue * Revert noCookie change * feat: demo radius tweaks * fix: poster image shouldn’t receive click events * chore: package updates * chore: linting * feat: custom controls option for embedded players * Package upgrades * ESLint to use common config * Linting changes * Update README.md * chore: formatting * fix: revert pointer events change for poster * fix: hack for Safari 14 not repainting Vimeo embed on entering fullscreen * fix: demo using custom controls for YouTube * doc: Add STROLLÿN among the list of Plyr users * Fixes #2005 * fix: overflowing volume slider * chore: clean up CSS * fix: hide poster when not using custom controls * Package upgrades * ESLint to use common config * Linting changes * chore: revert customControls default option (to prevent breaking change) * docs: changelog for v3.6.3 * Remove unnecessary calc from media query (#2049) * Enhance types (#1841) * 🏷️(type) enhance QualityOptions type Some optional properties in the QualityOptions were missing. The forced and onChange property allwoing to use an external handler. * ♻️(type) use Plyr.Provider for the readonly provider property A type exists to define all available providers. This type isn't used in the Plyr class definition and the same provider list is also defined. This code is refactored to use the Plyr.Provider type * 🏷️(type) add missing elements property in Plyr class In Plyr class, you can access elements set in cache. This property is missing in the class definition. The Plyr.Elements is for now incomplete. * FIX - object values for the providers must be used (#2053) To make use of the provider configuration, the objects values must be used. * Fix to work inside iframes. (#2069) * Fix to work inside iframes. Right now Plyr fails to load inside iframes because the selectors are not instances of Element (iframes have their own, separate globals). This is an alternative method to check isElement that will work inside iframes. This is battle-tested fallback code used before browsers supported HTMLElement. * Update is.js * Added --plyr-video-background for having control over the background of a video with alpha channel (webm) or a poster image with alpha channel. (#2076) * Fix issue with not entering iosfullscreen of vimeo videos with playsi… (#2038) * Fix issue with not entering iosfullscreen of vimeo videos with playsinline=true * Use isVimeo-function instead of hardcoded value Co-authored-by: Julian Frosch * fix: use new syntax for iframe allow attribute * Bump ini from 1.3.5 to 1.3.7 (#2044) Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7. - [Release notes](https://github.com/isaacs/ini/releases) - [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: package updates * chore: add @babel/plugin-proposal-class-properties * fix: use bound arrow functions in classes * chore: cleanup commented out code * chore: release Co-authored-by: Som Meaden Co-authored-by: akuma06 Co-authored-by: Jonathan Arbely Co-authored-by: Takeshi Co-authored-by: Hex Co-authored-by: Syed Husain Co-authored-by: Danielh112 Co-authored-by: Danil Stoyanov Co-authored-by: Guru Prasad Srinivasa Co-authored-by: Stephane Fortin Bouchard Co-authored-by: Zev Averbach Co-authored-by: Vincent Orback Co-authored-by: trafium Co-authored-by: xansen <27698939+xansen@users.noreply.github.com> Co-authored-by: zoomerdev <59863739+zoomerdev@users.noreply.github.com> Co-authored-by: Mikaël Castellani Co-authored-by: dirkjf Co-authored-by: Naomi Co-authored-by: Manuel Raynaud Co-authored-by: syteknet-core Co-authored-by: Andre Gagnon Co-authored-by: Nepomuk Leutschacher <864660+nepomuc@users.noreply.github.com> Co-authored-by: Elias Saalmann Co-authored-by: Julian Frosch Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 + CONTRIBUTING.md | 4 +- README.md | 1 + demo/dist/demo.js | 2044 ++++++++++++++++++------------- package.json | 2 +- src/js/fullscreen.js | 6 +- src/js/plugins/vimeo.js | 2 +- src/js/plyr.d.ts | 30 +- src/js/plyr.js | 2 +- src/js/utils/is.js | 8 +- src/sass/components/poster.scss | 2 +- src/sass/components/times.scss | 2 +- src/sass/settings/colors.scss | 1 + src/sass/types/video.scss | 4 +- 14 files changed, 1264 insertions(+), 857 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4167041..fe0c61ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +### v3.6.4 + +- Remove unnecessary calc from media query (thanks @naomiaz) +- Enhance types (thanks @lunika) +- Fix: Object.values for the providers must be used (thanks @syteknet-core) +- Fix: Improve support inside iframes (thanks @ajgagnon) +- Added --plyr-video-background for having control over the background of a video with alpha channel (webm) or a poster image with alpha channel (thanks @nepomuc) +- Fix issue with not entering iosfullscreen of vimeo videos with playsinline=true (thanks @lordon and @Frosch) +- fix: use new syntax for iframe allow attribute +- chore: package updates +- chore: add @babel/plugin-proposal-class-properties +- fix: use bound arrow functions in classes + ### v3.6.3 - Fix volume when unmuting from volume 0 using YouTube (thanks @stephanefbouchard) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53e096ec..2b3efe9c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,8 +36,8 @@ Please follow the instructions in our issue templates. Don't use github issues t You can use Gitpod (a free online VS Code-like IDE) for contributing. With a single click it will launch a workspace and automatically: - clone the plyr repo. -- install the dependencies. -- run `gulp` to the start the server. +- install the dependencies with `yarn install` in root directory and "demo" directory. +- run `gulp` in root directory to start the dev server. So that you can start straight away. diff --git a/README.md b/README.md index 5ec7ad88..5b8a79e3 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,7 @@ Here's a list of the properties and what they are used for: | Name | Description | Default / Fallback | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | | `--plyr-color-main` | The primary UI color. | ![#f03c15](https://placehold.it/15/00b3ff/000000?text=+) `#00b3ff` | +| `--plyr-video-background` | The background color of video and poster wrappers for using alpha channel videos and poster images. | `rgba(0, 0, 0, 1)` | | `--plyr-tab-focus-color` | The color used for the dotted outline when an element is `:focus-visible` (equivalent) keyboard focus. | `--plyr-color-main` | | `--plyr-badge-background` | The background color for badges in the menu. | ![#4a5464](https://placehold.it/15/4a5464/000000?text=+) `#4a5464` | | `--plyr-badge-text-color` | The text color for badges. | ![#ffffff](https://placehold.it/15/ffffff/000000?text=+) `#ffffff` | diff --git a/demo/dist/demo.js b/demo/dist/demo.js index e470aa27..6cea2552 100644 --- a/demo/dist/demo.js +++ b/demo/dist/demo.js @@ -4665,7 +4665,7 @@ typeof navigator === "object" && (function () { var checkIfURLSearchParamsSupported = function checkIfURLSearchParamsSupported() { try { var URLSearchParams = global.URLSearchParams; - return new URLSearchParams('?a=1').toString() === 'a=1' && typeof URLSearchParams.prototype.set === 'function'; + return new URLSearchParams('?a=1').toString() === 'a=1' && typeof URLSearchParams.prototype.set === 'function' && typeof URLSearchParams.prototype.entries === 'function'; } catch (e) { return false; } @@ -4789,7 +4789,11 @@ typeof navigator === "object" && (function () { anchorElement.href = anchorElement.href; // force href to refresh } - if (anchorElement.protocol === ':' || !/:/.test(anchorElement.href)) { + var inputElement = doc.createElement('input'); + inputElement.type = 'url'; + inputElement.value = url; + + if (anchorElement.protocol === ':' || !/:/.test(anchorElement.href) || !inputElement.checkValidity() && !base) { throw new TypeError('Invalid URL'); } @@ -5769,6 +5773,7 @@ typeof navigator === "object" && (function () { } /** JSDoc */ + // eslint-disable-next-line import/export var Severity; (function (Severity) { @@ -5792,8 +5797,7 @@ typeof navigator === "object" && (function () { /** JSDoc */ Severity["Critical"] = "critical"; - })(Severity || (Severity = {})); // tslint:disable:completed-docs - // tslint:disable:no-unnecessary-qualifier no-namespace + })(Severity || (Severity = {})); // eslint-disable-next-line @typescript-eslint/no-namespace, import/export (function (Severity) { @@ -5834,6 +5838,7 @@ typeof navigator === "object" && (function () { })(Severity || (Severity = {})); /** The status of an event. */ + // eslint-disable-next-line import/export var Status; (function (Status) { @@ -5854,8 +5859,7 @@ typeof navigator === "object" && (function () { /** A server-side error ocurred during submission. */ Status["Failed"] = "failed"; - })(Status || (Status = {})); // tslint:disable:completed-docs - // tslint:disable:no-unnecessary-qualifier no-namespace + })(Status || (Status = {})); // eslint-disable-next-line @typescript-eslint/no-namespace, import/export (function (Status) { @@ -5912,26 +5916,28 @@ typeof navigator === "object" && (function () { var setPrototypeOf = Object.setPrototypeOf || ({ __proto__: [] - } instanceof Array ? setProtoOf : mixinProperties); // tslint:disable-line:no-unbound-method - + } instanceof Array ? setProtoOf : mixinProperties); /** * setPrototypeOf polyfill using __proto__ */ + // eslint-disable-next-line @typescript-eslint/ban-types function setProtoOf(obj, proto) { - // @ts-ignore + // @ts-ignore __proto__ does not exist on obj obj.__proto__ = proto; return obj; } /** * setPrototypeOf polyfill using mixin */ + // eslint-disable-next-line @typescript-eslint/ban-types function mixinProperties(obj, proto) { for (var prop in proto) { + // eslint-disable-next-line no-prototype-builtins if (!obj.hasOwnProperty(prop)) { - // @ts-ignore + // @ts-ignore typescript complains about indexing so we remove obj[prop] = proto[prop]; } } @@ -5951,8 +5957,7 @@ typeof navigator === "object" && (function () { var _this = _super.call(this, message) || this; - _this.message = message; // tslint:disable:no-unsafe-any - + _this.message = message; _this.name = _newTarget.prototype.constructor.name; setPrototypeOf(_this, _newTarget.prototype); return _this; @@ -5961,6 +5966,10 @@ typeof navigator === "object" && (function () { return SentryError; }(Error); + /* eslint-disable @typescript-eslint/no-explicit-any */ + + /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ + /** * Checks whether given value's type is one of a few Error or Error-like * {@link isError}. @@ -6058,7 +6067,6 @@ typeof navigator === "object" && (function () { */ function isEvent(wat) { - // tslint:disable-next-line:strict-type-predicates return typeof Event !== 'undefined' && isInstanceOf(wat, Event); } /** @@ -6070,7 +6078,6 @@ typeof navigator === "object" && (function () { */ function isElement(wat) { - // tslint:disable-next-line:strict-type-predicates return typeof Element !== 'undefined' && isInstanceOf(wat, Element); } /** @@ -6090,8 +6097,8 @@ typeof navigator === "object" && (function () { */ function isThenable$1(wat) { - // tslint:disable:no-unsafe-any - return Boolean(wat && wat.then && typeof wat.then === 'function'); // tslint:enable:no-unsafe-any + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return Boolean(wat && wat.then && typeof wat.then === 'function'); } /** * Checks whether given value's type is a SyntheticEvent @@ -6102,7 +6109,6 @@ typeof navigator === "object" && (function () { */ function isSyntheticEvent(wat) { - // tslint:disable-next-line:no-unsafe-any return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat; } /** @@ -6116,7 +6122,6 @@ typeof navigator === "object" && (function () { function isInstanceOf(wat, base) { try { - // tslint:disable-next-line:no-unsafe-any return wat instanceof base; } catch (_e) { return false; @@ -7370,8 +7375,7 @@ typeof navigator === "object" && (function () { function truncate(str, max) { if (max === void 0) { max = 0; - } // tslint:disable-next-line:strict-type-predicates - + } if (typeof str !== 'string' || max === 0) { return str; @@ -7385,13 +7389,14 @@ typeof navigator === "object" && (function () { * @param delimiter string to be placed in-between values * @returns Joined values */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any function safeJoin(input, delimiter) { if (!Array.isArray(input)) { return ''; } - var output = []; // tslint:disable-next-line:prefer-for-of + var output = []; // eslint-disable-next-line @typescript-eslint/prefer-for-of for (var i = 0; i < input.length; i++) { var value = input[i]; @@ -7432,9 +7437,10 @@ typeof navigator === "object" && (function () { * * @param request The module path to resolve */ + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types function dynamicRequire(mod, request) { - // tslint:disable-next-line: no-unsafe-any + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access return mod.require(request); } /** @@ -7444,7 +7450,6 @@ typeof navigator === "object" && (function () { */ function isNodeEnv() { - // tslint:disable:strict-type-predicates return Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; } var fallbackGlobalObject = {}; @@ -7471,10 +7476,10 @@ typeof navigator === "object" && (function () { // Use window.crypto API if available var arr = new Uint16Array(8); crypto.getRandomValues(arr); // set 4 in byte 7 - // tslint:disable-next-line:no-bitwise + // eslint-disable-next-line no-bitwise arr[3] = arr[3] & 0xfff | 0x4000; // set 2 most significant bits of byte 9 to '10' - // tslint:disable-next-line:no-bitwise + // eslint-disable-next-line no-bitwise arr[4] = arr[4] & 0x3fff | 0x8000; @@ -7493,8 +7498,8 @@ typeof navigator === "object" && (function () { return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - // tslint:disable-next-line:no-bitwise - var r = Math.random() * 16 | 0; // tslint:disable-next-line:no-bitwise + // eslint-disable-next-line no-bitwise + var r = Math.random() * 16 | 0; // eslint-disable-next-line no-bitwise var v = c === 'x' ? r : r & 0x3 | 0x8; return v.toString(16); @@ -7513,7 +7518,7 @@ typeof navigator === "object" && (function () { return {}; } - var match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); + var match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/); if (!match) { return {}; @@ -7607,11 +7612,12 @@ typeof navigator === "object" && (function () { try { - // @ts-ignore - // tslint:disable:no-non-null-assertion + // @ts-ignore Type 'Mechanism | {}' is not assignable to type 'Mechanism | undefined' + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion event.exception.values[0].mechanism = event.exception.values[0].mechanism || {}; Object.keys(mechanism).forEach(function (key) { - // @ts-ignore + // @ts-ignore Mechanism has no index signature + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion event.exception.values[0].mechanism[key] = mechanism[key]; }); } catch (_oO) {// no-empty @@ -7649,7 +7655,7 @@ typeof navigator === "object" && (function () { var len = 0; var separator = ' > '; var sepLength = separator.length; - var nextStr = void 0; + var nextStr = void 0; // eslint-disable-next-line no-plusplus while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { nextStr = _htmlElementAsString(currentElem); // bail out if @@ -7694,7 +7700,8 @@ typeof navigator === "object" && (function () { if (elem.id) { out.push("#" + elem.id); - } + } // eslint-disable-next-line prefer-const + className = elem.className; @@ -7706,10 +7713,10 @@ typeof navigator === "object" && (function () { } } - var attrWhitelist = ['type', 'name', 'title', 'alt']; + var allowedAttrs = ['type', 'name', 'title', 'alt']; - for (i = 0; i < attrWhitelist.length; i++) { - key = attrWhitelist[i]; + for (i = 0; i < allowedAttrs.length; i++) { + key = allowedAttrs[i]; attr = elem.getAttribute(key); if (attr) { @@ -7745,22 +7752,25 @@ typeof navigator === "object" && (function () { } } - if (getGlobalObject().performance) { - // Polyfill for performance.timeOrigin. - // - // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin - // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. - // tslint:disable-next-line:strict-type-predicates - if (performance.timeOrigin === undefined) { - // As of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always a - // valid fallback. In the absence of a initial time provided by the browser, fallback to INITIAL_TIME. - // @ts-ignore - // tslint:disable-next-line:deprecation - performance.timeOrigin = performance.timing && performance.timing.navigationStart || INITIAL_TIME; - } + var performance = getGlobalObject().performance; + + if (!performance || !performance.now) { + return performanceFallback; + } // Polyfill for performance.timeOrigin. + // + // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin + // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing. + + + if (performance.timeOrigin === undefined) { + // As of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always a + // valid fallback. In the absence of a initial time provided by the browser, fallback to INITIAL_TIME. + // @ts-ignore ignored because timeOrigin is a readonly property but we want to override + // eslint-disable-next-line deprecation/deprecation + performance.timeOrigin = performance.timing && performance.timing.navigationStart || INITIAL_TIME; } - return getGlobalObject().performance || performanceFallback; + return performance; }(); /** * Returns a timestamp in seconds with milliseconds precision since the UNIX epoch calculated with the monotonic clock. @@ -7855,7 +7865,7 @@ typeof navigator === "object" && (function () { } consoleSandbox(function () { - global$1.console.log(PREFIX + "[Log]: " + args.join(' ')); // tslint:disable-line:no-console + global$1.console.log(PREFIX + "[Log]: " + args.join(' ')); }); }; /** JSDoc */ @@ -7873,7 +7883,7 @@ typeof navigator === "object" && (function () { } consoleSandbox(function () { - global$1.console.warn(PREFIX + "[Warn]: " + args.join(' ')); // tslint:disable-line:no-console + global$1.console.warn(PREFIX + "[Warn]: " + args.join(' ')); }); }; /** JSDoc */ @@ -7891,7 +7901,7 @@ typeof navigator === "object" && (function () { } consoleSandbox(function () { - global$1.console.error(PREFIX + "[Error]: " + args.join(' ')); // tslint:disable-line:no-console + global$1.console.error(PREFIX + "[Error]: " + args.join(' ')); }); }; @@ -8243,7 +8253,11 @@ typeof navigator === "object" && (function () { return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionWeak); - // tslint:disable:no-unsafe-any + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ + + /* eslint-disable @typescript-eslint/no-explicit-any */ + + /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ /** * Memo class used for decycle json objects. Uses WeakSet if available otherwise array. @@ -8252,7 +8266,6 @@ typeof navigator === "object" && (function () { /** @class */ function () { function Memo() { - // tslint:disable-next-line this._hasWeakSet = typeof WeakSet === 'function'; this._inner = this._hasWeakSet ? new WeakSet() : []; } @@ -8271,7 +8284,7 @@ typeof navigator === "object" && (function () { this._inner.add(obj); return false; - } // tslint:disable-next-line:prefer-for-of + } // eslint-disable-next-line @typescript-eslint/prefer-for-of for (var i = 0; i < this._inner.length; i++) { @@ -8334,7 +8347,6 @@ typeof navigator === "object" && (function () { var original = source[name]; var wrapped = replacement(original); // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work // otherwise it'll throw "TypeError: Object.defineProperties called on non-object" - // tslint:disable-next-line:strict-type-predicates if (typeof wrapped === 'function') { try { @@ -8360,8 +8372,7 @@ typeof navigator === "object" && (function () { */ function urlEncode(object) { - return Object.keys(object).map( // tslint:disable-next-line:no-unsafe-any - function (key) { + return Object.keys(object).map(function (key) { return encodeURIComponent(key) + "=" + encodeURIComponent(object[key]); }).join('&'); } @@ -8405,8 +8416,7 @@ typeof navigator === "object" && (function () { source.currentTarget = isElement(event_1.currentTarget) ? htmlTreeAsString(event_1.currentTarget) : Object.prototype.toString.call(event_1.currentTarget); } catch (_oO) { source.currentTarget = ''; - } // tslint:disable-next-line:strict-type-predicates - + } if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) { source.detail = event_1.detail; @@ -8427,7 +8437,7 @@ typeof navigator === "object" && (function () { function utf8Length(value) { - // tslint:disable-next-line:no-bitwise + // eslint-disable-next-line no-bitwise return ~-encodeURI(value).split(/%..|./).length; } /** Calculates bytes size of input object */ @@ -8487,7 +8497,6 @@ typeof navigator === "object" && (function () { * - serializes Error objects * - filter global objects */ - // tslint:disable-next-line:cyclomatic-complexity function normalizeValue(value, key) { @@ -8514,8 +8523,7 @@ typeof navigator === "object" && (function () { if (isSyntheticEvent(value)) { return '[SyntheticEvent]'; - } // tslint:disable-next-line:no-tautology-expression - + } if (typeof value === 'number' && value !== value) { return '[NaN]'; @@ -8539,6 +8547,7 @@ typeof navigator === "object" && (function () { * @param depth Optional number indicating how deep should walking be performed * @param memo Optional Memo class handling decycling */ + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types function walk(key, value, depth, memo) { @@ -8553,13 +8562,15 @@ typeof navigator === "object" && (function () { if (depth === 0) { return serializeValue(value); - } // If value implements `toJSON` method, call it and return early - // tslint:disable:no-unsafe-any + } + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ + // If value implements `toJSON` method, call it and return early if (value !== null && value !== undefined && typeof value.toJSON === 'function') { return value.toJSON(); - } // tslint:enable:no-unsafe-any + } + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ // If normalized value is a primitive, there are no branches left to walk, so we can just bail out, as theres no point in going down that branch any further @@ -8606,10 +8617,10 @@ typeof navigator === "object" && (function () { * - Takes care of Error objects serialization * - Optionally limit depth of final output */ + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types function normalize$1(input, depth) { try { - // tslint:disable-next-line:no-unsafe-any return JSON.parse(JSON.stringify(input, function (key, value) { return walk(key, value, depth); })); @@ -8622,12 +8633,12 @@ typeof navigator === "object" && (function () { * and truncated list that will be used inside the event message. * eg. `Non-error exception captured with keys: foo, bar, baz` */ + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types function extractExceptionKeysForMessage(exception, maxLength) { if (maxLength === void 0) { maxLength = 40; - } // tslint:disable:strict-type-predicates - + } var keys = Object.keys(getWalkSource(exception)); keys.sort(); @@ -8785,6 +8796,7 @@ typeof navigator === "object" && (function () { if (_this._state === States.RESOLVED) { if (handler.onfulfilled) { + // eslint-disable-next-line @typescript-eslint/no-floating-promises handler.onfulfilled(_this._value); } } @@ -8808,12 +8820,6 @@ typeof navigator === "object" && (function () { /** JSDoc */ - SyncPromise.prototype.toString = function () { - return '[object SyncPromise]'; - }; - /** JSDoc */ - - SyncPromise.resolve = function (value) { return new SyncPromise(function (resolve) { resolve(value); @@ -8941,6 +8947,12 @@ typeof navigator === "object" && (function () { }); }); }; + /** JSDoc */ + + + SyncPromise.prototype.toString = function () { + return '[object SyncPromise]'; + }; return SyncPromise; }(); @@ -9055,11 +9067,8 @@ typeof navigator === "object" && (function () { } try { - // tslint:disable-next-line:no-unused-expression - new Headers(); // tslint:disable-next-line:no-unused-expression - - new Request(''); // tslint:disable-next-line:no-unused-expression - + new Headers(); + new Request(''); new Response(); return true; } catch (e) { @@ -9069,6 +9078,7 @@ typeof navigator === "object" && (function () { /** * isNativeFetch checks if the given function is a native implementation of fetch() */ + // eslint-disable-next-line @typescript-eslint/ban-types function isNativeFetch(func) { return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); @@ -9087,7 +9097,7 @@ typeof navigator === "object" && (function () { } var global = getGlobalObject(); // Fast path to avoid DOM I/O - // tslint:disable-next-line:no-unbound-method + // eslint-disable-next-line @typescript-eslint/unbound-method if (isNativeFetch(global.fetch)) { return true; @@ -9096,7 +9106,7 @@ typeof navigator === "object" && (function () { var result = false; - var doc = global.document; // tslint:disable-next-line:no-unbound-method deprecation + var doc = global.document; // eslint-disable-next-line deprecation/deprecation if (doc && typeof doc.createElement === "function") { try { @@ -9105,7 +9115,7 @@ typeof navigator === "object" && (function () { doc.head.appendChild(sandbox); if (sandbox.contentWindow && sandbox.contentWindow.fetch) { - // tslint:disable-next-line:no-unbound-method + // eslint-disable-next-line @typescript-eslint/unbound-method result = isNativeFetch(sandbox.contentWindow.fetch); } @@ -9134,7 +9144,6 @@ typeof navigator === "object" && (function () { } try { - // tslint:disable:no-unused-expression new Request('_', { referrerPolicy: 'origin' }); @@ -9155,9 +9164,13 @@ typeof navigator === "object" && (function () { // a try/catch block*, will cause Chrome to output an error to console.error // borrowed from: https://github.com/angular/angular.js/pull/13945/files var global = getGlobalObject(); - var chrome = global.chrome; // tslint:disable-next-line:no-unsafe-any + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var chrome = global.chrome; var isChromePackagedApp = chrome && chrome.app && chrome.app.runtime; + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + var hasHistoryApi = 'history' in global && !!global.history.pushState && !!global.history.replaceState; return !isChromePackagedApp && hasHistoryApi; } @@ -9226,7 +9239,6 @@ typeof navigator === "object" && (function () { function addInstrumentationHandler(handler) { - // tslint:disable-next-line:strict-type-predicates if (!handler || typeof handler.type !== 'string' || typeof handler.callback !== 'function') { return; } @@ -9323,23 +9335,29 @@ typeof navigator === "object" && (function () { }, startTimestamp: Date.now() }; - triggerHandlers('fetch', _assign({}, commonHandlerData)); + triggerHandlers('fetch', _assign({}, commonHandlerData)); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return originalFetch.apply(global$2, args).then(function (response) { - triggerHandlers('fetch', _assign({}, commonHandlerData, { + triggerHandlers('fetch', _assign(_assign({}, commonHandlerData), { endTimestamp: Date.now(), response: response })); return response; }, function (error) { - triggerHandlers('fetch', _assign({}, commonHandlerData, { + triggerHandlers('fetch', _assign(_assign({}, commonHandlerData), { endTimestamp: Date.now(), error: error - })); + })); // NOTE: If you are a Sentry user, and you are seeing this stack frame, + // it means the sentry.javascript SDK caught an error invoking your application code. + // This is expected behavior and NOT indicative of a bug with sentry.javascript. + throw error; }); }; }); } + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ + /** Extract `method` from fetch call arguments */ @@ -9376,6 +9394,8 @@ typeof navigator === "object" && (function () { return String(fetchArgs[0]); } + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + /** JSDoc */ @@ -9391,38 +9411,23 @@ typeof navigator === "object" && (function () { for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; - } + } // eslint-disable-next-line @typescript-eslint/no-this-alias + + var xhr = this; var url = args[1]; - this.__sentry_xhr__ = { + xhr.__sentry_xhr__ = { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access method: isString(args[0]) ? args[0].toUpperCase() : args[0], url: args[1] }; // if Sentry key appears in URL, don't capture it as a request + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - if (isString(url) && this.__sentry_xhr__.method === 'POST' && url.match(/sentry_key/)) { - this.__sentry_own_request__ = true; + if (isString(url) && xhr.__sentry_xhr__.method === 'POST' && url.match(/sentry_key/)) { + xhr.__sentry_own_request__ = true; } - return originalOpen.apply(this, args); - }; - }); - fill(xhrproto, 'send', function (originalSend) { - return function () { - var args = []; - - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - - var xhr = this; // tslint:disable-line:no-this-assignment - - var commonHandlerData = { - args: args, - startTimestamp: Date.now(), - xhr: xhr - }; - triggerHandlers('xhr', _assign({}, commonHandlerData)); - xhr.addEventListener('readystatechange', function () { + var onreadystatechangeHandler = function onreadystatechangeHandler() { if (xhr.readyState === 4) { try { // touching statusCode in some platforms throws @@ -9434,10 +9439,47 @@ typeof navigator === "object" && (function () { /* do nothing */ } - triggerHandlers('xhr', _assign({}, commonHandlerData, { - endTimestamp: Date.now() - })); + triggerHandlers('xhr', { + args: args, + endTimestamp: Date.now(), + startTimestamp: Date.now(), + xhr: xhr + }); } + }; + + if ('onreadystatechange' in xhr && typeof xhr.onreadystatechange === 'function') { + fill(xhr, 'onreadystatechange', function (original) { + return function () { + var readyStateArgs = []; + + for (var _i = 0; _i < arguments.length; _i++) { + readyStateArgs[_i] = arguments[_i]; + } + + onreadystatechangeHandler(); + return original.apply(xhr, readyStateArgs); + }; + }); + } else { + xhr.addEventListener('readystatechange', onreadystatechangeHandler); + } + + return originalOpen.apply(xhr, args); + }; + }); + fill(xhrproto, 'send', function (originalSend) { + return function () { + var args = []; + + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + + triggerHandlers('xhr', { + args: args, + startTimestamp: Date.now(), + xhr: this }); return originalSend.apply(this, args); }; @@ -9520,11 +9562,14 @@ typeof navigator === "object" && (function () { global$2.document.addEventListener('keypress', keypressEventHandler(triggerHandlers.bind(null, 'dom')), false); // After hooking into document bubbled up click and keypresses events, we also hook into user handled click & keypresses. ['EventTarget', 'Node'].forEach(function (target) { - var proto = global$2[target] && global$2[target].prototype; + /* eslint-disable @typescript-eslint/no-unsafe-member-access */ + var proto = global$2[target] && global$2[target].prototype; // eslint-disable-next-line no-prototype-builtins if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { return; } + /* eslint-enable @typescript-eslint/no-unsafe-member-access */ + fill(proto, 'addEventListener', function (original) { return function (eventName, fn, options) { @@ -9561,14 +9606,12 @@ typeof navigator === "object" && (function () { }); fill(proto, 'removeEventListener', function (original) { return function (eventName, fn, options) { - var callback = fn; - try { - callback = callback && (callback.__sentry_wrapped__ || callback); + original.call(this, eventName, fn.__sentry_wrapped__, options); } catch (e) {// ignore, accessing __sentry_wrapped__ will throw in some Selenium environments } - return original.call(this, eventName, callback, options); + return original.call(this, eventName, fn, options); }; }); }); @@ -9685,6 +9728,7 @@ typeof navigator === "object" && (function () { }); if (_oldOnErrorHandler) { + // eslint-disable-next-line prefer-rest-params return _oldOnErrorHandler.apply(this, arguments); } @@ -9702,6 +9746,7 @@ typeof navigator === "object" && (function () { triggerHandlers('unhandledrejection', e); if (_oldOnUnhandledRejectionHandler) { + // eslint-disable-next-line prefer-rest-params return _oldOnUnhandledRejectionHandler.apply(this, arguments); } @@ -9711,7 +9756,7 @@ typeof navigator === "object" && (function () { /** Regular expression used to parse a Dsn. */ - var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w\.-]+)(?::(\d+))?\/(.+)/; + var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/; /** Error message */ var ERROR_MESSAGE = 'Invalid Dsn'; @@ -9744,8 +9789,7 @@ typeof navigator === "object" && (function () { Dsn.prototype.toString = function (withPassword) { if (withPassword === void 0) { withPassword = false; - } // tslint:disable-next-line:no-this-assignment - + } var _a = this, host = _a.host, @@ -9787,6 +9831,14 @@ typeof navigator === "object" && (function () { projectId = split.pop(); } + if (projectId) { + var projectMatch = projectId.match(/^\d+/); + + if (projectMatch) { + projectId = projectMatch[0]; + } + } + this._fromComponents({ host: host, pass: pass, @@ -9817,16 +9869,20 @@ typeof navigator === "object" && (function () { ['protocol', 'user', 'host', 'projectId'].forEach(function (component) { if (!_this[component]) { - throw new SentryError(ERROR_MESSAGE); + throw new SentryError(ERROR_MESSAGE + ": " + component + " missing"); } }); + if (!this.projectId.match(/^\d+$/)) { + throw new SentryError(ERROR_MESSAGE + ": Invalid projectId " + this.projectId); + } + if (this.protocol !== 'http' && this.protocol !== 'https') { - throw new SentryError(ERROR_MESSAGE); + throw new SentryError(ERROR_MESSAGE + ": Invalid protocol " + this.protocol); } if (this.port && isNaN(parseInt(this.port, 10))) { - throw new SentryError(ERROR_MESSAGE); + throw new SentryError(ERROR_MESSAGE + ": Invalid port " + this.port); } }; @@ -9860,12 +9916,38 @@ typeof navigator === "object" && (function () { this._tags = {}; /** Extra */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any this._extra = {}; /** Contexts */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any - this._context = {}; + this._contexts = {}; } + /** + * Inherit values from the parent scope. + * @param scope to clone. + */ + + + Scope.clone = function (scope) { + var newScope = new Scope(); + + if (scope) { + newScope._breadcrumbs = __spread(scope._breadcrumbs); + newScope._tags = _assign({}, scope._tags); + newScope._extra = _assign({}, scope._extra); + newScope._contexts = _assign({}, scope._contexts); + newScope._user = scope._user; + newScope._level = scope._level; + newScope._span = scope._span; + newScope._transactionName = scope._transactionName; + newScope._fingerprint = scope._fingerprint; + newScope._eventProcessors = __spread(scope._eventProcessors); + } + + return newScope; + }; /** * Add internal on change listener. Used for sub SDKs that need to store the scope. * @hidden @@ -9885,55 +9967,6 @@ typeof navigator === "object" && (function () { return this; }; - /** - * This will be called on every set call. - */ - - - Scope.prototype._notifyScopeListeners = function () { - var _this = this; - - if (!this._notifyingListeners) { - this._notifyingListeners = true; - setTimeout(function () { - _this._scopeListeners.forEach(function (callback) { - callback(_this); - }); - - _this._notifyingListeners = false; - }); - } - }; - /** - * This will be called after {@link applyToEvent} is finished. - */ - - - Scope.prototype._notifyEventProcessors = function (processors, event, hint, index) { - var _this = this; - - if (index === void 0) { - index = 0; - } - - return new SyncPromise(function (resolve, reject) { - var processor = processors[index]; // tslint:disable-next-line:strict-type-predicates - - if (event === null || typeof processor !== 'function') { - resolve(event); - } else { - var result = processor(_assign({}, event), hint); - - if (isThenable$1(result)) { - result.then(function (final) { - return _this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve); - }).then(null, reject); - } else { - _this._notifyEventProcessors(processors, result, hint, index + 1).then(resolve).then(null, reject); - } - } - }); - }; /** * @inheritDoc */ @@ -9952,7 +9985,7 @@ typeof navigator === "object" && (function () { Scope.prototype.setTags = function (tags) { - this._tags = _assign({}, this._tags, tags); + this._tags = _assign(_assign({}, this._tags), tags); this._notifyScopeListeners(); @@ -9966,7 +9999,7 @@ typeof navigator === "object" && (function () { Scope.prototype.setTag = function (key, value) { var _a; - this._tags = _assign({}, this._tags, (_a = {}, _a[key] = value, _a)); + this._tags = _assign(_assign({}, this._tags), (_a = {}, _a[key] = value, _a)); this._notifyScopeListeners(); @@ -9978,7 +10011,7 @@ typeof navigator === "object" && (function () { Scope.prototype.setExtras = function (extras) { - this._extra = _assign({}, this._extra, extras); + this._extra = _assign(_assign({}, this._extra), extras); this._notifyScopeListeners(); @@ -9992,7 +10025,7 @@ typeof navigator === "object" && (function () { Scope.prototype.setExtra = function (key, extra) { var _a; - this._extra = _assign({}, this._extra, (_a = {}, _a[key] = extra, _a)); + this._extra = _assign(_assign({}, this._extra), (_a = {}, _a[key] = extra, _a)); this._notifyScopeListeners(); @@ -10027,26 +10060,32 @@ typeof navigator === "object" && (function () { */ - Scope.prototype.setTransaction = function (transaction) { - this._transaction = transaction; - - if (this._span) { - this._span.transaction = transaction; - } + Scope.prototype.setTransactionName = function (name) { + this._transactionName = name; this._notifyScopeListeners(); return this; }; + /** + * Can be removed in major version. + * @deprecated in favor of {@link this.setTransactionName} + */ + + + Scope.prototype.setTransaction = function (name) { + return this.setTransactionName(name); + }; /** * @inheritDoc */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any Scope.prototype.setContext = function (key, context) { var _a; - this._context = _assign({}, this._context, (_a = {}, _a[key] = context, _a)); + this._contexts = _assign(_assign({}, this._contexts), (_a = {}, _a[key] = context, _a)); this._notifyScopeListeners(); @@ -10065,8 +10104,7 @@ typeof navigator === "object" && (function () { return this; }; /** - * Internal getter for Span, used in Hub. - * @hidden + * @inheritDoc */ @@ -10074,28 +10112,71 @@ typeof navigator === "object" && (function () { return this._span; }; /** - * Inherit values from the parent scope. - * @param scope to clone. + * @inheritDoc */ - Scope.clone = function (scope) { - var newScope = new Scope(); + Scope.prototype.getTransaction = function () { + var span = this.getSpan(); - if (scope) { - newScope._breadcrumbs = __spread(scope._breadcrumbs); - newScope._tags = _assign({}, scope._tags); - newScope._extra = _assign({}, scope._extra); - newScope._context = _assign({}, scope._context); - newScope._user = scope._user; - newScope._level = scope._level; - newScope._span = scope._span; - newScope._transaction = scope._transaction; - newScope._fingerprint = scope._fingerprint; - newScope._eventProcessors = __spread(scope._eventProcessors); + if (span && span.spanRecorder && span.spanRecorder.spans[0]) { + return span.spanRecorder.spans[0]; } - return newScope; + return undefined; + }; + /** + * @inheritDoc + */ + + + Scope.prototype.update = function (captureContext) { + if (!captureContext) { + return this; + } + + if (typeof captureContext === 'function') { + var updatedScope = captureContext(this); + return updatedScope instanceof Scope ? updatedScope : this; + } + + if (captureContext instanceof Scope) { + this._tags = _assign(_assign({}, this._tags), captureContext._tags); + this._extra = _assign(_assign({}, this._extra), captureContext._extra); + this._contexts = _assign(_assign({}, this._contexts), captureContext._contexts); + + if (captureContext._user) { + this._user = captureContext._user; + } + + if (captureContext._level) { + this._level = captureContext._level; + } + + if (captureContext._fingerprint) { + this._fingerprint = captureContext._fingerprint; + } + } else if (isPlainObject(captureContext)) { + // eslint-disable-next-line no-param-reassign + captureContext = captureContext; + this._tags = _assign(_assign({}, this._tags), captureContext.tags); + this._extra = _assign(_assign({}, this._extra), captureContext.extra); + this._contexts = _assign(_assign({}, this._contexts), captureContext.contexts); + + if (captureContext.user) { + this._user = captureContext.user; + } + + if (captureContext.level) { + this._level = captureContext.level; + } + + if (captureContext.fingerprint) { + this._fingerprint = captureContext.fingerprint; + } + } + + return this; }; /** * @inheritDoc @@ -10107,9 +10188,9 @@ typeof navigator === "object" && (function () { this._tags = {}; this._extra = {}; this._user = {}; - this._context = {}; + this._contexts = {}; this._level = undefined; - this._transaction = undefined; + this._transactionName = undefined; this._fingerprint = undefined; this._span = undefined; @@ -10145,6 +10226,105 @@ typeof navigator === "object" && (function () { return this; }; + /** + * Applies the current context and fingerprint to the event. + * Note that breadcrumbs will be added by the client. + * Also if the event has already breadcrumbs on it, we do not merge them. + * @param event Event + * @param hint May contain additional informartion about the original exception. + * @hidden + */ + + + Scope.prototype.applyToEvent = function (event, hint) { + if (this._extra && Object.keys(this._extra).length) { + event.extra = _assign(_assign({}, this._extra), event.extra); + } + + if (this._tags && Object.keys(this._tags).length) { + event.tags = _assign(_assign({}, this._tags), event.tags); + } + + if (this._user && Object.keys(this._user).length) { + event.user = _assign(_assign({}, this._user), event.user); + } + + if (this._contexts && Object.keys(this._contexts).length) { + event.contexts = _assign(_assign({}, this._contexts), event.contexts); + } + + if (this._level) { + event.level = this._level; + } + + if (this._transactionName) { + event.transaction = this._transactionName; + } // We want to set the trace context for normal events only if there isn't already + // a trace context on the event. There is a product feature in place where we link + // errors with transaction and it relys on that. + + + if (this._span) { + event.contexts = _assign({ + trace: this._span.getTraceContext() + }, event.contexts); + } + + this._applyFingerprint(event); + + event.breadcrumbs = __spread(event.breadcrumbs || [], this._breadcrumbs); + event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined; + return this._notifyEventProcessors(__spread(getGlobalEventProcessors(), this._eventProcessors), event, hint); + }; + /** + * This will be called after {@link applyToEvent} is finished. + */ + + + Scope.prototype._notifyEventProcessors = function (processors, event, hint, index) { + var _this = this; + + if (index === void 0) { + index = 0; + } + + return new SyncPromise(function (resolve, reject) { + var processor = processors[index]; + + if (event === null || typeof processor !== 'function') { + resolve(event); + } else { + var result = processor(_assign({}, event), hint); + + if (isThenable$1(result)) { + result.then(function (final) { + return _this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve); + }).then(null, reject); + } else { + _this._notifyEventProcessors(processors, result, hint, index + 1).then(resolve).then(null, reject); + } + } + }); + }; + /** + * This will be called on every set call. + */ + + + Scope.prototype._notifyScopeListeners = function () { + var _this = this; + + if (!this._notifyingListeners) { + this._notifyingListeners = true; + setTimeout(function () { + _this._scopeListeners.forEach(function (callback) { + callback(_this); + }); + + _this._notifyingListeners = false; + }); + } + }; /** * Applies fingerprint from the scope to the event if there's one, * uses message if there's one instead or get rid of empty fingerprint @@ -10164,53 +10344,6 @@ typeof navigator === "object" && (function () { delete event.fingerprint; } }; - /** - * Applies the current context and fingerprint to the event. - * Note that breadcrumbs will be added by the client. - * Also if the event has already breadcrumbs on it, we do not merge them. - * @param event Event - * @param hint May contain additional informartion about the original exception. - * @hidden - */ - - - Scope.prototype.applyToEvent = function (event, hint) { - if (this._extra && Object.keys(this._extra).length) { - event.extra = _assign({}, this._extra, event.extra); - } - - if (this._tags && Object.keys(this._tags).length) { - event.tags = _assign({}, this._tags, event.tags); - } - - if (this._user && Object.keys(this._user).length) { - event.user = _assign({}, this._user, event.user); - } - - if (this._context && Object.keys(this._context).length) { - event.contexts = _assign({}, this._context, event.contexts); - } - - if (this._level) { - event.level = this._level; - } - - if (this._transaction) { - event.transaction = this._transaction; - } - - if (this._span) { - event.contexts = _assign({ - trace: this._span.getTraceContext() - }, event.contexts); - } - - this._applyFingerprint(event); - - event.breadcrumbs = __spread(event.breadcrumbs || [], this._breadcrumbs); - event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined; - return this._notifyEventProcessors(__spread(getGlobalEventProcessors(), this._eventProcessors), event, hint); - }; return Scope; }(); @@ -10237,8 +10370,8 @@ typeof navigator === "object" && (function () { /** * API compatibility version of this hub. * - * WARNING: This number should only be incresed when the global interface - * changes a and new methods are introduced. + * WARNING: This number should only be increased when the global interface + * changes and new methods are introduced. * * @hidden */ @@ -10289,30 +10422,9 @@ typeof navigator === "object" && (function () { client: client, scope: scope }); + + this.bindClient(client); } - /** - * Internal helper function to call a method on the top client if it exists. - * - * @param method The method to call on the client. - * @param args Arguments to pass to the client function. - */ - - - Hub.prototype._invokeClient = function (method) { - var _a; - - var args = []; - - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - - var top = this.getStackTop(); - - if (top && top.client && top.client[method]) { - (_a = top.client)[method].apply(_a, __spread(args, [top.scope])); - } - }; /** * @inheritDoc */ @@ -10401,6 +10513,7 @@ typeof navigator === "object" && (function () { /** * @inheritDoc */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types Hub.prototype.captureException = function (exception, hint) { @@ -10425,7 +10538,7 @@ typeof navigator === "object" && (function () { }; } - this._invokeClient('captureException', exception, _assign({}, finalHint, { + this._invokeClient('captureException', exception, _assign(_assign({}, finalHint), { event_id: eventId })); @@ -10458,7 +10571,7 @@ typeof navigator === "object" && (function () { }; } - this._invokeClient('captureMessage', message, level, _assign({}, finalHint, { + this._invokeClient('captureMessage', message, level, _assign(_assign({}, finalHint), { event_id: eventId })); @@ -10472,7 +10585,7 @@ typeof navigator === "object" && (function () { Hub.prototype.captureEvent = function (event, hint) { var eventId = this._lastEventId = uuid4(); - this._invokeClient('captureEvent', event, _assign({}, hint, { + this._invokeClient('captureEvent', event, _assign(_assign({}, hint), { event_id: eventId })); @@ -10496,7 +10609,8 @@ typeof navigator === "object" && (function () { if (!top.scope || !top.client) { return; - } + } // eslint-disable-next-line @typescript-eslint/unbound-method + var _a = top.client.getOptions && top.client.getOptions() || {}, _b = _a.beforeBreadcrumb, @@ -10597,6 +10711,7 @@ typeof navigator === "object" && (function () { /** * @inheritDoc */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any Hub.prototype.setContext = function (name, context) { @@ -10658,12 +10773,16 @@ typeof navigator === "object" && (function () { */ - Hub.prototype.startSpan = function (spanOrSpanContext, forceNoChild) { - if (forceNoChild === void 0) { - forceNoChild = false; - } + Hub.prototype.startSpan = function (context) { + return this._callExtensionMethod('startSpan', context); + }; + /** + * @inheritDoc + */ - return this._callExtensionMethod('startSpan', spanOrSpanContext, forceNoChild); + + Hub.prototype.startTransaction = function (context) { + return this._callExtensionMethod('startTransaction', context); }; /** * @inheritDoc @@ -10673,10 +10792,36 @@ typeof navigator === "object" && (function () { Hub.prototype.traceHeaders = function () { return this._callExtensionMethod('traceHeaders'); }; + /** + * Internal helper function to call a method on the top client if it exists. + * + * @param method The method to call on the client. + * @param args Arguments to pass to the client function. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + + Hub.prototype._invokeClient = function (method) { + var _a; + + var args = []; + + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + + var top = this.getStackTop(); + + if (top && top.client && top.client[method]) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any + (_a = top.client)[method].apply(_a, __spread(args, [top.scope])); + } + }; /** * Calls global extension method and binding current instance to the function call */ - // @ts-ignore + // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366) + // eslint-disable-next-line @typescript-eslint/no-explicit-any Hub.prototype._callExtensionMethod = function (method) { @@ -10687,7 +10832,7 @@ typeof navigator === "object" && (function () { } var carrier = getMainCarrier(); - var sentry = carrier.__SENTRY__; // tslint:disable-next-line: strict-type-predicates + var sentry = carrier.__SENTRY__; if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') { return sentry.extensions[method].apply(this, args); @@ -10745,7 +10890,7 @@ typeof navigator === "object" && (function () { return getHubFromCarrier(registry); } /** - * Try to read the hub from an active domain, fallback to the registry if one doesnt exist + * Try to read the hub from an active domain, and fallback to the registry if one doesn't exist * @returns discovered hub */ @@ -10753,18 +10898,20 @@ typeof navigator === "object" && (function () { try { var property = 'domain'; var carrier = getMainCarrier(); - var sentry = carrier.__SENTRY__; // tslint:disable-next-line: strict-type-predicates + var sentry = carrier.__SENTRY__; if (!sentry || !sentry.extensions || !sentry.extensions[property]) { return getHubFromCarrier(registry); - } + } // eslint-disable-next-line @typescript-eslint/no-explicit-any - var domain = sentry.extensions[property]; - var activeDomain = domain.active; // If there no active domain, just return global hub + + var domain = sentry.extensions[property]; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + + var activeDomain = domain.active; // If there's no active domain, just return global hub if (!activeDomain) { return getHubFromCarrier(registry); - } // If there's no hub on current domain, or its an old API, assign a new one + } // If there's no hub on current domain, or it's an old API, assign a new one if (!hasHubOnCarrier(activeDomain) || getHubFromCarrier(activeDomain).isOlderThan(API_VERSION)) { @@ -10830,6 +10977,7 @@ typeof navigator === "object" && (function () { * @param method function to call on hub. * @param args to pass to function. */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any function callOnHub(method) { var args = []; @@ -10841,7 +10989,7 @@ typeof navigator === "object" && (function () { var hub = getCurrentHub(); if (hub && hub[method]) { - // tslint:disable-next-line:no-unsafe-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return hub[method].apply(hub, __spread(args)); } @@ -10853,9 +11001,10 @@ typeof navigator === "object" && (function () { * @param exception An exception-like object. * @returns The generated eventId. */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types - function captureException(exception) { + function captureException(exception, captureContext) { var syntheticException; try { @@ -10865,6 +11014,7 @@ typeof navigator === "object" && (function () { } return callOnHub('captureException', exception, { + captureContext: captureContext, originalException: exception, syntheticException: syntheticException }); @@ -10904,33 +11054,40 @@ typeof navigator === "object" && (function () { API.prototype.getDsn = function () { return this._dsnObject; }; - /** Returns a string with auth headers in the url to the store endpoint. */ + /** Returns the prefix to construct Sentry ingestion API endpoints. */ - API.prototype.getStoreEndpoint = function () { - return "" + this._getBaseUrl() + this.getStoreEndpointPath(); - }; - /** Returns the store endpoint with auth added in url encoded. */ - - - API.prototype.getStoreEndpointWithUrlEncodedAuth = function () { - var dsn = this._dsnObject; - var auth = { - sentry_key: dsn.user, - sentry_version: SENTRY_API_VERSION - }; // Auth is intentionally sent as part of query string (NOT as custom HTTP header) - // to avoid preflight CORS requests - - return this.getStoreEndpoint() + "?" + urlEncode(auth); - }; - /** Returns the base path of the url including the port. */ - - - API.prototype._getBaseUrl = function () { + API.prototype.getBaseApiEndpoint = function () { var dsn = this._dsnObject; var protocol = dsn.protocol ? dsn.protocol + ":" : ''; var port = dsn.port ? ":" + dsn.port : ''; - return protocol + "//" + dsn.host + port; + return protocol + "//" + dsn.host + port + (dsn.path ? "/" + dsn.path : '') + "/api/"; + }; + /** Returns the store endpoint URL. */ + + + API.prototype.getStoreEndpoint = function () { + return this._getIngestEndpoint('store'); + }; + /** + * Returns the store endpoint URL with auth in the query string. + * + * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. + */ + + + API.prototype.getStoreEndpointWithUrlEncodedAuth = function () { + return this.getStoreEndpoint() + "?" + this._encodedAuth(); + }; + /** + * Returns the envelope endpoint URL with auth in the query string. + * + * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests. + */ + + + API.prototype.getEnvelopeEndpointWithUrlEncodedAuth = function () { + return this._getEnvelopeEndpoint() + "?" + this._encodedAuth(); }; /** Returns only the path component for the store endpoint. */ @@ -10939,7 +11096,10 @@ typeof navigator === "object" && (function () { var dsn = this._dsnObject; return (dsn.path ? "/" + dsn.path : '') + "/api/" + dsn.projectId + "/store/"; }; - /** Returns an object that can be used in request headers. */ + /** + * Returns an object that can be used in request headers. + * This is needed for node and the old /store endpoint in sentry + */ API.prototype.getRequestHeaders = function (clientName, clientVersion) { @@ -10966,7 +11126,7 @@ typeof navigator === "object" && (function () { } var dsn = this._dsnObject; - var endpoint = "" + this._getBaseUrl() + (dsn.path ? "/" + dsn.path : '') + "/api/embed/error-page/"; + var endpoint = this.getBaseApiEndpoint() + "embed/error-page/"; var encodedOptions = []; encodedOptions.push("dsn=" + dsn.toString()); @@ -10994,6 +11154,33 @@ typeof navigator === "object" && (function () { return endpoint; }; + /** Returns the envelope endpoint URL. */ + + + API.prototype._getEnvelopeEndpoint = function () { + return this._getIngestEndpoint('envelope'); + }; + /** Returns the ingest API endpoint for target. */ + + + API.prototype._getIngestEndpoint = function (target) { + var base = this.getBaseApiEndpoint(); + var dsn = this._dsnObject; + return "" + base + dsn.projectId + "/" + target + "/"; + }; + /** Returns a URL-encoded string with auth config suitable for a query string. */ + + + API.prototype._encodedAuth = function () { + var dsn = this._dsnObject; + var auth = { + // We send only the minimum set of required information. See + // https://github.com/getsentry/sentry-javascript/issues/2572. + sentry_key: dsn.user, + sentry_version: SENTRY_API_VERSION + }; + return urlEncode(auth); + }; return API; }(); @@ -11129,23 +11316,17 @@ typeof navigator === "object" && (function () { /** * @inheritDoc */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types BaseClient.prototype.captureException = function (exception, hint, scope) { var _this = this; var eventId = hint && hint.event_id; - this._processing = true; + this._processing = true; // eslint-disable-next-line @typescript-eslint/no-floating-promises this._getBackend().eventFromException(exception, hint).then(function (event) { - return _this._processEvent(event, hint, scope); - }).then(function (finalEvent) { - // We need to check for finalEvent in case beforeSend returned null - eventId = finalEvent && finalEvent.event_id; - _this._processing = false; - }).then(null, function (reason) { - logger.error(reason); - _this._processing = false; + eventId = _this.captureEvent(event, hint, scope); }); return eventId; @@ -11160,16 +11341,10 @@ typeof navigator === "object" && (function () { var eventId = hint && hint.event_id; this._processing = true; - var promisedEvent = isPrimitive(message) ? this._getBackend().eventFromMessage("" + message, level, hint) : this._getBackend().eventFromException(message, hint); + var promisedEvent = isPrimitive(message) ? this._getBackend().eventFromMessage("" + message, level, hint) : this._getBackend().eventFromException(message, hint); // eslint-disable-next-line @typescript-eslint/no-floating-promises + promisedEvent.then(function (event) { - return _this._processEvent(event, hint, scope); - }).then(function (finalEvent) { - // We need to check for finalEvent in case beforeSend returned null - eventId = finalEvent && finalEvent.event_id; - _this._processing = false; - }).then(null, function (reason) { - logger.error(reason); - _this._processing = false; + eventId = _this.captureEvent(event, hint, scope); }); return eventId; }; @@ -11314,7 +11489,7 @@ typeof navigator === "object" && (function () { * nested objects, such as the context, keys are merged. * * @param event The original event. - * @param hint May contain additional informartion about the original exception. + * @param hint May contain additional information about the original exception. * @param scope A scope containing event metadata. * @returns A new event with more information. */ @@ -11323,62 +11498,36 @@ typeof navigator === "object" && (function () { BaseClient.prototype._prepareEvent = function (event, scope, hint) { var _this = this; - var _a = this.getOptions(), - environment = _a.environment, - release = _a.release, - dist = _a.dist, - _b = _a.maxValueLength, - maxValueLength = _b === void 0 ? 250 : _b, - _c = _a.normalizeDepth, - normalizeDepth = _c === void 0 ? 3 : _c; + var _a = this.getOptions().normalizeDepth, + normalizeDepth = _a === void 0 ? 3 : _a; - var prepared = _assign({}, event); + var prepared = _assign(_assign({}, event), { + event_id: event.event_id || (hint && hint.event_id ? hint.event_id : uuid4()), + timestamp: event.timestamp || timestampWithMs() + }); - if (prepared.environment === undefined && environment !== undefined) { - prepared.environment = environment; - } + this._applyClientOptions(prepared); - if (prepared.release === undefined && release !== undefined) { - prepared.release = release; - } + this._applyIntegrationsMetadata(prepared); // If we have scope given to us, use it as the base for further modifications. + // This allows us to prevent unnecessary copying of data if `captureContext` is not provided. - if (prepared.dist === undefined && dist !== undefined) { - prepared.dist = dist; - } - if (prepared.message) { - prepared.message = truncate(prepared.message, maxValueLength); - } + var finalScope = scope; - var exception = prepared.exception && prepared.exception.values && prepared.exception.values[0]; - - if (exception && exception.value) { - exception.value = truncate(exception.value, maxValueLength); - } - - var request = prepared.request; - - if (request && request.url) { - request.url = truncate(request.url, maxValueLength); - } - - if (prepared.event_id === undefined) { - prepared.event_id = hint && hint.event_id ? hint.event_id : uuid4(); - } - - this._addIntegrations(prepared.sdk); // We prepare the result here with a resolved Event. + if (hint && hint.captureContext) { + finalScope = Scope.clone(finalScope).update(hint.captureContext); + } // We prepare the result here with a resolved Event. var result = SyncPromise.resolve(prepared); // This should be the last thing called, since we want that // {@link Hub.addEventProcessor} gets the finished prepared event. - if (scope) { + if (finalScope) { // In case we have a hub we reassign it. - result = scope.applyToEvent(prepared, hint); + result = finalScope.applyToEvent(prepared, hint); } return result.then(function (evt) { - // tslint:disable-next-line:strict-type-predicates if (typeof normalizeDepth === 'number' && normalizeDepth > 0) { return _this._normalizeEvent(evt, normalizeDepth); } @@ -11401,22 +11550,79 @@ typeof navigator === "object" && (function () { BaseClient.prototype._normalizeEvent = function (event, depth) { if (!event) { return null; - } // tslint:disable:no-unsafe-any + } - - return _assign({}, event, event.breadcrumbs && { + var normalized = _assign(_assign(_assign(_assign(_assign({}, event), event.breadcrumbs && { breadcrumbs: event.breadcrumbs.map(function (b) { - return _assign({}, b, b.data && { + return _assign(_assign({}, b), b.data && { data: normalize$1(b.data, depth) }); }) - }, event.user && { + }), event.user && { user: normalize$1(event.user, depth) - }, event.contexts && { + }), event.contexts && { contexts: normalize$1(event.contexts, depth) - }, event.extra && { + }), event.extra && { extra: normalize$1(event.extra, depth) - }); + }); // event.contexts.trace stores information about a Transaction. Similarly, + // event.spans[] stores information about child Spans. Given that a + // Transaction is conceptually a Span, normalization should apply to both + // Transactions and Spans consistently. + // For now the decision is to skip normalization of Transactions and Spans, + // so this block overwrites the normalized event to add back the original + // Transaction information prior to normalization. + + + if (event.contexts && event.contexts.trace) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + normalized.contexts.trace = event.contexts.trace; + } + + return normalized; + }; + /** + * Enhances event using the client configuration. + * It takes care of all "static" values like environment, release and `dist`, + * as well as truncating overly long values. + * @param event event instance to be enhanced + */ + + + BaseClient.prototype._applyClientOptions = function (event) { + var _a = this.getOptions(), + environment = _a.environment, + release = _a.release, + dist = _a.dist, + _b = _a.maxValueLength, + maxValueLength = _b === void 0 ? 250 : _b; + + if (event.environment === undefined && environment !== undefined) { + event.environment = environment; + } + + if (event.release === undefined && release !== undefined) { + event.release = release; + } + + if (event.dist === undefined && dist !== undefined) { + event.dist = dist; + } + + if (event.message) { + event.message = truncate(event.message, maxValueLength); + } + + var exception = event.exception && event.exception.values && event.exception.values[0]; + + if (exception && exception.value) { + exception.value = truncate(exception.value, maxValueLength); + } + + var request = event.request; + + if (request && request.url) { + request.url = truncate(request.url, maxValueLength); + } }; /** * This function adds all used integrations to the SDK info in the event. @@ -11424,13 +11630,23 @@ typeof navigator === "object" && (function () { */ - BaseClient.prototype._addIntegrations = function (sdkInfo) { + BaseClient.prototype._applyIntegrationsMetadata = function (event) { + var sdkInfo = event.sdk; var integrationsArray = Object.keys(this._integrations); if (sdkInfo && integrationsArray.length > 0) { sdkInfo.integrations = integrationsArray; } }; + /** + * Tells the backend to send this event + * @param event The Sentry event to send + */ + + + BaseClient.prototype._sendEvent = function (event) { + this._getBackend().sendEvent(event); + }; /** * Processes an event (either error or message) and sends it to Sentry. * @@ -11440,14 +11656,15 @@ typeof navigator === "object" && (function () { * * * @param event The event to send to Sentry. - * @param hint May contain additional informartion about the original exception. + * @param hint May contain additional information about the original exception. * @param scope A scope containing event metadata. * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send. */ BaseClient.prototype._processEvent = function (event, hint, scope) { - var _this = this; + var _this = this; // eslint-disable-next-line @typescript-eslint/unbound-method + var _a = this.getOptions(), beforeSend = _a.beforeSend, @@ -11455,11 +11672,13 @@ typeof navigator === "object" && (function () { if (!this._isEnabled()) { return SyncPromise.reject('SDK not enabled, will not send event.'); - } // 1.0 === 100% events are sent + } + + var isTransaction = event.type === 'transaction'; // 1.0 === 100% events are sent // 0.0 === 0% events are sent + // Sampling for transaction happens somewhere else - - if (typeof sampleRate === 'number' && Math.random() > sampleRate) { + if (!isTransaction && typeof sampleRate === 'number' && Math.random() > sampleRate) { return SyncPromise.reject('This event has been sampled, will not send event.'); } @@ -11471,16 +11690,16 @@ typeof navigator === "object" && (function () { } var finalEvent = prepared; - var isInternalException = hint && hint.data && hint.data.__sentry__ === true; + var isInternalException = hint && hint.data && hint.data.__sentry__ === true; // We skip beforeSend in case of transactions - if (isInternalException || !beforeSend) { - _this._getBackend().sendEvent(finalEvent); + if (isInternalException || !beforeSend || isTransaction) { + _this._sendEvent(finalEvent); resolve(finalEvent); return; } - var beforeSendResult = beforeSend(prepared, hint); // tslint:disable-next-line:strict-type-predicates + var beforeSendResult = beforeSend(prepared, hint); if (typeof beforeSendResult === 'undefined') { logger.error('`beforeSend` method has to return `null` or a valid event.'); @@ -11496,7 +11715,7 @@ typeof navigator === "object" && (function () { } // From here on we are really async - _this._getBackend().sendEvent(finalEvent); + _this._sendEvent(finalEvent); resolve(finalEvent); } @@ -11527,7 +11746,7 @@ typeof navigator === "object" && (function () { } // From here on we are really async - _this._getBackend().sendEvent(processedEvent); + _this._sendEvent(processedEvent); resolve(processedEvent); }).then(null, function (e) { @@ -11585,17 +11804,10 @@ typeof navigator === "object" && (function () { this._transport = this._setupTransport(); } - /** - * Sets up the transport so it can be used later to send requests. - */ - - - BaseBackend.prototype._setupTransport = function () { - return new NoopTransport(); - }; /** * @inheritDoc */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types BaseBackend.prototype.eventFromException = function (_exception, _hint) { @@ -11627,10 +11839,52 @@ typeof navigator === "object" && (function () { BaseBackend.prototype.getTransport = function () { return this._transport; }; + /** + * Sets up the transport so it can be used later to send requests. + */ + + + BaseBackend.prototype._setupTransport = function () { + return new NoopTransport(); + }; return BaseBackend; }(); + /** Creates a SentryRequest from an event. */ + + function eventToSentryRequest(event, api) { + var useEnvelope = event.type === 'transaction'; + var req = { + body: JSON.stringify(event), + url: useEnvelope ? api.getEnvelopeEndpointWithUrlEncodedAuth() : api.getStoreEndpointWithUrlEncodedAuth() + }; // https://develop.sentry.dev/sdk/envelopes/ + // Since we don't need to manipulate envelopes nor store them, there is no + // exported concept of an Envelope with operations including serialization and + // deserialization. Instead, we only implement a minimal subset of the spec to + // serialize events inline here. + + if (useEnvelope) { + var envelopeHeaders = JSON.stringify({ + event_id: event.event_id, + // We need to add * 1000 since we divide it by 1000 by default but JS works with ms precision + // The reason we use timestampWithMs here is that all clocks across the SDK use the same clock + sent_at: new Date(timestampWithMs() * 1000).toISOString() + }); + var itemHeaders = JSON.stringify({ + type: event.type + }); // The trailing newline is optional. We intentionally don't send it to avoid + // sending unnecessary bytes. + // + // const envelope = `${envelopeHeaders}\n${itemHeaders}\n${req.body}\n`; + + var envelope = envelopeHeaders + "\n" + itemHeaders + "\n" + req.body; + req.body = envelope; + } + + return req; + } + /** * Internal function to create a new SDK client instance. The client is * installed and then bound to the current scope. @@ -11667,7 +11921,8 @@ typeof navigator === "object" && (function () { FunctionToString.prototype.setupOnce = function () { - originalFunctionToString = Function.prototype.toString; + // eslint-disable-next-line @typescript-eslint/unbound-method + originalFunctionToString = Function.prototype.toString; // eslint-disable-next-line @typescript-eslint/no-explicit-any Function.prototype.toString = function () { var args = []; @@ -11676,8 +11931,7 @@ typeof navigator === "object" && (function () { args[_i] = arguments[_i]; } - var context = this.__sentry_original__ || this; // tslint:disable-next-line:no-unsafe-any - + var context = this.__sentry_original__ || this; return originalFunctionToString.apply(context, args); }; }; @@ -11768,13 +12022,13 @@ typeof navigator === "object" && (function () { return true; } - if (this._isBlacklistedUrl(event, options)) { - logger.warn("Event dropped due to being matched by `blacklistUrls` option.\nEvent: " + getEventDescription(event) + ".\nUrl: " + this._getEventFilterUrl(event)); + if (this._isDeniedUrl(event, options)) { + logger.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: " + getEventDescription(event) + ".\nUrl: " + this._getEventFilterUrl(event)); return true; } - if (!this._isWhitelistedUrl(event, options)) { - logger.warn("Event dropped due to not being matched by `whitelistUrls` option.\nEvent: " + getEventDescription(event) + ".\nUrl: " + this._getEventFilterUrl(event)); + if (!this._isAllowedUrl(event, options)) { + logger.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: " + getEventDescription(event) + ".\nUrl: " + this._getEventFilterUrl(event)); return true; } @@ -11784,10 +12038,6 @@ typeof navigator === "object" && (function () { InboundFilters.prototype._isSentryError = function (event, options) { - if (options === void 0) { - options = {}; - } - if (!options.ignoreInternal) { return false; } @@ -11802,10 +12052,6 @@ typeof navigator === "object" && (function () { InboundFilters.prototype._isIgnoredError = function (event, options) { - if (options === void 0) { - options = {}; - } - if (!options.ignoreErrors || !options.ignoreErrors.length) { return false; } @@ -11820,38 +12066,30 @@ typeof navigator === "object" && (function () { /** JSDoc */ - InboundFilters.prototype._isBlacklistedUrl = function (event, options) { - if (options === void 0) { - options = {}; - } // TODO: Use Glob instead? - - - if (!options.blacklistUrls || !options.blacklistUrls.length) { + InboundFilters.prototype._isDeniedUrl = function (event, options) { + // TODO: Use Glob instead? + if (!options.denyUrls || !options.denyUrls.length) { return false; } var url = this._getEventFilterUrl(event); - return !url ? false : options.blacklistUrls.some(function (pattern) { + return !url ? false : options.denyUrls.some(function (pattern) { return isMatchingPattern(url, pattern); }); }; /** JSDoc */ - InboundFilters.prototype._isWhitelistedUrl = function (event, options) { - if (options === void 0) { - options = {}; - } // TODO: Use Glob instead? - - - if (!options.whitelistUrls || !options.whitelistUrls.length) { + InboundFilters.prototype._isAllowedUrl = function (event, options) { + // TODO: Use Glob instead? + if (!options.allowUrls || !options.allowUrls.length) { return true; } var url = this._getEventFilterUrl(event); - return !url ? true : options.whitelistUrls.some(function (pattern) { + return !url ? true : options.allowUrls.some(function (pattern) { return isMatchingPattern(url, pattern); }); }; @@ -11864,10 +12102,10 @@ typeof navigator === "object" && (function () { } return { - blacklistUrls: __spread(this._options.blacklistUrls || [], clientOptions.blacklistUrls || []), + allowUrls: __spread(this._options.whitelistUrls || [], this._options.allowUrls || [], clientOptions.whitelistUrls || [], clientOptions.allowUrls || []), + denyUrls: __spread(this._options.blacklistUrls || [], this._options.denyUrls || [], clientOptions.blacklistUrls || [], clientOptions.denyUrls || []), ignoreErrors: __spread(this._options.ignoreErrors || [], clientOptions.ignoreErrors || [], DEFAULT_IGNORE_ERRORS), - ignoreInternal: typeof this._options.ignoreInternal !== 'undefined' ? this._options.ignoreInternal : true, - whitelistUrls: __spread(this._options.whitelistUrls || [], clientOptions.whitelistUrls || []) + ignoreInternal: typeof this._options.ignoreInternal !== 'undefined' ? this._options.ignoreInternal : true }; }; /** JSDoc */ @@ -11931,16 +12169,26 @@ typeof navigator === "object" && (function () { // generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js // We need this specific case for now because we want no other regex to match. - var gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i; + var gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i; var winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i; var geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; - var chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/; + var chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/; // Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108 + + var reactMinifiedRegexp = /Minified React error #\d+;/i; /** JSDoc */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types function computeStackTrace(ex) { - // tslint:disable:no-unsafe-any var stack = null; - var popSize = ex && ex.framesToPop; + var popSize = 0; + + if (ex) { + if (typeof ex.framesToPop === 'number') { + popSize = ex.framesToPop; + } else if (reactMinifiedRegexp.test(ex.message)) { + popSize = 1; + } + } try { // This must be tried first because Opera 10 *destroys* @@ -11971,10 +12219,9 @@ typeof navigator === "object" && (function () { }; } /** JSDoc */ - // tslint:disable-next-line:cyclomatic-complexity + // eslint-disable-next-line @typescript-eslint/no-explicit-any, complexity function computeStackTraceFromStackProp(ex) { - // tslint:disable:no-conditional-assignment if (!ex || !ex.stack) { return null; } @@ -12064,6 +12311,7 @@ typeof navigator === "object" && (function () { }; } /** JSDoc */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any function computeStackTraceFromStacktraceProp(ex) { @@ -12076,13 +12324,12 @@ typeof navigator === "object" && (function () { var stacktrace = ex.stacktrace; var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i; - var opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i; + var opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i; var lines = stacktrace.split('\n'); var stack = []; var parts; for (var line = 0; line < lines.length; line += 2) { - // tslint:disable:no-conditional-assignment var element = null; if (parts = opera10Regex.exec(lines[line])) { @@ -12127,7 +12374,7 @@ typeof navigator === "object" && (function () { function popFrames(stacktrace, popSize) { try { - return _assign({}, stacktrace, { + return _assign(_assign({}, stacktrace), { stack: stacktrace.stack.slice(popSize) }); } catch (e) { @@ -12139,6 +12386,7 @@ typeof navigator === "object" && (function () { * https://github.com/getsentry/sentry-javascript/issues/1949 * In this specific case we try to extract stacktrace.message.error.message */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any function extractMessage(ex) { @@ -12173,8 +12421,7 @@ typeof navigator === "object" && (function () { exception.stacktrace = { frames: frames }; - } // tslint:disable-next-line:strict-type-predicates - + } if (exception.type === undefined && exception.value === '') { exception.value = 'Unrecoverable error caught'; @@ -12244,7 +12491,7 @@ typeof navigator === "object" && (function () { } // The frame where the crash happened, should be the last entry in the array - return localStack.map(function (frame) { + return localStack.slice(0, STACKTRACE_LIMIT).map(function (frame) { return { colno: frame.column === null ? undefined : frame.column, filename: frame.url || localStack[0].url, @@ -12252,10 +12499,56 @@ typeof navigator === "object" && (function () { in_app: true, lineno: frame.line === null ? undefined : frame.line }; - }).slice(0, STACKTRACE_LIMIT).reverse(); + }).reverse(); } - /** JSDoc */ + /** + * Builds and Event from a Exception + * @hidden + */ + + function eventFromException(options, exception, hint) { + var syntheticException = hint && hint.syntheticException || undefined; + var event = eventFromUnknownInput(exception, syntheticException, { + attachStacktrace: options.attachStacktrace + }); + addExceptionMechanism(event, { + handled: true, + type: 'generic' + }); + event.level = Severity.Error; + + if (hint && hint.event_id) { + event.event_id = hint.event_id; + } + + return SyncPromise.resolve(event); + } + /** + * Builds and Event from a Message + * @hidden + */ + + function eventFromMessage(options, message, level, hint) { + if (level === void 0) { + level = Severity.Info; + } + + var syntheticException = hint && hint.syntheticException || undefined; + var event = eventFromString(message, syntheticException, { + attachStacktrace: options.attachStacktrace + }); + event.level = level; + + if (hint && hint.event_id) { + event.event_id = hint.event_id; + } + + return SyncPromise.resolve(event); + } + /** + * @hidden + */ function eventFromUnknownInput(exception, syntheticException, options) { if (options === void 0) { @@ -12266,9 +12559,9 @@ typeof navigator === "object" && (function () { if (isErrorEvent(exception) && exception.error) { // If it is an ErrorEvent with `error` property, extract it to get actual Error - var errorEvent = exception; - exception = errorEvent.error; // tslint:disable-line:no-parameter-reassignment + var errorEvent = exception; // eslint-disable-next-line no-param-reassign + exception = errorEvent.error; event = eventFromStacktrace(computeStackTrace(exception)); return event; } @@ -12319,9 +12612,10 @@ typeof navigator === "object" && (function () { synthetic: true }); return event; - } // this._options.attachStacktrace - - /** JSDoc */ + } + /** + * @hidden + */ function eventFromString(input, syntheticException, options) { if (options === void 0) { @@ -12353,7 +12647,9 @@ typeof navigator === "object" && (function () { /** A simple buffer holding all requests. */ this._buffer = new PromiseBuffer(30); - this.url = new API(this.options.dsn).getStoreEndpointWithUrlEncodedAuth(); + this._api = new API(this.options.dsn); // eslint-disable-next-line deprecation/deprecation + + this.url = this._api.getStoreEndpointWithUrlEncodedAuth(); } /** * @inheritDoc @@ -12407,8 +12703,9 @@ typeof navigator === "object" && (function () { }); } - var defaultOptions = { - body: JSON.stringify(event), + var sentryReq = eventToSentryRequest(event, this._api); + var options = { + body: sentryReq.body, method: 'POST', // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default // https://caniuse.com/#feat=referrer-policy @@ -12417,12 +12714,16 @@ typeof navigator === "object" && (function () { referrerPolicy: supportsReferrerPolicy() ? 'origin' : '' }; + if (this.options.fetchParameters !== undefined) { + Object.assign(options, this.options.fetchParameters); + } + if (this.options.headers !== undefined) { - defaultOptions.headers = this.options.headers; + options.headers = this.options.headers; } return this._buffer.add(new SyncPromise(function (resolve, reject) { - global$3.fetch(_this.url, defaultOptions).then(function (response) { + global$3.fetch(sentryReq.url, options).then(function (response) { var status = Status.fromHttpCode(response.status); if (status === Status.Success) { @@ -12434,7 +12735,13 @@ typeof navigator === "object" && (function () { if (status === Status.RateLimit) { var now = Date.now(); - _this._disabledUntil = new Date(now + parseRetryAfterHeader(now, response.headers.get('Retry-After'))); + /** + * "The name is case-insensitive." + * https://developer.mozilla.org/en-US/docs/Web/API/Headers/get + */ + + var retryAfterHeader = response.headers.get('Retry-After'); + _this._disabledUntil = new Date(now + parseRetryAfterHeader(now, retryAfterHeader)); logger.warn("Too many requests, backing off till: " + _this._disabledUntil); } @@ -12477,6 +12784,7 @@ typeof navigator === "object" && (function () { }); } + var sentryReq = eventToSentryRequest(event, this._api); return this._buffer.add(new SyncPromise(function (resolve, reject) { var request = new XMLHttpRequest(); @@ -12496,14 +12804,20 @@ typeof navigator === "object" && (function () { if (status === Status.RateLimit) { var now = Date.now(); - _this._disabledUntil = new Date(now + parseRetryAfterHeader(now, request.getResponseHeader('Retry-After'))); + /** + * "The search for the header name is case-insensitive." + * https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getResponseHeader + */ + + var retryAfterHeader = request.getResponseHeader('Retry-After'); + _this._disabledUntil = new Date(now + parseRetryAfterHeader(now, retryAfterHeader)); logger.warn("Too many requests, backing off till: " + _this._disabledUntil); } reject(request); }; - request.open('POST', _this.url); + request.open('POST', sentryReq.url); for (var header in _this.options.headers) { if (_this.options.headers.hasOwnProperty(header)) { @@ -12511,7 +12825,7 @@ typeof navigator === "object" && (function () { } } - request.send(JSON.stringify(event)); + request.send(sentryReq.body); })); }; @@ -12536,13 +12850,33 @@ typeof navigator === "object" && (function () { */ + BrowserBackend.prototype.eventFromException = function (exception, hint) { + return eventFromException(this._options, exception, hint); + }; + /** + * @inheritDoc + */ + + + BrowserBackend.prototype.eventFromMessage = function (message, level, hint) { + if (level === void 0) { + level = Severity.Info; + } + + return eventFromMessage(this._options, message, level, hint); + }; + /** + * @inheritDoc + */ + + BrowserBackend.prototype._setupTransport = function () { if (!this._options.dsn) { // We return the noop transport here in case there is no Dsn. return _super.prototype._setupTransport.call(this); } - var transportOptions = _assign({}, this._options.transportOptions, { + var transportOptions = _assign(_assign({}, this._options.transportOptions), { dsn: this._options.dsn }); @@ -12556,149 +12890,10 @@ typeof navigator === "object" && (function () { return new XHRTransport(transportOptions); }; - /** - * @inheritDoc - */ - - - BrowserBackend.prototype.eventFromException = function (exception, hint) { - var syntheticException = hint && hint.syntheticException || undefined; - var event = eventFromUnknownInput(exception, syntheticException, { - attachStacktrace: this._options.attachStacktrace - }); - addExceptionMechanism(event, { - handled: true, - type: 'generic' - }); - event.level = Severity.Error; - - if (hint && hint.event_id) { - event.event_id = hint.event_id; - } - - return SyncPromise.resolve(event); - }; - /** - * @inheritDoc - */ - - - BrowserBackend.prototype.eventFromMessage = function (message, level, hint) { - if (level === void 0) { - level = Severity.Info; - } - - var syntheticException = hint && hint.syntheticException || undefined; - var event = eventFromString(message, syntheticException, { - attachStacktrace: this._options.attachStacktrace - }); - event.level = level; - - if (hint && hint.event_id) { - event.event_id = hint.event_id; - } - - return SyncPromise.resolve(event); - }; return BrowserBackend; }(BaseBackend); - var SDK_NAME = 'sentry.javascript.browser'; - var SDK_VERSION = '5.15.5'; - - /** - * The Sentry Browser SDK Client. - * - * @see BrowserOptions for documentation on configuration options. - * @see SentryClient for usage documentation. - */ - - var BrowserClient = - /** @class */ - function (_super) { - __extends(BrowserClient, _super); - /** - * Creates a new Browser SDK instance. - * - * @param options Configuration options for this SDK. - */ - - - function BrowserClient(options) { - if (options === void 0) { - options = {}; - } - - return _super.call(this, BrowserBackend, options) || this; - } - /** - * @inheritDoc - */ - - - BrowserClient.prototype._prepareEvent = function (event, scope, hint) { - event.platform = event.platform || 'javascript'; - event.sdk = _assign({}, event.sdk, { - name: SDK_NAME, - packages: __spread(event.sdk && event.sdk.packages || [], [{ - name: 'npm:@sentry/browser', - version: SDK_VERSION - }]), - version: SDK_VERSION - }); - return _super.prototype._prepareEvent.call(this, event, scope, hint); - }; - /** - * Show a report dialog to the user to send feedback to a specific event. - * - * @param options Set individual options for the dialog - */ - - - BrowserClient.prototype.showReportDialog = function (options) { - if (options === void 0) { - options = {}; - } // doesn't work without a document (React Native) - - - var document = getGlobalObject().document; - - if (!document) { - return; - } - - if (!this._isEnabled()) { - logger.error('Trying to call showReportDialog with Sentry Client is disabled'); - return; - } - - var dsn = options.dsn || this.getDsn(); - - if (!options.eventId) { - logger.error('Missing `eventId` option in showReportDialog call'); - return; - } - - if (!dsn) { - logger.error('Missing `Dsn` option in showReportDialog call'); - return; - } - - var script = document.createElement('script'); - script.async = true; - script.src = new API(dsn).getReportDialogEndpoint(options); - - if (options.onLoad) { - script.onload = options.onLoad; - } - - (document.head || document.body).appendChild(script); - }; - - return BrowserClient; - }(BaseClient); - var ignoreOnError = 0; /** * @hidden @@ -12730,8 +12925,7 @@ typeof navigator === "object" && (function () { function wrap$1(fn, options, before) { if (options === void 0) { options = {}; - } // tslint:disable-next-line:strict-type-predicates - + } if (typeof fn !== 'function') { return fn; @@ -12753,15 +12947,18 @@ typeof navigator === "object" && (function () { // Bail on wrapping and return the function as-is (defers to window.onerror). return fn; } + /* eslint-disable prefer-rest-params */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var sentryWrapped = function sentryWrapped() { - var args = Array.prototype.slice.call(arguments); // tslint:disable:no-unsafe-any + var args = Array.prototype.slice.call(arguments); try { - // tslint:disable-next-line:strict-type-predicates if (before && typeof before === 'function') { before.apply(this, arguments); - } + } // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access + var wrappedArguments = args.map(function (arg) { return wrap$1(arg, options); @@ -12772,6 +12969,7 @@ typeof navigator === "object" && (function () { // NOTE: If you are a Sentry user, and you are seeing this stack frame, it // means the sentry.javascript SDK caught an error invoking your application code. This // is expected behavior and NOT indicative of a bug with sentry.javascript. + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access return fn.handleEvent.apply(this, wrappedArguments); } // Attempt to invoke user-land function // NOTE: If you are a Sentry user, and you are seeing this stack frame, it @@ -12779,7 +12977,7 @@ typeof navigator === "object" && (function () { // is expected behavior and NOT indicative of a bug with sentry.javascript. - return fn.apply(this, wrappedArguments); // tslint:enable:no-unsafe-any + return fn.apply(this, wrappedArguments); } catch (ex) { ignoreNextOnError(); withScope(function (scope) { @@ -12791,7 +12989,7 @@ typeof navigator === "object" && (function () { addExceptionMechanism(processedEvent, options.mechanism); } - processedEvent.extra = _assign({}, processedEvent.extra, { + processedEvent.extra = _assign(_assign({}, processedEvent.extra), { arguments: args }); return processedEvent; @@ -12800,7 +12998,9 @@ typeof navigator === "object" && (function () { }); throw ex; } - }; // Accessing some objects may throw + }; + /* eslint-enable prefer-rest-params */ + // Accessing some objects may throw // ref: https://github.com/getsentry/sentry-javascript/issues/1168 @@ -12810,7 +13010,7 @@ typeof navigator === "object" && (function () { sentryWrapped[property] = fn[property]; } } - } catch (_oO) {} // tslint:disable-line:no-empty + } catch (_oO) {} // eslint-disable-line no-empty fn.prototype = fn.prototype || {}; @@ -12841,13 +13041,43 @@ typeof navigator === "object" && (function () { return fn.name; } }); - } - } catch (_oO) { - /*no-empty*/ - } + } // eslint-disable-next-line no-empty + + } catch (_oO) {} return sentryWrapped; } + /** + * Injects the Report Dialog script + * @hidden + */ + + function injectReportDialog(options) { + if (options === void 0) { + options = {}; + } + + if (!options.eventId) { + logger.error("Missing eventId option in showReportDialog call"); + return; + } + + if (!options.dsn) { + logger.error("Missing dsn option in showReportDialog call"); + return; + } + + var script = document.createElement('script'); + script.async = true; + script.src = new API(options.dsn).getReportDialogEndpoint(options); + + if (options.onLoad) { + // eslint-disable-next-line @typescript-eslint/unbound-method + script.onload = options.onLoad; + } + + (document.head || document.body).appendChild(script); + } /** Global handlers */ @@ -12902,6 +13132,7 @@ typeof navigator === "object" && (function () { } addInstrumentationHandler({ + // eslint-disable-next-line @typescript-eslint/no-explicit-any callback: function callback(data) { var error = data.error; var currentHub = getCurrentHub(); @@ -12940,6 +13171,7 @@ typeof navigator === "object" && (function () { } addInstrumentationHandler({ + // eslint-disable-next-line @typescript-eslint/no-explicit-any callback: function callback(e) { var error = e; // dig the object of the rejection out of known event types @@ -12989,6 +13221,7 @@ typeof navigator === "object" && (function () { /** * This function creates a stack from an old, error-less onerror handler. */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any GlobalHandlers.prototype._eventFromIncompleteOnError = function (msg, url, line, column) { @@ -13019,6 +13252,7 @@ typeof navigator === "object" && (function () { /** * This function creates an Event from an TraceKitStackTrace that has part of it missing. */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any GlobalHandlers.prototype._eventFromIncompleteRejection = function (error) { @@ -13032,6 +13266,7 @@ typeof navigator === "object" && (function () { }; }; /** JSDoc */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any GlobalHandlers.prototype._enhanceEventWithInitialFrame = function (event, url, line, column) { @@ -13065,24 +13300,63 @@ typeof navigator === "object" && (function () { return GlobalHandlers; }(); + var DEFAULT_EVENT_TARGET = ['EventTarget', 'Window', 'Node', 'ApplicationCache', 'AudioTrackList', 'ChannelMergerNode', 'CryptoOperation', 'EventSource', 'FileReader', 'HTMLUnknownElement', 'IDBDatabase', 'IDBRequest', 'IDBTransaction', 'KeyOperation', 'MediaController', 'MessagePort', 'ModalWindow', 'Notification', 'SVGElementInstance', 'Screen', 'TextTrack', 'TextTrackCue', 'TextTrackList', 'WebSocket', 'WebSocketWorker', 'Worker', 'XMLHttpRequest', 'XMLHttpRequestEventTarget', 'XMLHttpRequestUpload']; /** Wrap timer functions and event targets to catch errors and provide better meta data */ var TryCatch = /** @class */ function () { - function TryCatch() { - /** JSDoc */ - this._ignoreOnError = 0; + /** + * @inheritDoc + */ + function TryCatch(options) { /** * @inheritDoc */ - this.name = TryCatch.id; + this._options = _assign({ + XMLHttpRequest: true, + eventTarget: true, + requestAnimationFrame: true, + setInterval: true, + setTimeout: true + }, options); } + /** + * Wrap timer functions and event targets to catch errors + * and provide better metadata. + */ + + + TryCatch.prototype.setupOnce = function () { + var global = getGlobalObject(); + + if (this._options.setTimeout) { + fill(global, 'setTimeout', this._wrapTimeFunction.bind(this)); + } + + if (this._options.setInterval) { + fill(global, 'setInterval', this._wrapTimeFunction.bind(this)); + } + + if (this._options.requestAnimationFrame) { + fill(global, 'requestAnimationFrame', this._wrapRAF.bind(this)); + } + + if (this._options.XMLHttpRequest && 'XMLHttpRequest' in global) { + fill(XMLHttpRequest.prototype, 'send', this._wrapXHR.bind(this)); + } + + if (this._options.eventTarget) { + var eventTarget = Array.isArray(this._options.eventTarget) ? this._options.eventTarget : DEFAULT_EVENT_TARGET; + eventTarget.forEach(this._wrapEventTarget.bind(this)); + } + }; /** JSDoc */ TryCatch.prototype._wrapTimeFunction = function (original) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any return function () { var args = []; @@ -13104,11 +13378,14 @@ typeof navigator === "object" && (function () { }; }; /** JSDoc */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any TryCatch.prototype._wrapRAF = function (original) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any return function (callback) { - return original(wrap$1(callback, { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + return original.call(this, wrap$1(callback, { mechanism: { data: { function: 'requestAnimationFrame', @@ -13124,8 +13401,10 @@ typeof navigator === "object" && (function () { TryCatch.prototype._wrapEventTarget = function (target) { - var global = getGlobalObject(); - var proto = global[target] && global[target].prototype; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var global = getGlobalObject(); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + + var proto = global[target] && global[target].prototype; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) { return; @@ -13134,7 +13413,6 @@ typeof navigator === "object" && (function () { fill(proto, 'addEventListener', function (original) { return function (eventName, fn, options) { try { - // tslint:disable-next-line:no-unbound-method strict-type-predicates if (typeof fn.handleEvent === 'function') { fn.handleEvent = wrap$1(fn.handleEvent.bind(fn), { mechanism: { @@ -13151,7 +13429,8 @@ typeof navigator === "object" && (function () { } catch (err) {// can sometimes get 'Permission denied to access property "handle Event' } - return original.call(this, eventName, wrap$1(fn, { + return original.call(this, eventName, // eslint-disable-next-line @typescript-eslint/no-explicit-any + wrap$1(fn, { mechanism: { data: { function: 'addEventListener', @@ -13166,14 +13445,29 @@ typeof navigator === "object" && (function () { }); fill(proto, 'removeEventListener', function (original) { return function (eventName, fn, options) { - var callback = fn; - + /** + * There are 2 possible scenarios here: + * + * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified + * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function + * as a pass-through, and call original `removeEventListener` with it. + * + * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using + * our wrapped version of `addEventListener`, which internally calls `wrap` helper. + * This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it, + * in order for us to make a distinction between wrapped/non-wrapped functions possible. + * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler. + * + * When someone adds a handler prior to initialization, and then do it again, but after, + * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible + * to get rid of the initial handler and it'd stick there forever. + */ try { - callback = callback && (callback.__sentry_wrapped__ || callback); + original.call(this, eventName, fn.__sentry_wrapped__, options); } catch (e) {// ignore, accessing __sentry_wrapped__ will throw in some Selenium environments } - return original.call(this, eventName, callback, options); + return original.call(this, eventName, fn, options); }; }); }; @@ -13181,18 +13475,20 @@ typeof navigator === "object" && (function () { TryCatch.prototype._wrapXHR = function (originalSend) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; - } + } // eslint-disable-next-line @typescript-eslint/no-this-alias - var xhr = this; // tslint:disable-line:no-this-assignment + var xhr = this; var xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange']; xmlHttpRequestProps.forEach(function (prop) { if (prop in xhr && typeof xhr[prop] === 'function') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any fill(xhr, prop, function (original) { var wrapOptions = { mechanism: { @@ -13217,25 +13513,6 @@ typeof navigator === "object" && (function () { return originalSend.apply(this, args); }; }; - /** - * Wrap timer functions and event targets to catch errors - * and provide better metadata. - */ - - - TryCatch.prototype.setupOnce = function () { - this._ignoreOnError = this._ignoreOnError; - var global = getGlobalObject(); - fill(global, 'setTimeout', this._wrapTimeFunction.bind(this)); - fill(global, 'setInterval', this._wrapTimeFunction.bind(this)); - fill(global, 'requestAnimationFrame', this._wrapRAF.bind(this)); - - if ('XMLHttpRequest' in global) { - fill(XMLHttpRequest.prototype, 'send', this._wrapXHR.bind(this)); - } - - ['EventTarget', 'Window', 'Node', 'ApplicationCache', 'AudioTrackList', 'ChannelMergerNode', 'CryptoOperation', 'EventSource', 'FileReader', 'HTMLUnknownElement', 'IDBDatabase', 'IDBRequest', 'IDBTransaction', 'KeyOperation', 'MediaController', 'MessagePort', 'ModalWindow', 'Notification', 'SVGElementInstance', 'Screen', 'TextTrack', 'TextTrackCue', 'TextTrackList', 'WebSocket', 'WebSocketWorker', 'Worker', 'XMLHttpRequest', 'XMLHttpRequestEventTarget', 'XMLHttpRequestUpload'].forEach(this._wrapEventTarget.bind(this)); - }; /** * @inheritDoc */ @@ -13271,173 +13548,22 @@ typeof navigator === "object" && (function () { }, options); } /** - * Creates breadcrumbs from console API calls + * Create a breadcrumb of `sentry` from the events themselves */ - Breadcrumbs.prototype._consoleBreadcrumb = function (handlerData) { - var breadcrumb = { - category: 'console', - data: { - arguments: handlerData.args, - logger: 'console' - }, - level: Severity.fromString(handlerData.level), - message: safeJoin(handlerData.args, ' ') - }; - - if (handlerData.level === 'assert') { - if (handlerData.args[0] === false) { - breadcrumb.message = "Assertion failed: " + (safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'); - breadcrumb.data.arguments = handlerData.args.slice(1); - } else { - // Don't capture a breadcrumb for passed assertions - return; - } - } - - getCurrentHub().addBreadcrumb(breadcrumb, { - input: handlerData.args, - level: handlerData.level - }); - }; - /** - * Creates breadcrumbs from DOM API calls - */ - - - Breadcrumbs.prototype._domBreadcrumb = function (handlerData) { - var target; // Accessing event.target can throw (see getsentry/raven-js#838, #768) - - try { - target = handlerData.event.target ? htmlTreeAsString(handlerData.event.target) : htmlTreeAsString(handlerData.event); - } catch (e) { - target = ''; - } - - if (target.length === 0) { + Breadcrumbs.prototype.addSentryBreadcrumb = function (event) { + if (!this._options.sentry) { return; } getCurrentHub().addBreadcrumb({ - category: "ui." + handlerData.name, - message: target + category: "sentry." + (event.type === 'transaction' ? 'transaction' : 'event'), + event_id: event.event_id, + level: event.level, + message: getEventDescription(event) }, { - event: handlerData.event, - name: handlerData.name - }); - }; - /** - * Creates breadcrumbs from XHR API calls - */ - - - Breadcrumbs.prototype._xhrBreadcrumb = function (handlerData) { - if (handlerData.endTimestamp) { - // We only capture complete, non-sentry requests - if (handlerData.xhr.__sentry_own_request__) { - return; - } - - getCurrentHub().addBreadcrumb({ - category: 'xhr', - data: handlerData.xhr.__sentry_xhr__, - type: 'http' - }, { - xhr: handlerData.xhr - }); - return; - } // We only capture issued sentry requests - - - if (this._options.sentry && handlerData.xhr.__sentry_own_request__) { - addSentryBreadcrumb(handlerData.args[0]); - } - }; - /** - * Creates breadcrumbs from fetch API calls - */ - - - Breadcrumbs.prototype._fetchBreadcrumb = function (handlerData) { - // We only capture complete fetch requests - if (!handlerData.endTimestamp) { - return; - } - - var client = getCurrentHub().getClient(); - var dsn = client && client.getDsn(); - - if (this._options.sentry && dsn) { - var filterUrl = new API(dsn).getStoreEndpoint(); // if Sentry key appears in URL, don't capture it as a request - // but rather as our own 'sentry' type breadcrumb - - if (filterUrl && handlerData.fetchData.url.indexOf(filterUrl) !== -1 && handlerData.fetchData.method === 'POST' && handlerData.args[1] && handlerData.args[1].body) { - addSentryBreadcrumb(handlerData.args[1].body); - return; - } - } - - if (handlerData.error) { - getCurrentHub().addBreadcrumb({ - category: 'fetch', - data: _assign({}, handlerData.fetchData, { - status_code: handlerData.response.status - }), - level: Severity.Error, - type: 'http' - }, { - data: handlerData.error, - input: handlerData.args - }); - } else { - getCurrentHub().addBreadcrumb({ - category: 'fetch', - data: _assign({}, handlerData.fetchData, { - status_code: handlerData.response.status - }), - type: 'http' - }, { - input: handlerData.args, - response: handlerData.response - }); - } - }; - /** - * Creates breadcrumbs from history API calls - */ - - - Breadcrumbs.prototype._historyBreadcrumb = function (handlerData) { - var global = getGlobalObject(); - var from = handlerData.from; - var to = handlerData.to; - var parsedLoc = parseUrl(global.location.href); - var parsedFrom = parseUrl(from); - var parsedTo = parseUrl(to); // Initial pushState doesn't provide `from` information - - if (!parsedFrom.path) { - parsedFrom = parsedLoc; - } // Use only the path component of the URL if the URL matches the current - // document (almost all the time when using pushState) - - - if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) { - // tslint:disable-next-line:no-parameter-reassignment - to = parsedTo.relative; - } - - if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) { - // tslint:disable-next-line:no-parameter-reassignment - from = parsedFrom.relative; - } - - getCurrentHub().addBreadcrumb({ - category: 'navigation', - data: { - from: from, - to: to - } + event: event }); }; /** @@ -13528,6 +13654,164 @@ typeof navigator === "object" && (function () { }); } }; + /** + * Creates breadcrumbs from console API calls + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + + Breadcrumbs.prototype._consoleBreadcrumb = function (handlerData) { + var breadcrumb = { + category: 'console', + data: { + arguments: handlerData.args, + logger: 'console' + }, + level: Severity.fromString(handlerData.level), + message: safeJoin(handlerData.args, ' ') + }; + + if (handlerData.level === 'assert') { + if (handlerData.args[0] === false) { + breadcrumb.message = "Assertion failed: " + (safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'); + breadcrumb.data.arguments = handlerData.args.slice(1); + } else { + // Don't capture a breadcrumb for passed assertions + return; + } + } + + getCurrentHub().addBreadcrumb(breadcrumb, { + input: handlerData.args, + level: handlerData.level + }); + }; + /** + * Creates breadcrumbs from DOM API calls + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + + Breadcrumbs.prototype._domBreadcrumb = function (handlerData) { + var target; // Accessing event.target can throw (see getsentry/raven-js#838, #768) + + try { + target = handlerData.event.target ? htmlTreeAsString(handlerData.event.target) : htmlTreeAsString(handlerData.event); + } catch (e) { + target = ''; + } + + if (target.length === 0) { + return; + } + + getCurrentHub().addBreadcrumb({ + category: "ui." + handlerData.name, + message: target + }, { + event: handlerData.event, + name: handlerData.name + }); + }; + /** + * Creates breadcrumbs from XHR API calls + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + + Breadcrumbs.prototype._xhrBreadcrumb = function (handlerData) { + if (handlerData.endTimestamp) { + // We only capture complete, non-sentry requests + if (handlerData.xhr.__sentry_own_request__) { + return; + } + + getCurrentHub().addBreadcrumb({ + category: 'xhr', + data: handlerData.xhr.__sentry_xhr__, + type: 'http' + }, { + xhr: handlerData.xhr + }); + return; + } + }; + /** + * Creates breadcrumbs from fetch API calls + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + + Breadcrumbs.prototype._fetchBreadcrumb = function (handlerData) { + // We only capture complete fetch requests + if (!handlerData.endTimestamp) { + return; + } + + if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') { + // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests) + return; + } + + if (handlerData.error) { + getCurrentHub().addBreadcrumb({ + category: 'fetch', + data: handlerData.fetchData, + level: Severity.Error, + type: 'http' + }, { + data: handlerData.error, + input: handlerData.args + }); + } else { + getCurrentHub().addBreadcrumb({ + category: 'fetch', + data: _assign(_assign({}, handlerData.fetchData), { + status_code: handlerData.response.status + }), + type: 'http' + }, { + input: handlerData.args, + response: handlerData.response + }); + } + }; + /** + * Creates breadcrumbs from history API calls + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + + + Breadcrumbs.prototype._historyBreadcrumb = function (handlerData) { + var global = getGlobalObject(); + var from = handlerData.from; + var to = handlerData.to; + var parsedLoc = parseUrl(global.location.href); + var parsedFrom = parseUrl(from); + var parsedTo = parseUrl(to); // Initial pushState doesn't provide `from` information + + if (!parsedFrom.path) { + parsedFrom = parsedLoc; + } // Use only the path component of the URL if the URL matches the current + // document (almost all the time when using pushState) + + + if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) { + to = parsedTo.relative; + } + + if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) { + from = parsedFrom.relative; + } + + getCurrentHub().addBreadcrumb({ + category: 'navigation', + data: { + from: from, + to: to + } + }); + }; /** * @inheritDoc */ @@ -13536,26 +13820,6 @@ typeof navigator === "object" && (function () { Breadcrumbs.id = 'Breadcrumbs'; return Breadcrumbs; }(); - /** - * Create a breadcrumb of `sentry` from the events themselves - */ - - function addSentryBreadcrumb(serializedData) { - // There's always something that can go wrong with deserialization... - try { - var event_1 = JSON.parse(serializedData); - getCurrentHub().addBreadcrumb({ - category: "sentry." + (event_1.type === 'transaction' ? 'transaction' : 'event'), - event_id: event_1.event_id, - level: event_1.level || Severity.fromString('error'), - message: getEventDescription(event_1) - }, { - event: event_1 - }); - } catch (_oO) { - logger.error('Error while adding sentry type breadcrumb'); - } - } var DEFAULT_KEY = 'cause'; var DEFAULT_LIMIT = 5; @@ -13660,14 +13924,13 @@ typeof navigator === "object" && (function () { if (getCurrentHub().getIntegration(UserAgent)) { if (!global$4.navigator || !global$4.location) { return event; - } // Request Interface: https://docs.sentry.io/development/sdk-dev/event-payloads/request/ - + } var request = event.request || {}; request.url = request.url || global$4.location.href; request.headers = request.headers || {}; request.headers['User-Agent'] = global$4.navigator.userAgent; - return _assign({}, event, { + return _assign(_assign({}, event), { request: request }); } @@ -13684,6 +13947,97 @@ typeof navigator === "object" && (function () { return UserAgent; }(); + var SDK_NAME = 'sentry.javascript.browser'; + var SDK_VERSION = '5.22.3'; + + /** + * The Sentry Browser SDK Client. + * + * @see BrowserOptions for documentation on configuration options. + * @see SentryClient for usage documentation. + */ + + var BrowserClient = + /** @class */ + function (_super) { + __extends(BrowserClient, _super); + /** + * Creates a new Browser SDK instance. + * + * @param options Configuration options for this SDK. + */ + + + function BrowserClient(options) { + if (options === void 0) { + options = {}; + } + + return _super.call(this, BrowserBackend, options) || this; + } + /** + * Show a report dialog to the user to send feedback to a specific event. + * + * @param options Set individual options for the dialog + */ + + + BrowserClient.prototype.showReportDialog = function (options) { + if (options === void 0) { + options = {}; + } // doesn't work without a document (React Native) + + + var document = getGlobalObject().document; + + if (!document) { + return; + } + + if (!this._isEnabled()) { + logger.error('Trying to call showReportDialog with Sentry Client disabled'); + return; + } + + injectReportDialog(_assign(_assign({}, options), { + dsn: options.dsn || this.getDsn() + })); + }; + /** + * @inheritDoc + */ + + + BrowserClient.prototype._prepareEvent = function (event, scope, hint) { + event.platform = event.platform || 'javascript'; + event.sdk = _assign(_assign({}, event.sdk), { + name: SDK_NAME, + packages: __spread(event.sdk && event.sdk.packages || [], [{ + name: 'npm:@sentry/browser', + version: SDK_VERSION + }]), + version: SDK_VERSION + }); + return _super.prototype._prepareEvent.call(this, event, scope, hint); + }; + /** + * @inheritDoc + */ + + + BrowserClient.prototype._sendEvent = function (event) { + var integration = this.getIntegration(Breadcrumbs); + + if (integration) { + integration.addSentryBreadcrumb(event); + } + + _super.prototype._sendEvent.call(this, event); + }; + + return BrowserClient; + }(BaseClient); + var defaultIntegrations = [new InboundFilters(), new FunctionToString(), new TryCatch(), new Breadcrumbs(), new GlobalHandlers(), new LinkedErrors(), new UserAgent()]; /** * The Sentry Browser SDK Client. diff --git a/package.json b/package.json index 8549d67a..f9ef169a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plyr", - "version": "3.6.3", + "version": "3.6.4", "description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player", "homepage": "https://plyr.io", "author": "Sam Potts ", diff --git a/src/js/fullscreen.js b/src/js/fullscreen.js index 76acbd06..20e958fc 100644 --- a/src/js/fullscreen.js +++ b/src/js/fullscreen.js @@ -256,7 +256,11 @@ class Fullscreen { // iOS native fullscreen doesn't need the request step if (browser.isIos && this.player.config.fullscreen.iosNative) { - this.target.webkitEnterFullscreen(); + if (this.player.isVimeo) { + this.player.embed.requestFullscreen(); + } else { + this.target.webkitEnterFullscreen(); + } } else if (!Fullscreen.native || this.forceFallback) { this.toggleFallback(true); } else if (!this.prefix) { diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js index b050cc53..5fe41aba 100644 --- a/src/js/plugins/vimeo.js +++ b/src/js/plugins/vimeo.js @@ -104,7 +104,7 @@ const vimeo = { const src = format(player.config.urls.vimeo.iframe, id, params); iframe.setAttribute('src', src); iframe.setAttribute('allowfullscreen', ''); - iframe.setAttribute('allow', 'autoplay,fullscreen,picture-in-picture'); + iframe.setAttribute('allow', ['autoplay', 'fullscreen', 'picture-in-picture'].join('; ')); // Set the referrer policy if required if (!is.empty(referrerPolicy)) { diff --git a/src/js/plyr.d.ts b/src/js/plyr.d.ts index 4b332aeb..479cfa98 100644 --- a/src/js/plyr.d.ts +++ b/src/js/plyr.d.ts @@ -138,10 +138,15 @@ declare class Plyr { */ ratio?: string; + /** + * Access Elements cache + */ + elements: Plyr.Elements; + /** * Returns the current video Provider */ - readonly provider: 'html5' | 'vimeo' | 'youtube'; + readonly provider: Plyr.Provider; /** * Returns the native API for Vimeo or Youtube players @@ -510,6 +515,8 @@ declare namespace Plyr { interface QualityOptions { default: number; + forced?: boolean; + onChange?: (quality: number) => void; options: number[]; } @@ -560,6 +567,27 @@ declare namespace Plyr { src?: string | string[]; } + export interface Elements { + buttons: { + airplay?: HTMLButtonElement; + captions?: HTMLButtonElement; + download?: HTMLButtonElement; + fastForward?: HTMLButtonElement; + fullscreen?: HTMLButtonElement; + mute?: HTMLButtonElement; + pip?: HTMLButtonElement; + play?: HTMLButtonElement | HTMLButtonElement[]; + restart?: HTMLButtonElement; + rewind?: HTMLButtonElement; + settings?: HTMLButtonElement; + }; + captions: HTMLElement | null; + container: HTMLElement | null; + controls: HTMLElement | null; + fullscreen: HTMLElement | null; + wrapper: HTMLElement | null; + } + interface SourceInfo { /** * Note: YouTube and Vimeo are currently not supported as audio sources. diff --git a/src/js/plyr.js b/src/js/plyr.js index b37893bc..e67e29d4 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -206,7 +206,7 @@ class Plyr { } // Unsupported or missing provider - if (is.empty(this.provider) || !Object.keys(providers).includes(this.provider)) { + if (is.empty(this.provider) || !Object.values(providers).includes(this.provider)) { this.debug.error('Setup failed: Invalid provider'); return; } diff --git a/src/js/utils/is.js b/src/js/utils/is.js index 3bb50a00..5a60da06 100644 --- a/src/js/utils/is.js +++ b/src/js/utils/is.js @@ -13,7 +13,6 @@ const isFunction = (input) => getConstructor(input) === Function; const isArray = (input) => Array.isArray(input); const isWeakMap = (input) => instanceOf(input, WeakMap); const isNodeList = (input) => instanceOf(input, NodeList); -const isElement = (input) => instanceOf(input, Element); const isTextNode = (input) => getConstructor(input) === Text; const isEvent = (input) => instanceOf(input, Event); const isKeyboardEvent = (input) => instanceOf(input, KeyboardEvent); @@ -21,6 +20,13 @@ const isCue = (input) => instanceOf(input, window.TextTrackCue) || instanceOf(in const isTrack = (input) => instanceOf(input, TextTrack) || (!isNullOrUndefined(input) && isString(input.kind)); const isPromise = (input) => instanceOf(input, Promise) && isFunction(input.then); +const isElement = (input) => + input !== null && + (typeof input === "object") && + (input.nodeType === 1) && + (typeof input.style === "object") && + (typeof input.ownerDocument === "object"); + const isEmpty = (input) => isNullOrUndefined(input) || ((isString(input) || isArray(input) || isNodeList(input)) && !input.length) || diff --git a/src/sass/components/poster.scss b/src/sass/components/poster.scss index 2e966a32..3a158c1b 100644 --- a/src/sass/components/poster.scss +++ b/src/sass/components/poster.scss @@ -3,7 +3,7 @@ // -------------------------------------------------------------- .plyr__poster { - background-color: #000; + background-color: var(--plyr-video-background, $plyr-video-background); background-position: 50% 50%; background-repeat: no-repeat; background-size: contain; diff --git a/src/sass/components/times.scss b/src/sass/components/times.scss index c9f957bb..5f1cb995 100644 --- a/src/sass/components/times.scss +++ b/src/sass/components/times.scss @@ -14,7 +14,7 @@ margin-right: $plyr-control-spacing; } - @media (max-width: calc(#{$plyr-bp-md} - 1px)) { + @media (max-width: ($plyr-bp-md - 1px)) { display: none; } } diff --git a/src/sass/settings/colors.scss b/src/sass/settings/colors.scss index f1364905..a9846b19 100644 --- a/src/sass/settings/colors.scss +++ b/src/sass/settings/colors.scss @@ -3,6 +3,7 @@ // ========================================================================== $plyr-color-main: var(--plyr-color-main, hsl(198, 100%, 50%)) !default; +$plyr-video-background: var(--plyr-video-background, rgba(0,0,0,1)) !default; // Grayscale $plyr-color-gray-900: hsl(216, 15%, 16%) !default; diff --git a/src/sass/types/video.scss b/src/sass/types/video.scss index 0cfaeacb..9a10d5ea 100644 --- a/src/sass/types/video.scss +++ b/src/sass/types/video.scss @@ -4,7 +4,7 @@ // Container .plyr--video { - background: #000; + background: var(--plyr-video-background, $plyr-video-background); overflow: hidden; &.plyr--menu-open { @@ -13,7 +13,7 @@ } .plyr__video-wrapper { - background: #000; + background: var(--plyr-video-background, $plyr-video-background); height: 100%; margin: auto; overflow: hidden; From ea87b9c7884c53c97854fe3efc47528896cdde2b Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 29 Jan 2021 23:15:44 +1100 Subject: [PATCH 06/13] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b3efe9c..e140371e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,6 +49,6 @@ So that you can start straight away. - If your modifications changes the documented behavior or add new features, document these changes in [README.md](README.md). -- When finished, push the changes to your GitHub repository and send a pull request to **develop**. Describe what your PR does. +- When finished, push the changes to your GitHub repository and send a pull request. Describe what your PR does. - If the Travis build fails, or if you get a code review with change requests, you can fix these by pushing new or rebased commits to the branch. From c66dc8bf95f58525833a0725d0e2c6432edc0be9 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 29 Jan 2021 23:16:15 +1100 Subject: [PATCH 07/13] Update .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3203fb95..fa259abb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: node_js node_js: lts/* script: -- bash .travis/prevent-base-master.sh - bash .travis/omit-dist.sh - npm run lint - npm run build From c8e776bbea9cc4c4ea372d67758839a1db37b6dd Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 29 Jan 2021 23:16:33 +1100 Subject: [PATCH 08/13] Delete prevent-base-master.sh --- .travis/prevent-base-master.sh | 5 ----- 1 file changed, 5 deletions(-) delete mode 100755 .travis/prevent-base-master.sh diff --git a/.travis/prevent-base-master.sh b/.travis/prevent-base-master.sh deleted file mode 100755 index 54536a66..00000000 --- a/.travis/prevent-base-master.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ $TRAVIS_BRANCH == "master" ] && $(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -q "^src/"); then - echo 'The base branch for pull requests must be "develop"' >&2 - exit 1 -fi From ad7778e78d6aefbe53f3f82f2c6bbd0f1dfe0c9c Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 29 Jan 2021 23:16:52 +1100 Subject: [PATCH 09/13] Delete .travis directory --- .travis/omit-dist.sh | 5 ----- 1 file changed, 5 deletions(-) delete mode 100755 .travis/omit-dist.sh diff --git a/.travis/omit-dist.sh b/.travis/omit-dist.sh deleted file mode 100755 index f107a6b9..00000000 --- a/.travis/omit-dist.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -if [ $TRAVIS_BRANCH == "develop" ] && $(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE "^(demo/)?dist/"); then - echo 'Build output ("dist" and "demo/dist") not permitted in develop' >&2 - exit 1 -fi From 150b07f3efd2eca83b849831c18b326fd38a320b Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 29 Jan 2021 23:17:08 +1100 Subject: [PATCH 10/13] Update .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fa259abb..29a6dfc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,5 @@ language: node_js node_js: lts/* script: -- bash .travis/omit-dist.sh - npm run lint - npm run build From 3096dd9513e144ea59a90fcd2a0f587bd0c2ee91 Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 29 Jan 2021 23:18:47 +1100 Subject: [PATCH 11/13] Update pull_request_template.md --- .github/pull_request_template.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f67d769f..7efb45b8 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,8 +1,3 @@ ### Link to related issue (if applicable) ### Summary of proposed changes - -### Checklist -- [ ] Use `develop` as the base branch -- [ ] Exclude the gulp build (`/dist` changes) from the PR -- [ ] Test on [supported browsers](https://github.com/sampotts/plyr#browser-support) From a187d07807415a833baf340793e988f81751478e Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 29 Jan 2021 23:28:02 +1100 Subject: [PATCH 12/13] chore: linting fix --- src/js/utils/is.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/js/utils/is.js b/src/js/utils/is.js index 5a60da06..28f0c1a4 100644 --- a/src/js/utils/is.js +++ b/src/js/utils/is.js @@ -21,11 +21,11 @@ const isTrack = (input) => instanceOf(input, TextTrack) || (!isNullOrUndefined(i const isPromise = (input) => instanceOf(input, Promise) && isFunction(input.then); const isElement = (input) => - input !== null && - (typeof input === "object") && - (input.nodeType === 1) && - (typeof input.style === "object") && - (typeof input.ownerDocument === "object"); + input !== null && + typeof input === 'object' && + input.nodeType === 1 && + typeof input.style === 'object' && + typeof input.ownerDocument === 'object'; const isEmpty = (input) => isNullOrUndefined(input) || From 1aee8f53a725df3c6f93e8a8c890a2e8bb9d03bf Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 29 Jan 2021 23:40:34 +1100 Subject: [PATCH 13/13] chore: publish 3.6.4 --- README.md | 8 +- demo/dist/demo.css | 2 +- demo/dist/demo.js | 3386 ++++++++++++++---------------- demo/dist/demo.min.js | 6 +- demo/dist/demo.min.js.map | 2 +- dist/plyr.css | 2 +- dist/plyr.js | 3316 ++++++++++++++--------------- dist/plyr.min.js | 4 +- dist/plyr.min.js.map | 2 +- dist/plyr.min.mjs | 4 +- dist/plyr.min.mjs.map | 2 +- dist/plyr.mjs | 3316 ++++++++++++++--------------- dist/plyr.polyfilled.js | 3380 ++++++++++++++--------------- dist/plyr.polyfilled.min.js | 4 +- dist/plyr.polyfilled.min.js.map | 2 +- dist/plyr.polyfilled.min.mjs | 4 +- dist/plyr.polyfilled.min.mjs.map | 2 +- dist/plyr.polyfilled.mjs | 3380 ++++++++++++++--------------- src/js/config/defaults.js | 2 +- src/js/plyr.js | 2 +- src/js/plyr.polyfilled.js | 2 +- 21 files changed, 7880 insertions(+), 8948 deletions(-) diff --git a/README.md b/README.md index 5b8a79e3..dac62dd6 100644 --- a/README.md +++ b/README.md @@ -134,13 +134,13 @@ See [initialising](#initialising) for more information on advanced setups. You can use our CDN (provided by [Fastly](https://www.fastly.com/)) for the JavaScript. There's 2 versions; one with and one without [polyfills](#polyfills). My recommendation would be to manage polyfills seperately as part of your application but to make life easier you can use the polyfilled build. ```html - + ``` ...or... ```html - + ``` ## CSS @@ -154,13 +154,13 @@ Include the `plyr.css` stylsheet into your ``. If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the default CSS, you can use the following: ```html - + ``` ## SVG Sprite The SVG sprite is loaded automatically from our CDN (provided by [Fastly](https://www.fastly.com/)). To change this, see the [options](#options) below. For -reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/3.6.3/plyr.svg`. +reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/3.6.4/plyr.svg`. # Ads diff --git a/demo/dist/demo.css b/demo/dist/demo.css index 280a85a1..e49e115b 100644 --- a/demo/dist/demo.css +++ b/demo/dist/demo.css @@ -1 +1 @@ -:root{--plyr-color-main:#00b3ff;--plyr-font-size-base:13px;--plyr-font-size-small:12px;--plyr-font-size-time:11px;--plyr-font-size-badges:9px;--plyr-font-size-menu:var(--plyr-font-size-base);--plyr-font-weight-regular:500;--plyr-font-weight-bold:600;--plyr-font-size-captions-medium:18px;--plyr-font-size-captions-large:21px}@font-face{font-display:swap;font-family:Gordita;font-style:normal;font-weight:300;src:url(https://cdn.plyr.io/static/fonts/gordita-light.woff2) format("woff2"),url(https://cdn.plyr.io/static/fonts/gordita-light.woff) format("woff")}@font-face{font-display:swap;font-family:Gordita;font-style:normal;font-weight:400;src:url(https://cdn.plyr.io/static/fonts/gordita-regular.woff2) format("woff2"),url(https://cdn.plyr.io/static/fonts/gordita-regular.woff) format("woff")}@font-face{font-display:swap;font-family:Gordita;font-style:normal;font-weight:500;src:url(https://cdn.plyr.io/static/fonts/gordita-medium.woff2) format("woff2"),url(https://cdn.plyr.io/static/fonts/gordita-medium.woff) format("woff")}@font-face{font-display:swap;font-family:Gordita;font-style:normal;font-weight:600;src:url(https://cdn.plyr.io/static/fonts/gordita-bold.woff2) format("woff2"),url(https://cdn.plyr.io/static/fonts/gordita-bold.woff) format("woff")}@font-face{font-display:swap;font-family:Gordita;font-style:normal;font-weight:900;src:url(https://cdn.plyr.io/static/fonts/gordita-black.woff2) format("woff2"),url(https://cdn.plyr.io/static/fonts/gordita-black.woff) format("woff")}@keyframes fadein{0%{opacity:0}100%{opacity:1}}@keyframes shrinkHide{0%{opacity:.5;width:38px}20%{width:45px}100%{opacity:0;width:0}}/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a,button.faux-link{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}*,::after,::before{box-sizing:border-box}body,html{display:flex;width:100%}html{background:linear-gradient(to left top,#e0f6ff,#f5fcff);background-attachment:fixed;height:100%}body{align-items:center;display:flex;flex-direction:column;min-height:100%}.grid{flex:1;overflow:auto}main{margin:auto;padding-bottom:1px;text-align:center}aside{align-items:center;background:#fff;display:flex;flex-shrink:0;justify-content:center;padding:16px;position:relative;text-align:center;text-shadow:none;width:100%}aside .icon{fill:#4baaf4;margin-right:8px}aside p{margin:0}aside a,aside button.faux-link{color:#4baaf4}aside a.tab-focus,aside button.tab-focus.faux-link{box-shadow:0 0 0 3px rgba(75,170,244,.35);outline:0}.grid{margin:0 auto;padding:16px}@media only screen and (min-width:768px){.grid{align-items:center;display:flex;max-width:1260px;width:100%}.grid>*{flex:1}}html{font-size:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:15px;font-size:.9375rem;color:#4a5764;font-family:Gordita,Avenir,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-weight:500;line-height:1.75}button,input,select,textarea{font:inherit}p,small{margin:0 0 24px}small{font-size:13px;font-size:.8125rem;display:block}h1{font-size:64px;font-size:4rem;color:#00b3ff;font-weight:600;letter-spacing:-.025em;line-height:1.2;margin:0 0 24px}.button,.button__count{align-items:center;border:0;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.1);display:inline-flex;padding:12px;position:relative;text-shadow:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle}.button{background:#00b3ff;color:#fff;font-weight:600;padding-left:20px;padding-right:20px;transition:all .2s ease}.button:focus,.button:hover{background:#1abaff}.button:focus::after,.button:hover::after{display:none}.button:hover{box-shadow:0 2px 2px rgba(0,0,0,.1)}.button:focus{outline:0}.button.tab-focus{box-shadow:0 0 0 3px rgba(255,255,255,.35);outline:0}.button:active{top:1px}.button--with-count{display:inline-flex}.button--with-count .button .icon{flex-shrink:0}.button__count{animation:fadein .2s ease;background:#fff;color:#5d6e7e;margin-left:12px}.button__count::before{border:5px solid transparent;border-left-width:0;border-right-color:#fff;content:'';height:0;position:absolute;right:100%;top:50%;transform:translateY(-50%);width:0}header{padding-bottom:16px;text-align:center}header h1 span{animation:shrinkHide 1s cubic-bezier(.175,.885,.32,1.275) 2s forwards;display:inline-block;font-weight:300;opacity:.5}header .call-to-action{margin-top:24px}@media only screen and (min-width:768px){header{margin-right:48px;max-width:360px;padding-bottom:32px;text-align:left}header p:first-of-type{font-size:16px;font-size:1rem}}.icon{fill:currentColor;height:16px;vertical-align:-3px;width:16px}a svg,button svg,button.faux-link svg,label svg{pointer-events:none}.btn .icon,a .icon,button.faux-link .icon{margin-right:8px}button.faux-link{background:0 0;border:0;border-radius:0;cursor:pointer;font:inherit;line-height:1.75;margin:0;padding:0;position:relative;text-align:inherit;text-shadow:inherit;-moz-user-select:text;vertical-align:baseline;width:auto}a,button.faux-link{border-bottom:1px dotted currentColor;color:#00b3ff;position:relative;text-decoration:none;transition:all .2s ease}a::after,button.faux-link::after{background:currentColor;content:'';height:1px;left:50%;position:absolute;top:100%;transform:translateX(-50%);transition:width .2s ease;width:0}a:focus,a:hover,button.faux-link:focus,button.faux-link:hover{border-bottom-color:transparent;outline:0}a:focus::after,a:hover::after,button.faux-link:focus::after,button.faux-link:hover::after{width:100%}a.tab-focus,button.tab-focus.faux-link{box-shadow:0 0 0 3px rgba(255,255,255,.35);outline:0}a.no-border::after,button.no-border.faux-link::after{display:none}li,ul{list-style:none;margin:0;padding:0}audio,img,video{max-width:100%;vertical-align:middle}nav{display:flex;justify-content:center;margin-bottom:16px}.plyr{border-radius:8px;box-shadow:0 2px 15px rgba(0,0,0,.1);margin:16px auto}.plyr.plyr--audio{max-width:480px}.plyr__video-wrapper::after{border:1px solid rgba(0,0,0,.15);border-radius:inherit;bottom:0;content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:3}.plyr__cite{color:#728597}.plyr__cite .icon{margin-right:3px}@keyframes plyr-progress{to{background-position:25px 0;background-position:var(--plyr-progress-loading-size,25px) 0}}@keyframes plyr-popup{0%{opacity:.5;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes plyr-fade-in{from{opacity:0}to{opacity:1}}.plyr{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;align-items:center;direction:ltr;display:flex;flex-direction:column;font-family:inherit;font-family:var(--plyr-font-family,inherit);font-variant-numeric:tabular-nums;font-weight:500;font-weight:var(--plyr-font-weight-regular,400);line-height:1.7;line-height:var(--plyr-line-height,1.7);max-width:100%;min-width:200px;position:relative;text-shadow:none;transition:box-shadow .3s ease;z-index:0}.plyr audio,.plyr iframe,.plyr video{display:block;height:100%;width:100%}.plyr button{font:inherit;line-height:inherit;width:auto}.plyr:focus{outline:0}.plyr--full-ui{box-sizing:border-box}.plyr--full-ui *,.plyr--full-ui ::after,.plyr--full-ui ::before{box-sizing:inherit}.plyr--full-ui a,.plyr--full-ui button,.plyr--full-ui button.faux-link,.plyr--full-ui input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:#4a5464;background:var(--plyr-badge-background,#4a5464);border-radius:2px;border-radius:var(--plyr-badge-border-radius,2px);color:#fff;color:var(--plyr-badge-text-color,#fff);font-size:9px;font-size:var(--plyr-font-size-badge,9px);line-height:1;padding:3px 4px}.plyr--full-ui ::-webkit-media-text-track-container{display:none}.plyr__captions{animation:plyr-fade-in .3s ease;bottom:0;display:none;font-size:12px;font-size:var(--plyr-font-size-small,13px);left:0;padding:10px;padding:var(--plyr-control-spacing,10px);position:absolute;text-align:center;transition:transform .4s ease-in-out;width:100%}.plyr__captions span:empty{display:none}@media (min-width:480px){.plyr__captions{font-size:13px;font-size:var(--plyr-font-size-base,15px);padding:calc(10px * 2);padding:calc(var(--plyr-control-spacing,10px) * 2)}}@media (min-width:768px){.plyr__captions{font-size:18px;font-size:var(--plyr-font-size-large,18px)}}.plyr--captions-active .plyr__captions{display:block}.plyr:not(.plyr--hide-controls) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(10px * -4));transform:translateY(calc(var(--plyr-control-spacing,10px) * -4))}.plyr__caption{background:rgba(0,0,0,.8);background:var(--plyr-captions-background,rgba(0,0,0,.8));border-radius:2px;-webkit-box-decoration-break:clone;box-decoration-break:clone;color:#fff;color:var(--plyr-captions-text-color,#fff);line-height:185%;padding:.2em .5em;white-space:pre-wrap}.plyr__caption div{display:inline}.plyr__control{background:0 0;border:0;border-radius:3px;border-radius:var(--plyr-control-radius,3px);color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:calc(10px * .7);padding:calc(var(--plyr-control-spacing,10px) * .7);position:relative;transition:all .3s ease}.plyr__control svg{display:block;fill:currentColor;height:18px;height:var(--plyr-control-icon-size,18px);pointer-events:none;width:18px;width:var(--plyr-control-icon-size,18px)}.plyr__control:focus{outline:0}.plyr__control.plyr__tab-focus{outline-color:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));outline-color:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));outline-offset:2px;outline-style:dotted;outline-width:3px}a.plyr__control,button.plyr__control.faux-link{text-decoration:none}a.plyr__control::after,a.plyr__control::before,button.plyr__control.faux-link::after,button.plyr__control.faux-link::before{display:none}.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control.plyr__control--pressed .label--not-pressed,.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed{display:none}.plyr--full-ui ::-webkit-media-controls{display:none}.plyr__controls{align-items:center;display:flex;justify-content:flex-end;text-align:center}.plyr__controls .plyr__progress__container{flex:1;min-width:0}.plyr__controls .plyr__controls__item{margin-left:calc(10px / 4);margin-left:calc(var(--plyr-control-spacing,10px)/ 4)}.plyr__controls .plyr__controls__item:first-child{margin-left:0;margin-right:auto}.plyr__controls .plyr__controls__item.plyr__progress__container{padding-left:calc(10px / 4);padding-left:calc(var(--plyr-control-spacing,10px)/ 4)}.plyr__controls .plyr__controls__item.plyr__time{padding:0 calc(10px / 2);padding:0 calc(var(--plyr-control-spacing,10px)/ 2)}.plyr__controls .plyr__controls__item.plyr__progress__container:first-child,.plyr__controls .plyr__controls__item.plyr__time+.plyr__time,.plyr__controls .plyr__controls__item.plyr__time:first-child{padding-left:0}.plyr__controls:empty{display:none}.plyr [data-plyr=airplay],.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr [data-plyr=pip]{display:none}.plyr--airplay-supported [data-plyr=airplay],.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen],.plyr--pip-supported [data-plyr=pip]{display:inline-block}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform .3s ease}.plyr__menu .plyr__control[aria-expanded=true] svg{transform:rotate(90deg)}.plyr__menu .plyr__control[aria-expanded=true] .plyr__tooltip{display:none}.plyr__menu__container{animation:plyr-popup .2s ease;background:rgba(255,255,255,.9);background:var(--plyr-menu-background,rgba(255,255,255,.9));border-radius:4px;bottom:100%;box-shadow:0 1px 2px rgba(0,0,0,.15);box-shadow:var(--plyr-menu-shadow,0 1px 2px rgba(0,0,0,.15));color:#4a5464;color:var(--plyr-menu-color,#4a5464);font-size:13px;font-size:var(--plyr-font-size-base,15px);margin-bottom:10px;position:absolute;right:-3px;text-align:left;white-space:nowrap;z-index:3}.plyr__menu__container>div{overflow:hidden;transition:height .35s cubic-bezier(.4,0,.2,1),width .35s cubic-bezier(.4,0,.2,1)}.plyr__menu__container::after{border:4px solid transparent;border:var(--plyr-menu-arrow-size,4px) solid transparent;border-top-color:rgba(255,255,255,.9);border-top-color:var(--plyr-menu-background,rgba(255,255,255,.9));content:'';height:0;position:absolute;right:calc(((18px / 2) + calc(10px * .7)) - (4px / 2));right:calc(((var(--plyr-control-icon-size,18px)/ 2) + calc(var(--plyr-control-spacing,10px) * .7)) - (var(--plyr-menu-arrow-size,4px)/ 2));top:100%;width:0}.plyr__menu__container [role=menu]{padding:calc(10px * .7);padding:calc(var(--plyr-control-spacing,10px) * .7)}.plyr__menu__container [role=menuitem],.plyr__menu__container [role=menuitemradio]{margin-top:2px}.plyr__menu__container [role=menuitem]:first-child,.plyr__menu__container [role=menuitemradio]:first-child{margin-top:0}.plyr__menu__container .plyr__control{align-items:center;color:#4a5464;color:var(--plyr-menu-color,#4a5464);display:flex;font-size:13px;font-size:var(--plyr-font-size-menu,var(--plyr-font-size-small,13px));padding-bottom:calc(calc(10px * .7)/ 1.5);padding-bottom:calc(calc(var(--plyr-control-spacing,10px) * .7)/ 1.5);padding-left:calc(calc(10px * .7) * 1.5);padding-left:calc(calc(var(--plyr-control-spacing,10px) * .7) * 1.5);padding-right:calc(calc(10px * .7) * 1.5);padding-right:calc(calc(var(--plyr-control-spacing,10px) * .7) * 1.5);padding-top:calc(calc(10px * .7)/ 1.5);padding-top:calc(calc(var(--plyr-control-spacing,10px) * .7)/ 1.5);-webkit-user-select:none;-ms-user-select:none;user-select:none;width:100%}.plyr__menu__container .plyr__control>span{align-items:inherit;display:flex;width:100%}.plyr__menu__container .plyr__control::after{border:4px solid transparent;border:var(--plyr-menu-item-arrow-size,4px) solid transparent;content:'';position:absolute;top:50%;transform:translateY(-50%)}.plyr__menu__container .plyr__control--forward{padding-right:calc(calc(10px * .7) * 4);padding-right:calc(calc(var(--plyr-control-spacing,10px) * .7) * 4)}.plyr__menu__container .plyr__control--forward::after{border-left-color:#728197;border-left-color:var(--plyr-menu-arrow-color,#728197);right:calc((calc(10px * .7) * 1.5) - 4px);right:calc((calc(var(--plyr-control-spacing,10px) * .7) * 1.5) - var(--plyr-menu-item-arrow-size,4px))}.plyr__menu__container .plyr__control--forward.plyr__tab-focus::after,.plyr__menu__container .plyr__control--forward:hover::after{border-left-color:currentColor}.plyr__menu__container .plyr__control--back{font-weight:500;font-weight:var(--plyr-font-weight-regular,400);margin:calc(10px * .7);margin:calc(var(--plyr-control-spacing,10px) * .7);margin-bottom:calc(calc(10px * .7)/ 2);margin-bottom:calc(calc(var(--plyr-control-spacing,10px) * .7)/ 2);padding-left:calc(calc(10px * .7) * 4);padding-left:calc(calc(var(--plyr-control-spacing,10px) * .7) * 4);position:relative;width:calc(100% - (calc(10px * .7) * 2));width:calc(100% - (calc(var(--plyr-control-spacing,10px) * .7) * 2))}.plyr__menu__container .plyr__control--back::after{border-right-color:#728197;border-right-color:var(--plyr-menu-arrow-color,#728197);left:calc((calc(10px * .7) * 1.5) - 4px);left:calc((calc(var(--plyr-control-spacing,10px) * .7) * 1.5) - var(--plyr-menu-item-arrow-size,4px))}.plyr__menu__container .plyr__control--back::before{background:#dcdfe5;background:var(--plyr-menu-back-border-color,#dcdfe5);box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 var(--plyr-menu-back-border-shadow-color,#fff);content:'';height:1px;left:0;margin-top:calc(calc(10px * .7)/ 2);margin-top:calc(calc(var(--plyr-control-spacing,10px) * .7)/ 2);overflow:hidden;position:absolute;right:0;top:100%}.plyr__menu__container .plyr__control--back.plyr__tab-focus::after,.plyr__menu__container .plyr__control--back:hover::after{border-right-color:currentColor}.plyr__menu__container .plyr__control[role=menuitemradio]{padding-left:calc(10px * .7);padding-left:calc(var(--plyr-control-spacing,10px) * .7)}.plyr__menu__container .plyr__control[role=menuitemradio]::after,.plyr__menu__container .plyr__control[role=menuitemradio]::before{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]::before{background:rgba(0,0,0,.1);content:'';display:block;flex-shrink:0;height:16px;margin-right:10px;margin-right:var(--plyr-control-spacing,10px);transition:all .3s ease;width:16px}.plyr__menu__container .plyr__control[role=menuitemradio]::after{background:#fff;border:0;height:6px;left:12px;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform .3s ease,opacity .3s ease;width:6px}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before{background:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));background:var(--plyr-control-toggle-checked-background,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)))}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::after{opacity:1;transform:translateY(-50%) scale(1)}.plyr__menu__container .plyr__control[role=menuitemradio].plyr__tab-focus::before,.plyr__menu__container .plyr__control[role=menuitemradio]:hover::before{background:rgba(35,40,47,.1)}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:calc((calc(10px * .7) - 2) * -1);margin-right:calc((calc(var(--plyr-control-spacing,10px) * .7) - 2) * -1);overflow:hidden;padding-left:calc(calc(10px * .7) * 3.5);padding-left:calc(calc(var(--plyr-control-spacing,10px) * .7) * 3.5);pointer-events:none}.plyr--full-ui input[type=range]{-webkit-appearance:none;background:0 0;border:0;border-radius:calc(13px * 2);border-radius:calc(var(--plyr-range-thumb-height,13px) * 2);color:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));color:var(--plyr-range-fill-background,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));display:block;height:calc((3px * 2) + 13px);height:calc((var(--plyr-range-thumb-active-shadow-width,3px) * 2) + var(--plyr-range-thumb-height,13px));margin:0;min-width:0;padding:0;transition:box-shadow .3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:0 0;border:0;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px);-webkit-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-webkit-user-select:none;user-select:none;background-image:linear-gradient(to right,currentColor 0,transparent 0);background-image:linear-gradient(to right,currentColor var(--value,0),transparent var(--value,0))}.plyr--full-ui input[type=range]::-webkit-slider-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2));height:13px;height:var(--plyr-range-thumb-height,13px);position:relative;-webkit-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px);-webkit-appearance:none;margin-top:calc(((13px - 5px)/ 2) * -1);margin-top:calc(((var(--plyr-range-thumb-height,13px) - var(--plyr-range-track-height,5px))/ 2) * -1)}.plyr--full-ui input[type=range]::-moz-range-track{background:0 0;border:0;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px);-moz-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2));height:13px;height:var(--plyr-range-thumb-height,13px);position:relative;-moz-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px)}.plyr--full-ui input[type=range]::-ms-track{background:0 0;border:0;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-ms-user-select:none;user-select:none;color:transparent}.plyr--full-ui input[type=range]::-ms-fill-upper{background:0 0;border:0;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-ms-user-select:none;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:0 0;border:0;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-ms-user-select:none;user-select:none;background:currentColor}.plyr--full-ui input[type=range]::-ms-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2));height:13px;height:var(--plyr-range-thumb-height,13px);position:relative;-ms-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px);margin-top:0}.plyr--full-ui input[type=range]::-ms-tooltip{display:none}.plyr--full-ui input[type=range]:focus{outline:0}.plyr--full-ui input[type=range]::-moz-focus-outer{border:0}.plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track{outline-color:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));outline-color:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));outline-offset:2px;outline-style:dotted;outline-width:3px}.plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track{outline-color:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));outline-color:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));outline-offset:2px;outline-style:dotted;outline-width:3px}.plyr--full-ui input[type=range].plyr__tab-focus::-ms-track{outline-color:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));outline-color:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));outline-offset:2px;outline-style:dotted;outline-width:3px}.plyr__poster{background-color:#000;background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr__time{font-size:11px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__time+.plyr__time::before{content:'\2044';margin-right:10px;margin-right:var(--plyr-control-spacing,10px)}@media (max-width:calc(768px - 1px)){.plyr__time+.plyr__time{display:none}}.plyr__tooltip{background:rgba(255,255,255,.9);background:var(--plyr-tooltip-background,rgba(255,255,255,.9));border-radius:3px;border-radius:var(--plyr-tooltip-radius,3px);bottom:100%;box-shadow:0 1px 2px rgba(0,0,0,.15);box-shadow:var(--plyr-tooltip-shadow,0 1px 2px rgba(0,0,0,.15));color:#4a5464;color:var(--plyr-tooltip-color,#4a5464);font-size:12px;font-size:var(--plyr-font-size-small,13px);font-weight:500;font-weight:var(--plyr-font-weight-regular,400);left:50%;line-height:1.3;margin-bottom:calc(calc(10px / 2) * 2);margin-bottom:calc(calc(var(--plyr-control-spacing,10px)/ 2) * 2);opacity:0;padding:calc(10px / 2) calc(calc(10px / 2) * 1.5);padding:calc(var(--plyr-control-spacing,10px)/ 2) calc(calc(var(--plyr-control-spacing,10px)/ 2) * 1.5);pointer-events:none;position:absolute;transform:translate(-50%,10px) scale(.8);transform-origin:50% 100%;transition:transform .2s .1s ease,opacity .2s .1s ease;white-space:nowrap;z-index:2}.plyr__tooltip::before{border-left:4px solid transparent;border-left:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-right:4px solid transparent;border-right:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-top:4px solid rgba(255,255,255,.9);border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,rgba(255,255,255,.9));bottom:calc(4px * -1);bottom:calc(var(--plyr-tooltip-arrow-size,4px) * -1);content:'';height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr .plyr__control.plyr__tab-focus .plyr__tooltip,.plyr .plyr__control:hover .plyr__tooltip,.plyr__tooltip--visible{opacity:1;transform:translate(-50%,0) scale(1)}.plyr .plyr__control:hover .plyr__tooltip{z-index:3}.plyr__controls>.plyr__control:first-child .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip{left:0;transform:translate(0,10px) scale(.8);transform-origin:0 100%}.plyr__controls>.plyr__control:first-child .plyr__tooltip::before,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip::before{left:calc((18px / 2) + calc(10px * .7));left:calc((var(--plyr-control-icon-size,18px)/ 2) + calc(var(--plyr-control-spacing,10px) * .7))}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translate(0,10px) scale(.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip::before{left:auto;right:calc((18px / 2) + calc(10px * .7));right:calc((var(--plyr-control-icon-size,18px)/ 2) + calc(var(--plyr-control-spacing,10px) * .7));transform:translateX(50%)}.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip{transform:translate(0,0) scale(1)}.plyr__progress{left:calc(13px * .5);left:calc(var(--plyr-range-thumb-height,13px) * .5);margin-right:13px;margin-right:var(--plyr-range-thumb-height,13px);position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:calc(13px * -.5);margin-left:calc(var(--plyr-range-thumb-height,13px) * -.5);margin-right:calc(13px * -.5);margin-right:calc(var(--plyr-range-thumb-height,13px) * -.5);width:calc(100% + 13px);width:calc(100% + var(--plyr-range-thumb-height,13px))}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress .plyr__tooltip{font-size:11px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px));left:0}.plyr__progress__buffer{-webkit-appearance:none;background:0 0;border:0;border-radius:100px;height:5px;height:var(--plyr-range-track-height,5px);left:0;margin-top:calc((5px / 2) * -1);margin-top:calc((var(--plyr-range-track-height,5px)/ 2) * -1);padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:0 0}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:5px;min-width:var(--plyr-range-track-height,5px);-webkit-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:5px;min-width:var(--plyr-range-track-height,5px);-moz-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-ms-fill{border-radius:100px;-ms-transition:width .2s ease;transition:width .2s ease}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg,rgba(35,40,47,.6) 25%,transparent 25%,transparent 50%,rgba(35,40,47,.6) 50%,rgba(35,40,47,.6) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 25%,transparent 25%,transparent 50%,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 50%,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 75%,transparent 75%,transparent);background-repeat:repeat-x;background-size:25px 25px;background-size:var(--plyr-progress-loading-size,25px) var(--plyr-progress-loading-size,25px);color:transparent}.plyr--video.plyr--loading .plyr__progress__buffer{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-progress-buffered-background,rgba(255,255,255,.25))}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6))}.plyr__volume{align-items:center;display:flex;max-width:110px;min-width:80px;position:relative;width:20%}.plyr__volume input[type=range]{margin-left:calc(10px / 2);margin-left:calc(var(--plyr-control-spacing,10px)/ 2);margin-right:calc(10px / 2);margin-right:calc(var(--plyr-control-spacing,10px)/ 2);position:relative;z-index:2}.plyr--is-ios .plyr__volume{min-width:0;width:auto}.plyr--audio{display:block}.plyr--audio .plyr__controls{background:#fff;background:var(--plyr-audio-controls-background,#fff);border-radius:inherit;color:#4a5464;color:var(--plyr-audio-control-color,#4a5464);padding:10px;padding:var(--plyr-control-spacing,10px)}.plyr--audio .plyr__control.plyr__tab-focus,.plyr--audio .plyr__control:hover,.plyr--audio .plyr__control[aria-expanded=true]{background:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));background:var(--plyr-audio-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));color:#fff;color:var(--plyr-audio-control-color-hover,#fff)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--audio .plyr__progress__buffer{color:rgba(193,200,209,.6);color:var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6))}.plyr--video{background:#000;overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:#000;height:100%;margin:auto;overflow:hidden;position:relative;width:100%}.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0;padding-bottom:56.25%}.plyr__video-embed iframe,.plyr__video-wrapper--fixed-ratio video{border:0;left:0;position:absolute;top:0}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr--video .plyr__controls{background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.75));background:var(--plyr-video-controls-background,linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.75)));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:#fff;color:var(--plyr-video-control-color,#fff);left:0;padding:calc(10px / 2);padding:calc(var(--plyr-control-spacing,10px)/ 2);padding-top:calc(10px * 2);padding-top:calc(var(--plyr-control-spacing,10px) * 2);position:absolute;right:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out;z-index:3}@media (min-width:480px){.plyr--video .plyr__controls{padding:10px;padding:var(--plyr-control-spacing,10px);padding-top:calc(10px * 3.5);padding-top:calc(var(--plyr-control-spacing,10px) * 3.5)}}.plyr--video.plyr--hide-controls .plyr__controls{opacity:0;pointer-events:none;transform:translateY(100%)}.plyr--video .plyr__control.plyr__tab-focus,.plyr--video .plyr__control:hover,.plyr--video .plyr__control[aria-expanded=true]{background:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));color:#fff;color:var(--plyr-video-control-color-hover,#fff)}.plyr__control--overlaid{background:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));border:0;border-radius:100%;color:#fff;color:var(--plyr-video-control-color,#fff);display:none;left:50%;opacity:.9;padding:calc(10px * 1.5);padding:calc(var(--plyr-control-spacing,10px) * 1.5);position:absolute;top:50%;transform:translate(-50%,-50%);transition:.3s;z-index:2}.plyr__control--overlaid svg{left:2px;position:relative}.plyr__control--overlaid:focus,.plyr__control--overlaid:hover{opacity:1}.plyr--playing .plyr__control--overlaid{opacity:0;visibility:hidden}.plyr--full-ui.plyr--video .plyr__control--overlaid{display:block}.plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,rgba(255,255,255,.25)))}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,rgba(255,255,255,.25)))}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,rgba(255,255,255,.25)))}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(255,255,255,.5))}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(255,255,255,.5))}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(255,255,255,.5))}.plyr--video .plyr__progress__buffer{color:rgba(255,255,255,.25);color:var(--plyr-video-progress-buffered-background,rgba(255,255,255,.25))}.plyr:-webkit-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-ms-fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-webkit-full-screen video{height:100%}.plyr:-ms-fullscreen video{height:100%}.plyr:fullscreen video{height:100%}.plyr:-webkit-full-screen .plyr__video-wrapper{height:100%;position:static}.plyr:-ms-fullscreen .plyr__video-wrapper{height:100%;position:static}.plyr:fullscreen .plyr__video-wrapper{height:100%;position:static}.plyr:-webkit-full-screen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:-ms-fullscreen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:fullscreen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-webkit-full-screen.plyr--hide-controls{cursor:none}.plyr:-ms-fullscreen.plyr--hide-controls{cursor:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-webkit-full-screen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}.plyr:-ms-fullscreen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}.plyr:fullscreen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr:-webkit-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-webkit-full-screen video{height:100%}.plyr:-webkit-full-screen .plyr__video-wrapper{height:100%;position:static}.plyr:-webkit-full-screen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-webkit-full-screen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-webkit-full-screen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr:-moz-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-moz-full-screen video{height:100%}.plyr:-moz-full-screen .plyr__video-wrapper{height:100%;position:static}.plyr:-moz-full-screen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:-moz-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-moz-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-moz-full-screen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-moz-full-screen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr:-ms-fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-ms-fullscreen video{height:100%}.plyr:-ms-fullscreen .plyr__video-wrapper{height:100%;position:static}.plyr:-ms-fullscreen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-ms-fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-ms-fullscreen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr--fullscreen-fallback{background:#000;border-radius:0!important;height:100%;margin:0;width:100%;bottom:0;display:block;left:0;position:fixed;right:0;top:0;z-index:10000000}.plyr--fullscreen-fallback video{height:100%}.plyr--fullscreen-fallback .plyr__video-wrapper{height:100%;position:static}.plyr--fullscreen-fallback.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen{display:block}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr--fullscreen-fallback.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr--fullscreen-fallback .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr__ads{border-radius:inherit;bottom:0;cursor:pointer;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:-1}.plyr__ads>div,.plyr__ads>div iframe{height:100%;position:absolute;width:100%}.plyr__ads::after{background:#23282f;border-radius:2px;bottom:10px;bottom:var(--plyr-control-spacing,10px);color:#fff;content:attr(data-badge-text);font-size:11px;padding:2px 6px;pointer-events:none;position:absolute;right:10px;right:var(--plyr-control-spacing,10px);z-index:3}.plyr__ads::after:empty{display:none}.plyr__cues{background:currentColor;display:block;height:5px;height:var(--plyr-range-track-height,5px);left:0;margin:-var(--plyr-range-track-height,5px)/2 0 0;opacity:.8;position:absolute;top:50%;width:3px;z-index:3}.plyr__preview-thumb{background-color:rgba(255,255,255,.9);background-color:var(--plyr-tooltip-background,rgba(255,255,255,.9));border-radius:3px;bottom:100%;box-shadow:0 1px 2px rgba(0,0,0,.15);box-shadow:var(--plyr-tooltip-shadow,0 1px 2px rgba(0,0,0,.15));margin-bottom:calc(calc(10px / 2) * 2);margin-bottom:calc(calc(var(--plyr-control-spacing,10px)/ 2) * 2);opacity:0;padding:3px;padding:var(--plyr-tooltip-radius,3px);pointer-events:none;position:absolute;transform:translate(0,10px) scale(.8);transform-origin:50% 100%;transition:transform .2s .1s ease,opacity .2s .1s ease;z-index:2}.plyr__preview-thumb--is-shown{opacity:1;transform:translate(0,0) scale(1)}.plyr__preview-thumb::before{border-left:4px solid transparent;border-left:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-right:4px solid transparent;border-right:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-top:4px solid rgba(255,255,255,.9);border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,rgba(255,255,255,.9));bottom:calc(4px * -1);bottom:calc(var(--plyr-tooltip-arrow-size,4px) * -1);content:'';height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr__preview-thumb__image-container{background:#c1c8d1;border-radius:calc(3px - 1px);border-radius:calc(var(--plyr-tooltip-radius,3px) - 1px);overflow:hidden;position:relative;z-index:0}.plyr__preview-thumb__image-container img{height:100%;left:0;max-height:none;max-width:none;position:absolute;top:0;width:100%}.plyr__preview-thumb__time-container{bottom:6px;left:0;position:absolute;right:0;white-space:nowrap;z-index:3}.plyr__preview-thumb__time-container span{background-color:rgba(0,0,0,.55);border-radius:calc(3px - 1px);border-radius:calc(var(--plyr-tooltip-radius,3px) - 1px);color:#fff;font-size:11px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px));padding:3px 6px}.plyr__preview-scrubbing{bottom:0;filter:blur(1px);height:100%;left:0;margin:auto;opacity:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;transition:opacity .3s ease;width:100%;z-index:1}.plyr__preview-scrubbing--is-shown{opacity:1}.plyr__preview-scrubbing img{height:100%;left:0;max-height:none;max-width:none;object-fit:contain;position:absolute;top:0;width:100%}.plyr--no-transition{transition:none!important}.plyr__sr-only{clip:rect(1px,1px,1px,1px);overflow:hidden;border:0!important;height:1px!important;padding:0!important;position:absolute!important;width:1px!important}.plyr [hidden]{display:none!important}.no-border{border:0}[hidden]{display:none}.sr-only{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;opacity:.001;overflow:hidden;padding:0;position:absolute;width:1px} \ No newline at end of file +:root{--plyr-color-main:#00b3ff;--plyr-font-size-base:13px;--plyr-font-size-small:12px;--plyr-font-size-time:11px;--plyr-font-size-badges:9px;--plyr-font-size-menu:var(--plyr-font-size-base);--plyr-font-weight-regular:500;--plyr-font-weight-bold:600;--plyr-font-size-captions-medium:18px;--plyr-font-size-captions-large:21px}@font-face{font-display:swap;font-family:Gordita;font-style:normal;font-weight:300;src:url(https://cdn.plyr.io/static/fonts/gordita-light.woff2) format("woff2"),url(https://cdn.plyr.io/static/fonts/gordita-light.woff) format("woff")}@font-face{font-display:swap;font-family:Gordita;font-style:normal;font-weight:400;src:url(https://cdn.plyr.io/static/fonts/gordita-regular.woff2) format("woff2"),url(https://cdn.plyr.io/static/fonts/gordita-regular.woff) format("woff")}@font-face{font-display:swap;font-family:Gordita;font-style:normal;font-weight:500;src:url(https://cdn.plyr.io/static/fonts/gordita-medium.woff2) format("woff2"),url(https://cdn.plyr.io/static/fonts/gordita-medium.woff) format("woff")}@font-face{font-display:swap;font-family:Gordita;font-style:normal;font-weight:600;src:url(https://cdn.plyr.io/static/fonts/gordita-bold.woff2) format("woff2"),url(https://cdn.plyr.io/static/fonts/gordita-bold.woff) format("woff")}@font-face{font-display:swap;font-family:Gordita;font-style:normal;font-weight:900;src:url(https://cdn.plyr.io/static/fonts/gordita-black.woff2) format("woff2"),url(https://cdn.plyr.io/static/fonts/gordita-black.woff) format("woff")}@keyframes fadein{0%{opacity:0}100%{opacity:1}}@keyframes shrinkHide{0%{opacity:.5;width:38px}20%{width:45px}100%{opacity:0;width:0}}/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a,button.faux-link{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}*,::after,::before{box-sizing:border-box}body,html{display:flex;width:100%}html{background:linear-gradient(to left top,#e0f6ff,#f5fcff);background-attachment:fixed;height:100%}body{align-items:center;display:flex;flex-direction:column;min-height:100%}.grid{flex:1;overflow:auto}main{margin:auto;padding-bottom:1px;text-align:center}aside{align-items:center;background:#fff;display:flex;flex-shrink:0;justify-content:center;padding:16px;position:relative;text-align:center;text-shadow:none;width:100%}aside .icon{fill:#4baaf4;margin-right:8px}aside p{margin:0}aside a,aside button.faux-link{color:#4baaf4}aside a.tab-focus,aside button.tab-focus.faux-link{box-shadow:0 0 0 3px rgba(75,170,244,.35);outline:0}.grid{margin:0 auto;padding:16px}@media only screen and (min-width:768px){.grid{align-items:center;display:flex;max-width:1260px;width:100%}.grid>*{flex:1}}html{font-size:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:15px;font-size:.9375rem;color:#4a5764;font-family:Gordita,Avenir,"Helvetica Neue",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-weight:500;line-height:1.75}button,input,select,textarea{font:inherit}p,small{margin:0 0 24px}small{font-size:13px;font-size:.8125rem;display:block}h1{font-size:64px;font-size:4rem;color:#00b3ff;font-weight:600;letter-spacing:-.025em;line-height:1.2;margin:0 0 24px}.button,.button__count{align-items:center;border:0;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.1);display:inline-flex;padding:12px;position:relative;text-shadow:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle}.button{background:#00b3ff;color:#fff;font-weight:600;padding-left:20px;padding-right:20px;transition:all .2s ease}.button:focus,.button:hover{background:#1abaff}.button:focus::after,.button:hover::after{display:none}.button:hover{box-shadow:0 2px 2px rgba(0,0,0,.1)}.button:focus{outline:0}.button.tab-focus{box-shadow:0 0 0 3px rgba(255,255,255,.35);outline:0}.button:active{top:1px}.button--with-count{display:inline-flex}.button--with-count .button .icon{flex-shrink:0}.button__count{animation:fadein .2s ease;background:#fff;color:#5d6e7e;margin-left:12px}.button__count::before{border:5px solid transparent;border-left-width:0;border-right-color:#fff;content:'';height:0;position:absolute;right:100%;top:50%;transform:translateY(-50%);width:0}header{padding-bottom:16px;text-align:center}header h1 span{animation:shrinkHide 1s cubic-bezier(.175,.885,.32,1.275) 2s forwards;display:inline-block;font-weight:300;opacity:.5}header .call-to-action{margin-top:24px}@media only screen and (min-width:768px){header{margin-right:48px;max-width:360px;padding-bottom:32px;text-align:left}header p:first-of-type{font-size:16px;font-size:1rem}}.icon{fill:currentColor;height:16px;vertical-align:-3px;width:16px}a svg,button svg,button.faux-link svg,label svg{pointer-events:none}.btn .icon,a .icon,button.faux-link .icon{margin-right:8px}button.faux-link{background:0 0;border:0;border-radius:0;cursor:pointer;font:inherit;line-height:1.75;margin:0;padding:0;position:relative;text-align:inherit;text-shadow:inherit;-moz-user-select:text;vertical-align:baseline;width:auto}a,button.faux-link{border-bottom:1px dotted currentColor;color:#00b3ff;position:relative;text-decoration:none;transition:all .2s ease}a::after,button.faux-link::after{background:currentColor;content:'';height:1px;left:50%;position:absolute;top:100%;transform:translateX(-50%);transition:width .2s ease;width:0}a:focus,a:hover,button.faux-link:focus,button.faux-link:hover{border-bottom-color:transparent;outline:0}a:focus::after,a:hover::after,button.faux-link:focus::after,button.faux-link:hover::after{width:100%}a.tab-focus,button.tab-focus.faux-link{box-shadow:0 0 0 3px rgba(255,255,255,.35);outline:0}a.no-border::after,button.no-border.faux-link::after{display:none}li,ul{list-style:none;margin:0;padding:0}audio,img,video{max-width:100%;vertical-align:middle}nav{display:flex;justify-content:center;margin-bottom:16px}.plyr{border-radius:8px;box-shadow:0 2px 15px rgba(0,0,0,.1);margin:16px auto}.plyr.plyr--audio{max-width:480px}.plyr__video-wrapper::after{border:1px solid rgba(0,0,0,.15);border-radius:inherit;bottom:0;content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:3}.plyr__cite{color:#728597}.plyr__cite .icon{margin-right:3px}@keyframes plyr-progress{to{background-position:25px 0;background-position:var(--plyr-progress-loading-size,25px) 0}}@keyframes plyr-popup{0%{opacity:.5;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes plyr-fade-in{from{opacity:0}to{opacity:1}}.plyr{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;align-items:center;direction:ltr;display:flex;flex-direction:column;font-family:inherit;font-family:var(--plyr-font-family,inherit);font-variant-numeric:tabular-nums;font-weight:500;font-weight:var(--plyr-font-weight-regular,400);line-height:1.7;line-height:var(--plyr-line-height,1.7);max-width:100%;min-width:200px;position:relative;text-shadow:none;transition:box-shadow .3s ease;z-index:0}.plyr audio,.plyr iframe,.plyr video{display:block;height:100%;width:100%}.plyr button{font:inherit;line-height:inherit;width:auto}.plyr:focus{outline:0}.plyr--full-ui{box-sizing:border-box}.plyr--full-ui *,.plyr--full-ui ::after,.plyr--full-ui ::before{box-sizing:inherit}.plyr--full-ui a,.plyr--full-ui button,.plyr--full-ui button.faux-link,.plyr--full-ui input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:#4a5464;background:var(--plyr-badge-background,#4a5464);border-radius:2px;border-radius:var(--plyr-badge-border-radius,2px);color:#fff;color:var(--plyr-badge-text-color,#fff);font-size:9px;font-size:var(--plyr-font-size-badge,9px);line-height:1;padding:3px 4px}.plyr--full-ui ::-webkit-media-text-track-container{display:none}.plyr__captions{animation:plyr-fade-in .3s ease;bottom:0;display:none;font-size:12px;font-size:var(--plyr-font-size-small,13px);left:0;padding:10px;padding:var(--plyr-control-spacing,10px);position:absolute;text-align:center;transition:transform .4s ease-in-out;width:100%}.plyr__captions span:empty{display:none}@media (min-width:480px){.plyr__captions{font-size:13px;font-size:var(--plyr-font-size-base,15px);padding:calc(10px * 2);padding:calc(var(--plyr-control-spacing,10px) * 2)}}@media (min-width:768px){.plyr__captions{font-size:18px;font-size:var(--plyr-font-size-large,18px)}}.plyr--captions-active .plyr__captions{display:block}.plyr:not(.plyr--hide-controls) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(10px * -4));transform:translateY(calc(var(--plyr-control-spacing,10px) * -4))}.plyr__caption{background:rgba(0,0,0,.8);background:var(--plyr-captions-background,rgba(0,0,0,.8));border-radius:2px;-webkit-box-decoration-break:clone;box-decoration-break:clone;color:#fff;color:var(--plyr-captions-text-color,#fff);line-height:185%;padding:.2em .5em;white-space:pre-wrap}.plyr__caption div{display:inline}.plyr__control{background:0 0;border:0;border-radius:3px;border-radius:var(--plyr-control-radius,3px);color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:calc(10px * .7);padding:calc(var(--plyr-control-spacing,10px) * .7);position:relative;transition:all .3s ease}.plyr__control svg{display:block;fill:currentColor;height:18px;height:var(--plyr-control-icon-size,18px);pointer-events:none;width:18px;width:var(--plyr-control-icon-size,18px)}.plyr__control:focus{outline:0}.plyr__control.plyr__tab-focus{outline-color:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));outline-color:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));outline-offset:2px;outline-style:dotted;outline-width:3px}a.plyr__control,button.plyr__control.faux-link{text-decoration:none}a.plyr__control::after,a.plyr__control::before,button.plyr__control.faux-link::after,button.plyr__control.faux-link::before{display:none}.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control.plyr__control--pressed .label--not-pressed,.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed{display:none}.plyr--full-ui ::-webkit-media-controls{display:none}.plyr__controls{align-items:center;display:flex;justify-content:flex-end;text-align:center}.plyr__controls .plyr__progress__container{flex:1;min-width:0}.plyr__controls .plyr__controls__item{margin-left:calc(10px / 4);margin-left:calc(var(--plyr-control-spacing,10px)/ 4)}.plyr__controls .plyr__controls__item:first-child{margin-left:0;margin-right:auto}.plyr__controls .plyr__controls__item.plyr__progress__container{padding-left:calc(10px / 4);padding-left:calc(var(--plyr-control-spacing,10px)/ 4)}.plyr__controls .plyr__controls__item.plyr__time{padding:0 calc(10px / 2);padding:0 calc(var(--plyr-control-spacing,10px)/ 2)}.plyr__controls .plyr__controls__item.plyr__progress__container:first-child,.plyr__controls .plyr__controls__item.plyr__time+.plyr__time,.plyr__controls .plyr__controls__item.plyr__time:first-child{padding-left:0}.plyr__controls:empty{display:none}.plyr [data-plyr=airplay],.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr [data-plyr=pip]{display:none}.plyr--airplay-supported [data-plyr=airplay],.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen],.plyr--pip-supported [data-plyr=pip]{display:inline-block}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform .3s ease}.plyr__menu .plyr__control[aria-expanded=true] svg{transform:rotate(90deg)}.plyr__menu .plyr__control[aria-expanded=true] .plyr__tooltip{display:none}.plyr__menu__container{animation:plyr-popup .2s ease;background:rgba(255,255,255,.9);background:var(--plyr-menu-background,rgba(255,255,255,.9));border-radius:4px;bottom:100%;box-shadow:0 1px 2px rgba(0,0,0,.15);box-shadow:var(--plyr-menu-shadow,0 1px 2px rgba(0,0,0,.15));color:#4a5464;color:var(--plyr-menu-color,#4a5464);font-size:13px;font-size:var(--plyr-font-size-base,15px);margin-bottom:10px;position:absolute;right:-3px;text-align:left;white-space:nowrap;z-index:3}.plyr__menu__container>div{overflow:hidden;transition:height .35s cubic-bezier(.4,0,.2,1),width .35s cubic-bezier(.4,0,.2,1)}.plyr__menu__container::after{border:4px solid transparent;border:var(--plyr-menu-arrow-size,4px) solid transparent;border-top-color:rgba(255,255,255,.9);border-top-color:var(--plyr-menu-background,rgba(255,255,255,.9));content:'';height:0;position:absolute;right:calc(((18px / 2) + calc(10px * .7)) - (4px / 2));right:calc(((var(--plyr-control-icon-size,18px)/ 2) + calc(var(--plyr-control-spacing,10px) * .7)) - (var(--plyr-menu-arrow-size,4px)/ 2));top:100%;width:0}.plyr__menu__container [role=menu]{padding:calc(10px * .7);padding:calc(var(--plyr-control-spacing,10px) * .7)}.plyr__menu__container [role=menuitem],.plyr__menu__container [role=menuitemradio]{margin-top:2px}.plyr__menu__container [role=menuitem]:first-child,.plyr__menu__container [role=menuitemradio]:first-child{margin-top:0}.plyr__menu__container .plyr__control{align-items:center;color:#4a5464;color:var(--plyr-menu-color,#4a5464);display:flex;font-size:13px;font-size:var(--plyr-font-size-menu,var(--plyr-font-size-small,13px));padding-bottom:calc(calc(10px * .7)/ 1.5);padding-bottom:calc(calc(var(--plyr-control-spacing,10px) * .7)/ 1.5);padding-left:calc(calc(10px * .7) * 1.5);padding-left:calc(calc(var(--plyr-control-spacing,10px) * .7) * 1.5);padding-right:calc(calc(10px * .7) * 1.5);padding-right:calc(calc(var(--plyr-control-spacing,10px) * .7) * 1.5);padding-top:calc(calc(10px * .7)/ 1.5);padding-top:calc(calc(var(--plyr-control-spacing,10px) * .7)/ 1.5);-webkit-user-select:none;-ms-user-select:none;user-select:none;width:100%}.plyr__menu__container .plyr__control>span{align-items:inherit;display:flex;width:100%}.plyr__menu__container .plyr__control::after{border:4px solid transparent;border:var(--plyr-menu-item-arrow-size,4px) solid transparent;content:'';position:absolute;top:50%;transform:translateY(-50%)}.plyr__menu__container .plyr__control--forward{padding-right:calc(calc(10px * .7) * 4);padding-right:calc(calc(var(--plyr-control-spacing,10px) * .7) * 4)}.plyr__menu__container .plyr__control--forward::after{border-left-color:#728197;border-left-color:var(--plyr-menu-arrow-color,#728197);right:calc((calc(10px * .7) * 1.5) - 4px);right:calc((calc(var(--plyr-control-spacing,10px) * .7) * 1.5) - var(--plyr-menu-item-arrow-size,4px))}.plyr__menu__container .plyr__control--forward.plyr__tab-focus::after,.plyr__menu__container .plyr__control--forward:hover::after{border-left-color:currentColor}.plyr__menu__container .plyr__control--back{font-weight:500;font-weight:var(--plyr-font-weight-regular,400);margin:calc(10px * .7);margin:calc(var(--plyr-control-spacing,10px) * .7);margin-bottom:calc(calc(10px * .7)/ 2);margin-bottom:calc(calc(var(--plyr-control-spacing,10px) * .7)/ 2);padding-left:calc(calc(10px * .7) * 4);padding-left:calc(calc(var(--plyr-control-spacing,10px) * .7) * 4);position:relative;width:calc(100% - (calc(10px * .7) * 2));width:calc(100% - (calc(var(--plyr-control-spacing,10px) * .7) * 2))}.plyr__menu__container .plyr__control--back::after{border-right-color:#728197;border-right-color:var(--plyr-menu-arrow-color,#728197);left:calc((calc(10px * .7) * 1.5) - 4px);left:calc((calc(var(--plyr-control-spacing,10px) * .7) * 1.5) - var(--plyr-menu-item-arrow-size,4px))}.plyr__menu__container .plyr__control--back::before{background:#dcdfe5;background:var(--plyr-menu-back-border-color,#dcdfe5);box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 var(--plyr-menu-back-border-shadow-color,#fff);content:'';height:1px;left:0;margin-top:calc(calc(10px * .7)/ 2);margin-top:calc(calc(var(--plyr-control-spacing,10px) * .7)/ 2);overflow:hidden;position:absolute;right:0;top:100%}.plyr__menu__container .plyr__control--back.plyr__tab-focus::after,.plyr__menu__container .plyr__control--back:hover::after{border-right-color:currentColor}.plyr__menu__container .plyr__control[role=menuitemradio]{padding-left:calc(10px * .7);padding-left:calc(var(--plyr-control-spacing,10px) * .7)}.plyr__menu__container .plyr__control[role=menuitemradio]::after,.plyr__menu__container .plyr__control[role=menuitemradio]::before{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]::before{background:rgba(0,0,0,.1);content:'';display:block;flex-shrink:0;height:16px;margin-right:10px;margin-right:var(--plyr-control-spacing,10px);transition:all .3s ease;width:16px}.plyr__menu__container .plyr__control[role=menuitemradio]::after{background:#fff;border:0;height:6px;left:12px;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform .3s ease,opacity .3s ease;width:6px}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before{background:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));background:var(--plyr-control-toggle-checked-background,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)))}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::after{opacity:1;transform:translateY(-50%) scale(1)}.plyr__menu__container .plyr__control[role=menuitemradio].plyr__tab-focus::before,.plyr__menu__container .plyr__control[role=menuitemradio]:hover::before{background:rgba(35,40,47,.1)}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:calc((calc(10px * .7) - 2) * -1);margin-right:calc((calc(var(--plyr-control-spacing,10px) * .7) - 2) * -1);overflow:hidden;padding-left:calc(calc(10px * .7) * 3.5);padding-left:calc(calc(var(--plyr-control-spacing,10px) * .7) * 3.5);pointer-events:none}.plyr--full-ui input[type=range]{-webkit-appearance:none;background:0 0;border:0;border-radius:calc(13px * 2);border-radius:calc(var(--plyr-range-thumb-height,13px) * 2);color:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));color:var(--plyr-range-fill-background,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));display:block;height:calc((3px * 2) + 13px);height:calc((var(--plyr-range-thumb-active-shadow-width,3px) * 2) + var(--plyr-range-thumb-height,13px));margin:0;min-width:0;padding:0;transition:box-shadow .3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:0 0;border:0;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px);-webkit-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-webkit-user-select:none;user-select:none;background-image:linear-gradient(to right,currentColor 0,transparent 0);background-image:linear-gradient(to right,currentColor var(--value,0),transparent var(--value,0))}.plyr--full-ui input[type=range]::-webkit-slider-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2));height:13px;height:var(--plyr-range-thumb-height,13px);position:relative;-webkit-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px);-webkit-appearance:none;margin-top:calc(((13px - 5px)/ 2) * -1);margin-top:calc(((var(--plyr-range-thumb-height,13px) - var(--plyr-range-track-height,5px))/ 2) * -1)}.plyr--full-ui input[type=range]::-moz-range-track{background:0 0;border:0;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px);-moz-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2));height:13px;height:var(--plyr-range-thumb-height,13px);position:relative;-moz-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px)}.plyr--full-ui input[type=range]::-ms-track{background:0 0;border:0;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-ms-user-select:none;user-select:none;color:transparent}.plyr--full-ui input[type=range]::-ms-fill-upper{background:0 0;border:0;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-ms-user-select:none;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:0 0;border:0;border-radius:calc(5px / 2);border-radius:calc(var(--plyr-range-track-height,5px)/ 2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-ms-user-select:none;user-select:none;background:currentColor}.plyr--full-ui input[type=range]::-ms-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2));height:13px;height:var(--plyr-range-thumb-height,13px);position:relative;-ms-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px);margin-top:0}.plyr--full-ui input[type=range]::-ms-tooltip{display:none}.plyr--full-ui input[type=range]:focus{outline:0}.plyr--full-ui input[type=range]::-moz-focus-outer{border:0}.plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track{outline-color:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));outline-color:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));outline-offset:2px;outline-style:dotted;outline-width:3px}.plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track{outline-color:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));outline-color:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));outline-offset:2px;outline-style:dotted;outline-width:3px}.plyr--full-ui input[type=range].plyr__tab-focus::-ms-track{outline-color:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));outline-color:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));outline-offset:2px;outline-style:dotted;outline-width:3px}.plyr__poster{background-color:#000;background-color:var(--plyr-video-background,var(--plyr-video-background,#000));background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr__time{font-size:11px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__time+.plyr__time::before{content:'\2044';margin-right:10px;margin-right:var(--plyr-control-spacing,10px)}@media (max-width:767px){.plyr__time+.plyr__time{display:none}}.plyr__tooltip{background:rgba(255,255,255,.9);background:var(--plyr-tooltip-background,rgba(255,255,255,.9));border-radius:3px;border-radius:var(--plyr-tooltip-radius,3px);bottom:100%;box-shadow:0 1px 2px rgba(0,0,0,.15);box-shadow:var(--plyr-tooltip-shadow,0 1px 2px rgba(0,0,0,.15));color:#4a5464;color:var(--plyr-tooltip-color,#4a5464);font-size:12px;font-size:var(--plyr-font-size-small,13px);font-weight:500;font-weight:var(--plyr-font-weight-regular,400);left:50%;line-height:1.3;margin-bottom:calc(calc(10px / 2) * 2);margin-bottom:calc(calc(var(--plyr-control-spacing,10px)/ 2) * 2);opacity:0;padding:calc(10px / 2) calc(calc(10px / 2) * 1.5);padding:calc(var(--plyr-control-spacing,10px)/ 2) calc(calc(var(--plyr-control-spacing,10px)/ 2) * 1.5);pointer-events:none;position:absolute;transform:translate(-50%,10px) scale(.8);transform-origin:50% 100%;transition:transform .2s .1s ease,opacity .2s .1s ease;white-space:nowrap;z-index:2}.plyr__tooltip::before{border-left:4px solid transparent;border-left:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-right:4px solid transparent;border-right:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-top:4px solid rgba(255,255,255,.9);border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,rgba(255,255,255,.9));bottom:calc(4px * -1);bottom:calc(var(--plyr-tooltip-arrow-size,4px) * -1);content:'';height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr .plyr__control.plyr__tab-focus .plyr__tooltip,.plyr .plyr__control:hover .plyr__tooltip,.plyr__tooltip--visible{opacity:1;transform:translate(-50%,0) scale(1)}.plyr .plyr__control:hover .plyr__tooltip{z-index:3}.plyr__controls>.plyr__control:first-child .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip{left:0;transform:translate(0,10px) scale(.8);transform-origin:0 100%}.plyr__controls>.plyr__control:first-child .plyr__tooltip::before,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip::before{left:calc((18px / 2) + calc(10px * .7));left:calc((var(--plyr-control-icon-size,18px)/ 2) + calc(var(--plyr-control-spacing,10px) * .7))}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translate(0,10px) scale(.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip::before{left:auto;right:calc((18px / 2) + calc(10px * .7));right:calc((var(--plyr-control-icon-size,18px)/ 2) + calc(var(--plyr-control-spacing,10px) * .7));transform:translateX(50%)}.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip{transform:translate(0,0) scale(1)}.plyr__progress{left:calc(13px * .5);left:calc(var(--plyr-range-thumb-height,13px) * .5);margin-right:13px;margin-right:var(--plyr-range-thumb-height,13px);position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:calc(13px * -.5);margin-left:calc(var(--plyr-range-thumb-height,13px) * -.5);margin-right:calc(13px * -.5);margin-right:calc(var(--plyr-range-thumb-height,13px) * -.5);width:calc(100% + 13px);width:calc(100% + var(--plyr-range-thumb-height,13px))}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress .plyr__tooltip{font-size:11px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px));left:0}.plyr__progress__buffer{-webkit-appearance:none;background:0 0;border:0;border-radius:100px;height:5px;height:var(--plyr-range-track-height,5px);left:0;margin-top:calc((5px / 2) * -1);margin-top:calc((var(--plyr-range-track-height,5px)/ 2) * -1);padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:0 0}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:5px;min-width:var(--plyr-range-track-height,5px);-webkit-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:5px;min-width:var(--plyr-range-track-height,5px);-moz-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-ms-fill{border-radius:100px;-ms-transition:width .2s ease;transition:width .2s ease}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg,rgba(35,40,47,.6) 25%,transparent 25%,transparent 50%,rgba(35,40,47,.6) 50%,rgba(35,40,47,.6) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 25%,transparent 25%,transparent 50%,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 50%,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 75%,transparent 75%,transparent);background-repeat:repeat-x;background-size:25px 25px;background-size:var(--plyr-progress-loading-size,25px) var(--plyr-progress-loading-size,25px);color:transparent}.plyr--video.plyr--loading .plyr__progress__buffer{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-progress-buffered-background,rgba(255,255,255,.25))}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6))}.plyr__volume{align-items:center;display:flex;max-width:110px;min-width:80px;position:relative;width:20%}.plyr__volume input[type=range]{margin-left:calc(10px / 2);margin-left:calc(var(--plyr-control-spacing,10px)/ 2);margin-right:calc(10px / 2);margin-right:calc(var(--plyr-control-spacing,10px)/ 2);position:relative;z-index:2}.plyr--is-ios .plyr__volume{min-width:0;width:auto}.plyr--audio{display:block}.plyr--audio .plyr__controls{background:#fff;background:var(--plyr-audio-controls-background,#fff);border-radius:inherit;color:#4a5464;color:var(--plyr-audio-control-color,#4a5464);padding:10px;padding:var(--plyr-control-spacing,10px)}.plyr--audio .plyr__control.plyr__tab-focus,.plyr--audio .plyr__control:hover,.plyr--audio .plyr__control[aria-expanded=true]{background:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));background:var(--plyr-audio-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));color:#fff;color:var(--plyr-audio-control-color-hover,#fff)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--audio .plyr__progress__buffer{color:rgba(193,200,209,.6);color:var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6))}.plyr--video{background:#000;background:var(--plyr-video-background,var(--plyr-video-background,#000));overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:#000;background:var(--plyr-video-background,var(--plyr-video-background,#000));height:100%;margin:auto;overflow:hidden;position:relative;width:100%}.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0;padding-bottom:56.25%}.plyr__video-embed iframe,.plyr__video-wrapper--fixed-ratio video{border:0;left:0;position:absolute;top:0}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr--video .plyr__controls{background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.75));background:var(--plyr-video-controls-background,linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.75)));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:#fff;color:var(--plyr-video-control-color,#fff);left:0;padding:calc(10px / 2);padding:calc(var(--plyr-control-spacing,10px)/ 2);padding-top:calc(10px * 2);padding-top:calc(var(--plyr-control-spacing,10px) * 2);position:absolute;right:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out;z-index:3}@media (min-width:480px){.plyr--video .plyr__controls{padding:10px;padding:var(--plyr-control-spacing,10px);padding-top:calc(10px * 3.5);padding-top:calc(var(--plyr-control-spacing,10px) * 3.5)}}.plyr--video.plyr--hide-controls .plyr__controls{opacity:0;pointer-events:none;transform:translateY(100%)}.plyr--video .plyr__control.plyr__tab-focus,.plyr--video .plyr__control:hover,.plyr--video .plyr__control[aria-expanded=true]{background:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));color:#fff;color:var(--plyr-video-control-color-hover,#fff)}.plyr__control--overlaid{background:var(--plyr-color-main,var(--plyr-color-main,#00b3ff));background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b3ff)));border:0;border-radius:100%;color:#fff;color:var(--plyr-video-control-color,#fff);display:none;left:50%;opacity:.9;padding:calc(10px * 1.5);padding:calc(var(--plyr-control-spacing,10px) * 1.5);position:absolute;top:50%;transform:translate(-50%,-50%);transition:.3s;z-index:2}.plyr__control--overlaid svg{left:2px;position:relative}.plyr__control--overlaid:focus,.plyr__control--overlaid:hover{opacity:1}.plyr--playing .plyr__control--overlaid{opacity:0;visibility:hidden}.plyr--full-ui.plyr--video .plyr__control--overlaid{display:block}.plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,rgba(255,255,255,.25)))}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,rgba(255,255,255,.25)))}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,rgba(255,255,255,.25)))}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(255,255,255,.5))}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(255,255,255,.5))}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2),0 0 0 3px rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(255,255,255,.5))}.plyr--video .plyr__progress__buffer{color:rgba(255,255,255,.25);color:var(--plyr-video-progress-buffered-background,rgba(255,255,255,.25))}.plyr:-webkit-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-ms-fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-webkit-full-screen video{height:100%}.plyr:-ms-fullscreen video{height:100%}.plyr:fullscreen video{height:100%}.plyr:-webkit-full-screen .plyr__video-wrapper{height:100%;position:static}.plyr:-ms-fullscreen .plyr__video-wrapper{height:100%;position:static}.plyr:fullscreen .plyr__video-wrapper{height:100%;position:static}.plyr:-webkit-full-screen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:-ms-fullscreen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:fullscreen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-webkit-full-screen.plyr--hide-controls{cursor:none}.plyr:-ms-fullscreen.plyr--hide-controls{cursor:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-webkit-full-screen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}.plyr:-ms-fullscreen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}.plyr:fullscreen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr:-webkit-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-webkit-full-screen video{height:100%}.plyr:-webkit-full-screen .plyr__video-wrapper{height:100%;position:static}.plyr:-webkit-full-screen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-webkit-full-screen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-webkit-full-screen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr:-moz-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-moz-full-screen video{height:100%}.plyr:-moz-full-screen .plyr__video-wrapper{height:100%;position:static}.plyr:-moz-full-screen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:-moz-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-moz-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-moz-full-screen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-moz-full-screen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr:-ms-fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-ms-fullscreen video{height:100%}.plyr:-ms-fullscreen .plyr__video-wrapper{height:100%;position:static}.plyr:-ms-fullscreen.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-ms-fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-ms-fullscreen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr--fullscreen-fallback{background:#000;border-radius:0!important;height:100%;margin:0;width:100%;bottom:0;display:block;left:0;position:fixed;right:0;top:0;z-index:10000000}.plyr--fullscreen-fallback video{height:100%}.plyr--fullscreen-fallback .plyr__video-wrapper{height:100%;position:static}.plyr--fullscreen-fallback.plyr--vimeo .plyr__video-wrapper{height:0;position:relative}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen{display:block}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr--fullscreen-fallback.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr--fullscreen-fallback .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr__ads{border-radius:inherit;bottom:0;cursor:pointer;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:-1}.plyr__ads>div,.plyr__ads>div iframe{height:100%;position:absolute;width:100%}.plyr__ads::after{background:#23282f;border-radius:2px;bottom:10px;bottom:var(--plyr-control-spacing,10px);color:#fff;content:attr(data-badge-text);font-size:11px;padding:2px 6px;pointer-events:none;position:absolute;right:10px;right:var(--plyr-control-spacing,10px);z-index:3}.plyr__ads::after:empty{display:none}.plyr__cues{background:currentColor;display:block;height:5px;height:var(--plyr-range-track-height,5px);left:0;margin:-var(--plyr-range-track-height,5px)/2 0 0;opacity:.8;position:absolute;top:50%;width:3px;z-index:3}.plyr__preview-thumb{background-color:rgba(255,255,255,.9);background-color:var(--plyr-tooltip-background,rgba(255,255,255,.9));border-radius:3px;bottom:100%;box-shadow:0 1px 2px rgba(0,0,0,.15);box-shadow:var(--plyr-tooltip-shadow,0 1px 2px rgba(0,0,0,.15));margin-bottom:calc(calc(10px / 2) * 2);margin-bottom:calc(calc(var(--plyr-control-spacing,10px)/ 2) * 2);opacity:0;padding:3px;padding:var(--plyr-tooltip-radius,3px);pointer-events:none;position:absolute;transform:translate(0,10px) scale(.8);transform-origin:50% 100%;transition:transform .2s .1s ease,opacity .2s .1s ease;z-index:2}.plyr__preview-thumb--is-shown{opacity:1;transform:translate(0,0) scale(1)}.plyr__preview-thumb::before{border-left:4px solid transparent;border-left:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-right:4px solid transparent;border-right:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-top:4px solid rgba(255,255,255,.9);border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,rgba(255,255,255,.9));bottom:calc(4px * -1);bottom:calc(var(--plyr-tooltip-arrow-size,4px) * -1);content:'';height:0;left:50%;position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr__preview-thumb__image-container{background:#c1c8d1;border-radius:calc(3px - 1px);border-radius:calc(var(--plyr-tooltip-radius,3px) - 1px);overflow:hidden;position:relative;z-index:0}.plyr__preview-thumb__image-container img{height:100%;left:0;max-height:none;max-width:none;position:absolute;top:0;width:100%}.plyr__preview-thumb__time-container{bottom:6px;left:0;position:absolute;right:0;white-space:nowrap;z-index:3}.plyr__preview-thumb__time-container span{background-color:rgba(0,0,0,.55);border-radius:calc(3px - 1px);border-radius:calc(var(--plyr-tooltip-radius,3px) - 1px);color:#fff;font-size:11px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px));padding:3px 6px}.plyr__preview-scrubbing{bottom:0;filter:blur(1px);height:100%;left:0;margin:auto;opacity:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;transition:opacity .3s ease;width:100%;z-index:1}.plyr__preview-scrubbing--is-shown{opacity:1}.plyr__preview-scrubbing img{height:100%;left:0;max-height:none;max-width:none;object-fit:contain;position:absolute;top:0;width:100%}.plyr--no-transition{transition:none!important}.plyr__sr-only{clip:rect(1px,1px,1px,1px);overflow:hidden;border:0!important;height:1px!important;padding:0!important;position:absolute!important;width:1px!important}.plyr [hidden]{display:none!important}.no-border{border:0}[hidden]{display:none}.sr-only{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;opacity:.001;overflow:hidden;padding:0;position:absolute;width:1px} \ No newline at end of file diff --git a/demo/dist/demo.js b/demo/dist/demo.js index 6cea2552..ba30d1bc 100644 --- a/demo/dist/demo.js +++ b/demo/dist/demo.js @@ -16298,6 +16298,46 @@ typeof navigator === "object" && (function () { redefine$1(Object.prototype, 'toString', objectToString$1, { unsafe: true }); } + var propertyIsEnumerable$1 = objectPropertyIsEnumerable$1.f; + + // `Object.{ entries, values }` methods implementation + var createMethod$9 = function (TO_ENTRIES) { + return function (it) { + var O = toIndexedObject$1(it); + var keys = objectKeys$1(O); + var length = keys.length; + var i = 0; + var result = []; + var key; + while (length > i) { + key = keys[i++]; + if (!descriptors$1 || propertyIsEnumerable$1.call(O, key)) { + result.push(TO_ENTRIES ? [key, O[key]] : O[key]); + } + } + return result; + }; + }; + + var objectToArray$1 = { + // `Object.entries` method + // https://tc39.github.io/ecma262/#sec-object.entries + entries: createMethod$9(true), + // `Object.values` method + // https://tc39.github.io/ecma262/#sec-object.values + values: createMethod$9(false) + }; + + var $values = objectToArray$1.values; + + // `Object.values` method + // https://tc39.github.io/ecma262/#sec-object.values + _export$1({ target: 'Object', stat: true }, { + values: function values(O) { + return $values(O); + } + }); + // `RegExp.prototype.flags` getter implementation // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags var regexpFlags$1 = function () { @@ -16484,7 +16524,7 @@ typeof navigator === "object" && (function () { }); // `String.prototype.{ codePointAt, at }` methods implementation - var createMethod$9 = function (CONVERT_TO_STRING) { + var createMethod$a = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = String(requireObjectCoercible$1($this)); var position = toInteger$1(pos); @@ -16502,10 +16542,10 @@ typeof navigator === "object" && (function () { var stringMultibyte$1 = { // `String.prototype.codePointAt` method // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat - codeAt: createMethod$9(false), + codeAt: createMethod$a(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at - charAt: createMethod$9(true) + charAt: createMethod$a(true) }; var charAt$2 = stringMultibyte$1.charAt; @@ -19179,36 +19219,6 @@ typeof navigator === "object" && (function () { } }); - var propertyIsEnumerable$1 = objectPropertyIsEnumerable$1.f; - - // `Object.{ entries, values }` methods implementation - var createMethod$a = function (TO_ENTRIES) { - return function (it) { - var O = toIndexedObject$1(it); - var keys = objectKeys$1(O); - var length = keys.length; - var i = 0; - var result = []; - var key; - while (length > i) { - key = keys[i++]; - if (!descriptors$1 || propertyIsEnumerable$1.call(O, key)) { - result.push(TO_ENTRIES ? [key, O[key]] : O[key]); - } - } - return result; - }; - }; - - var objectToArray$1 = { - // `Object.entries` method - // https://tc39.github.io/ecma262/#sec-object.entries - entries: createMethod$a(true), - // `Object.values` method - // https://tc39.github.io/ecma262/#sec-object.values - values: createMethod$a(false) - }; - var $entries$1 = objectToArray$1.entries; // `Object.entries` method @@ -19219,16 +19229,6 @@ typeof navigator === "object" && (function () { } }); - var $values = objectToArray$1.values; - - // `Object.values` method - // https://tc39.github.io/ecma262/#sec-object.values - _export$1({ target: 'Object', stat: true }, { - values: function values(O) { - return $values(O); - } - }); - var max$5 = Math.max; var min$a = Math.min; var floor$a = Math.floor; @@ -20651,10 +20651,6 @@ typeof navigator === "object" && (function () { return instanceOf$2(input, NodeList); }; - var isElement$3 = function isElement(input) { - return instanceOf$2(input, Element); - }; - var isTextNode = function isTextNode(input) { return getConstructor$2(input) === Text; }; @@ -20679,6 +20675,10 @@ typeof navigator === "object" && (function () { return instanceOf$2(input, Promise) && isFunction$2(input.then); }; + var isElement$3 = function isElement(input) { + return input !== null && _typeof(input) === 'object' && input.nodeType === 1 && _typeof(input.style) === 'object' && _typeof(input.ownerDocument) === 'object'; + }; + var isEmpty$2 = function isEmpty(input) { return isNullOrUndefined$2(input) || (isString$3(input) || isArray$4(input) || isNodeList$2(input)) && !input.length || isObject$4(input) && !Object.keys(input).length; }; @@ -21859,21 +21859,16 @@ typeof navigator === "object" && (function () { var Storage$1 = /*#__PURE__*/function () { function Storage(player) { + var _this = this; + _classCallCheck(this, Storage); - this.enabled = player.config.storage.enabled; - this.key = player.config.storage.key; - } // Check for actual support (see if we can use it) - - - _createClass(Storage, [{ - key: "get", - value: function get(key) { - if (!Storage.supported || !this.enabled) { + _defineProperty(this, "get", function (key) { + if (!Storage.supported || !_this.enabled) { return null; } - var store = window.localStorage.getItem(this.key); + var store = window.localStorage.getItem(_this.key); if (is$2.empty(store)) { return null; @@ -21881,12 +21876,11 @@ typeof navigator === "object" && (function () { var json = JSON.parse(store); return is$2.string(key) && key.length ? json[key] : json; - } - }, { - key: "set", - value: function set(object) { + }); + + _defineProperty(this, "set", function (object) { // Bail if we don't have localStorage support or it's disabled - if (!Storage.supported || !this.enabled) { + if (!Storage.supported || !_this.enabled) { return; } // Can only store objectst @@ -21896,7 +21890,8 @@ typeof navigator === "object" && (function () { } // Get current storage - var storage = this.get(); // Default to empty object + var storage = _this.get(); // Default to empty object + if (is$2.empty(storage)) { storage = {}; @@ -21905,9 +21900,15 @@ typeof navigator === "object" && (function () { extend$1(storage, object); // Update storage - window.localStorage.setItem(this.key, JSON.stringify(storage)); - } - }], [{ + window.localStorage.setItem(_this.key, JSON.stringify(storage)); + }); + + this.enabled = player.config.storage.enabled; + this.key = player.config.storage.key; + } // Check for actual support (see if we can use it) + + + _createClass(Storage, null, [{ key: "supported", get: function get() { try { @@ -24040,7 +24041,7 @@ typeof navigator === "object" && (function () { // Sprite (for icons) loadSprite: true, iconPrefix: 'plyr', - iconUrl: 'https://cdn.plyr.io/3.6.3/plyr.svg', + iconUrl: 'https://cdn.plyr.io/3.6.4/plyr.svg', // Blank video (used to prevent errors on source change) blankVideo: 'https://cdn.plyr.io/static/blank.mp4', // Quality default @@ -24439,6 +24440,169 @@ typeof navigator === "object" && (function () { _classCallCheck(this, Fullscreen); + _defineProperty(this, "onChange", function () { + if (!_this.enabled) { + return; + } // Update toggle button + + + var button = _this.player.elements.buttons.fullscreen; + + if (is$2.element(button)) { + button.pressed = _this.active; + } // Always trigger events on the plyr / media element (not a fullscreen container) and let them bubble up + + + var target = _this.target === _this.player.media ? _this.target : _this.player.elements.container; // Trigger an event + + triggerEvent.call(_this.player, target, _this.active ? 'enterfullscreen' : 'exitfullscreen', true); + }); + + _defineProperty(this, "toggleFallback", function () { + var toggle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + // Store or restore scroll position + if (toggle) { + _this.scrollPosition = { + x: window.scrollX || 0, + y: window.scrollY || 0 + }; + } else { + window.scrollTo(_this.scrollPosition.x, _this.scrollPosition.y); + } // Toggle scroll + + + document.body.style.overflow = toggle ? 'hidden' : ''; // Toggle class hook + + toggleClass(_this.target, _this.player.config.classNames.fullscreen.fallback, toggle); // Force full viewport on iPhone X+ + + if (browser.isIos) { + var viewport = document.head.querySelector('meta[name="viewport"]'); + var property = 'viewport-fit=cover'; // Inject the viewport meta if required + + if (!viewport) { + viewport = document.createElement('meta'); + viewport.setAttribute('name', 'viewport'); + } // Check if the property already exists + + + var hasProperty = is$2.string(viewport.content) && viewport.content.includes(property); + + if (toggle) { + _this.cleanupViewport = !hasProperty; + + if (!hasProperty) { + viewport.content += ",".concat(property); + } + } else if (_this.cleanupViewport) { + viewport.content = viewport.content.split(',').filter(function (part) { + return part.trim() !== property; + }).join(','); + } + } // Toggle button and fire events + + + _this.onChange(); + }); + + _defineProperty(this, "trapFocus", function (event) { + // Bail if iOS, not active, not the tab key + if (browser.isIos || !_this.active || event.key !== 'Tab' || event.keyCode !== 9) { + return; + } // Get the current focused element + + + var focused = document.activeElement; + var focusable = getElements.call(_this.player, 'a[href], button:not(:disabled), input:not(:disabled), [tabindex]'); + + var _focusable = _slicedToArray(focusable, 1), + first = _focusable[0]; + + var last = focusable[focusable.length - 1]; + + if (focused === last && !event.shiftKey) { + // Move focus to first element that can be tabbed if Shift isn't used + first.focus(); + event.preventDefault(); + } else if (focused === first && event.shiftKey) { + // Move focus to last element that can be tabbed if Shift is used + last.focus(); + event.preventDefault(); + } + }); + + _defineProperty(this, "update", function () { + if (_this.enabled) { + var mode; + + if (_this.forceFallback) { + mode = 'Fallback (forced)'; + } else if (Fullscreen.native) { + mode = 'Native'; + } else { + mode = 'Fallback'; + } + + _this.player.debug.log("".concat(mode, " fullscreen enabled")); + } else { + _this.player.debug.log('Fullscreen not supported and fallback disabled'); + } // Add styling hook to show button + + + toggleClass(_this.player.elements.container, _this.player.config.classNames.fullscreen.enabled, _this.enabled); + }); + + _defineProperty(this, "enter", function () { + if (!_this.enabled) { + return; + } // iOS native fullscreen doesn't need the request step + + + if (browser.isIos && _this.player.config.fullscreen.iosNative) { + if (_this.player.isVimeo) { + _this.player.embed.requestFullscreen(); + } else { + _this.target.webkitEnterFullscreen(); + } + } else if (!Fullscreen.native || _this.forceFallback) { + _this.toggleFallback(true); + } else if (!_this.prefix) { + _this.target.requestFullscreen({ + navigationUI: 'hide' + }); + } else if (!is$2.empty(_this.prefix)) { + _this.target["".concat(_this.prefix, "Request").concat(_this.property)](); + } + }); + + _defineProperty(this, "exit", function () { + if (!_this.enabled) { + return; + } // iOS native fullscreen + + + if (browser.isIos && _this.player.config.fullscreen.iosNative) { + _this.target.webkitExitFullscreen(); + + silencePromise(_this.player.play()); + } else if (!Fullscreen.native || _this.forceFallback) { + _this.toggleFallback(false); + } else if (!_this.prefix) { + (document.cancelFullScreen || document.exitFullscreen).call(document); + } else if (!is$2.empty(_this.prefix)) { + var action = _this.prefix === 'moz' ? 'Cancel' : 'Exit'; + document["".concat(_this.prefix).concat(action).concat(_this.property)](); + } + }); + + _defineProperty(this, "toggle", function () { + if (!_this.active) { + _this.enter(); + } else { + _this.exit(); + } + }); + // Keep reference to parent this.player = player; // Get prefix @@ -24474,181 +24638,11 @@ typeof navigator === "object" && (function () { return _this.trapFocus(event); }); // Update the UI - this.update(); + this.update(); // this.toggle = this.toggle.bind(this); } // Determine if native supported _createClass(Fullscreen, [{ - key: "onChange", - value: function onChange() { - if (!this.enabled) { - return; - } // Update toggle button - - - var button = this.player.elements.buttons.fullscreen; - - if (is$2.element(button)) { - button.pressed = this.active; - } // Always trigger events on the plyr / media element (not a fullscreen container) and let them bubble up - - - var target = this.target === this.player.media ? this.target : this.player.elements.container; // Trigger an event - - triggerEvent.call(this.player, target, this.active ? 'enterfullscreen' : 'exitfullscreen', true); - } - }, { - key: "toggleFallback", - value: function toggleFallback() { - var toggle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - // Store or restore scroll position - if (toggle) { - this.scrollPosition = { - x: window.scrollX || 0, - y: window.scrollY || 0 - }; - } else { - window.scrollTo(this.scrollPosition.x, this.scrollPosition.y); - } // Toggle scroll - - - document.body.style.overflow = toggle ? 'hidden' : ''; // Toggle class hook - - toggleClass(this.target, this.player.config.classNames.fullscreen.fallback, toggle); // Force full viewport on iPhone X+ - - if (browser.isIos) { - var viewport = document.head.querySelector('meta[name="viewport"]'); - var property = 'viewport-fit=cover'; // Inject the viewport meta if required - - if (!viewport) { - viewport = document.createElement('meta'); - viewport.setAttribute('name', 'viewport'); - } // Check if the property already exists - - - var hasProperty = is$2.string(viewport.content) && viewport.content.includes(property); - - if (toggle) { - this.cleanupViewport = !hasProperty; - - if (!hasProperty) { - viewport.content += ",".concat(property); - } - } else if (this.cleanupViewport) { - viewport.content = viewport.content.split(',').filter(function (part) { - return part.trim() !== property; - }).join(','); - } - } // Toggle button and fire events - - - this.onChange(); - } // Trap focus inside container - - }, { - key: "trapFocus", - value: function trapFocus(event) { - // Bail if iOS, not active, not the tab key - if (browser.isIos || !this.active || event.key !== 'Tab' || event.keyCode !== 9) { - return; - } // Get the current focused element - - - var focused = document.activeElement; - var focusable = getElements.call(this.player, 'a[href], button:not(:disabled), input:not(:disabled), [tabindex]'); - - var _focusable = _slicedToArray(focusable, 1), - first = _focusable[0]; - - var last = focusable[focusable.length - 1]; - - if (focused === last && !event.shiftKey) { - // Move focus to first element that can be tabbed if Shift isn't used - first.focus(); - event.preventDefault(); - } else if (focused === first && event.shiftKey) { - // Move focus to last element that can be tabbed if Shift is used - last.focus(); - event.preventDefault(); - } - } // Update UI - - }, { - key: "update", - value: function update() { - if (this.enabled) { - var mode; - - if (this.forceFallback) { - mode = 'Fallback (forced)'; - } else if (Fullscreen.native) { - mode = 'Native'; - } else { - mode = 'Fallback'; - } - - this.player.debug.log("".concat(mode, " fullscreen enabled")); - } else { - this.player.debug.log('Fullscreen not supported and fallback disabled'); - } // Add styling hook to show button - - - toggleClass(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.enabled); - } // Make an element fullscreen - - }, { - key: "enter", - value: function enter() { - if (!this.enabled) { - return; - } // iOS native fullscreen doesn't need the request step - - - if (browser.isIos && this.player.config.fullscreen.iosNative) { - this.target.webkitEnterFullscreen(); - } else if (!Fullscreen.native || this.forceFallback) { - this.toggleFallback(true); - } else if (!this.prefix) { - this.target.requestFullscreen({ - navigationUI: 'hide' - }); - } else if (!is$2.empty(this.prefix)) { - this.target["".concat(this.prefix, "Request").concat(this.property)](); - } - } // Bail from fullscreen - - }, { - key: "exit", - value: function exit() { - if (!this.enabled) { - return; - } // iOS native fullscreen - - - if (browser.isIos && this.player.config.fullscreen.iosNative) { - this.target.webkitExitFullscreen(); - silencePromise(this.player.play()); - } else if (!Fullscreen.native || this.forceFallback) { - this.toggleFallback(false); - } else if (!this.prefix) { - (document.cancelFullScreen || document.exitFullscreen).call(document); - } else if (!is$2.empty(this.prefix)) { - var action = this.prefix === 'moz' ? 'Cancel' : 'Exit'; - document["".concat(this.prefix).concat(action).concat(this.property)](); - } - } // Toggle state - - }, { - key: "toggle", - value: function toggle() { - if (!this.active) { - this.enter(); - } else { - this.exit(); - } - } - }, { key: "usingNative", // If we're actually using native get: function get() { @@ -24992,10 +24986,639 @@ typeof navigator === "object" && (function () { }; var Listeners = /*#__PURE__*/function () { - function Listeners(player) { + function Listeners(_player) { + var _this = this; + _classCallCheck(this, Listeners); - this.player = player; + _defineProperty(this, "firstTouch", function () { + var player = _this.player; + var elements = player.elements; + player.touch = true; // Add touch class + + toggleClass(elements.container, player.config.classNames.isTouch, true); + }); + + _defineProperty(this, "setTabFocus", function (event) { + var player = _this.player; + var elements = player.elements; + clearTimeout(_this.focusTimer); // Ignore any key other than tab + + if (event.type === 'keydown' && event.which !== 9) { + return; + } // Store reference to event timeStamp + + + if (event.type === 'keydown') { + _this.lastKeyDown = event.timeStamp; + } // Remove current classes + + + var removeCurrent = function removeCurrent() { + var className = player.config.classNames.tabFocus; + var current = getElements.call(player, ".".concat(className)); + toggleClass(current, className, false); + }; // Determine if a key was pressed to trigger this event + + + var wasKeyDown = event.timeStamp - _this.lastKeyDown <= 20; // Ignore focus events if a key was pressed prior + + if (event.type === 'focus' && !wasKeyDown) { + return; + } // Remove all current + + + removeCurrent(); // Delay the adding of classname until the focus has changed + // This event fires before the focusin event + + if (event.type !== 'focusout') { + _this.focusTimer = setTimeout(function () { + var focused = document.activeElement; // Ignore if current focus element isn't inside the player + + if (!elements.container.contains(focused)) { + return; + } + + toggleClass(document.activeElement, player.config.classNames.tabFocus, true); + }, 10); + } + }); + + _defineProperty(this, "global", function () { + var toggle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + var player = _this.player; // Keyboard shortcuts + + if (player.config.keyboard.global) { + toggleListener.call(player, window, 'keydown keyup', _this.handleKey, toggle, false); + } // Click anywhere closes menu + + + toggleListener.call(player, document.body, 'click', _this.toggleMenu, toggle); // Detect touch by events + + once.call(player, document.body, 'touchstart', _this.firstTouch); // Tab focus detection + + toggleListener.call(player, document.body, 'keydown focus blur focusout', _this.setTabFocus, toggle, false, true); + }); + + _defineProperty(this, "container", function () { + var player = _this.player; + var config = player.config, + elements = player.elements, + timers = player.timers; // Keyboard shortcuts + + if (!config.keyboard.global && config.keyboard.focused) { + on.call(player, elements.container, 'keydown keyup', _this.handleKey, false); + } // Toggle controls on mouse events and entering fullscreen + + + on.call(player, elements.container, 'mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen', function (event) { + var controlsElement = elements.controls; // Remove button states for fullscreen + + if (controlsElement && event.type === 'enterfullscreen') { + controlsElement.pressed = false; + controlsElement.hover = false; + } // Show, then hide after a timeout unless another control event occurs + + + var show = ['touchstart', 'touchmove', 'mousemove'].includes(event.type); + var delay = 0; + + if (show) { + ui.toggleControls.call(player, true); // Use longer timeout for touch devices + + delay = player.touch ? 3000 : 2000; + } // Clear timer + + + clearTimeout(timers.controls); // Set new timer to prevent flicker when seeking + + timers.controls = setTimeout(function () { + return ui.toggleControls.call(player, false); + }, delay); + }); // Set a gutter for Vimeo + + var setGutter = function setGutter(ratio, padding, toggle) { + if (!player.isVimeo || player.config.vimeo.premium) { + return; + } + + var target = player.elements.wrapper.firstChild; + + var _ratio = _slicedToArray(ratio, 2), + y = _ratio[1]; + + var _getAspectRatio$call = getAspectRatio.call(player), + _getAspectRatio$call2 = _slicedToArray(_getAspectRatio$call, 2), + videoX = _getAspectRatio$call2[0], + videoY = _getAspectRatio$call2[1]; + + target.style.maxWidth = toggle ? "".concat(y / videoY * videoX, "px") : null; + target.style.margin = toggle ? '0 auto' : null; + }; // Resize on fullscreen change + + + var setPlayerSize = function setPlayerSize(measure) { + // If we don't need to measure the viewport + if (!measure) { + return setAspectRatio.call(player); + } + + var rect = elements.container.getBoundingClientRect(); + var width = rect.width, + height = rect.height; + return setAspectRatio.call(player, "".concat(width, ":").concat(height)); + }; + + var resized = function resized() { + clearTimeout(timers.resized); + timers.resized = setTimeout(setPlayerSize, 50); + }; + + on.call(player, elements.container, 'enterfullscreen exitfullscreen', function (event) { + var _player$fullscreen = player.fullscreen, + target = _player$fullscreen.target, + usingNative = _player$fullscreen.usingNative; // Ignore events not from target + + if (target !== elements.container) { + return; + } // If it's not an embed and no ratio specified + + + if (!player.isEmbed && is$2.empty(player.config.ratio)) { + return; + } + + var isEnter = event.type === 'enterfullscreen'; // Set the player size when entering fullscreen to viewport size + + var _setPlayerSize = setPlayerSize(isEnter), + padding = _setPlayerSize.padding, + ratio = _setPlayerSize.ratio; // Set Vimeo gutter + + + setGutter(ratio, padding, isEnter); // Horrible hack for Safari 14 not repainting properly on entering fullscreen + + if (isEnter) { + setTimeout(function () { + return repaint(elements.container); + }, 100); + } // If not using native browser fullscreen API, we need to check for resizes of viewport + + + if (!usingNative) { + if (isEnter) { + on.call(player, window, 'resize', resized); + } else { + off.call(player, window, 'resize', resized); + } + } + }); + }); + + _defineProperty(this, "media", function () { + var player = _this.player; + var elements = player.elements; // Time change on media + + on.call(player, player.media, 'timeupdate seeking seeked', function (event) { + return controls.timeUpdate.call(player, event); + }); // Display duration + + on.call(player, player.media, 'durationchange loadeddata loadedmetadata', function (event) { + return controls.durationUpdate.call(player, event); + }); // Handle the media finishing + + on.call(player, player.media, 'ended', function () { + // Show poster on end + if (player.isHTML5 && player.isVideo && player.config.resetOnEnd) { + // Restart + player.restart(); // Call pause otherwise IE11 will start playing the video again + + player.pause(); + } + }); // Check for buffer progress + + on.call(player, player.media, 'progress playing seeking seeked', function (event) { + return controls.updateProgress.call(player, event); + }); // Handle volume changes + + on.call(player, player.media, 'volumechange', function (event) { + return controls.updateVolume.call(player, event); + }); // Handle play/pause + + on.call(player, player.media, 'playing play pause ended emptied timeupdate', function (event) { + return ui.checkPlaying.call(player, event); + }); // Loading state + + on.call(player, player.media, 'waiting canplay seeked playing', function (event) { + return ui.checkLoading.call(player, event); + }); // Click video + + if (player.supported.ui && player.config.clickToPlay && !player.isAudio) { + // Re-fetch the wrapper + var wrapper = getElement.call(player, ".".concat(player.config.classNames.video)); // Bail if there's no wrapper (this should never happen) + + if (!is$2.element(wrapper)) { + return; + } // On click play, pause or restart + + + on.call(player, elements.container, 'click', function (event) { + var targets = [elements.container, wrapper]; // Ignore if click if not container or in video wrapper + + if (!targets.includes(event.target) && !wrapper.contains(event.target)) { + return; + } // Touch devices will just show controls (if hidden) + + + if (player.touch && player.config.hideControls) { + return; + } + + if (player.ended) { + _this.proxy(event, player.restart, 'restart'); + + _this.proxy(event, function () { + silencePromise(player.play()); + }, 'play'); + } else { + _this.proxy(event, function () { + silencePromise(player.togglePlay()); + }, 'play'); + } + }); + } // Disable right click + + + if (player.supported.ui && player.config.disableContextMenu) { + on.call(player, elements.wrapper, 'contextmenu', function (event) { + event.preventDefault(); + }, false); + } // Volume change + + + on.call(player, player.media, 'volumechange', function () { + // Save to storage + player.storage.set({ + volume: player.volume, + muted: player.muted + }); + }); // Speed change + + on.call(player, player.media, 'ratechange', function () { + // Update UI + controls.updateSetting.call(player, 'speed'); // Save to storage + + player.storage.set({ + speed: player.speed + }); + }); // Quality change + + on.call(player, player.media, 'qualitychange', function (event) { + // Update UI + controls.updateSetting.call(player, 'quality', null, event.detail.quality); + }); // Update download link when ready and if quality changes + + on.call(player, player.media, 'ready qualitychange', function () { + controls.setDownloadUrl.call(player); + }); // Proxy events to container + // Bubble up key events for Edge + + var proxyEvents = player.config.events.concat(['keyup', 'keydown']).join(' '); + on.call(player, player.media, proxyEvents, function (event) { + var _event$detail = event.detail, + detail = _event$detail === void 0 ? {} : _event$detail; // Get error details from media + + if (event.type === 'error') { + detail = player.media.error; + } + + triggerEvent.call(player, elements.container, event.type, true, detail); + }); + }); + + _defineProperty(this, "proxy", function (event, defaultHandler, customHandlerKey) { + var player = _this.player; + var customHandler = player.config.listeners[customHandlerKey]; + var hasCustomHandler = is$2.function(customHandler); + var returned = true; // Execute custom handler + + if (hasCustomHandler) { + returned = customHandler.call(player, event); + } // Only call default handler if not prevented in custom handler + + + if (returned !== false && is$2.function(defaultHandler)) { + defaultHandler.call(player, event); + } + }); + + _defineProperty(this, "bind", function (element, type, defaultHandler, customHandlerKey) { + var passive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; + var player = _this.player; + var customHandler = player.config.listeners[customHandlerKey]; + var hasCustomHandler = is$2.function(customHandler); + on.call(player, element, type, function (event) { + return _this.proxy(event, defaultHandler, customHandlerKey); + }, passive && !hasCustomHandler); + }); + + _defineProperty(this, "controls", function () { + var player = _this.player; + var elements = player.elements; // IE doesn't support input event, so we fallback to change + + var inputEvent = browser.isIE ? 'change' : 'input'; // Play/pause toggle + + if (elements.buttons.play) { + Array.from(elements.buttons.play).forEach(function (button) { + _this.bind(button, 'click', function () { + silencePromise(player.togglePlay()); + }, 'play'); + }); + } // Pause + + + _this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); // Rewind + + + _this.bind(elements.buttons.rewind, 'click', function () { + // Record seek time so we can prevent hiding controls for a few seconds after rewind + player.lastSeekTime = Date.now(); + player.rewind(); + }, 'rewind'); // Rewind + + + _this.bind(elements.buttons.fastForward, 'click', function () { + // Record seek time so we can prevent hiding controls for a few seconds after fast forward + player.lastSeekTime = Date.now(); + player.forward(); + }, 'fastForward'); // Mute toggle + + + _this.bind(elements.buttons.mute, 'click', function () { + player.muted = !player.muted; + }, 'mute'); // Captions toggle + + + _this.bind(elements.buttons.captions, 'click', function () { + return player.toggleCaptions(); + }); // Download + + + _this.bind(elements.buttons.download, 'click', function () { + triggerEvent.call(player, player.media, 'download'); + }, 'download'); // Fullscreen toggle + + + _this.bind(elements.buttons.fullscreen, 'click', function () { + player.fullscreen.toggle(); + }, 'fullscreen'); // Picture-in-Picture + + + _this.bind(elements.buttons.pip, 'click', function () { + player.pip = 'toggle'; + }, 'pip'); // Airplay + + + _this.bind(elements.buttons.airplay, 'click', player.airplay, 'airplay'); // Settings menu - click toggle + + + _this.bind(elements.buttons.settings, 'click', function (event) { + // Prevent the document click listener closing the menu + event.stopPropagation(); + event.preventDefault(); + controls.toggleMenu.call(player, event); + }, null, false); // Can't be passive as we're preventing default + // Settings menu - keyboard toggle + // We have to bind to keyup otherwise Firefox triggers a click when a keydown event handler shifts focus + // https://bugzilla.mozilla.org/show_bug.cgi?id=1220143 + + + _this.bind(elements.buttons.settings, 'keyup', function (event) { + var code = event.which; // We only care about space and return + + if (![13, 32].includes(code)) { + return; + } // Because return triggers a click anyway, all we need to do is set focus + + + if (code === 13) { + controls.focusFirstMenuItem.call(player, null, true); + return; + } // Prevent scroll + + + event.preventDefault(); // Prevent playing video (Firefox) + + event.stopPropagation(); // Toggle menu + + controls.toggleMenu.call(player, event); + }, null, false // Can't be passive as we're preventing default + ); // Escape closes menu + + + _this.bind(elements.settings.menu, 'keydown', function (event) { + if (event.which === 27) { + controls.toggleMenu.call(player, event); + } + }); // Set range input alternative "value", which matches the tooltip time (#954) + + + _this.bind(elements.inputs.seek, 'mousedown mousemove', function (event) { + var rect = elements.progress.getBoundingClientRect(); + var percent = 100 / rect.width * (event.pageX - rect.left); + event.currentTarget.setAttribute('seek-value', percent); + }); // Pause while seeking + + + _this.bind(elements.inputs.seek, 'mousedown mouseup keydown keyup touchstart touchend', function (event) { + var seek = event.currentTarget; + var code = event.keyCode ? event.keyCode : event.which; + var attribute = 'play-on-seeked'; + + if (is$2.keyboardEvent(event) && code !== 39 && code !== 37) { + return; + } // Record seek time so we can prevent hiding controls for a few seconds after seek + + + player.lastSeekTime = Date.now(); // Was playing before? + + var play = seek.hasAttribute(attribute); // Done seeking + + var done = ['mouseup', 'touchend', 'keyup'].includes(event.type); // If we're done seeking and it was playing, resume playback + + if (play && done) { + seek.removeAttribute(attribute); + silencePromise(player.play()); + } else if (!done && player.playing) { + seek.setAttribute(attribute, ''); + player.pause(); + } + }); // Fix range inputs on iOS + // Super weird iOS bug where after you interact with an , + // it takes over further interactions on the page. This is a hack + + + if (browser.isIos) { + var inputs = getElements.call(player, 'input[type="range"]'); + Array.from(inputs).forEach(function (input) { + return _this.bind(input, inputEvent, function (event) { + return repaint(event.target); + }); + }); + } // Seek + + + _this.bind(elements.inputs.seek, inputEvent, function (event) { + var seek = event.currentTarget; // If it exists, use seek-value instead of "value" for consistency with tooltip time (#954) + + var seekTo = seek.getAttribute('seek-value'); + + if (is$2.empty(seekTo)) { + seekTo = seek.value; + } + + seek.removeAttribute('seek-value'); + player.currentTime = seekTo / seek.max * player.duration; + }, 'seek'); // Seek tooltip + + + _this.bind(elements.progress, 'mouseenter mouseleave mousemove', function (event) { + return controls.updateSeekTooltip.call(player, event); + }); // Preview thumbnails plugin + // TODO: Really need to work on some sort of plug-in wide event bus or pub-sub for this + + + _this.bind(elements.progress, 'mousemove touchmove', function (event) { + var previewThumbnails = player.previewThumbnails; + + if (previewThumbnails && previewThumbnails.loaded) { + previewThumbnails.startMove(event); + } + }); // Hide thumbnail preview - on mouse click, mouse leave, and video play/seek. All four are required, e.g., for buffering + + + _this.bind(elements.progress, 'mouseleave touchend click', function () { + var previewThumbnails = player.previewThumbnails; + + if (previewThumbnails && previewThumbnails.loaded) { + previewThumbnails.endMove(false, true); + } + }); // Show scrubbing preview + + + _this.bind(elements.progress, 'mousedown touchstart', function (event) { + var previewThumbnails = player.previewThumbnails; + + if (previewThumbnails && previewThumbnails.loaded) { + previewThumbnails.startScrubbing(event); + } + }); + + _this.bind(elements.progress, 'mouseup touchend', function (event) { + var previewThumbnails = player.previewThumbnails; + + if (previewThumbnails && previewThumbnails.loaded) { + previewThumbnails.endScrubbing(event); + } + }); // Polyfill for lower fill in for webkit + + + if (browser.isWebkit) { + Array.from(getElements.call(player, 'input[type="range"]')).forEach(function (element) { + _this.bind(element, 'input', function (event) { + return controls.updateRangeFill.call(player, event.target); + }); + }); + } // Current time invert + // Only if one time element is used for both currentTime and duration + + + if (player.config.toggleInvert && !is$2.element(elements.display.duration)) { + _this.bind(elements.display.currentTime, 'click', function () { + // Do nothing if we're at the start + if (player.currentTime === 0) { + return; + } + + player.config.invertTime = !player.config.invertTime; + controls.timeUpdate.call(player); + }); + } // Volume + + + _this.bind(elements.inputs.volume, inputEvent, function (event) { + player.volume = event.target.value; + }, 'volume'); // Update controls.hover state (used for ui.toggleControls to avoid hiding when interacting) + + + _this.bind(elements.controls, 'mouseenter mouseleave', function (event) { + elements.controls.hover = !player.touch && event.type === 'mouseenter'; + }); // Also update controls.hover state for any non-player children of fullscreen element (as above) + + + if (elements.fullscreen) { + Array.from(elements.fullscreen.children).filter(function (c) { + return !c.contains(elements.container); + }).forEach(function (child) { + _this.bind(child, 'mouseenter mouseleave', function (event) { + elements.controls.hover = !player.touch && event.type === 'mouseenter'; + }); + }); + } // Update controls.pressed state (used for ui.toggleControls to avoid hiding when interacting) + + + _this.bind(elements.controls, 'mousedown mouseup touchstart touchend touchcancel', function (event) { + elements.controls.pressed = ['mousedown', 'touchstart'].includes(event.type); + }); // Show controls when they receive focus (e.g., when using keyboard tab key) + + + _this.bind(elements.controls, 'focusin', function () { + var config = player.config, + timers = player.timers; // Skip transition to prevent focus from scrolling the parent element + + toggleClass(elements.controls, config.classNames.noTransition, true); // Toggle + + ui.toggleControls.call(player, true); // Restore transition + + setTimeout(function () { + toggleClass(elements.controls, config.classNames.noTransition, false); + }, 0); // Delay a little more for mouse users + + var delay = _this.touch ? 3000 : 4000; // Clear timer + + clearTimeout(timers.controls); // Hide again after delay + + timers.controls = setTimeout(function () { + return ui.toggleControls.call(player, false); + }, delay); + }); // Mouse wheel for volume + + + _this.bind(elements.inputs.volume, 'wheel', function (event) { + // Detect "natural" scroll - suppored on OS X Safari only + // Other browsers on OS X will be inverted until support improves + var inverted = event.webkitDirectionInvertedFromDevice; // Get delta from event. Invert if `inverted` is true + + var _map = [event.deltaX, -event.deltaY].map(function (value) { + return inverted ? -value : value; + }), + _map2 = _slicedToArray(_map, 2), + x = _map2[0], + y = _map2[1]; // Using the biggest delta, normalize to 1 or -1 (or 0 if no delta) + + + var direction = Math.sign(Math.abs(x) > Math.abs(y) ? x : y); // Change the volume by 2% + + player.increaseVolume(direction / 50); // Don't break page scrolling at max and min + + var volume = player.media.volume; + + if (direction === 1 && volume < 1 || direction === -1 && volume > 0) { + event.preventDefault(); + } + }, 'volume', false); + }); + + this.player = _player; this.lastKey = null; this.focusTimer = null; this.lastKeyDown = null; @@ -25153,633 +25776,6 @@ typeof navigator === "object" && (function () { controls.toggleMenu.call(this.player, event); } // Device is touch enabled - }, { - key: "firstTouch", - value: function firstTouch() { - var player = this.player; - var elements = player.elements; - player.touch = true; // Add touch class - - toggleClass(elements.container, player.config.classNames.isTouch, true); - } - }, { - key: "setTabFocus", - value: function setTabFocus(event) { - var player = this.player; - var elements = player.elements; - clearTimeout(this.focusTimer); // Ignore any key other than tab - - if (event.type === 'keydown' && event.which !== 9) { - return; - } // Store reference to event timeStamp - - - if (event.type === 'keydown') { - this.lastKeyDown = event.timeStamp; - } // Remove current classes - - - var removeCurrent = function removeCurrent() { - var className = player.config.classNames.tabFocus; - var current = getElements.call(player, ".".concat(className)); - toggleClass(current, className, false); - }; // Determine if a key was pressed to trigger this event - - - var wasKeyDown = event.timeStamp - this.lastKeyDown <= 20; // Ignore focus events if a key was pressed prior - - if (event.type === 'focus' && !wasKeyDown) { - return; - } // Remove all current - - - removeCurrent(); // Delay the adding of classname until the focus has changed - // This event fires before the focusin event - - if (event.type !== 'focusout') { - this.focusTimer = setTimeout(function () { - var focused = document.activeElement; // Ignore if current focus element isn't inside the player - - if (!elements.container.contains(focused)) { - return; - } - - toggleClass(document.activeElement, player.config.classNames.tabFocus, true); - }, 10); - } - } // Global window & document listeners - - }, { - key: "global", - value: function global() { - var toggle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - var player = this.player; // Keyboard shortcuts - - if (player.config.keyboard.global) { - toggleListener.call(player, window, 'keydown keyup', this.handleKey, toggle, false); - } // Click anywhere closes menu - - - toggleListener.call(player, document.body, 'click', this.toggleMenu, toggle); // Detect touch by events - - once.call(player, document.body, 'touchstart', this.firstTouch); // Tab focus detection - - toggleListener.call(player, document.body, 'keydown focus blur focusout', this.setTabFocus, toggle, false, true); - } // Container listeners - - }, { - key: "container", - value: function container() { - var player = this.player; - var config = player.config, - elements = player.elements, - timers = player.timers; // Keyboard shortcuts - - if (!config.keyboard.global && config.keyboard.focused) { - on.call(player, elements.container, 'keydown keyup', this.handleKey, false); - } // Toggle controls on mouse events and entering fullscreen - - - on.call(player, elements.container, 'mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen', function (event) { - var controlsElement = elements.controls; // Remove button states for fullscreen - - if (controlsElement && event.type === 'enterfullscreen') { - controlsElement.pressed = false; - controlsElement.hover = false; - } // Show, then hide after a timeout unless another control event occurs - - - var show = ['touchstart', 'touchmove', 'mousemove'].includes(event.type); - var delay = 0; - - if (show) { - ui.toggleControls.call(player, true); // Use longer timeout for touch devices - - delay = player.touch ? 3000 : 2000; - } // Clear timer - - - clearTimeout(timers.controls); // Set new timer to prevent flicker when seeking - - timers.controls = setTimeout(function () { - return ui.toggleControls.call(player, false); - }, delay); - }); // Set a gutter for Vimeo - - var setGutter = function setGutter(ratio, padding, toggle) { - if (!player.isVimeo || player.config.vimeo.premium) { - return; - } - - var target = player.elements.wrapper.firstChild; - - var _ratio = _slicedToArray(ratio, 2), - y = _ratio[1]; - - var _getAspectRatio$call = getAspectRatio.call(player), - _getAspectRatio$call2 = _slicedToArray(_getAspectRatio$call, 2), - videoX = _getAspectRatio$call2[0], - videoY = _getAspectRatio$call2[1]; - - target.style.maxWidth = toggle ? "".concat(y / videoY * videoX, "px") : null; - target.style.margin = toggle ? '0 auto' : null; - }; // Resize on fullscreen change - - - var setPlayerSize = function setPlayerSize(measure) { - // If we don't need to measure the viewport - if (!measure) { - return setAspectRatio.call(player); - } - - var rect = elements.container.getBoundingClientRect(); - var width = rect.width, - height = rect.height; - return setAspectRatio.call(player, "".concat(width, ":").concat(height)); - }; - - var resized = function resized() { - clearTimeout(timers.resized); - timers.resized = setTimeout(setPlayerSize, 50); - }; - - on.call(player, elements.container, 'enterfullscreen exitfullscreen', function (event) { - var _player$fullscreen = player.fullscreen, - target = _player$fullscreen.target, - usingNative = _player$fullscreen.usingNative; // Ignore events not from target - - if (target !== elements.container) { - return; - } // If it's not an embed and no ratio specified - - - if (!player.isEmbed && is$2.empty(player.config.ratio)) { - return; - } - - var isEnter = event.type === 'enterfullscreen'; // Set the player size when entering fullscreen to viewport size - - var _setPlayerSize = setPlayerSize(isEnter), - padding = _setPlayerSize.padding, - ratio = _setPlayerSize.ratio; // Set Vimeo gutter - - - setGutter(ratio, padding, isEnter); // Horrible hack for Safari 14 not repainting properly on entering fullscreen - - if (isEnter) { - setTimeout(function () { - return repaint(elements.container); - }, 100); - } // If not using native browser fullscreen API, we need to check for resizes of viewport - - - if (!usingNative) { - if (isEnter) { - on.call(player, window, 'resize', resized); - } else { - off.call(player, window, 'resize', resized); - } - } - }); - } // Listen for media events - - }, { - key: "media", - value: function media() { - var _this = this; - - var player = this.player; - var elements = player.elements; // Time change on media - - on.call(player, player.media, 'timeupdate seeking seeked', function (event) { - return controls.timeUpdate.call(player, event); - }); // Display duration - - on.call(player, player.media, 'durationchange loadeddata loadedmetadata', function (event) { - return controls.durationUpdate.call(player, event); - }); // Handle the media finishing - - on.call(player, player.media, 'ended', function () { - // Show poster on end - if (player.isHTML5 && player.isVideo && player.config.resetOnEnd) { - // Restart - player.restart(); // Call pause otherwise IE11 will start playing the video again - - player.pause(); - } - }); // Check for buffer progress - - on.call(player, player.media, 'progress playing seeking seeked', function (event) { - return controls.updateProgress.call(player, event); - }); // Handle volume changes - - on.call(player, player.media, 'volumechange', function (event) { - return controls.updateVolume.call(player, event); - }); // Handle play/pause - - on.call(player, player.media, 'playing play pause ended emptied timeupdate', function (event) { - return ui.checkPlaying.call(player, event); - }); // Loading state - - on.call(player, player.media, 'waiting canplay seeked playing', function (event) { - return ui.checkLoading.call(player, event); - }); // Click video - - if (player.supported.ui && player.config.clickToPlay && !player.isAudio) { - // Re-fetch the wrapper - var wrapper = getElement.call(player, ".".concat(player.config.classNames.video)); // Bail if there's no wrapper (this should never happen) - - if (!is$2.element(wrapper)) { - return; - } // On click play, pause or restart - - - on.call(player, elements.container, 'click', function (event) { - var targets = [elements.container, wrapper]; // Ignore if click if not container or in video wrapper - - if (!targets.includes(event.target) && !wrapper.contains(event.target)) { - return; - } // Touch devices will just show controls (if hidden) - - - if (player.touch && player.config.hideControls) { - return; - } - - if (player.ended) { - _this.proxy(event, player.restart, 'restart'); - - _this.proxy(event, function () { - silencePromise(player.play()); - }, 'play'); - } else { - _this.proxy(event, function () { - silencePromise(player.togglePlay()); - }, 'play'); - } - }); - } // Disable right click - - - if (player.supported.ui && player.config.disableContextMenu) { - on.call(player, elements.wrapper, 'contextmenu', function (event) { - event.preventDefault(); - }, false); - } // Volume change - - - on.call(player, player.media, 'volumechange', function () { - // Save to storage - player.storage.set({ - volume: player.volume, - muted: player.muted - }); - }); // Speed change - - on.call(player, player.media, 'ratechange', function () { - // Update UI - controls.updateSetting.call(player, 'speed'); // Save to storage - - - player.storage.set({ - speed: player.speed - }); - }); // Quality change - - on.call(player, player.media, 'qualitychange', function (event) { - // Update UI - controls.updateSetting.call(player, 'quality', null, event.detail.quality); - }); // Update download link when ready and if quality changes - - on.call(player, player.media, 'ready qualitychange', function () { - controls.setDownloadUrl.call(player); - }); // Proxy events to container - // Bubble up key events for Edge - - var proxyEvents = player.config.events.concat(['keyup', 'keydown']).join(' '); - on.call(player, player.media, proxyEvents, function (event) { - var _event$detail = event.detail, - detail = _event$detail === void 0 ? {} : _event$detail; // Get error details from media - - if (event.type === 'error') { - detail = player.media.error; - } - - triggerEvent.call(player, elements.container, event.type, true, detail); - }); - } // Run default and custom handlers - - }, { - key: "proxy", - value: function proxy(event, defaultHandler, customHandlerKey) { - var player = this.player; - var customHandler = player.config.listeners[customHandlerKey]; - var hasCustomHandler = is$2.function(customHandler); - var returned = true; // Execute custom handler - - if (hasCustomHandler) { - returned = customHandler.call(player, event); - } // Only call default handler if not prevented in custom handler - - - if (returned !== false && is$2.function(defaultHandler)) { - defaultHandler.call(player, event); - } - } // Trigger custom and default handlers - - }, { - key: "bind", - value: function bind(element, type, defaultHandler, customHandlerKey) { - var _this2 = this; - - var passive = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; - var player = this.player; - var customHandler = player.config.listeners[customHandlerKey]; - var hasCustomHandler = is$2.function(customHandler); - on.call(player, element, type, function (event) { - return _this2.proxy(event, defaultHandler, customHandlerKey); - }, passive && !hasCustomHandler); - } // Listen for control events - - }, { - key: "controls", - value: function controls$1() { - var _this3 = this; - - var player = this.player; - var elements = player.elements; // IE doesn't support input event, so we fallback to change - - var inputEvent = browser.isIE ? 'change' : 'input'; // Play/pause toggle - - if (elements.buttons.play) { - Array.from(elements.buttons.play).forEach(function (button) { - _this3.bind(button, 'click', function () { - silencePromise(player.togglePlay()); - }, 'play'); - }); - } // Pause - - - this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); // Rewind - - this.bind(elements.buttons.rewind, 'click', function () { - // Record seek time so we can prevent hiding controls for a few seconds after rewind - player.lastSeekTime = Date.now(); - player.rewind(); - }, 'rewind'); // Rewind - - this.bind(elements.buttons.fastForward, 'click', function () { - // Record seek time so we can prevent hiding controls for a few seconds after fast forward - player.lastSeekTime = Date.now(); - player.forward(); - }, 'fastForward'); // Mute toggle - - this.bind(elements.buttons.mute, 'click', function () { - player.muted = !player.muted; - }, 'mute'); // Captions toggle - - this.bind(elements.buttons.captions, 'click', function () { - return player.toggleCaptions(); - }); // Download - - this.bind(elements.buttons.download, 'click', function () { - triggerEvent.call(player, player.media, 'download'); - }, 'download'); // Fullscreen toggle - - this.bind(elements.buttons.fullscreen, 'click', function () { - player.fullscreen.toggle(); - }, 'fullscreen'); // Picture-in-Picture - - this.bind(elements.buttons.pip, 'click', function () { - player.pip = 'toggle'; - }, 'pip'); // Airplay - - this.bind(elements.buttons.airplay, 'click', player.airplay, 'airplay'); // Settings menu - click toggle - - this.bind(elements.buttons.settings, 'click', function (event) { - // Prevent the document click listener closing the menu - event.stopPropagation(); - event.preventDefault(); - - controls.toggleMenu.call(player, event); - }, null, false); // Can't be passive as we're preventing default - // Settings menu - keyboard toggle - // We have to bind to keyup otherwise Firefox triggers a click when a keydown event handler shifts focus - // https://bugzilla.mozilla.org/show_bug.cgi?id=1220143 - - this.bind(elements.buttons.settings, 'keyup', function (event) { - var code = event.which; // We only care about space and return - - if (![13, 32].includes(code)) { - return; - } // Because return triggers a click anyway, all we need to do is set focus - - - if (code === 13) { - controls.focusFirstMenuItem.call(player, null, true); - - return; - } // Prevent scroll - - - event.preventDefault(); // Prevent playing video (Firefox) - - event.stopPropagation(); // Toggle menu - - controls.toggleMenu.call(player, event); - }, null, false // Can't be passive as we're preventing default - ); // Escape closes menu - - this.bind(elements.settings.menu, 'keydown', function (event) { - if (event.which === 27) { - controls.toggleMenu.call(player, event); - } - }); // Set range input alternative "value", which matches the tooltip time (#954) - - this.bind(elements.inputs.seek, 'mousedown mousemove', function (event) { - var rect = elements.progress.getBoundingClientRect(); - var percent = 100 / rect.width * (event.pageX - rect.left); - event.currentTarget.setAttribute('seek-value', percent); - }); // Pause while seeking - - this.bind(elements.inputs.seek, 'mousedown mouseup keydown keyup touchstart touchend', function (event) { - var seek = event.currentTarget; - var code = event.keyCode ? event.keyCode : event.which; - var attribute = 'play-on-seeked'; - - if (is$2.keyboardEvent(event) && code !== 39 && code !== 37) { - return; - } // Record seek time so we can prevent hiding controls for a few seconds after seek - - - player.lastSeekTime = Date.now(); // Was playing before? - - var play = seek.hasAttribute(attribute); // Done seeking - - var done = ['mouseup', 'touchend', 'keyup'].includes(event.type); // If we're done seeking and it was playing, resume playback - - if (play && done) { - seek.removeAttribute(attribute); - silencePromise(player.play()); - } else if (!done && player.playing) { - seek.setAttribute(attribute, ''); - player.pause(); - } - }); // Fix range inputs on iOS - // Super weird iOS bug where after you interact with an , - // it takes over further interactions on the page. This is a hack - - if (browser.isIos) { - var inputs = getElements.call(player, 'input[type="range"]'); - Array.from(inputs).forEach(function (input) { - return _this3.bind(input, inputEvent, function (event) { - return repaint(event.target); - }); - }); - } // Seek - - - this.bind(elements.inputs.seek, inputEvent, function (event) { - var seek = event.currentTarget; // If it exists, use seek-value instead of "value" for consistency with tooltip time (#954) - - var seekTo = seek.getAttribute('seek-value'); - - if (is$2.empty(seekTo)) { - seekTo = seek.value; - } - - seek.removeAttribute('seek-value'); - player.currentTime = seekTo / seek.max * player.duration; - }, 'seek'); // Seek tooltip - - this.bind(elements.progress, 'mouseenter mouseleave mousemove', function (event) { - return controls.updateSeekTooltip.call(player, event); - }); // Preview thumbnails plugin - // TODO: Really need to work on some sort of plug-in wide event bus or pub-sub for this - - this.bind(elements.progress, 'mousemove touchmove', function (event) { - var previewThumbnails = player.previewThumbnails; - - if (previewThumbnails && previewThumbnails.loaded) { - previewThumbnails.startMove(event); - } - }); // Hide thumbnail preview - on mouse click, mouse leave, and video play/seek. All four are required, e.g., for buffering - - this.bind(elements.progress, 'mouseleave touchend click', function () { - var previewThumbnails = player.previewThumbnails; - - if (previewThumbnails && previewThumbnails.loaded) { - previewThumbnails.endMove(false, true); - } - }); // Show scrubbing preview - - this.bind(elements.progress, 'mousedown touchstart', function (event) { - var previewThumbnails = player.previewThumbnails; - - if (previewThumbnails && previewThumbnails.loaded) { - previewThumbnails.startScrubbing(event); - } - }); - this.bind(elements.progress, 'mouseup touchend', function (event) { - var previewThumbnails = player.previewThumbnails; - - if (previewThumbnails && previewThumbnails.loaded) { - previewThumbnails.endScrubbing(event); - } - }); // Polyfill for lower fill in for webkit - - if (browser.isWebkit) { - Array.from(getElements.call(player, 'input[type="range"]')).forEach(function (element) { - _this3.bind(element, 'input', function (event) { - return controls.updateRangeFill.call(player, event.target); - }); - }); - } // Current time invert - // Only if one time element is used for both currentTime and duration - - - if (player.config.toggleInvert && !is$2.element(elements.display.duration)) { - this.bind(elements.display.currentTime, 'click', function () { - // Do nothing if we're at the start - if (player.currentTime === 0) { - return; - } - - player.config.invertTime = !player.config.invertTime; - - controls.timeUpdate.call(player); - }); - } // Volume - - - this.bind(elements.inputs.volume, inputEvent, function (event) { - player.volume = event.target.value; - }, 'volume'); // Update controls.hover state (used for ui.toggleControls to avoid hiding when interacting) - - this.bind(elements.controls, 'mouseenter mouseleave', function (event) { - elements.controls.hover = !player.touch && event.type === 'mouseenter'; - }); // Also update controls.hover state for any non-player children of fullscreen element (as above) - - if (elements.fullscreen) { - Array.from(elements.fullscreen.children).filter(function (c) { - return !c.contains(elements.container); - }).forEach(function (child) { - _this3.bind(child, 'mouseenter mouseleave', function (event) { - elements.controls.hover = !player.touch && event.type === 'mouseenter'; - }); - }); - } // Update controls.pressed state (used for ui.toggleControls to avoid hiding when interacting) - - - this.bind(elements.controls, 'mousedown mouseup touchstart touchend touchcancel', function (event) { - elements.controls.pressed = ['mousedown', 'touchstart'].includes(event.type); - }); // Show controls when they receive focus (e.g., when using keyboard tab key) - - this.bind(elements.controls, 'focusin', function () { - var config = player.config, - timers = player.timers; // Skip transition to prevent focus from scrolling the parent element - - toggleClass(elements.controls, config.classNames.noTransition, true); // Toggle - - ui.toggleControls.call(player, true); // Restore transition - - setTimeout(function () { - toggleClass(elements.controls, config.classNames.noTransition, false); - }, 0); // Delay a little more for mouse users - - var delay = _this3.touch ? 3000 : 4000; // Clear timer - - clearTimeout(timers.controls); // Hide again after delay - - timers.controls = setTimeout(function () { - return ui.toggleControls.call(player, false); - }, delay); - }); // Mouse wheel for volume - - this.bind(elements.inputs.volume, 'wheel', function (event) { - // Detect "natural" scroll - suppored on OS X Safari only - // Other browsers on OS X will be inverted until support improves - var inverted = event.webkitDirectionInvertedFromDevice; // Get delta from event. Invert if `inverted` is true - - var _map = [event.deltaX, -event.deltaY].map(function (value) { - return inverted ? -value : value; - }), - _map2 = _slicedToArray(_map, 2), - x = _map2[0], - y = _map2[1]; // Using the biggest delta, normalize to 1 or -1 (or 0 if no delta) - - - var direction = Math.sign(Math.abs(x) > Math.abs(y) ? x : y); // Change the volume by 2% - - player.increaseVolume(direction / 50); // Don't break page scrolling at max and min - - var volume = player.media.volume; - - if (direction === 1 && volume < 1 || direction === -1 && volume > 0) { - event.preventDefault(); - } - }, 'volume', false); - } }]); return Listeners; @@ -26233,7 +26229,7 @@ typeof navigator === "object" && (function () { var src = format(player.config.urls.vimeo.iframe, id, params); iframe.setAttribute('src', src); iframe.setAttribute('allowfullscreen', ''); - iframe.setAttribute('allow', 'autoplay,fullscreen,picture-in-picture'); // Set the referrer policy if required + iframe.setAttribute('allow', ['autoplay', 'fullscreen', 'picture-in-picture'].join('; ')); // Set the referrer policy if required if (!is$2.empty(referrerPolicy)) { iframe.setAttribute('referrerPolicy', referrerPolicy); @@ -26989,135 +26985,84 @@ typeof navigator === "object" && (function () { _classCallCheck(this, Ads); - this.player = player; - this.config = player.config.ads; - this.playing = false; - this.initialized = false; - this.elements = { - container: null, - displayContainer: null - }; - this.manager = null; - this.loader = null; - this.cuePoints = null; - this.events = {}; - this.safetyTimer = null; - this.countdownTimer = null; // Setup a promise to resolve when the IMA manager is ready - - this.managerPromise = new Promise(function (resolve, reject) { - // The ad is loaded and ready - _this.on('loaded', resolve); // Ads failed - - - _this.on('error', reject); - }); - this.load(); - } - - _createClass(Ads, [{ - key: "load", - - /** - * Load the IMA SDK - */ - value: function load() { - var _this2 = this; - - if (!this.enabled) { + _defineProperty(this, "load", function () { + if (!_this.enabled) { return; } // Check if the Google IMA3 SDK is loaded or load it ourselves if (!is$2.object(window.google) || !is$2.object(window.google.ima)) { - loadScript(this.player.config.urls.googleIMA.sdk).then(function () { - _this2.ready(); + loadScript(_this.player.config.urls.googleIMA.sdk).then(function () { + _this.ready(); }).catch(function () { // Script failed to load or is blocked - _this2.trigger('error', new Error('Google IMA SDK failed to load')); + _this.trigger('error', new Error('Google IMA SDK failed to load')); }); } else { - this.ready(); + _this.ready(); } - } - /** - * Get the ads instance ready - */ - - }, { - key: "ready", - value: function ready() { - var _this3 = this; + }); + _defineProperty(this, "ready", function () { // Double check we're enabled - if (!this.enabled) { - destroy(this); + if (!_this.enabled) { + destroy(_this); } // Start ticking our safety timer. If the whole advertisement // thing doesn't resolve within our set time; we bail - this.startSafetyTimer(12000, 'ready()'); // Clear the safety timer + _this.startSafetyTimer(12000, 'ready()'); // Clear the safety timer - this.managerPromise.then(function () { - _this3.clearSafetyTimer('onAdsManagerLoaded()'); + + _this.managerPromise.then(function () { + _this.clearSafetyTimer('onAdsManagerLoaded()'); }); // Set listeners on the Plyr instance - this.listeners(); // Setup the IMA SDK - this.setupIMA(); - } // Build the tag URL + _this.listeners(); // Setup the IMA SDK - }, { - key: "setupIMA", - /** - * In order for the SDK to display ads for our video, we need to tell it where to put them, - * so here we define our ad container. This div is set up to render on top of the video player. - * Using the code below, we tell the SDK to render ads within that div. We also provide a - * handle to the content video player - the SDK will poll the current time of our player to - * properly place mid-rolls. After we create the ad display container, we initialize it. On - * mobile devices, this initialization is done as the result of a user action. - */ - value: function setupIMA() { - var _this4 = this; + _this.setupIMA(); + }); + _defineProperty(this, "setupIMA", function () { // Create the container for our advertisements - this.elements.container = createElement$1('div', { - class: this.player.config.classNames.ads + _this.elements.container = createElement$1('div', { + class: _this.player.config.classNames.ads }); - this.player.elements.container.appendChild(this.elements.container); // So we can run VPAID2 + + _this.player.elements.container.appendChild(_this.elements.container); // So we can run VPAID2 + google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED); // Set language - google.ima.settings.setLocale(this.player.config.ads.language); // Set playback for iOS10+ + google.ima.settings.setLocale(_this.player.config.ads.language); // Set playback for iOS10+ - google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline); // We assume the adContainer is the video container of the plyr element that will house the ads + google.ima.settings.setDisableCustomPlaybackForIOS10Plus(_this.player.config.playsinline); // We assume the adContainer is the video container of the plyr element that will house the ads - this.elements.displayContainer = new google.ima.AdDisplayContainer(this.elements.container, this.player.media); // Create ads loader + _this.elements.displayContainer = new google.ima.AdDisplayContainer(_this.elements.container, _this.player.media); // Create ads loader - this.loader = new google.ima.AdsLoader(this.elements.displayContainer); // Listen and respond to ads loaded and error events + _this.loader = new google.ima.AdsLoader(_this.elements.displayContainer); // Listen and respond to ads loaded and error events - this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, function (event) { - return _this4.onAdsManagerLoaded(event); + _this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, function (event) { + return _this.onAdsManagerLoaded(event); }, false); - this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, function (error) { - return _this4.onAdError(error); + + _this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, function (error) { + return _this.onAdError(error); }, false); // Request video ads to be pre-loaded - this.requestAds(); - } - /** - * Request advertisements - */ - }, { - key: "requestAds", - value: function requestAds() { - var container = this.player.elements.container; + _this.requestAds(); + }); + + _defineProperty(this, "requestAds", function () { + var container = _this.player.elements.container; try { // Request video ads var request = new google.ima.AdsRequest(); - request.adTagUrl = this.tagUrl; // Specify the linear and nonlinear slot sizes. This helps the SDK + request.adTagUrl = _this.tagUrl; // Specify the linear and nonlinear slot sizes. This helps the SDK // to select the correct creative if multiple are returned request.linearAdSlotWidth = container.offsetWidth; @@ -27127,51 +27072,38 @@ typeof navigator === "object" && (function () { request.forceNonLinearFullSlot = false; // Mute based on current state - request.setAdWillPlayMuted(!this.player.muted); - this.loader.requestAds(request); + request.setAdWillPlayMuted(!_this.player.muted); + + _this.loader.requestAds(request); } catch (e) { - this.onAdError(e); + _this.onAdError(e); } - } - /** - * Update the ad countdown - * @param {Boolean} start - */ - - }, { - key: "pollCountdown", - value: function pollCountdown() { - var _this5 = this; + }); + _defineProperty(this, "pollCountdown", function () { var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (!start) { - clearInterval(this.countdownTimer); - this.elements.container.removeAttribute('data-badge-text'); + clearInterval(_this.countdownTimer); + + _this.elements.container.removeAttribute('data-badge-text'); + return; } var update = function update() { - var time = formatTime(Math.max(_this5.manager.getRemainingTime(), 0)); - var label = "".concat(i18n.get('advertisement', _this5.player.config), " - ").concat(time); + var time = formatTime(Math.max(_this.manager.getRemainingTime(), 0)); + var label = "".concat(i18n.get('advertisement', _this.player.config), " - ").concat(time); - _this5.elements.container.setAttribute('data-badge-text', label); + _this.elements.container.setAttribute('data-badge-text', label); }; - this.countdownTimer = setInterval(update, 100); - } - /** - * This method is called whenever the ads are ready inside the AdDisplayContainer - * @param {Event} adsManagerLoadedEvent - */ - - }, { - key: "onAdsManagerLoaded", - value: function onAdsManagerLoaded(event) { - var _this6 = this; + _this.countdownTimer = setInterval(update, 100); + }); + _defineProperty(this, "onAdsManagerLoaded", function (event) { // Load could occur after a source change (race condition) - if (!this.enabled) { + if (!_this.enabled) { return; } // Get the ads manager @@ -27182,38 +27114,36 @@ typeof navigator === "object" && (function () { settings.enablePreloading = true; // The SDK is polling currentTime on the contentPlayback. And needs a duration // so it can determine when to start the mid- and post-roll - this.manager = event.getAdsManager(this.player, settings); // Get the cue points for any mid-rolls by filtering out the pre- and post-roll + _this.manager = event.getAdsManager(_this.player, settings); // Get the cue points for any mid-rolls by filtering out the pre- and post-roll - this.cuePoints = this.manager.getCuePoints(); // Add listeners to the required events + _this.cuePoints = _this.manager.getCuePoints(); // Add listeners to the required events // Advertisement error events - this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, function (error) { - return _this6.onAdError(error); + _this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, function (error) { + return _this.onAdError(error); }); // Advertisement regular events + Object.keys(google.ima.AdEvent.Type).forEach(function (type) { - _this6.manager.addEventListener(google.ima.AdEvent.Type[type], function (e) { - return _this6.onAdEvent(e); + _this.manager.addEventListener(google.ima.AdEvent.Type[type], function (e) { + return _this.onAdEvent(e); }); }); // Resolve our adsManager - this.trigger('loaded'); - } - }, { - key: "addCuePoints", - value: function addCuePoints() { - var _this7 = this; + _this.trigger('loaded'); + }); + _defineProperty(this, "addCuePoints", function () { // Add advertisement cue's within the time line if available - if (!is$2.empty(this.cuePoints)) { - this.cuePoints.forEach(function (cuePoint) { - if (cuePoint !== 0 && cuePoint !== -1 && cuePoint < _this7.player.duration) { - var seekElement = _this7.player.elements.progress; + if (!is$2.empty(_this.cuePoints)) { + _this.cuePoints.forEach(function (cuePoint) { + if (cuePoint !== 0 && cuePoint !== -1 && cuePoint < _this.player.duration) { + var seekElement = _this.player.elements.progress; if (is$2.element(seekElement)) { - var cuePercentage = 100 / _this7.player.duration * cuePoint; + var cuePercentage = 100 / _this.player.duration * cuePoint; var cue = createElement$1('span', { - class: _this7.player.config.classNames.cues + class: _this.player.config.classNames.cues }); cue.style.left = "".concat(cuePercentage.toString(), "%"); seekElement.appendChild(cue); @@ -27221,27 +27151,17 @@ typeof navigator === "object" && (function () { } }); } - } - /** - * This is where all the event handling takes place. Retrieve the ad from the event. Some - * events (e.g. ALL_ADS_COMPLETED) don't have the ad object associated - * https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdEvent.Type - * @param {Event} event - */ + }); - }, { - key: "onAdEvent", - value: function onAdEvent(event) { - var _this8 = this; - - var container = this.player.elements.container; // Retrieve the ad from the event. Some events (e.g. ALL_ADS_COMPLETED) + _defineProperty(this, "onAdEvent", function (event) { + var container = _this.player.elements.container; // Retrieve the ad from the event. Some events (e.g. ALL_ADS_COMPLETED) // don't have ad object associated var ad = event.getAd(); var adData = event.getAdData(); // Proxy event var dispatchEvent = function dispatchEvent(type) { - triggerEvent.call(_this8.player, _this8.player.media, "ads".concat(type.replace(/_/g, '').toLowerCase())); + triggerEvent.call(_this.player, _this.player.media, "ads".concat(type.replace(/_/g, '').toLowerCase())); }; // Bubble the event @@ -27251,9 +27171,10 @@ typeof navigator === "object" && (function () { case google.ima.AdEvent.Type.LOADED: // This is the first event sent for an ad - it is possible to determine whether the // ad is a video ad or an overlay - this.trigger('loaded'); // Start countdown + _this.trigger('loaded'); // Start countdown - this.pollCountdown(true); + + _this.pollCountdown(true); if (!ad.isLinear()) { // Position AdDisplayContainer correctly for overlay @@ -27267,7 +27188,8 @@ typeof navigator === "object" && (function () { case google.ima.AdEvent.Type.STARTED: // Set volume to match player - this.manager.setVolume(this.player.volume); + _this.manager.setVolume(_this.player.volume); + break; case google.ima.AdEvent.Type.ALL_ADS_COMPLETED: @@ -27294,11 +27216,11 @@ typeof navigator === "object" && (function () { // }; // TODO: So there is still this thing where a video should only be allowed to start // playing when the IMA SDK is ready or has failed - if (this.player.ended) { - this.loadAds(); + if (_this.player.ended) { + _this.loadAds(); } else { // The SDK won't allow new ads to be called without receiving a contentComplete() - this.loader.contentComplete(); + _this.loader.contentComplete(); } break; @@ -27307,7 +27229,8 @@ typeof navigator === "object" && (function () { // This event indicates the ad has started - the video player can adjust the UI, // for example display a pause button and remaining time. Fired when content should // be paused. This usually happens right before an ad is about to cover the content - this.pauseContent(); + _this.pauseContent(); + break; case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED: @@ -27315,275 +27238,237 @@ typeof navigator === "object" && (function () { // appropriate UI actions, such as removing the timer for remaining time detection. // Fired when content should be resumed. This usually happens when an ad finishes // or collapses - this.pollCountdown(); - this.resumeContent(); + _this.pollCountdown(); + + _this.resumeContent(); + break; case google.ima.AdEvent.Type.LOG: if (adData.adError) { - this.player.debug.warn("Non-fatal ad error: ".concat(adData.adError.getMessage())); + _this.player.debug.warn("Non-fatal ad error: ".concat(adData.adError.getMessage())); } break; } - } - /** - * Any ad error handling comes through here - * @param {Event} event - */ + }); - }, { - key: "onAdError", - value: function onAdError(event) { - this.cancel(); - this.player.debug.warn('Ads error', event); - } - /** - * Setup hooks for Plyr and window events. This ensures - * the mid- and post-roll launch at the correct time. And - * resize the advertisement when the player resizes - */ + _defineProperty(this, "onAdError", function (event) { + _this.cancel(); - }, { - key: "listeners", - value: function listeners() { - var _this9 = this; + _this.player.debug.warn('Ads error', event); + }); - var container = this.player.elements.container; + _defineProperty(this, "listeners", function () { + var container = _this.player.elements.container; var time; - this.player.on('canplay', function () { - _this9.addCuePoints(); - }); - this.player.on('ended', function () { - _this9.loader.contentComplete(); - }); - this.player.on('timeupdate', function () { - time = _this9.player.currentTime; - }); - this.player.on('seeked', function () { - var seekedTime = _this9.player.currentTime; - if (is$2.empty(_this9.cuePoints)) { + _this.player.on('canplay', function () { + _this.addCuePoints(); + }); + + _this.player.on('ended', function () { + _this.loader.contentComplete(); + }); + + _this.player.on('timeupdate', function () { + time = _this.player.currentTime; + }); + + _this.player.on('seeked', function () { + var seekedTime = _this.player.currentTime; + + if (is$2.empty(_this.cuePoints)) { return; } - _this9.cuePoints.forEach(function (cuePoint, index) { + _this.cuePoints.forEach(function (cuePoint, index) { if (time < cuePoint && cuePoint < seekedTime) { - _this9.manager.discardAdBreak(); + _this.manager.discardAdBreak(); - _this9.cuePoints.splice(index, 1); + _this.cuePoints.splice(index, 1); } }); }); // Listen to the resizing of the window. And resize ad accordingly // TODO: eventually implement ResizeObserver + window.addEventListener('resize', function () { - if (_this9.manager) { - _this9.manager.resize(container.offsetWidth, container.offsetHeight, google.ima.ViewMode.NORMAL); + if (_this.manager) { + _this.manager.resize(container.offsetWidth, container.offsetHeight, google.ima.ViewMode.NORMAL); } }); - } - /** - * Initialize the adsManager and start playing advertisements - */ + }); - }, { - key: "play", - value: function play() { - var _this10 = this; + _defineProperty(this, "play", function () { + var container = _this.player.elements.container; - var container = this.player.elements.container; - - if (!this.managerPromise) { - this.resumeContent(); + if (!_this.managerPromise) { + _this.resumeContent(); } // Play the requested advertisement whenever the adsManager is ready - this.managerPromise.then(function () { + _this.managerPromise.then(function () { // Set volume to match player - _this10.manager.setVolume(_this10.player.volume); // Initialize the container. Must be done via a user action on mobile devices + _this.manager.setVolume(_this.player.volume); // Initialize the container. Must be done via a user action on mobile devices - _this10.elements.displayContainer.initialize(); + _this.elements.displayContainer.initialize(); try { - if (!_this10.initialized) { + if (!_this.initialized) { // Initialize the ads manager. Ad rules playlist will start at this time - _this10.manager.init(container.offsetWidth, container.offsetHeight, google.ima.ViewMode.NORMAL); // Call play to start showing the ad. Single video and overlay ads will + _this.manager.init(container.offsetWidth, container.offsetHeight, google.ima.ViewMode.NORMAL); // Call play to start showing the ad. Single video and overlay ads will // start at this time; the call will be ignored for ad rules - _this10.manager.start(); + _this.manager.start(); } - _this10.initialized = true; + _this.initialized = true; } catch (adError) { // An error may be thrown if there was a problem with the // VAST response - _this10.onAdError(adError); + _this.onAdError(adError); } }).catch(function () {}); - } - /** - * Resume our video - */ + }); - }, { - key: "resumeContent", - value: function resumeContent() { + _defineProperty(this, "resumeContent", function () { // Hide the advertisement container - this.elements.container.style.zIndex = ''; // Ad is stopped + _this.elements.container.style.zIndex = ''; // Ad is stopped - this.playing = false; // Play video + _this.playing = false; // Play video - silencePromise(this.player.media.play()); - } - /** - * Pause our video - */ + silencePromise(_this.player.media.play()); + }); - }, { - key: "pauseContent", - value: function pauseContent() { + _defineProperty(this, "pauseContent", function () { // Show the advertisement container - this.elements.container.style.zIndex = 3; // Ad is playing + _this.elements.container.style.zIndex = 3; // Ad is playing - this.playing = true; // Pause our video. + _this.playing = true; // Pause our video. - this.player.media.pause(); - } - /** - * Destroy the adsManager so we can grab new ads after this. If we don't then we're not - * allowed to call new ads based on google policies, as they interpret this as an accidental - * video requests. https://developers.google.com/interactive- - * media-ads/docs/sdks/android/faq#8 - */ + _this.player.media.pause(); + }); - }, { - key: "cancel", - value: function cancel() { + _defineProperty(this, "cancel", function () { // Pause our video - if (this.initialized) { - this.resumeContent(); + if (_this.initialized) { + _this.resumeContent(); } // Tell our instance that we're done for now - this.trigger('error'); // Re-create our adsManager + _this.trigger('error'); // Re-create our adsManager - this.loadAds(); - } - /** - * Re-create our adsManager - */ - }, { - key: "loadAds", - value: function loadAds() { - var _this11 = this; + _this.loadAds(); + }); + _defineProperty(this, "loadAds", function () { // Tell our adsManager to go bye bye - this.managerPromise.then(function () { + _this.managerPromise.then(function () { // Destroy our adsManager - if (_this11.manager) { - _this11.manager.destroy(); + if (_this.manager) { + _this.manager.destroy(); } // Re-set our adsManager promises - _this11.managerPromise = new Promise(function (resolve) { - _this11.on('loaded', resolve); + _this.managerPromise = new Promise(function (resolve) { + _this.on('loaded', resolve); - _this11.player.debug.log(_this11.manager); + _this.player.debug.log(_this.manager); }); // Now that the manager has been destroyed set it to also be un-initialized - _this11.initialized = false; // Now request some new advertisements + _this.initialized = false; // Now request some new advertisements - _this11.requestAds(); + _this.requestAds(); }).catch(function () {}); - } - /** - * Handles callbacks after an ad event was invoked - * @param {String} event - Event type - */ - - }, { - key: "trigger", - value: function trigger(event) { - var _this12 = this; + }); + _defineProperty(this, "trigger", function (event) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } - var handlers = this.events[event]; + var handlers = _this.events[event]; if (is$2.array(handlers)) { handlers.forEach(function (handler) { if (is$2.function(handler)) { - handler.apply(_this12, args); + handler.apply(_this, args); } }); } - } - /** - * Add event listeners - * @param {String} event - Event type - * @param {Function} callback - Callback for when event occurs - * @return {Ads} - */ + }); - }, { - key: "on", - value: function on(event, callback) { - if (!is$2.array(this.events[event])) { - this.events[event] = []; + _defineProperty(this, "on", function (event, callback) { + if (!is$2.array(_this.events[event])) { + _this.events[event] = []; } - this.events[event].push(callback); - return this; - } - /** - * Setup a safety timer for when the ad network doesn't respond for whatever reason. - * The advertisement has 12 seconds to get its things together. We stop this timer when the - * advertisement is playing, or when a user action is required to start, then we clear the - * timer on ad ready - * @param {Number} time - * @param {String} from - */ + _this.events[event].push(callback); - }, { - key: "startSafetyTimer", - value: function startSafetyTimer(time, from) { - var _this13 = this; + return _this; + }); - this.player.debug.log("Safety timer invoked from: ".concat(from)); - this.safetyTimer = setTimeout(function () { - _this13.cancel(); + _defineProperty(this, "startSafetyTimer", function (time, from) { + _this.player.debug.log("Safety timer invoked from: ".concat(from)); - _this13.clearSafetyTimer('startSafetyTimer()'); + _this.safetyTimer = setTimeout(function () { + _this.cancel(); + + _this.clearSafetyTimer('startSafetyTimer()'); }, time); - } - /** - * Clear our safety timer(s) - * @param {String} from - */ + }); - }, { - key: "clearSafetyTimer", - value: function clearSafetyTimer(from) { - if (!is$2.nullOrUndefined(this.safetyTimer)) { - this.player.debug.log("Safety timer cleared from: ".concat(from)); - clearTimeout(this.safetyTimer); - this.safetyTimer = null; + _defineProperty(this, "clearSafetyTimer", function (from) { + if (!is$2.nullOrUndefined(_this.safetyTimer)) { + _this.player.debug.log("Safety timer cleared from: ".concat(from)); + + clearTimeout(_this.safetyTimer); + _this.safetyTimer = null; } - } - }, { + }); + + this.player = player; + this.config = player.config.ads; + this.playing = false; + this.initialized = false; + this.elements = { + container: null, + displayContainer: null + }; + this.manager = null; + this.loader = null; + this.cuePoints = null; + this.events = {}; + this.safetyTimer = null; + this.countdownTimer = null; // Setup a promise to resolve when the IMA manager is ready + + this.managerPromise = new Promise(function (resolve, reject) { + // The ad is loaded and ready + _this.on('loaded', resolve); // Ads failed + + + _this.on('error', reject); + }); + this.load(); + } + + _createClass(Ads, [{ key: "enabled", get: function get() { var config = this.config; return this.player.isHTML5 && this.player.isVideo && config.enabled && (!is$2.empty(config.publisherId) || is$2.url(config.tagUrl)); } + /** + * Load the IMA SDK + */ + }, { key: "tagUrl", + // Build the tag URL get: function get() { var config = this.config; @@ -27603,6 +27488,15 @@ typeof navigator === "object" && (function () { var base = 'https://go.aniview.com/api/adserver6/vast/'; return "".concat(base, "?").concat(buildUrlParams(params)); } + /** + * In order for the SDK to display ads for our video, we need to tell it where to put them, + * so here we define our ad container. This div is set up to render on top of the video player. + * Using the code below, we tell the SDK to render ads within that div. We also provide a + * handle to the content video player - the SDK will poll the current time of our player to + * properly place mid-rolls. After we create the ad display container, we initialize it. On + * mobile devices, this initialization is done as the result of a user action. + */ + }]); return Ads; @@ -27736,36 +27630,21 @@ typeof navigator === "object" && (function () { * @return {PreviewThumbnails} */ function PreviewThumbnails(player) { + var _this = this; + _classCallCheck(this, PreviewThumbnails); - this.player = player; - this.thumbnails = []; - this.loaded = false; - this.lastMouseMoveTime = Date.now(); - this.mouseDown = false; - this.loadedImages = []; - this.elements = { - thumb: {}, - scrubbing: {} - }; - this.load(); - } - - _createClass(PreviewThumbnails, [{ - key: "load", - value: function load() { - var _this = this; - + _defineProperty(this, "load", function () { // Toggle the regular seek tooltip - if (this.player.elements.display.seekTooltip) { - this.player.elements.display.seekTooltip.hidden = this.enabled; + if (_this.player.elements.display.seekTooltip) { + _this.player.elements.display.seekTooltip.hidden = _this.enabled; } - if (!this.enabled) { + if (!_this.enabled) { return; } - this.getThumbnails().then(function () { + _this.getThumbnails().then(function () { if (!_this.enabled) { return; } // Render DOM elements @@ -27778,15 +27657,11 @@ typeof navigator === "object" && (function () { _this.loaded = true; }); - } // Download VTT files and parse them - - }, { - key: "getThumbnails", - value: function getThumbnails() { - var _this2 = this; + }); + _defineProperty(this, "getThumbnails", function () { return new Promise(function (resolve) { - var src = _this2.player.config.previewThumbnails.src; + var src = _this.player.config.previewThumbnails.src; if (is$2.empty(src)) { throw new Error('Missing previewThumbnails.src config attribute'); @@ -27795,11 +27670,11 @@ typeof navigator === "object" && (function () { var sortAndResolve = function sortAndResolve() { // Sort smallest to biggest (e.g., [120p, 480p, 1080p]) - _this2.thumbnails.sort(function (x, y) { + _this.thumbnails.sort(function (x, y) { return x.height - y.height; }); - _this2.player.debug.log('Preview thumbnails', _this2.thumbnails); + _this.player.debug.log('Preview thumbnails', _this.thumbnails); resolve(); }; // Via callback() @@ -27807,7 +27682,7 @@ typeof navigator === "object" && (function () { if (is$2.function(src)) { src(function (thumbnails) { - _this2.thumbnails = thumbnails; + _this.thumbnails = thumbnails; sortAndResolve(); }); } // VTT urls @@ -27816,19 +27691,15 @@ typeof navigator === "object" && (function () { var urls = is$2.string(src) ? [src] : src; // Loop through each src URL. Download and process the VTT file, storing the resulting data in this.thumbnails var promises = urls.map(function (u) { - return _this2.getThumbnail(u); + return _this.getThumbnail(u); }); // Resolve Promise.all(promises).then(sortAndResolve); } }); - } // Process individual VTT file - - }, { - key: "getThumbnail", - value: function getThumbnail(url) { - var _this3 = this; + }); + _defineProperty(this, "getThumbnail", function (url) { return new Promise(function (resolve) { fetch(url).then(function (response) { var thumbnail = { @@ -27850,7 +27721,7 @@ typeof navigator === "object" && (function () { thumbnail.height = tempImage.naturalHeight; thumbnail.width = tempImage.naturalWidth; - _this3.thumbnails.push(thumbnail); + _this.thumbnails.push(thumbnail); resolve(); }; @@ -27858,11 +27729,10 @@ typeof navigator === "object" && (function () { tempImage.src = thumbnail.urlPrefix + thumbnail.frames[0].text; }); }); - } - }, { - key: "startMove", - value: function startMove(event) { - if (!this.loaded) { + }); + + _defineProperty(this, "startMove", function (event) { + if (!_this.loaded) { return; } @@ -27871,163 +27741,153 @@ typeof navigator === "object" && (function () { } // Wait until media has a duration - if (!this.player.media.duration) { + if (!_this.player.media.duration) { return; } if (event.type === 'touchmove') { // Calculate seek hover position as approx video seconds - this.seekTime = this.player.media.duration * (this.player.elements.inputs.seek.value / 100); + _this.seekTime = _this.player.media.duration * (_this.player.elements.inputs.seek.value / 100); } else { // Calculate seek hover position as approx video seconds - var clientRect = this.player.elements.progress.getBoundingClientRect(); + var clientRect = _this.player.elements.progress.getBoundingClientRect(); + var percentage = 100 / clientRect.width * (event.pageX - clientRect.left); - this.seekTime = this.player.media.duration * (percentage / 100); + _this.seekTime = _this.player.media.duration * (percentage / 100); - if (this.seekTime < 0) { + if (_this.seekTime < 0) { // The mousemove fires for 10+px out to the left - this.seekTime = 0; + _this.seekTime = 0; } - if (this.seekTime > this.player.media.duration - 1) { + if (_this.seekTime > _this.player.media.duration - 1) { // Took 1 second off the duration for safety, because different players can disagree on the real duration of a video - this.seekTime = this.player.media.duration - 1; + _this.seekTime = _this.player.media.duration - 1; } - this.mousePosX = event.pageX; // Set time text inside image container + _this.mousePosX = event.pageX; // Set time text inside image container - this.elements.thumb.time.innerText = formatTime(this.seekTime); + _this.elements.thumb.time.innerText = formatTime(_this.seekTime); } // Download and show image - this.showImageAtCurrentTime(); - } - }, { - key: "endMove", - value: function endMove() { - this.toggleThumbContainer(false, true); - } - }, { - key: "startScrubbing", - value: function startScrubbing(event) { + _this.showImageAtCurrentTime(); + }); + + _defineProperty(this, "endMove", function () { + _this.toggleThumbContainer(false, true); + }); + + _defineProperty(this, "startScrubbing", function (event) { // Only act on left mouse button (0), or touch device (event.button does not exist or is false) if (is$2.nullOrUndefined(event.button) || event.button === false || event.button === 0) { - this.mouseDown = true; // Wait until media has a duration + _this.mouseDown = true; // Wait until media has a duration - if (this.player.media.duration) { - this.toggleScrubbingContainer(true); - this.toggleThumbContainer(false, true); // Download and show image + if (_this.player.media.duration) { + _this.toggleScrubbingContainer(true); - this.showImageAtCurrentTime(); + _this.toggleThumbContainer(false, true); // Download and show image + + + _this.showImageAtCurrentTime(); } } - } - }, { - key: "endScrubbing", - value: function endScrubbing() { - var _this4 = this; + }); - this.mouseDown = false; // Hide scrubbing preview. But wait until the video has successfully seeked before hiding the scrubbing preview + _defineProperty(this, "endScrubbing", function () { + _this.mouseDown = false; // Hide scrubbing preview. But wait until the video has successfully seeked before hiding the scrubbing preview - if (Math.ceil(this.lastTime) === Math.ceil(this.player.media.currentTime)) { + if (Math.ceil(_this.lastTime) === Math.ceil(_this.player.media.currentTime)) { // The video was already seeked/loaded at the chosen time - hide immediately - this.toggleScrubbingContainer(false); + _this.toggleScrubbingContainer(false); } else { // The video hasn't seeked yet. Wait for that - once.call(this.player, this.player.media, 'timeupdate', function () { + once.call(_this.player, _this.player.media, 'timeupdate', function () { // Re-check mousedown - we might have already started scrubbing again - if (!_this4.mouseDown) { - _this4.toggleScrubbingContainer(false); + if (!_this.mouseDown) { + _this.toggleScrubbingContainer(false); } }); } - } - /** - * Setup hooks for Plyr and window events - */ - - }, { - key: "listeners", - value: function listeners() { - var _this5 = this; + }); + _defineProperty(this, "listeners", function () { // Hide thumbnail preview - on mouse click, mouse leave (in listeners.js for now), and video play/seek. All four are required, e.g., for buffering - this.player.on('play', function () { - _this5.toggleThumbContainer(false, true); + _this.player.on('play', function () { + _this.toggleThumbContainer(false, true); }); - this.player.on('seeked', function () { - _this5.toggleThumbContainer(false); - }); - this.player.on('timeupdate', function () { - _this5.lastTime = _this5.player.media.currentTime; - }); - } - /** - * Create HTML elements for image containers - */ - }, { - key: "render", - value: function render() { + _this.player.on('seeked', function () { + _this.toggleThumbContainer(false); + }); + + _this.player.on('timeupdate', function () { + _this.lastTime = _this.player.media.currentTime; + }); + }); + + _defineProperty(this, "render", function () { // Create HTML element: plyr__preview-thumbnail-container - this.elements.thumb.container = createElement$1('div', { - class: this.player.config.classNames.previewThumbnails.thumbContainer + _this.elements.thumb.container = createElement$1('div', { + class: _this.player.config.classNames.previewThumbnails.thumbContainer }); // Wrapper for the image for styling - this.elements.thumb.imageContainer = createElement$1('div', { - class: this.player.config.classNames.previewThumbnails.imageContainer + _this.elements.thumb.imageContainer = createElement$1('div', { + class: _this.player.config.classNames.previewThumbnails.imageContainer }); - this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer); // Create HTML element, parent+span: time text (e.g., 01:32:00) + + _this.elements.thumb.container.appendChild(_this.elements.thumb.imageContainer); // Create HTML element, parent+span: time text (e.g., 01:32:00) + var timeContainer = createElement$1('div', { - class: this.player.config.classNames.previewThumbnails.timeContainer + class: _this.player.config.classNames.previewThumbnails.timeContainer }); - this.elements.thumb.time = createElement$1('span', {}, '00:00'); - timeContainer.appendChild(this.elements.thumb.time); - this.elements.thumb.container.appendChild(timeContainer); // Inject the whole thumb + _this.elements.thumb.time = createElement$1('span', {}, '00:00'); + timeContainer.appendChild(_this.elements.thumb.time); - if (is$2.element(this.player.elements.progress)) { - this.player.elements.progress.appendChild(this.elements.thumb.container); + _this.elements.thumb.container.appendChild(timeContainer); // Inject the whole thumb + + + if (is$2.element(_this.player.elements.progress)) { + _this.player.elements.progress.appendChild(_this.elements.thumb.container); } // Create HTML element: plyr__preview-scrubbing-container - this.elements.scrubbing.container = createElement$1('div', { - class: this.player.config.classNames.previewThumbnails.scrubbingContainer + _this.elements.scrubbing.container = createElement$1('div', { + class: _this.player.config.classNames.previewThumbnails.scrubbingContainer }); - this.player.elements.wrapper.appendChild(this.elements.scrubbing.container); - } - }, { - key: "destroy", - value: function destroy() { - if (this.elements.thumb.container) { - this.elements.thumb.container.remove(); + + _this.player.elements.wrapper.appendChild(_this.elements.scrubbing.container); + }); + + _defineProperty(this, "destroy", function () { + if (_this.elements.thumb.container) { + _this.elements.thumb.container.remove(); } - if (this.elements.scrubbing.container) { - this.elements.scrubbing.container.remove(); + if (_this.elements.scrubbing.container) { + _this.elements.scrubbing.container.remove(); } - } - }, { - key: "showImageAtCurrentTime", - value: function showImageAtCurrentTime() { - var _this6 = this; + }); - if (this.mouseDown) { - this.setScrubbingContainerSize(); + _defineProperty(this, "showImageAtCurrentTime", function () { + if (_this.mouseDown) { + _this.setScrubbingContainerSize(); } else { - this.setThumbContainerSizeAndPos(); + _this.setThumbContainerSizeAndPos(); } // Find the desired thumbnail index // TODO: Handle a video longer than the thumbs where thumbNum is null - var thumbNum = this.thumbnails[0].frames.findIndex(function (frame) { - return _this6.seekTime >= frame.startTime && _this6.seekTime <= frame.endTime; + var thumbNum = _this.thumbnails[0].frames.findIndex(function (frame) { + return _this.seekTime >= frame.startTime && _this.seekTime <= frame.endTime; }); + var hasThumb = thumbNum >= 0; var qualityIndex = 0; // Show the thumb container if we're not scrubbing - if (!this.mouseDown) { - this.toggleThumbContainer(hasThumb); + if (!_this.mouseDown) { + _this.toggleThumbContainer(hasThumb); } // No matching thumb found @@ -28036,36 +27896,34 @@ typeof navigator === "object" && (function () { } // Check to see if we've already downloaded higher quality versions of this image - this.thumbnails.forEach(function (thumbnail, index) { - if (_this6.loadedImages.includes(thumbnail.frames[thumbNum].text)) { + _this.thumbnails.forEach(function (thumbnail, index) { + if (_this.loadedImages.includes(thumbnail.frames[thumbNum].text)) { qualityIndex = index; } }); // Only proceed if either thumbnum or thumbfilename has changed - if (thumbNum !== this.showingThumb) { - this.showingThumb = thumbNum; - this.loadImage(qualityIndex); + + if (thumbNum !== _this.showingThumb) { + _this.showingThumb = thumbNum; + + _this.loadImage(qualityIndex); } - } // Show the image that's currently specified in this.showingThumb - - }, { - key: "loadImage", - value: function loadImage() { - var _this7 = this; + }); + _defineProperty(this, "loadImage", function () { var qualityIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var thumbNum = this.showingThumb; - var thumbnail = this.thumbnails[qualityIndex]; + var thumbNum = _this.showingThumb; + var thumbnail = _this.thumbnails[qualityIndex]; var urlPrefix = thumbnail.urlPrefix; var frame = thumbnail.frames[thumbNum]; var thumbFilename = thumbnail.frames[thumbNum].text; var thumbUrl = urlPrefix + thumbFilename; - if (!this.currentImageElement || this.currentImageElement.dataset.filename !== thumbFilename) { + if (!_this.currentImageElement || _this.currentImageElement.dataset.filename !== thumbFilename) { // If we're already loading a previous image, remove its onload handler - we don't want it to load after this one // Only do this if not using sprites. Without sprites we really want to show as many images as possible, as a best-effort - if (this.loadingImage && this.usingSprites) { - this.loadingImage.onload = null; + if (_this.loadingImage && _this.usingSprites) { + _this.loadingImage.onload = null; } // We're building and adding a new image. In other implementations of similar functionality (YouTube), background image // is instead used. But this causes issues with larger images in Firefox and Safari - switching between background // images causes a flicker. Putting a new image over the top does not @@ -28075,56 +27933,59 @@ typeof navigator === "object" && (function () { previewImage.src = thumbUrl; previewImage.dataset.index = thumbNum; previewImage.dataset.filename = thumbFilename; - this.showingThumbFilename = thumbFilename; - this.player.debug.log("Loading image: ".concat(thumbUrl)); // For some reason, passing the named function directly causes it to execute immediately. So I've wrapped it in an anonymous function... + _this.showingThumbFilename = thumbFilename; + + _this.player.debug.log("Loading image: ".concat(thumbUrl)); // For some reason, passing the named function directly causes it to execute immediately. So I've wrapped it in an anonymous function... + previewImage.onload = function () { - return _this7.showImage(previewImage, frame, qualityIndex, thumbNum, thumbFilename, true); + return _this.showImage(previewImage, frame, qualityIndex, thumbNum, thumbFilename, true); }; - this.loadingImage = previewImage; - this.removeOldImages(previewImage); + _this.loadingImage = previewImage; + + _this.removeOldImages(previewImage); } else { // Update the existing image - this.showImage(this.currentImageElement, frame, qualityIndex, thumbNum, thumbFilename, false); - this.currentImageElement.dataset.index = thumbNum; - this.removeOldImages(this.currentImageElement); + _this.showImage(_this.currentImageElement, frame, qualityIndex, thumbNum, thumbFilename, false); + + _this.currentImageElement.dataset.index = thumbNum; + + _this.removeOldImages(_this.currentImageElement); } - } - }, { - key: "showImage", - value: function showImage(previewImage, frame, qualityIndex, thumbNum, thumbFilename) { + }); + + _defineProperty(this, "showImage", function (previewImage, frame, qualityIndex, thumbNum, thumbFilename) { var newImage = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true; - this.player.debug.log("Showing thumb: ".concat(thumbFilename, ". num: ").concat(thumbNum, ". qual: ").concat(qualityIndex, ". newimg: ").concat(newImage)); - this.setImageSizeAndOffset(previewImage, frame); + + _this.player.debug.log("Showing thumb: ".concat(thumbFilename, ". num: ").concat(thumbNum, ". qual: ").concat(qualityIndex, ". newimg: ").concat(newImage)); + + _this.setImageSizeAndOffset(previewImage, frame); if (newImage) { - this.currentImageContainer.appendChild(previewImage); - this.currentImageElement = previewImage; + _this.currentImageContainer.appendChild(previewImage); - if (!this.loadedImages.includes(thumbFilename)) { - this.loadedImages.push(thumbFilename); + _this.currentImageElement = previewImage; + + if (!_this.loadedImages.includes(thumbFilename)) { + _this.loadedImages.push(thumbFilename); } } // Preload images before and after the current one // Show higher quality of the same frame // Each step here has a short time delay, and only continues if still hovering/seeking the same spot. This is to protect slow connections from overloading - this.preloadNearby(thumbNum, true).then(this.preloadNearby(thumbNum, false)).then(this.getHigherQuality(qualityIndex, previewImage, frame, thumbFilename)); - } // Remove all preview images that aren't the designated current image - - }, { - key: "removeOldImages", - value: function removeOldImages(currentImage) { - var _this8 = this; + _this.preloadNearby(thumbNum, true).then(_this.preloadNearby(thumbNum, false)).then(_this.getHigherQuality(qualityIndex, previewImage, frame, thumbFilename)); + }); + _defineProperty(this, "removeOldImages", function (currentImage) { // Get a list of all images, convert it from a DOM list to an array - Array.from(this.currentImageContainer.children).forEach(function (image) { + Array.from(_this.currentImageContainer.children).forEach(function (image) { if (image.tagName.toLowerCase() !== 'img') { return; } - var removeDelay = _this8.usingSprites ? 500 : 1000; + var removeDelay = _this.usingSprites ? 500 : 1000; if (image.dataset.index !== currentImage.dataset.index && !image.dataset.deleting) { // Wait 200ms, as the new image can take some time to show on certain browsers (even though it was downloaded before showing). This will prevent flicker, and show some generosity towards slower clients @@ -28132,35 +27993,30 @@ typeof navigator === "object" && (function () { // eslint-disable-next-line no-param-reassign image.dataset.deleting = true; // This has to be set before the timeout - to prevent issues switching between hover and scrub - var currentImageContainer = _this8.currentImageContainer; + var currentImageContainer = _this.currentImageContainer; setTimeout(function () { currentImageContainer.removeChild(image); - _this8.player.debug.log("Removing thumb: ".concat(image.dataset.filename)); + _this.player.debug.log("Removing thumb: ".concat(image.dataset.filename)); }, removeDelay); } }); - } // Preload images before and after the current one. Only if the user is still hovering/seeking the same frame - // This will only preload the lowest quality - - }, { - key: "preloadNearby", - value: function preloadNearby(thumbNum) { - var _this9 = this; + }); + _defineProperty(this, "preloadNearby", function (thumbNum) { var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; return new Promise(function (resolve) { setTimeout(function () { - var oldThumbFilename = _this9.thumbnails[0].frames[thumbNum].text; + var oldThumbFilename = _this.thumbnails[0].frames[thumbNum].text; - if (_this9.showingThumbFilename === oldThumbFilename) { + if (_this.showingThumbFilename === oldThumbFilename) { // Find the nearest thumbs with different filenames. Sometimes it'll be the next index, but in the case of sprites, it might be 100+ away var thumbnailsClone; if (forward) { - thumbnailsClone = _this9.thumbnails[0].frames.slice(thumbNum); + thumbnailsClone = _this.thumbnails[0].frames.slice(thumbNum); } else { - thumbnailsClone = _this9.thumbnails[0].frames.slice(0, thumbNum).reverse(); + thumbnailsClone = _this.thumbnails[0].frames.slice(0, thumbNum).reverse(); } var foundOne = false; @@ -28169,20 +28025,20 @@ typeof navigator === "object" && (function () { if (newThumbFilename !== oldThumbFilename) { // Found one with a different filename. Make sure it hasn't already been loaded on this page visit - if (!_this9.loadedImages.includes(newThumbFilename)) { + if (!_this.loadedImages.includes(newThumbFilename)) { foundOne = true; - _this9.player.debug.log("Preloading thumb filename: ".concat(newThumbFilename)); + _this.player.debug.log("Preloading thumb filename: ".concat(newThumbFilename)); - var urlPrefix = _this9.thumbnails[0].urlPrefix; + var urlPrefix = _this.thumbnails[0].urlPrefix; var thumbURL = urlPrefix + newThumbFilename; var previewImage = new Image(); previewImage.src = thumbURL; previewImage.onload = function () { - _this9.player.debug.log("Preloaded thumb filename: ".concat(newThumbFilename)); + _this.player.debug.log("Preloaded thumb filename: ".concat(newThumbFilename)); - if (!_this9.loadedImages.includes(newThumbFilename)) _this9.loadedImages.push(newThumbFilename); // We don't resolve until the thumb is loaded + if (!_this.loadedImages.includes(newThumbFilename)) _this.loadedImages.push(newThumbFilename); // We don't resolve until the thumb is loaded resolve(); }; @@ -28196,97 +28052,91 @@ typeof navigator === "object" && (function () { } }, 300); }); - } // If user has been hovering current image for half a second, look for a higher quality one + }); - }, { - key: "getHigherQuality", - value: function getHigherQuality(currentQualityIndex, previewImage, frame, thumbFilename) { - var _this10 = this; - - if (currentQualityIndex < this.thumbnails.length - 1) { + _defineProperty(this, "getHigherQuality", function (currentQualityIndex, previewImage, frame, thumbFilename) { + if (currentQualityIndex < _this.thumbnails.length - 1) { // Only use the higher quality version if it's going to look any better - if the current thumb is of a lower pixel density than the thumbnail container var previewImageHeight = previewImage.naturalHeight; - if (this.usingSprites) { + if (_this.usingSprites) { previewImageHeight = frame.h; } - if (previewImageHeight < this.thumbContainerHeight) { + if (previewImageHeight < _this.thumbContainerHeight) { // Recurse back to the loadImage function - show a higher quality one, but only if the viewer is on this frame for a while setTimeout(function () { // Make sure the mouse hasn't already moved on and started hovering at another image - if (_this10.showingThumbFilename === thumbFilename) { - _this10.player.debug.log("Showing higher quality thumb for: ".concat(thumbFilename)); + if (_this.showingThumbFilename === thumbFilename) { + _this.player.debug.log("Showing higher quality thumb for: ".concat(thumbFilename)); - _this10.loadImage(currentQualityIndex + 1); + _this.loadImage(currentQualityIndex + 1); } }, 300); } } - } - }, { - key: "toggleThumbContainer", - value: function toggleThumbContainer() { + }); + + _defineProperty(this, "toggleThumbContainer", function () { var toggle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var clearShowing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var className = this.player.config.classNames.previewThumbnails.thumbContainerShown; - this.elements.thumb.container.classList.toggle(className, toggle); + var className = _this.player.config.classNames.previewThumbnails.thumbContainerShown; + + _this.elements.thumb.container.classList.toggle(className, toggle); if (!toggle && clearShowing) { - this.showingThumb = null; - this.showingThumbFilename = null; + _this.showingThumb = null; + _this.showingThumbFilename = null; } - } - }, { - key: "toggleScrubbingContainer", - value: function toggleScrubbingContainer() { + }); + + _defineProperty(this, "toggleScrubbingContainer", function () { var toggle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - var className = this.player.config.classNames.previewThumbnails.scrubbingContainerShown; - this.elements.scrubbing.container.classList.toggle(className, toggle); + var className = _this.player.config.classNames.previewThumbnails.scrubbingContainerShown; + + _this.elements.scrubbing.container.classList.toggle(className, toggle); if (!toggle) { - this.showingThumb = null; - this.showingThumbFilename = null; + _this.showingThumb = null; + _this.showingThumbFilename = null; } - } - }, { - key: "determineContainerAutoSizing", - value: function determineContainerAutoSizing() { - if (this.elements.thumb.imageContainer.clientHeight > 20 || this.elements.thumb.imageContainer.clientWidth > 20) { + }); + + _defineProperty(this, "determineContainerAutoSizing", function () { + if (_this.elements.thumb.imageContainer.clientHeight > 20 || _this.elements.thumb.imageContainer.clientWidth > 20) { // This will prevent auto sizing in this.setThumbContainerSizeAndPos() - this.sizeSpecifiedInCSS = true; + _this.sizeSpecifiedInCSS = true; } - } // Set the size to be about a quarter of the size of video. Unless option dynamicSize === false, in which case it needs to be set in CSS + }); - }, { - key: "setThumbContainerSizeAndPos", - value: function setThumbContainerSizeAndPos() { - if (!this.sizeSpecifiedInCSS) { - var thumbWidth = Math.floor(this.thumbContainerHeight * this.thumbAspectRatio); - this.elements.thumb.imageContainer.style.height = "".concat(this.thumbContainerHeight, "px"); - this.elements.thumb.imageContainer.style.width = "".concat(thumbWidth, "px"); - } else if (this.elements.thumb.imageContainer.clientHeight > 20 && this.elements.thumb.imageContainer.clientWidth < 20) { - var _thumbWidth = Math.floor(this.elements.thumb.imageContainer.clientHeight * this.thumbAspectRatio); + _defineProperty(this, "setThumbContainerSizeAndPos", function () { + if (!_this.sizeSpecifiedInCSS) { + var thumbWidth = Math.floor(_this.thumbContainerHeight * _this.thumbAspectRatio); + _this.elements.thumb.imageContainer.style.height = "".concat(_this.thumbContainerHeight, "px"); + _this.elements.thumb.imageContainer.style.width = "".concat(thumbWidth, "px"); + } else if (_this.elements.thumb.imageContainer.clientHeight > 20 && _this.elements.thumb.imageContainer.clientWidth < 20) { + var _thumbWidth = Math.floor(_this.elements.thumb.imageContainer.clientHeight * _this.thumbAspectRatio); - this.elements.thumb.imageContainer.style.width = "".concat(_thumbWidth, "px"); - } else if (this.elements.thumb.imageContainer.clientHeight < 20 && this.elements.thumb.imageContainer.clientWidth > 20) { - var thumbHeight = Math.floor(this.elements.thumb.imageContainer.clientWidth / this.thumbAspectRatio); - this.elements.thumb.imageContainer.style.height = "".concat(thumbHeight, "px"); + _this.elements.thumb.imageContainer.style.width = "".concat(_thumbWidth, "px"); + } else if (_this.elements.thumb.imageContainer.clientHeight < 20 && _this.elements.thumb.imageContainer.clientWidth > 20) { + var thumbHeight = Math.floor(_this.elements.thumb.imageContainer.clientWidth / _this.thumbAspectRatio); + _this.elements.thumb.imageContainer.style.height = "".concat(thumbHeight, "px"); } - this.setThumbContainerPos(); - } - }, { - key: "setThumbContainerPos", - value: function setThumbContainerPos() { - var seekbarRect = this.player.elements.progress.getBoundingClientRect(); - var plyrRect = this.player.elements.container.getBoundingClientRect(); - var container = this.elements.thumb.container; // Find the lowest and highest desired left-position, so we don't slide out the side of the video container + _this.setThumbContainerPos(); + }); + + _defineProperty(this, "setThumbContainerPos", function () { + var seekbarRect = _this.player.elements.progress.getBoundingClientRect(); + + var plyrRect = _this.player.elements.container.getBoundingClientRect(); + + var container = _this.elements.thumb.container; // Find the lowest and highest desired left-position, so we don't slide out the side of the video container var minVal = plyrRect.left - seekbarRect.left + 10; var maxVal = plyrRect.right - seekbarRect.left - container.clientWidth - 10; // Set preview container position to: mousepos, minus seekbar.left, minus half of previewContainer.clientWidth - var previewPos = this.mousePosX - seekbarRect.left - container.clientWidth / 2; + var previewPos = _this.mousePosX - seekbarRect.left - container.clientWidth / 2; if (previewPos < minVal) { previewPos = minVal; @@ -28297,31 +28147,27 @@ typeof navigator === "object" && (function () { } container.style.left = "".concat(previewPos, "px"); - } // Can't use 100% width, in case the video is a different aspect ratio to the video container + }); - }, { - key: "setScrubbingContainerSize", - value: function setScrubbingContainerSize() { - var _fitRatio = fitRatio(this.thumbAspectRatio, { - width: this.player.media.clientWidth, - height: this.player.media.clientHeight + _defineProperty(this, "setScrubbingContainerSize", function () { + var _fitRatio = fitRatio(_this.thumbAspectRatio, { + width: _this.player.media.clientWidth, + height: _this.player.media.clientHeight }), width = _fitRatio.width, height = _fitRatio.height; - this.elements.scrubbing.container.style.width = "".concat(width, "px"); - this.elements.scrubbing.container.style.height = "".concat(height, "px"); - } // Sprites need to be offset to the correct location + _this.elements.scrubbing.container.style.width = "".concat(width, "px"); + _this.elements.scrubbing.container.style.height = "".concat(height, "px"); + }); - }, { - key: "setImageSizeAndOffset", - value: function setImageSizeAndOffset(previewImage, frame) { - if (!this.usingSprites) { + _defineProperty(this, "setImageSizeAndOffset", function (previewImage, frame) { + if (!_this.usingSprites) { return; } // Find difference between height and preview container height - var multiplier = this.thumbContainerHeight / frame.h; // eslint-disable-next-line no-param-reassign + var multiplier = _this.thumbContainerHeight / frame.h; // eslint-disable-next-line no-param-reassign previewImage.style.height = "".concat(previewImage.naturalHeight * multiplier, "px"); // eslint-disable-next-line no-param-reassign @@ -28330,8 +28176,22 @@ typeof navigator === "object" && (function () { previewImage.style.left = "-".concat(frame.x * multiplier, "px"); // eslint-disable-next-line no-param-reassign previewImage.style.top = "-".concat(frame.y * multiplier, "px"); - } - }, { + }); + + this.player = player; + this.thumbnails = []; + this.loaded = false; + this.lastMouseMoveTime = Date.now(); + this.mouseDown = false; + this.loadedImages = []; + this.elements = { + thumb: {}, + scrubbing: {} + }; + this.load(); + } + + _createClass(PreviewThumbnails, [{ key: "enabled", get: function get() { return this.player.isHTML5 && this.player.isVideo && this.player.config.previewThumbnails.enabled; @@ -28577,6 +28437,214 @@ typeof navigator === "object" && (function () { _classCallCheck(this, Plyr); + _defineProperty(this, "play", function () { + if (!is$2.function(_this.media.play)) { + return null; + } // Intecept play with ads + + + if (_this.ads && _this.ads.enabled) { + _this.ads.managerPromise.then(function () { + return _this.ads.play(); + }).catch(function () { + return silencePromise(_this.media.play()); + }); + } // Return the promise (for HTML5) + + + return _this.media.play(); + }); + + _defineProperty(this, "pause", function () { + if (!_this.playing || !is$2.function(_this.media.pause)) { + return null; + } + + return _this.media.pause(); + }); + + _defineProperty(this, "togglePlay", function (input) { + // Toggle based on current state if nothing passed + var toggle = is$2.boolean(input) ? input : !_this.playing; + + if (toggle) { + return _this.play(); + } + + return _this.pause(); + }); + + _defineProperty(this, "stop", function () { + if (_this.isHTML5) { + _this.pause(); + + _this.restart(); + } else if (is$2.function(_this.media.stop)) { + _this.media.stop(); + } + }); + + _defineProperty(this, "restart", function () { + _this.currentTime = 0; + }); + + _defineProperty(this, "rewind", function (seekTime) { + _this.currentTime -= is$2.number(seekTime) ? seekTime : _this.config.seekTime; + }); + + _defineProperty(this, "forward", function (seekTime) { + _this.currentTime += is$2.number(seekTime) ? seekTime : _this.config.seekTime; + }); + + _defineProperty(this, "increaseVolume", function (step) { + var volume = _this.media.muted ? 0 : _this.volume; + _this.volume = volume + (is$2.number(step) ? step : 0); + }); + + _defineProperty(this, "decreaseVolume", function (step) { + _this.increaseVolume(-step); + }); + + _defineProperty(this, "airplay", function () { + // Show dialog if supported + if (support.airplay) { + _this.media.webkitShowPlaybackTargetPicker(); + } + }); + + _defineProperty(this, "toggleControls", function (toggle) { + // Don't toggle if missing UI support or if it's audio + if (_this.supported.ui && !_this.isAudio) { + // Get state before change + var isHidden = hasClass(_this.elements.container, _this.config.classNames.hideControls); // Negate the argument if not undefined since adding the class to hides the controls + + var force = typeof toggle === 'undefined' ? undefined : !toggle; // Apply and get updated state + + var hiding = toggleClass(_this.elements.container, _this.config.classNames.hideControls, force); // Close menu + + if (hiding && is$2.array(_this.config.controls) && _this.config.controls.includes('settings') && !is$2.empty(_this.config.settings)) { + controls.toggleMenu.call(_this, false); + } // Trigger event on change + + + if (hiding !== isHidden) { + var eventName = hiding ? 'controlshidden' : 'controlsshown'; + triggerEvent.call(_this, _this.media, eventName); + } + + return !hiding; + } + + return false; + }); + + _defineProperty(this, "on", function (event, callback) { + on.call(_this, _this.elements.container, event, callback); + }); + + _defineProperty(this, "once", function (event, callback) { + once.call(_this, _this.elements.container, event, callback); + }); + + _defineProperty(this, "off", function (event, callback) { + off(_this.elements.container, event, callback); + }); + + _defineProperty(this, "destroy", function (callback) { + var soft = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!_this.ready) { + return; + } + + var done = function done() { + // Reset overflow (incase destroyed while in fullscreen) + document.body.style.overflow = ''; // GC for embed + + _this.embed = null; // If it's a soft destroy, make minimal changes + + if (soft) { + if (Object.keys(_this.elements).length) { + // Remove elements + removeElement(_this.elements.buttons.play); + removeElement(_this.elements.captions); + removeElement(_this.elements.controls); + removeElement(_this.elements.wrapper); // Clear for GC + + _this.elements.buttons.play = null; + _this.elements.captions = null; + _this.elements.controls = null; + _this.elements.wrapper = null; + } // Callback + + + if (is$2.function(callback)) { + callback(); + } + } else { + // Unbind listeners + unbindListeners.call(_this); // Cancel current network requests + + html5.cancelRequests.call(_this); // Replace the container with the original element provided + + replaceElement(_this.elements.original, _this.elements.container); // Event + + triggerEvent.call(_this, _this.elements.original, 'destroyed', true); // Callback + + if (is$2.function(callback)) { + callback.call(_this.elements.original); + } // Reset state + + + _this.ready = false; // Clear for garbage collection + + setTimeout(function () { + _this.elements = null; + _this.media = null; + }, 200); + } + }; // Stop playback + + + _this.stop(); // Clear timeouts + + + clearTimeout(_this.timers.loading); + clearTimeout(_this.timers.controls); + clearTimeout(_this.timers.resized); // Provider specific stuff + + if (_this.isHTML5) { + // Restore native video controls + ui.toggleNativeControls.call(_this, true); // Clean up + + done(); + } else if (_this.isYouTube) { + // Clear timers + clearInterval(_this.timers.buffering); + clearInterval(_this.timers.playing); // Destroy YouTube API + + if (_this.embed !== null && is$2.function(_this.embed.destroy)) { + _this.embed.destroy(); + } // Clean up + + + done(); + } else if (_this.isVimeo) { + // Destroy Vimeo API + // then clean up (wait, to prevent postmessage errors) + if (_this.embed !== null) { + _this.embed.unload().then(done); + } // Vimeo does not always return + + + setTimeout(done, 200); + } + }); + + _defineProperty(this, "supports", function (type) { + return support.mime.call(_this, type); + }); + this.timers = {}; // State this.ready = false; @@ -28673,12 +28741,13 @@ typeof navigator === "object" && (function () { this.elements.original = clone; // Set media type based on tag or data attribute // Supported: video, audio, vimeo, youtube - var type = this.media.tagName.toLowerCase(); // Embed properties + var _type = this.media.tagName.toLowerCase(); // Embed properties + var iframe = null; var url = null; // Different setup based on type - switch (type) { + switch (_type) { case 'div': // Find the frame iframe = this.media.querySelector('iframe'); //