UNPKG

@wistia/wistia-player-react

Version:

An embeddable wistia-player web component and React wrapper to add responsive, lightweight, and SEO-friendly videos to your site.

1,039 lines (1,033 loc) 765 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/utils/getMergedEmbedOption.ts var getMergedEmbedOption; var init_getMergedEmbedOption = __esm({ "src/utils/getMergedEmbedOption.ts"() { getMergedEmbedOption = (mediaId, optionKey, optionValue) => { let finalEmbedOption = optionValue; if (typeof window === "undefined") { return finalEmbedOption; } if (window.wistiaOptions?._all?.[optionKey] !== void 0) { finalEmbedOption = window.wistiaOptions._all[optionKey]; } const mediaIdOptions = window.wistiaOptions?.[mediaId]; if (mediaIdOptions !== void 0) { const mediaIdOptionValue = mediaIdOptions[optionKey]; if (optionValue !== void 0) { finalEmbedOption = mediaIdOptionValue; } } return finalEmbedOption; }; } }); // src/utils/camelCaseToKebabCase.ts var camelCaseToKebabCase; var init_camelCaseToKebabCase = __esm({ "src/utils/camelCaseToKebabCase.ts"() { camelCaseToKebabCase = (str) => { return str.replace( /[A-Z]+(?![a-z])|[A-Z]/g, (letter, idx) => (idx !== 0 ? "-" : "") + letter.toLowerCase() ); }; } }); // src/utils/swatch.ts var getSwatchMetaData, swatchUrl, getSwatchAspectRatio, wistiaPlayerStyleBlock; var init_swatch = __esm({ "src/utils/swatch.ts"() { init_camelCaseToKebabCase(); getSwatchMetaData = async (url) => { const swatch = new Image(); swatch.src = url; await swatch.decode(); return swatch; }; swatchUrl = (mediaId, embedHost) => `https://${embedHost}/embed/medias/${mediaId}/swatch`; getSwatchAspectRatio = async (mediaId, embedHost = "fast.wistia.com") => { const swatchImg = await getSwatchMetaData(swatchUrl(mediaId, embedHost)); const { naturalHeight, naturalWidth } = swatchImg; return naturalWidth / naturalHeight; }; wistiaPlayerStyleBlock = ({ mediaId, embedHost = "fast.wistia.com", aspect = 1.7, shouldLoadSwatch = true, roundedPlayer = 0 }) => { const CSSProperties = { background: shouldLoadSwatch ? `center / contain no-repeat url(${swatchUrl(mediaId, embedHost)})` : void 0, borderRadius: `${roundedPlayer}px`, display: "block", filter: "blur(5px)", paddingTop: `${100 / aspect}%` }; return ` wistia-player[media-id='${mediaId}']:not(:defined) { ${Object.entries(CSSProperties).map(([key, value]) => `${camelCaseToKebabCase(key)}: ${value};`).join("\r\n")} } wistia-player[media-id='${mediaId}']:state(--initializing) { ${Object.entries(CSSProperties).map(([key, value]) => `${camelCaseToKebabCase(key)}: ${value};`).join("\r\n")} } `; }; } }); // ../wistia-player/dist/wistia-player.js var wistia_player_exports = {}; __export(wistia_player_exports, { WistiaPlayer: () => __webpack_exports__WistiaPlayer, wistiaSwatchElement: () => __webpack_exports__wistiaSwatchElement }); function __webpack_require__2(moduleId) { var cachedModule = __webpack_module_cache__[moduleId]; if (cachedModule !== void 0) { return cachedModule.exports; } var module2 = __webpack_module_cache__[moduleId] = { /******/ id: moduleId, /******/ loaded: false, /******/ exports: {} /******/ }; __webpack_modules__[moduleId](module2, module2.exports, __webpack_require__2); module2.loaded = true; return module2.exports; } function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i2, u, a = [], f = true, o = false; try { if (i2 = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = false; } else for (; !(f = (e = i2.call(t)).done) && (a.push(e.value), a.length !== l); f = true) ; } catch (r2) { o = true, n = r2; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } function _regeneratorRuntime() { "use strict"; _regeneratorRuntime = function _regeneratorRuntime2() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function(t2, e2, r2) { t2[e2] = r2.value; }, i2 = "function" == typeof Symbol ? Symbol : {}, a = i2.iterator || "@@iterator", c = i2.asyncIterator || "@@asyncIterator", u = i2.toStringTag || "@@toStringTag"; function define(t2, e2, r2) { return Object.defineProperty(t2, e2, { value: r2, enumerable: true, configurable: true, writable: true }), t2[e2]; } try { define({}, ""); } catch (t2) { define = function define2(t3, e2, r2) { return t3[e2] = r2; }; } function wrap(t2, e2, r2, n2) { var i3 = e2 && e2.prototype instanceof Generator ? e2 : Generator, a2 = Object.create(i3.prototype), c2 = new Context(n2 || []); return o(a2, "_invoke", { value: makeInvokeMethod(t2, r2, c2) }), a2; } function tryCatch(t2, e2, r2) { try { return { type: "normal", arg: t2.call(e2, r2) }; } catch (t3) { return { type: "throw", arg: t3 }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() { } function GeneratorFunction() { } function GeneratorFunctionPrototype() { } var p = {}; define(p, a, function() { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t2) { ["next", "throw", "return"].forEach(function(e2) { define(t2, e2, function(t3) { return this._invoke(e2, t3); }); }); } function AsyncIterator(t2, e2) { function invoke(r3, o2, i3, a2) { var c2 = tryCatch(t2[r3], t2, o2); if ("throw" !== c2.type) { var u2 = c2.arg, h2 = u2.value; return h2 && "object" == typeof h2 && n.call(h2, "__await") ? e2.resolve(h2.__await).then(function(t3) { invoke("next", t3, i3, a2); }, function(t3) { invoke("throw", t3, i3, a2); }) : e2.resolve(h2).then(function(t3) { u2.value = t3, i3(u2); }, function(t3) { return invoke("throw", t3, i3, a2); }); } a2(c2.arg); } var r2; o(this, "_invoke", { value: function value(t3, n2) { function callInvokeWithMethodAndArg() { return new e2(function(e3, r3) { invoke(t3, n2, e3, r3); }); } return r2 = r2 ? r2.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e2, r2, n2) { var o2 = h; return function(i3, a2) { if (o2 === f) throw Error("Generator is already running"); if (o2 === s) { if ("throw" === i3) throw a2; return { value: t, done: true }; } for (n2.method = i3, n2.arg = a2; ; ) { var c2 = n2.delegate; if (c2) { var u2 = maybeInvokeDelegate(c2, n2); if (u2) { if (u2 === y) continue; return u2; } } if ("next" === n2.method) n2.sent = n2._sent = n2.arg; else if ("throw" === n2.method) { if (o2 === h) throw o2 = s, n2.arg; n2.dispatchException(n2.arg); } else "return" === n2.method && n2.abrupt("return", n2.arg); o2 = f; var p2 = tryCatch(e2, r2, n2); if ("normal" === p2.type) { if (o2 = n2.done ? s : l, p2.arg === y) continue; return { value: p2.arg, done: n2.done }; } "throw" === p2.type && (o2 = s, n2.method = "throw", n2.arg = p2.arg); } }; } function maybeInvokeDelegate(e2, r2) { var n2 = r2.method, o2 = e2.iterator[n2]; if (o2 === t) return r2.delegate = null, "throw" === n2 && e2.iterator.return && (r2.method = "return", r2.arg = t, maybeInvokeDelegate(e2, r2), "throw" === r2.method) || "return" !== n2 && (r2.method = "throw", r2.arg = new TypeError("The iterator does not provide a '" + n2 + "' method")), y; var i3 = tryCatch(o2, e2.iterator, r2.arg); if ("throw" === i3.type) return r2.method = "throw", r2.arg = i3.arg, r2.delegate = null, y; var a2 = i3.arg; return a2 ? a2.done ? (r2[e2.resultName] = a2.value, r2.next = e2.nextLoc, "return" !== r2.method && (r2.method = "next", r2.arg = t), r2.delegate = null, y) : a2 : (r2.method = "throw", r2.arg = new TypeError("iterator result is not an object"), r2.delegate = null, y); } function pushTryEntry(t2) { var e2 = { tryLoc: t2[0] }; 1 in t2 && (e2.catchLoc = t2[1]), 2 in t2 && (e2.finallyLoc = t2[2], e2.afterLoc = t2[3]), this.tryEntries.push(e2); } function resetTryEntry(t2) { var e2 = t2.completion || {}; e2.type = "normal", delete e2.arg, t2.completion = e2; } function Context(t2) { this.tryEntries = [{ tryLoc: "root" }], t2.forEach(pushTryEntry, this), this.reset(true); } function values(e2) { if (e2 || "" === e2) { var r2 = e2[a]; if (r2) return r2.call(e2); if ("function" == typeof e2.next) return e2; if (!isNaN(e2.length)) { var o2 = -1, i3 = function next() { for (; ++o2 < e2.length; ) if (n.call(e2, o2)) return next.value = e2[o2], next.done = false, next; return next.value = t, next.done = true, next; }; return i3.next = i3; } } throw new TypeError(typeof e2 + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: true }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function(t2) { var e2 = "function" == typeof t2 && t2.constructor; return !!e2 && (e2 === GeneratorFunction || "GeneratorFunction" === (e2.displayName || e2.name)); }, e.mark = function(t2) { return Object.setPrototypeOf ? Object.setPrototypeOf(t2, GeneratorFunctionPrototype) : (t2.__proto__ = GeneratorFunctionPrototype, define(t2, u, "GeneratorFunction")), t2.prototype = Object.create(g), t2; }, e.awrap = function(t2) { return { __await: t2 }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function() { return this; }), e.AsyncIterator = AsyncIterator, e.async = function(t2, r2, n2, o2, i3) { void 0 === i3 && (i3 = Promise); var a2 = new AsyncIterator(wrap(t2, r2, n2, o2), i3); return e.isGeneratorFunction(r2) ? a2 : a2.next().then(function(t3) { return t3.done ? t3.value : a2.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function() { return this; }), define(g, "toString", function() { return "[object Generator]"; }), e.keys = function(t2) { var e2 = Object(t2), r2 = []; for (var n2 in e2) r2.push(n2); return r2.reverse(), function next() { for (; r2.length; ) { var t3 = r2.pop(); if (t3 in e2) return next.value = t3, next.done = false, next; } return next.done = true, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e2) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e2) for (var r2 in this) "t" === r2.charAt(0) && n.call(this, r2) && !isNaN(+r2.slice(1)) && (this[r2] = t); }, stop: function stop() { this.done = true; var t2 = this.tryEntries[0].completion; if ("throw" === t2.type) throw t2.arg; return this.rval; }, dispatchException: function dispatchException(e2) { if (this.done) throw e2; var r2 = this; function handle(n2, o3) { return a2.type = "throw", a2.arg = e2, r2.next = n2, o3 && (r2.method = "next", r2.arg = t), !!o3; } for (var o2 = this.tryEntries.length - 1; o2 >= 0; --o2) { var i3 = this.tryEntries[o2], a2 = i3.completion; if ("root" === i3.tryLoc) return handle("end"); if (i3.tryLoc <= this.prev) { var c2 = n.call(i3, "catchLoc"), u2 = n.call(i3, "finallyLoc"); if (c2 && u2) { if (this.prev < i3.catchLoc) return handle(i3.catchLoc, true); if (this.prev < i3.finallyLoc) return handle(i3.finallyLoc); } else if (c2) { if (this.prev < i3.catchLoc) return handle(i3.catchLoc, true); } else { if (!u2) throw Error("try statement without catch or finally"); if (this.prev < i3.finallyLoc) return handle(i3.finallyLoc); } } } }, abrupt: function abrupt(t2, e2) { for (var r2 = this.tryEntries.length - 1; r2 >= 0; --r2) { var o2 = this.tryEntries[r2]; if (o2.tryLoc <= this.prev && n.call(o2, "finallyLoc") && this.prev < o2.finallyLoc) { var i3 = o2; break; } } i3 && ("break" === t2 || "continue" === t2) && i3.tryLoc <= e2 && e2 <= i3.finallyLoc && (i3 = null); var a2 = i3 ? i3.completion : {}; return a2.type = t2, a2.arg = e2, i3 ? (this.method = "next", this.next = i3.finallyLoc, y) : this.complete(a2); }, complete: function complete(t2, e2) { if ("throw" === t2.type) throw t2.arg; return "break" === t2.type || "continue" === t2.type ? this.next = t2.arg : "return" === t2.type ? (this.rval = this.arg = t2.arg, this.method = "return", this.next = "end") : "normal" === t2.type && e2 && (this.next = e2), y; }, finish: function finish(t2) { for (var e2 = this.tryEntries.length - 1; e2 >= 0; --e2) { var r2 = this.tryEntries[e2]; if (r2.finallyLoc === t2) return this.complete(r2.completion, r2.afterLoc), resetTryEntry(r2), y; } }, catch: function _catch(t2) { for (var e2 = this.tryEntries.length - 1; e2 >= 0; --e2) { var r2 = this.tryEntries[e2]; if (r2.tryLoc === t2) { var n2 = r2.completion; if ("throw" === n2.type) { var o2 = n2.arg; resetTryEntry(r2); } return o2; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e2, r2, n2) { return this.delegate = { iterator: values(e2), resultName: r2, nextLoc: n2 }, "next" === this.method && (this.arg = t), y; } }, e; } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i2 = n[a](c), u = i2.value; } catch (n2) { return void e(n2); } i2.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function() { var t = this, e = arguments; return new Promise(function(r, o) { var a = n.apply(t, e); function _next(n2) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n2); } function _throw(n2) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n2); } _next(void 0); }); }; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function(r2) { return Object.getOwnPropertyDescriptor(e, r2).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function(r2) { _defineProperty(e, r2, t[r2]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) { Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: false }), e; } function _toPropertyKey(t) { var i2 = _toPrimitive(t, "string"); return "symbol" == typeof i2 ? i2 : i2 + ""; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i2 = e.call(t, r || "default"); if ("object" != typeof i2) return i2; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function(t2) { return p.apply(e, t2); } : p; } function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)); ) ; return t; } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: true, configurable: true } }), Object.defineProperty(t, "prototype", { writable: false }), e && _setPrototypeOf(t, e); } function _wrapNativeSuper(t) { var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper2(t2) { if (null === t2 || !_isNativeFunction(t2)) return t2; if ("function" != typeof t2) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t2)) return r.get(t2); r.set(t2, Wrapper); } function Wrapper() { return _construct(t2, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }), _setPrototypeOf(Wrapper, t2); }, _wrapNativeSuper(t); } function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch (t2) { } return (_isNativeReflectConstruct = function _isNativeReflectConstruct2() { return !!t; })(); } function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) { return t2.__proto__ = e2, t2; }, _setPrototypeOf(t, e); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t2) { return t2.__proto__ || Object.getPrototypeOf(t2); }, _getPrototypeOf(t); } function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); } function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); } function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } function _classPrivateGetter(s, r, a) { return a(_assertClassBrand(s, r)); } function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); } function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; } function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } function _get_pageUrl(_this) { var _this$getAttribute3; return (_this$getAttribute3 = _this.getAttribute("page-url")) !== null && _this$getAttribute3 !== void 0 ? _this$getAttribute3 : (0, _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_32__.H)(); } function _defaultLocalization() { return { alpha3Bibliographic: "eng", alpha3Terminologic: "eng", duration: 0, hashedId: this.mediaId, ietfLanguageTag: "eng", iso6392LanguageCode: "eng", name: "English", nativeName: "English", sourceLanguage: true, timeMappings: [] }; } function _deferMediaDataFetchingToCarouselEmbed() { return !!document.querySelector('wistia-carousel[player-dom-id="'.concat(this.id, '"]:not([is-inside-playlist-embed="true"][channel-id])')); } function _findLocalizationByLanguage(language) { var _classPrivateFieldGet93; if (language == null) { return void 0; } return (_classPrivateFieldGet93 = _classPrivateFieldGet(_playerData, this).mediaData.localizations) === null || _classPrivateFieldGet93 === void 0 ? void 0 : _classPrivateFieldGet93.find(function(localization) { return localization.ietfLanguageTag === language || localization.iso6392LanguageCode === language; }); } function _generateUniqueId(mediaId) { var prefix = "wistia-".concat(mediaId, "-"); return (0, _utilities_seqid_js__WEBPACK_IMPORTED_MODULE_15__.h)(prefix); } function _getSyncedEmbedOption(key) { var _ref20, _ref21; if (_classPrivateFieldGet(_impl, this) && key in _classPrivateFieldGet(_impl, this)._attrs) { return _classPrivateFieldGet(_impl, this)._attrs[key]; } return (_ref20 = (_ref21 = this.embedOptions[key]) !== null && _ref21 !== void 0 ? _ref21 : _assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, (0, _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_30__.$)(key))) !== null && _ref20 !== void 0 ? _ref20 : defaultEmbedOptions[key]; } function _getValueFromAttribute(name) { if (!this.hasAttribute(name)) { return null; } switch (this.getAttribute(name)) { case "true": return true; case "false": return false; case "": return true; case null: default: return this.getAttribute(name); } } function _initPlayerEmbed(_ref22) { var container = _ref22.container, mediaData = _ref22.mediaData; if (!_classPrivateFieldGet(_hasElementConnectedToDOM, this)) { return; } _classPrivateFieldGet(_playerData, this).updateEmbedOptionOverrides({ videoFoam: true }); if (mediaData && !(0, _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_31__.V)(mediaData)) { _classPrivateFieldSet(_playerType, this, (0, _utilities_judy_js__WEBPACK_IMPORTED_MODULE_13__.$F)(_classPrivateFieldGet(_judyContext, this), _classPrivateFieldGet(_playerData, this).mediaData, _classPrivateFieldGet(_playerData, this).embedOptions)); _assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this); _assertClassBrand(_WistiaPlayer_brand, this, _maybeInjectJsonLd).call(this); } if ("attachInternals" in HTMLElement.prototype && "states" in ElementInternals.prototype) { var _classPrivateFieldGet94; (_classPrivateFieldGet94 = _classPrivateFieldGet(_internals, this)) === null || _classPrivateFieldGet94 === void 0 ? void 0 : _classPrivateFieldGet94.states.delete("--initializing"); } void _assertClassBrand(_WistiaPlayer_brand, this, _initPublicApi).call(this, this.mediaId, { container, mediaData }); } function _initPublicApi(_x22, _x23) { return _initPublicApi2.apply(this, arguments); } function _initPublicApi2() { _initPublicApi2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee27(mediaId, options) { var _this19 = this; var embeddedCallback; return _regeneratorRuntime().wrap(function _callee27$(_context27) { while (1) switch (_context27.prev = _context27.next) { case 0: _context27.next = 2; return _classPrivateFieldGet(_publicApiScript, this); case 2: if (_wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_2__.s.PublicApi) { _context27.next = 5; break; } (0, _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_16__.WO)("player/failure/init-failed"); throw new Error("Wistia.PublicApi is not defined"); case 5: embeddedCallback = function embeddedCallback2() { var _classPrivateFieldGet101; void _assertClassBrand(_WistiaPlayer_brand, _this19, _maybeInitializeMux).call(_this19); _assertClassBrand(_WistiaPlayer_brand, _this19, _renderEmbedTemplate).call(_this19); (_classPrivateFieldGet101 = _classPrivateFieldGet(_resizeObserver, _this19)) === null || _classPrivateFieldGet101 === void 0 ? void 0 : _classPrivateFieldGet101.disconnect(); _classPrivateFieldSet(_resizeObserver, _this19, null); if (_classPrivateFieldGet(_playPending, _this19)) { void _this19.play(); } }; this.addEventListener("embedded", embeddedCallback); _classPrivateFieldGet(_removeEventListeners, this).push(function() { _this19.removeEventListener("embedded", embeddedCallback); }); _classPrivateFieldSet(_api, this, new _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_2__.s.PublicApi(mediaId, options)); this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__.kY, _classPrivateFieldGet(_handleBeforeReplace, this)); this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__.$1, _classPrivateFieldGet(_handleAfterReplace, this)); _classPrivateFieldGet(_removeEventListeners, this).push(function() { _this19.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__.kY, _classPrivateFieldGet(_handleBeforeReplace, _this19)); _this19.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__.$1, _classPrivateFieldGet(_handleAfterReplace, _this19)); }); _classPrivateFieldGet(_api, this).ready(function() { var _classPrivateFieldGet102; (_classPrivateFieldGet102 = _classPrivateFieldGet(_preloadThumbnailRoot, _this19)) === null || _classPrivateFieldGet102 === void 0 ? void 0 : _classPrivateFieldGet102.remove(); _this19.removeEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, _this19)); _this19.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__.c5, { detail: { mediaId } })); _this19.dispatchEvent(new CustomEvent(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__.iP, { detail: { mediaId, api: _classPrivateFieldGet(_api, _this19) } })); if (_classPrivateFieldGet(_impl, _this19)) { Object.entries(_classPrivateFieldGet(_impl, _this19)._attrs).forEach(function(_ref28) { var _ref29 = _slicedToArray(_ref28, 2), key = _ref29[0], value = _ref29[1]; _classPrivateFieldGet(_playerData, _this19).updateEmbedOptionOverrides(_defineProperty({}, key, value)); }); } _assertClassBrand(_WistiaPlayer_brand, _this19, _renderPreloadThumbnail).call(_this19); }); case 13: case "end": return _context27.stop(); } }, _callee27, this); })); return _initPublicApi2.apply(this, arguments); } function _isPopoverWithThumbnail() { return this.wistiaPopover && (this.popoverContent === void 0 || this.popoverContent === "" || this.popoverContent === "thumbnail"); } function _maybeInitializeMux() { return _maybeInitializeMux2.apply(this, arguments); } function _maybeInitializeMux2() { _maybeInitializeMux2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee28() { var _this20 = this; var shouldRandomEnableMux, shouldEnableMuxForPlayer, embedType, mux; return _regeneratorRuntime().wrap(function _callee28$(_context28) { while (1) switch (_context28.prev = _context28.next) { case 0: if (_classPrivateFieldGet(_api, this)) { _context28.next = 2; break; } return _context28.abrupt("return"); case 2: shouldRandomEnableMux = (0, _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_33__.k)(_utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_34__._); shouldEnableMuxForPlayer = (0, _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_34__.J)(_classPrivateFieldGet(_api, this), shouldRandomEnableMux) && (0, _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_17__.D5)(); embedType = this.useWebComponent ? "translated-web-component" : "web-component"; if (!shouldEnableMuxForPlayer) { _context28.next = 11; break; } _context28.next = 8; return (0, _utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_8__.$)("assets/external/wistia-mux.js"); case 8: mux = _context28.sent; mux.init(_classPrivateFieldGet(_api, this), { embedType }); this.addEventListener("visitor-tracking-change", function(event) { var isTrackingEnabled = event.detail.isTrackingEnabled; if (!isTrackingEnabled) { var _classPrivateFieldGet104, _classPrivateFieldGet105; (_classPrivateFieldGet104 = _classPrivateFieldGet(_api, _this20)) === null || _classPrivateFieldGet104 === void 0 ? void 0 : (_classPrivateFieldGet105 = _classPrivateFieldGet104.mux) === null || _classPrivateFieldGet105 === void 0 ? void 0 : _classPrivateFieldGet105.destroy(); } }); case 11: case "end": return _context28.stop(); } }, _callee28, this); })); return _maybeInitializeMux2.apply(this, arguments); } function _maybeInjectJsonLd() { if (this.seo && _classPrivateFieldGet(_playerType, this) !== "notplayable" && _classPrivateFieldGet(_playerType, this) !== "passwordprotected" && _classPrivateFieldGet(_playerType, this) !== "carouselHardWall") { _classPrivateFieldSet(_jsonLdId, this, "w-json-ld-".concat(this.uniqueId)); (0, _utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_23__.Z)(_classPrivateFieldGet(_jsonLdId, this)); (0, _utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_23__.g)(_classPrivateFieldGet(_jsonLdId, this), _classPrivateFieldGet(_playerData, this).mediaData, { embedOptions: _classPrivateFieldGet(_playerData, this).embedOptions, videoHeight: this.offsetHeight, videoWidth: this.offsetWidth }); } } function _maybeSetupEmbedOptionsFromIframe() { if (!window._inWistiaIframe) { return; } var searchParams = new URLSearchParams(window.location.search); var iframeEmbedOptions = Object.fromEntries(searchParams.entries()); iframeEmbedOptions.pageTitle = document.title; iframeEmbedOptions._inIframe = true; _classPrivateFieldGet(_playerData, this).setIframeEmbedOptionSource(iframeEmbedOptions); } function _renderEmbedTemplate() { var _this$embedHost2, _this14 = this; if (!_classPrivateFieldGet(_preactRoot, this)) { return; } var mediaType = _classPrivateFieldGet(_playerData, this).mediaData.mediaType; var swatchUrl2 = getSwatchUrl(this.mediaId, (_this$embedHost2 = this.embedHost) !== null && _this$embedHost2 !== void 0 ? _this$embedHost2 : ""); var swatchHeight = "100%"; if (parseFloat(_classPrivateFieldGet(_paddingTop, this)) !== 0 && _classPrivateFieldGet(_paddingTop, this) !== "") { swatchHeight = "".concat(parseFloat(_classPrivateFieldGet(_paddingTop, this)), "px"); } var playerBorderRadius = (0, _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_35__.JA)({ playerBorderRadius: this.playerBorderRadius, roundedPlayer: this.roundedPlayer }); (0, preact__WEBPACK_IMPORTED_MODULE_0__.XX)((0, preact__WEBPACK_IMPORTED_MODULE_0__.h)(preact__WEBPACK_IMPORTED_MODULE_0__.FK, null, (0, preact__WEBPACK_IMPORTED_MODULE_0__.h)("style", null, ":host {\n display: flex;\n position: relative;\n width: 100%;\n ".concat(mediaType === "Audio" ? "min-height: 45px;" : "", "\n }")), _assertClassBrand(_WistiaPlayer_brand, this, _shouldDisplaySwatch).call(this) && (0, preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { style: { height: swatchHeight, left: 0, position: "absolute", top: 0, width: "100%" }, class: "wistia_swatch" }, (0, preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { style: { height: "100%", position: "relative", width: "100%" } }, (0, preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { style: { height: "100%", left: 0, overflow: "hidden", position: "absolute", top: 0, width: "100%", borderRadius: "".concat(playerBorderRadius, "px") } }, (0, preact__WEBPACK_IMPORTED_MODULE_0__.h)("img", { src: swatchUrl2, style: { filter: "blur(5px)", height: "100%", objectFit: "contain", width: "100%" }, alt: "", "aria-hidden": "true" })))), (0, preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { ref: function ref(_ref23) { _classPrivateFieldSet(_preloadThumbnailRoot, _this14, _ref23); } })), _classPrivateFieldGet(_preactRoot, this)); } function _renderPreloadThumbnail() { var _this$playerForce; if (!_classPrivateFieldGet(_preloadThumbnailRoot, this)) { return; } var _classPrivateFieldGet95 = _classPrivateFieldGet(_playerData, this).mediaData, assets = _classPrivateFieldGet95.assets, mediaType = _classPrivateFieldGet95.mediaType, carouselHardWall = _classPrivateFieldGet95.carouselHardWall; var _classPrivateFieldGet96 = _classPrivateFieldGet(_playerData, this).embedOptions, autoPlay = _classPrivateFieldGet96.autoPlay, plugin = _classPrivateFieldGet96.plugin; if (carouselHardWall) { return; } var thumbnailAssets = (0, _utilities_assets_js__WEBPACK_IMPORTED_MODULE_6__.Q0)(assets, {}); var willAutoplay = this.autoplay || autoPlay; var hasVideoThumbnail = (plugin === null || plugin === void 0 ? void 0 : plugin.videoThumbnail) !== void 0; var shouldRenderThumbnail = (!this.wistiaPopover || _assertClassBrand(_WistiaPlayer_brand, this, _isPopoverWithThumbnail).call(this)) && mediaType !== "Audio" && thumbnailAssets.length > 0 && !willAutoplay && !hasVideoThumbnail; if (!shouldRenderThumbnail) { return; } (0, preact__WEBPACK_IMPORTED_MODULE_0__.XX)((0, preact__WEBPACK_IMPORTED_MODULE_0__.h)(_hooks_usePlayerData_tsx__WEBPACK_IMPORTED_MODULE_4__.z, { embedOptions: _classPrivateFieldGet(_playerData, this).embedOptions, mediaData: _classPrivateFieldGet(_playerData, this).mediaData }, (0, preact__WEBPACK_IMPORTED_MODULE_0__.h)(_components_PreloadThumbnail_tsx__WEBPACK_IMPORTED_MODULE_3__.u, { mediaId: this.mediaId, playerType: (_this$playerForce = this.playerForce) !== null && _this$playerForce !== void 0 ? _this$playerForce : _classPrivateFieldGet(_playerType, this), playerWidth: this.offsetWidth, isPlayPending: _classPrivateFieldGet(_playPending, this) })), _classPrivateFieldGet(_preloadThumbnailRoot, this)); } function _runMethodsFromAttributes() { var _this15 = this; if (_assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, "current-time") !== null) { this.whenApiReady().then(function() { var _ref24, _classPrivateFieldGet97, _classPrivateFieldGet98; var newTime = Number(_assertClassBrand(_WistiaPlayer_brand, _this15, _getValueFromAttribute).call(_this15, "current-time")); var isClosedPopover = (_ref24 = ((_classPrivateFieldGet97 = _classPrivateFieldGet(_api, _this15)) === null || _classPrivateFieldGet97 === void 0 ? void 0 : _classPrivateFieldGet97.popover) && !_classPrivateFieldGet(_api, _this15).popover.isVisible()) !== null && _ref24 !== void 0 ? _ref24 : false; var isMobile = (0, _utilities_detect_js__WEBPACK_IMPORTED_MODULE_7__.GS)(); var shouldDelayUntilPlay = _this15.state !== "playing" && (isMobile || isClosedPopover); void ((_classPrivateFieldGet98 = _classPrivateFieldGet(_impl, _this15)) === null || _classPrivateFieldGet98 === void 0 ? void 0 : _classPrivateFieldGet98.time(newTime, { lazy: shouldDelayUntilPlay })); _assertClassBrand(_WistiaPlayer_brand, _this15, _setSyncedEmbedOption).call(_this15, "currentTime", newTime); }).catch(function(_error) { }); } if (_assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, "email") !== null) { _assertClassBrand(_WistiaPlayer_brand, this, _updateEmail).call(this, _assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, "email")); } if (_assertClassBrand(_WistiaPlayer_brand, this, _getValueFromAttribute).call(this, "video-quality") !== null) { this.whenApiReady().then(function() { var _classPrivateFieldGet99; var newQuality = _assertClassBrand(_WistiaPlayer_brand, _this15, _getValueFromAttribute).call(_this15, "video-quality"); (_classPrivateFieldGet99 = _classPrivateFieldGet(_impl, _this15)) === null || _classPrivateFieldGet99 === void 0 ? void 0 : _classPrivateFieldGet99.setVideoQuality(newQuality); _assertClassBrand(_WistiaPlayer_brand, _this15, _setSyncedEmbedOption).call(_this15, "videoQuality", newQuality); }).catch(function(_error) { }); } } function _saveInitialAttributesFromDomOptions() { var _this16 = this; var domOptions = Object.fromEntries(Object.entries(this.attributes).map(function(_ref25) { var _ref26 = _slicedToArray(_ref25, 2), value = _ref26[1]; return [(0, _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_30__.b)(value.name), _assertClassBrand(_WistiaPlayer_brand, _this16, _getValueFromAttribute).call(_this16, value.name)]; })); _classPrivateFieldGet(_playerData, this).setDomEmbedOptionSource(domOptions); (0, _utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_9__.gY)("__".concat(this.uniqueId, "_dom_options__"), _classPrivateFieldGet(_playerData, this).embedOptions); } function _setSyncedEmbedOption(key, value) { _classPrivateFieldGet(_logger, this).info("set ".concat(key), value.toString()); if (_classPrivateFieldGet(_impl, this)) { _classPrivateFieldGet(_impl, this)._attrs[key] = value; } _classPrivateFieldGet(_playerData, this).updateEmbedOptionOverrides(_defineProperty({}, key, value)); _assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this); } function _setupEventListeners() { var _this17 = this; var loadedMediaDataCallback = function loadedMediaDataCallback2(event) { var _ref27 = event.detail, mediaData = _ref27.mediaData; _assertClassBrand(_WistiaPlayer_brand, _this17, _updateMediaData).call(_this17, mediaData); }; var implCreatedCallback = function implCreatedCallback2(event) { _classPrivateFieldSet(_impl, _this17, event.detail.impl); }; this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__.rO, loadedMediaDataCallback); this.addEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__.dp, implCreatedCallback); _classPrivateFieldGet(_removeEventListeners, this).push(function() { _this17.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__.rO, loadedMediaDataCallback); }, function() { _this17.removeEventListener(_utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__.dp, implCreatedCallback); }); this.addEventListener("click", _classPrivateFieldGet(_handlePreloadThumbnailClick, this), { once: true }); } function _shouldDisplaySwatch() { return this.swatch !== false && (!this.wistiaPopover || _assertClassBrand(_WistiaPlayer_brand, this, _isPopoverWithThumbnail).call(this)); } function _updateEmail(email) { var _this18 = this; (0, _utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_19__.$B)(function(localStorage2) { localStorage2[_classPrivateGetter(_WistiaPlayer_brand, _this18, _get_pageUrl)] = _objectSpread(_objectSpread({}, localStorage2[_classPrivateGetter(_WistiaPlayer_brand, _this18, _get_pageUrl)]), {}, { trackEmail: email }); }); this.dispatchEvent(new CustomEvent("emailchange", { detail: { email } })); } function _updateMediaData(mediaData) { _classPrivateFieldGet(_playerData, this).setMediaDataSource(mediaData); _classPrivateFieldSet(_playerType, this, (0, _utilities_judy_js__WEBPACK_IMPORTED_MODULE_13__.$F)(_classPrivateFieldGet(_judyContext, this), _classPrivateFieldGet(_playerData, this).mediaData, _classPrivateFieldGet(_playerData, this).embedOptions)); _assertClassBrand(_WistiaPlayer_brand, this, _renderPreloadThumbnail).call(this); } var __webpack_modules__, __webpack_module_cache__, __webpack_exports__2, preact__WEBPACK_IMPORTED_MODULE_0__, _utilities_gradients_ts__WEBPACK_IMPORTED_MODULE_1__, _wistia_namespace_ts__WEBPACK_IMPORTED_MODULE_2__, _components_PreloadThumbnail_tsx__WEBPACK_IMPORTED_MODULE_3__, _hooks_usePlayerData_tsx__WEBPACK_IMPORTED_MODULE_4__, _utilities_constants_ts__WEBPACK_IMPORTED_MODULE_27__, _utilities_PlayerDataHandler_ts__WEBPACK_IMPORTED_MODULE_5__, _appHostname_js__WEBPACK_IMPORTED_MODULE_26__, _utilities_assets_js__WEBPACK_IMPORTED_MODULE_6__, _utilities_coinFlip_ts__WEBPACK_IMPORTED_MODULE_33__, _utilities_detect_js__WEBPACK_IMPORTED_MODULE_7__, _utilities_dynamicImport_ts__WEBPACK_IMPORTED_MODULE_8__, _utilities_embedOptionStore_ts__WEBPACK_IMPORTED_MODULE_9__, _utilities_elem_js__WEBPACK_IMPORTED_MODULE_10__, _utilities_eventConstants_ts__WEBPACK_IMPORTED_MODULE_29__, _utilities_extractEmailFromParams_ts__WEBPACK_IMPORTED_MODULE_11__, _utilities_hosts_js__WEBPACK_IMPORTED_MODULE_12__, _utilities_inferPageUrl_ts__WEBPACK_IMPORTED_MODULE_32__, _utilities_judy_js__WEBPACK_IMPORTED_MODULE_13__, _utilities_roundedPlayerDefaults_ts__WEBPACK_IMPORTED_MODULE_35__, _utilities_runScript_js__WEBPACK_IMPORTED_MODULE_14__, _utilities_seqid_js__WEBPACK_IMPORTED_MODULE_15__, _utilities_shouldEnableMux_ts__WEBPACK_IMPORTED_MODULE_34__, _utilities_simpleMetrics_js__WEBPACK_IMPORTED_MODULE_16__, _utilities_trackingConsentApi_js__WEBPACK_IMPORTED_MODULE_17__, _utilities_url_js__WEBPACK_IMPORTED_MODULE_18__, _utilities_wistiaLocalStorage_js__WEBPACK_IMPORTED_MODULE_19__, _utilities_wistiaOptions_ts__WEBPACK_IMPORTED_MODULE_20__, _utilities_wistiaQueue_ts__WEBPACK_IMPORTED_MODULE_21__, _utilities_wlog_js__WEBPACK_IMPORTED_MODULE_22__, _utilities_injectJsonLd_js__WEBPACK_IMPORTED_MODULE_23__, _utilities_getInitialMediaData_ts__WEBPACK_IMPORTED_MODULE_24__, _utilities_mediaDataError_ts__WEBPACK_IMPORTED_MODULE_31__, _utilities_remote_data_cache_ts__WEBPACK_IMPORTED_MODULE_25__, _utilities_camelCaseToKebabCase_ts__WEBPACK_IMPORTED_MODULE_30__, _types_gradient_ts__WEBPACK_IMPORTED_MODULE_28__, _WistiaPlayer, requiredAttributes, optionalPublicAttributes, optionalPrivateAttributes, defaultEmbedOptions, getSwatchUrl, _api, _eventListeners, _fullscreenState, _impl, _internals, _jsonLdId, _judyContext, _logger, _oldEngine, _playerData, _playerType, _removeEventListeners, _cachedRemapTime, _hasElementConnectedToDOM, _paddingTop, _playPending, _preactRoot, _preloadThumbnailRoot, _publicApiScript, _resizeObserver, _WistiaPlayer_brand, _handleAfterReplace, _handleBeforeReplace, _handlePreloadThumbnailClick, WistiaPlayer, getSwatchMetaData2, wistiaSwatchElement, __webpack_exports__WistiaPlayer, __webpack_exports__wistiaSwatchElement; var init_wistia_player = __esm({ "../wistia-player/dist/wistia-player.js"() { __webpack_modules__ = { /***/ 159: ( /***/ (__unused_webpack___webpack_module__2, __webpack_exports__3, __webpack_require__3) => { __webpack_require__3.d(__webpack_exports__3, { /* harmony export */ Rb: () => ( /* binding */ findScriptInDomBySrc ) /* harmony export */ }); var utilities_wlog_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__3(6637); var utilities_obj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__3(731); var utilities_runScript_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__3(1248); function ownKeys2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function(r2) { return Object.getOwnPropertyDescriptor(e, r2).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys2(Object(t), true).forEach(function(r2) { _defineProperty2(e, r2, t[r2]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys2(Object(t)).forEach(function(r2) { Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2)); }); } return e; } function _defineProperty2(e, r, t) { return (r = _toPropertyKey2(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; } function _toPropertyKey2(t) { var i2 = _toPrimitive2(t, "string"); return "symbol" == typeof i2 ? i2 : i2 + ""; } function _toPrimitive2(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i2 = e.call(t, r || "default"); if ("object" != typeof i2) return i2; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var findScriptInDomBySrc = function findScriptInDomBySrc2(targetSrc) { var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; var scriptTags2 = document.getElementsByTagName("script"); for (var i2 = 0; i2 < scriptTags2.length; i2++) { var s = scriptTags2[i2]; var src2 = s.getAttribute("src") || "";