Version Description
- November 30, 2022 =
- Improvement: Make captions autodetect text direction.
- Fix: Improve accessibility on control buttons with aria-pressed.
- Fix: issue with captions sometimes not switching.
- Fix: issue with audio player email capture not working.
Download this release
Release Info
Developer | patilvikasj |
Plugin | The Ultimate Video Player For WordPress – by Presto Player |
Version | 1.10.2 |
Comparing to | |
See all releases |
Code changes from version 1.10.1 to 1.10.2
- dist/components/cjs/{hls-55b568d7.js → hls-2f0773d8.js} +23 -31
- dist/components/cjs/{index-c2577253.js → index-7c213f46.js} +179 -792
- dist/components/cjs/{learndash-da083e6b.js → learndash-0fc381a1.js} +26 -33
- dist/components/cjs/{lifter-ffa800e1.js → lifter-405c1707.js} +15 -26
- dist/components/cjs/loader.cjs.js +1 -3
- dist/components/cjs/presto-action-bar_25.cjs.entry.js +2 -2
- dist/components/cjs/presto-player-skeleton.cjs.entry.js +1 -1
- dist/components/cjs/presto-video-curtain-ui.cjs.entry.js +1 -1
- dist/components/cjs/{resize-observer-e02153c5.js → resize-observer-3bee288d.js} +18 -120
- dist/components/cjs/{tutor-2302fd34.js → tutor-789803e8.js} +8 -17
- dist/components/cjs/web-components.cjs.js +1 -4
- dist/components/collection/components/core/features/presto-email-overlay/controller/presto-email-overlay-controller.js +1 -1
- dist/components/collection/components/core/player/presto-player.css +49 -118
- dist/components/esm/{hls-0acc614b.js → hls-155734cc.js} +23 -31
- dist/components/esm/{index-ef535bb5.js → index-936ae1d6.js} +180 -792
- dist/components/esm/{learndash-9970e552.js → learndash-f2523a03.js} +26 -33
- dist/components/esm/{lifter-9f2633b7.js → lifter-e77d57e8.js} +15 -26
- dist/components/esm/loader.js +1 -3
- dist/components/esm/presto-action-bar_25.entry.js +2 -2
- dist/components/esm/presto-player-skeleton.entry.js +1 -1
- dist/components/esm/presto-video-curtain-ui.entry.js +1 -1
- dist/components/esm/{resize-observer-05e5e763.js → resize-observer-641aea72.js} +18 -120
- dist/components/esm/{tutor-25b387c9.js → tutor-ed49135f.js} +8 -17
- dist/components/esm/web-components.js +1 -4
- dist/components/web-components/p-146fd1f2.js +1 -0
- dist/components/web-components/p-219091ba.js +1 -0
- dist/components/web-components/{p-0e1cd603.js → p-24bcf5c4.js} +0 -0
- dist/components/web-components/{p-06502f62.js → p-36c54493.js} +1 -1
- dist/components/web-components/p-3e9a58ac.js +0 -1
- dist/components/web-components/{p-b2b3bfdb.entry.js → p-42f151d8.entry.js} +1 -1
- dist/components/web-components/p-4338b6d7.js +0 -1
- dist/components/web-components/p-771734f3.js +1 -0
- dist/components/web-components/{p-a9751bf2.entry.js → p-7cdc88f8.entry.js} +1 -1
- dist/components/web-components/p-80dd671c.js +1 -0
- dist/components/web-components/{p-68f17ca9.js → p-80de15fc.js} +0 -0
- dist/components/web-components/p-82ad268e.js +0 -1
- dist/components/web-components/p-97e2763b.js +0 -1
- dist/components/web-components/{p-5f63f270.entry.js → p-c84320f1.entry.js} +1 -1
- dist/components/web-components/web-components.esm.js +1 -1
- dist/settings/admin-8ab815a4.js.map +1 -1
dist/components/cjs/{hls-55b568d7.js → hls-2f0773d8.js}
RENAMED
@@ -1,17 +1,16 @@
|
|
1 |
'use strict';
|
2 |
|
3 |
-
const index = require('./index-
|
4 |
-
const prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry = require('./presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-
|
5 |
|
6 |
var loadHLS = function loadHLS(_ref) {
|
7 |
var config = _ref.config,
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
return new Promise( /*#__PURE__*/function () {
|
12 |
var _ref2 = index._asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve, reject) {
|
13 |
var _wp, autoStartLoad, hls;
|
14 |
-
|
15 |
return regeneratorRuntime.wrap(function _callee$(_context) {
|
16 |
while (1) {
|
17 |
switch (_context.prev = _context.next) {
|
@@ -20,68 +19,63 @@ var loadHLS = function loadHLS(_ref) {
|
|
20 |
_context.next = 6;
|
21 |
break;
|
22 |
}
|
23 |
-
|
24 |
case 1:
|
25 |
if (window.hasOwnProperty('Hls')) {
|
26 |
_context.next = 6;
|
27 |
break;
|
28 |
}
|
29 |
-
|
30 |
_context.next = 4;
|
31 |
return new Promise(function (resolve) {
|
32 |
return setTimeout(resolve, 50);
|
33 |
});
|
34 |
-
|
35 |
case 4:
|
36 |
_context.next = 1;
|
37 |
break;
|
38 |
-
|
39 |
case 6:
|
40 |
if (!window.Hls.isSupported()) {
|
41 |
_context.next = 16;
|
42 |
break;
|
43 |
}
|
44 |
-
|
45 |
// should we autoload start
|
46 |
autoStartLoad = !['metadata', 'none'].includes(preload); // always autoload in admin for preview
|
47 |
-
|
48 |
if ((_wp = wp) !== null && _wp !== void 0 && _wp.blocks) {
|
49 |
autoStartLoad = true;
|
50 |
-
}
|
51 |
-
|
52 |
|
|
|
53 |
hls = new window.Hls({
|
54 |
autoStartLoad: autoStartLoad
|
55 |
});
|
56 |
-
hls.loadSource(src);
|
57 |
|
|
|
58 |
hls.on(window.Hls.Events.LEVEL_SWITCHED, function (event, data) {
|
59 |
var span = selector.closest('.presto-player__wrapper').querySelector(".plyr__menu__container [data-plyr='quality'][value='0'] span");
|
60 |
-
|
61 |
if (hls.autoLevelEnabled) {
|
62 |
span.innerHTML = "AUTO (".concat(hls.levels[data.level].height, "p)");
|
63 |
} else {
|
64 |
span.innerHTML = "AUTO";
|
65 |
}
|
66 |
-
});
|
|
|
|
|
67 |
// all available video qualities. This is important, in this approach,
|
68 |
// we will have one source on the Plyr player.
|
69 |
-
|
70 |
hls.on(window.Hls.Events.MANIFEST_PARSED, function (event, data) {
|
71 |
// Transform available levels into an array of integers (height values).
|
72 |
var availableQualities = hls.levels.map(function (l) {
|
73 |
return l.height;
|
74 |
});
|
75 |
availableQualities.unshift(0); //prepend 0 to quality array;
|
76 |
-
// do start level
|
77 |
|
|
|
78 |
var startLevel = availableQualities.findIndex(function (qty) {
|
79 |
var _prestoPlayer;
|
80 |
-
|
81 |
return qty === parseInt((_prestoPlayer = prestoPlayer) === null || _prestoPlayer === void 0 ? void 0 : _prestoPlayer.hls_start_level);
|
82 |
});
|
83 |
-
hls.startLevel = startLevel ? startLevel - 1 : 2;
|
84 |
|
|
|
85 |
config.quality = {
|
86 |
default: 0,
|
87 |
options: availableQualities,
|
@@ -99,21 +93,24 @@ var loadHLS = function loadHLS(_ref) {
|
|
99 |
});
|
100 |
}
|
101 |
}
|
102 |
-
};
|
103 |
|
|
|
104 |
hls.attachMedia(selector);
|
105 |
-
window.prestoHLS = hls;
|
106 |
|
|
|
107 |
var player = new prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry.PrestoPlayer(selector, index._objectSpread2({}, config));
|
108 |
-
player.hls = hls;
|
109 |
|
|
|
110 |
var firstPlay = function firstPlay() {
|
111 |
hls.startLoad(-1);
|
112 |
player.off('waiting', firstPlay);
|
113 |
};
|
|
|
114 |
|
115 |
-
|
116 |
-
|
117 |
player.on('languagechange', function () {
|
118 |
// Caption support is still flaky. See: https://github.com/sampotts/plyr/issues/994
|
119 |
setTimeout(function () {
|
@@ -123,18 +120,14 @@ var loadHLS = function loadHLS(_ref) {
|
|
123 |
return resolve(player);
|
124 |
});
|
125 |
return _context.abrupt("return");
|
126 |
-
|
127 |
case 16:
|
128 |
if (!selector.canPlayType('application/vnd.apple.mpegurl')) {
|
129 |
_context.next = 18;
|
130 |
break;
|
131 |
}
|
132 |
-
|
133 |
return _context.abrupt("return", resolve(new prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry.PrestoPlayer(selector, index._objectSpread2({}, config))));
|
134 |
-
|
135 |
case 18:
|
136 |
return _context.abrupt("return", resolve(new prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry.PrestoPlayer(selector, index._objectSpread2({}, config))));
|
137 |
-
|
138 |
case 19:
|
139 |
case "end":
|
140 |
return _context.stop();
|
@@ -142,7 +135,6 @@ var loadHLS = function loadHLS(_ref) {
|
|
142 |
}
|
143 |
}, _callee);
|
144 |
}));
|
145 |
-
|
146 |
return function (_x, _x2) {
|
147 |
return _ref2.apply(this, arguments);
|
148 |
};
|
1 |
'use strict';
|
2 |
|
3 |
+
const index = require('./index-7c213f46.js');
|
4 |
+
const prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry = require('./presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-0c9358bf.js');
|
5 |
|
6 |
var loadHLS = function loadHLS(_ref) {
|
7 |
var config = _ref.config,
|
8 |
+
selector = _ref.selector,
|
9 |
+
src = _ref.src,
|
10 |
+
preload = _ref.preload;
|
11 |
return new Promise( /*#__PURE__*/function () {
|
12 |
var _ref2 = index._asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve, reject) {
|
13 |
var _wp, autoStartLoad, hls;
|
|
|
14 |
return regeneratorRuntime.wrap(function _callee$(_context) {
|
15 |
while (1) {
|
16 |
switch (_context.prev = _context.next) {
|
19 |
_context.next = 6;
|
20 |
break;
|
21 |
}
|
|
|
22 |
case 1:
|
23 |
if (window.hasOwnProperty('Hls')) {
|
24 |
_context.next = 6;
|
25 |
break;
|
26 |
}
|
|
|
27 |
_context.next = 4;
|
28 |
return new Promise(function (resolve) {
|
29 |
return setTimeout(resolve, 50);
|
30 |
});
|
|
|
31 |
case 4:
|
32 |
_context.next = 1;
|
33 |
break;
|
|
|
34 |
case 6:
|
35 |
if (!window.Hls.isSupported()) {
|
36 |
_context.next = 16;
|
37 |
break;
|
38 |
}
|
|
|
39 |
// should we autoload start
|
40 |
autoStartLoad = !['metadata', 'none'].includes(preload); // always autoload in admin for preview
|
|
|
41 |
if ((_wp = wp) !== null && _wp !== void 0 && _wp.blocks) {
|
42 |
autoStartLoad = true;
|
43 |
+
}
|
|
|
44 |
|
45 |
+
// maybe don't auto start load depending on performance parameter
|
46 |
hls = new window.Hls({
|
47 |
autoStartLoad: autoStartLoad
|
48 |
});
|
49 |
+
hls.loadSource(src);
|
50 |
|
51 |
+
// update menu container to dynamically display quality
|
52 |
hls.on(window.Hls.Events.LEVEL_SWITCHED, function (event, data) {
|
53 |
var span = selector.closest('.presto-player__wrapper').querySelector(".plyr__menu__container [data-plyr='quality'][value='0'] span");
|
|
|
54 |
if (hls.autoLevelEnabled) {
|
55 |
span.innerHTML = "AUTO (".concat(hls.levels[data.level].height, "p)");
|
56 |
} else {
|
57 |
span.innerHTML = "AUTO";
|
58 |
}
|
59 |
+
});
|
60 |
+
|
61 |
+
// From the m3u8 playlist, hls parses the manifest and returns
|
62 |
// all available video qualities. This is important, in this approach,
|
63 |
// we will have one source on the Plyr player.
|
|
|
64 |
hls.on(window.Hls.Events.MANIFEST_PARSED, function (event, data) {
|
65 |
// Transform available levels into an array of integers (height values).
|
66 |
var availableQualities = hls.levels.map(function (l) {
|
67 |
return l.height;
|
68 |
});
|
69 |
availableQualities.unshift(0); //prepend 0 to quality array;
|
|
|
70 |
|
71 |
+
// do start level
|
72 |
var startLevel = availableQualities.findIndex(function (qty) {
|
73 |
var _prestoPlayer;
|
|
|
74 |
return qty === parseInt((_prestoPlayer = prestoPlayer) === null || _prestoPlayer === void 0 ? void 0 : _prestoPlayer.hls_start_level);
|
75 |
});
|
76 |
+
hls.startLevel = startLevel ? startLevel - 1 : 2;
|
77 |
|
78 |
+
// Add new qualities to option
|
79 |
config.quality = {
|
80 |
default: 0,
|
81 |
options: availableQualities,
|
93 |
});
|
94 |
}
|
95 |
}
|
96 |
+
};
|
97 |
|
98 |
+
// attach media and make our HLS options available globally
|
99 |
hls.attachMedia(selector);
|
100 |
+
window.prestoHLS = hls;
|
101 |
|
102 |
+
// Initialize player
|
103 |
var player = new prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry.PrestoPlayer(selector, index._objectSpread2({}, config));
|
104 |
+
player.hls = hls;
|
105 |
|
106 |
+
// make sure we start loading on the first play
|
107 |
var firstPlay = function firstPlay() {
|
108 |
hls.startLoad(-1);
|
109 |
player.off('waiting', firstPlay);
|
110 |
};
|
111 |
+
player.on('waiting', firstPlay);
|
112 |
|
113 |
+
// Handle changing captions
|
|
|
114 |
player.on('languagechange', function () {
|
115 |
// Caption support is still flaky. See: https://github.com/sampotts/plyr/issues/994
|
116 |
setTimeout(function () {
|
120 |
return resolve(player);
|
121 |
});
|
122 |
return _context.abrupt("return");
|
|
|
123 |
case 16:
|
124 |
if (!selector.canPlayType('application/vnd.apple.mpegurl')) {
|
125 |
_context.next = 18;
|
126 |
break;
|
127 |
}
|
|
|
128 |
return _context.abrupt("return", resolve(new prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry.PrestoPlayer(selector, index._objectSpread2({}, config))));
|
|
|
129 |
case 18:
|
130 |
return _context.abrupt("return", resolve(new prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry.PrestoPlayer(selector, index._objectSpread2({}, config))));
|
|
|
131 |
case 19:
|
132 |
case "end":
|
133 |
return _context.stop();
|
135 |
}
|
136 |
}, _callee);
|
137 |
}));
|
|
|
138 |
return function (_x, _x2) {
|
139 |
return _ref2.apply(this, arguments);
|
140 |
};
|
dist/components/cjs/{index-c2577253.js → index-7c213f46.js}
RENAMED
@@ -22,17 +22,14 @@ function _interopNamespace(e) {
|
|
22 |
|
23 |
function ownKeys(object, enumerableOnly) {
|
24 |
var keys = Object.keys(object);
|
25 |
-
|
26 |
if (Object.getOwnPropertySymbols) {
|
27 |
var symbols = Object.getOwnPropertySymbols(object);
|
28 |
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
29 |
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
30 |
})), keys.push.apply(keys, symbols);
|
31 |
}
|
32 |
-
|
33 |
return keys;
|
34 |
}
|
35 |
-
|
36 |
function _objectSpread2(target) {
|
37 |
for (var i = 1; i < arguments.length; i++) {
|
38 |
var source = null != arguments[i] ? arguments[i] : {};
|
@@ -42,10 +39,8 @@ function _objectSpread2(target) {
|
|
42 |
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
43 |
});
|
44 |
}
|
45 |
-
|
46 |
return target;
|
47 |
}
|
48 |
-
|
49 |
function _typeof(obj) {
|
50 |
"@babel/helpers - typeof";
|
51 |
|
@@ -55,55 +50,6 @@ function _typeof(obj) {
|
|
55 |
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
56 |
}, _typeof(obj);
|
57 |
}
|
58 |
-
|
59 |
-
function _wrapRegExp() {
|
60 |
-
_wrapRegExp = function (re, groups) {
|
61 |
-
return new BabelRegExp(re, void 0, groups);
|
62 |
-
};
|
63 |
-
|
64 |
-
var _super = RegExp.prototype,
|
65 |
-
_groups = new WeakMap();
|
66 |
-
|
67 |
-
function BabelRegExp(re, flags, groups) {
|
68 |
-
var _this = new RegExp(re, flags);
|
69 |
-
|
70 |
-
return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype);
|
71 |
-
}
|
72 |
-
|
73 |
-
function buildGroups(result, re) {
|
74 |
-
var g = _groups.get(re);
|
75 |
-
|
76 |
-
return Object.keys(g).reduce(function (groups, name) {
|
77 |
-
return groups[name] = result[g[name]], groups;
|
78 |
-
}, Object.create(null));
|
79 |
-
}
|
80 |
-
|
81 |
-
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) {
|
82 |
-
var result = _super.exec.call(this, str);
|
83 |
-
|
84 |
-
return result && (result.groups = buildGroups(result, this)), result;
|
85 |
-
}, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
|
86 |
-
if ("string" == typeof substitution) {
|
87 |
-
var groups = _groups.get(this);
|
88 |
-
|
89 |
-
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
|
90 |
-
return "$" + groups[name];
|
91 |
-
}));
|
92 |
-
}
|
93 |
-
|
94 |
-
if ("function" == typeof substitution) {
|
95 |
-
var _this = this;
|
96 |
-
|
97 |
-
return _super[Symbol.replace].call(this, str, function () {
|
98 |
-
var args = arguments;
|
99 |
-
return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args);
|
100 |
-
});
|
101 |
-
}
|
102 |
-
|
103 |
-
return _super[Symbol.replace].call(this, str, substitution);
|
104 |
-
}, _wrapRegExp.apply(this, arguments);
|
105 |
-
}
|
106 |
-
|
107 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
108 |
try {
|
109 |
var info = gen[key](arg);
|
@@ -112,40 +58,33 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
112 |
reject(error);
|
113 |
return;
|
114 |
}
|
115 |
-
|
116 |
if (info.done) {
|
117 |
resolve(value);
|
118 |
} else {
|
119 |
Promise.resolve(value).then(_next, _throw);
|
120 |
}
|
121 |
}
|
122 |
-
|
123 |
function _asyncToGenerator(fn) {
|
124 |
return function () {
|
125 |
var self = this,
|
126 |
-
|
127 |
return new Promise(function (resolve, reject) {
|
128 |
var gen = fn.apply(self, args);
|
129 |
-
|
130 |
function _next(value) {
|
131 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
132 |
}
|
133 |
-
|
134 |
function _throw(err) {
|
135 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
136 |
}
|
137 |
-
|
138 |
_next(undefined);
|
139 |
});
|
140 |
};
|
141 |
}
|
142 |
-
|
143 |
function _classCallCheck(instance, Constructor) {
|
144 |
if (!(instance instanceof Constructor)) {
|
145 |
throw new TypeError("Cannot call a class as a function");
|
146 |
}
|
147 |
}
|
148 |
-
|
149 |
function _defineProperties(target, props) {
|
150 |
for (var i = 0; i < props.length; i++) {
|
151 |
var descriptor = props[i];
|
@@ -155,7 +94,6 @@ function _defineProperties(target, props) {
|
|
155 |
Object.defineProperty(target, descriptor.key, descriptor);
|
156 |
}
|
157 |
}
|
158 |
-
|
159 |
function _createClass(Constructor, protoProps, staticProps) {
|
160 |
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
161 |
if (staticProps) _defineProperties(Constructor, staticProps);
|
@@ -164,7 +102,6 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
164 |
});
|
165 |
return Constructor;
|
166 |
}
|
167 |
-
|
168 |
function _defineProperty(obj, key, value) {
|
169 |
if (key in obj) {
|
170 |
Object.defineProperty(obj, key, {
|
@@ -176,49 +113,41 @@ function _defineProperty(obj, key, value) {
|
|
176 |
} else {
|
177 |
obj[key] = value;
|
178 |
}
|
179 |
-
|
180 |
return obj;
|
181 |
}
|
182 |
-
|
183 |
function _inherits(subClass, superClass) {
|
184 |
if (typeof superClass !== "function" && superClass !== null) {
|
185 |
throw new TypeError("Super expression must either be null or a function");
|
186 |
}
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
Object.defineProperty(subClass, "prototype", {
|
189 |
-
value: Object.create(superClass && superClass.prototype, {
|
190 |
-
constructor: {
|
191 |
-
value: subClass,
|
192 |
-
writable: true,
|
193 |
-
configurable: true
|
194 |
-
}
|
195 |
-
}),
|
196 |
writable: false
|
197 |
});
|
198 |
if (superClass) _setPrototypeOf(subClass, superClass);
|
199 |
}
|
200 |
-
|
201 |
function _getPrototypeOf(o) {
|
202 |
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
203 |
return o.__proto__ || Object.getPrototypeOf(o);
|
204 |
};
|
205 |
return _getPrototypeOf(o);
|
206 |
}
|
207 |
-
|
208 |
function _setPrototypeOf(o, p) {
|
209 |
-
_setPrototypeOf = Object.setPrototypeOf
|
210 |
o.__proto__ = p;
|
211 |
return o;
|
212 |
};
|
213 |
-
|
214 |
return _setPrototypeOf(o, p);
|
215 |
}
|
216 |
-
|
217 |
function _isNativeReflectConstruct() {
|
218 |
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
219 |
if (Reflect.construct.sham) return false;
|
220 |
if (typeof Proxy === "function") return true;
|
221 |
-
|
222 |
try {
|
223 |
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
224 |
return true;
|
@@ -226,10 +155,9 @@ function _isNativeReflectConstruct() {
|
|
226 |
return false;
|
227 |
}
|
228 |
}
|
229 |
-
|
230 |
function _construct(Parent, args, Class) {
|
231 |
if (_isNativeReflectConstruct()) {
|
232 |
-
_construct = Reflect.construct;
|
233 |
} else {
|
234 |
_construct = function _construct(Parent, args, Class) {
|
235 |
var a = [null];
|
@@ -240,34 +168,25 @@ function _construct(Parent, args, Class) {
|
|
240 |
return instance;
|
241 |
};
|
242 |
}
|
243 |
-
|
244 |
return _construct.apply(null, arguments);
|
245 |
}
|
246 |
-
|
247 |
function _isNativeFunction(fn) {
|
248 |
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
249 |
}
|
250 |
-
|
251 |
function _wrapNativeSuper(Class) {
|
252 |
var _cache = typeof Map === "function" ? new Map() : undefined;
|
253 |
-
|
254 |
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
255 |
if (Class === null || !_isNativeFunction(Class)) return Class;
|
256 |
-
|
257 |
if (typeof Class !== "function") {
|
258 |
throw new TypeError("Super expression must either be null or a function");
|
259 |
}
|
260 |
-
|
261 |
if (typeof _cache !== "undefined") {
|
262 |
if (_cache.has(Class)) return _cache.get(Class);
|
263 |
-
|
264 |
_cache.set(Class, Wrapper);
|
265 |
}
|
266 |
-
|
267 |
function Wrapper() {
|
268 |
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
269 |
}
|
270 |
-
|
271 |
Wrapper.prototype = Object.create(Class.prototype, {
|
272 |
constructor: {
|
273 |
value: Wrapper,
|
@@ -278,35 +197,26 @@ function _wrapNativeSuper(Class) {
|
|
278 |
});
|
279 |
return _setPrototypeOf(Wrapper, Class);
|
280 |
};
|
281 |
-
|
282 |
return _wrapNativeSuper(Class);
|
283 |
}
|
284 |
-
|
285 |
function _objectWithoutPropertiesLoose(source, excluded) {
|
286 |
if (source == null) return {};
|
287 |
var target = {};
|
288 |
var sourceKeys = Object.keys(source);
|
289 |
var key, i;
|
290 |
-
|
291 |
for (i = 0; i < sourceKeys.length; i++) {
|
292 |
key = sourceKeys[i];
|
293 |
if (excluded.indexOf(key) >= 0) continue;
|
294 |
target[key] = source[key];
|
295 |
}
|
296 |
-
|
297 |
return target;
|
298 |
}
|
299 |
-
|
300 |
function _objectWithoutProperties(source, excluded) {
|
301 |
if (source == null) return {};
|
302 |
-
|
303 |
var target = _objectWithoutPropertiesLoose(source, excluded);
|
304 |
-
|
305 |
var key, i;
|
306 |
-
|
307 |
if (Object.getOwnPropertySymbols) {
|
308 |
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
309 |
-
|
310 |
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
311 |
key = sourceSymbolKeys[i];
|
312 |
if (excluded.indexOf(key) >= 0) continue;
|
@@ -314,81 +224,61 @@ function _objectWithoutProperties(source, excluded) {
|
|
314 |
target[key] = source[key];
|
315 |
}
|
316 |
}
|
317 |
-
|
318 |
return target;
|
319 |
}
|
320 |
-
|
321 |
function _assertThisInitialized(self) {
|
322 |
if (self === void 0) {
|
323 |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
324 |
}
|
325 |
-
|
326 |
return self;
|
327 |
}
|
328 |
-
|
329 |
function _possibleConstructorReturn(self, call) {
|
330 |
if (call && (typeof call === "object" || typeof call === "function")) {
|
331 |
return call;
|
332 |
} else if (call !== void 0) {
|
333 |
throw new TypeError("Derived constructors may only return object or undefined");
|
334 |
}
|
335 |
-
|
336 |
return _assertThisInitialized(self);
|
337 |
}
|
338 |
-
|
339 |
function _createSuper(Derived) {
|
340 |
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
341 |
-
|
342 |
return function _createSuperInternal() {
|
343 |
var Super = _getPrototypeOf(Derived),
|
344 |
-
|
345 |
-
|
346 |
if (hasNativeReflectConstruct) {
|
347 |
var NewTarget = _getPrototypeOf(this).constructor;
|
348 |
-
|
349 |
result = Reflect.construct(Super, arguments, NewTarget);
|
350 |
} else {
|
351 |
result = Super.apply(this, arguments);
|
352 |
}
|
353 |
-
|
354 |
return _possibleConstructorReturn(this, result);
|
355 |
};
|
356 |
}
|
357 |
-
|
358 |
function _slicedToArray(arr, i) {
|
359 |
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
360 |
}
|
361 |
-
|
362 |
function _toConsumableArray(arr) {
|
363 |
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
364 |
}
|
365 |
-
|
366 |
function _arrayWithoutHoles(arr) {
|
367 |
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
368 |
}
|
369 |
-
|
370 |
function _arrayWithHoles(arr) {
|
371 |
if (Array.isArray(arr)) return arr;
|
372 |
}
|
373 |
-
|
374 |
function _iterableToArray(iter) {
|
375 |
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
376 |
}
|
377 |
-
|
378 |
function _iterableToArrayLimit(arr, i) {
|
379 |
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
380 |
-
|
381 |
if (_i == null) return;
|
382 |
var _arr = [];
|
383 |
var _n = true;
|
384 |
var _d = false;
|
385 |
-
|
386 |
var _s, _e;
|
387 |
-
|
388 |
try {
|
389 |
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
390 |
_arr.push(_s.value);
|
391 |
-
|
392 |
if (i && _arr.length === i) break;
|
393 |
}
|
394 |
} catch (err) {
|
@@ -401,10 +291,8 @@ function _iterableToArrayLimit(arr, i) {
|
|
401 |
if (_d) throw _e;
|
402 |
}
|
403 |
}
|
404 |
-
|
405 |
return _arr;
|
406 |
}
|
407 |
-
|
408 |
function _unsupportedIterableToArray(o, minLen) {
|
409 |
if (!o) return;
|
410 |
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
@@ -413,33 +301,24 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
413 |
if (n === "Map" || n === "Set") return Array.from(o);
|
414 |
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
415 |
}
|
416 |
-
|
417 |
function _arrayLikeToArray(arr, len) {
|
418 |
if (len == null || len > arr.length) len = arr.length;
|
419 |
-
|
420 |
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
421 |
-
|
422 |
return arr2;
|
423 |
}
|
424 |
-
|
425 |
function _nonIterableSpread() {
|
426 |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
427 |
}
|
428 |
-
|
429 |
function _nonIterableRest() {
|
430 |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
431 |
}
|
432 |
-
|
433 |
function _createForOfIteratorHelper(o, allowArrayLike) {
|
434 |
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
435 |
-
|
436 |
if (!it) {
|
437 |
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
438 |
if (it) o = it;
|
439 |
var i = 0;
|
440 |
-
|
441 |
var F = function () {};
|
442 |
-
|
443 |
return {
|
444 |
s: F,
|
445 |
n: function () {
|
@@ -457,13 +336,11 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
457 |
f: F
|
458 |
};
|
459 |
}
|
460 |
-
|
461 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
462 |
}
|
463 |
-
|
464 |
var normalCompletion = true,
|
465 |
-
|
466 |
-
|
467 |
return {
|
468 |
s: function () {
|
469 |
it = it.call(o);
|
@@ -501,7 +378,6 @@ var win = typeof window !== 'undefined' ? window : {};
|
|
501 |
var doc = win.document || {
|
502 |
head: {}
|
503 |
};
|
504 |
-
|
505 |
var plt = {
|
506 |
$flags$: 0,
|
507 |
$resourcesUrl$: '',
|
@@ -521,29 +397,24 @@ var plt = {
|
|
521 |
return new CustomEvent(eventName, opts);
|
522 |
}
|
523 |
};
|
524 |
-
|
525 |
var promiseResolve = function promiseResolve(v) {
|
526 |
return Promise.resolve(v);
|
527 |
};
|
528 |
-
|
529 |
var supportsConstructibleStylesheets = /*@__PURE__*/function () {
|
530 |
try {
|
531 |
new CSSStyleSheet();
|
532 |
return typeof new CSSStyleSheet().replace === 'function';
|
533 |
} catch (e) {}
|
534 |
-
|
535 |
return false;
|
536 |
}() ;
|
537 |
-
|
538 |
var addHostEventListeners = function addHostEventListeners(elm, hostRef, listeners, attachParentListeners) {
|
539 |
if (listeners) {
|
540 |
|
541 |
listeners.map(function (_ref6) {
|
542 |
var _ref7 = _slicedToArray(_ref6, 3),
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
var target = getHostListenerTarget(elm, flags) ;
|
548 |
var handler = hostListenerProxy(hostRef, method);
|
549 |
var opts = hostListenerOpts(flags);
|
@@ -554,14 +425,11 @@ var addHostEventListeners = function addHostEventListeners(elm, hostRef, listene
|
|
554 |
});
|
555 |
}
|
556 |
};
|
557 |
-
|
558 |
var hostListenerProxy = function hostListenerProxy(hostRef, methodName) {
|
559 |
return function (ev) {
|
560 |
try {
|
561 |
{
|
562 |
-
if (hostRef.$flags$ & 256
|
563 |
-
/* isListenReady */
|
564 |
-
) {
|
565 |
// instance is ready, let's call it's member method for this event
|
566 |
hostRef.$lazyInstance$[methodName](ev);
|
567 |
} else {
|
@@ -573,32 +441,23 @@ var hostListenerProxy = function hostListenerProxy(hostRef, methodName) {
|
|
573 |
}
|
574 |
};
|
575 |
};
|
576 |
-
|
577 |
var getHostListenerTarget = function getHostListenerTarget(elm, flags) {
|
578 |
-
if (flags & 8
|
579 |
-
/* TargetWindow */
|
580 |
-
) return win;
|
581 |
return elm;
|
582 |
-
};
|
583 |
-
|
584 |
-
|
585 |
var hostListenerOpts = function hostListenerOpts(flags) {
|
586 |
-
return (flags & 2
|
587 |
-
/* Capture */
|
588 |
-
) !== 0;
|
589 |
};
|
590 |
var HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
591 |
var XLINK_NS = 'http://www.w3.org/1999/xlink';
|
592 |
-
|
593 |
var createTime = function createTime(fnName) {
|
594 |
-
|
595 |
{
|
596 |
return function () {
|
597 |
return;
|
598 |
};
|
599 |
}
|
600 |
};
|
601 |
-
|
602 |
var uniqueTime = function uniqueTime(key, measureText) {
|
603 |
{
|
604 |
return function () {
|
@@ -606,52 +465,39 @@ var uniqueTime = function uniqueTime(key, measureText) {
|
|
606 |
};
|
607 |
}
|
608 |
};
|
609 |
-
|
610 |
var rootAppliedStyles = new WeakMap();
|
611 |
-
|
612 |
var registerStyle = function registerStyle(scopeId, cssText, allowCS) {
|
613 |
var style = styles.get(scopeId);
|
614 |
-
|
615 |
if (supportsConstructibleStylesheets && allowCS) {
|
616 |
style = style || new CSSStyleSheet();
|
617 |
style.replace(cssText);
|
618 |
} else {
|
619 |
style = cssText;
|
620 |
}
|
621 |
-
|
622 |
styles.set(scopeId, style);
|
623 |
};
|
624 |
-
|
625 |
var addStyle = function addStyle(styleContainerNode, cmpMeta, mode, hostElm) {
|
626 |
var scopeId = getScopeId(cmpMeta);
|
627 |
var style = styles.get(scopeId);
|
|
|
628 |
// so the fallback is to always use the document for the root node in those cases
|
629 |
-
|
630 |
-
|
631 |
-
styleContainerNode = styleContainerNode.nodeType === 11
|
632 |
-
/* DocumentFragment */
|
633 |
-
? styleContainerNode : doc;
|
634 |
-
|
635 |
if (style) {
|
636 |
if (typeof style === 'string') {
|
637 |
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
638 |
var appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
639 |
var styleElm;
|
640 |
-
|
641 |
if (!appliedStyles) {
|
642 |
rootAppliedStyles.set(styleContainerNode, appliedStyles = new Set());
|
643 |
}
|
644 |
-
|
645 |
if (!appliedStyles.has(scopeId)) {
|
646 |
{
|
647 |
{
|
648 |
styleElm = doc.createElement('style');
|
649 |
styleElm.innerHTML = style;
|
650 |
}
|
651 |
-
|
652 |
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
653 |
}
|
654 |
-
|
655 |
if (appliedStyles) {
|
656 |
appliedStyles.add(scopeId);
|
657 |
}
|
@@ -660,20 +506,15 @@ var addStyle = function addStyle(styleContainerNode, cmpMeta, mode, hostElm) {
|
|
660 |
styleContainerNode.adoptedStyleSheets = [].concat(_toConsumableArray(styleContainerNode.adoptedStyleSheets), [style]);
|
661 |
}
|
662 |
}
|
663 |
-
|
664 |
return scopeId;
|
665 |
};
|
666 |
-
|
667 |
var attachStyles = function attachStyles(hostRef) {
|
668 |
var cmpMeta = hostRef.$cmpMeta$;
|
669 |
var elm = hostRef.$hostElement$;
|
670 |
var flags = cmpMeta.$flags$;
|
671 |
var endAttachStyles = createTime();
|
672 |
var scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
673 |
-
|
674 |
-
if (flags & 10
|
675 |
-
/* needsScopedEncapsulation */
|
676 |
-
) {
|
677 |
// only required when we're NOT using native shadow dom (slot)
|
678 |
// or this browser doesn't support native shadow dom
|
679 |
// and this host element was NOT created with SSR
|
@@ -684,35 +525,27 @@ var attachStyles = function attachStyles(hostRef) {
|
|
684 |
elm['s-sc'] = scopeId;
|
685 |
elm.classList.add(scopeId + '-h');
|
686 |
}
|
687 |
-
|
688 |
endAttachStyles();
|
689 |
};
|
690 |
-
|
691 |
var getScopeId = function getScopeId(cmp, mode) {
|
692 |
return 'sc-' + (cmp.$tagName$);
|
693 |
};
|
694 |
/**
|
695 |
* Default style mode id
|
696 |
*/
|
697 |
-
|
698 |
/**
|
699 |
* Reusable empty obj/array
|
700 |
* Don't add values to these!!
|
701 |
*/
|
702 |
-
|
703 |
-
|
704 |
var EMPTY_OBJ = {};
|
705 |
/**
|
706 |
* Namespaces
|
707 |
*/
|
708 |
-
|
709 |
var SVG_NS = 'http://www.w3.org/2000/svg';
|
710 |
var HTML_NS = 'http://www.w3.org/1999/xhtml';
|
711 |
-
|
712 |
var isDef = function isDef(v) {
|
713 |
return v != null;
|
714 |
};
|
715 |
-
|
716 |
var isComplexType = function isComplexType(o) {
|
717 |
// https://jsperf.com/typeof-fn-object/5
|
718 |
o = _typeof(o);
|
@@ -729,8 +562,6 @@ var isComplexType = function isComplexType(o) {
|
|
729 |
// const stack: any[] = [];
|
730 |
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
731 |
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
732 |
-
|
733 |
-
|
734 |
var h = function h(nodeName, vnodeData) {
|
735 |
var child = null;
|
736 |
var key = null;
|
@@ -738,18 +569,15 @@ var h = function h(nodeName, vnodeData) {
|
|
738 |
var simple = false;
|
739 |
var lastSimple = false;
|
740 |
var vNodeChildren = [];
|
741 |
-
|
742 |
var walk = function walk(c) {
|
743 |
for (var _i = 0; _i < c.length; _i++) {
|
744 |
child = c[_i];
|
745 |
-
|
746 |
if (Array.isArray(child)) {
|
747 |
walk(child);
|
748 |
} else if (child != null && typeof child !== 'boolean') {
|
749 |
if (simple = typeof nodeName !== 'function' && !isComplexType(child)) {
|
750 |
child = String(child);
|
751 |
}
|
752 |
-
|
753 |
if (simple && lastSimple) {
|
754 |
// If the previous child was simple (string), we merge both
|
755 |
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
@@ -757,32 +585,24 @@ var h = function h(nodeName, vnodeData) {
|
|
757 |
// Append a new vNode, if it's text, we create a text vNode
|
758 |
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
759 |
}
|
760 |
-
|
761 |
lastSimple = simple;
|
762 |
}
|
763 |
}
|
764 |
};
|
765 |
-
|
766 |
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
767 |
children[_key - 2] = arguments[_key];
|
768 |
}
|
769 |
-
|
770 |
walk(children);
|
771 |
-
|
772 |
if (vnodeData) {
|
773 |
-
|
774 |
-
|
775 |
if (vnodeData.key) {
|
776 |
key = vnodeData.key;
|
777 |
}
|
778 |
-
|
779 |
if (vnodeData.name) {
|
780 |
slotName = vnodeData.name;
|
781 |
}
|
782 |
-
|
783 |
{
|
784 |
var classData = vnodeData.className || vnodeData.class;
|
785 |
-
|
786 |
if (classData) {
|
787 |
vnodeData.class = _typeof(classData) !== 'object' ? classData : Object.keys(classData).filter(function (k) {
|
788 |
return classData[k];
|
@@ -790,30 +610,23 @@ var h = function h(nodeName, vnodeData) {
|
|
790 |
}
|
791 |
}
|
792 |
}
|
793 |
-
|
794 |
if (typeof nodeName === 'function') {
|
795 |
// nodeName is a functional component
|
796 |
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
797 |
}
|
798 |
-
|
799 |
var vnode = newVNode(nodeName, null);
|
800 |
vnode.$attrs$ = vnodeData;
|
801 |
-
|
802 |
if (vNodeChildren.length > 0) {
|
803 |
vnode.$children$ = vNodeChildren;
|
804 |
}
|
805 |
-
|
806 |
{
|
807 |
vnode.$key$ = key;
|
808 |
}
|
809 |
-
|
810 |
{
|
811 |
vnode.$name$ = slotName;
|
812 |
}
|
813 |
-
|
814 |
return vnode;
|
815 |
};
|
816 |
-
|
817 |
var newVNode = function newVNode(tag, text) {
|
818 |
var vnode = {
|
819 |
$flags$: 0,
|
@@ -822,28 +635,21 @@ var newVNode = function newVNode(tag, text) {
|
|
822 |
$elm$: null,
|
823 |
$children$: null
|
824 |
};
|
825 |
-
|
826 |
{
|
827 |
vnode.$attrs$ = null;
|
828 |
}
|
829 |
-
|
830 |
{
|
831 |
vnode.$key$ = null;
|
832 |
}
|
833 |
-
|
834 |
{
|
835 |
vnode.$name$ = null;
|
836 |
}
|
837 |
-
|
838 |
return vnode;
|
839 |
};
|
840 |
-
|
841 |
var Host = {};
|
842 |
-
|
843 |
var isHost = function isHost(node) {
|
844 |
return node && node.$tag$ === Host;
|
845 |
};
|
846 |
-
|
847 |
var vdomFnUtils = {
|
848 |
forEach: function forEach(children, cb) {
|
849 |
return children.map(convertToPublic).forEach(cb);
|
@@ -852,7 +658,6 @@ var vdomFnUtils = {
|
|
852 |
return children.map(convertToPublic).map(cb).map(convertToPrivate);
|
853 |
}
|
854 |
};
|
855 |
-
|
856 |
var convertToPublic = function convertToPublic(node) {
|
857 |
return {
|
858 |
vattrs: node.$attrs$,
|
@@ -863,22 +668,17 @@ var convertToPublic = function convertToPublic(node) {
|
|
863 |
vtext: node.$text$
|
864 |
};
|
865 |
};
|
866 |
-
|
867 |
var convertToPrivate = function convertToPrivate(node) {
|
868 |
if (typeof node.vtag === 'function') {
|
869 |
var vnodeData = Object.assign({}, node.vattrs);
|
870 |
-
|
871 |
if (node.vkey) {
|
872 |
vnodeData.key = node.vkey;
|
873 |
}
|
874 |
-
|
875 |
if (node.vname) {
|
876 |
vnodeData.name = node.vname;
|
877 |
}
|
878 |
-
|
879 |
return h.apply(void 0, [node.vtag, vnodeData].concat(_toConsumableArray(node.vchildren || [])));
|
880 |
}
|
881 |
-
|
882 |
var vnode = newVNode(node.vtag, node.vtext);
|
883 |
vnode.$attrs$ = node.vattrs;
|
884 |
vnode.$children$ = node.vchildren;
|
@@ -894,13 +694,10 @@ var convertToPrivate = function convertToPrivate(node) {
|
|
894 |
*
|
895 |
* Modified for Stencil's compiler and vdom
|
896 |
*/
|
897 |
-
|
898 |
-
|
899 |
var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSvg, flags) {
|
900 |
if (oldValue !== newValue) {
|
901 |
var isProp = isMemberInElement(elm, memberName);
|
902 |
var ln = memberName.toLowerCase();
|
903 |
-
|
904 |
if (memberName === 'class') {
|
905 |
var classList = elm.classList;
|
906 |
var oldClasses = parseClassList(oldValue);
|
@@ -924,7 +721,6 @@ var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSv
|
|
924 |
}
|
925 |
}
|
926 |
}
|
927 |
-
|
928 |
for (var _prop in newValue) {
|
929 |
if (!oldValue || newValue[_prop] !== oldValue[_prop]) {
|
930 |
if (_prop.includes('-')) {
|
@@ -967,25 +763,23 @@ var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSv
|
|
967 |
// except for the first character, we keep the event name case
|
968 |
memberName = ln[2] + memberName.slice(3);
|
969 |
}
|
970 |
-
|
971 |
if (oldValue) {
|
972 |
plt.rel(elm, memberName, oldValue, false);
|
973 |
}
|
974 |
-
|
975 |
if (newValue) {
|
976 |
plt.ael(elm, memberName, newValue, false);
|
977 |
}
|
978 |
} else {
|
979 |
// Set property if it exists and it's not a SVG
|
980 |
var isComplex = isComplexType(newValue);
|
981 |
-
|
982 |
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
983 |
try {
|
984 |
if (!elm.tagName.includes('-')) {
|
985 |
-
var n = newValue == null ? '' : newValue;
|
986 |
-
|
987 |
if (memberName === 'list') {
|
988 |
-
isProp = false;
|
|
|
989 |
} else if (oldValue == null || elm[memberName] != n) {
|
990 |
elm[memberName] = n;
|
991 |
}
|
@@ -1001,17 +795,13 @@ var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSv
|
|
1001 |
* - if it's a SVG, since properties might not work in <svg>
|
1002 |
* - if the newValue is null/undefined or 'false'.
|
1003 |
*/
|
1004 |
-
|
1005 |
-
|
1006 |
var xlink = false;
|
1007 |
-
|
1008 |
{
|
1009 |
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
1010 |
memberName = ln;
|
1011 |
xlink = true;
|
1012 |
}
|
1013 |
}
|
1014 |
-
|
1015 |
if (newValue == null || newValue === false) {
|
1016 |
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
1017 |
if (xlink) {
|
@@ -1020,11 +810,8 @@ var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSv
|
|
1020 |
elm.removeAttribute(memberName);
|
1021 |
}
|
1022 |
}
|
1023 |
-
} else if ((!isProp || flags & 4
|
1024 |
-
/* isHost */
|
1025 |
-
|| isSvg) && !isComplex) {
|
1026 |
newValue = newValue === true ? '' : newValue;
|
1027 |
-
|
1028 |
if (xlink) {
|
1029 |
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
1030 |
} else {
|
@@ -1034,23 +821,17 @@ var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSv
|
|
1034 |
}
|
1035 |
}
|
1036 |
};
|
1037 |
-
|
1038 |
var parseClassListRegex = /\s/;
|
1039 |
-
|
1040 |
var parseClassList = function parseClassList(value) {
|
1041 |
return !value ? [] : value.split(parseClassListRegex);
|
1042 |
};
|
1043 |
-
|
1044 |
var updateElement = function updateElement(oldVnode, newVnode, isSvgMode, memberName) {
|
1045 |
// if the element passed in is a shadow root, which is a document fragment
|
1046 |
// then we want to be adding attrs/props to the shadow root's "host" element
|
1047 |
// if it's not a shadow root, then we add attrs/props to the same element
|
1048 |
-
var elm = newVnode.$elm$.nodeType === 11
|
1049 |
-
/* DocumentFragment */
|
1050 |
-
&& newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
1051 |
var oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
1052 |
var newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
1053 |
-
|
1054 |
{
|
1055 |
// remove attributes no longer present on the vnode by setting them to undefined
|
1056 |
for (memberName in oldVnodeAttrs) {
|
@@ -1058,14 +839,12 @@ var updateElement = function updateElement(oldVnode, newVnode, isSvgMode, member
|
|
1058 |
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
1059 |
}
|
1060 |
}
|
1061 |
-
}
|
1062 |
-
|
1063 |
-
|
1064 |
for (memberName in newVnodeAttrs) {
|
1065 |
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
1066 |
}
|
1067 |
};
|
1068 |
-
|
1069 |
var createElm = function createElm(oldParentVNode, newParentVNode, childIndex, parentElm) {
|
1070 |
// tslint:disable-next-line: prefer-const
|
1071 |
var newVNode = newParentVNode.$children$[childIndex];
|
@@ -1073,72 +852,56 @@ var createElm = function createElm(oldParentVNode, newParentVNode, childIndex, p
|
|
1073 |
var elm;
|
1074 |
var childNode;
|
1075 |
var oldVNode;
|
1076 |
-
|
1077 |
if (!useNativeShadowDom) {
|
1078 |
// remember for later we need to check to relocate nodes
|
1079 |
checkSlotRelocate = true;
|
1080 |
-
|
1081 |
if (newVNode.$tag$ === 'slot') {
|
1082 |
if (scopeId) {
|
1083 |
// scoped css needs to add its scoped id to the parent element
|
1084 |
parentElm.classList.add(scopeId + '-s');
|
1085 |
}
|
1086 |
-
|
1087 |
-
|
1088 |
-
2
|
1089 |
-
|
1090 |
-
|
1091 |
-
1
|
1092 |
-
/* isSlotReference */
|
1093 |
-
;
|
1094 |
}
|
1095 |
}
|
1096 |
-
|
1097 |
if (newVNode.$text$ !== null) {
|
1098 |
// create text node
|
1099 |
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
1100 |
-
} else if (newVNode.$flags$ & 1
|
1101 |
-
/* isSlotReference */
|
1102 |
-
) {
|
1103 |
// create a slot reference node
|
1104 |
elm = newVNode.$elm$ = doc.createTextNode('');
|
1105 |
} else {
|
1106 |
if (!isSvgMode) {
|
1107 |
isSvgMode = newVNode.$tag$ === 'svg';
|
1108 |
-
}
|
1109 |
-
|
1110 |
-
|
1111 |
-
elm = newVNode.$elm$ = doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2
|
1112 |
-
/* isSlotFallback */
|
1113 |
-
? 'slot-fb' : newVNode.$tag$) ;
|
1114 |
-
|
1115 |
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
1116 |
isSvgMode = false;
|
1117 |
-
}
|
1118 |
-
|
1119 |
-
|
1120 |
{
|
1121 |
updateElement(null, newVNode, isSvgMode);
|
1122 |
}
|
1123 |
-
|
1124 |
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
1125 |
// if there is a scopeId and this is the initial render
|
1126 |
// then let's add the scopeId as a css class
|
1127 |
elm.classList.add(elm['s-si'] = scopeId);
|
1128 |
}
|
1129 |
-
|
1130 |
if (newVNode.$children$) {
|
1131 |
for (i = 0; i < newVNode.$children$.length; ++i) {
|
1132 |
// create the node
|
1133 |
-
childNode = createElm(oldParentVNode, newVNode, i, elm);
|
1134 |
-
|
1135 |
if (childNode) {
|
1136 |
// append our new node
|
1137 |
elm.appendChild(childNode);
|
1138 |
}
|
1139 |
}
|
1140 |
}
|
1141 |
-
|
1142 |
{
|
1143 |
if (newVNode.$tag$ === 'svg') {
|
1144 |
// Only reset the SVG context when we're exiting <svg> element
|
@@ -1149,24 +912,17 @@ var createElm = function createElm(oldParentVNode, newParentVNode, childIndex, p
|
|
1149 |
}
|
1150 |
}
|
1151 |
}
|
1152 |
-
|
1153 |
{
|
1154 |
elm['s-hn'] = hostTagName;
|
1155 |
-
|
1156 |
-
if (newVNode.$flags$ & (2
|
1157 |
-
/* isSlotFallback */
|
1158 |
-
| 1
|
1159 |
-
/* isSlotReference */
|
1160 |
-
)) {
|
1161 |
// remember the content reference comment
|
1162 |
-
elm['s-sr'] = true;
|
1163 |
-
|
1164 |
-
elm['s-cr'] = contentRef;
|
1165 |
-
|
1166 |
-
elm['s-sn'] = newVNode.$name$ || '';
|
1167 |
-
|
1168 |
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
1169 |
-
|
1170 |
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
1171 |
// we've got an old slot vnode and the wrapper is being replaced
|
1172 |
// so let's move the old slot content back to it's original location
|
@@ -1174,55 +930,42 @@ var createElm = function createElm(oldParentVNode, newParentVNode, childIndex, p
|
|
1174 |
}
|
1175 |
}
|
1176 |
}
|
1177 |
-
|
1178 |
return elm;
|
1179 |
};
|
1180 |
-
|
1181 |
var putBackInOriginalLocation = function putBackInOriginalLocation(parentElm, recursive) {
|
1182 |
-
plt.$flags$ |= 1
|
1183 |
-
/* isTmpDisconnected */
|
1184 |
-
;
|
1185 |
var oldSlotChildNodes = parentElm.childNodes;
|
1186 |
-
|
1187 |
for (var _i2 = oldSlotChildNodes.length - 1; _i2 >= 0; _i2--) {
|
1188 |
var childNode = oldSlotChildNodes[_i2];
|
1189 |
-
|
1190 |
if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
1191 |
// // this child node in the old element is from another component
|
1192 |
// // remove this node from the old slot's parent
|
1193 |
// childNode.remove();
|
1194 |
// and relocate it back to it's original location
|
1195 |
-
parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
|
|
1196 |
// later on the patch function will know what to do
|
1197 |
// and move this to the correct spot in need be
|
1198 |
-
|
1199 |
childNode['s-ol'].remove();
|
1200 |
childNode['s-ol'] = undefined;
|
1201 |
checkSlotRelocate = true;
|
1202 |
}
|
1203 |
-
|
1204 |
if (recursive) {
|
1205 |
putBackInOriginalLocation(childNode, recursive);
|
1206 |
}
|
1207 |
}
|
1208 |
-
|
1209 |
-
plt.$flags$ &= ~1
|
1210 |
-
/* isTmpDisconnected */
|
1211 |
-
;
|
1212 |
};
|
1213 |
|
1214 |
var addVnodes = function addVnodes(parentElm, before, parentVNode, vnodes, startIdx, endIdx) {
|
1215 |
var containerElm = parentElm['s-cr'] && parentElm['s-cr'].parentNode || parentElm;
|
1216 |
var childNode;
|
1217 |
-
|
1218 |
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
1219 |
containerElm = containerElm.shadowRoot;
|
1220 |
}
|
1221 |
-
|
1222 |
for (; startIdx <= endIdx; ++startIdx) {
|
1223 |
if (vnodes[startIdx]) {
|
1224 |
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
1225 |
-
|
1226 |
if (childNode) {
|
1227 |
vnodes[startIdx].$elm$ = childNode;
|
1228 |
containerElm.insertBefore(childNode, referenceNode(before) );
|
@@ -1230,18 +973,15 @@ var addVnodes = function addVnodes(parentElm, before, parentVNode, vnodes, start
|
|
1230 |
}
|
1231 |
}
|
1232 |
};
|
1233 |
-
|
1234 |
var removeVnodes = function removeVnodes(vnodes, startIdx, endIdx, vnode, elm) {
|
1235 |
for (; startIdx <= endIdx; ++startIdx) {
|
1236 |
if (vnode = vnodes[startIdx]) {
|
1237 |
elm = vnode.$elm$;
|
1238 |
callNodeRefs(vnode);
|
1239 |
-
|
1240 |
{
|
1241 |
// we're removing this element
|
1242 |
// so it's possible we need to show slot fallback content now
|
1243 |
checkSlotFallbackVisibility = true;
|
1244 |
-
|
1245 |
if (elm['s-ol']) {
|
1246 |
// remove the original location comment
|
1247 |
elm['s-ol'].remove();
|
@@ -1250,14 +990,12 @@ var removeVnodes = function removeVnodes(vnodes, startIdx, endIdx, vnode, elm) {
|
|
1250 |
// that's being removed are slot nodes
|
1251 |
putBackInOriginalLocation(elm, true);
|
1252 |
}
|
1253 |
-
}
|
1254 |
-
|
1255 |
-
|
1256 |
elm.remove();
|
1257 |
}
|
1258 |
}
|
1259 |
};
|
1260 |
-
|
1261 |
var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh) {
|
1262 |
var oldStartIdx = 0;
|
1263 |
var newStartIdx = 0;
|
@@ -1271,7 +1009,6 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1271 |
var newEndVnode = newCh[newEndIdx];
|
1272 |
var node;
|
1273 |
var elmToMove;
|
1274 |
-
|
1275 |
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
1276 |
if (oldStartVnode == null) {
|
1277 |
// Vnode might have been moved left
|
@@ -1295,7 +1032,6 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1295 |
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
1296 |
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
1297 |
}
|
1298 |
-
|
1299 |
patch(oldStartVnode, newEndVnode);
|
1300 |
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
1301 |
oldStartVnode = oldCh[++oldStartIdx];
|
@@ -1305,7 +1041,6 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1305 |
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
1306 |
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
1307 |
}
|
1308 |
-
|
1309 |
patch(oldEndVnode, newStartVnode);
|
1310 |
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
1311 |
oldEndVnode = oldCh[--oldEndIdx];
|
@@ -1313,7 +1048,6 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1313 |
} else {
|
1314 |
// createKeyToOldIdx
|
1315 |
idxInOld = -1;
|
1316 |
-
|
1317 |
{
|
1318 |
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
1319 |
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
@@ -1322,10 +1056,8 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1322 |
}
|
1323 |
}
|
1324 |
}
|
1325 |
-
|
1326 |
if (idxInOld >= 0) {
|
1327 |
elmToMove = oldCh[idxInOld];
|
1328 |
-
|
1329 |
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
1330 |
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
1331 |
} else {
|
@@ -1333,14 +1065,12 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1333 |
oldCh[idxInOld] = undefined;
|
1334 |
node = elmToMove.$elm$;
|
1335 |
}
|
1336 |
-
|
1337 |
newStartVnode = newCh[++newStartIdx];
|
1338 |
} else {
|
1339 |
// new element
|
1340 |
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
1341 |
newStartVnode = newCh[++newStartIdx];
|
1342 |
}
|
1343 |
-
|
1344 |
if (node) {
|
1345 |
{
|
1346 |
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
@@ -1348,14 +1078,12 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1348 |
}
|
1349 |
}
|
1350 |
}
|
1351 |
-
|
1352 |
if (oldStartIdx > oldEndIdx) {
|
1353 |
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
1354 |
} else if (newStartIdx > newEndIdx) {
|
1355 |
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
1356 |
}
|
1357 |
};
|
1358 |
-
|
1359 |
var isSameVnode = function isSameVnode(vnode1, vnode2) {
|
1360 |
// compare if two vnode to see if they're "technically" the same
|
1361 |
// need to have the same element tag, and same key to be the same
|
@@ -1363,15 +1091,12 @@ var isSameVnode = function isSameVnode(vnode1, vnode2) {
|
|
1363 |
if (vnode1.$tag$ === 'slot') {
|
1364 |
return vnode1.$name$ === vnode2.$name$;
|
1365 |
}
|
1366 |
-
|
1367 |
{
|
1368 |
return vnode1.$key$ === vnode2.$key$;
|
1369 |
}
|
1370 |
}
|
1371 |
-
|
1372 |
return false;
|
1373 |
};
|
1374 |
-
|
1375 |
var referenceNode = function referenceNode(node) {
|
1376 |
// this node was relocated to a new location in the dom
|
1377 |
// because of some other component's slot
|
@@ -1379,11 +1104,9 @@ var referenceNode = function referenceNode(node) {
|
|
1379 |
// it's original location was according to it's original vdom
|
1380 |
return node && node['s-ol'] || node;
|
1381 |
};
|
1382 |
-
|
1383 |
var parentReferenceNode = function parentReferenceNode(node) {
|
1384 |
return (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
1385 |
};
|
1386 |
-
|
1387 |
var patch = function patch(oldVNode, newVNode) {
|
1388 |
var elm = newVNode.$elm$ = oldVNode.$elm$;
|
1389 |
var oldChildren = oldVNode.$children$;
|
@@ -1391,15 +1114,13 @@ var patch = function patch(oldVNode, newVNode) {
|
|
1391 |
var tag = newVNode.$tag$;
|
1392 |
var text = newVNode.$text$;
|
1393 |
var defaultHolder;
|
1394 |
-
|
1395 |
if (text === null) {
|
1396 |
{
|
1397 |
// test if we're rendering an svg element, or still rendering nodes inside of one
|
1398 |
// only add this to the when the compiler sees we're using an svg somewhere
|
1399 |
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
1400 |
-
}
|
1401 |
-
|
1402 |
-
|
1403 |
{
|
1404 |
if (tag === 'slot') ;else {
|
1405 |
// either this is the first render of an element OR it's an update
|
@@ -1408,7 +1129,6 @@ var patch = function patch(oldVNode, newVNode) {
|
|
1408 |
updateElement(oldVNode, newVNode, isSvgMode);
|
1409 |
}
|
1410 |
}
|
1411 |
-
|
1412 |
if (oldChildren !== null && newChildren !== null) {
|
1413 |
// looks like there's child vnodes for both the old and new vnodes
|
1414 |
updateChildren(elm, oldChildren, newVNode, newChildren);
|
@@ -1417,15 +1137,13 @@ var patch = function patch(oldVNode, newVNode) {
|
|
1417 |
if (oldVNode.$text$ !== null) {
|
1418 |
// the old vnode was text, so be sure to clear it out
|
1419 |
elm.textContent = '';
|
1420 |
-
}
|
1421 |
-
|
1422 |
-
|
1423 |
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
1424 |
} else if (oldChildren !== null) {
|
1425 |
// no new child vnodes, but there are old child vnodes to remove
|
1426 |
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
1427 |
}
|
1428 |
-
|
1429 |
if (isSvgMode && tag === 'svg') {
|
1430 |
isSvgMode = false;
|
1431 |
}
|
@@ -1438,7 +1156,6 @@ var patch = function patch(oldVNode, newVNode) {
|
|
1438 |
elm.data = text;
|
1439 |
}
|
1440 |
};
|
1441 |
-
|
1442 |
var updateFallbackSlotVisibility = function updateFallbackSlotVisibility(elm) {
|
1443 |
// tslint:disable-next-line: prefer-const
|
1444 |
var childNodes = elm.childNodes;
|
@@ -1448,29 +1165,21 @@ var updateFallbackSlotVisibility = function updateFallbackSlotVisibility(elm) {
|
|
1448 |
var j;
|
1449 |
var slotNameAttr;
|
1450 |
var nodeType;
|
1451 |
-
|
1452 |
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
1453 |
childNode = childNodes[i];
|
1454 |
-
|
1455 |
-
if (childNode.nodeType === 1
|
1456 |
-
/* ElementNode */
|
1457 |
-
) {
|
1458 |
if (childNode['s-sr']) {
|
1459 |
// this is a slot fallback node
|
1460 |
// get the slot name for this slot reference node
|
1461 |
-
slotNameAttr = childNode['s-sn'];
|
|
|
1462 |
// then hide it if there are other slots in the light dom
|
1463 |
-
|
1464 |
childNode.hidden = false;
|
1465 |
-
|
1466 |
for (j = 0; j < ilen; j++) {
|
1467 |
nodeType = childNodes[j].nodeType;
|
1468 |
-
|
1469 |
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
1470 |
// this sibling node is from a different component OR is a named fallback slot node
|
1471 |
-
if (nodeType === 1
|
1472 |
-
/* ElementNode */
|
1473 |
-
&& slotNameAttr === childNodes[j].getAttribute('slot')) {
|
1474 |
childNode.hidden = true;
|
1475 |
break;
|
1476 |
}
|
@@ -1478,26 +1187,19 @@ var updateFallbackSlotVisibility = function updateFallbackSlotVisibility(elm) {
|
|
1478 |
// this is a default fallback slot node
|
1479 |
// any element or text node (with content)
|
1480 |
// should hide the default fallback slot node
|
1481 |
-
if (nodeType === 1
|
1482 |
-
/* ElementNode */
|
1483 |
-
|| nodeType === 3
|
1484 |
-
/* TextNode */
|
1485 |
-
&& childNodes[j].textContent.trim() !== '') {
|
1486 |
childNode.hidden = true;
|
1487 |
break;
|
1488 |
}
|
1489 |
}
|
1490 |
}
|
1491 |
-
}
|
1492 |
-
|
1493 |
-
|
1494 |
updateFallbackSlotVisibility(childNode);
|
1495 |
}
|
1496 |
}
|
1497 |
};
|
1498 |
-
|
1499 |
var relocateNodes = [];
|
1500 |
-
|
1501 |
var relocateSlotContent = function relocateSlotContent(elm) {
|
1502 |
// tslint:disable-next-line: prefer-const
|
1503 |
var childNode;
|
@@ -1509,19 +1211,15 @@ var relocateSlotContent = function relocateSlotContent(elm) {
|
|
1509 |
var i = 0;
|
1510 |
var childNodes = elm.childNodes;
|
1511 |
var ilen = childNodes.length;
|
1512 |
-
|
1513 |
for (; i < ilen; i++) {
|
1514 |
childNode = childNodes[i];
|
1515 |
-
|
1516 |
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
1517 |
// first got the content reference comment node
|
1518 |
// then we got it's parent, which is where all the host content is in now
|
1519 |
hostContentNodes = node.parentNode.childNodes;
|
1520 |
slotNameAttr = childNode['s-sn'];
|
1521 |
-
|
1522 |
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
1523 |
node = hostContentNodes[j];
|
1524 |
-
|
1525 |
if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
|
1526 |
// let's do some relocating to its new home
|
1527 |
// but never relocate a content reference node
|
@@ -1530,13 +1228,12 @@ var relocateSlotContent = function relocateSlotContent(elm) {
|
|
1530 |
// it's possible we've already decided to relocate this node
|
1531 |
relocateNodeData = relocateNodes.find(function (r) {
|
1532 |
return r.$nodeToRelocate$ === node;
|
1533 |
-
});
|
|
|
1534 |
// let's make sure we also double check
|
1535 |
// fallbacks are correctly hidden or shown
|
1536 |
-
|
1537 |
checkSlotFallbackVisibility = true;
|
1538 |
node['s-sn'] = node['s-sn'] || slotNameAttr;
|
1539 |
-
|
1540 |
if (relocateNodeData) {
|
1541 |
// previously we never found a slot home for this node
|
1542 |
// but turns out we did, so let's remember it now
|
@@ -1548,14 +1245,12 @@ var relocateSlotContent = function relocateSlotContent(elm) {
|
|
1548 |
$nodeToRelocate$: node
|
1549 |
});
|
1550 |
}
|
1551 |
-
|
1552 |
if (node['s-sr']) {
|
1553 |
relocateNodes.map(function (relocateNode) {
|
1554 |
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
|
1555 |
relocateNodeData = relocateNodes.find(function (r) {
|
1556 |
return r.$nodeToRelocate$ === node;
|
1557 |
});
|
1558 |
-
|
1559 |
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
1560 |
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
1561 |
}
|
@@ -1574,92 +1269,66 @@ var relocateSlotContent = function relocateSlotContent(elm) {
|
|
1574 |
}
|
1575 |
}
|
1576 |
}
|
1577 |
-
|
1578 |
-
if (childNode.nodeType === 1
|
1579 |
-
/* ElementNode */
|
1580 |
-
) {
|
1581 |
relocateSlotContent(childNode);
|
1582 |
}
|
1583 |
}
|
1584 |
};
|
1585 |
-
|
1586 |
var isNodeLocatedInSlot = function isNodeLocatedInSlot(nodeToRelocate, slotNameAttr) {
|
1587 |
-
if (nodeToRelocate.nodeType === 1
|
1588 |
-
/* ElementNode */
|
1589 |
-
) {
|
1590 |
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
1591 |
return true;
|
1592 |
}
|
1593 |
-
|
1594 |
if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
|
1595 |
return true;
|
1596 |
}
|
1597 |
-
|
1598 |
return false;
|
1599 |
}
|
1600 |
-
|
1601 |
if (nodeToRelocate['s-sn'] === slotNameAttr) {
|
1602 |
return true;
|
1603 |
}
|
1604 |
-
|
1605 |
return slotNameAttr === '';
|
1606 |
};
|
1607 |
-
|
1608 |
var callNodeRefs = function callNodeRefs(vNode) {
|
1609 |
{
|
1610 |
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
1611 |
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
1612 |
}
|
1613 |
};
|
1614 |
-
|
1615 |
var renderVdom = function renderVdom(hostRef, renderFnResults) {
|
1616 |
var hostElm = hostRef.$hostElement$;
|
1617 |
var cmpMeta = hostRef.$cmpMeta$;
|
1618 |
var oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
1619 |
var rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
1620 |
-
hostTagName = hostElm.tagName;
|
1621 |
-
|
1622 |
if (cmpMeta.$attrsToReflect$) {
|
1623 |
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
1624 |
cmpMeta.$attrsToReflect$.map(function (_ref9) {
|
1625 |
var _ref10 = _slicedToArray(_ref9, 2),
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
return rootVnode.$attrs$[attribute] = hostElm[propName];
|
1630 |
});
|
1631 |
}
|
1632 |
-
|
1633 |
rootVnode.$tag$ = null;
|
1634 |
-
rootVnode.$flags$ |= 4
|
1635 |
-
/* isHost */
|
1636 |
-
;
|
1637 |
hostRef.$vnode$ = rootVnode;
|
1638 |
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
1639 |
-
|
1640 |
{
|
1641 |
scopeId = hostElm['s-sc'];
|
1642 |
}
|
1643 |
-
|
1644 |
{
|
1645 |
contentRef = hostElm['s-cr'];
|
1646 |
-
useNativeShadowDom = (cmpMeta.$flags$ & 1
|
1647 |
-
|
1648 |
-
) !== 0; // always reset
|
1649 |
-
|
1650 |
checkSlotFallbackVisibility = false;
|
1651 |
-
}
|
1652 |
-
|
1653 |
-
|
1654 |
patch(oldVNode, rootVnode);
|
1655 |
-
|
1656 |
{
|
1657 |
// while we're moving nodes around existing nodes, temporarily disable
|
1658 |
// the disconnectCallback from working
|
1659 |
-
plt.$flags$ |= 1
|
1660 |
-
/* isTmpDisconnected */
|
1661 |
-
;
|
1662 |
-
|
1663 |
if (checkSlotRelocate) {
|
1664 |
relocateSlotContent(rootVnode.$elm$);
|
1665 |
var relocateData;
|
@@ -1669,11 +1338,9 @@ var renderVdom = function renderVdom(hostRef, renderFnResults) {
|
|
1669 |
var insertBeforeNode;
|
1670 |
var refNode;
|
1671 |
var _i3 = 0;
|
1672 |
-
|
1673 |
for (; _i3 < relocateNodes.length; _i3++) {
|
1674 |
relocateData = relocateNodes[_i3];
|
1675 |
nodeToRelocate = relocateData.$nodeToRelocate$;
|
1676 |
-
|
1677 |
if (!nodeToRelocate['s-ol']) {
|
1678 |
// add a reference node marking this node's original location
|
1679 |
// keep a reference to this node for later lookups
|
@@ -1682,31 +1349,25 @@ var renderVdom = function renderVdom(hostRef, renderFnResults) {
|
|
1682 |
nodeToRelocate.parentNode.insertBefore(nodeToRelocate['s-ol'] = orgLocationNode, nodeToRelocate);
|
1683 |
}
|
1684 |
}
|
1685 |
-
|
1686 |
for (_i3 = 0; _i3 < relocateNodes.length; _i3++) {
|
1687 |
relocateData = relocateNodes[_i3];
|
1688 |
nodeToRelocate = relocateData.$nodeToRelocate$;
|
1689 |
-
|
1690 |
if (relocateData.$slotRefNode$) {
|
1691 |
// by default we're just going to insert it directly
|
1692 |
// after the slot reference node
|
1693 |
parentNodeRef = relocateData.$slotRefNode$.parentNode;
|
1694 |
insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
|
1695 |
orgLocationNode = nodeToRelocate['s-ol'];
|
1696 |
-
|
1697 |
while (orgLocationNode = orgLocationNode.previousSibling) {
|
1698 |
refNode = orgLocationNode['s-nr'];
|
1699 |
-
|
1700 |
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
1701 |
refNode = refNode.nextSibling;
|
1702 |
-
|
1703 |
if (!refNode || !refNode['s-nr']) {
|
1704 |
insertBeforeNode = refNode;
|
1705 |
break;
|
1706 |
}
|
1707 |
}
|
1708 |
}
|
1709 |
-
|
1710 |
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
1711 |
// we've checked that it's worth while to relocate
|
1712 |
// since that the node to relocate
|
@@ -1715,56 +1376,40 @@ var renderVdom = function renderVdom(hostRef, renderFnResults) {
|
|
1715 |
if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
1716 |
// probably a component in the index.html that doesn't have it's hostname set
|
1717 |
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
1718 |
-
}
|
1719 |
-
|
1720 |
-
|
1721 |
parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
1722 |
}
|
1723 |
}
|
1724 |
} else {
|
1725 |
// this node doesn't have a slot home to go to, so let's hide it
|
1726 |
-
if (nodeToRelocate.nodeType === 1
|
1727 |
-
/* ElementNode */
|
1728 |
-
) {
|
1729 |
nodeToRelocate.hidden = true;
|
1730 |
}
|
1731 |
}
|
1732 |
}
|
1733 |
}
|
1734 |
-
|
1735 |
if (checkSlotFallbackVisibility) {
|
1736 |
updateFallbackSlotVisibility(rootVnode.$elm$);
|
1737 |
-
}
|
|
|
1738 |
// allow the disconnect callback to work again
|
1739 |
-
|
1740 |
-
|
1741 |
-
plt.$flags$ &= ~1
|
1742 |
-
/* isTmpDisconnected */
|
1743 |
-
; // always reset
|
1744 |
-
|
1745 |
relocateNodes.length = 0;
|
1746 |
}
|
1747 |
-
};
|
1748 |
-
|
1749 |
var getElement = function getElement(ref) {
|
1750 |
return getHostRef(ref).$hostElement$ ;
|
1751 |
};
|
1752 |
-
|
1753 |
var createEvent = function createEvent(ref, name, flags) {
|
1754 |
var elm = getElement(ref);
|
1755 |
return {
|
1756 |
emit: function emit(detail) {
|
1757 |
-
|
1758 |
return emitEvent(elm, name, {
|
1759 |
-
bubbles: !!(flags & 4
|
1760 |
-
/*
|
1761 |
-
),
|
1762 |
-
composed: !!(flags & 2
|
1763 |
-
/* Composed */
|
1764 |
-
),
|
1765 |
-
cancelable: !!(flags & 1
|
1766 |
-
/* Cancellable */
|
1767 |
-
),
|
1768 |
detail: detail
|
1769 |
});
|
1770 |
}
|
@@ -1777,14 +1422,11 @@ var createEvent = function createEvent(ref, name, flags) {
|
|
1777 |
* @param opts options for configuring a custom Event
|
1778 |
* @returns the custom Event
|
1779 |
*/
|
1780 |
-
|
1781 |
-
|
1782 |
var emitEvent = function emitEvent(elm, name, opts) {
|
1783 |
var ev = plt.ce(name, opts);
|
1784 |
elm.dispatchEvent(ev);
|
1785 |
return ev;
|
1786 |
};
|
1787 |
-
|
1788 |
var attachToAncestor = function attachToAncestor(hostRef, ancestorComponent) {
|
1789 |
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
1790 |
ancestorComponent['s-p'].push(new Promise(function (r) {
|
@@ -1792,68 +1434,50 @@ var attachToAncestor = function attachToAncestor(hostRef, ancestorComponent) {
|
|
1792 |
}));
|
1793 |
}
|
1794 |
};
|
1795 |
-
|
1796 |
var scheduleUpdate = function scheduleUpdate(hostRef, isInitialLoad) {
|
1797 |
{
|
1798 |
-
hostRef.$flags$ |= 16
|
1799 |
-
/* isQueuedForUpdate */
|
1800 |
-
;
|
1801 |
}
|
1802 |
|
1803 |
-
if (hostRef.$flags$ & 4
|
1804 |
-
|
1805 |
-
) {
|
1806 |
-
hostRef.$flags$ |= 512
|
1807 |
-
/* needsRerender */
|
1808 |
-
;
|
1809 |
return;
|
1810 |
}
|
1811 |
-
|
1812 |
-
|
1813 |
// has already fired off its lifecycle update then
|
1814 |
// fire off the initial update
|
1815 |
-
|
1816 |
var dispatch = function dispatch() {
|
1817 |
return dispatchHooks(hostRef, isInitialLoad);
|
1818 |
};
|
1819 |
-
|
1820 |
return writeTask(dispatch) ;
|
1821 |
};
|
1822 |
-
|
1823 |
var dispatchHooks = function dispatchHooks(hostRef, isInitialLoad) {
|
1824 |
var endSchedule = createTime();
|
1825 |
var instance = hostRef.$lazyInstance$ ;
|
1826 |
var promise;
|
1827 |
-
|
1828 |
if (isInitialLoad) {
|
1829 |
{
|
1830 |
-
hostRef.$flags$ |= 256
|
1831 |
-
/* isListenReady */
|
1832 |
-
;
|
1833 |
-
|
1834 |
if (hostRef.$queuedListeners$) {
|
1835 |
hostRef.$queuedListeners$.map(function (_ref11) {
|
1836 |
var _ref12 = _slicedToArray(_ref11, 2),
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
return safeCall(instance, methodName, event);
|
1841 |
});
|
1842 |
hostRef.$queuedListeners$ = null;
|
1843 |
}
|
1844 |
}
|
1845 |
-
|
1846 |
{
|
1847 |
promise = safeCall(instance, 'componentWillLoad');
|
1848 |
}
|
1849 |
}
|
1850 |
-
|
1851 |
endSchedule();
|
1852 |
return then(promise, function () {
|
1853 |
return updateComponent(hostRef, instance, isInitialLoad);
|
1854 |
});
|
1855 |
};
|
1856 |
-
|
1857 |
var updateComponent = /*#__PURE__*/function () {
|
1858 |
var _ref13 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(hostRef, instance, isInitialLoad) {
|
1859 |
var elm, endUpdate, rc, endRender, childrenPromises, postUpdate;
|
@@ -1865,28 +1489,21 @@ var updateComponent = /*#__PURE__*/function () {
|
|
1865 |
elm = hostRef.$hostElement$;
|
1866 |
endUpdate = createTime();
|
1867 |
rc = elm['s-rc'];
|
1868 |
-
|
1869 |
if (isInitialLoad) {
|
1870 |
// DOM WRITE!
|
1871 |
attachStyles(hostRef);
|
1872 |
}
|
1873 |
-
|
1874 |
endRender = createTime();
|
1875 |
-
|
1876 |
{
|
1877 |
_context.next = 11;
|
1878 |
break;
|
1879 |
}
|
1880 |
-
|
1881 |
case 9:
|
1882 |
_context.next = 12;
|
1883 |
break;
|
1884 |
-
|
1885 |
case 11:
|
1886 |
callRender(hostRef, instance);
|
1887 |
-
|
1888 |
case 12:
|
1889 |
-
|
1890 |
if (rc) {
|
1891 |
// ok, so turns out there are some child host elements
|
1892 |
// waiting on this parent element to load
|
@@ -1896,28 +1513,21 @@ var updateComponent = /*#__PURE__*/function () {
|
|
1896 |
});
|
1897 |
elm['s-rc'] = undefined;
|
1898 |
}
|
1899 |
-
|
1900 |
endRender();
|
1901 |
endUpdate();
|
1902 |
-
|
1903 |
{
|
1904 |
childrenPromises = elm['s-p'];
|
1905 |
-
|
1906 |
postUpdate = function postUpdate() {
|
1907 |
return postUpdateComponent(hostRef);
|
1908 |
};
|
1909 |
-
|
1910 |
if (childrenPromises.length === 0) {
|
1911 |
postUpdate();
|
1912 |
} else {
|
1913 |
Promise.all(childrenPromises).then(postUpdate);
|
1914 |
-
hostRef.$flags$ |= 4
|
1915 |
-
/* isWaitingForChildren */
|
1916 |
-
;
|
1917 |
childrenPromises.length = 0;
|
1918 |
}
|
1919 |
}
|
1920 |
-
|
1921 |
case 19:
|
1922 |
case "end":
|
1923 |
return _context.stop();
|
@@ -1925,27 +1535,19 @@ var updateComponent = /*#__PURE__*/function () {
|
|
1925 |
}
|
1926 |
}, _callee);
|
1927 |
}));
|
1928 |
-
|
1929 |
return function updateComponent(_x, _x2, _x3) {
|
1930 |
return _ref13.apply(this, arguments);
|
1931 |
};
|
1932 |
}();
|
1933 |
-
|
1934 |
var callRender = function callRender(hostRef, instance, elm) {
|
1935 |
-
|
1936 |
try {
|
1937 |
instance = instance.render() ;
|
1938 |
-
|
1939 |
{
|
1940 |
-
hostRef.$flags$ &= ~16
|
1941 |
-
/* isQueuedForUpdate */
|
1942 |
-
;
|
1943 |
}
|
1944 |
|
1945 |
{
|
1946 |
-
hostRef.$flags$ |= 2
|
1947 |
-
/* hasRendered */
|
1948 |
-
;
|
1949 |
}
|
1950 |
|
1951 |
{
|
@@ -1963,39 +1565,28 @@ var callRender = function callRender(hostRef, instance, elm) {
|
|
1963 |
}
|
1964 |
return null;
|
1965 |
};
|
1966 |
-
|
1967 |
var postUpdateComponent = function postUpdateComponent(hostRef) {
|
1968 |
var elm = hostRef.$hostElement$;
|
1969 |
var endPostUpdate = createTime();
|
1970 |
var instance = hostRef.$lazyInstance$ ;
|
1971 |
var ancestorComponent = hostRef.$ancestorComponent$;
|
1972 |
-
|
1973 |
{
|
1974 |
|
1975 |
safeCall(instance, 'componentDidRender');
|
1976 |
}
|
1977 |
-
|
1978 |
-
|
1979 |
-
/* hasLoadedComponent */
|
1980 |
-
)) {
|
1981 |
-
hostRef.$flags$ |= 64
|
1982 |
-
/* hasLoadedComponent */
|
1983 |
-
;
|
1984 |
-
|
1985 |
{
|
1986 |
// DOM WRITE!
|
1987 |
addHydratedFlag(elm);
|
1988 |
}
|
1989 |
-
|
1990 |
{
|
1991 |
|
1992 |
safeCall(instance, 'componentDidLoad');
|
1993 |
}
|
1994 |
endPostUpdate();
|
1995 |
-
|
1996 |
{
|
1997 |
hostRef.$onReadyResolve$(elm);
|
1998 |
-
|
1999 |
if (!ancestorComponent) {
|
2000 |
appDidLoad();
|
2001 |
}
|
@@ -2003,38 +1594,27 @@ var postUpdateComponent = function postUpdateComponent(hostRef) {
|
|
2003 |
} else {
|
2004 |
endPostUpdate();
|
2005 |
}
|
2006 |
-
|
2007 |
{
|
2008 |
hostRef.$onInstanceResolve$(elm);
|
2009 |
-
}
|
|
|
2010 |
// the deepest elements load first then bubbles up
|
2011 |
-
|
2012 |
-
|
2013 |
{
|
2014 |
if (hostRef.$onRenderResolve$) {
|
2015 |
hostRef.$onRenderResolve$();
|
2016 |
hostRef.$onRenderResolve$ = undefined;
|
2017 |
}
|
2018 |
-
|
2019 |
-
if (hostRef.$flags$ & 512
|
2020 |
-
/* needsRerender */
|
2021 |
-
) {
|
2022 |
nextTick(function () {
|
2023 |
return scheduleUpdate(hostRef, false);
|
2024 |
});
|
2025 |
}
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
| 512
|
2030 |
-
/* needsRerender */
|
2031 |
-
);
|
2032 |
-
} // ( •_•)
|
2033 |
// ( •_•)>⌐■-■
|
2034 |
// (⌐■_■)
|
2035 |
-
|
2036 |
};
|
2037 |
-
|
2038 |
var appDidLoad = function appDidLoad(who) {
|
2039 |
// on appload
|
2040 |
// we have finish the first big initial render
|
@@ -2050,7 +1630,6 @@ var appDidLoad = function appDidLoad(who) {
|
|
2050 |
});
|
2051 |
});
|
2052 |
};
|
2053 |
-
|
2054 |
var safeCall = function safeCall(instance, method, arg) {
|
2055 |
if (instance && instance[method]) {
|
2056 |
try {
|
@@ -2059,57 +1638,41 @@ var safeCall = function safeCall(instance, method, arg) {
|
|
2059 |
consoleError(e);
|
2060 |
}
|
2061 |
}
|
2062 |
-
|
2063 |
return undefined;
|
2064 |
};
|
2065 |
-
|
2066 |
var then = function then(promise, thenFn) {
|
2067 |
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
2068 |
};
|
2069 |
-
|
2070 |
var addHydratedFlag = function addHydratedFlag(elm) {
|
2071 |
return elm.classList.add('hydrated') ;
|
2072 |
};
|
2073 |
-
|
2074 |
var parsePropertyValue = function parsePropertyValue(propValue, propType) {
|
2075 |
// ensure this value is of the correct prop type
|
2076 |
if (propValue != null && !isComplexType(propValue)) {
|
2077 |
-
if (propType & 4
|
2078 |
-
/* Boolean */
|
2079 |
-
) {
|
2080 |
// per the HTML spec, any string value means it is a boolean true value
|
2081 |
// but we'll cheat here and say that the string "false" is the boolean false
|
2082 |
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
2083 |
}
|
2084 |
-
|
2085 |
-
if (propType & 2
|
2086 |
-
/* Number */
|
2087 |
-
) {
|
2088 |
// force it to be a number
|
2089 |
return parseFloat(propValue);
|
2090 |
}
|
2091 |
-
|
2092 |
-
if (propType & 1
|
2093 |
-
/* String */
|
2094 |
-
) {
|
2095 |
// could have been passed as a number or boolean
|
2096 |
// but we still want it as a string
|
2097 |
return String(propValue);
|
2098 |
-
}
|
2099 |
-
|
2100 |
-
|
2101 |
return propValue;
|
2102 |
-
}
|
|
|
2103 |
// so no need to change to a different type
|
2104 |
-
|
2105 |
-
|
2106 |
return propValue;
|
2107 |
};
|
2108 |
-
|
2109 |
var getValue = function getValue(ref, propName) {
|
2110 |
return getHostRef(ref).$instanceValues$.get(propName);
|
2111 |
};
|
2112 |
-
|
2113 |
var setValue = function setValue(ref, propName, newVal, cmpMeta) {
|
2114 |
// check our new property value against our internal value
|
2115 |
var hostRef = getHostRef(ref);
|
@@ -2118,21 +1681,14 @@ var setValue = function setValue(ref, propName, newVal, cmpMeta) {
|
|
2118 |
var flags = hostRef.$flags$;
|
2119 |
var instance = hostRef.$lazyInstance$ ;
|
2120 |
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
2121 |
-
|
2122 |
-
if ((!(flags & 8
|
2123 |
-
/* isConstructingInstance */
|
2124 |
-
) || oldVal === undefined) && newVal !== oldVal) {
|
2125 |
// gadzooks! the property's value has changed!!
|
2126 |
// set our new value!
|
2127 |
hostRef.$instanceValues$.set(propName, newVal);
|
2128 |
-
|
2129 |
if (instance) {
|
2130 |
// get an array of method names of watch functions to call
|
2131 |
-
if (cmpMeta.$watchers$ && flags & 128
|
2132 |
-
/* isWatchReady */
|
2133 |
-
) {
|
2134 |
var watchMethods = cmpMeta.$watchers$[propName];
|
2135 |
-
|
2136 |
if (watchMethods) {
|
2137 |
// this instance is watching for when this property changed
|
2138 |
watchMethods.map(function (watchMethodName) {
|
@@ -2145,47 +1701,30 @@ var setValue = function setValue(ref, propName, newVal, cmpMeta) {
|
|
2145 |
});
|
2146 |
}
|
2147 |
}
|
2148 |
-
|
2149 |
-
|
2150 |
-
/* hasRendered */
|
2151 |
-
| 16
|
2152 |
-
/* isQueuedForUpdate */
|
2153 |
-
)) === 2
|
2154 |
-
/* hasRendered */
|
2155 |
-
) {
|
2156 |
// but only if we've already rendered, otherwise just chill out
|
2157 |
// queue that we need to do an update, but don't worry about queuing
|
2158 |
// up millions cuz this function ensures it only runs once
|
2159 |
-
|
2160 |
-
|
2161 |
scheduleUpdate(hostRef, false);
|
2162 |
}
|
2163 |
}
|
2164 |
}
|
2165 |
};
|
2166 |
-
|
2167 |
var proxyComponent = function proxyComponent(Cstr, cmpMeta, flags) {
|
2168 |
if (cmpMeta.$members$) {
|
2169 |
if (Cstr.watchers) {
|
2170 |
cmpMeta.$watchers$ = Cstr.watchers;
|
2171 |
-
}
|
2172 |
-
|
2173 |
-
|
2174 |
var members = Object.entries(cmpMeta.$members$);
|
2175 |
var prototype = Cstr.prototype;
|
2176 |
members.map(function (_ref14) {
|
2177 |
var _ref15 = _slicedToArray(_ref14, 2),
|
2178 |
-
|
2179 |
-
|
2180 |
-
|
2181 |
-
|
2182 |
-
if ((memberFlags & 31
|
2183 |
-
/* Prop */
|
2184 |
-
|| (flags & 2
|
2185 |
-
/* proxyState */
|
2186 |
-
) && memberFlags & 32
|
2187 |
-
/* State */
|
2188 |
-
)) {
|
2189 |
// proxyComponent - prop
|
2190 |
Object.defineProperty(prototype, memberName, {
|
2191 |
get: function get() {
|
@@ -2193,46 +1732,35 @@ var proxyComponent = function proxyComponent(Cstr, cmpMeta, flags) {
|
|
2193 |
return getValue(this, memberName);
|
2194 |
},
|
2195 |
set: function set(newValue) {
|
2196 |
-
|
2197 |
-
|
2198 |
setValue(this, memberName, newValue, cmpMeta);
|
2199 |
},
|
2200 |
configurable: true,
|
2201 |
enumerable: true
|
2202 |
});
|
2203 |
-
} else if (flags & 1
|
2204 |
-
/* isElementConstructor */
|
2205 |
-
&& memberFlags & 64
|
2206 |
-
/* Method */
|
2207 |
-
) {
|
2208 |
// proxyComponent - method
|
2209 |
Object.defineProperty(prototype, memberName, {
|
2210 |
value: function value() {
|
2211 |
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
2212 |
args[_key2] = arguments[_key2];
|
2213 |
}
|
2214 |
-
|
2215 |
var ref = getHostRef(this);
|
2216 |
return ref.$onInstancePromise$.then(function () {
|
2217 |
var _ref$$lazyInstance$;
|
2218 |
-
|
2219 |
return (_ref$$lazyInstance$ = ref.$lazyInstance$)[memberName].apply(_ref$$lazyInstance$, args);
|
2220 |
});
|
2221 |
}
|
2222 |
});
|
2223 |
}
|
2224 |
});
|
2225 |
-
|
2226 |
-
if ((flags & 1
|
2227 |
-
/* isElementConstructor */
|
2228 |
-
)) {
|
2229 |
var attrNameToPropName = new Map();
|
2230 |
-
|
2231 |
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
2232 |
var _this = this;
|
2233 |
-
|
2234 |
plt.jmp(function () {
|
2235 |
-
var propName = attrNameToPropName.get(attrName);
|
|
|
2236 |
// in the case where an attribute was set inline.
|
2237 |
// ```html
|
2238 |
// <my-component some-attribute="some-value"></my-component>
|
@@ -2265,92 +1793,68 @@ var proxyComponent = function proxyComponent(Cstr, cmpMeta, flags) {
|
|
2265 |
// TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
|
2266 |
// properties here given that this goes against best practices outlined here
|
2267 |
// https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
|
2268 |
-
|
2269 |
if (_this.hasOwnProperty(propName)) {
|
2270 |
newValue = _this[propName];
|
2271 |
delete _this[propName];
|
2272 |
}
|
2273 |
-
|
2274 |
_this[propName] = newValue === null && typeof _this[propName] === 'boolean' ? false : newValue;
|
2275 |
});
|
2276 |
-
};
|
|
|
2277 |
// and also create a map of html attribute name to js property name
|
2278 |
-
|
2279 |
-
|
2280 |
Cstr.observedAttributes = members.filter(function (_ref16) {
|
2281 |
var _ref17 = _slicedToArray(_ref16, 2),
|
2282 |
-
|
2283 |
-
|
2284 |
return m[0] & 15;
|
2285 |
-
}
|
2286 |
-
/* HasAttribute */
|
2287 |
-
) // filter to only keep props that should match attributes
|
2288 |
.map(function (_ref18) {
|
2289 |
var _ref19 = _slicedToArray(_ref18, 2),
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
var attrName = m[1] || propName;
|
2294 |
attrNameToPropName.set(attrName, propName);
|
2295 |
-
|
2296 |
-
if (m[0] & 512
|
2297 |
-
/* ReflectAttr */
|
2298 |
-
) {
|
2299 |
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
2300 |
}
|
2301 |
-
|
2302 |
return attrName;
|
2303 |
});
|
2304 |
}
|
2305 |
}
|
2306 |
-
|
2307 |
return Cstr;
|
2308 |
};
|
2309 |
-
|
2310 |
var initializeComponent = /*#__PURE__*/function () {
|
2311 |
var _ref20 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(elm, hostRef, cmpMeta, hmrVersionId, Cstr) {
|
2312 |
var endLoad, endNewInstance, style, _scopeId, endRegisterStyles, ancestorComponent, schedule;
|
2313 |
-
|
2314 |
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2315 |
while (1) {
|
2316 |
switch (_context2.prev = _context2.next) {
|
2317 |
case 0:
|
2318 |
-
if (!((hostRef.$flags$ & 32
|
2319 |
-
/* hasInitializedComponent */
|
2320 |
-
) === 0)) {
|
2321 |
_context2.next = 37;
|
2322 |
break;
|
2323 |
}
|
2324 |
-
|
2325 |
// we haven't initialized this element yet
|
2326 |
-
hostRef.$flags$ |= 32
|
2327 |
-
|
2328 |
-
; // lazy loaded components
|
2329 |
// request the component's implementation to be
|
2330 |
// wired up with the host element
|
2331 |
-
|
2332 |
Cstr = loadModule(cmpMeta);
|
2333 |
-
|
2334 |
if (!Cstr.then) {
|
2335 |
_context2.next = 10;
|
2336 |
break;
|
2337 |
}
|
2338 |
-
|
2339 |
// Await creates a micro-task avoid if possible
|
2340 |
endLoad = uniqueTime();
|
2341 |
_context2.next = 8;
|
2342 |
return Cstr;
|
2343 |
-
|
2344 |
case 8:
|
2345 |
Cstr = _context2.sent;
|
2346 |
endLoad();
|
2347 |
-
|
2348 |
case 10:
|
2349 |
{
|
2350 |
_context2.next = 12;
|
2351 |
break;
|
2352 |
}
|
2353 |
-
|
2354 |
case 12:
|
2355 |
if (!Cstr.isProxied) {
|
2356 |
// we've never proxied this Constructor before
|
@@ -2359,104 +1863,73 @@ var initializeComponent = /*#__PURE__*/function () {
|
|
2359 |
{
|
2360 |
cmpMeta.$watchers$ = Cstr.watchers;
|
2361 |
}
|
2362 |
-
|
2363 |
-
proxyComponent(Cstr, cmpMeta, 2
|
2364 |
-
/* proxyState */
|
2365 |
-
);
|
2366 |
Cstr.isProxied = true;
|
2367 |
}
|
2368 |
-
|
2369 |
endNewInstance = createTime(); // ok, time to construct the instance
|
2370 |
// but let's keep track of when we start and stop
|
2371 |
// so that the getters/setters don't incorrectly step on data
|
2372 |
-
|
2373 |
{
|
2374 |
-
hostRef.$flags$ |= 8
|
2375 |
-
|
2376 |
-
|
2377 |
-
} // construct the lazy-loaded component implementation
|
2378 |
// passing the hostRef is very important during
|
2379 |
// construction in order to directly wire together the
|
2380 |
// host element and the lazy-loaded instance
|
2381 |
-
|
2382 |
-
|
2383 |
try {
|
2384 |
new Cstr(hostRef);
|
2385 |
} catch (e) {
|
2386 |
consoleError(e);
|
2387 |
}
|
2388 |
-
|
2389 |
{
|
2390 |
-
hostRef.$flags$ &= ~8
|
2391 |
-
/* isConstructingInstance */
|
2392 |
-
;
|
2393 |
}
|
2394 |
|
2395 |
{
|
2396 |
-
hostRef.$flags$ |= 128
|
2397 |
-
/* isWatchReady */
|
2398 |
-
;
|
2399 |
}
|
2400 |
|
2401 |
endNewInstance();
|
2402 |
_context2.next = 25;
|
2403 |
break;
|
2404 |
-
|
2405 |
case 22:
|
2406 |
// sync constructor component
|
2407 |
Cstr = elm.constructor;
|
2408 |
-
hostRef.$flags$ |= 32
|
2409 |
-
|
2410 |
-
; // wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
|
2411 |
// watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
|
2412 |
// Stencil has completed instantiating the component.
|
2413 |
-
|
2414 |
customElements.whenDefined(cmpMeta.$tagName$).then(function () {
|
2415 |
-
return hostRef.$flags$ |= 128
|
2416 |
-
/* isWatchReady */
|
2417 |
-
;
|
2418 |
});
|
2419 |
-
|
2420 |
case 25:
|
2421 |
if (!(Cstr.style)) {
|
2422 |
_context2.next = 37;
|
2423 |
break;
|
2424 |
}
|
2425 |
-
|
2426 |
// this component has styles but we haven't registered them yet
|
2427 |
style = Cstr.style;
|
2428 |
-
|
2429 |
_scopeId = getScopeId(cmpMeta);
|
2430 |
-
|
2431 |
if (styles.has(_scopeId)) {
|
2432 |
_context2.next = 37;
|
2433 |
break;
|
2434 |
}
|
2435 |
-
|
2436 |
endRegisterStyles = createTime();
|
2437 |
-
|
2438 |
{
|
2439 |
_context2.next = 35;
|
2440 |
break;
|
2441 |
}
|
2442 |
-
|
2443 |
case 34:
|
2444 |
style = _context2.sent;
|
2445 |
-
|
2446 |
case 35:
|
2447 |
-
registerStyle(_scopeId, style, !!(cmpMeta.$flags$ & 1
|
2448 |
-
/* shadowDomEncapsulation */
|
2449 |
-
));
|
2450 |
endRegisterStyles();
|
2451 |
-
|
2452 |
case 37:
|
2453 |
// we've successfully created a lazy instance
|
2454 |
ancestorComponent = hostRef.$ancestorComponent$;
|
2455 |
-
|
2456 |
schedule = function schedule() {
|
2457 |
return scheduleUpdate(hostRef, true);
|
2458 |
};
|
2459 |
-
|
2460 |
if (ancestorComponent && ancestorComponent['s-rc']) {
|
2461 |
// this is the intial load and this component it has an ancestor component
|
2462 |
// but the ancestor component has NOT fired its will update lifecycle yet
|
@@ -2468,7 +1941,6 @@ var initializeComponent = /*#__PURE__*/function () {
|
|
2468 |
} else {
|
2469 |
schedule();
|
2470 |
}
|
2471 |
-
|
2472 |
case 40:
|
2473 |
case "end":
|
2474 |
return _context2.stop();
|
@@ -2476,48 +1948,32 @@ var initializeComponent = /*#__PURE__*/function () {
|
|
2476 |
}
|
2477 |
}, _callee2);
|
2478 |
}));
|
2479 |
-
|
2480 |
return function initializeComponent(_x4, _x5, _x6, _x7, _x8) {
|
2481 |
return _ref20.apply(this, arguments);
|
2482 |
};
|
2483 |
}();
|
2484 |
-
|
2485 |
var _connectedCallback = function connectedCallback(elm) {
|
2486 |
-
if ((plt.$flags$ & 1
|
2487 |
-
/* isTmpDisconnected */
|
2488 |
-
) === 0) {
|
2489 |
var hostRef = getHostRef(elm);
|
2490 |
var cmpMeta = hostRef.$cmpMeta$;
|
2491 |
var endConnected = createTime();
|
2492 |
-
|
2493 |
-
if (!(hostRef.$flags$ & 1
|
2494 |
-
/* hasConnected */
|
2495 |
-
)) {
|
2496 |
// first time this component has connected
|
2497 |
-
hostRef.$flags$ |= 1
|
2498 |
-
/* hasConnected */
|
2499 |
-
;
|
2500 |
var hostId;
|
2501 |
-
|
2502 |
if (!hostId) {
|
2503 |
// initUpdate
|
2504 |
// if the slot polyfill is required we'll need to put some nodes
|
2505 |
// in here to act as original content anchors as we move nodes around
|
2506 |
// host element has been connected to the DOM
|
2507 |
-
if (cmpMeta.$flags$ & (4
|
2508 |
-
/* hasSlotRelocation */
|
2509 |
-
| 8
|
2510 |
-
/* needsShadowDomShim */
|
2511 |
-
)) {
|
2512 |
setContentReference(elm);
|
2513 |
}
|
2514 |
}
|
2515 |
-
|
2516 |
{
|
2517 |
// find the first ancestor component (if there is one) and register
|
2518 |
// this component as one of the actively loading child components for its ancestor
|
2519 |
var ancestorComponent = elm;
|
2520 |
-
|
2521 |
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
2522 |
// climb up the ancestors looking for the first
|
2523 |
// component that hasn't finished its lifecycle update yet
|
@@ -2528,27 +1984,22 @@ var _connectedCallback = function connectedCallback(elm) {
|
|
2528 |
break;
|
2529 |
}
|
2530 |
}
|
2531 |
-
}
|
|
|
2532 |
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
2533 |
-
|
2534 |
-
|
2535 |
if (cmpMeta.$members$) {
|
2536 |
Object.entries(cmpMeta.$members$).map(function (_ref21) {
|
2537 |
var _ref22 = _slicedToArray(_ref21, 2),
|
2538 |
-
|
2539 |
-
|
2540 |
-
|
2541 |
-
|
2542 |
-
if (memberFlags & 31
|
2543 |
-
/* Prop */
|
2544 |
-
&& elm.hasOwnProperty(memberName)) {
|
2545 |
var value = elm[memberName];
|
2546 |
delete elm[memberName];
|
2547 |
elm[memberName] = value;
|
2548 |
}
|
2549 |
});
|
2550 |
}
|
2551 |
-
|
2552 |
{
|
2553 |
initializeComponent(elm, hostRef, cmpMeta);
|
2554 |
}
|
@@ -2556,13 +2007,11 @@ var _connectedCallback = function connectedCallback(elm) {
|
|
2556 |
// not the first time this has connected
|
2557 |
// reattach any event listeners to the host
|
2558 |
// since they would have been removed when disconnected
|
2559 |
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
2560 |
}
|
2561 |
-
|
2562 |
endConnected();
|
2563 |
}
|
2564 |
};
|
2565 |
-
|
2566 |
var setContentReference = function setContentReference(elm) {
|
2567 |
// only required when we're NOT using native shadow dom (slot)
|
2568 |
// or this browser doesn't support native shadow dom
|
@@ -2574,14 +2023,10 @@ var setContentReference = function setContentReference(elm) {
|
|
2574 |
contentRefElm['s-cn'] = true;
|
2575 |
elm.insertBefore(contentRefElm, elm.firstChild);
|
2576 |
};
|
2577 |
-
|
2578 |
var _disconnectedCallback = function disconnectedCallback(elm) {
|
2579 |
-
if ((plt.$flags$ & 1
|
2580 |
-
/* isTmpDisconnected */
|
2581 |
-
) === 0) {
|
2582 |
var hostRef = getHostRef(elm);
|
2583 |
var instance = hostRef.$lazyInstance$ ;
|
2584 |
-
|
2585 |
{
|
2586 |
if (hostRef.$rmListeners$) {
|
2587 |
hostRef.$rmListeners$.map(function (rmListener) {
|
@@ -2589,14 +2034,12 @@ var _disconnectedCallback = function disconnectedCallback(elm) {
|
|
2589 |
});
|
2590 |
hostRef.$rmListeners$ = undefined;
|
2591 |
}
|
2592 |
-
}
|
2593 |
-
|
2594 |
{
|
2595 |
safeCall(instance, 'disconnectedCallback');
|
2596 |
}
|
2597 |
}
|
2598 |
};
|
2599 |
-
|
2600 |
var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
2601 |
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2602 |
var endBootstrap = createTime();
|
@@ -2611,7 +2054,6 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2611 |
var isBootstrapping = true;
|
2612 |
Object.assign(plt, options);
|
2613 |
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
2614 |
-
|
2615 |
lazyBundles.map(function (lazyBundle) {
|
2616 |
return lazyBundle[1].map(function (compactMeta) {
|
2617 |
var cmpMeta = {
|
@@ -2620,44 +2062,32 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2620 |
$members$: compactMeta[2],
|
2621 |
$listeners$: compactMeta[3]
|
2622 |
};
|
2623 |
-
|
2624 |
{
|
2625 |
cmpMeta.$members$ = compactMeta[2];
|
2626 |
}
|
2627 |
-
|
2628 |
{
|
2629 |
cmpMeta.$listeners$ = compactMeta[3];
|
2630 |
}
|
2631 |
-
|
2632 |
{
|
2633 |
cmpMeta.$attrsToReflect$ = [];
|
2634 |
}
|
2635 |
-
|
2636 |
{
|
2637 |
cmpMeta.$watchers$ = {};
|
2638 |
}
|
2639 |
|
2640 |
var tagName = cmpMeta.$tagName$;
|
2641 |
-
|
2642 |
var HostElement = /*#__PURE__*/function (_HTMLElement) {
|
2643 |
_inherits(HostElement, _HTMLElement);
|
2644 |
-
|
2645 |
var _super2 = _createSuper(HostElement);
|
2646 |
-
|
2647 |
// StencilLazyHost
|
2648 |
function HostElement(self) {
|
2649 |
var _this2;
|
2650 |
-
|
2651 |
_classCallCheck(this, HostElement);
|
2652 |
-
|
2653 |
// @ts-ignore
|
2654 |
_this2 = _super2.call(this, self);
|
2655 |
self = _assertThisInitialized(_this2);
|
2656 |
registerHost(self, cmpMeta);
|
2657 |
-
|
2658 |
-
if (cmpMeta.$flags$ & 1
|
2659 |
-
/* shadowDomEncapsulation */
|
2660 |
-
) {
|
2661 |
// this component is using shadow dom
|
2662 |
// and this browser supports shadow dom
|
2663 |
// add the read-only property "shadowRoot" to the host element
|
@@ -2670,20 +2100,16 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2670 |
}
|
2671 |
}
|
2672 |
}
|
2673 |
-
|
2674 |
return _this2;
|
2675 |
}
|
2676 |
-
|
2677 |
_createClass(HostElement, [{
|
2678 |
key: "connectedCallback",
|
2679 |
value: function connectedCallback() {
|
2680 |
var _this3 = this;
|
2681 |
-
|
2682 |
if (appLoadFallback) {
|
2683 |
clearTimeout(appLoadFallback);
|
2684 |
appLoadFallback = null;
|
2685 |
}
|
2686 |
-
|
2687 |
if (isBootstrapping) {
|
2688 |
// connectedCallback will be processed once all components have been registered
|
2689 |
deferredConnectedCallbacks.push(this);
|
@@ -2697,7 +2123,6 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2697 |
key: "disconnectedCallback",
|
2698 |
value: function disconnectedCallback() {
|
2699 |
var _this4 = this;
|
2700 |
-
|
2701 |
plt.jmp(function () {
|
2702 |
return _disconnectedCallback(_this4);
|
2703 |
});
|
@@ -2708,17 +2133,12 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2708 |
return getHostRef(this).$onReadyPromise$;
|
2709 |
}
|
2710 |
}]);
|
2711 |
-
|
2712 |
return HostElement;
|
2713 |
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
2714 |
-
|
2715 |
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
2716 |
-
|
2717 |
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
2718 |
cmpTags.push(tagName);
|
2719 |
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1
|
2720 |
-
/* isElementConstructor */
|
2721 |
-
));
|
2722 |
}
|
2723 |
});
|
2724 |
});
|
@@ -2727,11 +2147,9 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2727 |
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
2728 |
visibilityStyle.setAttribute('data-styles', '');
|
2729 |
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
2730 |
-
}
|
2731 |
-
|
2732 |
-
|
2733 |
isBootstrapping = false;
|
2734 |
-
|
2735 |
if (deferredConnectedCallbacks.length) {
|
2736 |
deferredConnectedCallbacks.map(function (host) {
|
2737 |
return host.connectedCallback();
|
@@ -2742,22 +2160,17 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2742 |
return appLoadFallback = setTimeout(appDidLoad, 30);
|
2743 |
});
|
2744 |
}
|
2745 |
-
}
|
2746 |
-
|
2747 |
-
|
2748 |
endBootstrap();
|
2749 |
};
|
2750 |
-
|
2751 |
var hostRefs = new WeakMap();
|
2752 |
-
|
2753 |
var getHostRef = function getHostRef(ref) {
|
2754 |
return hostRefs.get(ref);
|
2755 |
};
|
2756 |
-
|
2757 |
var registerInstance = function registerInstance(lazyInstance, hostRef) {
|
2758 |
return hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
2759 |
};
|
2760 |
-
|
2761 |
var registerHost = function registerHost(elm, cmpMeta) {
|
2762 |
var hostRef = {
|
2763 |
$flags$: 0,
|
@@ -2765,13 +2178,11 @@ var registerHost = function registerHost(elm, cmpMeta) {
|
|
2765 |
$cmpMeta$: cmpMeta,
|
2766 |
$instanceValues$: new Map()
|
2767 |
};
|
2768 |
-
|
2769 |
{
|
2770 |
hostRef.$onInstancePromise$ = new Promise(function (r) {
|
2771 |
return hostRef.$onInstanceResolve$ = r;
|
2772 |
});
|
2773 |
}
|
2774 |
-
|
2775 |
{
|
2776 |
hostRef.$onReadyPromise$ = new Promise(function (r) {
|
2777 |
return hostRef.$onReadyResolve$ = r;
|
@@ -2779,61 +2190,44 @@ var registerHost = function registerHost(elm, cmpMeta) {
|
|
2779 |
elm['s-p'] = [];
|
2780 |
elm['s-rc'] = [];
|
2781 |
}
|
2782 |
-
|
2783 |
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
2784 |
return hostRefs.set(elm, hostRef);
|
2785 |
};
|
2786 |
-
|
2787 |
var isMemberInElement = function isMemberInElement(elm, memberName) {
|
2788 |
return memberName in elm;
|
2789 |
};
|
2790 |
-
|
2791 |
var consoleError = function consoleError(e, el) {
|
2792 |
return (0, console.error)(e, el);
|
2793 |
};
|
2794 |
-
|
2795 |
var cmpModules = /*@__PURE__*/new Map();
|
2796 |
-
|
2797 |
var loadModule = function loadModule(cmpMeta, hostRef, hmrVersionId) {
|
2798 |
// loadModuleImport
|
2799 |
var exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
2800 |
var bundleId = cmpMeta.$lazyBundleId$;
|
2801 |
-
|
2802 |
var module = cmpModules.get(bundleId) ;
|
2803 |
-
|
2804 |
if (module) {
|
2805 |
return module[exportName];
|
2806 |
}
|
2807 |
-
|
2808 |
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
2809 |
/* webpackInclude: /\.entry\.js$/ */
|
2810 |
-
|
2811 |
/* webpackExclude: /\.system\.entry\.js$/ */
|
2812 |
-
|
2813 |
/* webpackMode: "lazy" */
|
2814 |
"./".concat(bundleId, ".entry.js").concat(''))); }).then(function (importedModule) {
|
2815 |
{
|
2816 |
cmpModules.set(bundleId, importedModule);
|
2817 |
}
|
2818 |
-
|
2819 |
return importedModule[exportName];
|
2820 |
}, consoleError);
|
2821 |
};
|
2822 |
-
|
2823 |
var styles = new Map();
|
2824 |
var queueDomReads = [];
|
2825 |
var queueDomWrites = [];
|
2826 |
-
|
2827 |
var queueTask = function queueTask(queue, write) {
|
2828 |
return function (cb) {
|
2829 |
queue.push(cb);
|
2830 |
-
|
2831 |
if (!queuePending) {
|
2832 |
queuePending = true;
|
2833 |
-
|
2834 |
-
if (write && plt.$flags$ & 4
|
2835 |
-
/* queueSync */
|
2836 |
-
) {
|
2837 |
nextTick(flush);
|
2838 |
} else {
|
2839 |
plt.raf(flush);
|
@@ -2841,7 +2235,6 @@ var queueTask = function queueTask(queue, write) {
|
|
2841 |
}
|
2842 |
};
|
2843 |
};
|
2844 |
-
|
2845 |
var consume = function consume(queue) {
|
2846 |
for (var _i7 = 0; _i7 < queue.length; _i7++) {
|
2847 |
try {
|
@@ -2850,20 +2243,16 @@ var consume = function consume(queue) {
|
|
2850 |
consoleError(e);
|
2851 |
}
|
2852 |
}
|
2853 |
-
|
2854 |
queue.length = 0;
|
2855 |
};
|
2856 |
-
|
2857 |
var flush = function flush() {
|
|
|
2858 |
// a throttle on how many can run in a certain time
|
2859 |
// DOM READS!!!
|
2860 |
-
|
2861 |
-
|
2862 |
-
consume(queueDomReads); // DOM WRITES!!!
|
2863 |
-
|
2864 |
{
|
2865 |
consume(queueDomWrites);
|
2866 |
-
|
2867 |
if (queuePending = queueDomReads.length > 0) {
|
2868 |
// still more to do yet, but we've run out of time
|
2869 |
// let's let this thing cool off and try again in the next tick
|
@@ -2871,7 +2260,6 @@ var flush = function flush() {
|
|
2871 |
}
|
2872 |
}
|
2873 |
};
|
2874 |
-
|
2875 |
var nextTick = /*@__PURE__*/function nextTick(cb) {
|
2876 |
return promiseResolve().then(cb);
|
2877 |
};
|
@@ -2888,7 +2276,6 @@ exports._objectWithoutProperties = _objectWithoutProperties;
|
|
2888 |
exports._slicedToArray = _slicedToArray;
|
2889 |
exports._toConsumableArray = _toConsumableArray;
|
2890 |
exports._typeof = _typeof;
|
2891 |
-
exports._wrapRegExp = _wrapRegExp;
|
2892 |
exports.bootstrapLazy = bootstrapLazy;
|
2893 |
exports.createEvent = createEvent;
|
2894 |
exports.getElement = getElement;
|
22 |
|
23 |
function ownKeys(object, enumerableOnly) {
|
24 |
var keys = Object.keys(object);
|
|
|
25 |
if (Object.getOwnPropertySymbols) {
|
26 |
var symbols = Object.getOwnPropertySymbols(object);
|
27 |
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
28 |
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
29 |
})), keys.push.apply(keys, symbols);
|
30 |
}
|
|
|
31 |
return keys;
|
32 |
}
|
|
|
33 |
function _objectSpread2(target) {
|
34 |
for (var i = 1; i < arguments.length; i++) {
|
35 |
var source = null != arguments[i] ? arguments[i] : {};
|
39 |
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
40 |
});
|
41 |
}
|
|
|
42 |
return target;
|
43 |
}
|
|
|
44 |
function _typeof(obj) {
|
45 |
"@babel/helpers - typeof";
|
46 |
|
50 |
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
51 |
}, _typeof(obj);
|
52 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
54 |
try {
|
55 |
var info = gen[key](arg);
|
58 |
reject(error);
|
59 |
return;
|
60 |
}
|
|
|
61 |
if (info.done) {
|
62 |
resolve(value);
|
63 |
} else {
|
64 |
Promise.resolve(value).then(_next, _throw);
|
65 |
}
|
66 |
}
|
|
|
67 |
function _asyncToGenerator(fn) {
|
68 |
return function () {
|
69 |
var self = this,
|
70 |
+
args = arguments;
|
71 |
return new Promise(function (resolve, reject) {
|
72 |
var gen = fn.apply(self, args);
|
|
|
73 |
function _next(value) {
|
74 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
75 |
}
|
|
|
76 |
function _throw(err) {
|
77 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
78 |
}
|
|
|
79 |
_next(undefined);
|
80 |
});
|
81 |
};
|
82 |
}
|
|
|
83 |
function _classCallCheck(instance, Constructor) {
|
84 |
if (!(instance instanceof Constructor)) {
|
85 |
throw new TypeError("Cannot call a class as a function");
|
86 |
}
|
87 |
}
|
|
|
88 |
function _defineProperties(target, props) {
|
89 |
for (var i = 0; i < props.length; i++) {
|
90 |
var descriptor = props[i];
|
94 |
Object.defineProperty(target, descriptor.key, descriptor);
|
95 |
}
|
96 |
}
|
|
|
97 |
function _createClass(Constructor, protoProps, staticProps) {
|
98 |
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
99 |
if (staticProps) _defineProperties(Constructor, staticProps);
|
102 |
});
|
103 |
return Constructor;
|
104 |
}
|
|
|
105 |
function _defineProperty(obj, key, value) {
|
106 |
if (key in obj) {
|
107 |
Object.defineProperty(obj, key, {
|
113 |
} else {
|
114 |
obj[key] = value;
|
115 |
}
|
|
|
116 |
return obj;
|
117 |
}
|
|
|
118 |
function _inherits(subClass, superClass) {
|
119 |
if (typeof superClass !== "function" && superClass !== null) {
|
120 |
throw new TypeError("Super expression must either be null or a function");
|
121 |
}
|
122 |
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
123 |
+
constructor: {
|
124 |
+
value: subClass,
|
125 |
+
writable: true,
|
126 |
+
configurable: true
|
127 |
+
}
|
128 |
+
});
|
129 |
Object.defineProperty(subClass, "prototype", {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
writable: false
|
131 |
});
|
132 |
if (superClass) _setPrototypeOf(subClass, superClass);
|
133 |
}
|
|
|
134 |
function _getPrototypeOf(o) {
|
135 |
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
136 |
return o.__proto__ || Object.getPrototypeOf(o);
|
137 |
};
|
138 |
return _getPrototypeOf(o);
|
139 |
}
|
|
|
140 |
function _setPrototypeOf(o, p) {
|
141 |
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
142 |
o.__proto__ = p;
|
143 |
return o;
|
144 |
};
|
|
|
145 |
return _setPrototypeOf(o, p);
|
146 |
}
|
|
|
147 |
function _isNativeReflectConstruct() {
|
148 |
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
149 |
if (Reflect.construct.sham) return false;
|
150 |
if (typeof Proxy === "function") return true;
|
|
|
151 |
try {
|
152 |
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
153 |
return true;
|
155 |
return false;
|
156 |
}
|
157 |
}
|
|
|
158 |
function _construct(Parent, args, Class) {
|
159 |
if (_isNativeReflectConstruct()) {
|
160 |
+
_construct = Reflect.construct.bind();
|
161 |
} else {
|
162 |
_construct = function _construct(Parent, args, Class) {
|
163 |
var a = [null];
|
168 |
return instance;
|
169 |
};
|
170 |
}
|
|
|
171 |
return _construct.apply(null, arguments);
|
172 |
}
|
|
|
173 |
function _isNativeFunction(fn) {
|
174 |
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
175 |
}
|
|
|
176 |
function _wrapNativeSuper(Class) {
|
177 |
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
|
178 |
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
179 |
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
|
180 |
if (typeof Class !== "function") {
|
181 |
throw new TypeError("Super expression must either be null or a function");
|
182 |
}
|
|
|
183 |
if (typeof _cache !== "undefined") {
|
184 |
if (_cache.has(Class)) return _cache.get(Class);
|
|
|
185 |
_cache.set(Class, Wrapper);
|
186 |
}
|
|
|
187 |
function Wrapper() {
|
188 |
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
189 |
}
|
|
|
190 |
Wrapper.prototype = Object.create(Class.prototype, {
|
191 |
constructor: {
|
192 |
value: Wrapper,
|
197 |
});
|
198 |
return _setPrototypeOf(Wrapper, Class);
|
199 |
};
|
|
|
200 |
return _wrapNativeSuper(Class);
|
201 |
}
|
|
|
202 |
function _objectWithoutPropertiesLoose(source, excluded) {
|
203 |
if (source == null) return {};
|
204 |
var target = {};
|
205 |
var sourceKeys = Object.keys(source);
|
206 |
var key, i;
|
|
|
207 |
for (i = 0; i < sourceKeys.length; i++) {
|
208 |
key = sourceKeys[i];
|
209 |
if (excluded.indexOf(key) >= 0) continue;
|
210 |
target[key] = source[key];
|
211 |
}
|
|
|
212 |
return target;
|
213 |
}
|
|
|
214 |
function _objectWithoutProperties(source, excluded) {
|
215 |
if (source == null) return {};
|
|
|
216 |
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
|
217 |
var key, i;
|
|
|
218 |
if (Object.getOwnPropertySymbols) {
|
219 |
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
|
220 |
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
221 |
key = sourceSymbolKeys[i];
|
222 |
if (excluded.indexOf(key) >= 0) continue;
|
224 |
target[key] = source[key];
|
225 |
}
|
226 |
}
|
|
|
227 |
return target;
|
228 |
}
|
|
|
229 |
function _assertThisInitialized(self) {
|
230 |
if (self === void 0) {
|
231 |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
232 |
}
|
|
|
233 |
return self;
|
234 |
}
|
|
|
235 |
function _possibleConstructorReturn(self, call) {
|
236 |
if (call && (typeof call === "object" || typeof call === "function")) {
|
237 |
return call;
|
238 |
} else if (call !== void 0) {
|
239 |
throw new TypeError("Derived constructors may only return object or undefined");
|
240 |
}
|
|
|
241 |
return _assertThisInitialized(self);
|
242 |
}
|
|
|
243 |
function _createSuper(Derived) {
|
244 |
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
|
245 |
return function _createSuperInternal() {
|
246 |
var Super = _getPrototypeOf(Derived),
|
247 |
+
result;
|
|
|
248 |
if (hasNativeReflectConstruct) {
|
249 |
var NewTarget = _getPrototypeOf(this).constructor;
|
|
|
250 |
result = Reflect.construct(Super, arguments, NewTarget);
|
251 |
} else {
|
252 |
result = Super.apply(this, arguments);
|
253 |
}
|
|
|
254 |
return _possibleConstructorReturn(this, result);
|
255 |
};
|
256 |
}
|
|
|
257 |
function _slicedToArray(arr, i) {
|
258 |
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
259 |
}
|
|
|
260 |
function _toConsumableArray(arr) {
|
261 |
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
262 |
}
|
|
|
263 |
function _arrayWithoutHoles(arr) {
|
264 |
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
265 |
}
|
|
|
266 |
function _arrayWithHoles(arr) {
|
267 |
if (Array.isArray(arr)) return arr;
|
268 |
}
|
|
|
269 |
function _iterableToArray(iter) {
|
270 |
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
271 |
}
|
|
|
272 |
function _iterableToArrayLimit(arr, i) {
|
273 |
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
|
274 |
if (_i == null) return;
|
275 |
var _arr = [];
|
276 |
var _n = true;
|
277 |
var _d = false;
|
|
|
278 |
var _s, _e;
|
|
|
279 |
try {
|
280 |
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
281 |
_arr.push(_s.value);
|
|
|
282 |
if (i && _arr.length === i) break;
|
283 |
}
|
284 |
} catch (err) {
|
291 |
if (_d) throw _e;
|
292 |
}
|
293 |
}
|
|
|
294 |
return _arr;
|
295 |
}
|
|
|
296 |
function _unsupportedIterableToArray(o, minLen) {
|
297 |
if (!o) return;
|
298 |
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
301 |
if (n === "Map" || n === "Set") return Array.from(o);
|
302 |
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
303 |
}
|
|
|
304 |
function _arrayLikeToArray(arr, len) {
|
305 |
if (len == null || len > arr.length) len = arr.length;
|
|
|
306 |
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
|
307 |
return arr2;
|
308 |
}
|
|
|
309 |
function _nonIterableSpread() {
|
310 |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
311 |
}
|
|
|
312 |
function _nonIterableRest() {
|
313 |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
314 |
}
|
|
|
315 |
function _createForOfIteratorHelper(o, allowArrayLike) {
|
316 |
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
|
317 |
if (!it) {
|
318 |
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
319 |
if (it) o = it;
|
320 |
var i = 0;
|
|
|
321 |
var F = function () {};
|
|
|
322 |
return {
|
323 |
s: F,
|
324 |
n: function () {
|
336 |
f: F
|
337 |
};
|
338 |
}
|
|
|
339 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
340 |
}
|
|
|
341 |
var normalCompletion = true,
|
342 |
+
didErr = false,
|
343 |
+
err;
|
344 |
return {
|
345 |
s: function () {
|
346 |
it = it.call(o);
|
378 |
var doc = win.document || {
|
379 |
head: {}
|
380 |
};
|
|
|
381 |
var plt = {
|
382 |
$flags$: 0,
|
383 |
$resourcesUrl$: '',
|
397 |
return new CustomEvent(eventName, opts);
|
398 |
}
|
399 |
};
|
|
|
400 |
var promiseResolve = function promiseResolve(v) {
|
401 |
return Promise.resolve(v);
|
402 |
};
|
|
|
403 |
var supportsConstructibleStylesheets = /*@__PURE__*/function () {
|
404 |
try {
|
405 |
new CSSStyleSheet();
|
406 |
return typeof new CSSStyleSheet().replace === 'function';
|
407 |
} catch (e) {}
|
|
|
408 |
return false;
|
409 |
}() ;
|
|
|
410 |
var addHostEventListeners = function addHostEventListeners(elm, hostRef, listeners, attachParentListeners) {
|
411 |
if (listeners) {
|
412 |
|
413 |
listeners.map(function (_ref6) {
|
414 |
var _ref7 = _slicedToArray(_ref6, 3),
|
415 |
+
flags = _ref7[0],
|
416 |
+
name = _ref7[1],
|
417 |
+
method = _ref7[2];
|
|
|
418 |
var target = getHostListenerTarget(elm, flags) ;
|
419 |
var handler = hostListenerProxy(hostRef, method);
|
420 |
var opts = hostListenerOpts(flags);
|
425 |
});
|
426 |
}
|
427 |
};
|
|
|
428 |
var hostListenerProxy = function hostListenerProxy(hostRef, methodName) {
|
429 |
return function (ev) {
|
430 |
try {
|
431 |
{
|
432 |
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
|
|
|
433 |
// instance is ready, let's call it's member method for this event
|
434 |
hostRef.$lazyInstance$[methodName](ev);
|
435 |
} else {
|
441 |
}
|
442 |
};
|
443 |
};
|
|
|
444 |
var getHostListenerTarget = function getHostListenerTarget(elm, flags) {
|
445 |
+
if (flags & 8 /* TargetWindow */) return win;
|
|
|
|
|
446 |
return elm;
|
447 |
+
};
|
448 |
+
// prettier-ignore
|
|
|
449 |
var hostListenerOpts = function hostListenerOpts(flags) {
|
450 |
+
return (flags & 2 /* Capture */) !== 0;
|
|
|
|
|
451 |
};
|
452 |
var HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
453 |
var XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
|
454 |
var createTime = function createTime(fnName) {
|
|
|
455 |
{
|
456 |
return function () {
|
457 |
return;
|
458 |
};
|
459 |
}
|
460 |
};
|
|
|
461 |
var uniqueTime = function uniqueTime(key, measureText) {
|
462 |
{
|
463 |
return function () {
|
465 |
};
|
466 |
}
|
467 |
};
|
|
|
468 |
var rootAppliedStyles = new WeakMap();
|
|
|
469 |
var registerStyle = function registerStyle(scopeId, cssText, allowCS) {
|
470 |
var style = styles.get(scopeId);
|
|
|
471 |
if (supportsConstructibleStylesheets && allowCS) {
|
472 |
style = style || new CSSStyleSheet();
|
473 |
style.replace(cssText);
|
474 |
} else {
|
475 |
style = cssText;
|
476 |
}
|
|
|
477 |
styles.set(scopeId, style);
|
478 |
};
|
|
|
479 |
var addStyle = function addStyle(styleContainerNode, cmpMeta, mode, hostElm) {
|
480 |
var scopeId = getScopeId(cmpMeta);
|
481 |
var style = styles.get(scopeId);
|
482 |
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
483 |
// so the fallback is to always use the document for the root node in those cases
|
484 |
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
|
|
|
|
|
|
|
|
|
485 |
if (style) {
|
486 |
if (typeof style === 'string') {
|
487 |
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
488 |
var appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
489 |
var styleElm;
|
|
|
490 |
if (!appliedStyles) {
|
491 |
rootAppliedStyles.set(styleContainerNode, appliedStyles = new Set());
|
492 |
}
|
|
|
493 |
if (!appliedStyles.has(scopeId)) {
|
494 |
{
|
495 |
{
|
496 |
styleElm = doc.createElement('style');
|
497 |
styleElm.innerHTML = style;
|
498 |
}
|
|
|
499 |
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
500 |
}
|
|
|
501 |
if (appliedStyles) {
|
502 |
appliedStyles.add(scopeId);
|
503 |
}
|
506 |
styleContainerNode.adoptedStyleSheets = [].concat(_toConsumableArray(styleContainerNode.adoptedStyleSheets), [style]);
|
507 |
}
|
508 |
}
|
|
|
509 |
return scopeId;
|
510 |
};
|
|
|
511 |
var attachStyles = function attachStyles(hostRef) {
|
512 |
var cmpMeta = hostRef.$cmpMeta$;
|
513 |
var elm = hostRef.$hostElement$;
|
514 |
var flags = cmpMeta.$flags$;
|
515 |
var endAttachStyles = createTime();
|
516 |
var scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
517 |
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
|
|
|
|
|
518 |
// only required when we're NOT using native shadow dom (slot)
|
519 |
// or this browser doesn't support native shadow dom
|
520 |
// and this host element was NOT created with SSR
|
525 |
elm['s-sc'] = scopeId;
|
526 |
elm.classList.add(scopeId + '-h');
|
527 |
}
|
|
|
528 |
endAttachStyles();
|
529 |
};
|
|
|
530 |
var getScopeId = function getScopeId(cmp, mode) {
|
531 |
return 'sc-' + (cmp.$tagName$);
|
532 |
};
|
533 |
/**
|
534 |
* Default style mode id
|
535 |
*/
|
|
|
536 |
/**
|
537 |
* Reusable empty obj/array
|
538 |
* Don't add values to these!!
|
539 |
*/
|
|
|
|
|
540 |
var EMPTY_OBJ = {};
|
541 |
/**
|
542 |
* Namespaces
|
543 |
*/
|
|
|
544 |
var SVG_NS = 'http://www.w3.org/2000/svg';
|
545 |
var HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
|
546 |
var isDef = function isDef(v) {
|
547 |
return v != null;
|
548 |
};
|
|
|
549 |
var isComplexType = function isComplexType(o) {
|
550 |
// https://jsperf.com/typeof-fn-object/5
|
551 |
o = _typeof(o);
|
562 |
// const stack: any[] = [];
|
563 |
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
564 |
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
|
|
|
565 |
var h = function h(nodeName, vnodeData) {
|
566 |
var child = null;
|
567 |
var key = null;
|
569 |
var simple = false;
|
570 |
var lastSimple = false;
|
571 |
var vNodeChildren = [];
|
|
|
572 |
var walk = function walk(c) {
|
573 |
for (var _i = 0; _i < c.length; _i++) {
|
574 |
child = c[_i];
|
|
|
575 |
if (Array.isArray(child)) {
|
576 |
walk(child);
|
577 |
} else if (child != null && typeof child !== 'boolean') {
|
578 |
if (simple = typeof nodeName !== 'function' && !isComplexType(child)) {
|
579 |
child = String(child);
|
580 |
}
|
|
|
581 |
if (simple && lastSimple) {
|
582 |
// If the previous child was simple (string), we merge both
|
583 |
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
585 |
// Append a new vNode, if it's text, we create a text vNode
|
586 |
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
587 |
}
|
|
|
588 |
lastSimple = simple;
|
589 |
}
|
590 |
}
|
591 |
};
|
|
|
592 |
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
593 |
children[_key - 2] = arguments[_key];
|
594 |
}
|
|
|
595 |
walk(children);
|
|
|
596 |
if (vnodeData) {
|
597 |
+
// normalize class / classname attributes
|
|
|
598 |
if (vnodeData.key) {
|
599 |
key = vnodeData.key;
|
600 |
}
|
|
|
601 |
if (vnodeData.name) {
|
602 |
slotName = vnodeData.name;
|
603 |
}
|
|
|
604 |
{
|
605 |
var classData = vnodeData.className || vnodeData.class;
|
|
|
606 |
if (classData) {
|
607 |
vnodeData.class = _typeof(classData) !== 'object' ? classData : Object.keys(classData).filter(function (k) {
|
608 |
return classData[k];
|
610 |
}
|
611 |
}
|
612 |
}
|
|
|
613 |
if (typeof nodeName === 'function') {
|
614 |
// nodeName is a functional component
|
615 |
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
616 |
}
|
|
|
617 |
var vnode = newVNode(nodeName, null);
|
618 |
vnode.$attrs$ = vnodeData;
|
|
|
619 |
if (vNodeChildren.length > 0) {
|
620 |
vnode.$children$ = vNodeChildren;
|
621 |
}
|
|
|
622 |
{
|
623 |
vnode.$key$ = key;
|
624 |
}
|
|
|
625 |
{
|
626 |
vnode.$name$ = slotName;
|
627 |
}
|
|
|
628 |
return vnode;
|
629 |
};
|
|
|
630 |
var newVNode = function newVNode(tag, text) {
|
631 |
var vnode = {
|
632 |
$flags$: 0,
|
635 |
$elm$: null,
|
636 |
$children$: null
|
637 |
};
|
|
|
638 |
{
|
639 |
vnode.$attrs$ = null;
|
640 |
}
|
|
|
641 |
{
|
642 |
vnode.$key$ = null;
|
643 |
}
|
|
|
644 |
{
|
645 |
vnode.$name$ = null;
|
646 |
}
|
|
|
647 |
return vnode;
|
648 |
};
|
|
|
649 |
var Host = {};
|
|
|
650 |
var isHost = function isHost(node) {
|
651 |
return node && node.$tag$ === Host;
|
652 |
};
|
|
|
653 |
var vdomFnUtils = {
|
654 |
forEach: function forEach(children, cb) {
|
655 |
return children.map(convertToPublic).forEach(cb);
|
658 |
return children.map(convertToPublic).map(cb).map(convertToPrivate);
|
659 |
}
|
660 |
};
|
|
|
661 |
var convertToPublic = function convertToPublic(node) {
|
662 |
return {
|
663 |
vattrs: node.$attrs$,
|
668 |
vtext: node.$text$
|
669 |
};
|
670 |
};
|
|
|
671 |
var convertToPrivate = function convertToPrivate(node) {
|
672 |
if (typeof node.vtag === 'function') {
|
673 |
var vnodeData = Object.assign({}, node.vattrs);
|
|
|
674 |
if (node.vkey) {
|
675 |
vnodeData.key = node.vkey;
|
676 |
}
|
|
|
677 |
if (node.vname) {
|
678 |
vnodeData.name = node.vname;
|
679 |
}
|
|
|
680 |
return h.apply(void 0, [node.vtag, vnodeData].concat(_toConsumableArray(node.vchildren || [])));
|
681 |
}
|
|
|
682 |
var vnode = newVNode(node.vtag, node.vtext);
|
683 |
vnode.$attrs$ = node.vattrs;
|
684 |
vnode.$children$ = node.vchildren;
|
694 |
*
|
695 |
* Modified for Stencil's compiler and vdom
|
696 |
*/
|
|
|
|
|
697 |
var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSvg, flags) {
|
698 |
if (oldValue !== newValue) {
|
699 |
var isProp = isMemberInElement(elm, memberName);
|
700 |
var ln = memberName.toLowerCase();
|
|
|
701 |
if (memberName === 'class') {
|
702 |
var classList = elm.classList;
|
703 |
var oldClasses = parseClassList(oldValue);
|
721 |
}
|
722 |
}
|
723 |
}
|
|
|
724 |
for (var _prop in newValue) {
|
725 |
if (!oldValue || newValue[_prop] !== oldValue[_prop]) {
|
726 |
if (_prop.includes('-')) {
|
763 |
// except for the first character, we keep the event name case
|
764 |
memberName = ln[2] + memberName.slice(3);
|
765 |
}
|
|
|
766 |
if (oldValue) {
|
767 |
plt.rel(elm, memberName, oldValue, false);
|
768 |
}
|
|
|
769 |
if (newValue) {
|
770 |
plt.ael(elm, memberName, newValue, false);
|
771 |
}
|
772 |
} else {
|
773 |
// Set property if it exists and it's not a SVG
|
774 |
var isComplex = isComplexType(newValue);
|
|
|
775 |
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
776 |
try {
|
777 |
if (!elm.tagName.includes('-')) {
|
778 |
+
var n = newValue == null ? '' : newValue;
|
779 |
+
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
780 |
if (memberName === 'list') {
|
781 |
+
isProp = false;
|
782 |
+
// tslint:disable-next-line: triple-equals
|
783 |
} else if (oldValue == null || elm[memberName] != n) {
|
784 |
elm[memberName] = n;
|
785 |
}
|
795 |
* - if it's a SVG, since properties might not work in <svg>
|
796 |
* - if the newValue is null/undefined or 'false'.
|
797 |
*/
|
|
|
|
|
798 |
var xlink = false;
|
|
|
799 |
{
|
800 |
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
801 |
memberName = ln;
|
802 |
xlink = true;
|
803 |
}
|
804 |
}
|
|
|
805 |
if (newValue == null || newValue === false) {
|
806 |
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
807 |
if (xlink) {
|
810 |
elm.removeAttribute(memberName);
|
811 |
}
|
812 |
}
|
813 |
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
|
|
|
814 |
newValue = newValue === true ? '' : newValue;
|
|
|
815 |
if (xlink) {
|
816 |
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
817 |
} else {
|
821 |
}
|
822 |
}
|
823 |
};
|
|
|
824 |
var parseClassListRegex = /\s/;
|
|
|
825 |
var parseClassList = function parseClassList(value) {
|
826 |
return !value ? [] : value.split(parseClassListRegex);
|
827 |
};
|
|
|
828 |
var updateElement = function updateElement(oldVnode, newVnode, isSvgMode, memberName) {
|
829 |
// if the element passed in is a shadow root, which is a document fragment
|
830 |
// then we want to be adding attrs/props to the shadow root's "host" element
|
831 |
// if it's not a shadow root, then we add attrs/props to the same element
|
832 |
+
var elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
|
|
|
833 |
var oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
834 |
var newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
|
835 |
{
|
836 |
// remove attributes no longer present on the vnode by setting them to undefined
|
837 |
for (memberName in oldVnodeAttrs) {
|
839 |
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
840 |
}
|
841 |
}
|
842 |
+
}
|
843 |
+
// add new & update changed attributes
|
|
|
844 |
for (memberName in newVnodeAttrs) {
|
845 |
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
846 |
}
|
847 |
};
|
|
|
848 |
var createElm = function createElm(oldParentVNode, newParentVNode, childIndex, parentElm) {
|
849 |
// tslint:disable-next-line: prefer-const
|
850 |
var newVNode = newParentVNode.$children$[childIndex];
|
852 |
var elm;
|
853 |
var childNode;
|
854 |
var oldVNode;
|
|
|
855 |
if (!useNativeShadowDom) {
|
856 |
// remember for later we need to check to relocate nodes
|
857 |
checkSlotRelocate = true;
|
|
|
858 |
if (newVNode.$tag$ === 'slot') {
|
859 |
if (scopeId) {
|
860 |
// scoped css needs to add its scoped id to the parent element
|
861 |
parentElm.classList.add(scopeId + '-s');
|
862 |
}
|
863 |
+
newVNode.$flags$ |= newVNode.$children$ ?
|
864 |
+
// slot element has fallback content
|
865 |
+
2 /* isSlotFallback */ :
|
866 |
+
// slot element does not have fallback content
|
867 |
+
1 /* isSlotReference */;
|
|
|
|
|
|
|
868 |
}
|
869 |
}
|
|
|
870 |
if (newVNode.$text$ !== null) {
|
871 |
// create text node
|
872 |
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
873 |
+
} else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
|
|
|
874 |
// create a slot reference node
|
875 |
elm = newVNode.$elm$ = doc.createTextNode('');
|
876 |
} else {
|
877 |
if (!isSvgMode) {
|
878 |
isSvgMode = newVNode.$tag$ === 'svg';
|
879 |
+
}
|
880 |
+
// create element
|
881 |
+
elm = newVNode.$elm$ = doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */ ? 'slot-fb' : newVNode.$tag$) ;
|
|
|
|
|
|
|
|
|
882 |
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
883 |
isSvgMode = false;
|
884 |
+
}
|
885 |
+
// add css classes, attrs, props, listeners, etc.
|
|
|
886 |
{
|
887 |
updateElement(null, newVNode, isSvgMode);
|
888 |
}
|
|
|
889 |
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
890 |
// if there is a scopeId and this is the initial render
|
891 |
// then let's add the scopeId as a css class
|
892 |
elm.classList.add(elm['s-si'] = scopeId);
|
893 |
}
|
|
|
894 |
if (newVNode.$children$) {
|
895 |
for (i = 0; i < newVNode.$children$.length; ++i) {
|
896 |
// create the node
|
897 |
+
childNode = createElm(oldParentVNode, newVNode, i, elm);
|
898 |
+
// return node could have been null
|
899 |
if (childNode) {
|
900 |
// append our new node
|
901 |
elm.appendChild(childNode);
|
902 |
}
|
903 |
}
|
904 |
}
|
|
|
905 |
{
|
906 |
if (newVNode.$tag$ === 'svg') {
|
907 |
// Only reset the SVG context when we're exiting <svg> element
|
912 |
}
|
913 |
}
|
914 |
}
|
|
|
915 |
{
|
916 |
elm['s-hn'] = hostTagName;
|
917 |
+
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
|
|
|
|
|
|
|
|
|
918 |
// remember the content reference comment
|
919 |
+
elm['s-sr'] = true;
|
920 |
+
// remember the content reference comment
|
921 |
+
elm['s-cr'] = contentRef;
|
922 |
+
// remember the slot name, or empty string for default slot
|
923 |
+
elm['s-sn'] = newVNode.$name$ || '';
|
924 |
+
// check if we've got an old vnode for this slot
|
925 |
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
|
926 |
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
927 |
// we've got an old slot vnode and the wrapper is being replaced
|
928 |
// so let's move the old slot content back to it's original location
|
930 |
}
|
931 |
}
|
932 |
}
|
|
|
933 |
return elm;
|
934 |
};
|
|
|
935 |
var putBackInOriginalLocation = function putBackInOriginalLocation(parentElm, recursive) {
|
936 |
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
|
|
|
937 |
var oldSlotChildNodes = parentElm.childNodes;
|
|
|
938 |
for (var _i2 = oldSlotChildNodes.length - 1; _i2 >= 0; _i2--) {
|
939 |
var childNode = oldSlotChildNodes[_i2];
|
|
|
940 |
if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
941 |
// // this child node in the old element is from another component
|
942 |
// // remove this node from the old slot's parent
|
943 |
// childNode.remove();
|
944 |
// and relocate it back to it's original location
|
945 |
+
parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
946 |
+
// remove the old original location comment entirely
|
947 |
// later on the patch function will know what to do
|
948 |
// and move this to the correct spot in need be
|
|
|
949 |
childNode['s-ol'].remove();
|
950 |
childNode['s-ol'] = undefined;
|
951 |
checkSlotRelocate = true;
|
952 |
}
|
|
|
953 |
if (recursive) {
|
954 |
putBackInOriginalLocation(childNode, recursive);
|
955 |
}
|
956 |
}
|
957 |
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
|
|
|
|
|
958 |
};
|
959 |
|
960 |
var addVnodes = function addVnodes(parentElm, before, parentVNode, vnodes, startIdx, endIdx) {
|
961 |
var containerElm = parentElm['s-cr'] && parentElm['s-cr'].parentNode || parentElm;
|
962 |
var childNode;
|
|
|
963 |
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
964 |
containerElm = containerElm.shadowRoot;
|
965 |
}
|
|
|
966 |
for (; startIdx <= endIdx; ++startIdx) {
|
967 |
if (vnodes[startIdx]) {
|
968 |
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
|
969 |
if (childNode) {
|
970 |
vnodes[startIdx].$elm$ = childNode;
|
971 |
containerElm.insertBefore(childNode, referenceNode(before) );
|
973 |
}
|
974 |
}
|
975 |
};
|
|
|
976 |
var removeVnodes = function removeVnodes(vnodes, startIdx, endIdx, vnode, elm) {
|
977 |
for (; startIdx <= endIdx; ++startIdx) {
|
978 |
if (vnode = vnodes[startIdx]) {
|
979 |
elm = vnode.$elm$;
|
980 |
callNodeRefs(vnode);
|
|
|
981 |
{
|
982 |
// we're removing this element
|
983 |
// so it's possible we need to show slot fallback content now
|
984 |
checkSlotFallbackVisibility = true;
|
|
|
985 |
if (elm['s-ol']) {
|
986 |
// remove the original location comment
|
987 |
elm['s-ol'].remove();
|
990 |
// that's being removed are slot nodes
|
991 |
putBackInOriginalLocation(elm, true);
|
992 |
}
|
993 |
+
}
|
994 |
+
// remove the vnode's element from the dom
|
|
|
995 |
elm.remove();
|
996 |
}
|
997 |
}
|
998 |
};
|
|
|
999 |
var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh) {
|
1000 |
var oldStartIdx = 0;
|
1001 |
var newStartIdx = 0;
|
1009 |
var newEndVnode = newCh[newEndIdx];
|
1010 |
var node;
|
1011 |
var elmToMove;
|
|
|
1012 |
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
1013 |
if (oldStartVnode == null) {
|
1014 |
// Vnode might have been moved left
|
1032 |
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
1033 |
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
1034 |
}
|
|
|
1035 |
patch(oldStartVnode, newEndVnode);
|
1036 |
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
1037 |
oldStartVnode = oldCh[++oldStartIdx];
|
1041 |
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
1042 |
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
1043 |
}
|
|
|
1044 |
patch(oldEndVnode, newStartVnode);
|
1045 |
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
1046 |
oldEndVnode = oldCh[--oldEndIdx];
|
1048 |
} else {
|
1049 |
// createKeyToOldIdx
|
1050 |
idxInOld = -1;
|
|
|
1051 |
{
|
1052 |
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
1053 |
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
1056 |
}
|
1057 |
}
|
1058 |
}
|
|
|
1059 |
if (idxInOld >= 0) {
|
1060 |
elmToMove = oldCh[idxInOld];
|
|
|
1061 |
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
1062 |
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
1063 |
} else {
|
1065 |
oldCh[idxInOld] = undefined;
|
1066 |
node = elmToMove.$elm$;
|
1067 |
}
|
|
|
1068 |
newStartVnode = newCh[++newStartIdx];
|
1069 |
} else {
|
1070 |
// new element
|
1071 |
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
1072 |
newStartVnode = newCh[++newStartIdx];
|
1073 |
}
|
|
|
1074 |
if (node) {
|
1075 |
{
|
1076 |
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
1078 |
}
|
1079 |
}
|
1080 |
}
|
|
|
1081 |
if (oldStartIdx > oldEndIdx) {
|
1082 |
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
1083 |
} else if (newStartIdx > newEndIdx) {
|
1084 |
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
1085 |
}
|
1086 |
};
|
|
|
1087 |
var isSameVnode = function isSameVnode(vnode1, vnode2) {
|
1088 |
// compare if two vnode to see if they're "technically" the same
|
1089 |
// need to have the same element tag, and same key to be the same
|
1091 |
if (vnode1.$tag$ === 'slot') {
|
1092 |
return vnode1.$name$ === vnode2.$name$;
|
1093 |
}
|
|
|
1094 |
{
|
1095 |
return vnode1.$key$ === vnode2.$key$;
|
1096 |
}
|
1097 |
}
|
|
|
1098 |
return false;
|
1099 |
};
|
|
|
1100 |
var referenceNode = function referenceNode(node) {
|
1101 |
// this node was relocated to a new location in the dom
|
1102 |
// because of some other component's slot
|
1104 |
// it's original location was according to it's original vdom
|
1105 |
return node && node['s-ol'] || node;
|
1106 |
};
|
|
|
1107 |
var parentReferenceNode = function parentReferenceNode(node) {
|
1108 |
return (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
1109 |
};
|
|
|
1110 |
var patch = function patch(oldVNode, newVNode) {
|
1111 |
var elm = newVNode.$elm$ = oldVNode.$elm$;
|
1112 |
var oldChildren = oldVNode.$children$;
|
1114 |
var tag = newVNode.$tag$;
|
1115 |
var text = newVNode.$text$;
|
1116 |
var defaultHolder;
|
|
|
1117 |
if (text === null) {
|
1118 |
{
|
1119 |
// test if we're rendering an svg element, or still rendering nodes inside of one
|
1120 |
// only add this to the when the compiler sees we're using an svg somewhere
|
1121 |
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
1122 |
+
}
|
1123 |
+
// element node
|
|
|
1124 |
{
|
1125 |
if (tag === 'slot') ;else {
|
1126 |
// either this is the first render of an element OR it's an update
|
1129 |
updateElement(oldVNode, newVNode, isSvgMode);
|
1130 |
}
|
1131 |
}
|
|
|
1132 |
if (oldChildren !== null && newChildren !== null) {
|
1133 |
// looks like there's child vnodes for both the old and new vnodes
|
1134 |
updateChildren(elm, oldChildren, newVNode, newChildren);
|
1137 |
if (oldVNode.$text$ !== null) {
|
1138 |
// the old vnode was text, so be sure to clear it out
|
1139 |
elm.textContent = '';
|
1140 |
+
}
|
1141 |
+
// add the new vnode children
|
|
|
1142 |
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
1143 |
} else if (oldChildren !== null) {
|
1144 |
// no new child vnodes, but there are old child vnodes to remove
|
1145 |
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
1146 |
}
|
|
|
1147 |
if (isSvgMode && tag === 'svg') {
|
1148 |
isSvgMode = false;
|
1149 |
}
|
1156 |
elm.data = text;
|
1157 |
}
|
1158 |
};
|
|
|
1159 |
var updateFallbackSlotVisibility = function updateFallbackSlotVisibility(elm) {
|
1160 |
// tslint:disable-next-line: prefer-const
|
1161 |
var childNodes = elm.childNodes;
|
1165 |
var j;
|
1166 |
var slotNameAttr;
|
1167 |
var nodeType;
|
|
|
1168 |
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
1169 |
childNode = childNodes[i];
|
1170 |
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
|
|
|
|
|
1171 |
if (childNode['s-sr']) {
|
1172 |
// this is a slot fallback node
|
1173 |
// get the slot name for this slot reference node
|
1174 |
+
slotNameAttr = childNode['s-sn'];
|
1175 |
+
// by default always show a fallback slot node
|
1176 |
// then hide it if there are other slots in the light dom
|
|
|
1177 |
childNode.hidden = false;
|
|
|
1178 |
for (j = 0; j < ilen; j++) {
|
1179 |
nodeType = childNodes[j].nodeType;
|
|
|
1180 |
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
1181 |
// this sibling node is from a different component OR is a named fallback slot node
|
1182 |
+
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
|
|
|
1183 |
childNode.hidden = true;
|
1184 |
break;
|
1185 |
}
|
1187 |
// this is a default fallback slot node
|
1188 |
// any element or text node (with content)
|
1189 |
// should hide the default fallback slot node
|
1190 |
+
if (nodeType === 1 /* ElementNode */ || nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '') {
|
|
|
|
|
|
|
|
|
1191 |
childNode.hidden = true;
|
1192 |
break;
|
1193 |
}
|
1194 |
}
|
1195 |
}
|
1196 |
+
}
|
1197 |
+
// keep drilling down
|
|
|
1198 |
updateFallbackSlotVisibility(childNode);
|
1199 |
}
|
1200 |
}
|
1201 |
};
|
|
|
1202 |
var relocateNodes = [];
|
|
|
1203 |
var relocateSlotContent = function relocateSlotContent(elm) {
|
1204 |
// tslint:disable-next-line: prefer-const
|
1205 |
var childNode;
|
1211 |
var i = 0;
|
1212 |
var childNodes = elm.childNodes;
|
1213 |
var ilen = childNodes.length;
|
|
|
1214 |
for (; i < ilen; i++) {
|
1215 |
childNode = childNodes[i];
|
|
|
1216 |
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
1217 |
// first got the content reference comment node
|
1218 |
// then we got it's parent, which is where all the host content is in now
|
1219 |
hostContentNodes = node.parentNode.childNodes;
|
1220 |
slotNameAttr = childNode['s-sn'];
|
|
|
1221 |
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
1222 |
node = hostContentNodes[j];
|
|
|
1223 |
if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
|
1224 |
// let's do some relocating to its new home
|
1225 |
// but never relocate a content reference node
|
1228 |
// it's possible we've already decided to relocate this node
|
1229 |
relocateNodeData = relocateNodes.find(function (r) {
|
1230 |
return r.$nodeToRelocate$ === node;
|
1231 |
+
});
|
1232 |
+
// made some changes to slots
|
1233 |
// let's make sure we also double check
|
1234 |
// fallbacks are correctly hidden or shown
|
|
|
1235 |
checkSlotFallbackVisibility = true;
|
1236 |
node['s-sn'] = node['s-sn'] || slotNameAttr;
|
|
|
1237 |
if (relocateNodeData) {
|
1238 |
// previously we never found a slot home for this node
|
1239 |
// but turns out we did, so let's remember it now
|
1245 |
$nodeToRelocate$: node
|
1246 |
});
|
1247 |
}
|
|
|
1248 |
if (node['s-sr']) {
|
1249 |
relocateNodes.map(function (relocateNode) {
|
1250 |
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
|
1251 |
relocateNodeData = relocateNodes.find(function (r) {
|
1252 |
return r.$nodeToRelocate$ === node;
|
1253 |
});
|
|
|
1254 |
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
1255 |
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
1256 |
}
|
1269 |
}
|
1270 |
}
|
1271 |
}
|
1272 |
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
|
|
|
|
|
1273 |
relocateSlotContent(childNode);
|
1274 |
}
|
1275 |
}
|
1276 |
};
|
|
|
1277 |
var isNodeLocatedInSlot = function isNodeLocatedInSlot(nodeToRelocate, slotNameAttr) {
|
1278 |
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
|
|
|
1279 |
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
1280 |
return true;
|
1281 |
}
|
|
|
1282 |
if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
|
1283 |
return true;
|
1284 |
}
|
|
|
1285 |
return false;
|
1286 |
}
|
|
|
1287 |
if (nodeToRelocate['s-sn'] === slotNameAttr) {
|
1288 |
return true;
|
1289 |
}
|
|
|
1290 |
return slotNameAttr === '';
|
1291 |
};
|
|
|
1292 |
var callNodeRefs = function callNodeRefs(vNode) {
|
1293 |
{
|
1294 |
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
1295 |
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
1296 |
}
|
1297 |
};
|
|
|
1298 |
var renderVdom = function renderVdom(hostRef, renderFnResults) {
|
1299 |
var hostElm = hostRef.$hostElement$;
|
1300 |
var cmpMeta = hostRef.$cmpMeta$;
|
1301 |
var oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
1302 |
var rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
1303 |
+
hostTagName = hostElm.tagName;
|
|
|
1304 |
if (cmpMeta.$attrsToReflect$) {
|
1305 |
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
1306 |
cmpMeta.$attrsToReflect$.map(function (_ref9) {
|
1307 |
var _ref10 = _slicedToArray(_ref9, 2),
|
1308 |
+
propName = _ref10[0],
|
1309 |
+
attribute = _ref10[1];
|
|
|
1310 |
return rootVnode.$attrs$[attribute] = hostElm[propName];
|
1311 |
});
|
1312 |
}
|
|
|
1313 |
rootVnode.$tag$ = null;
|
1314 |
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
|
|
|
1315 |
hostRef.$vnode$ = rootVnode;
|
1316 |
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
|
1317 |
{
|
1318 |
scopeId = hostElm['s-sc'];
|
1319 |
}
|
|
|
1320 |
{
|
1321 |
contentRef = hostElm['s-cr'];
|
1322 |
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
1323 |
+
// always reset
|
|
|
|
|
1324 |
checkSlotFallbackVisibility = false;
|
1325 |
+
}
|
1326 |
+
// synchronous patch
|
|
|
1327 |
patch(oldVNode, rootVnode);
|
|
|
1328 |
{
|
1329 |
// while we're moving nodes around existing nodes, temporarily disable
|
1330 |
// the disconnectCallback from working
|
1331 |
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
|
|
|
|
|
1332 |
if (checkSlotRelocate) {
|
1333 |
relocateSlotContent(rootVnode.$elm$);
|
1334 |
var relocateData;
|
1338 |
var insertBeforeNode;
|
1339 |
var refNode;
|
1340 |
var _i3 = 0;
|
|
|
1341 |
for (; _i3 < relocateNodes.length; _i3++) {
|
1342 |
relocateData = relocateNodes[_i3];
|
1343 |
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
|
1344 |
if (!nodeToRelocate['s-ol']) {
|
1345 |
// add a reference node marking this node's original location
|
1346 |
// keep a reference to this node for later lookups
|
1349 |
nodeToRelocate.parentNode.insertBefore(nodeToRelocate['s-ol'] = orgLocationNode, nodeToRelocate);
|
1350 |
}
|
1351 |
}
|
|
|
1352 |
for (_i3 = 0; _i3 < relocateNodes.length; _i3++) {
|
1353 |
relocateData = relocateNodes[_i3];
|
1354 |
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
|
1355 |
if (relocateData.$slotRefNode$) {
|
1356 |
// by default we're just going to insert it directly
|
1357 |
// after the slot reference node
|
1358 |
parentNodeRef = relocateData.$slotRefNode$.parentNode;
|
1359 |
insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
|
1360 |
orgLocationNode = nodeToRelocate['s-ol'];
|
|
|
1361 |
while (orgLocationNode = orgLocationNode.previousSibling) {
|
1362 |
refNode = orgLocationNode['s-nr'];
|
|
|
1363 |
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
1364 |
refNode = refNode.nextSibling;
|
|
|
1365 |
if (!refNode || !refNode['s-nr']) {
|
1366 |
insertBeforeNode = refNode;
|
1367 |
break;
|
1368 |
}
|
1369 |
}
|
1370 |
}
|
|
|
1371 |
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
1372 |
// we've checked that it's worth while to relocate
|
1373 |
// since that the node to relocate
|
1376 |
if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
1377 |
// probably a component in the index.html that doesn't have it's hostname set
|
1378 |
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
1379 |
+
}
|
1380 |
+
// add it back to the dom but in its new home
|
|
|
1381 |
parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
1382 |
}
|
1383 |
}
|
1384 |
} else {
|
1385 |
// this node doesn't have a slot home to go to, so let's hide it
|
1386 |
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
|
|
|
1387 |
nodeToRelocate.hidden = true;
|
1388 |
}
|
1389 |
}
|
1390 |
}
|
1391 |
}
|
|
|
1392 |
if (checkSlotFallbackVisibility) {
|
1393 |
updateFallbackSlotVisibility(rootVnode.$elm$);
|
1394 |
+
}
|
1395 |
+
// done moving nodes around
|
1396 |
// allow the disconnect callback to work again
|
1397 |
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
1398 |
+
// always reset
|
|
|
|
|
|
|
|
|
1399 |
relocateNodes.length = 0;
|
1400 |
}
|
1401 |
+
};
|
|
|
1402 |
var getElement = function getElement(ref) {
|
1403 |
return getHostRef(ref).$hostElement$ ;
|
1404 |
};
|
|
|
1405 |
var createEvent = function createEvent(ref, name, flags) {
|
1406 |
var elm = getElement(ref);
|
1407 |
return {
|
1408 |
emit: function emit(detail) {
|
|
|
1409 |
return emitEvent(elm, name, {
|
1410 |
+
bubbles: !!(flags & 4 /* Bubbles */),
|
1411 |
+
composed: !!(flags & 2 /* Composed */),
|
1412 |
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
|
|
|
|
|
|
|
|
|
|
|
1413 |
detail: detail
|
1414 |
});
|
1415 |
}
|
1422 |
* @param opts options for configuring a custom Event
|
1423 |
* @returns the custom Event
|
1424 |
*/
|
|
|
|
|
1425 |
var emitEvent = function emitEvent(elm, name, opts) {
|
1426 |
var ev = plt.ce(name, opts);
|
1427 |
elm.dispatchEvent(ev);
|
1428 |
return ev;
|
1429 |
};
|
|
|
1430 |
var attachToAncestor = function attachToAncestor(hostRef, ancestorComponent) {
|
1431 |
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
1432 |
ancestorComponent['s-p'].push(new Promise(function (r) {
|
1434 |
}));
|
1435 |
}
|
1436 |
};
|
|
|
1437 |
var scheduleUpdate = function scheduleUpdate(hostRef, isInitialLoad) {
|
1438 |
{
|
1439 |
+
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
|
|
|
1440 |
}
|
1441 |
|
1442 |
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
1443 |
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
|
|
|
|
|
|
|
1444 |
return;
|
1445 |
}
|
1446 |
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
1447 |
+
// there is no ancestor component or the ancestor component
|
1448 |
// has already fired off its lifecycle update then
|
1449 |
// fire off the initial update
|
|
|
1450 |
var dispatch = function dispatch() {
|
1451 |
return dispatchHooks(hostRef, isInitialLoad);
|
1452 |
};
|
|
|
1453 |
return writeTask(dispatch) ;
|
1454 |
};
|
|
|
1455 |
var dispatchHooks = function dispatchHooks(hostRef, isInitialLoad) {
|
1456 |
var endSchedule = createTime();
|
1457 |
var instance = hostRef.$lazyInstance$ ;
|
1458 |
var promise;
|
|
|
1459 |
if (isInitialLoad) {
|
1460 |
{
|
1461 |
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
|
|
|
|
|
1462 |
if (hostRef.$queuedListeners$) {
|
1463 |
hostRef.$queuedListeners$.map(function (_ref11) {
|
1464 |
var _ref12 = _slicedToArray(_ref11, 2),
|
1465 |
+
methodName = _ref12[0],
|
1466 |
+
event = _ref12[1];
|
|
|
1467 |
return safeCall(instance, methodName, event);
|
1468 |
});
|
1469 |
hostRef.$queuedListeners$ = null;
|
1470 |
}
|
1471 |
}
|
|
|
1472 |
{
|
1473 |
promise = safeCall(instance, 'componentWillLoad');
|
1474 |
}
|
1475 |
}
|
|
|
1476 |
endSchedule();
|
1477 |
return then(promise, function () {
|
1478 |
return updateComponent(hostRef, instance, isInitialLoad);
|
1479 |
});
|
1480 |
};
|
|
|
1481 |
var updateComponent = /*#__PURE__*/function () {
|
1482 |
var _ref13 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(hostRef, instance, isInitialLoad) {
|
1483 |
var elm, endUpdate, rc, endRender, childrenPromises, postUpdate;
|
1489 |
elm = hostRef.$hostElement$;
|
1490 |
endUpdate = createTime();
|
1491 |
rc = elm['s-rc'];
|
|
|
1492 |
if (isInitialLoad) {
|
1493 |
// DOM WRITE!
|
1494 |
attachStyles(hostRef);
|
1495 |
}
|
|
|
1496 |
endRender = createTime();
|
|
|
1497 |
{
|
1498 |
_context.next = 11;
|
1499 |
break;
|
1500 |
}
|
|
|
1501 |
case 9:
|
1502 |
_context.next = 12;
|
1503 |
break;
|
|
|
1504 |
case 11:
|
1505 |
callRender(hostRef, instance);
|
|
|
1506 |
case 12:
|
|
|
1507 |
if (rc) {
|
1508 |
// ok, so turns out there are some child host elements
|
1509 |
// waiting on this parent element to load
|
1513 |
});
|
1514 |
elm['s-rc'] = undefined;
|
1515 |
}
|
|
|
1516 |
endRender();
|
1517 |
endUpdate();
|
|
|
1518 |
{
|
1519 |
childrenPromises = elm['s-p'];
|
|
|
1520 |
postUpdate = function postUpdate() {
|
1521 |
return postUpdateComponent(hostRef);
|
1522 |
};
|
|
|
1523 |
if (childrenPromises.length === 0) {
|
1524 |
postUpdate();
|
1525 |
} else {
|
1526 |
Promise.all(childrenPromises).then(postUpdate);
|
1527 |
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
|
|
|
1528 |
childrenPromises.length = 0;
|
1529 |
}
|
1530 |
}
|
|
|
1531 |
case 19:
|
1532 |
case "end":
|
1533 |
return _context.stop();
|
1535 |
}
|
1536 |
}, _callee);
|
1537 |
}));
|
|
|
1538 |
return function updateComponent(_x, _x2, _x3) {
|
1539 |
return _ref13.apply(this, arguments);
|
1540 |
};
|
1541 |
}();
|
|
|
1542 |
var callRender = function callRender(hostRef, instance, elm) {
|
|
|
1543 |
try {
|
1544 |
instance = instance.render() ;
|
|
|
1545 |
{
|
1546 |
+
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
|
|
|
1547 |
}
|
1548 |
|
1549 |
{
|
1550 |
+
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
|
|
|
1551 |
}
|
1552 |
|
1553 |
{
|
1565 |
}
|
1566 |
return null;
|
1567 |
};
|
|
|
1568 |
var postUpdateComponent = function postUpdateComponent(hostRef) {
|
1569 |
var elm = hostRef.$hostElement$;
|
1570 |
var endPostUpdate = createTime();
|
1571 |
var instance = hostRef.$lazyInstance$ ;
|
1572 |
var ancestorComponent = hostRef.$ancestorComponent$;
|
|
|
1573 |
{
|
1574 |
|
1575 |
safeCall(instance, 'componentDidRender');
|
1576 |
}
|
1577 |
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
1578 |
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
|
|
|
|
|
|
|
|
|
|
|
1579 |
{
|
1580 |
// DOM WRITE!
|
1581 |
addHydratedFlag(elm);
|
1582 |
}
|
|
|
1583 |
{
|
1584 |
|
1585 |
safeCall(instance, 'componentDidLoad');
|
1586 |
}
|
1587 |
endPostUpdate();
|
|
|
1588 |
{
|
1589 |
hostRef.$onReadyResolve$(elm);
|
|
|
1590 |
if (!ancestorComponent) {
|
1591 |
appDidLoad();
|
1592 |
}
|
1594 |
} else {
|
1595 |
endPostUpdate();
|
1596 |
}
|
|
|
1597 |
{
|
1598 |
hostRef.$onInstanceResolve$(elm);
|
1599 |
+
}
|
1600 |
+
// load events fire from bottom to top
|
1601 |
// the deepest elements load first then bubbles up
|
|
|
|
|
1602 |
{
|
1603 |
if (hostRef.$onRenderResolve$) {
|
1604 |
hostRef.$onRenderResolve$();
|
1605 |
hostRef.$onRenderResolve$ = undefined;
|
1606 |
}
|
1607 |
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
|
|
|
|
|
1608 |
nextTick(function () {
|
1609 |
return scheduleUpdate(hostRef, false);
|
1610 |
});
|
1611 |
}
|
1612 |
+
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
1613 |
+
}
|
1614 |
+
// ( •_•)
|
|
|
|
|
|
|
|
|
1615 |
// ( •_•)>⌐■-■
|
1616 |
// (⌐■_■)
|
|
|
1617 |
};
|
|
|
1618 |
var appDidLoad = function appDidLoad(who) {
|
1619 |
// on appload
|
1620 |
// we have finish the first big initial render
|
1630 |
});
|
1631 |
});
|
1632 |
};
|
|
|
1633 |
var safeCall = function safeCall(instance, method, arg) {
|
1634 |
if (instance && instance[method]) {
|
1635 |
try {
|
1638 |
consoleError(e);
|
1639 |
}
|
1640 |
}
|
|
|
1641 |
return undefined;
|
1642 |
};
|
|
|
1643 |
var then = function then(promise, thenFn) {
|
1644 |
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
1645 |
};
|
|
|
1646 |
var addHydratedFlag = function addHydratedFlag(elm) {
|
1647 |
return elm.classList.add('hydrated') ;
|
1648 |
};
|
|
|
1649 |
var parsePropertyValue = function parsePropertyValue(propValue, propType) {
|
1650 |
// ensure this value is of the correct prop type
|
1651 |
if (propValue != null && !isComplexType(propValue)) {
|
1652 |
+
if (propType & 4 /* Boolean */) {
|
|
|
|
|
1653 |
// per the HTML spec, any string value means it is a boolean true value
|
1654 |
// but we'll cheat here and say that the string "false" is the boolean false
|
1655 |
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
1656 |
}
|
1657 |
+
if (propType & 2 /* Number */) {
|
|
|
|
|
|
|
1658 |
// force it to be a number
|
1659 |
return parseFloat(propValue);
|
1660 |
}
|
1661 |
+
if (propType & 1 /* String */) {
|
|
|
|
|
|
|
1662 |
// could have been passed as a number or boolean
|
1663 |
// but we still want it as a string
|
1664 |
return String(propValue);
|
1665 |
+
}
|
1666 |
+
// redundant return here for better minification
|
|
|
1667 |
return propValue;
|
1668 |
+
}
|
1669 |
+
// not sure exactly what type we want
|
1670 |
// so no need to change to a different type
|
|
|
|
|
1671 |
return propValue;
|
1672 |
};
|
|
|
1673 |
var getValue = function getValue(ref, propName) {
|
1674 |
return getHostRef(ref).$instanceValues$.get(propName);
|
1675 |
};
|
|
|
1676 |
var setValue = function setValue(ref, propName, newVal, cmpMeta) {
|
1677 |
// check our new property value against our internal value
|
1678 |
var hostRef = getHostRef(ref);
|
1681 |
var flags = hostRef.$flags$;
|
1682 |
var instance = hostRef.$lazyInstance$ ;
|
1683 |
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
1684 |
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
|
|
|
|
|
|
|
1685 |
// gadzooks! the property's value has changed!!
|
1686 |
// set our new value!
|
1687 |
hostRef.$instanceValues$.set(propName, newVal);
|
|
|
1688 |
if (instance) {
|
1689 |
// get an array of method names of watch functions to call
|
1690 |
+
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
|
|
|
1691 |
var watchMethods = cmpMeta.$watchers$[propName];
|
|
|
1692 |
if (watchMethods) {
|
1693 |
// this instance is watching for when this property changed
|
1694 |
watchMethods.map(function (watchMethodName) {
|
1701 |
});
|
1702 |
}
|
1703 |
}
|
1704 |
+
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
1705 |
+
// looks like this value actually changed, so we've got work to do!
|
|
|
|
|
|
|
|
|
|
|
|
|
1706 |
// but only if we've already rendered, otherwise just chill out
|
1707 |
// queue that we need to do an update, but don't worry about queuing
|
1708 |
// up millions cuz this function ensures it only runs once
|
|
|
|
|
1709 |
scheduleUpdate(hostRef, false);
|
1710 |
}
|
1711 |
}
|
1712 |
}
|
1713 |
};
|
|
|
1714 |
var proxyComponent = function proxyComponent(Cstr, cmpMeta, flags) {
|
1715 |
if (cmpMeta.$members$) {
|
1716 |
if (Cstr.watchers) {
|
1717 |
cmpMeta.$watchers$ = Cstr.watchers;
|
1718 |
+
}
|
1719 |
+
// It's better to have a const than two Object.entries()
|
|
|
1720 |
var members = Object.entries(cmpMeta.$members$);
|
1721 |
var prototype = Cstr.prototype;
|
1722 |
members.map(function (_ref14) {
|
1723 |
var _ref15 = _slicedToArray(_ref14, 2),
|
1724 |
+
memberName = _ref15[0],
|
1725 |
+
_ref15$ = _slicedToArray(_ref15[1], 1),
|
1726 |
+
memberFlags = _ref15$[0];
|
1727 |
+
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1728 |
// proxyComponent - prop
|
1729 |
Object.defineProperty(prototype, memberName, {
|
1730 |
get: function get() {
|
1732 |
return getValue(this, memberName);
|
1733 |
},
|
1734 |
set: function set(newValue) {
|
1735 |
+
// proxyComponent, set value
|
|
|
1736 |
setValue(this, memberName, newValue, cmpMeta);
|
1737 |
},
|
1738 |
configurable: true,
|
1739 |
enumerable: true
|
1740 |
});
|
1741 |
+
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
|
|
|
|
|
|
|
1742 |
// proxyComponent - method
|
1743 |
Object.defineProperty(prototype, memberName, {
|
1744 |
value: function value() {
|
1745 |
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
1746 |
args[_key2] = arguments[_key2];
|
1747 |
}
|
|
|
1748 |
var ref = getHostRef(this);
|
1749 |
return ref.$onInstancePromise$.then(function () {
|
1750 |
var _ref$$lazyInstance$;
|
|
|
1751 |
return (_ref$$lazyInstance$ = ref.$lazyInstance$)[memberName].apply(_ref$$lazyInstance$, args);
|
1752 |
});
|
1753 |
}
|
1754 |
});
|
1755 |
}
|
1756 |
});
|
1757 |
+
if ((flags & 1 /* isElementConstructor */)) {
|
|
|
|
|
|
|
1758 |
var attrNameToPropName = new Map();
|
|
|
1759 |
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
1760 |
var _this = this;
|
|
|
1761 |
plt.jmp(function () {
|
1762 |
+
var propName = attrNameToPropName.get(attrName);
|
1763 |
+
// In a webcomponent lifecyle the attributeChangedCallback runs prior to connectedCallback
|
1764 |
// in the case where an attribute was set inline.
|
1765 |
// ```html
|
1766 |
// <my-component some-attribute="some-value"></my-component>
|
1793 |
// TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
|
1794 |
// properties here given that this goes against best practices outlined here
|
1795 |
// https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
|
|
|
1796 |
if (_this.hasOwnProperty(propName)) {
|
1797 |
newValue = _this[propName];
|
1798 |
delete _this[propName];
|
1799 |
}
|
|
|
1800 |
_this[propName] = newValue === null && typeof _this[propName] === 'boolean' ? false : newValue;
|
1801 |
});
|
1802 |
+
};
|
1803 |
+
// create an array of attributes to observe
|
1804 |
// and also create a map of html attribute name to js property name
|
|
|
|
|
1805 |
Cstr.observedAttributes = members.filter(function (_ref16) {
|
1806 |
var _ref17 = _slicedToArray(_ref16, 2),
|
1807 |
+
m = _ref17[1];
|
|
|
1808 |
return m[0] & 15;
|
1809 |
+
} /* HasAttribute */) // filter to only keep props that should match attributes
|
|
|
|
|
1810 |
.map(function (_ref18) {
|
1811 |
var _ref19 = _slicedToArray(_ref18, 2),
|
1812 |
+
propName = _ref19[0],
|
1813 |
+
m = _ref19[1];
|
|
|
1814 |
var attrName = m[1] || propName;
|
1815 |
attrNameToPropName.set(attrName, propName);
|
1816 |
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
|
|
|
|
|
1817 |
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
1818 |
}
|
|
|
1819 |
return attrName;
|
1820 |
});
|
1821 |
}
|
1822 |
}
|
|
|
1823 |
return Cstr;
|
1824 |
};
|
|
|
1825 |
var initializeComponent = /*#__PURE__*/function () {
|
1826 |
var _ref20 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(elm, hostRef, cmpMeta, hmrVersionId, Cstr) {
|
1827 |
var endLoad, endNewInstance, style, _scopeId, endRegisterStyles, ancestorComponent, schedule;
|
|
|
1828 |
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
1829 |
while (1) {
|
1830 |
switch (_context2.prev = _context2.next) {
|
1831 |
case 0:
|
1832 |
+
if (!((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0)) {
|
|
|
|
|
1833 |
_context2.next = 37;
|
1834 |
break;
|
1835 |
}
|
|
|
1836 |
// we haven't initialized this element yet
|
1837 |
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
1838 |
+
// lazy loaded components
|
|
|
1839 |
// request the component's implementation to be
|
1840 |
// wired up with the host element
|
|
|
1841 |
Cstr = loadModule(cmpMeta);
|
|
|
1842 |
if (!Cstr.then) {
|
1843 |
_context2.next = 10;
|
1844 |
break;
|
1845 |
}
|
|
|
1846 |
// Await creates a micro-task avoid if possible
|
1847 |
endLoad = uniqueTime();
|
1848 |
_context2.next = 8;
|
1849 |
return Cstr;
|
|
|
1850 |
case 8:
|
1851 |
Cstr = _context2.sent;
|
1852 |
endLoad();
|
|
|
1853 |
case 10:
|
1854 |
{
|
1855 |
_context2.next = 12;
|
1856 |
break;
|
1857 |
}
|
|
|
1858 |
case 12:
|
1859 |
if (!Cstr.isProxied) {
|
1860 |
// we've never proxied this Constructor before
|
1863 |
{
|
1864 |
cmpMeta.$watchers$ = Cstr.watchers;
|
1865 |
}
|
1866 |
+
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
|
|
|
|
|
1867 |
Cstr.isProxied = true;
|
1868 |
}
|
|
|
1869 |
endNewInstance = createTime(); // ok, time to construct the instance
|
1870 |
// but let's keep track of when we start and stop
|
1871 |
// so that the getters/setters don't incorrectly step on data
|
|
|
1872 |
{
|
1873 |
+
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
1874 |
+
}
|
1875 |
+
// construct the lazy-loaded component implementation
|
|
|
1876 |
// passing the hostRef is very important during
|
1877 |
// construction in order to directly wire together the
|
1878 |
// host element and the lazy-loaded instance
|
|
|
|
|
1879 |
try {
|
1880 |
new Cstr(hostRef);
|
1881 |
} catch (e) {
|
1882 |
consoleError(e);
|
1883 |
}
|
|
|
1884 |
{
|
1885 |
+
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
|
|
|
1886 |
}
|
1887 |
|
1888 |
{
|
1889 |
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
|
|
|
1890 |
}
|
1891 |
|
1892 |
endNewInstance();
|
1893 |
_context2.next = 25;
|
1894 |
break;
|
|
|
1895 |
case 22:
|
1896 |
// sync constructor component
|
1897 |
Cstr = elm.constructor;
|
1898 |
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
1899 |
+
// wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
|
|
|
1900 |
// watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
|
1901 |
// Stencil has completed instantiating the component.
|
|
|
1902 |
customElements.whenDefined(cmpMeta.$tagName$).then(function () {
|
1903 |
+
return hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
|
|
|
1904 |
});
|
|
|
1905 |
case 25:
|
1906 |
if (!(Cstr.style)) {
|
1907 |
_context2.next = 37;
|
1908 |
break;
|
1909 |
}
|
|
|
1910 |
// this component has styles but we haven't registered them yet
|
1911 |
style = Cstr.style;
|
|
|
1912 |
_scopeId = getScopeId(cmpMeta);
|
|
|
1913 |
if (styles.has(_scopeId)) {
|
1914 |
_context2.next = 37;
|
1915 |
break;
|
1916 |
}
|
|
|
1917 |
endRegisterStyles = createTime();
|
|
|
1918 |
{
|
1919 |
_context2.next = 35;
|
1920 |
break;
|
1921 |
}
|
|
|
1922 |
case 34:
|
1923 |
style = _context2.sent;
|
|
|
1924 |
case 35:
|
1925 |
+
registerStyle(_scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
|
|
|
1926 |
endRegisterStyles();
|
|
|
1927 |
case 37:
|
1928 |
// we've successfully created a lazy instance
|
1929 |
ancestorComponent = hostRef.$ancestorComponent$;
|
|
|
1930 |
schedule = function schedule() {
|
1931 |
return scheduleUpdate(hostRef, true);
|
1932 |
};
|
|
|
1933 |
if (ancestorComponent && ancestorComponent['s-rc']) {
|
1934 |
// this is the intial load and this component it has an ancestor component
|
1935 |
// but the ancestor component has NOT fired its will update lifecycle yet
|
1941 |
} else {
|
1942 |
schedule();
|
1943 |
}
|
|
|
1944 |
case 40:
|
1945 |
case "end":
|
1946 |
return _context2.stop();
|
1948 |
}
|
1949 |
}, _callee2);
|
1950 |
}));
|
|
|
1951 |
return function initializeComponent(_x4, _x5, _x6, _x7, _x8) {
|
1952 |
return _ref20.apply(this, arguments);
|
1953 |
};
|
1954 |
}();
|
|
|
1955 |
var _connectedCallback = function connectedCallback(elm) {
|
1956 |
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
|
|
|
1957 |
var hostRef = getHostRef(elm);
|
1958 |
var cmpMeta = hostRef.$cmpMeta$;
|
1959 |
var endConnected = createTime();
|
1960 |
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
|
|
|
|
|
1961 |
// first time this component has connected
|
1962 |
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
|
|
|
1963 |
var hostId;
|
|
|
1964 |
if (!hostId) {
|
1965 |
// initUpdate
|
1966 |
// if the slot polyfill is required we'll need to put some nodes
|
1967 |
// in here to act as original content anchors as we move nodes around
|
1968 |
// host element has been connected to the DOM
|
1969 |
+
if (cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
|
|
|
|
|
|
|
1970 |
setContentReference(elm);
|
1971 |
}
|
1972 |
}
|
|
|
1973 |
{
|
1974 |
// find the first ancestor component (if there is one) and register
|
1975 |
// this component as one of the actively loading child components for its ancestor
|
1976 |
var ancestorComponent = elm;
|
|
|
1977 |
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
1978 |
// climb up the ancestors looking for the first
|
1979 |
// component that hasn't finished its lifecycle update yet
|
1984 |
break;
|
1985 |
}
|
1986 |
}
|
1987 |
+
}
|
1988 |
+
// Lazy properties
|
1989 |
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
|
|
|
1990 |
if (cmpMeta.$members$) {
|
1991 |
Object.entries(cmpMeta.$members$).map(function (_ref21) {
|
1992 |
var _ref22 = _slicedToArray(_ref21, 2),
|
1993 |
+
memberName = _ref22[0],
|
1994 |
+
_ref22$ = _slicedToArray(_ref22[1], 1),
|
1995 |
+
memberFlags = _ref22$[0];
|
1996 |
+
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
|
|
|
|
|
1997 |
var value = elm[memberName];
|
1998 |
delete elm[memberName];
|
1999 |
elm[memberName] = value;
|
2000 |
}
|
2001 |
});
|
2002 |
}
|
|
|
2003 |
{
|
2004 |
initializeComponent(elm, hostRef, cmpMeta);
|
2005 |
}
|
2007 |
// not the first time this has connected
|
2008 |
// reattach any event listeners to the host
|
2009 |
// since they would have been removed when disconnected
|
2010 |
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
2011 |
}
|
|
|
2012 |
endConnected();
|
2013 |
}
|
2014 |
};
|
|
|
2015 |
var setContentReference = function setContentReference(elm) {
|
2016 |
// only required when we're NOT using native shadow dom (slot)
|
2017 |
// or this browser doesn't support native shadow dom
|
2023 |
contentRefElm['s-cn'] = true;
|
2024 |
elm.insertBefore(contentRefElm, elm.firstChild);
|
2025 |
};
|
|
|
2026 |
var _disconnectedCallback = function disconnectedCallback(elm) {
|
2027 |
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
|
|
|
2028 |
var hostRef = getHostRef(elm);
|
2029 |
var instance = hostRef.$lazyInstance$ ;
|
|
|
2030 |
{
|
2031 |
if (hostRef.$rmListeners$) {
|
2032 |
hostRef.$rmListeners$.map(function (rmListener) {
|
2034 |
});
|
2035 |
hostRef.$rmListeners$ = undefined;
|
2036 |
}
|
2037 |
+
}
|
|
|
2038 |
{
|
2039 |
safeCall(instance, 'disconnectedCallback');
|
2040 |
}
|
2041 |
}
|
2042 |
};
|
|
|
2043 |
var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
2044 |
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2045 |
var endBootstrap = createTime();
|
2054 |
var isBootstrapping = true;
|
2055 |
Object.assign(plt, options);
|
2056 |
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
|
2057 |
lazyBundles.map(function (lazyBundle) {
|
2058 |
return lazyBundle[1].map(function (compactMeta) {
|
2059 |
var cmpMeta = {
|
2062 |
$members$: compactMeta[2],
|
2063 |
$listeners$: compactMeta[3]
|
2064 |
};
|
|
|
2065 |
{
|
2066 |
cmpMeta.$members$ = compactMeta[2];
|
2067 |
}
|
|
|
2068 |
{
|
2069 |
cmpMeta.$listeners$ = compactMeta[3];
|
2070 |
}
|
|
|
2071 |
{
|
2072 |
cmpMeta.$attrsToReflect$ = [];
|
2073 |
}
|
|
|
2074 |
{
|
2075 |
cmpMeta.$watchers$ = {};
|
2076 |
}
|
2077 |
|
2078 |
var tagName = cmpMeta.$tagName$;
|
|
|
2079 |
var HostElement = /*#__PURE__*/function (_HTMLElement) {
|
2080 |
_inherits(HostElement, _HTMLElement);
|
|
|
2081 |
var _super2 = _createSuper(HostElement);
|
|
|
2082 |
// StencilLazyHost
|
2083 |
function HostElement(self) {
|
2084 |
var _this2;
|
|
|
2085 |
_classCallCheck(this, HostElement);
|
|
|
2086 |
// @ts-ignore
|
2087 |
_this2 = _super2.call(this, self);
|
2088 |
self = _assertThisInitialized(_this2);
|
2089 |
registerHost(self, cmpMeta);
|
2090 |
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
|
|
|
|
|
2091 |
// this component is using shadow dom
|
2092 |
// and this browser supports shadow dom
|
2093 |
// add the read-only property "shadowRoot" to the host element
|
2100 |
}
|
2101 |
}
|
2102 |
}
|
|
|
2103 |
return _this2;
|
2104 |
}
|
|
|
2105 |
_createClass(HostElement, [{
|
2106 |
key: "connectedCallback",
|
2107 |
value: function connectedCallback() {
|
2108 |
var _this3 = this;
|
|
|
2109 |
if (appLoadFallback) {
|
2110 |
clearTimeout(appLoadFallback);
|
2111 |
appLoadFallback = null;
|
2112 |
}
|
|
|
2113 |
if (isBootstrapping) {
|
2114 |
// connectedCallback will be processed once all components have been registered
|
2115 |
deferredConnectedCallbacks.push(this);
|
2123 |
key: "disconnectedCallback",
|
2124 |
value: function disconnectedCallback() {
|
2125 |
var _this4 = this;
|
|
|
2126 |
plt.jmp(function () {
|
2127 |
return _disconnectedCallback(_this4);
|
2128 |
});
|
2133 |
return getHostRef(this).$onReadyPromise$;
|
2134 |
}
|
2135 |
}]);
|
|
|
2136 |
return HostElement;
|
2137 |
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
|
|
2138 |
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
|
2139 |
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
2140 |
cmpTags.push(tagName);
|
2141 |
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
|
|
|
2142 |
}
|
2143 |
});
|
2144 |
});
|
2147 |
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
2148 |
visibilityStyle.setAttribute('data-styles', '');
|
2149 |
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
2150 |
+
}
|
2151 |
+
// Process deferred connectedCallbacks now all components have been registered
|
|
|
2152 |
isBootstrapping = false;
|
|
|
2153 |
if (deferredConnectedCallbacks.length) {
|
2154 |
deferredConnectedCallbacks.map(function (host) {
|
2155 |
return host.connectedCallback();
|
2160 |
return appLoadFallback = setTimeout(appDidLoad, 30);
|
2161 |
});
|
2162 |
}
|
2163 |
+
}
|
2164 |
+
// Fallback appLoad event
|
|
|
2165 |
endBootstrap();
|
2166 |
};
|
|
|
2167 |
var hostRefs = new WeakMap();
|
|
|
2168 |
var getHostRef = function getHostRef(ref) {
|
2169 |
return hostRefs.get(ref);
|
2170 |
};
|
|
|
2171 |
var registerInstance = function registerInstance(lazyInstance, hostRef) {
|
2172 |
return hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
2173 |
};
|
|
|
2174 |
var registerHost = function registerHost(elm, cmpMeta) {
|
2175 |
var hostRef = {
|
2176 |
$flags$: 0,
|
2178 |
$cmpMeta$: cmpMeta,
|
2179 |
$instanceValues$: new Map()
|
2180 |
};
|
|
|
2181 |
{
|
2182 |
hostRef.$onInstancePromise$ = new Promise(function (r) {
|
2183 |
return hostRef.$onInstanceResolve$ = r;
|
2184 |
});
|
2185 |
}
|
|
|
2186 |
{
|
2187 |
hostRef.$onReadyPromise$ = new Promise(function (r) {
|
2188 |
return hostRef.$onReadyResolve$ = r;
|
2190 |
elm['s-p'] = [];
|
2191 |
elm['s-rc'] = [];
|
2192 |
}
|
|
|
2193 |
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
2194 |
return hostRefs.set(elm, hostRef);
|
2195 |
};
|
|
|
2196 |
var isMemberInElement = function isMemberInElement(elm, memberName) {
|
2197 |
return memberName in elm;
|
2198 |
};
|
|
|
2199 |
var consoleError = function consoleError(e, el) {
|
2200 |
return (0, console.error)(e, el);
|
2201 |
};
|
|
|
2202 |
var cmpModules = /*@__PURE__*/new Map();
|
|
|
2203 |
var loadModule = function loadModule(cmpMeta, hostRef, hmrVersionId) {
|
2204 |
// loadModuleImport
|
2205 |
var exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
2206 |
var bundleId = cmpMeta.$lazyBundleId$;
|
|
|
2207 |
var module = cmpModules.get(bundleId) ;
|
|
|
2208 |
if (module) {
|
2209 |
return module[exportName];
|
2210 |
}
|
|
|
2211 |
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
2212 |
/* webpackInclude: /\.entry\.js$/ */
|
|
|
2213 |
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
|
2214 |
/* webpackMode: "lazy" */
|
2215 |
"./".concat(bundleId, ".entry.js").concat(''))); }).then(function (importedModule) {
|
2216 |
{
|
2217 |
cmpModules.set(bundleId, importedModule);
|
2218 |
}
|
|
|
2219 |
return importedModule[exportName];
|
2220 |
}, consoleError);
|
2221 |
};
|
|
|
2222 |
var styles = new Map();
|
2223 |
var queueDomReads = [];
|
2224 |
var queueDomWrites = [];
|
|
|
2225 |
var queueTask = function queueTask(queue, write) {
|
2226 |
return function (cb) {
|
2227 |
queue.push(cb);
|
|
|
2228 |
if (!queuePending) {
|
2229 |
queuePending = true;
|
2230 |
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
|
|
|
|
|
2231 |
nextTick(flush);
|
2232 |
} else {
|
2233 |
plt.raf(flush);
|
2235 |
}
|
2236 |
};
|
2237 |
};
|
|
|
2238 |
var consume = function consume(queue) {
|
2239 |
for (var _i7 = 0; _i7 < queue.length; _i7++) {
|
2240 |
try {
|
2243 |
consoleError(e);
|
2244 |
}
|
2245 |
}
|
|
|
2246 |
queue.length = 0;
|
2247 |
};
|
|
|
2248 |
var flush = function flush() {
|
2249 |
+
// always force a bunch of medium callbacks to run, but still have
|
2250 |
// a throttle on how many can run in a certain time
|
2251 |
// DOM READS!!!
|
2252 |
+
consume(queueDomReads);
|
2253 |
+
// DOM WRITES!!!
|
|
|
|
|
2254 |
{
|
2255 |
consume(queueDomWrites);
|
|
|
2256 |
if (queuePending = queueDomReads.length > 0) {
|
2257 |
// still more to do yet, but we've run out of time
|
2258 |
// let's let this thing cool off and try again in the next tick
|
2260 |
}
|
2261 |
}
|
2262 |
};
|
|
|
2263 |
var nextTick = /*@__PURE__*/function nextTick(cb) {
|
2264 |
return promiseResolve().then(cb);
|
2265 |
};
|
2276 |
exports._slicedToArray = _slicedToArray;
|
2277 |
exports._toConsumableArray = _toConsumableArray;
|
2278 |
exports._typeof = _typeof;
|
|
|
2279 |
exports.bootstrapLazy = bootstrapLazy;
|
2280 |
exports.createEvent = createEvent;
|
2281 |
exports.getElement = getElement;
|
dist/components/cjs/{learndash-da083e6b.js → learndash-0fc381a1.js}
RENAMED
@@ -1,70 +1,68 @@
|
|
1 |
'use strict';
|
2 |
|
3 |
-
const prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry = require('./presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-
|
4 |
-
require('./index-
|
5 |
|
6 |
const learndash = (function (player) {
|
7 |
var _learndash_video_data, _prestoPlayer, _prestoPlayer$learnda, _learndash_video_data2, _prestoPlayer2, _prestoPlayer2$learnd, _prestoPlayer3, _prestoPlayer3$learnd, _prestoPlayer4, _prestoPlayer4$learnd, _learndash_video_data3;
|
8 |
-
|
9 |
if (typeof learndash_video_data === 'undefined' || ((_learndash_video_data = learndash_video_data) === null || _learndash_video_data === void 0 ? void 0 : _learndash_video_data.videos_found_provider) !== 'presto') {
|
10 |
return;
|
11 |
}
|
12 |
-
|
13 |
prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry.resumeProgress(player); // maybe resume progress
|
|
|
14 |
// Learndash has this logic in a shitty method on their php class
|
15 |
// we have to fake it here since we don't have access to it
|
16 |
-
|
17 |
window.learndash_video_data.videos_auto_complete = ((_prestoPlayer = prestoPlayer) === null || _prestoPlayer === void 0 ? void 0 : (_prestoPlayer$learnda = _prestoPlayer.learndash) === null || _prestoPlayer$learnda === void 0 ? void 0 : _prestoPlayer$learnda.lesson_video_auto_complete) === 'on';
|
18 |
window.learndash_video_data.videos_hide_complete_button = 'AFTER' === ((_learndash_video_data2 = learndash_video_data) === null || _learndash_video_data2 === void 0 ? void 0 : _learndash_video_data2.videos_shown) && ((_prestoPlayer2 = prestoPlayer) === null || _prestoPlayer2 === void 0 ? void 0 : (_prestoPlayer2$learnd = _prestoPlayer2.learndash) === null || _prestoPlayer2$learnd === void 0 ? void 0 : _prestoPlayer2$learnd.lesson_video_hide_complete_button) === 'on';
|
19 |
window.learndash_video_data.videos_auto_complete_delay = (_prestoPlayer3 = prestoPlayer) === null || _prestoPlayer3 === void 0 ? void 0 : (_prestoPlayer3$learnd = _prestoPlayer3.learndash) === null || _prestoPlayer3$learnd === void 0 ? void 0 : _prestoPlayer3$learnd.lesson_video_auto_complete_delay;
|
20 |
-
window.learndash_video_data.videos_auto_complete_delay_message = (_prestoPlayer4 = prestoPlayer) === null || _prestoPlayer4 === void 0 ? void 0 : (_prestoPlayer4$learnd = _prestoPlayer4.learndash) === null || _prestoPlayer4$learnd === void 0 ? void 0 : _prestoPlayer4$learnd.videos_auto_complete_delay_message;
|
21 |
|
22 |
-
|
23 |
-
|
24 |
|
|
|
|
|
25 |
if ('BEFORE' === ((_learndash_video_data3 = learndash_video_data) === null || _learndash_video_data3 === void 0 ? void 0 : _learndash_video_data3.videos_shown)) {
|
26 |
learndash_video_data.videos_auto_complete = false;
|
27 |
-
jQuery(document).trigger('learndash_video_disable_assets', [true]);
|
28 |
|
|
|
29 |
jQuery(function () {
|
30 |
if (learndash_video_data.video_debug === '1') {
|
31 |
console.log('PRESTO: init');
|
32 |
}
|
33 |
-
|
34 |
if (document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="' + learndash_video_data.videos_found_provider + '"]').length) {
|
35 |
if (learndash_video_data.video_debug === '1') {
|
36 |
console.log('PRESTO: calling LearnDash_disable_assets(true)');
|
37 |
-
}
|
38 |
-
|
39 |
|
|
|
40 |
LearnDash_disable_assets(true);
|
41 |
-
LearnDash_watchPlayers();
|
42 |
|
|
|
43 |
document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="' + learndash_video_data.videos_found_provider + '"]').forEach(function (element, index) {
|
44 |
var element_key = 'presto-player__wrapper-player-' + index;
|
45 |
var element_id = element.getAttribute('id');
|
46 |
-
|
47 |
if (typeof element_id === 'undefined' || element_id == '') {
|
48 |
element_id = element_key;
|
49 |
element.setAttribute('id', element_id);
|
50 |
}
|
51 |
-
|
52 |
ld_video_players[element_key] = {};
|
53 |
ld_video_players[element_key]['player_key'] = element_key;
|
54 |
ld_video_players[element_key]['player_type'] = learndash_video_data.videos_found_provider;
|
55 |
ld_video_players[element_key]['player_id'] = element_id;
|
56 |
ld_video_players[element_key]['player_wrapper'] = element.closest('presto-player');
|
57 |
-
|
58 |
if (typeof ld_video_players[element_key]['player_wrapper'] !== 'undefined') {
|
59 |
ld_video_players[element_key]['player_cookie_key'] = ld_video_players[element_key]['player_wrapper'].getAttribute('data-video-cookie-key');
|
60 |
} else {
|
61 |
ld_video_players[element_key]['player_cookie_key'] = '';
|
62 |
}
|
|
|
63 |
|
64 |
-
|
65 |
// If yes, enable the assets back and end watch players function.
|
66 |
// If no, then apply all the filters and performs the actions again.
|
67 |
-
|
68 |
if (LearnDash_Video_Progress_getSetting(ld_video_players[element_key], 'video_state') === 'complete') {
|
69 |
LearnDash_disable_assets(false);
|
70 |
LearnDash_watchPlayersEnd();
|
@@ -74,62 +72,57 @@ const learndash = (function (player) {
|
|
74 |
if (learndash_video_data.video_debug === '1') {
|
75 |
console.log('PRESTO: Video is playing');
|
76 |
}
|
77 |
-
|
78 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_duration', player.duration);
|
79 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
80 |
-
|
81 |
if (player.duration && player.duration === player.currentTime) {
|
82 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'complete');
|
83 |
-
|
84 |
if (learndash_video_data.video_debug === '1') {
|
85 |
console.log('PRESTO: calling LearnDash_disable_assets(false)');
|
86 |
}
|
|
|
87 |
|
88 |
-
|
89 |
-
|
90 |
LearnDash_watchPlayersEnd();
|
91 |
}
|
92 |
-
});
|
93 |
|
|
|
94 |
wp.hooks.addAction('presto.playerPlaying', 'presto-player', function (player) {
|
95 |
if (learndash_video_data.video_debug === '1') {
|
96 |
console.log('PRESTO: Video is playing');
|
97 |
}
|
98 |
-
|
99 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_duration', player.duration);
|
100 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
101 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'play');
|
102 |
-
});
|
103 |
|
|
|
104 |
wp.hooks.addAction('presto.playerPause', 'presto-player', function (player) {
|
105 |
if (learndash_video_data.video_debug === '1') {
|
106 |
console.log('PRESTO: Video is paused');
|
107 |
}
|
108 |
-
|
109 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
110 |
console.log(player.duration);
|
111 |
console.log(player.currentTime);
|
112 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'pause');
|
113 |
-
});
|
114 |
|
|
|
115 |
wp.hooks.addAction('presto.playerEnded', 'presto-player', function (player) {
|
116 |
if (learndash_video_data.video_debug === '1') {
|
117 |
console.log('PRESTO: video ended');
|
118 |
}
|
119 |
-
|
120 |
if (learndash_video_data.video_debug === '1') {
|
121 |
console.log("PRESTO: setting 'video_state' to 'complete'");
|
122 |
}
|
123 |
-
|
124 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
125 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'complete');
|
126 |
-
|
127 |
if (learndash_video_data.video_debug === '1') {
|
128 |
console.log('PRESTO: calling LearnDash_disable_assets(false)');
|
129 |
}
|
|
|
130 |
|
131 |
-
|
132 |
-
|
133 |
LearnDash_watchPlayersEnd();
|
134 |
});
|
135 |
}
|
1 |
'use strict';
|
2 |
|
3 |
+
const prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry = require('./presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-0c9358bf.js');
|
4 |
+
require('./index-7c213f46.js');
|
5 |
|
6 |
const learndash = (function (player) {
|
7 |
var _learndash_video_data, _prestoPlayer, _prestoPlayer$learnda, _learndash_video_data2, _prestoPlayer2, _prestoPlayer2$learnd, _prestoPlayer3, _prestoPlayer3$learnd, _prestoPlayer4, _prestoPlayer4$learnd, _learndash_video_data3;
|
|
|
8 |
if (typeof learndash_video_data === 'undefined' || ((_learndash_video_data = learndash_video_data) === null || _learndash_video_data === void 0 ? void 0 : _learndash_video_data.videos_found_provider) !== 'presto') {
|
9 |
return;
|
10 |
}
|
|
|
11 |
prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry.resumeProgress(player); // maybe resume progress
|
12 |
+
|
13 |
// Learndash has this logic in a shitty method on their php class
|
14 |
// we have to fake it here since we don't have access to it
|
|
|
15 |
window.learndash_video_data.videos_auto_complete = ((_prestoPlayer = prestoPlayer) === null || _prestoPlayer === void 0 ? void 0 : (_prestoPlayer$learnda = _prestoPlayer.learndash) === null || _prestoPlayer$learnda === void 0 ? void 0 : _prestoPlayer$learnda.lesson_video_auto_complete) === 'on';
|
16 |
window.learndash_video_data.videos_hide_complete_button = 'AFTER' === ((_learndash_video_data2 = learndash_video_data) === null || _learndash_video_data2 === void 0 ? void 0 : _learndash_video_data2.videos_shown) && ((_prestoPlayer2 = prestoPlayer) === null || _prestoPlayer2 === void 0 ? void 0 : (_prestoPlayer2$learnd = _prestoPlayer2.learndash) === null || _prestoPlayer2$learnd === void 0 ? void 0 : _prestoPlayer2$learnd.lesson_video_hide_complete_button) === 'on';
|
17 |
window.learndash_video_data.videos_auto_complete_delay = (_prestoPlayer3 = prestoPlayer) === null || _prestoPlayer3 === void 0 ? void 0 : (_prestoPlayer3$learnd = _prestoPlayer3.learndash) === null || _prestoPlayer3$learnd === void 0 ? void 0 : _prestoPlayer3$learnd.lesson_video_auto_complete_delay;
|
18 |
+
window.learndash_video_data.videos_auto_complete_delay_message = (_prestoPlayer4 = prestoPlayer) === null || _prestoPlayer4 === void 0 ? void 0 : (_prestoPlayer4$learnd = _prestoPlayer4.learndash) === null || _prestoPlayer4$learnd === void 0 ? void 0 : _prestoPlayer4$learnd.videos_auto_complete_delay_message;
|
19 |
|
20 |
+
// Temporarily set the video track path to '/' to set the cookie globally
|
21 |
+
window.learndash_video_data.video_track_path = '/';
|
22 |
|
23 |
+
// Learndash has this logic in a shitty method on their php class
|
24 |
+
// we have to fake it here since we don't have access to it
|
25 |
if ('BEFORE' === ((_learndash_video_data3 = learndash_video_data) === null || _learndash_video_data3 === void 0 ? void 0 : _learndash_video_data3.videos_shown)) {
|
26 |
learndash_video_data.videos_auto_complete = false;
|
27 |
+
jQuery(document).trigger('learndash_video_disable_assets', [true]);
|
28 |
|
29 |
+
// Set learndash video players
|
30 |
jQuery(function () {
|
31 |
if (learndash_video_data.video_debug === '1') {
|
32 |
console.log('PRESTO: init');
|
33 |
}
|
|
|
34 |
if (document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="' + learndash_video_data.videos_found_provider + '"]').length) {
|
35 |
if (learndash_video_data.video_debug === '1') {
|
36 |
console.log('PRESTO: calling LearnDash_disable_assets(true)');
|
37 |
+
}
|
|
|
38 |
|
39 |
+
// Disable learndash assets and watch players.
|
40 |
LearnDash_disable_assets(true);
|
41 |
+
LearnDash_watchPlayers();
|
42 |
|
43 |
+
// Go through all the <presto-player> instances
|
44 |
document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="' + learndash_video_data.videos_found_provider + '"]').forEach(function (element, index) {
|
45 |
var element_key = 'presto-player__wrapper-player-' + index;
|
46 |
var element_id = element.getAttribute('id');
|
|
|
47 |
if (typeof element_id === 'undefined' || element_id == '') {
|
48 |
element_id = element_key;
|
49 |
element.setAttribute('id', element_id);
|
50 |
}
|
|
|
51 |
ld_video_players[element_key] = {};
|
52 |
ld_video_players[element_key]['player_key'] = element_key;
|
53 |
ld_video_players[element_key]['player_type'] = learndash_video_data.videos_found_provider;
|
54 |
ld_video_players[element_key]['player_id'] = element_id;
|
55 |
ld_video_players[element_key]['player_wrapper'] = element.closest('presto-player');
|
|
|
56 |
if (typeof ld_video_players[element_key]['player_wrapper'] !== 'undefined') {
|
57 |
ld_video_players[element_key]['player_cookie_key'] = ld_video_players[element_key]['player_wrapper'].getAttribute('data-video-cookie-key');
|
58 |
} else {
|
59 |
ld_video_players[element_key]['player_cookie_key'] = '';
|
60 |
}
|
61 |
+
ld_video_players[element_key]['player_cookie_values'] = LearnDash_Video_Progress_initSettings(ld_video_players[element_key]);
|
62 |
|
63 |
+
// Check if video has been completed already.
|
64 |
// If yes, enable the assets back and end watch players function.
|
65 |
// If no, then apply all the filters and performs the actions again.
|
|
|
66 |
if (LearnDash_Video_Progress_getSetting(ld_video_players[element_key], 'video_state') === 'complete') {
|
67 |
LearnDash_disable_assets(false);
|
68 |
LearnDash_watchPlayersEnd();
|
72 |
if (learndash_video_data.video_debug === '1') {
|
73 |
console.log('PRESTO: Video is playing');
|
74 |
}
|
|
|
75 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_duration', player.duration);
|
76 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
|
|
77 |
if (player.duration && player.duration === player.currentTime) {
|
78 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'complete');
|
|
|
79 |
if (learndash_video_data.video_debug === '1') {
|
80 |
console.log('PRESTO: calling LearnDash_disable_assets(false)');
|
81 |
}
|
82 |
+
LearnDash_disable_assets(false);
|
83 |
|
84 |
+
// Stop watching players.
|
|
|
85 |
LearnDash_watchPlayersEnd();
|
86 |
}
|
87 |
+
});
|
88 |
|
89 |
+
// Player Playing.
|
90 |
wp.hooks.addAction('presto.playerPlaying', 'presto-player', function (player) {
|
91 |
if (learndash_video_data.video_debug === '1') {
|
92 |
console.log('PRESTO: Video is playing');
|
93 |
}
|
|
|
94 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_duration', player.duration);
|
95 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
96 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'play');
|
97 |
+
});
|
98 |
|
99 |
+
// Player Paused.
|
100 |
wp.hooks.addAction('presto.playerPause', 'presto-player', function (player) {
|
101 |
if (learndash_video_data.video_debug === '1') {
|
102 |
console.log('PRESTO: Video is paused');
|
103 |
}
|
|
|
104 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
105 |
console.log(player.duration);
|
106 |
console.log(player.currentTime);
|
107 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'pause');
|
108 |
+
});
|
109 |
|
110 |
+
// Player Ended.
|
111 |
wp.hooks.addAction('presto.playerEnded', 'presto-player', function (player) {
|
112 |
if (learndash_video_data.video_debug === '1') {
|
113 |
console.log('PRESTO: video ended');
|
114 |
}
|
|
|
115 |
if (learndash_video_data.video_debug === '1') {
|
116 |
console.log("PRESTO: setting 'video_state' to 'complete'");
|
117 |
}
|
|
|
118 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
119 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'complete');
|
|
|
120 |
if (learndash_video_data.video_debug === '1') {
|
121 |
console.log('PRESTO: calling LearnDash_disable_assets(false)');
|
122 |
}
|
123 |
+
LearnDash_disable_assets(false);
|
124 |
|
125 |
+
// Stop watching players.
|
|
|
126 |
LearnDash_watchPlayersEnd();
|
127 |
});
|
128 |
}
|
dist/components/cjs/{lifter-ffa800e1.js → lifter-405c1707.js}
RENAMED
@@ -4,12 +4,10 @@
|
|
4 |
var prevent_default = function prevent_default(event) {
|
5 |
event.preventDefault();
|
6 |
};
|
7 |
-
|
8 |
function toggle_mark_complete(enabled) {
|
9 |
var $form = jQuery('.llms-complete-lesson-form'),
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
if (true === enabled) {
|
14 |
$form.off('submit', prevent_default);
|
15 |
$btn.removeAttr('disabled');
|
@@ -19,9 +17,9 @@ function toggle_mark_complete(enabled) {
|
|
19 |
$btn.attr('disabled', 'disabled');
|
20 |
$links.addClass('llms-av-disabled').on('click', prevent_default);
|
21 |
}
|
22 |
-
}
|
23 |
-
|
24 |
|
|
|
25 |
var getEventMeta = function getEventMeta(player) {
|
26 |
var eventMeta = {
|
27 |
ts: player.currentTime,
|
@@ -31,32 +29,29 @@ var getEventMeta = function getEventMeta(player) {
|
|
31 |
id: player.config.id
|
32 |
};
|
33 |
return eventMeta;
|
34 |
-
};
|
35 |
-
|
36 |
|
|
|
37 |
var track_event = function track_event(event_id, meta) {
|
38 |
llms.tracking.addEvent('video.' + event_id, {
|
39 |
meta: meta
|
40 |
});
|
41 |
-
};
|
42 |
-
|
43 |
|
|
|
44 |
function start_countdown($el) {
|
45 |
var $seconds = $el.find('.llms-av-pv--seconds'),
|
46 |
-
|
47 |
setInterval(function () {
|
48 |
time = $seconds.text() * 1 - 1;
|
49 |
-
|
50 |
if (1 === time) {
|
51 |
$seconds.closest('a')[0].click();
|
52 |
}
|
53 |
-
|
54 |
if (time >= 0) {
|
55 |
$seconds.text(time);
|
56 |
}
|
57 |
}, 1000);
|
58 |
}
|
59 |
-
|
60 |
function do_ajax_completion($el, settings) {
|
61 |
LLMS.Ajax.call({
|
62 |
data: {
|
@@ -69,15 +64,12 @@ function do_ajax_completion($el, settings) {
|
|
69 |
},
|
70 |
error: function error(xhr, status, _error) {
|
71 |
LLMS.Spinner.stop($el);
|
72 |
-
console.error(xhr.responseText + ' (' + _error + ' ' + status + ')');
|
73 |
-
/* eslint-disable-line no-console */
|
74 |
-
|
75 |
-
console.log(xhr);
|
76 |
-
/* eslint-disable-line no-console */
|
77 |
},
|
|
|
78 |
success: function success(res) {
|
79 |
LLMS.Spinner.stop($el);
|
80 |
-
|
81 |
if (res !== null && res !== void 0 && res.html) {
|
82 |
$el.append(res.html);
|
83 |
start_countdown($el);
|
@@ -106,29 +98,26 @@ var onEndedVideo = function onEndedVideo(e, $el, settings) {
|
|
106 |
};
|
107 |
function lifter (player) {
|
108 |
var _llms, _llms$tracking;
|
109 |
-
|
110 |
/*
|
111 |
Below code is coped from LifterLMS-Advanced-Videos/assets/js/llms.av.js
|
112 |
We replaced $ with jQuery.
|
113 |
*/
|
114 |
var settings = {};
|
115 |
var tracking_settings = ((_llms = llms) === null || _llms === void 0 ? void 0 : (_llms$tracking = _llms.tracking) === null || _llms$tracking === void 0 ? void 0 : _llms$tracking.getSettings()) || null;
|
116 |
-
|
117 |
if (tracking_settings !== null && tracking_settings !== void 0 && tracking_settings.av) {
|
118 |
settings = tracking_settings.av;
|
119 |
}
|
|
|
120 |
/*
|
121 |
LifterLMS-Advanced-Videos copied code end.
|
122 |
Below code will glue the LifterAV with Presto player.
|
123 |
*/
|
124 |
-
|
125 |
-
|
126 |
if (settings.require_video_completion && !settings.video_completed) {
|
127 |
toggle_mark_complete(false);
|
128 |
}
|
|
|
129 |
|
130 |
-
|
131 |
-
|
132 |
player.on('pause', onPauseVideo);
|
133 |
player.on('playing', onPlayingVideo);
|
134 |
player.on('ended', function (e) {
|
4 |
var prevent_default = function prevent_default(event) {
|
5 |
event.preventDefault();
|
6 |
};
|
|
|
7 |
function toggle_mark_complete(enabled) {
|
8 |
var $form = jQuery('.llms-complete-lesson-form'),
|
9 |
+
$btn = jQuery('.llms-complete-lesson-form button[type="submit"]'),
|
10 |
+
$links = jQuery('#llms_start_quiz, #llms-start-assignment');
|
|
|
11 |
if (true === enabled) {
|
12 |
$form.off('submit', prevent_default);
|
13 |
$btn.removeAttr('disabled');
|
17 |
$btn.attr('disabled', 'disabled');
|
18 |
$links.addClass('llms-av-disabled').on('click', prevent_default);
|
19 |
}
|
20 |
+
}
|
|
|
21 |
|
22 |
+
// Setting and Getting Event meta data
|
23 |
var getEventMeta = function getEventMeta(player) {
|
24 |
var eventMeta = {
|
25 |
ts: player.currentTime,
|
29 |
id: player.config.id
|
30 |
};
|
31 |
return eventMeta;
|
32 |
+
};
|
|
|
33 |
|
34 |
+
// tracking event
|
35 |
var track_event = function track_event(event_id, meta) {
|
36 |
llms.tracking.addEvent('video.' + event_id, {
|
37 |
meta: meta
|
38 |
});
|
39 |
+
};
|
|
|
40 |
|
41 |
+
// ajax call
|
42 |
function start_countdown($el) {
|
43 |
var $seconds = $el.find('.llms-av-pv--seconds'),
|
44 |
+
time;
|
45 |
setInterval(function () {
|
46 |
time = $seconds.text() * 1 - 1;
|
|
|
47 |
if (1 === time) {
|
48 |
$seconds.closest('a')[0].click();
|
49 |
}
|
|
|
50 |
if (time >= 0) {
|
51 |
$seconds.text(time);
|
52 |
}
|
53 |
}, 1000);
|
54 |
}
|
|
|
55 |
function do_ajax_completion($el, settings) {
|
56 |
LLMS.Ajax.call({
|
57 |
data: {
|
64 |
},
|
65 |
error: function error(xhr, status, _error) {
|
66 |
LLMS.Spinner.stop($el);
|
67 |
+
console.error(xhr.responseText + ' (' + _error + ' ' + status + ')'); /* eslint-disable-line no-console */
|
68 |
+
console.log(xhr); /* eslint-disable-line no-console */
|
|
|
|
|
|
|
69 |
},
|
70 |
+
|
71 |
success: function success(res) {
|
72 |
LLMS.Spinner.stop($el);
|
|
|
73 |
if (res !== null && res !== void 0 && res.html) {
|
74 |
$el.append(res.html);
|
75 |
start_countdown($el);
|
98 |
};
|
99 |
function lifter (player) {
|
100 |
var _llms, _llms$tracking;
|
|
|
101 |
/*
|
102 |
Below code is coped from LifterLMS-Advanced-Videos/assets/js/llms.av.js
|
103 |
We replaced $ with jQuery.
|
104 |
*/
|
105 |
var settings = {};
|
106 |
var tracking_settings = ((_llms = llms) === null || _llms === void 0 ? void 0 : (_llms$tracking = _llms.tracking) === null || _llms$tracking === void 0 ? void 0 : _llms$tracking.getSettings()) || null;
|
|
|
107 |
if (tracking_settings !== null && tracking_settings !== void 0 && tracking_settings.av) {
|
108 |
settings = tracking_settings.av;
|
109 |
}
|
110 |
+
|
111 |
/*
|
112 |
LifterLMS-Advanced-Videos copied code end.
|
113 |
Below code will glue the LifterAV with Presto player.
|
114 |
*/
|
|
|
|
|
115 |
if (settings.require_video_completion && !settings.video_completed) {
|
116 |
toggle_mark_complete(false);
|
117 |
}
|
118 |
+
var $el = jQuery('.presto-block-video');
|
119 |
|
120 |
+
// on end, sync time and autoload content
|
|
|
121 |
player.on('pause', onPauseVideo);
|
122 |
player.on('playing', onPlayingVideo);
|
123 |
player.on('ended', function (e) {
|
dist/components/cjs/loader.cjs.js
CHANGED
@@ -2,14 +2,12 @@
|
|
2 |
|
3 |
Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 |
-
const index = require('./index-
|
6 |
|
7 |
/*
|
8 |
Stencil Client Patch Esm v2.9.0 | MIT Licensed | https://stenciljs.com
|
9 |
*/
|
10 |
-
|
11 |
var patchEsm = function patchEsm() {
|
12 |
-
|
13 |
return index.promiseResolve();
|
14 |
};
|
15 |
|
2 |
|
3 |
Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 |
+
const index = require('./index-7c213f46.js');
|
6 |
|
7 |
/*
|
8 |
Stencil Client Patch Esm v2.9.0 | MIT Licensed | https://stenciljs.com
|
9 |
*/
|
|
|
10 |
var patchEsm = function patchEsm() {
|
|
|
11 |
return index.promiseResolve();
|
12 |
};
|
13 |
|
dist/components/cjs/presto-action-bar_25.cjs.entry.js
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
|
3 |
Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 |
-
const prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry = require('./presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-
|
6 |
-
require('./index-
|
7 |
|
8 |
|
9 |
|
2 |
|
3 |
Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 |
+
const prestoActionBar_prestoActionBarController_prestoActionBarUi_prestoAudio_prestoBunny_prestoBusinessSkin_prestoCtaOverlay_prestoCtaOverlayController_prestoCtaOverlayUi_prestoDynamicOverlayUi_prestoDynamicOverlays_prestoEmailOverlay_prestoEmailOverlayController_prestoEmailOverlayUi_prestoModernSkin_prestoMutedOverlay_prestoPlayer_prestoPlayerButton_prestoPlayerSpinner_prestoStackedSkin_prestoTimestamp_prestoVideo_prestoVimeo_prestoYoutube_prestoYoutubeSubscribeButton_entry = require('./presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-0c9358bf.js');
|
6 |
+
require('./index-7c213f46.js');
|
7 |
|
8 |
|
9 |
|
dist/components/cjs/presto-player-skeleton.cjs.entry.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 |
-
const index = require('./index-
|
6 |
|
7 |
const prestoSkeletonCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{--border-radius:var(--presto-player-border-radius-pill);--color:#e5e7eb;--sheen-color:#f3f4f6;display:block;position:relative}.skeleton{display:flex;width:100%;height:100%;min-height:1rem}.skeleton__indicator{flex:1 1 auto;background:var(--color);border-radius:var(--border-radius)}.skeleton--sheen .skeleton__indicator{background:linear-gradient(270deg, var(--sheen-color), var(--color), var(--color), var(--sheen-color));background-size:400% 100%;background-size:400% 100%;animation:sheen 8s ease-in-out infinite}.skeleton--pulse .skeleton__indicator{animation:pulse 2s ease-in-out 0.5s infinite}@keyframes sheen{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}";
|
8 |
|
2 |
|
3 |
Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 |
+
const index = require('./index-7c213f46.js');
|
6 |
|
7 |
const prestoSkeletonCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{--border-radius:var(--presto-player-border-radius-pill);--color:#e5e7eb;--sheen-color:#f3f4f6;display:block;position:relative}.skeleton{display:flex;width:100%;height:100%;min-height:1rem}.skeleton__indicator{flex:1 1 auto;background:var(--color);border-radius:var(--border-radius)}.skeleton--sheen .skeleton__indicator{background:linear-gradient(270deg, var(--sheen-color), var(--color), var(--color), var(--sheen-color));background-size:400% 100%;background-size:400% 100%;animation:sheen 8s ease-in-out infinite}.skeleton--pulse .skeleton__indicator{animation:pulse 2s ease-in-out 0.5s infinite}@keyframes sheen{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}";
|
8 |
|
dist/components/cjs/presto-video-curtain-ui.cjs.entry.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 |
-
const index = require('./index-
|
6 |
|
7 |
const prestoVideoCurtainUiCss = ":host{font-size:16px}.curtain{position:relative;font-family:var(--presto-curtain-font-family, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\");background-color:var(--presto-curtain-background-color, #000);text-align:var(--presto-curtain-text-align, center);color:var(--presto-curtain-text-color, #fff);padding-bottom:var(--presto-curtain-size, 56.25%);font-size:var(--presto-curtain-font-size, 1.5em)}::slotted(:not(:first-child)){margin-top:14px}.content{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;flex-direction:column;padding:48px}";
|
8 |
|
2 |
|
3 |
Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 |
+
const index = require('./index-7c213f46.js');
|
6 |
|
7 |
const prestoVideoCurtainUiCss = ":host{font-size:16px}.curtain{position:relative;font-family:var(--presto-curtain-font-family, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\");background-color:var(--presto-curtain-background-color, #000);text-align:var(--presto-curtain-text-align, center);color:var(--presto-curtain-text-color, #fff);padding-bottom:var(--presto-curtain-size, 56.25%);font-size:var(--presto-curtain-font-size, 1.5em)}::slotted(:not(:first-child)){margin-top:14px}.content{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;flex-direction:column;padding:48px}";
|
8 |
|
dist/components/cjs/{resize-observer-e02153c5.js → resize-observer-3bee288d.js}
RENAMED
@@ -15,10 +15,8 @@ var hasSkippedObservations = function hasSkippedObservations() {
|
|
15 |
};
|
16 |
|
17 |
var msg = 'ResizeObserver loop completed with undelivered notifications.';
|
18 |
-
|
19 |
var deliverResizeLoopError = function deliverResizeLoopError() {
|
20 |
var event;
|
21 |
-
|
22 |
if (typeof ErrorEvent === 'function') {
|
23 |
event = new ErrorEvent('error', {
|
24 |
message: msg
|
@@ -28,12 +26,10 @@ var deliverResizeLoopError = function deliverResizeLoopError() {
|
|
28 |
event.initEvent('error', false, false);
|
29 |
event.message = msg;
|
30 |
}
|
31 |
-
|
32 |
window.dispatchEvent(event);
|
33 |
};
|
34 |
|
35 |
var ResizeObserverBoxOptions;
|
36 |
-
|
37 |
(function (ResizeObserverBoxOptions) {
|
38 |
ResizeObserverBoxOptions["BORDER_BOX"] = "border-box";
|
39 |
ResizeObserverBoxOptions["CONTENT_BOX"] = "content-box";
|
@@ -50,7 +46,6 @@ var ResizeObserverSize = function () {
|
|
50 |
this.blockSize = blockSize;
|
51 |
freeze(this);
|
52 |
}
|
53 |
-
|
54 |
return ResizeObserverSize;
|
55 |
}();
|
56 |
|
@@ -66,18 +61,16 @@ var DOMRectReadOnly = function () {
|
|
66 |
this.right = this.left + this.width;
|
67 |
return freeze(this);
|
68 |
}
|
69 |
-
|
70 |
DOMRectReadOnly.prototype.toJSON = function () {
|
71 |
var _a = this,
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
return {
|
82 |
x: x,
|
83 |
y: y,
|
@@ -89,51 +82,41 @@ var DOMRectReadOnly = function () {
|
|
89 |
height: height
|
90 |
};
|
91 |
};
|
92 |
-
|
93 |
DOMRectReadOnly.fromRect = function (rectangle) {
|
94 |
return new DOMRectReadOnly(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
|
95 |
};
|
96 |
-
|
97 |
return DOMRectReadOnly;
|
98 |
}();
|
99 |
|
100 |
var isSVG = function isSVG(target) {
|
101 |
return target instanceof SVGElement && 'getBBox' in target;
|
102 |
};
|
103 |
-
|
104 |
var isHidden = function isHidden(target) {
|
105 |
if (isSVG(target)) {
|
106 |
var _a = target.getBBox(),
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
return !width && !height;
|
111 |
}
|
112 |
-
|
113 |
var _b = target,
|
114 |
-
|
115 |
-
|
116 |
return !(offsetWidth || offsetHeight || target.getClientRects().length);
|
117 |
};
|
118 |
-
|
119 |
var isElement = function isElement(obj) {
|
120 |
-
var _a
|
121 |
-
|
122 |
if (obj instanceof Element) {
|
123 |
return true;
|
124 |
}
|
125 |
-
|
126 |
-
var scope = (_b = (_a = obj) === null || _a === void 0 ? void 0 : _a.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView;
|
127 |
return !!(scope && obj instanceof scope.Element);
|
128 |
};
|
129 |
-
|
130 |
var isReplacedElement = function isReplacedElement(target) {
|
131 |
switch (target.tagName) {
|
132 |
case 'INPUT':
|
133 |
if (target.type !== 'image') {
|
134 |
break;
|
135 |
}
|
136 |
-
|
137 |
case 'VIDEO':
|
138 |
case 'AUDIO':
|
139 |
case 'EMBED':
|
@@ -143,7 +126,6 @@ var isReplacedElement = function isReplacedElement(target) {
|
|
143 |
case 'IMG':
|
144 |
return true;
|
145 |
}
|
146 |
-
|
147 |
return false;
|
148 |
};
|
149 |
|
@@ -153,48 +135,38 @@ var cache = new WeakMap();
|
|
153 |
var scrollRegexp = /auto|scroll/;
|
154 |
var verticalRegexp = /^tb|vertical/;
|
155 |
var IE = /msie|trident/i.test(global.navigator && global.navigator.userAgent);
|
156 |
-
|
157 |
var parseDimension = function parseDimension(pixel) {
|
158 |
return parseFloat(pixel || '0');
|
159 |
};
|
160 |
-
|
161 |
var size = function size(inlineSize, blockSize, switchSizes) {
|
162 |
if (inlineSize === void 0) {
|
163 |
inlineSize = 0;
|
164 |
}
|
165 |
-
|
166 |
if (blockSize === void 0) {
|
167 |
blockSize = 0;
|
168 |
}
|
169 |
-
|
170 |
if (switchSizes === void 0) {
|
171 |
switchSizes = false;
|
172 |
}
|
173 |
-
|
174 |
return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
|
175 |
};
|
176 |
-
|
177 |
var zeroBoxes = freeze({
|
178 |
devicePixelContentBoxSize: size(),
|
179 |
borderBoxSize: size(),
|
180 |
contentBoxSize: size(),
|
181 |
contentRect: new DOMRectReadOnly(0, 0, 0, 0)
|
182 |
});
|
183 |
-
|
184 |
var calculateBoxSizes = function calculateBoxSizes(target, forceRecalculation) {
|
185 |
if (forceRecalculation === void 0) {
|
186 |
forceRecalculation = false;
|
187 |
}
|
188 |
-
|
189 |
if (cache.has(target) && !forceRecalculation) {
|
190 |
return cache.get(target);
|
191 |
}
|
192 |
-
|
193 |
if (isHidden(target)) {
|
194 |
cache.set(target, zeroBoxes);
|
195 |
return zeroBoxes;
|
196 |
}
|
197 |
-
|
198 |
var cs = getComputedStyle(target);
|
199 |
var svg = isSVG(target) && target.ownerSVGElement && target.getBBox();
|
200 |
var removePadding = !IE && cs.boxSizing === 'border-box';
|
@@ -230,20 +202,16 @@ var calculateBoxSizes = function calculateBoxSizes(target, forceRecalculation) {
|
|
230 |
cache.set(target, boxes);
|
231 |
return boxes;
|
232 |
};
|
233 |
-
|
234 |
var calculateBoxSize = function calculateBoxSize(target, observedBox, forceRecalculation) {
|
235 |
var _a = calculateBoxSizes(target, forceRecalculation),
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
switch (observedBox) {
|
241 |
case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:
|
242 |
return devicePixelContentBoxSize;
|
243 |
-
|
244 |
case ResizeObserverBoxOptions.BORDER_BOX:
|
245 |
return borderBoxSize;
|
246 |
-
|
247 |
default:
|
248 |
return contentBoxSize;
|
249 |
}
|
@@ -258,7 +226,6 @@ var ResizeObserverEntry = function () {
|
|
258 |
this.contentBoxSize = freeze([boxes.contentBoxSize]);
|
259 |
this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);
|
260 |
}
|
261 |
-
|
262 |
return ResizeObserverEntry;
|
263 |
}();
|
264 |
|
@@ -266,15 +233,12 @@ var calculateDepthForNode = function calculateDepthForNode(node) {
|
|
266 |
if (isHidden(node)) {
|
267 |
return Infinity;
|
268 |
}
|
269 |
-
|
270 |
var depth = 0;
|
271 |
var parent = node.parentNode;
|
272 |
-
|
273 |
while (parent) {
|
274 |
depth += 1;
|
275 |
parent = parent.parentNode;
|
276 |
}
|
277 |
-
|
278 |
return depth;
|
279 |
};
|
280 |
|
@@ -285,14 +249,12 @@ var broadcastActiveObservations = function broadcastActiveObservations() {
|
|
285 |
if (ro.activeTargets.length === 0) {
|
286 |
return;
|
287 |
}
|
288 |
-
|
289 |
var entries = [];
|
290 |
ro.activeTargets.forEach(function processTarget(ot) {
|
291 |
var entry = new ResizeObserverEntry(ot.target);
|
292 |
var targetDepth = calculateDepthForNode(ot.target);
|
293 |
entries.push(entry);
|
294 |
ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);
|
295 |
-
|
296 |
if (targetDepth < shallowestDepth) {
|
297 |
shallowestDepth = targetDepth;
|
298 |
}
|
@@ -302,12 +264,10 @@ var broadcastActiveObservations = function broadcastActiveObservations() {
|
|
302 |
});
|
303 |
ro.activeTargets.splice(0, ro.activeTargets.length);
|
304 |
});
|
305 |
-
|
306 |
for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
|
307 |
var callback = callbacks_1[_i];
|
308 |
callback();
|
309 |
}
|
310 |
-
|
311 |
return shallowestDepth;
|
312 |
};
|
313 |
|
@@ -330,28 +290,23 @@ var gatherActiveObservationsAtDepth = function gatherActiveObservationsAtDepth(d
|
|
330 |
var process = function process() {
|
331 |
var depth = 0;
|
332 |
gatherActiveObservationsAtDepth(depth);
|
333 |
-
|
334 |
while (hasActiveObservations()) {
|
335 |
depth = broadcastActiveObservations();
|
336 |
gatherActiveObservationsAtDepth(depth);
|
337 |
}
|
338 |
-
|
339 |
if (hasSkippedObservations()) {
|
340 |
deliverResizeLoopError();
|
341 |
}
|
342 |
-
|
343 |
return depth > 0;
|
344 |
};
|
345 |
|
346 |
var trigger;
|
347 |
var callbacks = [];
|
348 |
-
|
349 |
var notify = function notify() {
|
350 |
return callbacks.splice(0).forEach(function (cb) {
|
351 |
return cb();
|
352 |
});
|
353 |
};
|
354 |
-
|
355 |
var queueMicroTask = function queueMicroTask(callback) {
|
356 |
if (!trigger) {
|
357 |
var toggle_1 = 0;
|
@@ -362,12 +317,10 @@ var queueMicroTask = function queueMicroTask(callback) {
|
|
362 |
new MutationObserver(function () {
|
363 |
return notify();
|
364 |
}).observe(el_1, config);
|
365 |
-
|
366 |
trigger = function trigger() {
|
367 |
-
el_1.textContent = ""
|
368 |
};
|
369 |
}
|
370 |
-
|
371 |
callbacks.push(callback);
|
372 |
trigger();
|
373 |
};
|
@@ -379,11 +332,9 @@ var queueResizeObserver = function queueResizeObserver(cb) {
|
|
379 |
};
|
380 |
|
381 |
var watching = 0;
|
382 |
-
|
383 |
var isWatching = function isWatching() {
|
384 |
return !!watching;
|
385 |
};
|
386 |
-
|
387 |
var CATCH_PERIOD = 250;
|
388 |
var observerConfig = {
|
389 |
attributes: true,
|
@@ -392,54 +343,41 @@ var observerConfig = {
|
|
392 |
subtree: true
|
393 |
};
|
394 |
var events = ['resize', 'load', 'transitionend', 'animationend', 'animationstart', 'animationiteration', 'keyup', 'keydown', 'mouseup', 'mousedown', 'mouseover', 'mouseout', 'blur', 'focus'];
|
395 |
-
|
396 |
var time = function time(timeout) {
|
397 |
if (timeout === void 0) {
|
398 |
timeout = 0;
|
399 |
}
|
400 |
-
|
401 |
return Date.now() + timeout;
|
402 |
};
|
403 |
-
|
404 |
var scheduled = false;
|
405 |
-
|
406 |
var Scheduler = function () {
|
407 |
function Scheduler() {
|
408 |
var _this = this;
|
409 |
-
|
410 |
this.stopped = true;
|
411 |
-
|
412 |
this.listener = function () {
|
413 |
return _this.schedule();
|
414 |
};
|
415 |
}
|
416 |
-
|
417 |
Scheduler.prototype.run = function (timeout) {
|
418 |
var _this = this;
|
419 |
-
|
420 |
if (timeout === void 0) {
|
421 |
timeout = CATCH_PERIOD;
|
422 |
}
|
423 |
-
|
424 |
if (scheduled) {
|
425 |
return;
|
426 |
}
|
427 |
-
|
428 |
scheduled = true;
|
429 |
var until = time(timeout);
|
430 |
queueResizeObserver(function () {
|
431 |
var elementsHaveResized = false;
|
432 |
-
|
433 |
try {
|
434 |
elementsHaveResized = process();
|
435 |
} finally {
|
436 |
scheduled = false;
|
437 |
timeout = until - time();
|
438 |
-
|
439 |
if (!isWatching()) {
|
440 |
return;
|
441 |
}
|
442 |
-
|
443 |
if (elementsHaveResized) {
|
444 |
_this.run(1000);
|
445 |
} else if (timeout > 0) {
|
@@ -450,25 +388,19 @@ var Scheduler = function () {
|
|
450 |
}
|
451 |
});
|
452 |
};
|
453 |
-
|
454 |
Scheduler.prototype.schedule = function () {
|
455 |
this.stop();
|
456 |
this.run();
|
457 |
};
|
458 |
-
|
459 |
Scheduler.prototype.observe = function () {
|
460 |
var _this = this;
|
461 |
-
|
462 |
var cb = function cb() {
|
463 |
return _this.observer && _this.observer.observe(document.body, observerConfig);
|
464 |
};
|
465 |
-
|
466 |
document.body ? cb() : global.addEventListener('DOMContentLoaded', cb);
|
467 |
};
|
468 |
-
|
469 |
Scheduler.prototype.start = function () {
|
470 |
var _this = this;
|
471 |
-
|
472 |
if (this.stopped) {
|
473 |
this.stopped = false;
|
474 |
this.observer = new MutationObserver(this.listener);
|
@@ -478,10 +410,8 @@ var Scheduler = function () {
|
|
478 |
});
|
479 |
}
|
480 |
};
|
481 |
-
|
482 |
Scheduler.prototype.stop = function () {
|
483 |
var _this = this;
|
484 |
-
|
485 |
if (!this.stopped) {
|
486 |
this.observer && this.observer.disconnect();
|
487 |
events.forEach(function (name) {
|
@@ -490,12 +420,9 @@ var Scheduler = function () {
|
|
490 |
this.stopped = true;
|
491 |
}
|
492 |
};
|
493 |
-
|
494 |
return Scheduler;
|
495 |
}();
|
496 |
-
|
497 |
var scheduler = new Scheduler();
|
498 |
-
|
499 |
var updateCount = function updateCount(n) {
|
500 |
!watching && n > 0 && scheduler.start();
|
501 |
watching += n;
|
@@ -505,7 +432,6 @@ var updateCount = function updateCount(n) {
|
|
505 |
var skipNotifyOnElement = function skipNotifyOnElement(target) {
|
506 |
return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === 'inline';
|
507 |
};
|
508 |
-
|
509 |
var ResizeObservation = function () {
|
510 |
function ResizeObservation(target, observedBox) {
|
511 |
this.target = target;
|
@@ -515,21 +441,16 @@ var ResizeObservation = function () {
|
|
515 |
blockSize: 0
|
516 |
};
|
517 |
}
|
518 |
-
|
519 |
ResizeObservation.prototype.isActive = function () {
|
520 |
var size = calculateBoxSize(this.target, this.observedBox, true);
|
521 |
-
|
522 |
if (skipNotifyOnElement(this.target)) {
|
523 |
this.lastReportedSize = size;
|
524 |
}
|
525 |
-
|
526 |
if (this.lastReportedSize.inlineSize !== size.inlineSize || this.lastReportedSize.blockSize !== size.blockSize) {
|
527 |
return true;
|
528 |
}
|
529 |
-
|
530 |
return false;
|
531 |
};
|
532 |
-
|
533 |
return ResizeObservation;
|
534 |
}();
|
535 |
|
@@ -541,34 +462,27 @@ var ResizeObserverDetail = function () {
|
|
541 |
this.observer = resizeObserver;
|
542 |
this.callback = callback;
|
543 |
}
|
544 |
-
|
545 |
return ResizeObserverDetail;
|
546 |
}();
|
547 |
|
548 |
var observerMap = new WeakMap();
|
549 |
-
|
550 |
var getObservationIndex = function getObservationIndex(observationTargets, target) {
|
551 |
for (var i = 0; i < observationTargets.length; i += 1) {
|
552 |
if (observationTargets[i].target === target) {
|
553 |
return i;
|
554 |
}
|
555 |
}
|
556 |
-
|
557 |
return -1;
|
558 |
};
|
559 |
-
|
560 |
var ResizeObserverController = function () {
|
561 |
function ResizeObserverController() {}
|
562 |
-
|
563 |
ResizeObserverController.connect = function (resizeObserver, callback) {
|
564 |
var detail = new ResizeObserverDetail(resizeObserver, callback);
|
565 |
observerMap.set(resizeObserver, detail);
|
566 |
};
|
567 |
-
|
568 |
ResizeObserverController.observe = function (resizeObserver, target, options) {
|
569 |
var detail = observerMap.get(resizeObserver);
|
570 |
var firstObservation = detail.observationTargets.length === 0;
|
571 |
-
|
572 |
if (getObservationIndex(detail.observationTargets, target) < 0) {
|
573 |
firstObservation && resizeObservers.push(detail);
|
574 |
detail.observationTargets.push(new ResizeObservation(target, options && options.box));
|
@@ -576,29 +490,24 @@ var ResizeObserverController = function () {
|
|
576 |
scheduler.schedule();
|
577 |
}
|
578 |
};
|
579 |
-
|
580 |
ResizeObserverController.unobserve = function (resizeObserver, target) {
|
581 |
var detail = observerMap.get(resizeObserver);
|
582 |
var index = getObservationIndex(detail.observationTargets, target);
|
583 |
var lastObservation = detail.observationTargets.length === 1;
|
584 |
-
|
585 |
if (index >= 0) {
|
586 |
lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1);
|
587 |
detail.observationTargets.splice(index, 1);
|
588 |
updateCount(-1);
|
589 |
}
|
590 |
};
|
591 |
-
|
592 |
ResizeObserverController.disconnect = function (resizeObserver) {
|
593 |
var _this = this;
|
594 |
-
|
595 |
var detail = observerMap.get(resizeObserver);
|
596 |
detail.observationTargets.slice().forEach(function (ot) {
|
597 |
return _this.unobserve(resizeObserver, ot.target);
|
598 |
});
|
599 |
detail.activeTargets.splice(0, detail.activeTargets.length);
|
600 |
};
|
601 |
-
|
602 |
return ResizeObserverController;
|
603 |
}();
|
604 |
|
@@ -607,46 +516,35 @@ var ResizeObserver = function () {
|
|
607 |
if (arguments.length === 0) {
|
608 |
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
|
609 |
}
|
610 |
-
|
611 |
if (typeof callback !== 'function') {
|
612 |
throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
|
613 |
}
|
614 |
-
|
615 |
ResizeObserverController.connect(this, callback);
|
616 |
}
|
617 |
-
|
618 |
ResizeObserver.prototype.observe = function (target, options) {
|
619 |
if (arguments.length === 0) {
|
620 |
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
621 |
}
|
622 |
-
|
623 |
if (!isElement(target)) {
|
624 |
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
625 |
}
|
626 |
-
|
627 |
ResizeObserverController.observe(this, target, options);
|
628 |
};
|
629 |
-
|
630 |
ResizeObserver.prototype.unobserve = function (target) {
|
631 |
if (arguments.length === 0) {
|
632 |
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
633 |
}
|
634 |
-
|
635 |
if (!isElement(target)) {
|
636 |
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
637 |
}
|
638 |
-
|
639 |
ResizeObserverController.unobserve(this, target);
|
640 |
};
|
641 |
-
|
642 |
ResizeObserver.prototype.disconnect = function () {
|
643 |
ResizeObserverController.disconnect(this);
|
644 |
};
|
645 |
-
|
646 |
ResizeObserver.toString = function () {
|
647 |
return 'function ResizeObserver () { [polyfill code] }';
|
648 |
};
|
649 |
-
|
650 |
return ResizeObserver;
|
651 |
}();
|
652 |
|
15 |
};
|
16 |
|
17 |
var msg = 'ResizeObserver loop completed with undelivered notifications.';
|
|
|
18 |
var deliverResizeLoopError = function deliverResizeLoopError() {
|
19 |
var event;
|
|
|
20 |
if (typeof ErrorEvent === 'function') {
|
21 |
event = new ErrorEvent('error', {
|
22 |
message: msg
|
26 |
event.initEvent('error', false, false);
|
27 |
event.message = msg;
|
28 |
}
|
|
|
29 |
window.dispatchEvent(event);
|
30 |
};
|
31 |
|
32 |
var ResizeObserverBoxOptions;
|
|
|
33 |
(function (ResizeObserverBoxOptions) {
|
34 |
ResizeObserverBoxOptions["BORDER_BOX"] = "border-box";
|
35 |
ResizeObserverBoxOptions["CONTENT_BOX"] = "content-box";
|
46 |
this.blockSize = blockSize;
|
47 |
freeze(this);
|
48 |
}
|
|
|
49 |
return ResizeObserverSize;
|
50 |
}();
|
51 |
|
61 |
this.right = this.left + this.width;
|
62 |
return freeze(this);
|
63 |
}
|
|
|
64 |
DOMRectReadOnly.prototype.toJSON = function () {
|
65 |
var _a = this,
|
66 |
+
x = _a.x,
|
67 |
+
y = _a.y,
|
68 |
+
top = _a.top,
|
69 |
+
right = _a.right,
|
70 |
+
bottom = _a.bottom,
|
71 |
+
left = _a.left,
|
72 |
+
width = _a.width,
|
73 |
+
height = _a.height;
|
|
|
74 |
return {
|
75 |
x: x,
|
76 |
y: y,
|
82 |
height: height
|
83 |
};
|
84 |
};
|
|
|
85 |
DOMRectReadOnly.fromRect = function (rectangle) {
|
86 |
return new DOMRectReadOnly(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
|
87 |
};
|
|
|
88 |
return DOMRectReadOnly;
|
89 |
}();
|
90 |
|
91 |
var isSVG = function isSVG(target) {
|
92 |
return target instanceof SVGElement && 'getBBox' in target;
|
93 |
};
|
|
|
94 |
var isHidden = function isHidden(target) {
|
95 |
if (isSVG(target)) {
|
96 |
var _a = target.getBBox(),
|
97 |
+
width = _a.width,
|
98 |
+
height = _a.height;
|
|
|
99 |
return !width && !height;
|
100 |
}
|
|
|
101 |
var _b = target,
|
102 |
+
offsetWidth = _b.offsetWidth,
|
103 |
+
offsetHeight = _b.offsetHeight;
|
104 |
return !(offsetWidth || offsetHeight || target.getClientRects().length);
|
105 |
};
|
|
|
106 |
var isElement = function isElement(obj) {
|
107 |
+
var _a;
|
|
|
108 |
if (obj instanceof Element) {
|
109 |
return true;
|
110 |
}
|
111 |
+
var scope = (_a = obj === null || obj === void 0 ? void 0 : obj.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
|
|
|
112 |
return !!(scope && obj instanceof scope.Element);
|
113 |
};
|
|
|
114 |
var isReplacedElement = function isReplacedElement(target) {
|
115 |
switch (target.tagName) {
|
116 |
case 'INPUT':
|
117 |
if (target.type !== 'image') {
|
118 |
break;
|
119 |
}
|
|
|
120 |
case 'VIDEO':
|
121 |
case 'AUDIO':
|
122 |
case 'EMBED':
|
126 |
case 'IMG':
|
127 |
return true;
|
128 |
}
|
|
|
129 |
return false;
|
130 |
};
|
131 |
|
135 |
var scrollRegexp = /auto|scroll/;
|
136 |
var verticalRegexp = /^tb|vertical/;
|
137 |
var IE = /msie|trident/i.test(global.navigator && global.navigator.userAgent);
|
|
|
138 |
var parseDimension = function parseDimension(pixel) {
|
139 |
return parseFloat(pixel || '0');
|
140 |
};
|
|
|
141 |
var size = function size(inlineSize, blockSize, switchSizes) {
|
142 |
if (inlineSize === void 0) {
|
143 |
inlineSize = 0;
|
144 |
}
|
|
|
145 |
if (blockSize === void 0) {
|
146 |
blockSize = 0;
|
147 |
}
|
|
|
148 |
if (switchSizes === void 0) {
|
149 |
switchSizes = false;
|
150 |
}
|
|
|
151 |
return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
|
152 |
};
|
|
|
153 |
var zeroBoxes = freeze({
|
154 |
devicePixelContentBoxSize: size(),
|
155 |
borderBoxSize: size(),
|
156 |
contentBoxSize: size(),
|
157 |
contentRect: new DOMRectReadOnly(0, 0, 0, 0)
|
158 |
});
|
|
|
159 |
var calculateBoxSizes = function calculateBoxSizes(target, forceRecalculation) {
|
160 |
if (forceRecalculation === void 0) {
|
161 |
forceRecalculation = false;
|
162 |
}
|
|
|
163 |
if (cache.has(target) && !forceRecalculation) {
|
164 |
return cache.get(target);
|
165 |
}
|
|
|
166 |
if (isHidden(target)) {
|
167 |
cache.set(target, zeroBoxes);
|
168 |
return zeroBoxes;
|
169 |
}
|
|
|
170 |
var cs = getComputedStyle(target);
|
171 |
var svg = isSVG(target) && target.ownerSVGElement && target.getBBox();
|
172 |
var removePadding = !IE && cs.boxSizing === 'border-box';
|
202 |
cache.set(target, boxes);
|
203 |
return boxes;
|
204 |
};
|
|
|
205 |
var calculateBoxSize = function calculateBoxSize(target, observedBox, forceRecalculation) {
|
206 |
var _a = calculateBoxSizes(target, forceRecalculation),
|
207 |
+
borderBoxSize = _a.borderBoxSize,
|
208 |
+
contentBoxSize = _a.contentBoxSize,
|
209 |
+
devicePixelContentBoxSize = _a.devicePixelContentBoxSize;
|
|
|
210 |
switch (observedBox) {
|
211 |
case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:
|
212 |
return devicePixelContentBoxSize;
|
|
|
213 |
case ResizeObserverBoxOptions.BORDER_BOX:
|
214 |
return borderBoxSize;
|
|
|
215 |
default:
|
216 |
return contentBoxSize;
|
217 |
}
|
226 |
this.contentBoxSize = freeze([boxes.contentBoxSize]);
|
227 |
this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);
|
228 |
}
|
|
|
229 |
return ResizeObserverEntry;
|
230 |
}();
|
231 |
|
233 |
if (isHidden(node)) {
|
234 |
return Infinity;
|
235 |
}
|
|
|
236 |
var depth = 0;
|
237 |
var parent = node.parentNode;
|
|
|
238 |
while (parent) {
|
239 |
depth += 1;
|
240 |
parent = parent.parentNode;
|
241 |
}
|
|
|
242 |
return depth;
|
243 |
};
|
244 |
|
249 |
if (ro.activeTargets.length === 0) {
|
250 |
return;
|
251 |
}
|
|
|
252 |
var entries = [];
|
253 |
ro.activeTargets.forEach(function processTarget(ot) {
|
254 |
var entry = new ResizeObserverEntry(ot.target);
|
255 |
var targetDepth = calculateDepthForNode(ot.target);
|
256 |
entries.push(entry);
|
257 |
ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);
|
|
|
258 |
if (targetDepth < shallowestDepth) {
|
259 |
shallowestDepth = targetDepth;
|
260 |
}
|
264 |
});
|
265 |
ro.activeTargets.splice(0, ro.activeTargets.length);
|
266 |
});
|
|
|
267 |
for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
|
268 |
var callback = callbacks_1[_i];
|
269 |
callback();
|
270 |
}
|
|
|
271 |
return shallowestDepth;
|
272 |
};
|
273 |
|
290 |
var process = function process() {
|
291 |
var depth = 0;
|
292 |
gatherActiveObservationsAtDepth(depth);
|
|
|
293 |
while (hasActiveObservations()) {
|
294 |
depth = broadcastActiveObservations();
|
295 |
gatherActiveObservationsAtDepth(depth);
|
296 |
}
|
|
|
297 |
if (hasSkippedObservations()) {
|
298 |
deliverResizeLoopError();
|
299 |
}
|
|
|
300 |
return depth > 0;
|
301 |
};
|
302 |
|
303 |
var trigger;
|
304 |
var callbacks = [];
|
|
|
305 |
var notify = function notify() {
|
306 |
return callbacks.splice(0).forEach(function (cb) {
|
307 |
return cb();
|
308 |
});
|
309 |
};
|
|
|
310 |
var queueMicroTask = function queueMicroTask(callback) {
|
311 |
if (!trigger) {
|
312 |
var toggle_1 = 0;
|
317 |
new MutationObserver(function () {
|
318 |
return notify();
|
319 |
}).observe(el_1, config);
|
|
|
320 |
trigger = function trigger() {
|
321 |
+
el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++);
|
322 |
};
|
323 |
}
|
|
|
324 |
callbacks.push(callback);
|
325 |
trigger();
|
326 |
};
|
332 |
};
|
333 |
|
334 |
var watching = 0;
|
|
|
335 |
var isWatching = function isWatching() {
|
336 |
return !!watching;
|
337 |
};
|
|
|
338 |
var CATCH_PERIOD = 250;
|
339 |
var observerConfig = {
|
340 |
attributes: true,
|
343 |
subtree: true
|
344 |
};
|
345 |
var events = ['resize', 'load', 'transitionend', 'animationend', 'animationstart', 'animationiteration', 'keyup', 'keydown', 'mouseup', 'mousedown', 'mouseover', 'mouseout', 'blur', 'focus'];
|
|
|
346 |
var time = function time(timeout) {
|
347 |
if (timeout === void 0) {
|
348 |
timeout = 0;
|
349 |
}
|
|
|
350 |
return Date.now() + timeout;
|
351 |
};
|
|
|
352 |
var scheduled = false;
|
|
|
353 |
var Scheduler = function () {
|
354 |
function Scheduler() {
|
355 |
var _this = this;
|
|
|
356 |
this.stopped = true;
|
|
|
357 |
this.listener = function () {
|
358 |
return _this.schedule();
|
359 |
};
|
360 |
}
|
|
|
361 |
Scheduler.prototype.run = function (timeout) {
|
362 |
var _this = this;
|
|
|
363 |
if (timeout === void 0) {
|
364 |
timeout = CATCH_PERIOD;
|
365 |
}
|
|
|
366 |
if (scheduled) {
|
367 |
return;
|
368 |
}
|
|
|
369 |
scheduled = true;
|
370 |
var until = time(timeout);
|
371 |
queueResizeObserver(function () {
|
372 |
var elementsHaveResized = false;
|
|
|
373 |
try {
|
374 |
elementsHaveResized = process();
|
375 |
} finally {
|
376 |
scheduled = false;
|
377 |
timeout = until - time();
|
|
|
378 |
if (!isWatching()) {
|
379 |
return;
|
380 |
}
|
|
|
381 |
if (elementsHaveResized) {
|
382 |
_this.run(1000);
|
383 |
} else if (timeout > 0) {
|
388 |
}
|
389 |
});
|
390 |
};
|
|
|
391 |
Scheduler.prototype.schedule = function () {
|
392 |
this.stop();
|
393 |
this.run();
|
394 |
};
|
|
|
395 |
Scheduler.prototype.observe = function () {
|
396 |
var _this = this;
|
|
|
397 |
var cb = function cb() {
|
398 |
return _this.observer && _this.observer.observe(document.body, observerConfig);
|
399 |
};
|
|
|
400 |
document.body ? cb() : global.addEventListener('DOMContentLoaded', cb);
|
401 |
};
|
|
|
402 |
Scheduler.prototype.start = function () {
|
403 |
var _this = this;
|
|
|
404 |
if (this.stopped) {
|
405 |
this.stopped = false;
|
406 |
this.observer = new MutationObserver(this.listener);
|
410 |
});
|
411 |
}
|
412 |
};
|
|
|
413 |
Scheduler.prototype.stop = function () {
|
414 |
var _this = this;
|
|
|
415 |
if (!this.stopped) {
|
416 |
this.observer && this.observer.disconnect();
|
417 |
events.forEach(function (name) {
|
420 |
this.stopped = true;
|
421 |
}
|
422 |
};
|
|
|
423 |
return Scheduler;
|
424 |
}();
|
|
|
425 |
var scheduler = new Scheduler();
|
|
|
426 |
var updateCount = function updateCount(n) {
|
427 |
!watching && n > 0 && scheduler.start();
|
428 |
watching += n;
|
432 |
var skipNotifyOnElement = function skipNotifyOnElement(target) {
|
433 |
return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === 'inline';
|
434 |
};
|
|
|
435 |
var ResizeObservation = function () {
|
436 |
function ResizeObservation(target, observedBox) {
|
437 |
this.target = target;
|
441 |
blockSize: 0
|
442 |
};
|
443 |
}
|
|
|
444 |
ResizeObservation.prototype.isActive = function () {
|
445 |
var size = calculateBoxSize(this.target, this.observedBox, true);
|
|
|
446 |
if (skipNotifyOnElement(this.target)) {
|
447 |
this.lastReportedSize = size;
|
448 |
}
|
|
|
449 |
if (this.lastReportedSize.inlineSize !== size.inlineSize || this.lastReportedSize.blockSize !== size.blockSize) {
|
450 |
return true;
|
451 |
}
|
|
|
452 |
return false;
|
453 |
};
|
|
|
454 |
return ResizeObservation;
|
455 |
}();
|
456 |
|
462 |
this.observer = resizeObserver;
|
463 |
this.callback = callback;
|
464 |
}
|
|
|
465 |
return ResizeObserverDetail;
|
466 |
}();
|
467 |
|
468 |
var observerMap = new WeakMap();
|
|
|
469 |
var getObservationIndex = function getObservationIndex(observationTargets, target) {
|
470 |
for (var i = 0; i < observationTargets.length; i += 1) {
|
471 |
if (observationTargets[i].target === target) {
|
472 |
return i;
|
473 |
}
|
474 |
}
|
|
|
475 |
return -1;
|
476 |
};
|
|
|
477 |
var ResizeObserverController = function () {
|
478 |
function ResizeObserverController() {}
|
|
|
479 |
ResizeObserverController.connect = function (resizeObserver, callback) {
|
480 |
var detail = new ResizeObserverDetail(resizeObserver, callback);
|
481 |
observerMap.set(resizeObserver, detail);
|
482 |
};
|
|
|
483 |
ResizeObserverController.observe = function (resizeObserver, target, options) {
|
484 |
var detail = observerMap.get(resizeObserver);
|
485 |
var firstObservation = detail.observationTargets.length === 0;
|
|
|
486 |
if (getObservationIndex(detail.observationTargets, target) < 0) {
|
487 |
firstObservation && resizeObservers.push(detail);
|
488 |
detail.observationTargets.push(new ResizeObservation(target, options && options.box));
|
490 |
scheduler.schedule();
|
491 |
}
|
492 |
};
|
|
|
493 |
ResizeObserverController.unobserve = function (resizeObserver, target) {
|
494 |
var detail = observerMap.get(resizeObserver);
|
495 |
var index = getObservationIndex(detail.observationTargets, target);
|
496 |
var lastObservation = detail.observationTargets.length === 1;
|
|
|
497 |
if (index >= 0) {
|
498 |
lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1);
|
499 |
detail.observationTargets.splice(index, 1);
|
500 |
updateCount(-1);
|
501 |
}
|
502 |
};
|
|
|
503 |
ResizeObserverController.disconnect = function (resizeObserver) {
|
504 |
var _this = this;
|
|
|
505 |
var detail = observerMap.get(resizeObserver);
|
506 |
detail.observationTargets.slice().forEach(function (ot) {
|
507 |
return _this.unobserve(resizeObserver, ot.target);
|
508 |
});
|
509 |
detail.activeTargets.splice(0, detail.activeTargets.length);
|
510 |
};
|
|
|
511 |
return ResizeObserverController;
|
512 |
}();
|
513 |
|
516 |
if (arguments.length === 0) {
|
517 |
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
|
518 |
}
|
|
|
519 |
if (typeof callback !== 'function') {
|
520 |
throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
|
521 |
}
|
|
|
522 |
ResizeObserverController.connect(this, callback);
|
523 |
}
|
|
|
524 |
ResizeObserver.prototype.observe = function (target, options) {
|
525 |
if (arguments.length === 0) {
|
526 |
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
527 |
}
|
|
|
528 |
if (!isElement(target)) {
|
529 |
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
530 |
}
|
|
|
531 |
ResizeObserverController.observe(this, target, options);
|
532 |
};
|
|
|
533 |
ResizeObserver.prototype.unobserve = function (target) {
|
534 |
if (arguments.length === 0) {
|
535 |
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
536 |
}
|
|
|
537 |
if (!isElement(target)) {
|
538 |
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
539 |
}
|
|
|
540 |
ResizeObserverController.unobserve(this, target);
|
541 |
};
|
|
|
542 |
ResizeObserver.prototype.disconnect = function () {
|
543 |
ResizeObserverController.disconnect(this);
|
544 |
};
|
|
|
545 |
ResizeObserver.toString = function () {
|
546 |
return 'function ResizeObserver () { [polyfill code] }';
|
547 |
};
|
|
|
548 |
return ResizeObserver;
|
549 |
}();
|
550 |
|
dist/components/cjs/{tutor-2302fd34.js → tutor-789803e8.js}
RENAMED
@@ -4,11 +4,9 @@ function tutor (player) {
|
|
4 |
// autoload course content
|
5 |
var autoload_content = function autoload_content() {
|
6 |
var _tutorobject2, _tutorobject3;
|
7 |
-
|
8 |
if (!_tutorobject.nonce_key || !((_tutorobject2 = _tutorobject) !== null && _tutorobject2 !== void 0 && _tutorobject2.ajaxurl)) {
|
9 |
return;
|
10 |
}
|
11 |
-
|
12 |
var post_id = getVideoData().post_id;
|
13 |
var data = {
|
14 |
action: 'autoload_next_course_content',
|
@@ -17,17 +15,15 @@ function tutor (player) {
|
|
17 |
data[_tutorobject.nonce_key] = _tutorobject[_tutorobject.nonce_key];
|
18 |
jQuery.post((_tutorobject3 = _tutorobject) === null || _tutorobject3 === void 0 ? void 0 : _tutorobject3.ajaxurl, data).done(function (response) {
|
19 |
var _response$data;
|
20 |
-
|
21 |
if (response !== null && response !== void 0 && response.success && response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.next_url) {
|
22 |
location.href = response.data.next_url;
|
23 |
}
|
24 |
});
|
25 |
-
};
|
26 |
-
|
27 |
|
|
|
28 |
var sync_time = function sync_time(instance, options) {
|
29 |
var _tutorobject4;
|
30 |
-
|
31 |
var post_id = getVideoData().post_id;
|
32 |
var data = {
|
33 |
action: 'sync_video_playback',
|
@@ -37,36 +33,32 @@ function tutor (player) {
|
|
37 |
};
|
38 |
data[_tutorobject.nonce_key] = _tutorobject[_tutorobject.nonce_key];
|
39 |
var data_send = data;
|
40 |
-
|
41 |
if (options) {
|
42 |
data_send = Object.assign(data, options);
|
43 |
}
|
44 |
-
|
45 |
jQuery.post((_tutorobject4 = _tutorobject) === null || _tutorobject4 === void 0 ? void 0 : _tutorobject4.ajaxurl, data_send);
|
46 |
-
};
|
47 |
-
|
48 |
|
|
|
49 |
var getVideoData = function getVideoData() {
|
50 |
var video_track_data = jQuery('#tutor_video_tracking_information').val();
|
51 |
return video_track_data ? JSON.parse(video_track_data) : {};
|
52 |
-
};
|
53 |
-
|
54 |
|
|
|
55 |
var tempTimeNow = 0;
|
56 |
var intervalSeconds = 30; //Send to tutor backend about video playing time in this interval
|
57 |
-
|
58 |
player.on('timeupdate', function (event) {
|
59 |
var instance = event.detail.plyr;
|
60 |
var tempTimeNowInSec = tempTimeNow / 4; //timeupdate firing 250ms interval
|
61 |
-
|
62 |
if (tempTimeNowInSec >= intervalSeconds) {
|
63 |
sync_time(instance);
|
64 |
tempTimeNow = 0;
|
65 |
}
|
66 |
-
|
67 |
tempTimeNow++;
|
68 |
-
});
|
69 |
|
|
|
70 |
player.on('ended', function (event) {
|
71 |
var video_data = getVideoData();
|
72 |
var instance = event.detail.plyr;
|
@@ -74,7 +66,6 @@ function tutor (player) {
|
|
74 |
is_ended: true
|
75 |
};
|
76 |
sync_time(instance, data);
|
77 |
-
|
78 |
if (video_data.autoload_next_course_content) {
|
79 |
autoload_content();
|
80 |
}
|
4 |
// autoload course content
|
5 |
var autoload_content = function autoload_content() {
|
6 |
var _tutorobject2, _tutorobject3;
|
|
|
7 |
if (!_tutorobject.nonce_key || !((_tutorobject2 = _tutorobject) !== null && _tutorobject2 !== void 0 && _tutorobject2.ajaxurl)) {
|
8 |
return;
|
9 |
}
|
|
|
10 |
var post_id = getVideoData().post_id;
|
11 |
var data = {
|
12 |
action: 'autoload_next_course_content',
|
15 |
data[_tutorobject.nonce_key] = _tutorobject[_tutorobject.nonce_key];
|
16 |
jQuery.post((_tutorobject3 = _tutorobject) === null || _tutorobject3 === void 0 ? void 0 : _tutorobject3.ajaxurl, data).done(function (response) {
|
17 |
var _response$data;
|
|
|
18 |
if (response !== null && response !== void 0 && response.success && response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.next_url) {
|
19 |
location.href = response.data.next_url;
|
20 |
}
|
21 |
});
|
22 |
+
};
|
|
|
23 |
|
24 |
+
// sync time with server
|
25 |
var sync_time = function sync_time(instance, options) {
|
26 |
var _tutorobject4;
|
|
|
27 |
var post_id = getVideoData().post_id;
|
28 |
var data = {
|
29 |
action: 'sync_video_playback',
|
33 |
};
|
34 |
data[_tutorobject.nonce_key] = _tutorobject[_tutorobject.nonce_key];
|
35 |
var data_send = data;
|
|
|
36 |
if (options) {
|
37 |
data_send = Object.assign(data, options);
|
38 |
}
|
|
|
39 |
jQuery.post((_tutorobject4 = _tutorobject) === null || _tutorobject4 === void 0 ? void 0 : _tutorobject4.ajaxurl, data_send);
|
40 |
+
};
|
|
|
41 |
|
42 |
+
// get video data
|
43 |
var getVideoData = function getVideoData() {
|
44 |
var video_track_data = jQuery('#tutor_video_tracking_information').val();
|
45 |
return video_track_data ? JSON.parse(video_track_data) : {};
|
46 |
+
};
|
|
|
47 |
|
48 |
+
// update time on server every 250ms
|
49 |
var tempTimeNow = 0;
|
50 |
var intervalSeconds = 30; //Send to tutor backend about video playing time in this interval
|
|
|
51 |
player.on('timeupdate', function (event) {
|
52 |
var instance = event.detail.plyr;
|
53 |
var tempTimeNowInSec = tempTimeNow / 4; //timeupdate firing 250ms interval
|
|
|
54 |
if (tempTimeNowInSec >= intervalSeconds) {
|
55 |
sync_time(instance);
|
56 |
tempTimeNow = 0;
|
57 |
}
|
|
|
58 |
tempTimeNow++;
|
59 |
+
});
|
60 |
|
61 |
+
// on end, sync time and autoload content
|
62 |
player.on('ended', function (event) {
|
63 |
var video_data = getVideoData();
|
64 |
var instance = event.detail.plyr;
|
66 |
is_ended: true
|
67 |
};
|
68 |
sync_time(instance, data);
|
|
|
69 |
if (video_data.autoload_next_course_content) {
|
70 |
autoload_content();
|
71 |
}
|
dist/components/cjs/web-components.cjs.js
CHANGED
@@ -1,19 +1,16 @@
|
|
1 |
'use strict';
|
2 |
|
3 |
-
const index = require('./index-
|
4 |
|
5 |
/*
|
6 |
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
7 |
*/
|
8 |
-
|
9 |
var patchBrowser = function patchBrowser() {
|
10 |
var importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('web-components.cjs.js', document.baseURI).href));
|
11 |
var opts = {};
|
12 |
-
|
13 |
if (importMeta !== '') {
|
14 |
opts.resourcesUrl = new URL('.', importMeta).href;
|
15 |
}
|
16 |
-
|
17 |
return index.promiseResolve(opts);
|
18 |
};
|
19 |
|
1 |
'use strict';
|
2 |
|
3 |
+
const index = require('./index-7c213f46.js');
|
4 |
|
5 |
/*
|
6 |
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
7 |
*/
|
|
|
8 |
var patchBrowser = function patchBrowser() {
|
9 |
var importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('web-components.cjs.js', document.baseURI).href));
|
10 |
var opts = {};
|
|
|
11 |
if (importMeta !== '') {
|
12 |
opts.resourcesUrl = new URL('.', importMeta).href;
|
13 |
}
|
|
|
14 |
return index.promiseResolve(opts);
|
15 |
};
|
16 |
|
dist/components/collection/components/core/features/presto-email-overlay/controller/presto-email-overlay-controller.js
CHANGED
@@ -81,7 +81,7 @@ export class PrestoEmailOverlayController {
|
|
81 |
try {
|
82 |
let response = await fetch((_a = window === null || window === void 0 ? void 0 : window.prestoPlayer) === null || _a === void 0 ? void 0 : _a.ajaxurl, {
|
83 |
method: 'post',
|
84 |
-
body: new URLSearchParams(Object.assign({ action: 'presto_player_email_submit', nonce, preset_id: this.presetId, video_id: this.videoId }, ((e === null || e === void 0 ? void 0 : e.detail) || {}))),
|
85 |
});
|
86 |
const { success, data } = await response.json();
|
87 |
if (success) {
|
81 |
try {
|
82 |
let response = await fetch((_a = window === null || window === void 0 ? void 0 : window.prestoPlayer) === null || _a === void 0 ? void 0 : _a.ajaxurl, {
|
83 |
method: 'post',
|
84 |
+
body: new URLSearchParams(Object.assign({ action: 'presto_player_email_submit', nonce, preset_id: this.presetId, video_id: this.videoId, provider: this.provider }, ((e === null || e === void 0 ? void 0 : e.detail) || {}))),
|
85 |
});
|
86 |
const { success, data } = await response.json();
|
87 |
if (success) {
|
dist/components/collection/components/core/player/presto-player.css
CHANGED
@@ -156,10 +156,8 @@
|
|
156 |
outline: 0;
|
157 |
}
|
158 |
.plyr__control.plyr__tab-focus {
|
159 |
-
outline
|
160 |
outline-offset: 2px;
|
161 |
-
outline-style: dotted;
|
162 |
-
outline-width: 3px;
|
163 |
}
|
164 |
|
165 |
a.plyr__control {
|
@@ -240,7 +238,7 @@ a.plyr__control::after, a.plyr__control::before {
|
|
240 |
.plyr__menu__container {
|
241 |
animation: plyr-popup 0.2s ease;
|
242 |
background: var(--plyr-menu-background, rgba(255, 255, 255, 0.9));
|
243 |
-
border-radius: 4px;
|
244 |
bottom: 100%;
|
245 |
box-shadow: var(--plyr-menu-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));
|
246 |
color: var(--plyr-menu-color, #4a5464);
|
@@ -282,10 +280,7 @@ a.plyr__control::after, a.plyr__control::before {
|
|
282 |
color: var(--plyr-menu-color, #4a5464);
|
283 |
display: flex;
|
284 |
font-size: var(--plyr-font-size-menu, var(--plyr-font-size-small, 13px));
|
285 |
-
padding
|
286 |
-
padding-left: calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5);
|
287 |
-
padding-right: calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5);
|
288 |
-
padding-top: calc(calc(var(--plyr-control-spacing, 10px) * 0.7) / 1.5);
|
289 |
user-select: none;
|
290 |
width: 100%;
|
291 |
}
|
@@ -379,15 +374,14 @@ a.plyr__control::after, a.plyr__control::before {
|
|
379 |
align-items: center;
|
380 |
display: flex;
|
381 |
margin-left: auto;
|
382 |
-
margin-right: calc((calc(var(--plyr-control-spacing, 10px) * 0.7) -
|
383 |
overflow: hidden;
|
384 |
padding-left: calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 3.5);
|
385 |
pointer-events: none;
|
386 |
}
|
387 |
|
388 |
.plyr--full-ui input[type=range] {
|
389 |
-
|
390 |
-
/* stylelint-disable-line */
|
391 |
background: transparent;
|
392 |
border: 0;
|
393 |
border-radius: calc(var(--plyr-range-thumb-height, 13px) * 2);
|
@@ -418,8 +412,7 @@ a.plyr__control::after, a.plyr__control::before {
|
|
418 |
position: relative;
|
419 |
transition: all 0.2s ease;
|
420 |
width: var(--plyr-range-thumb-height, 13px);
|
421 |
-
|
422 |
-
/* stylelint-disable-line */
|
423 |
margin-top: calc((var(--plyr-range-thumb-height, 13px) - var(--plyr-range-track-height, 5px)) / 2 * -1);
|
424 |
}
|
425 |
.plyr--full-ui input[type=range]::-moz-range-track {
|
@@ -485,29 +478,23 @@ a.plyr__control::after, a.plyr__control::before {
|
|
485 |
.plyr--full-ui input[type=range]::-ms-tooltip {
|
486 |
display: none;
|
487 |
}
|
488 |
-
.plyr--full-ui input[type=range]:focus {
|
489 |
-
outline: 0;
|
490 |
-
}
|
491 |
.plyr--full-ui input[type=range]::-moz-focus-outer {
|
492 |
border: 0;
|
493 |
}
|
|
|
|
|
|
|
494 |
.plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track {
|
495 |
-
outline
|
496 |
outline-offset: 2px;
|
497 |
-
outline-style: dotted;
|
498 |
-
outline-width: 3px;
|
499 |
}
|
500 |
.plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track {
|
501 |
-
outline
|
502 |
outline-offset: 2px;
|
503 |
-
outline-style: dotted;
|
504 |
-
outline-width: 3px;
|
505 |
}
|
506 |
.plyr--full-ui input[type=range].plyr__tab-focus::-ms-track {
|
507 |
-
outline
|
508 |
outline-offset: 2px;
|
509 |
-
outline-style: dotted;
|
510 |
-
outline-width: 3px;
|
511 |
}
|
512 |
|
513 |
.plyr__poster {
|
@@ -547,9 +534,10 @@ a.plyr__control::after, a.plyr__control::before {
|
|
547 |
}
|
548 |
}
|
549 |
|
|
|
550 |
.plyr__tooltip {
|
551 |
background: var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));
|
552 |
-
border-radius: var(--plyr-tooltip-radius,
|
553 |
bottom: 100%;
|
554 |
box-shadow: var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));
|
555 |
color: var(--plyr-tooltip-color, #4a5464);
|
@@ -642,8 +630,9 @@ a.plyr__control::after, a.plyr__control::before {
|
|
642 |
z-index: 2;
|
643 |
}
|
644 |
.plyr__progress .plyr__tooltip {
|
645 |
-
font-size: var(--plyr-font-size-time, var(--plyr-font-size-small, 13px));
|
646 |
left: 0;
|
|
|
|
|
647 |
}
|
648 |
|
649 |
.plyr__progress__buffer {
|
@@ -695,6 +684,17 @@ a.plyr__control::after, a.plyr__control::before {
|
|
695 |
background-color: var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6));
|
696 |
}
|
697 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
698 |
.plyr__volume {
|
699 |
align-items: center;
|
700 |
display: flex;
|
@@ -912,84 +912,6 @@ a.plyr__control::after, a.plyr__control::before {
|
|
912 |
}
|
913 |
}
|
914 |
|
915 |
-
/* stylelint-disable-next-line */
|
916 |
-
.plyr:-webkit-full-screen {
|
917 |
-
background: #000;
|
918 |
-
border-radius: 0 !important;
|
919 |
-
height: 100%;
|
920 |
-
margin: 0;
|
921 |
-
width: 100%;
|
922 |
-
}
|
923 |
-
.plyr:-webkit-full-screen video {
|
924 |
-
height: 100%;
|
925 |
-
}
|
926 |
-
.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen {
|
927 |
-
display: block;
|
928 |
-
}
|
929 |
-
.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen + svg {
|
930 |
-
display: none;
|
931 |
-
}
|
932 |
-
.plyr:-webkit-full-screen.plyr--hide-controls {
|
933 |
-
cursor: none;
|
934 |
-
}
|
935 |
-
@media (min-width: 1024px) {
|
936 |
-
.plyr:-webkit-full-screen .plyr__captions {
|
937 |
-
font-size: var(--plyr-font-size-xlarge, 21px);
|
938 |
-
}
|
939 |
-
}
|
940 |
-
|
941 |
-
/* stylelint-disable-next-line */
|
942 |
-
.plyr:-moz-full-screen {
|
943 |
-
background: #000;
|
944 |
-
border-radius: 0 !important;
|
945 |
-
height: 100%;
|
946 |
-
margin: 0;
|
947 |
-
width: 100%;
|
948 |
-
}
|
949 |
-
.plyr:-moz-full-screen video {
|
950 |
-
height: 100%;
|
951 |
-
}
|
952 |
-
.plyr:-moz-full-screen .plyr__control .icon--exit-fullscreen {
|
953 |
-
display: block;
|
954 |
-
}
|
955 |
-
.plyr:-moz-full-screen .plyr__control .icon--exit-fullscreen + svg {
|
956 |
-
display: none;
|
957 |
-
}
|
958 |
-
.plyr:-moz-full-screen.plyr--hide-controls {
|
959 |
-
cursor: none;
|
960 |
-
}
|
961 |
-
@media (min-width: 1024px) {
|
962 |
-
.plyr:-moz-full-screen .plyr__captions {
|
963 |
-
font-size: var(--plyr-font-size-xlarge, 21px);
|
964 |
-
}
|
965 |
-
}
|
966 |
-
|
967 |
-
/* stylelint-disable-next-line */
|
968 |
-
.plyr:-ms-fullscreen {
|
969 |
-
background: #000;
|
970 |
-
border-radius: 0 !important;
|
971 |
-
height: 100%;
|
972 |
-
margin: 0;
|
973 |
-
width: 100%;
|
974 |
-
}
|
975 |
-
.plyr:-ms-fullscreen video {
|
976 |
-
height: 100%;
|
977 |
-
}
|
978 |
-
.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen {
|
979 |
-
display: block;
|
980 |
-
}
|
981 |
-
.plyr:-ms-fullscreen .plyr__control .icon--exit-fullscreen + svg {
|
982 |
-
display: none;
|
983 |
-
}
|
984 |
-
.plyr:-ms-fullscreen.plyr--hide-controls {
|
985 |
-
cursor: none;
|
986 |
-
}
|
987 |
-
@media (min-width: 1024px) {
|
988 |
-
.plyr:-ms-fullscreen .plyr__captions {
|
989 |
-
font-size: var(--plyr-font-size-xlarge, 21px);
|
990 |
-
}
|
991 |
-
}
|
992 |
-
|
993 |
.plyr--fullscreen-fallback {
|
994 |
background: #000;
|
995 |
border-radius: 0 !important;
|
@@ -1061,22 +983,22 @@ a.plyr__control::after, a.plyr__control::before {
|
|
1061 |
display: block;
|
1062 |
height: var(--plyr-range-track-height, 5px);
|
1063 |
left: 0;
|
1064 |
-
margin: -var(--plyr-range-track-height, 5px)/2 0 0;
|
1065 |
opacity: 0.8;
|
1066 |
position: absolute;
|
1067 |
top: 50%;
|
|
|
1068 |
width: 3px;
|
1069 |
z-index: 3;
|
1070 |
}
|
1071 |
|
1072 |
.plyr__preview-thumb {
|
1073 |
background-color: var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));
|
1074 |
-
border-radius:
|
1075 |
bottom: 100%;
|
1076 |
box-shadow: var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));
|
1077 |
margin-bottom: calc(calc(var(--plyr-control-spacing, 10px) / 2) * 2);
|
1078 |
opacity: 0;
|
1079 |
-
padding:
|
1080 |
pointer-events: none;
|
1081 |
position: absolute;
|
1082 |
transform: translate(0, 10px) scale(0.8);
|
@@ -1095,7 +1017,7 @@ a.plyr__control::after, a.plyr__control::before {
|
|
1095 |
bottom: calc(var(--plyr-tooltip-arrow-size, 4px) * -1);
|
1096 |
content: "";
|
1097 |
height: 0;
|
1098 |
-
left: 50
|
1099 |
position: absolute;
|
1100 |
transform: translateX(-50%);
|
1101 |
width: 0;
|
@@ -1103,34 +1025,43 @@ a.plyr__control::after, a.plyr__control::before {
|
|
1103 |
}
|
1104 |
.plyr__preview-thumb__image-container {
|
1105 |
background: #c1c8d1;
|
1106 |
-
border-radius: calc(var(--plyr-tooltip-radius,
|
1107 |
overflow: hidden;
|
1108 |
position: relative;
|
1109 |
z-index: 0;
|
1110 |
}
|
1111 |
-
.plyr__preview-thumb__image-container img {
|
1112 |
height: 100%;
|
1113 |
left: 0;
|
1114 |
-
max-height: none;
|
1115 |
-
max-width: none;
|
1116 |
position: absolute;
|
1117 |
top: 0;
|
1118 |
width: 100%;
|
1119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1120 |
.plyr__preview-thumb__time-container {
|
1121 |
-
|
|
|
|
|
|
|
1122 |
left: 0;
|
|
|
|
|
1123 |
position: absolute;
|
1124 |
right: 0;
|
1125 |
-
white-space: nowrap;
|
1126 |
z-index: 3;
|
1127 |
}
|
1128 |
.plyr__preview-thumb__time-container span {
|
1129 |
-
background-color: rgba(0, 0, 0, 0.55);
|
1130 |
-
border-radius: calc(var(--plyr-tooltip-radius, 3px) - 1px);
|
1131 |
color: #fff;
|
1132 |
font-size: var(--plyr-font-size-time, var(--plyr-font-size-small, 13px));
|
1133 |
-
padding: 3px 6px;
|
1134 |
}
|
1135 |
|
1136 |
.plyr__preview-scrubbing {
|
156 |
outline: 0;
|
157 |
}
|
158 |
.plyr__control.plyr__tab-focus {
|
159 |
+
outline: var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b3ff))) dotted 3px;
|
160 |
outline-offset: 2px;
|
|
|
|
|
161 |
}
|
162 |
|
163 |
a.plyr__control {
|
238 |
.plyr__menu__container {
|
239 |
animation: plyr-popup 0.2s ease;
|
240 |
background: var(--plyr-menu-background, rgba(255, 255, 255, 0.9));
|
241 |
+
border-radius: var(--plyr-menu-radius, 4px);
|
242 |
bottom: 100%;
|
243 |
box-shadow: var(--plyr-menu-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));
|
244 |
color: var(--plyr-menu-color, #4a5464);
|
280 |
color: var(--plyr-menu-color, #4a5464);
|
281 |
display: flex;
|
282 |
font-size: var(--plyr-font-size-menu, var(--plyr-font-size-small, 13px));
|
283 |
+
padding: calc(calc(var(--plyr-control-spacing, 10px) * 0.7) / 1.5) calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5);
|
|
|
|
|
|
|
284 |
user-select: none;
|
285 |
width: 100%;
|
286 |
}
|
374 |
align-items: center;
|
375 |
display: flex;
|
376 |
margin-left: auto;
|
377 |
+
margin-right: calc((calc(var(--plyr-control-spacing, 10px) * 0.7) - 2px) * -1);
|
378 |
overflow: hidden;
|
379 |
padding-left: calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 3.5);
|
380 |
pointer-events: none;
|
381 |
}
|
382 |
|
383 |
.plyr--full-ui input[type=range] {
|
384 |
+
appearance: none;
|
|
|
385 |
background: transparent;
|
386 |
border: 0;
|
387 |
border-radius: calc(var(--plyr-range-thumb-height, 13px) * 2);
|
412 |
position: relative;
|
413 |
transition: all 0.2s ease;
|
414 |
width: var(--plyr-range-thumb-height, 13px);
|
415 |
+
appearance: none;
|
|
|
416 |
margin-top: calc((var(--plyr-range-thumb-height, 13px) - var(--plyr-range-track-height, 5px)) / 2 * -1);
|
417 |
}
|
418 |
.plyr--full-ui input[type=range]::-moz-range-track {
|
478 |
.plyr--full-ui input[type=range]::-ms-tooltip {
|
479 |
display: none;
|
480 |
}
|
|
|
|
|
|
|
481 |
.plyr--full-ui input[type=range]::-moz-focus-outer {
|
482 |
border: 0;
|
483 |
}
|
484 |
+
.plyr--full-ui input[type=range]:focus {
|
485 |
+
outline: 0;
|
486 |
+
}
|
487 |
.plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track {
|
488 |
+
outline: var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b3ff))) dotted 3px;
|
489 |
outline-offset: 2px;
|
|
|
|
|
490 |
}
|
491 |
.plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track {
|
492 |
+
outline: var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b3ff))) dotted 3px;
|
493 |
outline-offset: 2px;
|
|
|
|
|
494 |
}
|
495 |
.plyr--full-ui input[type=range].plyr__tab-focus::-ms-track {
|
496 |
+
outline: var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b3ff))) dotted 3px;
|
497 |
outline-offset: 2px;
|
|
|
|
|
498 |
}
|
499 |
|
500 |
.plyr__poster {
|
534 |
}
|
535 |
}
|
536 |
|
537 |
+
/* stylelint-disable selector-max-compound-selectors */
|
538 |
.plyr__tooltip {
|
539 |
background: var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));
|
540 |
+
border-radius: var(--plyr-tooltip-radius, 5px);
|
541 |
bottom: 100%;
|
542 |
box-shadow: var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));
|
543 |
color: var(--plyr-tooltip-color, #4a5464);
|
630 |
z-index: 2;
|
631 |
}
|
632 |
.plyr__progress .plyr__tooltip {
|
|
|
633 |
left: 0;
|
634 |
+
max-width: 120px;
|
635 |
+
overflow-wrap: break-word;
|
636 |
}
|
637 |
|
638 |
.plyr__progress__buffer {
|
684 |
background-color: var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6));
|
685 |
}
|
686 |
|
687 |
+
.plyr__progress__marker {
|
688 |
+
background-color: var(--plyr-progress-marker-background, #fff);
|
689 |
+
border-radius: 1px;
|
690 |
+
height: var(--plyr-range-track-height, 5px);
|
691 |
+
position: absolute;
|
692 |
+
top: 50%;
|
693 |
+
transform: translate(-50%, -50%);
|
694 |
+
width: var(--plyr-progress-marker-width, 3px);
|
695 |
+
z-index: 3;
|
696 |
+
}
|
697 |
+
|
698 |
.plyr__volume {
|
699 |
align-items: center;
|
700 |
display: flex;
|
912 |
}
|
913 |
}
|
914 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
915 |
.plyr--fullscreen-fallback {
|
916 |
background: #000;
|
917 |
border-radius: 0 !important;
|
983 |
display: block;
|
984 |
height: var(--plyr-range-track-height, 5px);
|
985 |
left: 0;
|
|
|
986 |
opacity: 0.8;
|
987 |
position: absolute;
|
988 |
top: 50%;
|
989 |
+
transform: translateY(-50%);
|
990 |
width: 3px;
|
991 |
z-index: 3;
|
992 |
}
|
993 |
|
994 |
.plyr__preview-thumb {
|
995 |
background-color: var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));
|
996 |
+
border-radius: var(--plyr-tooltip-radius, 5px);
|
997 |
bottom: 100%;
|
998 |
box-shadow: var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));
|
999 |
margin-bottom: calc(calc(var(--plyr-control-spacing, 10px) / 2) * 2);
|
1000 |
opacity: 0;
|
1001 |
+
padding: 3px;
|
1002 |
pointer-events: none;
|
1003 |
position: absolute;
|
1004 |
transform: translate(0, 10px) scale(0.8);
|
1017 |
bottom: calc(var(--plyr-tooltip-arrow-size, 4px) * -1);
|
1018 |
content: "";
|
1019 |
height: 0;
|
1020 |
+
left: calc(50% + var(--preview-arrow-offset));
|
1021 |
position: absolute;
|
1022 |
transform: translateX(-50%);
|
1023 |
width: 0;
|
1025 |
}
|
1026 |
.plyr__preview-thumb__image-container {
|
1027 |
background: #c1c8d1;
|
1028 |
+
border-radius: calc(var(--plyr-tooltip-radius, 5px) - 1px);
|
1029 |
overflow: hidden;
|
1030 |
position: relative;
|
1031 |
z-index: 0;
|
1032 |
}
|
1033 |
+
.plyr__preview-thumb__image-container img, .plyr__preview-thumb__image-container::after {
|
1034 |
height: 100%;
|
1035 |
left: 0;
|
|
|
|
|
1036 |
position: absolute;
|
1037 |
top: 0;
|
1038 |
width: 100%;
|
1039 |
}
|
1040 |
+
.plyr__preview-thumb__image-container::after {
|
1041 |
+
border-radius: inherit;
|
1042 |
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
|
1043 |
+
content: "";
|
1044 |
+
pointer-events: none;
|
1045 |
+
}
|
1046 |
+
.plyr__preview-thumb__image-container img {
|
1047 |
+
max-height: none;
|
1048 |
+
max-width: none;
|
1049 |
+
}
|
1050 |
.plyr__preview-thumb__time-container {
|
1051 |
+
background: var(--plyr-video-controls-background, linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75)));
|
1052 |
+
border-bottom-left-radius: calc(var(--plyr-tooltip-radius, 5px) - 1px);
|
1053 |
+
border-bottom-right-radius: calc(var(--plyr-tooltip-radius, 5px) - 1px);
|
1054 |
+
bottom: 0;
|
1055 |
left: 0;
|
1056 |
+
line-height: 1.1;
|
1057 |
+
padding: 20px 6px 6px;
|
1058 |
position: absolute;
|
1059 |
right: 0;
|
|
|
1060 |
z-index: 3;
|
1061 |
}
|
1062 |
.plyr__preview-thumb__time-container span {
|
|
|
|
|
1063 |
color: #fff;
|
1064 |
font-size: var(--plyr-font-size-time, var(--plyr-font-size-small, 13px));
|
|
|
1065 |
}
|
1066 |
|
1067 |
.plyr__preview-scrubbing {
|
dist/components/esm/{hls-0acc614b.js → hls-155734cc.js}
RENAMED
@@ -1,15 +1,14 @@
|
|
1 |
-
import {
|
2 |
-
import { P as PrestoPlayer } from './presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-
|
3 |
|
4 |
var loadHLS = function loadHLS(_ref) {
|
5 |
var config = _ref.config,
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
return new Promise( /*#__PURE__*/function () {
|
10 |
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve, reject) {
|
11 |
var _wp, autoStartLoad, hls;
|
12 |
-
|
13 |
return regeneratorRuntime.wrap(function _callee$(_context) {
|
14 |
while (1) {
|
15 |
switch (_context.prev = _context.next) {
|
@@ -18,68 +17,63 @@ var loadHLS = function loadHLS(_ref) {
|
|
18 |
_context.next = 6;
|
19 |
break;
|
20 |
}
|
21 |
-
|
22 |
case 1:
|
23 |
if (window.hasOwnProperty('Hls')) {
|
24 |
_context.next = 6;
|
25 |
break;
|
26 |
}
|
27 |
-
|
28 |
_context.next = 4;
|
29 |
return new Promise(function (resolve) {
|
30 |
return setTimeout(resolve, 50);
|
31 |
});
|
32 |
-
|
33 |
case 4:
|
34 |
_context.next = 1;
|
35 |
break;
|
36 |
-
|
37 |
case 6:
|
38 |
if (!window.Hls.isSupported()) {
|
39 |
_context.next = 16;
|
40 |
break;
|
41 |
}
|
42 |
-
|
43 |
// should we autoload start
|
44 |
autoStartLoad = !['metadata', 'none'].includes(preload); // always autoload in admin for preview
|
45 |
-
|
46 |
if ((_wp = wp) !== null && _wp !== void 0 && _wp.blocks) {
|
47 |
autoStartLoad = true;
|
48 |
-
}
|
49 |
-
|
50 |
|
|
|
51 |
hls = new window.Hls({
|
52 |
autoStartLoad: autoStartLoad
|
53 |
});
|
54 |
-
hls.loadSource(src);
|
55 |
|
|
|
56 |
hls.on(window.Hls.Events.LEVEL_SWITCHED, function (event, data) {
|
57 |
var span = selector.closest('.presto-player__wrapper').querySelector(".plyr__menu__container [data-plyr='quality'][value='0'] span");
|
58 |
-
|
59 |
if (hls.autoLevelEnabled) {
|
60 |
span.innerHTML = "AUTO (".concat(hls.levels[data.level].height, "p)");
|
61 |
} else {
|
62 |
span.innerHTML = "AUTO";
|
63 |
}
|
64 |
-
});
|
|
|
|
|
65 |
// all available video qualities. This is important, in this approach,
|
66 |
// we will have one source on the Plyr player.
|
67 |
-
|
68 |
hls.on(window.Hls.Events.MANIFEST_PARSED, function (event, data) {
|
69 |
// Transform available levels into an array of integers (height values).
|
70 |
var availableQualities = hls.levels.map(function (l) {
|
71 |
return l.height;
|
72 |
});
|
73 |
availableQualities.unshift(0); //prepend 0 to quality array;
|
74 |
-
// do start level
|
75 |
|
|
|
76 |
var startLevel = availableQualities.findIndex(function (qty) {
|
77 |
var _prestoPlayer;
|
78 |
-
|
79 |
return qty === parseInt((_prestoPlayer = prestoPlayer) === null || _prestoPlayer === void 0 ? void 0 : _prestoPlayer.hls_start_level);
|
80 |
});
|
81 |
-
hls.startLevel = startLevel ? startLevel - 1 : 2;
|
82 |
|
|
|
83 |
config.quality = {
|
84 |
default: 0,
|
85 |
options: availableQualities,
|
@@ -97,21 +91,24 @@ var loadHLS = function loadHLS(_ref) {
|
|
97 |
});
|
98 |
}
|
99 |
}
|
100 |
-
};
|
101 |
|
|
|
102 |
hls.attachMedia(selector);
|
103 |
-
window.prestoHLS = hls;
|
104 |
|
|
|
105 |
var player = new PrestoPlayer(selector, _objectSpread2({}, config));
|
106 |
-
player.hls = hls;
|
107 |
|
|
|
108 |
var firstPlay = function firstPlay() {
|
109 |
hls.startLoad(-1);
|
110 |
player.off('waiting', firstPlay);
|
111 |
};
|
|
|
112 |
|
113 |
-
|
114 |
-
|
115 |
player.on('languagechange', function () {
|
116 |
// Caption support is still flaky. See: https://github.com/sampotts/plyr/issues/994
|
117 |
setTimeout(function () {
|
@@ -121,18 +118,14 @@ var loadHLS = function loadHLS(_ref) {
|
|
121 |
return resolve(player);
|
122 |
});
|
123 |
return _context.abrupt("return");
|
124 |
-
|
125 |
case 16:
|
126 |
if (!selector.canPlayType('application/vnd.apple.mpegurl')) {
|
127 |
_context.next = 18;
|
128 |
break;
|
129 |
}
|
130 |
-
|
131 |
return _context.abrupt("return", resolve(new PrestoPlayer(selector, _objectSpread2({}, config))));
|
132 |
-
|
133 |
case 18:
|
134 |
return _context.abrupt("return", resolve(new PrestoPlayer(selector, _objectSpread2({}, config))));
|
135 |
-
|
136 |
case 19:
|
137 |
case "end":
|
138 |
return _context.stop();
|
@@ -140,7 +133,6 @@ var loadHLS = function loadHLS(_ref) {
|
|
140 |
}
|
141 |
}, _callee);
|
142 |
}));
|
143 |
-
|
144 |
return function (_x, _x2) {
|
145 |
return _ref2.apply(this, arguments);
|
146 |
};
|
1 |
+
import { l as _asyncToGenerator, a as _objectSpread2 } from './index-936ae1d6.js';
|
2 |
+
import { P as PrestoPlayer } from './presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-78ff809d.js';
|
3 |
|
4 |
var loadHLS = function loadHLS(_ref) {
|
5 |
var config = _ref.config,
|
6 |
+
selector = _ref.selector,
|
7 |
+
src = _ref.src,
|
8 |
+
preload = _ref.preload;
|
9 |
return new Promise( /*#__PURE__*/function () {
|
10 |
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resolve, reject) {
|
11 |
var _wp, autoStartLoad, hls;
|
|
|
12 |
return regeneratorRuntime.wrap(function _callee$(_context) {
|
13 |
while (1) {
|
14 |
switch (_context.prev = _context.next) {
|
17 |
_context.next = 6;
|
18 |
break;
|
19 |
}
|
|
|
20 |
case 1:
|
21 |
if (window.hasOwnProperty('Hls')) {
|
22 |
_context.next = 6;
|
23 |
break;
|
24 |
}
|
|
|
25 |
_context.next = 4;
|
26 |
return new Promise(function (resolve) {
|
27 |
return setTimeout(resolve, 50);
|
28 |
});
|
|
|
29 |
case 4:
|
30 |
_context.next = 1;
|
31 |
break;
|
|
|
32 |
case 6:
|
33 |
if (!window.Hls.isSupported()) {
|
34 |
_context.next = 16;
|
35 |
break;
|
36 |
}
|
|
|
37 |
// should we autoload start
|
38 |
autoStartLoad = !['metadata', 'none'].includes(preload); // always autoload in admin for preview
|
|
|
39 |
if ((_wp = wp) !== null && _wp !== void 0 && _wp.blocks) {
|
40 |
autoStartLoad = true;
|
41 |
+
}
|
|
|
42 |
|
43 |
+
// maybe don't auto start load depending on performance parameter
|
44 |
hls = new window.Hls({
|
45 |
autoStartLoad: autoStartLoad
|
46 |
});
|
47 |
+
hls.loadSource(src);
|
48 |
|
49 |
+
// update menu container to dynamically display quality
|
50 |
hls.on(window.Hls.Events.LEVEL_SWITCHED, function (event, data) {
|
51 |
var span = selector.closest('.presto-player__wrapper').querySelector(".plyr__menu__container [data-plyr='quality'][value='0'] span");
|
|
|
52 |
if (hls.autoLevelEnabled) {
|
53 |
span.innerHTML = "AUTO (".concat(hls.levels[data.level].height, "p)");
|
54 |
} else {
|
55 |
span.innerHTML = "AUTO";
|
56 |
}
|
57 |
+
});
|
58 |
+
|
59 |
+
// From the m3u8 playlist, hls parses the manifest and returns
|
60 |
// all available video qualities. This is important, in this approach,
|
61 |
// we will have one source on the Plyr player.
|
|
|
62 |
hls.on(window.Hls.Events.MANIFEST_PARSED, function (event, data) {
|
63 |
// Transform available levels into an array of integers (height values).
|
64 |
var availableQualities = hls.levels.map(function (l) {
|
65 |
return l.height;
|
66 |
});
|
67 |
availableQualities.unshift(0); //prepend 0 to quality array;
|
|
|
68 |
|
69 |
+
// do start level
|
70 |
var startLevel = availableQualities.findIndex(function (qty) {
|
71 |
var _prestoPlayer;
|
|
|
72 |
return qty === parseInt((_prestoPlayer = prestoPlayer) === null || _prestoPlayer === void 0 ? void 0 : _prestoPlayer.hls_start_level);
|
73 |
});
|
74 |
+
hls.startLevel = startLevel ? startLevel - 1 : 2;
|
75 |
|
76 |
+
// Add new qualities to option
|
77 |
config.quality = {
|
78 |
default: 0,
|
79 |
options: availableQualities,
|
91 |
});
|
92 |
}
|
93 |
}
|
94 |
+
};
|
95 |
|
96 |
+
// attach media and make our HLS options available globally
|
97 |
hls.attachMedia(selector);
|
98 |
+
window.prestoHLS = hls;
|
99 |
|
100 |
+
// Initialize player
|
101 |
var player = new PrestoPlayer(selector, _objectSpread2({}, config));
|
102 |
+
player.hls = hls;
|
103 |
|
104 |
+
// make sure we start loading on the first play
|
105 |
var firstPlay = function firstPlay() {
|
106 |
hls.startLoad(-1);
|
107 |
player.off('waiting', firstPlay);
|
108 |
};
|
109 |
+
player.on('waiting', firstPlay);
|
110 |
|
111 |
+
// Handle changing captions
|
|
|
112 |
player.on('languagechange', function () {
|
113 |
// Caption support is still flaky. See: https://github.com/sampotts/plyr/issues/994
|
114 |
setTimeout(function () {
|
118 |
return resolve(player);
|
119 |
});
|
120 |
return _context.abrupt("return");
|
|
|
121 |
case 16:
|
122 |
if (!selector.canPlayType('application/vnd.apple.mpegurl')) {
|
123 |
_context.next = 18;
|
124 |
break;
|
125 |
}
|
|
|
126 |
return _context.abrupt("return", resolve(new PrestoPlayer(selector, _objectSpread2({}, config))));
|
|
|
127 |
case 18:
|
128 |
return _context.abrupt("return", resolve(new PrestoPlayer(selector, _objectSpread2({}, config))));
|
|
|
129 |
case 19:
|
130 |
case "end":
|
131 |
return _context.stop();
|
133 |
}
|
134 |
}, _callee);
|
135 |
}));
|
|
|
136 |
return function (_x, _x2) {
|
137 |
return _ref2.apply(this, arguments);
|
138 |
};
|
dist/components/esm/{index-ef535bb5.js → index-936ae1d6.js}
RENAMED
@@ -1,16 +1,13 @@
|
|
1 |
function ownKeys(object, enumerableOnly) {
|
2 |
var keys = Object.keys(object);
|
3 |
-
|
4 |
if (Object.getOwnPropertySymbols) {
|
5 |
var symbols = Object.getOwnPropertySymbols(object);
|
6 |
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
7 |
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
8 |
})), keys.push.apply(keys, symbols);
|
9 |
}
|
10 |
-
|
11 |
return keys;
|
12 |
}
|
13 |
-
|
14 |
function _objectSpread2(target) {
|
15 |
for (var i = 1; i < arguments.length; i++) {
|
16 |
var source = null != arguments[i] ? arguments[i] : {};
|
@@ -20,10 +17,8 @@ function _objectSpread2(target) {
|
|
20 |
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
21 |
});
|
22 |
}
|
23 |
-
|
24 |
return target;
|
25 |
}
|
26 |
-
|
27 |
function _typeof(obj) {
|
28 |
"@babel/helpers - typeof";
|
29 |
|
@@ -33,55 +28,6 @@ function _typeof(obj) {
|
|
33 |
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
34 |
}, _typeof(obj);
|
35 |
}
|
36 |
-
|
37 |
-
function _wrapRegExp() {
|
38 |
-
_wrapRegExp = function (re, groups) {
|
39 |
-
return new BabelRegExp(re, void 0, groups);
|
40 |
-
};
|
41 |
-
|
42 |
-
var _super = RegExp.prototype,
|
43 |
-
_groups = new WeakMap();
|
44 |
-
|
45 |
-
function BabelRegExp(re, flags, groups) {
|
46 |
-
var _this = new RegExp(re, flags);
|
47 |
-
|
48 |
-
return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype);
|
49 |
-
}
|
50 |
-
|
51 |
-
function buildGroups(result, re) {
|
52 |
-
var g = _groups.get(re);
|
53 |
-
|
54 |
-
return Object.keys(g).reduce(function (groups, name) {
|
55 |
-
return groups[name] = result[g[name]], groups;
|
56 |
-
}, Object.create(null));
|
57 |
-
}
|
58 |
-
|
59 |
-
return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) {
|
60 |
-
var result = _super.exec.call(this, str);
|
61 |
-
|
62 |
-
return result && (result.groups = buildGroups(result, this)), result;
|
63 |
-
}, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) {
|
64 |
-
if ("string" == typeof substitution) {
|
65 |
-
var groups = _groups.get(this);
|
66 |
-
|
67 |
-
return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) {
|
68 |
-
return "$" + groups[name];
|
69 |
-
}));
|
70 |
-
}
|
71 |
-
|
72 |
-
if ("function" == typeof substitution) {
|
73 |
-
var _this = this;
|
74 |
-
|
75 |
-
return _super[Symbol.replace].call(this, str, function () {
|
76 |
-
var args = arguments;
|
77 |
-
return "object" != typeof args[args.length - 1] && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args);
|
78 |
-
});
|
79 |
-
}
|
80 |
-
|
81 |
-
return _super[Symbol.replace].call(this, str, substitution);
|
82 |
-
}, _wrapRegExp.apply(this, arguments);
|
83 |
-
}
|
84 |
-
|
85 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
86 |
try {
|
87 |
var info = gen[key](arg);
|
@@ -90,40 +36,33 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
90 |
reject(error);
|
91 |
return;
|
92 |
}
|
93 |
-
|
94 |
if (info.done) {
|
95 |
resolve(value);
|
96 |
} else {
|
97 |
Promise.resolve(value).then(_next, _throw);
|
98 |
}
|
99 |
}
|
100 |
-
|
101 |
function _asyncToGenerator(fn) {
|
102 |
return function () {
|
103 |
var self = this,
|
104 |
-
|
105 |
return new Promise(function (resolve, reject) {
|
106 |
var gen = fn.apply(self, args);
|
107 |
-
|
108 |
function _next(value) {
|
109 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
110 |
}
|
111 |
-
|
112 |
function _throw(err) {
|
113 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
114 |
}
|
115 |
-
|
116 |
_next(undefined);
|
117 |
});
|
118 |
};
|
119 |
}
|
120 |
-
|
121 |
function _classCallCheck(instance, Constructor) {
|
122 |
if (!(instance instanceof Constructor)) {
|
123 |
throw new TypeError("Cannot call a class as a function");
|
124 |
}
|
125 |
}
|
126 |
-
|
127 |
function _defineProperties(target, props) {
|
128 |
for (var i = 0; i < props.length; i++) {
|
129 |
var descriptor = props[i];
|
@@ -133,7 +72,6 @@ function _defineProperties(target, props) {
|
|
133 |
Object.defineProperty(target, descriptor.key, descriptor);
|
134 |
}
|
135 |
}
|
136 |
-
|
137 |
function _createClass(Constructor, protoProps, staticProps) {
|
138 |
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
139 |
if (staticProps) _defineProperties(Constructor, staticProps);
|
@@ -142,7 +80,6 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
142 |
});
|
143 |
return Constructor;
|
144 |
}
|
145 |
-
|
146 |
function _defineProperty(obj, key, value) {
|
147 |
if (key in obj) {
|
148 |
Object.defineProperty(obj, key, {
|
@@ -154,49 +91,41 @@ function _defineProperty(obj, key, value) {
|
|
154 |
} else {
|
155 |
obj[key] = value;
|
156 |
}
|
157 |
-
|
158 |
return obj;
|
159 |
}
|
160 |
-
|
161 |
function _inherits(subClass, superClass) {
|
162 |
if (typeof superClass !== "function" && superClass !== null) {
|
163 |
throw new TypeError("Super expression must either be null or a function");
|
164 |
}
|
165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
Object.defineProperty(subClass, "prototype", {
|
167 |
-
value: Object.create(superClass && superClass.prototype, {
|
168 |
-
constructor: {
|
169 |
-
value: subClass,
|
170 |
-
writable: true,
|
171 |
-
configurable: true
|
172 |
-
}
|
173 |
-
}),
|
174 |
writable: false
|
175 |
});
|
176 |
if (superClass) _setPrototypeOf(subClass, superClass);
|
177 |
}
|
178 |
-
|
179 |
function _getPrototypeOf(o) {
|
180 |
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
181 |
return o.__proto__ || Object.getPrototypeOf(o);
|
182 |
};
|
183 |
return _getPrototypeOf(o);
|
184 |
}
|
185 |
-
|
186 |
function _setPrototypeOf(o, p) {
|
187 |
-
_setPrototypeOf = Object.setPrototypeOf
|
188 |
o.__proto__ = p;
|
189 |
return o;
|
190 |
};
|
191 |
-
|
192 |
return _setPrototypeOf(o, p);
|
193 |
}
|
194 |
-
|
195 |
function _isNativeReflectConstruct() {
|
196 |
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
197 |
if (Reflect.construct.sham) return false;
|
198 |
if (typeof Proxy === "function") return true;
|
199 |
-
|
200 |
try {
|
201 |
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
202 |
return true;
|
@@ -204,10 +133,9 @@ function _isNativeReflectConstruct() {
|
|
204 |
return false;
|
205 |
}
|
206 |
}
|
207 |
-
|
208 |
function _construct(Parent, args, Class) {
|
209 |
if (_isNativeReflectConstruct()) {
|
210 |
-
_construct = Reflect.construct;
|
211 |
} else {
|
212 |
_construct = function _construct(Parent, args, Class) {
|
213 |
var a = [null];
|
@@ -218,34 +146,25 @@ function _construct(Parent, args, Class) {
|
|
218 |
return instance;
|
219 |
};
|
220 |
}
|
221 |
-
|
222 |
return _construct.apply(null, arguments);
|
223 |
}
|
224 |
-
|
225 |
function _isNativeFunction(fn) {
|
226 |
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
227 |
}
|
228 |
-
|
229 |
function _wrapNativeSuper(Class) {
|
230 |
var _cache = typeof Map === "function" ? new Map() : undefined;
|
231 |
-
|
232 |
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
233 |
if (Class === null || !_isNativeFunction(Class)) return Class;
|
234 |
-
|
235 |
if (typeof Class !== "function") {
|
236 |
throw new TypeError("Super expression must either be null or a function");
|
237 |
}
|
238 |
-
|
239 |
if (typeof _cache !== "undefined") {
|
240 |
if (_cache.has(Class)) return _cache.get(Class);
|
241 |
-
|
242 |
_cache.set(Class, Wrapper);
|
243 |
}
|
244 |
-
|
245 |
function Wrapper() {
|
246 |
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
247 |
}
|
248 |
-
|
249 |
Wrapper.prototype = Object.create(Class.prototype, {
|
250 |
constructor: {
|
251 |
value: Wrapper,
|
@@ -256,35 +175,26 @@ function _wrapNativeSuper(Class) {
|
|
256 |
});
|
257 |
return _setPrototypeOf(Wrapper, Class);
|
258 |
};
|
259 |
-
|
260 |
return _wrapNativeSuper(Class);
|
261 |
}
|
262 |
-
|
263 |
function _objectWithoutPropertiesLoose(source, excluded) {
|
264 |
if (source == null) return {};
|
265 |
var target = {};
|
266 |
var sourceKeys = Object.keys(source);
|
267 |
var key, i;
|
268 |
-
|
269 |
for (i = 0; i < sourceKeys.length; i++) {
|
270 |
key = sourceKeys[i];
|
271 |
if (excluded.indexOf(key) >= 0) continue;
|
272 |
target[key] = source[key];
|
273 |
}
|
274 |
-
|
275 |
return target;
|
276 |
}
|
277 |
-
|
278 |
function _objectWithoutProperties(source, excluded) {
|
279 |
if (source == null) return {};
|
280 |
-
|
281 |
var target = _objectWithoutPropertiesLoose(source, excluded);
|
282 |
-
|
283 |
var key, i;
|
284 |
-
|
285 |
if (Object.getOwnPropertySymbols) {
|
286 |
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
287 |
-
|
288 |
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
289 |
key = sourceSymbolKeys[i];
|
290 |
if (excluded.indexOf(key) >= 0) continue;
|
@@ -292,81 +202,61 @@ function _objectWithoutProperties(source, excluded) {
|
|
292 |
target[key] = source[key];
|
293 |
}
|
294 |
}
|
295 |
-
|
296 |
return target;
|
297 |
}
|
298 |
-
|
299 |
function _assertThisInitialized(self) {
|
300 |
if (self === void 0) {
|
301 |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
302 |
}
|
303 |
-
|
304 |
return self;
|
305 |
}
|
306 |
-
|
307 |
function _possibleConstructorReturn(self, call) {
|
308 |
if (call && (typeof call === "object" || typeof call === "function")) {
|
309 |
return call;
|
310 |
} else if (call !== void 0) {
|
311 |
throw new TypeError("Derived constructors may only return object or undefined");
|
312 |
}
|
313 |
-
|
314 |
return _assertThisInitialized(self);
|
315 |
}
|
316 |
-
|
317 |
function _createSuper(Derived) {
|
318 |
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
319 |
-
|
320 |
return function _createSuperInternal() {
|
321 |
var Super = _getPrototypeOf(Derived),
|
322 |
-
|
323 |
-
|
324 |
if (hasNativeReflectConstruct) {
|
325 |
var NewTarget = _getPrototypeOf(this).constructor;
|
326 |
-
|
327 |
result = Reflect.construct(Super, arguments, NewTarget);
|
328 |
} else {
|
329 |
result = Super.apply(this, arguments);
|
330 |
}
|
331 |
-
|
332 |
return _possibleConstructorReturn(this, result);
|
333 |
};
|
334 |
}
|
335 |
-
|
336 |
function _slicedToArray(arr, i) {
|
337 |
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
338 |
}
|
339 |
-
|
340 |
function _toConsumableArray(arr) {
|
341 |
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
342 |
}
|
343 |
-
|
344 |
function _arrayWithoutHoles(arr) {
|
345 |
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
346 |
}
|
347 |
-
|
348 |
function _arrayWithHoles(arr) {
|
349 |
if (Array.isArray(arr)) return arr;
|
350 |
}
|
351 |
-
|
352 |
function _iterableToArray(iter) {
|
353 |
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
354 |
}
|
355 |
-
|
356 |
function _iterableToArrayLimit(arr, i) {
|
357 |
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
358 |
-
|
359 |
if (_i == null) return;
|
360 |
var _arr = [];
|
361 |
var _n = true;
|
362 |
var _d = false;
|
363 |
-
|
364 |
var _s, _e;
|
365 |
-
|
366 |
try {
|
367 |
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
368 |
_arr.push(_s.value);
|
369 |
-
|
370 |
if (i && _arr.length === i) break;
|
371 |
}
|
372 |
} catch (err) {
|
@@ -379,10 +269,8 @@ function _iterableToArrayLimit(arr, i) {
|
|
379 |
if (_d) throw _e;
|
380 |
}
|
381 |
}
|
382 |
-
|
383 |
return _arr;
|
384 |
}
|
385 |
-
|
386 |
function _unsupportedIterableToArray(o, minLen) {
|
387 |
if (!o) return;
|
388 |
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
@@ -391,33 +279,24 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
391 |
if (n === "Map" || n === "Set") return Array.from(o);
|
392 |
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
393 |
}
|
394 |
-
|
395 |
function _arrayLikeToArray(arr, len) {
|
396 |
if (len == null || len > arr.length) len = arr.length;
|
397 |
-
|
398 |
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
399 |
-
|
400 |
return arr2;
|
401 |
}
|
402 |
-
|
403 |
function _nonIterableSpread() {
|
404 |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
405 |
}
|
406 |
-
|
407 |
function _nonIterableRest() {
|
408 |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
409 |
}
|
410 |
-
|
411 |
function _createForOfIteratorHelper(o, allowArrayLike) {
|
412 |
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
413 |
-
|
414 |
if (!it) {
|
415 |
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
416 |
if (it) o = it;
|
417 |
var i = 0;
|
418 |
-
|
419 |
var F = function () {};
|
420 |
-
|
421 |
return {
|
422 |
s: F,
|
423 |
n: function () {
|
@@ -435,13 +314,11 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
435 |
f: F
|
436 |
};
|
437 |
}
|
438 |
-
|
439 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
440 |
}
|
441 |
-
|
442 |
var normalCompletion = true,
|
443 |
-
|
444 |
-
|
445 |
return {
|
446 |
s: function () {
|
447 |
it = it.call(o);
|
@@ -479,7 +356,6 @@ var win = typeof window !== 'undefined' ? window : {};
|
|
479 |
var doc = win.document || {
|
480 |
head: {}
|
481 |
};
|
482 |
-
|
483 |
var plt = {
|
484 |
$flags$: 0,
|
485 |
$resourcesUrl$: '',
|
@@ -499,29 +375,24 @@ var plt = {
|
|
499 |
return new CustomEvent(eventName, opts);
|
500 |
}
|
501 |
};
|
502 |
-
|
503 |
var promiseResolve = function promiseResolve(v) {
|
504 |
return Promise.resolve(v);
|
505 |
};
|
506 |
-
|
507 |
var supportsConstructibleStylesheets = /*@__PURE__*/function () {
|
508 |
try {
|
509 |
new CSSStyleSheet();
|
510 |
return typeof new CSSStyleSheet().replace === 'function';
|
511 |
} catch (e) {}
|
512 |
-
|
513 |
return false;
|
514 |
}() ;
|
515 |
-
|
516 |
var addHostEventListeners = function addHostEventListeners(elm, hostRef, listeners, attachParentListeners) {
|
517 |
if (listeners) {
|
518 |
|
519 |
listeners.map(function (_ref6) {
|
520 |
var _ref7 = _slicedToArray(_ref6, 3),
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
var target = getHostListenerTarget(elm, flags) ;
|
526 |
var handler = hostListenerProxy(hostRef, method);
|
527 |
var opts = hostListenerOpts(flags);
|
@@ -532,14 +403,11 @@ var addHostEventListeners = function addHostEventListeners(elm, hostRef, listene
|
|
532 |
});
|
533 |
}
|
534 |
};
|
535 |
-
|
536 |
var hostListenerProxy = function hostListenerProxy(hostRef, methodName) {
|
537 |
return function (ev) {
|
538 |
try {
|
539 |
{
|
540 |
-
if (hostRef.$flags$ & 256
|
541 |
-
/* isListenReady */
|
542 |
-
) {
|
543 |
// instance is ready, let's call it's member method for this event
|
544 |
hostRef.$lazyInstance$[methodName](ev);
|
545 |
} else {
|
@@ -551,32 +419,23 @@ var hostListenerProxy = function hostListenerProxy(hostRef, methodName) {
|
|
551 |
}
|
552 |
};
|
553 |
};
|
554 |
-
|
555 |
var getHostListenerTarget = function getHostListenerTarget(elm, flags) {
|
556 |
-
if (flags & 8
|
557 |
-
/* TargetWindow */
|
558 |
-
) return win;
|
559 |
return elm;
|
560 |
-
};
|
561 |
-
|
562 |
-
|
563 |
var hostListenerOpts = function hostListenerOpts(flags) {
|
564 |
-
return (flags & 2
|
565 |
-
/* Capture */
|
566 |
-
) !== 0;
|
567 |
};
|
568 |
var HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
569 |
var XLINK_NS = 'http://www.w3.org/1999/xlink';
|
570 |
-
|
571 |
var createTime = function createTime(fnName) {
|
572 |
-
|
573 |
{
|
574 |
return function () {
|
575 |
return;
|
576 |
};
|
577 |
}
|
578 |
};
|
579 |
-
|
580 |
var uniqueTime = function uniqueTime(key, measureText) {
|
581 |
{
|
582 |
return function () {
|
@@ -584,52 +443,39 @@ var uniqueTime = function uniqueTime(key, measureText) {
|
|
584 |
};
|
585 |
}
|
586 |
};
|
587 |
-
|
588 |
var rootAppliedStyles = new WeakMap();
|
589 |
-
|
590 |
var registerStyle = function registerStyle(scopeId, cssText, allowCS) {
|
591 |
var style = styles.get(scopeId);
|
592 |
-
|
593 |
if (supportsConstructibleStylesheets && allowCS) {
|
594 |
style = style || new CSSStyleSheet();
|
595 |
style.replace(cssText);
|
596 |
} else {
|
597 |
style = cssText;
|
598 |
}
|
599 |
-
|
600 |
styles.set(scopeId, style);
|
601 |
};
|
602 |
-
|
603 |
var addStyle = function addStyle(styleContainerNode, cmpMeta, mode, hostElm) {
|
604 |
var scopeId = getScopeId(cmpMeta);
|
605 |
var style = styles.get(scopeId);
|
|
|
606 |
// so the fallback is to always use the document for the root node in those cases
|
607 |
-
|
608 |
-
|
609 |
-
styleContainerNode = styleContainerNode.nodeType === 11
|
610 |
-
/* DocumentFragment */
|
611 |
-
? styleContainerNode : doc;
|
612 |
-
|
613 |
if (style) {
|
614 |
if (typeof style === 'string') {
|
615 |
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
616 |
var appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
617 |
var styleElm;
|
618 |
-
|
619 |
if (!appliedStyles) {
|
620 |
rootAppliedStyles.set(styleContainerNode, appliedStyles = new Set());
|
621 |
}
|
622 |
-
|
623 |
if (!appliedStyles.has(scopeId)) {
|
624 |
{
|
625 |
{
|
626 |
styleElm = doc.createElement('style');
|
627 |
styleElm.innerHTML = style;
|
628 |
}
|
629 |
-
|
630 |
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
631 |
}
|
632 |
-
|
633 |
if (appliedStyles) {
|
634 |
appliedStyles.add(scopeId);
|
635 |
}
|
@@ -638,20 +484,15 @@ var addStyle = function addStyle(styleContainerNode, cmpMeta, mode, hostElm) {
|
|
638 |
styleContainerNode.adoptedStyleSheets = [].concat(_toConsumableArray(styleContainerNode.adoptedStyleSheets), [style]);
|
639 |
}
|
640 |
}
|
641 |
-
|
642 |
return scopeId;
|
643 |
};
|
644 |
-
|
645 |
var attachStyles = function attachStyles(hostRef) {
|
646 |
var cmpMeta = hostRef.$cmpMeta$;
|
647 |
var elm = hostRef.$hostElement$;
|
648 |
var flags = cmpMeta.$flags$;
|
649 |
var endAttachStyles = createTime();
|
650 |
var scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
651 |
-
|
652 |
-
if (flags & 10
|
653 |
-
/* needsScopedEncapsulation */
|
654 |
-
) {
|
655 |
// only required when we're NOT using native shadow dom (slot)
|
656 |
// or this browser doesn't support native shadow dom
|
657 |
// and this host element was NOT created with SSR
|
@@ -662,35 +503,27 @@ var attachStyles = function attachStyles(hostRef) {
|
|
662 |
elm['s-sc'] = scopeId;
|
663 |
elm.classList.add(scopeId + '-h');
|
664 |
}
|
665 |
-
|
666 |
endAttachStyles();
|
667 |
};
|
668 |
-
|
669 |
var getScopeId = function getScopeId(cmp, mode) {
|
670 |
return 'sc-' + (cmp.$tagName$);
|
671 |
};
|
672 |
/**
|
673 |
* Default style mode id
|
674 |
*/
|
675 |
-
|
676 |
/**
|
677 |
* Reusable empty obj/array
|
678 |
* Don't add values to these!!
|
679 |
*/
|
680 |
-
|
681 |
-
|
682 |
var EMPTY_OBJ = {};
|
683 |
/**
|
684 |
* Namespaces
|
685 |
*/
|
686 |
-
|
687 |
var SVG_NS = 'http://www.w3.org/2000/svg';
|
688 |
var HTML_NS = 'http://www.w3.org/1999/xhtml';
|
689 |
-
|
690 |
var isDef = function isDef(v) {
|
691 |
return v != null;
|
692 |
};
|
693 |
-
|
694 |
var isComplexType = function isComplexType(o) {
|
695 |
// https://jsperf.com/typeof-fn-object/5
|
696 |
o = _typeof(o);
|
@@ -707,8 +540,6 @@ var isComplexType = function isComplexType(o) {
|
|
707 |
// const stack: any[] = [];
|
708 |
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
709 |
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
710 |
-
|
711 |
-
|
712 |
var h = function h(nodeName, vnodeData) {
|
713 |
var child = null;
|
714 |
var key = null;
|
@@ -716,18 +547,15 @@ var h = function h(nodeName, vnodeData) {
|
|
716 |
var simple = false;
|
717 |
var lastSimple = false;
|
718 |
var vNodeChildren = [];
|
719 |
-
|
720 |
var walk = function walk(c) {
|
721 |
for (var _i = 0; _i < c.length; _i++) {
|
722 |
child = c[_i];
|
723 |
-
|
724 |
if (Array.isArray(child)) {
|
725 |
walk(child);
|
726 |
} else if (child != null && typeof child !== 'boolean') {
|
727 |
if (simple = typeof nodeName !== 'function' && !isComplexType(child)) {
|
728 |
child = String(child);
|
729 |
}
|
730 |
-
|
731 |
if (simple && lastSimple) {
|
732 |
// If the previous child was simple (string), we merge both
|
733 |
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
@@ -735,32 +563,24 @@ var h = function h(nodeName, vnodeData) {
|
|
735 |
// Append a new vNode, if it's text, we create a text vNode
|
736 |
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
737 |
}
|
738 |
-
|
739 |
lastSimple = simple;
|
740 |
}
|
741 |
}
|
742 |
};
|
743 |
-
|
744 |
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
745 |
children[_key - 2] = arguments[_key];
|
746 |
}
|
747 |
-
|
748 |
walk(children);
|
749 |
-
|
750 |
if (vnodeData) {
|
751 |
-
|
752 |
-
|
753 |
if (vnodeData.key) {
|
754 |
key = vnodeData.key;
|
755 |
}
|
756 |
-
|
757 |
if (vnodeData.name) {
|
758 |
slotName = vnodeData.name;
|
759 |
}
|
760 |
-
|
761 |
{
|
762 |
var classData = vnodeData.className || vnodeData.class;
|
763 |
-
|
764 |
if (classData) {
|
765 |
vnodeData.class = _typeof(classData) !== 'object' ? classData : Object.keys(classData).filter(function (k) {
|
766 |
return classData[k];
|
@@ -768,30 +588,23 @@ var h = function h(nodeName, vnodeData) {
|
|
768 |
}
|
769 |
}
|
770 |
}
|
771 |
-
|
772 |
if (typeof nodeName === 'function') {
|
773 |
// nodeName is a functional component
|
774 |
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
775 |
}
|
776 |
-
|
777 |
var vnode = newVNode(nodeName, null);
|
778 |
vnode.$attrs$ = vnodeData;
|
779 |
-
|
780 |
if (vNodeChildren.length > 0) {
|
781 |
vnode.$children$ = vNodeChildren;
|
782 |
}
|
783 |
-
|
784 |
{
|
785 |
vnode.$key$ = key;
|
786 |
}
|
787 |
-
|
788 |
{
|
789 |
vnode.$name$ = slotName;
|
790 |
}
|
791 |
-
|
792 |
return vnode;
|
793 |
};
|
794 |
-
|
795 |
var newVNode = function newVNode(tag, text) {
|
796 |
var vnode = {
|
797 |
$flags$: 0,
|
@@ -800,28 +613,21 @@ var newVNode = function newVNode(tag, text) {
|
|
800 |
$elm$: null,
|
801 |
$children$: null
|
802 |
};
|
803 |
-
|
804 |
{
|
805 |
vnode.$attrs$ = null;
|
806 |
}
|
807 |
-
|
808 |
{
|
809 |
vnode.$key$ = null;
|
810 |
}
|
811 |
-
|
812 |
{
|
813 |
vnode.$name$ = null;
|
814 |
}
|
815 |
-
|
816 |
return vnode;
|
817 |
};
|
818 |
-
|
819 |
var Host = {};
|
820 |
-
|
821 |
var isHost = function isHost(node) {
|
822 |
return node && node.$tag$ === Host;
|
823 |
};
|
824 |
-
|
825 |
var vdomFnUtils = {
|
826 |
forEach: function forEach(children, cb) {
|
827 |
return children.map(convertToPublic).forEach(cb);
|
@@ -830,7 +636,6 @@ var vdomFnUtils = {
|
|
830 |
return children.map(convertToPublic).map(cb).map(convertToPrivate);
|
831 |
}
|
832 |
};
|
833 |
-
|
834 |
var convertToPublic = function convertToPublic(node) {
|
835 |
return {
|
836 |
vattrs: node.$attrs$,
|
@@ -841,22 +646,17 @@ var convertToPublic = function convertToPublic(node) {
|
|
841 |
vtext: node.$text$
|
842 |
};
|
843 |
};
|
844 |
-
|
845 |
var convertToPrivate = function convertToPrivate(node) {
|
846 |
if (typeof node.vtag === 'function') {
|
847 |
var vnodeData = Object.assign({}, node.vattrs);
|
848 |
-
|
849 |
if (node.vkey) {
|
850 |
vnodeData.key = node.vkey;
|
851 |
}
|
852 |
-
|
853 |
if (node.vname) {
|
854 |
vnodeData.name = node.vname;
|
855 |
}
|
856 |
-
|
857 |
return h.apply(void 0, [node.vtag, vnodeData].concat(_toConsumableArray(node.vchildren || [])));
|
858 |
}
|
859 |
-
|
860 |
var vnode = newVNode(node.vtag, node.vtext);
|
861 |
vnode.$attrs$ = node.vattrs;
|
862 |
vnode.$children$ = node.vchildren;
|
@@ -872,13 +672,10 @@ var convertToPrivate = function convertToPrivate(node) {
|
|
872 |
*
|
873 |
* Modified for Stencil's compiler and vdom
|
874 |
*/
|
875 |
-
|
876 |
-
|
877 |
var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSvg, flags) {
|
878 |
if (oldValue !== newValue) {
|
879 |
var isProp = isMemberInElement(elm, memberName);
|
880 |
var ln = memberName.toLowerCase();
|
881 |
-
|
882 |
if (memberName === 'class') {
|
883 |
var classList = elm.classList;
|
884 |
var oldClasses = parseClassList(oldValue);
|
@@ -902,7 +699,6 @@ var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSv
|
|
902 |
}
|
903 |
}
|
904 |
}
|
905 |
-
|
906 |
for (var _prop in newValue) {
|
907 |
if (!oldValue || newValue[_prop] !== oldValue[_prop]) {
|
908 |
if (_prop.includes('-')) {
|
@@ -945,25 +741,23 @@ var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSv
|
|
945 |
// except for the first character, we keep the event name case
|
946 |
memberName = ln[2] + memberName.slice(3);
|
947 |
}
|
948 |
-
|
949 |
if (oldValue) {
|
950 |
plt.rel(elm, memberName, oldValue, false);
|
951 |
}
|
952 |
-
|
953 |
if (newValue) {
|
954 |
plt.ael(elm, memberName, newValue, false);
|
955 |
}
|
956 |
} else {
|
957 |
// Set property if it exists and it's not a SVG
|
958 |
var isComplex = isComplexType(newValue);
|
959 |
-
|
960 |
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
961 |
try {
|
962 |
if (!elm.tagName.includes('-')) {
|
963 |
-
var n = newValue == null ? '' : newValue;
|
964 |
-
|
965 |
if (memberName === 'list') {
|
966 |
-
isProp = false;
|
|
|
967 |
} else if (oldValue == null || elm[memberName] != n) {
|
968 |
elm[memberName] = n;
|
969 |
}
|
@@ -979,17 +773,13 @@ var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSv
|
|
979 |
* - if it's a SVG, since properties might not work in <svg>
|
980 |
* - if the newValue is null/undefined or 'false'.
|
981 |
*/
|
982 |
-
|
983 |
-
|
984 |
var xlink = false;
|
985 |
-
|
986 |
{
|
987 |
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
988 |
memberName = ln;
|
989 |
xlink = true;
|
990 |
}
|
991 |
}
|
992 |
-
|
993 |
if (newValue == null || newValue === false) {
|
994 |
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
995 |
if (xlink) {
|
@@ -998,11 +788,8 @@ var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSv
|
|
998 |
elm.removeAttribute(memberName);
|
999 |
}
|
1000 |
}
|
1001 |
-
} else if ((!isProp || flags & 4
|
1002 |
-
/* isHost */
|
1003 |
-
|| isSvg) && !isComplex) {
|
1004 |
newValue = newValue === true ? '' : newValue;
|
1005 |
-
|
1006 |
if (xlink) {
|
1007 |
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
1008 |
} else {
|
@@ -1012,23 +799,17 @@ var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSv
|
|
1012 |
}
|
1013 |
}
|
1014 |
};
|
1015 |
-
|
1016 |
var parseClassListRegex = /\s/;
|
1017 |
-
|
1018 |
var parseClassList = function parseClassList(value) {
|
1019 |
return !value ? [] : value.split(parseClassListRegex);
|
1020 |
};
|
1021 |
-
|
1022 |
var updateElement = function updateElement(oldVnode, newVnode, isSvgMode, memberName) {
|
1023 |
// if the element passed in is a shadow root, which is a document fragment
|
1024 |
// then we want to be adding attrs/props to the shadow root's "host" element
|
1025 |
// if it's not a shadow root, then we add attrs/props to the same element
|
1026 |
-
var elm = newVnode.$elm$.nodeType === 11
|
1027 |
-
/* DocumentFragment */
|
1028 |
-
&& newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
1029 |
var oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
1030 |
var newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
1031 |
-
|
1032 |
{
|
1033 |
// remove attributes no longer present on the vnode by setting them to undefined
|
1034 |
for (memberName in oldVnodeAttrs) {
|
@@ -1036,14 +817,12 @@ var updateElement = function updateElement(oldVnode, newVnode, isSvgMode, member
|
|
1036 |
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
1037 |
}
|
1038 |
}
|
1039 |
-
}
|
1040 |
-
|
1041 |
-
|
1042 |
for (memberName in newVnodeAttrs) {
|
1043 |
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
1044 |
}
|
1045 |
};
|
1046 |
-
|
1047 |
var createElm = function createElm(oldParentVNode, newParentVNode, childIndex, parentElm) {
|
1048 |
// tslint:disable-next-line: prefer-const
|
1049 |
var newVNode = newParentVNode.$children$[childIndex];
|
@@ -1051,72 +830,56 @@ var createElm = function createElm(oldParentVNode, newParentVNode, childIndex, p
|
|
1051 |
var elm;
|
1052 |
var childNode;
|
1053 |
var oldVNode;
|
1054 |
-
|
1055 |
if (!useNativeShadowDom) {
|
1056 |
// remember for later we need to check to relocate nodes
|
1057 |
checkSlotRelocate = true;
|
1058 |
-
|
1059 |
if (newVNode.$tag$ === 'slot') {
|
1060 |
if (scopeId) {
|
1061 |
// scoped css needs to add its scoped id to the parent element
|
1062 |
parentElm.classList.add(scopeId + '-s');
|
1063 |
}
|
1064 |
-
|
1065 |
-
|
1066 |
-
2
|
1067 |
-
|
1068 |
-
|
1069 |
-
1
|
1070 |
-
/* isSlotReference */
|
1071 |
-
;
|
1072 |
}
|
1073 |
}
|
1074 |
-
|
1075 |
if (newVNode.$text$ !== null) {
|
1076 |
// create text node
|
1077 |
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
1078 |
-
} else if (newVNode.$flags$ & 1
|
1079 |
-
/* isSlotReference */
|
1080 |
-
) {
|
1081 |
// create a slot reference node
|
1082 |
elm = newVNode.$elm$ = doc.createTextNode('');
|
1083 |
} else {
|
1084 |
if (!isSvgMode) {
|
1085 |
isSvgMode = newVNode.$tag$ === 'svg';
|
1086 |
-
}
|
1087 |
-
|
1088 |
-
|
1089 |
-
elm = newVNode.$elm$ = doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2
|
1090 |
-
/* isSlotFallback */
|
1091 |
-
? 'slot-fb' : newVNode.$tag$) ;
|
1092 |
-
|
1093 |
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
1094 |
isSvgMode = false;
|
1095 |
-
}
|
1096 |
-
|
1097 |
-
|
1098 |
{
|
1099 |
updateElement(null, newVNode, isSvgMode);
|
1100 |
}
|
1101 |
-
|
1102 |
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
1103 |
// if there is a scopeId and this is the initial render
|
1104 |
// then let's add the scopeId as a css class
|
1105 |
elm.classList.add(elm['s-si'] = scopeId);
|
1106 |
}
|
1107 |
-
|
1108 |
if (newVNode.$children$) {
|
1109 |
for (i = 0; i < newVNode.$children$.length; ++i) {
|
1110 |
// create the node
|
1111 |
-
childNode = createElm(oldParentVNode, newVNode, i, elm);
|
1112 |
-
|
1113 |
if (childNode) {
|
1114 |
// append our new node
|
1115 |
elm.appendChild(childNode);
|
1116 |
}
|
1117 |
}
|
1118 |
}
|
1119 |
-
|
1120 |
{
|
1121 |
if (newVNode.$tag$ === 'svg') {
|
1122 |
// Only reset the SVG context when we're exiting <svg> element
|
@@ -1127,24 +890,17 @@ var createElm = function createElm(oldParentVNode, newParentVNode, childIndex, p
|
|
1127 |
}
|
1128 |
}
|
1129 |
}
|
1130 |
-
|
1131 |
{
|
1132 |
elm['s-hn'] = hostTagName;
|
1133 |
-
|
1134 |
-
if (newVNode.$flags$ & (2
|
1135 |
-
/* isSlotFallback */
|
1136 |
-
| 1
|
1137 |
-
/* isSlotReference */
|
1138 |
-
)) {
|
1139 |
// remember the content reference comment
|
1140 |
-
elm['s-sr'] = true;
|
1141 |
-
|
1142 |
-
elm['s-cr'] = contentRef;
|
1143 |
-
|
1144 |
-
elm['s-sn'] = newVNode.$name$ || '';
|
1145 |
-
|
1146 |
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
1147 |
-
|
1148 |
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
1149 |
// we've got an old slot vnode and the wrapper is being replaced
|
1150 |
// so let's move the old slot content back to it's original location
|
@@ -1152,55 +908,42 @@ var createElm = function createElm(oldParentVNode, newParentVNode, childIndex, p
|
|
1152 |
}
|
1153 |
}
|
1154 |
}
|
1155 |
-
|
1156 |
return elm;
|
1157 |
};
|
1158 |
-
|
1159 |
var putBackInOriginalLocation = function putBackInOriginalLocation(parentElm, recursive) {
|
1160 |
-
plt.$flags$ |= 1
|
1161 |
-
/* isTmpDisconnected */
|
1162 |
-
;
|
1163 |
var oldSlotChildNodes = parentElm.childNodes;
|
1164 |
-
|
1165 |
for (var _i2 = oldSlotChildNodes.length - 1; _i2 >= 0; _i2--) {
|
1166 |
var childNode = oldSlotChildNodes[_i2];
|
1167 |
-
|
1168 |
if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
1169 |
// // this child node in the old element is from another component
|
1170 |
// // remove this node from the old slot's parent
|
1171 |
// childNode.remove();
|
1172 |
// and relocate it back to it's original location
|
1173 |
-
parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
|
|
1174 |
// later on the patch function will know what to do
|
1175 |
// and move this to the correct spot in need be
|
1176 |
-
|
1177 |
childNode['s-ol'].remove();
|
1178 |
childNode['s-ol'] = undefined;
|
1179 |
checkSlotRelocate = true;
|
1180 |
}
|
1181 |
-
|
1182 |
if (recursive) {
|
1183 |
putBackInOriginalLocation(childNode, recursive);
|
1184 |
}
|
1185 |
}
|
1186 |
-
|
1187 |
-
plt.$flags$ &= ~1
|
1188 |
-
/* isTmpDisconnected */
|
1189 |
-
;
|
1190 |
};
|
1191 |
|
1192 |
var addVnodes = function addVnodes(parentElm, before, parentVNode, vnodes, startIdx, endIdx) {
|
1193 |
var containerElm = parentElm['s-cr'] && parentElm['s-cr'].parentNode || parentElm;
|
1194 |
var childNode;
|
1195 |
-
|
1196 |
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
1197 |
containerElm = containerElm.shadowRoot;
|
1198 |
}
|
1199 |
-
|
1200 |
for (; startIdx <= endIdx; ++startIdx) {
|
1201 |
if (vnodes[startIdx]) {
|
1202 |
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
1203 |
-
|
1204 |
if (childNode) {
|
1205 |
vnodes[startIdx].$elm$ = childNode;
|
1206 |
containerElm.insertBefore(childNode, referenceNode(before) );
|
@@ -1208,18 +951,15 @@ var addVnodes = function addVnodes(parentElm, before, parentVNode, vnodes, start
|
|
1208 |
}
|
1209 |
}
|
1210 |
};
|
1211 |
-
|
1212 |
var removeVnodes = function removeVnodes(vnodes, startIdx, endIdx, vnode, elm) {
|
1213 |
for (; startIdx <= endIdx; ++startIdx) {
|
1214 |
if (vnode = vnodes[startIdx]) {
|
1215 |
elm = vnode.$elm$;
|
1216 |
callNodeRefs(vnode);
|
1217 |
-
|
1218 |
{
|
1219 |
// we're removing this element
|
1220 |
// so it's possible we need to show slot fallback content now
|
1221 |
checkSlotFallbackVisibility = true;
|
1222 |
-
|
1223 |
if (elm['s-ol']) {
|
1224 |
// remove the original location comment
|
1225 |
elm['s-ol'].remove();
|
@@ -1228,14 +968,12 @@ var removeVnodes = function removeVnodes(vnodes, startIdx, endIdx, vnode, elm) {
|
|
1228 |
// that's being removed are slot nodes
|
1229 |
putBackInOriginalLocation(elm, true);
|
1230 |
}
|
1231 |
-
}
|
1232 |
-
|
1233 |
-
|
1234 |
elm.remove();
|
1235 |
}
|
1236 |
}
|
1237 |
};
|
1238 |
-
|
1239 |
var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh) {
|
1240 |
var oldStartIdx = 0;
|
1241 |
var newStartIdx = 0;
|
@@ -1249,7 +987,6 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1249 |
var newEndVnode = newCh[newEndIdx];
|
1250 |
var node;
|
1251 |
var elmToMove;
|
1252 |
-
|
1253 |
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
1254 |
if (oldStartVnode == null) {
|
1255 |
// Vnode might have been moved left
|
@@ -1273,7 +1010,6 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1273 |
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
1274 |
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
1275 |
}
|
1276 |
-
|
1277 |
patch(oldStartVnode, newEndVnode);
|
1278 |
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
1279 |
oldStartVnode = oldCh[++oldStartIdx];
|
@@ -1283,7 +1019,6 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1283 |
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
1284 |
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
1285 |
}
|
1286 |
-
|
1287 |
patch(oldEndVnode, newStartVnode);
|
1288 |
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
1289 |
oldEndVnode = oldCh[--oldEndIdx];
|
@@ -1291,7 +1026,6 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1291 |
} else {
|
1292 |
// createKeyToOldIdx
|
1293 |
idxInOld = -1;
|
1294 |
-
|
1295 |
{
|
1296 |
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
1297 |
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
@@ -1300,10 +1034,8 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1300 |
}
|
1301 |
}
|
1302 |
}
|
1303 |
-
|
1304 |
if (idxInOld >= 0) {
|
1305 |
elmToMove = oldCh[idxInOld];
|
1306 |
-
|
1307 |
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
1308 |
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
1309 |
} else {
|
@@ -1311,14 +1043,12 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1311 |
oldCh[idxInOld] = undefined;
|
1312 |
node = elmToMove.$elm$;
|
1313 |
}
|
1314 |
-
|
1315 |
newStartVnode = newCh[++newStartIdx];
|
1316 |
} else {
|
1317 |
// new element
|
1318 |
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
1319 |
newStartVnode = newCh[++newStartIdx];
|
1320 |
}
|
1321 |
-
|
1322 |
if (node) {
|
1323 |
{
|
1324 |
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
@@ -1326,14 +1056,12 @@ var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh)
|
|
1326 |
}
|
1327 |
}
|
1328 |
}
|
1329 |
-
|
1330 |
if (oldStartIdx > oldEndIdx) {
|
1331 |
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
1332 |
} else if (newStartIdx > newEndIdx) {
|
1333 |
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
1334 |
}
|
1335 |
};
|
1336 |
-
|
1337 |
var isSameVnode = function isSameVnode(vnode1, vnode2) {
|
1338 |
// compare if two vnode to see if they're "technically" the same
|
1339 |
// need to have the same element tag, and same key to be the same
|
@@ -1341,15 +1069,12 @@ var isSameVnode = function isSameVnode(vnode1, vnode2) {
|
|
1341 |
if (vnode1.$tag$ === 'slot') {
|
1342 |
return vnode1.$name$ === vnode2.$name$;
|
1343 |
}
|
1344 |
-
|
1345 |
{
|
1346 |
return vnode1.$key$ === vnode2.$key$;
|
1347 |
}
|
1348 |
}
|
1349 |
-
|
1350 |
return false;
|
1351 |
};
|
1352 |
-
|
1353 |
var referenceNode = function referenceNode(node) {
|
1354 |
// this node was relocated to a new location in the dom
|
1355 |
// because of some other component's slot
|
@@ -1357,11 +1082,9 @@ var referenceNode = function referenceNode(node) {
|
|
1357 |
// it's original location was according to it's original vdom
|
1358 |
return node && node['s-ol'] || node;
|
1359 |
};
|
1360 |
-
|
1361 |
var parentReferenceNode = function parentReferenceNode(node) {
|
1362 |
return (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
1363 |
};
|
1364 |
-
|
1365 |
var patch = function patch(oldVNode, newVNode) {
|
1366 |
var elm = newVNode.$elm$ = oldVNode.$elm$;
|
1367 |
var oldChildren = oldVNode.$children$;
|
@@ -1369,15 +1092,13 @@ var patch = function patch(oldVNode, newVNode) {
|
|
1369 |
var tag = newVNode.$tag$;
|
1370 |
var text = newVNode.$text$;
|
1371 |
var defaultHolder;
|
1372 |
-
|
1373 |
if (text === null) {
|
1374 |
{
|
1375 |
// test if we're rendering an svg element, or still rendering nodes inside of one
|
1376 |
// only add this to the when the compiler sees we're using an svg somewhere
|
1377 |
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
1378 |
-
}
|
1379 |
-
|
1380 |
-
|
1381 |
{
|
1382 |
if (tag === 'slot') ;else {
|
1383 |
// either this is the first render of an element OR it's an update
|
@@ -1386,7 +1107,6 @@ var patch = function patch(oldVNode, newVNode) {
|
|
1386 |
updateElement(oldVNode, newVNode, isSvgMode);
|
1387 |
}
|
1388 |
}
|
1389 |
-
|
1390 |
if (oldChildren !== null && newChildren !== null) {
|
1391 |
// looks like there's child vnodes for both the old and new vnodes
|
1392 |
updateChildren(elm, oldChildren, newVNode, newChildren);
|
@@ -1395,15 +1115,13 @@ var patch = function patch(oldVNode, newVNode) {
|
|
1395 |
if (oldVNode.$text$ !== null) {
|
1396 |
// the old vnode was text, so be sure to clear it out
|
1397 |
elm.textContent = '';
|
1398 |
-
}
|
1399 |
-
|
1400 |
-
|
1401 |
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
1402 |
} else if (oldChildren !== null) {
|
1403 |
// no new child vnodes, but there are old child vnodes to remove
|
1404 |
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
1405 |
}
|
1406 |
-
|
1407 |
if (isSvgMode && tag === 'svg') {
|
1408 |
isSvgMode = false;
|
1409 |
}
|
@@ -1416,7 +1134,6 @@ var patch = function patch(oldVNode, newVNode) {
|
|
1416 |
elm.data = text;
|
1417 |
}
|
1418 |
};
|
1419 |
-
|
1420 |
var updateFallbackSlotVisibility = function updateFallbackSlotVisibility(elm) {
|
1421 |
// tslint:disable-next-line: prefer-const
|
1422 |
var childNodes = elm.childNodes;
|
@@ -1426,29 +1143,21 @@ var updateFallbackSlotVisibility = function updateFallbackSlotVisibility(elm) {
|
|
1426 |
var j;
|
1427 |
var slotNameAttr;
|
1428 |
var nodeType;
|
1429 |
-
|
1430 |
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
1431 |
childNode = childNodes[i];
|
1432 |
-
|
1433 |
-
if (childNode.nodeType === 1
|
1434 |
-
/* ElementNode */
|
1435 |
-
) {
|
1436 |
if (childNode['s-sr']) {
|
1437 |
// this is a slot fallback node
|
1438 |
// get the slot name for this slot reference node
|
1439 |
-
slotNameAttr = childNode['s-sn'];
|
|
|
1440 |
// then hide it if there are other slots in the light dom
|
1441 |
-
|
1442 |
childNode.hidden = false;
|
1443 |
-
|
1444 |
for (j = 0; j < ilen; j++) {
|
1445 |
nodeType = childNodes[j].nodeType;
|
1446 |
-
|
1447 |
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
1448 |
// this sibling node is from a different component OR is a named fallback slot node
|
1449 |
-
if (nodeType === 1
|
1450 |
-
/* ElementNode */
|
1451 |
-
&& slotNameAttr === childNodes[j].getAttribute('slot')) {
|
1452 |
childNode.hidden = true;
|
1453 |
break;
|
1454 |
}
|
@@ -1456,26 +1165,19 @@ var updateFallbackSlotVisibility = function updateFallbackSlotVisibility(elm) {
|
|
1456 |
// this is a default fallback slot node
|
1457 |
// any element or text node (with content)
|
1458 |
// should hide the default fallback slot node
|
1459 |
-
if (nodeType === 1
|
1460 |
-
/* ElementNode */
|
1461 |
-
|| nodeType === 3
|
1462 |
-
/* TextNode */
|
1463 |
-
&& childNodes[j].textContent.trim() !== '') {
|
1464 |
childNode.hidden = true;
|
1465 |
break;
|
1466 |
}
|
1467 |
}
|
1468 |
}
|
1469 |
-
}
|
1470 |
-
|
1471 |
-
|
1472 |
updateFallbackSlotVisibility(childNode);
|
1473 |
}
|
1474 |
}
|
1475 |
};
|
1476 |
-
|
1477 |
var relocateNodes = [];
|
1478 |
-
|
1479 |
var relocateSlotContent = function relocateSlotContent(elm) {
|
1480 |
// tslint:disable-next-line: prefer-const
|
1481 |
var childNode;
|
@@ -1487,19 +1189,15 @@ var relocateSlotContent = function relocateSlotContent(elm) {
|
|
1487 |
var i = 0;
|
1488 |
var childNodes = elm.childNodes;
|
1489 |
var ilen = childNodes.length;
|
1490 |
-
|
1491 |
for (; i < ilen; i++) {
|
1492 |
childNode = childNodes[i];
|
1493 |
-
|
1494 |
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
1495 |
// first got the content reference comment node
|
1496 |
// then we got it's parent, which is where all the host content is in now
|
1497 |
hostContentNodes = node.parentNode.childNodes;
|
1498 |
slotNameAttr = childNode['s-sn'];
|
1499 |
-
|
1500 |
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
1501 |
node = hostContentNodes[j];
|
1502 |
-
|
1503 |
if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
|
1504 |
// let's do some relocating to its new home
|
1505 |
// but never relocate a content reference node
|
@@ -1508,13 +1206,12 @@ var relocateSlotContent = function relocateSlotContent(elm) {
|
|
1508 |
// it's possible we've already decided to relocate this node
|
1509 |
relocateNodeData = relocateNodes.find(function (r) {
|
1510 |
return r.$nodeToRelocate$ === node;
|
1511 |
-
});
|
|
|
1512 |
// let's make sure we also double check
|
1513 |
// fallbacks are correctly hidden or shown
|
1514 |
-
|
1515 |
checkSlotFallbackVisibility = true;
|
1516 |
node['s-sn'] = node['s-sn'] || slotNameAttr;
|
1517 |
-
|
1518 |
if (relocateNodeData) {
|
1519 |
// previously we never found a slot home for this node
|
1520 |
// but turns out we did, so let's remember it now
|
@@ -1526,14 +1223,12 @@ var relocateSlotContent = function relocateSlotContent(elm) {
|
|
1526 |
$nodeToRelocate$: node
|
1527 |
});
|
1528 |
}
|
1529 |
-
|
1530 |
if (node['s-sr']) {
|
1531 |
relocateNodes.map(function (relocateNode) {
|
1532 |
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
|
1533 |
relocateNodeData = relocateNodes.find(function (r) {
|
1534 |
return r.$nodeToRelocate$ === node;
|
1535 |
});
|
1536 |
-
|
1537 |
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
1538 |
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
1539 |
}
|
@@ -1552,92 +1247,66 @@ var relocateSlotContent = function relocateSlotContent(elm) {
|
|
1552 |
}
|
1553 |
}
|
1554 |
}
|
1555 |
-
|
1556 |
-
if (childNode.nodeType === 1
|
1557 |
-
/* ElementNode */
|
1558 |
-
) {
|
1559 |
relocateSlotContent(childNode);
|
1560 |
}
|
1561 |
}
|
1562 |
};
|
1563 |
-
|
1564 |
var isNodeLocatedInSlot = function isNodeLocatedInSlot(nodeToRelocate, slotNameAttr) {
|
1565 |
-
if (nodeToRelocate.nodeType === 1
|
1566 |
-
/* ElementNode */
|
1567 |
-
) {
|
1568 |
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
1569 |
return true;
|
1570 |
}
|
1571 |
-
|
1572 |
if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
|
1573 |
return true;
|
1574 |
}
|
1575 |
-
|
1576 |
return false;
|
1577 |
}
|
1578 |
-
|
1579 |
if (nodeToRelocate['s-sn'] === slotNameAttr) {
|
1580 |
return true;
|
1581 |
}
|
1582 |
-
|
1583 |
return slotNameAttr === '';
|
1584 |
};
|
1585 |
-
|
1586 |
var callNodeRefs = function callNodeRefs(vNode) {
|
1587 |
{
|
1588 |
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
1589 |
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
1590 |
}
|
1591 |
};
|
1592 |
-
|
1593 |
var renderVdom = function renderVdom(hostRef, renderFnResults) {
|
1594 |
var hostElm = hostRef.$hostElement$;
|
1595 |
var cmpMeta = hostRef.$cmpMeta$;
|
1596 |
var oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
1597 |
var rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
1598 |
-
hostTagName = hostElm.tagName;
|
1599 |
-
|
1600 |
if (cmpMeta.$attrsToReflect$) {
|
1601 |
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
1602 |
cmpMeta.$attrsToReflect$.map(function (_ref9) {
|
1603 |
var _ref10 = _slicedToArray(_ref9, 2),
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
return rootVnode.$attrs$[attribute] = hostElm[propName];
|
1608 |
});
|
1609 |
}
|
1610 |
-
|
1611 |
rootVnode.$tag$ = null;
|
1612 |
-
rootVnode.$flags$ |= 4
|
1613 |
-
/* isHost */
|
1614 |
-
;
|
1615 |
hostRef.$vnode$ = rootVnode;
|
1616 |
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
1617 |
-
|
1618 |
{
|
1619 |
scopeId = hostElm['s-sc'];
|
1620 |
}
|
1621 |
-
|
1622 |
{
|
1623 |
contentRef = hostElm['s-cr'];
|
1624 |
-
useNativeShadowDom = (cmpMeta.$flags$ & 1
|
1625 |
-
|
1626 |
-
) !== 0; // always reset
|
1627 |
-
|
1628 |
checkSlotFallbackVisibility = false;
|
1629 |
-
}
|
1630 |
-
|
1631 |
-
|
1632 |
patch(oldVNode, rootVnode);
|
1633 |
-
|
1634 |
{
|
1635 |
// while we're moving nodes around existing nodes, temporarily disable
|
1636 |
// the disconnectCallback from working
|
1637 |
-
plt.$flags$ |= 1
|
1638 |
-
/* isTmpDisconnected */
|
1639 |
-
;
|
1640 |
-
|
1641 |
if (checkSlotRelocate) {
|
1642 |
relocateSlotContent(rootVnode.$elm$);
|
1643 |
var relocateData;
|
@@ -1647,11 +1316,9 @@ var renderVdom = function renderVdom(hostRef, renderFnResults) {
|
|
1647 |
var insertBeforeNode;
|
1648 |
var refNode;
|
1649 |
var _i3 = 0;
|
1650 |
-
|
1651 |
for (; _i3 < relocateNodes.length; _i3++) {
|
1652 |
relocateData = relocateNodes[_i3];
|
1653 |
nodeToRelocate = relocateData.$nodeToRelocate$;
|
1654 |
-
|
1655 |
if (!nodeToRelocate['s-ol']) {
|
1656 |
// add a reference node marking this node's original location
|
1657 |
// keep a reference to this node for later lookups
|
@@ -1660,31 +1327,25 @@ var renderVdom = function renderVdom(hostRef, renderFnResults) {
|
|
1660 |
nodeToRelocate.parentNode.insertBefore(nodeToRelocate['s-ol'] = orgLocationNode, nodeToRelocate);
|
1661 |
}
|
1662 |
}
|
1663 |
-
|
1664 |
for (_i3 = 0; _i3 < relocateNodes.length; _i3++) {
|
1665 |
relocateData = relocateNodes[_i3];
|
1666 |
nodeToRelocate = relocateData.$nodeToRelocate$;
|
1667 |
-
|
1668 |
if (relocateData.$slotRefNode$) {
|
1669 |
// by default we're just going to insert it directly
|
1670 |
// after the slot reference node
|
1671 |
parentNodeRef = relocateData.$slotRefNode$.parentNode;
|
1672 |
insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
|
1673 |
orgLocationNode = nodeToRelocate['s-ol'];
|
1674 |
-
|
1675 |
while (orgLocationNode = orgLocationNode.previousSibling) {
|
1676 |
refNode = orgLocationNode['s-nr'];
|
1677 |
-
|
1678 |
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
1679 |
refNode = refNode.nextSibling;
|
1680 |
-
|
1681 |
if (!refNode || !refNode['s-nr']) {
|
1682 |
insertBeforeNode = refNode;
|
1683 |
break;
|
1684 |
}
|
1685 |
}
|
1686 |
}
|
1687 |
-
|
1688 |
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
1689 |
// we've checked that it's worth while to relocate
|
1690 |
// since that the node to relocate
|
@@ -1693,56 +1354,40 @@ var renderVdom = function renderVdom(hostRef, renderFnResults) {
|
|
1693 |
if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
1694 |
// probably a component in the index.html that doesn't have it's hostname set
|
1695 |
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
1696 |
-
}
|
1697 |
-
|
1698 |
-
|
1699 |
parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
1700 |
}
|
1701 |
}
|
1702 |
} else {
|
1703 |
// this node doesn't have a slot home to go to, so let's hide it
|
1704 |
-
if (nodeToRelocate.nodeType === 1
|
1705 |
-
/* ElementNode */
|
1706 |
-
) {
|
1707 |
nodeToRelocate.hidden = true;
|
1708 |
}
|
1709 |
}
|
1710 |
}
|
1711 |
}
|
1712 |
-
|
1713 |
if (checkSlotFallbackVisibility) {
|
1714 |
updateFallbackSlotVisibility(rootVnode.$elm$);
|
1715 |
-
}
|
|
|
1716 |
// allow the disconnect callback to work again
|
1717 |
-
|
1718 |
-
|
1719 |
-
plt.$flags$ &= ~1
|
1720 |
-
/* isTmpDisconnected */
|
1721 |
-
; // always reset
|
1722 |
-
|
1723 |
relocateNodes.length = 0;
|
1724 |
}
|
1725 |
-
};
|
1726 |
-
|
1727 |
var getElement = function getElement(ref) {
|
1728 |
return getHostRef(ref).$hostElement$ ;
|
1729 |
};
|
1730 |
-
|
1731 |
var createEvent = function createEvent(ref, name, flags) {
|
1732 |
var elm = getElement(ref);
|
1733 |
return {
|
1734 |
emit: function emit(detail) {
|
1735 |
-
|
1736 |
return emitEvent(elm, name, {
|
1737 |
-
bubbles: !!(flags & 4
|
1738 |
-
/*
|
1739 |
-
),
|
1740 |
-
composed: !!(flags & 2
|
1741 |
-
/* Composed */
|
1742 |
-
),
|
1743 |
-
cancelable: !!(flags & 1
|
1744 |
-
/* Cancellable */
|
1745 |
-
),
|
1746 |
detail: detail
|
1747 |
});
|
1748 |
}
|
@@ -1755,14 +1400,11 @@ var createEvent = function createEvent(ref, name, flags) {
|
|
1755 |
* @param opts options for configuring a custom Event
|
1756 |
* @returns the custom Event
|
1757 |
*/
|
1758 |
-
|
1759 |
-
|
1760 |
var emitEvent = function emitEvent(elm, name, opts) {
|
1761 |
var ev = plt.ce(name, opts);
|
1762 |
elm.dispatchEvent(ev);
|
1763 |
return ev;
|
1764 |
};
|
1765 |
-
|
1766 |
var attachToAncestor = function attachToAncestor(hostRef, ancestorComponent) {
|
1767 |
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
1768 |
ancestorComponent['s-p'].push(new Promise(function (r) {
|
@@ -1770,68 +1412,50 @@ var attachToAncestor = function attachToAncestor(hostRef, ancestorComponent) {
|
|
1770 |
}));
|
1771 |
}
|
1772 |
};
|
1773 |
-
|
1774 |
var scheduleUpdate = function scheduleUpdate(hostRef, isInitialLoad) {
|
1775 |
{
|
1776 |
-
hostRef.$flags$ |= 16
|
1777 |
-
/* isQueuedForUpdate */
|
1778 |
-
;
|
1779 |
}
|
1780 |
|
1781 |
-
if (hostRef.$flags$ & 4
|
1782 |
-
|
1783 |
-
) {
|
1784 |
-
hostRef.$flags$ |= 512
|
1785 |
-
/* needsRerender */
|
1786 |
-
;
|
1787 |
return;
|
1788 |
}
|
1789 |
-
|
1790 |
-
|
1791 |
// has already fired off its lifecycle update then
|
1792 |
// fire off the initial update
|
1793 |
-
|
1794 |
var dispatch = function dispatch() {
|
1795 |
return dispatchHooks(hostRef, isInitialLoad);
|
1796 |
};
|
1797 |
-
|
1798 |
return writeTask(dispatch) ;
|
1799 |
};
|
1800 |
-
|
1801 |
var dispatchHooks = function dispatchHooks(hostRef, isInitialLoad) {
|
1802 |
var endSchedule = createTime();
|
1803 |
var instance = hostRef.$lazyInstance$ ;
|
1804 |
var promise;
|
1805 |
-
|
1806 |
if (isInitialLoad) {
|
1807 |
{
|
1808 |
-
hostRef.$flags$ |= 256
|
1809 |
-
/* isListenReady */
|
1810 |
-
;
|
1811 |
-
|
1812 |
if (hostRef.$queuedListeners$) {
|
1813 |
hostRef.$queuedListeners$.map(function (_ref11) {
|
1814 |
var _ref12 = _slicedToArray(_ref11, 2),
|
1815 |
-
|
1816 |
-
|
1817 |
-
|
1818 |
return safeCall(instance, methodName, event);
|
1819 |
});
|
1820 |
hostRef.$queuedListeners$ = null;
|
1821 |
}
|
1822 |
}
|
1823 |
-
|
1824 |
{
|
1825 |
promise = safeCall(instance, 'componentWillLoad');
|
1826 |
}
|
1827 |
}
|
1828 |
-
|
1829 |
endSchedule();
|
1830 |
return then(promise, function () {
|
1831 |
return updateComponent(hostRef, instance, isInitialLoad);
|
1832 |
});
|
1833 |
};
|
1834 |
-
|
1835 |
var updateComponent = /*#__PURE__*/function () {
|
1836 |
var _ref13 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(hostRef, instance, isInitialLoad) {
|
1837 |
var elm, endUpdate, rc, endRender, childrenPromises, postUpdate;
|
@@ -1843,28 +1467,21 @@ var updateComponent = /*#__PURE__*/function () {
|
|
1843 |
elm = hostRef.$hostElement$;
|
1844 |
endUpdate = createTime();
|
1845 |
rc = elm['s-rc'];
|
1846 |
-
|
1847 |
if (isInitialLoad) {
|
1848 |
// DOM WRITE!
|
1849 |
attachStyles(hostRef);
|
1850 |
}
|
1851 |
-
|
1852 |
endRender = createTime();
|
1853 |
-
|
1854 |
{
|
1855 |
_context.next = 11;
|
1856 |
break;
|
1857 |
}
|
1858 |
-
|
1859 |
case 9:
|
1860 |
_context.next = 12;
|
1861 |
break;
|
1862 |
-
|
1863 |
case 11:
|
1864 |
callRender(hostRef, instance);
|
1865 |
-
|
1866 |
case 12:
|
1867 |
-
|
1868 |
if (rc) {
|
1869 |
// ok, so turns out there are some child host elements
|
1870 |
// waiting on this parent element to load
|
@@ -1874,28 +1491,21 @@ var updateComponent = /*#__PURE__*/function () {
|
|
1874 |
});
|
1875 |
elm['s-rc'] = undefined;
|
1876 |
}
|
1877 |
-
|
1878 |
endRender();
|
1879 |
endUpdate();
|
1880 |
-
|
1881 |
{
|
1882 |
childrenPromises = elm['s-p'];
|
1883 |
-
|
1884 |
postUpdate = function postUpdate() {
|
1885 |
return postUpdateComponent(hostRef);
|
1886 |
};
|
1887 |
-
|
1888 |
if (childrenPromises.length === 0) {
|
1889 |
postUpdate();
|
1890 |
} else {
|
1891 |
Promise.all(childrenPromises).then(postUpdate);
|
1892 |
-
hostRef.$flags$ |= 4
|
1893 |
-
/* isWaitingForChildren */
|
1894 |
-
;
|
1895 |
childrenPromises.length = 0;
|
1896 |
}
|
1897 |
}
|
1898 |
-
|
1899 |
case 19:
|
1900 |
case "end":
|
1901 |
return _context.stop();
|
@@ -1903,27 +1513,19 @@ var updateComponent = /*#__PURE__*/function () {
|
|
1903 |
}
|
1904 |
}, _callee);
|
1905 |
}));
|
1906 |
-
|
1907 |
return function updateComponent(_x, _x2, _x3) {
|
1908 |
return _ref13.apply(this, arguments);
|
1909 |
};
|
1910 |
}();
|
1911 |
-
|
1912 |
var callRender = function callRender(hostRef, instance, elm) {
|
1913 |
-
|
1914 |
try {
|
1915 |
instance = instance.render() ;
|
1916 |
-
|
1917 |
{
|
1918 |
-
hostRef.$flags$ &= ~16
|
1919 |
-
/* isQueuedForUpdate */
|
1920 |
-
;
|
1921 |
}
|
1922 |
|
1923 |
{
|
1924 |
-
hostRef.$flags$ |= 2
|
1925 |
-
/* hasRendered */
|
1926 |
-
;
|
1927 |
}
|
1928 |
|
1929 |
{
|
@@ -1941,39 +1543,28 @@ var callRender = function callRender(hostRef, instance, elm) {
|
|
1941 |
}
|
1942 |
return null;
|
1943 |
};
|
1944 |
-
|
1945 |
var postUpdateComponent = function postUpdateComponent(hostRef) {
|
1946 |
var elm = hostRef.$hostElement$;
|
1947 |
var endPostUpdate = createTime();
|
1948 |
var instance = hostRef.$lazyInstance$ ;
|
1949 |
var ancestorComponent = hostRef.$ancestorComponent$;
|
1950 |
-
|
1951 |
{
|
1952 |
|
1953 |
safeCall(instance, 'componentDidRender');
|
1954 |
}
|
1955 |
-
|
1956 |
-
|
1957 |
-
/* hasLoadedComponent */
|
1958 |
-
)) {
|
1959 |
-
hostRef.$flags$ |= 64
|
1960 |
-
/* hasLoadedComponent */
|
1961 |
-
;
|
1962 |
-
|
1963 |
{
|
1964 |
// DOM WRITE!
|
1965 |
addHydratedFlag(elm);
|
1966 |
}
|
1967 |
-
|
1968 |
{
|
1969 |
|
1970 |
safeCall(instance, 'componentDidLoad');
|
1971 |
}
|
1972 |
endPostUpdate();
|
1973 |
-
|
1974 |
{
|
1975 |
hostRef.$onReadyResolve$(elm);
|
1976 |
-
|
1977 |
if (!ancestorComponent) {
|
1978 |
appDidLoad();
|
1979 |
}
|
@@ -1981,38 +1572,27 @@ var postUpdateComponent = function postUpdateComponent(hostRef) {
|
|
1981 |
} else {
|
1982 |
endPostUpdate();
|
1983 |
}
|
1984 |
-
|
1985 |
{
|
1986 |
hostRef.$onInstanceResolve$(elm);
|
1987 |
-
}
|
|
|
1988 |
// the deepest elements load first then bubbles up
|
1989 |
-
|
1990 |
-
|
1991 |
{
|
1992 |
if (hostRef.$onRenderResolve$) {
|
1993 |
hostRef.$onRenderResolve$();
|
1994 |
hostRef.$onRenderResolve$ = undefined;
|
1995 |
}
|
1996 |
-
|
1997 |
-
if (hostRef.$flags$ & 512
|
1998 |
-
/* needsRerender */
|
1999 |
-
) {
|
2000 |
nextTick(function () {
|
2001 |
return scheduleUpdate(hostRef, false);
|
2002 |
});
|
2003 |
}
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
| 512
|
2008 |
-
/* needsRerender */
|
2009 |
-
);
|
2010 |
-
} // ( •_•)
|
2011 |
// ( •_•)>⌐■-■
|
2012 |
// (⌐■_■)
|
2013 |
-
|
2014 |
};
|
2015 |
-
|
2016 |
var appDidLoad = function appDidLoad(who) {
|
2017 |
// on appload
|
2018 |
// we have finish the first big initial render
|
@@ -2028,7 +1608,6 @@ var appDidLoad = function appDidLoad(who) {
|
|
2028 |
});
|
2029 |
});
|
2030 |
};
|
2031 |
-
|
2032 |
var safeCall = function safeCall(instance, method, arg) {
|
2033 |
if (instance && instance[method]) {
|
2034 |
try {
|
@@ -2037,57 +1616,41 @@ var safeCall = function safeCall(instance, method, arg) {
|
|
2037 |
consoleError(e);
|
2038 |
}
|
2039 |
}
|
2040 |
-
|
2041 |
return undefined;
|
2042 |
};
|
2043 |
-
|
2044 |
var then = function then(promise, thenFn) {
|
2045 |
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
2046 |
};
|
2047 |
-
|
2048 |
var addHydratedFlag = function addHydratedFlag(elm) {
|
2049 |
return elm.classList.add('hydrated') ;
|
2050 |
};
|
2051 |
-
|
2052 |
var parsePropertyValue = function parsePropertyValue(propValue, propType) {
|
2053 |
// ensure this value is of the correct prop type
|
2054 |
if (propValue != null && !isComplexType(propValue)) {
|
2055 |
-
if (propType & 4
|
2056 |
-
/* Boolean */
|
2057 |
-
) {
|
2058 |
// per the HTML spec, any string value means it is a boolean true value
|
2059 |
// but we'll cheat here and say that the string "false" is the boolean false
|
2060 |
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
2061 |
}
|
2062 |
-
|
2063 |
-
if (propType & 2
|
2064 |
-
/* Number */
|
2065 |
-
) {
|
2066 |
// force it to be a number
|
2067 |
return parseFloat(propValue);
|
2068 |
}
|
2069 |
-
|
2070 |
-
if (propType & 1
|
2071 |
-
/* String */
|
2072 |
-
) {
|
2073 |
// could have been passed as a number or boolean
|
2074 |
// but we still want it as a string
|
2075 |
return String(propValue);
|
2076 |
-
}
|
2077 |
-
|
2078 |
-
|
2079 |
return propValue;
|
2080 |
-
}
|
|
|
2081 |
// so no need to change to a different type
|
2082 |
-
|
2083 |
-
|
2084 |
return propValue;
|
2085 |
};
|
2086 |
-
|
2087 |
var getValue = function getValue(ref, propName) {
|
2088 |
return getHostRef(ref).$instanceValues$.get(propName);
|
2089 |
};
|
2090 |
-
|
2091 |
var setValue = function setValue(ref, propName, newVal, cmpMeta) {
|
2092 |
// check our new property value against our internal value
|
2093 |
var hostRef = getHostRef(ref);
|
@@ -2096,21 +1659,14 @@ var setValue = function setValue(ref, propName, newVal, cmpMeta) {
|
|
2096 |
var flags = hostRef.$flags$;
|
2097 |
var instance = hostRef.$lazyInstance$ ;
|
2098 |
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
2099 |
-
|
2100 |
-
if ((!(flags & 8
|
2101 |
-
/* isConstructingInstance */
|
2102 |
-
) || oldVal === undefined) && newVal !== oldVal) {
|
2103 |
// gadzooks! the property's value has changed!!
|
2104 |
// set our new value!
|
2105 |
hostRef.$instanceValues$.set(propName, newVal);
|
2106 |
-
|
2107 |
if (instance) {
|
2108 |
// get an array of method names of watch functions to call
|
2109 |
-
if (cmpMeta.$watchers$ && flags & 128
|
2110 |
-
/* isWatchReady */
|
2111 |
-
) {
|
2112 |
var watchMethods = cmpMeta.$watchers$[propName];
|
2113 |
-
|
2114 |
if (watchMethods) {
|
2115 |
// this instance is watching for when this property changed
|
2116 |
watchMethods.map(function (watchMethodName) {
|
@@ -2123,47 +1679,30 @@ var setValue = function setValue(ref, propName, newVal, cmpMeta) {
|
|
2123 |
});
|
2124 |
}
|
2125 |
}
|
2126 |
-
|
2127 |
-
|
2128 |
-
/* hasRendered */
|
2129 |
-
| 16
|
2130 |
-
/* isQueuedForUpdate */
|
2131 |
-
)) === 2
|
2132 |
-
/* hasRendered */
|
2133 |
-
) {
|
2134 |
// but only if we've already rendered, otherwise just chill out
|
2135 |
// queue that we need to do an update, but don't worry about queuing
|
2136 |
// up millions cuz this function ensures it only runs once
|
2137 |
-
|
2138 |
-
|
2139 |
scheduleUpdate(hostRef, false);
|
2140 |
}
|
2141 |
}
|
2142 |
}
|
2143 |
};
|
2144 |
-
|
2145 |
var proxyComponent = function proxyComponent(Cstr, cmpMeta, flags) {
|
2146 |
if (cmpMeta.$members$) {
|
2147 |
if (Cstr.watchers) {
|
2148 |
cmpMeta.$watchers$ = Cstr.watchers;
|
2149 |
-
}
|
2150 |
-
|
2151 |
-
|
2152 |
var members = Object.entries(cmpMeta.$members$);
|
2153 |
var prototype = Cstr.prototype;
|
2154 |
members.map(function (_ref14) {
|
2155 |
var _ref15 = _slicedToArray(_ref14, 2),
|
2156 |
-
|
2157 |
-
|
2158 |
-
|
2159 |
-
|
2160 |
-
if ((memberFlags & 31
|
2161 |
-
/* Prop */
|
2162 |
-
|| (flags & 2
|
2163 |
-
/* proxyState */
|
2164 |
-
) && memberFlags & 32
|
2165 |
-
/* State */
|
2166 |
-
)) {
|
2167 |
// proxyComponent - prop
|
2168 |
Object.defineProperty(prototype, memberName, {
|
2169 |
get: function get() {
|
@@ -2171,46 +1710,35 @@ var proxyComponent = function proxyComponent(Cstr, cmpMeta, flags) {
|
|
2171 |
return getValue(this, memberName);
|
2172 |
},
|
2173 |
set: function set(newValue) {
|
2174 |
-
|
2175 |
-
|
2176 |
setValue(this, memberName, newValue, cmpMeta);
|
2177 |
},
|
2178 |
configurable: true,
|
2179 |
enumerable: true
|
2180 |
});
|
2181 |
-
} else if (flags & 1
|
2182 |
-
/* isElementConstructor */
|
2183 |
-
&& memberFlags & 64
|
2184 |
-
/* Method */
|
2185 |
-
) {
|
2186 |
// proxyComponent - method
|
2187 |
Object.defineProperty(prototype, memberName, {
|
2188 |
value: function value() {
|
2189 |
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
2190 |
args[_key2] = arguments[_key2];
|
2191 |
}
|
2192 |
-
|
2193 |
var ref = getHostRef(this);
|
2194 |
return ref.$onInstancePromise$.then(function () {
|
2195 |
var _ref$$lazyInstance$;
|
2196 |
-
|
2197 |
return (_ref$$lazyInstance$ = ref.$lazyInstance$)[memberName].apply(_ref$$lazyInstance$, args);
|
2198 |
});
|
2199 |
}
|
2200 |
});
|
2201 |
}
|
2202 |
});
|
2203 |
-
|
2204 |
-
if ((flags & 1
|
2205 |
-
/* isElementConstructor */
|
2206 |
-
)) {
|
2207 |
var attrNameToPropName = new Map();
|
2208 |
-
|
2209 |
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
2210 |
var _this = this;
|
2211 |
-
|
2212 |
plt.jmp(function () {
|
2213 |
-
var propName = attrNameToPropName.get(attrName);
|
|
|
2214 |
// in the case where an attribute was set inline.
|
2215 |
// ```html
|
2216 |
// <my-component some-attribute="some-value"></my-component>
|
@@ -2243,92 +1771,68 @@ var proxyComponent = function proxyComponent(Cstr, cmpMeta, flags) {
|
|
2243 |
// TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
|
2244 |
// properties here given that this goes against best practices outlined here
|
2245 |
// https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
|
2246 |
-
|
2247 |
if (_this.hasOwnProperty(propName)) {
|
2248 |
newValue = _this[propName];
|
2249 |
delete _this[propName];
|
2250 |
}
|
2251 |
-
|
2252 |
_this[propName] = newValue === null && typeof _this[propName] === 'boolean' ? false : newValue;
|
2253 |
});
|
2254 |
-
};
|
|
|
2255 |
// and also create a map of html attribute name to js property name
|
2256 |
-
|
2257 |
-
|
2258 |
Cstr.observedAttributes = members.filter(function (_ref16) {
|
2259 |
var _ref17 = _slicedToArray(_ref16, 2),
|
2260 |
-
|
2261 |
-
|
2262 |
return m[0] & 15;
|
2263 |
-
}
|
2264 |
-
/* HasAttribute */
|
2265 |
-
) // filter to only keep props that should match attributes
|
2266 |
.map(function (_ref18) {
|
2267 |
var _ref19 = _slicedToArray(_ref18, 2),
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
var attrName = m[1] || propName;
|
2272 |
attrNameToPropName.set(attrName, propName);
|
2273 |
-
|
2274 |
-
if (m[0] & 512
|
2275 |
-
/* ReflectAttr */
|
2276 |
-
) {
|
2277 |
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
2278 |
}
|
2279 |
-
|
2280 |
return attrName;
|
2281 |
});
|
2282 |
}
|
2283 |
}
|
2284 |
-
|
2285 |
return Cstr;
|
2286 |
};
|
2287 |
-
|
2288 |
var initializeComponent = /*#__PURE__*/function () {
|
2289 |
var _ref20 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(elm, hostRef, cmpMeta, hmrVersionId, Cstr) {
|
2290 |
var endLoad, endNewInstance, style, _scopeId, endRegisterStyles, ancestorComponent, schedule;
|
2291 |
-
|
2292 |
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2293 |
while (1) {
|
2294 |
switch (_context2.prev = _context2.next) {
|
2295 |
case 0:
|
2296 |
-
if (!((hostRef.$flags$ & 32
|
2297 |
-
/* hasInitializedComponent */
|
2298 |
-
) === 0)) {
|
2299 |
_context2.next = 37;
|
2300 |
break;
|
2301 |
}
|
2302 |
-
|
2303 |
// we haven't initialized this element yet
|
2304 |
-
hostRef.$flags$ |= 32
|
2305 |
-
|
2306 |
-
; // lazy loaded components
|
2307 |
// request the component's implementation to be
|
2308 |
// wired up with the host element
|
2309 |
-
|
2310 |
Cstr = loadModule(cmpMeta);
|
2311 |
-
|
2312 |
if (!Cstr.then) {
|
2313 |
_context2.next = 10;
|
2314 |
break;
|
2315 |
}
|
2316 |
-
|
2317 |
// Await creates a micro-task avoid if possible
|
2318 |
endLoad = uniqueTime();
|
2319 |
_context2.next = 8;
|
2320 |
return Cstr;
|
2321 |
-
|
2322 |
case 8:
|
2323 |
Cstr = _context2.sent;
|
2324 |
endLoad();
|
2325 |
-
|
2326 |
case 10:
|
2327 |
{
|
2328 |
_context2.next = 12;
|
2329 |
break;
|
2330 |
}
|
2331 |
-
|
2332 |
case 12:
|
2333 |
if (!Cstr.isProxied) {
|
2334 |
// we've never proxied this Constructor before
|
@@ -2337,104 +1841,73 @@ var initializeComponent = /*#__PURE__*/function () {
|
|
2337 |
{
|
2338 |
cmpMeta.$watchers$ = Cstr.watchers;
|
2339 |
}
|
2340 |
-
|
2341 |
-
proxyComponent(Cstr, cmpMeta, 2
|
2342 |
-
/* proxyState */
|
2343 |
-
);
|
2344 |
Cstr.isProxied = true;
|
2345 |
}
|
2346 |
-
|
2347 |
endNewInstance = createTime(); // ok, time to construct the instance
|
2348 |
// but let's keep track of when we start and stop
|
2349 |
// so that the getters/setters don't incorrectly step on data
|
2350 |
-
|
2351 |
{
|
2352 |
-
hostRef.$flags$ |= 8
|
2353 |
-
|
2354 |
-
|
2355 |
-
} // construct the lazy-loaded component implementation
|
2356 |
// passing the hostRef is very important during
|
2357 |
// construction in order to directly wire together the
|
2358 |
// host element and the lazy-loaded instance
|
2359 |
-
|
2360 |
-
|
2361 |
try {
|
2362 |
new Cstr(hostRef);
|
2363 |
} catch (e) {
|
2364 |
consoleError(e);
|
2365 |
}
|
2366 |
-
|
2367 |
{
|
2368 |
-
hostRef.$flags$ &= ~8
|
2369 |
-
/* isConstructingInstance */
|
2370 |
-
;
|
2371 |
}
|
2372 |
|
2373 |
{
|
2374 |
-
hostRef.$flags$ |= 128
|
2375 |
-
/* isWatchReady */
|
2376 |
-
;
|
2377 |
}
|
2378 |
|
2379 |
endNewInstance();
|
2380 |
_context2.next = 25;
|
2381 |
break;
|
2382 |
-
|
2383 |
case 22:
|
2384 |
// sync constructor component
|
2385 |
Cstr = elm.constructor;
|
2386 |
-
hostRef.$flags$ |= 32
|
2387 |
-
|
2388 |
-
; // wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
|
2389 |
// watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
|
2390 |
// Stencil has completed instantiating the component.
|
2391 |
-
|
2392 |
customElements.whenDefined(cmpMeta.$tagName$).then(function () {
|
2393 |
-
return hostRef.$flags$ |= 128
|
2394 |
-
/* isWatchReady */
|
2395 |
-
;
|
2396 |
});
|
2397 |
-
|
2398 |
case 25:
|
2399 |
if (!(Cstr.style)) {
|
2400 |
_context2.next = 37;
|
2401 |
break;
|
2402 |
}
|
2403 |
-
|
2404 |
// this component has styles but we haven't registered them yet
|
2405 |
style = Cstr.style;
|
2406 |
-
|
2407 |
_scopeId = getScopeId(cmpMeta);
|
2408 |
-
|
2409 |
if (styles.has(_scopeId)) {
|
2410 |
_context2.next = 37;
|
2411 |
break;
|
2412 |
}
|
2413 |
-
|
2414 |
endRegisterStyles = createTime();
|
2415 |
-
|
2416 |
{
|
2417 |
_context2.next = 35;
|
2418 |
break;
|
2419 |
}
|
2420 |
-
|
2421 |
case 34:
|
2422 |
style = _context2.sent;
|
2423 |
-
|
2424 |
case 35:
|
2425 |
-
registerStyle(_scopeId, style, !!(cmpMeta.$flags$ & 1
|
2426 |
-
/* shadowDomEncapsulation */
|
2427 |
-
));
|
2428 |
endRegisterStyles();
|
2429 |
-
|
2430 |
case 37:
|
2431 |
// we've successfully created a lazy instance
|
2432 |
ancestorComponent = hostRef.$ancestorComponent$;
|
2433 |
-
|
2434 |
schedule = function schedule() {
|
2435 |
return scheduleUpdate(hostRef, true);
|
2436 |
};
|
2437 |
-
|
2438 |
if (ancestorComponent && ancestorComponent['s-rc']) {
|
2439 |
// this is the intial load and this component it has an ancestor component
|
2440 |
// but the ancestor component has NOT fired its will update lifecycle yet
|
@@ -2446,7 +1919,6 @@ var initializeComponent = /*#__PURE__*/function () {
|
|
2446 |
} else {
|
2447 |
schedule();
|
2448 |
}
|
2449 |
-
|
2450 |
case 40:
|
2451 |
case "end":
|
2452 |
return _context2.stop();
|
@@ -2454,48 +1926,32 @@ var initializeComponent = /*#__PURE__*/function () {
|
|
2454 |
}
|
2455 |
}, _callee2);
|
2456 |
}));
|
2457 |
-
|
2458 |
return function initializeComponent(_x4, _x5, _x6, _x7, _x8) {
|
2459 |
return _ref20.apply(this, arguments);
|
2460 |
};
|
2461 |
}();
|
2462 |
-
|
2463 |
var _connectedCallback = function connectedCallback(elm) {
|
2464 |
-
if ((plt.$flags$ & 1
|
2465 |
-
/* isTmpDisconnected */
|
2466 |
-
) === 0) {
|
2467 |
var hostRef = getHostRef(elm);
|
2468 |
var cmpMeta = hostRef.$cmpMeta$;
|
2469 |
var endConnected = createTime();
|
2470 |
-
|
2471 |
-
if (!(hostRef.$flags$ & 1
|
2472 |
-
/* hasConnected */
|
2473 |
-
)) {
|
2474 |
// first time this component has connected
|
2475 |
-
hostRef.$flags$ |= 1
|
2476 |
-
/* hasConnected */
|
2477 |
-
;
|
2478 |
var hostId;
|
2479 |
-
|
2480 |
if (!hostId) {
|
2481 |
// initUpdate
|
2482 |
// if the slot polyfill is required we'll need to put some nodes
|
2483 |
// in here to act as original content anchors as we move nodes around
|
2484 |
// host element has been connected to the DOM
|
2485 |
-
if (cmpMeta.$flags$ & (4
|
2486 |
-
/* hasSlotRelocation */
|
2487 |
-
| 8
|
2488 |
-
/* needsShadowDomShim */
|
2489 |
-
)) {
|
2490 |
setContentReference(elm);
|
2491 |
}
|
2492 |
}
|
2493 |
-
|
2494 |
{
|
2495 |
// find the first ancestor component (if there is one) and register
|
2496 |
// this component as one of the actively loading child components for its ancestor
|
2497 |
var ancestorComponent = elm;
|
2498 |
-
|
2499 |
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
2500 |
// climb up the ancestors looking for the first
|
2501 |
// component that hasn't finished its lifecycle update yet
|
@@ -2506,27 +1962,22 @@ var _connectedCallback = function connectedCallback(elm) {
|
|
2506 |
break;
|
2507 |
}
|
2508 |
}
|
2509 |
-
}
|
|
|
2510 |
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
2511 |
-
|
2512 |
-
|
2513 |
if (cmpMeta.$members$) {
|
2514 |
Object.entries(cmpMeta.$members$).map(function (_ref21) {
|
2515 |
var _ref22 = _slicedToArray(_ref21, 2),
|
2516 |
-
|
2517 |
-
|
2518 |
-
|
2519 |
-
|
2520 |
-
if (memberFlags & 31
|
2521 |
-
/* Prop */
|
2522 |
-
&& elm.hasOwnProperty(memberName)) {
|
2523 |
var value = elm[memberName];
|
2524 |
delete elm[memberName];
|
2525 |
elm[memberName] = value;
|
2526 |
}
|
2527 |
});
|
2528 |
}
|
2529 |
-
|
2530 |
{
|
2531 |
initializeComponent(elm, hostRef, cmpMeta);
|
2532 |
}
|
@@ -2534,13 +1985,11 @@ var _connectedCallback = function connectedCallback(elm) {
|
|
2534 |
// not the first time this has connected
|
2535 |
// reattach any event listeners to the host
|
2536 |
// since they would have been removed when disconnected
|
2537 |
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
2538 |
}
|
2539 |
-
|
2540 |
endConnected();
|
2541 |
}
|
2542 |
};
|
2543 |
-
|
2544 |
var setContentReference = function setContentReference(elm) {
|
2545 |
// only required when we're NOT using native shadow dom (slot)
|
2546 |
// or this browser doesn't support native shadow dom
|
@@ -2552,14 +2001,10 @@ var setContentReference = function setContentReference(elm) {
|
|
2552 |
contentRefElm['s-cn'] = true;
|
2553 |
elm.insertBefore(contentRefElm, elm.firstChild);
|
2554 |
};
|
2555 |
-
|
2556 |
var _disconnectedCallback = function disconnectedCallback(elm) {
|
2557 |
-
if ((plt.$flags$ & 1
|
2558 |
-
/* isTmpDisconnected */
|
2559 |
-
) === 0) {
|
2560 |
var hostRef = getHostRef(elm);
|
2561 |
var instance = hostRef.$lazyInstance$ ;
|
2562 |
-
|
2563 |
{
|
2564 |
if (hostRef.$rmListeners$) {
|
2565 |
hostRef.$rmListeners$.map(function (rmListener) {
|
@@ -2567,14 +2012,12 @@ var _disconnectedCallback = function disconnectedCallback(elm) {
|
|
2567 |
});
|
2568 |
hostRef.$rmListeners$ = undefined;
|
2569 |
}
|
2570 |
-
}
|
2571 |
-
|
2572 |
{
|
2573 |
safeCall(instance, 'disconnectedCallback');
|
2574 |
}
|
2575 |
}
|
2576 |
};
|
2577 |
-
|
2578 |
var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
2579 |
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2580 |
var endBootstrap = createTime();
|
@@ -2589,7 +2032,6 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2589 |
var isBootstrapping = true;
|
2590 |
Object.assign(plt, options);
|
2591 |
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
2592 |
-
|
2593 |
lazyBundles.map(function (lazyBundle) {
|
2594 |
return lazyBundle[1].map(function (compactMeta) {
|
2595 |
var cmpMeta = {
|
@@ -2598,44 +2040,32 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2598 |
$members$: compactMeta[2],
|
2599 |
$listeners$: compactMeta[3]
|
2600 |
};
|
2601 |
-
|
2602 |
{
|
2603 |
cmpMeta.$members$ = compactMeta[2];
|
2604 |
}
|
2605 |
-
|
2606 |
{
|
2607 |
cmpMeta.$listeners$ = compactMeta[3];
|
2608 |
}
|
2609 |
-
|
2610 |
{
|
2611 |
cmpMeta.$attrsToReflect$ = [];
|
2612 |
}
|
2613 |
-
|
2614 |
{
|
2615 |
cmpMeta.$watchers$ = {};
|
2616 |
}
|
2617 |
|
2618 |
var tagName = cmpMeta.$tagName$;
|
2619 |
-
|
2620 |
var HostElement = /*#__PURE__*/function (_HTMLElement) {
|
2621 |
_inherits(HostElement, _HTMLElement);
|
2622 |
-
|
2623 |
var _super2 = _createSuper(HostElement);
|
2624 |
-
|
2625 |
// StencilLazyHost
|
2626 |
function HostElement(self) {
|
2627 |
var _this2;
|
2628 |
-
|
2629 |
_classCallCheck(this, HostElement);
|
2630 |
-
|
2631 |
// @ts-ignore
|
2632 |
_this2 = _super2.call(this, self);
|
2633 |
self = _assertThisInitialized(_this2);
|
2634 |
registerHost(self, cmpMeta);
|
2635 |
-
|
2636 |
-
if (cmpMeta.$flags$ & 1
|
2637 |
-
/* shadowDomEncapsulation */
|
2638 |
-
) {
|
2639 |
// this component is using shadow dom
|
2640 |
// and this browser supports shadow dom
|
2641 |
// add the read-only property "shadowRoot" to the host element
|
@@ -2648,20 +2078,16 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2648 |
}
|
2649 |
}
|
2650 |
}
|
2651 |
-
|
2652 |
return _this2;
|
2653 |
}
|
2654 |
-
|
2655 |
_createClass(HostElement, [{
|
2656 |
key: "connectedCallback",
|
2657 |
value: function connectedCallback() {
|
2658 |
var _this3 = this;
|
2659 |
-
|
2660 |
if (appLoadFallback) {
|
2661 |
clearTimeout(appLoadFallback);
|
2662 |
appLoadFallback = null;
|
2663 |
}
|
2664 |
-
|
2665 |
if (isBootstrapping) {
|
2666 |
// connectedCallback will be processed once all components have been registered
|
2667 |
deferredConnectedCallbacks.push(this);
|
@@ -2675,7 +2101,6 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2675 |
key: "disconnectedCallback",
|
2676 |
value: function disconnectedCallback() {
|
2677 |
var _this4 = this;
|
2678 |
-
|
2679 |
plt.jmp(function () {
|
2680 |
return _disconnectedCallback(_this4);
|
2681 |
});
|
@@ -2686,17 +2111,12 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2686 |
return getHostRef(this).$onReadyPromise$;
|
2687 |
}
|
2688 |
}]);
|
2689 |
-
|
2690 |
return HostElement;
|
2691 |
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
2692 |
-
|
2693 |
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
2694 |
-
|
2695 |
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
2696 |
cmpTags.push(tagName);
|
2697 |
-
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1
|
2698 |
-
/* isElementConstructor */
|
2699 |
-
));
|
2700 |
}
|
2701 |
});
|
2702 |
});
|
@@ -2705,11 +2125,9 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2705 |
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
2706 |
visibilityStyle.setAttribute('data-styles', '');
|
2707 |
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
2708 |
-
}
|
2709 |
-
|
2710 |
-
|
2711 |
isBootstrapping = false;
|
2712 |
-
|
2713 |
if (deferredConnectedCallbacks.length) {
|
2714 |
deferredConnectedCallbacks.map(function (host) {
|
2715 |
return host.connectedCallback();
|
@@ -2720,22 +2138,17 @@ var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
|
2720 |
return appLoadFallback = setTimeout(appDidLoad, 30);
|
2721 |
});
|
2722 |
}
|
2723 |
-
}
|
2724 |
-
|
2725 |
-
|
2726 |
endBootstrap();
|
2727 |
};
|
2728 |
-
|
2729 |
var hostRefs = new WeakMap();
|
2730 |
-
|
2731 |
var getHostRef = function getHostRef(ref) {
|
2732 |
return hostRefs.get(ref);
|
2733 |
};
|
2734 |
-
|
2735 |
var registerInstance = function registerInstance(lazyInstance, hostRef) {
|
2736 |
return hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
2737 |
};
|
2738 |
-
|
2739 |
var registerHost = function registerHost(elm, cmpMeta) {
|
2740 |
var hostRef = {
|
2741 |
$flags$: 0,
|
@@ -2743,13 +2156,11 @@ var registerHost = function registerHost(elm, cmpMeta) {
|
|
2743 |
$cmpMeta$: cmpMeta,
|
2744 |
$instanceValues$: new Map()
|
2745 |
};
|
2746 |
-
|
2747 |
{
|
2748 |
hostRef.$onInstancePromise$ = new Promise(function (r) {
|
2749 |
return hostRef.$onInstanceResolve$ = r;
|
2750 |
});
|
2751 |
}
|
2752 |
-
|
2753 |
{
|
2754 |
hostRef.$onReadyPromise$ = new Promise(function (r) {
|
2755 |
return hostRef.$onReadyResolve$ = r;
|
@@ -2757,61 +2168,44 @@ var registerHost = function registerHost(elm, cmpMeta) {
|
|
2757 |
elm['s-p'] = [];
|
2758 |
elm['s-rc'] = [];
|
2759 |
}
|
2760 |
-
|
2761 |
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
2762 |
return hostRefs.set(elm, hostRef);
|
2763 |
};
|
2764 |
-
|
2765 |
var isMemberInElement = function isMemberInElement(elm, memberName) {
|
2766 |
return memberName in elm;
|
2767 |
};
|
2768 |
-
|
2769 |
var consoleError = function consoleError(e, el) {
|
2770 |
return (0, console.error)(e, el);
|
2771 |
};
|
2772 |
-
|
2773 |
var cmpModules = /*@__PURE__*/new Map();
|
2774 |
-
|
2775 |
var loadModule = function loadModule(cmpMeta, hostRef, hmrVersionId) {
|
2776 |
// loadModuleImport
|
2777 |
var exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
2778 |
var bundleId = cmpMeta.$lazyBundleId$;
|
2779 |
-
|
2780 |
var module = cmpModules.get(bundleId) ;
|
2781 |
-
|
2782 |
if (module) {
|
2783 |
return module[exportName];
|
2784 |
}
|
2785 |
-
|
2786 |
return import(
|
2787 |
/* webpackInclude: /\.entry\.js$/ */
|
2788 |
-
|
2789 |
/* webpackExclude: /\.system\.entry\.js$/ */
|
2790 |
-
|
2791 |
/* webpackMode: "lazy" */
|
2792 |
"./".concat(bundleId, ".entry.js").concat('')).then(function (importedModule) {
|
2793 |
{
|
2794 |
cmpModules.set(bundleId, importedModule);
|
2795 |
}
|
2796 |
-
|
2797 |
return importedModule[exportName];
|
2798 |
}, consoleError);
|
2799 |
};
|
2800 |
-
|
2801 |
var styles = new Map();
|
2802 |
var queueDomReads = [];
|
2803 |
var queueDomWrites = [];
|
2804 |
-
|
2805 |
var queueTask = function queueTask(queue, write) {
|
2806 |
return function (cb) {
|
2807 |
queue.push(cb);
|
2808 |
-
|
2809 |
if (!queuePending) {
|
2810 |
queuePending = true;
|
2811 |
-
|
2812 |
-
if (write && plt.$flags$ & 4
|
2813 |
-
/* queueSync */
|
2814 |
-
) {
|
2815 |
nextTick(flush);
|
2816 |
} else {
|
2817 |
plt.raf(flush);
|
@@ -2819,7 +2213,6 @@ var queueTask = function queueTask(queue, write) {
|
|
2819 |
}
|
2820 |
};
|
2821 |
};
|
2822 |
-
|
2823 |
var consume = function consume(queue) {
|
2824 |
for (var _i7 = 0; _i7 < queue.length; _i7++) {
|
2825 |
try {
|
@@ -2828,20 +2221,16 @@ var consume = function consume(queue) {
|
|
2828 |
consoleError(e);
|
2829 |
}
|
2830 |
}
|
2831 |
-
|
2832 |
queue.length = 0;
|
2833 |
};
|
2834 |
-
|
2835 |
var flush = function flush() {
|
|
|
2836 |
// a throttle on how many can run in a certain time
|
2837 |
// DOM READS!!!
|
2838 |
-
|
2839 |
-
|
2840 |
-
consume(queueDomReads); // DOM WRITES!!!
|
2841 |
-
|
2842 |
{
|
2843 |
consume(queueDomWrites);
|
2844 |
-
|
2845 |
if (queuePending = queueDomReads.length > 0) {
|
2846 |
// still more to do yet, but we've run out of time
|
2847 |
// let's let this thing cool off and try again in the next tick
|
@@ -2849,10 +2238,9 @@ var flush = function flush() {
|
|
2849 |
}
|
2850 |
}
|
2851 |
};
|
2852 |
-
|
2853 |
var nextTick = /*@__PURE__*/function nextTick(cb) {
|
2854 |
return promiseResolve().then(cb);
|
2855 |
};
|
2856 |
var writeTask = /*@__PURE__*/queueTask(queueDomWrites, true);
|
2857 |
|
2858 |
-
export { Host as H, _slicedToArray as _, _objectSpread2 as a, bootstrapLazy as b, createEvent as c, _defineProperty as d, _createClass as e, _typeof as f, getElement as g, h, _classCallCheck as i, _toConsumableArray as j, _objectWithoutProperties as k,
|
1 |
function ownKeys(object, enumerableOnly) {
|
2 |
var keys = Object.keys(object);
|
|
|
3 |
if (Object.getOwnPropertySymbols) {
|
4 |
var symbols = Object.getOwnPropertySymbols(object);
|
5 |
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
6 |
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
7 |
})), keys.push.apply(keys, symbols);
|
8 |
}
|
|
|
9 |
return keys;
|
10 |
}
|
|
|
11 |
function _objectSpread2(target) {
|
12 |
for (var i = 1; i < arguments.length; i++) {
|
13 |
var source = null != arguments[i] ? arguments[i] : {};
|
17 |
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
18 |
});
|
19 |
}
|
|
|
20 |
return target;
|
21 |
}
|
|
|
22 |
function _typeof(obj) {
|
23 |
"@babel/helpers - typeof";
|
24 |
|
28 |
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
29 |
}, _typeof(obj);
|
30 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
32 |
try {
|
33 |
var info = gen[key](arg);
|
36 |
reject(error);
|
37 |
return;
|
38 |
}
|
|
|
39 |
if (info.done) {
|
40 |
resolve(value);
|
41 |
} else {
|
42 |
Promise.resolve(value).then(_next, _throw);
|
43 |
}
|
44 |
}
|
|
|
45 |
function _asyncToGenerator(fn) {
|
46 |
return function () {
|
47 |
var self = this,
|
48 |
+
args = arguments;
|
49 |
return new Promise(function (resolve, reject) {
|
50 |
var gen = fn.apply(self, args);
|
|
|
51 |
function _next(value) {
|
52 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
53 |
}
|
|
|
54 |
function _throw(err) {
|
55 |
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
56 |
}
|
|
|
57 |
_next(undefined);
|
58 |
});
|
59 |
};
|
60 |
}
|
|
|
61 |
function _classCallCheck(instance, Constructor) {
|
62 |
if (!(instance instanceof Constructor)) {
|
63 |
throw new TypeError("Cannot call a class as a function");
|
64 |
}
|
65 |
}
|
|
|
66 |
function _defineProperties(target, props) {
|
67 |
for (var i = 0; i < props.length; i++) {
|
68 |
var descriptor = props[i];
|
72 |
Object.defineProperty(target, descriptor.key, descriptor);
|
73 |
}
|
74 |
}
|
|
|
75 |
function _createClass(Constructor, protoProps, staticProps) {
|
76 |
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
77 |
if (staticProps) _defineProperties(Constructor, staticProps);
|
80 |
});
|
81 |
return Constructor;
|
82 |
}
|
|
|
83 |
function _defineProperty(obj, key, value) {
|
84 |
if (key in obj) {
|
85 |
Object.defineProperty(obj, key, {
|
91 |
} else {
|
92 |
obj[key] = value;
|
93 |
}
|
|
|
94 |
return obj;
|
95 |
}
|
|
|
96 |
function _inherits(subClass, superClass) {
|
97 |
if (typeof superClass !== "function" && superClass !== null) {
|
98 |
throw new TypeError("Super expression must either be null or a function");
|
99 |
}
|
100 |
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
101 |
+
constructor: {
|
102 |
+
value: subClass,
|
103 |
+
writable: true,
|
104 |
+
configurable: true
|
105 |
+
}
|
106 |
+
});
|
107 |
Object.defineProperty(subClass, "prototype", {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
writable: false
|
109 |
});
|
110 |
if (superClass) _setPrototypeOf(subClass, superClass);
|
111 |
}
|
|
|
112 |
function _getPrototypeOf(o) {
|
113 |
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
114 |
return o.__proto__ || Object.getPrototypeOf(o);
|
115 |
};
|
116 |
return _getPrototypeOf(o);
|
117 |
}
|
|
|
118 |
function _setPrototypeOf(o, p) {
|
119 |
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
120 |
o.__proto__ = p;
|
121 |
return o;
|
122 |
};
|
|
|
123 |
return _setPrototypeOf(o, p);
|
124 |
}
|
|
|
125 |
function _isNativeReflectConstruct() {
|
126 |
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
127 |
if (Reflect.construct.sham) return false;
|
128 |
if (typeof Proxy === "function") return true;
|
|
|
129 |
try {
|
130 |
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
131 |
return true;
|
133 |
return false;
|
134 |
}
|
135 |
}
|
|
|
136 |
function _construct(Parent, args, Class) {
|
137 |
if (_isNativeReflectConstruct()) {
|
138 |
+
_construct = Reflect.construct.bind();
|
139 |
} else {
|
140 |
_construct = function _construct(Parent, args, Class) {
|
141 |
var a = [null];
|
146 |
return instance;
|
147 |
};
|
148 |
}
|
|
|
149 |
return _construct.apply(null, arguments);
|
150 |
}
|
|
|
151 |
function _isNativeFunction(fn) {
|
152 |
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
153 |
}
|
|
|
154 |
function _wrapNativeSuper(Class) {
|
155 |
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
|
156 |
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
157 |
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
|
158 |
if (typeof Class !== "function") {
|
159 |
throw new TypeError("Super expression must either be null or a function");
|
160 |
}
|
|
|
161 |
if (typeof _cache !== "undefined") {
|
162 |
if (_cache.has(Class)) return _cache.get(Class);
|
|
|
163 |
_cache.set(Class, Wrapper);
|
164 |
}
|
|
|
165 |
function Wrapper() {
|
166 |
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
167 |
}
|
|
|
168 |
Wrapper.prototype = Object.create(Class.prototype, {
|
169 |
constructor: {
|
170 |
value: Wrapper,
|
175 |
});
|
176 |
return _setPrototypeOf(Wrapper, Class);
|
177 |
};
|
|
|
178 |
return _wrapNativeSuper(Class);
|
179 |
}
|
|
|
180 |
function _objectWithoutPropertiesLoose(source, excluded) {
|
181 |
if (source == null) return {};
|
182 |
var target = {};
|
183 |
var sourceKeys = Object.keys(source);
|
184 |
var key, i;
|
|
|
185 |
for (i = 0; i < sourceKeys.length; i++) {
|
186 |
key = sourceKeys[i];
|
187 |
if (excluded.indexOf(key) >= 0) continue;
|
188 |
target[key] = source[key];
|
189 |
}
|
|
|
190 |
return target;
|
191 |
}
|
|
|
192 |
function _objectWithoutProperties(source, excluded) {
|
193 |
if (source == null) return {};
|
|
|
194 |
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
|
195 |
var key, i;
|
|
|
196 |
if (Object.getOwnPropertySymbols) {
|
197 |
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
|
198 |
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
199 |
key = sourceSymbolKeys[i];
|
200 |
if (excluded.indexOf(key) >= 0) continue;
|
202 |
target[key] = source[key];
|
203 |
}
|
204 |
}
|
|
|
205 |
return target;
|
206 |
}
|
|
|
207 |
function _assertThisInitialized(self) {
|
208 |
if (self === void 0) {
|
209 |
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
210 |
}
|
|
|
211 |
return self;
|
212 |
}
|
|
|
213 |
function _possibleConstructorReturn(self, call) {
|
214 |
if (call && (typeof call === "object" || typeof call === "function")) {
|
215 |
return call;
|
216 |
} else if (call !== void 0) {
|
217 |
throw new TypeError("Derived constructors may only return object or undefined");
|
218 |
}
|
|
|
219 |
return _assertThisInitialized(self);
|
220 |
}
|
|
|
221 |
function _createSuper(Derived) {
|
222 |
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
|
223 |
return function _createSuperInternal() {
|
224 |
var Super = _getPrototypeOf(Derived),
|
225 |
+
result;
|
|
|
226 |
if (hasNativeReflectConstruct) {
|
227 |
var NewTarget = _getPrototypeOf(this).constructor;
|
|
|
228 |
result = Reflect.construct(Super, arguments, NewTarget);
|
229 |
} else {
|
230 |
result = Super.apply(this, arguments);
|
231 |
}
|
|
|
232 |
return _possibleConstructorReturn(this, result);
|
233 |
};
|
234 |
}
|
|
|
235 |
function _slicedToArray(arr, i) {
|
236 |
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
237 |
}
|
|
|
238 |
function _toConsumableArray(arr) {
|
239 |
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
240 |
}
|
|
|
241 |
function _arrayWithoutHoles(arr) {
|
242 |
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
243 |
}
|
|
|
244 |
function _arrayWithHoles(arr) {
|
245 |
if (Array.isArray(arr)) return arr;
|
246 |
}
|
|
|
247 |
function _iterableToArray(iter) {
|
248 |
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
249 |
}
|
|
|
250 |
function _iterableToArrayLimit(arr, i) {
|
251 |
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
|
252 |
if (_i == null) return;
|
253 |
var _arr = [];
|
254 |
var _n = true;
|
255 |
var _d = false;
|
|
|
256 |
var _s, _e;
|
|
|
257 |
try {
|
258 |
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
259 |
_arr.push(_s.value);
|
|
|
260 |
if (i && _arr.length === i) break;
|
261 |
}
|
262 |
} catch (err) {
|
269 |
if (_d) throw _e;
|
270 |
}
|
271 |
}
|
|
|
272 |
return _arr;
|
273 |
}
|
|
|
274 |
function _unsupportedIterableToArray(o, minLen) {
|
275 |
if (!o) return;
|
276 |
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
279 |
if (n === "Map" || n === "Set") return Array.from(o);
|
280 |
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
281 |
}
|
|
|
282 |
function _arrayLikeToArray(arr, len) {
|
283 |
if (len == null || len > arr.length) len = arr.length;
|
|
|
284 |
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
|
285 |
return arr2;
|
286 |
}
|
|
|
287 |
function _nonIterableSpread() {
|
288 |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
289 |
}
|
|
|
290 |
function _nonIterableRest() {
|
291 |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
292 |
}
|
|
|
293 |
function _createForOfIteratorHelper(o, allowArrayLike) {
|
294 |
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
|
295 |
if (!it) {
|
296 |
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
297 |
if (it) o = it;
|
298 |
var i = 0;
|
|
|
299 |
var F = function () {};
|
|
|
300 |
return {
|
301 |
s: F,
|
302 |
n: function () {
|
314 |
f: F
|
315 |
};
|
316 |
}
|
|
|
317 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
318 |
}
|
|
|
319 |
var normalCompletion = true,
|
320 |
+
didErr = false,
|
321 |
+
err;
|
322 |
return {
|
323 |
s: function () {
|
324 |
it = it.call(o);
|
356 |
var doc = win.document || {
|
357 |
head: {}
|
358 |
};
|
|
|
359 |
var plt = {
|
360 |
$flags$: 0,
|
361 |
$resourcesUrl$: '',
|
375 |
return new CustomEvent(eventName, opts);
|
376 |
}
|
377 |
};
|
|
|
378 |
var promiseResolve = function promiseResolve(v) {
|
379 |
return Promise.resolve(v);
|
380 |
};
|
|
|
381 |
var supportsConstructibleStylesheets = /*@__PURE__*/function () {
|
382 |
try {
|
383 |
new CSSStyleSheet();
|
384 |
return typeof new CSSStyleSheet().replace === 'function';
|
385 |
} catch (e) {}
|
|
|
386 |
return false;
|
387 |
}() ;
|
|
|
388 |
var addHostEventListeners = function addHostEventListeners(elm, hostRef, listeners, attachParentListeners) {
|
389 |
if (listeners) {
|
390 |
|
391 |
listeners.map(function (_ref6) {
|
392 |
var _ref7 = _slicedToArray(_ref6, 3),
|
393 |
+
flags = _ref7[0],
|
394 |
+
name = _ref7[1],
|
395 |
+
method = _ref7[2];
|
|
|
396 |
var target = getHostListenerTarget(elm, flags) ;
|
397 |
var handler = hostListenerProxy(hostRef, method);
|
398 |
var opts = hostListenerOpts(flags);
|
403 |
});
|
404 |
}
|
405 |
};
|
|
|
406 |
var hostListenerProxy = function hostListenerProxy(hostRef, methodName) {
|
407 |
return function (ev) {
|
408 |
try {
|
409 |
{
|
410 |
+
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
|
|
|
411 |
// instance is ready, let's call it's member method for this event
|
412 |
hostRef.$lazyInstance$[methodName](ev);
|
413 |
} else {
|
419 |
}
|
420 |
};
|
421 |
};
|
|
|
422 |
var getHostListenerTarget = function getHostListenerTarget(elm, flags) {
|
423 |
+
if (flags & 8 /* TargetWindow */) return win;
|
|
|
|
|
424 |
return elm;
|
425 |
+
};
|
426 |
+
// prettier-ignore
|
|
|
427 |
var hostListenerOpts = function hostListenerOpts(flags) {
|
428 |
+
return (flags & 2 /* Capture */) !== 0;
|
|
|
|
|
429 |
};
|
430 |
var HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
431 |
var XLINK_NS = 'http://www.w3.org/1999/xlink';
|
|
|
432 |
var createTime = function createTime(fnName) {
|
|
|
433 |
{
|
434 |
return function () {
|
435 |
return;
|
436 |
};
|
437 |
}
|
438 |
};
|
|
|
439 |
var uniqueTime = function uniqueTime(key, measureText) {
|
440 |
{
|
441 |
return function () {
|
443 |
};
|
444 |
}
|
445 |
};
|
|
|
446 |
var rootAppliedStyles = new WeakMap();
|
|
|
447 |
var registerStyle = function registerStyle(scopeId, cssText, allowCS) {
|
448 |
var style = styles.get(scopeId);
|
|
|
449 |
if (supportsConstructibleStylesheets && allowCS) {
|
450 |
style = style || new CSSStyleSheet();
|
451 |
style.replace(cssText);
|
452 |
} else {
|
453 |
style = cssText;
|
454 |
}
|
|
|
455 |
styles.set(scopeId, style);
|
456 |
};
|
|
|
457 |
var addStyle = function addStyle(styleContainerNode, cmpMeta, mode, hostElm) {
|
458 |
var scopeId = getScopeId(cmpMeta);
|
459 |
var style = styles.get(scopeId);
|
460 |
+
// if an element is NOT connected then getRootNode() will return the wrong root node
|
461 |
// so the fallback is to always use the document for the root node in those cases
|
462 |
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
|
|
|
|
|
|
|
|
|
463 |
if (style) {
|
464 |
if (typeof style === 'string') {
|
465 |
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
466 |
var appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
467 |
var styleElm;
|
|
|
468 |
if (!appliedStyles) {
|
469 |
rootAppliedStyles.set(styleContainerNode, appliedStyles = new Set());
|
470 |
}
|
|
|
471 |
if (!appliedStyles.has(scopeId)) {
|
472 |
{
|
473 |
{
|
474 |
styleElm = doc.createElement('style');
|
475 |
styleElm.innerHTML = style;
|
476 |
}
|
|
|
477 |
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
|
478 |
}
|
|
|
479 |
if (appliedStyles) {
|
480 |
appliedStyles.add(scopeId);
|
481 |
}
|
484 |
styleContainerNode.adoptedStyleSheets = [].concat(_toConsumableArray(styleContainerNode.adoptedStyleSheets), [style]);
|
485 |
}
|
486 |
}
|
|
|
487 |
return scopeId;
|
488 |
};
|
|
|
489 |
var attachStyles = function attachStyles(hostRef) {
|
490 |
var cmpMeta = hostRef.$cmpMeta$;
|
491 |
var elm = hostRef.$hostElement$;
|
492 |
var flags = cmpMeta.$flags$;
|
493 |
var endAttachStyles = createTime();
|
494 |
var scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
|
495 |
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
|
|
|
|
|
496 |
// only required when we're NOT using native shadow dom (slot)
|
497 |
// or this browser doesn't support native shadow dom
|
498 |
// and this host element was NOT created with SSR
|
503 |
elm['s-sc'] = scopeId;
|
504 |
elm.classList.add(scopeId + '-h');
|
505 |
}
|
|
|
506 |
endAttachStyles();
|
507 |
};
|
|
|
508 |
var getScopeId = function getScopeId(cmp, mode) {
|
509 |
return 'sc-' + (cmp.$tagName$);
|
510 |
};
|
511 |
/**
|
512 |
* Default style mode id
|
513 |
*/
|
|
|
514 |
/**
|
515 |
* Reusable empty obj/array
|
516 |
* Don't add values to these!!
|
517 |
*/
|
|
|
|
|
518 |
var EMPTY_OBJ = {};
|
519 |
/**
|
520 |
* Namespaces
|
521 |
*/
|
|
|
522 |
var SVG_NS = 'http://www.w3.org/2000/svg';
|
523 |
var HTML_NS = 'http://www.w3.org/1999/xhtml';
|
|
|
524 |
var isDef = function isDef(v) {
|
525 |
return v != null;
|
526 |
};
|
|
|
527 |
var isComplexType = function isComplexType(o) {
|
528 |
// https://jsperf.com/typeof-fn-object/5
|
529 |
o = _typeof(o);
|
540 |
// const stack: any[] = [];
|
541 |
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
|
542 |
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
|
|
|
543 |
var h = function h(nodeName, vnodeData) {
|
544 |
var child = null;
|
545 |
var key = null;
|
547 |
var simple = false;
|
548 |
var lastSimple = false;
|
549 |
var vNodeChildren = [];
|
|
|
550 |
var walk = function walk(c) {
|
551 |
for (var _i = 0; _i < c.length; _i++) {
|
552 |
child = c[_i];
|
|
|
553 |
if (Array.isArray(child)) {
|
554 |
walk(child);
|
555 |
} else if (child != null && typeof child !== 'boolean') {
|
556 |
if (simple = typeof nodeName !== 'function' && !isComplexType(child)) {
|
557 |
child = String(child);
|
558 |
}
|
|
|
559 |
if (simple && lastSimple) {
|
560 |
// If the previous child was simple (string), we merge both
|
561 |
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
563 |
// Append a new vNode, if it's text, we create a text vNode
|
564 |
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
565 |
}
|
|
|
566 |
lastSimple = simple;
|
567 |
}
|
568 |
}
|
569 |
};
|
|
|
570 |
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
571 |
children[_key - 2] = arguments[_key];
|
572 |
}
|
|
|
573 |
walk(children);
|
|
|
574 |
if (vnodeData) {
|
575 |
+
// normalize class / classname attributes
|
|
|
576 |
if (vnodeData.key) {
|
577 |
key = vnodeData.key;
|
578 |
}
|
|
|
579 |
if (vnodeData.name) {
|
580 |
slotName = vnodeData.name;
|
581 |
}
|
|
|
582 |
{
|
583 |
var classData = vnodeData.className || vnodeData.class;
|
|
|
584 |
if (classData) {
|
585 |
vnodeData.class = _typeof(classData) !== 'object' ? classData : Object.keys(classData).filter(function (k) {
|
586 |
return classData[k];
|
588 |
}
|
589 |
}
|
590 |
}
|
|
|
591 |
if (typeof nodeName === 'function') {
|
592 |
// nodeName is a functional component
|
593 |
return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
|
594 |
}
|
|
|
595 |
var vnode = newVNode(nodeName, null);
|
596 |
vnode.$attrs$ = vnodeData;
|
|
|
597 |
if (vNodeChildren.length > 0) {
|
598 |
vnode.$children$ = vNodeChildren;
|
599 |
}
|
|
|
600 |
{
|
601 |
vnode.$key$ = key;
|
602 |
}
|
|
|
603 |
{
|
604 |
vnode.$name$ = slotName;
|
605 |
}
|
|
|
606 |
return vnode;
|
607 |
};
|
|
|
608 |
var newVNode = function newVNode(tag, text) {
|
609 |
var vnode = {
|
610 |
$flags$: 0,
|
613 |
$elm$: null,
|
614 |
$children$: null
|
615 |
};
|
|
|
616 |
{
|
617 |
vnode.$attrs$ = null;
|
618 |
}
|
|
|
619 |
{
|
620 |
vnode.$key$ = null;
|
621 |
}
|
|
|
622 |
{
|
623 |
vnode.$name$ = null;
|
624 |
}
|
|
|
625 |
return vnode;
|
626 |
};
|
|
|
627 |
var Host = {};
|
|
|
628 |
var isHost = function isHost(node) {
|
629 |
return node && node.$tag$ === Host;
|
630 |
};
|
|
|
631 |
var vdomFnUtils = {
|
632 |
forEach: function forEach(children, cb) {
|
633 |
return children.map(convertToPublic).forEach(cb);
|
636 |
return children.map(convertToPublic).map(cb).map(convertToPrivate);
|
637 |
}
|
638 |
};
|
|
|
639 |
var convertToPublic = function convertToPublic(node) {
|
640 |
return {
|
641 |
vattrs: node.$attrs$,
|
646 |
vtext: node.$text$
|
647 |
};
|
648 |
};
|
|
|
649 |
var convertToPrivate = function convertToPrivate(node) {
|
650 |
if (typeof node.vtag === 'function') {
|
651 |
var vnodeData = Object.assign({}, node.vattrs);
|
|
|
652 |
if (node.vkey) {
|
653 |
vnodeData.key = node.vkey;
|
654 |
}
|
|
|
655 |
if (node.vname) {
|
656 |
vnodeData.name = node.vname;
|
657 |
}
|
|
|
658 |
return h.apply(void 0, [node.vtag, vnodeData].concat(_toConsumableArray(node.vchildren || [])));
|
659 |
}
|
|
|
660 |
var vnode = newVNode(node.vtag, node.vtext);
|
661 |
vnode.$attrs$ = node.vattrs;
|
662 |
vnode.$children$ = node.vchildren;
|
672 |
*
|
673 |
* Modified for Stencil's compiler and vdom
|
674 |
*/
|
|
|
|
|
675 |
var setAccessor = function setAccessor(elm, memberName, oldValue, newValue, isSvg, flags) {
|
676 |
if (oldValue !== newValue) {
|
677 |
var isProp = isMemberInElement(elm, memberName);
|
678 |
var ln = memberName.toLowerCase();
|
|
|
679 |
if (memberName === 'class') {
|
680 |
var classList = elm.classList;
|
681 |
var oldClasses = parseClassList(oldValue);
|
699 |
}
|
700 |
}
|
701 |
}
|
|
|
702 |
for (var _prop in newValue) {
|
703 |
if (!oldValue || newValue[_prop] !== oldValue[_prop]) {
|
704 |
if (_prop.includes('-')) {
|
741 |
// except for the first character, we keep the event name case
|
742 |
memberName = ln[2] + memberName.slice(3);
|
743 |
}
|
|
|
744 |
if (oldValue) {
|
745 |
plt.rel(elm, memberName, oldValue, false);
|
746 |
}
|
|
|
747 |
if (newValue) {
|
748 |
plt.ael(elm, memberName, newValue, false);
|
749 |
}
|
750 |
} else {
|
751 |
// Set property if it exists and it's not a SVG
|
752 |
var isComplex = isComplexType(newValue);
|
|
|
753 |
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
754 |
try {
|
755 |
if (!elm.tagName.includes('-')) {
|
756 |
+
var n = newValue == null ? '' : newValue;
|
757 |
+
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
|
758 |
if (memberName === 'list') {
|
759 |
+
isProp = false;
|
760 |
+
// tslint:disable-next-line: triple-equals
|
761 |
} else if (oldValue == null || elm[memberName] != n) {
|
762 |
elm[memberName] = n;
|
763 |
}
|
773 |
* - if it's a SVG, since properties might not work in <svg>
|
774 |
* - if the newValue is null/undefined or 'false'.
|
775 |
*/
|
|
|
|
|
776 |
var xlink = false;
|
|
|
777 |
{
|
778 |
if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
|
779 |
memberName = ln;
|
780 |
xlink = true;
|
781 |
}
|
782 |
}
|
|
|
783 |
if (newValue == null || newValue === false) {
|
784 |
if (newValue !== false || elm.getAttribute(memberName) === '') {
|
785 |
if (xlink) {
|
788 |
elm.removeAttribute(memberName);
|
789 |
}
|
790 |
}
|
791 |
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
|
|
|
792 |
newValue = newValue === true ? '' : newValue;
|
|
|
793 |
if (xlink) {
|
794 |
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
795 |
} else {
|
799 |
}
|
800 |
}
|
801 |
};
|
|
|
802 |
var parseClassListRegex = /\s/;
|
|
|
803 |
var parseClassList = function parseClassList(value) {
|
804 |
return !value ? [] : value.split(parseClassListRegex);
|
805 |
};
|
|
|
806 |
var updateElement = function updateElement(oldVnode, newVnode, isSvgMode, memberName) {
|
807 |
// if the element passed in is a shadow root, which is a document fragment
|
808 |
// then we want to be adding attrs/props to the shadow root's "host" element
|
809 |
// if it's not a shadow root, then we add attrs/props to the same element
|
810 |
+
var elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
|
|
|
811 |
var oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
812 |
var newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
|
813 |
{
|
814 |
// remove attributes no longer present on the vnode by setting them to undefined
|
815 |
for (memberName in oldVnodeAttrs) {
|
817 |
setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
|
818 |
}
|
819 |
}
|
820 |
+
}
|
821 |
+
// add new & update changed attributes
|
|
|
822 |
for (memberName in newVnodeAttrs) {
|
823 |
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
|
824 |
}
|
825 |
};
|
|
|
826 |
var createElm = function createElm(oldParentVNode, newParentVNode, childIndex, parentElm) {
|
827 |
// tslint:disable-next-line: prefer-const
|
828 |
var newVNode = newParentVNode.$children$[childIndex];
|
830 |
var elm;
|
831 |
var childNode;
|
832 |
var oldVNode;
|
|
|
833 |
if (!useNativeShadowDom) {
|
834 |
// remember for later we need to check to relocate nodes
|
835 |
checkSlotRelocate = true;
|
|
|
836 |
if (newVNode.$tag$ === 'slot') {
|
837 |
if (scopeId) {
|
838 |
// scoped css needs to add its scoped id to the parent element
|
839 |
parentElm.classList.add(scopeId + '-s');
|
840 |
}
|
841 |
+
newVNode.$flags$ |= newVNode.$children$ ?
|
842 |
+
// slot element has fallback content
|
843 |
+
2 /* isSlotFallback */ :
|
844 |
+
// slot element does not have fallback content
|
845 |
+
1 /* isSlotReference */;
|
|
|
|
|
|
|
846 |
}
|
847 |
}
|
|
|
848 |
if (newVNode.$text$ !== null) {
|
849 |
// create text node
|
850 |
elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
|
851 |
+
} else if (newVNode.$flags$ & 1 /* isSlotReference */) {
|
|
|
|
|
852 |
// create a slot reference node
|
853 |
elm = newVNode.$elm$ = doc.createTextNode('');
|
854 |
} else {
|
855 |
if (!isSvgMode) {
|
856 |
isSvgMode = newVNode.$tag$ === 'svg';
|
857 |
+
}
|
858 |
+
// create element
|
859 |
+
elm = newVNode.$elm$ = doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* isSlotFallback */ ? 'slot-fb' : newVNode.$tag$) ;
|
|
|
|
|
|
|
|
|
860 |
if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
|
861 |
isSvgMode = false;
|
862 |
+
}
|
863 |
+
// add css classes, attrs, props, listeners, etc.
|
|
|
864 |
{
|
865 |
updateElement(null, newVNode, isSvgMode);
|
866 |
}
|
|
|
867 |
if (isDef(scopeId) && elm['s-si'] !== scopeId) {
|
868 |
// if there is a scopeId and this is the initial render
|
869 |
// then let's add the scopeId as a css class
|
870 |
elm.classList.add(elm['s-si'] = scopeId);
|
871 |
}
|
|
|
872 |
if (newVNode.$children$) {
|
873 |
for (i = 0; i < newVNode.$children$.length; ++i) {
|
874 |
// create the node
|
875 |
+
childNode = createElm(oldParentVNode, newVNode, i, elm);
|
876 |
+
// return node could have been null
|
877 |
if (childNode) {
|
878 |
// append our new node
|
879 |
elm.appendChild(childNode);
|
880 |
}
|
881 |
}
|
882 |
}
|
|
|
883 |
{
|
884 |
if (newVNode.$tag$ === 'svg') {
|
885 |
// Only reset the SVG context when we're exiting <svg> element
|
890 |
}
|
891 |
}
|
892 |
}
|
|
|
893 |
{
|
894 |
elm['s-hn'] = hostTagName;
|
895 |
+
if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
|
|
|
|
|
|
|
|
|
896 |
// remember the content reference comment
|
897 |
+
elm['s-sr'] = true;
|
898 |
+
// remember the content reference comment
|
899 |
+
elm['s-cr'] = contentRef;
|
900 |
+
// remember the slot name, or empty string for default slot
|
901 |
+
elm['s-sn'] = newVNode.$name$ || '';
|
902 |
+
// check if we've got an old vnode for this slot
|
903 |
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
|
904 |
if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
|
905 |
// we've got an old slot vnode and the wrapper is being replaced
|
906 |
// so let's move the old slot content back to it's original location
|
908 |
}
|
909 |
}
|
910 |
}
|
|
|
911 |
return elm;
|
912 |
};
|
|
|
913 |
var putBackInOriginalLocation = function putBackInOriginalLocation(parentElm, recursive) {
|
914 |
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
|
|
|
915 |
var oldSlotChildNodes = parentElm.childNodes;
|
|
|
916 |
for (var _i2 = oldSlotChildNodes.length - 1; _i2 >= 0; _i2--) {
|
917 |
var childNode = oldSlotChildNodes[_i2];
|
|
|
918 |
if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
|
919 |
// // this child node in the old element is from another component
|
920 |
// // remove this node from the old slot's parent
|
921 |
// childNode.remove();
|
922 |
// and relocate it back to it's original location
|
923 |
+
parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
|
924 |
+
// remove the old original location comment entirely
|
925 |
// later on the patch function will know what to do
|
926 |
// and move this to the correct spot in need be
|
|
|
927 |
childNode['s-ol'].remove();
|
928 |
childNode['s-ol'] = undefined;
|
929 |
checkSlotRelocate = true;
|
930 |
}
|
|
|
931 |
if (recursive) {
|
932 |
putBackInOriginalLocation(childNode, recursive);
|
933 |
}
|
934 |
}
|
935 |
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
|
|
|
|
|
936 |
};
|
937 |
|
938 |
var addVnodes = function addVnodes(parentElm, before, parentVNode, vnodes, startIdx, endIdx) {
|
939 |
var containerElm = parentElm['s-cr'] && parentElm['s-cr'].parentNode || parentElm;
|
940 |
var childNode;
|
|
|
941 |
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
942 |
containerElm = containerElm.shadowRoot;
|
943 |
}
|
|
|
944 |
for (; startIdx <= endIdx; ++startIdx) {
|
945 |
if (vnodes[startIdx]) {
|
946 |
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
|
947 |
if (childNode) {
|
948 |
vnodes[startIdx].$elm$ = childNode;
|
949 |
containerElm.insertBefore(childNode, referenceNode(before) );
|
951 |
}
|
952 |
}
|
953 |
};
|
|
|
954 |
var removeVnodes = function removeVnodes(vnodes, startIdx, endIdx, vnode, elm) {
|
955 |
for (; startIdx <= endIdx; ++startIdx) {
|
956 |
if (vnode = vnodes[startIdx]) {
|
957 |
elm = vnode.$elm$;
|
958 |
callNodeRefs(vnode);
|
|
|
959 |
{
|
960 |
// we're removing this element
|
961 |
// so it's possible we need to show slot fallback content now
|
962 |
checkSlotFallbackVisibility = true;
|
|
|
963 |
if (elm['s-ol']) {
|
964 |
// remove the original location comment
|
965 |
elm['s-ol'].remove();
|
968 |
// that's being removed are slot nodes
|
969 |
putBackInOriginalLocation(elm, true);
|
970 |
}
|
971 |
+
}
|
972 |
+
// remove the vnode's element from the dom
|
|
|
973 |
elm.remove();
|
974 |
}
|
975 |
}
|
976 |
};
|
|
|
977 |
var updateChildren = function updateChildren(parentElm, oldCh, newVNode, newCh) {
|
978 |
var oldStartIdx = 0;
|
979 |
var newStartIdx = 0;
|
987 |
var newEndVnode = newCh[newEndIdx];
|
988 |
var node;
|
989 |
var elmToMove;
|
|
|
990 |
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
991 |
if (oldStartVnode == null) {
|
992 |
// Vnode might have been moved left
|
1010 |
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
1011 |
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
1012 |
}
|
|
|
1013 |
patch(oldStartVnode, newEndVnode);
|
1014 |
parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
1015 |
oldStartVnode = oldCh[++oldStartIdx];
|
1019 |
if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
|
1020 |
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
1021 |
}
|
|
|
1022 |
patch(oldEndVnode, newStartVnode);
|
1023 |
parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
|
1024 |
oldEndVnode = oldCh[--oldEndIdx];
|
1026 |
} else {
|
1027 |
// createKeyToOldIdx
|
1028 |
idxInOld = -1;
|
|
|
1029 |
{
|
1030 |
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
1031 |
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
1034 |
}
|
1035 |
}
|
1036 |
}
|
|
|
1037 |
if (idxInOld >= 0) {
|
1038 |
elmToMove = oldCh[idxInOld];
|
|
|
1039 |
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
1040 |
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
|
1041 |
} else {
|
1043 |
oldCh[idxInOld] = undefined;
|
1044 |
node = elmToMove.$elm$;
|
1045 |
}
|
|
|
1046 |
newStartVnode = newCh[++newStartIdx];
|
1047 |
} else {
|
1048 |
// new element
|
1049 |
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
|
1050 |
newStartVnode = newCh[++newStartIdx];
|
1051 |
}
|
|
|
1052 |
if (node) {
|
1053 |
{
|
1054 |
parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
|
1056 |
}
|
1057 |
}
|
1058 |
}
|
|
|
1059 |
if (oldStartIdx > oldEndIdx) {
|
1060 |
addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
|
1061 |
} else if (newStartIdx > newEndIdx) {
|
1062 |
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
1063 |
}
|
1064 |
};
|
|
|
1065 |
var isSameVnode = function isSameVnode(vnode1, vnode2) {
|
1066 |
// compare if two vnode to see if they're "technically" the same
|
1067 |
// need to have the same element tag, and same key to be the same
|
1069 |
if (vnode1.$tag$ === 'slot') {
|
1070 |
return vnode1.$name$ === vnode2.$name$;
|
1071 |
}
|
|
|
1072 |
{
|
1073 |
return vnode1.$key$ === vnode2.$key$;
|
1074 |
}
|
1075 |
}
|
|
|
1076 |
return false;
|
1077 |
};
|
|
|
1078 |
var referenceNode = function referenceNode(node) {
|
1079 |
// this node was relocated to a new location in the dom
|
1080 |
// because of some other component's slot
|
1082 |
// it's original location was according to it's original vdom
|
1083 |
return node && node['s-ol'] || node;
|
1084 |
};
|
|
|
1085 |
var parentReferenceNode = function parentReferenceNode(node) {
|
1086 |
return (node['s-ol'] ? node['s-ol'] : node).parentNode;
|
1087 |
};
|
|
|
1088 |
var patch = function patch(oldVNode, newVNode) {
|
1089 |
var elm = newVNode.$elm$ = oldVNode.$elm$;
|
1090 |
var oldChildren = oldVNode.$children$;
|
1092 |
var tag = newVNode.$tag$;
|
1093 |
var text = newVNode.$text$;
|
1094 |
var defaultHolder;
|
|
|
1095 |
if (text === null) {
|
1096 |
{
|
1097 |
// test if we're rendering an svg element, or still rendering nodes inside of one
|
1098 |
// only add this to the when the compiler sees we're using an svg somewhere
|
1099 |
isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
|
1100 |
+
}
|
1101 |
+
// element node
|
|
|
1102 |
{
|
1103 |
if (tag === 'slot') ;else {
|
1104 |
// either this is the first render of an element OR it's an update
|
1107 |
updateElement(oldVNode, newVNode, isSvgMode);
|
1108 |
}
|
1109 |
}
|
|
|
1110 |
if (oldChildren !== null && newChildren !== null) {
|
1111 |
// looks like there's child vnodes for both the old and new vnodes
|
1112 |
updateChildren(elm, oldChildren, newVNode, newChildren);
|
1115 |
if (oldVNode.$text$ !== null) {
|
1116 |
// the old vnode was text, so be sure to clear it out
|
1117 |
elm.textContent = '';
|
1118 |
+
}
|
1119 |
+
// add the new vnode children
|
|
|
1120 |
addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
|
1121 |
} else if (oldChildren !== null) {
|
1122 |
// no new child vnodes, but there are old child vnodes to remove
|
1123 |
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
1124 |
}
|
|
|
1125 |
if (isSvgMode && tag === 'svg') {
|
1126 |
isSvgMode = false;
|
1127 |
}
|
1134 |
elm.data = text;
|
1135 |
}
|
1136 |
};
|
|
|
1137 |
var updateFallbackSlotVisibility = function updateFallbackSlotVisibility(elm) {
|
1138 |
// tslint:disable-next-line: prefer-const
|
1139 |
var childNodes = elm.childNodes;
|
1143 |
var j;
|
1144 |
var slotNameAttr;
|
1145 |
var nodeType;
|
|
|
1146 |
for (i = 0, ilen = childNodes.length; i < ilen; i++) {
|
1147 |
childNode = childNodes[i];
|
1148 |
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
|
|
|
|
|
1149 |
if (childNode['s-sr']) {
|
1150 |
// this is a slot fallback node
|
1151 |
// get the slot name for this slot reference node
|
1152 |
+
slotNameAttr = childNode['s-sn'];
|
1153 |
+
// by default always show a fallback slot node
|
1154 |
// then hide it if there are other slots in the light dom
|
|
|
1155 |
childNode.hidden = false;
|
|
|
1156 |
for (j = 0; j < ilen; j++) {
|
1157 |
nodeType = childNodes[j].nodeType;
|
|
|
1158 |
if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
|
1159 |
// this sibling node is from a different component OR is a named fallback slot node
|
1160 |
+
if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
|
|
|
|
|
1161 |
childNode.hidden = true;
|
1162 |
break;
|
1163 |
}
|
1165 |
// this is a default fallback slot node
|
1166 |
// any element or text node (with content)
|
1167 |
// should hide the default fallback slot node
|
1168 |
+
if (nodeType === 1 /* ElementNode */ || nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '') {
|
|
|
|
|
|
|
|
|
1169 |
childNode.hidden = true;
|
1170 |
break;
|
1171 |
}
|
1172 |
}
|
1173 |
}
|
1174 |
+
}
|
1175 |
+
// keep drilling down
|
|
|
1176 |
updateFallbackSlotVisibility(childNode);
|
1177 |
}
|
1178 |
}
|
1179 |
};
|
|
|
1180 |
var relocateNodes = [];
|
|
|
1181 |
var relocateSlotContent = function relocateSlotContent(elm) {
|
1182 |
// tslint:disable-next-line: prefer-const
|
1183 |
var childNode;
|
1189 |
var i = 0;
|
1190 |
var childNodes = elm.childNodes;
|
1191 |
var ilen = childNodes.length;
|
|
|
1192 |
for (; i < ilen; i++) {
|
1193 |
childNode = childNodes[i];
|
|
|
1194 |
if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
|
1195 |
// first got the content reference comment node
|
1196 |
// then we got it's parent, which is where all the host content is in now
|
1197 |
hostContentNodes = node.parentNode.childNodes;
|
1198 |
slotNameAttr = childNode['s-sn'];
|
|
|
1199 |
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
1200 |
node = hostContentNodes[j];
|
|
|
1201 |
if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
|
1202 |
// let's do some relocating to its new home
|
1203 |
// but never relocate a content reference node
|
1206 |
// it's possible we've already decided to relocate this node
|
1207 |
relocateNodeData = relocateNodes.find(function (r) {
|
1208 |
return r.$nodeToRelocate$ === node;
|
1209 |
+
});
|
1210 |
+
// made some changes to slots
|
1211 |
// let's make sure we also double check
|
1212 |
// fallbacks are correctly hidden or shown
|
|
|
1213 |
checkSlotFallbackVisibility = true;
|
1214 |
node['s-sn'] = node['s-sn'] || slotNameAttr;
|
|
|
1215 |
if (relocateNodeData) {
|
1216 |
// previously we never found a slot home for this node
|
1217 |
// but turns out we did, so let's remember it now
|
1223 |
$nodeToRelocate$: node
|
1224 |
});
|
1225 |
}
|
|
|
1226 |
if (node['s-sr']) {
|
1227 |
relocateNodes.map(function (relocateNode) {
|
1228 |
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
|
1229 |
relocateNodeData = relocateNodes.find(function (r) {
|
1230 |
return r.$nodeToRelocate$ === node;
|
1231 |
});
|
|
|
1232 |
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
1233 |
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
1234 |
}
|
1247 |
}
|
1248 |
}
|
1249 |
}
|
1250 |
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
|
|
|
|
|
1251 |
relocateSlotContent(childNode);
|
1252 |
}
|
1253 |
}
|
1254 |
};
|
|
|
1255 |
var isNodeLocatedInSlot = function isNodeLocatedInSlot(nodeToRelocate, slotNameAttr) {
|
1256 |
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
|
|
|
1257 |
if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
|
1258 |
return true;
|
1259 |
}
|
|
|
1260 |
if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
|
1261 |
return true;
|
1262 |
}
|
|
|
1263 |
return false;
|
1264 |
}
|
|
|
1265 |
if (nodeToRelocate['s-sn'] === slotNameAttr) {
|
1266 |
return true;
|
1267 |
}
|
|
|
1268 |
return slotNameAttr === '';
|
1269 |
};
|
|
|
1270 |
var callNodeRefs = function callNodeRefs(vNode) {
|
1271 |
{
|
1272 |
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
1273 |
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
1274 |
}
|
1275 |
};
|
|
|
1276 |
var renderVdom = function renderVdom(hostRef, renderFnResults) {
|
1277 |
var hostElm = hostRef.$hostElement$;
|
1278 |
var cmpMeta = hostRef.$cmpMeta$;
|
1279 |
var oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
1280 |
var rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
1281 |
+
hostTagName = hostElm.tagName;
|
|
|
1282 |
if (cmpMeta.$attrsToReflect$) {
|
1283 |
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
1284 |
cmpMeta.$attrsToReflect$.map(function (_ref9) {
|
1285 |
var _ref10 = _slicedToArray(_ref9, 2),
|
1286 |
+
propName = _ref10[0],
|
1287 |
+
attribute = _ref10[1];
|
|
|
1288 |
return rootVnode.$attrs$[attribute] = hostElm[propName];
|
1289 |
});
|
1290 |
}
|
|
|
1291 |
rootVnode.$tag$ = null;
|
1292 |
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
|
|
|
1293 |
hostRef.$vnode$ = rootVnode;
|
1294 |
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
|
1295 |
{
|
1296 |
scopeId = hostElm['s-sc'];
|
1297 |
}
|
|
|
1298 |
{
|
1299 |
contentRef = hostElm['s-cr'];
|
1300 |
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
1301 |
+
// always reset
|
|
|
|
|
1302 |
checkSlotFallbackVisibility = false;
|
1303 |
+
}
|
1304 |
+
// synchronous patch
|
|
|
1305 |
patch(oldVNode, rootVnode);
|
|
|
1306 |
{
|
1307 |
// while we're moving nodes around existing nodes, temporarily disable
|
1308 |
// the disconnectCallback from working
|
1309 |
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
|
|
|
|
|
1310 |
if (checkSlotRelocate) {
|
1311 |
relocateSlotContent(rootVnode.$elm$);
|
1312 |
var relocateData;
|
1316 |
var insertBeforeNode;
|
1317 |
var refNode;
|
1318 |
var _i3 = 0;
|
|
|
1319 |
for (; _i3 < relocateNodes.length; _i3++) {
|
1320 |
relocateData = relocateNodes[_i3];
|
1321 |
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
|
1322 |
if (!nodeToRelocate['s-ol']) {
|
1323 |
// add a reference node marking this node's original location
|
1324 |
// keep a reference to this node for later lookups
|
1327 |
nodeToRelocate.parentNode.insertBefore(nodeToRelocate['s-ol'] = orgLocationNode, nodeToRelocate);
|
1328 |
}
|
1329 |
}
|
|
|
1330 |
for (_i3 = 0; _i3 < relocateNodes.length; _i3++) {
|
1331 |
relocateData = relocateNodes[_i3];
|
1332 |
nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
|
1333 |
if (relocateData.$slotRefNode$) {
|
1334 |
// by default we're just going to insert it directly
|
1335 |
// after the slot reference node
|
1336 |
parentNodeRef = relocateData.$slotRefNode$.parentNode;
|
1337 |
insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
|
1338 |
orgLocationNode = nodeToRelocate['s-ol'];
|
|
|
1339 |
while (orgLocationNode = orgLocationNode.previousSibling) {
|
1340 |
refNode = orgLocationNode['s-nr'];
|
|
|
1341 |
if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
|
1342 |
refNode = refNode.nextSibling;
|
|
|
1343 |
if (!refNode || !refNode['s-nr']) {
|
1344 |
insertBeforeNode = refNode;
|
1345 |
break;
|
1346 |
}
|
1347 |
}
|
1348 |
}
|
|
|
1349 |
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
1350 |
// we've checked that it's worth while to relocate
|
1351 |
// since that the node to relocate
|
1354 |
if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
|
1355 |
// probably a component in the index.html that doesn't have it's hostname set
|
1356 |
nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
|
1357 |
+
}
|
1358 |
+
// add it back to the dom but in its new home
|
|
|
1359 |
parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
|
1360 |
}
|
1361 |
}
|
1362 |
} else {
|
1363 |
// this node doesn't have a slot home to go to, so let's hide it
|
1364 |
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
|
|
|
1365 |
nodeToRelocate.hidden = true;
|
1366 |
}
|
1367 |
}
|
1368 |
}
|
1369 |
}
|
|
|
1370 |
if (checkSlotFallbackVisibility) {
|
1371 |
updateFallbackSlotVisibility(rootVnode.$elm$);
|
1372 |
+
}
|
1373 |
+
// done moving nodes around
|
1374 |
// allow the disconnect callback to work again
|
1375 |
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
1376 |
+
// always reset
|
|
|
|
|
|
|
|
|
1377 |
relocateNodes.length = 0;
|
1378 |
}
|
1379 |
+
};
|
|
|
1380 |
var getElement = function getElement(ref) {
|
1381 |
return getHostRef(ref).$hostElement$ ;
|
1382 |
};
|
|
|
1383 |
var createEvent = function createEvent(ref, name, flags) {
|
1384 |
var elm = getElement(ref);
|
1385 |
return {
|
1386 |
emit: function emit(detail) {
|
|
|
1387 |
return emitEvent(elm, name, {
|
1388 |
+
bubbles: !!(flags & 4 /* Bubbles */),
|
1389 |
+
composed: !!(flags & 2 /* Composed */),
|
1390 |
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
|
|
|
|
|
|
|
|
|
|
|
1391 |
detail: detail
|
1392 |
});
|
1393 |
}
|
1400 |
* @param opts options for configuring a custom Event
|
1401 |
* @returns the custom Event
|
1402 |
*/
|
|
|
|
|
1403 |
var emitEvent = function emitEvent(elm, name, opts) {
|
1404 |
var ev = plt.ce(name, opts);
|
1405 |
elm.dispatchEvent(ev);
|
1406 |
return ev;
|
1407 |
};
|
|
|
1408 |
var attachToAncestor = function attachToAncestor(hostRef, ancestorComponent) {
|
1409 |
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
|
1410 |
ancestorComponent['s-p'].push(new Promise(function (r) {
|
1412 |
}));
|
1413 |
}
|
1414 |
};
|
|
|
1415 |
var scheduleUpdate = function scheduleUpdate(hostRef, isInitialLoad) {
|
1416 |
{
|
1417 |
+
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
|
|
|
1418 |
}
|
1419 |
|
1420 |
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
1421 |
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
|
|
|
|
|
|
|
1422 |
return;
|
1423 |
}
|
1424 |
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
1425 |
+
// there is no ancestor component or the ancestor component
|
1426 |
// has already fired off its lifecycle update then
|
1427 |
// fire off the initial update
|
|
|
1428 |
var dispatch = function dispatch() {
|
1429 |
return dispatchHooks(hostRef, isInitialLoad);
|
1430 |
};
|
|
|
1431 |
return writeTask(dispatch) ;
|
1432 |
};
|
|
|
1433 |
var dispatchHooks = function dispatchHooks(hostRef, isInitialLoad) {
|
1434 |
var endSchedule = createTime();
|
1435 |
var instance = hostRef.$lazyInstance$ ;
|
1436 |
var promise;
|
|
|
1437 |
if (isInitialLoad) {
|
1438 |
{
|
1439 |
+
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
|
|
|
|
|
1440 |
if (hostRef.$queuedListeners$) {
|
1441 |
hostRef.$queuedListeners$.map(function (_ref11) {
|
1442 |
var _ref12 = _slicedToArray(_ref11, 2),
|
1443 |
+
methodName = _ref12[0],
|
1444 |
+
event = _ref12[1];
|
|
|
1445 |
return safeCall(instance, methodName, event);
|
1446 |
});
|
1447 |
hostRef.$queuedListeners$ = null;
|
1448 |
}
|
1449 |
}
|
|
|
1450 |
{
|
1451 |
promise = safeCall(instance, 'componentWillLoad');
|
1452 |
}
|
1453 |
}
|
|
|
1454 |
endSchedule();
|
1455 |
return then(promise, function () {
|
1456 |
return updateComponent(hostRef, instance, isInitialLoad);
|
1457 |
});
|
1458 |
};
|
|
|
1459 |
var updateComponent = /*#__PURE__*/function () {
|
1460 |
var _ref13 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(hostRef, instance, isInitialLoad) {
|
1461 |
var elm, endUpdate, rc, endRender, childrenPromises, postUpdate;
|
1467 |
elm = hostRef.$hostElement$;
|
1468 |
endUpdate = createTime();
|
1469 |
rc = elm['s-rc'];
|
|
|
1470 |
if (isInitialLoad) {
|
1471 |
// DOM WRITE!
|
1472 |
attachStyles(hostRef);
|
1473 |
}
|
|
|
1474 |
endRender = createTime();
|
|
|
1475 |
{
|
1476 |
_context.next = 11;
|
1477 |
break;
|
1478 |
}
|
|
|
1479 |
case 9:
|
1480 |
_context.next = 12;
|
1481 |
break;
|
|
|
1482 |
case 11:
|
1483 |
callRender(hostRef, instance);
|
|
|
1484 |
case 12:
|
|
|
1485 |
if (rc) {
|
1486 |
// ok, so turns out there are some child host elements
|
1487 |
// waiting on this parent element to load
|
1491 |
});
|
1492 |
elm['s-rc'] = undefined;
|
1493 |
}
|
|
|
1494 |
endRender();
|
1495 |
endUpdate();
|
|
|
1496 |
{
|
1497 |
childrenPromises = elm['s-p'];
|
|
|
1498 |
postUpdate = function postUpdate() {
|
1499 |
return postUpdateComponent(hostRef);
|
1500 |
};
|
|
|
1501 |
if (childrenPromises.length === 0) {
|
1502 |
postUpdate();
|
1503 |
} else {
|
1504 |
Promise.all(childrenPromises).then(postUpdate);
|
1505 |
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
|
|
|
1506 |
childrenPromises.length = 0;
|
1507 |
}
|
1508 |
}
|
|
|
1509 |
case 19:
|
1510 |
case "end":
|
1511 |
return _context.stop();
|
1513 |
}
|
1514 |
}, _callee);
|
1515 |
}));
|
|
|
1516 |
return function updateComponent(_x, _x2, _x3) {
|
1517 |
return _ref13.apply(this, arguments);
|
1518 |
};
|
1519 |
}();
|
|
|
1520 |
var callRender = function callRender(hostRef, instance, elm) {
|
|
|
1521 |
try {
|
1522 |
instance = instance.render() ;
|
|
|
1523 |
{
|
1524 |
+
hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
|
|
|
|
|
1525 |
}
|
1526 |
|
1527 |
{
|
1528 |
+
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
|
|
|
1529 |
}
|
1530 |
|
1531 |
{
|
1543 |
}
|
1544 |
return null;
|
1545 |
};
|
|
|
1546 |
var postUpdateComponent = function postUpdateComponent(hostRef) {
|
1547 |
var elm = hostRef.$hostElement$;
|
1548 |
var endPostUpdate = createTime();
|
1549 |
var instance = hostRef.$lazyInstance$ ;
|
1550 |
var ancestorComponent = hostRef.$ancestorComponent$;
|
|
|
1551 |
{
|
1552 |
|
1553 |
safeCall(instance, 'componentDidRender');
|
1554 |
}
|
1555 |
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
1556 |
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
|
|
|
|
|
|
|
|
|
|
|
1557 |
{
|
1558 |
// DOM WRITE!
|
1559 |
addHydratedFlag(elm);
|
1560 |
}
|
|
|
1561 |
{
|
1562 |
|
1563 |
safeCall(instance, 'componentDidLoad');
|
1564 |
}
|
1565 |
endPostUpdate();
|
|
|
1566 |
{
|
1567 |
hostRef.$onReadyResolve$(elm);
|
|
|
1568 |
if (!ancestorComponent) {
|
1569 |
appDidLoad();
|
1570 |
}
|
1572 |
} else {
|
1573 |
endPostUpdate();
|
1574 |
}
|
|
|
1575 |
{
|
1576 |
hostRef.$onInstanceResolve$(elm);
|
1577 |
+
}
|
1578 |
+
// load events fire from bottom to top
|
1579 |
// the deepest elements load first then bubbles up
|
|
|
|
|
1580 |
{
|
1581 |
if (hostRef.$onRenderResolve$) {
|
1582 |
hostRef.$onRenderResolve$();
|
1583 |
hostRef.$onRenderResolve$ = undefined;
|
1584 |
}
|
1585 |
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
|
|
|
|
|
1586 |
nextTick(function () {
|
1587 |
return scheduleUpdate(hostRef, false);
|
1588 |
});
|
1589 |
}
|
1590 |
+
hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
|
1591 |
+
}
|
1592 |
+
// ( •_•)
|
|
|
|
|
|
|
|
|
1593 |
// ( •_•)>⌐■-■
|
1594 |
// (⌐■_■)
|
|
|
1595 |
};
|
|
|
1596 |
var appDidLoad = function appDidLoad(who) {
|
1597 |
// on appload
|
1598 |
// we have finish the first big initial render
|
1608 |
});
|
1609 |
});
|
1610 |
};
|
|
|
1611 |
var safeCall = function safeCall(instance, method, arg) {
|
1612 |
if (instance && instance[method]) {
|
1613 |
try {
|
1616 |
consoleError(e);
|
1617 |
}
|
1618 |
}
|
|
|
1619 |
return undefined;
|
1620 |
};
|
|
|
1621 |
var then = function then(promise, thenFn) {
|
1622 |
return promise && promise.then ? promise.then(thenFn) : thenFn();
|
1623 |
};
|
|
|
1624 |
var addHydratedFlag = function addHydratedFlag(elm) {
|
1625 |
return elm.classList.add('hydrated') ;
|
1626 |
};
|
|
|
1627 |
var parsePropertyValue = function parsePropertyValue(propValue, propType) {
|
1628 |
// ensure this value is of the correct prop type
|
1629 |
if (propValue != null && !isComplexType(propValue)) {
|
1630 |
+
if (propType & 4 /* Boolean */) {
|
|
|
|
|
1631 |
// per the HTML spec, any string value means it is a boolean true value
|
1632 |
// but we'll cheat here and say that the string "false" is the boolean false
|
1633 |
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
1634 |
}
|
1635 |
+
if (propType & 2 /* Number */) {
|
|
|
|
|
|
|
1636 |
// force it to be a number
|
1637 |
return parseFloat(propValue);
|
1638 |
}
|
1639 |
+
if (propType & 1 /* String */) {
|
|
|
|
|
|
|
1640 |
// could have been passed as a number or boolean
|
1641 |
// but we still want it as a string
|
1642 |
return String(propValue);
|
1643 |
+
}
|
1644 |
+
// redundant return here for better minification
|
|
|
1645 |
return propValue;
|
1646 |
+
}
|
1647 |
+
// not sure exactly what type we want
|
1648 |
// so no need to change to a different type
|
|
|
|
|
1649 |
return propValue;
|
1650 |
};
|
|
|
1651 |
var getValue = function getValue(ref, propName) {
|
1652 |
return getHostRef(ref).$instanceValues$.get(propName);
|
1653 |
};
|
|
|
1654 |
var setValue = function setValue(ref, propName, newVal, cmpMeta) {
|
1655 |
// check our new property value against our internal value
|
1656 |
var hostRef = getHostRef(ref);
|
1659 |
var flags = hostRef.$flags$;
|
1660 |
var instance = hostRef.$lazyInstance$ ;
|
1661 |
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
1662 |
+
if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
|
|
|
|
|
|
|
1663 |
// gadzooks! the property's value has changed!!
|
1664 |
// set our new value!
|
1665 |
hostRef.$instanceValues$.set(propName, newVal);
|
|
|
1666 |
if (instance) {
|
1667 |
// get an array of method names of watch functions to call
|
1668 |
+
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
|
|
|
1669 |
var watchMethods = cmpMeta.$watchers$[propName];
|
|
|
1670 |
if (watchMethods) {
|
1671 |
// this instance is watching for when this property changed
|
1672 |
watchMethods.map(function (watchMethodName) {
|
1679 |
});
|
1680 |
}
|
1681 |
}
|
1682 |
+
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
1683 |
+
// looks like this value actually changed, so we've got work to do!
|
|
|
|
|
|
|
|
|
|
|
|
|
1684 |
// but only if we've already rendered, otherwise just chill out
|
1685 |
// queue that we need to do an update, but don't worry about queuing
|
1686 |
// up millions cuz this function ensures it only runs once
|
|
|
|
|
1687 |
scheduleUpdate(hostRef, false);
|
1688 |
}
|
1689 |
}
|
1690 |
}
|
1691 |
};
|
|
|
1692 |
var proxyComponent = function proxyComponent(Cstr, cmpMeta, flags) {
|
1693 |
if (cmpMeta.$members$) {
|
1694 |
if (Cstr.watchers) {
|
1695 |
cmpMeta.$watchers$ = Cstr.watchers;
|
1696 |
+
}
|
1697 |
+
// It's better to have a const than two Object.entries()
|
|
|
1698 |
var members = Object.entries(cmpMeta.$members$);
|
1699 |
var prototype = Cstr.prototype;
|
1700 |
members.map(function (_ref14) {
|
1701 |
var _ref15 = _slicedToArray(_ref14, 2),
|
1702 |
+
memberName = _ref15[0],
|
1703 |
+
_ref15$ = _slicedToArray(_ref15[1], 1),
|
1704 |
+
memberFlags = _ref15$[0];
|
1705 |
+
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1706 |
// proxyComponent - prop
|
1707 |
Object.defineProperty(prototype, memberName, {
|
1708 |
get: function get() {
|
1710 |
return getValue(this, memberName);
|
1711 |
},
|
1712 |
set: function set(newValue) {
|
1713 |
+
// proxyComponent, set value
|
|
|
1714 |
setValue(this, memberName, newValue, cmpMeta);
|
1715 |
},
|
1716 |
configurable: true,
|
1717 |
enumerable: true
|
1718 |
});
|
1719 |
+
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
|
|
|
|
|
|
|
1720 |
// proxyComponent - method
|
1721 |
Object.defineProperty(prototype, memberName, {
|
1722 |
value: function value() {
|
1723 |
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
1724 |
args[_key2] = arguments[_key2];
|
1725 |
}
|
|
|
1726 |
var ref = getHostRef(this);
|
1727 |
return ref.$onInstancePromise$.then(function () {
|
1728 |
var _ref$$lazyInstance$;
|
|
|
1729 |
return (_ref$$lazyInstance$ = ref.$lazyInstance$)[memberName].apply(_ref$$lazyInstance$, args);
|
1730 |
});
|
1731 |
}
|
1732 |
});
|
1733 |
}
|
1734 |
});
|
1735 |
+
if ((flags & 1 /* isElementConstructor */)) {
|
|
|
|
|
|
|
1736 |
var attrNameToPropName = new Map();
|
|
|
1737 |
prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
|
1738 |
var _this = this;
|
|
|
1739 |
plt.jmp(function () {
|
1740 |
+
var propName = attrNameToPropName.get(attrName);
|
1741 |
+
// In a webcomponent lifecyle the attributeChangedCallback runs prior to connectedCallback
|
1742 |
// in the case where an attribute was set inline.
|
1743 |
// ```html
|
1744 |
// <my-component some-attribute="some-value"></my-component>
|
1771 |
// TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
|
1772 |
// properties here given that this goes against best practices outlined here
|
1773 |
// https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
|
|
|
1774 |
if (_this.hasOwnProperty(propName)) {
|
1775 |
newValue = _this[propName];
|
1776 |
delete _this[propName];
|
1777 |
}
|
|
|
1778 |
_this[propName] = newValue === null && typeof _this[propName] === 'boolean' ? false : newValue;
|
1779 |
});
|
1780 |
+
};
|
1781 |
+
// create an array of attributes to observe
|
1782 |
// and also create a map of html attribute name to js property name
|
|
|
|
|
1783 |
Cstr.observedAttributes = members.filter(function (_ref16) {
|
1784 |
var _ref17 = _slicedToArray(_ref16, 2),
|
1785 |
+
m = _ref17[1];
|
|
|
1786 |
return m[0] & 15;
|
1787 |
+
} /* HasAttribute */) // filter to only keep props that should match attributes
|
|
|
|
|
1788 |
.map(function (_ref18) {
|
1789 |
var _ref19 = _slicedToArray(_ref18, 2),
|
1790 |
+
propName = _ref19[0],
|
1791 |
+
m = _ref19[1];
|
|
|
1792 |
var attrName = m[1] || propName;
|
1793 |
attrNameToPropName.set(attrName, propName);
|
1794 |
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
|
|
|
|
|
1795 |
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
1796 |
}
|
|
|
1797 |
return attrName;
|
1798 |
});
|
1799 |
}
|
1800 |
}
|
|
|
1801 |
return Cstr;
|
1802 |
};
|
|
|
1803 |
var initializeComponent = /*#__PURE__*/function () {
|
1804 |
var _ref20 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(elm, hostRef, cmpMeta, hmrVersionId, Cstr) {
|
1805 |
var endLoad, endNewInstance, style, _scopeId, endRegisterStyles, ancestorComponent, schedule;
|
|
|
1806 |
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
1807 |
while (1) {
|
1808 |
switch (_context2.prev = _context2.next) {
|
1809 |
case 0:
|
1810 |
+
if (!((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0)) {
|
|
|
|
|
1811 |
_context2.next = 37;
|
1812 |
break;
|
1813 |
}
|
|
|
1814 |
// we haven't initialized this element yet
|
1815 |
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
1816 |
+
// lazy loaded components
|
|
|
1817 |
// request the component's implementation to be
|
1818 |
// wired up with the host element
|
|
|
1819 |
Cstr = loadModule(cmpMeta);
|
|
|
1820 |
if (!Cstr.then) {
|
1821 |
_context2.next = 10;
|
1822 |
break;
|
1823 |
}
|
|
|
1824 |
// Await creates a micro-task avoid if possible
|
1825 |
endLoad = uniqueTime();
|
1826 |
_context2.next = 8;
|
1827 |
return Cstr;
|
|
|
1828 |
case 8:
|
1829 |
Cstr = _context2.sent;
|
1830 |
endLoad();
|
|
|
1831 |
case 10:
|
1832 |
{
|
1833 |
_context2.next = 12;
|
1834 |
break;
|
1835 |
}
|
|
|
1836 |
case 12:
|
1837 |
if (!Cstr.isProxied) {
|
1838 |
// we've never proxied this Constructor before
|
1841 |
{
|
1842 |
cmpMeta.$watchers$ = Cstr.watchers;
|
1843 |
}
|
1844 |
+
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
|
|
|
|
|
1845 |
Cstr.isProxied = true;
|
1846 |
}
|
|
|
1847 |
endNewInstance = createTime(); // ok, time to construct the instance
|
1848 |
// but let's keep track of when we start and stop
|
1849 |
// so that the getters/setters don't incorrectly step on data
|
|
|
1850 |
{
|
1851 |
+
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
1852 |
+
}
|
1853 |
+
// construct the lazy-loaded component implementation
|
|
|
1854 |
// passing the hostRef is very important during
|
1855 |
// construction in order to directly wire together the
|
1856 |
// host element and the lazy-loaded instance
|
|
|
|
|
1857 |
try {
|
1858 |
new Cstr(hostRef);
|
1859 |
} catch (e) {
|
1860 |
consoleError(e);
|
1861 |
}
|
|
|
1862 |
{
|
1863 |
+
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
|
|
|
1864 |
}
|
1865 |
|
1866 |
{
|
1867 |
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
|
|
|
1868 |
}
|
1869 |
|
1870 |
endNewInstance();
|
1871 |
_context2.next = 25;
|
1872 |
break;
|
|
|
1873 |
case 22:
|
1874 |
// sync constructor component
|
1875 |
Cstr = elm.constructor;
|
1876 |
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
1877 |
+
// wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
|
|
|
1878 |
// watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
|
1879 |
// Stencil has completed instantiating the component.
|
|
|
1880 |
customElements.whenDefined(cmpMeta.$tagName$).then(function () {
|
1881 |
+
return hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
|
|
|
1882 |
});
|
|
|
1883 |
case 25:
|
1884 |
if (!(Cstr.style)) {
|
1885 |
_context2.next = 37;
|
1886 |
break;
|
1887 |
}
|
|
|
1888 |
// this component has styles but we haven't registered them yet
|
1889 |
style = Cstr.style;
|
|
|
1890 |
_scopeId = getScopeId(cmpMeta);
|
|
|
1891 |
if (styles.has(_scopeId)) {
|
1892 |
_context2.next = 37;
|
1893 |
break;
|
1894 |
}
|
|
|
1895 |
endRegisterStyles = createTime();
|
|
|
1896 |
{
|
1897 |
_context2.next = 35;
|
1898 |
break;
|
1899 |
}
|
|
|
1900 |
case 34:
|
1901 |
style = _context2.sent;
|
|
|
1902 |
case 35:
|
1903 |
+
registerStyle(_scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
|
|
|
1904 |
endRegisterStyles();
|
|
|
1905 |
case 37:
|
1906 |
// we've successfully created a lazy instance
|
1907 |
ancestorComponent = hostRef.$ancestorComponent$;
|
|
|
1908 |
schedule = function schedule() {
|
1909 |
return scheduleUpdate(hostRef, true);
|
1910 |
};
|
|
|
1911 |
if (ancestorComponent && ancestorComponent['s-rc']) {
|
1912 |
// this is the intial load and this component it has an ancestor component
|
1913 |
// but the ancestor component has NOT fired its will update lifecycle yet
|
1919 |
} else {
|
1920 |
schedule();
|
1921 |
}
|
|
|
1922 |
case 40:
|
1923 |
case "end":
|
1924 |
return _context2.stop();
|
1926 |
}
|
1927 |
}, _callee2);
|
1928 |
}));
|
|
|
1929 |
return function initializeComponent(_x4, _x5, _x6, _x7, _x8) {
|
1930 |
return _ref20.apply(this, arguments);
|
1931 |
};
|
1932 |
}();
|
|
|
1933 |
var _connectedCallback = function connectedCallback(elm) {
|
1934 |
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
|
|
|
1935 |
var hostRef = getHostRef(elm);
|
1936 |
var cmpMeta = hostRef.$cmpMeta$;
|
1937 |
var endConnected = createTime();
|
1938 |
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
|
|
|
|
|
1939 |
// first time this component has connected
|
1940 |
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
|
|
|
1941 |
var hostId;
|
|
|
1942 |
if (!hostId) {
|
1943 |
// initUpdate
|
1944 |
// if the slot polyfill is required we'll need to put some nodes
|
1945 |
// in here to act as original content anchors as we move nodes around
|
1946 |
// host element has been connected to the DOM
|
1947 |
+
if (cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
|
|
|
|
|
|
|
1948 |
setContentReference(elm);
|
1949 |
}
|
1950 |
}
|
|
|
1951 |
{
|
1952 |
// find the first ancestor component (if there is one) and register
|
1953 |
// this component as one of the actively loading child components for its ancestor
|
1954 |
var ancestorComponent = elm;
|
|
|
1955 |
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
1956 |
// climb up the ancestors looking for the first
|
1957 |
// component that hasn't finished its lifecycle update yet
|
1962 |
break;
|
1963 |
}
|
1964 |
}
|
1965 |
+
}
|
1966 |
+
// Lazy properties
|
1967 |
// https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
|
|
|
|
|
1968 |
if (cmpMeta.$members$) {
|
1969 |
Object.entries(cmpMeta.$members$).map(function (_ref21) {
|
1970 |
var _ref22 = _slicedToArray(_ref21, 2),
|
1971 |
+
memberName = _ref22[0],
|
1972 |
+
_ref22$ = _slicedToArray(_ref22[1], 1),
|
1973 |
+
memberFlags = _ref22$[0];
|
1974 |
+
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
|
|
|
|
|
1975 |
var value = elm[memberName];
|
1976 |
delete elm[memberName];
|
1977 |
elm[memberName] = value;
|
1978 |
}
|
1979 |
});
|
1980 |
}
|
|
|
1981 |
{
|
1982 |
initializeComponent(elm, hostRef, cmpMeta);
|
1983 |
}
|
1985 |
// not the first time this has connected
|
1986 |
// reattach any event listeners to the host
|
1987 |
// since they would have been removed when disconnected
|
1988 |
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
1989 |
}
|
|
|
1990 |
endConnected();
|
1991 |
}
|
1992 |
};
|
|
|
1993 |
var setContentReference = function setContentReference(elm) {
|
1994 |
// only required when we're NOT using native shadow dom (slot)
|
1995 |
// or this browser doesn't support native shadow dom
|
2001 |
contentRefElm['s-cn'] = true;
|
2002 |
elm.insertBefore(contentRefElm, elm.firstChild);
|
2003 |
};
|
|
|
2004 |
var _disconnectedCallback = function disconnectedCallback(elm) {
|
2005 |
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
|
|
|
2006 |
var hostRef = getHostRef(elm);
|
2007 |
var instance = hostRef.$lazyInstance$ ;
|
|
|
2008 |
{
|
2009 |
if (hostRef.$rmListeners$) {
|
2010 |
hostRef.$rmListeners$.map(function (rmListener) {
|
2012 |
});
|
2013 |
hostRef.$rmListeners$ = undefined;
|
2014 |
}
|
2015 |
+
}
|
|
|
2016 |
{
|
2017 |
safeCall(instance, 'disconnectedCallback');
|
2018 |
}
|
2019 |
}
|
2020 |
};
|
|
|
2021 |
var bootstrapLazy = function bootstrapLazy(lazyBundles) {
|
2022 |
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2023 |
var endBootstrap = createTime();
|
2032 |
var isBootstrapping = true;
|
2033 |
Object.assign(plt, options);
|
2034 |
plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
|
|
|
2035 |
lazyBundles.map(function (lazyBundle) {
|
2036 |
return lazyBundle[1].map(function (compactMeta) {
|
2037 |
var cmpMeta = {
|
2040 |
$members$: compactMeta[2],
|
2041 |
$listeners$: compactMeta[3]
|
2042 |
};
|
|
|
2043 |
{
|
2044 |
cmpMeta.$members$ = compactMeta[2];
|
2045 |
}
|
|
|
2046 |
{
|
2047 |
cmpMeta.$listeners$ = compactMeta[3];
|
2048 |
}
|
|
|
2049 |
{
|
2050 |
cmpMeta.$attrsToReflect$ = [];
|
2051 |
}
|
|
|
2052 |
{
|
2053 |
cmpMeta.$watchers$ = {};
|
2054 |
}
|
2055 |
|
2056 |
var tagName = cmpMeta.$tagName$;
|
|
|
2057 |
var HostElement = /*#__PURE__*/function (_HTMLElement) {
|
2058 |
_inherits(HostElement, _HTMLElement);
|
|
|
2059 |
var _super2 = _createSuper(HostElement);
|
|
|
2060 |
// StencilLazyHost
|
2061 |
function HostElement(self) {
|
2062 |
var _this2;
|
|
|
2063 |
_classCallCheck(this, HostElement);
|
|
|
2064 |
// @ts-ignore
|
2065 |
_this2 = _super2.call(this, self);
|
2066 |
self = _assertThisInitialized(_this2);
|
2067 |
registerHost(self, cmpMeta);
|
2068 |
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
|
|
|
|
|
2069 |
// this component is using shadow dom
|
2070 |
// and this browser supports shadow dom
|
2071 |
// add the read-only property "shadowRoot" to the host element
|
2078 |
}
|
2079 |
}
|
2080 |
}
|
|
|
2081 |
return _this2;
|
2082 |
}
|
|
|
2083 |
_createClass(HostElement, [{
|
2084 |
key: "connectedCallback",
|
2085 |
value: function connectedCallback() {
|
2086 |
var _this3 = this;
|
|
|
2087 |
if (appLoadFallback) {
|
2088 |
clearTimeout(appLoadFallback);
|
2089 |
appLoadFallback = null;
|
2090 |
}
|
|
|
2091 |
if (isBootstrapping) {
|
2092 |
// connectedCallback will be processed once all components have been registered
|
2093 |
deferredConnectedCallbacks.push(this);
|
2101 |
key: "disconnectedCallback",
|
2102 |
value: function disconnectedCallback() {
|
2103 |
var _this4 = this;
|
|
|
2104 |
plt.jmp(function () {
|
2105 |
return _disconnectedCallback(_this4);
|
2106 |
});
|
2111 |
return getHostRef(this).$onReadyPromise$;
|
2112 |
}
|
2113 |
}]);
|
|
|
2114 |
return HostElement;
|
2115 |
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
|
|
2116 |
cmpMeta.$lazyBundleId$ = lazyBundle[0];
|
|
|
2117 |
if (!exclude.includes(tagName) && !customElements.get(tagName)) {
|
2118 |
cmpTags.push(tagName);
|
2119 |
+
customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
|
|
|
|
|
2120 |
}
|
2121 |
});
|
2122 |
});
|
2125 |
visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
|
2126 |
visibilityStyle.setAttribute('data-styles', '');
|
2127 |
head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
|
2128 |
+
}
|
2129 |
+
// Process deferred connectedCallbacks now all components have been registered
|
|
|
2130 |
isBootstrapping = false;
|
|
|
2131 |
if (deferredConnectedCallbacks.length) {
|
2132 |
deferredConnectedCallbacks.map(function (host) {
|
2133 |
return host.connectedCallback();
|
2138 |
return appLoadFallback = setTimeout(appDidLoad, 30);
|
2139 |
});
|
2140 |
}
|
2141 |
+
}
|
2142 |
+
// Fallback appLoad event
|
|
|
2143 |
endBootstrap();
|
2144 |
};
|
|
|
2145 |
var hostRefs = new WeakMap();
|
|
|
2146 |
var getHostRef = function getHostRef(ref) {
|
2147 |
return hostRefs.get(ref);
|
2148 |
};
|
|
|
2149 |
var registerInstance = function registerInstance(lazyInstance, hostRef) {
|
2150 |
return hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
2151 |
};
|
|
|
2152 |
var registerHost = function registerHost(elm, cmpMeta) {
|
2153 |
var hostRef = {
|
2154 |
$flags$: 0,
|
2156 |
$cmpMeta$: cmpMeta,
|
2157 |
$instanceValues$: new Map()
|
2158 |
};
|
|
|
2159 |
{
|
2160 |
hostRef.$onInstancePromise$ = new Promise(function (r) {
|
2161 |
return hostRef.$onInstanceResolve$ = r;
|
2162 |
});
|
2163 |
}
|
|
|
2164 |
{
|
2165 |
hostRef.$onReadyPromise$ = new Promise(function (r) {
|
2166 |
return hostRef.$onReadyResolve$ = r;
|
2168 |
elm['s-p'] = [];
|
2169 |
elm['s-rc'] = [];
|
2170 |
}
|
|
|
2171 |
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
2172 |
return hostRefs.set(elm, hostRef);
|
2173 |
};
|
|
|
2174 |
var isMemberInElement = function isMemberInElement(elm, memberName) {
|
2175 |
return memberName in elm;
|
2176 |
};
|
|
|
2177 |
var consoleError = function consoleError(e, el) {
|
2178 |
return (0, console.error)(e, el);
|
2179 |
};
|
|
|
2180 |
var cmpModules = /*@__PURE__*/new Map();
|
|
|
2181 |
var loadModule = function loadModule(cmpMeta, hostRef, hmrVersionId) {
|
2182 |
// loadModuleImport
|
2183 |
var exportName = cmpMeta.$tagName$.replace(/-/g, '_');
|
2184 |
var bundleId = cmpMeta.$lazyBundleId$;
|
|
|
2185 |
var module = cmpModules.get(bundleId) ;
|
|
|
2186 |
if (module) {
|
2187 |
return module[exportName];
|
2188 |
}
|
|
|
2189 |
return import(
|
2190 |
/* webpackInclude: /\.entry\.js$/ */
|
|
|
2191 |
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
|
2192 |
/* webpackMode: "lazy" */
|
2193 |
"./".concat(bundleId, ".entry.js").concat('')).then(function (importedModule) {
|
2194 |
{
|
2195 |
cmpModules.set(bundleId, importedModule);
|
2196 |
}
|
|
|
2197 |
return importedModule[exportName];
|
2198 |
}, consoleError);
|
2199 |
};
|
|
|
2200 |
var styles = new Map();
|
2201 |
var queueDomReads = [];
|
2202 |
var queueDomWrites = [];
|
|
|
2203 |
var queueTask = function queueTask(queue, write) {
|
2204 |
return function (cb) {
|
2205 |
queue.push(cb);
|
|
|
2206 |
if (!queuePending) {
|
2207 |
queuePending = true;
|
2208 |
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
|
|
|
|
|
2209 |
nextTick(flush);
|
2210 |
} else {
|
2211 |
plt.raf(flush);
|
2213 |
}
|
2214 |
};
|
2215 |
};
|
|
|
2216 |
var consume = function consume(queue) {
|
2217 |
for (var _i7 = 0; _i7 < queue.length; _i7++) {
|
2218 |
try {
|
2221 |
consoleError(e);
|
2222 |
}
|
2223 |
}
|
|
|
2224 |
queue.length = 0;
|
2225 |
};
|
|
|
2226 |
var flush = function flush() {
|
2227 |
+
// always force a bunch of medium callbacks to run, but still have
|
2228 |
// a throttle on how many can run in a certain time
|
2229 |
// DOM READS!!!
|
2230 |
+
consume(queueDomReads);
|
2231 |
+
// DOM WRITES!!!
|
|
|
|
|
2232 |
{
|
2233 |
consume(queueDomWrites);
|
|
|
2234 |
if (queuePending = queueDomReads.length > 0) {
|
2235 |
// still more to do yet, but we've run out of time
|
2236 |
// let's let this thing cool off and try again in the next tick
|
2238 |
}
|
2239 |
}
|
2240 |
};
|
|
|
2241 |
var nextTick = /*@__PURE__*/function nextTick(cb) {
|
2242 |
return promiseResolve().then(cb);
|
2243 |
};
|
2244 |
var writeTask = /*@__PURE__*/queueTask(queueDomWrites, true);
|
2245 |
|
2246 |
+
export { Host as H, _slicedToArray as _, _objectSpread2 as a, bootstrapLazy as b, createEvent as c, _defineProperty as d, _createClass as e, _typeof as f, getElement as g, h, _classCallCheck as i, _toConsumableArray as j, _objectWithoutProperties as k, _asyncToGenerator as l, _createForOfIteratorHelper as m, promiseResolve as p, registerInstance as r };
|
dist/components/esm/{learndash-9970e552.js → learndash-f2523a03.js}
RENAMED
@@ -1,68 +1,66 @@
|
|
1 |
-
import { r as resumeProgress } from './presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-
|
2 |
-
import './index-
|
3 |
|
4 |
const learndash = (function (player) {
|
5 |
var _learndash_video_data, _prestoPlayer, _prestoPlayer$learnda, _learndash_video_data2, _prestoPlayer2, _prestoPlayer2$learnd, _prestoPlayer3, _prestoPlayer3$learnd, _prestoPlayer4, _prestoPlayer4$learnd, _learndash_video_data3;
|
6 |
-
|
7 |
if (typeof learndash_video_data === 'undefined' || ((_learndash_video_data = learndash_video_data) === null || _learndash_video_data === void 0 ? void 0 : _learndash_video_data.videos_found_provider) !== 'presto') {
|
8 |
return;
|
9 |
}
|
10 |
-
|
11 |
resumeProgress(player); // maybe resume progress
|
|
|
12 |
// Learndash has this logic in a shitty method on their php class
|
13 |
// we have to fake it here since we don't have access to it
|
14 |
-
|
15 |
window.learndash_video_data.videos_auto_complete = ((_prestoPlayer = prestoPlayer) === null || _prestoPlayer === void 0 ? void 0 : (_prestoPlayer$learnda = _prestoPlayer.learndash) === null || _prestoPlayer$learnda === void 0 ? void 0 : _prestoPlayer$learnda.lesson_video_auto_complete) === 'on';
|
16 |
window.learndash_video_data.videos_hide_complete_button = 'AFTER' === ((_learndash_video_data2 = learndash_video_data) === null || _learndash_video_data2 === void 0 ? void 0 : _learndash_video_data2.videos_shown) && ((_prestoPlayer2 = prestoPlayer) === null || _prestoPlayer2 === void 0 ? void 0 : (_prestoPlayer2$learnd = _prestoPlayer2.learndash) === null || _prestoPlayer2$learnd === void 0 ? void 0 : _prestoPlayer2$learnd.lesson_video_hide_complete_button) === 'on';
|
17 |
window.learndash_video_data.videos_auto_complete_delay = (_prestoPlayer3 = prestoPlayer) === null || _prestoPlayer3 === void 0 ? void 0 : (_prestoPlayer3$learnd = _prestoPlayer3.learndash) === null || _prestoPlayer3$learnd === void 0 ? void 0 : _prestoPlayer3$learnd.lesson_video_auto_complete_delay;
|
18 |
-
window.learndash_video_data.videos_auto_complete_delay_message = (_prestoPlayer4 = prestoPlayer) === null || _prestoPlayer4 === void 0 ? void 0 : (_prestoPlayer4$learnd = _prestoPlayer4.learndash) === null || _prestoPlayer4$learnd === void 0 ? void 0 : _prestoPlayer4$learnd.videos_auto_complete_delay_message;
|
19 |
|
20 |
-
|
21 |
-
|
22 |
|
|
|
|
|
23 |
if ('BEFORE' === ((_learndash_video_data3 = learndash_video_data) === null || _learndash_video_data3 === void 0 ? void 0 : _learndash_video_data3.videos_shown)) {
|
24 |
learndash_video_data.videos_auto_complete = false;
|
25 |
-
jQuery(document).trigger('learndash_video_disable_assets', [true]);
|
26 |
|
|
|
27 |
jQuery(function () {
|
28 |
if (learndash_video_data.video_debug === '1') {
|
29 |
console.log('PRESTO: init');
|
30 |
}
|
31 |
-
|
32 |
if (document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="' + learndash_video_data.videos_found_provider + '"]').length) {
|
33 |
if (learndash_video_data.video_debug === '1') {
|
34 |
console.log('PRESTO: calling LearnDash_disable_assets(true)');
|
35 |
-
}
|
36 |
-
|
37 |
|
|
|
38 |
LearnDash_disable_assets(true);
|
39 |
-
LearnDash_watchPlayers();
|
40 |
|
|
|
41 |
document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="' + learndash_video_data.videos_found_provider + '"]').forEach(function (element, index) {
|
42 |
var element_key = 'presto-player__wrapper-player-' + index;
|
43 |
var element_id = element.getAttribute('id');
|
44 |
-
|
45 |
if (typeof element_id === 'undefined' || element_id == '') {
|
46 |
element_id = element_key;
|
47 |
element.setAttribute('id', element_id);
|
48 |
}
|
49 |
-
|
50 |
ld_video_players[element_key] = {};
|
51 |
ld_video_players[element_key]['player_key'] = element_key;
|
52 |
ld_video_players[element_key]['player_type'] = learndash_video_data.videos_found_provider;
|
53 |
ld_video_players[element_key]['player_id'] = element_id;
|
54 |
ld_video_players[element_key]['player_wrapper'] = element.closest('presto-player');
|
55 |
-
|
56 |
if (typeof ld_video_players[element_key]['player_wrapper'] !== 'undefined') {
|
57 |
ld_video_players[element_key]['player_cookie_key'] = ld_video_players[element_key]['player_wrapper'].getAttribute('data-video-cookie-key');
|
58 |
} else {
|
59 |
ld_video_players[element_key]['player_cookie_key'] = '';
|
60 |
}
|
|
|
61 |
|
62 |
-
|
63 |
// If yes, enable the assets back and end watch players function.
|
64 |
// If no, then apply all the filters and performs the actions again.
|
65 |
-
|
66 |
if (LearnDash_Video_Progress_getSetting(ld_video_players[element_key], 'video_state') === 'complete') {
|
67 |
LearnDash_disable_assets(false);
|
68 |
LearnDash_watchPlayersEnd();
|
@@ -72,62 +70,57 @@ const learndash = (function (player) {
|
|
72 |
if (learndash_video_data.video_debug === '1') {
|
73 |
console.log('PRESTO: Video is playing');
|
74 |
}
|
75 |
-
|
76 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_duration', player.duration);
|
77 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
78 |
-
|
79 |
if (player.duration && player.duration === player.currentTime) {
|
80 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'complete');
|
81 |
-
|
82 |
if (learndash_video_data.video_debug === '1') {
|
83 |
console.log('PRESTO: calling LearnDash_disable_assets(false)');
|
84 |
}
|
|
|
85 |
|
86 |
-
|
87 |
-
|
88 |
LearnDash_watchPlayersEnd();
|
89 |
}
|
90 |
-
});
|
91 |
|
|
|
92 |
wp.hooks.addAction('presto.playerPlaying', 'presto-player', function (player) {
|
93 |
if (learndash_video_data.video_debug === '1') {
|
94 |
console.log('PRESTO: Video is playing');
|
95 |
}
|
96 |
-
|
97 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_duration', player.duration);
|
98 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
99 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'play');
|
100 |
-
});
|
101 |
|
|
|
102 |
wp.hooks.addAction('presto.playerPause', 'presto-player', function (player) {
|
103 |
if (learndash_video_data.video_debug === '1') {
|
104 |
console.log('PRESTO: Video is paused');
|
105 |
}
|
106 |
-
|
107 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
108 |
console.log(player.duration);
|
109 |
console.log(player.currentTime);
|
110 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'pause');
|
111 |
-
});
|
112 |
|
|
|
113 |
wp.hooks.addAction('presto.playerEnded', 'presto-player', function (player) {
|
114 |
if (learndash_video_data.video_debug === '1') {
|
115 |
console.log('PRESTO: video ended');
|
116 |
}
|
117 |
-
|
118 |
if (learndash_video_data.video_debug === '1') {
|
119 |
console.log("PRESTO: setting 'video_state' to 'complete'");
|
120 |
}
|
121 |
-
|
122 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
123 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'complete');
|
124 |
-
|
125 |
if (learndash_video_data.video_debug === '1') {
|
126 |
console.log('PRESTO: calling LearnDash_disable_assets(false)');
|
127 |
}
|
|
|
128 |
|
129 |
-
|
130 |
-
|
131 |
LearnDash_watchPlayersEnd();
|
132 |
});
|
133 |
}
|
1 |
+
import { r as resumeProgress } from './presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-78ff809d.js';
|
2 |
+
import './index-936ae1d6.js';
|
3 |
|
4 |
const learndash = (function (player) {
|
5 |
var _learndash_video_data, _prestoPlayer, _prestoPlayer$learnda, _learndash_video_data2, _prestoPlayer2, _prestoPlayer2$learnd, _prestoPlayer3, _prestoPlayer3$learnd, _prestoPlayer4, _prestoPlayer4$learnd, _learndash_video_data3;
|
|
|
6 |
if (typeof learndash_video_data === 'undefined' || ((_learndash_video_data = learndash_video_data) === null || _learndash_video_data === void 0 ? void 0 : _learndash_video_data.videos_found_provider) !== 'presto') {
|
7 |
return;
|
8 |
}
|
|
|
9 |
resumeProgress(player); // maybe resume progress
|
10 |
+
|
11 |
// Learndash has this logic in a shitty method on their php class
|
12 |
// we have to fake it here since we don't have access to it
|
|
|
13 |
window.learndash_video_data.videos_auto_complete = ((_prestoPlayer = prestoPlayer) === null || _prestoPlayer === void 0 ? void 0 : (_prestoPlayer$learnda = _prestoPlayer.learndash) === null || _prestoPlayer$learnda === void 0 ? void 0 : _prestoPlayer$learnda.lesson_video_auto_complete) === 'on';
|
14 |
window.learndash_video_data.videos_hide_complete_button = 'AFTER' === ((_learndash_video_data2 = learndash_video_data) === null || _learndash_video_data2 === void 0 ? void 0 : _learndash_video_data2.videos_shown) && ((_prestoPlayer2 = prestoPlayer) === null || _prestoPlayer2 === void 0 ? void 0 : (_prestoPlayer2$learnd = _prestoPlayer2.learndash) === null || _prestoPlayer2$learnd === void 0 ? void 0 : _prestoPlayer2$learnd.lesson_video_hide_complete_button) === 'on';
|
15 |
window.learndash_video_data.videos_auto_complete_delay = (_prestoPlayer3 = prestoPlayer) === null || _prestoPlayer3 === void 0 ? void 0 : (_prestoPlayer3$learnd = _prestoPlayer3.learndash) === null || _prestoPlayer3$learnd === void 0 ? void 0 : _prestoPlayer3$learnd.lesson_video_auto_complete_delay;
|
16 |
+
window.learndash_video_data.videos_auto_complete_delay_message = (_prestoPlayer4 = prestoPlayer) === null || _prestoPlayer4 === void 0 ? void 0 : (_prestoPlayer4$learnd = _prestoPlayer4.learndash) === null || _prestoPlayer4$learnd === void 0 ? void 0 : _prestoPlayer4$learnd.videos_auto_complete_delay_message;
|
17 |
|
18 |
+
// Temporarily set the video track path to '/' to set the cookie globally
|
19 |
+
window.learndash_video_data.video_track_path = '/';
|
20 |
|
21 |
+
// Learndash has this logic in a shitty method on their php class
|
22 |
+
// we have to fake it here since we don't have access to it
|
23 |
if ('BEFORE' === ((_learndash_video_data3 = learndash_video_data) === null || _learndash_video_data3 === void 0 ? void 0 : _learndash_video_data3.videos_shown)) {
|
24 |
learndash_video_data.videos_auto_complete = false;
|
25 |
+
jQuery(document).trigger('learndash_video_disable_assets', [true]);
|
26 |
|
27 |
+
// Set learndash video players
|
28 |
jQuery(function () {
|
29 |
if (learndash_video_data.video_debug === '1') {
|
30 |
console.log('PRESTO: init');
|
31 |
}
|
|
|
32 |
if (document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="' + learndash_video_data.videos_found_provider + '"]').length) {
|
33 |
if (learndash_video_data.video_debug === '1') {
|
34 |
console.log('PRESTO: calling LearnDash_disable_assets(true)');
|
35 |
+
}
|
|
|
36 |
|
37 |
+
// Disable learndash assets and watch players.
|
38 |
LearnDash_disable_assets(true);
|
39 |
+
LearnDash_watchPlayers();
|
40 |
|
41 |
+
// Go through all the <presto-player> instances
|
42 |
document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="' + learndash_video_data.videos_found_provider + '"]').forEach(function (element, index) {
|
43 |
var element_key = 'presto-player__wrapper-player-' + index;
|
44 |
var element_id = element.getAttribute('id');
|
|
|
45 |
if (typeof element_id === 'undefined' || element_id == '') {
|
46 |
element_id = element_key;
|
47 |
element.setAttribute('id', element_id);
|
48 |
}
|
|
|
49 |
ld_video_players[element_key] = {};
|
50 |
ld_video_players[element_key]['player_key'] = element_key;
|
51 |
ld_video_players[element_key]['player_type'] = learndash_video_data.videos_found_provider;
|
52 |
ld_video_players[element_key]['player_id'] = element_id;
|
53 |
ld_video_players[element_key]['player_wrapper'] = element.closest('presto-player');
|
|
|
54 |
if (typeof ld_video_players[element_key]['player_wrapper'] !== 'undefined') {
|
55 |
ld_video_players[element_key]['player_cookie_key'] = ld_video_players[element_key]['player_wrapper'].getAttribute('data-video-cookie-key');
|
56 |
} else {
|
57 |
ld_video_players[element_key]['player_cookie_key'] = '';
|
58 |
}
|
59 |
+
ld_video_players[element_key]['player_cookie_values'] = LearnDash_Video_Progress_initSettings(ld_video_players[element_key]);
|
60 |
|
61 |
+
// Check if video has been completed already.
|
62 |
// If yes, enable the assets back and end watch players function.
|
63 |
// If no, then apply all the filters and performs the actions again.
|
|
|
64 |
if (LearnDash_Video_Progress_getSetting(ld_video_players[element_key], 'video_state') === 'complete') {
|
65 |
LearnDash_disable_assets(false);
|
66 |
LearnDash_watchPlayersEnd();
|
70 |
if (learndash_video_data.video_debug === '1') {
|
71 |
console.log('PRESTO: Video is playing');
|
72 |
}
|
|
|
73 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_duration', player.duration);
|
74 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
|
|
75 |
if (player.duration && player.duration === player.currentTime) {
|
76 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'complete');
|
|
|
77 |
if (learndash_video_data.video_debug === '1') {
|
78 |
console.log('PRESTO: calling LearnDash_disable_assets(false)');
|
79 |
}
|
80 |
+
LearnDash_disable_assets(false);
|
81 |
|
82 |
+
// Stop watching players.
|
|
|
83 |
LearnDash_watchPlayersEnd();
|
84 |
}
|
85 |
+
});
|
86 |
|
87 |
+
// Player Playing.
|
88 |
wp.hooks.addAction('presto.playerPlaying', 'presto-player', function (player) {
|
89 |
if (learndash_video_data.video_debug === '1') {
|
90 |
console.log('PRESTO: Video is playing');
|
91 |
}
|
|
|
92 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_duration', player.duration);
|
93 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
94 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'play');
|
95 |
+
});
|
96 |
|
97 |
+
// Player Paused.
|
98 |
wp.hooks.addAction('presto.playerPause', 'presto-player', function (player) {
|
99 |
if (learndash_video_data.video_debug === '1') {
|
100 |
console.log('PRESTO: Video is paused');
|
101 |
}
|
|
|
102 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
103 |
console.log(player.duration);
|
104 |
console.log(player.currentTime);
|
105 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'pause');
|
106 |
+
});
|
107 |
|
108 |
+
// Player Ended.
|
109 |
wp.hooks.addAction('presto.playerEnded', 'presto-player', function (player) {
|
110 |
if (learndash_video_data.video_debug === '1') {
|
111 |
console.log('PRESTO: video ended');
|
112 |
}
|
|
|
113 |
if (learndash_video_data.video_debug === '1') {
|
114 |
console.log("PRESTO: setting 'video_state' to 'complete'");
|
115 |
}
|
|
|
116 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_time', player.currentTime);
|
117 |
LearnDash_Video_Progress_setSetting(ld_video_players[element_key], 'video_state', 'complete');
|
|
|
118 |
if (learndash_video_data.video_debug === '1') {
|
119 |
console.log('PRESTO: calling LearnDash_disable_assets(false)');
|
120 |
}
|
121 |
+
LearnDash_disable_assets(false);
|
122 |
|
123 |
+
// Stop watching players.
|
|
|
124 |
LearnDash_watchPlayersEnd();
|
125 |
});
|
126 |
}
|
dist/components/esm/{lifter-9f2633b7.js → lifter-e77d57e8.js}
RENAMED
@@ -2,12 +2,10 @@
|
|
2 |
var prevent_default = function prevent_default(event) {
|
3 |
event.preventDefault();
|
4 |
};
|
5 |
-
|
6 |
function toggle_mark_complete(enabled) {
|
7 |
var $form = jQuery('.llms-complete-lesson-form'),
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
if (true === enabled) {
|
12 |
$form.off('submit', prevent_default);
|
13 |
$btn.removeAttr('disabled');
|
@@ -17,9 +15,9 @@ function toggle_mark_complete(enabled) {
|
|
17 |
$btn.attr('disabled', 'disabled');
|
18 |
$links.addClass('llms-av-disabled').on('click', prevent_default);
|
19 |
}
|
20 |
-
}
|
21 |
-
|
22 |
|
|
|
23 |
var getEventMeta = function getEventMeta(player) {
|
24 |
var eventMeta = {
|
25 |
ts: player.currentTime,
|
@@ -29,32 +27,29 @@ var getEventMeta = function getEventMeta(player) {
|
|
29 |
id: player.config.id
|
30 |
};
|
31 |
return eventMeta;
|
32 |
-
};
|
33 |
-
|
34 |
|
|
|
35 |
var track_event = function track_event(event_id, meta) {
|
36 |
llms.tracking.addEvent('video.' + event_id, {
|
37 |
meta: meta
|
38 |
});
|
39 |
-
};
|
40 |
-
|
41 |
|
|
|
42 |
function start_countdown($el) {
|
43 |
var $seconds = $el.find('.llms-av-pv--seconds'),
|
44 |
-
|
45 |
setInterval(function () {
|
46 |
time = $seconds.text() * 1 - 1;
|
47 |
-
|
48 |
if (1 === time) {
|
49 |
$seconds.closest('a')[0].click();
|
50 |
}
|
51 |
-
|
52 |
if (time >= 0) {
|
53 |
$seconds.text(time);
|
54 |
}
|
55 |
}, 1000);
|
56 |
}
|
57 |
-
|
58 |
function do_ajax_completion($el, settings) {
|
59 |
LLMS.Ajax.call({
|
60 |
data: {
|
@@ -67,15 +62,12 @@ function do_ajax_completion($el, settings) {
|
|
67 |
},
|
68 |
error: function error(xhr, status, _error) {
|
69 |
LLMS.Spinner.stop($el);
|
70 |
-
console.error(xhr.responseText + ' (' + _error + ' ' + status + ')');
|
71 |
-
/* eslint-disable-line no-console */
|
72 |
-
|
73 |
-
console.log(xhr);
|
74 |
-
/* eslint-disable-line no-console */
|
75 |
},
|
|
|
76 |
success: function success(res) {
|
77 |
LLMS.Spinner.stop($el);
|
78 |
-
|
79 |
if (res !== null && res !== void 0 && res.html) {
|
80 |
$el.append(res.html);
|
81 |
start_countdown($el);
|
@@ -104,29 +96,26 @@ var onEndedVideo = function onEndedVideo(e, $el, settings) {
|
|
104 |
};
|
105 |
function lifter (player) {
|
106 |
var _llms, _llms$tracking;
|
107 |
-
|
108 |
/*
|
109 |
Below code is coped from LifterLMS-Advanced-Videos/assets/js/llms.av.js
|
110 |
We replaced $ with jQuery.
|
111 |
*/
|
112 |
var settings = {};
|
113 |
var tracking_settings = ((_llms = llms) === null || _llms === void 0 ? void 0 : (_llms$tracking = _llms.tracking) === null || _llms$tracking === void 0 ? void 0 : _llms$tracking.getSettings()) || null;
|
114 |
-
|
115 |
if (tracking_settings !== null && tracking_settings !== void 0 && tracking_settings.av) {
|
116 |
settings = tracking_settings.av;
|
117 |
}
|
|
|
118 |
/*
|
119 |
LifterLMS-Advanced-Videos copied code end.
|
120 |
Below code will glue the LifterAV with Presto player.
|
121 |
*/
|
122 |
-
|
123 |
-
|
124 |
if (settings.require_video_completion && !settings.video_completed) {
|
125 |
toggle_mark_complete(false);
|
126 |
}
|
|
|
127 |
|
128 |
-
|
129 |
-
|
130 |
player.on('pause', onPauseVideo);
|
131 |
player.on('playing', onPlayingVideo);
|
132 |
player.on('ended', function (e) {
|
2 |
var prevent_default = function prevent_default(event) {
|
3 |
event.preventDefault();
|
4 |
};
|
|
|
5 |
function toggle_mark_complete(enabled) {
|
6 |
var $form = jQuery('.llms-complete-lesson-form'),
|
7 |
+
$btn = jQuery('.llms-complete-lesson-form button[type="submit"]'),
|
8 |
+
$links = jQuery('#llms_start_quiz, #llms-start-assignment');
|
|
|
9 |
if (true === enabled) {
|
10 |
$form.off('submit', prevent_default);
|
11 |
$btn.removeAttr('disabled');
|
15 |
$btn.attr('disabled', 'disabled');
|
16 |
$links.addClass('llms-av-disabled').on('click', prevent_default);
|
17 |
}
|
18 |
+
}
|
|
|
19 |
|
20 |
+
// Setting and Getting Event meta data
|
21 |
var getEventMeta = function getEventMeta(player) {
|
22 |
var eventMeta = {
|
23 |
ts: player.currentTime,
|
27 |
id: player.config.id
|
28 |
};
|
29 |
return eventMeta;
|
30 |
+
};
|
|
|
31 |
|
32 |
+
// tracking event
|
33 |
var track_event = function track_event(event_id, meta) {
|
34 |
llms.tracking.addEvent('video.' + event_id, {
|
35 |
meta: meta
|
36 |
});
|
37 |
+
};
|
|
|
38 |
|
39 |
+
// ajax call
|
40 |
function start_countdown($el) {
|
41 |
var $seconds = $el.find('.llms-av-pv--seconds'),
|
42 |
+
time;
|
43 |
setInterval(function () {
|
44 |
time = $seconds.text() * 1 - 1;
|
|
|
45 |
if (1 === time) {
|
46 |
$seconds.closest('a')[0].click();
|
47 |
}
|
|
|
48 |
if (time >= 0) {
|
49 |
$seconds.text(time);
|
50 |
}
|
51 |
}, 1000);
|
52 |
}
|
|
|
53 |
function do_ajax_completion($el, settings) {
|
54 |
LLMS.Ajax.call({
|
55 |
data: {
|
62 |
},
|
63 |
error: function error(xhr, status, _error) {
|
64 |
LLMS.Spinner.stop($el);
|
65 |
+
console.error(xhr.responseText + ' (' + _error + ' ' + status + ')'); /* eslint-disable-line no-console */
|
66 |
+
console.log(xhr); /* eslint-disable-line no-console */
|
|
|
|
|
|
|
67 |
},
|
68 |
+
|
69 |
success: function success(res) {
|
70 |
LLMS.Spinner.stop($el);
|
|
|
71 |
if (res !== null && res !== void 0 && res.html) {
|
72 |
$el.append(res.html);
|
73 |
start_countdown($el);
|
96 |
};
|
97 |
function lifter (player) {
|
98 |
var _llms, _llms$tracking;
|
|
|
99 |
/*
|
100 |
Below code is coped from LifterLMS-Advanced-Videos/assets/js/llms.av.js
|
101 |
We replaced $ with jQuery.
|
102 |
*/
|
103 |
var settings = {};
|
104 |
var tracking_settings = ((_llms = llms) === null || _llms === void 0 ? void 0 : (_llms$tracking = _llms.tracking) === null || _llms$tracking === void 0 ? void 0 : _llms$tracking.getSettings()) || null;
|
|
|
105 |
if (tracking_settings !== null && tracking_settings !== void 0 && tracking_settings.av) {
|
106 |
settings = tracking_settings.av;
|
107 |
}
|
108 |
+
|
109 |
/*
|
110 |
LifterLMS-Advanced-Videos copied code end.
|
111 |
Below code will glue the LifterAV with Presto player.
|
112 |
*/
|
|
|
|
|
113 |
if (settings.require_video_completion && !settings.video_completed) {
|
114 |
toggle_mark_complete(false);
|
115 |
}
|
116 |
+
var $el = jQuery('.presto-block-video');
|
117 |
|
118 |
+
// on end, sync time and autoload content
|
|
|
119 |
player.on('pause', onPauseVideo);
|
120 |
player.on('playing', onPlayingVideo);
|
121 |
player.on('ended', function (e) {
|
dist/components/esm/loader.js
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
2 |
|
3 |
/*
|
4 |
Stencil Client Patch Esm v2.9.0 | MIT Licensed | https://stenciljs.com
|
5 |
*/
|
6 |
-
|
7 |
var patchEsm = function patchEsm() {
|
8 |
-
|
9 |
return promiseResolve();
|
10 |
};
|
11 |
|
1 |
+
import { p as promiseResolve, b as bootstrapLazy } from './index-936ae1d6.js';
|
2 |
|
3 |
/*
|
4 |
Stencil Client Patch Esm v2.9.0 | MIT Licensed | https://stenciljs.com
|
5 |
*/
|
|
|
6 |
var patchEsm = function patchEsm() {
|
|
|
7 |
return promiseResolve();
|
8 |
};
|
9 |
|
dist/components/esm/presto-action-bar_25.entry.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
export { a as presto_action_bar, b as presto_action_bar_controller, c as presto_action_bar_ui, d as presto_audio, e as presto_bunny, f as presto_business_skin, g as presto_cta_overlay, h as presto_cta_overlay_controller, C as presto_cta_overlay_ui, i as presto_dynamic_overlay_ui, j as presto_dynamic_overlays, k as presto_email_overlay, l as presto_email_overlay_controller, E as presto_email_overlay_ui, m as presto_modern_skin, n as presto_muted_overlay, o as presto_player, p as presto_player_button, q as presto_player_spinner, s as presto_stacked_skin, t as presto_timestamp, u as presto_video, v as presto_vimeo, w as presto_youtube, x as presto_youtube_subscribe_button } from './presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-
|
2 |
-
import './index-
|
1 |
+
export { a as presto_action_bar, b as presto_action_bar_controller, c as presto_action_bar_ui, d as presto_audio, e as presto_bunny, f as presto_business_skin, g as presto_cta_overlay, h as presto_cta_overlay_controller, C as presto_cta_overlay_ui, i as presto_dynamic_overlay_ui, j as presto_dynamic_overlays, k as presto_email_overlay, l as presto_email_overlay_controller, E as presto_email_overlay_ui, m as presto_modern_skin, n as presto_muted_overlay, o as presto_player, p as presto_player_button, q as presto_player_spinner, s as presto_stacked_skin, t as presto_timestamp, u as presto_video, v as presto_vimeo, w as presto_youtube, x as presto_youtube_subscribe_button } from './presto-action-bar.presto-action-bar-controller.presto-action-bar-ui.presto-audio.presto-bunny.presto-business-skin.presto-cta-overlay.presto-cta-overlay-controller.presto-cta-overlay-ui.presto-dynamic-overlay-ui.presto-dynamic-overlays.presto-email-overlay.presto-email-overlay-controller.presto-email-overlay-ui.presto-modern-skin.presto-muted-overlay.presto-player.presto-player-button.presto-player-spinner.presto-stacked-skin.presto-timestamp.presto-video.presto-vimeo.presto-youtube.presto-youtube-subscribe-button-78ff809d.js';
|
2 |
+
import './index-936ae1d6.js';
|
dist/components/esm/presto-player-skeleton.entry.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import { r as registerInstance, h } from './index-
|
2 |
|
3 |
const prestoSkeletonCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{--border-radius:var(--presto-player-border-radius-pill);--color:#e5e7eb;--sheen-color:#f3f4f6;display:block;position:relative}.skeleton{display:flex;width:100%;height:100%;min-height:1rem}.skeleton__indicator{flex:1 1 auto;background:var(--color);border-radius:var(--border-radius)}.skeleton--sheen .skeleton__indicator{background:linear-gradient(270deg, var(--sheen-color), var(--color), var(--color), var(--sheen-color));background-size:400% 100%;background-size:400% 100%;animation:sheen 8s ease-in-out infinite}.skeleton--pulse .skeleton__indicator{animation:pulse 2s ease-in-out 0.5s infinite}@keyframes sheen{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}";
|
4 |
|
1 |
+
import { r as registerInstance, h } from './index-936ae1d6.js';
|
2 |
|
3 |
const prestoSkeletonCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{--border-radius:var(--presto-player-border-radius-pill);--color:#e5e7eb;--sheen-color:#f3f4f6;display:block;position:relative}.skeleton{display:flex;width:100%;height:100%;min-height:1rem}.skeleton__indicator{flex:1 1 auto;background:var(--color);border-radius:var(--border-radius)}.skeleton--sheen .skeleton__indicator{background:linear-gradient(270deg, var(--sheen-color), var(--color), var(--color), var(--sheen-color));background-size:400% 100%;background-size:400% 100%;animation:sheen 8s ease-in-out infinite}.skeleton--pulse .skeleton__indicator{animation:pulse 2s ease-in-out 0.5s infinite}@keyframes sheen{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}";
|
4 |
|
dist/components/esm/presto-video-curtain-ui.entry.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import { r as registerInstance, h } from './index-
|
2 |
|
3 |
const prestoVideoCurtainUiCss = ":host{font-size:16px}.curtain{position:relative;font-family:var(--presto-curtain-font-family, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\");background-color:var(--presto-curtain-background-color, #000);text-align:var(--presto-curtain-text-align, center);color:var(--presto-curtain-text-color, #fff);padding-bottom:var(--presto-curtain-size, 56.25%);font-size:var(--presto-curtain-font-size, 1.5em)}::slotted(:not(:first-child)){margin-top:14px}.content{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;flex-direction:column;padding:48px}";
|
4 |
|
1 |
+
import { r as registerInstance, h } from './index-936ae1d6.js';
|
2 |
|
3 |
const prestoVideoCurtainUiCss = ":host{font-size:16px}.curtain{position:relative;font-family:var(--presto-curtain-font-family, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\");background-color:var(--presto-curtain-background-color, #000);text-align:var(--presto-curtain-text-align, center);color:var(--presto-curtain-text-color, #fff);padding-bottom:var(--presto-curtain-size, 56.25%);font-size:var(--presto-curtain-font-size, 1.5em)}::slotted(:not(:first-child)){margin-top:14px}.content{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;flex-direction:column;padding:48px}";
|
4 |
|
dist/components/esm/{resize-observer-05e5e763.js → resize-observer-641aea72.js}
RENAMED
@@ -13,10 +13,8 @@ var hasSkippedObservations = function hasSkippedObservations() {
|
|
13 |
};
|
14 |
|
15 |
var msg = 'ResizeObserver loop completed with undelivered notifications.';
|
16 |
-
|
17 |
var deliverResizeLoopError = function deliverResizeLoopError() {
|
18 |
var event;
|
19 |
-
|
20 |
if (typeof ErrorEvent === 'function') {
|
21 |
event = new ErrorEvent('error', {
|
22 |
message: msg
|
@@ -26,12 +24,10 @@ var deliverResizeLoopError = function deliverResizeLoopError() {
|
|
26 |
event.initEvent('error', false, false);
|
27 |
event.message = msg;
|
28 |
}
|
29 |
-
|
30 |
window.dispatchEvent(event);
|
31 |
};
|
32 |
|
33 |
var ResizeObserverBoxOptions;
|
34 |
-
|
35 |
(function (ResizeObserverBoxOptions) {
|
36 |
ResizeObserverBoxOptions["BORDER_BOX"] = "border-box";
|
37 |
ResizeObserverBoxOptions["CONTENT_BOX"] = "content-box";
|
@@ -48,7 +44,6 @@ var ResizeObserverSize = function () {
|
|
48 |
this.blockSize = blockSize;
|
49 |
freeze(this);
|
50 |
}
|
51 |
-
|
52 |
return ResizeObserverSize;
|
53 |
}();
|
54 |
|
@@ -64,18 +59,16 @@ var DOMRectReadOnly = function () {
|
|
64 |
this.right = this.left + this.width;
|
65 |
return freeze(this);
|
66 |
}
|
67 |
-
|
68 |
DOMRectReadOnly.prototype.toJSON = function () {
|
69 |
var _a = this,
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
return {
|
80 |
x: x,
|
81 |
y: y,
|
@@ -87,51 +80,41 @@ var DOMRectReadOnly = function () {
|
|
87 |
height: height
|
88 |
};
|
89 |
};
|
90 |
-
|
91 |
DOMRectReadOnly.fromRect = function (rectangle) {
|
92 |
return new DOMRectReadOnly(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
|
93 |
};
|
94 |
-
|
95 |
return DOMRectReadOnly;
|
96 |
}();
|
97 |
|
98 |
var isSVG = function isSVG(target) {
|
99 |
return target instanceof SVGElement && 'getBBox' in target;
|
100 |
};
|
101 |
-
|
102 |
var isHidden = function isHidden(target) {
|
103 |
if (isSVG(target)) {
|
104 |
var _a = target.getBBox(),
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
return !width && !height;
|
109 |
}
|
110 |
-
|
111 |
var _b = target,
|
112 |
-
|
113 |
-
|
114 |
return !(offsetWidth || offsetHeight || target.getClientRects().length);
|
115 |
};
|
116 |
-
|
117 |
var isElement = function isElement(obj) {
|
118 |
-
var _a
|
119 |
-
|
120 |
if (obj instanceof Element) {
|
121 |
return true;
|
122 |
}
|
123 |
-
|
124 |
-
var scope = (_b = (_a = obj) === null || _a === void 0 ? void 0 : _a.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView;
|
125 |
return !!(scope && obj instanceof scope.Element);
|
126 |
};
|
127 |
-
|
128 |
var isReplacedElement = function isReplacedElement(target) {
|
129 |
switch (target.tagName) {
|
130 |
case 'INPUT':
|
131 |
if (target.type !== 'image') {
|
132 |
break;
|
133 |
}
|
134 |
-
|
135 |
case 'VIDEO':
|
136 |
case 'AUDIO':
|
137 |
case 'EMBED':
|
@@ -141,7 +124,6 @@ var isReplacedElement = function isReplacedElement(target) {
|
|
141 |
case 'IMG':
|
142 |
return true;
|
143 |
}
|
144 |
-
|
145 |
return false;
|
146 |
};
|
147 |
|
@@ -151,48 +133,38 @@ var cache = new WeakMap();
|
|
151 |
var scrollRegexp = /auto|scroll/;
|
152 |
var verticalRegexp = /^tb|vertical/;
|
153 |
var IE = /msie|trident/i.test(global.navigator && global.navigator.userAgent);
|
154 |
-
|
155 |
var parseDimension = function parseDimension(pixel) {
|
156 |
return parseFloat(pixel || '0');
|
157 |
};
|
158 |
-
|
159 |
var size = function size(inlineSize, blockSize, switchSizes) {
|
160 |
if (inlineSize === void 0) {
|
161 |
inlineSize = 0;
|
162 |
}
|
163 |
-
|
164 |
if (blockSize === void 0) {
|
165 |
blockSize = 0;
|
166 |
}
|
167 |
-
|
168 |
if (switchSizes === void 0) {
|
169 |
switchSizes = false;
|
170 |
}
|
171 |
-
|
172 |
return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
|
173 |
};
|
174 |
-
|
175 |
var zeroBoxes = freeze({
|
176 |
devicePixelContentBoxSize: size(),
|
177 |
borderBoxSize: size(),
|
178 |
contentBoxSize: size(),
|
179 |
contentRect: new DOMRectReadOnly(0, 0, 0, 0)
|
180 |
});
|
181 |
-
|
182 |
var calculateBoxSizes = function calculateBoxSizes(target, forceRecalculation) {
|
183 |
if (forceRecalculation === void 0) {
|
184 |
forceRecalculation = false;
|
185 |
}
|
186 |
-
|
187 |
if (cache.has(target) && !forceRecalculation) {
|
188 |
return cache.get(target);
|
189 |
}
|
190 |
-
|
191 |
if (isHidden(target)) {
|
192 |
cache.set(target, zeroBoxes);
|
193 |
return zeroBoxes;
|
194 |
}
|
195 |
-
|
196 |
var cs = getComputedStyle(target);
|
197 |
var svg = isSVG(target) && target.ownerSVGElement && target.getBBox();
|
198 |
var removePadding = !IE && cs.boxSizing === 'border-box';
|
@@ -228,20 +200,16 @@ var calculateBoxSizes = function calculateBoxSizes(target, forceRecalculation) {
|
|
228 |
cache.set(target, boxes);
|
229 |
return boxes;
|
230 |
};
|
231 |
-
|
232 |
var calculateBoxSize = function calculateBoxSize(target, observedBox, forceRecalculation) {
|
233 |
var _a = calculateBoxSizes(target, forceRecalculation),
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
switch (observedBox) {
|
239 |
case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:
|
240 |
return devicePixelContentBoxSize;
|
241 |
-
|
242 |
case ResizeObserverBoxOptions.BORDER_BOX:
|
243 |
return borderBoxSize;
|
244 |
-
|
245 |
default:
|
246 |
return contentBoxSize;
|
247 |
}
|
@@ -256,7 +224,6 @@ var ResizeObserverEntry = function () {
|
|
256 |
this.contentBoxSize = freeze([boxes.contentBoxSize]);
|
257 |
this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);
|
258 |
}
|
259 |
-
|
260 |
return ResizeObserverEntry;
|
261 |
}();
|
262 |
|
@@ -264,15 +231,12 @@ var calculateDepthForNode = function calculateDepthForNode(node) {
|
|
264 |
if (isHidden(node)) {
|
265 |
return Infinity;
|
266 |
}
|
267 |
-
|
268 |
var depth = 0;
|
269 |
var parent = node.parentNode;
|
270 |
-
|
271 |
while (parent) {
|
272 |
depth += 1;
|
273 |
parent = parent.parentNode;
|
274 |
}
|
275 |
-
|
276 |
return depth;
|
277 |
};
|
278 |
|
@@ -283,14 +247,12 @@ var broadcastActiveObservations = function broadcastActiveObservations() {
|
|
283 |
if (ro.activeTargets.length === 0) {
|
284 |
return;
|
285 |
}
|
286 |
-
|
287 |
var entries = [];
|
288 |
ro.activeTargets.forEach(function processTarget(ot) {
|
289 |
var entry = new ResizeObserverEntry(ot.target);
|
290 |
var targetDepth = calculateDepthForNode(ot.target);
|
291 |
entries.push(entry);
|
292 |
ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);
|
293 |
-
|
294 |
if (targetDepth < shallowestDepth) {
|
295 |
shallowestDepth = targetDepth;
|
296 |
}
|
@@ -300,12 +262,10 @@ var broadcastActiveObservations = function broadcastActiveObservations() {
|
|
300 |
});
|
301 |
ro.activeTargets.splice(0, ro.activeTargets.length);
|
302 |
});
|
303 |
-
|
304 |
for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
|
305 |
var callback = callbacks_1[_i];
|
306 |
callback();
|
307 |
}
|
308 |
-
|
309 |
return shallowestDepth;
|
310 |
};
|
311 |
|
@@ -328,28 +288,23 @@ var gatherActiveObservationsAtDepth = function gatherActiveObservationsAtDepth(d
|
|
328 |
var process = function process() {
|
329 |
var depth = 0;
|
330 |
gatherActiveObservationsAtDepth(depth);
|
331 |
-
|
332 |
while (hasActiveObservations()) {
|
333 |
depth = broadcastActiveObservations();
|
334 |
gatherActiveObservationsAtDepth(depth);
|
335 |
}
|
336 |
-
|
337 |
if (hasSkippedObservations()) {
|
338 |
deliverResizeLoopError();
|
339 |
}
|
340 |
-
|
341 |
return depth > 0;
|
342 |
};
|
343 |
|
344 |
var trigger;
|
345 |
var callbacks = [];
|
346 |
-
|
347 |
var notify = function notify() {
|
348 |
return callbacks.splice(0).forEach(function (cb) {
|
349 |
return cb();
|
350 |
});
|
351 |
};
|
352 |
-
|
353 |
var queueMicroTask = function queueMicroTask(callback) {
|
354 |
if (!trigger) {
|
355 |
var toggle_1 = 0;
|
@@ -360,12 +315,10 @@ var queueMicroTask = function queueMicroTask(callback) {
|
|
360 |
new MutationObserver(function () {
|
361 |
return notify();
|
362 |
}).observe(el_1, config);
|
363 |
-
|
364 |
trigger = function trigger() {
|
365 |
-
el_1.textContent = ""
|
366 |
};
|
367 |
}
|
368 |
-
|
369 |
callbacks.push(callback);
|
370 |
trigger();
|
371 |
};
|
@@ -377,11 +330,9 @@ var queueResizeObserver = function queueResizeObserver(cb) {
|
|
377 |
};
|
378 |
|
379 |
var watching = 0;
|
380 |
-
|
381 |
var isWatching = function isWatching() {
|
382 |
return !!watching;
|
383 |
};
|
384 |
-
|
385 |
var CATCH_PERIOD = 250;
|
386 |
var observerConfig = {
|
387 |
attributes: true,
|
@@ -390,54 +341,41 @@ var observerConfig = {
|
|
390 |
subtree: true
|
391 |
};
|
392 |
var events = ['resize', 'load', 'transitionend', 'animationend', 'animationstart', 'animationiteration', 'keyup', 'keydown', 'mouseup', 'mousedown', 'mouseover', 'mouseout', 'blur', 'focus'];
|
393 |
-
|
394 |
var time = function time(timeout) {
|
395 |
if (timeout === void 0) {
|
396 |
timeout = 0;
|
397 |
}
|
398 |
-
|
399 |
return Date.now() + timeout;
|
400 |
};
|
401 |
-
|
402 |
var scheduled = false;
|
403 |
-
|
404 |
var Scheduler = function () {
|
405 |
function Scheduler() {
|
406 |
var _this = this;
|
407 |
-
|
408 |
this.stopped = true;
|
409 |
-
|
410 |
this.listener = function () {
|
411 |
return _this.schedule();
|
412 |
};
|
413 |
}
|
414 |
-
|
415 |
Scheduler.prototype.run = function (timeout) {
|
416 |
var _this = this;
|
417 |
-
|
418 |
if (timeout === void 0) {
|
419 |
timeout = CATCH_PERIOD;
|
420 |
}
|
421 |
-
|
422 |
if (scheduled) {
|
423 |
return;
|
424 |
}
|
425 |
-
|
426 |
scheduled = true;
|
427 |
var until = time(timeout);
|
428 |
queueResizeObserver(function () {
|
429 |
var elementsHaveResized = false;
|
430 |
-
|
431 |
try {
|
432 |
elementsHaveResized = process();
|
433 |
} finally {
|
434 |
scheduled = false;
|
435 |
timeout = until - time();
|
436 |
-
|
437 |
if (!isWatching()) {
|
438 |
return;
|
439 |
}
|
440 |
-
|
441 |
if (elementsHaveResized) {
|
442 |
_this.run(1000);
|
443 |
} else if (timeout > 0) {
|
@@ -448,25 +386,19 @@ var Scheduler = function () {
|
|
448 |
}
|
449 |
});
|
450 |
};
|
451 |
-
|
452 |
Scheduler.prototype.schedule = function () {
|
453 |
this.stop();
|
454 |
this.run();
|
455 |
};
|
456 |
-
|
457 |
Scheduler.prototype.observe = function () {
|
458 |
var _this = this;
|
459 |
-
|
460 |
var cb = function cb() {
|
461 |
return _this.observer && _this.observer.observe(document.body, observerConfig);
|
462 |
};
|
463 |
-
|
464 |
document.body ? cb() : global.addEventListener('DOMContentLoaded', cb);
|
465 |
};
|
466 |
-
|
467 |
Scheduler.prototype.start = function () {
|
468 |
var _this = this;
|
469 |
-
|
470 |
if (this.stopped) {
|
471 |
this.stopped = false;
|
472 |
this.observer = new MutationObserver(this.listener);
|
@@ -476,10 +408,8 @@ var Scheduler = function () {
|
|
476 |
});
|
477 |
}
|
478 |
};
|
479 |
-
|
480 |
Scheduler.prototype.stop = function () {
|
481 |
var _this = this;
|
482 |
-
|
483 |
if (!this.stopped) {
|
484 |
this.observer && this.observer.disconnect();
|
485 |
events.forEach(function (name) {
|
@@ -488,12 +418,9 @@ var Scheduler = function () {
|
|
488 |
this.stopped = true;
|
489 |
}
|
490 |
};
|
491 |
-
|
492 |
return Scheduler;
|
493 |
}();
|
494 |
-
|
495 |
var scheduler = new Scheduler();
|
496 |
-
|
497 |
var updateCount = function updateCount(n) {
|
498 |
!watching && n > 0 && scheduler.start();
|
499 |
watching += n;
|
@@ -503,7 +430,6 @@ var updateCount = function updateCount(n) {
|
|
503 |
var skipNotifyOnElement = function skipNotifyOnElement(target) {
|
504 |
return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === 'inline';
|
505 |
};
|
506 |
-
|
507 |
var ResizeObservation = function () {
|
508 |
function ResizeObservation(target, observedBox) {
|
509 |
this.target = target;
|
@@ -513,21 +439,16 @@ var ResizeObservation = function () {
|
|
513 |
blockSize: 0
|
514 |
};
|
515 |
}
|
516 |
-
|
517 |
ResizeObservation.prototype.isActive = function () {
|
518 |
var size = calculateBoxSize(this.target, this.observedBox, true);
|
519 |
-
|
520 |
if (skipNotifyOnElement(this.target)) {
|
521 |
this.lastReportedSize = size;
|
522 |
}
|
523 |
-
|
524 |
if (this.lastReportedSize.inlineSize !== size.inlineSize || this.lastReportedSize.blockSize !== size.blockSize) {
|
525 |
return true;
|
526 |
}
|
527 |
-
|
528 |
return false;
|
529 |
};
|
530 |
-
|
531 |
return ResizeObservation;
|
532 |
}();
|
533 |
|
@@ -539,34 +460,27 @@ var ResizeObserverDetail = function () {
|
|
539 |
this.observer = resizeObserver;
|
540 |
this.callback = callback;
|
541 |
}
|
542 |
-
|
543 |
return ResizeObserverDetail;
|
544 |
}();
|
545 |
|
546 |
var observerMap = new WeakMap();
|
547 |
-
|
548 |
var getObservationIndex = function getObservationIndex(observationTargets, target) {
|
549 |
for (var i = 0; i < observationTargets.length; i += 1) {
|
550 |
if (observationTargets[i].target === target) {
|
551 |
return i;
|
552 |
}
|
553 |
}
|
554 |
-
|
555 |
return -1;
|
556 |
};
|
557 |
-
|
558 |
var ResizeObserverController = function () {
|
559 |
function ResizeObserverController() {}
|
560 |
-
|
561 |
ResizeObserverController.connect = function (resizeObserver, callback) {
|
562 |
var detail = new ResizeObserverDetail(resizeObserver, callback);
|
563 |
observerMap.set(resizeObserver, detail);
|
564 |
};
|
565 |
-
|
566 |
ResizeObserverController.observe = function (resizeObserver, target, options) {
|
567 |
var detail = observerMap.get(resizeObserver);
|
568 |
var firstObservation = detail.observationTargets.length === 0;
|
569 |
-
|
570 |
if (getObservationIndex(detail.observationTargets, target) < 0) {
|
571 |
firstObservation && resizeObservers.push(detail);
|
572 |
detail.observationTargets.push(new ResizeObservation(target, options && options.box));
|
@@ -574,29 +488,24 @@ var ResizeObserverController = function () {
|
|
574 |
scheduler.schedule();
|
575 |
}
|
576 |
};
|
577 |
-
|
578 |
ResizeObserverController.unobserve = function (resizeObserver, target) {
|
579 |
var detail = observerMap.get(resizeObserver);
|
580 |
var index = getObservationIndex(detail.observationTargets, target);
|
581 |
var lastObservation = detail.observationTargets.length === 1;
|
582 |
-
|
583 |
if (index >= 0) {
|
584 |
lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1);
|
585 |
detail.observationTargets.splice(index, 1);
|
586 |
updateCount(-1);
|
587 |
}
|
588 |
};
|
589 |
-
|
590 |
ResizeObserverController.disconnect = function (resizeObserver) {
|
591 |
var _this = this;
|
592 |
-
|
593 |
var detail = observerMap.get(resizeObserver);
|
594 |
detail.observationTargets.slice().forEach(function (ot) {
|
595 |
return _this.unobserve(resizeObserver, ot.target);
|
596 |
});
|
597 |
detail.activeTargets.splice(0, detail.activeTargets.length);
|
598 |
};
|
599 |
-
|
600 |
return ResizeObserverController;
|
601 |
}();
|
602 |
|
@@ -605,46 +514,35 @@ var ResizeObserver = function () {
|
|
605 |
if (arguments.length === 0) {
|
606 |
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
|
607 |
}
|
608 |
-
|
609 |
if (typeof callback !== 'function') {
|
610 |
throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
|
611 |
}
|
612 |
-
|
613 |
ResizeObserverController.connect(this, callback);
|
614 |
}
|
615 |
-
|
616 |
ResizeObserver.prototype.observe = function (target, options) {
|
617 |
if (arguments.length === 0) {
|
618 |
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
619 |
}
|
620 |
-
|
621 |
if (!isElement(target)) {
|
622 |
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
623 |
}
|
624 |
-
|
625 |
ResizeObserverController.observe(this, target, options);
|
626 |
};
|
627 |
-
|
628 |
ResizeObserver.prototype.unobserve = function (target) {
|
629 |
if (arguments.length === 0) {
|
630 |
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
631 |
}
|
632 |
-
|
633 |
if (!isElement(target)) {
|
634 |
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
635 |
}
|
636 |
-
|
637 |
ResizeObserverController.unobserve(this, target);
|
638 |
};
|
639 |
-
|
640 |
ResizeObserver.prototype.disconnect = function () {
|
641 |
ResizeObserverController.disconnect(this);
|
642 |
};
|
643 |
-
|
644 |
ResizeObserver.toString = function () {
|
645 |
return 'function ResizeObserver () { [polyfill code] }';
|
646 |
};
|
647 |
-
|
648 |
return ResizeObserver;
|
649 |
}();
|
650 |
|
13 |
};
|
14 |
|
15 |
var msg = 'ResizeObserver loop completed with undelivered notifications.';
|
|
|
16 |
var deliverResizeLoopError = function deliverResizeLoopError() {
|
17 |
var event;
|
|
|
18 |
if (typeof ErrorEvent === 'function') {
|
19 |
event = new ErrorEvent('error', {
|
20 |
message: msg
|
24 |
event.initEvent('error', false, false);
|
25 |
event.message = msg;
|
26 |
}
|
|
|
27 |
window.dispatchEvent(event);
|
28 |
};
|
29 |
|
30 |
var ResizeObserverBoxOptions;
|
|
|
31 |
(function (ResizeObserverBoxOptions) {
|
32 |
ResizeObserverBoxOptions["BORDER_BOX"] = "border-box";
|
33 |
ResizeObserverBoxOptions["CONTENT_BOX"] = "content-box";
|
44 |
this.blockSize = blockSize;
|
45 |
freeze(this);
|
46 |
}
|
|
|
47 |
return ResizeObserverSize;
|
48 |
}();
|
49 |
|
59 |
this.right = this.left + this.width;
|
60 |
return freeze(this);
|
61 |
}
|
|
|
62 |
DOMRectReadOnly.prototype.toJSON = function () {
|
63 |
var _a = this,
|
64 |
+
x = _a.x,
|
65 |
+
y = _a.y,
|
66 |
+
top = _a.top,
|
67 |
+
right = _a.right,
|
68 |
+
bottom = _a.bottom,
|
69 |
+
left = _a.left,
|
70 |
+
width = _a.width,
|
71 |
+
height = _a.height;
|
|
|
72 |
return {
|
73 |
x: x,
|
74 |
y: y,
|
80 |
height: height
|
81 |
};
|
82 |
};
|
|
|
83 |
DOMRectReadOnly.fromRect = function (rectangle) {
|
84 |
return new DOMRectReadOnly(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
|
85 |
};
|
|
|
86 |
return DOMRectReadOnly;
|
87 |
}();
|
88 |
|
89 |
var isSVG = function isSVG(target) {
|
90 |
return target instanceof SVGElement && 'getBBox' in target;
|
91 |
};
|
|
|
92 |
var isHidden = function isHidden(target) {
|
93 |
if (isSVG(target)) {
|
94 |
var _a = target.getBBox(),
|
95 |
+
width = _a.width,
|
96 |
+
height = _a.height;
|
|
|
97 |
return !width && !height;
|
98 |
}
|
|
|
99 |
var _b = target,
|
100 |
+
offsetWidth = _b.offsetWidth,
|
101 |
+
offsetHeight = _b.offsetHeight;
|
102 |
return !(offsetWidth || offsetHeight || target.getClientRects().length);
|
103 |
};
|
|
|
104 |
var isElement = function isElement(obj) {
|
105 |
+
var _a;
|
|
|
106 |
if (obj instanceof Element) {
|
107 |
return true;
|
108 |
}
|
109 |
+
var scope = (_a = obj === null || obj === void 0 ? void 0 : obj.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
|
|
|
110 |
return !!(scope && obj instanceof scope.Element);
|
111 |
};
|
|
|
112 |
var isReplacedElement = function isReplacedElement(target) {
|
113 |
switch (target.tagName) {
|
114 |
case 'INPUT':
|
115 |
if (target.type !== 'image') {
|
116 |
break;
|
117 |
}
|
|
|
118 |
case 'VIDEO':
|
119 |
case 'AUDIO':
|
120 |
case 'EMBED':
|
124 |
case 'IMG':
|
125 |
return true;
|
126 |
}
|
|
|
127 |
return false;
|
128 |
};
|
129 |
|
133 |
var scrollRegexp = /auto|scroll/;
|
134 |
var verticalRegexp = /^tb|vertical/;
|
135 |
var IE = /msie|trident/i.test(global.navigator && global.navigator.userAgent);
|
|
|
136 |
var parseDimension = function parseDimension(pixel) {
|
137 |
return parseFloat(pixel || '0');
|
138 |
};
|
|
|
139 |
var size = function size(inlineSize, blockSize, switchSizes) {
|
140 |
if (inlineSize === void 0) {
|
141 |
inlineSize = 0;
|
142 |
}
|
|
|
143 |
if (blockSize === void 0) {
|
144 |
blockSize = 0;
|
145 |
}
|
|
|
146 |
if (switchSizes === void 0) {
|
147 |
switchSizes = false;
|
148 |
}
|
|
|
149 |
return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
|
150 |
};
|
|
|
151 |
var zeroBoxes = freeze({
|
152 |
devicePixelContentBoxSize: size(),
|
153 |
borderBoxSize: size(),
|
154 |
contentBoxSize: size(),
|
155 |
contentRect: new DOMRectReadOnly(0, 0, 0, 0)
|
156 |
});
|
|
|
157 |
var calculateBoxSizes = function calculateBoxSizes(target, forceRecalculation) {
|
158 |
if (forceRecalculation === void 0) {
|
159 |
forceRecalculation = false;
|
160 |
}
|
|
|
161 |
if (cache.has(target) && !forceRecalculation) {
|
162 |
return cache.get(target);
|
163 |
}
|
|
|
164 |
if (isHidden(target)) {
|
165 |
cache.set(target, zeroBoxes);
|
166 |
return zeroBoxes;
|
167 |
}
|
|
|
168 |
var cs = getComputedStyle(target);
|
169 |
var svg = isSVG(target) && target.ownerSVGElement && target.getBBox();
|
170 |
var removePadding = !IE && cs.boxSizing === 'border-box';
|
200 |
cache.set(target, boxes);
|
201 |
return boxes;
|
202 |
};
|
|
|
203 |
var calculateBoxSize = function calculateBoxSize(target, observedBox, forceRecalculation) {
|
204 |
var _a = calculateBoxSizes(target, forceRecalculation),
|
205 |
+
borderBoxSize = _a.borderBoxSize,
|
206 |
+
contentBoxSize = _a.contentBoxSize,
|
207 |
+
devicePixelContentBoxSize = _a.devicePixelContentBoxSize;
|
|
|
208 |
switch (observedBox) {
|
209 |
case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:
|
210 |
return devicePixelContentBoxSize;
|
|
|
211 |
case ResizeObserverBoxOptions.BORDER_BOX:
|
212 |
return borderBoxSize;
|
|
|
213 |
default:
|
214 |
return contentBoxSize;
|
215 |
}
|
224 |
this.contentBoxSize = freeze([boxes.contentBoxSize]);
|
225 |
this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);
|
226 |
}
|
|
|
227 |
return ResizeObserverEntry;
|
228 |
}();
|
229 |
|
231 |
if (isHidden(node)) {
|
232 |
return Infinity;
|
233 |
}
|
|
|
234 |
var depth = 0;
|
235 |
var parent = node.parentNode;
|
|
|
236 |
while (parent) {
|
237 |
depth += 1;
|
238 |
parent = parent.parentNode;
|
239 |
}
|
|
|
240 |
return depth;
|
241 |
};
|
242 |
|
247 |
if (ro.activeTargets.length === 0) {
|
248 |
return;
|
249 |
}
|
|
|
250 |
var entries = [];
|
251 |
ro.activeTargets.forEach(function processTarget(ot) {
|
252 |
var entry = new ResizeObserverEntry(ot.target);
|
253 |
var targetDepth = calculateDepthForNode(ot.target);
|
254 |
entries.push(entry);
|
255 |
ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);
|
|
|
256 |
if (targetDepth < shallowestDepth) {
|
257 |
shallowestDepth = targetDepth;
|
258 |
}
|
262 |
});
|
263 |
ro.activeTargets.splice(0, ro.activeTargets.length);
|
264 |
});
|
|
|
265 |
for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
|
266 |
var callback = callbacks_1[_i];
|
267 |
callback();
|
268 |
}
|
|
|
269 |
return shallowestDepth;
|
270 |
};
|
271 |
|
288 |
var process = function process() {
|
289 |
var depth = 0;
|
290 |
gatherActiveObservationsAtDepth(depth);
|
|
|
291 |
while (hasActiveObservations()) {
|
292 |
depth = broadcastActiveObservations();
|
293 |
gatherActiveObservationsAtDepth(depth);
|
294 |
}
|
|
|
295 |
if (hasSkippedObservations()) {
|
296 |
deliverResizeLoopError();
|
297 |
}
|
|
|
298 |
return depth > 0;
|
299 |
};
|
300 |
|
301 |
var trigger;
|
302 |
var callbacks = [];
|
|
|
303 |
var notify = function notify() {
|
304 |
return callbacks.splice(0).forEach(function (cb) {
|
305 |
return cb();
|
306 |
});
|
307 |
};
|
|
|
308 |
var queueMicroTask = function queueMicroTask(callback) {
|
309 |
if (!trigger) {
|
310 |
var toggle_1 = 0;
|
315 |
new MutationObserver(function () {
|
316 |
return notify();
|
317 |
}).observe(el_1, config);
|
|
|
318 |
trigger = function trigger() {
|
319 |
+
el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++);
|
320 |
};
|
321 |
}
|
|
|
322 |
callbacks.push(callback);
|
323 |
trigger();
|
324 |
};
|
330 |
};
|
331 |
|
332 |
var watching = 0;
|
|
|
333 |
var isWatching = function isWatching() {
|
334 |
return !!watching;
|
335 |
};
|
|
|
336 |
var CATCH_PERIOD = 250;
|
337 |
var observerConfig = {
|
338 |
attributes: true,
|
341 |
subtree: true
|
342 |
};
|
343 |
var events = ['resize', 'load', 'transitionend', 'animationend', 'animationstart', 'animationiteration', 'keyup', 'keydown', 'mouseup', 'mousedown', 'mouseover', 'mouseout', 'blur', 'focus'];
|
|
|
344 |
var time = function time(timeout) {
|
345 |
if (timeout === void 0) {
|
346 |
timeout = 0;
|
347 |
}
|
|
|
348 |
return Date.now() + timeout;
|
349 |
};
|
|
|
350 |
var scheduled = false;
|
|
|
351 |
var Scheduler = function () {
|
352 |
function Scheduler() {
|
353 |
var _this = this;
|
|
|
354 |
this.stopped = true;
|
|
|
355 |
this.listener = function () {
|
356 |
return _this.schedule();
|
357 |
};
|
358 |
}
|
|
|
359 |
Scheduler.prototype.run = function (timeout) {
|
360 |
var _this = this;
|
|
|
361 |
if (timeout === void 0) {
|
362 |
timeout = CATCH_PERIOD;
|
363 |
}
|
|
|
364 |
if (scheduled) {
|
365 |
return;
|
366 |
}
|
|
|
367 |
scheduled = true;
|
368 |
var until = time(timeout);
|
369 |
queueResizeObserver(function () {
|
370 |
var elementsHaveResized = false;
|
|
|
371 |
try {
|
372 |
elementsHaveResized = process();
|
373 |
} finally {
|
374 |
scheduled = false;
|
375 |
timeout = until - time();
|
|
|
376 |
if (!isWatching()) {
|
377 |
return;
|
378 |
}
|
|
|
379 |
if (elementsHaveResized) {
|
380 |
_this.run(1000);
|
381 |
} else if (timeout > 0) {
|
386 |
}
|
387 |
});
|
388 |
};
|
|
|
389 |
Scheduler.prototype.schedule = function () {
|
390 |
this.stop();
|
391 |
this.run();
|
392 |
};
|
|
|
393 |
Scheduler.prototype.observe = function () {
|
394 |
var _this = this;
|
|
|
395 |
var cb = function cb() {
|
396 |
return _this.observer && _this.observer.observe(document.body, observerConfig);
|
397 |
};
|
|
|
398 |
document.body ? cb() : global.addEventListener('DOMContentLoaded', cb);
|
399 |
};
|
|
|
400 |
Scheduler.prototype.start = function () {
|
401 |
var _this = this;
|
|
|
402 |
if (this.stopped) {
|
403 |
this.stopped = false;
|
404 |
this.observer = new MutationObserver(this.listener);
|
408 |
});
|
409 |
}
|
410 |
};
|
|
|
411 |
Scheduler.prototype.stop = function () {
|
412 |
var _this = this;
|
|
|
413 |
if (!this.stopped) {
|
414 |
this.observer && this.observer.disconnect();
|
415 |
events.forEach(function (name) {
|
418 |
this.stopped = true;
|
419 |
}
|
420 |
};
|
|
|
421 |
return Scheduler;
|
422 |
}();
|
|
|
423 |
var scheduler = new Scheduler();
|
|
|
424 |
var updateCount = function updateCount(n) {
|
425 |
!watching && n > 0 && scheduler.start();
|
426 |
watching += n;
|
430 |
var skipNotifyOnElement = function skipNotifyOnElement(target) {
|
431 |
return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === 'inline';
|
432 |
};
|
|
|
433 |
var ResizeObservation = function () {
|
434 |
function ResizeObservation(target, observedBox) {
|
435 |
this.target = target;
|
439 |
blockSize: 0
|
440 |
};
|
441 |
}
|
|
|
442 |
ResizeObservation.prototype.isActive = function () {
|
443 |
var size = calculateBoxSize(this.target, this.observedBox, true);
|
|
|
444 |
if (skipNotifyOnElement(this.target)) {
|
445 |
this.lastReportedSize = size;
|
446 |
}
|
|
|
447 |
if (this.lastReportedSize.inlineSize !== size.inlineSize || this.lastReportedSize.blockSize !== size.blockSize) {
|
448 |
return true;
|
449 |
}
|
|
|
450 |
return false;
|
451 |
};
|
|
|
452 |
return ResizeObservation;
|
453 |
}();
|
454 |
|
460 |
this.observer = resizeObserver;
|
461 |
this.callback = callback;
|
462 |
}
|
|
|
463 |
return ResizeObserverDetail;
|
464 |
}();
|
465 |
|
466 |
var observerMap = new WeakMap();
|
|
|
467 |
var getObservationIndex = function getObservationIndex(observationTargets, target) {
|
468 |
for (var i = 0; i < observationTargets.length; i += 1) {
|
469 |
if (observationTargets[i].target === target) {
|
470 |
return i;
|
471 |
}
|
472 |
}
|
|
|
473 |
return -1;
|
474 |
};
|
|
|
475 |
var ResizeObserverController = function () {
|
476 |
function ResizeObserverController() {}
|
|
|
477 |
ResizeObserverController.connect = function (resizeObserver, callback) {
|
478 |
var detail = new ResizeObserverDetail(resizeObserver, callback);
|
479 |
observerMap.set(resizeObserver, detail);
|
480 |
};
|
|
|
481 |
ResizeObserverController.observe = function (resizeObserver, target, options) {
|
482 |
var detail = observerMap.get(resizeObserver);
|
483 |
var firstObservation = detail.observationTargets.length === 0;
|
|
|
484 |
if (getObservationIndex(detail.observationTargets, target) < 0) {
|
485 |
firstObservation && resizeObservers.push(detail);
|
486 |
detail.observationTargets.push(new ResizeObservation(target, options && options.box));
|
488 |
scheduler.schedule();
|
489 |
}
|
490 |
};
|
|
|
491 |
ResizeObserverController.unobserve = function (resizeObserver, target) {
|
492 |
var detail = observerMap.get(resizeObserver);
|
493 |
var index = getObservationIndex(detail.observationTargets, target);
|
494 |
var lastObservation = detail.observationTargets.length === 1;
|
|
|
495 |
if (index >= 0) {
|
496 |
lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1);
|
497 |
detail.observationTargets.splice(index, 1);
|
498 |
updateCount(-1);
|
499 |
}
|
500 |
};
|
|
|
501 |
ResizeObserverController.disconnect = function (resizeObserver) {
|
502 |
var _this = this;
|
|
|
503 |
var detail = observerMap.get(resizeObserver);
|
504 |
detail.observationTargets.slice().forEach(function (ot) {
|
505 |
return _this.unobserve(resizeObserver, ot.target);
|
506 |
});
|
507 |
detail.activeTargets.splice(0, detail.activeTargets.length);
|
508 |
};
|
|
|
509 |
return ResizeObserverController;
|
510 |
}();
|
511 |
|
514 |
if (arguments.length === 0) {
|
515 |
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
|
516 |
}
|
|
|
517 |
if (typeof callback !== 'function') {
|
518 |
throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
|
519 |
}
|
|
|
520 |
ResizeObserverController.connect(this, callback);
|
521 |
}
|
|
|
522 |
ResizeObserver.prototype.observe = function (target, options) {
|
523 |
if (arguments.length === 0) {
|
524 |
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
525 |
}
|
|
|
526 |
if (!isElement(target)) {
|
527 |
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
528 |
}
|
|
|
529 |
ResizeObserverController.observe(this, target, options);
|
530 |
};
|
|
|
531 |
ResizeObserver.prototype.unobserve = function (target) {
|
532 |
if (arguments.length === 0) {
|
533 |
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
534 |
}
|
|
|
535 |
if (!isElement(target)) {
|
536 |
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
537 |
}
|
|
|
538 |
ResizeObserverController.unobserve(this, target);
|
539 |
};
|
|
|
540 |
ResizeObserver.prototype.disconnect = function () {
|
541 |
ResizeObserverController.disconnect(this);
|
542 |
};
|
|
|
543 |
ResizeObserver.toString = function () {
|
544 |
return 'function ResizeObserver () { [polyfill code] }';
|
545 |
};
|
|
|
546 |
return ResizeObserver;
|
547 |
}();
|
548 |
|
dist/components/esm/{tutor-25b387c9.js → tutor-ed49135f.js}
RENAMED
@@ -2,11 +2,9 @@ function tutor (player) {
|
|
2 |
// autoload course content
|
3 |
var autoload_content = function autoload_content() {
|
4 |
var _tutorobject2, _tutorobject3;
|
5 |
-
|
6 |
if (!_tutorobject.nonce_key || !((_tutorobject2 = _tutorobject) !== null && _tutorobject2 !== void 0 && _tutorobject2.ajaxurl)) {
|
7 |
return;
|
8 |
}
|
9 |
-
|
10 |
var post_id = getVideoData().post_id;
|
11 |
var data = {
|
12 |
action: 'autoload_next_course_content',
|
@@ -15,17 +13,15 @@ function tutor (player) {
|
|
15 |
data[_tutorobject.nonce_key] = _tutorobject[_tutorobject.nonce_key];
|
16 |
jQuery.post((_tutorobject3 = _tutorobject) === null || _tutorobject3 === void 0 ? void 0 : _tutorobject3.ajaxurl, data).done(function (response) {
|
17 |
var _response$data;
|
18 |
-
|
19 |
if (response !== null && response !== void 0 && response.success && response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.next_url) {
|
20 |
location.href = response.data.next_url;
|
21 |
}
|
22 |
});
|
23 |
-
};
|
24 |
-
|
25 |
|
|
|
26 |
var sync_time = function sync_time(instance, options) {
|
27 |
var _tutorobject4;
|
28 |
-
|
29 |
var post_id = getVideoData().post_id;
|
30 |
var data = {
|
31 |
action: 'sync_video_playback',
|
@@ -35,36 +31,32 @@ function tutor (player) {
|
|
35 |
};
|
36 |
data[_tutorobject.nonce_key] = _tutorobject[_tutorobject.nonce_key];
|
37 |
var data_send = data;
|
38 |
-
|
39 |
if (options) {
|
40 |
data_send = Object.assign(data, options);
|
41 |
}
|
42 |
-
|
43 |
jQuery.post((_tutorobject4 = _tutorobject) === null || _tutorobject4 === void 0 ? void 0 : _tutorobject4.ajaxurl, data_send);
|
44 |
-
};
|
45 |
-
|
46 |
|
|
|
47 |
var getVideoData = function getVideoData() {
|
48 |
var video_track_data = jQuery('#tutor_video_tracking_information').val();
|
49 |
return video_track_data ? JSON.parse(video_track_data) : {};
|
50 |
-
};
|
51 |
-
|
52 |
|
|
|
53 |
var tempTimeNow = 0;
|
54 |
var intervalSeconds = 30; //Send to tutor backend about video playing time in this interval
|
55 |
-
|
56 |
player.on('timeupdate', function (event) {
|
57 |
var instance = event.detail.plyr;
|
58 |
var tempTimeNowInSec = tempTimeNow / 4; //timeupdate firing 250ms interval
|
59 |
-
|
60 |
if (tempTimeNowInSec >= intervalSeconds) {
|
61 |
sync_time(instance);
|
62 |
tempTimeNow = 0;
|
63 |
}
|
64 |
-
|
65 |
tempTimeNow++;
|
66 |
-
});
|
67 |
|
|
|
68 |
player.on('ended', function (event) {
|
69 |
var video_data = getVideoData();
|
70 |
var instance = event.detail.plyr;
|
@@ -72,7 +64,6 @@ function tutor (player) {
|
|
72 |
is_ended: true
|
73 |
};
|
74 |
sync_time(instance, data);
|
75 |
-
|
76 |
if (video_data.autoload_next_course_content) {
|
77 |
autoload_content();
|
78 |
}
|
2 |
// autoload course content
|
3 |
var autoload_content = function autoload_content() {
|
4 |
var _tutorobject2, _tutorobject3;
|
|
|
5 |
if (!_tutorobject.nonce_key || !((_tutorobject2 = _tutorobject) !== null && _tutorobject2 !== void 0 && _tutorobject2.ajaxurl)) {
|
6 |
return;
|
7 |
}
|
|
|
8 |
var post_id = getVideoData().post_id;
|
9 |
var data = {
|
10 |
action: 'autoload_next_course_content',
|
13 |
data[_tutorobject.nonce_key] = _tutorobject[_tutorobject.nonce_key];
|
14 |
jQuery.post((_tutorobject3 = _tutorobject) === null || _tutorobject3 === void 0 ? void 0 : _tutorobject3.ajaxurl, data).done(function (response) {
|
15 |
var _response$data;
|
|
|
16 |
if (response !== null && response !== void 0 && response.success && response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.next_url) {
|
17 |
location.href = response.data.next_url;
|
18 |
}
|
19 |
});
|
20 |
+
};
|
|
|
21 |
|
22 |
+
// sync time with server
|
23 |
var sync_time = function sync_time(instance, options) {
|
24 |
var _tutorobject4;
|
|
|
25 |
var post_id = getVideoData().post_id;
|
26 |
var data = {
|
27 |
action: 'sync_video_playback',
|
31 |
};
|
32 |
data[_tutorobject.nonce_key] = _tutorobject[_tutorobject.nonce_key];
|
33 |
var data_send = data;
|
|
|
34 |
if (options) {
|
35 |
data_send = Object.assign(data, options);
|
36 |
}
|
|
|
37 |
jQuery.post((_tutorobject4 = _tutorobject) === null || _tutorobject4 === void 0 ? void 0 : _tutorobject4.ajaxurl, data_send);
|
38 |
+
};
|
|
|
39 |
|
40 |
+
// get video data
|
41 |
var getVideoData = function getVideoData() {
|
42 |
var video_track_data = jQuery('#tutor_video_tracking_information').val();
|
43 |
return video_track_data ? JSON.parse(video_track_data) : {};
|
44 |
+
};
|
|
|
45 |
|
46 |
+
// update time on server every 250ms
|
47 |
var tempTimeNow = 0;
|
48 |
var intervalSeconds = 30; //Send to tutor backend about video playing time in this interval
|
|
|
49 |
player.on('timeupdate', function (event) {
|
50 |
var instance = event.detail.plyr;
|
51 |
var tempTimeNowInSec = tempTimeNow / 4; //timeupdate firing 250ms interval
|
|
|
52 |
if (tempTimeNowInSec >= intervalSeconds) {
|
53 |
sync_time(instance);
|
54 |
tempTimeNow = 0;
|
55 |
}
|
|
|
56 |
tempTimeNow++;
|
57 |
+
});
|
58 |
|
59 |
+
// on end, sync time and autoload content
|
60 |
player.on('ended', function (event) {
|
61 |
var video_data = getVideoData();
|
62 |
var instance = event.detail.plyr;
|
64 |
is_ended: true
|
65 |
};
|
66 |
sync_time(instance, data);
|
|
|
67 |
if (video_data.autoload_next_course_content) {
|
68 |
autoload_content();
|
69 |
}
|
dist/components/esm/web-components.js
CHANGED
@@ -1,17 +1,14 @@
|
|
1 |
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
2 |
|
3 |
/*
|
4 |
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
5 |
*/
|
6 |
-
|
7 |
var patchBrowser = function patchBrowser() {
|
8 |
var importMeta = import.meta.url;
|
9 |
var opts = {};
|
10 |
-
|
11 |
if (importMeta !== '') {
|
12 |
opts.resourcesUrl = new URL('.', importMeta).href;
|
13 |
}
|
14 |
-
|
15 |
return promiseResolve(opts);
|
16 |
};
|
17 |
|
1 |
+
import { p as promiseResolve, b as bootstrapLazy } from './index-936ae1d6.js';
|
2 |
|
3 |
/*
|
4 |
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
5 |
*/
|
|
|
6 |
var patchBrowser = function patchBrowser() {
|
7 |
var importMeta = import.meta.url;
|
8 |
var opts = {};
|
|
|
9 |
if (importMeta !== '') {
|
10 |
opts.resourcesUrl = new URL('.', importMeta).href;
|
11 |
}
|
|
|
12 |
return promiseResolve(opts);
|
13 |
};
|
14 |
|
dist/components/web-components/p-146fd1f2.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
import{l as n,a as r}from"./p-219091ba.js";import{P as e}from"./p-771734f3.js";export default function(t){var a=t.config,o=t.selector,i=t.src,u=t.preload;return new Promise(function(){var t=n(regeneratorRuntime.mark((function n(t){var c,s,f;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(window.Hls){n.next=6;break}case 1:if(window.hasOwnProperty("Hls")){n.next=6;break}return n.next=4,new Promise((function(n){return setTimeout(n,50)}));case 4:n.next=1;break;case 6:if(!window.Hls.isSupported()){n.next=16;break}return s=!["metadata","none"].includes(u),null!==(c=wp)&&void 0!==c&&c.blocks&&(s=!0),(f=new window.Hls({autoStartLoad:s})).loadSource(i),f.on(window.Hls.Events.LEVEL_SWITCHED,(function(n,r){o.closest(".presto-player__wrapper").querySelector(".plyr__menu__container [data-plyr='quality'][value='0'] span").innerHTML=f.autoLevelEnabled?"AUTO (".concat(f.levels[r.level].height,"p)"):"AUTO"})),f.on(window.Hls.Events.MANIFEST_PARSED,(function(){var n=f.levels.map((function(n){return n.height}));n.unshift(0);var i=n.findIndex((function(n){var r;return n===parseInt(null===(r=prestoPlayer)||void 0===r?void 0:r.hls_start_level)}));f.startLevel=i?i-1:2,a.quality={default:0,options:n,forced:!0,onChange:function(n){0===n?prestoHLS.currentLevel=-1:prestoHLS.levels.forEach((function(r,e){r.height===n&&(console.log("Found quality match with "+n),prestoHLS.currentLevel=e)}))}},f.attachMedia(o),window.prestoHLS=f;var u=new e(o,r({},a));return u.hls=f,u.on("waiting",(function n(){f.startLoad(-1),u.off("waiting",n)})),u.on("languagechange",(function(){setTimeout((function(){return f.subtitleTrack=u.currentTrack}),50)})),t(u)})),n.abrupt("return");case 16:if(!o.canPlayType("application/vnd.apple.mpegurl")){n.next=18;break}return n.abrupt("return",t(new e(o,r({},a))));case 18:return n.abrupt("return",t(new e(o,r({},a))));case 19:case"end":return n.stop()}}),n)})));return function(n,r){return t.apply(this,arguments)}}())}
|
dist/components/web-components/p-219091ba.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
function n(n,t){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.push.apply(r,e)}return r}function t(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?n(Object(e),!0).forEach((function(n){c(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function r(n){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function e(n,t,r,e,u,o,i){try{var f=n[o](i),c=f.value}catch(n){return void r(n)}f.done?t(c):Promise.resolve(c).then(e,u)}function u(n){return function(){var t=this,r=arguments;return new Promise((function(u,o){var i=n.apply(t,r);function f(n){e(i,u,o,f,c,"next",n)}function c(n){e(i,u,o,f,c,"throw",n)}f(void 0)}))}}function o(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function i(n,t){for(var r=0;r<t.length;r++){var e=t[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function f(n,t,r){return t&&i(n.prototype,t),r&&i(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}function c(n,t,r){return t in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r,n}function a(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&s(n,t)}function l(n){return(l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function s(n,t){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,t){return n.__proto__=t,n})(n,t)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(n){return!1}}function b(n,t,r){return(b=v()?Reflect.construct.bind():function(n,t,r){var e=[null];e.push.apply(e,t);var u=new(Function.bind.apply(n,e));return r&&s(u,r.prototype),u}).apply(null,arguments)}function y(n){var t="function"==typeof Map?new Map:void 0;return(y=function(n){if(null===n||!function(n){return-1!==Function.toString.call(n).indexOf("[native code]")}(n))return n;if("function"!=typeof n)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(n))return t.get(n);t.set(n,r)}function r(){return b(n,arguments,l(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),s(r,n)})(n)}function d(n,t){if(null==n)return{};var r,e,u=function(n,t){if(null==n)return{};var r,e,u={},o=Object.keys(n);for(e=0;e<o.length;e++)t.indexOf(r=o[e])>=0||(u[r]=n[r]);return u}(n,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(e=0;e<o.length;e++)t.indexOf(r=o[e])>=0||Object.prototype.propertyIsEnumerable.call(n,r)&&(u[r]=n[r])}return u}function m(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function p(n,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(n)}function h(n){var t=v();return function(){var r,e=l(n);if(t){var u=l(this).constructor;r=Reflect.construct(e,arguments,u)}else r=e.apply(this,arguments);return p(this,r)}}function w(n,t){return function(n){if(Array.isArray(n))return n}(n)||function(n,t){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var e,u,o=[],i=!0,f=!1;try{for(r=r.call(n);!(i=(e=r.next()).done)&&(o.push(e.value),!t||o.length!==t);i=!0);}catch(n){f=!0,u=n}finally{try{i||null==r.return||r.return()}finally{if(f)throw u}}return o}}(n,t)||$(n,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(n){return function(n){if(Array.isArray(n))return O(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||$(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(n,t){if(n){if("string"==typeof n)return O(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?O(n,t):void 0}}function O(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=Array(t);r<t;r++)e[r]=n[r];return e}function g(n,t){var r="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!r){if(Array.isArray(n)||(r=$(n))||t&&n&&"number"==typeof n.length){r&&(n=r);var e=0,u=function(){};return{s:u,n:function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}},e:function(n){throw n},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,f=!1;return{s:function(){r=r.call(n)},n:function(){var n=r.next();return i=n.done,n},e:function(n){f=!0,o=n},f:function(){try{i||null==r.return||r.return()}finally{if(f)throw o}}}}var S,k,R,E=!1,A=!1,T=!1,M=!1,x=!1,C="undefined"!=typeof window?window:{},P=C.document||{head:{}},I={t:0,u:"",jmp:function(n){return n()},raf:function(n){return requestAnimationFrame(n)},ael:function(n,t,r,e){return n.addEventListener(t,r,e)},rel:function(n,t,r,e){return n.removeEventListener(t,r,e)},ce:function(n,t){return new CustomEvent(n,t)}},F=function(n){return Promise.resolve(n)},L=function(){try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(n){}return!1}(),D=function(n,t,r){r&&r.map((function(r){var e=w(r,3),u=e[0],o=e[1],i=e[2],f=W(n,u),c=U(t,i),a=B(u);I.ael(f,o,c,a),(t.o=t.o||[]).push((function(){return I.rel(f,o,c,a)}))}))},U=function(n,t){return function(r){try{256&n.t?n.i[t](r):(n.l=n.l||[]).push([t,r])}catch(n){qn(n)}}},W=function(n,t){return 8&t?C:n},B=function(n){return 0!=(2&n)},H="{visibility:hidden}.hydrated{visibility:inherit}",N="http://www.w3.org/1999/xlink",_=new WeakMap,q=function(n,t,r){var e=Gn.get(n);L&&r?(e=e||new CSSStyleSheet).replace(t):e=t,Gn.set(n,e)},V=function(n){var t=n.v,r=n.m,e=t.t,u=function(n,t){var r=z(t),e=Gn.get(r);if(n=11===n.nodeType?n:P,e)if("string"==typeof e){var u,o=_.get(n=n.head||n);o||_.set(n,o=new Set),o.has(r)||((u=P.createElement("style")).innerHTML=e,n.insertBefore(u,n.querySelector("link")),o&&o.add(r))}else n.adoptedStyleSheets.includes(e)||(n.adoptedStyleSheets=[].concat(j(n.adoptedStyleSheets),[e]));return r}(r.shadowRoot?r.shadowRoot:r.getRootNode(),t);10&e&&(r["s-sc"]=u,r.classList.add(u+"-h"))},z=function(n){return"sc-"+n.p},G={},J=function(n){return"object"===(n=r(n))||"function"===n},K=function(n,t){for(var e=null,u=null,o=null,i=!1,f=!1,c=[],a=function t(r){for(var u=0;u<r.length;u++)Array.isArray(e=r[u])?t(e):null!=e&&"boolean"!=typeof e&&((i="function"!=typeof n&&!J(e))&&(e+=""),i&&f?c[c.length-1].h+=e:c.push(i?Q(null,e):e),f=i)},l=arguments.length,s=Array(l>2?l-2:0),v=2;v<l;v++)s[v-2]=arguments[v];if(a(s),t){t.key&&(u=t.key),t.name&&(o=t.name);var b=t.className||t.class;b&&(t.class="object"!==r(b)?b:Object.keys(b).filter((function(n){return b[n]})).join(" "))}if("function"==typeof n)return n(null===t?{}:t,c,Y);var y=Q(n,null);return y.j=t,c.length>0&&(y.$=c),y.O=u,y.g=o,y},Q=function(n,t){return{t:0,S:n,h:t,k:null,$:null,j:null,O:null,g:null}},X={},Y={forEach:function(n,t){return n.map(Z).forEach(t)},map:function(n,t){return n.map(Z).map(t).map(nn)}},Z=function(n){return{vattrs:n.j,vchildren:n.$,vkey:n.O,vname:n.g,vtag:n.S,vtext:n.h}},nn=function(n){if("function"==typeof n.vtag){var t=Object.assign({},n.vattrs);return n.vkey&&(t.key=n.vkey),n.vname&&(t.name=n.vname),K.apply(void 0,[n.vtag,t].concat(j(n.vchildren||[])))}var r=Q(n.vtag,n.vtext);return r.j=n.vattrs,r.$=n.vchildren,r.O=n.vkey,r.g=n.vname,r},tn=function(n,t,r,e,u,o){if(r!==e){var i=_n(n,t),f=t.toLowerCase();if("class"===t){var c=n.classList,a=en(r),l=en(e);c.remove.apply(c,j(a.filter((function(n){return n&&!l.includes(n)})))),c.add.apply(c,j(l.filter((function(n){return n&&!a.includes(n)}))))}else if("style"===t){for(var s in r)e&&null!=e[s]||(s.includes("-")?n.style.removeProperty(s):n.style[s]="");for(var v in e)r&&e[v]===r[v]||(v.includes("-")?n.style.setProperty(v,e[v]):n.style[v]=e[v])}else if("key"===t);else if("ref"===t)e&&e(n);else if(i||"o"!==t[0]||"n"!==t[1]){var b=J(e);if((i||b&&null!==e)&&!u)try{if(n.tagName.includes("-"))n[t]=e;else{var y=null==e?"":e;"list"===t?i=!1:null!=r&&n[t]==y||(n[t]=y)}}catch(n){}var d=!1;f!==(f=f.replace(/^xlink\:?/,""))&&(t=f,d=!0),null==e||!1===e?!1===e&&""!==n.getAttribute(t)||(d?n.removeAttributeNS(N,t):n.removeAttribute(t)):(!i||4&o||u)&&!b&&(e=!0===e?"":e,d?n.setAttributeNS(N,t,e):n.setAttribute(t,e))}else t="-"===t[2]?t.slice(3):_n(C,f)?f.slice(2):f[2]+t.slice(3),r&&I.rel(n,t,r,!1),e&&I.ael(n,t,e,!1)}},rn=/\s/,en=function(n){return n?n.split(rn):[]},un=function(n,t,r,e){var u=11===t.k.nodeType&&t.k.host?t.k.host:t.k,o=n&&n.j||G,i=t.j||G;for(e in o)e in i||tn(u,e,o[e],void 0,r,t.t);for(e in i)tn(u,e,o[e],i[e],r,t.t)},on=function n(t,r,e,u){var o,i,f,c=r.$[e],a=0;if(E||(T=!0,"slot"===c.S&&(S&&u.classList.add(S+"-s"),c.t|=c.$?2:1)),null!==c.h)o=c.k=P.createTextNode(c.h);else if(1&c.t)o=c.k=P.createTextNode("");else{if(M||(M="svg"===c.S),o=c.k=P.createElementNS(M?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&c.t?"slot-fb":c.S),M&&"foreignObject"===c.S&&(M=!1),un(null,c,M),null!=S&&o["s-si"]!==S&&o.classList.add(o["s-si"]=S),c.$)for(a=0;a<c.$.length;++a)(i=n(t,c,a,o))&&o.appendChild(i);"svg"===c.S?M=!1:"foreignObject"===o.tagName&&(M=!0)}return o["s-hn"]=R,3&c.t&&(o["s-sr"]=!0,o["s-cr"]=k,o["s-sn"]=c.g||"",(f=t&&t.$&&t.$[e])&&f.S===c.S&&t.k&&fn(t.k,!1)),o},fn=function n(t,r){I.t|=1;for(var e=t.childNodes,u=e.length-1;u>=0;u--){var o=e[u];o["s-hn"]!==R&&o["s-ol"]&&(vn(o).insertBefore(o,sn(o)),o["s-ol"].remove(),o["s-ol"]=void 0,T=!0),r&&n(o,r)}I.t&=-2},cn=function(n,t,r,e,u,o){var i,f=n["s-cr"]&&n["s-cr"].parentNode||n;for(f.shadowRoot&&f.tagName===R&&(f=f.shadowRoot);u<=o;++u)e[u]&&(i=on(null,r,u,n))&&(e[u].k=i,f.insertBefore(i,sn(t)))},an=function(n,t,r,e,u){for(;t<=r;++t)(e=n[t])&&(u=e.k,hn(e),A=!0,u["s-ol"]?u["s-ol"].remove():fn(u,!0),u.remove())},ln=function(n,t){return n.S===t.S&&("slot"===n.S?n.g===t.g:n.O===t.O)},sn=function(n){return n&&n["s-ol"]||n},vn=function(n){return(n["s-ol"]?n["s-ol"]:n).parentNode},bn=function(n,t){var r,e=t.k=n.k,u=n.$,o=t.$,i=t.S,f=t.h;null===f?(M="svg"===i||"foreignObject"!==i&&M,"slot"===i||un(n,t,M),null!==u&&null!==o?function(n,t,r,e){for(var u,o,i=0,f=0,c=0,a=0,l=t.length-1,s=t[0],v=t[l],b=e.length-1,y=e[0],d=e[b];i<=l&&f<=b;)if(null==s)s=t[++i];else if(null==v)v=t[--l];else if(null==y)y=e[++f];else if(null==d)d=e[--b];else if(ln(s,y))bn(s,y),s=t[++i],y=e[++f];else if(ln(v,d))bn(v,d),v=t[--l],d=e[--b];else if(ln(s,d))"slot"!==s.S&&"slot"!==d.S||fn(s.k.parentNode,!1),bn(s,d),n.insertBefore(s.k,v.k.nextSibling),s=t[++i],d=e[--b];else if(ln(v,y))"slot"!==s.S&&"slot"!==d.S||fn(v.k.parentNode,!1),bn(v,y),n.insertBefore(v.k,s.k),v=t[--l],y=e[++f];else{for(c=-1,a=i;a<=l;++a)if(t[a]&&null!==t[a].O&&t[a].O===y.O){c=a;break}c>=0?((o=t[c]).S!==y.S?u=on(t&&t[f],r,c,n):(bn(o,y),t[c]=void 0,u=o.k),y=e[++f]):(u=on(t&&t[f],r,f,n),y=e[++f]),u&&vn(s.k).insertBefore(u,sn(s.k))}i>l?cn(n,null==e[b+1]?null:e[b+1].k,r,e,f,b):f>b&&an(t,i,l)}(e,u,t,o):null!==o?(null!==n.h&&(e.textContent=""),cn(e,null,t,o,0,o.length-1)):null!==u&&an(u,0,u.length-1),M&&"svg"===i&&(M=!1)):(r=e["s-cr"])?r.parentNode.textContent=f:n.h!==f&&(e.data=f)},yn=function n(t){var r,e,u,o,i,f,c=t.childNodes;for(e=0,u=c.length;e<u;e++)if(1===(r=c[e]).nodeType){if(r["s-sr"])for(i=r["s-sn"],r.hidden=!1,o=0;o<u;o++)if(f=c[o].nodeType,c[o]["s-hn"]!==r["s-hn"]||""!==i){if(1===f&&i===c[o].getAttribute("slot")){r.hidden=!0;break}}else if(1===f||3===f&&""!==c[o].textContent.trim()){r.hidden=!0;break}n(r)}},dn=[],mn=function n(t){for(var r,e,u,o,i,f,c=0,a=t.childNodes,l=a.length;c<l;c++){if((r=a[c])["s-sr"]&&(e=r["s-cr"])&&e.parentNode)for(o=r["s-sn"],f=(u=e.parentNode.childNodes).length-1;f>=0;f--)(e=u[f])["s-cn"]||e["s-nr"]||e["s-hn"]===r["s-hn"]||(pn(e,o)?(i=dn.find((function(n){return n.R===e})),A=!0,e["s-sn"]=e["s-sn"]||o,i?i.A=r:dn.push({A:r,R:e}),e["s-sr"]&&dn.map((function(n){pn(n.R,e["s-sn"])&&(i=dn.find((function(n){return n.R===e})))&&!n.A&&(n.A=i.A)}))):dn.some((function(n){return n.R===e}))||dn.push({R:e}));1===r.nodeType&&n(r)}},pn=function(n,t){return 1===n.nodeType?null===n.getAttribute("slot")&&""===t||n.getAttribute("slot")===t:n["s-sn"]===t||""===t},hn=function n(t){t.j&&t.j.ref&&t.j.ref(null),t.$&&t.$.map(n)},wn=function(n,t){var r=n.m,e=n.v,u=n.T||Q(null,null),o=function(n){return n&&n.S===X}(t)?t:K(null,null,t);if(R=r.tagName,e.M&&(o.j=o.j||{},e.M.map((function(n){var t=w(n,2);return o.j[t[1]]=r[t[0]]}))),o.S=null,o.t|=4,n.T=o,o.k=u.k=r.shadowRoot||r,S=r["s-sc"],k=r["s-cr"],E=0!=(1&e.t),A=!1,bn(u,o),I.t|=1,T){var i,f,c,a,l,s;mn(o.k);for(var v=0;v<dn.length;v++)(f=(i=dn[v]).R)["s-ol"]||((c=P.createTextNode(""))["s-nr"]=f,f.parentNode.insertBefore(f["s-ol"]=c,f));for(v=0;v<dn.length;v++)if(f=(i=dn[v]).R,i.A){for(a=i.A.parentNode,l=i.A.nextSibling,c=f["s-ol"];c=c.previousSibling;)if((s=c["s-nr"])&&s["s-sn"]===f["s-sn"]&&a===s.parentNode&&(!(s=s.nextSibling)||!s["s-nr"])){l=s;break}(!l&&a!==f.parentNode||f.nextSibling!==l)&&f!==l&&(!f["s-hn"]&&f["s-ol"]&&(f["s-hn"]=f["s-ol"].parentNode.nodeName),a.insertBefore(f,l))}else 1===f.nodeType&&(f.hidden=!0)}A&&yn(o.k),I.t&=-2,dn.length=0},jn=function(n){return Bn(n).m},$n=function(n,t,r){var e=jn(n);return{emit:function(n){return On(e,t,{bubbles:!!(4&r),composed:!!(2&r),cancelable:!!(1&r),detail:n})}}},On=function(n,t,r){var e=I.ce(t,r);return n.dispatchEvent(e),e},gn=function(n,t){t&&!n.C&&t["s-p"]&&t["s-p"].push(new Promise((function(t){return n.C=t})))},Sn=function(n,t){if(n.t|=16,!(4&n.t))return gn(n,n.P),nt((function(){return kn(n,t)}));n.t|=512},kn=function(n,t){var r,e=n.i;return t&&(n.t|=256,n.l&&(n.l.map((function(n){var t=w(n,2);return Mn(e,t[0],t[1])})),n.l=null),r=Mn(e,"componentWillLoad")),xn(r,(function(){return Rn(n,e,t)}))},Rn=function(){var n=u(regeneratorRuntime.mark((function n(t,r,e){var u,o,i,f,c,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=function(){},i=(u=t.m)["s-rc"],e&&V(t),f=function(){},n.next=11;break;case 9:n.next=12;break;case 11:En(t,r);case 12:i&&(i.map((function(n){return n()})),u["s-rc"]=void 0),f(),o(),a=function(){return An(t)},0===(c=u["s-p"]).length?a():(Promise.all(c).then(a),t.t|=4,c.length=0);case 19:case"end":return n.stop()}}),n)})));return function(t,r,e){return n.apply(this,arguments)}}(),En=function(n,t){try{t=t.render(),n.t&=-17,n.t|=2,wn(n,t)}catch(t){qn(t,n.m)}return null},An=function(n){var t=n.m,r=n.i,e=n.P;Mn(r,"componentDidRender"),64&n.t||(n.t|=64,Cn(t),Mn(r,"componentDidLoad"),n.I(t),e||Tn()),n.F(t),n.C&&(n.C(),n.C=void 0),512&n.t&&Zn((function(){return Sn(n,!1)})),n.t&=-517},Tn=function(){Cn(P.documentElement),Zn((function(){return On(C,"appload",{detail:{namespace:"web-components"}})}))},Mn=function(n,t,r){if(n&&n[t])try{return n[t](r)}catch(n){qn(n)}},xn=function(n,t){return n&&n.then?n.then(t):t()},Cn=function(n){return n.classList.add("hydrated")},Pn=function(n,t,r){if(t.L){n.watchers&&(t.D=n.watchers);var e=Object.entries(t.L),u=n.prototype;if(e.map((function(n){var e=w(n,2),o=e[0],i=w(e[1],1)[0];31&i||2&r&&32&i?Object.defineProperty(u,o,{get:function(){return function(n,t){return Bn(n).U.get(t)}(this,o)},set:function(n){!function(n,t,r,e){var u=Bn(n),o=u.m,i=u.U.get(t),f=u.t,c=u.i;if(r=function(n,t){return null==n||J(n)?n:4&t?"false"!==n&&(""===n||!!n):2&t?parseFloat(n):1&t?n+"":n}(r,e.L[t][0]),!(8&f&&void 0!==i||r===i)&&(u.U.set(t,r),c)){if(e.D&&128&f){var a=e.D[t];a&&a.map((function(n){try{c[n](r,i,t)}catch(n){qn(n,o)}}))}2==(18&f)&&Sn(u,!1)}}(this,o,n,t)},configurable:!0,enumerable:!0}):1&r&&64&i&&Object.defineProperty(u,o,{value:function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];var e=Bn(this);return e.W.then((function(){var n;return(n=e.i)[o].apply(n,t)}))}})})),1&r){var o=new Map;u.attributeChangedCallback=function(n,t,r){var e=this;I.jmp((function(){var t=o.get(n);e.hasOwnProperty(t)&&(r=e[t],delete e[t]),e[t]=(null!==r||"boolean"!=typeof e[t])&&r}))},n.observedAttributes=e.filter((function(n){return 15&w(n,2)[1][0]})).map((function(n){var r=w(n,2),e=r[0],u=r[1],i=u[1]||e;return o.set(i,e),512&u[0]&&t.M.push([e,i]),i}))}}return n},In=function(){var n=u(regeneratorRuntime.mark((function n(t,r,e,u,o){var i,f,c,a,l,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(0!=(32&r.t)){n.next=37;break}if(r.t|=32,!(o=zn(e)).then){n.next=10;break}return i=function(){},n.next=8,o;case 8:o=n.sent,i();case 10:n.next=12;break;case 12:o.isProxied||(e.D=o.watchers,Pn(o,e,2),o.isProxied=!0),function(){},r.t|=8;try{new o(r)}catch(n){qn(n)}r.t&=-9,r.t|=128,n.next=25;break;case 22:o=t.constructor,r.t|=32,customElements.whenDefined(e.p).then((function(){return r.t|=128}));case 25:if(!o.style){n.next=37;break}if(f=o.style,c=z(e),Gn.has(c)){n.next=37;break}a=function(){},n.next=35;break;case 34:f=n.sent;case 35:q(c,f,!!(1&e.t)),a();case 37:s=function(){return Sn(r,!0)},(l=r.P)&&l["s-rc"]?l["s-rc"].push(s):s();case 40:case"end":return n.stop()}}),n)})));return function(t,r,e,u,o){return n.apply(this,arguments)}}(),Fn=function(n){if(0==(1&I.t)){var t=Bn(n),r=t.v;if(1&t.t)D(n,t,r.B);else{t.t|=1,12&r.t&&Ln(n);for(var e=n;e=e.parentNode||e.host;)if(e["s-p"]){gn(t,t.P=e);break}r.L&&Object.entries(r.L).map((function(t){var r=w(t,2),e=r[0];if(31&w(r[1],1)[0]&&n.hasOwnProperty(e)){var u=n[e];delete n[e],n[e]=u}})),In(n,t,r)}}},Ln=function(n){var t=n["s-cr"]=P.createComment("");t["s-cn"]=!0,n.insertBefore(t,n.firstChild)},Dn=function(n){if(0==(1&I.t)){var t=Bn(n),r=t.i;t.o&&(t.o.map((function(n){return n()})),t.o=void 0),Mn(r,"disconnectedCallback")}},Un=function(n){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=function(){},u=[],i=r.exclude||[],c=C.customElements,l=P.head,s=l.querySelector("meta[charset]"),v=P.createElement("style"),b=[],d=!0;Object.assign(I,r),I.u=new URL(r.resourcesUrl||"./",P.baseURI).href,n.map((function(n){return n[1].map((function(r){var e={t:r[0],p:r[1],L:r[2],B:r[3]};e.L=r[2],e.B=r[3],e.M=[],e.D={};var l=e.p,s=function(){a(r,y(HTMLElement));var n=h(r);function r(t){var u;return o(this,r),t=m(u=n.call(this,t)),Nn(t,e),1&e.t&&t.attachShadow({mode:"open"}),u}return f(r,[{key:"connectedCallback",value:function(){var n=this;t&&(clearTimeout(t),t=null),d?b.push(this):I.jmp((function(){return Fn(n)}))}},{key:"disconnectedCallback",value:function(){var n=this;I.jmp((function(){return Dn(n)}))}},{key:"componentOnReady",value:function(){return Bn(this).H}}]),r}();e.N=n[0],i.includes(l)||c.get(l)||(u.push(l),c.define(l,Pn(s,e,1)))}))})),v.innerHTML=u+H,v.setAttribute("data-styles",""),l.insertBefore(v,s?s.nextSibling:l.firstChild),d=!1,b.length?b.map((function(n){return n.connectedCallback()})):I.jmp((function(){return t=setTimeout(Tn,30)})),e()},Wn=new WeakMap,Bn=function(n){return Wn.get(n)},Hn=function(n,t){return Wn.set(t.i=n,t)},Nn=function(n,t){var r={t:0,m:n,v:t,U:new Map};return r.W=new Promise((function(n){return r.F=n})),r.H=new Promise((function(n){return r.I=n})),n["s-p"]=[],n["s-rc"]=[],D(n,r,t.B),Wn.set(n,r)},_n=function(n,t){return t in n},qn=function(n,t){return(0,console.error)(n,t)},Vn=new Map,zn=function(n){var t=n.p.replace(/-/g,"_"),r=n.N,e=Vn.get(r);return e?e[t]:import("./".concat(r,".entry.js").concat("")).then((function(n){return Vn.set(r,n),n[t]}),qn)},Gn=new Map,Jn=[],Kn=[],Qn=function(n,t){return function(r){n.push(r),x||(x=!0,t&&4&I.t?Zn(Yn):I.raf(Yn))}},Xn=function(n){for(var t=0;t<n.length;t++)try{n[t](performance.now())}catch(n){qn(n)}n.length=0},Yn=function n(){Xn(Jn),Xn(Kn),(x=Jn.length>0)&&I.raf(n)},Zn=function(n){return F().then(n)},nt=Qn(Kn,!0);export{X as H,w as _,t as a,Un as b,$n as c,c as d,f as e,r as f,jn as g,K as h,o as i,j,d as k,u as l,g as m,F as p,Hn as r}
|
dist/components/web-components/{p-0e1cd603.js → p-24bcf5c4.js}
RENAMED
File without changes
|
dist/components/web-components/{p-06502f62.js → p-36c54493.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
import{r as e}from"./p-
|
1 |
+
import{r as e}from"./p-771734f3.js";import"./p-219091ba.js";export default function(a){var d,o,s,i,r,_,l,t,n,p,v;if("undefined"!=typeof learndash_video_data&&"presto"===(null===(d=learndash_video_data)||void 0===d?void 0:d.videos_found_provider)){if(e(a),window.learndash_video_data.videos_auto_complete="on"===(null===(o=prestoPlayer)||void 0===o||null===(s=o.learndash)||void 0===s?void 0:s.lesson_video_auto_complete),window.learndash_video_data.videos_hide_complete_button="AFTER"===(null===(i=learndash_video_data)||void 0===i?void 0:i.videos_shown)&&"on"===(null===(r=prestoPlayer)||void 0===r||null===(_=r.learndash)||void 0===_?void 0:_.lesson_video_hide_complete_button),window.learndash_video_data.videos_auto_complete_delay=null===(l=prestoPlayer)||void 0===l||null===(t=l.learndash)||void 0===t?void 0:t.lesson_video_auto_complete_delay,window.learndash_video_data.videos_auto_complete_delay_message=null===(n=prestoPlayer)||void 0===n||null===(p=n.learndash)||void 0===p?void 0:p.videos_auto_complete_delay_message,window.learndash_video_data.video_track_path="/","BEFORE"===(null===(v=learndash_video_data)||void 0===v?void 0:v.videos_shown))return learndash_video_data.videos_auto_complete=!1,jQuery(document).trigger("learndash_video_disable_assets",[!0]),void jQuery((function(){"1"===learndash_video_data.video_debug&&console.log("PRESTO: init"),document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="'+learndash_video_data.videos_found_provider+'"]').length&&("1"===learndash_video_data.video_debug&&console.log("PRESTO: calling LearnDash_disable_assets(true)"),LearnDash_disable_assets(!0),LearnDash_watchPlayers(),document.querySelectorAll('presto-player[data-video-progression="true"][data-video-provider="'+learndash_video_data.videos_found_provider+'"]').forEach((function(e,a){var d="presto-player__wrapper-player-"+a,o=e.getAttribute("id");void 0!==o&&""!=o||e.setAttribute("id",o=d),ld_video_players[d]={},ld_video_players[d].player_key=d,ld_video_players[d].player_type=learndash_video_data.videos_found_provider,ld_video_players[d].player_id=o,ld_video_players[d].player_wrapper=e.closest("presto-player"),void 0!==ld_video_players[d].player_wrapper?ld_video_players[d].player_cookie_key=ld_video_players[d].player_wrapper.getAttribute("data-video-cookie-key"):ld_video_players[d].player_cookie_key="",ld_video_players[d].player_cookie_values=LearnDash_Video_Progress_initSettings(ld_video_players[d]),"complete"===LearnDash_Video_Progress_getSetting(ld_video_players[d],"video_state")?(LearnDash_disable_assets(!1),LearnDash_watchPlayersEnd()):(wp.hooks.addAction("presto.playerTimeUpdate","presto-player",(function(e){"1"===learndash_video_data.video_debug&&console.log("PRESTO: Video is playing"),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_duration",e.duration),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_time",e.currentTime),e.duration&&e.duration===e.currentTime&&(LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_state","complete"),"1"===learndash_video_data.video_debug&&console.log("PRESTO: calling LearnDash_disable_assets(false)"),LearnDash_disable_assets(!1),LearnDash_watchPlayersEnd())})),wp.hooks.addAction("presto.playerPlaying","presto-player",(function(e){"1"===learndash_video_data.video_debug&&console.log("PRESTO: Video is playing"),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_duration",e.duration),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_time",e.currentTime),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_state","play")})),wp.hooks.addAction("presto.playerPause","presto-player",(function(e){"1"===learndash_video_data.video_debug&&console.log("PRESTO: Video is paused"),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_time",e.currentTime),console.log(e.duration),console.log(e.currentTime),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_state","pause")})),wp.hooks.addAction("presto.playerEnded","presto-player",(function(e){"1"===learndash_video_data.video_debug&&console.log("PRESTO: video ended"),"1"===learndash_video_data.video_debug&&console.log("PRESTO: setting 'video_state' to 'complete'"),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_time",e.currentTime),LearnDash_Video_Progress_setSetting(ld_video_players[d],"video_state","complete"),"1"===learndash_video_data.video_debug&&console.log("PRESTO: calling LearnDash_disable_assets(false)"),LearnDash_disable_assets(!1),LearnDash_watchPlayersEnd()})))})))}));window.LearnDash_disable_assets(!0),wp.hooks.addAction("presto.playerEnded","presto-player",(function(){window.LearnDash_disable_assets(!1)}))}}
|
dist/components/web-components/p-3e9a58ac.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
function n(n,t){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);t&&(e=e.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.push.apply(r,e)}return r}function t(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?n(Object(e),!0).forEach((function(n){a(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function r(n){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function e(){e=function(n,t){return new r(n,void 0,t)};var n=RegExp.prototype,t=new WeakMap;function r(n,e,u){var o=RegExp(n,e);return t.set(o,u||t.get(n)),v(o,r.prototype)}function u(n,r){var e=t.get(r);return Object.keys(e).reduce((function(t,r){return t[r]=n[e[r]],t}),Object.create(null))}return l(r,RegExp),r.prototype.exec=function(t){var r=n.exec.call(this,t);return r&&(r.groups=u(r,this)),r},r.prototype[Symbol.replace]=function(r,e){if("string"==typeof e){var o=t.get(this);return n[Symbol.replace].call(this,r,e.replace(/\$<([^>]+)>/g,(function(n,t){return"$"+o[t]})))}if("function"==typeof e){var i=this;return n[Symbol.replace].call(this,r,(function(){var n=arguments;return"object"!=typeof n[n.length-1]&&(n=[].slice.call(n)).push(u(n,i)),e.apply(this,n)}))}return n[Symbol.replace].call(this,r,e)},e.apply(this,arguments)}function u(n,t,r,e,u,o,i){try{var f=n[o](i),c=f.value}catch(n){return void r(n)}f.done?t(c):Promise.resolve(c).then(e,u)}function o(n){return function(){var t=this,r=arguments;return new Promise((function(e,o){var i=n.apply(t,r);function f(n){u(i,e,o,f,c,"next",n)}function c(n){u(i,e,o,f,c,"throw",n)}f(void 0)}))}}function i(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function f(n,t){for(var r=0;r<t.length;r++){var e=t[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function c(n,t,r){return t&&f(n.prototype,t),r&&f(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}function a(n,t,r){return t in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r,n}function l(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(n,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),writable:!1}),t&&v(n,t)}function s(n){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function v(n,t){return(v=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(n){return!1}}function y(n,t,r){return(y=b()?Reflect.construct:function(n,t,r){var e=[null];e.push.apply(e,t);var u=new(Function.bind.apply(n,e));return r&&v(u,r.prototype),u}).apply(null,arguments)}function d(n){var t="function"==typeof Map?new Map:void 0;return(d=function(n){if(null===n||!function(n){return-1!==Function.toString.call(n).indexOf("[native code]")}(n))return n;if("function"!=typeof n)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(n))return t.get(n);t.set(n,r)}function r(){return y(n,arguments,s(this).constructor)}return r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),v(r,n)})(n)}function p(n,t){if(null==n)return{};var r,e,u=function(n,t){if(null==n)return{};var r,e,u={},o=Object.keys(n);for(e=0;e<o.length;e++)t.indexOf(r=o[e])>=0||(u[r]=n[r]);return u}(n,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(e=0;e<o.length;e++)t.indexOf(r=o[e])>=0||Object.prototype.propertyIsEnumerable.call(n,r)&&(u[r]=n[r])}return u}function m(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function h(n,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(n)}function w(n){var t=b();return function(){var r,e=s(n);if(t){var u=s(this).constructor;r=Reflect.construct(e,arguments,u)}else r=e.apply(this,arguments);return h(this,r)}}function j(n,t){return function(n){if(Array.isArray(n))return n}(n)||function(n,t){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var e,u,o=[],i=!0,f=!1;try{for(r=r.call(n);!(i=(e=r.next()).done)&&(o.push(e.value),!t||o.length!==t);i=!0);}catch(n){f=!0,u=n}finally{try{i||null==r.return||r.return()}finally{if(f)throw u}}return o}}(n,t)||O(n,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(n){return function(n){if(Array.isArray(n))return g(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||O(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(n,t){if(n){if("string"==typeof n)return g(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);return"Object"===r&&n.constructor&&(r=n.constructor.name),"Map"===r||"Set"===r?Array.from(n):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(n,t):void 0}}function g(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=Array(t);r<t;r++)e[r]=n[r];return e}function S(n,t){var r="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!r){if(Array.isArray(n)||(r=O(n))||t&&n&&"number"==typeof n.length){r&&(n=r);var e=0,u=function(){};return{s:u,n:function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}},e:function(n){throw n},f:u}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,f=!1;return{s:function(){r=r.call(n)},n:function(){var n=r.next();return i=n.done,n},e:function(n){f=!0,o=n},f:function(){try{i||null==r.return||r.return()}finally{if(f)throw o}}}}var k,R,E,x=!1,A=!1,M=!1,T=!1,C=!1,P="undefined"!=typeof window?window:{},I=P.document||{head:{}},F={t:0,u:"",jmp:function(n){return n()},raf:function(n){return requestAnimationFrame(n)},ael:function(n,t,r,e){return n.addEventListener(t,r,e)},rel:function(n,t,r,e){return n.removeEventListener(t,r,e)},ce:function(n,t){return new CustomEvent(n,t)}},L=function(n){return Promise.resolve(n)},W=function(){try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(n){}return!1}(),D=function(n,t,r){r&&r.map((function(r){var e=j(r,3),u=e[0],o=e[1],i=e[2],f=B(n,u),c=U(t,i),a=H(u);F.ael(f,o,c,a),(t.o=t.o||[]).push((function(){return F.rel(f,o,c,a)}))}))},U=function(n,t){return function(r){try{256&n.t?n.i[t](r):(n.l=n.l||[]).push([t,r])}catch(n){Vn(n)}}},B=function(n,t){return 8&t?P:n},H=function(n){return 0!=(2&n)},N="{visibility:hidden}.hydrated{visibility:inherit}",_="http://www.w3.org/1999/xlink",q=new WeakMap,V=function(n,t,r){var e=Jn.get(n);W&&r?(e=e||new CSSStyleSheet).replace(t):e=t,Jn.set(n,e)},z=function(n){var t=n.v,r=n.p,e=t.t,u=function(n,t){var r=G(t),e=Jn.get(r);if(n=11===n.nodeType?n:I,e)if("string"==typeof e){var u,o=q.get(n=n.head||n);o||q.set(n,o=new Set),o.has(r)||((u=I.createElement("style")).innerHTML=e,n.insertBefore(u,n.querySelector("link")),o&&o.add(r))}else n.adoptedStyleSheets.includes(e)||(n.adoptedStyleSheets=[].concat($(n.adoptedStyleSheets),[e]));return r}(r.shadowRoot?r.shadowRoot:r.getRootNode(),t);10&e&&(r["s-sc"]=u,r.classList.add(u+"-h"))},G=function(n){return"sc-"+n.m},J={},K=function(n){return"object"===(n=r(n))||"function"===n},Q=function(n,t){for(var e=null,u=null,o=null,i=!1,f=!1,c=[],a=function t(r){for(var u=0;u<r.length;u++)Array.isArray(e=r[u])?t(e):null!=e&&"boolean"!=typeof e&&((i="function"!=typeof n&&!K(e))&&(e+=""),i&&f?c[c.length-1].h+=e:c.push(i?X(null,e):e),f=i)},l=arguments.length,s=Array(l>2?l-2:0),v=2;v<l;v++)s[v-2]=arguments[v];if(a(s),t){t.key&&(u=t.key),t.name&&(o=t.name);var b=t.className||t.class;b&&(t.class="object"!==r(b)?b:Object.keys(b).filter((function(n){return b[n]})).join(" "))}if("function"==typeof n)return n(null===t?{}:t,c,Z);var y=X(n,null);return y.j=t,c.length>0&&(y.$=c),y.O=u,y.g=o,y},X=function(n,t){return{t:0,S:n,h:t,k:null,$:null,j:null,O:null,g:null}},Y={},Z={forEach:function(n,t){return n.map(nn).forEach(t)},map:function(n,t){return n.map(nn).map(t).map(tn)}},nn=function(n){return{vattrs:n.j,vchildren:n.$,vkey:n.O,vname:n.g,vtag:n.S,vtext:n.h}},tn=function(n){if("function"==typeof n.vtag){var t=Object.assign({},n.vattrs);return n.vkey&&(t.key=n.vkey),n.vname&&(t.name=n.vname),Q.apply(void 0,[n.vtag,t].concat($(n.vchildren||[])))}var r=X(n.vtag,n.vtext);return r.j=n.vattrs,r.$=n.vchildren,r.O=n.vkey,r.g=n.vname,r},rn=function(n,t,r,e,u,o){if(r!==e){var i=qn(n,t),f=t.toLowerCase();if("class"===t){var c=n.classList,a=un(r),l=un(e);c.remove.apply(c,$(a.filter((function(n){return n&&!l.includes(n)})))),c.add.apply(c,$(l.filter((function(n){return n&&!a.includes(n)}))))}else if("style"===t){for(var s in r)e&&null!=e[s]||(s.includes("-")?n.style.removeProperty(s):n.style[s]="");for(var v in e)r&&e[v]===r[v]||(v.includes("-")?n.style.setProperty(v,e[v]):n.style[v]=e[v])}else if("key"===t);else if("ref"===t)e&&e(n);else if(i||"o"!==t[0]||"n"!==t[1]){var b=K(e);if((i||b&&null!==e)&&!u)try{if(n.tagName.includes("-"))n[t]=e;else{var y=null==e?"":e;"list"===t?i=!1:null!=r&&n[t]==y||(n[t]=y)}}catch(n){}var d=!1;f!==(f=f.replace(/^xlink\:?/,""))&&(t=f,d=!0),null==e||!1===e?!1===e&&""!==n.getAttribute(t)||(d?n.removeAttributeNS(_,t):n.removeAttribute(t)):(!i||4&o||u)&&!b&&(e=!0===e?"":e,d?n.setAttributeNS(_,t,e):n.setAttribute(t,e))}else t="-"===t[2]?t.slice(3):qn(P,f)?f.slice(2):f[2]+t.slice(3),r&&F.rel(n,t,r,!1),e&&F.ael(n,t,e,!1)}},en=/\s/,un=function(n){return n?n.split(en):[]},on=function(n,t,r,e){var u=11===t.k.nodeType&&t.k.host?t.k.host:t.k,o=n&&n.j||J,i=t.j||J;for(e in o)e in i||rn(u,e,o[e],void 0,r,t.t);for(e in i)rn(u,e,o[e],i[e],r,t.t)},fn=function n(t,r,e,u){var o,i,f,c=r.$[e],a=0;if(x||(M=!0,"slot"===c.S&&(k&&u.classList.add(k+"-s"),c.t|=c.$?2:1)),null!==c.h)o=c.k=I.createTextNode(c.h);else if(1&c.t)o=c.k=I.createTextNode("");else{if(T||(T="svg"===c.S),o=c.k=I.createElementNS(T?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&c.t?"slot-fb":c.S),T&&"foreignObject"===c.S&&(T=!1),on(null,c,T),null!=k&&o["s-si"]!==k&&o.classList.add(o["s-si"]=k),c.$)for(a=0;a<c.$.length;++a)(i=n(t,c,a,o))&&o.appendChild(i);"svg"===c.S?T=!1:"foreignObject"===o.tagName&&(T=!0)}return o["s-hn"]=E,3&c.t&&(o["s-sr"]=!0,o["s-cr"]=R,o["s-sn"]=c.g||"",(f=t&&t.$&&t.$[e])&&f.S===c.S&&t.k&&cn(t.k,!1)),o},cn=function n(t,r){F.t|=1;for(var e=t.childNodes,u=e.length-1;u>=0;u--){var o=e[u];o["s-hn"]!==E&&o["s-ol"]&&(bn(o).insertBefore(o,vn(o)),o["s-ol"].remove(),o["s-ol"]=void 0,M=!0),r&&n(o,r)}F.t&=-2},an=function(n,t,r,e,u,o){var i,f=n["s-cr"]&&n["s-cr"].parentNode||n;for(f.shadowRoot&&f.tagName===E&&(f=f.shadowRoot);u<=o;++u)e[u]&&(i=fn(null,r,u,n))&&(e[u].k=i,f.insertBefore(i,vn(t)))},ln=function(n,t,r,e,u){for(;t<=r;++t)(e=n[t])&&(u=e.k,wn(e),A=!0,u["s-ol"]?u["s-ol"].remove():cn(u,!0),u.remove())},sn=function(n,t){return n.S===t.S&&("slot"===n.S?n.g===t.g:n.O===t.O)},vn=function(n){return n&&n["s-ol"]||n},bn=function(n){return(n["s-ol"]?n["s-ol"]:n).parentNode},yn=function(n,t){var r,e=t.k=n.k,u=n.$,o=t.$,i=t.S,f=t.h;null===f?(T="svg"===i||"foreignObject"!==i&&T,"slot"===i||on(n,t,T),null!==u&&null!==o?function(n,t,r,e){for(var u,o,i=0,f=0,c=0,a=0,l=t.length-1,s=t[0],v=t[l],b=e.length-1,y=e[0],d=e[b];i<=l&&f<=b;)if(null==s)s=t[++i];else if(null==v)v=t[--l];else if(null==y)y=e[++f];else if(null==d)d=e[--b];else if(sn(s,y))yn(s,y),s=t[++i],y=e[++f];else if(sn(v,d))yn(v,d),v=t[--l],d=e[--b];else if(sn(s,d))"slot"!==s.S&&"slot"!==d.S||cn(s.k.parentNode,!1),yn(s,d),n.insertBefore(s.k,v.k.nextSibling),s=t[++i],d=e[--b];else if(sn(v,y))"slot"!==s.S&&"slot"!==d.S||cn(v.k.parentNode,!1),yn(v,y),n.insertBefore(v.k,s.k),v=t[--l],y=e[++f];else{for(c=-1,a=i;a<=l;++a)if(t[a]&&null!==t[a].O&&t[a].O===y.O){c=a;break}c>=0?((o=t[c]).S!==y.S?u=fn(t&&t[f],r,c,n):(yn(o,y),t[c]=void 0,u=o.k),y=e[++f]):(u=fn(t&&t[f],r,f,n),y=e[++f]),u&&bn(s.k).insertBefore(u,vn(s.k))}i>l?an(n,null==e[b+1]?null:e[b+1].k,r,e,f,b):f>b&&ln(t,i,l)}(e,u,t,o):null!==o?(null!==n.h&&(e.textContent=""),an(e,null,t,o,0,o.length-1)):null!==u&&ln(u,0,u.length-1),T&&"svg"===i&&(T=!1)):(r=e["s-cr"])?r.parentNode.textContent=f:n.h!==f&&(e.data=f)},dn=function n(t){var r,e,u,o,i,f,c=t.childNodes;for(e=0,u=c.length;e<u;e++)if(1===(r=c[e]).nodeType){if(r["s-sr"])for(i=r["s-sn"],r.hidden=!1,o=0;o<u;o++)if(f=c[o].nodeType,c[o]["s-hn"]!==r["s-hn"]||""!==i){if(1===f&&i===c[o].getAttribute("slot")){r.hidden=!0;break}}else if(1===f||3===f&&""!==c[o].textContent.trim()){r.hidden=!0;break}n(r)}},pn=[],mn=function n(t){for(var r,e,u,o,i,f,c=0,a=t.childNodes,l=a.length;c<l;c++){if((r=a[c])["s-sr"]&&(e=r["s-cr"])&&e.parentNode)for(o=r["s-sn"],f=(u=e.parentNode.childNodes).length-1;f>=0;f--)(e=u[f])["s-cn"]||e["s-nr"]||e["s-hn"]===r["s-hn"]||(hn(e,o)?(i=pn.find((function(n){return n.R===e})),A=!0,e["s-sn"]=e["s-sn"]||o,i?i.A=r:pn.push({A:r,R:e}),e["s-sr"]&&pn.map((function(n){hn(n.R,e["s-sn"])&&(i=pn.find((function(n){return n.R===e})))&&!n.A&&(n.A=i.A)}))):pn.some((function(n){return n.R===e}))||pn.push({R:e}));1===r.nodeType&&n(r)}},hn=function(n,t){return 1===n.nodeType?null===n.getAttribute("slot")&&""===t||n.getAttribute("slot")===t:n["s-sn"]===t||""===t},wn=function n(t){t.j&&t.j.ref&&t.j.ref(null),t.$&&t.$.map(n)},jn=function(n,t){var r=n.p,e=n.v,u=n.M||X(null,null),o=function(n){return n&&n.S===Y}(t)?t:Q(null,null,t);if(E=r.tagName,e.T&&(o.j=o.j||{},e.T.map((function(n){var t=j(n,2);return o.j[t[1]]=r[t[0]]}))),o.S=null,o.t|=4,n.M=o,o.k=u.k=r.shadowRoot||r,k=r["s-sc"],R=r["s-cr"],x=0!=(1&e.t),A=!1,yn(u,o),F.t|=1,M){var i,f,c,a,l,s;mn(o.k);for(var v=0;v<pn.length;v++)(f=(i=pn[v]).R)["s-ol"]||((c=I.createTextNode(""))["s-nr"]=f,f.parentNode.insertBefore(f["s-ol"]=c,f));for(v=0;v<pn.length;v++)if(f=(i=pn[v]).R,i.A){for(a=i.A.parentNode,l=i.A.nextSibling,c=f["s-ol"];c=c.previousSibling;)if((s=c["s-nr"])&&s["s-sn"]===f["s-sn"]&&a===s.parentNode&&(!(s=s.nextSibling)||!s["s-nr"])){l=s;break}(!l&&a!==f.parentNode||f.nextSibling!==l)&&f!==l&&(!f["s-hn"]&&f["s-ol"]&&(f["s-hn"]=f["s-ol"].parentNode.nodeName),a.insertBefore(f,l))}else 1===f.nodeType&&(f.hidden=!0)}A&&dn(o.k),F.t&=-2,pn.length=0},$n=function(n){return Hn(n).p},On=function(n,t,r){var e=$n(n);return{emit:function(n){return gn(e,t,{bubbles:!!(4&r),composed:!!(2&r),cancelable:!!(1&r),detail:n})}}},gn=function(n,t,r){var e=F.ce(t,r);return n.dispatchEvent(e),e},Sn=function(n,t){t&&!n.C&&t["s-p"]&&t["s-p"].push(new Promise((function(t){return n.C=t})))},kn=function(n,t){if(n.t|=16,!(4&n.t))return Sn(n,n.P),tt((function(){return Rn(n,t)}));n.t|=512},Rn=function(n,t){var r,e=n.i;return t&&(n.t|=256,n.l&&(n.l.map((function(n){var t=j(n,2);return Tn(e,t[0],t[1])})),n.l=null),r=Tn(e,"componentWillLoad")),Cn(r,(function(){return En(n,e,t)}))},En=function(){var n=o(regeneratorRuntime.mark((function n(t,r,e){var u,o,i,f,c,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:o=function(){},i=(u=t.p)["s-rc"],e&&z(t),f=function(){},n.next=11;break;case 9:n.next=12;break;case 11:xn(t,r);case 12:i&&(i.map((function(n){return n()})),u["s-rc"]=void 0),f(),o(),a=function(){return An(t)},0===(c=u["s-p"]).length?a():(Promise.all(c).then(a),t.t|=4,c.length=0);case 19:case"end":return n.stop()}}),n)})));return function(t,r,e){return n.apply(this,arguments)}}(),xn=function(n,t){try{t=t.render(),n.t&=-17,n.t|=2,jn(n,t)}catch(t){Vn(t,n.p)}return null},An=function(n){var t=n.p,r=n.i,e=n.P;Tn(r,"componentDidRender"),64&n.t||(n.t|=64,Pn(t),Tn(r,"componentDidLoad"),n.I(t),e||Mn()),n.F(t),n.C&&(n.C(),n.C=void 0),512&n.t&&nt((function(){return kn(n,!1)})),n.t&=-517},Mn=function(){Pn(I.documentElement),nt((function(){return gn(P,"appload",{detail:{namespace:"web-components"}})}))},Tn=function(n,t,r){if(n&&n[t])try{return n[t](r)}catch(n){Vn(n)}},Cn=function(n,t){return n&&n.then?n.then(t):t()},Pn=function(n){return n.classList.add("hydrated")},In=function(n,t,r){if(t.L){n.watchers&&(t.W=n.watchers);var e=Object.entries(t.L),u=n.prototype;if(e.map((function(n){var e=j(n,2),o=e[0],i=j(e[1],1)[0];31&i||2&r&&32&i?Object.defineProperty(u,o,{get:function(){return function(n,t){return Hn(n).D.get(t)}(this,o)},set:function(n){!function(n,t,r,e){var u=Hn(n),o=u.p,i=u.D.get(t),f=u.t,c=u.i;if(r=function(n,t){return null==n||K(n)?n:4&t?"false"!==n&&(""===n||!!n):2&t?parseFloat(n):1&t?n+"":n}(r,e.L[t][0]),!(8&f&&void 0!==i||r===i)&&(u.D.set(t,r),c)){if(e.W&&128&f){var a=e.W[t];a&&a.map((function(n){try{c[n](r,i,t)}catch(n){Vn(n,o)}}))}2==(18&f)&&kn(u,!1)}}(this,o,n,t)},configurable:!0,enumerable:!0}):1&r&&64&i&&Object.defineProperty(u,o,{value:function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];var e=Hn(this);return e.U.then((function(){var n;return(n=e.i)[o].apply(n,t)}))}})})),1&r){var o=new Map;u.attributeChangedCallback=function(n,t,r){var e=this;F.jmp((function(){var t=o.get(n);e.hasOwnProperty(t)&&(r=e[t],delete e[t]),e[t]=(null!==r||"boolean"!=typeof e[t])&&r}))},n.observedAttributes=e.filter((function(n){return 15&j(n,2)[1][0]})).map((function(n){var r=j(n,2),e=r[0],u=r[1],i=u[1]||e;return o.set(i,e),512&u[0]&&t.T.push([e,i]),i}))}}return n},Fn=function(){var n=o(regeneratorRuntime.mark((function n(t,r,e,u,o){var i,f,c,a,l,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(0!=(32&r.t)){n.next=37;break}if(r.t|=32,!(o=Gn(e)).then){n.next=10;break}return i=function(){},n.next=8,o;case 8:o=n.sent,i();case 10:n.next=12;break;case 12:o.isProxied||(e.W=o.watchers,In(o,e,2),o.isProxied=!0),function(){},r.t|=8;try{new o(r)}catch(n){Vn(n)}r.t&=-9,r.t|=128,n.next=25;break;case 22:o=t.constructor,r.t|=32,customElements.whenDefined(e.m).then((function(){return r.t|=128}));case 25:if(!o.style){n.next=37;break}if(f=o.style,c=G(e),Jn.has(c)){n.next=37;break}a=function(){},n.next=35;break;case 34:f=n.sent;case 35:V(c,f,!!(1&e.t)),a();case 37:s=function(){return kn(r,!0)},(l=r.P)&&l["s-rc"]?l["s-rc"].push(s):s();case 40:case"end":return n.stop()}}),n)})));return function(t,r,e,u,o){return n.apply(this,arguments)}}(),Ln=function(n){if(0==(1&F.t)){var t=Hn(n),r=t.v;if(1&t.t)D(n,t,r.B);else{t.t|=1,12&r.t&&Wn(n);for(var e=n;e=e.parentNode||e.host;)if(e["s-p"]){Sn(t,t.P=e);break}r.L&&Object.entries(r.L).map((function(t){var r=j(t,2),e=r[0];if(31&j(r[1],1)[0]&&n.hasOwnProperty(e)){var u=n[e];delete n[e],n[e]=u}})),Fn(n,t,r)}}},Wn=function(n){var t=n["s-cr"]=I.createComment("");t["s-cn"]=!0,n.insertBefore(t,n.firstChild)},Dn=function(n){if(0==(1&F.t)){var t=Hn(n),r=t.i;t.o&&(t.o.map((function(n){return n()})),t.o=void 0),Tn(r,"disconnectedCallback")}},Un=function(n){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=function(){},u=[],o=r.exclude||[],f=P.customElements,a=I.head,s=a.querySelector("meta[charset]"),v=I.createElement("style"),b=[],y=!0;Object.assign(F,r),F.u=new URL(r.resourcesUrl||"./",I.baseURI).href,n.map((function(n){return n[1].map((function(r){var e={t:r[0],m:r[1],L:r[2],B:r[3]};e.L=r[2],e.B=r[3],e.T=[],e.W={};var a=e.m,s=function(){l(r,d(HTMLElement));var n=w(r);function r(t){var u;return i(this,r),t=m(u=n.call(this,t)),_n(t,e),1&e.t&&t.attachShadow({mode:"open"}),u}return c(r,[{key:"connectedCallback",value:function(){var n=this;t&&(clearTimeout(t),t=null),y?b.push(this):F.jmp((function(){return Ln(n)}))}},{key:"disconnectedCallback",value:function(){var n=this;F.jmp((function(){return Dn(n)}))}},{key:"componentOnReady",value:function(){return Hn(this).H}}]),r}();e.N=n[0],o.includes(a)||f.get(a)||(u.push(a),f.define(a,In(s,e,1)))}))})),v.innerHTML=u+N,v.setAttribute("data-styles",""),a.insertBefore(v,s?s.nextSibling:a.firstChild),y=!1,b.length?b.map((function(n){return n.connectedCallback()})):F.jmp((function(){return t=setTimeout(Mn,30)})),e()},Bn=new WeakMap,Hn=function(n){return Bn.get(n)},Nn=function(n,t){return Bn.set(t.i=n,t)},_n=function(n,t){var r={t:0,p:n,v:t,D:new Map};return r.U=new Promise((function(n){return r.F=n})),r.H=new Promise((function(n){return r.I=n})),n["s-p"]=[],n["s-rc"]=[],D(n,r,t.B),Bn.set(n,r)},qn=function(n,t){return t in n},Vn=function(n,t){return(0,console.error)(n,t)},zn=new Map,Gn=function(n){var t=n.m.replace(/-/g,"_"),r=n.N,e=zn.get(r);return e?e[t]:import("./".concat(r,".entry.js").concat("")).then((function(n){return zn.set(r,n),n[t]}),Vn)},Jn=new Map,Kn=[],Qn=[],Xn=function(n,t){return function(r){n.push(r),C||(C=!0,t&&4&F.t?nt(Zn):F.raf(Zn))}},Yn=function(n){for(var t=0;t<n.length;t++)try{n[t](performance.now())}catch(n){Vn(n)}n.length=0},Zn=function n(){Yn(Kn),Yn(Qn),(C=Kn.length>0)&&F.raf(n)},nt=function(n){return L().then(n)},tt=Xn(Qn,!0);export{Y as H,j as _,t as a,Un as b,On as c,a as d,c as e,r as f,$n as g,Q as h,i,$ as j,p as k,e as l,o as m,S as n,L as p,Nn as r}
|
|
dist/components/web-components/{p-b2b3bfdb.entry.js → p-42f151d8.entry.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
export{a as presto_action_bar,b as presto_action_bar_controller,c as presto_action_bar_ui,d as presto_audio,e as presto_bunny,f as presto_business_skin,g as presto_cta_overlay,h as presto_cta_overlay_controller,C as presto_cta_overlay_ui,i as presto_dynamic_overlay_ui,j as presto_dynamic_overlays,k as presto_email_overlay,l as presto_email_overlay_controller,E as presto_email_overlay_ui,m as presto_modern_skin,n as presto_muted_overlay,o as presto_player,p as presto_player_button,q as presto_player_spinner,s as presto_stacked_skin,t as presto_timestamp,u as presto_video,v as presto_vimeo,w as presto_youtube,x as presto_youtube_subscribe_button}from"./p-
|
1 |
+
export{a as presto_action_bar,b as presto_action_bar_controller,c as presto_action_bar_ui,d as presto_audio,e as presto_bunny,f as presto_business_skin,g as presto_cta_overlay,h as presto_cta_overlay_controller,C as presto_cta_overlay_ui,i as presto_dynamic_overlay_ui,j as presto_dynamic_overlays,k as presto_email_overlay,l as presto_email_overlay_controller,E as presto_email_overlay_ui,m as presto_modern_skin,n as presto_muted_overlay,o as presto_player,p as presto_player_button,q as presto_player_spinner,s as presto_stacked_skin,t as presto_timestamp,u as presto_video,v as presto_vimeo,w as presto_youtube,x as presto_youtube_subscribe_button}from"./p-771734f3.js";import"./p-219091ba.js";
|
dist/components/web-components/p-4338b6d7.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
import{r as t,h as r,g as e,c as i,H as o,_ as n,a,d as s,e as l,f as p,i as u,j as d,k as c,l as h,m as y,n as v}from"./p-3e9a58ac.js";let f=class{constructor(r){t(this,r)}componentWillLoad(){this.player&&(this.player.on("ended",(()=>this.setEnded())),this.player.on("timeupdate",(t=>this.setCurrentTime(t))))}setEnded(){this.ended=!0}setCurrentTime(t){var r,e;this.currentTime=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.plyr.currentTime,this.duration=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){return r("presto-action-bar-controller",{ended:this.ended,config:this.config,currentTime:this.currentTime,duration:this.duration,direction:this.direction,youtube:this.youtube})}get el(){return e(this)}};function _({current:t,duration:r,showAfter:e=null}){if(0===e)return!0;if(null===e||!r)return!1;if(t===e)return!0;let i=t/r*100;return 99.9<i&&(i=100),i>=e}function g(t){if(!t)return;let r,e,i,o;if(t.match(/^rgb/)){const o=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);r=o[1],e=o[2],i=o[3]}else{const o=+("0x"+t.slice(1).replace(t.length<5&&/./g,"$&$&"));r=o>>16,e=o>>8&255,i=255&o}return o=Math.sqrt(r*r*.299+e*e*.587+i*i*.114),o>127.5?"light":"dark"}function m(t){let r,e=t.split(":");return e.length>1&&(r=60*parseInt(e[0])),parseInt(e[1])+parseInt(r)}function b(){var t=navigator.userAgent||navigator.vendor;return/windows phone/i.test(t)?"Windows Phone":/android/i.test(t)?"Android":"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||/(iPad|iPhone|iPod)/gi.test(navigator.platform)?"iOS":"unknown"}function w(){return"iOS"===b()}f.style=":host{display:block}";let k=class{constructor(r){t(this,r),this.actionBarStateChange=i(this,"actionBarStateChange",7),this.show=!1,this.youtubeRenderKey=1,this.percentagePassed=0}componentWillLoad(){this.handleDuration()}handleDuration(){this.handleTime()}handleEnded(t){var r;if(t){if(100!==(null===(r=null==this?void 0:this.config)||void 0===r?void 0:r.percentage_start))return;this.show=!0}}handlePercentagePassed(){this.percentagePassed=this.currentTime/this.duration*100}handleTime(){this.checkTime()}checkTime(){var t,r;this.show=!!(null===(t=null===window||void 0===window?void 0:window.wp)||void 0===t?void 0:t.blocks)||_({current:this.currentTime,duration:this.duration,showAfter:null===(r=this.config)||void 0===r?void 0:r.percentage_start})}handleButtonCountChange(t,r){(null==t?void 0:t.button_count)!==(null==r?void 0:r.button_count)&&this.youtubeRenderKey++,(null==t?void 0:t.enabled)&&this.handleDuration()}youtubeButton(){var t,e,i,o;if("youtube"===(null===(t=this.config)||void 0===t?void 0:t.button_type)&&(null===(e=this.youtube)||void 0===e?void 0:e.channelId))return r("presto-youtube-subscribe-button",{key:this.youtubeRenderKey,channel:null===(i=this.youtube)||void 0===i?void 0:i.channelId,showCount:null===(o=this.config)||void 0===o?void 0:o.button_count})}customButton(){var t,e,i,o,n,a,s,l,p,u,d;if("custom"===(null===(t=this.config)||void 0===t?void 0:t.button_type))return r("presto-player-button",{type:"primary",size:"small",href:null===(i=null===(e=this.config)||void 0===e?void 0:e.button_link)||void 0===i?void 0:i.url,target:(null===(n=null===(o=this.config)||void 0===o?void 0:o.button_link)||void 0===n?void 0:n.opensInNewTab)?"_blank":"_self",style:Object.assign(Object.assign({"--presto-player-button-border-radius":`${null===(a=this.config)||void 0===a?void 0:a.button_radius}px`},(null===(s=this.config)||void 0===s?void 0:s.button_color)?{"--presto-player-button-color":`${null===(l=this.config)||void 0===l?void 0:l.button_color}`}:{}),(null===(p=this.config)||void 0===p?void 0:p.button_text_color)?{"--presto-player-button-text":`${null===(u=this.config)||void 0===u?void 0:u.button_text_color}`}:{})},null===(d=this.config)||void 0===d?void 0:d.button_text)}handleCtaStateChange(t){this.actionBarStateChange.emit(t)}render(){var t,e;return r("presto-action-bar-ui",{open:this.show,style:{"--presto-action-bar-background":(null===(t=this.config)||void 0===t?void 0:t.background_color)||"#1d1d1d"}},null===(e=this.config)||void 0===e?void 0:e.text,r("div",{slot:"button"},this.youtubeButton(),this.customButton()))}get el(){return e(this)}static get watchers(){return{duration:["handleDuration","handlePercentagePassed"],ended:["handleEnded"],currentTime:["handlePercentagePassed","handleTime"],config:["handleButtonCountChange"],show:["handleCtaStateChange"]}}};k.style=":host{display:block}";let x=class{constructor(r){t(this,r)}render(){return r("div",{class:{bar:!0,"bar--open":this.open}},r("span",{part:"content",class:"bar__content"},r("slot",null)),r("span",{part:"button",class:"bar__button"},r("slot",{name:"button"})))}};x.style=":host{display:block;overflow:hidden}.bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;background:var(--presto-action-bar-background, #1d1d1d);color:#fff;padding:0 var(--presto-action-bar-padding, 6px);line-height:1em;font-size:16px;margin-top:-100%;transition:margin var(--presto-action-bar-animation-speed, 0.5s) ease-in-out;transform:translate3d(0);border-radius:0px 0px var(--presto-player-border-radius) var(--presto-player-border-radius)}.bar.bar--open{margin-top:0}.bar__button{margin:var(--presto-action-bar-padding, 6px);display:flex;align-items:center}.bar__content{margin:var(--presto-action-bar-padding, 6px);width:100%;text-align:center}@media screen and (min-width: 480px){.bar__content{width:auto}}";let z=class{constructor(r){t(this,r),this.playVideo=i(this,"playVideo",7),this.pauseVideo=i(this,"pauseVideo",7)}renderPosterImage(){if(this.poster)return r("div",{class:"presto-audio__poster"},r("img",{src:this.poster}))}hasPosterArea(){var t;return!!this.poster||!!(null===(t=this.preset)||void 0===t?void 0:t["play-large"])}renderMobilePoster(){var t;return r("div",{class:"presto-audio__poster-wrapper-mobile"},!!(null===(t=this.preset)||void 0===t?void 0:t["play-large"])&&this.renderLargePlay("presto-audio__large-play-button is-relative"),r("div",{class:"presto-audio__mobile-title"},this.mediaTitle))}renderLargePlay(t="presto-audio__large-play-button"){return r("div",{class:t,onClick:()=>{this.player.playing?this.pauseVideo.emit():this.playVideo.emit()}},r("svg",{class:"presto-audio__icon-play",width:"16",height:"18",viewBox:"0 0 16 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r("path",{d:"M15.5588 9.00005L0.117662 17.915L0.117662 0.0850823L15.5588 9.00005Z"})),r("svg",{class:"presto-audio__icon-pause",width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r("rect",{width:"5",height:"17"}),r("rect",{x:"12",width:"5",height:"17"})))}componentDidLoad(){"ResizeObserver"in window&&new ResizeObserver((t=>{t.forEach((t=>this.width=t.contentRect.width))})).observe(this.el)}render(){var t,e,i,o,n;return r("div",{ref:t=>this.el=t,class:{"presto-audio__wrapper":!0,"has-poster":!!this.poster,"has-play-large":!!(null===(t=this.preset)||void 0===t?void 0:t["play-large"]),"is-playing":null===(e=this.player)||void 0===e?void 0:e.playing,"has-light-background":"light"===g(null===(i=this.preset)||void 0===i?void 0:i.background_color),"has-dark-background":"dark"===g(null===(o=this.preset)||void 0===o?void 0:o.background_color),"breakpoint-small":this.width<520,"skin-stacked":this.width<520,"breakpoint-large":this.width>=520}},this.hasPosterArea()&&r("div",{class:"presto-audio__poster-wrapper"},!!(null===(n=this.preset)||void 0===n?void 0:n["play-large"])&&r("div",{class:"presto-audio__large-play-wrapper"},this.renderLargePlay()),this.renderPosterImage()),this.hasPosterArea()&&this.renderMobilePoster(),r("div",{class:"presto-audio__controls-wrapper"},r("div",{class:"presto-audio__title"},this.mediaTitle),r("audio",Object.assign({part:"audio-player",ref:this.getRef,autoplay:this.autoplay,preload:this.preload,"data-poster":this.poster},this.audioAttributes),r("source",{src:this.src}),!!this.tracks&&!!this.tracks.length&&this.tracks.map((t=>r("track",{kind:"captions",label:(null==t?void 0:t.label)?t.label:"Captions",src:null==t?void 0:t.src,srclang:(null==t?void 0:t.srcLang)?null==t?void 0:t.srcLang:"en"}))))))}};z.style=":host{display:block}.presto-audio__wrapper{border-radius:var(--presto-player-border-radius, 0px)}.presto-audio__wrapper .plyr--audio .plyr__controls{padding:0}.presto-audio__wrapper .plyr--audio .plyr__control.plyr__tab-focus,.presto-audio__wrapper .plyr--audio .plyr__control:hover,.presto-audio__wrapper .plyr--audio .plyr__control[aria-expanded=true]{background:var(--plyr-audio-controls-background);color:var(--plyr-audio-control-color)}.presto-audio__wrapper{display:flex;background:var(--plyr-audio-controls-background, #fff)}.presto-audio__controls-wrapper{padding:calc(var(--plyr-control-spacing, 10px) * 2);flex:1;display:flex;flex-direction:column;justify-content:center;min-width:0}.has-poster .presto-audio__controls-wrapper{padding:calc(var(--plyr-control-spacing, 10px) * 3)}.has-play-large:not(.has-poster) .presto-audio__controls-wrapper{padding-left:0}.presto-audio__title,.presto-audio__mobile-title{font-size:18px;font-weight:500;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--plyr-audio-control-color)}.presto-audio__title{margin:calc(var(--plyr-control-spacing, 10px) / 2);margin-top:0}.presto-audio__poster-wrapper{position:relative;width:100px;min-height:100px;flex:0 0 100px}.presto-audio__poster-wrapper img{border-radius:var(--presto-player-border-radius, 0px) 0 0 var(--presto-player-border-radius, 0px);width:100%;height:100%;object-fit:cover;aspect-ratio:1;display:block}.has-poster .presto-audio__poster-wrapper{width:140px;height:140px;flex:0 0 140px}.presto-audio__poster{width:100%;height:100%}.presto-audio__large-play-button{user-select:none;cursor:pointer;position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:50%;transform:translate(-50%, -50%);width:50px;height:50px;color:white;border-radius:100%;background:var(--plyr-audio-control-color);color:var(--plyr-audio-controls-background)}.presto-audio__large-play-button.is-relative{position:relative;top:auto;left:auto;transform:none}.has-light-background.has-poster .presto-audio__large-play-button{background:var(--plyr-audio-controls-background);color:var(--plyr-audio-control-color)}.has-dark-background.has-poster .presto-audio__large-play-button{background:var(--plyr-audio-control-color);color:var(--plyr-audio-controls-background)}.presto-audio__icon-play,.presto-audio__icon-pause{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);fill:currentColor;display:block;transition:opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;margin:0 auto;text-align:center}.presto-audio__icon-pause{opacity:0;visibility:hidden}.presto-audio__wrapper.is-playing .presto-audio__icon-pause{opacity:1;visibility:visible}.presto-audio__icon-play{margin-left:2px;opacity:1;visibility:visible}.presto-audio__wrapper.is-playing .presto-audio__icon-play{opacity:0;visibility:hidden}.presto-audio__poster-wrapper-mobile{display:none;min-width:0}.presto-audio__poster-wrapper-mobile .presto-audio__large-play-button{flex:0 0 50px}.presto-audio__wrapper.breakpoint-small{flex-direction:column}.presto-audio__wrapper.breakpoint-small .presto-audio__controls-wrapper{padding:calc(var(--plyr-control-spacing, 10px) * 2)}.presto-audio__wrapper.breakpoint-small.has-poster .presto-audio__title{text-align:center;margin:calc(var(--plyr-control-spacing, 10px) * 1.5)}.presto-audio__wrapper.breakpoint-small.has-poster .presto-audio__poster-wrapper{margin:30px auto auto auto;overflow:hidden;border-radius:var(--presto-player-border-radius, 0px);width:225px;height:225px;flex:0 0 225px}.presto-audio__wrapper.breakpoint-small.has-play-large:not(.has-poster) .presto-audio__poster-wrapper,.presto-audio__wrapper.breakpoint-small.has-play-large:not(.has-poster) .presto-audio__title{display:none}.presto-audio__wrapper.breakpoint-small.has-play-large:not(.has-poster) .presto-audio__poster-wrapper-mobile{display:flex;align-items:center;gap:1em;margin-bottom:calc(var(--plyr-control-spacing, 10px) * -1);padding:calc(var(--plyr-control-spacing, 10px) * 2) calc(var(--plyr-control-spacing, 10px) * 2) 0 calc(var(--plyr-control-spacing, 10px) * 2)}.skin-stacked.presto-sticky-audio .presto-audio__wrapper{height:115px}.skin-stacked.presto-sticky-audio .has-poster .presto-audio__controls-wrapper{padding:20px}.skin-stacked.presto-sticky-audio .has-poster .presto-audio__poster-wrapper{width:115px;height:115px;flex:0 0 115px}.presto-sticky-audio .presto-audio__wrapper{height:100px}.presto-sticky-audio .has-poster .presto-audio__controls-wrapper{padding:20px}.presto-sticky-audio .has-poster .presto-audio__poster-wrapper{width:100px;height:100px;flex:0 0 100px}.action-bar-active .presto-audio__wrapper{border-radius:var(--presto-player-border-radius) var(--presto-player-border-radius) 0px 0px}@media screen and (max-width: 520px){.presto-sticky-audio .presto-audio__poster-wrapper-mobile{display:flex;align-items:center;gap:1em;margin-bottom:calc(var(--plyr-control-spacing, 10px) * -1);padding:calc(var(--plyr-control-spacing, 10px) * 2) calc(var(--plyr-control-spacing, 10px) * 2) 0 calc(var(--plyr-control-spacing, 10px) * 2)}.presto-sticky-audio .presto-audio__poster-wrapper,.presto-sticky-audio .presto-audio__title{display:none}.presto-sticky-audio .presto-audio__wrapper{height:140px}.presto-sticky-audio .has-poster .presto-audio__controls-wrapper{padding:0px}.presto-sticky-audio .presto-audio__poster-wrapper-mobile .presto-audio__large-play-button{flex:0 0 40px;height:40px}}";let j=class{constructor(r){t(this,r)}componentWillLoad(){this.poster=this.poster||this.thumbnail}render(){return r("presto-video",{getRef:this.getRef,player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,playsinline:this.playsinline,src:this.src,tracks:this.tracks,videoAttributes:this.videoAttributes})}},T=class{constructor(r){t(this,r)}render(){return r(o,null,r("slot",null))}};T.style='.skin-business.presto-player__wrapper.rewind-inactive .plyr__controls .plyr__controls__item:nth-child(2)::before{border-radius:var(--plyr-control-radius, 3px) 0px 0px var(--plyr-control-radius, 3px)}.skin-business.presto-player__wrapper.caption-style-full .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 16px) * -4))}.skin-business.presto-player__wrapper .presto-player-progress__marker{border-radius:0;width:15px;height:15px;border-width:1px}.skin-business.presto-player__wrapper .plyr__control[data-plyr]:hover:not([role*=menuitem]):not(.plyr__control--back),.skin-business.presto-player__wrapper .plyr__control[data-plyr]:focus:not([role*=menuitem]):not(.plyr__control--back),.skin-business.presto-player__wrapper .plyr__control[data-plyr]:active:not([role*=menuitem]):not(.plyr__control--back){background-color:transparent;color:var(--plyr-color-main)}.skin-business.presto-player__wrapper .plyr__control[data-plyr]:hover:not([role*=menuitem]):not(.plyr__control--back)[data-plyr=play],.skin-business.presto-player__wrapper .plyr__control[data-plyr]:focus:not([role*=menuitem]):not(.plyr__control--back)[data-plyr=play],.skin-business.presto-player__wrapper .plyr__control[data-plyr]:active:not([role*=menuitem]):not(.plyr__control--back)[data-plyr=play]{background-color:var(--plyr-color-main);color:white}.skin-business.presto-player__wrapper .plyr__control--overlaid[data-plyr=play]{border-radius:4px;background:#000000;opacity:75%}.skin-business.presto-player__wrapper .plyr__control--overlaid[data-plyr=play]:hover{background-color:var(--plyr-color-main);color:white;opacity:100%}.skin-business.presto-player__wrapper .plyr__volume input[type=range]{cursor:pointer}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fast-forward]{border-radius:0px}.skin-business.presto-player__wrapper .plyr__progress{margin:0px 20px 0 5px}.skin-business.presto-player__wrapper .plyr__progress input[type=range]{height:32px;border-radius:0px;cursor:pointer}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker):first-child::before{border-radius:var(--plyr-control-radius, 3px) 0px 0px var(--plyr-control-radius, 3px)}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker):last-child::before{border-radius:0px var(--plyr-control-radius, 3px) var(--plyr-control-radius, 3px) 0px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item.plyr__control[data-plyr=play]{order:-1;margin-right:5px;padding:11px 20px 11px 20px;top:-4px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item.plyr__control[data-plyr=play]::before{border-radius:4px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=rewind]::before{border-radius:var(--plyr-control-radius, 3px) 0px 0px var(--plyr-control-radius, 3px)}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not([data-plyr=play]){margin:0}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen]{padding:4px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen] svg{height:24px;width:24px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker){position:relative}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker).plyr__time{height:32px;padding-top:4.5px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker)::before{content:"";background:#000000;position:absolute;top:0px;left:0;right:0;bottom:0px;opacity:0.76;z-index:-1}.skin-business.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-runnable-track{box-shadow:none;color:var(--plyr-color-main);height:9px;outline:1px solid #878787a6;outline-offset:2px;border-radius:0px}.skin-business.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-thumb{visibility:hidden}.skin-business.presto-player__wrapper .plyr__progress__buffer::-webkit-progress-value{position:relative;border-radius:0px;height:9px;top:-2px}.skin-business.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background-color:transparent}@media screen and (max-width: 480px){.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item.plyr__time{padding:1.5%}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=play]{padding:8px;top:0px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen] svg{width:22px}}';let S=class{constructor(r){t(this,r)}componentWillLoad(){this.player&&(this.player.on("ended",(()=>this.setEnded())),this.player.on("timeupdate",(t=>this.setCurrentTime(t))))}setEnded(){this.ended=!0}setCurrentTime(t){var r,e;this.currentTime=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.plyr.currentTime,this.duration=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){var t;return r("presto-cta-overlay-controller",{ended:this.ended,currentTime:this.currentTime,duration:this.duration,direction:this.direction,cta:null===(t=this.preset)||void 0===t?void 0:t.cta,i18n:this.i18n,provider:this.provider})}};S.style=":host{display:block}";let C=class{constructor(r){t(this,r),this.playVideo=i(this,"playVideo",7),this.pauseVideo=i(this,"pauseVideo",7),this.restartVideo=i(this,"restartVideo",7),this.ctaStateChange=i(this,"ctaStateChange",7),this.percentagePassed=0}componentWillLoad(){this.handleDuration()}handleEnded(t){var r;if(t){if(100!==(null===(r=null==this?void 0:this.cta)||void 0===r?void 0:r.percentage))return;this.show=!0}}handleDuration(){var t;this.enabled=!this.skipped&&(null===(t=null==this?void 0:this.cta)||void 0===t?void 0:t.enabled),this.handleTime()}handlePercentagePassed(){this.percentagePassed=this.currentTime/this.duration*100}handleEnabled(){this.show&&(this.skipped||this.pauseVideo.emit(!0))}handleTime(){var t;this.enabled&&(this.skipped||100!==(null===(t=null==this?void 0:this.cta)||void 0===t?void 0:t.percentage)&&this.checkTime())}checkTime(){var t;this.show=_({current:this.currentTime,duration:this.duration,showAfter:(null===(t=null==this?void 0:this.cta)||void 0===t?void 0:t.percentage)||0})}skip(){this.skipped=!0,this.show=!1,this.playVideo.emit()}rewatch(){this.ended=!1,this.show=!1,this.restartVideo.emit()}handleCtaStateChange(t){this.ctaStateChange.emit(t)}render(){var t,e,i,o,n,a,s,l,p,u,d,c,h,y;if(this.show)return r("presto-cta-overlay-ui",{style:Object.assign(Object.assign(Object.assign({"--presto-player-button-border-radius":`${null===(t=null==this?void 0:this.cta)||void 0===t?void 0:t.button_radius}px`},(null===(e=null==this?void 0:this.cta)||void 0===e?void 0:e.background_opacity)?{"--presto-player-cta-background-opacity":""+(null===(i=null==this?void 0:this.cta)||void 0===i?void 0:i.background_opacity)/100}:{}),(null===(o=null==this?void 0:this.cta)||void 0===o?void 0:o.button_color)?{"--presto-player-button-color":`${null===(n=null==this?void 0:this.cta)||void 0===n?void 0:n.button_color}`}:{}),(null===(a=null==this?void 0:this.cta)||void 0===a?void 0:a.button_text_color)?{"--presto-player-button-text":`${null===(s=null==this?void 0:this.cta)||void 0===s?void 0:s.button_text_color}`}:{}),direction:this.direction,class:"cta-overlay",i18n:this.i18n,headline:null===(l=null==this?void 0:this.cta)||void 0===l?void 0:l.headline,"bottom-text":null===(p=null==this?void 0:this.cta)||void 0===p?void 0:p.bottom_text,"show-button":null===(u=null==this?void 0:this.cta)||void 0===u?void 0:u.show_button,buttonLink:null===(d=null==this?void 0:this.cta)||void 0===d?void 0:d.button_link,allowSkip:!this.ended&&(null===(c=null==this?void 0:this.cta)||void 0===c?void 0:c.show_skip),allowRewatch:this.ended&&(null===(h=null==this?void 0:this.cta)||void 0===h?void 0:h.show_rewatch),"button-text":null===(y=null==this?void 0:this.cta)||void 0===y?void 0:y.button_text,onSkip:()=>this.skip(),onRewatch:()=>this.rewatch(),provider:this.provider})}static get watchers(){return{ended:["handleEnded"],duration:["handleDuration","handlePercentagePassed"],currentTime:["handlePercentagePassed","handleEnabled","handleTime"],show:["handleCtaStateChange"]}}};C.style=":host{display:block}";const P=function(t,r,e){var i=function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return t}({minFontSize:-1/0,maxFontSize:1/0,container:t},e),o=function(t){var e=r||1,o=function(){var r;t.style.fontSize=Math.max(Math.min(((null==i||null===(r=i.container)||void 0===r?void 0:r.clientWidth)||0)/(10*e),parseFloat(i.maxFontSize)),parseFloat(i.minFontSize))+"px"};if(o(),"ResizeObserver"in window==0)var n=import("./p-97e2763b.js").then((function(){window.ResizeObserver=n.ResizeObserver,new ResizeObserver(o).observe(i.container)}));else new ResizeObserver(o).observe(i.container)};if(t.length)for(var n=0;n<t.length;n++)o(t[n]);else o(t);return t};let O=class{constructor(r){t(this,r),this.skip=i(this,"skip",7),this.rewatch=i(this,"rewatch",7)}componentDidLoad(){this.isAudioProvider="audio"===(this.type||this.provider),P(this.textInput,3,{maxFontSize:!0===this.isAudioProvider?15:20,minFontSize:8})}handleCTAClick(t){var r;(null===(r=this.buttonLink)||void 0===r?void 0:r.url)&&(t.preventDefault(),t.stopPropagation(),this.handleLink())}handleLink(){var t,r,e;(null===(t=this.buttonLink)||void 0===t?void 0:t.opensInNewTab)?window.open(null===(r=this.buttonLink)||void 0===r?void 0:r.url,"_blank"):window.location.href=null===(e=this.buttonLink)||void 0===e?void 0:e.url}render(){var t,e,i,o,n;return r("div",{class:"wrapper",ref:t=>this.textInput=t},r("div",{onClick:t=>this.handleCTAClick(t),class:`overlay ${"rtl"===this.direction?"rtl":""} ${(null===(t=this.buttonLink)||void 0===t?void 0:t.url)?"has-link":""}`},r("div",{class:this.isAudioProvider?"content is-centered":"content"},r("h1",{part:"cta-headline"},this.headline||this.defaultHeadline),this.bottomText&&r("p",{class:this.isAudioProvider&&"is-small",part:"cta-bottom-text",innerHTML:this.bottomText}),this.showButton&&r("presto-player-button",{full:!0,onClick:t=>this.handleCTAClick(t),part:"cta-button",href:null===(e=null==this?void 0:this.buttonLink)||void 0===e?void 0:e.url,target:(null===(i=null==this?void 0:this.buttonLink)||void 0===i?void 0:i.opensInNewTab)?"_blank":"_self",class:"button",type:"primary"},this.buttonText))),!!this.allowRewatch&&r("div",{class:"rewatch",onClick:t=>{t.preventDefault(),t.stopImmediatePropagation(),this.rewatch.emit()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-corner-up-left"},r("polyline",{points:"9 14 4 9 9 4"}),r("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})),null===(o=null==this?void 0:this.i18n)||void 0===o?void 0:o.rewatch),!!this.allowSkip&&r("div",{class:"skip",onClick:t=>{t.preventDefault(),this.skip.emit()}},null===(n=null==this?void 0:this.i18n)||void 0===n?void 0:n.skip," →"))}};O.style=':host{display:block;font-size:16px;width:100%;height:100%;position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;z-index:99999;user-select:none}*{box-sizing:border-box}a{color:#fff}.wrapper{height:100%;position:relative;color:#fff;font-family:var(--plyr-font-family, "San Francisco", -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif)}.overlay{position:relative;display:flex;align-items:center;justify-content:center;padding:48px;height:100%}.overlay.has-link{cursor:pointer}.overlay:before{content:"";border-radius:var(--presto-player-border-radius, 0);opacity:var(--presto-player-cta-background-opacity, 0.75);position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--presto-player-cta-background, #000);z-index:-1;box-shadow:inset 0 0 100px black}.content{width:80%;max-width:600px}.content *~*{margin-top:22px}button{background:var(--plyr-color-main, #000);appearance:none;padding:6px 12px;align-items:center;display:inline-flex;border-width:1px;border-color:transparent;color:#fff;border-radius:0;cursor:pointer;font-size:0.8em;border-radius:0 var(--presto-player-cta-border-radius, 0) var(--presto-player-cta-border-radius) 0}@media screen and (min-width: 700px){button{padding:10px 18px}}button:focus{box-shadow:white 0px 0px 0px 2px, var(--plyr-color-main, #000) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;z-index:1}button:focus,button:hover{outline:none}h1{font-size:1.5em;font-weight:500;margin:0;line-height:1.1em}.skip,.rewatch{font-size:0.8em;font-weight:600;position:absolute;top:0;right:0;padding:4%;cursor:pointer}.rewatch{display:inline-flex;align-items:center;right:auto;left:0}.rewatch .icon{margin-right:5px}p{font-size:0.85em;margin:0;margin-top:1.5em;line-height:1.4em;opacity:0.75}p.is-small{font-size:0.85em;margin:1.5em 0px 0px;line-height:0.1em;opacity:0.75}.is-centered{text-align:center}';let A=class{constructor(r){t(this,r),this.position="top-right"}closestElement(t,r){return r&&r!=document&&r!=window&&r.closest(t)||r&&this.closestElement(t,r.getRootNode().host)}componentDidLoad(){let t=this.closestElement("presto-player",this.el);P(this.text,3,{maxFontSize:16,minFontSize:10,container:t})}render(){return r(this.href?"a":"span",{class:{"overlay-text":!0,"overlay--top-left":"top-left"===this.position,"overlay--top-right":"top-right"===this.position},href:this.href,target:this.target,part:"overlay-text",ref:t=>this.text=t},r("slot",null))}get el(){return e(this)}};A.style=":host{display:block}.overlay-text{text-decoration:none;display:inline-block;user-select:none;line-height:1;opacity:var(--presto-dynamic-overlay-opacity, 1);font-size:var(--presto-dynamic-overlay-font-size, 18px);padding:var(--presto-dynamic-overlay-padding, 0.65em 0.85em);font-weight:var(--presto-dynamic-overlay-font-weight, 500);border-radius:var(--presto-dynamic-overlay-radius, 0.25em);background:var(--presto-dynamic-overlay-background, rgba(0, 0, 0, 0.8));color:var(--presto-dynamic-overlay-color, #fff);opacity:var(--presto-dynamic-overlay-opacity, 1);word-break:break-word}a.overlay-text{cursor:pointer}";let I=class{constructor(r){t(this,r),this.reloadComponent=i(this,"reloadComponent",7),this.watermarkRef={left:null,right:null},this.destroy=!1,this.refs={}}componentDidLoad(){this.player&&this.player.on("timeupdate",(t=>{this.currentTime=t.detail.plyr.currentTime,this.checkValidity()}))}checkValidity(){var t,r,e,i,o,n,a,s,l,p;this.player.playing&&((null===(t=null==this?void 0:this.overlays)||void 0===t?void 0:t.length)||(null===(e=null===(r=this.preset)||void 0===r?void 0:r.watermark)||void 0===e?void 0:e.enabled))&&((null===(i=this.container)||void 0===i?void 0:i.offsetParent)&&(null===(o=this.topLeft)||void 0===o?void 0:o.offsetParent)&&(null===(n=this.topRight)||void 0===n?void 0:n.offsetParent)||this.reloadComponent.emit(),Object.keys(this.refs||{}).forEach((t=>{const{overlay:r,component:e}=this.refs[t];this.checkComponent(e,r.text,(()=>this.reloadComponent.emit()))})),this.shouldShowWatermark("top-left")&&this.watermarkRef.left&&this.checkComponent(this.watermarkRef.left,null===(s=null===(a=this.preset)||void 0===a?void 0:a.watermark)||void 0===s?void 0:s.text,(()=>this.reloadComponent.emit())),this.shouldShowWatermark("top-right")&&this.watermarkRef.right&&this.checkComponent(this.watermarkRef.right,null===(p=null===(l=this.preset)||void 0===l?void 0:l.watermark)||void 0===p?void 0:p.text,(()=>this.reloadComponent.emit())))}checkComponent(t,r,e){if(!(null==t?void 0:t.offsetParent))return e();if(!t.shadowRoot.querySelector("slot"))return e();if(this.player&&this.player.playing){const i=t.shadowRoot.querySelector("slot").assignedNodes()[0];if(i){if(i.parentElement.innerHTML!=r)return e();const t=getComputedStyle(i.parentElement.shadowRoot.querySelector(".overlay-text"));if(parseInt(t.fontSize,10)<10)return e();const o=function(t){var r=t.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);return r?[r[1],r[2],r[3],"1"]:(r=t.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((0.)?\d+)\s*\)$/i))?[r[1],r[2],r[3],r[4]]:void 0}(t.color);if("1"!==(null==o?void 0:o[3]))return e()}}}shouldShowOverlay(t){if(void 0!==this.currentTime)return!(this.currentTime<m(null==t?void 0:t.startTime)||this.currentTime>m(null==t?void 0:t.endTime))}renderOverlay(t){var e,i;return r("presto-dynamic-overlay-ui",{class:{visible:this.shouldShowOverlay(t)},ref:r=>this.refs[t.id]={overlay:t,component:r},key:t.id,position:t.position,href:null===(e=null==t?void 0:t.link)||void 0===e?void 0:e.url,target:(null===(i=null==t?void 0:t.link)||void 0===i?void 0:i.opensInNewTab)?"_blank":"_self",innerHTML:this.shouldShowOverlay(t)?t.text:"",style:{"--presto-dynamic-overlay-color":(null==t?void 0:t.color)||"#fff","--presto-dynamic-overlay-background":(null==t?void 0:t.backgroundColor)||"#333","--presto-dynamic-overlay-opacity":(null==t?void 0:t.opacity)?(t.opacity/100).toString():"1"}})}shouldShowWatermark(t){var r,e,i;if(!(null===(e=null===(r=this.preset)||void 0===r?void 0:r.watermark)||void 0===e?void 0:e.enabled))return!1;const o=null===(i=this.preset)||void 0===i?void 0:i.watermark;return"randomize"===o.position?Math.floor((this.player.currentTime||0)/10)%2==0?"top-left"===t:"top-right"===t:o.position===t||!o.position&&"top-right"===t}render(){var t,e,i,o,n,a,s,l,p,u,d;if(this.enabled&&((null===(t=null==this?void 0:this.overlays)||void 0===t?void 0:t.length)||(null===(i=null===(e=this.preset)||void 0===e?void 0:e.watermark)||void 0===i?void 0:i.enabled)))return r("div",{class:"overlays",ref:t=>this.container=t},r("div",{class:"top-left",ref:t=>this.topLeft=t},!!this.shouldShowWatermark("top-left")&&r("presto-dynamic-overlay-ui",{ref:t=>this.watermarkRef.left=t,style:{"--presto-dynamic-overlay-color":(null===(o=this.preset.watermark)||void 0===o?void 0:o.color)||"#fff","--presto-dynamic-overlay-background":(null===(n=this.preset.watermark)||void 0===n?void 0:n.backgroundColor)||"#333","--presto-dynamic-overlay-opacity":(null===(a=this.preset.watermark)||void 0===a?void 0:a.opacity)?(this.preset.watermark.opacity/100).toString():"1"},class:"visible",position:"top-left",innerHTML:this.preset.watermark.text}),!!(null===(s=null==this?void 0:this.overlays)||void 0===s?void 0:s.length)&&this.overlays.map((t=>"top-left"!==t.position?"":this.renderOverlay(t)))),r("div",{class:"top-right",ref:t=>this.topRight=t},!!this.shouldShowWatermark("top-right")&&r("presto-dynamic-overlay-ui",{ref:t=>this.watermarkRef.right=t,style:{"--presto-dynamic-overlay-color":(null===(l=this.preset.watermark)||void 0===l?void 0:l.color)||"#fff","--presto-dynamic-overlay-background":(null===(p=this.preset.watermark)||void 0===p?void 0:p.backgroundColor)||"#333","--presto-dynamic-overlay-opacity":(null===(u=this.preset.watermark)||void 0===u?void 0:u.opacity)?(this.preset.watermark.opacity/100).toString():"1"},class:"visible",position:"top-right",innerHTML:this.preset.watermark.text}),!!(null===(d=null==this?void 0:this.overlays)||void 0===d?void 0:d.length)&&this.overlays.map((t=>"top-right"!==t.position?"":this.renderOverlay(t)))))}get el(){return e(this)}};I.style=".top-left,.top-right{position:absolute;display:block;padding:20px;max-width:45%;z-index:20;display:flex;flex-direction:column;flex-wrap:wrap}.top-left{top:0;left:0}.top-right{top:0;right:0;align-items:flex-end}presto-dynamic-overlay-ui{overflow:hidden;height:0;opacity:0;transition:height 0ms 400ms, opacity 400ms 0ms}presto-dynamic-overlay-ui.visible{margin-bottom:10px;height:auto;opacity:1;transition:height 0ms 0ms, opacity 500ms 0ms}";let M=class{constructor(r){t(this,r)}componentWillLoad(){this.player&&(this.player.on("ended",(()=>this.setEnded())),this.player.on("timeupdate",(t=>this.setCurrentTime(t))))}setEnded(){this.ended=!0}setCurrentTime(t){var r,e;this.currentTime=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.plyr.currentTime,this.duration=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){var t,e;return r("presto-email-overlay-controller",{ended:this.ended,currentTime:this.currentTime,videoId:this.videoId,duration:this.duration,direction:this.direction,presetId:null===(t=this.preset)||void 0===t?void 0:t.id,emailCollection:null===(e=this.preset)||void 0===e?void 0:e.email_collection,i18n:this.i18n,provider:this.provider})}};M.style=":host{display:block}";let E=class{constructor(r){t(this,r),this.playVideo=i(this,"playVideo",7),this.pauseVideo=i(this,"pauseVideo",7),this.restartVideo=i(this,"restartVideo",7),this.emailStateChange=i(this,"emailStateChange",7),this.percentagePassed=0}setStorage(t){window.localStorage.setItem("presto.videos.email_collection",JSON.stringify({[this.videoId]:t}))}getStorage(){return window.localStorage.getItem("presto.videos.email_collection")}componentWillLoad(){this.handleDuration()}handleDuration(){var t;this.enabled=!this.getStorage()&&(null===(t=null==this?void 0:this.emailCollection)||void 0===t?void 0:t.enabled),this.handleTimeCheck()}handleTimeCheck(){this.enabled&&(this.getStorage()||this.checkTime())}handleShowChange(){this.show&&this.pauseVideo.emit(!0)}checkTime(){var t;this.show=_({current:this.currentTime,duration:this.duration,showAfter:(null===(t=null==this?void 0:this.emailCollection)||void 0===t?void 0:t.percentage)||0})}async getNonce(){var t;return fetch(`${null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.ajaxurl}?action=presto_refresh_progress_nonce`)}async submit(t){var r;this.loading=!0,this.error="";const e=await this.getNonce(),{data:i}=await e.json();try{let e=await fetch(null===(r=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===r?void 0:r.ajaxurl,{method:"post",body:new URLSearchParams(Object.assign({action:"presto_player_email_submit",nonce:i,preset_id:this.presetId,video_id:this.videoId},(null==t?void 0:t.detail)||{}))});const{success:o,data:n}=await e.json();if(!o)throw n;this.setStorage("collected"),this.show=!1,this.playVideo.emit()}catch(t){const r=null==t?void 0:t[0];r&&"string"==typeof r&&(this.error=r)}finally{this.loading=!1}}skip(){this.setStorage("skipped"),this.show=!1,this.playVideo.emit()}handleEmailStateChange(t){this.emailStateChange.emit(t)}render(){var t,e,i,o,n,a,s,l;if(this.show)return r("presto-email-overlay-ui",{style:Object.assign(Object.assign({},(null===(t=null==this?void 0:this.emailCollection)||void 0===t?void 0:t.button_color)?{"--presto-player-button-color":`${null===(e=null==this?void 0:this.emailCollection)||void 0===e?void 0:e.button_color}`}:{}),(null===(i=null==this?void 0:this.emailCollection)||void 0===i?void 0:i.button_text_color)?{"--presto-player-button-text":`${null===(o=null==this?void 0:this.emailCollection)||void 0===o?void 0:o.button_text_color}`}:{}),direction:this.direction,class:"email-overlay",headline:null===(n=null==this?void 0:this.emailCollection)||void 0===n?void 0:n.headline,bottomText:null===(a=null==this?void 0:this.emailCollection)||void 0===a?void 0:a.bottom_text,allowSkip:null===(s=null==this?void 0:this.emailCollection)||void 0===s?void 0:s.allow_skip,buttonText:null===(l=null==this?void 0:this.emailCollection)||void 0===l?void 0:l.button_text,isLoading:this.loading,errorMessage:this.error,onSubmitForm:t=>this.submit(t),onSkip:()=>this.skip(),i18n:this.i18n,provider:this.provider})}static get watchers(){return{duration:["handleDuration"],currentTime:["handleTimeCheck","handleShowChange"],show:["handleEmailStateChange"]}}};E.style=":host{display:block}";let F=class{constructor(r){t(this,r),this.submitForm=i(this,"submitForm",7),this.skip=i(this,"skip",7)}handleSubmit(t){this.submitForm.emit({email:this.email}),t.preventDefault()}componentDidLoad(){this.isAudioProvider="audio"===(this.type||this.provider),P(this.textInput,3,{maxFontSize:this.isAudioProvider?15:20,minFontSize:8})}handleChange(t){this.email=t.target.value}render(){var t,e,i,o;return r("div",{class:"overlay "+("rtl"===this.direction?"rtl":""),ref:t=>this.textInput=t},r("div",{class:"content"},r("h1",{class:this.isAudioProvider&&"is-small"},this.headline||(null===(t=null==this?void 0:this.i18n)||void 0===t?void 0:t.emailDefaultHeadline)),this.isLoading?r("presto-player-spinner",null):r("form",{onSubmit:t=>this.handleSubmit(t)},r("input",{type:"email",placeholder:null===(e=null==this?void 0:this.i18n)||void 0===e?void 0:e.emailPlaceholder,value:this.email,onInput:t=>this.handleChange(t),required:!0}),r("button",{type:"submit"},this.buttonText||(null===(i=null==this?void 0:this.i18n)||void 0===i?void 0:i.play))),this.errorMessage&&r("p",{class:"error"},this.errorMessage),this.bottomText&&r("p",{innerHTML:this.bottomText,class:this.isAudioProvider&&"is-small"}),!!this.allowSkip&&r("div",{class:"skip",onClick:()=>{this.skip.emit()}},null===(o=null==this?void 0:this.i18n)||void 0===o?void 0:o.skip," →")))}};F.style=':host{display:block;font-size:16px;width:100%;height:100%;position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;z-index:99999}*{box-sizing:border-box}a{color:#fff}.overlay{position:relative;display:flex;align-items:center;text-align:center;justify-content:center;padding:48px;color:#fff;font-family:var(--plyr-font-family, "San Francisco", -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif);height:100%}.overlay:before{content:"";border-radius:var(--presto-player-border-radius, 0);opacity:var(--presto-player-email-background-opacity, 0.75);position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--presto-player-email-background, #000);z-index:-1;box-shadow:inset 0 0 100px black}.overlay.rtl form{flex-direction:row-reverse}.content{width:20em}form{display:flex;align-items:stretch;justify-content:center}input{background:#fff;border:none;font-size:0.8em;line-height:20px;padding:6px 8px;border-radius:0;border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--presto-player-email-border-radius, 0) 0 0 var(--presto-player-email-border-radius);flex:1}@media screen and (min-width: 700px){input{padding:10px 14px}}input:focus{border-color:var(--plyr-color-main, #000);z-index:1}input:focus,input:hover{outline:none}.rtl input{border-radius:0 var(--presto-player-email-border-radius, 0) var(--presto-player-email-border-radius) 0}button{background-color:var(--presto-player-button-color, var(--plyr-color-main));border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-text, #fff);appearance:none;padding:6px 12px;align-items:center;display:inline-flex;border-width:1px;border-color:transparent;border-radius:0;cursor:pointer;font-size:0.8em;border-radius:0 var(--presto-player-email-border-radius, 0) var(--presto-player-email-border-radius) 0}@media screen and (min-width: 700px){button{padding:10px 18px}}button:focus{box-shadow:white 0px 0px 0px 2px, var(--plyr-color-main, #000) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;z-index:1}button:focus,button:hover{outline:none}.rtl button{border-radius:var(--presto-player-email-border-radius, 0) 0 0 var(--presto-player-email-border-radius)}h1{font-size:1.5em;font-weight:500;margin:0 0 22px 0;max-width:600px;line-height:1.1em}h1.is-small{margin-bottom:1em;font-size:1.1em}.skip{font-size:0.8em;font-weight:600;position:absolute;top:0;right:0;padding:4%;cursor:pointer}p{font-size:0.7em;margin:0;margin-top:1.5em}p.is-small{font-size:0.9em;margin-top:1em}';let L=class{constructor(r){t(this,r)}render(){return r(o,null,r("slot",null))}};L.style='.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid{border-radius:2px;padding:3% 5%;max-width:135px;max-height:90px;box-sizing:content-box;position:absolute !important;top:50% !important;opacity:100%}.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid svg{height:31px;width:37px}.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid:hover,.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid:focus{opacity:0.8;background:var(--plyr-color-main)}.skin-modern.presto-player__wrapper.caption-style-full .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 9px) * -4))}.skin-modern.presto-player__wrapper .plyr--video .plyr__controls{padding:0px}.skin-modern.presto-player__wrapper .plyr--video .plyr__controls::before{content:"";background:var(--plyr-color-main);position:absolute;top:0;left:0;right:0;bottom:0;opacity:0.75}.skin-modern.presto-player__wrapper .plyr__controls__item{z-index:1}.skin-modern.presto-player__wrapper .plyr__controls__item.plyr__control:not(.presto-player-progress__marker):not([role*=menuitem]):not(.plyr__control--back){height:36px;border-radius:0px}.skin-modern.presto-player__wrapper .plyr__controls__item.plyr__control:not(.presto-player-progress__marker):not([role*=menuitem]):not(.plyr__control--back):focus{background-color:transparent;color:white}.skin-modern.presto-player__wrapper .plyr__controls__item.presto-player-progress__marker{z-index:2}.skin-modern.presto-player__wrapper .plyr__controls__item.plyr__menu{height:36px}.skin-modern.presto-player__wrapper .plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{height:2px;color:white}.skin-modern.presto-player__wrapper .presto-player__wrapper .plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{height:2px}.skin-modern.presto-player__wrapper .plyr--video .plyr__progress__buffer{height:2px;top:11px}.skin-modern.presto-player__wrapper .plyr__progress input[type=range]{cursor:pointer}.skin-modern.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-thumb{top:1px;height:var(--plyr-range-thumb-height, 8px);width:var(--plyr-range-thumb-height, 8px);box-shadow:0px 0px 5px white}.skin-modern.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.5)}.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item{margin:0px}.skin-modern.presto-player__wrapper .plyr__volume{width:auto}.skin-modern.presto-player__wrapper .plyr__volume input[type=range]{width:55px}.skin-modern.presto-player__wrapper .plyr__volume input[type=range]{cursor:pointer}.skin-modern.presto-player__wrapper .presto-player__muted-overlay .plyr__control.plyr__control--overlaid{border-radius:2px}.skin-modern.presto-player__wrapper .presto-player__muted-overlay .plyr__control.plyr__control--overlaid svg{height:40px;width:50px}.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=rewind] svg,.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fast-forward] svg,.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen] svg{width:22px;height:22px}@media screen and (max-width: 480px){.skin-modern.presto-player__wrapper .plyr__control--overlaid svg{height:18px;width:16px}}';let R=class{constructor(r){t(this,r),this.playVideo=i(this,"playVideo",7)}render(){var t,e,i,o,n,a,s,l,p;return r("div",{class:"presto-player__muted-overlay",onClick:()=>{this.mutedPreview=!1,this.playVideo.emit()}},(null===(t=this.preset)||void 0===t?void 0:t["play-large"])&&r("div",{class:"plyr__control plyr__control--overlaid","data-plyr":"play","aria-label":"Play",part:"muted-overlay-play"},r("svg",{id:"plyr-play",viewBox:"0 0 18 18"},r("path",{d:"M15.562 8.1L3.87.225c-.818-.562-1.87 0-1.87.9v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"})),r("span",{class:"plyr__sr-only"},"Play")),(null===(e=this.mutedOverlay)||void 0===e?void 0:e.enabled)&&(null===(i=this.mutedOverlay)||void 0===i?void 0:i.src)?r("div",{class:"presto-player__overlay is-image",part:"muted-overlay-image",style:{width:`${(null===(o=this.mutedOverlay)||void 0===o?void 0:o.width)||50}%`,left:100*((null===(a=null===(n=this.mutedOverlay)||void 0===n?void 0:n.focalPoint)||void 0===a?void 0:a.x)||.5)+"%",top:100*((null===(l=null===(s=this.mutedOverlay)||void 0===s?void 0:s.focalPoint)||void 0===l?void 0:l.y)||.5)+"%"}},r("img",{src:null===(p=this.mutedOverlay)||void 0===p?void 0:p.src,style:{transform:"translateX(-50%) translateY(-50%)"}})):"")}};R.style=":host{display:block}";var N=["premium","referrerPolicy"];function B(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function D(t,r){for(var e=0;e<r.length;e++){var i=r[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function $(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function q(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,i)}return e}function V(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?q(Object(e),!0).forEach((function(r){$(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):q(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}var H={addCSS:!0,thumbWidth:15,watch:!0};function U(t,r){return function(){return Array.from(document.querySelectorAll(r)).includes(this)}.call(t,r)}var Q=function(t){return null!=t?t.constructor:null},Y=function(t,r){return!!(t&&r&&t instanceof r)},W=function(t){return Q(t)===String},J=function(t){return Array.isArray(t)},G=function(t){return Y(t,NodeList)},K=W,X=J,Z=G,tt=function(t){return Y(t,Element)},rt=function(t){return Y(t,Event)},et=function(t){return function(t){return null==t}(t)||(W(t)||J(t)||G(t))&&!t.length||function(t){return Q(t)===Object}(t)&&!Object.keys(t).length};var it,ot,nt,at=function(){function t(r,e){(function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),tt(r)?this.element=r:K(r)&&(this.element=document.querySelector(r)),tt(this.element)&&et(this.element.rangeTouch)&&(this.config=V({},H,{},e),this.init())}return function(t,r,e){r&&D(t.prototype,r),e&&D(t,e)}(t,[{key:"init",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(t){var r=this,e=t?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(t){r.element[e](t,(function(t){return r.set(t)}),!1)}))}},{key:"get",value:function(r){if(!t.enabled||!rt(r))return null;var e,i=r.target,o=r.changedTouches[0],n=parseFloat(i.getAttribute("min"))||0,a=parseFloat(i.getAttribute("max"))||100,s=parseFloat(i.getAttribute("step"))||1,l=i.getBoundingClientRect(),p=100/l.width*(this.config.thumbWidth/2)/100;return 0>(e=100/l.width*(o.clientX-l.left))?e=0:100<e&&(e=100),50>e?e-=(100-2*e)*p:50<e&&(e+=2*(e-50)*p),n+function(t,r){if(1>r){var e=function(t){var r="".concat(t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return r?Math.max(0,(r[1]?r[1].length:0)-(r[2]?+r[2]:0)):0}(r);return parseFloat(t.toFixed(e))}return Math.round(t/r)*r}(e/100*(a-n),s)}},{key:"set",value:function(r){t.enabled&&rt(r)&&!r.target.disabled&&(r.preventDefault(),r.target.value=this.get(r),function(t,r){if(t&&r){var e=new Event(r,{bubbles:!0});t.dispatchEvent(e)}}(r.target,"touchend"===r.type?"change":"input"))}}],[{key:"setup",value:function(r){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=null;if(et(r)||K(r)?i=Array.from(document.querySelectorAll(K(r)?r:'input[type="range"]')):tt(r)?i=[r]:Z(r)?i=Array.from(r):X(r)&&(i=r.filter(tt)),et(i))return null;var o=V({},H,{},e);if(K(r)&&o.watch){var n=new MutationObserver((function(e){Array.from(e).forEach((function(e){Array.from(e.addedNodes).forEach((function(e){tt(e)&&U(e,r)&&new t(e,o)}))}))}));n.observe(document.body,{childList:!0,subtree:!0})}return i.map((function(r){return new t(r,e)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),t}(),st=function(t){return null!=t?t.constructor:null},lt=function(t,r){return Boolean(t&&r&&t instanceof r)},pt=function(t){return null==t},ut=function(t){return st(t)===Object},dt=function(t){return st(t)===String},ct=function(t){return st(t)===Function},ht=function(t){return Array.isArray(t)},yt=function(t){return lt(t,NodeList)},vt=function(t){return pt(t)||(dt(t)||ht(t)||yt(t))&&!t.length||ut(t)&&!Object.keys(t).length},ft=pt,_t=ut,gt=function(t){return st(t)===Number&&!Number.isNaN(t)},mt=dt,bt=function(t){return st(t)===Boolean},wt=ct,kt=ht,xt=yt,zt=function(t){return null!==t&&"object"==p(t)&&1===t.nodeType&&"object"==p(t.style)&&"object"==p(t.ownerDocument)},jt=function(t){return lt(t,Event)},Tt=function(t){return lt(t,KeyboardEvent)},St=function(t){return lt(t,TextTrack)||!pt(t)&&dt(t.kind)},Ct=function(t){if(lt(t,window.URL))return!0;if(!dt(t))return!1;var r=t;t.startsWith("http://")&&t.startsWith("https://")||(r="http://".concat(t));try{return!vt(new URL(r).hostname)}catch(t){return!1}},Pt=vt,Ot=(it=document.createElement("span"),ot={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},nt=Object.keys(ot).find((function(t){return void 0!==it.style[t]})),!!mt(nt)&&ot[nt]);function At(t,r){setTimeout((function(){try{t.hidden=!0,t.hidden=!1}catch(t){}}),r)}var It={isIE:Boolean(window.document.documentMode),isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||/(iPad|iPhone|iPod)/gi.test(navigator.platform)};function Mt(t,r){return r.split(".").reduce((function(t,r){return t&&t[r]}),t)}function Et(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length,e=new Array(r>1?r-1:0),i=1;i<r;i++)e[i-1]=arguments[i];if(!e.length)return t;var o=e.shift();return _t(o)?(Object.keys(o).forEach((function(r){_t(o[r])?(Object.keys(t).includes(r)||Object.assign(t,s({},r,{})),Et(t[r],o[r])):Object.assign(t,s({},r,o[r]))})),Et.apply(void 0,[t].concat(e))):t}function Ft(t,r){Array.from(t.length?t:[t]).reverse().forEach((function(t,e){var i=e>0?r.cloneNode(!0):r,o=t.parentNode,n=t.nextSibling;i.appendChild(t),n?o.insertBefore(i,n):o.appendChild(i)}))}function Lt(t,r){zt(t)&&!Pt(r)&&Object.entries(r).filter((function(t){var r=n(t,2);return!ft(r[1])})).forEach((function(r){var e=n(r,2);return t.setAttribute(e[0],e[1])}))}function Rt(t,r,e){var i=document.createElement(t);return _t(r)&&Lt(i,r),mt(e)&&(i.innerText=e),i}function Nt(t,r,e,i){zt(r)&&r.appendChild(Rt(t,e,i))}function Bt(t){xt(t)||kt(t)?Array.from(t).forEach(Bt):zt(t)&&zt(t.parentNode)&&t.parentNode.removeChild(t)}function Dt(t){if(zt(t))for(var r=t.childNodes.length;r>0;)t.removeChild(t.lastChild),r-=1}function $t(t,r){return zt(r)&&zt(r.parentNode)&&zt(t)?(r.parentNode.replaceChild(t,r),t):null}function qt(t,r){if(!mt(t)||Pt(t))return{};var e={},i=Et({},r);return t.split(",").forEach((function(t){var r=t.trim(),o=r.replace(".",""),a=r.replace(/[[\]]/g,"").split("="),s=n(a,1)[0],l=a.length>1?a[1].replace(/["']/g,""):"";switch(r.charAt(0)){case".":e.class=mt(i.class)?"".concat(i.class," ").concat(o):o;break;case"#":e.id=r.replace("#","");break;case"[":e[s]=l}})),Et(i,e)}function Vt(t,r){if(zt(t)){var e=r;bt(e)||(e=!t.hidden),t.hidden=e}}function Ht(t,r,e){if(xt(t))return Array.from(t).map((function(t){return Ht(t,r,e)}));if(zt(t)){var i="toggle";return void 0!==e&&(i=e?"add":"remove"),t.classList[i](r),t.classList.contains(r)}return!1}function Ut(t,r){return zt(t)&&t.classList.contains(r)}function Qt(t,r){var e=Element.prototype;return(e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||function(){return Array.from(document.querySelectorAll(r)).includes(this)}).call(t,r)}function Yt(t){return this.elements.container.querySelectorAll(t)}function Wt(t){return this.elements.container.querySelector(t)}function Jt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];zt(t)&&(t.focus({preventScroll:!0}),r&&Ht(t,this.config.classNames.tabFocus))}var Gt={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Kt={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(t,r,e){var i=Kt[t]||"html5"!==r;return{api:i,ui:i&&Kt.rangeInput&&("video"!==t||!It.isIPhone||It.isIPhone&&e&&Kt.playsinline)}},pip:!(It.isIPhone||!wt(Rt("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||Rt("video").disablePictureInPicture)),airplay:wt(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(t){if(Pt(t))return!1;var r=t.split("/"),e=n(r,1),i=t;if(!this.isHTML5||e[0]!==this.type)return!1;Object.keys(Gt).includes(i)&&(i+='; codecs="'.concat(Gt[t],'"'));try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(t){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:function(){var t=document.createElement("input");return t.type="range","range"===t.type}(),touch:"ontouchstart"in document.documentElement,transitions:!1!==Ot,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Xt=function(){var t=!1;try{var r=Object.defineProperty({},"passive",{get:function(){return t=!0,null}});window.addEventListener("test",null,r),window.removeEventListener("test",null,r)}catch(t){}return t}();function Zt(t,r,e){var i=this,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t&&"addEventListener"in t&&!Pt(r)&&wt(e)){var s=r.split(" "),l=a;Xt&&(l={passive:n,capture:a}),s.forEach((function(r){i&&i.eventListeners&&o&&i.eventListeners.push({element:t,type:r,callback:e,options:l}),t[o?"addEventListener":"removeEventListener"](r,e,l)}))}}function tr(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Zt.call(this,t,r,e,!0,i,o)}function rr(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Zt.call(this,t,r,e,!1,i,o)}function er(t){var r=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=function a(){for(var s=arguments.length,l=new Array(s),p=0;p<s;p++)l[p]=arguments[p];rr(t,e,a,o,n),i.apply(r,l)};Zt.call(this,t,e,a,!0,o,n)}function ir(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(zt(t)&&!Pt(r)){var o=new CustomEvent(r,{bubbles:e,detail:a(a({},i),{},{plyr:this})});t.dispatchEvent(o)}}function or(){this&&this.eventListeners&&(this.eventListeners.forEach((function(t){t.element.removeEventListener(t.type,t.callback,t.options)})),this.eventListeners=[])}function nr(){var t=this;return new Promise((function(r){return t.ready?setTimeout(r,0):tr.call(t,t.elements.container,"ready",r)})).then((function(){}))}function ar(t){(function(t){return lt(t,Promise)&&ct(t.then)})(t)&&t.then(null,(function(){}))}function sr(t){return kt(t)?t.filter((function(r,e){return t.indexOf(r)===e})):t}function lr(t,r){return kt(t)&&t.length?t.reduce((function(t,e){return Math.abs(e-r)<Math.abs(t-r)?e:t})):null}function pr(t){return!(!window||!window.CSS)&&window.CSS.supports(t)}var ur=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((function(t,r){var e=n(r,2),i=e[0],o=e[1];return a(a({},t),{},s({},i/o,[i,o]))}),{});function dr(t){return!!(kt(t)||mt(t)&&t.includes(":"))&&(kt(t)?t:t.split(":")).map(Number).every(gt)}function cr(t){if(!kt(t)||!t.every(gt))return null;var r=n(t,2),e=r[0],i=r[1],o=function t(r,e){return 0===e?r:t(e,r%e)}(e,i);return[e/o,i/o]}function hr(t){var r=function(t){return dr(t)?t.split(":").map(Number):null},e=r(t);if(null===e&&(e=r(this.config.ratio)),null===e&&!Pt(this.embed)&&kt(this.embed.ratio)&&(e=this.embed.ratio),null===e&&this.isHTML5){var i=this.media;e=[i.videoWidth,i.videoHeight]}return cr(e)}function yr(t){if(!this.isVideo)return{};var r=this.elements.wrapper,e=hr.call(this,t);if(!kt(e))return{};var i=cr(e),o=n(i,2),a=o[0],s=o[1],l=100/a*s;if(pr("aspect-ratio: ".concat(a,"/").concat(s))?r.style.aspectRatio="".concat(a,"/").concat(s):r.style.paddingBottom="".concat(l,"%"),this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){var p=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),u=(p-l)/(p/50);this.fullscreen.active?r.style.paddingBottom=null:this.media.style.transform="translateY(-".concat(u,"%)")}else this.isHTML5&&r.classList.add(this.config.classNames.videoFixedRatio);return{padding:l,ratio:e}}function vr(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.05,i=t/r,o=lr(Object.keys(ur),i);return Math.abs(o-i)<=e?ur[o]:[t,r]}var fr={getSources:function(){var t=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((function(r){var e=r.getAttribute("type");return!!Pt(e)||Kt.mime.call(t,e)})):[]},getQualityOptions:function(){return this.config.quality.forced?this.config.quality.options:fr.getSources.call(this).map((function(t){return Number(t.getAttribute("size"))})).filter(Boolean)},setup:function(){if(this.isHTML5){var t=this;t.options.speed=t.config.speed.options,Pt(this.config.ratio)||yr.call(t),Object.defineProperty(t.media,"quality",{get:function(){var r=fr.getSources.call(t).find((function(r){return r.getAttribute("src")===t.source}));return r&&Number(r.getAttribute("size"))},set:function(r){if(t.quality!==r){if(t.config.quality.forced&&wt(t.config.quality.onChange))t.config.quality.onChange(r);else{var e=fr.getSources.call(t).find((function(t){return Number(t.getAttribute("size"))===r}));if(!e)return;var i=t.media,o=i.currentTime,n=i.paused,a=i.preload,s=i.readyState,l=i.playbackRate;t.media.src=e.getAttribute("src"),("none"!==a||s)&&(t.once("loadedmetadata",(function(){t.speed=l,t.currentTime=o,n||ar(t.play())})),t.media.load())}ir.call(t,t.media,"qualitychange",!1,{quality:r})}}})}},cancelRequests:function(){this.isHTML5&&(Bt(fr.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function _r(t){return"".concat(t,"-").concat(Math.floor(1e4*Math.random()))}function gr(t){for(var r=arguments.length,e=new Array(r>1?r-1:0),i=1;i<r;i++)e[i-1]=arguments[i];return Pt(t)?t:t.toString().replace(/{(\d+)}/g,(function(t,r){return e[r].toString()}))}var mr=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.replace(new RegExp(r.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),e.toString())},br=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.toString().replace(/\w\S*/g,(function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}))};function wr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=t.toString();return r=mr(r,"-"," "),r=mr(r,"_"," "),r=br(r),mr(r," ","")}function kr(t){var r=document.createElement("div");return r.appendChild(t),r.innerHTML}var xr={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},zr=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Pt(t)||Pt(r))return"";var e=Mt(r.i18n,t);if(Pt(e))return Object.keys(xr).includes(t)?xr[t]:"";var i={"{seektime}":r.seekTime,"{title}":r.title};return Object.entries(i).forEach((function(t){var r=n(t,2);e=mr(e,r[0],r[1])})),e},jr=function(){function t(r){var e=this;u(this,t),B(this,"get",(function(r){if(!t.supported||!e.enabled)return null;var i=window.localStorage.getItem(e.key);if(Pt(i))return null;var o=JSON.parse(i);return mt(r)&&r.length?o[r]:o})),B(this,"set",(function(r){if(t.supported&&e.enabled&&_t(r)){var i=e.get();Pt(i)&&(i={}),Et(i,r);try{window.localStorage.setItem(e.key,JSON.stringify(i))}catch(r){}}})),this.enabled=r.config.storage.enabled,this.key=r.config.storage.key}return l(t,null,[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;var t="___test";return window.localStorage.setItem(t,t),window.localStorage.removeItem(t),!0}catch(t){return!1}}}]),t}();function Tr(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise((function(e,i){try{var o=new XMLHttpRequest;if(!("withCredentials"in o))return;o.addEventListener("load",(function(){if("text"===r)try{e(JSON.parse(o.responseText))}catch(t){e(o.responseText)}else e(o.response)})),o.addEventListener("error",(function(){throw new Error(o.status)})),o.open("GET",t,!0),o.responseType=r,o.send()}catch(t){i(t)}}))}function Sr(t,r){if(mt(t)){var e=mt(r),i=function(){return null!==document.getElementById(r)},o=function(t,r){t.innerHTML=r,e&&i()||document.body.insertAdjacentElement("afterbegin",t)};if(!e||!i()){var n=jr.supported,a=document.createElement("div");if(a.setAttribute("hidden",""),e&&a.setAttribute("id",r),n){var s=window.localStorage.getItem("cache-".concat(r));if(null!==s){var l=JSON.parse(s);o(a,l.content)}}Tr(t).then((function(t){if(!Pt(t)){if(n)try{window.localStorage.setItem("cache-".concat(r),JSON.stringify({content:t}))}catch(t){}o(a,t)}})).catch((function(){}))}}}var Cr=function(t){return Math.trunc(t/60/60%60,10)},Pr=function(t){return Math.trunc(t%60,10)};function Or(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!gt(t))return Or(void 0,r,e);var i,o=function(t){return"0".concat(t).slice(-2)},n=Cr(t),a=(i=t,Math.trunc(i/60%60,10)),s=Pr(t);return n=r||n>0?"".concat(n,":"):"","".concat(e&&t>0?"-":"").concat(n).concat(o(a),":").concat(o(s))}var Ar={getIconUrl:function(){var t=new URL(this.config.iconUrl,window.location),r=window.location.host?window.location.host:window.top.location.host,e=t.host!==r||It.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=Wt.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:Yt.call(this,this.config.selectors.buttons.play),pause:Wt.call(this,this.config.selectors.buttons.pause),restart:Wt.call(this,this.config.selectors.buttons.restart),rewind:Wt.call(this,this.config.selectors.buttons.rewind),fastForward:Wt.call(this,this.config.selectors.buttons.fastForward),mute:Wt.call(this,this.config.selectors.buttons.mute),pip:Wt.call(this,this.config.selectors.buttons.pip),airplay:Wt.call(this,this.config.selectors.buttons.airplay),settings:Wt.call(this,this.config.selectors.buttons.settings),captions:Wt.call(this,this.config.selectors.buttons.captions),fullscreen:Wt.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=Wt.call(this,this.config.selectors.progress),this.elements.inputs={seek:Wt.call(this,this.config.selectors.inputs.seek),volume:Wt.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:Wt.call(this,this.config.selectors.display.buffer),currentTime:Wt.call(this,this.config.selectors.display.currentTime),duration:Wt.call(this,this.config.selectors.display.duration)},zt(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip))),!0}catch(t){return this.debug.warn("It looks like there is a problem with your custom controls HTML",t),this.toggleNativeControls(!0),!1}},createIcon:function(t,r){var e="http://www.w3.org/2000/svg",i=Ar.getIconUrl.call(this),o="".concat(i.cors?"":i.url,"#").concat(this.config.iconPrefix),n=document.createElementNS(e,"svg");Lt(n,Et(r,{"aria-hidden":"true",focusable:"false"}));var a=document.createElementNS(e,"use"),s="".concat(o,"-").concat(t);return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",s),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.appendChild(a),n},createLabel:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=zr(t,this.config);return Rt("span",a(a({},r),{},{class:[r.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),e)},createBadge:function(t){if(Pt(t))return null;var r=Rt("span",{class:this.config.classNames.menu.value});return r.appendChild(Rt("span",{class:this.config.classNames.menu.badge},t)),r},createButton:function(t,r){var e=this,i=Et({},r),o=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(t=wr(t)).charAt(0).toLowerCase()+t.slice(1)}(t),n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((function(t){Object.keys(i).includes(t)&&(n[t]=i[t],delete i[t])})),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((function(t){return t===e.config.classNames.control}))||Et(i,{class:"".concat(i.class," ").concat(this.config.classNames.control)}):i.class=this.config.classNames.control,t){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=" ".concat(this.config.classNames.control,"--overlaid"),o="play",n.label="play",n.icon="play";break;default:Pt(n.label)&&(n.label=o),Pt(n.icon)&&(n.icon=t)}var a=Rt(n.element);return n.toggle?(a.appendChild(Ar.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(Ar.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(Ar.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(Ar.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(Ar.createIcon.call(this,n.icon)),a.appendChild(Ar.createLabel.call(this,n.label))),Et(i,qt(this.config.selectors.buttons[o],i)),Lt(a,i),"play"===o?(kt(this.elements.buttons[o])||(this.elements.buttons[o]=[]),this.elements.buttons[o].push(a)):this.elements.buttons[o]=a,a},createRange:function(t,r){var e=Rt("input",Et(qt(this.config.selectors.inputs[t]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":zr(t,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},r));return this.elements.inputs[t]=e,Ar.updateRangeFill.call(this,e),at.setup(e),e},createProgress:function(t,r){var e=Rt("progress",Et(qt(this.config.selectors.display[t]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},r));if("volume"!==t){e.appendChild(Rt("span",null,"0"));var i={played:"played",buffer:"buffered"}[t],o=i?zr(i,this.config):"";e.innerText="% ".concat(o.toLowerCase())}return this.elements.display[t]=e,e},createTime:function(t,r){var e=qt(this.config.selectors.display[t],r),i=Rt("div",Et(e,{class:"".concat(e.class?e.class:""," ").concat(this.config.classNames.display.time," ").trim(),"aria-label":zr(t,this.config)}),"00:00");return this.elements.display[t]=i,i},bindMenuItemShortcuts:function(t,r){var e=this;tr.call(this,t,"keydown keyup",(function(i){if([32,38,39,40].includes(i.which)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var o,n=Qt(t,'[role="menuitemradio"]');!n&&[32,39].includes(i.which)?Ar.showMenuPanel.call(e,r,!0):32!==i.which&&(40===i.which||n&&39===i.which?zt(o=t.nextElementSibling)||(o=t.parentNode.firstElementChild):zt(o=t.previousElementSibling)||(o=t.parentNode.lastElementChild),Jt.call(e,o,!0))}}),!1),tr.call(this,t,"keyup",(function(t){13===t.which&&Ar.focusFirstMenuItem.call(e,null,!0)}))},createMenuItem:function(t){var r=this,e=t.value,i=t.list,o=t.type,n=t.title,a=t.badge,s=void 0===a?null:a,l=t.checked,p=void 0!==l&&l,u=qt(this.config.selectors.inputs[o]),d=Rt("button",Et(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":p,value:e})),c=Rt("span");c.innerHTML=n,zt(s)&&c.appendChild(s),d.appendChild(c),Object.defineProperty(d,"checked",{enumerable:!0,get:function(){return"true"===d.getAttribute("aria-checked")},set:function(t){t&&Array.from(d.parentNode.children).filter((function(t){return Qt(t,'[role="menuitemradio"]')})).forEach((function(t){return t.setAttribute("aria-checked","false")})),d.setAttribute("aria-checked",t?"true":"false")}}),this.listeners.bind(d,"click keyup",(function(t){if(!Tt(t)||32===t.which){switch(t.preventDefault(),t.stopPropagation(),d.checked=!0,o){case"language":r.currentTrack=Number(e);break;case"quality":r.quality=e;break;case"speed":r.speed=parseFloat(e)}Ar.showMenuPanel.call(r,"home",Tt(t))}}),o,!1),Ar.bindMenuItemShortcuts.call(this,d,o),i.appendChild(d)},formatTime:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return gt(t)?Or(t,Cr(this.duration)>0,r):t},updateTimeDisplay:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];zt(t)&>(r)&&(t.innerText=Ar.formatTime(r,e))},updateVolume:function(){this.supported.ui&&(zt(this.elements.inputs.volume)&&Ar.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),zt(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;zt(t)&&(t.value=r,Ar.updateRangeFill.call(this,t))},updateProgress:function(t){var r=this;if(this.supported.ui&&jt(t)){var e=0;if(t)switch(t.type){case"timeupdate":case"seeking":case"seeked":e=function(t,r){return 0===t||0===r||Number.isNaN(t)||Number.isNaN(r)?0:(t/r*100).toFixed(2)}(this.currentTime,this.duration),"timeupdate"===t.type&&Ar.setRange.call(this,this.elements.inputs.seek,e);break;case"playing":case"progress":!function(t,e){var i=gt(e)?e:0,o=zt(t)?t:r.elements.display.buffer;if(zt(o)){o.value=i;var n=o.getElementsByTagName("span")[0];zt(n)&&(n.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(t){var r=jt(t)?t.target:t;if(zt(r)&&"range"===r.getAttribute("type")){if(Qt(r,this.config.selectors.inputs.seek)){r.setAttribute("aria-valuenow",this.currentTime);var e=Ar.formatTime(this.currentTime),i=Ar.formatTime(this.duration),o=zr("seekLabel",this.config);r.setAttribute("aria-valuetext",o.replace("{currentTime}",e).replace("{duration}",i))}else if(Qt(r,this.config.selectors.inputs.volume)){var n=100*r.value;r.setAttribute("aria-valuenow",n),r.setAttribute("aria-valuetext","".concat(n.toFixed(1),"%"))}else r.setAttribute("aria-valuenow",r.value);It.isWebkit&&r.style.setProperty("--value",r.value/r.max*100+"%")}},updateSeekTooltip:function(t){var r=this;if(this.config.tooltips.seek&&zt(this.elements.inputs.seek)&&zt(this.elements.display.seekTooltip)&&0!==this.duration){var e="".concat(this.config.classNames.tooltip,"--visible"),i=function(t){return Ht(r.elements.display.seekTooltip,e,t)};if(this.touch)i(!1);else{var o=0,n=this.elements.progress.getBoundingClientRect();if(jt(t))o=100/n.width*(t.pageX-n.left);else{if(!Ut(this.elements.display.seekTooltip,e))return;o=parseFloat(this.elements.display.seekTooltip.style.left,10)}o<0?o=0:o>100&&(o=100),Ar.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*o),this.elements.display.seekTooltip.style.left="".concat(o,"%"),jt(t)&&["mouseenter","mouseleave"].includes(t.type)&&i("mouseenter"===t.type)}}},timeUpdate:function(t){var r=!zt(this.elements.display.duration)&&this.config.invertTime;Ar.updateTimeDisplay.call(this,this.elements.display.currentTime,r?this.duration-this.currentTime:this.currentTime,r),t&&"timeupdate"===t.type&&this.media.seeking||Ar.updateProgress.call(this,t)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return Vt(this.elements.display.currentTime,!0),void Vt(this.elements.progress,!0);zt(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var t=zt(this.elements.display.duration);!t&&this.config.displayDuration&&this.paused&&Ar.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),t&&Ar.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),Ar.updateSeekTooltip.call(this)}},toggleMenuButton:function(t,r){Vt(this.elements.settings.buttons[t],!r)},updateSetting:function(t,r,e){var i=this.elements.settings.panels[t],o=null,n=r;if("captions"===t)o=this.currentTrack;else{if(o=Pt(e)?this[t]:e,Pt(o)&&(o=this.config[t].default),!Pt(this.options[t])&&!this.options[t].includes(o))return void this.debug.warn("Unsupported value of '".concat(o,"' for ").concat(t));if(!this.config[t].options.includes(o))return void this.debug.warn("Disabled value of '".concat(o,"' for ").concat(t))}if(zt(n)||(n=i&&i.querySelector('[role="menu"]')),zt(n)){this.elements.settings.buttons[t].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=Ar.getLabel.call(this,t,o);var a=n&&n.querySelector('[value="'.concat(o,'"]'));zt(a)&&(a.checked=!0)}},getLabel:function(t,r){switch(t){case"speed":return 1===r?zr("normal",this.config):"".concat(r,"×");case"quality":if(gt(r)){if(0===r)return zr("auto",this.config);var e=zr("qualityLabel.".concat(r),this.config);return e.length?e:"".concat(r,"p")}return br(r);case"captions":return Er.getLabel.call(this);default:return null}},setQualityMenu:function(t){var r=this;if(zt(this.elements.settings.panels.quality)){var e="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');kt(t)&&(this.options.quality=sr(t).filter((function(t){return r.config.quality.options.includes(t)})));var o=!Pt(this.options.quality)&&this.options.quality.length>1;if(Ar.toggleMenuButton.call(this,e,o),Dt(i),Ar.checkMenu.call(this),o){var n=function(t){var e=zr("qualityBadge.".concat(t),r.config);return e.length?Ar.createBadge.call(r,e):null};this.options.quality.sort((function(t,e){var i=r.config.quality.options;return i.indexOf(t)>i.indexOf(e)?1:-1})).forEach((function(t){Ar.createMenuItem.call(r,{value:t,list:i,type:e,title:Ar.getLabel.call(r,"quality",t),badge:n(t)})})),Ar.updateSetting.call(this,e,i)}}},setCaptionsMenu:function(){var t=this;if(zt(this.elements.settings.panels.captions)){var r="captions",e=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=Er.getTracks.call(this),o=Boolean(i.length);if(Ar.toggleMenuButton.call(this,r,o),Dt(e),Ar.checkMenu.call(this),o){var n=i.map((function(r,i){return{value:i,checked:t.captions.toggled&&t.currentTrack===i,title:Er.getLabel.call(t,r),badge:r.language&&Ar.createBadge.call(t,r.language.toUpperCase()),list:e,type:"language"}}));n.unshift({value:-1,checked:!this.captions.toggled,title:zr("disabled",this.config),list:e,type:"language"}),n.forEach(Ar.createMenuItem.bind(this)),Ar.updateSetting.call(this,r,e)}}},setSpeedMenu:function(){var t=this;if(zt(this.elements.settings.panels.speed)){var r="speed",e=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((function(r){return r>=t.minimumSpeed&&r<=t.maximumSpeed}));var i=!Pt(this.options.speed)&&this.options.speed.length>1;Ar.toggleMenuButton.call(this,r,i),Dt(e),Ar.checkMenu.call(this),i&&(this.options.speed.forEach((function(i){Ar.createMenuItem.call(t,{value:i,list:e,type:r,title:Ar.getLabel.call(t,"speed",i)})})),Ar.updateSetting.call(this,r,e))}},checkMenu:function(){var t=this.elements.settings.buttons,r=!Pt(t)&&Object.values(t).some((function(t){return!t.hidden}));Vt(this.elements.settings.menu,!r)},focusFirstMenuItem:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var e=t;zt(e)||(e=Object.values(this.elements.settings.panels).find((function(t){return!t.hidden})));var i=e.querySelector('[role^="menuitem"]');Jt.call(this,i,r)}},toggleMenu:function(t){var r=this.elements.settings.popup,e=this.elements.buttons.settings;if(zt(r)&&zt(e)){var i=r.hidden,o=i;if(bt(t))o=t;else if(Tt(t)&&27===t.which)o=!1;else if(jt(t)){var n=wt(t.composedPath)?t.composedPath()[0]:t.target,a=r.contains(n);if(a||!a&&t.target!==e&&o)return}e.setAttribute("aria-expanded",o),Vt(r,!o),Ht(this.elements.container,this.config.classNames.menu.open,o),o&&Tt(t)?Ar.focusFirstMenuItem.call(this,null,!0):o||i||Jt.call(this,e,Tt(t))}},getMenuSize:function(t){var r=t.cloneNode(!0);r.style.position="absolute",r.style.opacity=0,r.removeAttribute("hidden"),t.parentNode.appendChild(r);var e=r.scrollWidth,i=r.scrollHeight;return Bt(r),{width:e,height:i}},showMenuPanel:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.elements.container.querySelector("#plyr-settings-".concat(this.id,"-").concat(r));if(zt(i)){var o=i.parentNode,n=Array.from(o.children).find((function(t){return!t.hidden}));if(Kt.transitions&&!Kt.reducedMotion){o.style.width="".concat(n.scrollWidth,"px"),o.style.height="".concat(n.scrollHeight,"px");var a=Ar.getMenuSize.call(this,i),s=function r(e){e.target===o&&["width","height"].includes(e.propertyName)&&(o.style.width="",o.style.height="",rr.call(t,o,Ot,r))};tr.call(this,o,Ot,s),o.style.width="".concat(a.width,"px"),o.style.height="".concat(a.height,"px")}Vt(n,!0),Vt(i,!1),Ar.focusFirstMenuItem.call(this,i,e)}},setDownloadUrl:function(){var t=this.elements.buttons.download;zt(t)&&t.setAttribute("href",this.download)},create:function(t){var r=this,e=Ar.bindMenuItemShortcuts,i=Ar.createButton,o=Ar.createProgress,n=Ar.createRange,a=Ar.createTime,s=Ar.setQualityMenu,l=Ar.setSpeedMenu,p=Ar.showMenuPanel;this.elements.controls=null,kt(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));var u=Rt("div",qt(this.config.selectors.controls.wrapper));this.elements.controls=u;var d={class:"plyr__controls__item"};return sr(kt(this.config.controls)?this.config.controls:[]).forEach((function(s){if("restart"===s&&u.appendChild(i.call(r,"restart",d)),"rewind"===s&&u.appendChild(i.call(r,"rewind",d)),"play"===s&&u.appendChild(i.call(r,"play",d)),"fast-forward"===s&&u.appendChild(i.call(r,"fast-forward",d)),"progress"===s){var l=Rt("div",{class:"".concat(d.class," plyr__progress__container")}),c=Rt("div",qt(r.config.selectors.progress));if(c.appendChild(n.call(r,"seek",{id:"plyr-seek-".concat(t.id)})),c.appendChild(o.call(r,"buffer")),r.config.tooltips.seek){var h=Rt("span",{class:r.config.classNames.tooltip},"00:00");c.appendChild(h),r.elements.display.seekTooltip=h}r.elements.progress=c,l.appendChild(r.elements.progress),u.appendChild(l)}if("current-time"===s&&u.appendChild(a.call(r,"currentTime",d)),"duration"===s&&u.appendChild(a.call(r,"duration",d)),"mute"===s||"volume"===s){var y=r.elements.volume;zt(y)&&u.contains(y)||(y=Rt("div",Et({},d,{class:"".concat(d.class," plyr__volume").trim()})),r.elements.volume=y,u.appendChild(y)),"mute"===s&&y.appendChild(i.call(r,"mute")),"volume"!==s||It.isIos||y.appendChild(n.call(r,"volume",Et({max:1,step:.05,value:r.config.volume},{id:"plyr-volume-".concat(t.id)})))}if("captions"===s&&u.appendChild(i.call(r,"captions",d)),"settings"===s&&!Pt(r.config.settings)){var v=Rt("div",Et({},d,{class:"".concat(d.class," plyr__menu").trim(),hidden:""}));v.appendChild(i.call(r,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(t.id),"aria-expanded":!1}));var f=Rt("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(t.id),hidden:""}),_=Rt("div"),g=Rt("div",{id:"plyr-settings-".concat(t.id,"-home")}),m=Rt("div",{role:"menu"});g.appendChild(m),_.appendChild(g),r.elements.settings.panels.home=g,r.config.settings.forEach((function(i){var o=Rt("button",Et(qt(r.config.selectors.buttons.settings),{type:"button",class:"".concat(r.config.classNames.control," ").concat(r.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));e.call(r,o,i),tr.call(r,o,"click",(function(){p.call(r,i,!1)}));var n=Rt("span",null,zr(i,r.config)),a=Rt("span",{class:r.config.classNames.menu.value});a.innerHTML=t[i],n.appendChild(a),o.appendChild(n),m.appendChild(o);var s=Rt("div",{id:"plyr-settings-".concat(t.id,"-").concat(i),hidden:""}),l=Rt("button",{type:"button",class:"".concat(r.config.classNames.control," ").concat(r.config.classNames.control,"--back")});l.appendChild(Rt("span",{"aria-hidden":!0},zr(i,r.config))),l.appendChild(Rt("span",{class:r.config.classNames.hidden},zr("menuBack",r.config))),tr.call(r,s,"keydown",(function(t){37===t.which&&(t.preventDefault(),t.stopPropagation(),p.call(r,"home",!0))}),!1),tr.call(r,l,"click",(function(){p.call(r,"home",!1)})),s.appendChild(l),s.appendChild(Rt("div",{role:"menu"})),_.appendChild(s),r.elements.settings.buttons[i]=o,r.elements.settings.panels[i]=s})),f.appendChild(_),v.appendChild(f),u.appendChild(v),r.elements.settings.popup=f,r.elements.settings.menu=v}if("pip"===s&&Kt.pip&&u.appendChild(i.call(r,"pip",d)),"airplay"===s&&Kt.airplay&&u.appendChild(i.call(r,"airplay",d)),"download"===s){var b=Et({},d,{element:"a",href:r.download,target:"_blank"});r.isHTML5&&(b.download=""),!Ct(r.config.urls.download)&&r.isEmbed&&Et(b,{icon:"logo-".concat(r.provider),label:r.provider}),u.appendChild(i.call(r,"download",b))}"fullscreen"===s&&u.appendChild(i.call(r,"fullscreen",d))})),this.isHTML5&&s.call(this,fr.getQualityOptions.call(this)),l.call(this),u},inject:function(){var t=this;if(this.config.loadSprite){var r=Ar.getIconUrl.call(this);r.cors&&Sr(r.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var e=null;this.elements.controls=null;var i,o={id:this.id,seektime:this.config.seekTime,title:this.config.title},a=!0;if(wt(this.config.controls)&&(this.config.controls=this.config.controls.call(this,o)),this.config.controls||(this.config.controls=[]),zt(this.config.controls)||mt(this.config.controls)?e=this.config.controls:(e=Ar.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Er.getLabel.call(this)}),a=!1),a&&mt(this.config.controls)&&(e=function(t){var r=t;return Object.entries(o).forEach((function(t){var e=n(t,2),i=e[1];r=mr(r,"{".concat(e[0],"}"),i)})),r}(e)),mt(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),zt(i)||(i=this.elements.container),i[zt(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),zt(this.elements.controls)||Ar.findElements.call(this),!Pt(this.elements.buttons)){var s=function(r){var e=t.config.classNames.controlPressed;Object.defineProperty(r,"pressed",{enumerable:!0,get:function(){return Ut(r,e)},set:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Ht(r,e,t)}})};Object.values(this.elements.buttons).filter(Boolean).forEach((function(t){kt(t)||xt(t)?Array.from(t).filter(Boolean).forEach(s):s(t)}))}if(It.isEdge&&At(i),this.config.tooltips.controls){var l=this.config,p=l.classNames,u=l.selectors,d="".concat(u.controls.wrapper," ").concat(u.labels," .").concat(p.hidden),c=Yt.call(this,d);Array.from(c).forEach((function(r){Ht(r,t.config.classNames.hidden,!1),Ht(r,t.config.classNames.tooltip,!0)}))}}};function Ir(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=t;if(r){var i=document.createElement("a");i.href=e,e=i.href}try{return new URL(e)}catch(t){return null}}function Mr(t){var r=new URLSearchParams;return _t(t)&&Object.entries(t).forEach((function(t){var e=n(t,2);r.set(e[0],e[1])})),r}var Er={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!Kt.textTracks)kt(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ar.setCaptionsMenu.call(this);else{if(zt(this.elements.captions)||(this.elements.captions=Rt("div",qt(this.config.selectors.captions)),function(t,r){zt(t)&&zt(r)&&r.parentNode.insertBefore(t,r.nextSibling)}(this.elements.captions,this.elements.wrapper)),It.isIE&&window.URL){var t=this.media.querySelectorAll("track");Array.from(t).forEach((function(t){var r=t.getAttribute("src"),e=Ir(r);null!==e&&e.hostname!==window.location.href.hostname&&["http:","https:"].includes(e.protocol)&&Tr(r,"blob").then((function(r){t.setAttribute("src",window.URL.createObjectURL(r))})).catch((function(){Bt(t)}))}))}var r=sr((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((function(t){return t.split("-")[0]}))),e=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===e&&(e=n(r,1)[0]);var i=this.storage.get("captions");bt(i)||(i=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:i,language:e,languages:r}),this.isHTML5&&tr.call(this,this.media.textTracks,this.config.captions.update?"addtrack removetrack":"removetrack",Er.update.bind(this)),setTimeout(Er.update.bind(this),0)}},update:function(){var t=this,r=Er.getTracks.call(this,!0),e=this.captions,i=e.active,o=e.language,n=e.meta,a=e.currentTrackNode,s=Boolean(r.find((function(t){return t.language===o})));this.isHTML5&&this.isVideo&&r.filter((function(t){return!n.get(t)})).forEach((function(r){t.debug.log("Track added",r),n.set(r,{default:"showing"===r.mode}),"showing"===r.mode&&(r.mode="hidden"),tr.call(t,r,"cuechange",(function(){return Er.updateCues.call(t)}))})),(s&&this.language!==o||!r.includes(a))&&(Er.setLanguage.call(this,o),Er.toggle.call(this,i&&s)),this.elements&&Ht(this.elements.container,this.config.classNames.captions.enabled,!Pt(r)),kt(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ar.setCaptionsMenu.call(this)},toggle:function(t){var r=this,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var i=this.captions.toggled,o=this.config.classNames.captions.active,n=ft(t)?!i:t;if(n!==i){if(e||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!e){var a=Er.getTracks.call(this),s=Er.findTrack.call(this,[this.captions.language].concat(d(this.captions.languages)),!0);return this.captions.language=s.language,void Er.set.call(this,a.indexOf(s))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),Ht(this.elements.container,o,n),this.captions.toggled=n,Ar.updateSetting.call(this,"captions"),ir.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout((function(){n&&r.captions.toggled&&r.captions.currentTrackNode&&(r.captions.currentTrackNode.mode="hidden")}))}},set:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=Er.getTracks.call(this);if(-1!==t)if(gt(t))if(t in e){if(this.captions.currentTrack!==t){this.captions.currentTrack=t;var i=e[t],o=i||{},n=o.language;this.captions.currentTrackNode=i,Ar.updateSetting.call(this,"captions"),r||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),ir.call(this,this.media,"languagechange")}Er.toggle.call(this,!0,r),this.isHTML5&&this.isVideo&&Er.updateCues.call(this)}else this.debug.warn("Track not found",t);else this.debug.warn("Invalid caption argument",t);else Er.toggle.call(this,!1,r)},setLanguage:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(mt(t)){var e=t.toLowerCase();this.captions.language=e;var i=Er.getTracks.call(this),o=Er.findTrack.call(this,[e]);Er.set.call(this,i.indexOf(o),r)}else this.debug.warn("Invalid language argument",t)},getTracks:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Array.from((this.media||{}).textTracks||[]).filter((function(e){return!t.isHTML5||r||t.captions.meta.has(e)})).filter((function(t){return["captions","subtitles"].includes(t.kind)}))},findTrack:function(t){var r,e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=Er.getTracks.call(this),n=function(t){return Number((e.captions.meta.get(t)||{}).default)},a=Array.from(o).sort((function(t,r){return n(r)-n(t)}));return t.every((function(t){return!(r=a.find((function(r){return r.language===t})))})),r||(i?a[0]:void 0)},getCurrentTrack:function(){return Er.getTracks.call(this)[this.currentTrack]},getLabel:function(t){var r=t;return!St(r)&&Kt.textTracks&&this.captions.toggled&&(r=Er.getCurrentTrack.call(this)),St(r)?Pt(r.label)?Pt(r.language)?zr("enabled",this.config):t.language.toUpperCase():r.label:zr("disabled",this.config)},updateCues:function(t){if(this.supported.ui)if(zt(this.elements.captions))if(ft(t)||Array.isArray(t)){var r=t;if(!r){var e=Er.getCurrentTrack.call(this);r=Array.from((e||{}).activeCues||[]).map((function(t){return t.getCueAsHTML()})).map(kr)}var i=r.map((function(t){return t.trim()})).join("\n");if(i!==this.elements.captions.innerHTML){Dt(this.elements.captions);var o=Rt("span",qt(this.config.selectors.caption));o.innerHTML=i,this.elements.captions.appendChild(o),ir.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",t);else this.debug.warn("No captions element to render to")}},Fr={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.6.9/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"},auto:"AUTO"},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1}},Lr={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Rr=function(){},Nr=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u(this,t),this.enabled=window.console&&r,this.enabled&&this.log("Debugging enabled")}return l(t,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):Rr}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):Rr}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):Rr}}]),t}(),Br=function(){function t(r){var e=this;u(this,t),B(this,"onChange",(function(){if(e.enabled){var t=e.player.elements.buttons.fullscreen;zt(t)&&(t.pressed=e.active),ir.call(e.player,e.target===e.player.media?e.target:e.player.elements.container,e.active?"enterfullscreen":"exitfullscreen",!0)}})),B(this,"toggleFallback",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t?e.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(e.scrollPosition.x,e.scrollPosition.y),document.body.style.overflow=t?"hidden":"",Ht(e.target,e.player.config.classNames.fullscreen.fallback,t),It.isIos){var r=document.head.querySelector('meta[name="viewport"]'),i="viewport-fit=cover";r||(r=document.createElement("meta")).setAttribute("name","viewport");var o=mt(r.content)&&r.content.includes(i);t?(e.cleanupViewport=!o,o||(r.content+=",".concat(i))):e.cleanupViewport&&(r.content=r.content.split(",").filter((function(t){return t.trim()!==i})).join(","))}e.onChange()})),B(this,"trapFocus",(function(t){if(!It.isIos&&e.active&&"Tab"===t.key&&9===t.keyCode){var r=document.activeElement,i=Yt.call(e.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),o=n(i,1)[0],a=i[i.length-1];r!==a||t.shiftKey?r===o&&t.shiftKey&&(a.focus(),t.preventDefault()):(o.focus(),t.preventDefault())}})),B(this,"update",(function(){e.player.debug.log(e.enabled?"".concat(e.forceFallback?"Fallback (forced)":t.native?"Native":"Fallback"," fullscreen enabled"):"Fullscreen not supported and fallback disabled"),Ht(e.player.elements.container,e.player.config.classNames.fullscreen.enabled,e.enabled)})),B(this,"enter",(function(){e.enabled&&(It.isIos&&e.player.config.fullscreen.iosNative?e.player.isVimeo?e.player.embed.requestFullscreen():e.target.webkitEnterFullscreen():!t.native||e.forceFallback?e.toggleFallback(!0):e.prefix?Pt(e.prefix)||e.target["".concat(e.prefix,"Request").concat(e.property)]():e.target.requestFullscreen({navigationUI:"hide"}))})),B(this,"exit",(function(){if(e.enabled)if(It.isIos&&e.player.config.fullscreen.iosNative)e.target.webkitExitFullscreen(),ar(e.player.play());else if(!t.native||e.forceFallback)e.toggleFallback(!1);else if(e.prefix){if(!Pt(e.prefix)){var r="moz"===e.prefix?"Cancel":"Exit";document["".concat(e.prefix).concat(r).concat(e.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),B(this,"toggle",(function(){e.active?e.exit():e.enter()})),this.player=r,this.prefix=t.prefix,this.property=t.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===r.config.fullscreen.fallback,this.player.elements.fullscreen=r.config.fullscreen.container&&function(t,r){return(Element.prototype.closest||function(){var t=this;do{if(Qt.matches(t,r))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}).call(t,r)}(this.player.elements.container,r.config.fullscreen.container),tr.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),(function(){e.onChange()})),tr.call(this.player,this.player.elements.container,"dblclick",(function(t){zt(e.player.elements.controls)&&e.player.elements.controls.contains(t.target)||e.player.listeners.proxy(t,e.toggle,"fullscreen")})),tr.call(this,this.player.elements.container,"keydown",(function(t){return e.trapFocus(t)})),this.update()}return l(t,[{key:"usingNative",get:function(){return t.native&&!this.forceFallback}},{key:"enabled",get:function(){return(t.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){if(!this.enabled)return!1;if(!t.native||this.forceFallback)return Ut(this.target,this.player.config.classNames.fullscreen.fallback);var r=this.prefix?this.target.getRootNode()["".concat(this.prefix).concat(this.property,"Element")]:this.target.getRootNode().fullscreenElement;return r&&r.shadowRoot?r===this.target.getRootNode().host:r===this.target}},{key:"target",get:function(){return It.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(wt(document.exitFullscreen))return"";var t="";return["webkit","moz","ms"].some((function(r){return!(!wt(document["".concat(r,"ExitFullscreen")])&&!wt(document["".concat(r,"CancelFullScreen")])||(t=r,0))})),t}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),t}();function Dr(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(e,i){var o=new Image,n=function(){delete o.onload,delete o.onerror,(o.naturalWidth>=r?e:i)(o)};Object.assign(o,{onload:n,onerror:n,src:t})}))}var $r={addStyleHook:function(){Ht(this.elements.container,this.config.selectors.container.replace(".",""),!0),Ht(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var t=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void $r.toggleNativeControls.call(this,!0);zt(this.elements.controls)||(Ar.inject.call(this),this.listeners.controls()),$r.toggleNativeControls.call(this),this.isHTML5&&Er.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Ar.updateVolume.call(this),Ar.timeUpdate.call(this),Ar.durationUpdate.call(this),$r.checkPlaying.call(this),Ht(this.elements.container,this.config.classNames.pip.supported,Kt.pip&&this.isHTML5&&this.isVideo),Ht(this.elements.container,this.config.classNames.airplay.supported,Kt.airplay&&this.isHTML5),Ht(this.elements.container,this.config.classNames.isIos,It.isIos),Ht(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((function(){ir.call(t,t.media,"ready")}),0),$r.setTitle.call(this),this.poster&&$r.setPoster.call(this,this.poster,!1).catch((function(){})),this.config.duration&&Ar.durationUpdate.call(this)},setTitle:function(){var t=zr("play",this.config);if(mt(this.config.title)&&!Pt(this.config.title)&&(t+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach((function(r){r.setAttribute("aria-label",t)})),this.isEmbed){var r=Wt.call(this,"iframe");if(!zt(r))return;var e=Pt(this.config.title)?"video":this.config.title,i=zr("frameTitle",this.config);r.setAttribute("title",i.replace("{title}",e))}},togglePoster:function(t){Ht(this.elements.container,this.config.classNames.posterEnabled,t)},setPoster:function(t){var r=this,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",t),this.elements.poster.removeAttribute("hidden"),nr.call(this).then((function(){return Dr(t)})).catch((function(e){throw t===r.poster&&$r.togglePoster.call(r,!1),e})).then((function(){if(t!==r.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((function(){return Object.assign(r.elements.poster.style,{backgroundImage:"url('".concat(t,"')"),backgroundSize:""}),$r.togglePoster.call(r,!0),t})))},checkPlaying:function(t){var r=this;Ht(this.elements.container,this.config.classNames.playing,this.playing),Ht(this.elements.container,this.config.classNames.paused,this.paused),Ht(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((function(t){Object.assign(t,{pressed:r.playing}),t.setAttribute("aria-label",zr(r.playing?"pause":"play",r.config))})),jt(t)&&"timeupdate"===t.type||$r.toggleControls.call(this)},checkLoading:function(t){var r=this;this.loading=["stalled","waiting"].includes(t.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((function(){Ht(r.elements.container,r.config.classNames.loading,r.loading),$r.toggleControls.call(r)}),this.loading?250:0)},toggleControls:function(t){var r=this.elements.controls;if(r&&this.config.hideControls){var e=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(t||this.loading||this.paused||r.pressed||r.hover||e))}},migrateStyles:function(){var t=this;Object.values(a({},this.media.style)).filter((function(t){return!Pt(t)&&mt(t)&&t.startsWith("--plyr")})).forEach((function(r){t.elements.container.style.setProperty(r,t.media.style.getPropertyValue(r)),t.media.style.removeProperty(r)})),Pt(this.media.style)&&this.media.removeAttribute("style")}},qr=function(){function t(r){var e=this;u(this,t),B(this,"firstTouch",(function(){var t=e.player,r=t.elements;t.touch=!0,Ht(r.container,t.config.classNames.isTouch,!0)})),B(this,"setTabFocus",(function(t){var r=e.player,i=r.elements;clearTimeout(e.focusTimer),("keydown"!==t.type||9===t.which)&&("keydown"===t.type&&(e.lastKeyDown=t.timeStamp),("focus"!==t.type||t.timeStamp-e.lastKeyDown<=20)&&(function(){var t=r.config.classNames.tabFocus;Ht(Yt.call(r,".".concat(t)),t,!1)}(),"focusout"!==t.type&&(e.focusTimer=setTimeout((function(){var t=document.activeElement;i.container.contains(t)&&Ht(document.activeElement,r.config.classNames.tabFocus,!0)}),10))))})),B(this,"global",(function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=e.player;r.config.keyboard.global&&Zt.call(r,window,"keydown keyup",e.handleKey,t,!1),Zt.call(r,document.body,"click",e.toggleMenu,t),er.call(r,document.body,"touchstart",e.firstTouch),Zt.call(r,document.body,"keydown focus blur focusout",e.setTabFocus,t,!1,!0)})),B(this,"container",(function(){var t=e.player,r=t.config,i=t.elements,o=t.timers;!r.keyboard.global&&r.keyboard.focused&&tr.call(t,i.container,"keydown keyup",e.handleKey,!1),tr.call(t,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(function(r){var e=i.controls;e&&"enterfullscreen"===r.type&&(e.pressed=!1,e.hover=!1);var n=0;["touchstart","touchmove","mousemove"].includes(r.type)&&($r.toggleControls.call(t,!0),n=t.touch?3e3:2e3),clearTimeout(o.controls),o.controls=setTimeout((function(){return $r.toggleControls.call(t,!1)}),n)}));var a=function(){if(t.isVimeo&&!t.config.vimeo.premium){var r=i.wrapper,e=t.fullscreen.active,o=hr.call(t),a=n(o,2),s=a[0],l=a[1],p=pr("aspect-ratio: ".concat(s," / ").concat(l));if(e){var u=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],d=n(u,2),c=d[1],h=d[0]/c>s/l;p?(r.style.width=h?"auto":"100%",r.style.height=h?"100%":"auto"):(r.style.maxWidth=h?c/l*s+"px":null,r.style.margin=h?"0 auto":null)}else p?(r.style.width=null,r.style.height=null):(r.style.maxWidth=null,r.style.margin=null)}},s=function(){clearTimeout(o.resized),o.resized=setTimeout(a,50)};tr.call(t,i.container,"enterfullscreen exitfullscreen",(function(r){t.fullscreen.target===i.container&&(!t.isEmbed&&Pt(t.config.ratio)||(a(),("enterfullscreen"===r.type?tr:rr).call(t,window,"resize",s)))}))})),B(this,"media",(function(){var t=e.player,r=t.elements;if(tr.call(t,t.media,"timeupdate seeking seeked",(function(r){return Ar.timeUpdate.call(t,r)})),tr.call(t,t.media,"durationchange loadeddata loadedmetadata",(function(r){return Ar.durationUpdate.call(t,r)})),tr.call(t,t.media,"ended",(function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())})),tr.call(t,t.media,"progress playing seeking seeked",(function(r){return Ar.updateProgress.call(t,r)})),tr.call(t,t.media,"volumechange",(function(r){return Ar.updateVolume.call(t,r)})),tr.call(t,t.media,"playing play pause ended emptied timeupdate",(function(r){return $r.checkPlaying.call(t,r)})),tr.call(t,t.media,"waiting canplay seeked playing",(function(r){return $r.checkLoading.call(t,r)})),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var i=Wt.call(t,".".concat(t.config.classNames.video));if(!zt(i))return;tr.call(t,r.container,"click",(function(o){([r.container,i].includes(o.target)||i.contains(o.target))&&(t.touch&&t.config.hideControls||(t.ended?(e.proxy(o,t.restart,"restart"),e.proxy(o,(function(){ar(t.play())}),"play")):e.proxy(o,(function(){ar(t.togglePlay())}),"play")))}))}t.supported.ui&&t.config.disableContextMenu&&tr.call(t,r.wrapper,"contextmenu",(function(t){t.preventDefault()}),!1),tr.call(t,t.media,"volumechange",(function(){t.storage.set({volume:t.volume,muted:t.muted})})),tr.call(t,t.media,"ratechange",(function(){Ar.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})})),tr.call(t,t.media,"qualitychange",(function(r){Ar.updateSetting.call(t,"quality",null,r.detail.quality)})),tr.call(t,t.media,"ready qualitychange",(function(){Ar.setDownloadUrl.call(t)}));var o=t.config.events.concat(["keyup","keydown"]).join(" ");tr.call(t,t.media,o,(function(e){var i=e.detail,o=void 0===i?{}:i;"error"===e.type&&(o=t.media.error),ir.call(t,r.container,e.type,!0,o)}))})),B(this,"proxy",(function(t,r,i){var o=e.player,n=o.config.listeners[i],a=!0;wt(n)&&(a=n.call(o,t)),!1!==a&&wt(r)&&r.call(o,t)})),B(this,"bind",(function(t,r,i,o){var n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=e.player,s=a.config.listeners[o],l=wt(s);tr.call(a,t,r,(function(t){return e.proxy(t,i,o)}),n&&!l)})),B(this,"controls",(function(){var t=e.player,r=t.elements,i=It.isIE?"change":"input";if(r.buttons.play&&Array.from(r.buttons.play).forEach((function(r){e.bind(r,"click",(function(){ar(t.togglePlay())}),"play")})),e.bind(r.buttons.restart,"click",t.restart,"restart"),e.bind(r.buttons.rewind,"click",(function(){t.lastSeekTime=Date.now(),t.rewind()}),"rewind"),e.bind(r.buttons.fastForward,"click",(function(){t.lastSeekTime=Date.now(),t.forward()}),"fastForward"),e.bind(r.buttons.mute,"click",(function(){t.muted=!t.muted}),"mute"),e.bind(r.buttons.captions,"click",(function(){return t.toggleCaptions()})),e.bind(r.buttons.download,"click",(function(){ir.call(t,t.media,"download")}),"download"),e.bind(r.buttons.fullscreen,"click",(function(){t.fullscreen.toggle()}),"fullscreen"),e.bind(r.buttons.pip,"click",(function(){t.pip="toggle"}),"pip"),e.bind(r.buttons.airplay,"click",t.airplay,"airplay"),e.bind(r.buttons.settings,"click",(function(r){r.stopPropagation(),r.preventDefault(),Ar.toggleMenu.call(t,r)}),null,!1),e.bind(r.buttons.settings,"keyup",(function(r){var e=r.which;[13,32].includes(e)&&(13!==e?(r.preventDefault(),r.stopPropagation(),Ar.toggleMenu.call(t,r)):Ar.focusFirstMenuItem.call(t,null,!0))}),null,!1),e.bind(r.settings.menu,"keydown",(function(r){27===r.which&&Ar.toggleMenu.call(t,r)})),e.bind(r.inputs.seek,"mousedown mousemove",(function(t){var e=r.progress.getBoundingClientRect();t.currentTarget.setAttribute("seek-value",100/e.width*(t.pageX-e.left))})),e.bind(r.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(function(r){var e=r.currentTarget,i=r.keyCode?r.keyCode:r.which,o="play-on-seeked";if(!Tt(r)||39===i||37===i){t.lastSeekTime=Date.now();var n=e.hasAttribute(o),a=["mouseup","touchend","keyup"].includes(r.type);n&&a?(e.removeAttribute(o),ar(t.play())):!a&&t.playing&&(e.setAttribute(o,""),t.pause())}})),It.isIos){var o=Yt.call(t,'input[type="range"]');Array.from(o).forEach((function(t){return e.bind(t,i,(function(t){return At(t.target)}))}))}e.bind(r.inputs.seek,i,(function(r){var e=r.currentTarget,i=e.getAttribute("seek-value");Pt(i)&&(i=e.value),e.removeAttribute("seek-value"),t.currentTime=i/e.max*t.duration}),"seek"),e.bind(r.progress,"mouseenter mouseleave mousemove",(function(r){return Ar.updateSeekTooltip.call(t,r)})),e.bind(r.progress,"mousemove touchmove",(function(r){var e=t.previewThumbnails;e&&e.loaded&&e.startMove(r)})),e.bind(r.progress,"mouseleave touchend click",(function(){var r=t.previewThumbnails;r&&r.loaded&&r.endMove(!1,!0)})),e.bind(r.progress,"mousedown touchstart",(function(r){var e=t.previewThumbnails;e&&e.loaded&&e.startScrubbing(r)})),e.bind(r.progress,"mouseup touchend",(function(r){var e=t.previewThumbnails;e&&e.loaded&&e.endScrubbing(r)})),It.isWebkit&&Array.from(Yt.call(t,'input[type="range"]')).forEach((function(r){e.bind(r,"input",(function(r){return Ar.updateRangeFill.call(t,r.target)}))})),t.config.toggleInvert&&!zt(r.display.duration)&&e.bind(r.display.currentTime,"click",(function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,Ar.timeUpdate.call(t))})),e.bind(r.inputs.volume,i,(function(r){t.volume=r.target.value}),"volume"),e.bind(r.controls,"mouseenter mouseleave",(function(e){r.controls.hover=!t.touch&&"mouseenter"===e.type})),r.fullscreen&&Array.from(r.fullscreen.children).filter((function(t){return!t.contains(r.container)})).forEach((function(i){e.bind(i,"mouseenter mouseleave",(function(e){r.controls&&(r.controls.hover=!t.touch&&"mouseenter"===e.type)}))})),e.bind(r.controls,"mousedown mouseup touchstart touchend touchcancel",(function(t){r.controls.pressed=["mousedown","touchstart"].includes(t.type)})),e.bind(r.controls,"focusin",(function(){var i=t.config,o=t.timers;Ht(r.controls,i.classNames.noTransition,!0),$r.toggleControls.call(t,!0),setTimeout((function(){Ht(r.controls,i.classNames.noTransition,!1)}),0);var n=e.touch?3e3:4e3;clearTimeout(o.controls),o.controls=setTimeout((function(){return $r.toggleControls.call(t,!1)}),n)})),e.bind(r.inputs.volume,"wheel",(function(r){var e=r.webkitDirectionInvertedFromDevice,i=[r.deltaX,-r.deltaY].map((function(t){return e?-t:t})),o=n(i,2),a=o[0],s=o[1],l=Math.sign(Math.abs(a)>Math.abs(s)?a:s);t.increaseVolume(l/50);var p=t.media.volume;(1===l&&p<1||-1===l&&p>0)&&r.preventDefault()}),"volume",!1)})),this.player=r,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return l(t,[{key:"handleKey",value:function(t){var r=this.player,e=r.elements,i=t.keyCode?t.keyCode:t.which,o="keydown"===t.type,n=o&&i===this.lastKey;if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)&>(i))if(o){var a=document.activeElement;if(zt(a)){if(a!==e.inputs.seek&&Qt(a,r.config.selectors.editable))return;if(32===t.which&&Qt(a,'button, [role^="menuitem"]'))return}switch([32,37,38,39,40,48,49,50,51,52,53,54,56,57,67,70,73,75,76,77,79].includes(i)&&(t.preventDefault(),t.stopPropagation()),i){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:n||(r.currentTime=r.duration/10*(i-48));break;case 32:case 75:n||ar(r.togglePlay());break;case 38:r.increaseVolume(.1);break;case 40:r.decreaseVolume(.1);break;case 77:n||(r.muted=!r.muted);break;case 39:r.forward();break;case 37:r.rewind();break;case 70:r.fullscreen.toggle();break;case 67:n||r.toggleCaptions();break;case 76:r.loop=!r.loop}27===i&&!r.fullscreen.usingNative&&r.fullscreen.active&&r.fullscreen.toggle(),this.lastKey=i}else this.lastKey=null}},{key:"toggleMenu",value:function(t){Ar.toggleMenu.call(this.player,t)}}]),t}(),Vr=function(t,r){return function(t){t.exports=function(){var t=function(){},r={},e={},i={};function o(t,r){if(t){var o=i[t];if(e[t]=r,o)for(;o.length;)o[0](t,r),o.splice(0,1)}}function n(r,e){r.call&&(r={success:r}),e.length?(r.error||t)(e):(r.success||t)(r)}function a(r,e,i,o){var n,s,l=document,p=i.async,u=(i.numRetries||0)+1,d=i.before||t,c=r.replace(/[\?|#].*$/,""),h=r.replace(/^(css|img)!/,"");o=o||0,/(^css!|\.css$)/.test(c)?((s=l.createElement("link")).rel="stylesheet",s.href=h,(n="hideFocus"in s)&&s.relList&&(n=0,s.rel="preload",s.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(c)?(s=l.createElement("img")).src=h:((s=l.createElement("script")).src=r,s.async=void 0===p||p),s.onload=s.onerror=s.onbeforeload=function(t){var l=t.type[0];if(n)try{s.sheet.cssText.length||(l="e")}catch(t){18!=t.code&&(l="e")}if("e"==l){if((o+=1)<u)return a(r,e,i,o)}else if("preload"==s.rel&&"style"==s.as)return s.rel="stylesheet";e(r,l,t.defaultPrevented)},!1!==d(r,s)&&l.head.appendChild(s)}function s(t,r,e){var i,o,n=(t=t.push?t:[t]).length,s=n,l=[];for(i=function(t,e,i){if("e"==e&&l.push(t),"b"==e){if(!i)return;l.push(t)}--n||r(l)},o=0;o<s;o++)a(t[o],i,e)}function l(t,e,i){var a,l;if(e&&e.trim&&(a=e),l=(a?i:e)||{},a){if(a in r)throw"LoadJS";r[a]=!0}function p(r,e){s(t,(function(t){n(l,t),r&&n({success:r,error:e},t),o(a,t)}),l)}if(l.returnPromise)return new Promise(p);p()}return l.ready=function(t,r){return function(t,r){var o,n,a,s=[],l=(t=t.push?t:[t]).length,p=l;for(o=function(t,e){e.length&&s.push(t),--p||r(s)};l--;)(a=e[n=t[l]])?o(n,a):(i[n]=i[n]||[]).push(o)}(t,(function(t){n(r,t)})),l},l.done=function(t){o(t,[])},l.reset=function(){r={},e={},i={}},l.isDefined=function(t){return t in r},l}()}(r={exports:{}}),r.exports}();function Hr(t){return new Promise((function(r,e){Vr(t,{success:r,error:e})}))}function Ur(t){t&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===t&&(this.media.paused=!t,ir.call(this,this.media,t?"play":"pause"))}var Qr={setup:function(){var t=this;Ht(t.elements.wrapper,t.config.classNames.embed,!0),t.options.speed=t.config.speed.options,yr.call(t),_t(window.Vimeo)?Qr.ready.call(t):Hr(t.config.urls.vimeo.sdk).then((function(){Qr.ready.call(t)})).catch((function(r){t.debug.warn("Vimeo SDK (player.js) failed to load",r)}))},ready:function(){var t=this,r=this,e=r.config.vimeo,i=e.premium,o=e.referrerPolicy,s=c(e,N),l=r.media.getAttribute("src"),p="";Pt(l)?(l=r.media.getAttribute(r.config.attributes.embed.id),p=r.media.getAttribute(r.config.attributes.embed.hash)):p=function(t){var r=t.match(h(/^.*(?:vimeo.com\/|video\/)(?:[0-9]+)(?:\?.*&*h=|\/)+([,0-9a-f]+)/,{hash:1}));return r?r.groups.hash:null}(l);var u=p?{h:p}:{};i&&Object.assign(s,{controls:!1,sidedock:!1});var d=Mr(a(a({loop:r.config.loop.active,autoplay:r.autoplay,muted:r.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},u),s)),y=function(t){return Pt(t)?null:gt(Number(t))?t:t.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:t}(l),v=Rt("iframe"),f=gr(r.config.urls.vimeo.iframe,y,d);if(v.setAttribute("src",f),v.setAttribute("allowfullscreen",""),v.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),Pt(o)||v.setAttribute("referrerPolicy",o),i||!e.customControls)v.setAttribute("data-poster",r.poster),r.media=$t(v,r.media);else{var _=Rt("div",{class:r.config.classNames.embedContainer,"data-poster":r.poster});_.appendChild(v),r.media=$t(_,r.media)}e.customControls||Tr(gr(r.config.urls.vimeo.api,f)).then((function(t){!Pt(t)&&t.thumbnail_url&&$r.setPoster.call(r,t.thumbnail_url).catch((function(){}))})),r.embed=new window.Vimeo.Player(v,{autopause:r.config.autopause,muted:r.muted}),r.media.paused=!0,r.media.currentTime=0,r.supported.ui&&r.embed.disableTextTrack(),r.media.play=function(){return Ur.call(r,!0),r.embed.play()},r.media.pause=function(){return Ur.call(r,!1),r.embed.pause()},r.media.stop=function(){r.pause(),r.currentTime=0};var g=r.media.currentTime;Object.defineProperty(r.media,"currentTime",{get:function(){return g},set:function(t){var e=r.embed,i=r.media,o=r.volume,n=r.paused&&!e.hasPlayed;i.seeking=!0,ir.call(r,i,"seeking"),Promise.resolve(n&&e.setVolume(0)).then((function(){return e.setCurrentTime(t)})).then((function(){return n&&e.pause()})).then((function(){return n&&e.setVolume(o)})).catch((function(){}))}});var m=r.config.speed.selected;Object.defineProperty(r.media,"playbackRate",{get:function(){return m},set:function(t){r.embed.setPlaybackRate(t).then((function(){m=t,ir.call(r,r.media,"ratechange")})).catch((function(){r.options.speed=[1]}))}});var b=r.config.volume;Object.defineProperty(r.media,"volume",{get:function(){return b},set:function(t){r.embed.setVolume(t).then((function(){b=t,ir.call(r,r.media,"volumechange")}))}});var w=r.config.muted;Object.defineProperty(r.media,"muted",{get:function(){return w},set:function(t){var e=!!bt(t)&&t;r.embed.setVolume(e?0:r.config.volume).then((function(){w=e,ir.call(r,r.media,"volumechange")}))}});var k,x=r.config.loop;Object.defineProperty(r.media,"loop",{get:function(){return x},set:function(t){var e=bt(t)?t:r.config.loop.active;r.embed.setLoop(e).then((function(){x=e}))}}),r.embed.getVideoUrl().then((function(t){k=t,Ar.setDownloadUrl.call(r)})).catch((function(r){t.debug.warn(r)})),Object.defineProperty(r.media,"currentSrc",{get:function(){return k}}),Object.defineProperty(r.media,"ended",{get:function(){return r.currentTime===r.duration}}),Promise.all([r.embed.getVideoWidth(),r.embed.getVideoHeight()]).then((function(e){var i=n(e,2);r.embed.ratio=vr(i[0],i[1]),yr.call(t)})),r.embed.setAutopause(r.config.autopause).then((function(t){r.config.autopause=t})),r.embed.getVideoTitle().then((function(e){r.config.title=e,$r.setTitle.call(t)})),r.embed.getCurrentTime().then((function(t){g=t,ir.call(r,r.media,"timeupdate")})),r.embed.getDuration().then((function(t){r.media.duration=t,ir.call(r,r.media,"durationchange")})),r.embed.getTextTracks().then((function(t){r.media.textTracks=t,Er.setup.call(r)})),r.embed.on("cuechange",(function(t){var e=t.cues,i=(void 0===e?[]:e).map((function(t){return function(t){var r=document.createDocumentFragment(),e=document.createElement("div");return r.appendChild(e),e.innerHTML=t,r.firstChild.innerText}(t.text)}));Er.updateCues.call(r,i)})),r.embed.on("loaded",(function(){r.embed.getPaused().then((function(t){Ur.call(r,!t),t||ir.call(r,r.media,"playing")})),zt(r.embed.element)&&r.supported.ui&&r.embed.element.setAttribute("tabindex",-1)})),r.embed.on("bufferstart",(function(){ir.call(r,r.media,"waiting")})),r.embed.on("bufferend",(function(){ir.call(r,r.media,"playing")})),r.embed.on("play",(function(){Ur.call(r,!0),ir.call(r,r.media,"playing")})),r.embed.on("pause",(function(){Ur.call(r,!1)})),r.embed.on("timeupdate",(function(t){r.media.seeking=!1,g=t.seconds,ir.call(r,r.media,"timeupdate")})),r.embed.on("progress",(function(t){r.media.buffered=t.percent,ir.call(r,r.media,"progress"),1===parseInt(t.percent,10)&&ir.call(r,r.media,"canplaythrough"),r.embed.getDuration().then((function(t){t!==r.media.duration&&(r.media.duration=t,ir.call(r,r.media,"durationchange"))}))})),r.embed.on("seeked",(function(){r.media.seeking=!1,ir.call(r,r.media,"seeked")})),r.embed.on("ended",(function(){r.media.paused=!0,ir.call(r,r.media,"ended")})),r.embed.on("error",(function(t){r.media.error=t,ir.call(r,r.media,"error")})),e.customControls&&setTimeout((function(){return $r.build.call(r)}),0)}};function Yr(t){t&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===t&&(this.media.paused=!t,ir.call(this,this.media,t?"play":"pause"))}function Wr(t){return t.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}var Jr,Gr,Kr,Xr,Zr,te,re={setup:function(){var t=this;if(Ht(this.elements.wrapper,this.config.classNames.embed,!0),_t(window.YT)&&wt(window.YT.Player))re.ready.call(this);else{var r=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){wt(r)&&r(),re.ready.call(t)},Hr(this.config.urls.youtube.sdk).catch((function(r){t.debug.warn("YouTube API failed to load",r)}))}},getTitle:function(t){var r=this;Tr(gr(this.config.urls.youtube.api,t)).then((function(t){if(_t(t)){var e=t.height,i=t.width;r.config.title=t.title,$r.setTitle.call(r),r.embed.ratio=vr(i,e)}yr.call(r)})).catch((function(){yr.call(r)}))},ready:function(){var t=this,r=t.config.youtube,e=t.media&&t.media.getAttribute("id");if(Pt(e)||!e.startsWith("youtube-")){var i=t.media.getAttribute("src");Pt(i)&&(i=t.media.getAttribute(this.config.attributes.embed.id));var o=function(t){return Pt(t)?null:t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:t}(i),n=Rt("div",{id:_r(t.provider),"data-poster":r.customControls?t.poster:void 0});if(t.media=$t(n,t.media),r.customControls){var a=function(t){return"https://i.ytimg.com/vi/".concat(o,"/").concat(t,"default.jpg")};Dr(a("maxres"),121).catch((function(){return Dr(a("sd"),121)})).catch((function(){return Dr(a("hq"))})).then((function(r){return $r.setPoster.call(t,r.src)})).then((function(r){r.includes("maxres")||(t.elements.poster.style.backgroundSize="cover")})).catch((function(){}))}t.embed=new window.YT.Player(t.media,{videoId:o,host:Wr(r),playerVars:Et({},{autoplay:t.config.autoplay?1:0,hl:t.config.hl,controls:t.supported.ui&&r.customControls?0:1,disablekb:1,playsinline:t.config.fullscreen.iosNative?0:1,cc_load_policy:t.captions.active?1:0,cc_lang_pref:t.config.captions.language,widget_referrer:window?window.location.href:null},r),events:{onError:function(r){if(!t.media.error){var e=r.data;t.media.error={code:e,message:{2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[e]||"An unknown error occured"},ir.call(t,t.media,"error")}},onPlaybackRateChange:function(r){t.media.playbackRate=r.target.getPlaybackRate(),ir.call(t,t.media,"ratechange")},onReady:function(e){if(!wt(t.media.play)){var i=e.target;re.getTitle.call(t,o),t.media.play=function(){Yr.call(t,!0),i.playVideo()},t.media.pause=function(){Yr.call(t,!1),i.pauseVideo()},t.media.stop=function(){i.stopVideo()},t.media.duration=i.getDuration(),t.media.paused=!0,t.media.currentTime=0,Object.defineProperty(t.media,"currentTime",{get:function(){return Number(i.getCurrentTime())},set:function(r){t.paused&&!t.embed.hasPlayed&&t.embed.mute(),t.media.seeking=!0,ir.call(t,t.media,"seeking"),i.seekTo(r)}}),Object.defineProperty(t.media,"playbackRate",{get:function(){return i.getPlaybackRate()},set:function(t){i.setPlaybackRate(t)}});var n=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return n},set:function(r){i.setVolume(100*(n=r)),ir.call(t,t.media,"volumechange")}});var a=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return a},set:function(r){var e=bt(r)?r:a;a=e,i[e?"mute":"unMute"](),i.setVolume(100*n),ir.call(t,t.media,"volumechange")}}),Object.defineProperty(t.media,"currentSrc",{get:function(){return i.getVideoUrl()}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}});var s=i.getAvailablePlaybackRates();t.options.speed=s.filter((function(r){return t.config.speed.options.includes(r)})),t.supported.ui&&r.customControls&&t.media.setAttribute("tabindex",-1),ir.call(t,t.media,"timeupdate"),ir.call(t,t.media,"durationchange"),clearInterval(t.timers.buffering),t.timers.buffering=setInterval((function(){t.media.buffered=i.getVideoLoadedFraction(),(null===t.media.lastBuffered||t.media.lastBuffered<t.media.buffered)&&ir.call(t,t.media,"progress"),t.media.lastBuffered=t.media.buffered,1===t.media.buffered&&(clearInterval(t.timers.buffering),ir.call(t,t.media,"canplaythrough"))}),200),r.customControls&&setTimeout((function(){return $r.build.call(t)}),50)}},onStateChange:function(e){var i=e.target;switch(clearInterval(t.timers.playing),t.media.seeking&&[1,2].includes(e.data)&&(t.media.seeking=!1,ir.call(t,t.media,"seeked")),e.data){case-1:ir.call(t,t.media,"timeupdate"),t.media.buffered=i.getVideoLoadedFraction(),ir.call(t,t.media,"progress");break;case 0:Yr.call(t,!1),t.media.loop?(i.stopVideo(),i.playVideo()):ir.call(t,t.media,"ended");break;case 1:r.customControls&&!t.config.autoplay&&t.media.paused&&!t.embed.hasPlayed?t.media.pause():(Yr.call(t,!0),ir.call(t,t.media,"playing"),t.timers.playing=setInterval((function(){ir.call(t,t.media,"timeupdate")}),50),t.media.duration!==i.getDuration()&&(t.media.duration=i.getDuration(),ir.call(t,t.media,"durationchange")));break;case 2:t.muted||t.embed.unMute(),Yr.call(t,!1);break;case 3:ir.call(t,t.media,"waiting")}ir.call(t,t.elements.container,"statechange",!1,{code:e.data})}}})}}},ee={setup:function(){this.media?(Ht(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),Ht(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&Ht(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=Rt("div",{class:this.config.classNames.video}),Ft(this.media,this.elements.wrapper),this.elements.poster=Rt("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?fr.setup.call(this):this.isYouTube?re.setup.call(this):this.isVimeo&&Qr.setup.call(this)):this.debug.warn("No media element found!")}},ie=function(){function t(r){var e=this;u(this,t),B(this,"load",(function(){e.enabled&&(_t(window.google)&&_t(window.google.ima)?e.ready():Hr(e.player.config.urls.googleIMA.sdk).then((function(){e.ready()})).catch((function(){e.trigger("error",new Error("Google IMA SDK failed to load"))})))})),B(this,"ready",(function(){var t;e.enabled||((t=e).manager&&t.manager.destroy(),t.elements.displayContainer&&t.elements.displayContainer.destroy(),t.elements.container.remove()),e.startSafetyTimer(12e3,"ready()"),e.managerPromise.then((function(){e.clearSafetyTimer("onAdsManagerLoaded()")})),e.listeners(),e.setupIMA()})),B(this,"setupIMA",(function(){e.elements.container=Rt("div",{class:e.player.config.classNames.ads}),e.player.elements.container.appendChild(e.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(e.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(e.player.config.playsinline),e.elements.displayContainer=new google.ima.AdDisplayContainer(e.elements.container,e.player.media),e.loader=new google.ima.AdsLoader(e.elements.displayContainer),e.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(t){return e.onAdsManagerLoaded(t)}),!1),e.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){return e.onAdError(t)}),!1),e.requestAds()})),B(this,"requestAds",(function(){var t=e.player.elements.container;try{var r=new google.ima.AdsRequest;r.adTagUrl=e.tagUrl,r.linearAdSlotWidth=t.offsetWidth,r.linearAdSlotHeight=t.offsetHeight,r.nonLinearAdSlotWidth=t.offsetWidth,r.nonLinearAdSlotHeight=t.offsetHeight,r.forceNonLinearFullSlot=!1,r.setAdWillPlayMuted(!e.player.muted),e.loader.requestAds(r)}catch(t){e.onAdError(t)}})),B(this,"pollCountdown",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return clearInterval(e.countdownTimer),void e.elements.container.removeAttribute("data-badge-text");e.countdownTimer=setInterval((function(){var t=Or(Math.max(e.manager.getRemainingTime(),0)),r="".concat(zr("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",r)}),100)})),B(this,"onAdsManagerLoaded",(function(t){if(e.enabled){var r=new google.ima.AdsRenderingSettings;r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.enablePreloading=!0,e.manager=t.getAdsManager(e.player,r),e.cuePoints=e.manager.getCuePoints(),e.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){return e.onAdError(t)})),Object.keys(google.ima.AdEvent.Type).forEach((function(t){e.manager.addEventListener(google.ima.AdEvent.Type[t],(function(t){return e.onAdEvent(t)}))})),e.trigger("loaded")}})),B(this,"addCuePoints",(function(){Pt(e.cuePoints)||e.cuePoints.forEach((function(t){if(0!==t&&-1!==t&&t<e.player.duration){var r=e.player.elements.progress;if(zt(r)){var i=100/e.player.duration*t,o=Rt("span",{class:e.player.config.classNames.cues});o.style.left="".concat(i.toString(),"%"),r.appendChild(o)}}}))})),B(this,"onAdEvent",(function(t){var r=e.player.elements.container,i=t.getAd(),o=t.getAdData();switch(function(t){ir.call(e.player,e.player.media,"ads".concat(t.replace(/_/g,"").toLowerCase()))}(t.type),t.type){case google.ima.AdEvent.Type.LOADED:e.trigger("loaded"),e.pollCountdown(!0),i.isLinear()||(i.width=r.offsetWidth,i.height=r.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:e.manager.setVolume(e.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:e.player.ended?e.loadAds():e.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:e.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:e.pollCountdown(),e.resumeContent();break;case google.ima.AdEvent.Type.LOG:o.adError&&e.player.debug.warn("Non-fatal ad error: ".concat(o.adError.getMessage()))}})),B(this,"onAdError",(function(t){e.cancel(),e.player.debug.warn("Ads error",t)})),B(this,"listeners",(function(){var t,r=e.player.elements.container;e.player.on("canplay",(function(){e.addCuePoints()})),e.player.on("ended",(function(){e.loader.contentComplete()})),e.player.on("timeupdate",(function(){t=e.player.currentTime})),e.player.on("seeked",(function(){var r=e.player.currentTime;Pt(e.cuePoints)||e.cuePoints.forEach((function(i,o){t<i&&i<r&&(e.manager.discardAdBreak(),e.cuePoints.splice(o,1))}))})),window.addEventListener("resize",(function(){e.manager&&e.manager.resize(r.offsetWidth,r.offsetHeight,google.ima.ViewMode.NORMAL)}))})),B(this,"play",(function(){var t=e.player.elements.container;e.managerPromise||e.resumeContent(),e.managerPromise.then((function(){e.manager.setVolume(e.player.volume),e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}})).catch((function(){}))})),B(this,"resumeContent",(function(){e.elements.container.style.zIndex="",e.playing=!1,ar(e.player.media.play())})),B(this,"pauseContent",(function(){e.elements.container.style.zIndex=3,e.playing=!0,e.player.media.pause()})),B(this,"cancel",(function(){e.initialized&&e.resumeContent(),e.trigger("error"),e.loadAds()})),B(this,"loadAds",(function(){e.managerPromise.then((function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise((function(t){e.on("loaded",t),e.player.debug.log(e.manager)})),e.initialized=!1,e.requestAds()})).catch((function(){}))})),B(this,"trigger",(function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var n=e.events[t];kt(n)&&n.forEach((function(t){wt(t)&&t.apply(e,i)}))})),B(this,"on",(function(t,r){return kt(e.events[t])||(e.events[t]=[]),e.events[t].push(r),e})),B(this,"startSafetyTimer",(function(t,r){e.player.debug.log("Safety timer invoked from: ".concat(r)),e.safetyTimer=setTimeout((function(){e.cancel(),e.clearSafetyTimer("startSafetyTimer()")}),t)})),B(this,"clearSafetyTimer",(function(t){ft(e.safetyTimer)||(e.player.debug.log("Safety timer cleared from: ".concat(t)),clearTimeout(e.safetyTimer),e.safetyTimer=null)})),this.player=r,this.config=r.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((function(t,r){e.on("loaded",t),e.on("error",r)})),this.load()}return l(t,[{key:"enabled",get:function(){var t=this.config;return this.player.isHTML5&&this.player.isVideo&&t.enabled&&(!Pt(t.publisherId)||Ct(t.tagUrl))}},{key:"tagUrl",get:function(){var t=this.config;return Ct(t.tagUrl)?t.tagUrl:"https://go.aniview.com/api/adserver6/vast/?".concat(Mr({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:t.publisherId}))}}]),t}(),oe=function(t){var r=[];return t.split(/\r\n\r\n|\n\n|\r\r/).forEach((function(t){var e={};t.split(/\r\n|\n|\r/).forEach((function(t){if(gt(e.startTime)){if(!Pt(t.trim())&&Pt(e.text)){var r,i,o,a=t.trim().split("#xywh=");r=n(a,1),e.text=r[0],a[1]&&(i=a[1].split(","),o=n(i,4),e.x=o[0],e.y=o[1],e.w=o[2],e.h=o[3])}}else{var s=t.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);s&&(e.startTime=60*Number(s[1]||0)*60+60*Number(s[2])+Number(s[3])+Number("0.".concat(s[4])),e.endTime=60*Number(s[6]||0)*60+60*Number(s[7])+Number(s[8])+Number("0.".concat(s[9])))}})),e.text&&r.push(e)})),r},ne=function(t,r){var e={};return t>r.width/r.height?(e.width=r.width,e.height=1/t*r.width):(e.height=r.height,e.width=t*r.height),e},ae=function(){function t(r){var e=this;u(this,t),B(this,"load",(function(){e.player.elements.display.seekTooltip&&(e.player.elements.display.seekTooltip.hidden=e.enabled),e.enabled&&e.getThumbnails().then((function(){e.enabled&&(e.render(),e.determineContainerAutoSizing(),e.loaded=!0)}))})),B(this,"getThumbnails",(function(){return new Promise((function(t){var r=e.player.config.previewThumbnails.src;if(Pt(r))throw new Error("Missing previewThumbnails.src config attribute");var i=function(){e.thumbnails.sort((function(t,r){return t.height-r.height})),e.player.debug.log("Preview thumbnails",e.thumbnails),t()};if(wt(r))r((function(t){e.thumbnails=t,i()}));else{var o=(mt(r)?[r]:r).map((function(t){return e.getThumbnail(t)}));Promise.all(o).then(i)}}))})),B(this,"getThumbnail",(function(t){return new Promise((function(r){Tr(t).then((function(i){var o={frames:oe(i),height:null,urlPrefix:""};o.frames[0].text.startsWith("/")||o.frames[0].text.startsWith("http://")||o.frames[0].text.startsWith("https://")||(o.urlPrefix=t.substring(0,t.lastIndexOf("/")+1));var n=new Image;n.onload=function(){o.height=n.naturalHeight,o.width=n.naturalWidth,e.thumbnails.push(o),r()},n.src=o.urlPrefix+o.frames[0].text}))}))})),B(this,"startMove",(function(t){if(e.loaded&&jt(t)&&["touchmove","mousemove"].includes(t.type)&&e.player.media.duration){if("touchmove"===t.type)e.seekTime=e.player.media.duration*(e.player.elements.inputs.seek.value/100);else{var r=e.player.elements.progress.getBoundingClientRect();e.seekTime=e.player.media.duration*(100/r.width*(t.pageX-r.left)/100),e.seekTime<0&&(e.seekTime=0),e.seekTime>e.player.media.duration-1&&(e.seekTime=e.player.media.duration-1),e.mousePosX=t.pageX,e.elements.thumb.time.innerText=Or(e.seekTime)}e.showImageAtCurrentTime()}})),B(this,"endMove",(function(){e.toggleThumbContainer(!1,!0)})),B(this,"startScrubbing",(function(t){(ft(t.button)||!1===t.button||0===t.button)&&(e.mouseDown=!0,e.player.media.duration&&(e.toggleScrubbingContainer(!0),e.toggleThumbContainer(!1,!0),e.showImageAtCurrentTime()))})),B(this,"endScrubbing",(function(){e.mouseDown=!1,Math.ceil(e.lastTime)===Math.ceil(e.player.media.currentTime)?e.toggleScrubbingContainer(!1):er.call(e.player,e.player.media,"timeupdate",(function(){e.mouseDown||e.toggleScrubbingContainer(!1)}))})),B(this,"listeners",(function(){e.player.on("play",(function(){e.toggleThumbContainer(!1,!0)})),e.player.on("seeked",(function(){e.toggleThumbContainer(!1)})),e.player.on("timeupdate",(function(){e.lastTime=e.player.media.currentTime}))})),B(this,"render",(function(){e.elements.thumb.container=Rt("div",{class:e.player.config.classNames.previewThumbnails.thumbContainer}),e.elements.thumb.imageContainer=Rt("div",{class:e.player.config.classNames.previewThumbnails.imageContainer}),e.elements.thumb.container.appendChild(e.elements.thumb.imageContainer);var t=Rt("div",{class:e.player.config.classNames.previewThumbnails.timeContainer});e.elements.thumb.time=Rt("span",{},"00:00"),t.appendChild(e.elements.thumb.time),e.elements.thumb.container.appendChild(t),zt(e.player.elements.progress)&&e.player.elements.progress.appendChild(e.elements.thumb.container),e.elements.scrubbing.container=Rt("div",{class:e.player.config.classNames.previewThumbnails.scrubbingContainer}),e.player.elements.wrapper.appendChild(e.elements.scrubbing.container)})),B(this,"destroy",(function(){e.elements.thumb.container&&e.elements.thumb.container.remove(),e.elements.scrubbing.container&&e.elements.scrubbing.container.remove()})),B(this,"showImageAtCurrentTime",(function(){e.mouseDown?e.setScrubbingContainerSize():e.setThumbContainerSizeAndPos();var t=e.thumbnails[0].frames.findIndex((function(t){return e.seekTime>=t.startTime&&e.seekTime<=t.endTime})),r=t>=0,i=0;e.mouseDown||e.toggleThumbContainer(r),r&&(e.thumbnails.forEach((function(r,o){e.loadedImages.includes(r.frames[t].text)&&(i=o)})),t!==e.showingThumb&&(e.showingThumb=t,e.loadImage(i)))})),B(this,"loadImage",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=e.showingThumb,i=e.thumbnails[t],o=i.urlPrefix,n=i.frames[r],a=i.frames[r].text,s=o+a;if(e.currentImageElement&&e.currentImageElement.dataset.filename===a)e.showImage(e.currentImageElement,n,t,r,a,!1),e.currentImageElement.dataset.index=r,e.removeOldImages(e.currentImageElement);else{e.loadingImage&&e.usingSprites&&(e.loadingImage.onload=null);var l=new Image;l.src=s,l.dataset.index=r,l.dataset.filename=a,e.showingThumbFilename=a,e.player.debug.log("Loading image: ".concat(s)),l.onload=function(){return e.showImage(l,n,t,r,a,!0)},e.loadingImage=l,e.removeOldImages(l)}})),B(this,"showImage",(function(t,r,i,o,n){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];e.player.debug.log("Showing thumb: ".concat(n,". num: ").concat(o,". qual: ").concat(i,". newimg: ").concat(a)),e.setImageSizeAndOffset(t,r),a&&(e.currentImageContainer.appendChild(t),e.currentImageElement=t,e.loadedImages.includes(n)||e.loadedImages.push(n)),e.preloadNearby(o,!0).then(e.preloadNearby(o,!1)).then(e.getHigherQuality(i,t,r,n))})),B(this,"removeOldImages",(function(t){Array.from(e.currentImageContainer.children).forEach((function(r){if("img"===r.tagName.toLowerCase()){var i=e.usingSprites?500:1e3;if(r.dataset.index!==t.dataset.index&&!r.dataset.deleting){r.dataset.deleting=!0;var o=e.currentImageContainer;setTimeout((function(){o.removeChild(r),e.player.debug.log("Removing thumb: ".concat(r.dataset.filename))}),i)}}}))})),B(this,"preloadNearby",(function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(i){setTimeout((function(){var o=e.thumbnails[0].frames[t].text;if(e.showingThumbFilename===o){var n;n=r?e.thumbnails[0].frames.slice(t):e.thumbnails[0].frames.slice(0,t).reverse();var a=!1;n.forEach((function(t){var r=t.text;if(r!==o&&!e.loadedImages.includes(r)){a=!0,e.player.debug.log("Preloading thumb filename: ".concat(r));var n=e.thumbnails[0].urlPrefix+r,s=new Image;s.src=n,s.onload=function(){e.player.debug.log("Preloaded thumb filename: ".concat(r)),e.loadedImages.includes(r)||e.loadedImages.push(r),i()}}})),a||i()}}),300)}))})),B(this,"getHigherQuality",(function(t,r,i,o){if(t<e.thumbnails.length-1){var n=r.naturalHeight;e.usingSprites&&(n=i.h),n<e.thumbContainerHeight&&setTimeout((function(){e.showingThumbFilename===o&&(e.player.debug.log("Showing higher quality thumb for: ".concat(o)),e.loadImage(t+1))}),300)}})),B(this,"toggleThumbContainer",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e.player.config.classNames.previewThumbnails.thumbContainerShown;e.elements.thumb.container.classList.toggle(i,t),!t&&r&&(e.showingThumb=null,e.showingThumbFilename=null)})),B(this,"toggleScrubbingContainer",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=e.player.config.classNames.previewThumbnails.scrubbingContainerShown;e.elements.scrubbing.container.classList.toggle(r,t),t||(e.showingThumb=null,e.showingThumbFilename=null)})),B(this,"determineContainerAutoSizing",(function(){(e.elements.thumb.imageContainer.clientHeight>20||e.elements.thumb.imageContainer.clientWidth>20)&&(e.sizeSpecifiedInCSS=!0)})),B(this,"setThumbContainerSizeAndPos",(function(){if(e.sizeSpecifiedInCSS){if(e.elements.thumb.imageContainer.clientHeight>20&&e.elements.thumb.imageContainer.clientWidth<20){var t=Math.floor(e.elements.thumb.imageContainer.clientHeight*e.thumbAspectRatio);e.elements.thumb.imageContainer.style.width="".concat(t,"px")}else if(e.elements.thumb.imageContainer.clientHeight<20&&e.elements.thumb.imageContainer.clientWidth>20){var r=Math.floor(e.elements.thumb.imageContainer.clientWidth/e.thumbAspectRatio);e.elements.thumb.imageContainer.style.height="".concat(r,"px")}}else{var i=Math.floor(e.thumbContainerHeight*e.thumbAspectRatio);e.elements.thumb.imageContainer.style.height="".concat(e.thumbContainerHeight,"px"),e.elements.thumb.imageContainer.style.width="".concat(i,"px")}e.setThumbContainerPos()})),B(this,"setThumbContainerPos",(function(){var t=e.player.elements.progress.getBoundingClientRect(),r=e.player.elements.container.getBoundingClientRect(),i=e.elements.thumb.container,o=r.left-t.left+10,n=r.right-t.left-i.clientWidth-10,a=e.mousePosX-t.left-i.clientWidth/2;a<o&&(a=o),a>n&&(a=n),i.style.left="".concat(a,"px")})),B(this,"setScrubbingContainerSize",(function(){var t=ne(e.thumbAspectRatio,{width:e.player.media.clientWidth,height:e.player.media.clientHeight}),r=t.height;e.elements.scrubbing.container.style.width="".concat(t.width,"px"),e.elements.scrubbing.container.style.height="".concat(r,"px")})),B(this,"setImageSizeAndOffset",(function(t,r){if(e.usingSprites){var i=e.thumbContainerHeight/r.h;t.style.height=t.naturalHeight*i+"px",t.style.width=t.naturalWidth*i+"px",t.style.left="-".concat(r.x*i,"px"),t.style.top="-".concat(r.y*i,"px")}})),this.player=r,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}return l(t,[{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentImageContainer",get:function(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}},{key:"usingSprites",get:function(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}},{key:"thumbAspectRatio",get:function(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?ne(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}).height:this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(t){this.mouseDown?this.currentScrubbingImageElement=t:this.currentThumbnailImageElement=t}}]),t}(),se={insertElements:function(t,r){var e=this;mt(r)?Nt(t,this.media,{src:r}):kt(r)&&r.forEach((function(r){Nt(t,e.media,r)}))},change:function(t){var r=this;Mt(t,"sources.length")?(fr.cancelRequests.call(this),this.destroy.call(this,(function(){r.options.quality=[],Bt(r.media),r.media=null,zt(r.elements.container)&&r.elements.container.removeAttribute("class");var e=t.sources,i=t.type,o=n(e,1)[0],a=o.provider,s=void 0===a?Lr.html5:a,l="html5"===s?i:"div",p="html5"===s?{}:{src:o.src};Object.assign(r,{provider:s,type:i,supported:Kt.check(i,s,r.config.playsinline),media:Rt(l,p)}),r.elements.container.appendChild(r.media),bt(t.autoplay)&&(r.config.autoplay=t.autoplay),r.isHTML5&&(r.config.crossorigin&&r.media.setAttribute("crossorigin",""),r.config.autoplay&&r.media.setAttribute("autoplay",""),Pt(t.poster)||(r.poster=t.poster),r.config.loop.active&&r.media.setAttribute("loop",""),r.config.muted&&r.media.setAttribute("muted",""),r.config.playsinline&&r.media.setAttribute("playsinline","")),$r.addStyleHook.call(r),r.isHTML5&&se.insertElements.call(r,"source",e),r.config.title=t.title,ee.setup.call(r),r.isHTML5&&Object.keys(t).includes("tracks")&&se.insertElements.call(r,"track",t.tracks),(r.isHTML5||r.isEmbed&&!r.supported.ui)&&$r.build.call(r),r.isHTML5&&r.media.load(),Pt(t.previewThumbnails)||(Object.assign(r.config.previewThumbnails,t.previewThumbnails),r.previewThumbnails&&r.previewThumbnails.loaded&&(r.previewThumbnails.destroy(),r.previewThumbnails=null),r.config.previewThumbnails.enabled&&(r.previewThumbnails=new ae(r))),r.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}},le=function(){function t(r,e){var i=this;if(u(this,t),B(this,"play",(function(){return wt(i.media.play)?(i.ads&&i.ads.enabled&&i.ads.managerPromise.then((function(){return i.ads.play()})).catch((function(){return ar(i.media.play())})),i.media.play()):null})),B(this,"pause",(function(){return i.playing&&wt(i.media.pause)?i.media.pause():null})),B(this,"togglePlay",(function(t){return(bt(t)?t:!i.playing)?i.play():i.pause()})),B(this,"stop",(function(){i.isHTML5?(i.pause(),i.restart()):wt(i.media.stop)&&i.media.stop()})),B(this,"restart",(function(){i.currentTime=0})),B(this,"rewind",(function(t){i.currentTime-=gt(t)?t:i.config.seekTime})),B(this,"forward",(function(t){i.currentTime+=gt(t)?t:i.config.seekTime})),B(this,"increaseVolume",(function(t){i.volume=(i.media.muted?0:i.volume)+(gt(t)?t:0)})),B(this,"decreaseVolume",(function(t){i.increaseVolume(-t)})),B(this,"airplay",(function(){Kt.airplay&&i.media.webkitShowPlaybackTargetPicker()})),B(this,"toggleControls",(function(t){if(i.supported.ui&&!i.isAudio){var r=Ut(i.elements.container,i.config.classNames.hideControls),e=Ht(i.elements.container,i.config.classNames.hideControls,void 0===t?void 0:!t);return e&&kt(i.config.controls)&&i.config.controls.includes("settings")&&!Pt(i.config.settings)&&Ar.toggleMenu.call(i,!1),e!==r&&ir.call(i,i.media,e?"controlshidden":"controlsshown"),!e}return!1})),B(this,"on",(function(t,r){tr.call(i,i.elements.container,t,r)})),B(this,"once",(function(t,r){er.call(i,i.elements.container,t,r)})),B(this,"off",(function(t,r){rr(i.elements.container,t,r)})),B(this,"destroy",(function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i.ready){var e=function(){document.body.style.overflow="",i.embed=null,r?(Object.keys(i.elements).length&&(Bt(i.elements.buttons.play),Bt(i.elements.captions),Bt(i.elements.controls),Bt(i.elements.wrapper),i.elements.buttons.play=null,i.elements.captions=null,i.elements.controls=null,i.elements.wrapper=null),wt(t)&&t()):(or.call(i),fr.cancelRequests.call(i),$t(i.elements.original,i.elements.container),ir.call(i,i.elements.original,"destroyed",!0),wt(t)&&t.call(i.elements.original),i.ready=!1,setTimeout((function(){i.elements=null,i.media=null}),200))};i.stop(),clearTimeout(i.timers.loading),clearTimeout(i.timers.controls),clearTimeout(i.timers.resized),i.isHTML5?($r.toggleNativeControls.call(i,!0),e()):i.isYouTube?(clearInterval(i.timers.buffering),clearInterval(i.timers.playing),null!==i.embed&&wt(i.embed.destroy)&&i.embed.destroy(),e()):i.isVimeo&&(null!==i.embed&&i.embed.unload().then(e),setTimeout(e,200))}})),B(this,"supports",(function(t){return Kt.mime.call(i,t)})),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Kt.touch,this.media=r,mt(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||xt(this.media)||kt(this.media))&&(this.media=this.media[0]),this.config=Et({},Fr,t.defaults,e||{},function(){try{return JSON.parse(i.media.getAttribute("data-plyr-config"))}catch(t){return{}}}()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Nr(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Kt),!ft(this.media)&&zt(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(Kt.check().api){var o=this.media.cloneNode(!0);o.autoplay=!1,this.elements.original=o;var n=this.media.tagName.toLowerCase(),a=null,s=null;switch(n){case"div":if(a=this.media.querySelector("iframe"),zt(a)){if(s=Ir(a.getAttribute("src")),this.provider=function(t){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(t)?Lr.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(t)?Lr.vimeo:null}(s.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",s.search.length){var l=["1","true"];l.includes(s.searchParams.get("autoplay"))&&(this.config.autoplay=!0),l.includes(s.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=l.includes(s.searchParams.get("playsinline")),this.config.youtube.hl=s.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(Pt(this.provider)||!Object.values(Lr).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type="video";break;case"video":case"audio":this.type=n,this.provider=Lr.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=Kt.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new qr(this),this.storage=new jr(this),this.media.plyr=this,zt(this.elements.container)||(this.elements.container=Rt("div",{tabindex:0}),Ft(this.media,this.elements.container)),$r.migrateStyles.call(this),$r.addStyleHook.call(this),ee.setup.call(this),this.config.debug&&tr.call(this,this.elements.container,this.config.events.join(" "),(function(t){i.debug.log("event: ".concat(t.type))})),this.fullscreen=new Br(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&$r.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ie(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(function(){return ar(i.play())})),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ae(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return l(t,[{key:"isHTML5",get:function(){return this.provider===Lr.html5}},{key:"isEmbed",get:function(){return this.isYouTube||this.isVimeo}},{key:"isYouTube",get:function(){return this.provider===Lr.youtube}},{key:"isVimeo",get:function(){return this.provider===Lr.vimeo}},{key:"isVideo",get:function(){return"video"===this.type}},{key:"isAudio",get:function(){return"audio"===this.type}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",get:function(){return Number(this.media.currentTime)},set:function(t){if(this.duration){var r=gt(t)&&t>0;this.media.currentTime=r?Math.min(t,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}}},{key:"buffered",get:function(){var t=this.media.buffered;return gt(t)?t:t&&t.length&&this.duration>0?t.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var t=parseFloat(this.config.duration),r=(this.media||{}).duration,e=gt(r)&&r!==1/0?r:0;return t||e}},{key:"volume",get:function(){return Number(this.media.volume)},set:function(t){var r=t;mt(r)&&(r=Number(r)),gt(r)||(r=this.storage.get("volume")),gt(r)||(r=this.config.volume),r>1&&(r=1),r<0&&(r=0),this.config.volume=r,this.media.volume=r,!Pt(t)&&this.muted&&r>0&&(this.muted=!1)}},{key:"muted",get:function(){return Boolean(this.media.muted)},set:function(t){var r=t;bt(r)||(r=this.storage.get("muted")),bt(r)||(r=this.config.muted),this.config.muted=r,this.media.muted=r}},{key:"hasAudio",get:function(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}},{key:"speed",get:function(){return Number(this.media.playbackRate)},set:function(t){var r=this,e=null;gt(t)&&(e=t),gt(e)||(e=this.storage.get("speed")),gt(e)||(e=this.config.speed.selected),e=function(){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255;return Math.min(Math.max(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),t)}(e,this.minimumSpeed,this.maximumSpeed),this.config.speed.selected=e,setTimeout((function(){r.media&&(r.media.playbackRate=e)}),0)}},{key:"minimumSpeed",get:function(){return this.isYouTube?Math.min.apply(Math,d(this.options.speed)):this.isVimeo?.5:.0625}},{key:"maximumSpeed",get:function(){return this.isYouTube?Math.max.apply(Math,d(this.options.speed)):this.isVimeo?2:16}},{key:"quality",get:function(){return this.media.quality},set:function(t){var r=this.config.quality,e=this.options.quality;if(e.length){var i=[!Pt(t)&&Number(t),this.storage.get("quality"),r.selected,r.default].find(gt),o=!0;if(!e.includes(i)){var n=lr(e,i);this.debug.warn("Unsupported quality option: ".concat(i,", using ").concat(n," instead")),i=n,o=!1}r.selected=i,this.media.quality=i,o&&this.storage.set({quality:i})}}},{key:"loop",get:function(){return Boolean(this.media.loop)},set:function(t){var r=bt(t)?t:this.config.loop.active;this.config.loop.active=r,this.media.loop=r}},{key:"source",get:function(){return this.media.currentSrc},set:function(t){se.change.call(this,t)}},{key:"download",get:function(){var t=this.config.urls.download;return Ct(t)?t:this.source},set:function(t){Ct(t)&&(this.config.urls.download=t,Ar.setDownloadUrl.call(this))}},{key:"poster",get:function(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null},set:function(t){this.isVideo?$r.setPoster.call(this,t,!1).catch((function(){})):this.debug.warn("Poster can only be set for video")}},{key:"ratio",get:function(){if(!this.isVideo)return null;var t=cr(hr.call(this));return kt(t)?t.join(":"):t},set:function(t){this.isVideo?mt(t)&&dr(t)?(this.config.ratio=cr(t),yr.call(this)):this.debug.error("Invalid aspect ratio specified (".concat(t,")")):this.debug.warn("Aspect ratio can only be set for video")}},{key:"autoplay",get:function(){return Boolean(this.config.autoplay)},set:function(t){var r=bt(t)?t:this.config.autoplay;this.config.autoplay=r}},{key:"toggleCaptions",value:function(t){Er.toggle.call(this,t,!1)}},{key:"currentTrack",get:function(){var t=this.captions;return t.toggled?t.currentTrack:-1},set:function(t){Er.set.call(this,t,!1),Er.setup()}},{key:"language",get:function(){return(Er.getCurrentTrack.call(this)||{}).language},set:function(t){Er.setLanguage.call(this,t,!1)}},{key:"pip",get:function(){return Kt.pip?Pt(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:"picture-in-picture"===this.media.webkitPresentationMode:null},set:function(t){if(Kt.pip){var r=bt(t)?t:!this.pip;wt(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(r?"picture-in-picture":"inline"),wt(this.media.requestPictureInPicture)&&(!this.pip&&r?this.media.requestPictureInPicture():this.pip&&!r&&document.exitPictureInPicture())}}},{key:"setPreviewThumbnails",value:function(t){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,t),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ae(this))}}],[{key:"supported",value:function(t,r,e){return Kt.check(t,r,e)}},{key:"loadSprite",value:function(t,r){return Sr(t,r)}},{key:"setup",value:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;return mt(r)?i=Array.from(document.querySelectorAll(r)):xt(r)?i=Array.from(r):kt(r)&&(i=r.filter(zt)),Pt(i)?null:i.map((function(r){return new t(r,e)}))}}]),t}();function pe(t){t.on("timeupdate",(function(){return function(t){var r,e;null!=t&&null!==(r=t.config)&&void 0!==r&&null!==(e=r.mutedPreview)&&void 0!==e&&e.enabled||function(t){var r;0!==t.currentTime&&null!=t&&null!==(r=t.config)&&void 0!==r&&r.save_player_position&&localStorage.setItem("player-progress-".concat(ue(t)),t.currentTime)}(t)}(t)})),t.on("ready",(function(){return de(t)})),t.on("loadeddata",(function(){return de(t)})),t.on("ended",(function(){return function(t){localStorage.removeItem("player-progress-".concat(ue(t)))}(t)}))}function ue(t){var r,e;return null==t||null===(r=t.config)||void 0===r||null===(e=r.blockAttributes)||void 0===e?void 0:e.id}function de(t){var r,e,i;if(null!=t&&null!==(r=t.config)&&void 0!==r&&r.save_player_position&&(null==t||null===(e=t.config)||void 0===e||null===(i=e.mutedPreview)||void 0===i||!i.enabled)){var o=function(t){return parseFloat(localStorage.getItem("player-progress-".concat(ue(t))))}(t);return t.hls&&o>=0&&t.hls.startLoad(o),t.duration&&(o=Math.min(o,t.duration)),!o||o<1?0:(t.currentTime=o,null!=t&&t.isVimeo&&setTimeout((function(){t.embed.setCurrentTime(o||0)}),0),o)}}le.defaults=JSON.parse(JSON.stringify(Fr));var ce=(null===(Jr=window)||void 0===Jr||null===(Gr=Jr.prestoPlayer)||void 0===Gr||null===(Kr=Gr.i18n)||void 0===Kr?void 0:Kr.hide_chapters)||"Hide Chapters",he=(null===(Xr=window)||void 0===Xr||null===(Zr=Xr.prestoPlayer)||void 0===Zr||null===(te=Zr.i18n)||void 0===te?void 0:te.show_chapters)||"Show Chapters";const ye='<button class="plyr__controls__item plyr__control" type="button" data-plyr="chapters">\n<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list">\n <line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line>\n <line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line>\n <line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line>\n</svg>\n<span class="label--pressed plyr__tooltip" role="tooltip">'.concat(ce,'</span>\n<span class="label--not-pressed plyr__tooltip" role="tooltip">').concat(he,"</span>\n</button>\n");var ve,fe,_e;const ge='\n<div class="presto-player-toc__wrapper">\n <div class="presto-player-toc__cover" data-player-toc-cover></div>\n <div class="presto-player-toc">\n <div class="presto-player-toc__title">'.concat((null===(ve=window)||void 0===ve||null===(fe=ve.prestoPlayer)||void 0===fe||null===(_e=fe.i18n)||void 0===_e?void 0:_e.chapters)||"Chapters",'</div>\n <div class="presto-player-toc__list" data-player-toc></div>\n </div>\n</div>');function me(t){var r,e,i,o,n,a,s,l,u,c,h,y,v,f=0,_={},g=null,m=0;if("undefined"!=typeof jQuery)if(i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!t.length)return t;var r={};return t.forEach((function(t){var e,i=t.time.split(":");i.length>1&&(e=60*parseInt(i[0]));var o=parseInt(i[1])+parseInt(e);r[o]=t})),r}((null===(r=o=t.detail.plyr)||void 0===r||null===(e=r.config)||void 0===e?void 0:e.chapters)||[]),"html5"!==o.provider||o.duration){if(i&&Object.keys(i).length){n=jQuery(o.elements.container).closest(".presto-player__wrapper").find(".plyr");var b=(v=jQuery(o.elements.controls)).find(".plyr__time");b=b.length?b:v.find(".plyr__progress__container"),(u=n.find('[data-plyr="chapters"]')).length||(u=jQuery(ye).insertAfter(b)),(s=n.find(".presto-player-toc__wrapper")).length||(s=jQuery(ge).appendTo(n)),c=s.find("[data-player-toc-cover]"),l=s.find("[data-player-toc]"),a=n.find(".plyr__progress__container");var w,k=jQuery('<div class="presto-player__chapters"></div>').appendTo(a);h=jQuery('<div class="presto-player__chapter-markers"></div>').appendTo(k),w=0,l.find(".presto-player-toc__chapter").length||(Object.keys(i).forEach((function(t){w++;var r=jQuery(function(t){var r=t.name,e=void 0===r?"Untitled":r,i=t.order,o=void 0===i?1:i,n=t.highlight;return'<div class="presto-player-toc__chapter '.concat(void 0!==n&&n?"is-highlighted":"",'" data-chapter-item>\n \n <span class="presto-player-toc__order">\n ').concat(o,'\n </span>\n <span class="presto-player-toc__name">\n ').concat(e,"\n </div>\n</div>")}({name:i[t].title,order:w})).appendTo(l);r.data("presto-player-timestamp",t),_[t]=r,r.on("click",(function(){o.currentTime=parseFloat(t),o.playing||(o.play(),o.once("playing",(function(){setTimeout((function(){o.pause()}),50)}))),j(!1)}))})),y=s.find("[data-chapter-item]")),z(),u.off("click"),u.on("click",j),x(),o.off("timeupdate"),o.on("timeupdate",x),g=window.setInterval((function(){m++,o.duration&&(z(),window.clearInterval(g)),m>50&&window.clearInterval(g)}),100),c.off("click"),c.on("click",(function(){return j(!1)})),l.off("mouseleave"),l.on("mouseleave",(function t(){if(o.playing){var r=setTimeout((function(){j(!1),l.off("mouseleave",t)}),2e3);l.on("mouseenter",(function(){clearTimeout(r)}))}}))}}else o.on("loadedmetadata",me);function x(){f=o.currentTime;var t=Object.keys(i).filter((function(t){return t<=f})).map((function(t){return parseInt(t,10)})),r=Math.max.apply(Math,d(t));y&&y.removeClass("is-highlighted"),jQuery(_[r||0]).addClass("is-highlighted")}function z(){o.duration&&(Object.keys(i).forEach((function(t){if(parseInt(t)&&!h.find("[data-timestamp=".concat(t,"]")).length){var r,e,n,a,s=i[t],l=parseInt(t)/o.duration*100,p=jQuery((r={position:l,name:"".concat(s.title)},e=r.position,n=r.name,a=void 0===n?"":n,'<div class="presto-player-progress__marker plyr__controls__item plyr__control" style="left: '.concat(void 0===e?0:e,'%" data-timeline-marker>\n <span class="label--not-pressed plyr__tooltip" role="tooltip">').concat(a,"</span>\n </div>"))).prependTo(h);p.attr("data-timestamp",t),p.data("timestamp",t),p.on("click",(function(){o.currentTime=parseInt(t),o.play()}))}})),s.find("[data-timeline-marker]"))}function j(t){void 0!==p(t)?s.toggleClass("is-showing",t):s.toggleClass("is-showing")}}var be;function we(t){"undefined"!=typeof jQuery&&(be=t,jQuery(be.elements.container).closest(".presto-player__wrapper"),be.on("ready",me),be.on("controlshidden",ke),be.on("controlsshown",xe))}function ke(t){var r,e,i;"undefined"!=typeof jQuery&&jQuery(null==t||null===(r=t.detail)||void 0===r||null===(e=r.plyr)||void 0===e||null===(i=e.elements)||void 0===i?void 0:i.container).closest(".presto-player__wrapper").addClass("presto-player--hide-controls")}function xe(t){var r,e,i;"undefined"!=typeof jQuery&&jQuery(null==t||null===(r=t.detail)||void 0===r||null===(e=r.plyr)||void 0===e||null===(i=e.elements)||void 0===i?void 0:i.container).closest(".presto-player__wrapper").removeClass("presto-player--hide-controls")}function ze(t){var r,e;return a(a(a({video_current_time:parseInt((null==t?void 0:t.currentTime)||0),video_provider:(null==t?void 0:t.provider)||"html5"},null!=t&&t.duration?{video_duration:parseInt(null==t?void 0:t.duration)}:{}),null!=t&&t.source?{video_url:null==t?void 0:t.source}:{}),null!=t&&null!==(r=t.config)&&void 0!==r&&r.title?{video_title:null==t||null===(e=t.config)||void 0===e?void 0:e.title}:{})}function je(t){var r,e;null!=t&&null!==(r=t.config)&&void 0!==r&&r.hasPlayed||(t.config.hasPlayed=!0,null===(e=window)||void 0===e||e.gtag("event","Play",ze(t)))}function Te(t){var r;null===(r=window)||void 0===r||r.gtag("event","Pause",ze(t))}function Se(t){var r,e;null!=t&&null!==(r=t.config)&&void 0!==r&&r.hasLoaded||(t.config.hasLoaded=!0,null===(e=window)||void 0===e||e.gtag("event","Player Load",ze(t)))}var Ce,Pe={25:!1,50:!1,75:!1,100:!1};function Oe(t){if(t.currentTime){var r=parseFloat(t.currentTime)/parseFloat(t.duration)*100;Object.keys(Pe).forEach((function(e){var i;!Pe[e]&&r>=parseInt(e)&&(Pe[e]=!0,null===(i=window)||void 0===i||i.gtag("event","".concat(e," Percent Played"),ze(t)))}))}}var Ae="presto-player.analytics",Ie="",Me=0;function Ee(t){var r,e;(Ce=t).config.analytics&&null!==(r=window)&&void 0!==r&&null!==(e=r.wp)&&void 0!==e&&e.hooks&&(wp.hooks.hasAction("presto.nonceRefreshed",Ae)||wp.hooks.addAction("presto.nonceRefreshed",Ae,(function(t){Ie=t})),wp.hooks.hasAction("presto.playerPlay",Ae)||wp.hooks.addAction("presto.playerPlay",Ae,Fe),wp.hooks.hasAction("presto.playerEnded",Ae)||wp.hooks.addAction("presto.playerEnded",Ae,Fe),wp.hooks.hasAction("presto.playerHidden",Ae)||wp.hooks.addAction("presto.playerHidden",Ae,Fe),wp.hooks.hasAction("presto.playerPause",Ae)||wp.hooks.addAction("presto.playerPause",Ae,Fe),wp.hooks.hasAction("presto.playerSeeked",Ae)||wp.hooks.addAction("presto.playerSeeked",Ae,Fe))}function Fe(t){isNaN(null==t?void 0:t.currentTime)||Le(function(t){var r,e;return t.currentTime>Me&&(Me=t.currentTime),t.currentTime>=t.duration&&(Me=t.duration),a(a(a({video_current_time:parseInt(Me),video_provider:(null==t?void 0:t.provider)||"html5"},null!=t&&t.duration?{video_duration:parseInt(null==t?void 0:t.duration)}:{}),null!=t&&t.source?{video_url:null==t?void 0:t.source}:{}),null!=t&&null!==(r=t.config)&&void 0!==r&&r.title?{video_title:null==t||null===(e=t.config)||void 0===e?void 0:e.title}:{})}(t))}function Le(t){var r,e,i,o,n,a,s,l;if(Ie){var p,u,d=new FormData;d.append("action","presto_player_progress"),d.append("duration",null==t?void 0:t.video_current_time),d.append("video_id",null===(r=Ce)||void 0===r||null===(e=r.config)||void 0===e?void 0:e.id),d.append("nonce",Ie),null!==(i=window)&&void 0!==i&&null!==(o=i.prestoPlayer)&&void 0!==o&&o.debug_navigator?"undefined"!=typeof jQuery&&jQuery.ajax({type:"POST",url:null===(n=window)||void 0===n||null===(a=n.prestoPlayer)||void 0===a?void 0:a.ajaxurl,dataType:"json",cache:!1,data:{action:"presto_player_progress",duration:null==t?void 0:t.video_current_time,video_id:null===(s=Ce)||void 0===s||null===(l=s.config)||void 0===l?void 0:l.id,nonce:Ie}}):navigator.sendBeacon(null===(p=window)||void 0===p||null===(u=p.prestoPlayer)||void 0===u?void 0:u.ajaxurl,d)}}function Re(t){var r,e;null!==(r=window)&&void 0!==r&&null!==(e=r.prestoPlayer)&&void 0!==e&&e.isPremium&&(function(){var t;null!==(t=window)&&void 0!==t&&t.gtag&&(wp.hooks.addAction("presto.playerPlay","presto-player",je),wp.hooks.addAction("presto.playerPause","presto-player",Te),wp.hooks.addAction("presto.playerReady","presto-player",Se),wp.hooks.addAction("presto.playerTimeUpdate","presto-player",Oe))}(),Ee(t))}const Ne=function(t){t.on("ready",(function(){var r,e,i,o;null==t||null===(r=t.config)||void 0===r||!r.logo||null!=t&&null!==(e=t.config)&&void 0!==e&&e.logo_added||"undefined"!=typeof jQuery&&(t.isAudio||(jQuery('<img src="'.concat(null==t||null===(i=t.config)||void 0===i?void 0:i.logo,'" class="presto-player__logo is-bottom-right" part="logo">')).insertBefore(null==t||null===(o=t.elements)||void 0===o?void 0:o.controls),t.config.logo_added=!0))}))};function Be(t){var r;null!=t&&null!==(r=t.config)&&void 0!==r&&r.poster&&(t.poster=t.config.poster)}const De=function(t){var r,e;null!==(r=window)&&void 0!==r&&null!==(e=r.wp)&&void 0!==e&&e.hooks&&(t.on("ready",(function(){$e("Ready",t)})),t.on("play",(function(){$e("Play",t)})),t.on("playing",(function(){$e("Playing",t)})),t.on("pause",(function(){$e("Pause",t)})),t.on("ended",(function(){$e("Ended",t)})),t.on("seeked",(function(){$e("Seeked",t)})),t.on("timeupdate",(function(){$e("TimeUpdate",t)})),t.on("enterfullscreen",(function(){$e("EnterFullScreen",t)})),t.on("exitfullscreen",(function(){$e("ExitFullScreen",t)})),document.addEventListener("visibilitychange",(function(){$e("hidden"===document.visibilityState?"Hidden":"Visible",t)})),t.on("statechange",(function(r){var e;switch(null==r||null===(e=r.detail)||void 0===e?void 0:e.code){case 0:$e("Ended",t);break;case 1:$e("Play",t);break;case 2:$e("Pause",t)}})))};function $e(t,r){window.wp.hooks.doAction("presto.player".concat(t),r)}let qe,Ve=Date.now();const He=t=>{var r,e;if(!t.automations)return;(null===(e=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===e?void 0:e.hasAction("presto.nonceRefreshed","presto-player.progress"))||window.wp.hooks.addAction("presto.nonceRefreshed","presto-player.progress",(t=>{qe=t})),null===window||void 0===window||window.wp.hooks.addAction("presto.playerTimeUpdate","presto-player",o),null===window||void 0===window||window.wp.hooks.addAction("presto.playerEnded","presto-player",(t=>o(t,100)));let i={0:!1,10:!1,20:!1,30:!1,40:!1,50:!1,60:!1,70:!1,80:!1,90:!1,100:!1};function o(t,r=null){var e;qe&&(null===(e=null==t?void 0:t.config)||void 0===e?void 0:e.ajaxProgress)&&(r||(r=parseFloat(t.currentTime)/parseFloat(t.duration)*100),t.watched=t.watched||{},Object.keys(i).forEach((e=>{var i,o,n,a,s,l,p,u,d;const c=parseInt(e);if(!t.watched[c]&&r>=c){t.watched[c]=!0;let r=new FormData;if(r.append("action","presto_player_progress_percent"),r.append("id",null===(i=null==t?void 0:t.config)||void 0===i?void 0:i.id),r.append("percent",c.toString()),r.append("visit_time",Ve.toString()),r.append("nonce",qe),(null===(o=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===o?void 0:o.debug)&&console.log(`${c} percent watched.`),null===(n=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===n?void 0:n.debug_navigator)window.jQuery.ajax({type:"POST",url:null===(u=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===u?void 0:u.ajaxurl,dataType:"json",cache:!1,data:{action:"presto_player_progress_percent",id:null===(d=null==t?void 0:t.config)||void 0===d?void 0:d.id,visit_time:Ve,percent:c,nonce:qe}});else{let e=navigator.sendBeacon(null===(a=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===a?void 0:a.ajaxurl,r);(null===(s=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===s?void 0:s.debug)&&(e?console.log("Successfully queued progress:",{id:null===(l=null==t?void 0:t.config)||void 0===l?void 0:l.id,percent:c,visit_time:Ve,nonce:qe}):console.log("Failed to queue progress",{id:null===(p=null==t?void 0:t.config)||void 0===p?void 0:p.id,percent:c,visit_time:Ve,nonce:qe}))}}})))}};let Ue=!1,Qe=!1;function Ye(t){return t.status>=200&&t.status<300?Promise.resolve(t):Promise.reject(new Error(t.statusText))}const We=t=>{var r,e;(t.config.analytics||t.config.automations)&&(null===(e=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===e||e.addAction("presto.playerPlaying","presto-player",(()=>{null===window||void 0===window||window.wp.hooks.doAction("presto.playerGetNonce")})),null===window||void 0===window||window.wp.hooks.addAction("presto.playerGetNonce","presto-player",(()=>{var t;Ue||Qe||(Qe=!0,fetch(`${null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.ajaxurl}?action=presto_refresh_progress_nonce`).then(Ye).then((t=>t.json())).then((({data:t})=>{null===window||void 0===window||window.wp.hooks.doAction("presto.nonceRefreshed",t),Ue=!0})).catch((function(t){console.log("Request failed",t)})).finally((()=>{Qe=!1})))})))},Je=function(t){var r=window.navigator.userAgent;if(r.match(/iPad/i)||r.match(/iPhone/i)){var e=function(t,r){for(var e,i,o,n=null==t||null===(e=t.elements)||void 0===e||null===(i=e.container)||void 0===i||null===(o=i.getRootNode())||void 0===o?void 0:o.host;(null!=n?n.nodeType:void 0)===Node.ELEMENT_NODE&&"BODY"!==n.tagName&&"HTML"!==n.tagName;)r?n.classList.add("presto-player-fullscreen-open"):n.classList.remove("presto-player-fullscreen-open"),n=n.parentNode};wp.hooks.addAction("presto.playerEnterFullScreen","presto-player",(function(){var r;null!=t&&null!==(r=t.fullscreen)&&void 0!==r&&r.active&&e(t,!0)})),wp.hooks.addAction("presto.playerExitFullScreen","presto-player",(function(){var r;null!=t&&null!==(r=t.fullscreen)&&void 0!==r&&r.active||e(t,!1)}))}},Ge=function(){var t=y(regeneratorRuntime.mark((function t(r){var e,i,o,n,a,s,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"!=typeof jQuery){t.next=2;break}return t.abrupt("return");case 2:if("ResizeObserver"in window!=0){t.next=7;break}return t.next=5,import("./p-97e2763b.js");case 5:window.ResizeObserver=t.sent.ResizeObserver;case 7:if(l=new ResizeObserver((function(t){var r,e=v(t);try{for(e.s();!(r=e.n()).done;){var i=r.value,o=i.contentRect;jQuery(i.target).find(".plyr__menu__container").css({maxHeight:"".concat(Math.max(o.height-48,200),"px")})}}catch(t){e.e(t)}finally{e.f()}})),null!=r&&null!==(e=r.elements)&&void 0!==e&&null!==(i=e.container)&&void 0!==i&&null!==(o=i.getRootNode())&&void 0!==o&&o.firstChild){t.next=10;break}return t.abrupt("return");case 10:if(l.observe(null==r||null===(n=r.elements)||void 0===n||null===(a=n.container)||void 0===a||null===(s=a.getRootNode())||void 0===s?void 0:s.firstChild),r){t.next=13;break}return t.abrupt("return");case 13:r.on("playing",(function(){var t,e,i,o,n=null==r||null===(t=r.elements)||void 0===t||null===(e=t.container)||void 0===e?void 0:e.getRootNode().firstChild.getBoundingClientRect();jQuery(null==r||null===(i=r.elements)||void 0===i||null===(o=i.container)||void 0===o?void 0:o.getRootNode()).find(".plyr__menu__container").css({maxHeight:"".concat(Math.max(n.height-48,200),"px")})}));case 14:case"end":return t.stop()}}),t)})));return function(r){return t.apply(this,arguments)}}();function Ke(t){var r,e,i,o,n,s,l,p,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=a(a(a({},d),null!==(r=window)&&void 0!==r&&null!==(e=r.prestoPlayer)&&void 0!==e&&e.plugin_url?{iconUrl:"".concat(null===(i=window)||void 0===i||null===(o=i.prestoPlayer)||void 0===o?void 0:o.plugin_url,"img/")+"".concat(null!=d&&null!==(n=d.preset)&&void 0!==n&&n.skin?d.preset.skin:"default")+".svg"}:{}),{chapters:(null==d?void 0:d.chapters)||[],controls:(null==d?void 0:d.controls)||[],settings:Object.keys((null==d?void 0:d.settings)||{}).length?d.settings:{}}),h=new le(t,c);return"undefined"!=typeof learndash_video_data&&import("./p-06502f62.js").then((function(t){(0,t.default)(h)})),"undefined"!=typeof _tutorobject&&import("./p-0e1cd603.js").then((function(t){(0,t.default)(h)})),void 0!==window.llms&&!0===(null===(p=prestoPlayer)||void 0===p||null===(u=p.lifter)||void 0===u?void 0:u.isLesson)&&import("./p-68f17ca9.js").then((function(t){(0,t.default)(h)})),De(h),Je(h),Ge(h),Ne(h),Be(h),we(h),null!==(s=window)&&void 0!==s&&null!==(l=s.prestoPlayer)&&void 0!==l&&l.isAdmin||(We(h),He(c),pe(h),Re(h)),h}function Xe(t){return"string"==typeof t&&t.includes(".m3u8")}var Ze=function(t){var r=t.config,e=t.selector;return new Promise((function(t){return t(new Ke(e,a({},r)))}))};let ti=class{constructor(r){t(this,r),this.loaded=i(this,"loaded",7),this.currentMediaPlayer=i(this,"currentMediaPlayer",7),this.isAdmin=!1,this.previouslyPlaying=!1,this.ctaActive=!1,this.emailActive=!1,this.actionBarActive=!1,this.components={cta:null,email:null,overlays:null}}async play(t=!1){this.shouldLazyLoad=!1,t&&(this.mutedPreview=!1),this.player.play()}async goToAndPlay(t){this.player.play(),this.player.currentTime=t}handleScroll(t){t.detail.id!==this.player.id&&(this.mutedPreview||this.pause())}async restart(){return this.shouldLazyLoad=!1,this.player.restart()}async pause(){return this.player.pause()}async stop(){return this.player.stop()}async fullscreenToggle(t){return this.player.fullscreen.toggle(t)}async on(t,r){return this.player.on(t,r)}async once(t,r){return this.player.once(t,r)}async off(t,r){return this.player.off(t,r)}async handleCurrentTimeChange(t){this.player&&Number.isInteger(t)&&(this.player.duration&&(this.player.currentTime=Math.min(this.player.currentTime,this.player.duration)),this.shouldLazyLoad&&(this.shouldLazyLoad=!1,await new Promise((t=>{setTimeout((async()=>{await this.initialize(),t()}),50)}))),this.player.embed&&!this.player.playing?(this.player.currentTime=t,this.player.muted=!0,this.player.play(),this.player.once("timeupdate",(()=>{this.player.pause(),this.player.currentTime=t,this.player.muted=!1}))):this.player.currentTime=t)}handleStickyChange(){(function(t){for(var r=[];t.parentNode&&"body"!=t.parentNode.nodeName.toLowerCase();)r.push(t=t.parentNode);return r})(this.el).forEach((t=>{t.classList.toggle("presto-sticky-parent",this.isSticky)}))}getConfig(){return Object.assign(Object.assign({},function({preset:t={},chapters:r,branding:e,src:i,analytics:o,automations:n,autoplay:a,blockAttributes:s={},provider:l="",provider_video_id:p="",youtube:u,type:d,isAdmin:c,i18n:h,storage:y={enabled:!c,key:`presto-player-${t.id}`}}){var v,f,_,g;const m=["settings"],b=[...["youtube","vimeo"].includes(l)?["pip"]:[]],w=["play-large","rewind","play","fast-forward","progress","current-time","mute","volume","captions","settings","pip","fullscreen"].filter((r=>((null==t?void 0:t[r])||m.includes(r))&&!b.includes(r)));(null===(v=null==s?void 0:s.mutedPreview)||void 0===v?void 0:v.enabled)&&(y={enabled:!1});let k=Object.assign(Object.assign(Object.assign(Object.assign({id:null==s?void 0:s.id,title:(null==s?void 0:s.title)||"",blockAttributes:Object.assign(Object.assign({},s),{type:d}),src:i,ajaxProgress:!0,analytics:o,preset:t,automations:n,mutedPreview:{enabled:null===(f=null==s?void 0:s.mutedPreview)||void 0===f?void 0:f.enabled},loop:{active:"loop"===(null==t?void 0:t.on_video_end)},chapters:r,controls:w,settings:["captions","quality","loop",...(null==t?void 0:t.speed)?["speed"]:[]],hideControls:null==t?void 0:t.auto_hide,captions:{active:null==t?void 0:t.captions_enabled,language:"auto",update:!1},logo:null==e?void 0:e.logo,logo_width:null==e?void 0:e.logo_width,hide_logo:null==t?void 0:t.hide_logo,lazy_load_youtube:null==t?void 0:t.lazy_load_youtube,save_player_position:!!(null==t?void 0:t.save_player_position),sticky_scroll:null==t?void 0:t.sticky_scroll,play_video_viewport:null==t?void 0:t.play_video_viewport,autoplay:!(!a||(null===(_=window.wp)||void 0===_?void 0:_.blocks))},l?{provider:l}:{}),p?{provider_video_id:p}:{}),(null==s?void 0:s.poster)?{poster:s.poster}:{}),{invertTime:!t.hasOwnProperty("invert_time")||(null==t?void 0:t.invert_time),storage:y,keyboard:{focused:!1,global:!1},resetOnEnd:!!(null==t?void 0:t.reset_on_end),vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,premium:!1,playsinline:!!(null==s?void 0:s.playsInline)},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!!(null==u?void 0:u.noCookie),playsinline:!!(null==s?void 0:s.playsInline)},tooltips:{controls:!0,seek:!0},i18n:h});return(null===(g=null===window||void 0===window?void 0:window.wp)||void 0===g?void 0:g.hooks)&&(k=window.wp.hooks.applyFilters("presto.playerSettings",k)),k}({preset:this.preset,chapters:this.chapters,branding:this.branding,analytics:!!this.analytics,automations:!!this.automations,autoplay:!this.isAdmin&&!!this.autoplay,blockAttributes:this.blockAttributes,provider:this.provider,youtube:this.youtube,provider_video_id:this.provider_video_id,i18n:this.i18n})),this.iconUrl?{iconUrl:this.iconUrl}:{})}getPlayerData(){return{selector:this.playerEl,src:this.src||"",preload:this.preload,provider:this.provider,config:this.getConfig(),isAdmin:this.isAdmin}}async createPlayer(){return await(t=this.getPlayerData(),r=t.config,e=t.selector,i=t.src,o=t.preload,i&&Xe(i)?e&&e.canPlayType("application/vnd.apple.mpegurl")&&w()?Ze({config:r,selector:e}):import("./p-82ad268e.js").then((function(t){return(0,t.default)({config:r,selector:e,src:i,preload:o})})):Ze({config:r,selector:e}));var t,r,e,i,o}handlePlayerElementChange(){var t;(({src:t,el:r,preload:e,currentTime:i})=>{if(!r.getAttribute("hls_loaded")&&["metadata","none"].includes(e)&&Xe(t)){if(i>0)return r.style.height=null,r.style.paddingBottom=null,void r.setAttribute("hls_loaded","1");r.style.height="0px",r.style.paddingBottom="56.25%"}})({src:this.src,el:this.playerEl,preload:this.preload,currentTime:null===(t=null==this?void 0:this.player)||void 0===t?void 0:t.currentTime})}handleMutedPreview(t,r){var e,i,o,n,a,s,l;this.player&&!this.isAdmin&&(!t&&r&&this.player.once("timeupdate",(()=>{var t,r;this.player.loop="loop"===(null===(t=this.preset)||void 0===t?void 0:t.on_video_end),this.player.toggleCaptions(null===(r=null==this?void 0:this.preset)||void 0===r?void 0:r.captions_enabled)})),(null===(o=null===(i=null===(e=this.originalConfig)||void 0===e?void 0:e.blockAttributes)||void 0===i?void 0:i.mutedPreview)||void 0===o?void 0:o.enabled)&&(({player:t,mutedPreview:r,captions:e,progress:i,savePosition:o,onPlay:n})=>{var a=window.navigator.userAgent;if(!a.match(/iPad/i)&&!a.match(/iPhone/i)){t.config.mutedPreview.enabled=r,t.muted=r,t.loop=r,t.config.ajaxProgress=!r&&i,t.config.save_player_position=!r&&o;try{t.toggleCaptions(!!r&&!!e)}catch(t){}return setTimeout((()=>{de(t)||t.restart(),setTimeout((()=>{t.muted=r,n()}),50)}),0),t}console.log("ios device, do not do muted autoplay")})({player:this.player,mutedPreview:this.mutedPreview,captions:!!(null===(a=null===(n=this.blockAttributes)||void 0===n?void 0:n.mutedPreview)||void 0===a?void 0:a.captions),progress:null===(s=this.originalConfig)||void 0===s?void 0:s.ajaxProgress,savePosition:null===(l=this.originalConfig)||void 0===l?void 0:l.save_player_position,onPlay:()=>this.play()}))}onPlayerReady(){var t,r,e;this.observer&&(this.observer.disconnect(),this.observer.observe(this.el)),this.duration=this.player.duration;var i=window.navigator.userAgent;!!i.match(/iPad/i)||!!i.match(/iPhone/i)||(this.mutedPreview=null===(r=null===(t=this.blockAttributes)||void 0===t?void 0:t.mutedPreview)||void 0===r?void 0:r.enabled),this.renderDynamicOverlays(),this.renderVideoCTA(),this.renderEmailOverlay(),this.player.on("timeupdate loadedmetadata",(()=>{this.duration=this.player.duration,this.renderDynamicOverlays()})),Xe(this.src)&&this.player.once("playing",(()=>{this.playerEl.style.height=null,this.playerEl.style.paddingBottom=null,this.playerEl.setAttribute("hls_loaded","1")})),this.player.on("playing",(()=>this.playClass="presto-player--playing")),this.player.on("pause",(()=>this.playClass="presto-player--paused")),this.player.on("ended",(()=>this.playClass="presto-player--ended")),this.player.on("playing",(t=>!this.mutedPreview&&this.currentMediaPlayer.emit(t.detail.plyr))),"go-to-start"===(null===(e=this.preset)||void 0===e?void 0:e.on_video_end)&&this.player.on("ended",(()=>{this.restart(),"youtube"===this.provider&&this.stop()}))}handlePlayerEvents(t){t.on("ready",(t=>{this.player=t.detail.plyr,this.onPlayerReady()}))}handleLazyLoadChange(){"youtube"!==this.provider||this.shouldLazyLoad||this.isAdmin||setTimeout((()=>{this.onReload("play")}),50)}shouldLazyLoadVideo(){var t,r,e;return"youtube"===this.provider&&!this.autoplay&&!(null===(r=null===(t=this.blockAttributes)||void 0===t?void 0:t.mutedPreview)||void 0===r?void 0:r.enabled)&&!!(null===(e=this.preset)||void 0===e?void 0:e.lazy_load_youtube)}componentWillLoad(){var t,r,e;const i=null===(t=this.el.children)||void 0===t?void 0:t[0];i&&i.classList&&i.classList.contains("presto-iframe-fallback-container")&&i.remove(),this.shouldLazyLoad=this.shouldLazyLoadVideo(),this.i18n=(null===(r=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===r?void 0:r.i18n)||(null===(e=null===window||void 0===window?void 0:window.prestoPlayerAdmin)||void 0===e?void 0:e.i18n),this.originalConfig||(this.originalConfig=this.getConfig()),this.trackIntersection()}async componentDidLoad(){setTimeout((()=>{this.initialize(),this.loaded.emit(!0)}),0)}async initialize(){const t=await this.createPlayer();return this.handlePlayerEvents(t),this.syncVideoHeight(),((t,r)=>{if(!r)return;const e=document.createElement("style");t.shadowRoot.append(e),e.appendChild(document.createTextNode(r))})(this.el,this.css),t}renderSkins(){var t,e,i;return"modern"===(null===(t=this.preset)||void 0===t?void 0:t.skin)?r("presto-modern-skin",null):"business"===(null===(e=this.preset)||void 0===e?void 0:e.skin)?r("presto-business-skin",null):"stacked"===(null===(i=this.preset)||void 0===i?void 0:i.skin)?r("presto-stacked-skin",null):void 0}async onReload(t){const r=await this.initialize();"play"==t&&r.on("ready",(()=>{this.play(),r.muted=!0,r.muted=!1,r.off("ready",this.play)}))}async syncVideoHeight(){if("ResizeObserver"in window==0){const t=await import("./p-97e2763b.js");window.ResizeObserver=t.ResizeObserver}new ResizeObserver((()=>{this.isSticky||(this.videoHeight=this.el.getBoundingClientRect().height)})).observe(this.el)}handleRestartVideo(){this.player.once("timeupdate",(()=>{setTimeout((()=>this.play()),500)})),this.player.restart()}handlePlayVideo(){this.play()}handlePauseVideo(t){this.pause(),t.detail&&function(t){var r,e,i,o,n;if("unknown"!==b()&&!(null===(e=null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.blockAttributes)||void 0===e?void 0:e.playsInline)&&("function"==typeof(null===(i=null==t?void 0:t.media)||void 0===i?void 0:i.webkitExitFullScreen)&&(null==t||t.media.webkitExitFullScreen()),"function"==typeof(null===(o=null==t?void 0:t.embed)||void 0===o?void 0:o.exitFullscreen)&&(null===(n=null==t?void 0:t.embed)||void 0===n||n.exitFullscreen()),"youtube"===t.provider)){const r=t.currentTime;t.currentTime=t.duration,t.once("playing",(()=>{t.currentTime=r}))}}(this.player)}playVideoOnlyInViewport(){var t;!this.isAdmin&&(null===(t=this.preset)||void 0===t?void 0:t.play_video_viewport)&&this.player&&("visible"===document.visibilityState?this.observer.observe(this.el):(this.player.playing&&(this.previouslyPlaying=!0),this.pause(),this.observer.disconnect()))}trackIntersection(){this.observer=new IntersectionObserver((t=>{this.handleVisibilityIntersection(null==t?void 0:t[0])})),this.observer.observe(this.el)}handleVisibilityIntersection(t){t&&(this.handleStickyScroll(t),this.handleVisibilityPlayChange(t))}handleStickyScroll(t){var r,e;if(!(null===(r=this.preset)||void 0===r?void 0:r.sticky_scroll))return;if(this.isAdmin||this.mutedPreview||!(null===(e=null==this?void 0:this.player)||void 0===e?void 0:e.playing))return void(this.isSticky=!1);let i=t.boundingClientRect;if(this.isSticky=i.height<-i.top,"visible"===document.visibilityState&&this.isSticky&&this.player){const t=()=>{window.removeEventListener("scroll",t),this.player.paused&&(this.isSticky=!1)};this.player.once("pause",(()=>{window.addEventListener("scroll",t)}))}}handleVisibilityPlayChange(t){var r,e,i;if(!this.isAdmin&&(null===(r=this.preset)||void 0===r?void 0:r.play_video_viewport)&&(!this.player&&this.originalConfig.autoplay&&(this.previouslyPlaying=!0,this.autoplay=!!(null==t?void 0:t.isIntersecting)),this.player)){if(null==t?void 0:t.isIntersecting)return this.originalConfig.autoplay&&(this.autoplay=!0),this.previouslyPlaying&&this.play(),void(this.previouslyPlaying=!1);if("visible"!==document.visibilityState||!this.isSticky){if(null===(i=null===(e=this.blockAttributes)||void 0===e?void 0:e.mutedPreview)||void 0===i?void 0:i.enabled)return this.previouslyPlaying=!0,this.pause(),void this.player.once("playing",(()=>{this.previouslyPlaying=!0,this.pause()}));this.player.playing&&(this.previouslyPlaying=!0),this.pause()}}}renderMutedOverlay(){var t;if(this.player&&this.mutedPreview&&!this.isAdmin)return r("presto-muted-overlay",{mutedOverlay:null===(t=this.player.config.blockAttributes)||void 0===t?void 0:t.mutedOverlay,preset:this.preset,onPlayVideo:()=>{this.mutedPreview=!1,this.play()}})}renderVideo(){var t;switch(this.provider){case"vimeo":return r("presto-vimeo",{player:this.player,getRef:t=>this.playerEl=t,poster:this.poster,src:this.src});case"youtube":return r("presto-youtube",{onReload:t=>this.onReload(null==t?void 0:t.detail),player:this.player,getRef:t=>this.playerEl=t,lazyLoad:this.shouldLazyLoad,poster:this.poster,src:this.src});case"bunny":return r("presto-bunny",{thumbnail:null===(t=null==this?void 0:this.bunny)||void 0===t?void 0:t.thumbnail,getRef:t=>this.playerEl=t,player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,playsinline:this.playsinline,src:this.src,tracks:this.tracks,videoAttributes:this.videoAttributes});case"audio":return r("presto-audio",{getRef:t=>this.playerEl=t,player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,preset:this.preset,src:this.src,tracks:this.tracks,mediaTitle:this.mediaTitle,audioAttributes:this.audioAttributes});default:return r("presto-video",{getRef:t=>this.playerEl=t,player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,playsinline:this.playsinline,src:this.src,tracks:this.tracks,videoAttributes:this.videoAttributes})}}renderVideoCTA(){var t,r,e,i;(null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.isPremium)&&(this.isAdmin||(null===(e=null===(r=this.preset)||void 0===r?void 0:r.cta)||void 0===e?void 0:e.enabled)&&((null===(i=this.components.cta)||void 0===i?void 0:i.offsetParent)||"audio"!==this.provider&&(this.components.cta=document.createElement("presto-cta-overlay"),this.components.cta.direction=this.direction,this.components.cta.player=this.player,this.components.cta.preset=this.preset,this.components.cta.i18n=this.i18n,this.player.elements.container.append(this.components.cta))))}renderAudioCTA(){var t,e;if("audio"===this.provider&&this.player&&(null===(e=null===(t=this.preset)||void 0===t?void 0:t.cta)||void 0===e?void 0:e.enabled))return r("presto-cta-overlay",{direction:this.direction,player:this.player,preset:this.preset,i18n:this.i18n,provider:this.provider})}renderEmailOverlay(){var t,r,e;!(null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.isPremium)||this.isAdmin||(null===(r=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===r?void 0:r.logged_in)||(null===(e=this.components.email)||void 0===e?void 0:e.offsetParent)||"audio"!==this.provider&&(this.components.email=document.createElement("presto-email-overlay"),this.components.email.direction=this.direction,this.components.email.player=this.player,this.components.email.preset=this.preset,this.components.email.i18n=this.i18n,this.components.email.videoId=this.video_id,this.player.elements.container.append(this.components.email))}renderAudioEmail(){var t,e;if("audio"===this.provider&&this.player&&(null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.isPremium)&&!this.isAdmin&&!(null===(e=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===e?void 0:e.logged_in))return r("presto-email-overlay",{direction:this.direction,player:this.player,preset:this.preset,i18n:this.i18n,provider:this.provider})}renderActionBar(){var t,e;if((null===(e=null===(t=this.preset)||void 0===t?void 0:t.action_bar)||void 0===e?void 0:e.enabled)&&this.player)return r("presto-action-bar",{config:this.preset.action_bar,player:null==this?void 0:this.player,youtube:this.youtube})}stickyPositionClass(){var t,r;return this.isSticky?(null===(t=this.preset)||void 0===t?void 0:t.sticky_scroll_position)?`presto-sticky--${null===(r=this.preset)||void 0===r?void 0:r.sticky_scroll_position.replace(/\s+/g,"-")}`:"presto-sticky--bottom-right":""}renderDynamicOverlays(){var t,r,e,i,o,n,a;this.player&&((null===(t=null==this?void 0:this.overlaysComponent)||void 0===t?void 0:t.offsetParent)||(this.overlaysComponent=document.createElement("presto-dynamic-overlays"),this.overlaysComponent.addEventListener("reloadComponent",(()=>{this.overlaysComponent.remove(),this.overlaysComponent=document.createElement("presto-dynamic-overlays")}),{once:!0})),this.overlaysComponent.style.cssText="display: block !important; opacity: 1 !important; visibility: visible !important;",this.overlaysComponent.overlays=this.overlays,this.overlaysComponent.preset=this.preset,this.overlaysComponent.player=this.player,this.overlaysComponent.enabled=!(null===(i=null===(e=null===(r=this.player)||void 0===r?void 0:r.config)||void 0===e?void 0:e.mutedPreview)||void 0===i?void 0:i.enabled),(null===(o=null==this?void 0:this.overlaysComponent)||void 0===o?void 0:o.offsetParent)||null===(a=null===(n=this.player.elements)||void 0===n?void 0:n.wrapper)||void 0===a||a.append(this.overlaysComponent))}handleCtaStateChange(t){this.ctaActive=t.detail}handleEmailStateChange(t){this.emailActive=t.detail}handleActionBarStateChange(t){this.actionBarActive=t.detail}render(){var t,e,i,n,a,s,l,p;return r(o,{style:{height:this.isSticky?`${this.videoHeight}px`:"auto"}},r("div",{part:"wrapper",dir:this.direction,class:`presto-player__wrapper fitvidsignore\n presto-video-id-${this.video_id}\n ${this.isSticky?"audio"===this.provider?"presto-sticky-audio":"presto-sticky":""}\n ${"audio"!==this.provider?this.stickyPositionClass():""}\n ${"rtl"===this.direction?"rtl":""}\n ${!0===this.ctaActive?"cta-active":""}\n ${!0===this.emailActive?"email-active":""}\n ${!0===this.actionBarActive&&(null===(e=null===(t=this.preset)||void 0===t?void 0:t.action_bar)||void 0===e?void 0:e.enabled)?"action-bar-active":""}\n ${!!(null===(i=this.preset)||void 0===i?void 0:i.skin)&&`skin-${null===(n=this.preset)||void 0===n?void 0:n.skin}`}\n ${(null===(a=this.preset)||void 0===a?void 0:a.hide_youtube)?"hide-youtube-ui":""}\n ${(null===(s=this.preset)||void 0===s?void 0:s.caption_style)?`caption-style-${null===(l=this.preset)||void 0===l?void 0:l.caption_style}`:""}\n ${this.mutedPreview?"is-muted-overlay":""}\n ${this.playClass?this.playClass:""}\n ${(null===(p=this.preset)||void 0===p?void 0:p.play)&&!this.preset.rewind?"rewind-inactive":""}\n ${this.classes||""}`},r("div",null,r("slot",{name:"player-start"}),r("slot",{name:"player-before-video"}),this.renderVideo(),r("slot",{name:"player-after-video"}),this.renderActionBar(),this.renderMutedOverlay(),this.renderAudioCTA(),this.renderAudioEmail(),this.renderSkins(),r("slot",{name:"player-end"}))))}get el(){return e(this)}static get watchers(){return{currentTime:["handleCurrentTimeChange"],isSticky:["handleStickyChange"],playerEl:["handlePlayerElementChange"],player:["handlePlayerElementChange"],mutedPreview:["handleMutedPreview"],shouldLazyLoad:["handleLazyLoadChange"],overlays:["renderDynamicOverlays"],preset:["renderDynamicOverlays"]}}};ti.style='@charset "UTF-8";@keyframes plyr-progress{to{background-position:var(--plyr-progress-loading-size, 25px) 0}}@keyframes plyr-popup{0%{opacity:0.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:var(--plyr-font-family, inherit);font-variant-numeric:tabular-nums;font-weight:var(--plyr-font-weight-regular, 400);line-height:var(--plyr-line-height, 1.7);max-width:100%;min-width:200px;position:relative;text-shadow:none;transition:box-shadow 0.3s ease;z-index:0}.plyr video,.plyr audio,.plyr iframe{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 input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:var(--plyr-badge-background, #4a5464);border-radius:var(--plyr-badge-border-radius, 2px);color:var(--plyr-badge-text-color, #fff);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 0.3s ease;bottom:0;display:none;font-size:var(--plyr-font-size-small, 13px);left:0;padding:var(--plyr-control-spacing, 10px);position:absolute;text-align:center;transition:transform 0.4s ease-in-out;width:100%}.plyr__captions span:empty{display:none}@media (min-width: 480px){.plyr__captions{font-size:var(--plyr-font-size-base, 15px);padding:calc(var(--plyr-control-spacing, 10px) * 2)}}@media (min-width: 768px){.plyr__captions{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(var(--plyr-control-spacing, 10px) * -4))}.plyr__caption{background:var(--plyr-captions-background, rgba(0, 0, 0, 0.8));border-radius:2px;box-decoration-break:clone;color:var(--plyr-captions-text-color, #fff);line-height:185%;padding:0.2em 0.5em;white-space:pre-wrap}.plyr__caption div{display:inline}.plyr__control{background:transparent;border:0;border-radius:var(--plyr-control-radius, 3px);color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:calc(var(--plyr-control-spacing, 10px) * 0.7);position:relative;transition:all 0.3s ease}.plyr__control svg{display:block;fill:currentColor;height:var(--plyr-control-icon-size, 18px);pointer-events:none;width:var(--plyr-control-icon-size, 18px)}.plyr__control:focus{outline:0}.plyr__control.plyr__tab-focus{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{text-decoration:none}a.plyr__control::after,a.plyr__control::before{display:none}.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed,.plyr__control.plyr__control--pressed .label--not-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(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(var(--plyr-control-spacing, 10px) / 4)}.plyr__controls .plyr__controls__item.plyr__time{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:first-child,.plyr__controls .plyr__controls__item.plyr__time+.plyr__time{padding-left:0}.plyr__controls:empty{display:none}.plyr [data-plyr=captions],.plyr [data-plyr=pip],.plyr [data-plyr=airplay],.plyr [data-plyr=fullscreen]{display:none}.plyr--captions-enabled [data-plyr=captions],.plyr--pip-supported [data-plyr=pip],.plyr--airplay-supported [data-plyr=airplay],.plyr--fullscreen-enabled [data-plyr=fullscreen]{display:inline-block}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform 0.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 0.2s ease;background:var(--plyr-menu-background, rgba(255, 255, 255, 0.9));border-radius:4px;bottom:100%;box-shadow:var(--plyr-menu-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));color:var(--plyr-menu-color, #4a5464);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 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1)}.plyr__menu__container::after{border:var(--plyr-menu-arrow-size, 4px) solid transparent;border-top-color:var(--plyr-menu-background, rgba(255, 255, 255, 0.9));content:"";height:0;position:absolute;right:calc(((var(--plyr-control-icon-size, 18px) / 2) + calc(var(--plyr-control-spacing, 10px) * 0.7)) - (var(--plyr-menu-arrow-size, 4px) / 2));top:100%;width:0}.plyr__menu__container [role=menu]{padding:calc(var(--plyr-control-spacing, 10px) * 0.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:var(--plyr-menu-color, #4a5464);display:flex;font-size:var(--plyr-font-size-menu, var(--plyr-font-size-small, 13px));padding-bottom:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) / 1.5);padding-left:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5);padding-right:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5);padding-top:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) / 1.5);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: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(var(--plyr-control-spacing, 10px) * 0.7) * 4)}.plyr__menu__container .plyr__control--forward::after{border-left-color:var(--plyr-menu-arrow-color, #728197);right:calc((calc(var(--plyr-control-spacing, 10px) * 0.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:var(--plyr-font-weight-regular, 400);margin:calc(var(--plyr-control-spacing, 10px) * 0.7);margin-bottom:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) / 2);padding-left:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 4);position:relative;width:calc(100% - (calc(var(--plyr-control-spacing, 10px) * 0.7) * 2))}.plyr__menu__container .plyr__control--back::after{border-right-color:var(--plyr-menu-arrow-color, #728197);left:calc((calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5) - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--back::before{background:var(--plyr-menu-back-border-color, #dcdfe5);box-shadow:0 1px 0 var(--plyr-menu-back-border-shadow-color, #fff);content:"";height:1px;left:0;margin-top:calc(calc(var(--plyr-control-spacing, 10px) * 0.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(var(--plyr-control-spacing, 10px) * 0.7)}.plyr__menu__container .plyr__control[role=menuitemradio]::before,.plyr__menu__container .plyr__control[role=menuitemradio]::after{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]::before{background:rgba(0, 0, 0, 0.1);content:"";display:block;flex-shrink:0;height:16px;margin-right:var(--plyr-control-spacing, 10px);transition:all 0.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 0.3s ease, opacity 0.3s ease;width:6px}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before{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, 0.1)}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:calc((calc(var(--plyr-control-spacing, 10px) * 0.7) - 2) * -1);overflow:hidden;padding-left:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 3.5);pointer-events:none}.plyr--full-ui input[type=range]{-webkit-appearance:none;background:transparent;border:0;border-radius:calc(var(--plyr-range-thumb-height, 13px) * 2);color:var(--plyr-range-fill-background, var(--plyr-color-main, var(--plyr-color-main, #00b3ff)));display:block;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 0.3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none;background-image:linear-gradient(to right, currentColor var(--value, 0%), transparent var(--value, 0%))}.plyr--full-ui input[type=range]::-webkit-slider-thumb{background:var(--plyr-range-thumb-background, #fff);border:0;border-radius:100%;box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2));height:var(--plyr-range-thumb-height, 13px);position:relative;transition:all 0.2s ease;width:var(--plyr-range-thumb-height, 13px);-webkit-appearance:none;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:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:var(--plyr-range-thumb-background, #fff);border:0;border-radius:100%;box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2));height:var(--plyr-range-thumb-height, 13px);position:relative;transition:all 0.2s ease;width:var(--plyr-range-thumb-height, 13px)}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px)}.plyr--full-ui input[type=range]::-ms-track{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none;color:transparent}.plyr--full-ui input[type=range]::-ms-fill-upper{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none;background:currentColor}.plyr--full-ui input[type=range]::-ms-thumb{background:var(--plyr-range-thumb-background, #fff);border:0;border-radius:100%;box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2));height:var(--plyr-range-thumb-height, 13px);position:relative;transition:all 0.2s ease;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-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-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-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:var(--plyr-video-background, var(--plyr-video-background, black));background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity 0.2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr--youtube.plyr--paused.plyr__poster-enabled:not(.plyr--stopped) .plyr__poster{display:none}.plyr__time{font-size:var(--plyr-font-size-time, var(--plyr-font-size-small, 13px))}.plyr__time+.plyr__time::before{content:"⁄";margin-right:var(--plyr-control-spacing, 10px)}@media (max-width: 767px){.plyr__time+.plyr__time{display:none}}.plyr__tooltip{background:var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));border-radius:var(--plyr-tooltip-radius, 3px);bottom:100%;box-shadow:var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));color:var(--plyr-tooltip-color, #4a5464);font-size:var(--plyr-font-size-small, 13px);font-weight:var(--plyr-font-weight-regular, 400);left:50%;line-height:1.3;margin-bottom:calc(calc(var(--plyr-control-spacing, 10px) / 2) * 2);opacity:0;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(0.8);transform-origin:50% 100%;transition:transform 0.2s 0.1s ease, opacity 0.2s 0.1s ease;white-space:nowrap;z-index:2}.plyr__tooltip::before{border-left:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-right:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-top:var(--plyr-tooltip-arrow-size, 4px) solid var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));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:hover .plyr__tooltip,.plyr .plyr__control.plyr__tab-focus .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(0.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((var(--plyr-control-icon-size, 18px) / 2) + calc(var(--plyr-control-spacing, 10px) * 0.7))}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translate(0, 10px) scale(0.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip::before{left:auto;right:calc((var(--plyr-control-icon-size, 18px) / 2) + calc(var(--plyr-control-spacing, 10px) * 0.7));transform:translateX(50%)}.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible{transform:translate(0, 0) scale(1)}.plyr__progress{left:calc(var(--plyr-range-thumb-height, 13px) * 0.5);margin-right:var(--plyr-range-thumb-height, 13px);position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:calc(var(--plyr-range-thumb-height, 13px) * -0.5);margin-right:calc(var(--plyr-range-thumb-height, 13px) * -0.5);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:var(--plyr-font-size-time, var(--plyr-font-size-small, 13px));left:0}.plyr__progress__buffer{-webkit-appearance:none;background:transparent;border:0;border-radius:100px;height:var(--plyr-range-track-height, 5px);left:0;margin-top:calc((var(--plyr-range-track-height, 5px) / 2) * -1);padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:transparent}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:var(--plyr-range-track-height, 5px);transition:width 0.2s ease}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:var(--plyr-range-track-height, 5px);transition:width 0.2s ease}.plyr__progress__buffer::-ms-fill{border-radius:100px;transition:width 0.2s ease}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg, var(--plyr-progress-loading-background, rgba(35, 40, 47, 0.6)) 25%, transparent 25%, transparent 50%, var(--plyr-progress-loading-background, rgba(35, 40, 47, 0.6)) 50%, var(--plyr-progress-loading-background, rgba(35, 40, 47, 0.6)) 75%, transparent 75%, transparent);background-repeat:repeat-x;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:var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25))}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.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(var(--plyr-control-spacing, 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:var(--plyr-audio-controls-background, #fff);border-radius:inherit;color:var(--plyr-audio-control-color, #4a5464);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-audio-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b3ff)));color:var(--plyr-audio-control-color-hover, #fff)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6)))}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6)))}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6)))}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, 0.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, 0.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, 0.1))}.plyr--audio .plyr__progress__buffer{color:var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6))}.plyr--video{background:var(--plyr-video-background, var(--plyr-video-background, black));overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:var(--plyr-video-background, var(--plyr-video-background, black));height:100%;margin:auto;overflow:hidden;position:relative;width:100%}.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{aspect-ratio:16/9}@supports not (aspect-ratio: 16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0;padding-bottom:56.25%;position:relative}}.plyr__video-embed iframe,.plyr__video-wrapper--fixed-ratio video{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr--video .plyr__controls{background:var(--plyr-video-controls-background, linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75)));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:var(--plyr-video-control-color, #fff);left:0;padding:calc(var(--plyr-control-spacing, 10px) / 2);padding-top:calc(var(--plyr-control-spacing, 10px) * 2);position:absolute;right:0;transition:opacity 0.4s ease-in-out, transform 0.4s ease-in-out;z-index:3}@media (min-width: 480px){.plyr--video .plyr__controls{padding:var(--plyr-control-spacing, 10px);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-video-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b3ff)));color:var(--plyr-video-control-color-hover, #fff)}.plyr__control--overlaid{background:var(--plyr-video-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b3ff)));border:0;border-radius:100%;color:var(--plyr-video-control-color, #fff);display:none;left:50%;opacity:0.9;padding:calc(var(--plyr-control-spacing, 10px) * 1.5);position:absolute;top:50%;transform:translate(-50%, -50%);transition:0.3s;z-index:2}.plyr__control--overlaid svg{left:2px;position:relative}.plyr__control--overlaid:hover,.plyr__control--overlaid:focus{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:var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25)))}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25)))}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25)))}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(255, 255, 255, 0.5))}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(255, 255, 255, 0.5))}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(255, 255, 255, 0.5))}.plyr--video .plyr__progress__buffer{color:var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25))}.plyr:fullscreen{background:#000;border-radius:0 !important;height:100%;margin:0;width:100%}.plyr:fullscreen video{height:100%}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width: 1024px){.plyr:fullscreen .plyr__captions{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__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: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__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: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__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: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__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: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:var(--plyr-control-spacing, 10px);color:#fff;content:attr(data-badge-text);font-size:11px;padding:2px 6px;pointer-events:none;position:absolute;right:var(--plyr-control-spacing, 10px);z-index:3}.plyr__ads:empty::after{display:none}.plyr__cues{background:currentColor;display:block;height:var(--plyr-range-track-height, 5px);left:0;margin:-var(--plyr-range-track-height, 5px)/2 0 0;opacity:0.8;position:absolute;top:50%;width:3px;z-index:3}.plyr__preview-thumb{background-color:var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));border-radius:3px;bottom:100%;box-shadow:var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));margin-bottom:calc(calc(var(--plyr-control-spacing, 10px) / 2) * 2);opacity:0;padding:var(--plyr-tooltip-radius, 3px);pointer-events:none;position:absolute;transform:translate(0, 10px) scale(0.8);transform-origin:50% 100%;transition:transform 0.2s 0.1s ease, opacity 0.2s 0.1s ease;z-index:2}.plyr__preview-thumb--is-shown{opacity:1;transform:translate(0, 0) scale(1)}.plyr__preview-thumb::before{border-left:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-right:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-top:var(--plyr-tooltip-arrow-size, 4px) solid var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));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(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, 0.55);border-radius:calc(var(--plyr-tooltip-radius, 3px) - 1px);color:#fff;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 0.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}video,iframe{max-width:100%}.plyr--html5 .plyr__video-wrapper,.plyr--youtube .plyr__video-wrapper{height:100%}.plyr__video-wrapper{z-index:1}.presto-player__wrapper{position:relative;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.presto-player__wrapper.rtl{direction:rtl}.presto-player__wrapper img{max-width:100%}.presto-player__wrapper .plyr{border-radius:var(--presto-player-border-radius)}.presto-player__wrapper .plyr.plyr--video.plyr--menu-open{overflow:hidden}.presto-player__wrapper .plyr--fullscreen-fallback.plyr--vimeo .plyr__video-wrapper{top:50%;transform:translateY(-50%)}.presto-player__wrapper .plyr--fullscreen-fallback.plyr{border-radius:0 !important}.presto-player__wrapper .plyr--fullscreen-fallback.plyr iframe{border-radius:0 !important}.presto-player__wrapper .plyr__menu__container{overflow:auto}.presto-player__wrapper .plyr__menu__container:after{display:none}.presto-player__wrapper img{border:none}.presto-player__wrapper video{margin:auto}.presto-player__wrapper iframe{height:100%}.presto-player__wrapper .plyr--video .plyr__control:active,.presto-player__wrapper .plyr--video .plyr__control:focus{background:#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)}.presto-player__wrapper .plyr__poster{background-size:cover;z-index:2}.presto-player__wrapper .presto-player__logo{margin:0;display:block;position:absolute;z-index:3;opacity:0.5;object-fit:contain;transition:bottom 0.4s ease-in-out;max-width:var(--presto-player-logo-width, 75px)}.presto-player__wrapper .presto-player__logo.is-bottom-right{left:auto;right:20px;top:auto;bottom:60px}.presto-player__wrapper .presto-player__logo.is-bottom-left{left:20px;right:auto;top:auto;bottom:60px}@media screen and (min-width: 380px){.presto-player__wrapper.presto-player--hide-controls .presto-player__logo.is-bottom-right,.presto-player__wrapper.presto-player--hide-controls .presto-player__logo.is-bottom-left,.presto-player__wrapper .plyr--hide-controls .presto-player__logo.is-bottom-right,.presto-player__wrapper .plyr--hide-controls .presto-player__logo.is-bottom-left{bottom:20px}}.presto-player__wrapper .presto-player-progress__marker{width:16px;height:16px;padding:0;border:2px solid rgba(255, 255, 255, 0.5);position:absolute;border-radius:9999px;bottom:calc(50% - 8px);z-index:9;margin-left:-8px !important}.presto-player__wrapper.presto-player--ended .plyr--youtube .plyr__poster{display:none}.presto-player__wrapper.presto-player--ended .plyr--youtube .plyr__control.plyr__control--overlaid{display:none}.presto-player__wrapper .presto-player__wrapper .plyr__control--overlaid{z-index:4}.presto-player__wrapper button.plyr__control.plyr__control--overlaid:focus{background:inherit;border:none;outline:0;position:absolute;top:50%;transform:translate(-50%, -50%)}.presto-player__wrapper .plyr__controls__item.plyr__progress__container{position:relative}.presto-player__wrapper .plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{box-shadow:none}.presto-player__wrapper .plyr--video .plyr__controls{background:var(--plyr-video-controls-background, linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.75)))}.presto-player__wrapper .plyr--fullscreen-fallback.plyr--video .plyr__controls{padding-bottom:calc(var(--plyr-control-spacing, 10px) + env(safe-area-inset-bottom))}.presto-player__wrapper .presto-player-toc{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";line-height:1.4;position:absolute;top:auto;right:0;left:0;bottom:0;max-height:100%;max-width:100%;background:rgba(255, 255, 255, 0.9);background:var(--plyr-menu-background, rgba(255, 255, 255, 0.9));left:auto;padding:20px 15px;border-radius:4px;width:100%;z-index:9;box-shadow:0 1px 2px rgba(0, 0, 0, 0.15);box-shadow:var(--plyr-menu-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));color:#4a5464;color:var(--plyr-menu-color, #4a5464);font-size:15px;font-size:var(--plyr-font-size-base, 15px);white-space:nowrap;z-index:3;display:flex;flex-direction:column;transition:bottom 0.25s ease}@media screen and (min-width: 380px){.presto-player__wrapper .presto-player-toc{right:20px;bottom:60px;width:300px;max-height:calc(100% - 80px);max-width:calc(100vw - 70px)}}.presto-player__wrapper .presto-player-toc__wrapper{position:absolute;top:0;left:0;bottom:0;right:0;z-index:3;visibility:hidden;opacity:0;transition:opacity 0.3s ease-in-out, visibility 0.3s ease-in-out}.presto-player__wrapper .presto-player-toc__wrapper.is-showing{visibility:visible;opacity:1}.presto-player__wrapper .presto-player-toc__cover{position:absolute;top:0;left:0;bottom:0;right:0;z-index:3}.presto-player__wrapper .presto-player-toc__list{flex:1;overflow:auto}.presto-player__wrapper .presto-player-toc__title{font-size:12px;font-weight:bold;margin-bottom:10px;margin-left:10px;margin-right:10px;display:none}@media screen and (min-width: 380px){.presto-player__wrapper .presto-player-toc__title{display:block}}.presto-player__wrapper .presto-player-toc__name{white-space:nowrap;overflow:hidden;width:100%;text-overflow:ellipsis}.presto-player__wrapper .presto-player-toc__chapter{padding:12px;border-radius:3px;cursor:pointer;line-height:1;display:flex;align-items:center;transition:background-color 0.4s ease, color 0.4s ease;margin-bottom:2px;position:relative}.presto-player__wrapper .presto-player-toc__chapter:last-child{margin-bottom:0}.presto-player__wrapper .presto-player-toc__chapter.is-highlighted,.presto-player__wrapper .presto-player-toc__chapter:hover{background:#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)}.presto-player__wrapper .presto-player-toc__chapter.is-highlighted{padding-right:30px}.presto-player__wrapper .presto-player-toc__chapter.is-highlighted:after{background:rgba(255, 255, 255, 0.5);content:"";display:block;flex-shrink:0;height:8px;width:8px;margin-right:10px;margin-right:var(--plyr-control-spacing, 10px);transition:all 0.3s ease;border-radius:9999px;position:absolute;right:7px}.presto-player__wrapper .presto-player-toc__order{margin-right:12px;opacity:0.5}.presto-player__wrapper.rtl{direction:rtl}.presto-player__wrapper.rtl .presto-player-toc__order{order:2;margin-left:12px;margin-right:0}.presto-player__wrapper.rtl .presto-player-toc__name{direction:rtl}.presto-player__wrapper.action-bar-active .presto-audio__poster img{border-bottom-left-radius:0px}.presto-player__wrapper .presto-player-error{position:absolute;top:0;left:0;bottom:0;right:0;background:rgba(0, 0, 0, 0.9);color:#fff;display:flex;align-items:center;justify-content:center;z-index:10;text-align:center}.presto-player__wrapper .presto-player-error__title{font-size:18px;font-weight:bold;margin-bottom:8px}.presto-player__wrapper .presto-player-error__description{opacity:0.75}.presto-player__wrapper.hide-youtube-ui .plyr__video-embed iframe{top:-50%;height:200%}.presto-player__wrapper .plyr--vimeo.plyr--playing .plyr__video-embed__container{pointer-events:none}.presto-player__wrapper .plyr__control--overlaid{border-radius:6px;padding-left:26px;padding-right:26px;position:absolute !important;top:50% !important}.presto-player__wrapper.presto-player--hide-scrim .plyr__controls{background:transparent}.presto-player__wrapper presto-audio .presto-player-toc{max-height:350px}.presto-player__wrapper presto-action-bar{position:relative;z-index:1}.presto-sticky-parent{z-index:99998}.presto-sticky-audio{position:fixed;z-index:3000;width:100vw;bottom:0px;right:0px;left:0px}@media screen and (min-width: 960px){.presto-sticky{--presto-sticky-space:15px;position:fixed;z-index:3000;max-width:var(--presto-sticky-width, 380px);width:100vw}.presto-sticky .plyr__controls,.presto-sticky .presto-player-toc__wrapper,.presto-sticky presto-action-bar,.presto-sticky .presto-player__logo{display:none}.presto-sticky--top-left{top:var(--presto-sticky-space);left:var(--presto-sticky-space)}.presto-sticky--top-center{top:var(--presto-sticky-space);left:0;right:0;margin:0 auto}.presto-sticky--top-right{top:var(--presto-sticky-space);right:var(--presto-sticky-space)}.presto-sticky--center-left{top:0;bottom:0;margin:auto 0;left:var(--presto-sticky-space);display:flex;align-items:center}.presto-sticky--center-center{top:0;bottom:0;right:0;left:0;margin:auto;display:flex;align-items:center}.presto-sticky--center-right{top:0;bottom:0;margin:auto 0;right:var(--presto-sticky-space);display:flex;align-items:center}.presto-sticky--bottom-left{bottom:var(--presto-sticky-space);left:var(--presto-sticky-space)}.presto-sticky--bottom-center{bottom:var(--presto-sticky-space);left:0;right:0;margin:0 auto}.presto-sticky--bottom-right{bottom:var(--presto-sticky-space);right:var(--presto-sticky-space)}}.presto-player__overlay{position:absolute;top:50%;left:50%;z-index:3}.presto-player__muted-overlay{position:absolute;top:0;left:0;right:0;bottom:0;display:none;align-items:center;justify-content:center}.presto-player__muted-overlay .plyr__control--overlaid{display:block;opacity:1;visibility:visible}.presto-player__wrapper.is-muted-overlay{cursor:pointer}.presto-player__wrapper.is-muted-overlay.presto-player--playing .presto-player__muted-overlay{display:flex}.presto-player__wrapper.is-muted-overlay .plyr--playing .presto-player__muted-overlay .plyr__control--overlaid{opacity:1;visibility:visible}.presto-player__wrapper.is-muted-overlay .presto-player__logo{display:none}.presto-player__wrapper.is-muted-overlay .plyr__controls{display:none}.presto-player__wrapper.is-muted-overlay .plyr .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(0) !important}.presto-player__wrapper.rtl .plyr__captions{direction:rtl}.presto-player__wrapper .plyr__captions{z-index:1}.presto-player__wrapper.caption-style-full .plyr__captions{background:var(--plyr-captions-background, rgba(0, 0, 0, 0.8));padding-top:0;padding-bottom:0}.presto-player__wrapper.caption-style-full .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 13px) * -4))}.presto-player__wrapper.caption-style-full.skin-stacked .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 17px) * -4))}.presto-player__play-cover{cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:99}.presto-player__chapters{width:100%;position:absolute;top:0;height:100%}.presto-player__chapter-markers{margin:0 8px;height:100%;position:relative}.presto-player-progress__marker.plyr__controls__item.plyr__control:hover{border:0;background:#fff}.presto-iframe-fallback-container{position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden}.presto-iframe-fallback-container embed,.presto-iframe-fallback-container iframe,.presto-iframe-fallback-container object{position:absolute;top:0;left:0;width:100%;height:100%}@media (min-aspect-ratio: 16/9){.hide-youtube-ui presto-youtube .plyr:fullscreen .plyr__video-wrapper{width:177.7777777778vh}}.cta-email-active,.cta-email-active .presto-audio__wrapper{min-height:140px}.cta-active,.email-active,.cta-active .presto-audio__wrapper,.email-active .presto-audio__wrapper{min-height:140px}.action-bar-active .plyr{border-radius:var(--presto-player-border-radius) var(--presto-player-border-radius) 0px 0px}';const ri=function(t,r){return d(r)};let ei=class{constructor(r){t(this,r),this.prestoBlur=i(this,"prestoBlur",7),this.prestoFocus=i(this,"prestoFocus",7),this.hasFocus=!1,this.hasLabel=!1,this.hasPrefix=!1,this.hasSuffix=!1,this.type="default",this.size="medium",this.full=!1,this.disabled=!1,this.submit=!1}componentWillLoad(){this.handleSlotChange()}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}handleSlotChange(){this.hasLabel=!!this.button.children,this.hasPrefix=!!this.button.querySelector('[slot="prefix"]'),this.hasSuffix=!!this.button.querySelector('[slot="suffix"]')}handleBlur(){this.hasFocus=!1,this.prestoBlur.emit()}handleFocus(){this.hasFocus=!0,this.prestoFocus.emit()}handleClick(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}render(){const t=!!this.href,e=r(ri,null,r("span",{part:"prefix",class:"button__prefix"},r("slot",{onSlotchange:()=>this.handleSlotChange(),name:"prefix"})),r("span",{part:"label",class:"button__label"},r("slot",{onSlotchange:()=>this.handleSlotChange()})),r("span",{part:"suffix",class:"button__suffix"},r("slot",{onSlotchange:()=>this.handleSlotChange(),name:"suffix"}))),i=r("button",{part:"base",class:{button:!0,"button--default":"default"===this.type,"button--primary":"primary"===this.type,"button--success":"success"===this.type,"button--info":"info"===this.type,"button--warning":"warning"===this.type,"button--danger":"danger"===this.type,"button--text":"text"===this.type,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--has-label":this.hasLabel,"button--has-prefix":this.hasPrefix,"button--has-suffix":this.hasSuffix},disabled:this.disabled,type:this.submit?"submit":"button",name:this.name,value:this.value,onBlur:()=>this.handleBlur,onFocus:()=>this.handleFocus,onClick:()=>this.handleClick},e),o=r("a",{part:"base",class:{button:!0,"button--default":"default"===this.type,"button--primary":"primary"===this.type,"button--success":"success"===this.type,"button--info":"info"===this.type,"button--warning":"warning"===this.type,"button--danger":"danger"===this.type,"button--text":"text"===this.type,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--has-label":this.hasLabel,"button--has-prefix":this.hasPrefix,"button--has-suffix":this.hasSuffix},href:this.href,target:this.target,download:this.download,rel:this.target?"noreferrer noopener":void 0,role:"button","aria-disabled":this.disabled?"true":"false",tabindex:this.disabled?"-1":"0",onBlur:()=>this.handleBlur,onFocus:()=>this.handleFocus,onClick:()=>this.handleClick},e);return t?o:i}get button(){return e(this)}};ei.style=":host{display:inline-block;width:auto;cursor:pointer}:host([full]){display:block}.button{display:inline-flex;align-items:stretch;justify-content:center;width:100%;border-style:solid;border-width:var(--presto-player-button-border-width);font-family:var(--plyr-font-family, inherit);font-weight:var(--presto-player-button-font-weight, 500);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;transition:var(--presto--player-transition-fast, 150ms) background-color, var(--presto-player-transition-fast, 150ms) color, var(--presto-player-transition-fast, 150ms) border, var(--presto--player-transition-fast, 150ms) box-shadow;cursor:inherit;border-radius:var(--presto-player-button-border-radius, 0.25em)}.button::-moz-focus-inner{border:0}.button:focus{outline:none}.button.button--disabled{opacity:0.5;cursor:not-allowed}.button.button--disabled *{pointer-events:none}.button ::slotted(.presto--icon){pointer-events:none}.button__prefix,.button__suffix{flex:0 0 auto;display:flex;align-items:center}.button__label{display:flex;align-items:center}.button__label ::slotted(presto-icon){vertical-align:-2px}.button.button--default{background-color:var(--presto-player-color-white, #fff);border-color:var(--presto-player-color-gray-300, #d1d5db);color:var(--presto-player-color-gray-600, #4b5563)}.button.button--default:hover:not(.button--disabled){border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-color, var(--plyr-color-main));opacity:0.75}.button.button--default:focus:not(.button--disabled){border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-color, var(--plyr-color-main));opacity:1}.button.button--default:active:not(.button--disabled){border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-color, var(--plyr-color-main));opacity:1}.button.button--primary{background-color:var(--presto-player-button-color, var(--plyr-color-main));border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-text, #fff)}.button.button--primary:hover:not(.button--disabled){opacity:0.9}.button.button--primary:focus:not(.button--disabled){opacity:1}.button.button--primary:active:not(.button--disabled){opacity:1}.button--text{background-color:transparent;border-color:transparent;color:var(--presto-player-button-color, var(--plyr-color-main))}.button--text:hover:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.8}.button--text:focus:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.7}.button--text:active:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.7}.button--small{font-size:var(--presto-player-button-font-size-small, 0.875em);height:var(--presto-player-button-height-small, 1.875em);line-height:calc(var(--presto-player-button-height-small, 1.875em) - var(--presto-player-button-border-width, 1px) * 2)}.button--medium{font-size:var(--presto-player-button-font-size-medium, 1em);height:var(--presto-player-button-height-medium, 2.5em);line-height:calc(var(--presto-player-button-height-medium, 2.5em) - var(--presto-player-button-border-width, 1px) * 2)}.button--large{font-size:var(--presto-player-button-font-size-large, 1.25em);height:var(--presto-player-button-height-large, 3.125em);line-height:calc(var(--presto-player-button-height-large, 3.125em) - var(--presto-player-button-border-width, 1px) * 2)}.button--full{display:block}.button--has-label.button--small .button__label{padding:0 var(--presto-player-button-spacing-small, 0.75em)}.button--has-label.button--medium .button__label{padding:0 var(--presto-player-button-spacing-medium, 1em)}.button--has-label.button--large .button__label{padding:0 var(--presto-player-button-spacing-large, 1.25em)}.button--has-prefix.button--small{padding-left:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-prefix.button--small .button__label{padding-left:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-prefix.button--medium{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-prefix.button--medium .button__label{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-prefix.button--large{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-prefix.button--large .button__label{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--small,.button--caret.button--small{padding-right:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-suffix.button--small .button__label,.button--caret.button--small .button__label{padding-right:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-suffix.button--medium,.button--caret.button--medium{padding-right:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--medium .button__label,.button--caret.button--medium .button__label{padding-right:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--large,.button--caret.button--large{padding-right:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--large .button__label,.button--caret.button--large .button__label{padding-right:var(--presto-player-button-spacing-small, 0.75em)}";let ii=class{constructor(r){t(this,r)}render(){return r("span",{part:"base",class:"spinner","aria-busy":"true","aria-live":"polite"})}};ii.style=":host{position:relative;box-sizing:border-box;--track-color:#0d131e20;--indicator-color:var(--plyr-color-main);--stroke-width:2px;display:inline-flex}:host *,:host *:before,:host *:after{box-sizing:inherit}.spinner{display:inline-block;width:1em;height:1em;border-radius:50%;border:solid var(--stroke-width) var(--track-color);border-top-color:var(--indicator-color);border-right-color:var(--indicator-color);animation:1s linear infinite spin}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";let oi=class{constructor(r){t(this,r)}render(){return r(o,null,r("slot",null))}};oi.style=".skin-stacked .plyr__controls{flex-wrap:wrap}.skin-stacked .presto-player-progress__marker{transform:scale(0.75)}.skin-stacked .plyr__controls{justify-content:flex-start}.skin-stacked .plyr__controls__item.plyr__progress__container{order:-1;flex:1 0 100%}.skin-stacked .plyr__controls__item.plyr__progress__container+:not(.plyr__time),.skin-stacked .plyr__controls__item.plyr__progress__container+.plyr__time+*{margin-left:auto}.skin-stacked .plyr__controls .plyr__controls__item:first-child{margin:0}.skin-stacked .plyr__progress{height:19px;display:flex;align-items:center}.skin-stacked .plyr__progress .plyr__progress__buffer{height:3px;transition:all 0.25s ease;position:absolute;top:calc(50% + 1px)}.skin-stacked .plyr__progress input[type=range]::-moz-range-track{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-webkit-slider-runnable-track{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-track{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-fill-upper{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-fill-lower{height:3px;transition:height 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-webkit-slider-thumb{visibility:hidden;opacity:0;transition:opacity 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-moz-range-thumb{visibility:hidden;opacity:0;transition:opacity 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-thumb{visibility:hidden;opacity:0;transition:opacity 0.25s ease}.skin-stacked .plyr__progress__container:hover .presto-player-progress__marker{transform:scale(1)}.skin-stacked .plyr__progress__container:hover .plyr__progress .plyr__progress__buffer{height:5px;top:50%}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]{overflow:visible}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-moz-range-track{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-webkit-slider-runnable-track{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-track{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-fill-upper{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-fill-lower{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-webkit-slider-thumb{visibility:visible;opacity:1}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-moz-range-thumb{visibility:visible;opacity:1}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-thumb{visibility:visible;opacity:1}";let ni=class{constructor(r){t(this,r)}handleClick(t){t.preventDefault();const r=document.body.querySelector("presto-player");r&&r.goToAndPlay(this.timeToSeconds(this.time))}timeToSeconds(t){let r,e=t.split(":");return e.length>1&&(r=60*parseInt(e[0])),parseInt(e[1])+parseInt(r)}render(){return r("a",{href:"#",class:"presto-timestamp",onClick:t=>this.handleClick(t)},r("slot",null,this.time))}};ni.style=":host{display:inline}";let ai=class{constructor(r){t(this,r)}render(){return r("video",Object.assign({class:{"presto-player__player":!0,"plyr__video-embed":["youtube","vimeo"].includes(this.provider)},part:"video",ref:this.getRef,autoplay:this.autoplay,preload:this.preload,"data-poster":this.poster,playsinline:this.playsinline},this.videoAttributes),r("source",{src:this.src}),!!this.tracks&&!!this.tracks.length&&this.tracks.map((t=>r("track",{kind:"captions",label:(null==t?void 0:t.label)?t.label:"Captions",src:null==t?void 0:t.src,srclang:(null==t?void 0:t.srcLang)?null==t?void 0:t.srcLang:"en"}))))}};ai.style=":host{display:block}";let si=class{constructor(r){t(this,r)}getId(t){const r=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/.exec(t||"");return(null==r?void 0:r[5])||""}parseHash(t){const r=t.match(/^.*(?:vimeo.com\/|video\/)(?:\d+)(?:\?.*\&*h=|\/)+(?<hash>[\d,a-f]+)/);return r?r.groups.hash:null}render(){if(this.src)return"Android"!==b()||(t=window.navigator.standalone,e=window.navigator.userAgent.toLowerCase(),i=/safari/.test(e),/iphone|ipod|ipad/.test(e)?!t&&i||t||i:!e.includes("wv"))?r("div",{class:"plyr__video-embed",part:"embed",ref:this.getRef,"data-plyr-provider":"vimeo","data-plyr-embed-id":this.getId(this.src),"data-plyr-embed-hash":this.parseHash(this.src)}):r("div",{class:"presto-iframe-fallback-container"},r("iframe",{src:`https://player.vimeo.com/video/${this.getId(this.src)}?h=${this.parseHash(this.src)}&loop=false&byline=false&portrait=false&title=false&speed=true&transparent=0&gesture=media`,allowFullScreen:!0,allowTransparency:!0,allow:"autoplay",style:{width:"100%"},class:"presto-fallback-iframe"}));var t,e,i}};si.style=":host{display:block}";let li=class{constructor(r){t(this,r),this.reload=i(this,"reload",7)}handlePlayerChange(){this.player&&this.fixes()}fixes(){this.player.once("statechange",(t=>{var r,e,i,o,n;1===t.detail.code&&((null===(n=null===(o=null===(i=null===(e=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.plyr)||void 0===e?void 0:e.config)||void 0===i?void 0:i.blockAttributes)||void 0===o?void 0:o.mutedPreview)||void 0===n?void 0:n.enabled)||(this.player.muted=!1))}))}getId(t){var r;const e=(t||"").match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return e&&11===(null===(r=null==e?void 0:e[2])||void 0===r?void 0:r.length)?e[2]:null}loadPlayer(){this.lazyLoad=!1,this.reloadPlayer=!0}componentDidRender(){this.reloadPlayer&&(this.reloadPlayer=!1,this.reload.emit("play"))}setWebView(){var t;let r=null===(t=window.navigator)||void 0===t?void 0:t.standalone,e=window.navigator.userAgent.toLowerCase(),i=/safari/.test(e),o=/iphone|ipod|ipad/.test(e);this.isWebView=o?!r&&!i:e.includes("wv")}componentWillLoad(){this.setWebView(),this.poster||(this.poster=`//img.youtube.com/vi/${this.getId(this.src)}/maxresdefault.jpg`),this.lazyLoad&&w()&&(this.lazyLoad=!1)}render(){return this.isWebView?r("div",{class:"fallback-container"},r("iframe",{src:this.src,allowFullScreen:!0,allowtransparency:!0,allow:"autoplay"})):this.lazyLoad?r("div",null,r("presto-video",{part:"video",getRef:this.getRef,poster:this.poster,src:"",provider:"youtube"}),r("div",{class:"presto-player__play-cover",onClick:()=>this.loadPlayer()})):r("div",{class:"plyr__video-embed",part:"embed",ref:this.getRef,"data-plyr-provider":"youtube","data-plyr-embed-id":this.getId(this.src)})}static get watchers(){return{player:["handlePlayerChange"]}}};li.style=":host{display:block}.fallback-container{position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden}.fallback-container iframe,.fallback-container object,.fallback-container embed{position:absolute;top:0;left:0;width:100%;height:100%}@supports not (aspect-ratio: 16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0 !important;padding-bottom:56.25%;position:relative}}";let pi=class{constructor(r){t(this,r),this.layout="default"}waitForApi(t){var r=setInterval((function(){var e;(null===(e=null===window||void 0===window?void 0:window.gapi)||void 0===e?void 0:e.ytsubscribe)&&(clearInterval(r),t())}),50)}componentDidLoad(){const t=document.createElement("script");t.type="text/javascript",t.async=!1,t.src="https://apis.google.com/js/platform.js";const r=document.getElementsByTagName("script")[0];r&&r.parentNode.insertBefore(t,r),this.waitForApi((()=>{window.gapi.ytsubscribe.render(this.textInput,{channelId:this.channel,layout:this.layout,count:this.showCount?"default":"hidden"})}))}render(){return r("div",{class:"g-ytsubscribe",ref:t=>this.textInput=t})}};pi.style=":host{display:block}";export{O as C,F as E,Ke as P,f as a,k as b,x as c,z as d,j as e,T as f,S as g,C as h,A as i,I as j,M as k,E as l,L as m,R as n,ti as o,ei as p,ii as q,de as r,oi as s,ni as t,ai as u,si as v,li as w,pi as x}
|
|
dist/components/web-components/p-771734f3.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
import{r as t,h as r,g as e,c as i,H as o,_ as n,a,d as s,e as l,f as p,i as u,j as d,k as c,l as h,m as v}from"./p-219091ba.js";let y=class{constructor(r){t(this,r)}componentWillLoad(){this.player&&(this.player.on("ended",(()=>this.setEnded())),this.player.on("timeupdate",(t=>this.setCurrentTime(t))))}setEnded(){this.ended=!0}setCurrentTime(t){var r,e;this.currentTime=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.plyr.currentTime,this.duration=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){return r("presto-action-bar-controller",{ended:this.ended,config:this.config,currentTime:this.currentTime,duration:this.duration,direction:this.direction,youtube:this.youtube})}get el(){return e(this)}};function f({current:t,duration:r,showAfter:e=null}){if(0===e)return!0;if(null===e||!r)return!1;if(t===e)return!0;let i=t/r*100;return 99.9<i&&(i=100),i>=e}function _(t){if(!t)return;let r,e,i,o;if(t.match(/^rgb/)){const o=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);r=o[1],e=o[2],i=o[3]}else{const o=+("0x"+t.slice(1).replace(t.length<5&&/./g,"$&$&"));r=o>>16,e=o>>8&255,i=255&o}return o=Math.sqrt(r*r*.299+e*e*.587+i*i*.114),o>127.5?"light":"dark"}function g(t){let r,e=t.split(":");return e.length>1&&(r=60*parseInt(e[0])),parseInt(e[1])+parseInt(r)}function b(){var t=navigator.userAgent||navigator.vendor;return/windows phone/i.test(t)?"Windows Phone":/android/i.test(t)?"Android":"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||/(iPad|iPhone|iPod)/gi.test(navigator.platform)?"iOS":"unknown"}function m(){return"iOS"===b()}y.style=":host{display:block}";let w=class{constructor(r){t(this,r),this.actionBarStateChange=i(this,"actionBarStateChange",7),this.show=!1,this.youtubeRenderKey=1,this.percentagePassed=0}componentWillLoad(){this.handleDuration()}handleDuration(){this.handleTime()}handleEnded(t){var r;if(t){if(100!==(null===(r=null==this?void 0:this.config)||void 0===r?void 0:r.percentage_start))return;this.show=!0}}handlePercentagePassed(){this.percentagePassed=this.currentTime/this.duration*100}handleTime(){this.checkTime()}checkTime(){var t,r;this.show=!!(null===(t=null===window||void 0===window?void 0:window.wp)||void 0===t?void 0:t.blocks)||f({current:this.currentTime,duration:this.duration,showAfter:null===(r=this.config)||void 0===r?void 0:r.percentage_start})}handleButtonCountChange(t,r){(null==t?void 0:t.button_count)!==(null==r?void 0:r.button_count)&&this.youtubeRenderKey++,(null==t?void 0:t.enabled)&&this.handleDuration()}youtubeButton(){var t,e,i,o;if("youtube"===(null===(t=this.config)||void 0===t?void 0:t.button_type)&&(null===(e=this.youtube)||void 0===e?void 0:e.channelId))return r("presto-youtube-subscribe-button",{key:this.youtubeRenderKey,channel:null===(i=this.youtube)||void 0===i?void 0:i.channelId,showCount:null===(o=this.config)||void 0===o?void 0:o.button_count})}customButton(){var t,e,i,o,n,a,s,l,p,u,d;if("custom"===(null===(t=this.config)||void 0===t?void 0:t.button_type))return r("presto-player-button",{type:"primary",size:"small",href:null===(i=null===(e=this.config)||void 0===e?void 0:e.button_link)||void 0===i?void 0:i.url,target:(null===(n=null===(o=this.config)||void 0===o?void 0:o.button_link)||void 0===n?void 0:n.opensInNewTab)?"_blank":"_self",style:Object.assign(Object.assign({"--presto-player-button-border-radius":`${null===(a=this.config)||void 0===a?void 0:a.button_radius}px`},(null===(s=this.config)||void 0===s?void 0:s.button_color)?{"--presto-player-button-color":`${null===(l=this.config)||void 0===l?void 0:l.button_color}`}:{}),(null===(p=this.config)||void 0===p?void 0:p.button_text_color)?{"--presto-player-button-text":`${null===(u=this.config)||void 0===u?void 0:u.button_text_color}`}:{})},null===(d=this.config)||void 0===d?void 0:d.button_text)}handleCtaStateChange(t){this.actionBarStateChange.emit(t)}render(){var t,e;return r("presto-action-bar-ui",{open:this.show,style:{"--presto-action-bar-background":(null===(t=this.config)||void 0===t?void 0:t.background_color)||"#1d1d1d"}},null===(e=this.config)||void 0===e?void 0:e.text,r("div",{slot:"button"},this.youtubeButton(),this.customButton()))}get el(){return e(this)}static get watchers(){return{duration:["handleDuration","handlePercentagePassed"],ended:["handleEnded"],currentTime:["handlePercentagePassed","handleTime"],config:["handleButtonCountChange"],show:["handleCtaStateChange"]}}};w.style=":host{display:block}";let k=class{constructor(r){t(this,r)}render(){return r("div",{class:{bar:!0,"bar--open":this.open}},r("span",{part:"content",class:"bar__content"},r("slot",null)),r("span",{part:"button",class:"bar__button"},r("slot",{name:"button"})))}};k.style=":host{display:block;overflow:hidden}.bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;background:var(--presto-action-bar-background, #1d1d1d);color:#fff;padding:0 var(--presto-action-bar-padding, 6px);line-height:1em;font-size:16px;margin-top:-100%;transition:margin var(--presto-action-bar-animation-speed, 0.5s) ease-in-out;transform:translate3d(0);border-radius:0px 0px var(--presto-player-border-radius) var(--presto-player-border-radius)}.bar.bar--open{margin-top:0}.bar__button{margin:var(--presto-action-bar-padding, 6px);display:flex;align-items:center}.bar__content{margin:var(--presto-action-bar-padding, 6px);width:100%;text-align:center}@media screen and (min-width: 480px){.bar__content{width:auto}}";let x=class{constructor(r){t(this,r),this.playVideo=i(this,"playVideo",7),this.pauseVideo=i(this,"pauseVideo",7)}renderPosterImage(){if(this.poster)return r("div",{class:"presto-audio__poster"},r("img",{src:this.poster}))}hasPosterArea(){var t;return!!this.poster||!!(null===(t=this.preset)||void 0===t?void 0:t["play-large"])}renderMobilePoster(){var t;return r("div",{class:"presto-audio__poster-wrapper-mobile"},!!(null===(t=this.preset)||void 0===t?void 0:t["play-large"])&&this.renderLargePlay("presto-audio__large-play-button is-relative"),r("div",{class:"presto-audio__mobile-title"},this.mediaTitle))}renderLargePlay(t="presto-audio__large-play-button"){return r("div",{class:t,onClick:()=>{this.player.playing?this.pauseVideo.emit():this.playVideo.emit()}},r("svg",{class:"presto-audio__icon-play",width:"16",height:"18",viewBox:"0 0 16 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r("path",{d:"M15.5588 9.00005L0.117662 17.915L0.117662 0.0850823L15.5588 9.00005Z"})),r("svg",{class:"presto-audio__icon-pause",width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r("rect",{width:"5",height:"17"}),r("rect",{x:"12",width:"5",height:"17"})))}componentDidLoad(){"ResizeObserver"in window&&new ResizeObserver((t=>{t.forEach((t=>this.width=t.contentRect.width))})).observe(this.el)}render(){var t,e,i,o,n;return r("div",{ref:t=>this.el=t,class:{"presto-audio__wrapper":!0,"has-poster":!!this.poster,"has-play-large":!!(null===(t=this.preset)||void 0===t?void 0:t["play-large"]),"is-playing":null===(e=this.player)||void 0===e?void 0:e.playing,"has-light-background":"light"===_(null===(i=this.preset)||void 0===i?void 0:i.background_color),"has-dark-background":"dark"===_(null===(o=this.preset)||void 0===o?void 0:o.background_color),"breakpoint-small":this.width<520,"skin-stacked":this.width<520,"breakpoint-large":this.width>=520}},this.hasPosterArea()&&r("div",{class:"presto-audio__poster-wrapper"},!!(null===(n=this.preset)||void 0===n?void 0:n["play-large"])&&r("div",{class:"presto-audio__large-play-wrapper"},this.renderLargePlay()),this.renderPosterImage()),this.hasPosterArea()&&this.renderMobilePoster(),r("div",{class:"presto-audio__controls-wrapper"},r("div",{class:"presto-audio__title"},this.mediaTitle),r("audio",Object.assign({part:"audio-player",ref:this.getRef,autoplay:this.autoplay,preload:this.preload,"data-poster":this.poster},this.audioAttributes),r("source",{src:this.src}),!!this.tracks&&!!this.tracks.length&&this.tracks.map((t=>r("track",{kind:"captions",label:(null==t?void 0:t.label)?t.label:"Captions",src:null==t?void 0:t.src,srclang:(null==t?void 0:t.srcLang)?null==t?void 0:t.srcLang:"en"}))))))}};x.style=":host{display:block}.presto-audio__wrapper{border-radius:var(--presto-player-border-radius, 0px)}.presto-audio__wrapper .plyr--audio .plyr__controls{padding:0}.presto-audio__wrapper .plyr--audio .plyr__control.plyr__tab-focus,.presto-audio__wrapper .plyr--audio .plyr__control:hover,.presto-audio__wrapper .plyr--audio .plyr__control[aria-expanded=true]{background:var(--plyr-audio-controls-background);color:var(--plyr-audio-control-color)}.presto-audio__wrapper{display:flex;background:var(--plyr-audio-controls-background, #fff)}.presto-audio__controls-wrapper{padding:calc(var(--plyr-control-spacing, 10px) * 2);flex:1;display:flex;flex-direction:column;justify-content:center;min-width:0}.has-poster .presto-audio__controls-wrapper{padding:calc(var(--plyr-control-spacing, 10px) * 3)}.has-play-large:not(.has-poster) .presto-audio__controls-wrapper{padding-left:0}.presto-audio__title,.presto-audio__mobile-title{font-size:18px;font-weight:500;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--plyr-audio-control-color)}.presto-audio__title{margin:calc(var(--plyr-control-spacing, 10px) / 2);margin-top:0}.presto-audio__poster-wrapper{position:relative;width:100px;min-height:100px;flex:0 0 100px}.presto-audio__poster-wrapper img{border-radius:var(--presto-player-border-radius, 0px) 0 0 var(--presto-player-border-radius, 0px);width:100%;height:100%;object-fit:cover;aspect-ratio:1;display:block}.has-poster .presto-audio__poster-wrapper{width:140px;height:140px;flex:0 0 140px}.presto-audio__poster{width:100%;height:100%}.presto-audio__large-play-button{user-select:none;cursor:pointer;position:absolute;display:flex;align-items:center;justify-content:center;top:50%;left:50%;transform:translate(-50%, -50%);width:50px;height:50px;color:white;border-radius:100%;background:var(--plyr-audio-control-color);color:var(--plyr-audio-controls-background)}.presto-audio__large-play-button.is-relative{position:relative;top:auto;left:auto;transform:none}.has-light-background.has-poster .presto-audio__large-play-button{background:var(--plyr-audio-controls-background);color:var(--plyr-audio-control-color)}.has-dark-background.has-poster .presto-audio__large-play-button{background:var(--plyr-audio-control-color);color:var(--plyr-audio-controls-background)}.presto-audio__icon-play,.presto-audio__icon-pause{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);fill:currentColor;display:block;transition:opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;margin:0 auto;text-align:center}.presto-audio__icon-pause{opacity:0;visibility:hidden}.presto-audio__wrapper.is-playing .presto-audio__icon-pause{opacity:1;visibility:visible}.presto-audio__icon-play{margin-left:2px;opacity:1;visibility:visible}.presto-audio__wrapper.is-playing .presto-audio__icon-play{opacity:0;visibility:hidden}.presto-audio__poster-wrapper-mobile{display:none;min-width:0}.presto-audio__poster-wrapper-mobile .presto-audio__large-play-button{flex:0 0 50px}.presto-audio__wrapper.breakpoint-small{flex-direction:column}.presto-audio__wrapper.breakpoint-small .presto-audio__controls-wrapper{padding:calc(var(--plyr-control-spacing, 10px) * 2)}.presto-audio__wrapper.breakpoint-small.has-poster .presto-audio__title{text-align:center;margin:calc(var(--plyr-control-spacing, 10px) * 1.5)}.presto-audio__wrapper.breakpoint-small.has-poster .presto-audio__poster-wrapper{margin:30px auto auto auto;overflow:hidden;border-radius:var(--presto-player-border-radius, 0px);width:225px;height:225px;flex:0 0 225px}.presto-audio__wrapper.breakpoint-small.has-play-large:not(.has-poster) .presto-audio__poster-wrapper,.presto-audio__wrapper.breakpoint-small.has-play-large:not(.has-poster) .presto-audio__title{display:none}.presto-audio__wrapper.breakpoint-small.has-play-large:not(.has-poster) .presto-audio__poster-wrapper-mobile{display:flex;align-items:center;gap:1em;margin-bottom:calc(var(--plyr-control-spacing, 10px) * -1);padding:calc(var(--plyr-control-spacing, 10px) * 2) calc(var(--plyr-control-spacing, 10px) * 2) 0 calc(var(--plyr-control-spacing, 10px) * 2)}.skin-stacked.presto-sticky-audio .presto-audio__wrapper{height:115px}.skin-stacked.presto-sticky-audio .has-poster .presto-audio__controls-wrapper{padding:20px}.skin-stacked.presto-sticky-audio .has-poster .presto-audio__poster-wrapper{width:115px;height:115px;flex:0 0 115px}.presto-sticky-audio .presto-audio__wrapper{height:100px}.presto-sticky-audio .has-poster .presto-audio__controls-wrapper{padding:20px}.presto-sticky-audio .has-poster .presto-audio__poster-wrapper{width:100px;height:100px;flex:0 0 100px}.action-bar-active .presto-audio__wrapper{border-radius:var(--presto-player-border-radius) var(--presto-player-border-radius) 0px 0px}@media screen and (max-width: 520px){.presto-sticky-audio .presto-audio__poster-wrapper-mobile{display:flex;align-items:center;gap:1em;margin-bottom:calc(var(--plyr-control-spacing, 10px) * -1);padding:calc(var(--plyr-control-spacing, 10px) * 2) calc(var(--plyr-control-spacing, 10px) * 2) 0 calc(var(--plyr-control-spacing, 10px) * 2)}.presto-sticky-audio .presto-audio__poster-wrapper,.presto-sticky-audio .presto-audio__title{display:none}.presto-sticky-audio .presto-audio__wrapper{height:140px}.presto-sticky-audio .has-poster .presto-audio__controls-wrapper{padding:0px}.presto-sticky-audio .presto-audio__poster-wrapper-mobile .presto-audio__large-play-button{flex:0 0 40px;height:40px}}";let z=class{constructor(r){t(this,r)}componentWillLoad(){this.poster=this.poster||this.thumbnail}render(){return r("presto-video",{getRef:this.getRef,player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,playsinline:this.playsinline,src:this.src,tracks:this.tracks,videoAttributes:this.videoAttributes})}},j=class{constructor(r){t(this,r)}render(){return r(o,null,r("slot",null))}};j.style='.skin-business.presto-player__wrapper.rewind-inactive .plyr__controls .plyr__controls__item:nth-child(2)::before{border-radius:var(--plyr-control-radius, 3px) 0px 0px var(--plyr-control-radius, 3px)}.skin-business.presto-player__wrapper.caption-style-full .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 16px) * -4))}.skin-business.presto-player__wrapper .presto-player-progress__marker{border-radius:0;width:15px;height:15px;border-width:1px}.skin-business.presto-player__wrapper .plyr__control[data-plyr]:hover:not([role*=menuitem]):not(.plyr__control--back),.skin-business.presto-player__wrapper .plyr__control[data-plyr]:focus:not([role*=menuitem]):not(.plyr__control--back),.skin-business.presto-player__wrapper .plyr__control[data-plyr]:active:not([role*=menuitem]):not(.plyr__control--back){background-color:transparent;color:var(--plyr-color-main)}.skin-business.presto-player__wrapper .plyr__control[data-plyr]:hover:not([role*=menuitem]):not(.plyr__control--back)[data-plyr=play],.skin-business.presto-player__wrapper .plyr__control[data-plyr]:focus:not([role*=menuitem]):not(.plyr__control--back)[data-plyr=play],.skin-business.presto-player__wrapper .plyr__control[data-plyr]:active:not([role*=menuitem]):not(.plyr__control--back)[data-plyr=play]{background-color:var(--plyr-color-main);color:white}.skin-business.presto-player__wrapper .plyr__control--overlaid[data-plyr=play]{border-radius:4px;background:#000000;opacity:75%}.skin-business.presto-player__wrapper .plyr__control--overlaid[data-plyr=play]:hover{background-color:var(--plyr-color-main);color:white;opacity:100%}.skin-business.presto-player__wrapper .plyr__volume input[type=range]{cursor:pointer}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fast-forward]{border-radius:0px}.skin-business.presto-player__wrapper .plyr__progress{margin:0px 20px 0 5px}.skin-business.presto-player__wrapper .plyr__progress input[type=range]{height:32px;border-radius:0px;cursor:pointer}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker):first-child::before{border-radius:var(--plyr-control-radius, 3px) 0px 0px var(--plyr-control-radius, 3px)}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker):last-child::before{border-radius:0px var(--plyr-control-radius, 3px) var(--plyr-control-radius, 3px) 0px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item.plyr__control[data-plyr=play]{order:-1;margin-right:5px;padding:11px 20px 11px 20px;top:-4px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item.plyr__control[data-plyr=play]::before{border-radius:4px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=rewind]::before{border-radius:var(--plyr-control-radius, 3px) 0px 0px var(--plyr-control-radius, 3px)}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not([data-plyr=play]){margin:0}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen]{padding:4px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen] svg{height:24px;width:24px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker){position:relative}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker).plyr__time{height:32px;padding-top:4.5px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item:not(.presto-player-progress__marker)::before{content:"";background:#000000;position:absolute;top:0px;left:0;right:0;bottom:0px;opacity:0.76;z-index:-1}.skin-business.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-runnable-track{box-shadow:none;color:var(--plyr-color-main);height:9px;outline:1px solid #878787a6;outline-offset:2px;border-radius:0px}.skin-business.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-thumb{visibility:hidden}.skin-business.presto-player__wrapper .plyr__progress__buffer::-webkit-progress-value{position:relative;border-radius:0px;height:9px;top:-2px}.skin-business.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background-color:transparent}@media screen and (max-width: 480px){.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item.plyr__time{padding:1.5%}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=play]{padding:8px;top:0px}.skin-business.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen] svg{width:22px}}';let S=class{constructor(r){t(this,r)}componentWillLoad(){this.player&&(this.player.on("ended",(()=>this.setEnded())),this.player.on("timeupdate",(t=>this.setCurrentTime(t))))}setEnded(){this.ended=!0}setCurrentTime(t){var r,e;this.currentTime=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.plyr.currentTime,this.duration=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){var t;return r("presto-cta-overlay-controller",{ended:this.ended,currentTime:this.currentTime,duration:this.duration,direction:this.direction,cta:null===(t=this.preset)||void 0===t?void 0:t.cta,i18n:this.i18n,provider:this.provider})}};S.style=":host{display:block}";let T=class{constructor(r){t(this,r),this.playVideo=i(this,"playVideo",7),this.pauseVideo=i(this,"pauseVideo",7),this.restartVideo=i(this,"restartVideo",7),this.ctaStateChange=i(this,"ctaStateChange",7),this.percentagePassed=0}componentWillLoad(){this.handleDuration()}handleEnded(t){var r;if(t){if(100!==(null===(r=null==this?void 0:this.cta)||void 0===r?void 0:r.percentage))return;this.show=!0}}handleDuration(){var t;this.enabled=!this.skipped&&(null===(t=null==this?void 0:this.cta)||void 0===t?void 0:t.enabled),this.handleTime()}handlePercentagePassed(){this.percentagePassed=this.currentTime/this.duration*100}handleEnabled(){this.show&&(this.skipped||this.pauseVideo.emit(!0))}handleTime(){var t;this.enabled&&(this.skipped||100!==(null===(t=null==this?void 0:this.cta)||void 0===t?void 0:t.percentage)&&this.checkTime())}checkTime(){var t;this.show=f({current:this.currentTime,duration:this.duration,showAfter:(null===(t=null==this?void 0:this.cta)||void 0===t?void 0:t.percentage)||0})}skip(){this.skipped=!0,this.show=!1,this.playVideo.emit()}rewatch(){this.ended=!1,this.show=!1,this.restartVideo.emit()}handleCtaStateChange(t){this.ctaStateChange.emit(t)}render(){var t,e,i,o,n,a,s,l,p,u,d,c,h,v;if(this.show)return r("presto-cta-overlay-ui",{style:Object.assign(Object.assign(Object.assign({"--presto-player-button-border-radius":`${null===(t=null==this?void 0:this.cta)||void 0===t?void 0:t.button_radius}px`},(null===(e=null==this?void 0:this.cta)||void 0===e?void 0:e.background_opacity)?{"--presto-player-cta-background-opacity":""+(null===(i=null==this?void 0:this.cta)||void 0===i?void 0:i.background_opacity)/100}:{}),(null===(o=null==this?void 0:this.cta)||void 0===o?void 0:o.button_color)?{"--presto-player-button-color":`${null===(n=null==this?void 0:this.cta)||void 0===n?void 0:n.button_color}`}:{}),(null===(a=null==this?void 0:this.cta)||void 0===a?void 0:a.button_text_color)?{"--presto-player-button-text":`${null===(s=null==this?void 0:this.cta)||void 0===s?void 0:s.button_text_color}`}:{}),direction:this.direction,class:"cta-overlay",i18n:this.i18n,headline:null===(l=null==this?void 0:this.cta)||void 0===l?void 0:l.headline,"bottom-text":null===(p=null==this?void 0:this.cta)||void 0===p?void 0:p.bottom_text,"show-button":null===(u=null==this?void 0:this.cta)||void 0===u?void 0:u.show_button,buttonLink:null===(d=null==this?void 0:this.cta)||void 0===d?void 0:d.button_link,allowSkip:!this.ended&&(null===(c=null==this?void 0:this.cta)||void 0===c?void 0:c.show_skip),allowRewatch:this.ended&&(null===(h=null==this?void 0:this.cta)||void 0===h?void 0:h.show_rewatch),"button-text":null===(v=null==this?void 0:this.cta)||void 0===v?void 0:v.button_text,onSkip:()=>this.skip(),onRewatch:()=>this.rewatch(),provider:this.provider})}static get watchers(){return{ended:["handleEnded"],duration:["handleDuration","handlePercentagePassed"],currentTime:["handlePercentagePassed","handleEnabled","handleTime"],show:["handleCtaStateChange"]}}};T.style=":host{display:block}";const C=function(t,r,e){var i=function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return t}({minFontSize:-1/0,maxFontSize:1/0,container:t},e),o=function(t){var e=r||1,o=function(){var r;t.style.fontSize=Math.max(Math.min(((null==i||null===(r=i.container)||void 0===r?void 0:r.clientWidth)||0)/(10*e),parseFloat(i.maxFontSize)),parseFloat(i.minFontSize))+"px"};if(o(),"ResizeObserver"in window==0)var n=import("./p-80dd671c.js").then((function(){window.ResizeObserver=n.ResizeObserver,new ResizeObserver(o).observe(i.container)}));else new ResizeObserver(o).observe(i.container)};if(t.length)for(var n=0;n<t.length;n++)o(t[n]);else o(t);return t};let P=class{constructor(r){t(this,r),this.skip=i(this,"skip",7),this.rewatch=i(this,"rewatch",7)}componentDidLoad(){this.isAudioProvider="audio"===(this.type||this.provider),C(this.textInput,3,{maxFontSize:!0===this.isAudioProvider?15:20,minFontSize:8})}handleCTAClick(t){var r;(null===(r=this.buttonLink)||void 0===r?void 0:r.url)&&(t.preventDefault(),t.stopPropagation(),this.handleLink())}handleLink(){var t,r,e;(null===(t=this.buttonLink)||void 0===t?void 0:t.opensInNewTab)?window.open(null===(r=this.buttonLink)||void 0===r?void 0:r.url,"_blank"):window.location.href=null===(e=this.buttonLink)||void 0===e?void 0:e.url}render(){var t,e,i,o,n;return r("div",{class:"wrapper",ref:t=>this.textInput=t},r("div",{onClick:t=>this.handleCTAClick(t),class:`overlay ${"rtl"===this.direction?"rtl":""} ${(null===(t=this.buttonLink)||void 0===t?void 0:t.url)?"has-link":""}`},r("div",{class:this.isAudioProvider?"content is-centered":"content"},r("h1",{part:"cta-headline"},this.headline||this.defaultHeadline),this.bottomText&&r("p",{class:this.isAudioProvider&&"is-small",part:"cta-bottom-text",innerHTML:this.bottomText}),this.showButton&&r("presto-player-button",{full:!0,onClick:t=>this.handleCTAClick(t),part:"cta-button",href:null===(e=null==this?void 0:this.buttonLink)||void 0===e?void 0:e.url,target:(null===(i=null==this?void 0:this.buttonLink)||void 0===i?void 0:i.opensInNewTab)?"_blank":"_self",class:"button",type:"primary"},this.buttonText))),!!this.allowRewatch&&r("div",{class:"rewatch",onClick:t=>{t.preventDefault(),t.stopImmediatePropagation(),this.rewatch.emit()}},r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-corner-up-left"},r("polyline",{points:"9 14 4 9 9 4"}),r("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})),null===(o=null==this?void 0:this.i18n)||void 0===o?void 0:o.rewatch),!!this.allowSkip&&r("div",{class:"skip",onClick:t=>{t.preventDefault(),this.skip.emit()}},null===(n=null==this?void 0:this.i18n)||void 0===n?void 0:n.skip," →"))}};P.style=':host{display:block;font-size:16px;width:100%;height:100%;position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;z-index:99999;user-select:none}*{box-sizing:border-box}a{color:#fff}.wrapper{height:100%;position:relative;color:#fff;font-family:var(--plyr-font-family, "San Francisco", -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif)}.overlay{position:relative;display:flex;align-items:center;justify-content:center;padding:48px;height:100%}.overlay.has-link{cursor:pointer}.overlay:before{content:"";border-radius:var(--presto-player-border-radius, 0);opacity:var(--presto-player-cta-background-opacity, 0.75);position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--presto-player-cta-background, #000);z-index:-1;box-shadow:inset 0 0 100px black}.content{width:80%;max-width:600px}.content *~*{margin-top:22px}button{background:var(--plyr-color-main, #000);appearance:none;padding:6px 12px;align-items:center;display:inline-flex;border-width:1px;border-color:transparent;color:#fff;border-radius:0;cursor:pointer;font-size:0.8em;border-radius:0 var(--presto-player-cta-border-radius, 0) var(--presto-player-cta-border-radius) 0}@media screen and (min-width: 700px){button{padding:10px 18px}}button:focus{box-shadow:white 0px 0px 0px 2px, var(--plyr-color-main, #000) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;z-index:1}button:focus,button:hover{outline:none}h1{font-size:1.5em;font-weight:500;margin:0;line-height:1.1em}.skip,.rewatch{font-size:0.8em;font-weight:600;position:absolute;top:0;right:0;padding:4%;cursor:pointer}.rewatch{display:inline-flex;align-items:center;right:auto;left:0}.rewatch .icon{margin-right:5px}p{font-size:0.85em;margin:0;margin-top:1.5em;line-height:1.4em;opacity:0.75}p.is-small{font-size:0.85em;margin:1.5em 0px 0px;line-height:0.1em;opacity:0.75}.is-centered{text-align:center}';let O=class{constructor(r){t(this,r),this.position="top-right"}closestElement(t,r){return r&&r!=document&&r!=window&&r.closest(t)||r&&this.closestElement(t,r.getRootNode().host)}componentDidLoad(){let t=this.closestElement("presto-player",this.el);C(this.text,3,{maxFontSize:16,minFontSize:10,container:t})}render(){return r(this.href?"a":"span",{class:{"overlay-text":!0,"overlay--top-left":"top-left"===this.position,"overlay--top-right":"top-right"===this.position},href:this.href,target:this.target,part:"overlay-text",ref:t=>this.text=t},r("slot",null))}get el(){return e(this)}};O.style=":host{display:block}.overlay-text{text-decoration:none;display:inline-block;user-select:none;line-height:1;opacity:var(--presto-dynamic-overlay-opacity, 1);font-size:var(--presto-dynamic-overlay-font-size, 18px);padding:var(--presto-dynamic-overlay-padding, 0.65em 0.85em);font-weight:var(--presto-dynamic-overlay-font-weight, 500);border-radius:var(--presto-dynamic-overlay-radius, 0.25em);background:var(--presto-dynamic-overlay-background, rgba(0, 0, 0, 0.8));color:var(--presto-dynamic-overlay-color, #fff);opacity:var(--presto-dynamic-overlay-opacity, 1);word-break:break-word}a.overlay-text{cursor:pointer}";let A=class{constructor(r){t(this,r),this.reloadComponent=i(this,"reloadComponent",7),this.watermarkRef={left:null,right:null},this.destroy=!1,this.refs={}}componentDidLoad(){this.player&&this.player.on("timeupdate",(t=>{this.currentTime=t.detail.plyr.currentTime,this.checkValidity()}))}checkValidity(){var t,r,e,i,o,n,a,s,l,p;this.player.playing&&((null===(t=null==this?void 0:this.overlays)||void 0===t?void 0:t.length)||(null===(e=null===(r=this.preset)||void 0===r?void 0:r.watermark)||void 0===e?void 0:e.enabled))&&((null===(i=this.container)||void 0===i?void 0:i.offsetParent)&&(null===(o=this.topLeft)||void 0===o?void 0:o.offsetParent)&&(null===(n=this.topRight)||void 0===n?void 0:n.offsetParent)||this.reloadComponent.emit(),Object.keys(this.refs||{}).forEach((t=>{const{overlay:r,component:e}=this.refs[t];this.checkComponent(e,r.text,(()=>this.reloadComponent.emit()))})),this.shouldShowWatermark("top-left")&&this.watermarkRef.left&&this.checkComponent(this.watermarkRef.left,null===(s=null===(a=this.preset)||void 0===a?void 0:a.watermark)||void 0===s?void 0:s.text,(()=>this.reloadComponent.emit())),this.shouldShowWatermark("top-right")&&this.watermarkRef.right&&this.checkComponent(this.watermarkRef.right,null===(p=null===(l=this.preset)||void 0===l?void 0:l.watermark)||void 0===p?void 0:p.text,(()=>this.reloadComponent.emit())))}checkComponent(t,r,e){if(!(null==t?void 0:t.offsetParent))return e();if(!t.shadowRoot.querySelector("slot"))return e();if(this.player&&this.player.playing){const i=t.shadowRoot.querySelector("slot").assignedNodes()[0];if(i){if(i.parentElement.innerHTML!=r)return e();const t=getComputedStyle(i.parentElement.shadowRoot.querySelector(".overlay-text"));if(parseInt(t.fontSize,10)<10)return e();const o=function(t){var r=t.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);return r?[r[1],r[2],r[3],"1"]:(r=t.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((0.)?\d+)\s*\)$/i))?[r[1],r[2],r[3],r[4]]:void 0}(t.color);if("1"!==(null==o?void 0:o[3]))return e()}}}shouldShowOverlay(t){if(void 0!==this.currentTime)return!(this.currentTime<g(null==t?void 0:t.startTime)||this.currentTime>g(null==t?void 0:t.endTime))}renderOverlay(t){var e,i;return r("presto-dynamic-overlay-ui",{class:{visible:this.shouldShowOverlay(t)},ref:r=>this.refs[t.id]={overlay:t,component:r},key:t.id,position:t.position,href:null===(e=null==t?void 0:t.link)||void 0===e?void 0:e.url,target:(null===(i=null==t?void 0:t.link)||void 0===i?void 0:i.opensInNewTab)?"_blank":"_self",innerHTML:this.shouldShowOverlay(t)?t.text:"",style:{"--presto-dynamic-overlay-color":(null==t?void 0:t.color)||"#fff","--presto-dynamic-overlay-background":(null==t?void 0:t.backgroundColor)||"#333","--presto-dynamic-overlay-opacity":(null==t?void 0:t.opacity)?(t.opacity/100).toString():"1"}})}shouldShowWatermark(t){var r,e,i;if(!(null===(e=null===(r=this.preset)||void 0===r?void 0:r.watermark)||void 0===e?void 0:e.enabled))return!1;const o=null===(i=this.preset)||void 0===i?void 0:i.watermark;return"randomize"===o.position?Math.floor((this.player.currentTime||0)/10)%2==0?"top-left"===t:"top-right"===t:o.position===t||!o.position&&"top-right"===t}render(){var t,e,i,o,n,a,s,l,p,u,d;if(this.enabled&&((null===(t=null==this?void 0:this.overlays)||void 0===t?void 0:t.length)||(null===(i=null===(e=this.preset)||void 0===e?void 0:e.watermark)||void 0===i?void 0:i.enabled)))return r("div",{class:"overlays",ref:t=>this.container=t},r("div",{class:"top-left",ref:t=>this.topLeft=t},!!this.shouldShowWatermark("top-left")&&r("presto-dynamic-overlay-ui",{ref:t=>this.watermarkRef.left=t,style:{"--presto-dynamic-overlay-color":(null===(o=this.preset.watermark)||void 0===o?void 0:o.color)||"#fff","--presto-dynamic-overlay-background":(null===(n=this.preset.watermark)||void 0===n?void 0:n.backgroundColor)||"#333","--presto-dynamic-overlay-opacity":(null===(a=this.preset.watermark)||void 0===a?void 0:a.opacity)?(this.preset.watermark.opacity/100).toString():"1"},class:"visible",position:"top-left",innerHTML:this.preset.watermark.text}),!!(null===(s=null==this?void 0:this.overlays)||void 0===s?void 0:s.length)&&this.overlays.map((t=>"top-left"!==t.position?"":this.renderOverlay(t)))),r("div",{class:"top-right",ref:t=>this.topRight=t},!!this.shouldShowWatermark("top-right")&&r("presto-dynamic-overlay-ui",{ref:t=>this.watermarkRef.right=t,style:{"--presto-dynamic-overlay-color":(null===(l=this.preset.watermark)||void 0===l?void 0:l.color)||"#fff","--presto-dynamic-overlay-background":(null===(p=this.preset.watermark)||void 0===p?void 0:p.backgroundColor)||"#333","--presto-dynamic-overlay-opacity":(null===(u=this.preset.watermark)||void 0===u?void 0:u.opacity)?(this.preset.watermark.opacity/100).toString():"1"},class:"visible",position:"top-right",innerHTML:this.preset.watermark.text}),!!(null===(d=null==this?void 0:this.overlays)||void 0===d?void 0:d.length)&&this.overlays.map((t=>"top-right"!==t.position?"":this.renderOverlay(t)))))}get el(){return e(this)}};A.style=".top-left,.top-right{position:absolute;display:block;padding:20px;max-width:45%;z-index:20;display:flex;flex-direction:column;flex-wrap:wrap}.top-left{top:0;left:0}.top-right{top:0;right:0;align-items:flex-end}presto-dynamic-overlay-ui{overflow:hidden;height:0;opacity:0;transition:height 0ms 400ms, opacity 400ms 0ms}presto-dynamic-overlay-ui.visible{margin-bottom:10px;height:auto;opacity:1;transition:height 0ms 0ms, opacity 500ms 0ms}";let M=class{constructor(r){t(this,r)}componentWillLoad(){this.player&&(this.player.on("ended",(()=>this.setEnded())),this.player.on("timeupdate",(t=>this.setCurrentTime(t))))}setEnded(){this.ended=!0}setCurrentTime(t){var r,e;this.currentTime=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.plyr.currentTime,this.duration=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){var t,e;return r("presto-email-overlay-controller",{ended:this.ended,currentTime:this.currentTime,videoId:this.videoId,duration:this.duration,direction:this.direction,presetId:null===(t=this.preset)||void 0===t?void 0:t.id,emailCollection:null===(e=this.preset)||void 0===e?void 0:e.email_collection,i18n:this.i18n,provider:this.provider})}};M.style=":host{display:block}";let I=class{constructor(r){t(this,r),this.playVideo=i(this,"playVideo",7),this.pauseVideo=i(this,"pauseVideo",7),this.restartVideo=i(this,"restartVideo",7),this.emailStateChange=i(this,"emailStateChange",7),this.percentagePassed=0}setStorage(t){window.localStorage.setItem("presto.videos.email_collection",JSON.stringify({[this.videoId]:t}))}getStorage(){return window.localStorage.getItem("presto.videos.email_collection")}componentWillLoad(){this.handleDuration()}handleDuration(){var t;this.enabled=!this.getStorage()&&(null===(t=null==this?void 0:this.emailCollection)||void 0===t?void 0:t.enabled),this.handleTimeCheck()}handleTimeCheck(){this.enabled&&(this.getStorage()||this.checkTime())}handleShowChange(){this.show&&this.pauseVideo.emit(!0)}checkTime(){var t;this.show=f({current:this.currentTime,duration:this.duration,showAfter:(null===(t=null==this?void 0:this.emailCollection)||void 0===t?void 0:t.percentage)||0})}async getNonce(){var t;return fetch(`${null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.ajaxurl}?action=presto_refresh_progress_nonce`)}async submit(t){var r;this.loading=!0,this.error="";const e=await this.getNonce(),{data:i}=await e.json();try{let e=await fetch(null===(r=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===r?void 0:r.ajaxurl,{method:"post",body:new URLSearchParams(Object.assign({action:"presto_player_email_submit",nonce:i,preset_id:this.presetId,video_id:this.videoId,provider:this.provider},(null==t?void 0:t.detail)||{}))});const{success:o,data:n}=await e.json();if(!o)throw n;this.setStorage("collected"),this.show=!1,this.playVideo.emit()}catch(t){const r=null==t?void 0:t[0];r&&"string"==typeof r&&(this.error=r)}finally{this.loading=!1}}skip(){this.setStorage("skipped"),this.show=!1,this.playVideo.emit()}handleEmailStateChange(t){this.emailStateChange.emit(t)}render(){var t,e,i,o,n,a,s,l;if(this.show)return r("presto-email-overlay-ui",{style:Object.assign(Object.assign({},(null===(t=null==this?void 0:this.emailCollection)||void 0===t?void 0:t.button_color)?{"--presto-player-button-color":`${null===(e=null==this?void 0:this.emailCollection)||void 0===e?void 0:e.button_color}`}:{}),(null===(i=null==this?void 0:this.emailCollection)||void 0===i?void 0:i.button_text_color)?{"--presto-player-button-text":`${null===(o=null==this?void 0:this.emailCollection)||void 0===o?void 0:o.button_text_color}`}:{}),direction:this.direction,class:"email-overlay",headline:null===(n=null==this?void 0:this.emailCollection)||void 0===n?void 0:n.headline,bottomText:null===(a=null==this?void 0:this.emailCollection)||void 0===a?void 0:a.bottom_text,allowSkip:null===(s=null==this?void 0:this.emailCollection)||void 0===s?void 0:s.allow_skip,buttonText:null===(l=null==this?void 0:this.emailCollection)||void 0===l?void 0:l.button_text,isLoading:this.loading,errorMessage:this.error,onSubmitForm:t=>this.submit(t),onSkip:()=>this.skip(),i18n:this.i18n,provider:this.provider})}static get watchers(){return{duration:["handleDuration"],currentTime:["handleTimeCheck","handleShowChange"],show:["handleEmailStateChange"]}}};I.style=":host{display:block}";let E=class{constructor(r){t(this,r),this.submitForm=i(this,"submitForm",7),this.skip=i(this,"skip",7)}handleSubmit(t){this.submitForm.emit({email:this.email}),t.preventDefault()}componentDidLoad(){this.isAudioProvider="audio"===(this.type||this.provider),C(this.textInput,3,{maxFontSize:this.isAudioProvider?15:20,minFontSize:8})}handleChange(t){this.email=t.target.value}render(){var t,e,i,o;return r("div",{class:"overlay "+("rtl"===this.direction?"rtl":""),ref:t=>this.textInput=t},r("div",{class:"content"},r("h1",{class:this.isAudioProvider&&"is-small"},this.headline||(null===(t=null==this?void 0:this.i18n)||void 0===t?void 0:t.emailDefaultHeadline)),this.isLoading?r("presto-player-spinner",null):r("form",{onSubmit:t=>this.handleSubmit(t)},r("input",{type:"email",placeholder:null===(e=null==this?void 0:this.i18n)||void 0===e?void 0:e.emailPlaceholder,value:this.email,onInput:t=>this.handleChange(t),required:!0}),r("button",{type:"submit"},this.buttonText||(null===(i=null==this?void 0:this.i18n)||void 0===i?void 0:i.play))),this.errorMessage&&r("p",{class:"error"},this.errorMessage),this.bottomText&&r("p",{innerHTML:this.bottomText,class:this.isAudioProvider&&"is-small"}),!!this.allowSkip&&r("div",{class:"skip",onClick:()=>{this.skip.emit()}},null===(o=null==this?void 0:this.i18n)||void 0===o?void 0:o.skip," →")))}};E.style=':host{display:block;font-size:16px;width:100%;height:100%;position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;z-index:99999}*{box-sizing:border-box}a{color:#fff}.overlay{position:relative;display:flex;align-items:center;text-align:center;justify-content:center;padding:48px;color:#fff;font-family:var(--plyr-font-family, "San Francisco", -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif);height:100%}.overlay:before{content:"";border-radius:var(--presto-player-border-radius, 0);opacity:var(--presto-player-email-background-opacity, 0.75);position:absolute;top:0;left:0;bottom:0;right:0;background-color:var(--presto-player-email-background, #000);z-index:-1;box-shadow:inset 0 0 100px black}.overlay.rtl form{flex-direction:row-reverse}.content{width:20em}form{display:flex;align-items:stretch;justify-content:center}input{background:#fff;border:none;font-size:0.8em;line-height:20px;padding:6px 8px;border-radius:0;border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--presto-player-email-border-radius, 0) 0 0 var(--presto-player-email-border-radius);flex:1}@media screen and (min-width: 700px){input{padding:10px 14px}}input:focus{border-color:var(--plyr-color-main, #000);z-index:1}input:focus,input:hover{outline:none}.rtl input{border-radius:0 var(--presto-player-email-border-radius, 0) var(--presto-player-email-border-radius) 0}button{background-color:var(--presto-player-button-color, var(--plyr-color-main));border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-text, #fff);appearance:none;padding:6px 12px;align-items:center;display:inline-flex;border-width:1px;border-color:transparent;border-radius:0;cursor:pointer;font-size:0.8em;border-radius:0 var(--presto-player-email-border-radius, 0) var(--presto-player-email-border-radius) 0}@media screen and (min-width: 700px){button{padding:10px 18px}}button:focus{box-shadow:white 0px 0px 0px 2px, var(--plyr-color-main, #000) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;z-index:1}button:focus,button:hover{outline:none}.rtl button{border-radius:var(--presto-player-email-border-radius, 0) 0 0 var(--presto-player-email-border-radius)}h1{font-size:1.5em;font-weight:500;margin:0 0 22px 0;max-width:600px;line-height:1.1em}h1.is-small{margin-bottom:1em;font-size:1.1em}.skip{font-size:0.8em;font-weight:600;position:absolute;top:0;right:0;padding:4%;cursor:pointer}p{font-size:0.7em;margin:0;margin-top:1.5em}p.is-small{font-size:0.9em;margin-top:1em}';let L=class{constructor(r){t(this,r)}render(){return r(o,null,r("slot",null))}};L.style='.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid{border-radius:2px;padding:3% 5%;max-width:135px;max-height:90px;box-sizing:content-box;position:absolute !important;top:50% !important;opacity:100%}.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid svg{height:31px;width:37px}.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid:hover,.skin-modern.presto-player__wrapper button.plyr__control.plyr__control--overlaid:focus{opacity:0.8;background:var(--plyr-color-main)}.skin-modern.presto-player__wrapper.caption-style-full .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 9px) * -4))}.skin-modern.presto-player__wrapper .plyr--video .plyr__controls{padding:0px}.skin-modern.presto-player__wrapper .plyr--video .plyr__controls::before{content:"";background:var(--plyr-color-main);position:absolute;top:0;left:0;right:0;bottom:0;opacity:0.75}.skin-modern.presto-player__wrapper .plyr__controls__item{z-index:1}.skin-modern.presto-player__wrapper .plyr__controls__item.plyr__control:not(.presto-player-progress__marker):not([role*=menuitem]):not(.plyr__control--back){height:36px;border-radius:0px}.skin-modern.presto-player__wrapper .plyr__controls__item.plyr__control:not(.presto-player-progress__marker):not([role*=menuitem]):not(.plyr__control--back):focus{background-color:transparent;color:white}.skin-modern.presto-player__wrapper .plyr__controls__item.presto-player-progress__marker{z-index:2}.skin-modern.presto-player__wrapper .plyr__controls__item.plyr__menu{height:36px}.skin-modern.presto-player__wrapper .plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{height:2px;color:white}.skin-modern.presto-player__wrapper .presto-player__wrapper .plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{height:2px}.skin-modern.presto-player__wrapper .plyr--video .plyr__progress__buffer{height:2px;top:11px}.skin-modern.presto-player__wrapper .plyr__progress input[type=range]{cursor:pointer}.skin-modern.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-thumb{top:1px;height:var(--plyr-range-thumb-height, 8px);width:var(--plyr-range-thumb-height, 8px);box-shadow:0px 0px 5px white}.skin-modern.presto-player__wrapper .plyr--full-ui input[type=range]::-webkit-slider-thumb:hover{transform:scale(1.5)}.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item{margin:0px}.skin-modern.presto-player__wrapper .plyr__volume{width:auto}.skin-modern.presto-player__wrapper .plyr__volume input[type=range]{width:55px}.skin-modern.presto-player__wrapper .plyr__volume input[type=range]{cursor:pointer}.skin-modern.presto-player__wrapper .presto-player__muted-overlay .plyr__control.plyr__control--overlaid{border-radius:2px}.skin-modern.presto-player__wrapper .presto-player__muted-overlay .plyr__control.plyr__control--overlaid svg{height:40px;width:50px}.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=rewind] svg,.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fast-forward] svg,.skin-modern.presto-player__wrapper .plyr__controls .plyr__controls__item[data-plyr=fullscreen] svg{width:22px;height:22px}@media screen and (max-width: 480px){.skin-modern.presto-player__wrapper .plyr__control--overlaid svg{height:18px;width:16px}}';let F=class{constructor(r){t(this,r),this.playVideo=i(this,"playVideo",7)}render(){var t,e,i,o,n,a,s,l,p;return r("div",{class:"presto-player__muted-overlay",onClick:()=>{this.mutedPreview=!1,this.playVideo.emit()}},(null===(t=this.preset)||void 0===t?void 0:t["play-large"])&&r("div",{class:"plyr__control plyr__control--overlaid","data-plyr":"play","aria-label":"Play",part:"muted-overlay-play"},r("svg",{id:"plyr-play",viewBox:"0 0 18 18"},r("path",{d:"M15.562 8.1L3.87.225c-.818-.562-1.87 0-1.87.9v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"})),r("span",{class:"plyr__sr-only"},"Play")),(null===(e=this.mutedOverlay)||void 0===e?void 0:e.enabled)&&(null===(i=this.mutedOverlay)||void 0===i?void 0:i.src)?r("div",{class:"presto-player__overlay is-image",part:"muted-overlay-image",style:{width:`${(null===(o=this.mutedOverlay)||void 0===o?void 0:o.width)||50}%`,left:100*((null===(a=null===(n=this.mutedOverlay)||void 0===n?void 0:n.focalPoint)||void 0===a?void 0:a.x)||.5)+"%",top:100*((null===(l=null===(s=this.mutedOverlay)||void 0===s?void 0:s.focalPoint)||void 0===l?void 0:l.y)||.5)+"%"}},r("img",{src:null===(p=this.mutedOverlay)||void 0===p?void 0:p.src,style:{transform:"translateX(-50%) translateY(-50%)"}})):"")}};F.style=":host{display:block}";var R=["premium","referrerPolicy"];function N(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function D(t,r){for(var e=0;e<r.length;e++){var i=r[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function B(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function $(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,i)}return e}function q(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?$(Object(e),!0).forEach((function(r){B(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):$(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}var V={addCSS:!0,thumbWidth:15,watch:!0};function H(t,r){return function(){return Array.from(document.querySelectorAll(r)).includes(this)}.call(t,r)}var U=function(t){return null!=t?t.constructor:null},Q=function(t,r){return!!(t&&r&&t instanceof r)},Y=function(t){return U(t)===String},W=function(t){return Array.isArray(t)},J=function(t){return Q(t,NodeList)},G=Y,K=W,X=J,Z=function(t){return Q(t,Element)},tt=function(t){return Q(t,Event)},rt=function(t){return function(t){return null==t}(t)||(Y(t)||W(t)||J(t))&&!t.length||function(t){return U(t)===Object}(t)&&!Object.keys(t).length};var et,it,ot,nt=function(){function t(r,e){(function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")})(this,t),Z(r)?this.element=r:G(r)&&(this.element=document.querySelector(r)),Z(this.element)&&rt(this.element.rangeTouch)&&(this.config=q({},V,{},e),this.init())}return function(t,r,e){r&&D(t.prototype,r),e&&D(t,e)}(t,[{key:"init",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(t){var r=this,e=t?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(t){r.element[e](t,(function(t){return r.set(t)}),!1)}))}},{key:"get",value:function(r){if(!t.enabled||!tt(r))return null;var e,i=r.target,o=r.changedTouches[0],n=parseFloat(i.getAttribute("min"))||0,a=parseFloat(i.getAttribute("max"))||100,s=parseFloat(i.getAttribute("step"))||1,l=i.getBoundingClientRect(),p=100/l.width*(this.config.thumbWidth/2)/100;return 0>(e=100/l.width*(o.clientX-l.left))?e=0:100<e&&(e=100),50>e?e-=(100-2*e)*p:50<e&&(e+=2*(e-50)*p),n+function(t,r){if(1>r){var e=function(t){var r="".concat(t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return r?Math.max(0,(r[1]?r[1].length:0)-(r[2]?+r[2]:0)):0}(r);return parseFloat(t.toFixed(e))}return Math.round(t/r)*r}(e/100*(a-n),s)}},{key:"set",value:function(r){t.enabled&&tt(r)&&!r.target.disabled&&(r.preventDefault(),r.target.value=this.get(r),function(t,r){if(t&&r){var e=new Event(r,{bubbles:!0});t.dispatchEvent(e)}}(r.target,"touchend"===r.type?"change":"input"))}}],[{key:"setup",value:function(r){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=null;if(rt(r)||G(r)?i=Array.from(document.querySelectorAll(G(r)?r:'input[type="range"]')):Z(r)?i=[r]:X(r)?i=Array.from(r):K(r)&&(i=r.filter(Z)),rt(i))return null;var o=q({},V,{},e);if(G(r)&&o.watch){var n=new MutationObserver((function(e){Array.from(e).forEach((function(e){Array.from(e.addedNodes).forEach((function(e){Z(e)&&H(e,r)&&new t(e,o)}))}))}));n.observe(document.body,{childList:!0,subtree:!0})}return i.map((function(r){return new t(r,e)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),t}(),at=function(t){return null!=t?t.constructor:null},st=function(t,r){return Boolean(t&&r&&t instanceof r)},lt=function(t){return null==t},pt=function(t){return at(t)===Object},ut=function(t){return at(t)===String},dt=function(t){return"function"==typeof t},ct=function(t){return Array.isArray(t)},ht=function(t){return st(t,NodeList)},vt=function(t){return lt(t)||(ut(t)||ct(t)||ht(t))&&!t.length||pt(t)&&!Object.keys(t).length},yt=lt,ft=pt,_t=function(t){return at(t)===Number&&!Number.isNaN(t)},gt=ut,bt=function(t){return at(t)===Boolean},mt=dt,wt=ct,kt=ht,xt=function(t){return null!==t&&"object"==p(t)&&1===t.nodeType&&"object"==p(t.style)&&"object"==p(t.ownerDocument)},zt=function(t){return st(t,Event)},jt=function(t){return st(t,KeyboardEvent)},St=function(t){return st(t,TextTrack)||!lt(t)&&ut(t.kind)},Tt=function(t){if(st(t,window.URL))return!0;if(!ut(t))return!1;var r=t;t.startsWith("http://")&&t.startsWith("https://")||(r="http://".concat(t));try{return!vt(new URL(r).hostname)}catch(t){return!1}},Ct=vt,Pt=(et=document.createElement("span"),it={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},ot=Object.keys(it).find((function(t){return void 0!==et.style[t]})),!!gt(ot)&&it[ot]);function Ot(t,r){setTimeout((function(){try{t.hidden=!0,t.hidden=!1}catch(t){}}),r)}var At={isIE:Boolean(window.document.documentMode),isEdge:/Edge/g.test(navigator.userAgent),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),isIPhone:/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function Mt(t,r){return r.split(".").reduce((function(t,r){return t&&t[r]}),t)}function It(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length,e=new Array(r>1?r-1:0),i=1;i<r;i++)e[i-1]=arguments[i];if(!e.length)return t;var o=e.shift();return ft(o)?(Object.keys(o).forEach((function(r){ft(o[r])?(Object.keys(t).includes(r)||Object.assign(t,s({},r,{})),It(t[r],o[r])):Object.assign(t,s({},r,o[r]))})),It.apply(void 0,[t].concat(e))):t}function Et(t,r){Array.from(t.length?t:[t]).reverse().forEach((function(t,e){var i=e>0?r.cloneNode(!0):r,o=t.parentNode,n=t.nextSibling;i.appendChild(t),n?o.insertBefore(i,n):o.appendChild(i)}))}function Lt(t,r){xt(t)&&!Ct(r)&&Object.entries(r).filter((function(t){var r=n(t,2);return!yt(r[1])})).forEach((function(r){var e=n(r,2);return t.setAttribute(e[0],e[1])}))}function Ft(t,r,e){var i=document.createElement(t);return ft(r)&&Lt(i,r),gt(e)&&(i.innerText=e),i}function Rt(t,r,e,i){xt(r)&&r.appendChild(Ft(t,e,i))}function Nt(t){kt(t)||wt(t)?Array.from(t).forEach(Nt):xt(t)&&xt(t.parentNode)&&t.parentNode.removeChild(t)}function Dt(t){if(xt(t))for(var r=t.childNodes.length;r>0;)t.removeChild(t.lastChild),r-=1}function Bt(t,r){return xt(r)&&xt(r.parentNode)&&xt(t)?(r.parentNode.replaceChild(t,r),t):null}function $t(t,r){if(!gt(t)||Ct(t))return{};var e={},i=It({},r);return t.split(",").forEach((function(t){var r=t.trim(),o=r.replace(".",""),a=r.replace(/[[\]]/g,"").split("="),s=n(a,1)[0],l=a.length>1?a[1].replace(/["']/g,""):"";switch(r.charAt(0)){case".":e.class=gt(i.class)?"".concat(i.class," ").concat(o):o;break;case"#":e.id=r.replace("#","");break;case"[":e[s]=l}})),It(i,e)}function qt(t,r){if(xt(t)){var e=r;bt(e)||(e=!t.hidden),t.hidden=e}}function Vt(t,r,e){if(kt(t))return Array.from(t).map((function(t){return Vt(t,r,e)}));if(xt(t)){var i="toggle";return void 0!==e&&(i=e?"add":"remove"),t.classList[i](r),t.classList.contains(r)}return!1}function Ht(t,r){return xt(t)&&t.classList.contains(r)}function Ut(t,r){var e=Element.prototype;return(e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||function(){return Array.from(document.querySelectorAll(r)).includes(this)}).call(t,r)}function Qt(t){return this.elements.container.querySelectorAll(t)}function Yt(t){return this.elements.container.querySelector(t)}function Wt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];xt(t)&&(t.focus({preventScroll:!0}),r&&Vt(t,this.config.classNames.tabFocus))}var Jt={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},Gt={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(t,r,e){var i=Gt[t]||"html5"!==r;return{api:i,ui:i&&Gt.rangeInput&&("video"!==t||!At.isIPhone||At.isIPhone&&e&&Gt.playsinline)}},pip:!(At.isIPhone||!mt(Ft("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||Ft("video").disablePictureInPicture)),airplay:mt(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime:function(t){if(Ct(t))return!1;var r=t.split("/"),e=n(r,1),i=t;if(!this.isHTML5||e[0]!==this.type)return!1;Object.keys(Jt).includes(i)&&(i+='; codecs="'.concat(Jt[t],'"'));try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(t){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:function(){var t=document.createElement("input");return t.type="range","range"===t.type}(),touch:"ontouchstart"in document.documentElement,transitions:!1!==Pt,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Kt=function(){var t=!1;try{var r=Object.defineProperty({},"passive",{get:function(){return t=!0,null}});window.addEventListener("test",null,r),window.removeEventListener("test",null,r)}catch(t){}return t}();function Xt(t,r,e){var i=this,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t&&"addEventListener"in t&&!Ct(r)&&mt(e)){var s=r.split(" "),l=a;Kt&&(l={passive:n,capture:a}),s.forEach((function(r){i&&i.eventListeners&&o&&i.eventListeners.push({element:t,type:r,callback:e,options:l}),t[o?"addEventListener":"removeEventListener"](r,e,l)}))}}function Zt(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Xt.call(this,t,r,e,!0,i,o)}function tr(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2?arguments[2]:void 0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];Xt.call(this,t,r,e,!1,i,o)}function rr(t){var r=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=function a(){for(var s=arguments.length,l=new Array(s),p=0;p<s;p++)l[p]=arguments[p];tr(t,e,a,o,n),i.apply(r,l)};Xt.call(this,t,e,a,!0,o,n)}function er(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(xt(t)&&!Ct(r)){var o=new CustomEvent(r,{bubbles:e,detail:a(a({},i),{},{plyr:this})});t.dispatchEvent(o)}}function ir(){this&&this.eventListeners&&(this.eventListeners.forEach((function(t){t.element.removeEventListener(t.type,t.callback,t.options)})),this.eventListeners=[])}function or(){var t=this;return new Promise((function(r){return t.ready?setTimeout(r,0):Zt.call(t,t.elements.container,"ready",r)})).then((function(){}))}function nr(t){(function(t){return st(t,Promise)&&dt(t.then)})(t)&&t.then(null,(function(){}))}function ar(t){return wt(t)?t.filter((function(r,e){return t.indexOf(r)===e})):t}function sr(t,r){return wt(t)&&t.length?t.reduce((function(t,e){return Math.abs(e-r)<Math.abs(t-r)?e:t})):null}function lr(t){return!(!window||!window.CSS)&&window.CSS.supports(t)}var pr=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((function(t,r){var e=n(r,2),i=e[0],o=e[1];return a(a({},t),{},s({},i/o,[i,o]))}),{});function ur(t){return!!(wt(t)||gt(t)&&t.includes(":"))&&(wt(t)?t:t.split(":")).map(Number).every(_t)}function dr(t){if(!wt(t)||!t.every(_t))return null;var r=n(t,2),e=r[0],i=r[1],o=function t(r,e){return 0===e?r:t(e,r%e)}(e,i);return[e/o,i/o]}function cr(t){var r=function(t){return ur(t)?t.split(":").map(Number):null},e=r(t);if(null===e&&(e=r(this.config.ratio)),null===e&&!Ct(this.embed)&&wt(this.embed.ratio)&&(e=this.embed.ratio),null===e&&this.isHTML5){var i=this.media;e=[i.videoWidth,i.videoHeight]}return dr(e)}function hr(t){if(!this.isVideo)return{};var r=this.elements.wrapper,e=cr.call(this,t);if(!wt(e))return{};var i=dr(e),o=n(i,2),a=o[0],s=o[1],l=100/a*s;if(lr("aspect-ratio: ".concat(a,"/").concat(s))?r.style.aspectRatio="".concat(a,"/").concat(s):r.style.paddingBottom="".concat(l,"%"),this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){var p=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),u=(p-l)/(p/50);this.fullscreen.active?r.style.paddingBottom=null:this.media.style.transform="translateY(-".concat(u,"%)")}else this.isHTML5&&r.classList.add(this.config.classNames.videoFixedRatio);return{padding:l,ratio:e}}function vr(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.05,i=t/r,o=sr(Object.keys(pr),i);return Math.abs(o-i)<=e?pr[o]:[t,r]}var yr={getSources:function(){var t=this;return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((function(r){var e=r.getAttribute("type");return!!Ct(e)||Gt.mime.call(t,e)})):[]},getQualityOptions:function(){return this.config.quality.forced?this.config.quality.options:yr.getSources.call(this).map((function(t){return Number(t.getAttribute("size"))})).filter(Boolean)},setup:function(){if(this.isHTML5){var t=this;t.options.speed=t.config.speed.options,Ct(this.config.ratio)||hr.call(t),Object.defineProperty(t.media,"quality",{get:function(){var r=yr.getSources.call(t).find((function(r){return r.getAttribute("src")===t.source}));return r&&Number(r.getAttribute("size"))},set:function(r){if(t.quality!==r){if(t.config.quality.forced&&mt(t.config.quality.onChange))t.config.quality.onChange(r);else{var e=yr.getSources.call(t).find((function(t){return Number(t.getAttribute("size"))===r}));if(!e)return;var i=t.media,o=i.currentTime,n=i.paused,a=i.preload,s=i.readyState,l=i.playbackRate;t.media.src=e.getAttribute("src"),("none"!==a||s)&&(t.once("loadedmetadata",(function(){t.speed=l,t.currentTime=o,n||nr(t.play())})),t.media.load())}er.call(t,t.media,"qualitychange",!1,{quality:r})}}})}},cancelRequests:function(){this.isHTML5&&(Nt(yr.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function fr(t){return"".concat(t,"-").concat(Math.floor(1e4*Math.random()))}function _r(t){for(var r=arguments.length,e=new Array(r>1?r-1:0),i=1;i<r;i++)e[i-1]=arguments[i];return Ct(t)?t:t.toString().replace(/{(\d+)}/g,(function(t,r){return e[r].toString()}))}var gr=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.replace(new RegExp(r.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),e.toString())},br=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.toString().replace(/\w\S*/g,(function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}))};function mr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=t.toString();return r=gr(r,"-"," "),r=gr(r,"_"," "),r=br(r),gr(r," ","")}function wr(t){var r=document.createElement("div");return r.appendChild(t),r.innerHTML}var kr={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},xr=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Ct(t)||Ct(r))return"";var e=Mt(r.i18n,t);if(Ct(e))return Object.keys(kr).includes(t)?kr[t]:"";var i={"{seektime}":r.seekTime,"{title}":r.title};return Object.entries(i).forEach((function(t){var r=n(t,2);e=gr(e,r[0],r[1])})),e},zr=function(){function t(r){var e=this;u(this,t),N(this,"get",(function(r){if(!t.supported||!e.enabled)return null;var i=window.localStorage.getItem(e.key);if(Ct(i))return null;var o=JSON.parse(i);return gt(r)&&r.length?o[r]:o})),N(this,"set",(function(r){if(t.supported&&e.enabled&&ft(r)){var i=e.get();Ct(i)&&(i={}),It(i,r);try{window.localStorage.setItem(e.key,JSON.stringify(i))}catch(r){}}})),this.enabled=r.config.storage.enabled,this.key=r.config.storage.key}return l(t,null,[{key:"supported",get:function(){try{if(!("localStorage"in window))return!1;var t="___test";return window.localStorage.setItem(t,t),window.localStorage.removeItem(t),!0}catch(t){return!1}}}]),t}();function jr(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";return new Promise((function(e,i){try{var o=new XMLHttpRequest;if(!("withCredentials"in o))return;o.addEventListener("load",(function(){if("text"===r)try{e(JSON.parse(o.responseText))}catch(t){e(o.responseText)}else e(o.response)})),o.addEventListener("error",(function(){throw new Error(o.status)})),o.open("GET",t,!0),o.responseType=r,o.send()}catch(t){i(t)}}))}function Sr(t,r,e){if(gt(t)){var i=gt(r),o=function(){return null!==document.getElementById(r)},n=function(t,r){t.innerHTML=r,i&&o()||e.appendChild(t)};if(!i||!o()){var a=zr.supported,s=document.createElement("div");if(s.setAttribute("hidden",""),i&&s.setAttribute("id",r),a){var l=window.localStorage.getItem("cache-".concat(r));if(null!==l){var p=JSON.parse(l);n(s,p.content)}}jr(t).then((function(t){if(!Ct(t)){if(a)try{window.localStorage.setItem("cache-".concat(r),JSON.stringify({content:t}))}catch(t){}n(s,t)}})).catch((function(){}))}}}var Tr=function(t){return Math.trunc(t/60/60%60,10)},Cr=function(t){return Math.trunc(t%60,10)};function Pr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!_t(t))return Pr(void 0,r,e);var i,o=function(t){return"0".concat(t).slice(-2)},n=Tr(t),a=(i=t,Math.trunc(i/60%60,10)),s=Cr(t);return n=r||n>0?"".concat(n,":"):"","".concat(e&&t>0?"-":"").concat(n).concat(o(a),":").concat(o(s))}var Or={getIconUrl:function(){var t=new URL(this.config.iconUrl,window.location),r=window.location.host?window.location.host:window.top.location.host,e=t.host!==r||At.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:e}},findElements:function(){try{return this.elements.controls=Yt.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:Qt.call(this,this.config.selectors.buttons.play),pause:Yt.call(this,this.config.selectors.buttons.pause),restart:Yt.call(this,this.config.selectors.buttons.restart),rewind:Yt.call(this,this.config.selectors.buttons.rewind),fastForward:Yt.call(this,this.config.selectors.buttons.fastForward),mute:Yt.call(this,this.config.selectors.buttons.mute),pip:Yt.call(this,this.config.selectors.buttons.pip),airplay:Yt.call(this,this.config.selectors.buttons.airplay),settings:Yt.call(this,this.config.selectors.buttons.settings),captions:Yt.call(this,this.config.selectors.buttons.captions),fullscreen:Yt.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=Yt.call(this,this.config.selectors.progress),this.elements.inputs={seek:Yt.call(this,this.config.selectors.inputs.seek),volume:Yt.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:Yt.call(this,this.config.selectors.display.buffer),currentTime:Yt.call(this,this.config.selectors.display.currentTime),duration:Yt.call(this,this.config.selectors.display.duration)},xt(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(".".concat(this.config.classNames.tooltip))),!0}catch(t){return this.debug.warn("It looks like there is a problem with your custom controls HTML",t),this.toggleNativeControls(!0),!1}},createIcon:function(t,r){var e="http://www.w3.org/2000/svg",i=Or.getIconUrl.call(this),o="".concat(i.cors?"":i.url,"#").concat(this.config.iconPrefix),n=document.createElementNS(e,"svg");Lt(n,It(r,{"aria-hidden":"true",focusable:"false"}));var a=document.createElementNS(e,"use"),s="".concat(o,"-").concat(t);return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",s),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s),n.appendChild(a),n},createLabel:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=xr(t,this.config);return Ft("span",a(a({},r),{},{class:[r.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),e)},createBadge:function(t){if(Ct(t))return null;var r=Ft("span",{class:this.config.classNames.menu.value});return r.appendChild(Ft("span",{class:this.config.classNames.menu.badge},t)),r},createButton:function(t,r){var e=this,i=It({},r),o=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString();return(t=mr(t)).charAt(0).toLowerCase()+t.slice(1)}(t),n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((function(t){Object.keys(i).includes(t)&&(n[t]=i[t],delete i[t])})),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((function(t){return t===e.config.classNames.control}))||It(i,{class:"".concat(i.class," ").concat(this.config.classNames.control)}):i.class=this.config.classNames.control,t){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=" ".concat(this.config.classNames.control,"--overlaid"),o="play",n.label="play",n.icon="play";break;default:Ct(n.label)&&(n.label=o),Ct(n.icon)&&(n.icon=t)}var a=Ft(n.element);return n.toggle?(a.appendChild(Or.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(Or.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(Or.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(Or.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(Or.createIcon.call(this,n.icon)),a.appendChild(Or.createLabel.call(this,n.label))),It(i,$t(this.config.selectors.buttons[o],i)),Lt(a,i),"play"===o?(wt(this.elements.buttons[o])||(this.elements.buttons[o]=[]),this.elements.buttons[o].push(a)):this.elements.buttons[o]=a,a},createRange:function(t,r){var e=Ft("input",It($t(this.config.selectors.inputs[t]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":xr(t,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},r));return this.elements.inputs[t]=e,Or.updateRangeFill.call(this,e),nt.setup(e),e},createProgress:function(t,r){var e=Ft("progress",It($t(this.config.selectors.display[t]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},r));if("volume"!==t){e.appendChild(Ft("span",null,"0"));var i={played:"played",buffer:"buffered"}[t],o=i?xr(i,this.config):"";e.innerText="% ".concat(o.toLowerCase())}return this.elements.display[t]=e,e},createTime:function(t,r){var e=$t(this.config.selectors.display[t],r),i=Ft("div",It(e,{class:"".concat(e.class?e.class:""," ").concat(this.config.classNames.display.time," ").trim(),"aria-label":xr(t,this.config)}),"00:00");return this.elements.display[t]=i,i},bindMenuItemShortcuts:function(t,r){var e=this;Zt.call(this,t,"keydown keyup",(function(i){if(["Space","ArrowUp","ArrowDown","ArrowRight"].includes(i.key)&&(i.preventDefault(),i.stopPropagation(),"keydown"!==i.type)){var o,n=Ut(t,'[role="menuitemradio"]');!n&&["Space","ArrowRight"].includes(i.key)?Or.showMenuPanel.call(e,r,!0):"Space"!==i.key&&("ArrowDown"===i.key||n&&"ArrowRight"===i.key?xt(o=t.nextElementSibling)||(o=t.parentNode.firstElementChild):xt(o=t.previousElementSibling)||(o=t.parentNode.lastElementChild),Wt.call(e,o,!0))}}),!1),Zt.call(this,t,"keyup",(function(t){"Return"===t.key&&Or.focusFirstMenuItem.call(e,null,!0)}))},createMenuItem:function(t){var r=this,e=t.value,i=t.list,o=t.type,n=t.title,a=t.badge,s=void 0===a?null:a,l=t.checked,p=void 0!==l&&l,u=$t(this.config.selectors.inputs[o]),d=Ft("button",It(u,{type:"button",role:"menuitemradio",class:"".concat(this.config.classNames.control," ").concat(u.class?u.class:"").trim(),"aria-checked":p,value:e})),c=Ft("span");c.innerHTML=n,xt(s)&&c.appendChild(s),d.appendChild(c),Object.defineProperty(d,"checked",{enumerable:!0,get:function(){return"true"===d.getAttribute("aria-checked")},set:function(t){t&&Array.from(d.parentNode.children).filter((function(t){return Ut(t,'[role="menuitemradio"]')})).forEach((function(t){return t.setAttribute("aria-checked","false")})),d.setAttribute("aria-checked",t?"true":"false")}}),this.listeners.bind(d,"click keyup",(function(t){if(!jt(t)||"Space"===t.key){switch(t.preventDefault(),t.stopPropagation(),d.checked=!0,o){case"language":r.currentTrack=Number(e);break;case"quality":r.quality=e;break;case"speed":r.speed=parseFloat(e)}Or.showMenuPanel.call(r,"home",jt(t))}}),o,!1),Or.bindMenuItemShortcuts.call(this,d,o),i.appendChild(d)},formatTime:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return _t(t)?Pr(t,Tr(this.duration)>0,r):t},updateTimeDisplay:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];xt(t)&&_t(r)&&(t.innerText=Or.formatTime(r,e))},updateVolume:function(){this.supported.ui&&(xt(this.elements.inputs.volume)&&Or.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),xt(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;xt(t)&&(t.value=r,Or.updateRangeFill.call(this,t))},updateProgress:function(t){var r=this;if(this.supported.ui&&zt(t)){var e=0;if(t)switch(t.type){case"timeupdate":case"seeking":case"seeked":e=function(t,r){return 0===t||0===r||Number.isNaN(t)||Number.isNaN(r)?0:(t/r*100).toFixed(2)}(this.currentTime,this.duration),"timeupdate"===t.type&&Or.setRange.call(this,this.elements.inputs.seek,e);break;case"playing":case"progress":!function(t,e){var i=_t(e)?e:0,o=xt(t)?t:r.elements.display.buffer;if(xt(o)){o.value=i;var n=o.getElementsByTagName("span")[0];xt(n)&&(n.childNodes[0].nodeValue=i)}}(this.elements.display.buffer,100*this.buffered)}}},updateRangeFill:function(t){var r=zt(t)?t.target:t;if(xt(r)&&"range"===r.getAttribute("type")){if(Ut(r,this.config.selectors.inputs.seek)){r.setAttribute("aria-valuenow",this.currentTime);var e=Or.formatTime(this.currentTime),i=Or.formatTime(this.duration),o=xr("seekLabel",this.config);r.setAttribute("aria-valuetext",o.replace("{currentTime}",e).replace("{duration}",i))}else if(Ut(r,this.config.selectors.inputs.volume)){var n=100*r.value;r.setAttribute("aria-valuenow",n),r.setAttribute("aria-valuetext","".concat(n.toFixed(1),"%"))}else r.setAttribute("aria-valuenow",r.value);At.isWebkit&&r.style.setProperty("--value",r.value/r.max*100+"%")}},updateSeekTooltip:function(t){var r,e;if(this.config.tooltips.seek&&xt(this.elements.inputs.seek)&&xt(this.elements.display.seekTooltip)&&0!==this.duration){var i=this.elements.display.seekTooltip,o="".concat(this.config.classNames.tooltip,"--visible"),n=function(t){return Vt(i,o,t)};if(this.touch)n(!1);else{var a=0,s=this.elements.progress.getBoundingClientRect();if(zt(t))a=100/s.width*(t.pageX-s.left);else{if(!Ht(i,o))return;a=parseFloat(i.style.left,10)}a<0?a=0:a>100&&(a=100);var l=this.duration/100*a;i.innerText=Or.formatTime(l);var p=null===(r=this.config.markers)||void 0===r||null===(e=r.points)||void 0===e?void 0:e.find((function(t){return t.time===Math.round(l)}));p&&i.insertAdjacentHTML("afterbegin","".concat(p.label,"<br>")),i.style.left="".concat(a,"%"),zt(t)&&["mouseenter","mouseleave"].includes(t.type)&&n("mouseenter"===t.type)}}},timeUpdate:function(t){var r=!xt(this.elements.display.duration)&&this.config.invertTime;Or.updateTimeDisplay.call(this,this.elements.display.currentTime,r?this.duration-this.currentTime:this.currentTime,r),t&&"timeupdate"===t.type&&this.media.seeking||Or.updateProgress.call(this,t)},durationUpdate:function(){if(this.supported.ui&&(this.config.invertTime||!this.currentTime)){if(this.duration>=Math.pow(2,32))return qt(this.elements.display.currentTime,!0),void qt(this.elements.progress,!0);xt(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);var t=xt(this.elements.display.duration);!t&&this.config.displayDuration&&this.paused&&Or.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),t&&Or.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Or.setMarkers.call(this),Or.updateSeekTooltip.call(this)}},toggleMenuButton:function(t,r){qt(this.elements.settings.buttons[t],!r)},updateSetting:function(t,r,e){var i=this.elements.settings.panels[t],o=null,n=r;if("captions"===t)o=this.currentTrack;else{if(o=Ct(e)?this[t]:e,Ct(o)&&(o=this.config[t].default),!Ct(this.options[t])&&!this.options[t].includes(o))return void this.debug.warn("Unsupported value of '".concat(o,"' for ").concat(t));if(!this.config[t].options.includes(o))return void this.debug.warn("Disabled value of '".concat(o,"' for ").concat(t))}if(xt(n)||(n=i&&i.querySelector('[role="menu"]')),xt(n)){this.elements.settings.buttons[t].querySelector(".".concat(this.config.classNames.menu.value)).innerHTML=Or.getLabel.call(this,t,o);var a=n&&n.querySelector('[value="'.concat(o,'"]'));xt(a)&&(a.checked=!0)}},getLabel:function(t,r){switch(t){case"speed":return 1===r?xr("normal",this.config):"".concat(r,"×");case"quality":if(_t(r)){if(0===r)return xr("auto",this.config);var e=xr("qualityLabel.".concat(r),this.config);return e.length?e:"".concat(r,"p")}return br(r);case"captions":return Ir.getLabel.call(this);default:return null}},setQualityMenu:function(t){var r=this;if(xt(this.elements.settings.panels.quality)){var e="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');wt(t)&&(this.options.quality=ar(t).filter((function(t){return r.config.quality.options.includes(t)})));var o=!Ct(this.options.quality)&&this.options.quality.length>1;if(Or.toggleMenuButton.call(this,e,o),Dt(i),Or.checkMenu.call(this),o){var n=function(t){var e=xr("qualityBadge.".concat(t),r.config);return e.length?Or.createBadge.call(r,e):null};this.options.quality.sort((function(t,e){var i=r.config.quality.options;return i.indexOf(t)>i.indexOf(e)?1:-1})).forEach((function(t){Or.createMenuItem.call(r,{value:t,list:i,type:e,title:Or.getLabel.call(r,"quality",t),badge:n(t)})})),Or.updateSetting.call(this,e,i)}}},setCaptionsMenu:function(){var t=this;if(xt(this.elements.settings.panels.captions)){var r="captions",e=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=Ir.getTracks.call(this),o=Boolean(i.length);if(Or.toggleMenuButton.call(this,r,o),Dt(e),Or.checkMenu.call(this),o){var n=i.map((function(r,i){return{value:i,checked:t.captions.toggled&&t.currentTrack===i,title:Ir.getLabel.call(t,r),badge:r.language&&Or.createBadge.call(t,r.language.toUpperCase()),list:e,type:"language"}}));n.unshift({value:-1,checked:!this.captions.toggled,title:xr("disabled",this.config),list:e,type:"language"}),n.forEach(Or.createMenuItem.bind(this)),Or.updateSetting.call(this,r,e)}}},setSpeedMenu:function(){var t=this;if(xt(this.elements.settings.panels.speed)){var r="speed",e=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((function(r){return r>=t.minimumSpeed&&r<=t.maximumSpeed}));var i=!Ct(this.options.speed)&&this.options.speed.length>1;Or.toggleMenuButton.call(this,r,i),Dt(e),Or.checkMenu.call(this),i&&(this.options.speed.forEach((function(i){Or.createMenuItem.call(t,{value:i,list:e,type:r,title:Or.getLabel.call(t,"speed",i)})})),Or.updateSetting.call(this,r,e))}},checkMenu:function(){var t=this.elements.settings.buttons,r=!Ct(t)&&Object.values(t).some((function(t){return!t.hidden}));qt(this.elements.settings.menu,!r)},focusFirstMenuItem:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.elements.settings.popup.hidden){var e=t;xt(e)||(e=Object.values(this.elements.settings.panels).find((function(t){return!t.hidden})));var i=e.querySelector('[role^="menuitem"]');Wt.call(this,i,r)}},toggleMenu:function(t){var r=this.elements.settings.popup,e=this.elements.buttons.settings;if(xt(r)&&xt(e)){var i=r.hidden,o=i;if(bt(t))o=t;else if(jt(t)&&"Escape"===t.key)o=!1;else if(zt(t)){var n=mt(t.composedPath)?t.composedPath()[0]:t.target,a=r.contains(n);if(a||!a&&t.target!==e&&o)return}e.setAttribute("aria-expanded",o),qt(r,!o),Vt(this.elements.container,this.config.classNames.menu.open,o),o&&jt(t)?Or.focusFirstMenuItem.call(this,null,!0):o||i||Wt.call(this,e,jt(t))}},getMenuSize:function(t){var r=t.cloneNode(!0);r.style.position="absolute",r.style.opacity=0,r.removeAttribute("hidden"),t.parentNode.appendChild(r);var e=r.scrollWidth,i=r.scrollHeight;return Nt(r),{width:e,height:i}},showMenuPanel:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.elements.container.querySelector("#plyr-settings-".concat(this.id,"-").concat(r));if(xt(i)){var o=i.parentNode,n=Array.from(o.children).find((function(t){return!t.hidden}));if(Gt.transitions&&!Gt.reducedMotion){o.style.width="".concat(n.scrollWidth,"px"),o.style.height="".concat(n.scrollHeight,"px");var a=Or.getMenuSize.call(this,i),s=function r(e){e.target===o&&["width","height"].includes(e.propertyName)&&(o.style.width="",o.style.height="",tr.call(t,o,Pt,r))};Zt.call(this,o,Pt,s),o.style.width="".concat(a.width,"px"),o.style.height="".concat(a.height,"px")}qt(n,!0),qt(i,!1),Or.focusFirstMenuItem.call(this,i,e)}},setDownloadUrl:function(){var t=this.elements.buttons.download;xt(t)&&t.setAttribute("href",this.download)},create:function(t){var r=this,e=Or.bindMenuItemShortcuts,i=Or.createButton,o=Or.createProgress,n=Or.createRange,a=Or.createTime,s=Or.setQualityMenu,l=Or.setSpeedMenu,p=Or.showMenuPanel;this.elements.controls=null,wt(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));var u=Ft("div",$t(this.config.selectors.controls.wrapper));this.elements.controls=u;var d={class:"plyr__controls__item"};return ar(wt(this.config.controls)?this.config.controls:[]).forEach((function(s){if("restart"===s&&u.appendChild(i.call(r,"restart",d)),"rewind"===s&&u.appendChild(i.call(r,"rewind",d)),"play"===s&&u.appendChild(i.call(r,"play",d)),"fast-forward"===s&&u.appendChild(i.call(r,"fast-forward",d)),"progress"===s){var l=Ft("div",{class:"".concat(d.class," plyr__progress__container")}),c=Ft("div",$t(r.config.selectors.progress));if(c.appendChild(n.call(r,"seek",{id:"plyr-seek-".concat(t.id)})),c.appendChild(o.call(r,"buffer")),r.config.tooltips.seek){var h=Ft("span",{class:r.config.classNames.tooltip},"00:00");c.appendChild(h),r.elements.display.seekTooltip=h}r.elements.progress=c,l.appendChild(r.elements.progress),u.appendChild(l)}if("current-time"===s&&u.appendChild(a.call(r,"currentTime",d)),"duration"===s&&u.appendChild(a.call(r,"duration",d)),"mute"===s||"volume"===s){var v=r.elements.volume;xt(v)&&u.contains(v)||(v=Ft("div",It({},d,{class:"".concat(d.class," plyr__volume").trim()})),r.elements.volume=v,u.appendChild(v)),"mute"===s&&v.appendChild(i.call(r,"mute")),"volume"!==s||At.isIos||v.appendChild(n.call(r,"volume",It({max:1,step:.05,value:r.config.volume},{id:"plyr-volume-".concat(t.id)})))}if("captions"===s&&u.appendChild(i.call(r,"captions",d)),"settings"===s&&!Ct(r.config.settings)){var y=Ft("div",It({},d,{class:"".concat(d.class," plyr__menu").trim(),hidden:""}));y.appendChild(i.call(r,"settings",{"aria-haspopup":!0,"aria-controls":"plyr-settings-".concat(t.id),"aria-expanded":!1}));var f=Ft("div",{class:"plyr__menu__container",id:"plyr-settings-".concat(t.id),hidden:""}),_=Ft("div"),g=Ft("div",{id:"plyr-settings-".concat(t.id,"-home")}),b=Ft("div",{role:"menu"});g.appendChild(b),_.appendChild(g),r.elements.settings.panels.home=g,r.config.settings.forEach((function(i){var o=Ft("button",It($t(r.config.selectors.buttons.settings),{type:"button",class:"".concat(r.config.classNames.control," ").concat(r.config.classNames.control,"--forward"),role:"menuitem","aria-haspopup":!0,hidden:""}));e.call(r,o,i),Zt.call(r,o,"click",(function(){p.call(r,i,!1)}));var n=Ft("span",null,xr(i,r.config)),a=Ft("span",{class:r.config.classNames.menu.value});a.innerHTML=t[i],n.appendChild(a),o.appendChild(n),b.appendChild(o);var s=Ft("div",{id:"plyr-settings-".concat(t.id,"-").concat(i),hidden:""}),l=Ft("button",{type:"button",class:"".concat(r.config.classNames.control," ").concat(r.config.classNames.control,"--back")});l.appendChild(Ft("span",{"aria-hidden":!0},xr(i,r.config))),l.appendChild(Ft("span",{class:r.config.classNames.hidden},xr("menuBack",r.config))),Zt.call(r,s,"keydown",(function(t){"ArrowLeft"===t.key&&(t.preventDefault(),t.stopPropagation(),p.call(r,"home",!0))}),!1),Zt.call(r,l,"click",(function(){p.call(r,"home",!1)})),s.appendChild(l),s.appendChild(Ft("div",{role:"menu"})),_.appendChild(s),r.elements.settings.buttons[i]=o,r.elements.settings.panels[i]=s})),f.appendChild(_),y.appendChild(f),u.appendChild(y),r.elements.settings.popup=f,r.elements.settings.menu=y}if("pip"===s&&Gt.pip&&u.appendChild(i.call(r,"pip",d)),"airplay"===s&&Gt.airplay&&u.appendChild(i.call(r,"airplay",d)),"download"===s){var m=It({},d,{element:"a",href:r.download,target:"_blank"});r.isHTML5&&(m.download=""),!Tt(r.config.urls.download)&&r.isEmbed&&It(m,{icon:"logo-".concat(r.provider),label:r.provider}),u.appendChild(i.call(r,"download",m))}"fullscreen"===s&&u.appendChild(i.call(r,"fullscreen",d))})),this.isHTML5&&s.call(this,yr.getQualityOptions.call(this)),l.call(this),u},inject:function(){var t=this;if(this.config.loadSprite){var r=Or.getIconUrl.call(this);r.cors&&Sr(r.url,"sprite-plyr",this.elements.container)}this.id=Math.floor(1e4*Math.random());var e=null;this.elements.controls=null;var i,o={id:this.id,seektime:this.config.seekTime,title:this.config.title},a=!0;if(mt(this.config.controls)&&(this.config.controls=this.config.controls.call(this,o)),this.config.controls||(this.config.controls=[]),xt(this.config.controls)||gt(this.config.controls)?e=this.config.controls:(e=Or.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Ir.getLabel.call(this)}),a=!1),a&>(this.config.controls)&&(e=function(t){var r=t;return Object.entries(o).forEach((function(t){var e=n(t,2),i=e[1];r=gr(r,"{".concat(e[0],"}"),i)})),r}(e)),gt(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),xt(i)||(i=this.elements.container),i[xt(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),xt(this.elements.controls)||Or.findElements.call(this),!Ct(this.elements.buttons)){var s=function(r){var e=t.config.classNames.controlPressed;r.setAttribute("aria-pressed","false"),Object.defineProperty(r,"pressed",{configurable:!0,enumerable:!0,get:function(){return Ht(r,e)},set:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];Vt(r,e,t),r.setAttribute("aria-pressed",t?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach((function(t){wt(t)||kt(t)?Array.from(t).filter(Boolean).forEach(s):s(t)}))}if(At.isEdge&&Ot(i),this.config.tooltips.controls){var l=this.config,p=l.classNames,u=l.selectors,d="".concat(u.controls.wrapper," ").concat(u.labels," .").concat(p.hidden),c=Qt.call(this,d);Array.from(c).forEach((function(r){Vt(r,t.config.classNames.hidden,!1),Vt(r,t.config.classNames.tooltip,!0)}))}},setMediaMetadata:function(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch(t){}},setMarkers:function(){var t,r,e=this;if(this.duration&&!this.elements.markers){var i=null===(t=this.config.markers)||void 0===t||null===(r=t.points)||void 0===r?void 0:r.filter((function(t){var r=t.time;return r>0&&r<e.duration}));if(null!=i&&i.length){var o=document.createDocumentFragment(),n=document.createDocumentFragment(),a=null,s="".concat(this.config.classNames.tooltip,"--visible"),l=function(t){return Vt(a,s,t)};i.forEach((function(t){var r=Ft("span",{class:e.config.classNames.marker},""),i=t.time/e.duration*100+"%";a&&(r.addEventListener("mouseenter",(function(){t.label||(a.style.left=i,a.innerHTML=t.label,l(!0))})),r.addEventListener("mouseleave",(function(){l(!1)}))),r.addEventListener("click",(function(){e.currentTime=t.time})),r.style.left=i,n.appendChild(r)})),o.appendChild(n),this.config.tooltips.seek||(a=Ft("span",{class:this.config.classNames.tooltip},""),o.appendChild(a)),this.elements.markers={points:n,tip:a},this.elements.progress.appendChild(o)}}}};function Ar(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=t;if(r){var i=document.createElement("a");i.href=e,e=i.href}try{return new URL(e)}catch(t){return null}}function Mr(t){var r=new URLSearchParams;return ft(t)&&Object.entries(t).forEach((function(t){var e=n(t,2);r.set(e[0],e[1])})),r}var Ir={setup:function(){if(this.supported.ui)if(!this.isVideo||this.isYouTube||this.isHTML5&&!Gt.textTracks)wt(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Or.setCaptionsMenu.call(this);else{if(xt(this.elements.captions)||(this.elements.captions=Ft("div",$t(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),function(t,r){xt(t)&&xt(r)&&r.parentNode.insertBefore(t,r.nextSibling)}(this.elements.captions,this.elements.wrapper)),At.isIE&&window.URL){var t=this.media.querySelectorAll("track");Array.from(t).forEach((function(t){var r=t.getAttribute("src"),e=Ar(r);null!==e&&e.hostname!==window.location.href.hostname&&["http:","https:"].includes(e.protocol)&&jr(r,"blob").then((function(r){t.setAttribute("src",window.URL.createObjectURL(r))})).catch((function(){Nt(t)}))}))}var r=ar((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((function(t){return t.split("-")[0]}))),e=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===e&&(e=n(r,1)[0]);var i=this.storage.get("captions");bt(i)||(i=this.config.captions.active),Object.assign(this.captions,{toggled:!1,active:i,language:e,languages:r}),this.isHTML5&&Zt.call(this,this.media.textTracks,this.config.captions.update?"addtrack removetrack":"removetrack",Ir.update.bind(this)),setTimeout(Ir.update.bind(this),0)}},update:function(){var t=this,r=Ir.getTracks.call(this,!0),e=this.captions,i=e.active,o=e.language,n=e.meta,a=e.currentTrackNode,s=Boolean(r.find((function(t){return t.language===o})));this.isHTML5&&this.isVideo&&r.filter((function(t){return!n.get(t)})).forEach((function(r){t.debug.log("Track added",r),n.set(r,{default:"showing"===r.mode}),"showing"===r.mode&&(r.mode="hidden"),Zt.call(t,r,"cuechange",(function(){return Ir.updateCues.call(t)}))})),(s&&this.language!==o||!r.includes(a))&&(Ir.setLanguage.call(this,o),Ir.toggle.call(this,i&&s)),this.elements&&Vt(this.elements.container,this.config.classNames.captions.enabled,!Ct(r)),wt(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Or.setCaptionsMenu.call(this)},toggle:function(t){var r=this,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.supported.ui){var i=this.captions.toggled,o=this.config.classNames.captions.active,n=yt(t)?!i:t;if(n!==i){if(e||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!e){var a=Ir.getTracks.call(this),s=Ir.findTrack.call(this,[this.captions.language].concat(d(this.captions.languages)),!0);return this.captions.language=s.language,void Ir.set.call(this,a.indexOf(s))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),Vt(this.elements.container,o,n),this.captions.toggled=n,Or.updateSetting.call(this,"captions"),er.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout((function(){n&&r.captions.toggled&&r.captions.currentTrackNode&&(r.captions.currentTrackNode.mode="hidden")}))}},set:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=Ir.getTracks.call(this);if(-1!==t)if(_t(t))if(t in e){if(this.captions.currentTrack!==t){this.captions.currentTrack=t;var i=e[t],o=i||{},n=o.language;this.captions.currentTrackNode=i,Or.updateSetting.call(this,"captions"),r||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),er.call(this,this.media,"languagechange")}Ir.toggle.call(this,!0,r),this.isHTML5&&this.isVideo&&Ir.updateCues.call(this)}else this.debug.warn("Track not found",t);else this.debug.warn("Invalid caption argument",t);else Ir.toggle.call(this,!1,r)},setLanguage:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(gt(t)){var e=t.toLowerCase();this.captions.language=e;var i=Ir.getTracks.call(this),o=Ir.findTrack.call(this,[e]);Ir.set.call(this,i.indexOf(o),r)}else this.debug.warn("Invalid language argument",t)},getTracks:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Array.from((this.media||{}).textTracks||[]).filter((function(e){return!t.isHTML5||r||t.captions.meta.has(e)})).filter((function(t){return["captions","subtitles"].includes(t.kind)}))},findTrack:function(t){var r,e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=Ir.getTracks.call(this),n=function(t){return Number((e.captions.meta.get(t)||{}).default)},a=Array.from(o).sort((function(t,r){return n(r)-n(t)}));return t.every((function(t){return!(r=a.find((function(r){return r.language===t})))})),r||(i?a[0]:void 0)},getCurrentTrack:function(){return Ir.getTracks.call(this)[this.currentTrack]},getLabel:function(t){var r=t;return!St(r)&&Gt.textTracks&&this.captions.toggled&&(r=Ir.getCurrentTrack.call(this)),St(r)?Ct(r.label)?Ct(r.language)?xr("enabled",this.config):t.language.toUpperCase():r.label:xr("disabled",this.config)},updateCues:function(t){if(this.supported.ui)if(xt(this.elements.captions))if(yt(t)||Array.isArray(t)){var r=t;if(!r){var e=Ir.getCurrentTrack.call(this);r=Array.from((e||{}).activeCues||[]).map((function(t){return t.getCueAsHTML()})).map(wr)}var i=r.map((function(t){return t.trim()})).join("\n");if(i!==this.elements.captions.innerHTML){Dt(this.elements.captions);var o=Ft("span",$t(this.config.selectors.caption));o.innerHTML=i,this.elements.captions.appendChild(o),er.call(this,this.media,"cuechange")}}else this.debug.warn("updateCues: Invalid input",t);else this.debug.warn("No captions element to render to")}},Er={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"},auto:"AUTO"},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},Lr={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Fr=function(){},Rr=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u(this,t),this.enabled=window.console&&r,this.enabled&&this.log("Debugging enabled")}return l(t,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):Fr}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):Fr}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):Fr}}]),t}(),Nr=function(){function t(r){var e=this;u(this,t),N(this,"onChange",(function(){if(e.enabled){var t=e.player.elements.buttons.fullscreen;xt(t)&&(t.pressed=e.active),er.call(e.player,e.target===e.player.media?e.target:e.player.elements.container,e.active?"enterfullscreen":"exitfullscreen",!0)}})),N(this,"toggleFallback",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t?e.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(e.scrollPosition.x,e.scrollPosition.y),document.body.style.overflow=t?"hidden":"",Vt(e.target,e.player.config.classNames.fullscreen.fallback,t),At.isIos){var r=document.head.querySelector('meta[name="viewport"]'),i="viewport-fit=cover";r||(r=document.createElement("meta")).setAttribute("name","viewport");var o=gt(r.content)&&r.content.includes(i);t?(e.cleanupViewport=!o,o||(r.content+=",".concat(i))):e.cleanupViewport&&(r.content=r.content.split(",").filter((function(t){return t.trim()!==i})).join(","))}e.onChange()})),N(this,"trapFocus",(function(t){if(!At.isIos&&e.active&&"Tab"===t.key){var r=document.activeElement,i=Qt.call(e.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),o=n(i,1)[0],a=i[i.length-1];r!==a||t.shiftKey?r===o&&t.shiftKey&&(a.focus(),t.preventDefault()):(o.focus(),t.preventDefault())}})),N(this,"update",(function(){e.player.debug.log(e.enabled?"".concat(e.forceFallback?"Fallback (forced)":t.native?"Native":"Fallback"," fullscreen enabled"):"Fullscreen not supported and fallback disabled"),Vt(e.player.elements.container,e.player.config.classNames.fullscreen.enabled,e.enabled)})),N(this,"enter",(function(){e.enabled&&(At.isIos&&e.player.config.fullscreen.iosNative?e.player.isVimeo?e.player.embed.requestFullscreen():e.target.webkitEnterFullscreen():!t.native||e.forceFallback?e.toggleFallback(!0):e.prefix?Ct(e.prefix)||e.target["".concat(e.prefix,"Request").concat(e.property)]():e.target.requestFullscreen({navigationUI:"hide"}))})),N(this,"exit",(function(){if(e.enabled)if(At.isIos&&e.player.config.fullscreen.iosNative)e.target.webkitExitFullscreen(),nr(e.player.play());else if(!t.native||e.forceFallback)e.toggleFallback(!1);else if(e.prefix){if(!Ct(e.prefix)){var r="moz"===e.prefix?"Cancel":"Exit";document["".concat(e.prefix).concat(r).concat(e.property)]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),N(this,"toggle",(function(){e.active?e.exit():e.enter()})),this.player=r,this.prefix=t.prefix,this.property=t.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===r.config.fullscreen.fallback,this.player.elements.fullscreen=r.config.fullscreen.container&&function(t,r){return(Element.prototype.closest||function(){var t=this;do{if(Ut.matches(t,r))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}).call(t,r)}(this.player.elements.container,r.config.fullscreen.container),Zt.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":"".concat(this.prefix,"fullscreenchange"),(function(){e.onChange()})),Zt.call(this.player,this.player.elements.container,"dblclick",(function(t){xt(e.player.elements.controls)&&e.player.elements.controls.contains(t.target)||e.player.listeners.proxy(t,e.toggle,"fullscreen")})),Zt.call(this,this.player.elements.container,"keydown",(function(t){return e.trapFocus(t)})),this.update()}return l(t,[{key:"usingNative",get:function(){return t.native&&!this.forceFallback}},{key:"enabled",get:function(){return(t.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}},{key:"active",get:function(){if(!this.enabled)return!1;if(!t.native||this.forceFallback)return Ht(this.target,this.player.config.classNames.fullscreen.fallback);var r=this.prefix?this.target.getRootNode()["".concat(this.prefix).concat(this.property,"Element")]:this.target.getRootNode().fullscreenElement;return r&&r.shadowRoot?r===this.target.getRootNode().host:r===this.target}},{key:"target",get:function(){return At.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}],[{key:"native",get:function(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}},{key:"prefix",get:function(){if(mt(document.exitFullscreen))return"";var t="";return["webkit","moz","ms"].some((function(r){return!(!mt(document["".concat(r,"ExitFullscreen")])&&!mt(document["".concat(r,"CancelFullScreen")])||(t=r,0))})),t}},{key:"property",get:function(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}}]),t}();function Dr(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Promise((function(e,i){var o=new Image,n=function(){delete o.onload,delete o.onerror,(o.naturalWidth>=r?e:i)(o)};Object.assign(o,{onload:n,onerror:n,src:t})}))}var Br={addStyleHook:function(){Vt(this.elements.container,this.config.selectors.container.replace(".",""),!0),Vt(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){var t=this;if(this.listeners.media(),!this.supported.ui)return this.debug.warn("Basic support only for ".concat(this.provider," ").concat(this.type)),void Br.toggleNativeControls.call(this,!0);xt(this.elements.controls)||(Or.inject.call(this),this.listeners.controls()),Br.toggleNativeControls.call(this),this.isHTML5&&Ir.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Or.updateVolume.call(this),Or.timeUpdate.call(this),Or.durationUpdate.call(this),Br.checkPlaying.call(this),Vt(this.elements.container,this.config.classNames.pip.supported,Gt.pip&&this.isHTML5&&this.isVideo),Vt(this.elements.container,this.config.classNames.airplay.supported,Gt.airplay&&this.isHTML5),Vt(this.elements.container,this.config.classNames.isIos,At.isIos),Vt(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((function(){er.call(t,t.media,"ready")}),0),Br.setTitle.call(this),this.poster&&Br.setPoster.call(this,this.poster,!1).catch((function(){})),this.config.duration&&Or.durationUpdate.call(this),this.config.mediaMetadata&&Or.setMediaMetadata.call(this)},setTitle:function(){var t=xr("play",this.config);if(gt(this.config.title)&&!Ct(this.config.title)&&(t+=", ".concat(this.config.title)),Array.from(this.elements.buttons.play||[]).forEach((function(r){r.setAttribute("aria-label",t)})),this.isEmbed){var r=Yt.call(this,"iframe");if(!xt(r))return;var e=Ct(this.config.title)?"video":this.config.title,i=xr("frameTitle",this.config);r.setAttribute("title",i.replace("{title}",e))}},togglePoster:function(t){Vt(this.elements.container,this.config.classNames.posterEnabled,t)},setPoster:function(t){var r=this,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",t),this.elements.poster.removeAttribute("hidden"),or.call(this).then((function(){return Dr(t)})).catch((function(e){throw t===r.poster&&Br.togglePoster.call(r,!1),e})).then((function(){if(t!==r.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((function(){return Object.assign(r.elements.poster.style,{backgroundImage:"url('".concat(t,"')"),backgroundSize:""}),Br.togglePoster.call(r,!0),t})))},checkPlaying:function(t){var r=this;Vt(this.elements.container,this.config.classNames.playing,this.playing),Vt(this.elements.container,this.config.classNames.paused,this.paused),Vt(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((function(t){Object.assign(t,{pressed:r.playing}),t.setAttribute("aria-label",xr(r.playing?"pause":"play",r.config))})),zt(t)&&"timeupdate"===t.type||Br.toggleControls.call(this)},checkLoading:function(t){var r=this;this.loading=["stalled","waiting"].includes(t.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((function(){Vt(r.elements.container,r.config.classNames.loading,r.loading),Br.toggleControls.call(r)}),this.loading?250:0)},toggleControls:function(t){var r=this.elements.controls;if(r&&this.config.hideControls){var e=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(t||this.loading||this.paused||r.pressed||r.hover||e))}},migrateStyles:function(){var t=this;Object.values(a({},this.media.style)).filter((function(t){return!Ct(t)&>(t)&&t.startsWith("--plyr")})).forEach((function(r){t.elements.container.style.setProperty(r,t.media.style.getPropertyValue(r)),t.media.style.removeProperty(r)})),Ct(this.media.style)&&this.media.removeAttribute("style")}},$r=function(){function t(r){var e=this;u(this,t),N(this,"firstTouch",(function(){var t=e.player,r=t.elements;t.touch=!0,Vt(r.container,t.config.classNames.isTouch,!0)})),N(this,"setTabFocus",(function(t){var r=e.player,i=r.elements,o=t.key,n=t.type,a=t.timeStamp;clearTimeout(e.focusTimer),("keydown"!==n||"Tab"===o)&&("keydown"===n&&(e.lastKeyDown=a),("focus"!==n||a-e.lastKeyDown<=20)&&(function(){var t=r.config.classNames.tabFocus;Vt(Qt.call(r,".".concat(t)),t,!1)}(),"focusout"!==n&&(e.focusTimer=setTimeout((function(){var t=document.activeElement;i.container.contains(t)&&Vt(document.activeElement,r.config.classNames.tabFocus,!0)}),10))))})),N(this,"global",(function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=e.player;r.config.keyboard.global&&Xt.call(r,window,"keydown keyup",e.handleKey,t,!1),Xt.call(r,document.body,"click",e.toggleMenu,t),rr.call(r,document.body,"touchstart",e.firstTouch),Xt.call(r,document.body,"keydown focus blur focusout",e.setTabFocus,t,!1,!0)})),N(this,"container",(function(){var t=e.player,r=t.config,i=t.elements,o=t.timers;!r.keyboard.global&&r.keyboard.focused&&Zt.call(t,i.container,"keydown keyup",e.handleKey,!1),Zt.call(t,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(function(r){var e=i.controls;e&&"enterfullscreen"===r.type&&(e.pressed=!1,e.hover=!1);var n=0;["touchstart","touchmove","mousemove"].includes(r.type)&&(Br.toggleControls.call(t,!0),n=t.touch?3e3:2e3),clearTimeout(o.controls),o.controls=setTimeout((function(){return Br.toggleControls.call(t,!1)}),n)}));var a=function(){if(t.isVimeo&&!t.config.vimeo.premium){var r=i.wrapper,e=t.fullscreen.active,o=cr.call(t),a=n(o,2),s=a[0],l=a[1],p=lr("aspect-ratio: ".concat(s," / ").concat(l));if(e){var u=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],d=n(u,2),c=d[1],h=d[0]/c>s/l;p?(r.style.width=h?"auto":"100%",r.style.height=h?"100%":"auto"):(r.style.maxWidth=h?c/l*s+"px":null,r.style.margin=h?"0 auto":null)}else p?(r.style.width=null,r.style.height=null):(r.style.maxWidth=null,r.style.margin=null)}},s=function(){clearTimeout(o.resized),o.resized=setTimeout(a,50)};Zt.call(t,i.container,"enterfullscreen exitfullscreen",(function(r){t.fullscreen.target===i.container&&(!t.isEmbed&&Ct(t.config.ratio)||(a(),("enterfullscreen"===r.type?Zt:tr).call(t,window,"resize",s)))}))})),N(this,"media",(function(){var t=e.player,r=t.elements;if(Zt.call(t,t.media,"timeupdate seeking seeked",(function(r){return Or.timeUpdate.call(t,r)})),Zt.call(t,t.media,"durationchange loadeddata loadedmetadata",(function(r){return Or.durationUpdate.call(t,r)})),Zt.call(t,t.media,"ended",(function(){t.isHTML5&&t.isVideo&&t.config.resetOnEnd&&(t.restart(),t.pause())})),Zt.call(t,t.media,"progress playing seeking seeked",(function(r){return Or.updateProgress.call(t,r)})),Zt.call(t,t.media,"volumechange",(function(r){return Or.updateVolume.call(t,r)})),Zt.call(t,t.media,"playing play pause ended emptied timeupdate",(function(r){return Br.checkPlaying.call(t,r)})),Zt.call(t,t.media,"waiting canplay seeked playing",(function(r){return Br.checkLoading.call(t,r)})),t.supported.ui&&t.config.clickToPlay&&!t.isAudio){var i=Yt.call(t,".".concat(t.config.classNames.video));if(!xt(i))return;Zt.call(t,r.container,"click",(function(o){([r.container,i].includes(o.target)||i.contains(o.target))&&(t.touch&&t.config.hideControls||(t.ended?(e.proxy(o,t.restart,"restart"),e.proxy(o,(function(){nr(t.play())}),"play")):e.proxy(o,(function(){nr(t.togglePlay())}),"play")))}))}t.supported.ui&&t.config.disableContextMenu&&Zt.call(t,r.wrapper,"contextmenu",(function(t){t.preventDefault()}),!1),Zt.call(t,t.media,"volumechange",(function(){t.storage.set({volume:t.volume,muted:t.muted})})),Zt.call(t,t.media,"ratechange",(function(){Or.updateSetting.call(t,"speed"),t.storage.set({speed:t.speed})})),Zt.call(t,t.media,"qualitychange",(function(r){Or.updateSetting.call(t,"quality",null,r.detail.quality)})),Zt.call(t,t.media,"ready qualitychange",(function(){Or.setDownloadUrl.call(t)}));var o=t.config.events.concat(["keyup","keydown"]).join(" ");Zt.call(t,t.media,o,(function(e){var i=e.detail,o=void 0===i?{}:i;"error"===e.type&&(o=t.media.error),er.call(t,r.container,e.type,!0,o)}))})),N(this,"proxy",(function(t,r,i){var o=e.player,n=o.config.listeners[i],a=!0;mt(n)&&(a=n.call(o,t)),!1!==a&&mt(r)&&r.call(o,t)})),N(this,"bind",(function(t,r,i,o){var n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=e.player,s=a.config.listeners[o],l=mt(s);Zt.call(a,t,r,(function(t){return e.proxy(t,i,o)}),n&&!l)})),N(this,"controls",(function(){var t=e.player,r=t.elements,i=At.isIE?"change":"input";if(r.buttons.play&&Array.from(r.buttons.play).forEach((function(r){e.bind(r,"click",(function(){nr(t.togglePlay())}),"play")})),e.bind(r.buttons.restart,"click",t.restart,"restart"),e.bind(r.buttons.rewind,"click",(function(){t.lastSeekTime=Date.now(),t.rewind()}),"rewind"),e.bind(r.buttons.fastForward,"click",(function(){t.lastSeekTime=Date.now(),t.forward()}),"fastForward"),e.bind(r.buttons.mute,"click",(function(){t.muted=!t.muted}),"mute"),e.bind(r.buttons.captions,"click",(function(){return t.toggleCaptions()})),e.bind(r.buttons.download,"click",(function(){er.call(t,t.media,"download")}),"download"),e.bind(r.buttons.fullscreen,"click",(function(){t.fullscreen.toggle()}),"fullscreen"),e.bind(r.buttons.pip,"click",(function(){t.pip="toggle"}),"pip"),e.bind(r.buttons.airplay,"click",t.airplay,"airplay"),e.bind(r.buttons.settings,"click",(function(r){r.stopPropagation(),r.preventDefault(),Or.toggleMenu.call(t,r)}),null,!1),e.bind(r.buttons.settings,"keyup",(function(r){["Space","Enter"].includes(r.key)&&("Enter"!==r.key?(r.preventDefault(),r.stopPropagation(),Or.toggleMenu.call(t,r)):Or.focusFirstMenuItem.call(t,null,!0))}),null,!1),e.bind(r.settings.menu,"keydown",(function(r){"Escape"===r.key&&Or.toggleMenu.call(t,r)})),e.bind(r.inputs.seek,"mousedown mousemove",(function(t){var e=r.progress.getBoundingClientRect();t.currentTarget.setAttribute("seek-value",100/e.width*(t.pageX-e.left))})),e.bind(r.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(function(r){var e=r.currentTarget,i="play-on-seeked";if(!jt(r)||["ArrowLeft","ArrowRight"].includes(r.key)){t.lastSeekTime=Date.now();var o=e.hasAttribute(i),n=["mouseup","touchend","keyup"].includes(r.type);o&&n?(e.removeAttribute(i),nr(t.play())):!n&&t.playing&&(e.setAttribute(i,""),t.pause())}})),At.isIos){var o=Qt.call(t,'input[type="range"]');Array.from(o).forEach((function(t){return e.bind(t,i,(function(t){return Ot(t.target)}))}))}e.bind(r.inputs.seek,i,(function(r){var e=r.currentTarget,i=e.getAttribute("seek-value");Ct(i)&&(i=e.value),e.removeAttribute("seek-value"),t.currentTime=i/e.max*t.duration}),"seek"),e.bind(r.progress,"mouseenter mouseleave mousemove",(function(r){return Or.updateSeekTooltip.call(t,r)})),e.bind(r.progress,"mousemove touchmove",(function(r){var e=t.previewThumbnails;e&&e.loaded&&e.startMove(r)})),e.bind(r.progress,"mouseleave touchend click",(function(){var r=t.previewThumbnails;r&&r.loaded&&r.endMove(!1,!0)})),e.bind(r.progress,"mousedown touchstart",(function(r){var e=t.previewThumbnails;e&&e.loaded&&e.startScrubbing(r)})),e.bind(r.progress,"mouseup touchend",(function(r){var e=t.previewThumbnails;e&&e.loaded&&e.endScrubbing(r)})),At.isWebkit&&Array.from(Qt.call(t,'input[type="range"]')).forEach((function(r){e.bind(r,"input",(function(r){return Or.updateRangeFill.call(t,r.target)}))})),t.config.toggleInvert&&!xt(r.display.duration)&&e.bind(r.display.currentTime,"click",(function(){0!==t.currentTime&&(t.config.invertTime=!t.config.invertTime,Or.timeUpdate.call(t))})),e.bind(r.inputs.volume,i,(function(r){t.volume=r.target.value}),"volume"),e.bind(r.controls,"mouseenter mouseleave",(function(e){r.controls.hover=!t.touch&&"mouseenter"===e.type})),r.fullscreen&&Array.from(r.fullscreen.children).filter((function(t){return!t.contains(r.container)})).forEach((function(i){e.bind(i,"mouseenter mouseleave",(function(e){r.controls&&(r.controls.hover=!t.touch&&"mouseenter"===e.type)}))})),e.bind(r.controls,"mousedown mouseup touchstart touchend touchcancel",(function(t){r.controls.pressed=["mousedown","touchstart"].includes(t.type)})),e.bind(r.controls,"focusin",(function(){var i=t.config,o=t.timers;Vt(r.controls,i.classNames.noTransition,!0),Br.toggleControls.call(t,!0),setTimeout((function(){Vt(r.controls,i.classNames.noTransition,!1)}),0);var n=e.touch?3e3:4e3;clearTimeout(o.controls),o.controls=setTimeout((function(){return Br.toggleControls.call(t,!1)}),n)})),e.bind(r.inputs.volume,"wheel",(function(r){var e=r.webkitDirectionInvertedFromDevice,i=[r.deltaX,-r.deltaY].map((function(t){return e?-t:t})),o=n(i,2),a=o[0],s=o[1],l=Math.sign(Math.abs(a)>Math.abs(s)?a:s);t.increaseVolume(l/50);var p=t.media.volume;(1===l&&p<1||-1===l&&p>0)&&r.preventDefault()}),"volume",!1)})),this.player=r,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}return l(t,[{key:"handleKey",value:function(t){var r,e=this.player,i=e.elements,o=t.key,n="keydown"===t.type,a=n&&o===this.lastKey;if(!(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)&&o)if(n){var s=document.activeElement;if(xt(s)){if(s!==i.inputs.seek&&Ut(s,e.config.selectors.editable))return;if("Space"===t.key&&Ut(s,'button, [role^="menuitem"]'))return}switch(["Space","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(o)&&(t.preventDefault(),t.stopPropagation()),o){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":a||(r=parseInt(o,10),e.currentTime=e.duration/10*r);break;case"Space":case"k":a||nr(e.togglePlay());break;case"ArrowUp":e.increaseVolume(.1);break;case"ArrowDown":e.decreaseVolume(.1);break;case"m":a||(e.muted=!e.muted);break;case"ArrowRight":e.forward();break;case"ArrowLeft":e.rewind();break;case"f":e.fullscreen.toggle();break;case"c":a||e.toggleCaptions();break;case"l":e.loop=!e.loop}"Escape"===o&&!e.fullscreen.usingNative&&e.fullscreen.active&&e.fullscreen.toggle(),this.lastKey=o}else this.lastKey=null}},{key:"toggleMenu",value:function(t){Or.toggleMenu.call(this.player,t)}}]),t}(),qr=function(t,r){return function(t){t.exports=function(){var t=function(){},r={},e={},i={};function o(t,r){if(t){var o=i[t];if(e[t]=r,o)for(;o.length;)o[0](t,r),o.splice(0,1)}}function n(r,e){r.call&&(r={success:r}),e.length?(r.error||t)(e):(r.success||t)(r)}function a(r,e,i,o){var n,s,l=document,p=i.async,u=(i.numRetries||0)+1,d=i.before||t,c=r.replace(/[\?|#].*$/,""),h=r.replace(/^(css|img)!/,"");o=o||0,/(^css!|\.css$)/.test(c)?((s=l.createElement("link")).rel="stylesheet",s.href=h,(n="hideFocus"in s)&&s.relList&&(n=0,s.rel="preload",s.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(c)?(s=l.createElement("img")).src=h:((s=l.createElement("script")).src=r,s.async=void 0===p||p),s.onload=s.onerror=s.onbeforeload=function(t){var l=t.type[0];if(n)try{s.sheet.cssText.length||(l="e")}catch(t){18!=t.code&&(l="e")}if("e"==l){if((o+=1)<u)return a(r,e,i,o)}else if("preload"==s.rel&&"style"==s.as)return s.rel="stylesheet";e(r,l,t.defaultPrevented)},!1!==d(r,s)&&l.head.appendChild(s)}function s(t,r,e){var i,o,n=(t=t.push?t:[t]).length,s=n,l=[];for(i=function(t,e,i){if("e"==e&&l.push(t),"b"==e){if(!i)return;l.push(t)}--n||r(l)},o=0;o<s;o++)a(t[o],i,e)}function l(t,e,i){var a,l;if(e&&e.trim&&(a=e),l=(a?i:e)||{},a){if(a in r)throw"LoadJS";r[a]=!0}function p(r,e){s(t,(function(t){n(l,t),r&&n({success:r,error:e},t),o(a,t)}),l)}if(l.returnPromise)return new Promise(p);p()}return l.ready=function(t,r){return function(t,r){var o,n,a,s=[],l=(t=t.push?t:[t]).length,p=l;for(o=function(t,e){e.length&&s.push(t),--p||r(s)};l--;)(a=e[n=t[l]])?o(n,a):(i[n]=i[n]||[]).push(o)}(t,(function(t){n(r,t)})),l},l.done=function(t){o(t,[])},l.reset=function(){r={},e={},i={}},l.isDefined=function(t){return t in r},l}()}(r={exports:{}}),r.exports}();function Vr(t){return new Promise((function(r,e){qr(t,{success:r,error:e})}))}function Hr(t){t&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===t&&(this.media.paused=!t,er.call(this,this.media,t?"play":"pause"))}var Ur={setup:function(){var t=this;Vt(t.elements.wrapper,t.config.classNames.embed,!0),t.options.speed=t.config.speed.options,hr.call(t),ft(window.Vimeo)?Ur.ready.call(t):Vr(t.config.urls.vimeo.sdk).then((function(){Ur.ready.call(t)})).catch((function(r){t.debug.warn("Vimeo SDK (player.js) failed to load",r)}))},ready:function(){var t=this,r=this,e=r.config.vimeo,i=e.premium,o=e.referrerPolicy,s=c(e,R),l=r.media.getAttribute("src"),p="";Ct(l)?(l=r.media.getAttribute(r.config.attributes.embed.id),p=r.media.getAttribute(r.config.attributes.embed.hash)):p=function(t){var r=t.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return r&&5===r.length?r[4]:null}(l);var u=p?{h:p}:{};i&&Object.assign(s,{controls:!1,sidedock:!1});var d=Mr(a(a({loop:r.config.loop.active,autoplay:r.autoplay,muted:r.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},u),s)),h=function(t){return Ct(t)?null:_t(Number(t))?t:t.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:t}(l),v=Ft("iframe"),y=_r(r.config.urls.vimeo.iframe,h,d);if(v.setAttribute("src",y),v.setAttribute("allowfullscreen",""),v.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),Ct(o)||v.setAttribute("referrerPolicy",o),i||!e.customControls)v.setAttribute("data-poster",r.poster),r.media=Bt(v,r.media);else{var f=Ft("div",{class:r.config.classNames.embedContainer,"data-poster":r.poster});f.appendChild(v),r.media=Bt(f,r.media)}e.customControls||jr(_r(r.config.urls.vimeo.api,y)).then((function(t){!Ct(t)&&t.thumbnail_url&&Br.setPoster.call(r,t.thumbnail_url).catch((function(){}))})),r.embed=new window.Vimeo.Player(v,{autopause:r.config.autopause,muted:r.muted}),r.media.paused=!0,r.media.currentTime=0,r.supported.ui&&r.embed.disableTextTrack(),r.media.play=function(){return Hr.call(r,!0),r.embed.play()},r.media.pause=function(){return Hr.call(r,!1),r.embed.pause()},r.media.stop=function(){r.pause(),r.currentTime=0};var _=r.media.currentTime;Object.defineProperty(r.media,"currentTime",{get:function(){return _},set:function(t){var e=r.embed,i=r.media,o=r.volume,n=r.paused&&!e.hasPlayed;i.seeking=!0,er.call(r,i,"seeking"),Promise.resolve(n&&e.setVolume(0)).then((function(){return e.setCurrentTime(t)})).then((function(){return n&&e.pause()})).then((function(){return n&&e.setVolume(o)})).catch((function(){}))}});var g=r.config.speed.selected;Object.defineProperty(r.media,"playbackRate",{get:function(){return g},set:function(t){r.embed.setPlaybackRate(t).then((function(){g=t,er.call(r,r.media,"ratechange")})).catch((function(){r.options.speed=[1]}))}});var b=r.config.volume;Object.defineProperty(r.media,"volume",{get:function(){return b},set:function(t){r.embed.setVolume(t).then((function(){b=t,er.call(r,r.media,"volumechange")}))}});var m=r.config.muted;Object.defineProperty(r.media,"muted",{get:function(){return m},set:function(t){var e=!!bt(t)&&t;r.embed.setVolume(e?0:r.config.volume).then((function(){m=e,er.call(r,r.media,"volumechange")}))}});var w,k=r.config.loop;Object.defineProperty(r.media,"loop",{get:function(){return k},set:function(t){var e=bt(t)?t:r.config.loop.active;r.embed.setLoop(e).then((function(){k=e}))}}),r.embed.getVideoUrl().then((function(t){w=t,Or.setDownloadUrl.call(r)})).catch((function(r){t.debug.warn(r)})),Object.defineProperty(r.media,"currentSrc",{get:function(){return w}}),Object.defineProperty(r.media,"ended",{get:function(){return r.currentTime===r.duration}}),Promise.all([r.embed.getVideoWidth(),r.embed.getVideoHeight()]).then((function(e){var i=n(e,2);r.embed.ratio=vr(i[0],i[1]),hr.call(t)})),r.embed.setAutopause(r.config.autopause).then((function(t){r.config.autopause=t})),r.embed.getVideoTitle().then((function(e){r.config.title=e,Br.setTitle.call(t)})),r.embed.getCurrentTime().then((function(t){_=t,er.call(r,r.media,"timeupdate")})),r.embed.getDuration().then((function(t){r.media.duration=t,er.call(r,r.media,"durationchange")})),r.embed.on("loaded",(function(){r.embed.getPaused().then((function(t){Hr.call(r,!t),t||er.call(r,r.media,"playing")})),xt(r.embed.element)&&r.supported.ui&&r.embed.element.setAttribute("tabindex",-1)})),r.embed.on("bufferstart",(function(){er.call(r,r.media,"waiting")})),r.embed.on("bufferend",(function(){er.call(r,r.media,"playing")})),r.embed.on("play",(function(){Hr.call(r,!0),er.call(r,r.media,"playing")})),r.embed.on("pause",(function(){Hr.call(r,!1)})),r.embed.on("timeupdate",(function(t){r.media.seeking=!1,_=t.seconds,er.call(r,r.media,"timeupdate")})),r.embed.on("progress",(function(t){r.media.buffered=t.percent,er.call(r,r.media,"progress"),1===parseInt(t.percent,10)&&er.call(r,r.media,"canplaythrough"),r.embed.getDuration().then((function(t){t!==r.media.duration&&(r.media.duration=t,er.call(r,r.media,"durationchange"))}))})),r.embed.on("seeked",(function(){r.media.seeking=!1,er.call(r,r.media,"seeked")})),r.embed.on("ended",(function(){r.media.paused=!0,er.call(r,r.media,"ended")})),r.embed.on("error",(function(t){r.media.error=t,er.call(r,r.media,"error")})),e.customControls&&setTimeout((function(){return Br.build.call(r)}),0)}};function Qr(t){t&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===t&&(this.media.paused=!t,er.call(this,this.media,t?"play":"pause"))}function Yr(t){return t.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}var Wr={setup:function(){var t=this;if(Vt(this.elements.wrapper,this.config.classNames.embed,!0),ft(window.YT)&&mt(window.YT.Player))Wr.ready.call(this);else{var r=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){mt(r)&&r(),Wr.ready.call(t)},Vr(this.config.urls.youtube.sdk).catch((function(r){t.debug.warn("YouTube API failed to load",r)}))}},getTitle:function(t){var r=this;jr(_r(this.config.urls.youtube.api,t)).then((function(t){if(ft(t)){var e=t.height,i=t.width;r.config.title=t.title,Br.setTitle.call(r),r.embed.ratio=vr(i,e)}hr.call(r)})).catch((function(){hr.call(r)}))},ready:function(){var t=this,r=t.config.youtube,e=t.media&&t.media.getAttribute("id");if(Ct(e)||!e.startsWith("youtube-")){var i=t.media.getAttribute("src");Ct(i)&&(i=t.media.getAttribute(this.config.attributes.embed.id));var o=function(t){return Ct(t)?null:t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:t}(i),n=Ft("div",{id:fr(t.provider),"data-poster":r.customControls?t.poster:void 0});if(t.media=Bt(n,t.media),r.customControls){var a=function(t){return"https://i.ytimg.com/vi/".concat(o,"/").concat(t,"default.jpg")};Dr(a("maxres"),121).catch((function(){return Dr(a("sd"),121)})).catch((function(){return Dr(a("hq"))})).then((function(r){return Br.setPoster.call(t,r.src)})).then((function(r){r.includes("maxres")||(t.elements.poster.style.backgroundSize="cover")})).catch((function(){}))}t.embed=new window.YT.Player(t.media,{videoId:o,host:Yr(r),playerVars:It({},{autoplay:t.config.autoplay?1:0,hl:t.config.hl,controls:t.supported.ui&&r.customControls?0:1,disablekb:1,playsinline:t.config.fullscreen.iosNative?0:1,cc_load_policy:t.captions.active?1:0,cc_lang_pref:t.config.captions.language,widget_referrer:window?window.location.href:null},r),events:{onError:function(r){if(!t.media.error){var e=r.data;t.media.error={code:e,message:{2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[e]||"An unknown error occured"},er.call(t,t.media,"error")}},onPlaybackRateChange:function(r){t.media.playbackRate=r.target.getPlaybackRate(),er.call(t,t.media,"ratechange")},onReady:function(e){if(!mt(t.media.play)){var i=e.target;Wr.getTitle.call(t,o),t.media.play=function(){Qr.call(t,!0),i.playVideo()},t.media.pause=function(){Qr.call(t,!1),i.pauseVideo()},t.media.stop=function(){i.stopVideo()},t.media.duration=i.getDuration(),t.media.paused=!0,t.media.currentTime=0,Object.defineProperty(t.media,"currentTime",{get:function(){return Number(i.getCurrentTime())},set:function(r){t.paused&&!t.embed.hasPlayed&&t.embed.mute(),t.media.seeking=!0,er.call(t,t.media,"seeking"),i.seekTo(r)}}),Object.defineProperty(t.media,"playbackRate",{get:function(){return i.getPlaybackRate()},set:function(t){i.setPlaybackRate(t)}});var n=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return n},set:function(r){i.setVolume(100*(n=r)),er.call(t,t.media,"volumechange")}});var a=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return a},set:function(r){var e=bt(r)?r:a;a=e,i[e?"mute":"unMute"](),i.setVolume(100*n),er.call(t,t.media,"volumechange")}}),Object.defineProperty(t.media,"currentSrc",{get:function(){return i.getVideoUrl()}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}});var s=i.getAvailablePlaybackRates();t.options.speed=s.filter((function(r){return t.config.speed.options.includes(r)})),t.supported.ui&&r.customControls&&t.media.setAttribute("tabindex",-1),er.call(t,t.media,"timeupdate"),er.call(t,t.media,"durationchange"),clearInterval(t.timers.buffering),t.timers.buffering=setInterval((function(){t.media.buffered=i.getVideoLoadedFraction(),(null===t.media.lastBuffered||t.media.lastBuffered<t.media.buffered)&&er.call(t,t.media,"progress"),t.media.lastBuffered=t.media.buffered,1===t.media.buffered&&(clearInterval(t.timers.buffering),er.call(t,t.media,"canplaythrough"))}),200),r.customControls&&setTimeout((function(){return Br.build.call(t)}),50)}},onStateChange:function(e){var i=e.target;switch(clearInterval(t.timers.playing),t.media.seeking&&[1,2].includes(e.data)&&(t.media.seeking=!1,er.call(t,t.media,"seeked")),e.data){case-1:er.call(t,t.media,"timeupdate"),t.media.buffered=i.getVideoLoadedFraction(),er.call(t,t.media,"progress");break;case 0:Qr.call(t,!1),t.media.loop?(i.stopVideo(),i.playVideo()):er.call(t,t.media,"ended");break;case 1:r.customControls&&!t.config.autoplay&&t.media.paused&&!t.embed.hasPlayed?t.media.pause():(Qr.call(t,!0),er.call(t,t.media,"playing"),t.timers.playing=setInterval((function(){er.call(t,t.media,"timeupdate")}),50),t.media.duration!==i.getDuration()&&(t.media.duration=i.getDuration(),er.call(t,t.media,"durationchange")));break;case 2:t.muted||t.embed.unMute(),Qr.call(t,!1);break;case 3:er.call(t,t.media,"waiting")}er.call(t,t.elements.container,"statechange",!1,{code:e.data})}}})}}},Jr={setup:function(){this.media?(Vt(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),Vt(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&Vt(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=Ft("div",{class:this.config.classNames.video}),Et(this.media,this.elements.wrapper),this.elements.poster=Ft("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?yr.setup.call(this):this.isYouTube?Wr.setup.call(this):this.isVimeo&&Ur.setup.call(this)):this.debug.warn("No media element found!")}},Gr=function(){function t(r){var e=this;u(this,t),N(this,"load",(function(){e.enabled&&(ft(window.google)&&ft(window.google.ima)?e.ready():Vr(e.player.config.urls.googleIMA.sdk).then((function(){e.ready()})).catch((function(){e.trigger("error",new Error("Google IMA SDK failed to load"))})))})),N(this,"ready",(function(){var t;e.enabled||((t=e).manager&&t.manager.destroy(),t.elements.displayContainer&&t.elements.displayContainer.destroy(),t.elements.container.remove()),e.startSafetyTimer(12e3,"ready()"),e.managerPromise.then((function(){e.clearSafetyTimer("onAdsManagerLoaded()")})),e.listeners(),e.setupIMA()})),N(this,"setupIMA",(function(){e.elements.container=Ft("div",{class:e.player.config.classNames.ads}),e.player.elements.container.appendChild(e.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(e.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(e.player.config.playsinline),e.elements.displayContainer=new google.ima.AdDisplayContainer(e.elements.container,e.player.media),e.loader=new google.ima.AdsLoader(e.elements.displayContainer),e.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(function(t){return e.onAdsManagerLoaded(t)}),!1),e.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){return e.onAdError(t)}),!1),e.requestAds()})),N(this,"requestAds",(function(){var t=e.player.elements.container;try{var r=new google.ima.AdsRequest;r.adTagUrl=e.tagUrl,r.linearAdSlotWidth=t.offsetWidth,r.linearAdSlotHeight=t.offsetHeight,r.nonLinearAdSlotWidth=t.offsetWidth,r.nonLinearAdSlotHeight=t.offsetHeight,r.forceNonLinearFullSlot=!1,r.setAdWillPlayMuted(!e.player.muted),e.loader.requestAds(r)}catch(t){e.onAdError(t)}})),N(this,"pollCountdown",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!t)return clearInterval(e.countdownTimer),void e.elements.container.removeAttribute("data-badge-text");e.countdownTimer=setInterval((function(){var t=Pr(Math.max(e.manager.getRemainingTime(),0)),r="".concat(xr("advertisement",e.player.config)," - ").concat(t);e.elements.container.setAttribute("data-badge-text",r)}),100)})),N(this,"onAdsManagerLoaded",(function(t){if(e.enabled){var r=new google.ima.AdsRenderingSettings;r.restoreCustomPlaybackStateOnAdBreakComplete=!0,r.enablePreloading=!0,e.manager=t.getAdsManager(e.player,r),e.cuePoints=e.manager.getCuePoints(),e.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(function(t){return e.onAdError(t)})),Object.keys(google.ima.AdEvent.Type).forEach((function(t){e.manager.addEventListener(google.ima.AdEvent.Type[t],(function(t){return e.onAdEvent(t)}))})),e.trigger("loaded")}})),N(this,"addCuePoints",(function(){Ct(e.cuePoints)||e.cuePoints.forEach((function(t){if(0!==t&&-1!==t&&t<e.player.duration){var r=e.player.elements.progress;if(xt(r)){var i=100/e.player.duration*t,o=Ft("span",{class:e.player.config.classNames.cues});o.style.left="".concat(i.toString(),"%"),r.appendChild(o)}}}))})),N(this,"onAdEvent",(function(t){var r=e.player.elements.container,i=t.getAd(),o=t.getAdData();switch(function(t){er.call(e.player,e.player.media,"ads".concat(t.replace(/_/g,"").toLowerCase()))}(t.type),t.type){case google.ima.AdEvent.Type.LOADED:e.trigger("loaded"),e.pollCountdown(!0),i.isLinear()||(i.width=r.offsetWidth,i.height=r.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:e.manager.setVolume(e.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:e.player.ended?e.loadAds():e.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:e.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:e.pollCountdown(),e.resumeContent();break;case google.ima.AdEvent.Type.LOG:o.adError&&e.player.debug.warn("Non-fatal ad error: ".concat(o.adError.getMessage()))}})),N(this,"onAdError",(function(t){e.cancel(),e.player.debug.warn("Ads error",t)})),N(this,"listeners",(function(){var t,r=e.player.elements.container;e.player.on("canplay",(function(){e.addCuePoints()})),e.player.on("ended",(function(){e.loader.contentComplete()})),e.player.on("timeupdate",(function(){t=e.player.currentTime})),e.player.on("seeked",(function(){var r=e.player.currentTime;Ct(e.cuePoints)||e.cuePoints.forEach((function(i,o){t<i&&i<r&&(e.manager.discardAdBreak(),e.cuePoints.splice(o,1))}))})),window.addEventListener("resize",(function(){e.manager&&e.manager.resize(r.offsetWidth,r.offsetHeight,google.ima.ViewMode.NORMAL)}))})),N(this,"play",(function(){var t=e.player.elements.container;e.managerPromise||e.resumeContent(),e.managerPromise.then((function(){e.manager.setVolume(e.player.volume),e.elements.displayContainer.initialize();try{e.initialized||(e.manager.init(t.offsetWidth,t.offsetHeight,google.ima.ViewMode.NORMAL),e.manager.start()),e.initialized=!0}catch(t){e.onAdError(t)}})).catch((function(){}))})),N(this,"resumeContent",(function(){e.elements.container.style.zIndex="",e.playing=!1,nr(e.player.media.play())})),N(this,"pauseContent",(function(){e.elements.container.style.zIndex=3,e.playing=!0,e.player.media.pause()})),N(this,"cancel",(function(){e.initialized&&e.resumeContent(),e.trigger("error"),e.loadAds()})),N(this,"loadAds",(function(){e.managerPromise.then((function(){e.manager&&e.manager.destroy(),e.managerPromise=new Promise((function(t){e.on("loaded",t),e.player.debug.log(e.manager)})),e.initialized=!1,e.requestAds()})).catch((function(){}))})),N(this,"trigger",(function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];var n=e.events[t];wt(n)&&n.forEach((function(t){mt(t)&&t.apply(e,i)}))})),N(this,"on",(function(t,r){return wt(e.events[t])||(e.events[t]=[]),e.events[t].push(r),e})),N(this,"startSafetyTimer",(function(t,r){e.player.debug.log("Safety timer invoked from: ".concat(r)),e.safetyTimer=setTimeout((function(){e.cancel(),e.clearSafetyTimer("startSafetyTimer()")}),t)})),N(this,"clearSafetyTimer",(function(t){yt(e.safetyTimer)||(e.player.debug.log("Safety timer cleared from: ".concat(t)),clearTimeout(e.safetyTimer),e.safetyTimer=null)})),this.player=r,this.config=r.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((function(t,r){e.on("loaded",t),e.on("error",r)})),this.load()}return l(t,[{key:"enabled",get:function(){var t=this.config;return this.player.isHTML5&&this.player.isVideo&&t.enabled&&(!Ct(t.publisherId)||Tt(t.tagUrl))}},{key:"tagUrl",get:function(){var t=this.config;return Tt(t.tagUrl)?t.tagUrl:"https://go.aniview.com/api/adserver6/vast/?".concat(Mr({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:t.publisherId}))}}]),t}();function Kr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:255;return Math.min(Math.max(t,r),e)}var Xr,Zr,te,re,ee,ie,oe=function(t){var r=[];return t.split(/\r\n\r\n|\n\n|\r\r/).forEach((function(t){var e={};t.split(/\r\n|\n|\r/).forEach((function(t){if(_t(e.startTime)){if(!Ct(t.trim())&&Ct(e.text)){var r,i,o,a=t.trim().split("#xywh=");r=n(a,1),e.text=r[0],a[1]&&(i=a[1].split(","),o=n(i,4),e.x=o[0],e.y=o[1],e.w=o[2],e.h=o[3])}}else{var s=t.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);s&&(e.startTime=60*Number(s[1]||0)*60+60*Number(s[2])+Number(s[3])+Number("0.".concat(s[4])),e.endTime=60*Number(s[6]||0)*60+60*Number(s[7])+Number(s[8])+Number("0.".concat(s[9])))}})),e.text&&r.push(e)})),r},ne=function(t,r){var e={};return t>r.width/r.height?(e.width=r.width,e.height=1/t*r.width):(e.height=r.height,e.width=t*r.height),e},ae=function(){function t(r){var e=this;u(this,t),N(this,"load",(function(){e.player.elements.display.seekTooltip&&(e.player.elements.display.seekTooltip.hidden=e.enabled),e.enabled&&e.getThumbnails().then((function(){e.enabled&&(e.render(),e.determineContainerAutoSizing(),e.loaded=!0)}))})),N(this,"getThumbnails",(function(){return new Promise((function(t){var r=e.player.config.previewThumbnails.src;if(Ct(r))throw new Error("Missing previewThumbnails.src config attribute");var i=function(){e.thumbnails.sort((function(t,r){return t.height-r.height})),e.player.debug.log("Preview thumbnails",e.thumbnails),t()};if(mt(r))r((function(t){e.thumbnails=t,i()}));else{var o=(gt(r)?[r]:r).map((function(t){return e.getThumbnail(t)}));Promise.all(o).then(i)}}))})),N(this,"getThumbnail",(function(t){return new Promise((function(r){jr(t).then((function(i){var o={frames:oe(i),height:null,urlPrefix:""};o.frames[0].text.startsWith("/")||o.frames[0].text.startsWith("http://")||o.frames[0].text.startsWith("https://")||(o.urlPrefix=t.substring(0,t.lastIndexOf("/")+1));var n=new Image;n.onload=function(){o.height=n.naturalHeight,o.width=n.naturalWidth,e.thumbnails.push(o),r()},n.src=o.urlPrefix+o.frames[0].text}))}))})),N(this,"startMove",(function(t){if(e.loaded&&zt(t)&&["touchmove","mousemove"].includes(t.type)&&e.player.media.duration){if("touchmove"===t.type)e.seekTime=e.player.media.duration*(e.player.elements.inputs.seek.value/100);else{var r,i,o=e.player.elements.progress.getBoundingClientRect();e.seekTime=e.player.media.duration*(100/o.width*(t.pageX-o.left)/100),e.seekTime<0&&(e.seekTime=0),e.seekTime>e.player.media.duration-1&&(e.seekTime=e.player.media.duration-1),e.mousePosX=t.pageX,e.elements.thumb.time.innerText=Pr(e.seekTime);var n=null===(r=e.player.config.markers)||void 0===r||null===(i=r.points)||void 0===i?void 0:i.find((function(t){return t.time===Math.round(e.seekTime)}));n&&e.elements.thumb.time.insertAdjacentHTML("afterbegin","".concat(n.label,"<br>"))}e.showImageAtCurrentTime()}})),N(this,"endMove",(function(){e.toggleThumbContainer(!1,!0)})),N(this,"startScrubbing",(function(t){(yt(t.button)||!1===t.button||0===t.button)&&(e.mouseDown=!0,e.player.media.duration&&(e.toggleScrubbingContainer(!0),e.toggleThumbContainer(!1,!0),e.showImageAtCurrentTime()))})),N(this,"endScrubbing",(function(){e.mouseDown=!1,Math.ceil(e.lastTime)===Math.ceil(e.player.media.currentTime)?e.toggleScrubbingContainer(!1):rr.call(e.player,e.player.media,"timeupdate",(function(){e.mouseDown||e.toggleScrubbingContainer(!1)}))})),N(this,"listeners",(function(){e.player.on("play",(function(){e.toggleThumbContainer(!1,!0)})),e.player.on("seeked",(function(){e.toggleThumbContainer(!1)})),e.player.on("timeupdate",(function(){e.lastTime=e.player.media.currentTime}))})),N(this,"render",(function(){e.elements.thumb.container=Ft("div",{class:e.player.config.classNames.previewThumbnails.thumbContainer}),e.elements.thumb.imageContainer=Ft("div",{class:e.player.config.classNames.previewThumbnails.imageContainer}),e.elements.thumb.container.appendChild(e.elements.thumb.imageContainer);var t=Ft("div",{class:e.player.config.classNames.previewThumbnails.timeContainer});e.elements.thumb.time=Ft("span",{},"00:00"),t.appendChild(e.elements.thumb.time),e.elements.thumb.imageContainer.appendChild(t),xt(e.player.elements.progress)&&e.player.elements.progress.appendChild(e.elements.thumb.container),e.elements.scrubbing.container=Ft("div",{class:e.player.config.classNames.previewThumbnails.scrubbingContainer}),e.player.elements.wrapper.appendChild(e.elements.scrubbing.container)})),N(this,"destroy",(function(){e.elements.thumb.container&&e.elements.thumb.container.remove(),e.elements.scrubbing.container&&e.elements.scrubbing.container.remove()})),N(this,"showImageAtCurrentTime",(function(){e.mouseDown?e.setScrubbingContainerSize():e.setThumbContainerSizeAndPos();var t=e.thumbnails[0].frames.findIndex((function(t){return e.seekTime>=t.startTime&&e.seekTime<=t.endTime})),r=t>=0,i=0;e.mouseDown||e.toggleThumbContainer(r),r&&(e.thumbnails.forEach((function(r,o){e.loadedImages.includes(r.frames[t].text)&&(i=o)})),t!==e.showingThumb&&(e.showingThumb=t,e.loadImage(i)))})),N(this,"loadImage",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=e.showingThumb,i=e.thumbnails[t],o=i.urlPrefix,n=i.frames[r],a=i.frames[r].text,s=o+a;if(e.currentImageElement&&e.currentImageElement.dataset.filename===a)e.showImage(e.currentImageElement,n,t,r,a,!1),e.currentImageElement.dataset.index=r,e.removeOldImages(e.currentImageElement);else{e.loadingImage&&e.usingSprites&&(e.loadingImage.onload=null);var l=new Image;l.src=s,l.dataset.index=r,l.dataset.filename=a,e.showingThumbFilename=a,e.player.debug.log("Loading image: ".concat(s)),l.onload=function(){return e.showImage(l,n,t,r,a,!0)},e.loadingImage=l,e.removeOldImages(l)}})),N(this,"showImage",(function(t,r,i,o,n){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];e.player.debug.log("Showing thumb: ".concat(n,". num: ").concat(o,". qual: ").concat(i,". newimg: ").concat(a)),e.setImageSizeAndOffset(t,r),a&&(e.currentImageContainer.appendChild(t),e.currentImageElement=t,e.loadedImages.includes(n)||e.loadedImages.push(n)),e.preloadNearby(o,!0).then(e.preloadNearby(o,!1)).then(e.getHigherQuality(i,t,r,n))})),N(this,"removeOldImages",(function(t){Array.from(e.currentImageContainer.children).forEach((function(r){if("img"===r.tagName.toLowerCase()){var i=e.usingSprites?500:1e3;if(r.dataset.index!==t.dataset.index&&!r.dataset.deleting){r.dataset.deleting=!0;var o=e.currentImageContainer;setTimeout((function(){o.removeChild(r),e.player.debug.log("Removing thumb: ".concat(r.dataset.filename))}),i)}}}))})),N(this,"preloadNearby",(function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(i){setTimeout((function(){var o=e.thumbnails[0].frames[t].text;if(e.showingThumbFilename===o){var n;n=r?e.thumbnails[0].frames.slice(t):e.thumbnails[0].frames.slice(0,t).reverse();var a=!1;n.forEach((function(t){var r=t.text;if(r!==o&&!e.loadedImages.includes(r)){a=!0,e.player.debug.log("Preloading thumb filename: ".concat(r));var n=e.thumbnails[0].urlPrefix+r,s=new Image;s.src=n,s.onload=function(){e.player.debug.log("Preloaded thumb filename: ".concat(r)),e.loadedImages.includes(r)||e.loadedImages.push(r),i()}}})),a||i()}}),300)}))})),N(this,"getHigherQuality",(function(t,r,i,o){if(t<e.thumbnails.length-1){var n=r.naturalHeight;e.usingSprites&&(n=i.h),n<e.thumbContainerHeight&&setTimeout((function(){e.showingThumbFilename===o&&(e.player.debug.log("Showing higher quality thumb for: ".concat(o)),e.loadImage(t+1))}),300)}})),N(this,"toggleThumbContainer",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e.player.config.classNames.previewThumbnails.thumbContainerShown;e.elements.thumb.container.classList.toggle(i,t),!t&&r&&(e.showingThumb=null,e.showingThumbFilename=null)})),N(this,"toggleScrubbingContainer",(function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=e.player.config.classNames.previewThumbnails.scrubbingContainerShown;e.elements.scrubbing.container.classList.toggle(r,t),t||(e.showingThumb=null,e.showingThumbFilename=null)})),N(this,"determineContainerAutoSizing",(function(){(e.elements.thumb.imageContainer.clientHeight>20||e.elements.thumb.imageContainer.clientWidth>20)&&(e.sizeSpecifiedInCSS=!0)})),N(this,"setThumbContainerSizeAndPos",(function(){var t=e.elements.thumb.imageContainer;if(e.sizeSpecifiedInCSS){if(t.clientHeight>20&&t.clientWidth<20){var r=Math.floor(t.clientHeight*e.thumbAspectRatio);t.style.width="".concat(r,"px")}else if(t.clientHeight<20&&t.clientWidth>20){var i=Math.floor(t.clientWidth/e.thumbAspectRatio);t.style.height="".concat(i,"px")}}else{var o=Math.floor(e.thumbContainerHeight*e.thumbAspectRatio);t.style.height="".concat(e.thumbContainerHeight,"px"),t.style.width="".concat(o,"px")}e.setThumbContainerPos()})),N(this,"setThumbContainerPos",(function(){var t=e.player.elements.progress.getBoundingClientRect(),r=e.player.elements.container.getBoundingClientRect(),i=e.elements.thumb.container,o=e.mousePosX-t.left-i.clientWidth/2,n=Kr(o,r.left-t.left+10,r.right-t.left-i.clientWidth-10);i.style.left="".concat(n,"px"),i.style.setProperty("--preview-arrow-offset",o-n+"px")})),N(this,"setScrubbingContainerSize",(function(){var t=ne(e.thumbAspectRatio,{width:e.player.media.clientWidth,height:e.player.media.clientHeight}),r=t.height;e.elements.scrubbing.container.style.width="".concat(t.width,"px"),e.elements.scrubbing.container.style.height="".concat(r,"px")})),N(this,"setImageSizeAndOffset",(function(t,r){if(e.usingSprites){var i=e.thumbContainerHeight/r.h;t.style.height=t.naturalHeight*i+"px",t.style.width=t.naturalWidth*i+"px",t.style.left="-".concat(r.x*i,"px"),t.style.top="-".concat(r.y*i,"px")}})),this.player=r,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}return l(t,[{key:"enabled",get:function(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}},{key:"currentImageContainer",get:function(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}},{key:"usingSprites",get:function(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}},{key:"thumbAspectRatio",get:function(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}},{key:"thumbContainerHeight",get:function(){return this.mouseDown?ne(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight}).height:this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}},{key:"currentImageElement",get:function(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement},set:function(t){this.mouseDown?this.currentScrubbingImageElement=t:this.currentThumbnailImageElement=t}}]),t}(),se={insertElements:function(t,r){var e=this;gt(r)?Rt(t,this.media,{src:r}):wt(r)&&r.forEach((function(r){Rt(t,e.media,r)}))},change:function(t){var r=this;Mt(t,"sources.length")?(yr.cancelRequests.call(this),this.destroy.call(this,(function(){r.options.quality=[],Nt(r.media),r.media=null,xt(r.elements.container)&&r.elements.container.removeAttribute("class");var e=t.sources,i=t.type,o=n(e,1)[0],a=o.provider,s=void 0===a?Lr.html5:a,l="html5"===s?i:"div",p="html5"===s?{}:{src:o.src};Object.assign(r,{provider:s,type:i,supported:Gt.check(i,s,r.config.playsinline),media:Ft(l,p)}),r.elements.container.appendChild(r.media),bt(t.autoplay)&&(r.config.autoplay=t.autoplay),r.isHTML5&&(r.config.crossorigin&&r.media.setAttribute("crossorigin",""),r.config.autoplay&&r.media.setAttribute("autoplay",""),Ct(t.poster)||(r.poster=t.poster),r.config.loop.active&&r.media.setAttribute("loop",""),r.config.muted&&r.media.setAttribute("muted",""),r.config.playsinline&&r.media.setAttribute("playsinline","")),Br.addStyleHook.call(r),r.isHTML5&&se.insertElements.call(r,"source",e),r.config.title=t.title,Jr.setup.call(r),r.isHTML5&&Object.keys(t).includes("tracks")&&se.insertElements.call(r,"track",t.tracks),(r.isHTML5||r.isEmbed&&!r.supported.ui)&&Br.build.call(r),r.isHTML5&&r.media.load(),Ct(t.previewThumbnails)||(Object.assign(r.config.previewThumbnails,t.previewThumbnails),r.previewThumbnails&&r.previewThumbnails.loaded&&(r.previewThumbnails.destroy(),r.previewThumbnails=null),r.config.previewThumbnails.enabled&&(r.previewThumbnails=new ae(r))),r.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}},le=function(){function t(r,e){var i=this;if(u(this,t),N(this,"play",(function(){return mt(i.media.play)?(i.ads&&i.ads.enabled&&i.ads.managerPromise.then((function(){return i.ads.play()})).catch((function(){return nr(i.media.play())})),i.media.play()):null})),N(this,"pause",(function(){return i.playing&&mt(i.media.pause)?i.media.pause():null})),N(this,"togglePlay",(function(t){return(bt(t)?t:!i.playing)?i.play():i.pause()})),N(this,"stop",(function(){i.isHTML5?(i.pause(),i.restart()):mt(i.media.stop)&&i.media.stop()})),N(this,"restart",(function(){i.currentTime=0})),N(this,"rewind",(function(t){i.currentTime-=_t(t)?t:i.config.seekTime})),N(this,"forward",(function(t){i.currentTime+=_t(t)?t:i.config.seekTime})),N(this,"increaseVolume",(function(t){i.volume=(i.media.muted?0:i.volume)+(_t(t)?t:0)})),N(this,"decreaseVolume",(function(t){i.increaseVolume(-t)})),N(this,"airplay",(function(){Gt.airplay&&i.media.webkitShowPlaybackTargetPicker()})),N(this,"toggleControls",(function(t){if(i.supported.ui&&!i.isAudio){var r=Ht(i.elements.container,i.config.classNames.hideControls),e=Vt(i.elements.container,i.config.classNames.hideControls,void 0===t?void 0:!t);return e&&wt(i.config.controls)&&i.config.controls.includes("settings")&&!Ct(i.config.settings)&&Or.toggleMenu.call(i,!1),e!==r&&er.call(i,i.media,e?"controlshidden":"controlsshown"),!e}return!1})),N(this,"on",(function(t,r){Zt.call(i,i.elements.container,t,r)})),N(this,"once",(function(t,r){rr.call(i,i.elements.container,t,r)})),N(this,"off",(function(t,r){tr(i.elements.container,t,r)})),N(this,"destroy",(function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(i.ready){var e=function(){document.body.style.overflow="",i.embed=null,r?(Object.keys(i.elements).length&&(Nt(i.elements.buttons.play),Nt(i.elements.captions),Nt(i.elements.controls),Nt(i.elements.wrapper),i.elements.buttons.play=null,i.elements.captions=null,i.elements.controls=null,i.elements.wrapper=null),mt(t)&&t()):(ir.call(i),yr.cancelRequests.call(i),Bt(i.elements.original,i.elements.container),er.call(i,i.elements.original,"destroyed",!0),mt(t)&&t.call(i.elements.original),i.ready=!1,setTimeout((function(){i.elements=null,i.media=null}),200))};i.stop(),clearTimeout(i.timers.loading),clearTimeout(i.timers.controls),clearTimeout(i.timers.resized),i.isHTML5?(Br.toggleNativeControls.call(i,!0),e()):i.isYouTube?(clearInterval(i.timers.buffering),clearInterval(i.timers.playing),null!==i.embed&&mt(i.embed.destroy)&&i.embed.destroy(),e()):i.isVimeo&&(null!==i.embed&&i.embed.unload().then(e),setTimeout(e,200))}})),N(this,"supports",(function(t){return Gt.mime.call(i,t)})),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=Gt.touch,this.media=r,gt(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||kt(this.media)||wt(this.media))&&(this.media=this.media[0]),this.config=It({},Er,t.defaults,e||{},function(){try{return JSON.parse(i.media.getAttribute("data-plyr-config"))}catch(t){return{}}}()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Rr(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",Gt),!yt(this.media)&&xt(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(Gt.check().api){var o=this.media.cloneNode(!0);o.autoplay=!1,this.elements.original=o;var n=this.media.tagName.toLowerCase(),a=null,s=null;switch(n){case"div":if(a=this.media.querySelector("iframe"),xt(a)){if(s=Ar(a.getAttribute("src")),this.provider=function(t){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(t)?Lr.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(t)?Lr.vimeo:null}(s.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",s.search.length){var l=["1","true"];l.includes(s.searchParams.get("autoplay"))&&(this.config.autoplay=!0),l.includes(s.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=l.includes(s.searchParams.get("playsinline")),this.config.youtube.hl=s.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(Ct(this.provider)||!Object.values(Lr).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type="video";break;case"video":case"audio":this.type=n,this.provider=Lr.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=Gt.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new $r(this),this.storage=new zr(this),this.media.plyr=this,xt(this.elements.container)||(this.elements.container=Ft("div",{tabindex:0}),Et(this.media,this.elements.container)),Br.migrateStyles.call(this),Br.addStyleHook.call(this),Jr.setup.call(this),this.config.debug&&Zt.call(this,this.elements.container,this.config.events.join(" "),(function(t){i.debug.log("event: ".concat(t.type))})),this.fullscreen=new Nr(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Br.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new Gr(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(function(){return nr(i.play())})),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ae(this))):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return l(t,[{key:"isHTML5",get:function(){return this.provider===Lr.html5}},{key:"isEmbed",get:function(){return this.isYouTube||this.isVimeo}},{key:"isYouTube",get:function(){return this.provider===Lr.youtube}},{key:"isVimeo",get:function(){return this.provider===Lr.vimeo}},{key:"isVideo",get:function(){return"video"===this.type}},{key:"isAudio",get:function(){return"audio"===this.type}},{key:"playing",get:function(){return Boolean(this.ready&&!this.paused&&!this.ended)}},{key:"paused",get:function(){return Boolean(this.media.paused)}},{key:"stopped",get:function(){return Boolean(this.paused&&0===this.currentTime)}},{key:"ended",get:function(){return Boolean(this.media.ended)}},{key:"currentTime",get:function(){return Number(this.media.currentTime)},set:function(t){if(this.duration){var r=_t(t)&&t>0;this.media.currentTime=r?Math.min(t,this.duration):0,this.debug.log("Seeking to ".concat(this.currentTime," seconds"))}}},{key:"buffered",get:function(){var t=this.media.buffered;return _t(t)?t:t&&t.length&&this.duration>0?t.end(0)/this.duration:0}},{key:"seeking",get:function(){return Boolean(this.media.seeking)}},{key:"duration",get:function(){var t=parseFloat(this.config.duration),r=(this.media||{}).duration,e=_t(r)&&r!==1/0?r:0;return t||e}},{key:"volume",get:function(){return Number(this.media.volume)},set:function(t){var r=t;gt(r)&&(r=Number(r)),_t(r)||(r=this.storage.get("volume")),_t(r)||(r=this.config.volume),r>1&&(r=1),r<0&&(r=0),this.config.volume=r,this.media.volume=r,!Ct(t)&&this.muted&&r>0&&(this.muted=!1)}},{key:"muted",get:function(){return Boolean(this.media.muted)},set:function(t){var r=t;bt(r)||(r=this.storage.get("muted")),bt(r)||(r=this.config.muted),this.config.muted=r,this.media.muted=r}},{key:"hasAudio",get:function(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}},{key:"speed",get:function(){return Number(this.media.playbackRate)},set:function(t){var r=this,e=null;_t(t)&&(e=t),_t(e)||(e=this.storage.get("speed")),_t(e)||(e=this.config.speed.selected),e=Kr(e,this.minimumSpeed,this.maximumSpeed),this.config.speed.selected=e,setTimeout((function(){r.media&&(r.media.playbackRate=e)}),0)}},{key:"minimumSpeed",get:function(){return this.isYouTube?Math.min.apply(Math,d(this.options.speed)):this.isVimeo?.5:.0625}},{key:"maximumSpeed",get:function(){return this.isYouTube?Math.max.apply(Math,d(this.options.speed)):this.isVimeo?2:16}},{key:"quality",get:function(){return this.media.quality},set:function(t){var r=this.config.quality,e=this.options.quality;if(e.length){var i=[!Ct(t)&&Number(t),this.storage.get("quality"),r.selected,r.default].find(_t),o=!0;if(!e.includes(i)){var n=sr(e,i);this.debug.warn("Unsupported quality option: ".concat(i,", using ").concat(n," instead")),i=n,o=!1}r.selected=i,this.media.quality=i,o&&this.storage.set({quality:i})}}},{key:"loop",get:function(){return Boolean(this.media.loop)},set:function(t){var r=bt(t)?t:this.config.loop.active;this.config.loop.active=r,this.media.loop=r}},{key:"source",get:function(){return this.media.currentSrc},set:function(t){se.change.call(this,t)}},{key:"download",get:function(){var t=this.config.urls.download;return Tt(t)?t:this.source},set:function(t){Tt(t)&&(this.config.urls.download=t,Or.setDownloadUrl.call(this))}},{key:"poster",get:function(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null},set:function(t){this.isVideo?Br.setPoster.call(this,t,!1).catch((function(){})):this.debug.warn("Poster can only be set for video")}},{key:"ratio",get:function(){if(!this.isVideo)return null;var t=dr(cr.call(this));return wt(t)?t.join(":"):t},set:function(t){this.isVideo?gt(t)&&ur(t)?(this.config.ratio=dr(t),hr.call(this)):this.debug.error("Invalid aspect ratio specified (".concat(t,")")):this.debug.warn("Aspect ratio can only be set for video")}},{key:"autoplay",get:function(){return Boolean(this.config.autoplay)},set:function(t){this.config.autoplay=bt(t)?t:this.config.autoplay}},{key:"toggleCaptions",value:function(t){Ir.toggle.call(this,t,!1)}},{key:"currentTrack",get:function(){var t=this.captions;return t.toggled?t.currentTrack:-1},set:function(t){Ir.set.call(this,t,!1),Ir.setup.call(this)}},{key:"language",get:function(){return(Ir.getCurrentTrack.call(this)||{}).language},set:function(t){Ir.setLanguage.call(this,t,!1)}},{key:"pip",get:function(){return Gt.pip?Ct(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:"picture-in-picture"===this.media.webkitPresentationMode:null},set:function(t){if(Gt.pip){var r=bt(t)?t:!this.pip;mt(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(r?"picture-in-picture":"inline"),mt(this.media.requestPictureInPicture)&&(!this.pip&&r?this.media.requestPictureInPicture():this.pip&&!r&&document.exitPictureInPicture())}}},{key:"setPreviewThumbnails",value:function(t){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,t),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ae(this))}}],[{key:"supported",value:function(t,r,e){return Gt.check(t,r,e)}},{key:"loadSprite",value:function(t,r){return Sr(t,r)}},{key:"setup",value:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;return gt(r)?i=Array.from(document.querySelectorAll(r)):kt(r)?i=Array.from(r):wt(r)&&(i=r.filter(xt)),Ct(i)?null:i.map((function(r){return new t(r,e)}))}}]),t}();function pe(t){t.on("timeupdate",(function(){return function(t){var r,e;null!=t&&null!==(r=t.config)&&void 0!==r&&null!==(e=r.mutedPreview)&&void 0!==e&&e.enabled||function(t){var r;0!==t.currentTime&&null!=t&&null!==(r=t.config)&&void 0!==r&&r.save_player_position&&localStorage.setItem("player-progress-".concat(ue(t)),t.currentTime)}(t)}(t)})),t.on("ready",(function(){return de(t)})),t.on("loadeddata",(function(){return de(t)})),t.on("ended",(function(){return function(t){localStorage.removeItem("player-progress-".concat(ue(t)))}(t)}))}function ue(t){var r,e;return null==t||null===(r=t.config)||void 0===r||null===(e=r.blockAttributes)||void 0===e?void 0:e.id}function de(t){var r,e,i;if(null!=t&&null!==(r=t.config)&&void 0!==r&&r.save_player_position&&(null==t||null===(e=t.config)||void 0===e||null===(i=e.mutedPreview)||void 0===i||!i.enabled)){var o=function(t){return parseFloat(localStorage.getItem("player-progress-".concat(ue(t))))}(t);return t.hls&&o>=0&&t.hls.startLoad(o),t.duration&&(o=Math.min(o,t.duration)),!o||o<1?0:(t.currentTime=o,null!=t&&t.isVimeo&&setTimeout((function(){t.embed.setCurrentTime(o||0)}),0),o)}}le.defaults=JSON.parse(JSON.stringify(Er));var ce=(null===(Xr=window)||void 0===Xr||null===(Zr=Xr.prestoPlayer)||void 0===Zr||null===(te=Zr.i18n)||void 0===te?void 0:te.hide_chapters)||"Hide Chapters",he=(null===(re=window)||void 0===re||null===(ee=re.prestoPlayer)||void 0===ee||null===(ie=ee.i18n)||void 0===ie?void 0:ie.show_chapters)||"Show Chapters";const ve='<button class="plyr__controls__item plyr__control" type="button" data-plyr="chapters">\n<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list">\n <line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line>\n <line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line>\n <line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line>\n</svg>\n<span class="label--pressed plyr__tooltip" role="tooltip">'.concat(ce,'</span>\n<span class="label--not-pressed plyr__tooltip" role="tooltip">').concat(he,"</span>\n</button>\n");var ye,fe,_e;const ge='\n<div class="presto-player-toc__wrapper">\n <div class="presto-player-toc__cover" data-player-toc-cover></div>\n <div class="presto-player-toc">\n <div class="presto-player-toc__title">'.concat((null===(ye=window)||void 0===ye||null===(fe=ye.prestoPlayer)||void 0===fe||null===(_e=fe.i18n)||void 0===_e?void 0:_e.chapters)||"Chapters",'</div>\n <div class="presto-player-toc__list" data-player-toc></div>\n </div>\n</div>');function be(t){var r,e,i,o,n,a,s,l,u,c,h,v,y,f=0,_={},g=null,b=0;if("undefined"!=typeof jQuery)if(i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!t.length)return t;var r={};return t.forEach((function(t){var e,i=t.time.split(":");i.length>1&&(e=60*parseInt(i[0]));var o=parseInt(i[1])+parseInt(e);r[o]=t})),r}((null===(r=o=t.detail.plyr)||void 0===r||null===(e=r.config)||void 0===e?void 0:e.chapters)||[]),"html5"!==o.provider||o.duration){if(i&&Object.keys(i).length){n=jQuery(o.elements.container).closest(".presto-player__wrapper").find(".plyr");var m=(y=jQuery(o.elements.controls)).find(".plyr__time");m=m.length?m:y.find(".plyr__progress__container"),(u=n.find('[data-plyr="chapters"]')).length||(u=jQuery(ve).insertAfter(m)),(s=n.find(".presto-player-toc__wrapper")).length||(s=jQuery(ge).appendTo(n)),c=s.find("[data-player-toc-cover]"),l=s.find("[data-player-toc]"),a=n.find(".plyr__progress__container");var w,k=jQuery('<div class="presto-player__chapters"></div>').appendTo(a);h=jQuery('<div class="presto-player__chapter-markers"></div>').appendTo(k),w=0,l.find(".presto-player-toc__chapter").length||(Object.keys(i).forEach((function(t){w++;var r=jQuery(function(t){var r=t.name,e=void 0===r?"Untitled":r,i=t.order,o=void 0===i?1:i,n=t.highlight;return'<div class="presto-player-toc__chapter '.concat(void 0!==n&&n?"is-highlighted":"",'" data-chapter-item>\n \n <span class="presto-player-toc__order">\n ').concat(o,'\n </span>\n <span class="presto-player-toc__name">\n ').concat(e,"\n </div>\n</div>")}({name:i[t].title,order:w})).appendTo(l);r.data("presto-player-timestamp",t),_[t]=r,r.on("click",(function(){o.currentTime=parseFloat(t),o.playing||(o.play(),o.once("playing",(function(){setTimeout((function(){o.pause()}),50)}))),j(!1)}))})),v=s.find("[data-chapter-item]")),z(),u.off("click"),u.on("click",j),x(),o.off("timeupdate"),o.on("timeupdate",x),g=window.setInterval((function(){b++,o.duration&&(z(),window.clearInterval(g)),b>50&&window.clearInterval(g)}),100),c.off("click"),c.on("click",(function(){return j(!1)})),l.off("mouseleave"),l.on("mouseleave",(function t(){if(o.playing){var r=setTimeout((function(){j(!1),l.off("mouseleave",t)}),2e3);l.on("mouseenter",(function(){clearTimeout(r)}))}}))}}else o.on("loadedmetadata",be);function x(){f=o.currentTime;var t=Object.keys(i).filter((function(t){return t<=f})).map((function(t){return parseInt(t,10)})),r=Math.max.apply(Math,d(t));v&&v.removeClass("is-highlighted"),jQuery(_[r||0]).addClass("is-highlighted")}function z(){o.duration&&(Object.keys(i).forEach((function(t){if(parseInt(t)&&!h.find("[data-timestamp=".concat(t,"]")).length){var r,e,n,a,s=i[t],l=parseInt(t)/o.duration*100,p=jQuery((r={position:l,name:"".concat(s.title)},e=r.position,n=r.name,a=void 0===n?"":n,'<div class="presto-player-progress__marker plyr__controls__item plyr__control" style="left: '.concat(void 0===e?0:e,'%" data-timeline-marker>\n <span class="label--not-pressed plyr__tooltip" role="tooltip">').concat(a,"</span>\n </div>"))).prependTo(h);p.attr("data-timestamp",t),p.data("timestamp",t),p.on("click",(function(){o.currentTime=parseInt(t),o.play()}))}})),s.find("[data-timeline-marker]"))}function j(t){void 0!==p(t)?s.toggleClass("is-showing",t):s.toggleClass("is-showing")}}var me;function we(t){"undefined"!=typeof jQuery&&(me=t,jQuery(me.elements.container).closest(".presto-player__wrapper"),me.on("ready",be),me.on("controlshidden",ke),me.on("controlsshown",xe))}function ke(t){var r,e,i;"undefined"!=typeof jQuery&&jQuery(null==t||null===(r=t.detail)||void 0===r||null===(e=r.plyr)||void 0===e||null===(i=e.elements)||void 0===i?void 0:i.container).closest(".presto-player__wrapper").addClass("presto-player--hide-controls")}function xe(t){var r,e,i;"undefined"!=typeof jQuery&&jQuery(null==t||null===(r=t.detail)||void 0===r||null===(e=r.plyr)||void 0===e||null===(i=e.elements)||void 0===i?void 0:i.container).closest(".presto-player__wrapper").removeClass("presto-player--hide-controls")}function ze(t){var r,e;return a(a(a({video_current_time:parseInt((null==t?void 0:t.currentTime)||0),video_provider:(null==t?void 0:t.provider)||"html5"},null!=t&&t.duration?{video_duration:parseInt(null==t?void 0:t.duration)}:{}),null!=t&&t.source?{video_url:null==t?void 0:t.source}:{}),null!=t&&null!==(r=t.config)&&void 0!==r&&r.title?{video_title:null==t||null===(e=t.config)||void 0===e?void 0:e.title}:{})}function je(t){var r,e;null!=t&&null!==(r=t.config)&&void 0!==r&&r.hasPlayed||(t.config.hasPlayed=!0,null===(e=window)||void 0===e||e.gtag("event","Play",ze(t)))}function Se(t){var r;null===(r=window)||void 0===r||r.gtag("event","Pause",ze(t))}function Te(t){var r,e;null!=t&&null!==(r=t.config)&&void 0!==r&&r.hasLoaded||(t.config.hasLoaded=!0,null===(e=window)||void 0===e||e.gtag("event","Player Load",ze(t)))}var Ce,Pe={25:!1,50:!1,75:!1,100:!1};function Oe(t){if(t.currentTime){var r=parseFloat(t.currentTime)/parseFloat(t.duration)*100;Object.keys(Pe).forEach((function(e){var i;!Pe[e]&&r>=parseInt(e)&&(Pe[e]=!0,null===(i=window)||void 0===i||i.gtag("event","".concat(e," Percent Played"),ze(t)))}))}}var Ae="presto-player.analytics",Me="",Ie=0;function Ee(t){var r,e;(Ce=t).config.analytics&&null!==(r=window)&&void 0!==r&&null!==(e=r.wp)&&void 0!==e&&e.hooks&&(wp.hooks.hasAction("presto.nonceRefreshed",Ae)||wp.hooks.addAction("presto.nonceRefreshed",Ae,(function(t){Me=t})),wp.hooks.hasAction("presto.playerPlay",Ae)||wp.hooks.addAction("presto.playerPlay",Ae,Le),wp.hooks.hasAction("presto.playerEnded",Ae)||wp.hooks.addAction("presto.playerEnded",Ae,Le),wp.hooks.hasAction("presto.playerHidden",Ae)||wp.hooks.addAction("presto.playerHidden",Ae,Le),wp.hooks.hasAction("presto.playerPause",Ae)||wp.hooks.addAction("presto.playerPause",Ae,Le),wp.hooks.hasAction("presto.playerSeeked",Ae)||wp.hooks.addAction("presto.playerSeeked",Ae,Le))}function Le(t){isNaN(null==t?void 0:t.currentTime)||Fe(function(t){var r,e;return t.currentTime>Ie&&(Ie=t.currentTime),t.currentTime>=t.duration&&(Ie=t.duration),a(a(a({video_current_time:parseInt(Ie),video_provider:(null==t?void 0:t.provider)||"html5"},null!=t&&t.duration?{video_duration:parseInt(null==t?void 0:t.duration)}:{}),null!=t&&t.source?{video_url:null==t?void 0:t.source}:{}),null!=t&&null!==(r=t.config)&&void 0!==r&&r.title?{video_title:null==t||null===(e=t.config)||void 0===e?void 0:e.title}:{})}(t))}function Fe(t){var r,e,i,o,n,a,s,l;if(Me){var p,u,d=new FormData;d.append("action","presto_player_progress"),d.append("duration",null==t?void 0:t.video_current_time),d.append("video_id",null===(r=Ce)||void 0===r||null===(e=r.config)||void 0===e?void 0:e.id),d.append("nonce",Me),null!==(i=window)&&void 0!==i&&null!==(o=i.prestoPlayer)&&void 0!==o&&o.debug_navigator?"undefined"!=typeof jQuery&&jQuery.ajax({type:"POST",url:null===(n=window)||void 0===n||null===(a=n.prestoPlayer)||void 0===a?void 0:a.ajaxurl,dataType:"json",cache:!1,data:{action:"presto_player_progress",duration:null==t?void 0:t.video_current_time,video_id:null===(s=Ce)||void 0===s||null===(l=s.config)||void 0===l?void 0:l.id,nonce:Me}}):navigator.sendBeacon(null===(p=window)||void 0===p||null===(u=p.prestoPlayer)||void 0===u?void 0:u.ajaxurl,d)}}function Re(t){var r,e;null!==(r=window)&&void 0!==r&&null!==(e=r.prestoPlayer)&&void 0!==e&&e.isPremium&&(function(){var t;null!==(t=window)&&void 0!==t&&t.gtag&&(wp.hooks.addAction("presto.playerPlay","presto-player",je),wp.hooks.addAction("presto.playerPause","presto-player",Se),wp.hooks.addAction("presto.playerReady","presto-player",Te),wp.hooks.addAction("presto.playerTimeUpdate","presto-player",Oe))}(),Ee(t))}const Ne=function(t){t.on("ready",(function(){var r,e,i,o;null==t||null===(r=t.config)||void 0===r||!r.logo||null!=t&&null!==(e=t.config)&&void 0!==e&&e.logo_added||"undefined"!=typeof jQuery&&(t.isAudio||(jQuery('<img src="'.concat(null==t||null===(i=t.config)||void 0===i?void 0:i.logo,'" class="presto-player__logo is-bottom-right" part="logo">')).insertBefore(null==t||null===(o=t.elements)||void 0===o?void 0:o.controls),t.config.logo_added=!0))}))};function De(t){var r;null!=t&&null!==(r=t.config)&&void 0!==r&&r.poster&&(t.poster=t.config.poster)}const Be=function(t){var r,e;null!==(r=window)&&void 0!==r&&null!==(e=r.wp)&&void 0!==e&&e.hooks&&(t.on("ready",(function(){$e("Ready",t)})),t.on("play",(function(){$e("Play",t)})),t.on("playing",(function(){$e("Playing",t)})),t.on("pause",(function(){$e("Pause",t)})),t.on("ended",(function(){$e("Ended",t)})),t.on("seeked",(function(){$e("Seeked",t)})),t.on("timeupdate",(function(){$e("TimeUpdate",t)})),t.on("enterfullscreen",(function(){$e("EnterFullScreen",t)})),t.on("exitfullscreen",(function(){$e("ExitFullScreen",t)})),document.addEventListener("visibilitychange",(function(){$e("hidden"===document.visibilityState?"Hidden":"Visible",t)})),t.on("statechange",(function(r){var e;switch(null==r||null===(e=r.detail)||void 0===e?void 0:e.code){case 0:$e("Ended",t);break;case 1:$e("Play",t);break;case 2:$e("Pause",t)}})))};function $e(t,r){window.wp.hooks.doAction("presto.player".concat(t),r)}let qe,Ve=Date.now();const He=t=>{var r,e;if(!t.automations)return;(null===(e=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===e?void 0:e.hasAction("presto.nonceRefreshed","presto-player.progress"))||window.wp.hooks.addAction("presto.nonceRefreshed","presto-player.progress",(t=>{qe=t})),null===window||void 0===window||window.wp.hooks.addAction("presto.playerTimeUpdate","presto-player",o),null===window||void 0===window||window.wp.hooks.addAction("presto.playerEnded","presto-player",(t=>o(t,100)));let i={0:!1,10:!1,20:!1,30:!1,40:!1,50:!1,60:!1,70:!1,80:!1,90:!1,100:!1};function o(t,r=null){var e;qe&&(null===(e=null==t?void 0:t.config)||void 0===e?void 0:e.ajaxProgress)&&(r||(r=parseFloat(t.currentTime)/parseFloat(t.duration)*100),t.watched=t.watched||{},Object.keys(i).forEach((e=>{var i,o,n,a,s,l,p,u,d;const c=parseInt(e);if(!t.watched[c]&&r>=c){t.watched[c]=!0;let r=new FormData;if(r.append("action","presto_player_progress_percent"),r.append("id",null===(i=null==t?void 0:t.config)||void 0===i?void 0:i.id),r.append("percent",c.toString()),r.append("visit_time",Ve.toString()),r.append("nonce",qe),(null===(o=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===o?void 0:o.debug)&&console.log(`${c} percent watched.`),null===(n=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===n?void 0:n.debug_navigator)window.jQuery.ajax({type:"POST",url:null===(u=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===u?void 0:u.ajaxurl,dataType:"json",cache:!1,data:{action:"presto_player_progress_percent",id:null===(d=null==t?void 0:t.config)||void 0===d?void 0:d.id,visit_time:Ve,percent:c,nonce:qe}});else{let e=navigator.sendBeacon(null===(a=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===a?void 0:a.ajaxurl,r);(null===(s=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===s?void 0:s.debug)&&(e?console.log("Successfully queued progress:",{id:null===(l=null==t?void 0:t.config)||void 0===l?void 0:l.id,percent:c,visit_time:Ve,nonce:qe}):console.log("Failed to queue progress",{id:null===(p=null==t?void 0:t.config)||void 0===p?void 0:p.id,percent:c,visit_time:Ve,nonce:qe}))}}})))}};let Ue=!1,Qe=!1;function Ye(t){return t.status>=200&&t.status<300?Promise.resolve(t):Promise.reject(new Error(t.statusText))}const We=t=>{var r,e;(t.config.analytics||t.config.automations)&&(null===(e=null===(r=null===window||void 0===window?void 0:window.wp)||void 0===r?void 0:r.hooks)||void 0===e||e.addAction("presto.playerPlaying","presto-player",(()=>{null===window||void 0===window||window.wp.hooks.doAction("presto.playerGetNonce")})),null===window||void 0===window||window.wp.hooks.addAction("presto.playerGetNonce","presto-player",(()=>{var t;Ue||Qe||(Qe=!0,fetch(`${null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.ajaxurl}?action=presto_refresh_progress_nonce`).then(Ye).then((t=>t.json())).then((({data:t})=>{null===window||void 0===window||window.wp.hooks.doAction("presto.nonceRefreshed",t),Ue=!0})).catch((function(t){console.log("Request failed",t)})).finally((()=>{Qe=!1})))})))},Je=function(t){var r=window.navigator.userAgent;if(r.match(/iPad/i)||r.match(/iPhone/i)){var e=function(t,r){for(var e,i,o,n=null==t||null===(e=t.elements)||void 0===e||null===(i=e.container)||void 0===i||null===(o=i.getRootNode())||void 0===o?void 0:o.host;(null!=n?n.nodeType:void 0)===Node.ELEMENT_NODE&&"BODY"!==n.tagName&&"HTML"!==n.tagName;)r?n.classList.add("presto-player-fullscreen-open"):n.classList.remove("presto-player-fullscreen-open"),n=n.parentNode};wp.hooks.addAction("presto.playerEnterFullScreen","presto-player",(function(){var r;null!=t&&null!==(r=t.fullscreen)&&void 0!==r&&r.active&&e(t,!0)})),wp.hooks.addAction("presto.playerExitFullScreen","presto-player",(function(){var r;null!=t&&null!==(r=t.fullscreen)&&void 0!==r&&r.active||e(t,!1)}))}},Ge=function(){var t=h(regeneratorRuntime.mark((function t(r){var e,i,o,n,a,s,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"!=typeof jQuery){t.next=2;break}return t.abrupt("return");case 2:if("ResizeObserver"in window!=0){t.next=7;break}return t.next=5,import("./p-80dd671c.js");case 5:window.ResizeObserver=t.sent.ResizeObserver;case 7:if(l=new ResizeObserver((function(t){var r,e=v(t);try{for(e.s();!(r=e.n()).done;){var i=r.value,o=i.contentRect;jQuery(i.target).find(".plyr__menu__container").css({maxHeight:"".concat(Math.max(o.height-48,200),"px")})}}catch(t){e.e(t)}finally{e.f()}})),null!=r&&null!==(e=r.elements)&&void 0!==e&&null!==(i=e.container)&&void 0!==i&&null!==(o=i.getRootNode())&&void 0!==o&&o.firstChild){t.next=10;break}return t.abrupt("return");case 10:if(l.observe(null==r||null===(n=r.elements)||void 0===n||null===(a=n.container)||void 0===a||null===(s=a.getRootNode())||void 0===s?void 0:s.firstChild),r){t.next=13;break}return t.abrupt("return");case 13:r.on("playing",(function(){var t,e,i,o,n=null==r||null===(t=r.elements)||void 0===t||null===(e=t.container)||void 0===e?void 0:e.getRootNode().firstChild.getBoundingClientRect();jQuery(null==r||null===(i=r.elements)||void 0===i||null===(o=i.container)||void 0===o?void 0:o.getRootNode()).find(".plyr__menu__container").css({maxHeight:"".concat(Math.max(n.height-48,200),"px")})}));case 14:case"end":return t.stop()}}),t)})));return function(r){return t.apply(this,arguments)}}();function Ke(t){var r,e,i,o,n,s,l,p,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=a(a(a({},d),null!==(r=window)&&void 0!==r&&null!==(e=r.prestoPlayer)&&void 0!==e&&e.plugin_url?{iconUrl:"".concat(null===(i=window)||void 0===i||null===(o=i.prestoPlayer)||void 0===o?void 0:o.plugin_url,"img/")+"".concat(null!=d&&null!==(n=d.preset)&&void 0!==n&&n.skin?d.preset.skin:"default")+".svg"}:{}),{chapters:(null==d?void 0:d.chapters)||[],controls:(null==d?void 0:d.controls)||[],settings:Object.keys((null==d?void 0:d.settings)||{}).length?d.settings:{}}),h=new le(t,c);return"undefined"!=typeof learndash_video_data&&import("./p-36c54493.js").then((function(t){(0,t.default)(h)})),"undefined"!=typeof _tutorobject&&import("./p-24bcf5c4.js").then((function(t){(0,t.default)(h)})),void 0!==window.llms&&!0===(null===(p=prestoPlayer)||void 0===p||null===(u=p.lifter)||void 0===u?void 0:u.isLesson)&&import("./p-80de15fc.js").then((function(t){(0,t.default)(h)})),Be(h),Je(h),Ge(h),Ne(h),De(h),we(h),null!==(s=window)&&void 0!==s&&null!==(l=s.prestoPlayer)&&void 0!==l&&l.isAdmin||(We(h),He(c),pe(h),Re(h)),h}function Xe(t){return"string"==typeof t&&t.includes(".m3u8")}var Ze=function(t){var r=t.config,e=t.selector;return new Promise((function(t){return t(new Ke(e,a({},r)))}))};let ti=class{constructor(r){t(this,r),this.loaded=i(this,"loaded",7),this.currentMediaPlayer=i(this,"currentMediaPlayer",7),this.isAdmin=!1,this.previouslyPlaying=!1,this.ctaActive=!1,this.emailActive=!1,this.actionBarActive=!1,this.components={cta:null,email:null,overlays:null}}async play(t=!1){this.shouldLazyLoad=!1,t&&(this.mutedPreview=!1),this.player.play()}async goToAndPlay(t){this.player.play(),this.player.currentTime=t}handleScroll(t){t.detail.id!==this.player.id&&(this.mutedPreview||this.pause())}async restart(){return this.shouldLazyLoad=!1,this.player.restart()}async pause(){return this.player.pause()}async stop(){return this.player.stop()}async fullscreenToggle(t){return this.player.fullscreen.toggle(t)}async on(t,r){return this.player.on(t,r)}async once(t,r){return this.player.once(t,r)}async off(t,r){return this.player.off(t,r)}async handleCurrentTimeChange(t){this.player&&Number.isInteger(t)&&(this.player.duration&&(this.player.currentTime=Math.min(this.player.currentTime,this.player.duration)),this.shouldLazyLoad&&(this.shouldLazyLoad=!1,await new Promise((t=>{setTimeout((async()=>{await this.initialize(),t()}),50)}))),this.player.embed&&!this.player.playing?(this.player.currentTime=t,this.player.muted=!0,this.player.play(),this.player.once("timeupdate",(()=>{this.player.pause(),this.player.currentTime=t,this.player.muted=!1}))):this.player.currentTime=t)}handleStickyChange(){(function(t){for(var r=[];t.parentNode&&"body"!=t.parentNode.nodeName.toLowerCase();)r.push(t=t.parentNode);return r})(this.el).forEach((t=>{t.classList.toggle("presto-sticky-parent",this.isSticky)}))}getConfig(){return Object.assign(Object.assign({},function({preset:t={},chapters:r,branding:e,src:i,analytics:o,automations:n,autoplay:a,blockAttributes:s={},provider:l="",provider_video_id:p="",youtube:u,type:d,isAdmin:c,i18n:h,storage:v={enabled:!c,key:`presto-player-${t.id}`}}){var y,f,_,g;const b=["settings"],m=[...["youtube","vimeo"].includes(l)?["pip"]:[]],w=["play-large","rewind","play","fast-forward","progress","current-time","mute","volume","captions","settings","pip","fullscreen"].filter((r=>((null==t?void 0:t[r])||b.includes(r))&&!m.includes(r)));(null===(y=null==s?void 0:s.mutedPreview)||void 0===y?void 0:y.enabled)&&(v={enabled:!1});let k=Object.assign(Object.assign(Object.assign(Object.assign({id:null==s?void 0:s.id,title:(null==s?void 0:s.title)||"",blockAttributes:Object.assign(Object.assign({},s),{type:d}),src:i,ajaxProgress:!0,analytics:o,preset:t,automations:n,mutedPreview:{enabled:null===(f=null==s?void 0:s.mutedPreview)||void 0===f?void 0:f.enabled},loop:{active:"loop"===(null==t?void 0:t.on_video_end)},chapters:r,controls:w,settings:["captions","quality","loop",...(null==t?void 0:t.speed)?["speed"]:[]],hideControls:null==t?void 0:t.auto_hide,captions:{active:null==t?void 0:t.captions_enabled,language:"auto",update:!1},logo:null==e?void 0:e.logo,logo_width:null==e?void 0:e.logo_width,hide_logo:null==t?void 0:t.hide_logo,lazy_load_youtube:null==t?void 0:t.lazy_load_youtube,save_player_position:!!(null==t?void 0:t.save_player_position),sticky_scroll:null==t?void 0:t.sticky_scroll,play_video_viewport:null==t?void 0:t.play_video_viewport,autoplay:!(!a||(null===(_=window.wp)||void 0===_?void 0:_.blocks))},l?{provider:l}:{}),p?{provider_video_id:p}:{}),(null==s?void 0:s.poster)?{poster:s.poster}:{}),{invertTime:!t.hasOwnProperty("invert_time")||(null==t?void 0:t.invert_time),storage:v,keyboard:{focused:!1,global:!1},resetOnEnd:!!(null==t?void 0:t.reset_on_end),vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,premium:!1,playsinline:!!(null==s?void 0:s.playsInline)},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!!(null==u?void 0:u.noCookie),playsinline:!!(null==s?void 0:s.playsInline)},tooltips:{controls:!0,seek:!0},i18n:h});return(null===(g=null===window||void 0===window?void 0:window.wp)||void 0===g?void 0:g.hooks)&&(k=window.wp.hooks.applyFilters("presto.playerSettings",k)),k}({preset:this.preset,chapters:this.chapters,branding:this.branding,analytics:!!this.analytics,automations:!!this.automations,autoplay:!this.isAdmin&&!!this.autoplay,blockAttributes:this.blockAttributes,provider:this.provider,youtube:this.youtube,provider_video_id:this.provider_video_id,i18n:this.i18n})),this.iconUrl?{iconUrl:this.iconUrl}:{})}getPlayerData(){return{selector:this.playerEl,src:this.src||"",preload:this.preload,provider:this.provider,config:this.getConfig(),isAdmin:this.isAdmin}}async createPlayer(){return await(t=this.getPlayerData(),r=t.config,e=t.selector,i=t.src,o=t.preload,i&&Xe(i)?e&&e.canPlayType("application/vnd.apple.mpegurl")&&m()?Ze({config:r,selector:e}):import("./p-146fd1f2.js").then((function(t){return(0,t.default)({config:r,selector:e,src:i,preload:o})})):Ze({config:r,selector:e}));var t,r,e,i,o}handlePlayerElementChange(){var t;(({src:t,el:r,preload:e,currentTime:i})=>{if(!r.getAttribute("hls_loaded")&&["metadata","none"].includes(e)&&Xe(t)){if(i>0)return r.style.height=null,r.style.paddingBottom=null,void r.setAttribute("hls_loaded","1");r.style.height="0px",r.style.paddingBottom="56.25%"}})({src:this.src,el:this.playerEl,preload:this.preload,currentTime:null===(t=null==this?void 0:this.player)||void 0===t?void 0:t.currentTime})}handleMutedPreview(t,r){var e,i,o,n,a,s,l;this.player&&!this.isAdmin&&(!t&&r&&this.player.once("timeupdate",(()=>{var t,r;this.player.loop="loop"===(null===(t=this.preset)||void 0===t?void 0:t.on_video_end),this.player.toggleCaptions(null===(r=null==this?void 0:this.preset)||void 0===r?void 0:r.captions_enabled)})),(null===(o=null===(i=null===(e=this.originalConfig)||void 0===e?void 0:e.blockAttributes)||void 0===i?void 0:i.mutedPreview)||void 0===o?void 0:o.enabled)&&(({player:t,mutedPreview:r,captions:e,progress:i,savePosition:o,onPlay:n})=>{var a=window.navigator.userAgent;if(!a.match(/iPad/i)&&!a.match(/iPhone/i)){t.config.mutedPreview.enabled=r,t.muted=r,t.loop=r,t.config.ajaxProgress=!r&&i,t.config.save_player_position=!r&&o;try{t.toggleCaptions(!!r&&!!e)}catch(t){}return setTimeout((()=>{de(t)||t.restart(),setTimeout((()=>{t.muted=r,n()}),50)}),0),t}console.log("ios device, do not do muted autoplay")})({player:this.player,mutedPreview:this.mutedPreview,captions:!!(null===(a=null===(n=this.blockAttributes)||void 0===n?void 0:n.mutedPreview)||void 0===a?void 0:a.captions),progress:null===(s=this.originalConfig)||void 0===s?void 0:s.ajaxProgress,savePosition:null===(l=this.originalConfig)||void 0===l?void 0:l.save_player_position,onPlay:()=>this.play()}))}onPlayerReady(){var t,r,e;this.observer&&(this.observer.disconnect(),this.observer.observe(this.el)),this.duration=this.player.duration;var i=window.navigator.userAgent;!!i.match(/iPad/i)||!!i.match(/iPhone/i)||(this.mutedPreview=null===(r=null===(t=this.blockAttributes)||void 0===t?void 0:t.mutedPreview)||void 0===r?void 0:r.enabled),this.renderDynamicOverlays(),this.renderVideoCTA(),this.renderEmailOverlay(),this.player.on("timeupdate loadedmetadata",(()=>{this.duration=this.player.duration,this.renderDynamicOverlays()})),Xe(this.src)&&this.player.once("playing",(()=>{this.playerEl.style.height=null,this.playerEl.style.paddingBottom=null,this.playerEl.setAttribute("hls_loaded","1")})),this.player.on("playing",(()=>this.playClass="presto-player--playing")),this.player.on("pause",(()=>this.playClass="presto-player--paused")),this.player.on("ended",(()=>this.playClass="presto-player--ended")),this.player.on("playing",(t=>!this.mutedPreview&&this.currentMediaPlayer.emit(t.detail.plyr))),"go-to-start"===(null===(e=this.preset)||void 0===e?void 0:e.on_video_end)&&this.player.on("ended",(()=>{this.restart(),"youtube"===this.provider&&this.stop()}))}handlePlayerEvents(t){t.on("ready",(t=>{this.player=t.detail.plyr,this.onPlayerReady()}))}handleLazyLoadChange(){"youtube"!==this.provider||this.shouldLazyLoad||this.isAdmin||setTimeout((()=>{this.onReload("play")}),50)}shouldLazyLoadVideo(){var t,r,e;return"youtube"===this.provider&&!this.autoplay&&!(null===(r=null===(t=this.blockAttributes)||void 0===t?void 0:t.mutedPreview)||void 0===r?void 0:r.enabled)&&!!(null===(e=this.preset)||void 0===e?void 0:e.lazy_load_youtube)}componentWillLoad(){var t,r,e;const i=null===(t=this.el.children)||void 0===t?void 0:t[0];i&&i.classList&&i.classList.contains("presto-iframe-fallback-container")&&i.remove(),this.shouldLazyLoad=this.shouldLazyLoadVideo(),this.i18n=(null===(r=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===r?void 0:r.i18n)||(null===(e=null===window||void 0===window?void 0:window.prestoPlayerAdmin)||void 0===e?void 0:e.i18n),this.originalConfig||(this.originalConfig=this.getConfig()),this.trackIntersection()}async componentDidLoad(){setTimeout((()=>{this.initialize(),this.loaded.emit(!0)}),0)}async initialize(){const t=await this.createPlayer();return this.handlePlayerEvents(t),this.syncVideoHeight(),((t,r)=>{if(!r)return;const e=document.createElement("style");t.shadowRoot.append(e),e.appendChild(document.createTextNode(r))})(this.el,this.css),t}renderSkins(){var t,e,i;return"modern"===(null===(t=this.preset)||void 0===t?void 0:t.skin)?r("presto-modern-skin",null):"business"===(null===(e=this.preset)||void 0===e?void 0:e.skin)?r("presto-business-skin",null):"stacked"===(null===(i=this.preset)||void 0===i?void 0:i.skin)?r("presto-stacked-skin",null):void 0}async onReload(t){const r=await this.initialize();"play"==t&&r.on("ready",(()=>{this.play(),r.muted=!0,r.muted=!1,r.off("ready",this.play)}))}async syncVideoHeight(){if("ResizeObserver"in window==0){const t=await import("./p-80dd671c.js");window.ResizeObserver=t.ResizeObserver}new ResizeObserver((()=>{this.isSticky||(this.videoHeight=this.el.getBoundingClientRect().height)})).observe(this.el)}handleRestartVideo(){this.player.once("timeupdate",(()=>{setTimeout((()=>this.play()),500)})),this.player.restart()}handlePlayVideo(){this.play()}handlePauseVideo(t){this.pause(),t.detail&&function(t){var r,e,i,o,n;if("unknown"!==b()&&!(null===(e=null===(r=null==t?void 0:t.config)||void 0===r?void 0:r.blockAttributes)||void 0===e?void 0:e.playsInline)&&("function"==typeof(null===(i=null==t?void 0:t.media)||void 0===i?void 0:i.webkitExitFullScreen)&&(null==t||t.media.webkitExitFullScreen()),"function"==typeof(null===(o=null==t?void 0:t.embed)||void 0===o?void 0:o.exitFullscreen)&&(null===(n=null==t?void 0:t.embed)||void 0===n||n.exitFullscreen()),"youtube"===t.provider)){const r=t.currentTime;t.currentTime=t.duration,t.once("playing",(()=>{t.currentTime=r}))}}(this.player)}playVideoOnlyInViewport(){var t;!this.isAdmin&&(null===(t=this.preset)||void 0===t?void 0:t.play_video_viewport)&&this.player&&("visible"===document.visibilityState?this.observer.observe(this.el):(this.player.playing&&(this.previouslyPlaying=!0),this.pause(),this.observer.disconnect()))}trackIntersection(){this.observer=new IntersectionObserver((t=>{this.handleVisibilityIntersection(null==t?void 0:t[0])})),this.observer.observe(this.el)}handleVisibilityIntersection(t){t&&(this.handleStickyScroll(t),this.handleVisibilityPlayChange(t))}handleStickyScroll(t){var r,e;if(!(null===(r=this.preset)||void 0===r?void 0:r.sticky_scroll))return;if(this.isAdmin||this.mutedPreview||!(null===(e=null==this?void 0:this.player)||void 0===e?void 0:e.playing))return void(this.isSticky=!1);let i=t.boundingClientRect;if(this.isSticky=i.height<-i.top,"visible"===document.visibilityState&&this.isSticky&&this.player){const t=()=>{window.removeEventListener("scroll",t),this.player.paused&&(this.isSticky=!1)};this.player.once("pause",(()=>{window.addEventListener("scroll",t)}))}}handleVisibilityPlayChange(t){var r,e,i;if(!this.isAdmin&&(null===(r=this.preset)||void 0===r?void 0:r.play_video_viewport)&&(!this.player&&this.originalConfig.autoplay&&(this.previouslyPlaying=!0,this.autoplay=!!(null==t?void 0:t.isIntersecting)),this.player)){if(null==t?void 0:t.isIntersecting)return this.originalConfig.autoplay&&(this.autoplay=!0),this.previouslyPlaying&&this.play(),void(this.previouslyPlaying=!1);if("visible"!==document.visibilityState||!this.isSticky){if(null===(i=null===(e=this.blockAttributes)||void 0===e?void 0:e.mutedPreview)||void 0===i?void 0:i.enabled)return this.previouslyPlaying=!0,this.pause(),void this.player.once("playing",(()=>{this.previouslyPlaying=!0,this.pause()}));this.player.playing&&(this.previouslyPlaying=!0),this.pause()}}}renderMutedOverlay(){var t;if(this.player&&this.mutedPreview&&!this.isAdmin)return r("presto-muted-overlay",{mutedOverlay:null===(t=this.player.config.blockAttributes)||void 0===t?void 0:t.mutedOverlay,preset:this.preset,onPlayVideo:()=>{this.mutedPreview=!1,this.play()}})}renderVideo(){var t;switch(this.provider){case"vimeo":return r("presto-vimeo",{player:this.player,getRef:t=>this.playerEl=t,poster:this.poster,src:this.src});case"youtube":return r("presto-youtube",{onReload:t=>this.onReload(null==t?void 0:t.detail),player:this.player,getRef:t=>this.playerEl=t,lazyLoad:this.shouldLazyLoad,poster:this.poster,src:this.src});case"bunny":return r("presto-bunny",{thumbnail:null===(t=null==this?void 0:this.bunny)||void 0===t?void 0:t.thumbnail,getRef:t=>this.playerEl=t,player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,playsinline:this.playsinline,src:this.src,tracks:this.tracks,videoAttributes:this.videoAttributes});case"audio":return r("presto-audio",{getRef:t=>this.playerEl=t,player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,preset:this.preset,src:this.src,tracks:this.tracks,mediaTitle:this.mediaTitle,audioAttributes:this.audioAttributes});default:return r("presto-video",{getRef:t=>this.playerEl=t,player:this.player,autoplay:this.autoplay,preload:this.preload,poster:this.poster,playsinline:this.playsinline,src:this.src,tracks:this.tracks,videoAttributes:this.videoAttributes})}}renderVideoCTA(){var t,r,e,i;(null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.isPremium)&&(this.isAdmin||(null===(e=null===(r=this.preset)||void 0===r?void 0:r.cta)||void 0===e?void 0:e.enabled)&&((null===(i=this.components.cta)||void 0===i?void 0:i.offsetParent)||"audio"!==this.provider&&(this.components.cta=document.createElement("presto-cta-overlay"),this.components.cta.direction=this.direction,this.components.cta.player=this.player,this.components.cta.preset=this.preset,this.components.cta.i18n=this.i18n,this.player.elements.container.append(this.components.cta))))}renderAudioCTA(){var t,e;if("audio"===this.provider&&this.player&&(null===(e=null===(t=this.preset)||void 0===t?void 0:t.cta)||void 0===e?void 0:e.enabled))return r("presto-cta-overlay",{direction:this.direction,player:this.player,preset:this.preset,i18n:this.i18n,provider:this.provider})}renderEmailOverlay(){var t,r,e;!(null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.isPremium)||this.isAdmin||(null===(r=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===r?void 0:r.logged_in)||(null===(e=this.components.email)||void 0===e?void 0:e.offsetParent)||"audio"!==this.provider&&(this.components.email=document.createElement("presto-email-overlay"),this.components.email.direction=this.direction,this.components.email.player=this.player,this.components.email.preset=this.preset,this.components.email.i18n=this.i18n,this.components.email.videoId=this.video_id,this.player.elements.container.append(this.components.email))}renderAudioEmail(){var t,e;if("audio"===this.provider&&this.player&&(null===(t=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===t?void 0:t.isPremium)&&!this.isAdmin&&!(null===(e=null===window||void 0===window?void 0:window.prestoPlayer)||void 0===e?void 0:e.logged_in))return r("presto-email-overlay",{direction:this.direction,player:this.player,preset:this.preset,i18n:this.i18n,provider:this.provider})}renderActionBar(){var t,e;if((null===(e=null===(t=this.preset)||void 0===t?void 0:t.action_bar)||void 0===e?void 0:e.enabled)&&this.player)return r("presto-action-bar",{config:this.preset.action_bar,player:null==this?void 0:this.player,youtube:this.youtube})}stickyPositionClass(){var t,r;return this.isSticky?(null===(t=this.preset)||void 0===t?void 0:t.sticky_scroll_position)?`presto-sticky--${null===(r=this.preset)||void 0===r?void 0:r.sticky_scroll_position.replace(/\s+/g,"-")}`:"presto-sticky--bottom-right":""}renderDynamicOverlays(){var t,r,e,i,o,n,a;this.player&&((null===(t=null==this?void 0:this.overlaysComponent)||void 0===t?void 0:t.offsetParent)||(this.overlaysComponent=document.createElement("presto-dynamic-overlays"),this.overlaysComponent.addEventListener("reloadComponent",(()=>{this.overlaysComponent.remove(),this.overlaysComponent=document.createElement("presto-dynamic-overlays")}),{once:!0})),this.overlaysComponent.style.cssText="display: block !important; opacity: 1 !important; visibility: visible !important;",this.overlaysComponent.overlays=this.overlays,this.overlaysComponent.preset=this.preset,this.overlaysComponent.player=this.player,this.overlaysComponent.enabled=!(null===(i=null===(e=null===(r=this.player)||void 0===r?void 0:r.config)||void 0===e?void 0:e.mutedPreview)||void 0===i?void 0:i.enabled),(null===(o=null==this?void 0:this.overlaysComponent)||void 0===o?void 0:o.offsetParent)||null===(a=null===(n=this.player.elements)||void 0===n?void 0:n.wrapper)||void 0===a||a.append(this.overlaysComponent))}handleCtaStateChange(t){this.ctaActive=t.detail}handleEmailStateChange(t){this.emailActive=t.detail}handleActionBarStateChange(t){this.actionBarActive=t.detail}render(){var t,e,i,n,a,s,l,p;return r(o,{style:{height:this.isSticky?`${this.videoHeight}px`:"auto"}},r("div",{part:"wrapper",dir:this.direction,class:`presto-player__wrapper fitvidsignore\n presto-video-id-${this.video_id}\n ${this.isSticky?"audio"===this.provider?"presto-sticky-audio":"presto-sticky":""}\n ${"audio"!==this.provider?this.stickyPositionClass():""}\n ${"rtl"===this.direction?"rtl":""}\n ${!0===this.ctaActive?"cta-active":""}\n ${!0===this.emailActive?"email-active":""}\n ${!0===this.actionBarActive&&(null===(e=null===(t=this.preset)||void 0===t?void 0:t.action_bar)||void 0===e?void 0:e.enabled)?"action-bar-active":""}\n ${!!(null===(i=this.preset)||void 0===i?void 0:i.skin)&&`skin-${null===(n=this.preset)||void 0===n?void 0:n.skin}`}\n ${(null===(a=this.preset)||void 0===a?void 0:a.hide_youtube)?"hide-youtube-ui":""}\n ${(null===(s=this.preset)||void 0===s?void 0:s.caption_style)?`caption-style-${null===(l=this.preset)||void 0===l?void 0:l.caption_style}`:""}\n ${this.mutedPreview?"is-muted-overlay":""}\n ${this.playClass?this.playClass:""}\n ${(null===(p=this.preset)||void 0===p?void 0:p.play)&&!this.preset.rewind?"rewind-inactive":""}\n ${this.classes||""}`},r("div",null,r("slot",{name:"player-start"}),r("slot",{name:"player-before-video"}),this.renderVideo(),r("slot",{name:"player-after-video"}),this.renderActionBar(),this.renderMutedOverlay(),this.renderAudioCTA(),this.renderAudioEmail(),this.renderSkins(),r("slot",{name:"player-end"}))))}get el(){return e(this)}static get watchers(){return{currentTime:["handleCurrentTimeChange"],isSticky:["handleStickyChange"],playerEl:["handlePlayerElementChange"],player:["handlePlayerElementChange"],mutedPreview:["handleMutedPreview"],shouldLazyLoad:["handleLazyLoadChange"],overlays:["renderDynamicOverlays"],preset:["renderDynamicOverlays"]}}};ti.style='@charset "UTF-8";@keyframes plyr-progress{to{background-position:var(--plyr-progress-loading-size, 25px) 0}}@keyframes plyr-popup{0%{opacity:0.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:var(--plyr-font-family, inherit);font-variant-numeric:tabular-nums;font-weight:var(--plyr-font-weight-regular, 400);line-height:var(--plyr-line-height, 1.7);max-width:100%;min-width:200px;position:relative;text-shadow:none;transition:box-shadow 0.3s ease;z-index:0}.plyr video,.plyr audio,.plyr iframe{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 input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:var(--plyr-badge-background, #4a5464);border-radius:var(--plyr-badge-border-radius, 2px);color:var(--plyr-badge-text-color, #fff);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 0.3s ease;bottom:0;display:none;font-size:var(--plyr-font-size-small, 13px);left:0;padding:var(--plyr-control-spacing, 10px);position:absolute;text-align:center;transition:transform 0.4s ease-in-out;width:100%}.plyr__captions span:empty{display:none}@media (min-width: 480px){.plyr__captions{font-size:var(--plyr-font-size-base, 15px);padding:calc(var(--plyr-control-spacing, 10px) * 2)}}@media (min-width: 768px){.plyr__captions{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(var(--plyr-control-spacing, 10px) * -4))}.plyr__caption{background:var(--plyr-captions-background, rgba(0, 0, 0, 0.8));border-radius:2px;box-decoration-break:clone;color:var(--plyr-captions-text-color, #fff);line-height:185%;padding:0.2em 0.5em;white-space:pre-wrap}.plyr__caption div{display:inline}.plyr__control{background:transparent;border:0;border-radius:var(--plyr-control-radius, 3px);color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:calc(var(--plyr-control-spacing, 10px) * 0.7);position:relative;transition:all 0.3s ease}.plyr__control svg{display:block;fill:currentColor;height:var(--plyr-control-icon-size, 18px);pointer-events:none;width:var(--plyr-control-icon-size, 18px)}.plyr__control:focus{outline:0}.plyr__control.plyr__tab-focus{outline:var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b3ff))) dotted 3px;outline-offset:2px}a.plyr__control{text-decoration:none}a.plyr__control::after,a.plyr__control::before{display:none}.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed,.plyr__control.plyr__control--pressed .label--not-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(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(var(--plyr-control-spacing, 10px) / 4)}.plyr__controls .plyr__controls__item.plyr__time{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:first-child,.plyr__controls .plyr__controls__item.plyr__time+.plyr__time{padding-left:0}.plyr__controls:empty{display:none}.plyr [data-plyr=captions],.plyr [data-plyr=pip],.plyr [data-plyr=airplay],.plyr [data-plyr=fullscreen]{display:none}.plyr--captions-enabled [data-plyr=captions],.plyr--pip-supported [data-plyr=pip],.plyr--airplay-supported [data-plyr=airplay],.plyr--fullscreen-enabled [data-plyr=fullscreen]{display:inline-block}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform 0.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 0.2s ease;background:var(--plyr-menu-background, rgba(255, 255, 255, 0.9));border-radius:var(--plyr-menu-radius, 4px);bottom:100%;box-shadow:var(--plyr-menu-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));color:var(--plyr-menu-color, #4a5464);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 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1)}.plyr__menu__container::after{border:var(--plyr-menu-arrow-size, 4px) solid transparent;border-top-color:var(--plyr-menu-background, rgba(255, 255, 255, 0.9));content:"";height:0;position:absolute;right:calc(((var(--plyr-control-icon-size, 18px) / 2) + calc(var(--plyr-control-spacing, 10px) * 0.7)) - (var(--plyr-menu-arrow-size, 4px) / 2));top:100%;width:0}.plyr__menu__container [role=menu]{padding:calc(var(--plyr-control-spacing, 10px) * 0.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:var(--plyr-menu-color, #4a5464);display:flex;font-size:var(--plyr-font-size-menu, var(--plyr-font-size-small, 13px));padding:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) / 1.5) calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5);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: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(var(--plyr-control-spacing, 10px) * 0.7) * 4)}.plyr__menu__container .plyr__control--forward::after{border-left-color:var(--plyr-menu-arrow-color, #728197);right:calc((calc(var(--plyr-control-spacing, 10px) * 0.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:var(--plyr-font-weight-regular, 400);margin:calc(var(--plyr-control-spacing, 10px) * 0.7);margin-bottom:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) / 2);padding-left:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 4);position:relative;width:calc(100% - (calc(var(--plyr-control-spacing, 10px) * 0.7) * 2))}.plyr__menu__container .plyr__control--back::after{border-right-color:var(--plyr-menu-arrow-color, #728197);left:calc((calc(var(--plyr-control-spacing, 10px) * 0.7) * 1.5) - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--back::before{background:var(--plyr-menu-back-border-color, #dcdfe5);box-shadow:0 1px 0 var(--plyr-menu-back-border-shadow-color, #fff);content:"";height:1px;left:0;margin-top:calc(calc(var(--plyr-control-spacing, 10px) * 0.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(var(--plyr-control-spacing, 10px) * 0.7)}.plyr__menu__container .plyr__control[role=menuitemradio]::before,.plyr__menu__container .plyr__control[role=menuitemradio]::after{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]::before{background:rgba(0, 0, 0, 0.1);content:"";display:block;flex-shrink:0;height:16px;margin-right:var(--plyr-control-spacing, 10px);transition:all 0.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 0.3s ease, opacity 0.3s ease;width:6px}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before{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, 0.1)}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:calc((calc(var(--plyr-control-spacing, 10px) * 0.7) - 2px) * -1);overflow:hidden;padding-left:calc(calc(var(--plyr-control-spacing, 10px) * 0.7) * 3.5);pointer-events:none}.plyr--full-ui input[type=range]{appearance:none;background:transparent;border:0;border-radius:calc(var(--plyr-range-thumb-height, 13px) * 2);color:var(--plyr-range-fill-background, var(--plyr-color-main, var(--plyr-color-main, #00b3ff)));display:block;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 0.3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none;background-image:linear-gradient(to right, currentColor var(--value, 0%), transparent var(--value, 0%))}.plyr--full-ui input[type=range]::-webkit-slider-thumb{background:var(--plyr-range-thumb-background, #fff);border:0;border-radius:100%;box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2));height:var(--plyr-range-thumb-height, 13px);position:relative;transition:all 0.2s ease;width:var(--plyr-range-thumb-height, 13px);appearance:none;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:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:var(--plyr-range-thumb-background, #fff);border:0;border-radius:100%;box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2));height:var(--plyr-range-thumb-height, 13px);position:relative;transition:all 0.2s ease;width:var(--plyr-range-thumb-height, 13px)}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px)}.plyr--full-ui input[type=range]::-ms-track{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none;color:transparent}.plyr--full-ui input[type=range]::-ms-fill-upper{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:transparent;border:0;border-radius:calc(var(--plyr-range-track-height, 5px) / 2);height:var(--plyr-range-track-height, 5px);transition:box-shadow 0.3s ease;user-select:none;background:currentColor}.plyr--full-ui input[type=range]::-ms-thumb{background:var(--plyr-range-thumb-background, #fff);border:0;border-radius:100%;box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2));height:var(--plyr-range-thumb-height, 13px);position:relative;transition:all 0.2s ease;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]::-moz-focus-outer{border:0}.plyr--full-ui input[type=range]:focus{outline:0}.plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track{outline:var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b3ff))) dotted 3px;outline-offset:2px}.plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track{outline:var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b3ff))) dotted 3px;outline-offset:2px}.plyr--full-ui input[type=range].plyr__tab-focus::-ms-track{outline:var(--plyr-tab-focus-color, var(--plyr-color-main, var(--plyr-color-main, #00b3ff))) dotted 3px;outline-offset:2px}.plyr__poster{background-color:var(--plyr-video-background, var(--plyr-video-background, black));background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity 0.2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr--youtube.plyr--paused.plyr__poster-enabled:not(.plyr--stopped) .plyr__poster{display:none}.plyr__time{font-size:var(--plyr-font-size-time, var(--plyr-font-size-small, 13px))}.plyr__time+.plyr__time::before{content:"⁄";margin-right:var(--plyr-control-spacing, 10px)}@media (max-width: 767px){.plyr__time+.plyr__time{display:none}}.plyr__tooltip{background:var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));border-radius:var(--plyr-tooltip-radius, 5px);bottom:100%;box-shadow:var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));color:var(--plyr-tooltip-color, #4a5464);font-size:var(--plyr-font-size-small, 13px);font-weight:var(--plyr-font-weight-regular, 400);left:50%;line-height:1.3;margin-bottom:calc(calc(var(--plyr-control-spacing, 10px) / 2) * 2);opacity:0;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(0.8);transform-origin:50% 100%;transition:transform 0.2s 0.1s ease, opacity 0.2s 0.1s ease;white-space:nowrap;z-index:2}.plyr__tooltip::before{border-left:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-right:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-top:var(--plyr-tooltip-arrow-size, 4px) solid var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));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:hover .plyr__tooltip,.plyr .plyr__control.plyr__tab-focus .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(0.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((var(--plyr-control-icon-size, 18px) / 2) + calc(var(--plyr-control-spacing, 10px) * 0.7))}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translate(0, 10px) scale(0.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip::before{left:auto;right:calc((var(--plyr-control-icon-size, 18px) / 2) + calc(var(--plyr-control-spacing, 10px) * 0.7));transform:translateX(50%)}.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible{transform:translate(0, 0) scale(1)}.plyr__progress{left:calc(var(--plyr-range-thumb-height, 13px) * 0.5);margin-right:var(--plyr-range-thumb-height, 13px);position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:calc(var(--plyr-range-thumb-height, 13px) * -0.5);margin-right:calc(var(--plyr-range-thumb-height, 13px) * -0.5);width:calc(100% + var(--plyr-range-thumb-height, 13px))}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress .plyr__tooltip{left:0;max-width:120px;overflow-wrap:break-word}.plyr__progress__buffer{-webkit-appearance:none;background:transparent;border:0;border-radius:100px;height:var(--plyr-range-track-height, 5px);left:0;margin-top:calc((var(--plyr-range-track-height, 5px) / 2) * -1);padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:transparent}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:var(--plyr-range-track-height, 5px);transition:width 0.2s ease}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:var(--plyr-range-track-height, 5px);transition:width 0.2s ease}.plyr__progress__buffer::-ms-fill{border-radius:100px;transition:width 0.2s ease}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg, var(--plyr-progress-loading-background, rgba(35, 40, 47, 0.6)) 25%, transparent 25%, transparent 50%, var(--plyr-progress-loading-background, rgba(35, 40, 47, 0.6)) 50%, var(--plyr-progress-loading-background, rgba(35, 40, 47, 0.6)) 75%, transparent 75%, transparent);background-repeat:repeat-x;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:var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25))}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6))}.plyr__progress__marker{background-color:var(--plyr-progress-marker-background, #fff);border-radius:1px;height:var(--plyr-range-track-height, 5px);position:absolute;top:50%;transform:translate(-50%, -50%);width:var(--plyr-progress-marker-width, 3px);z-index:3}.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(var(--plyr-control-spacing, 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:var(--plyr-audio-controls-background, #fff);border-radius:inherit;color:var(--plyr-audio-control-color, #4a5464);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-audio-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b3ff)));color:var(--plyr-audio-control-color-hover, #fff)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6)))}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6)))}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:var(--plyr-audio-range-track-background, var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6)))}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, 0.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, 0.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(35, 40, 47, 0.1))}.plyr--audio .plyr__progress__buffer{color:var(--plyr-audio-progress-buffered-background, rgba(193, 200, 209, 0.6))}.plyr--video{background:var(--plyr-video-background, var(--plyr-video-background, black));overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:var(--plyr-video-background, var(--plyr-video-background, black));height:100%;margin:auto;overflow:hidden;position:relative;width:100%}.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{aspect-ratio:16/9}@supports not (aspect-ratio: 16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0;padding-bottom:56.25%;position:relative}}.plyr__video-embed iframe,.plyr__video-wrapper--fixed-ratio video{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr--video .plyr__controls{background:var(--plyr-video-controls-background, linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75)));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:var(--plyr-video-control-color, #fff);left:0;padding:calc(var(--plyr-control-spacing, 10px) / 2);padding-top:calc(var(--plyr-control-spacing, 10px) * 2);position:absolute;right:0;transition:opacity 0.4s ease-in-out, transform 0.4s ease-in-out;z-index:3}@media (min-width: 480px){.plyr--video .plyr__controls{padding:var(--plyr-control-spacing, 10px);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-video-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b3ff)));color:var(--plyr-video-control-color-hover, #fff)}.plyr__control--overlaid{background:var(--plyr-video-control-background-hover, var(--plyr-color-main, var(--plyr-color-main, #00b3ff)));border:0;border-radius:100%;color:var(--plyr-video-control-color, #fff);display:none;left:50%;opacity:0.9;padding:calc(var(--plyr-control-spacing, 10px) * 1.5);position:absolute;top:50%;transform:translate(-50%, -50%);transition:0.3s;z-index:2}.plyr__control--overlaid svg{left:2px;position:relative}.plyr__control--overlaid:hover,.plyr__control--overlaid:focus{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:var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25)))}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25)))}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:var(--plyr-video-range-track-background, var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25)))}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(255, 255, 255, 0.5))}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(255, 255, 255, 0.5))}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:var(--plyr-range-thumb-shadow, 0 1px 1px rgba(35, 40, 47, 0.15), 0 0 0 1px rgba(35, 40, 47, 0.2)), 0 0 0 var(--plyr-range-thumb-active-shadow-width, 3px) var(--plyr-audio-range-thumb-active-shadow-color, rgba(255, 255, 255, 0.5))}.plyr--video .plyr__progress__buffer{color:var(--plyr-video-progress-buffered-background, rgba(255, 255, 255, 0.25))}.plyr:fullscreen{background:#000;border-radius:0 !important;height:100%;margin:0;width:100%}.plyr:fullscreen video{height:100%}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width: 1024px){.plyr:fullscreen .plyr__captions{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__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: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:var(--plyr-control-spacing, 10px);color:#fff;content:attr(data-badge-text);font-size:11px;padding:2px 6px;pointer-events:none;position:absolute;right:var(--plyr-control-spacing, 10px);z-index:3}.plyr__ads:empty::after{display:none}.plyr__cues{background:currentColor;display:block;height:var(--plyr-range-track-height, 5px);left:0;opacity:0.8;position:absolute;top:50%;transform:translateY(-50%);width:3px;z-index:3}.plyr__preview-thumb{background-color:var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));border-radius:var(--plyr-tooltip-radius, 5px);bottom:100%;box-shadow:var(--plyr-tooltip-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));margin-bottom:calc(calc(var(--plyr-control-spacing, 10px) / 2) * 2);opacity:0;padding:3px;pointer-events:none;position:absolute;transform:translate(0, 10px) scale(0.8);transform-origin:50% 100%;transition:transform 0.2s 0.1s ease, opacity 0.2s 0.1s ease;z-index:2}.plyr__preview-thumb--is-shown{opacity:1;transform:translate(0, 0) scale(1)}.plyr__preview-thumb::before{border-left:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-right:var(--plyr-tooltip-arrow-size, 4px) solid transparent;border-top:var(--plyr-tooltip-arrow-size, 4px) solid var(--plyr-tooltip-background, rgba(255, 255, 255, 0.9));bottom:calc(var(--plyr-tooltip-arrow-size, 4px) * -1);content:"";height:0;left:calc(50% + var(--preview-arrow-offset));position:absolute;transform:translateX(-50%);width:0;z-index:2}.plyr__preview-thumb__image-container{background:#c1c8d1;border-radius:calc(var(--plyr-tooltip-radius, 5px) - 1px);overflow:hidden;position:relative;z-index:0}.plyr__preview-thumb__image-container img,.plyr__preview-thumb__image-container::after{height:100%;left:0;position:absolute;top:0;width:100%}.plyr__preview-thumb__image-container::after{border-radius:inherit;box-shadow:inset 0 0 0 1px rgba(0, 0, 0, 0.15);content:"";pointer-events:none}.plyr__preview-thumb__image-container img{max-height:none;max-width:none}.plyr__preview-thumb__time-container{background:var(--plyr-video-controls-background, linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75)));border-bottom-left-radius:calc(var(--plyr-tooltip-radius, 5px) - 1px);border-bottom-right-radius:calc(var(--plyr-tooltip-radius, 5px) - 1px);bottom:0;left:0;line-height:1.1;padding:20px 6px 6px;position:absolute;right:0;z-index:3}.plyr__preview-thumb__time-container span{color:#fff;font-size:var(--plyr-font-size-time, var(--plyr-font-size-small, 13px))}.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 0.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}video,iframe{max-width:100%}.plyr--html5 .plyr__video-wrapper,.plyr--youtube .plyr__video-wrapper{height:100%}.plyr__video-wrapper{z-index:1}.presto-player__wrapper{position:relative;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.presto-player__wrapper.rtl{direction:rtl}.presto-player__wrapper img{max-width:100%}.presto-player__wrapper .plyr{border-radius:var(--presto-player-border-radius)}.presto-player__wrapper .plyr.plyr--video.plyr--menu-open{overflow:hidden}.presto-player__wrapper .plyr--fullscreen-fallback.plyr--vimeo .plyr__video-wrapper{top:50%;transform:translateY(-50%)}.presto-player__wrapper .plyr--fullscreen-fallback.plyr{border-radius:0 !important}.presto-player__wrapper .plyr--fullscreen-fallback.plyr iframe{border-radius:0 !important}.presto-player__wrapper .plyr__menu__container{overflow:auto}.presto-player__wrapper .plyr__menu__container:after{display:none}.presto-player__wrapper img{border:none}.presto-player__wrapper video{margin:auto}.presto-player__wrapper iframe{height:100%}.presto-player__wrapper .plyr--video .plyr__control:active,.presto-player__wrapper .plyr--video .plyr__control:focus{background:#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)}.presto-player__wrapper .plyr__poster{background-size:cover;z-index:2}.presto-player__wrapper .presto-player__logo{margin:0;display:block;position:absolute;z-index:3;opacity:0.5;object-fit:contain;transition:bottom 0.4s ease-in-out;max-width:var(--presto-player-logo-width, 75px)}.presto-player__wrapper .presto-player__logo.is-bottom-right{left:auto;right:20px;top:auto;bottom:60px}.presto-player__wrapper .presto-player__logo.is-bottom-left{left:20px;right:auto;top:auto;bottom:60px}@media screen and (min-width: 380px){.presto-player__wrapper.presto-player--hide-controls .presto-player__logo.is-bottom-right,.presto-player__wrapper.presto-player--hide-controls .presto-player__logo.is-bottom-left,.presto-player__wrapper .plyr--hide-controls .presto-player__logo.is-bottom-right,.presto-player__wrapper .plyr--hide-controls .presto-player__logo.is-bottom-left{bottom:20px}}.presto-player__wrapper .presto-player-progress__marker{width:16px;height:16px;padding:0;border:2px solid rgba(255, 255, 255, 0.5);position:absolute;border-radius:9999px;bottom:calc(50% - 8px);z-index:9;margin-left:-8px !important}.presto-player__wrapper.presto-player--ended .plyr--youtube .plyr__poster{display:none}.presto-player__wrapper.presto-player--ended .plyr--youtube .plyr__control.plyr__control--overlaid{display:none}.presto-player__wrapper .presto-player__wrapper .plyr__control--overlaid{z-index:4}.presto-player__wrapper button.plyr__control.plyr__control--overlaid:focus{background:inherit;border:none;outline:0;position:absolute;top:50%;transform:translate(-50%, -50%)}.presto-player__wrapper .plyr__controls__item.plyr__progress__container{position:relative}.presto-player__wrapper .plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{box-shadow:none}.presto-player__wrapper .plyr--video .plyr__controls{background:var(--plyr-video-controls-background, linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.75)))}.presto-player__wrapper .plyr--fullscreen-fallback.plyr--video .plyr__controls{padding-bottom:calc(var(--plyr-control-spacing, 10px) + env(safe-area-inset-bottom))}.presto-player__wrapper .presto-player-toc{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";line-height:1.4;position:absolute;top:auto;right:0;left:0;bottom:0;max-height:100%;max-width:100%;background:rgba(255, 255, 255, 0.9);background:var(--plyr-menu-background, rgba(255, 255, 255, 0.9));left:auto;padding:20px 15px;border-radius:4px;width:100%;z-index:9;box-shadow:0 1px 2px rgba(0, 0, 0, 0.15);box-shadow:var(--plyr-menu-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));color:#4a5464;color:var(--plyr-menu-color, #4a5464);font-size:15px;font-size:var(--plyr-font-size-base, 15px);white-space:nowrap;z-index:3;display:flex;flex-direction:column;transition:bottom 0.25s ease}@media screen and (min-width: 380px){.presto-player__wrapper .presto-player-toc{right:20px;bottom:60px;width:300px;max-height:calc(100% - 80px);max-width:calc(100vw - 70px)}}.presto-player__wrapper .presto-player-toc__wrapper{position:absolute;top:0;left:0;bottom:0;right:0;z-index:3;visibility:hidden;opacity:0;transition:opacity 0.3s ease-in-out, visibility 0.3s ease-in-out}.presto-player__wrapper .presto-player-toc__wrapper.is-showing{visibility:visible;opacity:1}.presto-player__wrapper .presto-player-toc__cover{position:absolute;top:0;left:0;bottom:0;right:0;z-index:3}.presto-player__wrapper .presto-player-toc__list{flex:1;overflow:auto}.presto-player__wrapper .presto-player-toc__title{font-size:12px;font-weight:bold;margin-bottom:10px;margin-left:10px;margin-right:10px;display:none}@media screen and (min-width: 380px){.presto-player__wrapper .presto-player-toc__title{display:block}}.presto-player__wrapper .presto-player-toc__name{white-space:nowrap;overflow:hidden;width:100%;text-overflow:ellipsis}.presto-player__wrapper .presto-player-toc__chapter{padding:12px;border-radius:3px;cursor:pointer;line-height:1;display:flex;align-items:center;transition:background-color 0.4s ease, color 0.4s ease;margin-bottom:2px;position:relative}.presto-player__wrapper .presto-player-toc__chapter:last-child{margin-bottom:0}.presto-player__wrapper .presto-player-toc__chapter.is-highlighted,.presto-player__wrapper .presto-player-toc__chapter:hover{background:#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)}.presto-player__wrapper .presto-player-toc__chapter.is-highlighted{padding-right:30px}.presto-player__wrapper .presto-player-toc__chapter.is-highlighted:after{background:rgba(255, 255, 255, 0.5);content:"";display:block;flex-shrink:0;height:8px;width:8px;margin-right:10px;margin-right:var(--plyr-control-spacing, 10px);transition:all 0.3s ease;border-radius:9999px;position:absolute;right:7px}.presto-player__wrapper .presto-player-toc__order{margin-right:12px;opacity:0.5}.presto-player__wrapper.rtl{direction:rtl}.presto-player__wrapper.rtl .presto-player-toc__order{order:2;margin-left:12px;margin-right:0}.presto-player__wrapper.rtl .presto-player-toc__name{direction:rtl}.presto-player__wrapper.action-bar-active .presto-audio__poster img{border-bottom-left-radius:0px}.presto-player__wrapper .presto-player-error{position:absolute;top:0;left:0;bottom:0;right:0;background:rgba(0, 0, 0, 0.9);color:#fff;display:flex;align-items:center;justify-content:center;z-index:10;text-align:center}.presto-player__wrapper .presto-player-error__title{font-size:18px;font-weight:bold;margin-bottom:8px}.presto-player__wrapper .presto-player-error__description{opacity:0.75}.presto-player__wrapper.hide-youtube-ui .plyr__video-embed iframe{top:-50%;height:200%}.presto-player__wrapper .plyr--vimeo.plyr--playing .plyr__video-embed__container{pointer-events:none}.presto-player__wrapper .plyr__control--overlaid{border-radius:6px;padding-left:26px;padding-right:26px;position:absolute !important;top:50% !important}.presto-player__wrapper.presto-player--hide-scrim .plyr__controls{background:transparent}.presto-player__wrapper presto-audio .presto-player-toc{max-height:350px}.presto-player__wrapper presto-action-bar{position:relative;z-index:1}.presto-sticky-parent{z-index:99998}.presto-sticky-audio{position:fixed;z-index:3000;width:100vw;bottom:0px;right:0px;left:0px}@media screen and (min-width: 960px){.presto-sticky{--presto-sticky-space:15px;position:fixed;z-index:3000;max-width:var(--presto-sticky-width, 380px);width:100vw}.presto-sticky .plyr__controls,.presto-sticky .presto-player-toc__wrapper,.presto-sticky presto-action-bar,.presto-sticky .presto-player__logo{display:none}.presto-sticky--top-left{top:var(--presto-sticky-space);left:var(--presto-sticky-space)}.presto-sticky--top-center{top:var(--presto-sticky-space);left:0;right:0;margin:0 auto}.presto-sticky--top-right{top:var(--presto-sticky-space);right:var(--presto-sticky-space)}.presto-sticky--center-left{top:0;bottom:0;margin:auto 0;left:var(--presto-sticky-space);display:flex;align-items:center}.presto-sticky--center-center{top:0;bottom:0;right:0;left:0;margin:auto;display:flex;align-items:center}.presto-sticky--center-right{top:0;bottom:0;margin:auto 0;right:var(--presto-sticky-space);display:flex;align-items:center}.presto-sticky--bottom-left{bottom:var(--presto-sticky-space);left:var(--presto-sticky-space)}.presto-sticky--bottom-center{bottom:var(--presto-sticky-space);left:0;right:0;margin:0 auto}.presto-sticky--bottom-right{bottom:var(--presto-sticky-space);right:var(--presto-sticky-space)}}.presto-player__overlay{position:absolute;top:50%;left:50%;z-index:3}.presto-player__muted-overlay{position:absolute;top:0;left:0;right:0;bottom:0;display:none;align-items:center;justify-content:center}.presto-player__muted-overlay .plyr__control--overlaid{display:block;opacity:1;visibility:visible}.presto-player__wrapper.is-muted-overlay{cursor:pointer}.presto-player__wrapper.is-muted-overlay.presto-player--playing .presto-player__muted-overlay{display:flex}.presto-player__wrapper.is-muted-overlay .plyr--playing .presto-player__muted-overlay .plyr__control--overlaid{opacity:1;visibility:visible}.presto-player__wrapper.is-muted-overlay .presto-player__logo{display:none}.presto-player__wrapper.is-muted-overlay .plyr__controls{display:none}.presto-player__wrapper.is-muted-overlay .plyr .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(0) !important}.presto-player__wrapper.rtl .plyr__captions{direction:rtl}.presto-player__wrapper .plyr__captions{z-index:1}.presto-player__wrapper.caption-style-full .plyr__captions{background:var(--plyr-captions-background, rgba(0, 0, 0, 0.8));padding-top:0;padding-bottom:0}.presto-player__wrapper.caption-style-full .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 13px) * -4))}.presto-player__wrapper.caption-style-full.skin-stacked .plyr:not(.plyr--hide-controls):not(.is-muted-overlay) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(calc(var(--plyr-control-spacing, 17px) * -4))}.presto-player__play-cover{cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:99}.presto-player__chapters{width:100%;position:absolute;top:0;height:100%}.presto-player__chapter-markers{margin:0 8px;height:100%;position:relative}.presto-player-progress__marker.plyr__controls__item.plyr__control:hover{border:0;background:#fff}.presto-iframe-fallback-container{position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden}.presto-iframe-fallback-container embed,.presto-iframe-fallback-container iframe,.presto-iframe-fallback-container object{position:absolute;top:0;left:0;width:100%;height:100%}@media (min-aspect-ratio: 16/9){.hide-youtube-ui presto-youtube .plyr:fullscreen .plyr__video-wrapper{width:177.7777777778vh}}.cta-email-active,.cta-email-active .presto-audio__wrapper{min-height:140px}.cta-active,.email-active,.cta-active .presto-audio__wrapper,.email-active .presto-audio__wrapper{min-height:140px}.action-bar-active .plyr{border-radius:var(--presto-player-border-radius) var(--presto-player-border-radius) 0px 0px}';const ri=function(t,r){return d(r)};let ei=class{constructor(r){t(this,r),this.prestoBlur=i(this,"prestoBlur",7),this.prestoFocus=i(this,"prestoFocus",7),this.hasFocus=!1,this.hasLabel=!1,this.hasPrefix=!1,this.hasSuffix=!1,this.type="default",this.size="medium",this.full=!1,this.disabled=!1,this.submit=!1}componentWillLoad(){this.handleSlotChange()}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}handleSlotChange(){this.hasLabel=!!this.button.children,this.hasPrefix=!!this.button.querySelector('[slot="prefix"]'),this.hasSuffix=!!this.button.querySelector('[slot="suffix"]')}handleBlur(){this.hasFocus=!1,this.prestoBlur.emit()}handleFocus(){this.hasFocus=!0,this.prestoFocus.emit()}handleClick(t){this.disabled&&(t.preventDefault(),t.stopPropagation())}render(){const t=!!this.href,e=r(ri,null,r("span",{part:"prefix",class:"button__prefix"},r("slot",{onSlotchange:()=>this.handleSlotChange(),name:"prefix"})),r("span",{part:"label",class:"button__label"},r("slot",{onSlotchange:()=>this.handleSlotChange()})),r("span",{part:"suffix",class:"button__suffix"},r("slot",{onSlotchange:()=>this.handleSlotChange(),name:"suffix"}))),i=r("button",{part:"base",class:{button:!0,"button--default":"default"===this.type,"button--primary":"primary"===this.type,"button--success":"success"===this.type,"button--info":"info"===this.type,"button--warning":"warning"===this.type,"button--danger":"danger"===this.type,"button--text":"text"===this.type,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--has-label":this.hasLabel,"button--has-prefix":this.hasPrefix,"button--has-suffix":this.hasSuffix},disabled:this.disabled,type:this.submit?"submit":"button",name:this.name,value:this.value,onBlur:()=>this.handleBlur,onFocus:()=>this.handleFocus,onClick:()=>this.handleClick},e),o=r("a",{part:"base",class:{button:!0,"button--default":"default"===this.type,"button--primary":"primary"===this.type,"button--success":"success"===this.type,"button--info":"info"===this.type,"button--warning":"warning"===this.type,"button--danger":"danger"===this.type,"button--text":"text"===this.type,"button--small":"small"===this.size,"button--medium":"medium"===this.size,"button--large":"large"===this.size,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--has-label":this.hasLabel,"button--has-prefix":this.hasPrefix,"button--has-suffix":this.hasSuffix},href:this.href,target:this.target,download:this.download,rel:this.target?"noreferrer noopener":void 0,role:"button","aria-disabled":this.disabled?"true":"false",tabindex:this.disabled?"-1":"0",onBlur:()=>this.handleBlur,onFocus:()=>this.handleFocus,onClick:()=>this.handleClick},e);return t?o:i}get button(){return e(this)}};ei.style=":host{display:inline-block;width:auto;cursor:pointer}:host([full]){display:block}.button{display:inline-flex;align-items:stretch;justify-content:center;width:100%;border-style:solid;border-width:var(--presto-player-button-border-width);font-family:var(--plyr-font-family, inherit);font-weight:var(--presto-player-button-font-weight, 500);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;transition:var(--presto--player-transition-fast, 150ms) background-color, var(--presto-player-transition-fast, 150ms) color, var(--presto-player-transition-fast, 150ms) border, var(--presto--player-transition-fast, 150ms) box-shadow;cursor:inherit;border-radius:var(--presto-player-button-border-radius, 0.25em)}.button::-moz-focus-inner{border:0}.button:focus{outline:none}.button.button--disabled{opacity:0.5;cursor:not-allowed}.button.button--disabled *{pointer-events:none}.button ::slotted(.presto--icon){pointer-events:none}.button__prefix,.button__suffix{flex:0 0 auto;display:flex;align-items:center}.button__label{display:flex;align-items:center}.button__label ::slotted(presto-icon){vertical-align:-2px}.button.button--default{background-color:var(--presto-player-color-white, #fff);border-color:var(--presto-player-color-gray-300, #d1d5db);color:var(--presto-player-color-gray-600, #4b5563)}.button.button--default:hover:not(.button--disabled){border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-color, var(--plyr-color-main));opacity:0.75}.button.button--default:focus:not(.button--disabled){border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-color, var(--plyr-color-main));opacity:1}.button.button--default:active:not(.button--disabled){border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-color, var(--plyr-color-main));opacity:1}.button.button--primary{background-color:var(--presto-player-button-color, var(--plyr-color-main));border-color:var(--presto-player-button-color, var(--plyr-color-main));color:var(--presto-player-button-text, #fff)}.button.button--primary:hover:not(.button--disabled){opacity:0.9}.button.button--primary:focus:not(.button--disabled){opacity:1}.button.button--primary:active:not(.button--disabled){opacity:1}.button--text{background-color:transparent;border-color:transparent;color:var(--presto-player-button-color, var(--plyr-color-main))}.button--text:hover:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.8}.button--text:focus:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.7}.button--text:active:not(.button--disabled){background-color:transparent;border-color:transparent;opacity:0.7}.button--small{font-size:var(--presto-player-button-font-size-small, 0.875em);height:var(--presto-player-button-height-small, 1.875em);line-height:calc(var(--presto-player-button-height-small, 1.875em) - var(--presto-player-button-border-width, 1px) * 2)}.button--medium{font-size:var(--presto-player-button-font-size-medium, 1em);height:var(--presto-player-button-height-medium, 2.5em);line-height:calc(var(--presto-player-button-height-medium, 2.5em) - var(--presto-player-button-border-width, 1px) * 2)}.button--large{font-size:var(--presto-player-button-font-size-large, 1.25em);height:var(--presto-player-button-height-large, 3.125em);line-height:calc(var(--presto-player-button-height-large, 3.125em) - var(--presto-player-button-border-width, 1px) * 2)}.button--full{display:block}.button--has-label.button--small .button__label{padding:0 var(--presto-player-button-spacing-small, 0.75em)}.button--has-label.button--medium .button__label{padding:0 var(--presto-player-button-spacing-medium, 1em)}.button--has-label.button--large .button__label{padding:0 var(--presto-player-button-spacing-large, 1.25em)}.button--has-prefix.button--small{padding-left:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-prefix.button--small .button__label{padding-left:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-prefix.button--medium{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-prefix.button--medium .button__label{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-prefix.button--large{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-prefix.button--large .button__label{padding-left:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--small,.button--caret.button--small{padding-right:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-suffix.button--small .button__label,.button--caret.button--small .button__label{padding-right:var(--presto-player-button-spacing-x-small, 0.5em)}.button--has-suffix.button--medium,.button--caret.button--medium{padding-right:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--medium .button__label,.button--caret.button--medium .button__label{padding-right:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--large,.button--caret.button--large{padding-right:var(--presto-player-button-spacing-small, 0.75em)}.button--has-suffix.button--large .button__label,.button--caret.button--large .button__label{padding-right:var(--presto-player-button-spacing-small, 0.75em)}";let ii=class{constructor(r){t(this,r)}render(){return r("span",{part:"base",class:"spinner","aria-busy":"true","aria-live":"polite"})}};ii.style=":host{position:relative;box-sizing:border-box;--track-color:#0d131e20;--indicator-color:var(--plyr-color-main);--stroke-width:2px;display:inline-flex}:host *,:host *:before,:host *:after{box-sizing:inherit}.spinner{display:inline-block;width:1em;height:1em;border-radius:50%;border:solid var(--stroke-width) var(--track-color);border-top-color:var(--indicator-color);border-right-color:var(--indicator-color);animation:1s linear infinite spin}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";let oi=class{constructor(r){t(this,r)}render(){return r(o,null,r("slot",null))}};oi.style=".skin-stacked .plyr__controls{flex-wrap:wrap}.skin-stacked .presto-player-progress__marker{transform:scale(0.75)}.skin-stacked .plyr__controls{justify-content:flex-start}.skin-stacked .plyr__controls__item.plyr__progress__container{order:-1;flex:1 0 100%}.skin-stacked .plyr__controls__item.plyr__progress__container+:not(.plyr__time),.skin-stacked .plyr__controls__item.plyr__progress__container+.plyr__time+*{margin-left:auto}.skin-stacked .plyr__controls .plyr__controls__item:first-child{margin:0}.skin-stacked .plyr__progress{height:19px;display:flex;align-items:center}.skin-stacked .plyr__progress .plyr__progress__buffer{height:3px;transition:all 0.25s ease;position:absolute;top:calc(50% + 1px)}.skin-stacked .plyr__progress input[type=range]::-moz-range-track{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-webkit-slider-runnable-track{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-track{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-fill-upper{height:3px;transition:all 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-fill-lower{height:3px;transition:height 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-webkit-slider-thumb{visibility:hidden;opacity:0;transition:opacity 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-moz-range-thumb{visibility:hidden;opacity:0;transition:opacity 0.25s ease}.skin-stacked .plyr__progress input[type=range]::-ms-thumb{visibility:hidden;opacity:0;transition:opacity 0.25s ease}.skin-stacked .plyr__progress__container:hover .presto-player-progress__marker{transform:scale(1)}.skin-stacked .plyr__progress__container:hover .plyr__progress .plyr__progress__buffer{height:5px;top:50%}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]{overflow:visible}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-moz-range-track{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-webkit-slider-runnable-track{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-track{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-fill-upper{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-fill-lower{height:5px}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-webkit-slider-thumb{visibility:visible;opacity:1}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-moz-range-thumb{visibility:visible;opacity:1}.skin-stacked .plyr__progress__container:hover .plyr__progress input[type=range]::-ms-thumb{visibility:visible;opacity:1}";let ni=class{constructor(r){t(this,r)}handleClick(t){t.preventDefault();const r=document.body.querySelector("presto-player");r&&r.goToAndPlay(this.timeToSeconds(this.time))}timeToSeconds(t){let r,e=t.split(":");return e.length>1&&(r=60*parseInt(e[0])),parseInt(e[1])+parseInt(r)}render(){return r("a",{href:"#",class:"presto-timestamp",onClick:t=>this.handleClick(t)},r("slot",null,this.time))}};ni.style=":host{display:inline}";let ai=class{constructor(r){t(this,r)}render(){return r("video",Object.assign({class:{"presto-player__player":!0,"plyr__video-embed":["youtube","vimeo"].includes(this.provider)},part:"video",ref:this.getRef,autoplay:this.autoplay,preload:this.preload,"data-poster":this.poster,playsinline:this.playsinline},this.videoAttributes),r("source",{src:this.src}),!!this.tracks&&!!this.tracks.length&&this.tracks.map((t=>r("track",{kind:"captions",label:(null==t?void 0:t.label)?t.label:"Captions",src:null==t?void 0:t.src,srclang:(null==t?void 0:t.srcLang)?null==t?void 0:t.srcLang:"en"}))))}};ai.style=":host{display:block}";let si=class{constructor(r){t(this,r)}getId(t){const r=/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/.exec(t||"");return(null==r?void 0:r[5])||""}parseHash(t){const r=t.match(/^.*(?:vimeo.com\/|video\/)(?:\d+)(?:\?.*\&*h=|\/)+(?<hash>[\d,a-f]+)/);return r?r.groups.hash:null}render(){if(this.src)return"Android"!==b()||(t=window.navigator.standalone,e=window.navigator.userAgent.toLowerCase(),i=/safari/.test(e),/iphone|ipod|ipad/.test(e)?!t&&i||t||i:!e.includes("wv"))?r("div",{class:"plyr__video-embed",part:"embed",ref:this.getRef,"data-plyr-provider":"vimeo","data-plyr-embed-id":this.getId(this.src),"data-plyr-embed-hash":this.parseHash(this.src)}):r("div",{class:"presto-iframe-fallback-container"},r("iframe",{src:`https://player.vimeo.com/video/${this.getId(this.src)}?h=${this.parseHash(this.src)}&loop=false&byline=false&portrait=false&title=false&speed=true&transparent=0&gesture=media`,allowFullScreen:!0,allowTransparency:!0,allow:"autoplay",style:{width:"100%"},class:"presto-fallback-iframe"}));var t,e,i}};si.style=":host{display:block}";let li=class{constructor(r){t(this,r),this.reload=i(this,"reload",7)}handlePlayerChange(){this.player&&this.fixes()}fixes(){this.player.once("statechange",(t=>{var r,e,i,o,n;1===t.detail.code&&((null===(n=null===(o=null===(i=null===(e=null===(r=null==t?void 0:t.detail)||void 0===r?void 0:r.plyr)||void 0===e?void 0:e.config)||void 0===i?void 0:i.blockAttributes)||void 0===o?void 0:o.mutedPreview)||void 0===n?void 0:n.enabled)||(this.player.muted=!1))}))}getId(t){var r;const e=(t||"").match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return e&&11===(null===(r=null==e?void 0:e[2])||void 0===r?void 0:r.length)?e[2]:null}loadPlayer(){this.lazyLoad=!1,this.reloadPlayer=!0}componentDidRender(){this.reloadPlayer&&(this.reloadPlayer=!1,this.reload.emit("play"))}setWebView(){var t;let r=null===(t=window.navigator)||void 0===t?void 0:t.standalone,e=window.navigator.userAgent.toLowerCase(),i=/safari/.test(e),o=/iphone|ipod|ipad/.test(e);this.isWebView=o?!r&&!i:e.includes("wv")}componentWillLoad(){this.setWebView(),this.poster||(this.poster=`//img.youtube.com/vi/${this.getId(this.src)}/maxresdefault.jpg`),this.lazyLoad&&m()&&(this.lazyLoad=!1)}render(){return this.isWebView?r("div",{class:"fallback-container"},r("iframe",{src:this.src,allowFullScreen:!0,allowtransparency:!0,allow:"autoplay"})):this.lazyLoad?r("div",null,r("presto-video",{part:"video",getRef:this.getRef,poster:this.poster,src:"",provider:"youtube"}),r("div",{class:"presto-player__play-cover",onClick:()=>this.loadPlayer()})):r("div",{class:"plyr__video-embed",part:"embed",ref:this.getRef,"data-plyr-provider":"youtube","data-plyr-embed-id":this.getId(this.src)})}static get watchers(){return{player:["handlePlayerChange"]}}};li.style=":host{display:block}.fallback-container{position:relative;padding-bottom:56.25%;padding-top:30px;height:0;overflow:hidden}.fallback-container iframe,.fallback-container object,.fallback-container embed{position:absolute;top:0;left:0;width:100%;height:100%}@supports not (aspect-ratio: 16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0 !important;padding-bottom:56.25%;position:relative}}";let pi=class{constructor(r){t(this,r),this.layout="default"}waitForApi(t){var r=setInterval((function(){var e;(null===(e=null===window||void 0===window?void 0:window.gapi)||void 0===e?void 0:e.ytsubscribe)&&(clearInterval(r),t())}),50)}componentDidLoad(){const t=document.createElement("script");t.type="text/javascript",t.async=!1,t.src="https://apis.google.com/js/platform.js";const r=document.getElementsByTagName("script")[0];r&&r.parentNode.insertBefore(t,r),this.waitForApi((()=>{window.gapi.ytsubscribe.render(this.textInput,{channelId:this.channel,layout:this.layout,count:this.showCount?"default":"hidden"})}))}render(){return r("div",{class:"g-ytsubscribe",ref:t=>this.textInput=t})}};pi.style=":host{display:block}";export{P as C,E,Ke as P,y as a,w as b,k as c,x as d,z as e,j as f,S as g,T as h,O as i,A as j,M as k,I as l,L as m,F as n,ti as o,ei as p,ii as q,de as r,oi as s,ni as t,ai as u,si as v,li as w,pi as x}
|
dist/components/web-components/{p-a9751bf2.entry.js → p-7cdc88f8.entry.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
import{r as t,h as o}from"./p-
|
1 |
+
import{r as t,h as o}from"./p-219091ba.js";let e=class{constructor(o){t(this,o)}render(){return o("div",{class:"curtain",part:"base"},o("div",{class:"content",part:"curtain-content"},o("slot",null)))}};e.style=':host{font-size:16px}.curtain{position:relative;font-family:var(--presto-curtain-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol");background-color:var(--presto-curtain-background-color, #000);text-align:var(--presto-curtain-text-align, center);color:var(--presto-curtain-text-color, #fff);padding-bottom:var(--presto-curtain-size, 56.25%);font-size:var(--presto-curtain-font-size, 1.5em)}::slotted(:not(:first-child)){margin-top:14px}.content{position:absolute;inset:0;display:flex;justify-content:center;align-items:center;flex-direction:column;padding:48px}';export{e as presto_video_curtain_ui}
|
dist/components/web-components/p-80dd671c.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var t,n=[],e="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(t||(t={}));var i,r=function(t){return Object.freeze(t)},o=function(t,n){this.inlineSize=t,this.blockSize=n,r(this)},u=function(){function t(t,n,e,i){return this.x=t,this.y=n,this.width=e,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,r(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(n){return new t(n.x,n.y,n.width,n.height)},t}(),s=function(t){return t instanceof SVGElement&&"getBBox"in t},c=function(t){if(s(t)){var n=t.getBBox();return!n.width&&!n.height}return!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},a=function(t){var n;if(t instanceof Element)return!0;var e=null===(n=null==t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(e&&t instanceof e.Element)},f="undefined"!=typeof window?window:{},h=new WeakMap,v=/auto|scroll/,d=/^tb|vertical/,l=/msie|trident/i.test(f.navigator&&f.navigator.userAgent),w=function(t){return parseFloat(t||"0")},b=function(t,n,e){return void 0===t&&(t=0),void 0===n&&(n=0),void 0===e&&(e=!1),new o((e?n:t)||0,(e?t:n)||0)},p=r({devicePixelContentBoxSize:b(),borderBoxSize:b(),contentBoxSize:b(),contentRect:new u(0,0,0,0)}),m=function(t,n){if(void 0===n&&(n=!1),h.has(t)&&!n)return h.get(t);if(c(t))return h.set(t,p),p;var e=getComputedStyle(t),i=s(t)&&t.ownerSVGElement&&t.getBBox(),o=!l&&"border-box"===e.boxSizing,a=d.test(e.writingMode||""),f=!i&&v.test(e.overflowY||""),m=!i&&v.test(e.overflowX||""),x=i?0:w(e.paddingTop),y=i?0:w(e.paddingRight),E=i?0:w(e.paddingBottom),z=i?0:w(e.paddingLeft),O=i?0:w(e.borderTopWidth),R=i?0:w(e.borderRightWidth),S=i?0:w(e.borderBottomWidth),g=z+y,B=x+E,M=(i?0:w(e.borderLeftWidth))+R,F=O+S,T=m?t.offsetHeight-F-t.clientHeight:0,k=f?t.offsetWidth-M-t.clientWidth:0,C=o?g+M:0,D=o?B+F:0,A=i?i.width:w(e.width)-C-k,I=i?i.height:w(e.height)-D-T,P=A+g+k+M,q=I+B+T+F,V=r({devicePixelContentBoxSize:b(Math.round(A*devicePixelRatio),Math.round(I*devicePixelRatio),a),borderBoxSize:b(P,q,a),contentBoxSize:b(A,I,a),contentRect:new u(z,x,A,I)});return h.set(t,V),V},x=function(n,e,i){var r=m(n,i),o=r.borderBoxSize,u=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case t.DEVICE_PIXEL_CONTENT_BOX:return s;case t.BORDER_BOX:return o;default:return u}},y=function(t){var n=m(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=r([n.borderBoxSize]),this.contentBoxSize=r([n.contentBoxSize]),this.devicePixelContentBoxSize=r([n.devicePixelContentBoxSize])},E=function(t){if(c(t))return 1/0;for(var n=0,e=t.parentNode;e;)n+=1,e=e.parentNode;return n},z=function(){var t=1/0,e=[];n.forEach((function(n){if(0!==n.activeTargets.length){var i=[];n.activeTargets.forEach((function(n){var e=new y(n.target),r=E(n.target);i.push(e),n.lastReportedSize=x(n.target,n.observedBox),r<t&&(t=r)})),e.push((function(){n.callback.call(n.observer,i,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var i=0,r=e;i<r.length;i++)(0,r[i])();return t},O=function(t){n.forEach((function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach((function(e){e.isActive()&&(E(e.target)>t?n.activeTargets.push(e):n.skippedTargets.push(e))}))}))},R=[],S=0,g={attributes:!0,characterData:!0,childList:!0,subtree:!0},B=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],M=function(t){return void 0===t&&(t=0),Date.now()+t},F=!1,T=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var r=this;if(void 0===t&&(t=250),!F){F=!0;var o,u=M(t);o=function(){var i=!1;try{i=function(){var t,i=0;for(O(i);n.some((function(t){return t.activeTargets.length>0}));)i=z(),O(i);return n.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:e}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=e),window.dispatchEvent(t)),i>0}()}finally{if(F=!1,t=u-M(),!S)return;i?r.run(1e3):t>0?r.run(t):r.start()}},function(t){if(!i){var n=0,e=document.createTextNode("");new MutationObserver((function(){return R.splice(0).forEach((function(t){return t()}))})).observe(e,{characterData:!0}),i=function(){e.textContent="".concat(n?n--:n++)}}R.push(t),i()}((function(){requestAnimationFrame(o)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,g)};document.body?n():f.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),B.forEach((function(n){return f.addEventListener(n,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),B.forEach((function(n){return f.removeEventListener(n,t.listener,!0)})),this.stopped=!0)},t}()),k=function(t){!S&&t>0&&T.start(),!(S+=t)&&T.stop()},C=function(){function n(n,e){this.target=n,this.observedBox=e||t.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return n.prototype.isActive=function(){var t,n=x(this.target,this.observedBox,!0);return s(t=this.target)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=n),this.lastReportedSize.inlineSize!==n.inlineSize||this.lastReportedSize.blockSize!==n.blockSize},n}(),D=function(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n},A=new WeakMap,I=function(t,n){for(var e=0;e<t.length;e+=1)if(t[e].target===n)return e;return-1},P=function(){function t(){}return t.connect=function(t,n){var e=new D(t,n);A.set(t,e)},t.observe=function(t,e,i){var r=A.get(t),o=0===r.observationTargets.length;I(r.observationTargets,e)<0&&(o&&n.push(r),r.observationTargets.push(new C(e,i&&i.box)),k(1),T.schedule())},t.unobserve=function(t,e){var i=A.get(t),r=I(i.observationTargets,e);r>=0&&(1===i.observationTargets.length&&n.splice(n.indexOf(i),1),i.observationTargets.splice(r,1),k(-1))},t.disconnect=function(t){var n=this,e=A.get(t);e.observationTargets.slice().forEach((function(e){return n.unobserve(t,e.target)})),e.activeTargets.splice(0,e.activeTargets.length)},t}(),q=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");P.connect(this,t)}return t.prototype.observe=function(t,n){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!a(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");P.observe(this,t,n)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!a(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");P.unobserve(this,t)},t.prototype.disconnect=function(){P.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();export{q as ResizeObserver,y as ResizeObserverEntry,o as ResizeObserverSize}
|
dist/components/web-components/{p-68f17ca9.js → p-80de15fc.js}
RENAMED
File without changes
|
dist/components/web-components/p-82ad268e.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
import{m as n,a as e}from"./p-3e9a58ac.js";import{P as r}from"./p-4338b6d7.js";export default function(t){var a=t.config,o=t.selector,i=t.src,u=t.preload;return new Promise(function(){var t=n(regeneratorRuntime.mark((function n(t){var c,s,w;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(window.Hls){n.next=6;break}case 1:if(window.hasOwnProperty("Hls")){n.next=6;break}return n.next=4,new Promise((function(n){return setTimeout(n,50)}));case 4:n.next=1;break;case 6:if(!window.Hls.isSupported()){n.next=16;break}return s=!["metadata","none"].includes(u),null!==(c=wp)&&void 0!==c&&c.blocks&&(s=!0),(w=new window.Hls({autoStartLoad:s})).loadSource(i),w.on(window.Hls.Events.LEVEL_SWITCHED,(function(n,e){o.closest(".presto-player__wrapper").querySelector(".plyr__menu__container [data-plyr='quality'][value='0'] span").innerHTML=w.autoLevelEnabled?"AUTO (".concat(w.levels[e.level].height,"p)"):"AUTO"})),w.on(window.Hls.Events.MANIFEST_PARSED,(function(){var n=w.levels.map((function(n){return n.height}));n.unshift(0);var i=n.findIndex((function(n){var e;return n===parseInt(null===(e=prestoPlayer)||void 0===e?void 0:e.hls_start_level)}));w.startLevel=i?i-1:2,a.quality={default:0,options:n,forced:!0,onChange:function(n){0===n?prestoHLS.currentLevel=-1:prestoHLS.levels.forEach((function(e,r){e.height===n&&(console.log("Found quality match with "+n),prestoHLS.currentLevel=r)}))}},w.attachMedia(o),window.prestoHLS=w;var u=new r(o,e({},a));return u.hls=w,u.on("waiting",(function n(){w.startLoad(-1),u.off("waiting",n)})),u.on("languagechange",(function(){setTimeout((function(){return w.subtitleTrack=u.currentTrack}),50)})),t(u)})),n.abrupt("return");case 16:if(!o.canPlayType("application/vnd.apple.mpegurl")){n.next=18;break}return n.abrupt("return",t(new r(o,e({},a))));case 18:return n.abrupt("return",t(new r(o,e({},a))));case 19:case"end":return n.stop()}}),n)})));return function(n,e){return t.apply(this,arguments)}}())}
|
|
dist/components/web-components/p-97e2763b.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
var t,n=[],e="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(t||(t={}));var i,r=function(t){return Object.freeze(t)},o=function(t,n){this.inlineSize=t,this.blockSize=n,r(this)},u=function(){function t(t,n,e,i){return this.x=t,this.y=n,this.width=e,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,r(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(n){return new t(n.x,n.y,n.width,n.height)},t}(),s=function(t){return t instanceof SVGElement&&"getBBox"in t},c=function(t){if(s(t)){var n=t.getBBox();return!n.width&&!n.height}return!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},a=function(t){var n,e;if(t instanceof Element)return!0;var i=null===(e=null===(n=t)||void 0===n?void 0:n.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(i&&t instanceof i.Element)},f="undefined"!=typeof window?window:{},h=new WeakMap,v=/auto|scroll/,d=/^tb|vertical/,l=/msie|trident/i.test(f.navigator&&f.navigator.userAgent),w=function(t){return parseFloat(t||"0")},b=function(t,n,e){return void 0===t&&(t=0),void 0===n&&(n=0),void 0===e&&(e=!1),new o((e?n:t)||0,(e?t:n)||0)},p=r({devicePixelContentBoxSize:b(),borderBoxSize:b(),contentBoxSize:b(),contentRect:new u(0,0,0,0)}),m=function(t,n){if(void 0===n&&(n=!1),h.has(t)&&!n)return h.get(t);if(c(t))return h.set(t,p),p;var e=getComputedStyle(t),i=s(t)&&t.ownerSVGElement&&t.getBBox(),o=!l&&"border-box"===e.boxSizing,a=d.test(e.writingMode||""),f=!i&&v.test(e.overflowY||""),m=!i&&v.test(e.overflowX||""),x=i?0:w(e.paddingTop),y=i?0:w(e.paddingRight),E=i?0:w(e.paddingBottom),z=i?0:w(e.paddingLeft),O=i?0:w(e.borderTopWidth),R=i?0:w(e.borderRightWidth),S=i?0:w(e.borderBottomWidth),g=z+y,B=x+E,M=(i?0:w(e.borderLeftWidth))+R,F=O+S,T=m?t.offsetHeight-F-t.clientHeight:0,k=f?t.offsetWidth-M-t.clientWidth:0,C=o?g+M:0,D=o?B+F:0,A=i?i.width:w(e.width)-C-k,I=i?i.height:w(e.height)-D-T,P=A+g+k+M,q=I+B+T+F,V=r({devicePixelContentBoxSize:b(Math.round(A*devicePixelRatio),Math.round(I*devicePixelRatio),a),borderBoxSize:b(P,q,a),contentBoxSize:b(A,I,a),contentRect:new u(z,x,A,I)});return h.set(t,V),V},x=function(n,e,i){var r=m(n,i),o=r.borderBoxSize,u=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case t.DEVICE_PIXEL_CONTENT_BOX:return s;case t.BORDER_BOX:return o;default:return u}},y=function(t){var n=m(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=r([n.borderBoxSize]),this.contentBoxSize=r([n.contentBoxSize]),this.devicePixelContentBoxSize=r([n.devicePixelContentBoxSize])},E=function(t){if(c(t))return 1/0;for(var n=0,e=t.parentNode;e;)n+=1,e=e.parentNode;return n},z=function(){var t=1/0,e=[];n.forEach((function(n){if(0!==n.activeTargets.length){var i=[];n.activeTargets.forEach((function(n){var e=new y(n.target),r=E(n.target);i.push(e),n.lastReportedSize=x(n.target,n.observedBox),r<t&&(t=r)})),e.push((function(){n.callback.call(n.observer,i,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var i=0,r=e;i<r.length;i++)(0,r[i])();return t},O=function(t){n.forEach((function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach((function(e){e.isActive()&&(E(e.target)>t?n.activeTargets.push(e):n.skippedTargets.push(e))}))}))},R=[],S=0,g={attributes:!0,characterData:!0,childList:!0,subtree:!0},B=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],M=function(t){return void 0===t&&(t=0),Date.now()+t},F=!1,T=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var r=this;if(void 0===t&&(t=250),!F){F=!0;var o,u=M(t);o=function(){var i=!1;try{i=function(){var t,i=0;for(O(i);n.some((function(t){return t.activeTargets.length>0}));)i=z(),O(i);return n.some((function(t){return t.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:e}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=e),window.dispatchEvent(t)),i>0}()}finally{if(F=!1,t=u-M(),!S)return;i?r.run(1e3):t>0?r.run(t):r.start()}},function(t){if(!i){var n=0,e=document.createTextNode("");new MutationObserver((function(){return R.splice(0).forEach((function(t){return t()}))})).observe(e,{characterData:!0}),i=function(){e.textContent=""+(n?n--:n++)}}R.push(t),i()}((function(){requestAnimationFrame(o)}))}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,g)};document.body?n():f.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),B.forEach((function(n){return f.addEventListener(n,t.listener,!0)})))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),B.forEach((function(n){return f.removeEventListener(n,t.listener,!0)})),this.stopped=!0)},t}()),k=function(t){!S&&t>0&&T.start(),!(S+=t)&&T.stop()},C=function(){function n(n,e){this.target=n,this.observedBox=e||t.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return n.prototype.isActive=function(){var t,n=x(this.target,this.observedBox,!0);return s(t=this.target)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=n),this.lastReportedSize.inlineSize!==n.inlineSize||this.lastReportedSize.blockSize!==n.blockSize},n}(),D=function(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n},A=new WeakMap,I=function(t,n){for(var e=0;e<t.length;e+=1)if(t[e].target===n)return e;return-1},P=function(){function t(){}return t.connect=function(t,n){var e=new D(t,n);A.set(t,e)},t.observe=function(t,e,i){var r=A.get(t),o=0===r.observationTargets.length;I(r.observationTargets,e)<0&&(o&&n.push(r),r.observationTargets.push(new C(e,i&&i.box)),k(1),T.schedule())},t.unobserve=function(t,e){var i=A.get(t),r=I(i.observationTargets,e);r>=0&&(1===i.observationTargets.length&&n.splice(n.indexOf(i),1),i.observationTargets.splice(r,1),k(-1))},t.disconnect=function(t){var n=this,e=A.get(t);e.observationTargets.slice().forEach((function(e){return n.unobserve(t,e.target)})),e.activeTargets.splice(0,e.activeTargets.length)},t}(),q=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");P.connect(this,t)}return t.prototype.observe=function(t,n){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!a(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");P.observe(this,t,n)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!a(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");P.unobserve(this,t)},t.prototype.disconnect=function(){P.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();export{q as ResizeObserver,y as ResizeObserverEntry,o as ResizeObserverSize}
|
|
dist/components/web-components/{p-5f63f270.entry.js → p-c84320f1.entry.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
import{r as e,h as o}from"./p-
|
1 |
+
import{r as e,h as o}from"./p-219091ba.js";let s=class{constructor(o){e(this,o),this.effect="sheen"}render(){return o("div",{part:"base",class:{skeleton:!0,"skeleton--pulse":"pulse"===this.effect,"skeleton--sheen":"sheen"===this.effect},"aria-busy":"true","aria-live":"polite"},o("div",{part:"indicator",class:"skeleton__indicator"}))}};s.style=":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{--border-radius:var(--presto-player-border-radius-pill);--color:#e5e7eb;--sheen-color:#f3f4f6;display:block;position:relative}.skeleton{display:flex;width:100%;height:100%;min-height:1rem}.skeleton__indicator{flex:1 1 auto;background:var(--color);border-radius:var(--border-radius)}.skeleton--sheen .skeleton__indicator{background:linear-gradient(270deg, var(--sheen-color), var(--color), var(--color), var(--sheen-color));background-size:400% 100%;background-size:400% 100%;animation:sheen 8s ease-in-out infinite}.skeleton--pulse .skeleton__indicator{animation:pulse 2s ease-in-out 0.5s infinite}@keyframes sheen{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}";export{s as presto_player_skeleton}
|
dist/components/web-components/web-components.esm.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
import{p as e,b as t}from"./p-
|
1 |
+
import{p as e,b as t}from"./p-219091ba.js";var r,o;(r=import.meta.url,o={},""!==r&&(o.resourcesUrl=new URL(".",r).href),e(o)).then((e=>t([["p-c84320f1",[[1,"presto-player-skeleton",{effect:[1]}]]],["p-7cdc88f8",[[1,"presto-video-curtain-ui",{actionUrl:[1,"action-url"]}]]],["p-42f151d8",[[1,"presto-player",{video_id:[2],iconUrl:[1,"icon-url"],src:[1],bunny:[16],branding:[16],config:[16],preset:[16],chapters:[16],overlays:[16],blockAttributes:[16],tracks:[16],analytics:[4],automations:[4],provider:[1],provider_video_id:[1],actionBar:[16],youtube:[16],type:[1],autoplay:[1540],preload:[1],poster:[1],playsinline:[4],isAdmin:[4,"is-admin"],direction:[1],css:[1],currentTime:[2,"current-time"],mediaTitle:[1,"media-title"],classes:[1],videoAttributes:[16],audioAttributes:[16],player:[32],playerEl:[32],shouldLazyLoad:[32],mutedPreview:[32],duration:[32],isSticky:[32],videoHeight:[32],playClass:[32],previouslyPlaying:[32],ctaActive:[32],emailActive:[32],actionBarActive:[32],play:[64],goToAndPlay:[64],restart:[64],pause:[64],stop:[64],fullscreenToggle:[64],on:[64],once:[64],off:[64]},[[8,"currentMediaPlayer","handleScroll"],[0,"restartVideo","handleRestartVideo"],[0,"playVideo","handlePlayVideo"],[0,"pauseVideo","handlePauseVideo"],[8,"visibilitychange","playVideoOnlyInViewport"],[0,"ctaStateChange","handleCtaStateChange"],[0,"emailStateChange","handleEmailStateChange"],[0,"actionBarStateChange","handleActionBarStateChange"]]],[4,"presto-timestamp",{time:[1]}],[1,"presto-action-bar",{player:[8],config:[16],direction:[1],youtube:[16],currentTime:[32],duration:[32],ended:[32]}],[0,"presto-cta-overlay",{player:[8],direction:[1],preset:[16],i18n:[16],provider:[1],currentTime:[32],duration:[32],ended:[32]}],[0,"presto-email-overlay",{player:[8],direction:[1],preset:[16],videoId:[2,"video-id"],i18n:[16],provider:[1],currentTime:[32],duration:[32],ended:[32]}],[0,"presto-bunny",{getRef:[1040],autoplay:[4],src:[1],preload:[1],poster:[1025],player:[8],tracks:[16],playsinline:[4],provider:[1],thumbnail:[1],previewUrl:[1,"preview-url"],videoAttributes:[16]}],[1,"presto-dynamic-overlays",{overlays:[16],player:[8],preset:[16],enabled:[4],currentTime:[32],destroy:[32]}],[0,"presto-youtube",{src:[1],poster:[1025],lazyLoad:[1028,"lazy-load"],player:[8],getRef:[1040],reloadPlayer:[32],isWebView:[32]}],[0,"presto-audio",{getRef:[1040],autoplay:[4],src:[1],preload:[1],poster:[1],player:[8],preset:[16],tracks:[16],provider:[1],mediaTitle:[1,"media-title"],audioAttributes:[16],width:[32]}],[4,"presto-business-skin"],[4,"presto-modern-skin"],[0,"presto-muted-overlay",{mutedPreview:[4,"muted-preview"],mutedOverlay:[16],preset:[16]}],[4,"presto-stacked-skin"],[0,"presto-vimeo",{src:[1],poster:[1],player:[8],getRef:[1040]}],[1,"presto-action-bar-controller",{ended:[4],config:[16],currentTime:[514,"current-time"],duration:[514],direction:[1],youtube:[16],show:[32],youtubeRenderKey:[32],percentagePassed:[32]}],[0,"presto-cta-overlay-controller",{ended:[4],currentTime:[514,"current-time"],duration:[514],direction:[1],cta:[16],i18n:[16],provider:[1],enabled:[32],show:[32],loading:[32],error:[32],skipped:[32],percentagePassed:[32]}],[0,"presto-email-overlay-controller",{ended:[4],currentTime:[514,"current-time"],duration:[514],direction:[1],emailCollection:[16],i18n:[16],videoId:[2,"video-id"],presetId:[2,"preset-id"],provider:[1],enabled:[32],show:[32],loading:[32],error:[32],percentagePassed:[32]}],[1,"presto-dynamic-overlay-ui",{href:[1],target:[1],position:[1]}],[1,"presto-cta-overlay-ui",{headline:[1],defaultHeadline:[1,"default-headline"],bottomText:[1,"bottom-text"],showButton:[4,"show-button"],buttonText:[1,"button-text"],buttonType:[1,"button-type"],buttonLink:[16],allowRewatch:[4,"allow-rewatch"],allowSkip:[4,"allow-skip"],direction:[1],i18n:[16],provider:[1],type:[1],isAudioProvider:[32]}],[1,"presto-email-overlay-ui",{headline:[1],bottomText:[1,"bottom-text"],buttonText:[1,"button-text"],allowSkip:[4,"allow-skip"],borderRadius:[2,"border-radius"],isLoading:[4,"is-loading"],errorMessage:[1,"error-message"],direction:[1],i18n:[16],provider:[1],type:[1],email:[32],isAudioProvider:[32]}],[1,"presto-action-bar-ui",{open:[4]}],[0,"presto-video",{getRef:[1040],autoplay:[4],src:[1],preload:[1],poster:[1],player:[8],tracks:[16],playsinline:[4],provider:[1],videoAttributes:[16]}],[0,"presto-youtube-subscribe-button",{channel:[1],layout:[1],showCount:[4,"show-count"]}],[1,"presto-player-spinner"],[1,"presto-player-button",{type:[513],size:[513],full:[516],disabled:[516],submit:[516],name:[1],value:[1],href:[1],target:[513],download:[1],hasFocus:[32],hasLabel:[32],hasPrefix:[32],hasSuffix:[32]}]]]],e)));
|
dist/settings/admin-8ab815a4.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["webpack:///external [\"wp\",\"i18n\"]","webpack:///external [\"wp\",\"components\"]","webpack:///external [\"wp\",\"notices\"]","webpack:///external [\"wp\",\"compose\"]","webpack:///external [\"wp\",\"coreData\"]","webpack:///external [\"wp\",\"apiFetch\"]","webpack:///./src/admin/settings/entities.js","webpack:///./src/router/utils.js","webpack:///./src/router/context.js","webpack:///./src/router/route.js","webpack:///./src/router/link.js","webpack:///./src/router/index.js","webpack:///./src/admin/settings/routes.js","webpack:///./src/admin/settings/components/SaveButton.js","webpack:///./src/admin/settings/components/Notices.js","webpack:///./src/hooks/useSave.js","webpack:///./src/admin/settings/components/Disabled.js","webpack:///./src/admin/settings/components/Group.js","webpack:///./src/admin/settings/components/Media.js","webpack:///./src/admin/settings/components/Page.js","webpack:///./src/admin/settings/components/CodeMirror.js","webpack:///./src/admin/settings/pages/General.js","webpack:///./src/admin/settings/pages/Performance.js","webpack:///./src/admin/settings/pages/parts/BunnyClassic/index.js","webpack:///./src/admin/settings/pages/parts/BunnyStream/PublicStream.js","webpack:///./src/admin/settings/pages/parts/BunnyStream/PrivateStream.js","webpack:///./src/admin/settings/pages/parts/BunnyStream/index.js","webpack:///./src/admin/settings/pages/parts/EmailExport.js","webpack:///./src/admin/settings/components/CTA.js","webpack:///./src/admin/settings/components/Integration.js","webpack:///./src/admin/settings/components/TextControl.js","webpack:///./src/admin/settings/pages/parts/integration/withIntegration.js","webpack:///./src/admin/settings/pages/parts/integration/ActiveCampaign.js","webpack:///./src/admin/settings/pages/parts/integration/FluentCRM.js","webpack:///./src/admin/settings/pages/parts/integration/Mailchimp.js","webpack:///./src/admin/settings/pages/parts/integration/MailerLite.js","webpack:///./src/admin/settings/pages/parts/Webhooks/Headers.js","webpack:///./src/admin/settings/pages/parts/Webhooks/NewWebhook.js","webpack:///./src/admin/settings/pages/parts/Webhooks/Webhook.js","webpack:///./src/admin/settings/pages/parts/Webhooks/index.js","webpack:///./src/admin/settings/pages/Integrations.js","webpack:///./src/admin/settings/app.js","webpack:///./src/admin/settings/index.js","webpack:///external [\"wp\",\"data\"]","webpack:///external [\"wp\",\"element\"]"],"names":["module","exports","window","dispatch","coreStore","addEntities","name","kind","label","__","baseURL","baseURLParams","context","locationToRoute","location","path","pathname","hash","query","qs","parse","search","history","createBrowserHistory","RouterContext","wp","element","createContext","route","useContext","prev","Route","onRoute","children","matched","match","checkMatch","substr","cloneElement","Link","props","to","onClick","activeClassName","state","className","classNames","e","preventDefault","push","Router","setState","routes","Object","keys","map","key","unlisten","listen","handleRouteChange","defaultRoute","this","NotFound","forEach","isMatched","data","routerContextValue","is404","Provider","value","Component","general","integrations","performance","SaveButton","onSave","busy","loading","rest","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","filter","r","isDirty","length","isSaving","some","record","disabled","ScSkeleton","style","width","height","display","isPrimary","aria-disabled","isBusy","undefined","notices","noticesStore","getNotices","removeNotice","useDispatch","snackbarNotices","type","onRemove","useSave","saveEditedEntityRecord","save","a","dirtyRecords","pendingSavedRecords","throwOnError","Promise","all","message","i18n","useState","components","Modal","Button","dialog","setDialog","title","onRequestClose","heading","href","link","target","Card","CardBody","CardFooter","description","hideSaveButton","createSuccessNotice","createErrorNotice","console","error","Disabled","size","marginBottom","isShady","BaseControl","MediaUpload","mediaUtils","option","help","allowedTypes","maxWidth","onSelect","VisualLabel","border","src","render","open","isSecondary","id","hidden","sprintf","isTertiary","onChange","handleChange","instance","textRef","current","useRef","useEffect","CodeMirror","fromTextArea","lineNumbers","on","css","ref","rows","prestoPlayer","isPremium","presetArgs","audioPresetArgs","presets","getEntityRecords","loadingPresets","isResolving","audioPresets","loadingAudioPresets","useEntityProp","presetSettings","setPresetSettings","audioPresetSettings","setAudioPresetSettings","analytics","setAnalytics","updateAnalytics","branding","setBranding","updateBranding","uninstall","setUninstall","Page","Group","Media","image","logo","url","logo_width","min","max","onChangeComplete","color","hex","checked","enable","purge_data","default_player_preset","options","preset","player_css","uninstall_data","confirm","setPerformance","updatePerformance","module_enabled","status","isDismissible","automations","classic","setClassic","updateClassic","public_id","public_hostname","private_id","private_hostname","private_security_key","marginTop","fontSize","stream","setStream","updateStream","video_library_api_key","pull_zone_url","video_library_id","token_auth_key","PublicStream","PrivateStream","Panel","PanelBody","Flex","FlexBlock","Notice","Spinner","step","setStep","progress","setProgress","setError","setURL","exportEmails","apiFetch","method","percentage","currentStep","fetchedURL","initialOpen","align","justify","alignItems","optionName","isBorderless","button","text","FlexItem","PanelRow","connected","onConnect","connectButtonText","disconnectButtonText","onDisconnect","setConfirm","isSmall","marginRight","onSubmit","isDestructive","TextControl","placeholder","updateSetting","createHigherOrderComponent","WrappedComponent","success","setSuccess","setIsBusy","setting","setSetting","makeRequest","response","compose","withIntegration","setData","Integration","api_key","headers","setHeaders","updateHeader","index","item","i","icon","_","removeHeader","header","onClose","webhook","saveEntityRecord","setBusy","email_name","form","setForm","updateForm","submit","archived","shouldCloseOnClickOutside","required","autoFocus","margin","Headers","incomingWebhook","setOpen","deleteEntityRecord","queryArgs","getEditedEntityRecord","isDeletingEntityRecord","isDeleting","deleteWebhook","NewWebhook","webhooks","Webhook","semverCompare","require","editBunny","setEditBunny","youtube","setYoutube","updateYoutube","use_existing_tag","measurement_id","nocookie","channel_id","proVersion","ActiveCampaign","FluentCRM","Mailchimp","MailerLite","Webhooks","EmailExport","isSetup","bunny","hls_start_level","disable_legacy_storage","BunnyStream","BunnyClassic","CTA","App","loaded","setLoaded","onhashchange","scrollTo","hasFinishedResolution","role","aria-orientation","General","Integrations","Performance","Notices","document","getElementById"],"mappings":"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","file":"settings/admin-8ab815a4.js","sourcesContent":["(function() { module.exports = window[\"wp\"][\"i18n\"]; }());","(function() { module.exports = window[\"wp\"][\"components\"]; }());","(function() { module.exports = window[\"wp\"][\"notices\"]; }());","(function() { module.exports = window[\"wp\"][\"compose\"]; }());","(function() { module.exports = window[\"wp\"][\"coreData\"]; }());","(function() { module.exports = window[\"wp\"][\"apiFetch\"]; }());","import { store as coreStore } from \"@wordpress/core-data\";\nimport { dispatch } from \"@wordpress/data\";\nimport { __ } from \"@wordpress/i18n\";\n\ndispatch(coreStore).addEntities([\n {\n name: \"preset\",\n kind: \"presto-player\",\n label: __(\"Presets\", \"presto-player\"),\n baseURL: \"presto-player/v1/preset\",\n baseURLParams: { context: \"edit\" },\n },\n {\n name: \"audio-preset\",\n kind: \"presto-player\",\n label: __(\"Audio Presets\", \"presto-player\"),\n baseURL: \"presto-player/v1/audio-preset\",\n baseURLParams: { context: \"edit\" },\n },\n {\n name: \"webhook\",\n kind: \"presto-player\",\n label: __(\"Webhook\", \"presto-player\"),\n baseURL: \"presto-player/v1/webhook\",\n baseURLParams: { context: \"edit\" },\n },\n]);\n","import qs from \"querystringify\";\nexport function locationToRoute(location) {\n // location comes from the history package\n return {\n path: location.pathname,\n hash: location.hash,\n query: qs.parse(location.search),\n };\n}\n","import { createBrowserHistory } from \"history\";\nimport { locationToRoute } from \"./utils\";\n\nexport const history = createBrowserHistory();\nexport const RouterContext = wp.element.createContext({\n route: locationToRoute(history.location),\n});\n","import { RouterContext } from \"./context\";\nconst { useContext } = wp.element;\nimport { match } from \"path-to-regexp\";\nlet prev = \"\";\n\nexport function Route({ path, onRoute, children }) {\n // Extract route from RouterContext\n const { route } = useContext(RouterContext);\n\n const checkMatch = match(`${path}`);\n const matched = checkMatch(`${route.hash.substr(1)}`);\n\n if (!matched) {\n return null;\n }\n\n if (onRoute) {\n if (prev !== matched.path) {\n onRoute();\n }\n prev = matched.path;\n }\n\n return <div>{wp.element.cloneElement(children, { route: matched })}</div>;\n}\n","const { useContext } = wp.element;\nimport { RouterContext, history } from \"./context\";\nimport classNames from \"classnames\";\nimport { match } from \"path-to-regexp\";\n\nexport function Link(props) {\n const { to, onClick, children, activeClassName } = props;\n const { route } = useContext(RouterContext);\n\n let state = { ...props };\n delete state.activeClassName;\n\n const isActive = () => {\n const checkMatch = match(`${to}`);\n return checkMatch(`${route.hash.substr(1)}`);\n };\n\n const handleClick = (e) => {\n e.preventDefault();\n // Dont' navigate if current path\n if (route.path === to) {\n return;\n }\n // Trigger onClick prop manually\n if (onClick) {\n onClick(e);\n }\n const { search } = history.location;\n\n // Use history API to navigate page\n history.push(`${search}#${to}`);\n };\n\n return (\n <a\n {...state}\n className={classNames({ [activeClassName]: isActive() }, props.className)}\n onClick={handleClick}\n >\n {children}\n </a>\n );\n}\n","import { Component } from \"@wordpress/element\";\nimport { locationToRoute } from \"./utils\";\nimport { history, RouterContext } from \"./context\";\nimport { Route } from \"./route\";\nimport { Link } from \"./link\";\nimport { match } from \"path-to-regexp\";\n\nclass Router extends Component {\n constructor(props) {\n super(props);\n\n // Convert our routes into an array for easy 404 checking\n this.routes = Object.keys(props.routes).map(\n (key) => props.routes[key].path\n );\n\n // Listen for path changes from the history API\n this.unlisten = history.listen(this.handleRouteChange);\n\n const route = locationToRoute(history.location);\n const { search } = history.location;\n\n // Define the initial RouterContext value\n this.state = {\n route,\n defaultRoute: props?.defaultRoute\n ? `${search}#${props?.defaultRoute}`\n : `${search}#/`,\n };\n }\n\n componentWillUnmount() {\n // Stop listening for changes if the Router component unmounts\n this.unlisten();\n }\n\n handleRouteChange = (location) => {\n const route = locationToRoute(location?.location);\n this.setState({ route: route });\n };\n\n render() {\n // Define our variables\n const { children, NotFound } = this.props;\n const { route, defaultRoute } = this.state;\n\n if (!route.hash) {\n history.push(defaultRoute);\n return <div></div>;\n }\n\n let matched = false;\n // match route\n (this.routes || []).forEach((name) => {\n const checkMatch = match(route.hash.substr(1));\n const isMatched = checkMatch(`${route.hash.substr(1)}`);\n if (!isMatched) {\n return;\n }\n matched = {\n name,\n data: isMatched,\n };\n });\n\n const routerContextValue = { route, matched };\n\n // Check if 404 if no route matched\n const is404 = !matched;\n\n return (\n <RouterContext.Provider value={routerContextValue}>\n {is404 ? <div>Not found</div> : children}\n </RouterContext.Provider>\n );\n }\n}\nexport { history, RouterContext, Router, Route, Link };\n","export const routes = {\n general: {\n path: \"general\",\n },\n integrations: {\n path: \"/integrations\",\n },\n performance: {\n path: \"/performance\",\n },\n};\n","/**\n * WordPress dependencies\n */\nimport { useSelect } from \"@wordpress/data\";\nimport { __ } from \"@wordpress/i18n\";\nimport { store as coreStore } from \"@wordpress/core-data\";\nimport { Button } from \"@wordpress/components\";\n\nexport default function SaveButton({\n onSave,\n children,\n busy,\n loading,\n ...rest\n}) {\n const { isDirty, isSaving } = useSelect((select) => {\n const {\n __experimentalGetDirtyEntityRecords,\n isSavingEntityRecord,\n } = select(coreStore);\n\n const dirtyEntityRecords = (\n __experimentalGetDirtyEntityRecords() || []\n ).filter((r) => r.name !== \"webhook\");\n\n return {\n isDirty: dirtyEntityRecords.length > 0,\n isSaving: dirtyEntityRecords.some((record) =>\n isSavingEntityRecord(record.kind, record.name, record.key)\n ),\n };\n }, []);\n\n const disabled = !isDirty || isSaving;\n\n if (loading) {\n return (\n <ScSkeleton\n style={{\n width: \"120px\",\n height: \"35px\",\n display: \"inline-block\",\n }}\n ></ScSkeleton>\n );\n }\n\n return (\n <Button\n isPrimary\n aria-disabled={disabled}\n disabled={disabled || isSaving || busy}\n isBusy={isSaving || busy}\n onClick={disabled ? undefined : onSave}\n {...rest}\n >\n {children}\n </Button>\n );\n}\n","import { SnackbarList } from \"@wordpress/components\";\nimport { useDispatch, useSelect } from \"@wordpress/data\";\n\nimport { store as noticesStore } from \"@wordpress/notices\";\n\nexport default ({ className }) => {\n const notices = useSelect((select) => select(noticesStore).getNotices());\n const { removeNotice } = useDispatch(noticesStore);\n const snackbarNotices = notices.filter(({ type }) => type === \"snackbar\");\n\n return (\n <SnackbarList\n notices={snackbarNotices}\n className={className}\n onRemove={removeNotice}\n />\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { select, useDispatch } from \"@wordpress/data\";\nimport { store as coreStore } from \"@wordpress/core-data\";\n\nexport default function useSave() {\n const { saveEditedEntityRecord } = useDispatch(coreStore);\n\n /**\n * Handle the form submission\n */\n const save = async () => {\n // build up pending records to save.\n const dirtyRecords = select(\n coreStore\n ).__experimentalGetDirtyEntityRecords();\n const pendingSavedRecords = [];\n\n dirtyRecords.forEach(({ kind, name, key }) => {\n pendingSavedRecords.push(\n saveEditedEntityRecord(kind, name, key, {\n throwOnError: true,\n })\n );\n });\n\n // check values.\n const values = await Promise.all(pendingSavedRecords);\n if (values.some((value) => typeof value === \"undefined\")) {\n throw { message: \"Saving failed.\" };\n }\n\n return true;\n };\n\n return {\n save,\n };\n}\n","const { __ } = wp.i18n;\nconst { useState } = wp.element;\nconst { Modal, Button } = wp.components;\n\nexport default ({ children, disabled }) => {\n const [dialog, setDialog] = useState(false);\n\n if (!disabled) {\n return <div>{children}</div>;\n }\n\n return (\n <div>\n <div\n className=\"presto-options__disabled-overlay\"\n onClick={(e) => {\n setDialog(true);\n e.preventDefault();\n return false;\n }}\n >\n <div>{children}</div>\n </div>\n {!!dialog && (\n <Modal title={disabled?.title} onRequestClose={() => setDialog(false)}>\n <h2>{disabled?.heading}</h2>\n <p>{disabled?.message}</p>\n <Button href={disabled?.link} target=\"_blank\" isPrimary>\n {__(\"Learn More\", \"presto-player\")}\n </Button>\n </Modal>\n )}\n </div>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nconst { Card, CardBody, CardFooter } = wp.components;\nimport SaveButton from \"./SaveButton\";\nimport { useDispatch } from \"@wordpress/data\";\nimport { store as noticesStore } from \"@wordpress/notices\";\nimport Disabled from \"./Disabled\";\nimport useSave from \"../../../hooks/useSave\";\n\nexport default ({ title, description, children, disabled, hideSaveButton }) => {\n const { save } = useSave();\n const { createSuccessNotice, createErrorNotice } = useDispatch(noticesStore);\n\n /**\n * Form is submitted.\n */\n const onSave = async () => {\n try {\n await save();\n createSuccessNotice(__(\"Settings Updated\", \"presto-player\"), {\n type: \"snackbar\",\n });\n } catch (e) {\n console.error(e);\n createErrorNotice(\n e?.message || __(\"Something went wrong\", \"presto-player\")\n );\n }\n };\n\n return (\n <Disabled disabled={disabled}>\n <Card size=\"large\" className=\"presto-options__card\">\n <CardBody className={`presto-options__card-body`}>\n <div className=\"presto-flow\" style={{ \"--presto-flow-space\": \"2em\" }}>\n <div\n className=\"presto-flow\"\n style={{ \"--presto-flow-space\": \"1em\" }}\n >\n {title && (\n <h2 style={{ marginBottom: 0 }}>\n {title}{\" \"}\n {!!disabled && (\n <div className=\"presto-options__pro-badge\">Pro</div>\n )}\n </h2>\n )}\n {description && <p>{description}</p>}\n </div>\n <div>{children}</div>\n </div>\n </CardBody>\n {!hideSaveButton ? (\n <CardFooter isShady>\n <div>\n <SaveButton onSave={onSave}>{__(\"Update Settings\")}</SaveButton>\n </div>\n </CardFooter>\n ) : (\n <br />\n )}\n </Card>\n </Disabled>\n );\n};\n","const { __ } = wp.i18n;\n\nconst { Button, BaseControl } = wp.components;\nconst { MediaUpload } = wp.mediaUtils;\nconst { dispatch } = wp.data;\nimport classNames from \"classnames\";\n\nexport default ({\n option,\n label,\n help,\n allowedTypes,\n value,\n className,\n maxWidth,\n onSelect,\n}) => {\n return (\n <div\n className={classNames(\n className,\n \"presto-settings__setting is-media-control\"\n )}\n >\n <BaseControl className=\"editor-video-poster-control\">\n <BaseControl.VisualLabel>{label}</BaseControl.VisualLabel>\n {value && (\n <BaseControl>\n <img\n style={{\n maxWidth,\n border: \"1px solid #dcdcdc\",\n }}\n src={value}\n />\n </BaseControl>\n )}\n <br />\n <MediaUpload\n title={help}\n onSelect={onSelect}\n allowedTypes={allowedTypes}\n render={({ open }) => (\n <Button\n isSecondary\n onClick={open}\n className={!value ? \"button-select\" : \"button-replace\"}\n >\n {!value\n ? __(\"Select\", \"presto-player\")\n : __(\"Replace\", \"presto-player\")}\n </Button>\n )}\n />{\" \"}\n <p id={`video-block__logo-image-description-${option?.id}`} hidden>\n {value\n ? sprintf(\n /* translators: %s: poster image URL. */\n __(\"The current logo image url is %s\", \"presto-player\"),\n value\n )\n : __(\"There is no logo image currently selected\", \"presto-player\")}\n </p>\n {!!value && (\n <Button onClick={() => onSelect(\"\")} isTertiary>\n {__(\"Remove\", \"presto-player\")}\n </Button>\n )}\n </BaseControl>\n <br />\n </div>\n );\n};\n","export default ({ children, title, description }) => {\n return (\n <div className=\"presto-flow presto-settings__page\">\n <div className=\"presto-flow\" style={{ \"--presto-flow-space\": \"1em\" }}>\n {title && <h1>{title}</h1>}\n {description && <p>{description}</p>}\n </div>\n\n <div className=\"presto-settings__body \">\n <div className=\"presto-flow\">{children}</div>\n </div>\n </div>\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\nimport { BaseControl } from \"@wordpress/components\";\nimport { useEffect, useRef } from \"@wordpress/element\";\nimport classNames from \"classnames\";\n\nexport default ({ option, value, className, disabled, onChange }) => {\n let codeMirror;\n\n const handleChange = (instance) => {\n if (disabled) {\n return;\n }\n instance.save();\n onChange(textRef.current.value);\n };\n\n const textRef = useRef();\n useEffect(() => {\n if (!wp?.CodeMirror) {\n return;\n }\n codeMirror = wp.CodeMirror.fromTextArea(textRef.current, {\n type: \"text/css\",\n lineNumbers: true,\n });\n\n codeMirror.on(\"change\", handleChange);\n }, []);\n\n return (\n <div className={classNames(className, \"presto-settings__setting\")}>\n <BaseControl\n css={css`\n .CodeMirror {\n height: 200px;\n border: 1px solid #e3e3e3;\n border-radius: 4px;\n }\n `}\n label={option?.name}\n help={option?.help}\n >\n <textarea onChange={handleChange} ref={textRef} rows=\"5\" disabled>\n {value}\n </textarea>\n </BaseControl>\n </div>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { useEntityProp, store as coreStore } from \"@wordpress/core-data\";\nimport { useSelect } from \"@wordpress/data\";\nimport {\n ColorPicker,\n ComboboxControl,\n ToggleControl,\n RangeControl,\n Spinner,\n} from \"@wordpress/components\";\nimport Disabled from \"../components/Disabled\";\nimport Group from \"../components/Group\";\nimport Media from \"../components/Media\";\nimport Page from \"../components/Page\";\nimport CodeMirror from \"../components/CodeMirror\";\n\nexport default () => {\n const disabled = () => {\n if (prestoPlayer?.isPremium) {\n return false;\n }\n return {\n title: __(\"Pro Feature\", \"presto-player\"),\n heading: __(\"Unlock Presto Player Pro\", \"presto-player\"),\n message: __(\n \"Get this feature and more with the Pro version of Presto Player!\",\n \"presto-player\"\n ),\n link: \"https://prestoplayer.com\",\n };\n };\n\n const {\n presets,\n loadingPresets,\n audioPresets,\n loadingAudioPresets,\n } = useSelect((select) => {\n const presetArgs = [\"presto-player\", \"preset\"];\n const audioPresetArgs = [\"presto-player\", \"audio-preset\"];\n return {\n presets: select(coreStore).getEntityRecords(...presetArgs),\n loadingPresets: select(coreStore).isResolving(\n \"getEntityRecords\",\n presetArgs\n ),\n audioPresets: select(coreStore).getEntityRecords(...audioPresetArgs),\n loadingAudioPresets: select(coreStore).isResolving(\n \"getEntityRecords\",\n audioPresetArgs\n ),\n };\n }, []);\n\n const [presetSettings, setPresetSettings] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_presets\"\n );\n const updatePresetSettings = (data) => {\n setPresetSettings({\n ...(presetSettings || {}),\n ...data,\n });\n };\n\n const [audioPresetSettings, setAudioPresetSettings] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_audio_presets\"\n );\n const updateAudioPresetSettings = (data) => {\n setAudioPresetSettings({\n ...(audioPresetSettings || {}),\n ...data,\n });\n };\n\n const [analytics, setAnalytics] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_analytics\"\n );\n const updateAnalytics = (data) => {\n setAnalytics({\n ...(analytics || {}),\n ...data,\n });\n };\n\n const [branding, setBranding] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_branding\"\n );\n const updateBranding = (data) => {\n setBranding({\n ...(branding || {}),\n ...data,\n });\n };\n\n const [uninstall, setUninstall] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_uninstall\"\n );\n const updateUninstall = (data) => {\n setUninstall({\n ...(uninstall || {}),\n ...data,\n });\n };\n\n return (\n <Page\n title={__(\"General\", \"presto-player\")}\n description={__(\n \"Branding, analytics and uninstall data.\",\n \"presto-player\"\n )}\n >\n <Group\n title={__(\"Branding\", \"presto-player\")}\n description={__(\"Global player branding options\", \"presto-player\")}\n >\n <Disabled disabled={disabled()}>\n <Media\n className={\"presto-player__setting--logo\"}\n label={\n <>\n {__(\"Logo\", \"presto-player\")}{\" \"}\n {disabled() && (\n <span className=\"presto-options__pro-badge\">\n {__(\"Pro\", \"presto-player\")}\n </span>\n )}\n </>\n }\n onSelect={(image) => updateBranding({ logo: image?.url })}\n maxWidth={branding?.logo_width || 150}\n value={branding?.logo}\n />\n\n <div style={{ maxWidth: \"500px\" }}>\n <RangeControl\n className={\"presto-player__setting--logo-width\"}\n label={__(\"Logo Max Width\", \"presto-player\")}\n value={branding?.logo_width || 150}\n onChange={(logo_width) => updateBranding({ logo_width })}\n min={1}\n max={400}\n />\n </div>\n </Disabled>\n <ColorPicker\n className={\"presto-player__setting--brand-color\"}\n onChangeComplete={(value) => updateBranding({ color: value.hex })}\n color={branding?.color}\n />\n </Group>\n <Group\n title={__(\"Analytics\", \"presto-player\")}\n disabled={disabled()}\n description={__(\n \"Analytics settings for media plays, watch times and more.\",\n \"presto-player\"\n )}\n >\n <div>\n <ToggleControl\n className={\"presto-player__setting--analytics-enable\"}\n label={__(\"Enable\", \"presto-player\")}\n help={__(\"Enable view analytics for your media\", \"presto-player\")}\n checked={analytics?.enable}\n onChange={(enable) => updateAnalytics({ enable })}\n />\n\n {!!analytics?.enable && (\n <ToggleControl\n label={__(\"Auto-Purge Data (recommended)\")}\n help={__(\n \"Automatically purge data older than 90 days.\",\n \"presto-player\"\n )}\n className={\"presto-player__setting--analytics-enable\"}\n checked={\n analytics?.purge_data !== undefined\n ? analytics?.purge_data\n : true\n }\n onChange={(purge_data) => updateAnalytics({ purge_data })}\n />\n )}\n </div>\n </Group>\n <Group\n title={__(\"Presets\", \"presto-player\")}\n disabled={disabled()}\n description={__(\"Media presets settings.\", \"presto-player\")}\n >\n {!!loadingPresets ? (\n <Spinner />\n ) : (\n <ComboboxControl\n label={__(\"Select default preset for video.\", \"presto-player\")}\n value={presetSettings?.default_player_preset}\n options={(presets || []).map((preset) => {\n return {\n value: preset?.id,\n label: preset?.name,\n };\n })}\n onChange={(default_player_preset) =>\n updatePresetSettings({\n default_player_preset: default_player_preset || 1,\n })\n }\n />\n )}\n\n {!!loadingAudioPresets ? (\n <Spinner />\n ) : (\n <ComboboxControl\n label={__(\"Select default preset for audio.\", \"presto-player\")}\n value={audioPresetSettings?.default_player_preset}\n options={(audioPresets || []).map((preset) => {\n return {\n value: preset?.id,\n label: preset?.name,\n };\n })}\n onChange={(default_player_preset) =>\n updateAudioPresetSettings({\n default_player_preset: default_player_preset || 1,\n })\n }\n />\n )}\n </Group>\n <Group\n disabled={disabled()}\n title={__(\"Custom CSS\", \"presto-player\")}\n description={__(\n \"Quickly add custom css to the player web component.\",\n \"presto-player\"\n )}\n >\n <CodeMirror\n disabled={!prestoPlayer?.isPremium}\n option={{ id: \"player_css\" }}\n value={branding?.player_css}\n key={branding?.player_css}\n onChange={(player_css) => updateBranding({ player_css })}\n />\n </Group>\n <Group\n title={__(\"Uninstall Options\", \"presto-player\")}\n description={__(\n \"Options to remove data on uninstall.\",\n \"presto-player\"\n )}\n >\n <ToggleControl\n label={__(\"Remove data on uninstall\")}\n help={__(\"This removes all data on uninstall.\", \"presto-player\")}\n className=\"presto-player__setting--uninstall\"\n checked={uninstall?.uninstall_data}\n onChange={(uninstall_data) => {\n if (uninstall_data) {\n const r = confirm(\n __(\n \"Caution: Data Loss. Are you sure you want to remove all the data from this plugin? This is irreversible!\",\n \"presto-player\"\n )\n );\n if (!r) return;\n }\n updateUninstall({ uninstall_data });\n }}\n />\n </Group>\n </Page>\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\n\nimport { __ } from \"@wordpress/i18n\";\nimport { Notice, ExternalLink, ToggleControl } from \"@wordpress/components\";\nimport { useEntityProp } from \"@wordpress/core-data\";\n\nimport Group from \"../components/Group\";\nimport Page from \"../components/Page\";\n\nexport default () => {\n const [performance, setPerformance] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_performance\"\n );\n const updatePerformance = (data) => {\n setPerformance({\n ...(performance || {}),\n ...data,\n });\n };\n\n return (\n <Page\n title={__(\"Performance\", \"presto-player\")}\n description={__(\"Player performance preferences.\", \"presto-player\")}\n >\n <Group\n title={__(\"Performance\", \"presto-player\")}\n description={__(\n \"Performance options for player loading.\",\n \"presto-player\"\n )}\n >\n <div>\n <ToggleControl\n className={\"presto-player__setting--module-enabled\"}\n label={__(\"Dynamically Load JavaScript\", \"presto-player\")}\n help={__(\n \"Dynamically load javascript modules on the page which can significantly reduce javascript size and increase performance.\",\n \"presto-player\"\n )}\n checked={performance?.module_enabled}\n onChange={(module_enabled) => updatePerformance({ module_enabled })}\n />\n\n {!!performance?.module_enabled && (\n <Notice\n css={css`\n background: #f3f4f5 !important;\n margin-bottom: 20px !important;\n `}\n className=\"presto-notice\"\n status=\"info\"\n isDismissible={false}\n >\n <div>\n <strong>{__(\"Please Note\", \"presto-player\")}</strong>\n </div>\n <div>\n {__(\n \"You may need to exclude the player script from combining, as well as enable CORS requests for some CDNs.\",\n \"presto-player\"\n )}{\" \"}\n <ExternalLink href=\"https://prestoplayer.com/docs/performance-preferences-explained#global-player-performance-setting\">\n {__(\"Learn More\", \"presto-player\")}\n </ExternalLink>\n </div>\n </Notice>\n )}\n </div>\n\n <ToggleControl\n className={\"presto-player__setting--automations\"}\n label={__(\n \"Enable Ajax Requests for Progress Integrations\",\n \"presto-player\"\n )}\n help={__(\n \"Keep this on unless you do not plan on using automation, LMS or membership integrations.\",\n \"presto-player\"\n )}\n checked={performance?.automations}\n onChange={(automations) => updatePerformance({ automations })}\n />\n </Group>\n </Page>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { TextControl } from \"@wordpress/components\";\nimport { useEntityProp } from \"@wordpress/core-data\";\n\nexport default () => {\n const [classic, setClassic] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_bunny_pull_zones\"\n );\n const updateClassic = (data) => {\n setClassic({\n ...(classic || {}),\n ...data,\n });\n };\n\n const {\n public_id,\n public_hostname,\n private_id,\n private_hostname,\n private_security_key,\n } = classic || {};\n\n return (\n <>\n <h2 style={{ marginTop: \"40px\" }}>\n {__(\"Bunny.net Storage (Classic)\", \"presto-player\")}\n </h2>\n <p style={{ fontSize: \"12px\", color: \"#757575\" }}>\n {__(\n 'Note: To Change your API key, please click \"Reconnect\" from a bunny block.',\n \"presto-player\"\n )}\n </p>\n\n <TextControl\n label={__(\"Public ID\", \"presto-player\")}\n help={__(\"The ID of the public pull zone to use.\", \"presto-player\")}\n value={public_id}\n onChange={(public_id) => updateClassic({ public_id })}\n />\n\n <TextControl\n label={__(\"Public Host Name\", \"presto-player\")}\n help={__(\"The hostname to use for this pullzone.\", \"presto-player\")}\n value={public_hostname}\n onChange={(public_hostname) => updateClassic({ public_hostname })}\n />\n\n <TextControl\n label={__(\"Private ID\", \"presto-player\")}\n help={__(\"The ID of the private pull zone to use.\", \"presto-player\")}\n value={private_id}\n onChange={(private_id) => updateClassic({ private_id })}\n />\n\n <TextControl\n label={__(\"Private Host Name\", \"presto-player\")}\n help={__(\n \"The hostname to use for the private pullzone.\",\n \"presto-player\"\n )}\n value={private_hostname}\n onChange={(private_hostname) => updateClassic({ private_hostname })}\n />\n\n <TextControl\n label={__(\"Private Url Token Authentication Key\", \"presto-player\")}\n help={__(\n \"Update the security token used to sign private urls.\",\n \"presto-player\"\n )}\n type=\"password\"\n value={private_security_key}\n onChange={(private_security_key) =>\n updateClassic({ private_security_key })\n }\n />\n </>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { TextControl } from \"@wordpress/components\";\nimport { useEntityProp } from \"@wordpress/core-data\";\n\nexport default () => {\n const [stream, setStream] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_bunny_stream_public\"\n );\n const updateStream = (data) => {\n setStream({\n ...(stream || {}),\n ...data,\n });\n };\n\n const { video_library_api_key, pull_zone_url, video_library_id } =\n stream || {};\n\n return (\n <>\n <TextControl\n label={__(\"Public Stream Library ID\", \"presto-player\")}\n help={__(\"The ID of the video library to use.\", \"presto-player\")}\n value={video_library_id}\n onChange={(video_library_id) => updateStream({ video_library_id })}\n />\n\n <TextControl\n label={__(\"Public Stream Library API Key\", \"presto-player\")}\n help={__(\n \"The API key for the above video library for read/write access.\",\n \"presto-player\"\n )}\n value={video_library_api_key}\n onChange={(video_library_api_key) =>\n updateStream({ video_library_api_key })\n }\n />\n\n <TextControl\n label={__(\"Public Stream CDN Hostname\", \"presto-player\")}\n help={__(\n \"The public cdn hostname for the video library.\",\n \"presto-player\"\n )}\n value={pull_zone_url}\n onChange={(pull_zone_url) => updateStream({ pull_zone_url })}\n />\n </>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { TextControl } from \"@wordpress/components\";\nimport { useEntityProp } from \"@wordpress/core-data\";\n\nexport default () => {\n const [stream, setStream] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_bunny_stream_private\"\n );\n const updateStream = (data) => {\n setStream({\n ...(stream || {}),\n ...data,\n });\n };\n\n const {\n video_library_api_key,\n pull_zone_url,\n video_library_id,\n token_auth_key,\n } = stream || {};\n\n return (\n <>\n <TextControl\n label={__(\"Private Stream Library ID\", \"presto-player\")}\n help={__(\"The ID of the video library to use.\", \"presto-player\")}\n value={video_library_id}\n onChange={(video_library_id) => updateStream({ video_library_id })}\n />\n\n <TextControl\n label={__(\"Private Stream Library API Key\", \"presto-player\")}\n help={__(\n \"The API key for the above video library for read/write access.\",\n \"presto-player\"\n )}\n value={video_library_api_key}\n onChange={(video_library_api_key) =>\n updateStream({ video_library_api_key })\n }\n />\n\n <TextControl\n label={__(\"Private Stream CDN Hostname\", \"presto-player\")}\n help={__(\n \"The public cdn hostname for the video library.\",\n \"presto-player\"\n )}\n value={pull_zone_url}\n onChange={(pull_zone_url) => updateStream({ pull_zone_url })}\n />\n\n <TextControl\n label={__(\"Private Stream Token Authentication Key\", \"presto-player\")}\n help={__(\n \"The token authentication key used to sign private urls.\",\n \"presto-player\"\n )}\n value={token_auth_key}\n onChange={(token_auth_key) => updateStream({ token_auth_key })}\n />\n </>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { useEntityProp } from \"@wordpress/core-data\";\nimport PublicStream from \"./PublicStream\";\nimport PrivateStream from \"./PrivateStream\";\n\nexport default () => {\n const [stream, setStream] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_bunny_stream_public\"\n );\n\n if (!stream) return null;\n\n return (\n <>\n <h2 style={{ marginTop: \"40px\" }}>\n {__(\"Bunny.net Stream\", \"presto-player\")}\n </h2>\n <PublicStream />\n <PrivateStream />\n </>\n );\n};\n","const { __ } = wp.i18n;\nconst {\n Button,\n Panel,\n PanelBody,\n Flex,\n FlexBlock,\n Notice,\n Spinner,\n} = wp.components;\nconst { useState, useEffect } = wp.element;\n\nexport default () => {\n const [step, setStep] = useState(0);\n const [progress, setProgress] = useState(0);\n const [error, setError] = useState(\"\");\n const [url, setURL] = useState(0);\n\n const exportEmails = async () => {\n setError(\"\");\n try {\n const {\n percentage,\n step: currentStep,\n url: fetchedURL,\n } = await wp.apiFetch({\n path: \"/presto-player/v1/email/export\",\n method: \"post\",\n data: {\n step,\n },\n });\n\n setStep(currentStep);\n setProgress(percentage);\n setURL(fetchedURL);\n } catch (e) {\n setProgress(0);\n setError(e?.message || __(\"Something went wrong\", \"presto-player\"));\n }\n };\n\n useEffect(() => {\n if (step && step != \"done\") {\n exportEmails();\n }\n }, [step]);\n\n useEffect(() => {\n if (url) {\n window.open(url);\n }\n }, [url]);\n\n return (\n <Panel>\n <PanelBody\n title={\n <Flex>\n <FlexBlock>{__(\"Other\", \"presto-player\")}</FlexBlock>\n </Flex>\n }\n initialOpen={false}\n >\n <h2>{__(\"Manual Export\", \"presto-player\")}</h2>\n <p>\n {__(\n \"Using a service not listed here? You can export contacts and manually upload them to a service.\",\n \"presto-player\"\n )}\n </p>\n {error && (\n <Notice\n className=\"presto-notice\"\n status=\"error\"\n onRemove={() => setError(\"\")}\n >\n {error}\n </Notice>\n )}\n <Flex align=\"center\" justify=\"flex-start\">\n <Button\n isPrimary\n onClick={(e) => {\n setStep(1);\n setProgress(1);\n e.preventDefault();\n }}\n >\n {__(\"Download CSV File\", \"presto-player\")}\n </Button>\n {!!progress && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <Spinner style={{ marginTop: 0 }} />\n <span>Exporting... {progress}% Complete</span>\n </div>\n )}\n </Flex>\n </PanelBody>\n </Panel>\n );\n};\n","const { Button, Card, CardBody } = wp.components;\nconst { dispatch } = wp.data;\n\nexport default ({ option, value, optionName, className }) => {\n return (\n <Card isBorderless className={className}>\n <CardBody isShady>\n {!!option?.name && <h2>{option.name}</h2>}\n {!!option.help && <p>{option.help}</p>}\n {!!option?.button?.text && (\n <Button\n isPrimary\n target={option?.button?.target}\n href={option?.button?.link}\n >\n {option.button.text}\n </Button>\n )}\n </CardBody>\n </Card>\n );\n};\n","const { __ } = wp.i18n;\n\nconst {\n Button,\n Panel,\n PanelBody,\n Flex,\n Modal,\n FlexBlock,\n FlexItem,\n PanelRow,\n} = wp.components;\n\nconst { useState } = wp.element;\n\nexport default ({\n connected,\n title,\n children,\n onConnect,\n isBusy,\n connectButtonText,\n disconnectButtonText,\n onDisconnect,\n}) => {\n const [confirm, setConfirm] = useState(false);\n\n return (\n <Panel>\n <PanelBody\n title={\n <Flex>\n <FlexBlock>{title}</FlexBlock>\n <FlexItem>\n {connected ? (\n <Button isSmall isPrimary style={{ marginRight: \"30px\" }}>\n {__(\"Connected\", \"presto-player\")}\n </Button>\n ) : (\n <Button isSmall isSecondary style={{ marginRight: \"30px\" }}>\n {__(\"Not Connected\", \"presto-player\")}\n </Button>\n )}\n </FlexItem>\n </Flex>\n }\n initialOpen={false}\n >\n <form\n onSubmit={(e) => {\n e.preventDefault();\n onConnect();\n }}\n disabled={isBusy}\n >\n {children}\n <PanelRow>\n <div>\n {!connected ? (\n <Button\n isPrimary\n isBusy={isBusy}\n disabled={isBusy}\n type=\"submit\"\n >\n {connectButtonText\n ? connectButtonText\n : __(\"Connect\", \"presto-player\")}\n </Button>\n ) : (\n <div>\n {\" \"}\n <Button\n isSecondary\n isBusy={isBusy}\n disabled={isBusy}\n onClick={(e) => {\n e.preventDefault();\n setConfirm(true);\n }}\n >\n {disconnectButtonText\n ? disconnectButtonText\n : __(\"Disconnect\", \"presto-player\")}\n </Button>\n </div>\n )}\n </div>\n </PanelRow>\n </form>\n </PanelBody>\n\n {confirm && (\n <Modal\n className=\"presto-player__modal-confirm\"\n title={__(\"Are you sure?\", \"presto-player\")}\n style={{ \"max-width\": \"350px\" }}\n onRequestClose={() => setConfirm(false)}\n >\n <p>\n {__(\n \"Are you sure you want to disconnect this integration?\",\n \"presto-player\"\n )}\n </p>\n <Button\n className=\"presto-player__modal-confirm-button\"\n isDestructive\n onClick={() => {\n onDisconnect && onDisconnect();\n setConfirm(false);\n }}\n >\n {__(\"Disconnect\", \"presto-player\")}\n </Button>\n <Button onClick={() => setConfirm(false)}>\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n </Modal>\n )}\n </Panel>\n );\n};\n","const { TextControl } = wp.components;\nconst { dispatch } = wp.data;\nimport classNames from \"classnames\";\n\nexport default (props) => {\n const { option, value, optionName, className } = props;\n return (\n <div className=\"presto-settings__setting is-text-control\">\n <TextControl\n className={classNames(\n className,\n \"presto-settings__setting is-media-control\"\n )}\n label={option?.name}\n value={value}\n type={option?.type}\n help={option?.help}\n placeholder={option?.placeholder}\n onChange={(value) =>\n dispatch(\"presto-player/settings\").updateSetting(\n option.id,\n value,\n optionName\n )\n }\n {...props}\n />\n </div>\n );\n};\n","/**\n * WordPress dependencies\n */\nimport { __ } from \"@wordpress/i18n\";\nimport { useState } from \"@wordpress/element\";\nimport apiFetch from \"@wordpress/api-fetch\";\nimport { createHigherOrderComponent } from \"@wordpress/compose\";\nimport { useEntityProp } from \"@wordpress/core-data\";\n\n/**\n * Higher order component factory\n *\n * @return {Function} The higher order component.\n */\nexport default ({ name }) =>\n createHigherOrderComponent(\n (WrappedComponent) => (props) => {\n const [error, setError] = useState(\"\");\n const [success, setSuccess] = useState(\"\");\n const [isBusy, setIsBusy] = useState(false);\n\n const [setting, setSetting] = useEntityProp(\"root\", \"site\", name);\n const updateSetting = (data) => {\n setSetting({\n ...(setting || {}),\n ...data,\n });\n };\n\n const makeRequest = async ({\n path,\n data = {},\n message = __(\"Success\", \"presto-player\"),\n success,\n error,\n }) => {\n setError(\"\");\n setSuccess(\"\");\n setIsBusy(true);\n\n try {\n let response = await apiFetch({\n path,\n method: \"post\",\n data,\n });\n success && success(response);\n setSuccess(message);\n } catch (e) {\n if (e?.message) {\n setError(e.message);\n error && error(e);\n }\n } finally {\n setIsBusy(false);\n }\n };\n\n return (\n <WrappedComponent\n success={success}\n setSuccess={setSuccess}\n setError={setError}\n error={error}\n isBusy={isBusy}\n setting={setting}\n updateSetting={updateSetting}\n makeRequest={makeRequest}\n {...props}\n />\n );\n },\n \"withIntegration\"\n );\n","import { __ } from \"@wordpress/i18n\";\nimport { BaseControl, PanelRow, Notice } from \"@wordpress/components\";\nimport { compose } from \"@wordpress/compose\";\n\nimport Integration from \"../../../components/Integration\";\nimport TextControl from \"../../../components/TextControl\";\nimport withIntegration from \"./withIntegration\";\n\nexport default compose([\n withIntegration({ name: \"presto_player_activecampaign\" }),\n])(\n ({\n success,\n setSuccess,\n error,\n setError,\n isBusy,\n makeRequest,\n setting,\n updateSetting,\n }) => {\n const setData = (props) => {\n updateSetting({\n ...props,\n });\n };\n\n const onConnect = () => {\n makeRequest({\n path: \"/presto-player/v1/activecampaign/connect\",\n data: { api_key: setting?.api_key, url: setting?.url },\n message: __(\"Connected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n const onDisconnect = async () => {\n makeRequest({\n path: \"/presto-player/v1/activecampaign/disconnect\",\n message: __(\"Disconnected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n return (\n <Integration\n title={__(\"ActiveCampaign\")}\n connected={setting?.connected}\n onConnect={onConnect}\n onDisconnect={onDisconnect}\n isBusy={isBusy}\n >\n {error && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"error\"\n onRemove={() => setError(\"\")}\n >\n {error}\n </Notice>\n </PanelRow>\n )}\n {success && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"success\"\n onRemove={() => setSuccess(\"\")}\n >\n {success}\n </Notice>\n </PanelRow>\n )}\n <PanelRow>\n <BaseControl>\n <TextControl\n label={__(\"Your ActiveCampaign Url\", \"presto-player\")}\n type=\"url\"\n help={__(\n \"You can find this on your Settings > Developer page.\",\n \"presto-player\"\n )}\n value={setting?.url}\n onChange={(url) => updateSetting({ url })}\n />\n <TextControl\n label={__(\"Your ActiveCampaign API key\", \"presto-player\")}\n help={__(\n \"You can find this on your Settings > Developer page.\",\n \"presto-player\"\n )}\n value={setting?.api_key}\n onChange={(api_key) => updateSetting({ api_key })}\n />\n </BaseControl>\n </PanelRow>\n </Integration>\n );\n }\n);\n","import { Notice, PanelRow } from \"@wordpress/components\";\nimport { compose } from \"@wordpress/compose\";\nimport { __ } from \"@wordpress/i18n\";\n\nimport Integration from \"../../../components/Integration\";\nimport withIntegration from \"./withIntegration\";\n\nexport default compose([withIntegration({ name: \"presto_player_fluentcrm\" })])(\n ({ error, setError, isBusy, makeRequest, setting, updateSetting }) => {\n const setData = (props) => {\n updateSetting({\n ...props,\n });\n };\n\n const { connected } = setting || {};\n\n const onConnect = () => {\n makeRequest({\n path: \"/presto-player/v1/fluentcrm/connect\",\n message: __(\"Installed and connected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n const onDisconnect = async () => {\n makeRequest({\n path: \"/presto-player/v1/fluentcrm/disconnect\",\n message: __(\"Deactivated\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n return (\n <Integration\n title={__(\"FluentCRM\")}\n connected={connected}\n onConnect={onConnect}\n onDisconnect={onDisconnect}\n connectButtonText={__(\"Install FluentCRM Plugin\", \"presto-player\")}\n disconnectButtonText={__(\n \"Deactivate FluentCRM Plugin\",\n \"presto-player\"\n )}\n isBusy={isBusy}\n >\n {error && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"error\"\n onRemove={() => setError(\"\")}\n >\n {error}\n </Notice>\n </PanelRow>\n )}\n {connected && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"success\"\n isDismissible={false}\n >\n {__(\"Installed and connected!\", \"presto-player\")}\n </Notice>\n </PanelRow>\n )}\n </Integration>\n );\n }\n);\n","import {\n BaseControl,\n ExternalLink,\n Notice,\n PanelRow,\n} from \"@wordpress/components\";\nimport { compose } from \"@wordpress/compose\";\nimport { __ } from \"@wordpress/i18n\";\n\nimport Integration from \"../../../components/Integration\";\nimport TextControl from \"../../../components/TextControl\";\nimport withIntegration from \"./withIntegration\";\n\nexport default compose([withIntegration({ name: \"presto_player_mailchimp\" })])(\n ({\n success,\n setSuccess,\n error,\n setError,\n isBusy,\n makeRequest,\n setting,\n updateSetting,\n }) => {\n const { api_key, connected } = setting || {};\n\n const setData = (props) => {\n updateSetting({\n ...props,\n });\n };\n\n const onConnect = () => {\n makeRequest({\n path: \"/presto-player/v1/mailchimp/connect\",\n data: { api_key },\n message: __(\"Connected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n const onDisconnect = async () => {\n makeRequest({\n path: \"/presto-player/v1/mailchimp/disconnect\",\n message: __(\"Disconnected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n return (\n <Integration\n title={__(\"Mailchimp\")}\n connected={connected}\n onDisconnect={onDisconnect}\n onConnect={onConnect}\n isBusy={isBusy}\n >\n {error && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"error\"\n onRemove={() => setError(\"\")}\n >\n {error}\n </Notice>\n </PanelRow>\n )}\n {success && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"success\"\n onRemove={() => setSuccess(\"\")}\n >\n {success}\n </Notice>\n </PanelRow>\n )}\n <PanelRow>\n <BaseControl>\n <TextControl\n className=\"presto-player__setting--mailchimp-api_key\"\n label={__(\"Your Mailchimp API key\", \"presto-player\")}\n help={\n <p>\n {__(\n \"You can create a new key on your mailchimp account page.\",\n \"presto-player\"\n )}{\" \"}\n <ExternalLink href=\"https://us11.admin.mailchimp.com/account/api/\">\n {__(\"Get My API Key\", \"presto-player\")}\n </ExternalLink>\n </p>\n }\n value={api_key}\n onChange={(api_key) => updateSetting({ api_key })}\n />\n </BaseControl>\n </PanelRow>\n </Integration>\n );\n }\n);\n","import {\n BaseControl,\n ExternalLink,\n Notice,\n PanelRow,\n} from \"@wordpress/components\";\nimport { compose } from \"@wordpress/compose\";\nimport { __ } from \"@wordpress/i18n\";\n\nimport Integration from \"../../../components/Integration\";\nimport TextControl from \"../../../components/TextControl\";\nimport withIntegration from \"./withIntegration\";\n\nexport default compose([withIntegration({ name: \"presto_player_mailerlite\" })])(\n ({\n success,\n setSuccess,\n error,\n setError,\n isBusy,\n makeRequest,\n setting,\n updateSetting,\n }) => {\n const { api_key, connected } = setting || {};\n\n const setData = (props) => {\n updateSetting({\n ...props,\n });\n };\n\n const onConnect = () => {\n makeRequest({\n path: \"/presto-player/v1/mailerlite/connect\",\n data: { api_key },\n message: __(\"Connected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n const onDisconnect = async () => {\n makeRequest({\n path: \"/presto-player/v1/mailerlite/disconnect\",\n message: __(\"Disconnected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n return (\n <Integration\n title={__(\"Mailerlite\")}\n connected={connected}\n onDisconnect={onDisconnect}\n onConnect={onConnect}\n isBusy={isBusy}\n >\n {error && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"error\"\n onRemove={() => setError(\"\")}\n >\n {error}\n </Notice>\n </PanelRow>\n )}\n {success && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"success\"\n onRemove={() => setSuccess(\"\")}\n >\n {success}\n </Notice>\n </PanelRow>\n )}\n <PanelRow>\n <BaseControl>\n <TextControl\n className=\"presto-player__setting--mailerlite-api_key\"\n label={__(\"Your MailerLite API key\", \"presto-player\")}\n help={\n <p>\n {__(\n \"You can create a new key on your MailerLite account page.\",\n \"presto-player\"\n )}{\" \"}\n <ExternalLink href=\"https://app.mailerlite.com/integrations/api/\">\n {__(\"Get My API Key\", \"presto-player\")}\n </ExternalLink>\n </p>\n }\n value={api_key}\n onChange={(api_key) => updateSetting({ api_key })}\n />\n </BaseControl>\n </PanelRow>\n </Integration>\n );\n }\n);\n","import {\n BaseControl,\n Button,\n Flex,\n TextControl,\n ToolbarButton,\n} from \"@wordpress/components\";\nimport { __ } from \"@wordpress/i18n\";\n\nexport default ({ headers, setHeaders }) => {\n const updateHeaders = (data) => {\n setHeaders([...(headers || []), ...data]);\n };\n\n const addHeader = (header) => {\n setHeaders([...(headers || []), ...[header]]);\n };\n const updateHeader = (data, index) => {\n setHeaders(\n (headers || []).map((item, i) => {\n if (i !== index) {\n // This isn't the item we care about - keep it as-is\n return item;\n }\n\n // Otherwise, this is the one we want - return an updated value\n return {\n ...item,\n ...data,\n };\n })\n );\n };\n\n const removeHeader = (index) =>\n setHeaders((headers || []).filter((_, i) => i !== index));\n\n return (\n <>\n {(headers || []).map(({ name, value }, index) => {\n return (\n <Flex key={index} align=\"center\">\n <TextControl\n placeholder={__(\"Header Name\", \"presto-player\")}\n value={name}\n onChange={(name) => updateHeader({ name }, index)}\n />\n <TextControl\n placeholder={__(\"New Value\", \"presto-player\")}\n value={value}\n onChange={(value) => updateHeader({ value }, index)}\n />\n <BaseControl>\n <ToolbarButton icon=\"trash\" onClick={() => removeHeader(index)} />\n </BaseControl>\n </Flex>\n );\n })}\n\n <div>\n <Button\n isSecondary\n isSmall\n onClick={() => addHeader({ name: \"\", value: \"\" })}\n >\n {__(\"Add Header\", \"presto-player\")}\n </Button>\n </div>\n </>\n );\n};\n","import { css, jsx } from \"@emotion/core\";\n/** @jsx jsx */\nimport {\n BaseControl,\n Button,\n Card,\n CardBody,\n Flex,\n Modal,\n SelectControl,\n TextControl,\n ToggleControl,\n} from \"@wordpress/components\";\nimport { store as coreStore } from \"@wordpress/core-data\";\nimport { useDispatch } from \"@wordpress/data\";\nimport { useState } from \"@wordpress/element\";\nimport { __ } from \"@wordpress/i18n\";\nimport { store as noticesStore } from \"@wordpress/notices\";\n\nimport Headers from \"./Headers\";\n\nexport default ({ onClose, webhook }) => {\n const { saveEntityRecord } = useDispatch(coreStore);\n const { createSuccessNotice, createErrorNotice } = useDispatch(noticesStore);\n const [busy, setBusy] = useState(false);\n\n const sectionCSS = { margin: \"0 0 1.5rem\" };\n\n const [form, setForm] = useState(\n webhook || {\n email_name: \"email\",\n method: \"POST\",\n }\n );\n\n const updateForm = (data) => {\n setForm({\n ...(form || {}),\n ...data,\n });\n };\n\n const { name, url, method, email_name, headers, archived } = form;\n\n const submit = async (e) => {\n try {\n e.preventDefault();\n setBusy(true);\n await saveEntityRecord(\"presto-player\", \"webhook\", {\n ...form,\n });\n createSuccessNotice(\n form?.id\n ? __(\"Webhook updated\", \"presto-player\")\n : __(\"Webhook created.\", \"presto-player\"),\n {\n type: \"snackbar\",\n }\n );\n onClose();\n } catch (e) {\n console.error(e);\n createErrorNotice(\n e?.message || __(\"Something went wrong.\", \"presto-player\"),\n { type: \"snackbar\" }\n );\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <Modal\n title={\n form?.id\n ? __(\"Edit Webhook\", \"presto-player\")\n : __(\"Add A Webhook\", \"presto-player\")\n }\n onRequestClose={onClose}\n shouldCloseOnClickOutside={false}\n >\n <form onSubmit={submit}>\n <TextControl\n label={__(\"Name\", \"presto-player\")}\n placeholder={__(\"Webhook feed name\", \"presto-player\")}\n value={name}\n onChange={(name) => updateForm({ name })}\n required\n autoFocus\n />\n\n <TextControl\n label={__(\"Request URL\", \"presto-player\")}\n placeholder={__(\"Webhook URL\", \"presto-player\")}\n type=\"url\"\n value={url}\n onChange={(url) => updateForm({ url })}\n required\n />\n\n <SelectControl\n label={__(\"Request Method\", \"presto-player\")}\n value={method}\n options={[\n { label: \"GET\", value: \"GET\" },\n { label: \"POST\", value: \"POST\" },\n { label: \"PUT\", value: \"PUT\" },\n ]}\n onChange={(method) => updateForm({ method })}\n required\n />\n\n <TextControl\n label={__(\"Email Name\", \"presto-player\")}\n placeholder={__(\"The name (key) of the email sent.\", \"presto-player\")}\n value={email_name}\n onChange={(email_name) => updateForm({ email_name })}\n required\n />\n\n <div css={sectionCSS}>\n <BaseControl.VisualLabel>\n {__(\"Headers\", \"presto-player\")}\n </BaseControl.VisualLabel>\n <Headers\n headers={headers}\n setHeaders={(headers) => updateForm({ headers })}\n />\n </div>\n\n <Button isPrimary type=\"submit\" isBusy={busy}>\n {form?.id\n ? __(\"Update\", \"presto-player\")\n : __(\"Create\", \"presto-player\")}\n </Button>\n </form>\n </Modal>\n );\n};\n","import {\n Card,\n CardBody,\n Flex,\n FlexBlock,\n FlexItem,\n Spinner,\n ToolbarButton,\n} from \"@wordpress/components\";\nimport { store as coreStore } from \"@wordpress/core-data\";\nimport { select, useDispatch, useSelect } from \"@wordpress/data\";\nimport { useState } from \"@wordpress/element\";\nimport { __ } from \"@wordpress/i18n\";\nimport { store as noticesStore } from \"@wordpress/notices\";\n\nimport NewWebhook from \"./NewWebhook\";\n\nexport default ({ webhook: incomingWebhook }) => {\n const [busy, setBusy] = useState(false);\n const [open, setOpen] = useState(false);\n const { deleteEntityRecord, saveEntityRecord } = useDispatch(coreStore);\n const { createSuccessNotice, createErrorNotice } = useDispatch(noticesStore);\n\n const { webhook, loading, isSaving, isDeleting } = useSelect((select) => {\n const queryArgs = [\"presto-player\", \"webhook\", incomingWebhook?.id];\n const {\n getEditedEntityRecord,\n isSavingEntityRecord,\n isDeletingEntityRecord,\n } = select(coreStore);\n return {\n webhook: getEditedEntityRecord(...queryArgs),\n loading: select(coreStore).isResolving(\n \"getEditedEntityRecord\",\n queryArgs\n ),\n isSaving: isSavingEntityRecord(...queryArgs),\n isDeleting: isDeletingEntityRecord(...queryArgs),\n };\n }, []);\n\n const { name, url } = webhook || {};\n\n const deleteWebhook = async () => {\n try {\n const r = confirm(\n __(\"Are you sure you want to delete this webhook?\", \"presto-player\")\n );\n if (!r) return;\n await deleteEntityRecord(\n \"presto-player\",\n \"webhook\",\n webhook?.id,\n undefined,\n { throwOnError: true }\n );\n createSuccessNotice(__(\"Webhook deleted.\", \"presto-player\"), {\n type: \"snackbar\",\n });\n } catch (e) {\n console.error(e);\n createErrorNotice(\n e?.message || __(\"Something went wrong\", \"presto-player\"),\n { type: \"snackbar\" }\n );\n }\n };\n\n if (loading) {\n return <Spinner />;\n }\n\n return (\n <Card>\n <CardBody>\n <Flex align=\"center\">\n <FlexBlock>\n <strong>{name || __(\"Untitled webhook\", \"presto-player\")}</strong>\n <br />\n {url}\n </FlexBlock>\n <FlexItem>\n <Flex align=\"center\">\n {isSaving || isDeleting ? (\n <Spinner />\n ) : (\n <>\n <ToolbarButton\n icon=\"edit\"\n label=\"Edit\"\n onClick={() => setOpen(true)}\n />\n <ToolbarButton\n icon=\"trash\"\n label={__(\"Delete\", \"presto-player\")}\n onClick={deleteWebhook}\n />\n </>\n )}\n </Flex>\n </FlexItem>\n </Flex>\n </CardBody>\n {open && (\n <NewWebhook onClose={() => setOpen(false)} webhook={incomingWebhook} />\n )}\n </Card>\n );\n};\n","import {\n Button,\n Flex,\n FlexBlock,\n Panel,\n PanelBody,\n} from \"@wordpress/components\";\nimport { store as coreStore } from \"@wordpress/core-data\";\nimport { useSelect } from \"@wordpress/data\";\nimport { useState } from \"@wordpress/element\";\nimport { __, _n, sprintf } from \"@wordpress/i18n\";\n\nimport NewWebhook from \"./NewWebhook\";\nimport Webhook from \"./Webhook\";\n\nexport default () => {\n const [open, setOpen] = useState(false);\n const { webhooks, loading } = useSelect((select) => {\n const queryArgs = [\"presto-player\", \"webhook\"];\n return {\n webhooks: select(coreStore).getEntityRecords(...queryArgs),\n loading: select(coreStore).isResolving(\"getEntityRecords\", queryArgs),\n };\n }, []);\n\n return (\n <Panel>\n <PanelBody\n title={\n <Flex>\n <FlexBlock>{__(\"Webhooks\", \"presto-player\")}</FlexBlock>\n {!!webhooks?.length && (\n <Button isSmall isPrimary style={{ marginRight: \"30px\" }}>\n {sprintf(__(\"%d connected\"), webhooks?.length)}\n </Button>\n )}\n </Flex>\n }\n initialOpen={false}\n >\n {(webhooks || []).map((webhook) => {\n return (\n <Webhook webhook={webhook} key={webhook?.id} loading={loading} />\n );\n })}\n\n <br />\n\n <Button\n isSecondary\n onClick={() => {\n setOpen(true);\n }}\n >\n {__(\"Create New WebHook\", \"presto-player\")}\n </Button>\n\n {open && <NewWebhook onClose={() => setOpen(false)} />}\n </PanelBody>\n </Panel>\n );\n};\n","import { ExternalLink, TextControl, ToggleControl } from \"@wordpress/components\";\nimport { useEntityProp } from \"@wordpress/core-data\";\nimport { Fragment, useState } from \"@wordpress/element\";\nimport { __ } from \"@wordpress/i18n\";\n\nconst semverCompare = require(\"semver/functions/compare\");\n\nimport Group from \"../components/Group\";\nimport Page from \"../components/Page\";\nimport BunnyClassic from \"./parts/BunnyClassic/index\";\nimport BunnyStream from \"./parts/BunnyStream/index\";\nimport EmailExport from \"./parts/EmailExport\";\nimport CTA from \"../components/CTA\";\n\nimport ActiveCampaign from \"./parts/integration/ActiveCampaign\";\nimport FluentCRM from \"./parts/integration/FluentCRM\";\nimport Mailchimp from \"./parts/integration/Mailchimp\";\nimport MailerLite from \"./parts/integration/MailerLite\";\nimport Webhooks from \"./parts/Webhooks/index.js\";\n\nexport default () => {\n const [editBunny, setEditBunny] = useState(false);\n\n const [stream, setStream] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_bunny_stream\"\n );\n const updateStream = (data) => {\n setStream({\n ...(stream || {}),\n ...data,\n });\n };\n\n const [analytics, setAnalytics] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_google_analytics\"\n );\n const updateAnalytics = (data) => {\n setAnalytics({\n ...(analytics || {}),\n ...data,\n });\n };\n\n const [youtube, setYoutube] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_youtube\"\n );\n const updateYoutube = (data) => {\n setYoutube({\n ...(youtube || {}),\n ...data,\n });\n };\n\n const disabled = () => {\n if (prestoPlayer?.isPremium) {\n return false;\n }\n return {\n title: __(\"Pro Feature\", \"presto-player\"),\n heading: __(\"Unlock Presto Player Pro\", \"presto-player\"),\n message: __(\n \"Get this feature and more with the Pro version of Presto Player!\",\n \"presto-player\"\n ),\n link: \"https://prestoplayer.com\",\n };\n };\n\n const showEmailIntegration = () => {\n if (!prestoPlayer?.isPremium) {\n return true;\n }\n\n if (\n prestoPlayer?.proVersion &&\n semverCompare(prestoPlayer?.proVersion, \"0.9.0\") >= 0\n ) {\n return true;\n }\n\n return false;\n };\n\n const bunnySettings = () => {\n return (\n <>\n <Group\n title={__(\"Bunny.net Settings\", \"presto-player\")}\n description={__(\"Modify bunny.net settings.\", \"presto-player\")}\n >\n {!!window?.prestoPlayer?.isSetup?.bunny?.stream && (\n <Fragment>\n <TextControl\n label={__(\"Initial Quality Level\", \"presto-player\")}\n help={__(\n \"You can set the default quality start level for all streams (i.e. 240, 360, 480, 720, 1080, etc). Set this lower to prevent initial buffering if your users have slow connections. Set this higher to start with a higher quality stream.\",\n \"presto-player\"\n )}\n placeholder={\"480\"}\n type=\"number\"\n value={stream?.hls_start_level}\n onChange={(hls_start_level) =>\n updateStream({ hls_start_level })\n }\n />\n\n {<br />}\n\n <ToggleControl\n label={__(\"Disable Classic Bunny.net Storage\", \"presto-player\")}\n help={__(\n \"This will disable Bunny.net classic storage in your block UI.\",\n \"presto-player\"\n )}\n checked={stream?.disable_legacy_storage}\n onChange={(disable_legacy_storage) =>\n updateStream({ disable_legacy_storage })\n }\n />\n\n {<br />}\n </Fragment>\n )}\n\n <ToggleControl\n label={__(\"Edit Bunny.net Settings\", \"presto-player\")}\n help={__(\n \"Edit Bunny.net connection settings. Only edit this if you know what you're doing.\",\n \"presto-player\"\n )}\n checked={editBunny}\n onChange={setEditBunny}\n />\n\n {!!editBunny && (\n <>\n <BunnyStream />\n <BunnyClassic />\n </>\n )}\n </Group>\n </>\n );\n };\n\n return (\n <Page\n title={__(\"Integrations\", \"presto-player\")}\n description={__(\n \"Third party integrations and connections.\",\n \"presto-player\"\n )}\n >\n <Group\n title={__(\"Google Analytics\", \"presto-player\")}\n description={__(\n \"Analytics settings for media plays, watch times and more.\",\n \"presto-player\"\n )}\n disabled={disabled()}\n >\n <ToggleControl\n className=\"presto-player__setting--google-analytics\"\n label={__(\"Enable\", \"presto-player\")}\n help={__(\n \"Send analytics events to your Google Analytics account.\",\n \"presto-player\"\n )}\n checked={analytics?.enable}\n onChange={(enable) => updateAnalytics({ enable })}\n />\n\n <ToggleControl\n className=\"presto-player__setting--use-existing-tag\"\n label={__(\"Use existing on-page tag?\", \"presto-player\")}\n help={__(\n \"Should we use an existing google analytics (v4) tag? If not, we'll output one for you.\",\n \"presto-player\"\n )}\n checked={analytics?.use_existing_tag}\n onChange={(use_existing_tag) => updateAnalytics({ use_existing_tag })}\n />\n\n <TextControl\n label={__(\"Measurement ID\", \"presto-player\")}\n help={__(\n \"Enter a Google Analytics Measurement ID, which can be found on your analytics admin page.\",\n \"presto-player\"\n )}\n value={analytics?.measurement_id}\n onChange={(measurement_id) => updateAnalytics({ measurement_id })}\n />\n </Group>\n\n <Group\n title={__(\"YouTube\", \"presto-player\")}\n description={__(\"Settings for YouTube videos.\", \"presto-player\")}\n >\n <ToggleControl\n className=\"presto-player__setting--youtube-nocookie\"\n label={__(\"Privacy-Enhanced Mode\", \"presto-player\")}\n help={__(\n \"Embed YouTube videos without using cookies that track viewing behaviour.\",\n \"presto-player\"\n )}\n checked={youtube?.nocookie}\n onChange={(nocookie) => updateYoutube({ nocookie })}\n />\n\n <TextControl\n label={__(\"Channel ID\", \"presto-player\")}\n help={\n <div>\n {__(\n \"Enter the ID of your channel to enable Youtube Subscribe button functionality.\",\n \"presto-player\"\n )}{\" \"}\n <ExternalLink href=\"https://support.google.com/youtube/answer/3250431?hl=en\">\n {__(\"Find my channel id\", \"presto-player\")}\n </ExternalLink>\n </div>\n }\n value={youtube?.channel_id}\n onChange={(channel_id) => updateYoutube({ channel_id })}\n />\n </Group>\n\n {showEmailIntegration() && (\n <Group\n hideSaveButton={true}\n title={__(\"Email Capture\", \"presto-player\")}\n description={__(\n \"Integrate Presto Player with an email provider for email capture.\",\n \"presto-player\"\n )}\n disabled={disabled()}\n >\n <ActiveCampaign />\n <FluentCRM />\n <Mailchimp />\n <MailerLite />\n {prestoPlayer?.proVersion &&\n semverCompare(prestoPlayer?.proVersion, \"1.2.0\") >= 0 && (\n <Webhooks />\n )}\n <EmailExport />\n </Group>\n )}\n\n {!window?.prestoPlayer?.isSetup?.bunny ? (\n <Group>\n <CTA\n className=\"presto-player__setting--bunny-cta\"\n option={{\n name: __(\"Bunny.net Video\", \"presto-player\"),\n help: __(\n \"To get started with Bunny.net, add a Bunny.net video to your page.\",\n \"presto-player\"\n ),\n type: \"cta\",\n button: {\n text: \"Learn More\",\n link: \"https://prestoplayer.com/secure-video-with-bunny-net\",\n target: \"_blank\",\n },\n }}\n />\n </Group>\n ) : (\n bunnySettings()\n )}\n </Page>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport {\n Card,\n Flex,\n FlexBlock,\n FlexItem,\n Spinner,\n} from \"@wordpress/components\";\nimport { store as noticesStore } from \"@wordpress/notices\";\nimport { useDispatch, useSelect } from \"@wordpress/data\";\nimport { store as coreStore } from \"@wordpress/core-data\";\nimport { useState, useEffect } from \"@wordpress/element\";\n\nimport { Router, Link, Route } from \"@/router\";\nimport { routes } from \"./routes\";\n\nimport SaveButton from \"./components/SaveButton\";\nimport Notices from \"./components/Notices\";\nimport useSave from \"../../hooks/useSave\";\nimport General from \"./pages/General\";\nimport Performance from \"./pages/Performance\";\nimport Integrations from \"./pages/Integrations\";\n\nfunction App() {\n const { createSuccessNotice, createErrorNotice } = useDispatch(noticesStore);\n const [loaded, setLoaded] = useState(false);\n\n // scroll top on history change\n window.onhashchange = () => {\n window.scrollTo(0, 0);\n };\n\n const { save } = useSave();\n\n /**\n * Form is submitted.\n */\n const onSubmit = async () => {\n try {\n await save();\n createSuccessNotice(__(\"Settings Updated\", \"presto-player\"), {\n type: \"snackbar\",\n });\n } catch (e) {\n console.error(e);\n createErrorNotice(\n e?.message || __(\"Something went wrong\", \"presto-player\"),\n { type: \"snackbar\" }\n );\n }\n };\n\n const loading = useSelect((select) => {\n const queryArgs = [\"root\", \"site\"];\n select(coreStore).getEntityRecords(...queryArgs);\n return !select(coreStore)?.hasFinishedResolution?.(\n \"getEntityRecords\",\n queryArgs\n );\n });\n\n useEffect(() => {\n if (!loading) {\n setLoaded(true);\n }\n }, [loading]);\n\n if (!loaded) {\n return (\n <div className=\"presto-settings__loading\">\n <Spinner />\n </div>\n );\n }\n\n return (\n <div className=\"presto-settings\">\n <Router routes={routes} defaultRoute={routes?.general?.path}>\n <Card className=\"presto-settings__navigation\">\n <Flex>\n <FlexBlock>\n <div\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n className=\"components-tab-panel__tabs\"\n >\n <Link\n to={routes?.general?.path}\n type=\"button\"\n role=\"tab\"\n activeClassName=\"is-active\"\n className=\"components-button components-tab-panel__tabs-item presto-player__nav-general\"\n >\n {__(\"General\", \"presto-player\")}\n </Link>\n <Link\n to={routes?.integrations?.path}\n type=\"button\"\n role=\"tab\"\n activeClassName=\"is-active\"\n className=\"components-button components-tab-panel__tabs-item presto-player__nav-integrations\"\n >\n {__(\"Integrations\", \"presto-player\")}\n </Link>\n <Link\n to={routes?.performance?.path}\n type=\"button\"\n role=\"tab\"\n activeClassName=\"is-active\"\n className=\"components-button components-tab-panel__tabs-item presto-player__nav-performance\"\n >\n {__(\"Performance\", \"presto-player\")}\n </Link>\n </div>\n </FlexBlock>\n <FlexItem>\n <SaveButton onSave={onSubmit} style={{ marginRight: \"8px\" }}>\n {__(\"Update Settings\", \"presto-player\")}\n </SaveButton>\n </FlexItem>\n </Flex>\n </Card>\n\n <Route path={routes?.general?.path}>\n <General />\n </Route>\n <Route path={routes?.integrations?.path}>\n <Integrations />\n </Route>\n <Route path={routes?.performance?.path}>\n <Performance />\n </Route>\n </Router>\n\n <Notices className=\"presto-settings-page-notices\" />\n </div>\n );\n}\n\nexport default App;\n","import { render } from \"@wordpress/element\";\n\n/**\n * Redux entities.\n */\nimport \"./entities\";\n\n/**\n * App\n */\nimport App from \"./app\";\n\n/**\n * styles\n */\nimport \"./settings.scss\";\n\n/**\n * Render\n */\nrender(<App />, document.getElementById(\"presto-settings-page\"));\n","(function() { module.exports = window[\"wp\"][\"data\"]; }());","(function() { module.exports = window[\"wp\"][\"element\"]; }());"],"sourceRoot":""}
|
1 |
+
{"version":3,"sources":["webpack:///external [\"wp\",\"i18n\"]","webpack:///external [\"wp\",\"components\"]","webpack:///external [\"wp\",\"notices\"]","webpack:///external [\"wp\",\"compose\"]","webpack:///external [\"wp\",\"coreData\"]","webpack:///external [\"wp\",\"apiFetch\"]","webpack:///./src/admin/settings/entities.js","webpack:///./src/router/utils.js","webpack:///./src/router/context.js","webpack:///./src/router/route.js","webpack:///./src/router/link.js","webpack:///./src/router/index.js","webpack:///./src/admin/settings/routes.js","webpack:///./src/admin/settings/components/SaveButton.js","webpack:///./src/admin/settings/components/Notices.js","webpack:///./src/hooks/useSave.js","webpack:///./src/admin/settings/components/Disabled.js","webpack:///./src/admin/settings/components/Group.js","webpack:///./src/admin/settings/components/Media.js","webpack:///./src/admin/settings/components/Page.js","webpack:///./src/admin/settings/components/CodeMirror.js","webpack:///./src/admin/settings/pages/General.js","webpack:///./src/admin/settings/pages/Performance.js","webpack:///./src/admin/settings/pages/parts/BunnyClassic/index.js","webpack:///./src/admin/settings/pages/parts/BunnyStream/PublicStream.js","webpack:///./src/admin/settings/pages/parts/BunnyStream/PrivateStream.js","webpack:///./src/admin/settings/pages/parts/BunnyStream/index.js","webpack:///./src/admin/settings/pages/parts/EmailExport.js","webpack:///./src/admin/settings/components/CTA.js","webpack:///./src/admin/settings/components/Integration.js","webpack:///./src/admin/settings/components/TextControl.js","webpack:///./src/admin/settings/pages/parts/integration/withIntegration.js","webpack:///./src/admin/settings/pages/parts/integration/ActiveCampaign.js","webpack:///./src/admin/settings/pages/parts/integration/FluentCRM.js","webpack:///./src/admin/settings/pages/parts/integration/Mailchimp.js","webpack:///./src/admin/settings/pages/parts/integration/MailerLite.js","webpack:///./src/admin/settings/pages/parts/Webhooks/Headers.js","webpack:///./src/admin/settings/pages/parts/Webhooks/NewWebhook.js","webpack:///./src/admin/settings/pages/parts/Webhooks/Webhook.js","webpack:///./src/admin/settings/pages/parts/Webhooks/index.js","webpack:///./src/admin/settings/pages/Integrations.js","webpack:///./src/admin/settings/app.js","webpack:///./src/admin/settings/index.js","webpack:///external [\"wp\",\"data\"]","webpack:///external [\"wp\",\"element\"]"],"names":["module","exports","window","dispatch","coreStore","addEntities","name","kind","label","__","baseURL","baseURLParams","context","locationToRoute","location","path","pathname","hash","query","qs","parse","search","history","createBrowserHistory","RouterContext","wp","element","createContext","route","useContext","prev","Route","onRoute","children","matched","match","checkMatch","substr","cloneElement","Link","props","to","onClick","activeClassName","state","className","classNames","e","preventDefault","push","Router","setState","routes","Object","keys","map","key","unlisten","listen","handleRouteChange","defaultRoute","this","NotFound","forEach","isMatched","data","routerContextValue","is404","Provider","value","Component","general","integrations","performance","SaveButton","onSave","busy","loading","rest","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","filter","r","isDirty","length","isSaving","some","record","disabled","ScSkeleton","style","width","height","display","isPrimary","aria-disabled","isBusy","undefined","notices","noticesStore","getNotices","removeNotice","useDispatch","snackbarNotices","type","onRemove","useSave","saveEditedEntityRecord","save","a","dirtyRecords","pendingSavedRecords","throwOnError","Promise","all","message","i18n","useState","components","Modal","Button","dialog","setDialog","title","onRequestClose","heading","href","link","target","Card","CardBody","CardFooter","description","hideSaveButton","createSuccessNotice","createErrorNotice","console","error","Disabled","size","marginBottom","isShady","BaseControl","MediaUpload","mediaUtils","option","help","allowedTypes","maxWidth","onSelect","VisualLabel","border","src","render","open","isSecondary","id","hidden","sprintf","isTertiary","onChange","handleChange","instance","textRef","current","useRef","useEffect","CodeMirror","fromTextArea","lineNumbers","on","css","ref","rows","prestoPlayer","isPremium","presetArgs","audioPresetArgs","presets","getEntityRecords","loadingPresets","isResolving","audioPresets","loadingAudioPresets","useEntityProp","presetSettings","setPresetSettings","audioPresetSettings","setAudioPresetSettings","analytics","setAnalytics","updateAnalytics","branding","setBranding","updateBranding","uninstall","setUninstall","Page","Group","Media","image","logo","url","logo_width","min","max","onChangeComplete","color","hex","checked","enable","purge_data","default_player_preset","options","preset","player_css","uninstall_data","confirm","setPerformance","updatePerformance","module_enabled","status","isDismissible","automations","classic","setClassic","updateClassic","public_id","public_hostname","private_id","private_hostname","private_security_key","marginTop","fontSize","stream","setStream","updateStream","video_library_api_key","pull_zone_url","video_library_id","token_auth_key","PublicStream","PrivateStream","Panel","PanelBody","Flex","FlexBlock","Notice","Spinner","step","setStep","progress","setProgress","setError","setURL","exportEmails","apiFetch","method","percentage","currentStep","fetchedURL","initialOpen","align","justify","alignItems","optionName","isBorderless","button","text","FlexItem","PanelRow","connected","onConnect","connectButtonText","disconnectButtonText","onDisconnect","setConfirm","isSmall","marginRight","onSubmit","isDestructive","TextControl","placeholder","updateSetting","createHigherOrderComponent","WrappedComponent","success","setSuccess","setIsBusy","setting","setSetting","makeRequest","response","compose","withIntegration","setData","Integration","api_key","headers","setHeaders","updateHeader","index","item","i","icon","_","removeHeader","header","onClose","webhook","saveEntityRecord","setBusy","email_name","form","setForm","updateForm","submit","archived","shouldCloseOnClickOutside","required","autoFocus","margin","Headers","incomingWebhook","setOpen","deleteEntityRecord","queryArgs","getEditedEntityRecord","isDeletingEntityRecord","isDeleting","deleteWebhook","NewWebhook","webhooks","Webhook","semverCompare","require","editBunny","setEditBunny","youtube","setYoutube","updateYoutube","use_existing_tag","measurement_id","nocookie","channel_id","proVersion","ActiveCampaign","FluentCRM","Mailchimp","MailerLite","Webhooks","EmailExport","isSetup","bunny","hls_start_level","disable_legacy_storage","BunnyStream","BunnyClassic","CTA","App","loaded","setLoaded","onhashchange","scrollTo","hasFinishedResolution","role","aria-orientation","General","Integrations","Performance","Notices","document","getElementById"],"mappings":"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","file":"settings/admin-8ab815a4.js","sourcesContent":["(function() { module.exports = window[\"wp\"][\"i18n\"]; }());","(function() { module.exports = window[\"wp\"][\"components\"]; }());","(function() { module.exports = window[\"wp\"][\"notices\"]; }());","(function() { module.exports = window[\"wp\"][\"compose\"]; }());","(function() { module.exports = window[\"wp\"][\"coreData\"]; }());","(function() { module.exports = window[\"wp\"][\"apiFetch\"]; }());","import { store as coreStore } from \"@wordpress/core-data\";\nimport { dispatch } from \"@wordpress/data\";\nimport { __ } from \"@wordpress/i18n\";\n\ndispatch(coreStore).addEntities([\n {\n name: \"preset\",\n kind: \"presto-player\",\n label: __(\"Presets\", \"presto-player\"),\n baseURL: \"presto-player/v1/preset\",\n baseURLParams: { context: \"edit\" },\n },\n {\n name: \"audio-preset\",\n kind: \"presto-player\",\n label: __(\"Audio Presets\", \"presto-player\"),\n baseURL: \"presto-player/v1/audio-preset\",\n baseURLParams: { context: \"edit\" },\n },\n {\n name: \"webhook\",\n kind: \"presto-player\",\n label: __(\"Webhook\", \"presto-player\"),\n baseURL: \"presto-player/v1/webhook\",\n baseURLParams: { context: \"edit\" },\n },\n]);\n","import qs from \"querystringify\";\nexport function locationToRoute(location) {\n // location comes from the history package\n return {\n path: location.pathname,\n hash: location.hash,\n query: qs.parse(location.search),\n };\n}\n","import { createBrowserHistory } from \"history\";\nimport { locationToRoute } from \"./utils\";\n\nexport const history = createBrowserHistory();\nexport const RouterContext = wp.element.createContext({\n route: locationToRoute(history.location),\n});\n","import { RouterContext } from \"./context\";\nconst { useContext } = wp.element;\nimport { match } from \"path-to-regexp\";\nlet prev = \"\";\n\nexport function Route({ path, onRoute, children }) {\n // Extract route from RouterContext\n const { route } = useContext(RouterContext);\n\n const checkMatch = match(`${path}`);\n const matched = checkMatch(`${route.hash.substr(1)}`);\n\n if (!matched) {\n return null;\n }\n\n if (onRoute) {\n if (prev !== matched.path) {\n onRoute();\n }\n prev = matched.path;\n }\n\n return <div>{wp.element.cloneElement(children, { route: matched })}</div>;\n}\n","const { useContext } = wp.element;\nimport { RouterContext, history } from \"./context\";\nimport classNames from \"classnames\";\nimport { match } from \"path-to-regexp\";\n\nexport function Link(props) {\n const { to, onClick, children, activeClassName } = props;\n const { route } = useContext(RouterContext);\n\n let state = { ...props };\n delete state.activeClassName;\n\n const isActive = () => {\n const checkMatch = match(`${to}`);\n return checkMatch(`${route.hash.substr(1)}`);\n };\n\n const handleClick = (e) => {\n e.preventDefault();\n // Dont' navigate if current path\n if (route.path === to) {\n return;\n }\n // Trigger onClick prop manually\n if (onClick) {\n onClick(e);\n }\n const { search } = history.location;\n\n // Use history API to navigate page\n history.push(`${search}#${to}`);\n };\n\n return (\n <a\n {...state}\n className={classNames({ [activeClassName]: isActive() }, props.className)}\n onClick={handleClick}\n >\n {children}\n </a>\n );\n}\n","import { Component } from \"@wordpress/element\";\nimport { locationToRoute } from \"./utils\";\nimport { history, RouterContext } from \"./context\";\nimport { Route } from \"./route\";\nimport { Link } from \"./link\";\nimport { match } from \"path-to-regexp\";\n\nclass Router extends Component {\n constructor(props) {\n super(props);\n\n // Convert our routes into an array for easy 404 checking\n this.routes = Object.keys(props.routes).map(\n (key) => props.routes[key].path\n );\n\n // Listen for path changes from the history API\n this.unlisten = history.listen(this.handleRouteChange);\n\n const route = locationToRoute(history.location);\n const { search } = history.location;\n\n // Define the initial RouterContext value\n this.state = {\n route,\n defaultRoute: props?.defaultRoute\n ? `${search}#${props?.defaultRoute}`\n : `${search}#/`,\n };\n }\n\n componentWillUnmount() {\n // Stop listening for changes if the Router component unmounts\n this.unlisten();\n }\n\n handleRouteChange = (location) => {\n const route = locationToRoute(location?.location);\n this.setState({ route: route });\n };\n\n render() {\n // Define our variables\n const { children, NotFound } = this.props;\n const { route, defaultRoute } = this.state;\n\n if (!route.hash) {\n history.push(defaultRoute);\n return <div></div>;\n }\n\n let matched = false;\n // match route\n (this.routes || []).forEach((name) => {\n const checkMatch = match(route.hash.substr(1));\n const isMatched = checkMatch(`${route.hash.substr(1)}`);\n if (!isMatched) {\n return;\n }\n matched = {\n name,\n data: isMatched,\n };\n });\n\n const routerContextValue = { route, matched };\n\n // Check if 404 if no route matched\n const is404 = !matched;\n\n return (\n <RouterContext.Provider value={routerContextValue}>\n {is404 ? <div>Not found</div> : children}\n </RouterContext.Provider>\n );\n }\n}\nexport { history, RouterContext, Router, Route, Link };\n","export const routes = {\n general: {\n path: \"general\",\n },\n integrations: {\n path: \"/integrations\",\n },\n performance: {\n path: \"/performance\",\n },\n};\n","/**\n * WordPress dependencies\n */\nimport { useSelect } from \"@wordpress/data\";\nimport { __ } from \"@wordpress/i18n\";\nimport { store as coreStore } from \"@wordpress/core-data\";\nimport { Button } from \"@wordpress/components\";\n\nexport default function SaveButton({\n onSave,\n children,\n busy,\n loading,\n ...rest\n}) {\n const { isDirty, isSaving } = useSelect((select) => {\n const {\n __experimentalGetDirtyEntityRecords,\n isSavingEntityRecord,\n } = select(coreStore);\n\n const dirtyEntityRecords = (\n __experimentalGetDirtyEntityRecords() || []\n ).filter((r) => r.name !== \"webhook\");\n\n return {\n isDirty: dirtyEntityRecords.length > 0,\n isSaving: dirtyEntityRecords.some((record) =>\n isSavingEntityRecord(record.kind, record.name, record.key)\n ),\n };\n }, []);\n\n const disabled = !isDirty || isSaving;\n\n if (loading) {\n return (\n <ScSkeleton\n style={{\n width: \"120px\",\n height: \"35px\",\n display: \"inline-block\",\n }}\n ></ScSkeleton>\n );\n }\n\n return (\n <Button\n isPrimary\n aria-disabled={disabled}\n disabled={disabled || isSaving || busy}\n isBusy={isSaving || busy}\n onClick={disabled ? undefined : onSave}\n {...rest}\n >\n {children}\n </Button>\n );\n}\n","import { SnackbarList } from \"@wordpress/components\";\nimport { useDispatch, useSelect } from \"@wordpress/data\";\n\nimport { store as noticesStore } from \"@wordpress/notices\";\n\nexport default ({ className }) => {\n const notices = useSelect((select) => select(noticesStore).getNotices());\n const { removeNotice } = useDispatch(noticesStore);\n const snackbarNotices = notices.filter(({ type }) => type === \"snackbar\");\n\n return (\n <SnackbarList\n notices={snackbarNotices}\n className={className}\n onRemove={removeNotice}\n />\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { select, useDispatch } from \"@wordpress/data\";\nimport { store as coreStore } from \"@wordpress/core-data\";\n\nexport default function useSave() {\n const { saveEditedEntityRecord } = useDispatch(coreStore);\n\n /**\n * Handle the form submission\n */\n const save = async () => {\n // build up pending records to save.\n const dirtyRecords = select(\n coreStore\n ).__experimentalGetDirtyEntityRecords();\n const pendingSavedRecords = [];\n\n dirtyRecords.forEach(({ kind, name, key }) => {\n pendingSavedRecords.push(\n saveEditedEntityRecord(kind, name, key, {\n throwOnError: true,\n })\n );\n });\n\n // check values.\n const values = await Promise.all(pendingSavedRecords);\n if (values.some((value) => typeof value === \"undefined\")) {\n throw { message: \"Saving failed.\" };\n }\n\n return true;\n };\n\n return {\n save,\n };\n}\n","const { __ } = wp.i18n;\nconst { useState } = wp.element;\nconst { Modal, Button } = wp.components;\n\nexport default ({ children, disabled }) => {\n const [dialog, setDialog] = useState(false);\n\n if (!disabled) {\n return <div>{children}</div>;\n }\n\n return (\n <div>\n <div\n className=\"presto-options__disabled-overlay\"\n onClick={(e) => {\n setDialog(true);\n e.preventDefault();\n return false;\n }}\n >\n <div>{children}</div>\n </div>\n {!!dialog && (\n <Modal title={disabled?.title} onRequestClose={() => setDialog(false)}>\n <h2>{disabled?.heading}</h2>\n <p>{disabled?.message}</p>\n <Button href={disabled?.link} target=\"_blank\" isPrimary>\n {__(\"Learn More\", \"presto-player\")}\n </Button>\n </Modal>\n )}\n </div>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nconst { Card, CardBody, CardFooter } = wp.components;\nimport SaveButton from \"./SaveButton\";\nimport { useDispatch } from \"@wordpress/data\";\nimport { store as noticesStore } from \"@wordpress/notices\";\nimport Disabled from \"./Disabled\";\nimport useSave from \"../../../hooks/useSave\";\n\nexport default ({ title, description, children, disabled, hideSaveButton }) => {\n const { save } = useSave();\n const { createSuccessNotice, createErrorNotice } = useDispatch(noticesStore);\n\n /**\n * Form is submitted.\n */\n const onSave = async () => {\n try {\n await save();\n createSuccessNotice(__(\"Settings Updated\", \"presto-player\"), {\n type: \"snackbar\",\n });\n } catch (e) {\n console.error(e);\n createErrorNotice(\n e?.message || __(\"Something went wrong\", \"presto-player\")\n );\n }\n };\n\n return (\n <Disabled disabled={disabled}>\n <Card size=\"large\" className=\"presto-options__card\">\n <CardBody className={`presto-options__card-body`}>\n <div className=\"presto-flow\" style={{ \"--presto-flow-space\": \"2em\" }}>\n <div\n className=\"presto-flow\"\n style={{ \"--presto-flow-space\": \"1em\" }}\n >\n {title && (\n <h2 style={{ marginBottom: 0 }}>\n {title}{\" \"}\n {!!disabled && (\n <div className=\"presto-options__pro-badge\">Pro</div>\n )}\n </h2>\n )}\n {description && <p>{description}</p>}\n </div>\n <div>{children}</div>\n </div>\n </CardBody>\n {!hideSaveButton ? (\n <CardFooter isShady>\n <div>\n <SaveButton onSave={onSave}>{__(\"Update Settings\")}</SaveButton>\n </div>\n </CardFooter>\n ) : (\n <br />\n )}\n </Card>\n </Disabled>\n );\n};\n","const { __ } = wp.i18n;\n\nconst { Button, BaseControl } = wp.components;\nconst { MediaUpload } = wp.mediaUtils;\nconst { dispatch } = wp.data;\nimport classNames from \"classnames\";\n\nexport default ({\n option,\n label,\n help,\n allowedTypes,\n value,\n className,\n maxWidth,\n onSelect,\n}) => {\n return (\n <div\n className={classNames(\n className,\n \"presto-settings__setting is-media-control\"\n )}\n >\n <BaseControl className=\"editor-video-poster-control\">\n <BaseControl.VisualLabel>{label}</BaseControl.VisualLabel>\n {value && (\n <BaseControl>\n <img\n style={{\n maxWidth,\n border: \"1px solid #dcdcdc\",\n }}\n src={value}\n />\n </BaseControl>\n )}\n <br />\n <MediaUpload\n title={help}\n onSelect={onSelect}\n allowedTypes={allowedTypes}\n render={({ open }) => (\n <Button\n isSecondary\n onClick={open}\n className={!value ? \"button-select\" : \"button-replace\"}\n >\n {!value\n ? __(\"Select\", \"presto-player\")\n : __(\"Replace\", \"presto-player\")}\n </Button>\n )}\n />{\" \"}\n <p id={`video-block__logo-image-description-${option?.id}`} hidden>\n {value\n ? sprintf(\n /* translators: %s: poster image URL. */\n __(\"The current logo image url is %s\", \"presto-player\"),\n value\n )\n : __(\"There is no logo image currently selected\", \"presto-player\")}\n </p>\n {!!value && (\n <Button onClick={() => onSelect(\"\")} isTertiary>\n {__(\"Remove\", \"presto-player\")}\n </Button>\n )}\n </BaseControl>\n <br />\n </div>\n );\n};\n","export default ({ children, title, description }) => {\n return (\n <div className=\"presto-flow presto-settings__page\">\n <div className=\"presto-flow\" style={{ \"--presto-flow-space\": \"1em\" }}>\n {title && <h1>{title}</h1>}\n {description && <p>{description}</p>}\n </div>\n\n <div className=\"presto-settings__body \">\n <div className=\"presto-flow\">{children}</div>\n </div>\n </div>\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\nimport { BaseControl } from \"@wordpress/components\";\nimport { useEffect, useRef } from \"@wordpress/element\";\nimport classNames from \"classnames\";\n\nexport default ({ option, value, className, disabled, onChange }) => {\n let codeMirror;\n\n const handleChange = (instance) => {\n if (disabled) {\n return;\n }\n instance.save();\n onChange(textRef.current.value);\n };\n\n const textRef = useRef();\n useEffect(() => {\n if (!wp?.CodeMirror) {\n return;\n }\n codeMirror = wp.CodeMirror.fromTextArea(textRef.current, {\n type: \"text/css\",\n lineNumbers: true,\n });\n\n codeMirror.on(\"change\", handleChange);\n }, []);\n\n return (\n <div className={classNames(className, \"presto-settings__setting\")}>\n <BaseControl\n css={css`\n .CodeMirror {\n height: 200px;\n border: 1px solid #e3e3e3;\n border-radius: 4px;\n }\n `}\n label={option?.name}\n help={option?.help}\n >\n <textarea onChange={handleChange} ref={textRef} rows=\"5\" disabled>\n {value}\n </textarea>\n </BaseControl>\n </div>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { useEntityProp, store as coreStore } from \"@wordpress/core-data\";\nimport { useSelect } from \"@wordpress/data\";\nimport {\n ColorPicker,\n ComboboxControl,\n ToggleControl,\n RangeControl,\n Spinner,\n} from \"@wordpress/components\";\nimport Disabled from \"../components/Disabled\";\nimport Group from \"../components/Group\";\nimport Media from \"../components/Media\";\nimport Page from \"../components/Page\";\nimport CodeMirror from \"../components/CodeMirror\";\n\nexport default () => {\n const disabled = () => {\n if (prestoPlayer?.isPremium) {\n return false;\n }\n return {\n title: __(\"Pro Feature\", \"presto-player\"),\n heading: __(\"Unlock Presto Player Pro\", \"presto-player\"),\n message: __(\n \"Get this feature and more with the Pro version of Presto Player!\",\n \"presto-player\"\n ),\n link: \"https://prestoplayer.com\",\n };\n };\n\n const {\n presets,\n loadingPresets,\n audioPresets,\n loadingAudioPresets,\n } = useSelect((select) => {\n const presetArgs = [\"presto-player\", \"preset\"];\n const audioPresetArgs = [\"presto-player\", \"audio-preset\"];\n return {\n presets: select(coreStore).getEntityRecords(...presetArgs),\n loadingPresets: select(coreStore).isResolving(\n \"getEntityRecords\",\n presetArgs\n ),\n audioPresets: select(coreStore).getEntityRecords(...audioPresetArgs),\n loadingAudioPresets: select(coreStore).isResolving(\n \"getEntityRecords\",\n audioPresetArgs\n ),\n };\n }, []);\n\n const [presetSettings, setPresetSettings] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_presets\"\n );\n const updatePresetSettings = (data) => {\n setPresetSettings({\n ...(presetSettings || {}),\n ...data,\n });\n };\n\n const [audioPresetSettings, setAudioPresetSettings] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_audio_presets\"\n );\n const updateAudioPresetSettings = (data) => {\n setAudioPresetSettings({\n ...(audioPresetSettings || {}),\n ...data,\n });\n };\n\n const [analytics, setAnalytics] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_analytics\"\n );\n const updateAnalytics = (data) => {\n setAnalytics({\n ...(analytics || {}),\n ...data,\n });\n };\n\n const [branding, setBranding] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_branding\"\n );\n const updateBranding = (data) => {\n setBranding({\n ...(branding || {}),\n ...data,\n });\n };\n\n const [uninstall, setUninstall] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_uninstall\"\n );\n const updateUninstall = (data) => {\n setUninstall({\n ...(uninstall || {}),\n ...data,\n });\n };\n\n return (\n <Page\n title={__(\"General\", \"presto-player\")}\n description={__(\n \"Branding, analytics and uninstall data.\",\n \"presto-player\"\n )}\n >\n <Group\n title={__(\"Branding\", \"presto-player\")}\n description={__(\"Global player branding options\", \"presto-player\")}\n >\n <Disabled disabled={disabled()}>\n <Media\n className={\"presto-player__setting--logo\"}\n label={\n <>\n {__(\"Logo\", \"presto-player\")}{\" \"}\n {disabled() && (\n <span className=\"presto-options__pro-badge\">\n {__(\"Pro\", \"presto-player\")}\n </span>\n )}\n </>\n }\n onSelect={(image) => updateBranding({ logo: image?.url })}\n maxWidth={branding?.logo_width || 150}\n value={branding?.logo}\n />\n\n <div style={{ maxWidth: \"500px\" }}>\n <RangeControl\n className={\"presto-player__setting--logo-width\"}\n label={__(\"Logo Max Width\", \"presto-player\")}\n value={branding?.logo_width || 150}\n onChange={(logo_width) => updateBranding({ logo_width })}\n min={1}\n max={400}\n />\n </div>\n </Disabled>\n <ColorPicker\n className={\"presto-player__setting--brand-color\"}\n onChangeComplete={(value) => updateBranding({ color: value.hex })}\n color={branding?.color}\n />\n </Group>\n <Group\n title={__(\"Analytics\", \"presto-player\")}\n disabled={disabled()}\n description={__(\n \"Analytics settings for media plays, watch times and more.\",\n \"presto-player\"\n )}\n >\n <div>\n <ToggleControl\n className={\"presto-player__setting--analytics-enable\"}\n label={__(\"Enable\", \"presto-player\")}\n help={__(\"Enable view analytics for your media\", \"presto-player\")}\n checked={analytics?.enable}\n onChange={(enable) => updateAnalytics({ enable })}\n />\n\n {!!analytics?.enable && (\n <ToggleControl\n label={__(\"Auto-Purge Data (recommended)\")}\n help={__(\n \"Automatically purge data older than 90 days.\",\n \"presto-player\"\n )}\n className={\"presto-player__setting--analytics-enable\"}\n checked={\n analytics?.purge_data !== undefined\n ? analytics?.purge_data\n : true\n }\n onChange={(purge_data) => updateAnalytics({ purge_data })}\n />\n )}\n </div>\n </Group>\n <Group\n title={__(\"Presets\", \"presto-player\")}\n disabled={disabled()}\n description={__(\"Media presets settings.\", \"presto-player\")}\n >\n {!!loadingPresets ? (\n <Spinner />\n ) : (\n <ComboboxControl\n label={__(\"Select default preset for video.\", \"presto-player\")}\n value={presetSettings?.default_player_preset}\n options={(presets || []).map((preset) => {\n return {\n value: preset?.id,\n label: preset?.name,\n };\n })}\n onChange={(default_player_preset) =>\n updatePresetSettings({\n default_player_preset: default_player_preset || 1,\n })\n }\n />\n )}\n\n {!!loadingAudioPresets ? (\n <Spinner />\n ) : (\n <ComboboxControl\n label={__(\"Select default preset for audio.\", \"presto-player\")}\n value={audioPresetSettings?.default_player_preset}\n options={(audioPresets || []).map((preset) => {\n return {\n value: preset?.id,\n label: preset?.name,\n };\n })}\n onChange={(default_player_preset) =>\n updateAudioPresetSettings({\n default_player_preset: default_player_preset || 1,\n })\n }\n />\n )}\n </Group>\n <Group\n disabled={disabled()}\n title={__(\"Custom CSS\", \"presto-player\")}\n description={__(\n \"Quickly add custom css to the player web component.\",\n \"presto-player\"\n )}\n >\n <CodeMirror\n disabled={!prestoPlayer?.isPremium}\n option={{ id: \"player_css\" }}\n value={branding?.player_css}\n key={branding?.player_css}\n onChange={(player_css) => updateBranding({ player_css })}\n />\n </Group>\n <Group\n title={__(\"Uninstall Options\", \"presto-player\")}\n description={__(\n \"Options to remove data on uninstall.\",\n \"presto-player\"\n )}\n >\n <ToggleControl\n label={__(\"Remove data on uninstall\")}\n help={__(\"This removes all data on uninstall.\", \"presto-player\")}\n className=\"presto-player__setting--uninstall\"\n checked={uninstall?.uninstall_data}\n onChange={(uninstall_data) => {\n if (uninstall_data) {\n const r = confirm(\n __(\n \"Caution: Data Loss. Are you sure you want to remove all the data from this plugin? This is irreversible!\",\n \"presto-player\"\n )\n );\n if (!r) return;\n }\n updateUninstall({ uninstall_data });\n }}\n />\n </Group>\n </Page>\n );\n};\n","/** @jsx jsx */\nimport { css, jsx } from \"@emotion/core\";\n\nimport { __ } from \"@wordpress/i18n\";\nimport { Notice, ExternalLink, ToggleControl } from \"@wordpress/components\";\nimport { useEntityProp } from \"@wordpress/core-data\";\n\nimport Group from \"../components/Group\";\nimport Page from \"../components/Page\";\n\nexport default () => {\n const [performance, setPerformance] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_performance\"\n );\n const updatePerformance = (data) => {\n setPerformance({\n ...(performance || {}),\n ...data,\n });\n };\n\n return (\n <Page\n title={__(\"Performance\", \"presto-player\")}\n description={__(\"Player performance preferences.\", \"presto-player\")}\n >\n <Group\n title={__(\"Performance\", \"presto-player\")}\n description={__(\n \"Performance options for player loading.\",\n \"presto-player\"\n )}\n >\n <div>\n <ToggleControl\n className={\"presto-player__setting--module-enabled\"}\n label={__(\"Dynamically Load JavaScript\", \"presto-player\")}\n help={__(\n \"Dynamically load javascript modules on the page which can significantly reduce javascript size and increase performance.\",\n \"presto-player\"\n )}\n checked={performance?.module_enabled}\n onChange={(module_enabled) => updatePerformance({ module_enabled })}\n />\n\n {!!performance?.module_enabled && (\n <Notice\n css={css`\n background: #f3f4f5 !important;\n margin-bottom: 20px !important;\n `}\n className=\"presto-notice\"\n status=\"info\"\n isDismissible={false}\n >\n <div>\n <strong>{__(\"Please Note\", \"presto-player\")}</strong>\n </div>\n <div>\n {__(\n \"You may need to exclude the player script from combining, as well as enable CORS requests for some CDNs.\",\n \"presto-player\"\n )}{\" \"}\n <ExternalLink href=\"https://prestoplayer.com/docs/performance-preferences-explained#global-player-performance-setting\">\n {__(\"Learn More\", \"presto-player\")}\n </ExternalLink>\n </div>\n </Notice>\n )}\n </div>\n\n <ToggleControl\n className={\"presto-player__setting--automations\"}\n label={__(\n \"Enable Ajax Requests for Progress Integrations\",\n \"presto-player\"\n )}\n help={__(\n \"Keep this on unless you do not plan on using automation, LMS or membership integrations.\",\n \"presto-player\"\n )}\n checked={performance?.automations}\n onChange={(automations) => updatePerformance({ automations })}\n />\n </Group>\n </Page>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { TextControl } from \"@wordpress/components\";\nimport { useEntityProp } from \"@wordpress/core-data\";\n\nexport default () => {\n const [classic, setClassic] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_bunny_pull_zones\"\n );\n const updateClassic = (data) => {\n setClassic({\n ...(classic || {}),\n ...data,\n });\n };\n\n const {\n public_id,\n public_hostname,\n private_id,\n private_hostname,\n private_security_key,\n } = classic || {};\n\n return (\n <>\n <h2 style={{ marginTop: \"40px\" }}>\n {__(\"Bunny.net Storage (Classic)\", \"presto-player\")}\n </h2>\n <p style={{ fontSize: \"12px\", color: \"#757575\" }}>\n {__(\n 'Note: To Change your API key, please click \"Reconnect\" from a bunny block.',\n \"presto-player\"\n )}\n </p>\n\n <TextControl\n label={__(\"Public ID\", \"presto-player\")}\n help={__(\"The ID of the public pull zone to use.\", \"presto-player\")}\n value={public_id}\n onChange={(public_id) => updateClassic({ public_id })}\n />\n\n <TextControl\n label={__(\"Public Host Name\", \"presto-player\")}\n help={__(\"The hostname to use for this pullzone.\", \"presto-player\")}\n value={public_hostname}\n onChange={(public_hostname) => updateClassic({ public_hostname })}\n />\n\n <TextControl\n label={__(\"Private ID\", \"presto-player\")}\n help={__(\"The ID of the private pull zone to use.\", \"presto-player\")}\n value={private_id}\n onChange={(private_id) => updateClassic({ private_id })}\n />\n\n <TextControl\n label={__(\"Private Host Name\", \"presto-player\")}\n help={__(\n \"The hostname to use for the private pullzone.\",\n \"presto-player\"\n )}\n value={private_hostname}\n onChange={(private_hostname) => updateClassic({ private_hostname })}\n />\n\n <TextControl\n label={__(\"Private Url Token Authentication Key\", \"presto-player\")}\n help={__(\n \"Update the security token used to sign private urls.\",\n \"presto-player\"\n )}\n type=\"password\"\n value={private_security_key}\n onChange={(private_security_key) =>\n updateClassic({ private_security_key })\n }\n />\n </>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { TextControl } from \"@wordpress/components\";\nimport { useEntityProp } from \"@wordpress/core-data\";\n\nexport default () => {\n const [stream, setStream] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_bunny_stream_public\"\n );\n const updateStream = (data) => {\n setStream({\n ...(stream || {}),\n ...data,\n });\n };\n\n const { video_library_api_key, pull_zone_url, video_library_id } =\n stream || {};\n\n return (\n <>\n <TextControl\n label={__(\"Public Stream Library ID\", \"presto-player\")}\n help={__(\"The ID of the video library to use.\", \"presto-player\")}\n value={video_library_id}\n onChange={(video_library_id) => updateStream({ video_library_id })}\n />\n\n <TextControl\n label={__(\"Public Stream Library API Key\", \"presto-player\")}\n help={__(\n \"The API key for the above video library for read/write access.\",\n \"presto-player\"\n )}\n value={video_library_api_key}\n onChange={(video_library_api_key) =>\n updateStream({ video_library_api_key })\n }\n />\n\n <TextControl\n label={__(\"Public Stream CDN Hostname\", \"presto-player\")}\n help={__(\n \"The public cdn hostname for the video library.\",\n \"presto-player\"\n )}\n value={pull_zone_url}\n onChange={(pull_zone_url) => updateStream({ pull_zone_url })}\n />\n </>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { TextControl } from \"@wordpress/components\";\nimport { useEntityProp } from \"@wordpress/core-data\";\n\nexport default () => {\n const [stream, setStream] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_bunny_stream_private\"\n );\n const updateStream = (data) => {\n setStream({\n ...(stream || {}),\n ...data,\n });\n };\n\n const {\n video_library_api_key,\n pull_zone_url,\n video_library_id,\n token_auth_key,\n } = stream || {};\n\n return (\n <>\n <TextControl\n label={__(\"Private Stream Library ID\", \"presto-player\")}\n help={__(\"The ID of the video library to use.\", \"presto-player\")}\n value={video_library_id}\n onChange={(video_library_id) => updateStream({ video_library_id })}\n />\n\n <TextControl\n label={__(\"Private Stream Library API Key\", \"presto-player\")}\n help={__(\n \"The API key for the above video library for read/write access.\",\n \"presto-player\"\n )}\n value={video_library_api_key}\n onChange={(video_library_api_key) =>\n updateStream({ video_library_api_key })\n }\n />\n\n <TextControl\n label={__(\"Private Stream CDN Hostname\", \"presto-player\")}\n help={__(\n \"The public cdn hostname for the video library.\",\n \"presto-player\"\n )}\n value={pull_zone_url}\n onChange={(pull_zone_url) => updateStream({ pull_zone_url })}\n />\n\n <TextControl\n label={__(\"Private Stream Token Authentication Key\", \"presto-player\")}\n help={__(\n \"The token authentication key used to sign private urls.\",\n \"presto-player\"\n )}\n value={token_auth_key}\n onChange={(token_auth_key) => updateStream({ token_auth_key })}\n />\n </>\n );\n};\n","import { __ } from \"@wordpress/i18n\";\nimport { useEntityProp } from \"@wordpress/core-data\";\nimport PublicStream from \"./PublicStream\";\nimport PrivateStream from \"./PrivateStream\";\n\nexport default () => {\n const [stream, setStream] = useEntityProp(\n \"root\",\n \"site\",\n \"presto_player_bunny_stream_public\"\n );\n\n if (!stream) return null;\n\n return (\n <>\n <h2 style={{ marginTop: \"40px\" }}>\n {__(\"Bunny.net Stream\", \"presto-player\")}\n </h2>\n <PublicStream />\n <PrivateStream />\n </>\n );\n};\n","const { __ } = wp.i18n;\nconst {\n Button,\n Panel,\n PanelBody,\n Flex,\n FlexBlock,\n Notice,\n Spinner,\n} = wp.components;\nconst { useState, useEffect } = wp.element;\n\nexport default () => {\n const [step, setStep] = useState(0);\n const [progress, setProgress] = useState(0);\n const [error, setError] = useState(\"\");\n const [url, setURL] = useState(0);\n\n const exportEmails = async () => {\n setError(\"\");\n try {\n const {\n percentage,\n step: currentStep,\n url: fetchedURL,\n } = await wp.apiFetch({\n path: \"/presto-player/v1/email/export\",\n method: \"post\",\n data: {\n step,\n },\n });\n\n setStep(currentStep);\n setProgress(percentage);\n setURL(fetchedURL);\n } catch (e) {\n setProgress(0);\n setError(e?.message || __(\"Something went wrong\", \"presto-player\"));\n }\n };\n\n useEffect(() => {\n if (step && step != \"done\") {\n exportEmails();\n }\n }, [step]);\n\n useEffect(() => {\n if (url) {\n window.open(url);\n }\n }, [url]);\n\n return (\n <Panel>\n <PanelBody\n title={\n <Flex>\n <FlexBlock>{__(\"Other\", \"presto-player\")}</FlexBlock>\n </Flex>\n }\n initialOpen={false}\n >\n <h2>{__(\"Manual Export\", \"presto-player\")}</h2>\n <p>\n {__(\n \"Using a service not listed here? You can export contacts and manually upload them to a service.\",\n \"presto-player\"\n )}\n </p>\n {error && (\n <Notice\n className=\"presto-notice\"\n status=\"error\"\n onRemove={() => setError(\"\")}\n >\n {error}\n </Notice>\n )}\n <Flex align=\"center\" justify=\"flex-start\">\n <Button\n isPrimary\n onClick={(e) => {\n setStep(1);\n setProgress(1);\n e.preventDefault();\n }}\n >\n {__(\"Download CSV File\", \"presto-player\")}\n </Button>\n {!!progress && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <Spinner style={{ marginTop: 0 }} />\n <span>Exporting... {progress}% Complete</span>\n </div>\n )}\n </Flex>\n </PanelBody>\n </Panel>\n );\n};\n","const { Button, Card, CardBody } = wp.components;\nconst { dispatch } = wp.data;\n\nexport default ({ option, value, optionName, className }) => {\n return (\n <Card isBorderless className={className}>\n <CardBody isShady>\n {!!option?.name && <h2>{option.name}</h2>}\n {!!option.help && <p>{option.help}</p>}\n {!!option?.button?.text && (\n <Button\n isPrimary\n target={option?.button?.target}\n href={option?.button?.link}\n >\n {option.button.text}\n </Button>\n )}\n </CardBody>\n </Card>\n );\n};\n","const { __ } = wp.i18n;\n\nconst {\n Button,\n Panel,\n PanelBody,\n Flex,\n Modal,\n FlexBlock,\n FlexItem,\n PanelRow,\n} = wp.components;\n\nconst { useState } = wp.element;\n\nexport default ({\n connected,\n title,\n children,\n onConnect,\n isBusy,\n connectButtonText,\n disconnectButtonText,\n onDisconnect,\n}) => {\n const [confirm, setConfirm] = useState(false);\n\n return (\n <Panel>\n <PanelBody\n title={\n <Flex>\n <FlexBlock>{title}</FlexBlock>\n <FlexItem>\n {connected ? (\n <Button isSmall isPrimary style={{ marginRight: \"30px\" }}>\n {__(\"Connected\", \"presto-player\")}\n </Button>\n ) : (\n <Button isSmall isSecondary style={{ marginRight: \"30px\" }}>\n {__(\"Not Connected\", \"presto-player\")}\n </Button>\n )}\n </FlexItem>\n </Flex>\n }\n initialOpen={false}\n >\n <form\n onSubmit={(e) => {\n e.preventDefault();\n onConnect();\n }}\n disabled={isBusy}\n >\n {children}\n <PanelRow>\n <div>\n {!connected ? (\n <Button\n isPrimary\n isBusy={isBusy}\n disabled={isBusy}\n type=\"submit\"\n >\n {connectButtonText\n ? connectButtonText\n : __(\"Connect\", \"presto-player\")}\n </Button>\n ) : (\n <div>\n {\" \"}\n <Button\n isSecondary\n isBusy={isBusy}\n disabled={isBusy}\n onClick={(e) => {\n e.preventDefault();\n setConfirm(true);\n }}\n >\n {disconnectButtonText\n ? disconnectButtonText\n : __(\"Disconnect\", \"presto-player\")}\n </Button>\n </div>\n )}\n </div>\n </PanelRow>\n </form>\n </PanelBody>\n\n {confirm && (\n <Modal\n className=\"presto-player__modal-confirm\"\n title={__(\"Are you sure?\", \"presto-player\")}\n style={{ \"max-width\": \"350px\" }}\n onRequestClose={() => setConfirm(false)}\n >\n <p>\n {__(\n \"Are you sure you want to disconnect this integration?\",\n \"presto-player\"\n )}\n </p>\n <Button\n className=\"presto-player__modal-confirm-button\"\n isDestructive\n onClick={() => {\n onDisconnect && onDisconnect();\n setConfirm(false);\n }}\n >\n {__(\"Disconnect\", \"presto-player\")}\n </Button>\n <Button onClick={() => setConfirm(false)}>\n {__(\"Cancel\", \"presto-player\")}\n </Button>\n </Modal>\n )}\n </Panel>\n );\n};\n","const { TextControl } = wp.components;\nconst { dispatch } = wp.data;\nimport classNames from \"classnames\";\n\nexport default (props) => {\n const { option, value, optionName, className } = props;\n return (\n <div className=\"presto-settings__setting is-text-control\">\n <TextControl\n className={classNames(\n className,\n \"presto-settings__setting is-media-control\"\n )}\n label={option?.name}\n value={value}\n type={option?.type}\n help={option?.help}\n placeholder={option?.placeholder}\n onChange={(value) =>\n dispatch(\"presto-player/settings\").updateSetting(\n option.id,\n value,\n optionName\n )\n }\n {...props}\n />\n </div>\n );\n};\n","/**\n * WordPress dependencies\n */\nimport { __ } from \"@wordpress/i18n\";\nimport { useState } from \"@wordpress/element\";\nimport apiFetch from \"@wordpress/api-fetch\";\nimport { createHigherOrderComponent } from \"@wordpress/compose\";\nimport { useEntityProp } from \"@wordpress/core-data\";\n\n/**\n * Higher order component factory\n *\n * @return {Function} The higher order component.\n */\nexport default ({ name }) =>\n createHigherOrderComponent(\n (WrappedComponent) => (props) => {\n const [error, setError] = useState(\"\");\n const [success, setSuccess] = useState(\"\");\n const [isBusy, setIsBusy] = useState(false);\n\n const [setting, setSetting] = useEntityProp(\"root\", \"site\", name);\n const updateSetting = (data) => {\n setSetting({\n ...(setting || {}),\n ...data,\n });\n };\n\n const makeRequest = async ({\n path,\n data = {},\n message = __(\"Success\", \"presto-player\"),\n success,\n error,\n }) => {\n setError(\"\");\n setSuccess(\"\");\n setIsBusy(true);\n\n try {\n let response = await apiFetch({\n path,\n method: \"post\",\n data,\n });\n success && success(response);\n setSuccess(message);\n } catch (e) {\n if (e?.message) {\n setError(e.message);\n error && error(e);\n }\n } finally {\n setIsBusy(false);\n }\n };\n\n return (\n <WrappedComponent\n success={success}\n setSuccess={setSuccess}\n setError={setError}\n error={error}\n isBusy={isBusy}\n setting={setting}\n updateSetting={updateSetting}\n makeRequest={makeRequest}\n {...props}\n />\n );\n },\n \"withIntegration\"\n );\n","import { __ } from \"@wordpress/i18n\";\nimport { BaseControl, PanelRow, Notice } from \"@wordpress/components\";\nimport { compose } from \"@wordpress/compose\";\n\nimport Integration from \"../../../components/Integration\";\nimport TextControl from \"../../../components/TextControl\";\nimport withIntegration from \"./withIntegration\";\n\nexport default compose([\n withIntegration({ name: \"presto_player_activecampaign\" }),\n])(\n ({\n success,\n setSuccess,\n error,\n setError,\n isBusy,\n makeRequest,\n setting,\n updateSetting,\n }) => {\n const setData = (props) => {\n updateSetting({\n ...props,\n });\n };\n\n const onConnect = () => {\n makeRequest({\n path: \"/presto-player/v1/activecampaign/connect\",\n data: { api_key: setting?.api_key, url: setting?.url },\n message: __(\"Connected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n const onDisconnect = async () => {\n makeRequest({\n path: \"/presto-player/v1/activecampaign/disconnect\",\n message: __(\"Disconnected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n return (\n <Integration\n title={__(\"ActiveCampaign\")}\n connected={setting?.connected}\n onConnect={onConnect}\n onDisconnect={onDisconnect}\n isBusy={isBusy}\n >\n {error && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"error\"\n onRemove={() => setError(\"\")}\n >\n {error}\n </Notice>\n </PanelRow>\n )}\n {success && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"success\"\n onRemove={() => setSuccess(\"\")}\n >\n {success}\n </Notice>\n </PanelRow>\n )}\n <PanelRow>\n <BaseControl>\n <TextControl\n label={__(\"Your ActiveCampaign Url\", \"presto-player\")}\n type=\"url\"\n help={__(\n \"You can find this on your Settings > Developer page.\",\n \"presto-player\"\n )}\n value={setting?.url}\n onChange={(url) => updateSetting({ url })}\n />\n <TextControl\n label={__(\"Your ActiveCampaign API key\", \"presto-player\")}\n help={__(\n \"You can find this on your Settings > Developer page.\",\n \"presto-player\"\n )}\n value={setting?.api_key}\n onChange={(api_key) => updateSetting({ api_key })}\n />\n </BaseControl>\n </PanelRow>\n </Integration>\n );\n }\n);\n","import { Notice, PanelRow } from \"@wordpress/components\";\nimport { compose } from \"@wordpress/compose\";\nimport { __ } from \"@wordpress/i18n\";\n\nimport Integration from \"../../../components/Integration\";\nimport withIntegration from \"./withIntegration\";\n\nexport default compose([withIntegration({ name: \"presto_player_fluentcrm\" })])(\n ({ error, setError, isBusy, makeRequest, setting, updateSetting }) => {\n const setData = (props) => {\n updateSetting({\n ...props,\n });\n };\n\n const { connected } = setting || {};\n\n const onConnect = () => {\n makeRequest({\n path: \"/presto-player/v1/fluentcrm/connect\",\n message: __(\"Installed and connected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n const onDisconnect = async () => {\n makeRequest({\n path: \"/presto-player/v1/fluentcrm/disconnect\",\n message: __(\"Deactivated\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n return (\n <Integration\n title={__(\"FluentCRM\")}\n connected={connected}\n onConnect={onConnect}\n onDisconnect={onDisconnect}\n connectButtonText={__(\"Install FluentCRM Plugin\", \"presto-player\")}\n disconnectButtonText={__(\n \"Deactivate FluentCRM Plugin\",\n \"presto-player\"\n )}\n isBusy={isBusy}\n >\n {error && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"error\"\n onRemove={() => setError(\"\")}\n >\n {error}\n </Notice>\n </PanelRow>\n )}\n {connected && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"success\"\n isDismissible={false}\n >\n {__(\"Installed and connected!\", \"presto-player\")}\n </Notice>\n </PanelRow>\n )}\n </Integration>\n );\n }\n);\n","import {\n BaseControl,\n ExternalLink,\n Notice,\n PanelRow,\n} from \"@wordpress/components\";\nimport { compose } from \"@wordpress/compose\";\nimport { __ } from \"@wordpress/i18n\";\n\nimport Integration from \"../../../components/Integration\";\nimport TextControl from \"../../../components/TextControl\";\nimport withIntegration from \"./withIntegration\";\n\nexport default compose([withIntegration({ name: \"presto_player_mailchimp\" })])(\n ({\n success,\n setSuccess,\n error,\n setError,\n isBusy,\n makeRequest,\n setting,\n updateSetting,\n }) => {\n const { api_key, connected } = setting || {};\n\n const setData = (props) => {\n updateSetting({\n ...props,\n });\n };\n\n const onConnect = () => {\n makeRequest({\n path: \"/presto-player/v1/mailchimp/connect\",\n data: { api_key },\n message: __(\"Connected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n const onDisconnect = async () => {\n makeRequest({\n path: \"/presto-player/v1/mailchimp/disconnect\",\n message: __(\"Disconnected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n return (\n <Integration\n title={__(\"Mailchimp\")}\n connected={connected}\n onDisconnect={onDisconnect}\n onConnect={onConnect}\n isBusy={isBusy}\n >\n {error && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"error\"\n onRemove={() => setError(\"\")}\n >\n {error}\n </Notice>\n </PanelRow>\n )}\n {success && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"success\"\n onRemove={() => setSuccess(\"\")}\n >\n {success}\n </Notice>\n </PanelRow>\n )}\n <PanelRow>\n <BaseControl>\n <TextControl\n className=\"presto-player__setting--mailchimp-api_key\"\n label={__(\"Your Mailchimp API key\", \"presto-player\")}\n help={\n <p>\n {__(\n \"You can create a new key on your mailchimp account page.\",\n \"presto-player\"\n )}{\" \"}\n <ExternalLink href=\"https://us11.admin.mailchimp.com/account/api/\">\n {__(\"Get My API Key\", \"presto-player\")}\n </ExternalLink>\n </p>\n }\n value={api_key}\n onChange={(api_key) => updateSetting({ api_key })}\n />\n </BaseControl>\n </PanelRow>\n </Integration>\n );\n }\n);\n","import {\n BaseControl,\n ExternalLink,\n Notice,\n PanelRow,\n} from \"@wordpress/components\";\nimport { compose } from \"@wordpress/compose\";\nimport { __ } from \"@wordpress/i18n\";\n\nimport Integration from \"../../../components/Integration\";\nimport TextControl from \"../../../components/TextControl\";\nimport withIntegration from \"./withIntegration\";\n\nexport default compose([withIntegration({ name: \"presto_player_mailerlite\" })])(\n ({\n success,\n setSuccess,\n error,\n setError,\n isBusy,\n makeRequest,\n setting,\n updateSetting,\n }) => {\n const { api_key, connected } = setting || {};\n\n const setData = (props) => {\n updateSetting({\n ...props,\n });\n };\n\n const onConnect = () => {\n makeRequest({\n path: \"/presto-player/v1/mailerlite/connect\",\n data: { api_key },\n message: __(\"Connected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n const onDisconnect = async () => {\n makeRequest({\n path: \"/presto-player/v1/mailerlite/disconnect\",\n message: __(\"Disconnected\", \"presto-player\"),\n success: setData,\n error: setData,\n });\n };\n\n return (\n <Integration\n title={__(\"Mailerlite\")}\n connected={connected}\n onDisconnect={onDisconnect}\n onConnect={onConnect}\n isBusy={isBusy}\n >\n {error && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"error\"\n onRemove={() => setError(\"\")}\n >\n {error}\n </Notice>\n </PanelRow>\n )}\n {success && (\n <PanelRow>\n <Notice\n className=\"presto-notice\"\n status=\"success\"\n onRemove={() => setSuccess(\"\")}\n >\n {success}\n </Notice>\n </PanelRow>\n )}\n <PanelRow>\n <BaseControl>\n <TextControl\n className=\"presto-player__setting--mailerlite-api_key\"\n label={__(\"Your MailerLite API key\", \"presto-player\")}\n help={\n <p>\n {__(\n \"You can create a new key on your MailerLite account page.\",\n \"presto-player\"\n )}{\" \"}\n <ExternalLink href=\"https://app.mailerlite.com/integrations/api/\">\n {__(\"Get My API Key\", \"presto-player\")}\n </ExternalLink>\n </p>\n }\n value={api_key}\n onChange={(api_key) => updateSetting({ api_key })}\n />\n </BaseControl>\n </PanelRow>\n </Integration>\n );\n }\n);\n","import {\n BaseControl,\n Button,\n Flex,\n TextControl,\n ToolbarButton,\n} from \"@wordpress/components\";\nimport { __ } from \"@wordpress/i18n\";\n\nexport default ({ headers, setHeaders }) => {\n const updateHeaders = (data) => {\n setHeaders([...(headers || []), ...data]);\n };\n\n const addHeader = (header) => {\n setHeaders([...(headers || []), ...[header]]);\n };\n const updateHeader = (data, index) => {\n setHeaders(\n (headers || []).map((item, i) => {\n if (i !== index) {\n // This isn't the item we care about - keep it as-is\n return item;\n }\n\n // Otherwise, this is the one we want - return an updated value\n return {\n ...item,\n ...data,\n };\n })\n );\n };\n\n const removeHeader = (index) =>\n setHeaders((headers || []).filter((_, i) => i !== index));\n\n return (\n <>\n {(headers || []).map(({ name, value }, index) => {\n return (\n <Flex key={index} align=\"center\">\n <TextControl\n placeholder={__(\"Header Name\", \"presto-player\")}\n value={name}\n onChange={(name) => updateHeader({ name }, index)}\n />\n <TextControl\n placeholder={__(\"New Value\", \"presto-player\")}\n value={value}\n onChange={(value) => updateHeader({ value }, index)}\n />\n <BaseControl>\n <ToolbarButton icon=\"trash\" onClick={() => removeHeader(index)} />\n </BaseControl>\n </Flex>\n );\n })}\n\n <div>\n <Button\n isSecondary\n isSmall\n onClick={() => addHeader({ name: \"\", value: \"\" })}\n >\n {__(\"Add Header\", \"presto-player\")}\n </Button>\n </div>\n </>\n );\n};\n","import { css, jsx } from \"@emotion/core\";\n/** @jsx jsx */\nimport {\n BaseControl,\n Button,\n Card,\n CardBody,\n Flex,\n Modal,\n SelectControl,\n TextControl,\n ToggleControl,\n} from \"@wordpress/components\";\nimport { store as coreStore } from \"@wordpress/core-data\";\nimport { useDispatch } from \"@wordpress/data\";\nimport { useState } from \"@wordpress/element\";\nimport { __ } from \"@wordpress/i18n\";\nimport { store as noticesStore } from \"@wordpress/notices\";\n\nimport Headers fr
|